From owner-svn-src-head@freebsd.org Sun Mar 11 00:38:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4686F45367; Sun, 11 Mar 2018 00:38:09 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 668FB6E2DD; Sun, 11 Mar 2018 00:38:09 +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 477C015334; Sun, 11 Mar 2018 00:38:09 +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 w2B0c99q073387; Sun, 11 Mar 2018 00:38:09 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2B0c9vC073386; Sun, 11 Mar 2018 00:38:09 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201803110038.w2B0c9vC073386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 11 Mar 2018 00:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330753 - head/sys/dev/otus X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/otus X-SVN-Commit-Revision: 330753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 00:38:09 -0000 Author: avos Date: Sun Mar 11 00:38:08 2018 New Revision: 330753 URL: https://svnweb.freebsd.org/changeset/base/330753 Log: otus(4): check mcast / mgt / ucast rates during Tx descriptor setup These parameters may be changed via ifconfig(8); by default, mgt / mcast rates are lowest possible and ucast rate is not set (matches previous configuration). While here, store some variables locally for better readability. Modified: head/sys/dev/otus/if_otus.c Modified: head/sys/dev/otus/if_otus.c ============================================================================== --- head/sys/dev/otus/if_otus.c Sun Mar 11 00:08:09 2018 (r330752) +++ head/sys/dev/otus/if_otus.c Sun Mar 11 00:38:08 2018 (r330753) @@ -2182,6 +2182,7 @@ static int otus_tx(struct otus_softc *sc, struct ieee80211_node *ni, struct mbuf *m, struct otus_data *data, const struct ieee80211_bpf_params *params) { + const struct ieee80211_txparam *tp = ni->ni_txparms; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_frame *wh; @@ -2190,7 +2191,7 @@ otus_tx(struct otus_softc *sc, struct ieee80211_node * uint32_t phyctl; uint16_t macctl, qos; uint8_t qid, rate; - int hasqos, xferlen; + int hasqos, xferlen, type, ismcast; wh = mtod(m, struct ieee80211_frame *); if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { @@ -2228,17 +2229,19 @@ otus_tx(struct otus_softc *sc, struct ieee80211_node * qid = WME_AC_BE; } + type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; + ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); + /* Pickup a rate index. */ - if (params != NULL) { + if (params != NULL) rate = otus_rate_to_hw_rate(sc, params->ibp_rate0); - } else if (m->m_flags & M_EAPOL) { - /* Get lowest rate */ - rate = otus_rate_to_hw_rate(sc, 0); - } else if (IEEE80211_IS_MULTICAST(wh->i_addr1) || - (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) != IEEE80211_FC0_TYPE_DATA) { - /* Get lowest rate */ - rate = otus_rate_to_hw_rate(sc, 0); - } else { + else if (!!(m->m_flags & M_EAPOL) || type != IEEE80211_FC0_TYPE_DATA) + rate = otus_rate_to_hw_rate(sc, tp->mgmtrate); + else if (ismcast) + rate = otus_rate_to_hw_rate(sc, tp->mcastrate); + else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) + rate = otus_rate_to_hw_rate(sc, tp->ucastrate); + else { (void) ieee80211_ratectl_rate(ni, NULL, 0); rate = otus_rate_to_hw_rate(sc, ni->ni_txrate); } @@ -2249,12 +2252,12 @@ otus_tx(struct otus_softc *sc, struct ieee80211_node * /* * XXX TODO: params for NOACK, ACK, RTS, CTS, etc */ - if (IEEE80211_IS_MULTICAST(wh->i_addr1) || + if (ismcast || (hasqos && ((qos & IEEE80211_QOS_ACKPOLICY) == IEEE80211_QOS_ACKPOLICY_NOACK))) macctl |= AR_TX_MAC_NOACK; - if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { + if (!ismcast) { if (m->m_pkthdr.len + IEEE80211_CRC_LEN >= vap->iv_rtsthreshold) macctl |= AR_TX_MAC_RTS; else if (ic->ic_flags & IEEE80211_F_USEPROT) { From owner-svn-src-head@freebsd.org Sun Mar 11 01:09:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 636BAF479A9; Sun, 11 Mar 2018 01:09:32 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17BA36F7AE; Sun, 11 Mar 2018 01:09:32 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11DBF1580A; Sun, 11 Mar 2018 01:09:32 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2B19VaE088241; Sun, 11 Mar 2018 01:09:31 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2B19V9c088240; Sun, 11 Mar 2018 01:09:31 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201803110109.w2B19V9c088240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 11 Mar 2018 01:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330754 - head/sys/powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/ofw X-SVN-Commit-Revision: 330754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 01:09:32 -0000 Author: nwhitehorn Date: Sun Mar 11 01:09:31 2018 New Revision: 330754 URL: https://svnweb.freebsd.org/changeset/base/330754 Log: Make FDT-using parts of ofw_machdep.c condition on options FDT. This fixes the kernel build when options FDT is absent. Modified: head/sys/powerpc/ofw/ofw_machdep.c Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Sun Mar 11 00:38:08 2018 (r330753) +++ head/sys/powerpc/ofw/ofw_machdep.c Sun Mar 11 01:09:31 2018 (r330754) @@ -223,6 +223,7 @@ parse_ofw_memory(phandle_t node, const char *prop, str return (sz); } +#ifdef FDT static int excise_fdt_reserved(struct mem_region *avail, int asz) { @@ -310,6 +311,7 @@ excise_fdt_reserved(struct mem_region *avail, int asz) return (asz); } +#endif /* * This is called during powerpc_init, before the system is really initialized. @@ -348,9 +350,11 @@ ofw_mem_regions(struct mem_region *memp, int *memsz, asz += res/sizeof(struct mem_region); } +#ifdef FDT phandle = OF_finddevice("/chosen"); if (OF_hasprop(phandle, "fdtmemreserv")) asz = excise_fdt_reserved(availp, asz); +#endif *memsz = msz; *availsz = asz; @@ -409,6 +413,7 @@ OF_bootstrap() } else #endif if (fdt != NULL) { +#ifdef FDT #ifdef AIM bus_space_tag_t fdt_bt; vm_offset_t tmp_fdt_ptr; @@ -445,6 +450,7 @@ OF_bootstrap() err = OF_init((void *)fdt_va); #else err = OF_init(fdt); +#endif #endif } From owner-svn-src-head@freebsd.org Sun Mar 11 05:09:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1597BF2CF21; Sun, 11 Mar 2018 05:09:03 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B27F2784F7; Sun, 11 Mar 2018 05:09:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA25918C6C; Sun, 11 Mar 2018 05:09:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2B592Hs008521; Sun, 11 Mar 2018 05:09:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2B5928t008519; Sun, 11 Mar 2018 05:09:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201803110509.w2B5928t008519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 11 Mar 2018 05:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330759 - in head: sbin/nvmecontrol sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: sbin/nvmecontrol sys/dev/nvme X-SVN-Commit-Revision: 330759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 05:09:03 -0000 Author: mav Date: Sun Mar 11 05:09:02 2018 New Revision: 330759 URL: https://svnweb.freebsd.org/changeset/base/330759 Log: Add new identify data structures fields from NVMe 1.3a. Some of them are already supported by existing hardware, so reporting them `nvmecontrol identify` can be useful. Modified: head/sbin/nvmecontrol/identify.c head/sys/dev/nvme/nvme.h Modified: head/sbin/nvmecontrol/identify.c ============================================================================== --- head/sbin/nvmecontrol/identify.c Sun Mar 11 04:37:05 2018 (r330758) +++ head/sbin/nvmecontrol/identify.c Sun Mar 11 05:09:02 2018 (r330759) @@ -95,25 +95,35 @@ print_controller(struct nvme_controller_data *cdata) printf("Controller Capabilities/Features\n"); printf("================================\n"); - printf("Vendor ID: %04x\n", cdata->vid); - printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); + printf("Vendor ID: %04x\n", cdata->vid); + printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); nvme_strvis(str, cdata->sn, sizeof(str), NVME_SERIAL_NUMBER_LENGTH); - printf("Serial Number: %s\n", str); + printf("Serial Number: %s\n", str); nvme_strvis(str, cdata->mn, sizeof(str), NVME_MODEL_NUMBER_LENGTH); - printf("Model Number: %s\n", str); + printf("Model Number: %s\n", str); nvme_strvis(str, cdata->fr, sizeof(str), NVME_FIRMWARE_REVISION_LENGTH); - printf("Firmware Version: %s\n", str); - printf("Recommended Arb Burst: %d\n", cdata->rab); - printf("IEEE OUI Identifier: %02x %02x %02x\n", + printf("Firmware Version: %s\n", str); + printf("Recommended Arb Burst: %d\n", cdata->rab); + printf("IEEE OUI Identifier: %02x %02x %02x\n", cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]); - printf("Multi-Interface Cap: %02x\n", cdata->mic); + printf("Multi-Path I/O Capabilities: %s%s%s%s\n", + (cdata->mic == 0) ? "Not Supported" : "", + ((cdata->mic >> NVME_CTRLR_DATA_MIC_SRIOVVF_SHIFT) & + NVME_CTRLR_DATA_MIC_SRIOVVF_MASK) ? "SR-IOV VF, " : "", + ((cdata->mic >> NVME_CTRLR_DATA_MIC_MCTRLRS_SHIFT) & + NVME_CTRLR_DATA_MIC_MCTRLRS_MASK) ? "Multiple controllers, " : "", + ((cdata->mic >> NVME_CTRLR_DATA_MIC_MPORTS_SHIFT) & + NVME_CTRLR_DATA_MIC_MPORTS_MASK) ? "Multiple ports" : ""); /* TODO: Use CAP.MPSMIN to determine true memory page size. */ - printf("Max Data Transfer Size: "); + printf("Max Data Transfer Size: "); if (cdata->mdts == 0) printf("Unlimited\n"); else printf("%d\n", PAGE_SIZE * (1 << cdata->mdts)); - printf("Controller ID: 0x%02x\n", cdata->ctrlr_id); + printf("Controller ID: 0x%02x\n", cdata->ctrlr_id); + printf("Version: %d.%d.%d\n", + (cdata->ver >> 16) & 0xffff, (cdata->ver >> 8) & 0xff, + cdata->ver & 0xff); printf("\n"); printf("Admin Command Set Attributes\n"); @@ -126,6 +136,21 @@ print_controller(struct nvme_controller_data *cdata) fw ? "Supported" : "Not Supported"); printf("Namespace Managment: %s\n", nsmgmt ? "Supported" : "Not Supported"); + printf("Device Self-test: %sSupported\n", + ((oacs >> NVME_CTRLR_DATA_OACS_SELFTEST_SHIFT) & + NVME_CTRLR_DATA_OACS_SELFTEST_MASK) ? "" : "Not "); + printf("Directives: %sSupported\n", + ((oacs >> NVME_CTRLR_DATA_OACS_DIRECTIVES_SHIFT) & + NVME_CTRLR_DATA_OACS_DIRECTIVES_MASK) ? "" : "Not "); + printf("NVMe-MI Send/Receive: %sSupported\n", + ((oacs >> NVME_CTRLR_DATA_OACS_NVMEMI_SHIFT) & + NVME_CTRLR_DATA_OACS_NVMEMI_MASK) ? "" : "Not "); + printf("Virtualization Management: %sSupported\n", + ((oacs >> NVME_CTRLR_DATA_OACS_VM_SHIFT) & + NVME_CTRLR_DATA_OACS_VM_MASK) ? "" : "Not "); + printf("Doorbell Buffer Config %sSupported\n", + ((oacs >> NVME_CTRLR_DATA_OACS_DBBUFFER_SHIFT) & + NVME_CTRLR_DATA_OACS_DBBUFFER_MASK) ? "" : "Not "); printf("Abort Command Limit: %d\n", cdata->acl+1); printf("Async Event Request Limit: %d\n", cdata->aerl+1); printf("Number of Firmware Slots: "); @@ -159,6 +184,18 @@ print_controller(struct nvme_controller_data *cdata) write_unc ? "Supported" : "Not Supported"); printf("Dataset Management Command: %s\n", dsm ? "Supported" : "Not Supported"); + printf("Write Zeroes Command: %sSupported\n", + ((oncs >> NVME_CTRLR_DATA_ONCS_WRZERO_SHIFT) & + NVME_CTRLR_DATA_ONCS_WRZERO_MASK) ? "" : "Not "); + printf("Save Features: %sSupported\n", + ((oncs >> NVME_CTRLR_DATA_ONCS_SAVEFEAT_SHIFT) & + NVME_CTRLR_DATA_ONCS_SAVEFEAT_MASK) ? "" : "Not "); + printf("Reservations: %sSupported\n", + ((oncs >> NVME_CTRLR_DATA_ONCS_RESERV_SHIFT) & + NVME_CTRLR_DATA_ONCS_RESERV_MASK) ? "" : "Not "); + printf("Timestamp feature: %sSupported\n", + ((oncs >> NVME_CTRLR_DATA_ONCS_TIMESTAMP_SHIFT) & + NVME_CTRLR_DATA_ONCS_TIMESTAMP_MASK) ? "" : "Not "); printf("Volatile Write Cache: %s\n", vwc_present ? "Present" : "Not Present"); @@ -177,8 +214,8 @@ static void print_namespace(struct nvme_namespace_data *nsdata) { uint32_t i; - uint32_t lbaf, lbads, ms; - uint8_t thin_prov; + uint32_t lbaf, lbads, ms, rp; + uint8_t thin_prov, ptype; uint8_t flbas_fmt; thin_prov = (nsdata->nsfeat >> NVME_NS_DATA_NSFEAT_THIN_PROV_SHIFT) & @@ -200,14 +237,79 @@ print_namespace(struct nvme_namespace_data *nsdata) thin_prov ? "Supported" : "Not Supported"); printf("Number of LBA Formats: %d\n", nsdata->nlbaf+1); printf("Current LBA Format: LBA Format #%02d\n", flbas_fmt); + printf("Data Protection Caps: %s%s%s%s%s%s\n", + (nsdata->dpc == 0) ? "Not Supported" : "", + ((nsdata->dpc >> NVME_NS_DATA_DPC_MD_END_SHIFT) & + NVME_NS_DATA_DPC_MD_END_MASK) ? "Last Bytes, " : "", + ((nsdata->dpc >> NVME_NS_DATA_DPC_MD_START_SHIFT) & + NVME_NS_DATA_DPC_MD_START_MASK) ? "First Bytes, " : "", + ((nsdata->dpc >> NVME_NS_DATA_DPC_PIT3_SHIFT) & + NVME_NS_DATA_DPC_PIT3_MASK) ? "Type 3, " : "", + ((nsdata->dpc >> NVME_NS_DATA_DPC_PIT2_SHIFT) & + NVME_NS_DATA_DPC_PIT2_MASK) ? "Type 2, " : "", + ((nsdata->dpc >> NVME_NS_DATA_DPC_PIT2_MASK) & + NVME_NS_DATA_DPC_PIT1_MASK) ? "Type 1" : ""); + printf("Data Protection Settings: "); + ptype = (nsdata->dps >> NVME_NS_DATA_DPS_PIT_SHIFT) & + NVME_NS_DATA_DPS_PIT_MASK; + if (ptype) { + printf("Type %d, %s Bytes\n", ptype, + ((nsdata->dps >> NVME_NS_DATA_DPS_MD_START_SHIFT) & + NVME_NS_DATA_DPS_MD_START_MASK) ? "First" : "Last"); + } else { + printf("Not Enabled\n"); + } + printf("Multi-Path I/O Capabilities: %s%s\n", + (nsdata->nmic == 0) ? "Not Supported" : "", + ((nsdata->nmic >> NVME_NS_DATA_NMIC_MAY_BE_SHARED_SHIFT) & + NVME_NS_DATA_NMIC_MAY_BE_SHARED_MASK) ? "May be shared" : ""); + printf("Reservation Capabilities: %s%s%s%s%s%s%s%s%s\n", + (nsdata->rescap == 0) ? "Not Supported" : "", + ((nsdata->rescap >> NVME_NS_DATA_RESCAP_IEKEY13_SHIFT) & + NVME_NS_DATA_RESCAP_IEKEY13_MASK) ? "IEKEY13, " : "", + ((nsdata->rescap >> NVME_NS_DATA_RESCAP_EX_AC_AR_SHIFT) & + NVME_NS_DATA_RESCAP_EX_AC_AR_MASK) ? "EX_AC_AR, " : "", + ((nsdata->rescap >> NVME_NS_DATA_RESCAP_WR_EX_AR_SHIFT) & + NVME_NS_DATA_RESCAP_WR_EX_AR_MASK) ? "WR_EX_AR, " : "", + ((nsdata->rescap >> NVME_NS_DATA_RESCAP_EX_AC_RO_SHIFT) & + NVME_NS_DATA_RESCAP_EX_AC_RO_MASK) ? "EX_AC_RO, " : "", + ((nsdata->rescap >> NVME_NS_DATA_RESCAP_WR_EX_RO_SHIFT) & + NVME_NS_DATA_RESCAP_WR_EX_RO_MASK) ? "WR_EX_RO, " : "", + ((nsdata->rescap >> NVME_NS_DATA_RESCAP_EX_AC_SHIFT) & + NVME_NS_DATA_RESCAP_EX_AC_MASK) ? "EX_AC, " : "", + ((nsdata->rescap >> NVME_NS_DATA_RESCAP_WR_EX_SHIFT) & + NVME_NS_DATA_RESCAP_WR_EX_MASK) ? "WR_EX, " : "", + ((nsdata->rescap >> NVME_NS_DATA_RESCAP_PTPL_SHIFT) & + NVME_NS_DATA_RESCAP_PTPL_MASK) ? "PTPL" : ""); + printf("Format Progress Indicator: "); + if ((nsdata->fpi >> NVME_NS_DATA_FPI_SUPP_SHIFT) & + NVME_NS_DATA_FPI_SUPP_MASK) { + printf("%u%% remains\n", + (nsdata->fpi >> NVME_NS_DATA_FPI_PERC_SHIFT) & + NVME_NS_DATA_FPI_PERC_MASK); + } else + printf("Not Supported\n"); + printf("Optimal I/O Boundary (LBAs): %u\n", nsdata->noiob); + printf("Globally Unique Identifier: "); + for (i = 0; i < sizeof(nsdata->nguid); i++) + printf("%02x", nsdata->nguid[i]); + printf("\n"); + printf("IEEE EUI64: "); + for (i = 0; i < sizeof(nsdata->eui64); i++) + printf("%02x", nsdata->eui64[i]); + printf("\n"); for (i = 0; i <= nsdata->nlbaf; i++) { lbaf = nsdata->lbaf[i]; lbads = (lbaf >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & NVME_NS_DATA_LBAF_LBADS_MASK; ms = (lbaf >> NVME_NS_DATA_LBAF_MS_SHIFT) & NVME_NS_DATA_LBAF_MS_MASK; - printf("LBA Format #%02d: Data Size: %5d Metadata Size: %5d\n", - i, 1 << lbads, ms); + rp = (lbaf >> NVME_NS_DATA_LBAF_RP_SHIFT) & + NVME_NS_DATA_LBAF_RP_MASK; + printf("LBA Format #%02d: Data Size: %5d Metadata Size: %5d" + " Performance: %s\n", + i, 1 << lbads, ms, (rp == 0) ? "Best" : + (rp == 1) ? "Better" : (rp == 2) ? "Good" : "Degraded"); } } @@ -252,7 +354,7 @@ identify_ctrlr(int argc, char *argv[]) hexlength = sizeof(struct nvme_controller_data); else hexlength = offsetof(struct nvme_controller_data, - reserved5); + reserved8); print_hex(&cdata, hexlength); exit(0); } Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Sun Mar 11 04:37:05 2018 (r330758) +++ head/sys/dev/nvme/nvme.h Sun Mar 11 05:09:02 2018 (r330759) @@ -153,6 +153,17 @@ #define NVME_PWR_ST_APS_SHIFT (6) #define NVME_PWR_ST_APS_MASK (0x3) +/** Controller Multi-path I/O and Namespace Sharing Capabilities */ +/* More then one port */ +#define NVME_CTRLR_DATA_MIC_MPORTS_SHIFT (0) +#define NVME_CTRLR_DATA_MIC_MPORTS_MASK (0x1) +/* More then one controller */ +#define NVME_CTRLR_DATA_MIC_MCTRLRS_SHIFT (1) +#define NVME_CTRLR_DATA_MIC_MCTRLRS_MASK (0x1) +/* SR-IOV Virtual Function */ +#define NVME_CTRLR_DATA_MIC_SRIOVVF_SHIFT (2) +#define NVME_CTRLR_DATA_MIC_SRIOVVF_MASK (0x1) + /** OACS - optional admin command support */ /* supports security send/receive commands */ #define NVME_CTRLR_DATA_OACS_SECURITY_SHIFT (0) @@ -166,6 +177,21 @@ /* supports namespace management commands */ #define NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT (3) #define NVME_CTRLR_DATA_OACS_NSMGMT_MASK (0x1) +/* supports Device Self-test command */ +#define NVME_CTRLR_DATA_OACS_SELFTEST_SHIFT (4) +#define NVME_CTRLR_DATA_OACS_SELFTEST_MASK (0x1) +/* supports Directives */ +#define NVME_CTRLR_DATA_OACS_DIRECTIVES_SHIFT (5) +#define NVME_CTRLR_DATA_OACS_DIRECTIVES_MASK (0x1) +/* supports NVMe-MI Send/Receive */ +#define NVME_CTRLR_DATA_OACS_NVMEMI_SHIFT (6) +#define NVME_CTRLR_DATA_OACS_NVMEMI_MASK (0x1) +/* supports Virtualization Management */ +#define NVME_CTRLR_DATA_OACS_VM_SHIFT (7) +#define NVME_CTRLR_DATA_OACS_VM_MASK (0x1) +/* supports Doorbell Buffer Config */ +#define NVME_CTRLR_DATA_OACS_DBBUFFER_SHIFT (8) +#define NVME_CTRLR_DATA_OACS_DBBUFFER_MASK (0x1) /** firmware updates */ /* first slot is read-only */ @@ -209,6 +235,14 @@ #define NVME_CTRLR_DATA_ONCS_WRITE_UNC_MASK (0x1) #define NVME_CTRLR_DATA_ONCS_DSM_SHIFT (2) #define NVME_CTRLR_DATA_ONCS_DSM_MASK (0x1) +#define NVME_CTRLR_DATA_ONCS_WRZERO_SHIFT (3) +#define NVME_CTRLR_DATA_ONCS_WRZERO_MASK (0x1) +#define NVME_CTRLR_DATA_ONCS_SAVEFEAT_SHIFT (4) +#define NVME_CTRLR_DATA_ONCS_SAVEFEAT_MASK (0x1) +#define NVME_CTRLR_DATA_ONCS_RESERV_SHIFT (5) +#define NVME_CTRLR_DATA_ONCS_RESERV_MASK (0x1) +#define NVME_CTRLR_DATA_ONCS_TIMESTAMP_SHIFT (6) +#define NVME_CTRLR_DATA_ONCS_TIMESTAMP_MASK (0x1) /** volatile write cache */ #define NVME_CTRLR_DATA_VWC_PRESENT_SHIFT (0) @@ -218,6 +252,15 @@ /* thin provisioning */ #define NVME_NS_DATA_NSFEAT_THIN_PROV_SHIFT (0) #define NVME_NS_DATA_NSFEAT_THIN_PROV_MASK (0x1) +/* NAWUN, NAWUPF, and NACWU fields are valid */ +#define NVME_NS_DATA_NSFEAT_NA_FIELDS_SHIFT (1) +#define NVME_NS_DATA_NSFEAT_NA_FIELDS_MASK (0x1) +/* Deallocated or Unwritten Logical Block errors supported */ +#define NVME_NS_DATA_NSFEAT_DEALLOC_SHIFT (2) +#define NVME_NS_DATA_NSFEAT_DEALLOC_MASK (0x1) +/* NGUID and EUI64 fields are not reusable */ +#define NVME_NS_DATA_NSFEAT_NO_ID_REUSE_SHIFT (3) +#define NVME_NS_DATA_NSFEAT_NO_ID_REUSE_MASK (0x1) /** formatted lba size */ #define NVME_NS_DATA_FLBAS_FORMAT_SHIFT (0) @@ -259,6 +302,45 @@ #define NVME_NS_DATA_DPS_MD_START_SHIFT (3) #define NVME_NS_DATA_DPS_MD_START_MASK (0x1) +/** Namespace Multi-path I/O and Namespace Sharing Capabilities */ +/* the namespace may be attached to two or more controllers */ +#define NVME_NS_DATA_NMIC_MAY_BE_SHARED_SHIFT (0) +#define NVME_NS_DATA_NMIC_MAY_BE_SHARED_MASK (0x1) + +/** Reservation Capabilities */ +/* Persist Through Power Loss */ +#define NVME_NS_DATA_RESCAP_PTPL_SHIFT (0) +#define NVME_NS_DATA_RESCAP_PTPL_MASK (0x1) +/* supports the Write Exclusive */ +#define NVME_NS_DATA_RESCAP_WR_EX_SHIFT (1) +#define NVME_NS_DATA_RESCAP_WR_EX_MASK (0x1) +/* supports the Exclusive Access */ +#define NVME_NS_DATA_RESCAP_EX_AC_SHIFT (2) +#define NVME_NS_DATA_RESCAP_EX_AC_MASK (0x1) +/* supports the Write Exclusive – Registrants Only */ +#define NVME_NS_DATA_RESCAP_WR_EX_RO_SHIFT (3) +#define NVME_NS_DATA_RESCAP_WR_EX_RO_MASK (0x1) +/* supports the Exclusive Access - Registrants Only */ +#define NVME_NS_DATA_RESCAP_EX_AC_RO_SHIFT (4) +#define NVME_NS_DATA_RESCAP_EX_AC_RO_MASK (0x1) +/* supports the Write Exclusive – All Registrants */ +#define NVME_NS_DATA_RESCAP_WR_EX_AR_SHIFT (5) +#define NVME_NS_DATA_RESCAP_WR_EX_AR_MASK (0x1) +/* supports the Exclusive Access - All Registrants */ +#define NVME_NS_DATA_RESCAP_EX_AC_AR_SHIFT (6) +#define NVME_NS_DATA_RESCAP_EX_AC_AR_MASK (0x1) +/* Ignore Existing Key is used as defined in revision 1.3 or later */ +#define NVME_NS_DATA_RESCAP_IEKEY13_SHIFT (7) +#define NVME_NS_DATA_RESCAP_IEKEY13_MASK (0x1) + +/** Format Progress Indicator */ +/* percentage of the Format NVM command that remains to be completed */ +#define NVME_NS_DATA_FPI_PERC_SHIFT (0) +#define NVME_NS_DATA_FPI_PERC_MASK (0x7f) +/* namespace supports the Format Progress Indicator */ +#define NVME_NS_DATA_FPI_SUPP_SHIFT (7) +#define NVME_NS_DATA_FPI_SUPP_MASK (0x1) + /** lba format support */ /* metadata size */ #define NVME_NS_DATA_LBAF_MS_SHIFT (0) @@ -719,12 +801,35 @@ struct nvme_controller_data { /** volatile write cache */ uint8_t vwc; - /* TODO: flesh out remaining nvm command set attributes */ - uint8_t reserved5[178]; + /** Atomic Write Unit Normal */ + uint16_t awun; - /* bytes 704-2047: i/o command set attributes */ - uint8_t reserved6[1344]; + /** Atomic Write Unit Power Fail */ + uint16_t awupf; + /** NVM Vendor Specific Command Configuration */ + uint8_t nvscc; + uint8_t reserved5; + + /** Atomic Compare & Write Unit */ + uint16_t acwu; + uint16_t reserved6; + + /** SGL Support */ + uint32_t sgls; + + /* bytes 540-767: Reserved */ + uint8_t reserved7[228]; + + /** NVM Subsystem NVMe Qualified Name */ + uint8_t subnqn[256]; + + /* bytes 1024-1791: Reserved */ + uint8_t reserved8[768]; + + /* bytes 1792-2047: NVMe over Fabrics specification */ + uint8_t reserved9[256]; + /* bytes 2048-3071: power state descriptors */ struct nvme_power_state power_state[32]; @@ -763,8 +868,51 @@ struct nvme_namespace_data { /** end-to-end data protection type settings */ uint8_t dps; - uint8_t reserved5[98]; + /** Namespace Multi-path I/O and Namespace Sharing Capabilities */ + uint8_t nmic; + /** Reservation Capabilities */ + uint8_t rescap; + + /** Format Progress Indicator */ + uint8_t fpi; + + /** Deallocate Logical Block Features */ + uint8_t dlfeat; + + /** Namespace Atomic Write Unit Normal */ + uint16_t nawun; + + /** Namespace Atomic Write Unit Power Fail */ + uint16_t nawupf; + + /** Namespace Atomic Compare & Write Unit */ + uint16_t nacwu; + + /** Namespace Atomic Boundary Size Normal */ + uint16_t nabsn; + + /** Namespace Atomic Boundary Offset */ + uint16_t nabo; + + /** Namespace Atomic Boundary Size Power Fail */ + uint16_t nabspf; + + /** Namespace Optimal IO Boundary */ + uint16_t noiob; + + /** NVM Capacity */ + uint8_t nvmcap[16]; + + /* bytes 64-103: Reserved */ + uint8_t reserved5[40]; + + /** Namespace Globally Unique Identifier */ + uint8_t nguid[16]; + + /** IEEE Extended Unique Identifier */ + uint8_t eui64[8]; + /** lba format support */ uint32_t lbaf[16]; @@ -1154,6 +1302,10 @@ void nvme_controller_data_swapbytes(struct nvme_contro s->nn = le32toh(s->nn); s->oncs = le16toh(s->oncs); s->fuses = le16toh(s->fuses); + s->awun = le16toh(s->awun); + s->awupf = le16toh(s->awupf); + s->acwu = le16toh(s->acwu); + s->sgls = le32toh(s->sgls); for (i = 0; i < 32; i++) nvme_power_state_swapbytes(&s->power_state[i]); } @@ -1166,6 +1318,13 @@ void nvme_namespace_data_swapbytes(struct nvme_namespa s->nsze = le64toh(s->nsze); s->ncap = le64toh(s->ncap); s->nuse = le64toh(s->nuse); + s->nawun = le16toh(s->nawun); + s->nawupf = le16toh(s->nawupf); + s->nacwu = le16toh(s->nacwu); + s->nabsn = le16toh(s->nabsn); + s->nabo = le16toh(s->nabo); + s->nabspf = le16toh(s->nabspf); + s->noiob = le16toh(s->noiob); for (i = 0; i < 16; i++) s->lbaf[i] = le32toh(s->lbaf[i]); } From owner-svn-src-head@freebsd.org Sun Mar 11 04:01:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DA07F29D93; Sun, 11 Mar 2018 04:01:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2114F75BF1; Sun, 11 Mar 2018 04:01:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C069176E0; Sun, 11 Mar 2018 04:01:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2B41Nir075866; Sun, 11 Mar 2018 04:01:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2B41Neq075865; Sun, 11 Mar 2018 04:01:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201803110401.w2B41Neq075865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 11 Mar 2018 04:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330756 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 330756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 04:01:24 -0000 Author: manu Date: Sun Mar 11 04:01:23 2018 New Revision: 330756 URL: https://svnweb.freebsd.org/changeset/base/330756 Log: allwinner: Add IR clock to sun8i Add ir clock definition to sun8i-r-ccu. No idea if it's working but aw_cir seems happy now and the frequency is set to 3Mhz as it should. Modified: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Modified: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Sun Mar 11 02:45:52 2018 (r330755) +++ head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Sun Mar 11 04:01:23 2018 (r330756) @@ -108,6 +108,17 @@ DIV_CLK(apb0_clk, 0, 2, /* shift, width */ 0, NULL); /* flags, div table */ +static const char *ir_parents[] = {"osc32k", "osc24M"}; +NM_CLK(ir_clk, + CLK_IR, /* id */ + "ir", ir_parents, /* names, parents */ + 0x54, /* offset */ + 0, 4, 0, 0, /* N factor */ + 16, 2, 0, 0, /* M flags */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_REPARENT); /* flags */ + static struct aw_clk_prediv_mux_def *r_ccu_prediv_mux_clks[] = { &ar100_clk, }; @@ -124,6 +135,10 @@ static struct clk_fixed_def *fixed_factor_clks[] = { &ahb0_clk, }; +static struct aw_clk_nm_def *nm_clks[] = { + &ir_clk, +}; + void ccu_sun8i_r_register_clocks(struct aw_ccung_softc *sc) { @@ -147,4 +162,6 @@ ccu_sun8i_r_register_clocks(struct aw_ccung_softc *sc) clknode_div_register(sc->clkdom, div_clks[i]); for (i = 0; i < nitems(fixed_factor_clks); i++) clknode_fixed_register(sc->clkdom, fixed_factor_clks[i]); + for (i = 0; i < nitems(nm_clks); i++) + aw_clk_nm_register(sc->clkdom, nm_clks[i]); } From owner-svn-src-head@freebsd.org Sun Mar 11 06:18:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02ED9F303EC; Sun, 11 Mar 2018 06:18:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f177.google.com (mail-io0-f177.google.com [209.85.223.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61DC17A97C; Sun, 11 Mar 2018 06:18:26 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f177.google.com with SMTP id k21so3949756ioc.2; Sat, 10 Mar 2018 22:18: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:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=XCaK6nEbZrHKh1hc14yiY+9yEjK/Z7K6dxLlaBlFwp4=; b=kdOm9tDGI8ZYqx2kd/3p1Ov3cORVQdSsiXu2hQ7hAPtMMHwILl4CXsp6h36s91CJb1 uOHei7MsAQlB27Kh/hbYHSEwMAzy8StYAqgontVhfDF9sFqVTKSLIDe+ngdg+OW9B8yk Lso5N7W/Y43IydYu8lNVZXVhXnV19ObYp7QhH2miQoZwozzcJqX0JVTMcoOaPi7ejlfL R/n6eRgVTJTDCgZioircRgmaXriwfOlM+b/uNhMjP94UmZuLTU2VbWbOqBoVO2pIS0T0 qg01d/UWrdsw2fPqnuE8DdIKo8qu+t3Yt5VXLMbt22B5BxcY50/7jqtTHCiSRYD1h0bq myRQ== X-Gm-Message-State: AElRT7GCUQWeSiPMm12Mir85utAxw1t91rGGP0FBCrzTa6eWB1IYQ8Mu 2fy/y40SEPn/ItEa7zAEcEo6sZCe X-Google-Smtp-Source: AG47ELtPc9QliGMExcdL4TXMlsPuL+7cRuwJqeHv+BBSMnZ4dFPLs5gO6qsWPaEgJHhvR1AckLNzsg== X-Received: by 10.107.141.194 with SMTP id p185mr4411453iod.204.1520748753073; Sat, 10 Mar 2018 22:12:33 -0800 (PST) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com. [209.85.223.172]) by smtp.gmail.com with ESMTPSA id p142sm1553761itb.24.2018.03.10.22.12.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Mar 2018 22:12:32 -0800 (PST) Received: by mail-io0-f172.google.com with SMTP id l12so7878482ioc.10; Sat, 10 Mar 2018 22:12:32 -0800 (PST) X-Received: by 10.107.34.80 with SMTP id i77mr4281667ioi.220.1520748752014; Sat, 10 Mar 2018 22:12:32 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.153.132 with HTTP; Sat, 10 Mar 2018 22:12:31 -0800 (PST) In-Reply-To: <201803110509.w2B5928t008519@repo.freebsd.org> References: <201803110509.w2B5928t008519@repo.freebsd.org> From: Conrad Meyer Date: Sat, 10 Mar 2018 22:12:31 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r330759 - in head: sbin/nvmecontrol sys/dev/nvme To: Alexander Motin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 06:18:27 -0000 On Sat, Mar 10, 2018 at 9:09 PM, Alexander Motin wrote: > Author: mav > Date: Sun Mar 11 05:09:02 2018 > New Revision: 330759 > URL: https://svnweb.freebsd.org/changeset/base/330759 > > Log: > Add new identify data structures fields from NVMe 1.3a. > > ... > Modified: head/sbin/nvmecontrol/identify.c > ============================================================================== > --- head/sbin/nvmecontrol/identify.c Sun Mar 11 04:37:05 2018 (r330758) > +++ head/sbin/nvmecontrol/identify.c Sun Mar 11 05:09:02 2018 (r330759) > @@ -95,25 +95,35 @@ print_controller(struct nvme_controller_data *cdata) > ... > + ((cdata->mic >> NVME_CTRLR_DATA_MIC_SRIOVVF_SHIFT) & > + NVME_CTRLR_DATA_MIC_SRIOVVF_MASK) ? "SR-IOV VF, " : "", > + ((cdata->mic >> NVME_CTRLR_DATA_MIC_MCTRLRS_SHIFT) & > + NVME_CTRLR_DATA_MIC_MCTRLRS_MASK) ? "Multiple controllers, " : "", > + ((cdata->mic >> NVME_CTRLR_DATA_MIC_MPORTS_SHIFT) & > + NVME_CTRLR_DATA_MIC_MPORTS_MASK) ? "Multiple ports" : ""); > ... > Modified: head/sys/dev/nvme/nvme.h > ============================================================================== > --- head/sys/dev/nvme/nvme.h Sun Mar 11 04:37:05 2018 (r330758) > +++ head/sys/dev/nvme/nvme.h Sun Mar 11 05:09:02 2018 (r330759) > @@ -153,6 +153,17 @@ > #define NVME_PWR_ST_APS_SHIFT (6) > #define NVME_PWR_ST_APS_MASK (0x3) > > +/** Controller Multi-path I/O and Namespace Sharing Capabilities */ > +/* More then one port */ > +#define NVME_CTRLR_DATA_MIC_MPORTS_SHIFT (0) > +#define NVME_CTRLR_DATA_MIC_MPORTS_MASK (0x1) > +/* More then one controller */ > +#define NVME_CTRLR_DATA_MIC_MCTRLRS_SHIFT (1) > +#define NVME_CTRLR_DATA_MIC_MCTRLRS_MASK (0x1) > +/* SR-IOV Virtual Function */ > +#define NVME_CTRLR_DATA_MIC_SRIOVVF_SHIFT (2) > +#define NVME_CTRLR_DATA_MIC_SRIOVVF_MASK (0x1) > + > /** OACS - optional admin command support */ > /* supports security send/receive commands */ > #define NVME_CTRLR_DATA_OACS_SECURITY_SHIFT (0) > @@ -166,6 +177,21 @@ > /* supports namespace management commands */ > #define NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT (3) > #define NVME_CTRLR_DATA_OACS_NSMGMT_MASK (0x1) > +/* supports Device Self-test command */ > +#define NVME_CTRLR_DATA_OACS_SELFTEST_SHIFT (4) > +#define NVME_CTRLR_DATA_OACS_SELFTEST_MASK (0x1) > +/* supports Directives */ > +#define NVME_CTRLR_DATA_OACS_DIRECTIVES_SHIFT (5) > +#define NVME_CTRLR_DATA_OACS_DIRECTIVES_MASK (0x1) > +/* supports NVMe-MI Send/Receive */ > +#define NVME_CTRLR_DATA_OACS_NVMEMI_SHIFT (6) > +#define NVME_CTRLR_DATA_OACS_NVMEMI_MASK (0x1) > +/* supports Virtualization Management */ > +#define NVME_CTRLR_DATA_OACS_VM_SHIFT (7) > +#define NVME_CTRLR_DATA_OACS_VM_MASK (0x1) > +/* supports Doorbell Buffer Config */ > +#define NVME_CTRLR_DATA_OACS_DBBUFFER_SHIFT (8) > +#define NVME_CTRLR_DATA_OACS_DBBUFFER_MASK (0x1) This seems like a suboptimal way to represent and check single flag bits. Is there a reason the conventional (1< Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E79A9F2A5D9; Sun, 11 Mar 2018 04:10:18 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 983407677C; Sun, 11 Mar 2018 04:10:18 +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 92FAF18294; Sun, 11 Mar 2018 04:10:18 +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 w2B4AI5e078590; Sun, 11 Mar 2018 04:10:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2B4AIXH078589; Sun, 11 Mar 2018 04:10:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803110410.w2B4AIXH078589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 11 Mar 2018 04:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330757 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 330757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 04:10:19 -0000 Author: kevans Date: Sun Mar 11 04:10:18 2018 New Revision: 330757 URL: https://svnweb.freebsd.org/changeset/base/330757 Log: stand/interp_lua: correct errorr => error Modified: head/stand/common/interp_lua.c Modified: head/stand/common/interp_lua.c ============================================================================== --- head/stand/common/interp_lua.c Sun Mar 11 04:01:23 2018 (r330756) +++ head/stand/common/interp_lua.c Sun Mar 11 04:10:18 2018 (r330757) @@ -123,7 +123,7 @@ interp_init(void) if (interp_include(filename) != 0) { const char *errstr = lua_tostring(luap, -1); errstr = errstr == NULL ? "unknown" : errstr; - printf("Startup errorr in %s:\nLUA ERROR: %s.\n", filename, errstr); + printf("Startup error in %s:\nLUA ERROR: %s.\n", filename, errstr); lua_pop(luap, 1); } } From owner-svn-src-head@freebsd.org Sun Mar 11 04:37:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A657F2B810; Sun, 11 Mar 2018 04:37:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A42EC7744B; Sun, 11 Mar 2018 04:37:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82E2A1876F; Sun, 11 Mar 2018 04:37:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2B4b58I093113; Sun, 11 Mar 2018 04:37:05 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2B4b5Es093111; Sun, 11 Mar 2018 04:37:05 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201803110437.w2B4b5Es093111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 11 Mar 2018 04:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330758 - head/sys/dev/extres/regulator X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/extres/regulator X-SVN-Commit-Revision: 330758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 04:37:06 -0000 Author: manu Date: Sun Mar 11 04:37:05 2018 New Revision: 330758 URL: https://svnweb.freebsd.org/changeset/base/330758 Log: extres/regulators: Add sysctls for regulators For each regulators create an hw.regulator.. : uvolt: Current value always_on: 1 If the reg is always on boot_on: 1 If the reg is set at boot time enable_cnt: Number of consumer(s) enable_delay: Delay before enabling the regulator ramp_delay: The Ramp delay max_uamp: The maximum value of the regulator in uAmps min_uamp: The minimal value of the regulator in uAmps max_uvolt: The maximum value of the regulator in uVolts min_uvolt: The minimal value of the regulator in uVolts Reviewed by: ian Differential Revision: https://reviews.freebsd.org/D14578 Modified: head/sys/dev/extres/regulator/regulator.c head/sys/dev/extres/regulator/regulator.h Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Sun Mar 11 04:10:18 2018 (r330757) +++ head/sys/dev/extres/regulator/regulator.c Sun Mar 11 04:37:05 2018 (r330758) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include "regdev_if.h" +SYSCTL_NODE(_hw, OID_AUTO, regulator, CTLFLAG_RD, NULL, "Regulators"); + MALLOC_DEFINE(M_REGULATOR, "regulator", "Regulator framework"); #define DIV_ROUND_UP(n,d) howmany(n, d) @@ -112,6 +114,8 @@ struct regnode { int enable_cnt; /* Enabled counter */ struct regnode_std_param std_param; /* Standard parameters */ + + struct sysctl_ctx_list sysctl_ctx; }; /* @@ -147,6 +151,29 @@ SX_SYSINIT(regulator_topology, ®node_topo_lock, "Re #define REGNODE_XLOCK(_sc) sx_xlock(&((_sc)->lock)) #define REGNODE_UNLOCK(_sc) sx_unlock(&((_sc)->lock)) +/* + * sysctl handler + */ +static int +regnode_uvolt_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct regnode *regnode = arg1; + int rv, uvolt; + + if (regnode->std_param.min_uvolt == regnode->std_param.max_uvolt) { + uvolt = regnode->std_param.min_uvolt; + } else { + REG_TOPO_SLOCK(); + if ((rv = regnode_get_voltage(regnode, &uvolt)) != 0) { + REG_TOPO_UNLOCK(); + return (rv); + } + REG_TOPO_UNLOCK(); + } + + return sysctl_handle_int(oidp, &uvolt, sizeof(uvolt), req); +} + /* ---------------------------------------------------------------------------- * * Default regulator methods for base class. @@ -233,6 +260,7 @@ regnode_create(device_t pdev, regnode_class_t regnode_ struct regnode_init_def *def) { struct regnode *regnode; + struct sysctl_oid *regnode_oid; KASSERT(def->name != NULL, ("regulator name is NULL")); KASSERT(def->name[0] != '\0', ("regulator name is empty")); @@ -276,6 +304,66 @@ regnode_create(device_t pdev, regnode_class_t regnode_ #ifdef FDT regnode->ofw_node = def->ofw_node; #endif + + sysctl_ctx_init(®node->sysctl_ctx); + regnode_oid = SYSCTL_ADD_NODE(®node->sysctl_ctx, + SYSCTL_STATIC_CHILDREN(_hw_regulator), + OID_AUTO, regnode->name, + CTLFLAG_RD, 0, "A regulator node"); + + SYSCTL_ADD_INT(®node->sysctl_ctx, + SYSCTL_CHILDREN(regnode_oid), + OID_AUTO, "min_uvolt", + CTLFLAG_RD, ®node->std_param.min_uvolt, 0, + "Minimal voltage (in uV)"); + SYSCTL_ADD_INT(®node->sysctl_ctx, + SYSCTL_CHILDREN(regnode_oid), + OID_AUTO, "max_uvolt", + CTLFLAG_RD, ®node->std_param.max_uvolt, 0, + "Maximal voltage (in uV)"); + SYSCTL_ADD_INT(®node->sysctl_ctx, + SYSCTL_CHILDREN(regnode_oid), + OID_AUTO, "min_uamp", + CTLFLAG_RD, ®node->std_param.min_uamp, 0, + "Minimal amperage (in uA)"); + SYSCTL_ADD_INT(®node->sysctl_ctx, + SYSCTL_CHILDREN(regnode_oid), + OID_AUTO, "max_uamp", + CTLFLAG_RD, ®node->std_param.max_uamp, 0, + "Maximal amperage (in uA)"); + SYSCTL_ADD_INT(®node->sysctl_ctx, + SYSCTL_CHILDREN(regnode_oid), + OID_AUTO, "ramp_delay", + CTLFLAG_RD, ®node->std_param.ramp_delay, 0, + "Ramp delay (in uV/us)"); + SYSCTL_ADD_INT(®node->sysctl_ctx, + SYSCTL_CHILDREN(regnode_oid), + OID_AUTO, "enable_delay", + CTLFLAG_RD, ®node->std_param.enable_delay, 0, + "Enable delay (in us)"); + SYSCTL_ADD_INT(®node->sysctl_ctx, + SYSCTL_CHILDREN(regnode_oid), + OID_AUTO, "enable_cnt", + CTLFLAG_RD, ®node->enable_cnt, 0, + "The regulator enable counter"); + SYSCTL_ADD_INT(®node->sysctl_ctx, + SYSCTL_CHILDREN(regnode_oid), + OID_AUTO, "boot_on", + CTLFLAG_RD, (int *) ®node->std_param.boot_on, 0, + "Is enabled on boot"); + SYSCTL_ADD_INT(®node->sysctl_ctx, + SYSCTL_CHILDREN(regnode_oid), + OID_AUTO, "always_on", + CTLFLAG_RD, (int *)®node->std_param.always_on, 0, + "Is always enabled"); + + SYSCTL_ADD_PROC(®node->sysctl_ctx, + SYSCTL_CHILDREN(regnode_oid), + OID_AUTO, "uvolt", + CTLTYPE_INT | CTLFLAG_RD, + regnode, 0, regnode_uvolt_sysctl, + "I", + "Current voltage (in uV)"); return (regnode); } Modified: head/sys/dev/extres/regulator/regulator.h ============================================================================== --- head/sys/dev/extres/regulator/regulator.h Sun Mar 11 04:10:18 2018 (r330757) +++ head/sys/dev/extres/regulator/regulator.h Sun Mar 11 04:37:05 2018 (r330758) @@ -31,10 +31,13 @@ #include "opt_platform.h" #include +#include #ifdef FDT #include #endif #include "regnode_if.h" + +SYSCTL_DECL(_hw_regulator); #define REGULATOR_FLAGS_STATIC 0x00000001 /* Static strings */ #define REGULATOR_FLAGS_NOT_DISABLE 0x00000002 /* Cannot be disabled */ From owner-svn-src-head@freebsd.org Sun Mar 11 06:32:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3683F310DC; Sun, 11 Mar 2018 06:32:32 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CD37B40D; Sun, 11 Mar 2018 06:32:32 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-it0-x22d.google.com with SMTP id u5-v6so7618239itc.1; Sat, 10 Mar 2018 22:32:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=G/5XKTqq9DMbm6Jl3Ybnm1j0ZZDnEZAO1ToEH6Txodc=; b=hwknC9hQNF5TEMIqHyr28jHgcTgLC8jzRAg0ZR2JbGECvJnnV4mUtJ60ddX053g4/t 2fhUj0MtKy4M+JhT/3oX7gJ0qzzbx8zFjbF4PyJpEGDRSousiPPmNTsvAfzHVPsj7wGl ONGQRPrAu4g+IaC+lE1UxuoFnOYvFEky7IjpS1ag2rUnNBXn4dIOHUlgAuC84z/GyHXw 5MoY2LOp39TMZnf+3gwNLlURbu7OuExti8piQEy+lW4R9aj3nRzKo7lo7HcAkV7y/QIZ hjzuX42UmmzmKBYslDyxnutIhzkHDe9iQQDLXqsMAoy6jURSkshWqfdNRPiUxXuIhorL 2Siw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=G/5XKTqq9DMbm6Jl3Ybnm1j0ZZDnEZAO1ToEH6Txodc=; b=HvzlzaXNXoL/u75wVFfpqvV0H9T5GlYSb8srK1nrMmUH5iarCwoS4MUIG8Qm8wcyYB 511izzEivqSW8Ddr4unnKyUTt0bS0n6LSWJ8ceWXzgjhxWt3bls11gKeX5QrGiNiKJCU AL0i76uKB4fz8VKZgMrTMEoekzrlJH/xB7EyMe5m8/0ZsPy1xpO4aEcblfiE4pkYXJOJ NEuQqevIugtgU40VqsEMyiuxZqx0OnzjL+8rMxuwUtJq+RmymeGdpmgX6ubNgfxyi/Ea MEg2o4B6G+q9f3WPxFHT04N/Hv44UPoHT2NBIfAXekJa3qZ5BXtgit8Q+1tkzDyzm98o ftKw== X-Gm-Message-State: AElRT7F5LxcQBNikkQg0i6pL7TydRaoYmDGtnykBEac7WcOUQSXool91 qY5ilnqZR4Z/EVn00BIAltleVoOw X-Google-Smtp-Source: AG47ELsI486uUfScjxEYYdtnzDCWYgZ5EY4hwl7cVt0l+vS+TYxdkSrVV7GXEAaQmGAOP7UjMhTcmA== X-Received: by 10.36.249.203 with SMTP id l194mr4121312ith.81.1520749951342; Sat, 10 Mar 2018 22:32:31 -0800 (PST) Received: from spectre.mavhome.dp.ua ([2600:1700:3580:3560:228:f8ff:fe04:d12]) by smtp.gmail.com with ESMTPSA id n123sm1570212itb.31.2018.03.10.22.32.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Mar 2018 22:32:30 -0800 (PST) Sender: Alexander Motin Subject: Re: svn commit: r330759 - in head: sbin/nvmecontrol sys/dev/nvme To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803110509.w2B5928t008519@repo.freebsd.org> From: Alexander Motin Message-ID: <76181c29-2b3b-b89b-0186-22863273891c@FreeBSD.org> Date: Sun, 11 Mar 2018 01:32:29 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 06:32:33 -0000 On 11.03.2018 01:12, Conrad Meyer wrote: > On Sat, Mar 10, 2018 at 9:09 PM, Alexander Motin wrote: >> Author: mav >> Date: Sun Mar 11 05:09:02 2018 >> New Revision: 330759 >> URL: https://svnweb.freebsd.org/changeset/base/330759 >> >> Log: >> Add new identify data structures fields from NVMe 1.3a. >> >> ... >> Modified: head/sbin/nvmecontrol/identify.c >> ============================================================================== >> --- head/sbin/nvmecontrol/identify.c Sun Mar 11 04:37:05 2018 (r330758) >> +++ head/sbin/nvmecontrol/identify.c Sun Mar 11 05:09:02 2018 (r330759) >> @@ -95,25 +95,35 @@ print_controller(struct nvme_controller_data *cdata) >> ... >> + ((cdata->mic >> NVME_CTRLR_DATA_MIC_SRIOVVF_SHIFT) & >> + NVME_CTRLR_DATA_MIC_SRIOVVF_MASK) ? "SR-IOV VF, " : "", >> + ((cdata->mic >> NVME_CTRLR_DATA_MIC_MCTRLRS_SHIFT) & >> + NVME_CTRLR_DATA_MIC_MCTRLRS_MASK) ? "Multiple controllers, " : "", >> + ((cdata->mic >> NVME_CTRLR_DATA_MIC_MPORTS_SHIFT) & >> + NVME_CTRLR_DATA_MIC_MPORTS_MASK) ? "Multiple ports" : ""); >> ... >> Modified: head/sys/dev/nvme/nvme.h >> ============================================================================== >> --- head/sys/dev/nvme/nvme.h Sun Mar 11 04:37:05 2018 (r330758) >> +++ head/sys/dev/nvme/nvme.h Sun Mar 11 05:09:02 2018 (r330759) >> @@ -153,6 +153,17 @@ >> #define NVME_PWR_ST_APS_SHIFT (6) >> #define NVME_PWR_ST_APS_MASK (0x3) >> >> +/** Controller Multi-path I/O and Namespace Sharing Capabilities */ >> +/* More then one port */ >> +#define NVME_CTRLR_DATA_MIC_MPORTS_SHIFT (0) >> +#define NVME_CTRLR_DATA_MIC_MPORTS_MASK (0x1) >> +/* More then one controller */ >> +#define NVME_CTRLR_DATA_MIC_MCTRLRS_SHIFT (1) >> +#define NVME_CTRLR_DATA_MIC_MCTRLRS_MASK (0x1) >> +/* SR-IOV Virtual Function */ >> +#define NVME_CTRLR_DATA_MIC_SRIOVVF_SHIFT (2) >> +#define NVME_CTRLR_DATA_MIC_SRIOVVF_MASK (0x1) >> + >> /** OACS - optional admin command support */ >> /* supports security send/receive commands */ >> #define NVME_CTRLR_DATA_OACS_SECURITY_SHIFT (0) >> @@ -166,6 +177,21 @@ >> /* supports namespace management commands */ >> #define NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT (3) >> #define NVME_CTRLR_DATA_OACS_NSMGMT_MASK (0x1) >> +/* supports Device Self-test command */ >> +#define NVME_CTRLR_DATA_OACS_SELFTEST_SHIFT (4) >> +#define NVME_CTRLR_DATA_OACS_SELFTEST_MASK (0x1) >> +/* supports Directives */ >> +#define NVME_CTRLR_DATA_OACS_DIRECTIVES_SHIFT (5) >> +#define NVME_CTRLR_DATA_OACS_DIRECTIVES_MASK (0x1) >> +/* supports NVMe-MI Send/Receive */ >> +#define NVME_CTRLR_DATA_OACS_NVMEMI_SHIFT (6) >> +#define NVME_CTRLR_DATA_OACS_NVMEMI_MASK (0x1) >> +/* supports Virtualization Management */ >> +#define NVME_CTRLR_DATA_OACS_VM_SHIFT (7) >> +#define NVME_CTRLR_DATA_OACS_VM_MASK (0x1) >> +/* supports Doorbell Buffer Config */ >> +#define NVME_CTRLR_DATA_OACS_DBBUFFER_SHIFT (8) >> +#define NVME_CTRLR_DATA_OACS_DBBUFFER_MASK (0x1) > > This seems like a suboptimal way to represent and check single flag > bits. Is there a reason the conventional (1< Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFD29F353AC; Sun, 11 Mar 2018 07:33:49 +0000 (UTC) (envelope-from joneum@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94A717DB93; Sun, 11 Mar 2018 07:33:49 +0000 (UTC) (envelope-from joneum@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89ECA1A4D2; Sun, 11 Mar 2018 07:33:49 +0000 (UTC) (envelope-from joneum@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2B7Xnbe082655; Sun, 11 Mar 2018 07:33:49 GMT (envelope-from joneum@FreeBSD.org) Received: (from joneum@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2B7XnCO082654; Sun, 11 Mar 2018 07:33:49 GMT (envelope-from joneum@FreeBSD.org) Message-Id: <201803110733.w2B7XnCO082654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: joneum set sender to joneum@FreeBSD.org using -f From: Jochen Neumeister Date: Sun, 11 Mar 2018 07:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330761 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: joneum X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 330761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 07:33:50 -0000 Author: joneum (ports committer) Date: Sun Mar 11 07:33:49 2018 New Revision: 330761 URL: https://svnweb.freebsd.org/changeset/base/330761 Log: Add myself to committers-ports.dot Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sun Mar 11 06:30:09 2018 (r330760) +++ head/share/misc/committers-ports.dot Sun Mar 11 07:33:49 2018 (r330761) @@ -131,6 +131,7 @@ jkim [label="Jung-uk Kim\njkim@FreeBSD.org\n2007/09/12 jlaffaye [label="Julien Laffaye\njlaffaye@FreeBSD.org\n2011/06/06"] jmd [label="Johannes M. Dieterich\njmd@FreeBSD.org\n2017/01/09"] jmelo [label="Jean Milanez Melo\njmelo@FreeBSD.org\n2006/03/31"] +joneum [label="Jochen Neumeister\joneum@FreeBSD.org\n2017/05/11" joerg [label="Joerg Wunsch\njoerg@FreeBSD.org\n1994/08/22"] johans [label="Johan Selst\njohans@FreeBSD.org\n2006/04/01"] josef [label="Josef El-Rayes\njosef@FreeBSD.org\n2004/12/20"] @@ -530,6 +531,7 @@ miwi -> dhn miwi -> farrokhi miwi -> fluffy miwi -> gahr +miwi -> joneum miwi -> kmoore miwi -> lme miwi -> makc @@ -597,6 +599,7 @@ rene -> cmt rene -> crees rene -> jgh rene -> jmd +rene -> joneum rene -> ler rene -> olivierd @@ -658,6 +661,7 @@ tabthorpe -> zi tabthorpe -> gblach tcberner -> adridg +tcberner -> joneum tcberner -> yuri thierry -> jadawin @@ -665,6 +669,8 @@ thierry -> riggs tmclaugh -> itetcu tmclaugh -> xride + +tz -> joneum vsevolod -> eugen From owner-svn-src-head@freebsd.org Sun Mar 11 08:02:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F4060F373C7; Sun, 11 Mar 2018 08:02:14 +0000 (UTC) (envelope-from joneum@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6F677EE4C; Sun, 11 Mar 2018 08:02:14 +0000 (UTC) (envelope-from joneum@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1D861A88D; Sun, 11 Mar 2018 08:02:14 +0000 (UTC) (envelope-from joneum@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2B82EbE097492; Sun, 11 Mar 2018 08:02:14 GMT (envelope-from joneum@FreeBSD.org) Received: (from joneum@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2B82ER3097491; Sun, 11 Mar 2018 08:02:14 GMT (envelope-from joneum@FreeBSD.org) Message-Id: <201803110802.w2B82ER3097491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: joneum set sender to joneum@FreeBSD.org using -f From: Jochen Neumeister Date: Sun, 11 Mar 2018 08:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330762 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: joneum X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 330762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 08:02:15 -0000 Author: joneum (ports committer) Date: Sun Mar 11 08:02:14 2018 New Revision: 330762 URL: https://svnweb.freebsd.org/changeset/base/330762 Log: Fix typo Reported by: tcberner Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sun Mar 11 07:33:49 2018 (r330761) +++ head/share/misc/committers-ports.dot Sun Mar 11 08:02:14 2018 (r330762) @@ -131,7 +131,7 @@ jkim [label="Jung-uk Kim\njkim@FreeBSD.org\n2007/09/12 jlaffaye [label="Julien Laffaye\njlaffaye@FreeBSD.org\n2011/06/06"] jmd [label="Johannes M. Dieterich\njmd@FreeBSD.org\n2017/01/09"] jmelo [label="Jean Milanez Melo\njmelo@FreeBSD.org\n2006/03/31"] -joneum [label="Jochen Neumeister\joneum@FreeBSD.org\n2017/05/11" +joneum [label="Jochen Neumeister\joneum@FreeBSD.org\n2017/05/11"] joerg [label="Joerg Wunsch\njoerg@FreeBSD.org\n1994/08/22"] johans [label="Johan Selst\njohans@FreeBSD.org\n2006/04/01"] josef [label="Josef El-Rayes\njosef@FreeBSD.org\n2004/12/20"] From owner-svn-src-head@freebsd.org Sun Mar 11 06:30:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0DA4F30DD1; Sun, 11 Mar 2018 06:30: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D2B57B054; Sun, 11 Mar 2018 06:30: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 6809019990; Sun, 11 Mar 2018 06:30: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 w2B6U9q2048107; Sun, 11 Mar 2018 06:30:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2B6U9tn048105; Sun, 11 Mar 2018 06:30:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201803110630.w2B6U9tn048105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 11 Mar 2018 06:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330760 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 330760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 06:30:10 -0000 Author: mav Date: Sun Mar 11 06:30:09 2018 New Revision: 330760 URL: https://svnweb.freebsd.org/changeset/base/330760 Log: Add new opcodes and statuses from NVMe 1.3a. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Sun Mar 11 05:09:02 2018 (r330759) +++ head/sys/dev/nvme/nvme.h Sun Mar 11 06:30:09 2018 (r330760) @@ -498,10 +498,31 @@ enum nvme_generic_command_status_code { NVME_SC_ABORTED_MISSING_FUSED = 0x0a, NVME_SC_INVALID_NAMESPACE_OR_FORMAT = 0x0b, NVME_SC_COMMAND_SEQUENCE_ERROR = 0x0c, + NVME_SC_INVALID_SGL_SEGMENT_DESCR = 0x0d, + NVME_SC_INVALID_NUMBER_OF_SGL_DESCR = 0x0e, + NVME_SC_DATA_SGL_LENGTH_INVALID = 0x0f, + NVME_SC_METADATA_SGL_LENGTH_INVALID = 0x10, + NVME_SC_SGL_DESCRIPTOR_TYPE_INVALID = 0x11, + NVME_SC_INVALID_USE_OF_CMB = 0x12, + NVME_SC_PRP_OFFET_INVALID = 0x13, + NVME_SC_ATOMIC_WRITE_UNIT_EXCEEDED = 0x14, + NVME_SC_OPERATION_DENIED = 0x15, + NVME_SC_SGL_OFFSET_INVALID = 0x16, + /* 0x17 - reserved */ + NVME_SC_HOST_ID_INCONSISTENT_FORMAT = 0x18, + NVME_SC_KEEP_ALIVE_TIMEOUT_EXPIRED = 0x19, + NVME_SC_KEEP_ALIVE_TIMEOUT_INVALID = 0x1a, + NVME_SC_ABORTED_DUE_TO_PREEMPT = 0x1b, + NVME_SC_SANITIZE_FAILED = 0x1c, + NVME_SC_SANITIZE_IN_PROGRESS = 0x1d, + NVME_SC_SGL_DATA_BLOCK_GRAN_INVALID = 0x1e, + NVME_SC_NOT_SUPPORTED_IN_CMB = 0x1f, NVME_SC_LBA_OUT_OF_RANGE = 0x80, NVME_SC_CAPACITY_EXCEEDED = 0x81, NVME_SC_NAMESPACE_NOT_READY = 0x82, + NVME_SC_RESERVATION_CONFLICT = 0x83, + NVME_SC_FORMAT_IN_PROGRESS = 0x84, }; /* command specific status codes */ @@ -518,6 +539,29 @@ enum nvme_command_specific_status_code { NVME_SC_INVALID_LOG_PAGE = 0x09, NVME_SC_INVALID_FORMAT = 0x0a, NVME_SC_FIRMWARE_REQUIRES_RESET = 0x0b, + NVME_SC_INVALID_QUEUE_DELETION = 0x0c, + NVME_SC_FEATURE_NOT_SAVEABLE = 0x0d, + NVME_SC_FEATURE_NOT_CHANGEABLE = 0x0e, + NVME_SC_FEATURE_NOT_NS_SPECIFIC = 0x0f, + NVME_SC_FW_ACT_REQUIRES_NVMS_RESET = 0x10, + NVME_SC_FW_ACT_REQUIRES_RESET = 0x11, + NVME_SC_FW_ACT_REQUIRES_TIME = 0x12, + NVME_SC_FW_ACT_PROHIBITED = 0x13, + NVME_SC_OVERLAPPING_RANGE = 0x14, + NVME_SC_NS_INSUFFICIENT_CAPACITY = 0x15, + NVME_SC_NS_ID_UNAVAILABLE = 0x16, + /* 0x17 - reserved */ + NVME_SC_NS_ALREADY_ATTACHED = 0x18, + NVME_SC_NS_IS_PRIVATE = 0x19, + NVME_SC_NS_NOT_ATTACHED = 0x1a, + NVME_SC_THIN_PROV_NOT_SUPPORTED = 0x1b, + NVME_SC_CTRLR_LIST_INVALID = 0x1c, + NVME_SC_SELT_TEST_IN_PROGRESS = 0x1d, + NVME_SC_BOOT_PART_WRITE_PROHIB = 0x1e, + NVME_SC_INVALID_CTRLR_ID = 0x1f, + NVME_SC_INVALID_SEC_CTRLR_STATE = 0x20, + NVME_SC_INVALID_NUM_OF_CTRLR_RESRC = 0x21, + NVME_SC_INVALID_RESOURCE_ID = 0x22, NVME_SC_CONFLICTING_ATTRIBUTES = 0x80, NVME_SC_INVALID_PROTECTION_INFO = 0x81, @@ -533,6 +577,7 @@ enum nvme_media_error_status_code { NVME_SC_REFERENCE_TAG_CHECK_ERROR = 0x84, NVME_SC_COMPARE_FAILURE = 0x85, NVME_SC_ACCESS_DENIED = 0x86, + NVME_SC_DEALLOCATED_OR_UNWRITTEN = 0x87, }; /* admin opcodes */ @@ -554,11 +599,20 @@ enum nvme_admin_opcode { /* 0x0e-0x0f - reserved */ NVME_OPC_FIRMWARE_ACTIVATE = 0x10, NVME_OPC_FIRMWARE_IMAGE_DOWNLOAD = 0x11, + NVME_OPC_DEVICE_SELF_TEST = 0x14, NVME_OPC_NAMESPACE_ATTACHMENT = 0x15, + NVME_OPC_KEEP_ALIVE = 0x18, + NVME_OPC_DIRECTIVE_SEND = 0x19, + NVME_OPC_DIRECTIVE_RECEIVE = 0x1a, + NVME_OPC_VIRTUALIZATION_MANAGEMENT = 0x1c, + NVME_OPC_NVME_MI_SEND = 0x1d, + NVME_OPC_NVME_MI_RECEIVE = 0x1e, + NVME_OPC_DOORBELL_BUFFER_CONFIG = 0x7c, NVME_OPC_FORMAT_NVM = 0x80, NVME_OPC_SECURITY_SEND = 0x81, NVME_OPC_SECURITY_RECEIVE = 0x82, + NVME_OPC_SANITIZE = 0x84, }; /* nvme nvm opcodes */ @@ -569,8 +623,17 @@ enum nvme_nvm_opcode { /* 0x03 - reserved */ NVME_OPC_WRITE_UNCORRECTABLE = 0x04, NVME_OPC_COMPARE = 0x05, - /* 0x06-0x07 - reserved */ + /* 0x06 - reserved */ + NVME_OPC_WRITE_ZEROES = 0x08, + /* 0x07 - reserved */ NVME_OPC_DATASET_MANAGEMENT = 0x09, + /* 0x0a-0x0c - reserved */ + NVME_OPC_RESERVATION_REGISTER = 0x0d, + NVME_OPC_RESERVATION_REPORT = 0x0e, + /* 0x0f-0x10 - reserved */ + NVME_OPC_RESERVATION_ACQUIRE = 0x11, + /* 0x12-0x14 - reserved */ + NVME_OPC_RESERVATION_RELEASE = 0x15, }; enum nvme_feature { Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Sun Mar 11 05:09:02 2018 (r330759) +++ head/sys/dev/nvme/nvme_qpair.c Sun Mar 11 06:30:09 2018 (r330760) @@ -59,9 +59,19 @@ static struct nvme_opcode_string admin_opcode[] = { { NVME_OPC_ASYNC_EVENT_REQUEST, "ASYNC EVENT REQUEST" }, { NVME_OPC_FIRMWARE_ACTIVATE, "FIRMWARE ACTIVATE" }, { NVME_OPC_FIRMWARE_IMAGE_DOWNLOAD, "FIRMWARE IMAGE DOWNLOAD" }, + { NVME_OPC_DEVICE_SELF_TEST, "DEVICE SELF-TEST" }, + { NVME_OPC_NAMESPACE_ATTACHMENT, "NAMESPACE ATTACHMENT" }, + { NVME_OPC_KEEP_ALIVE, "KEEP ALIVE" }, + { NVME_OPC_DIRECTIVE_SEND, "DIRECTIVE SEND" }, + { NVME_OPC_DIRECTIVE_RECEIVE, "DIRECTIVE RECEIVE" }, + { NVME_OPC_VIRTUALIZATION_MANAGEMENT, "VIRTUALIZATION MANAGEMENT" }, + { NVME_OPC_NVME_MI_SEND, "NVME-MI SEND" }, + { NVME_OPC_NVME_MI_RECEIVE, "NVME-MI RECEIVE" }, + { NVME_OPC_DOORBELL_BUFFER_CONFIG, "DOORBELL BUFFER CONFIG" }, { NVME_OPC_FORMAT_NVM, "FORMAT NVM" }, { NVME_OPC_SECURITY_SEND, "SECURITY SEND" }, { NVME_OPC_SECURITY_RECEIVE, "SECURITY RECEIVE" }, + { NVME_OPC_SANITIZE, "SANITIZE" }, { 0xFFFF, "ADMIN COMMAND" } }; @@ -71,7 +81,12 @@ static struct nvme_opcode_string io_opcode[] = { { NVME_OPC_READ, "READ" }, { NVME_OPC_WRITE_UNCORRECTABLE, "WRITE UNCORRECTABLE" }, { NVME_OPC_COMPARE, "COMPARE" }, + { NVME_OPC_WRITE_ZEROES, "WRITE ZEROES" }, { NVME_OPC_DATASET_MANAGEMENT, "DATASET MANAGEMENT" }, + { NVME_OPC_RESERVATION_REGISTER, "RESERVATION REGISTER" }, + { NVME_OPC_RESERVATION_REPORT, "RESERVATION REPORT" }, + { NVME_OPC_RESERVATION_ACQUIRE, "RESERVATION ACQUIRE" }, + { NVME_OPC_RESERVATION_RELEASE, "RESERVATION RELEASE" }, { 0xFFFF, "IO COMMAND" } }; @@ -131,6 +146,7 @@ nvme_io_qpair_print_command(struct nvme_qpair *qpair, case NVME_OPC_READ: case NVME_OPC_WRITE_UNCORRECTABLE: case NVME_OPC_COMPARE: + case NVME_OPC_WRITE_ZEROES: nvme_printf(qpair->ctrlr, "%s sqid:%d cid:%d nsid:%d " "lba:%llu len:%d\n", get_io_opcode_string(opc), qpair->id, cmd->cid, le32toh(cmd->nsid), @@ -139,6 +155,10 @@ nvme_io_qpair_print_command(struct nvme_qpair *qpair, break; case NVME_OPC_FLUSH: case NVME_OPC_DATASET_MANAGEMENT: + case NVME_OPC_RESERVATION_REGISTER: + case NVME_OPC_RESERVATION_REPORT: + case NVME_OPC_RESERVATION_ACQUIRE: + case NVME_OPC_RESERVATION_RELEASE: nvme_printf(qpair->ctrlr, "%s sqid:%d cid:%d nsid:%d\n", get_io_opcode_string(opc), qpair->id, cmd->cid, le32toh(cmd->nsid)); break; @@ -179,9 +199,30 @@ static struct nvme_status_string generic_status[] = { { NVME_SC_ABORTED_MISSING_FUSED, "ABORTED - MISSING FUSED" }, { NVME_SC_INVALID_NAMESPACE_OR_FORMAT, "INVALID NAMESPACE OR FORMAT" }, { NVME_SC_COMMAND_SEQUENCE_ERROR, "COMMAND SEQUENCE ERROR" }, + { NVME_SC_INVALID_SGL_SEGMENT_DESCR, "INVALID SGL SEGMENT DESCRIPTOR" }, + { NVME_SC_INVALID_NUMBER_OF_SGL_DESCR, "INVALID NUMBER OF SGL DESCRIPTORS" }, + { NVME_SC_DATA_SGL_LENGTH_INVALID, "DATA SGL LENGTH INVALID" }, + { NVME_SC_METADATA_SGL_LENGTH_INVALID, "METADATA SGL LENGTH INVALID" }, + { NVME_SC_SGL_DESCRIPTOR_TYPE_INVALID, "SGL DESCRIPTOR TYPE INVALID" }, + { NVME_SC_INVALID_USE_OF_CMB, "INVALID USE OF CONTROLLER MEMORY BUFFER" }, + { NVME_SC_PRP_OFFET_INVALID, "PRP OFFET INVALID" }, + { NVME_SC_ATOMIC_WRITE_UNIT_EXCEEDED, "ATOMIC WRITE UNIT EXCEEDED" }, + { NVME_SC_OPERATION_DENIED, "OPERATION DENIED" }, + { NVME_SC_SGL_OFFSET_INVALID, "SGL OFFSET INVALID" }, + { NVME_SC_HOST_ID_INCONSISTENT_FORMAT, "HOST IDENTIFIER INCONSISTENT FORMAT" }, + { NVME_SC_KEEP_ALIVE_TIMEOUT_EXPIRED, "KEEP ALIVE TIMEOUT EXPIRED" }, + { NVME_SC_KEEP_ALIVE_TIMEOUT_INVALID, "KEEP ALIVE TIMEOUT INVALID" }, + { NVME_SC_ABORTED_DUE_TO_PREEMPT, "COMMAND ABORTED DUE TO PREEMPT AND ABORT" }, + { NVME_SC_SANITIZE_FAILED, "SANITIZE FAILED" }, + { NVME_SC_SANITIZE_IN_PROGRESS, "SANITIZE IN PROGRESS" }, + { NVME_SC_SGL_DATA_BLOCK_GRAN_INVALID, "SGL_DATA_BLOCK_GRANULARITY_INVALID" }, + { NVME_SC_NOT_SUPPORTED_IN_CMB, "COMMAND NOT SUPPORTED FOR QUEUE IN CMB" }, + { NVME_SC_LBA_OUT_OF_RANGE, "LBA OUT OF RANGE" }, { NVME_SC_CAPACITY_EXCEEDED, "CAPACITY EXCEEDED" }, { NVME_SC_NAMESPACE_NOT_READY, "NAMESPACE NOT READY" }, + { NVME_SC_RESERVATION_CONFLICT, "RESERVATION CONFLICT" }, + { NVME_SC_FORMAT_IN_PROGRESS, "FORMAT IN PROGRESS" }, { 0xFFFF, "GENERIC" } }; @@ -197,6 +238,29 @@ static struct nvme_status_string command_specific_stat { NVME_SC_INVALID_LOG_PAGE, "INVALID LOG PAGE" }, { NVME_SC_INVALID_FORMAT, "INVALID FORMAT" }, { NVME_SC_FIRMWARE_REQUIRES_RESET, "FIRMWARE REQUIRES RESET" }, + { NVME_SC_INVALID_QUEUE_DELETION, "INVALID QUEUE DELETION" }, + { NVME_SC_FEATURE_NOT_SAVEABLE, "FEATURE IDENTIFIER NOT SAVEABLE" }, + { NVME_SC_FEATURE_NOT_CHANGEABLE, "FEATURE NOT CHANGEABLE" }, + { NVME_SC_FEATURE_NOT_NS_SPECIFIC, "FEATURE NOT NAMESPACE SPECIFIC" }, + { NVME_SC_FW_ACT_REQUIRES_NVMS_RESET, "FIRMWARE ACTIVATION REQUIRES NVM SUBSYSTEM RESET" }, + { NVME_SC_FW_ACT_REQUIRES_RESET, "FIRMWARE ACTIVATION REQUIRES RESET" }, + { NVME_SC_FW_ACT_REQUIRES_TIME, "FIRMWARE ACTIVATION REQUIRES MAXIMUM TIME VIOLATION" }, + { NVME_SC_FW_ACT_PROHIBITED, "FIRMWARE ACTIVATION PROHIBITED" }, + { NVME_SC_OVERLAPPING_RANGE, "OVERLAPPING RANGE" }, + { NVME_SC_NS_INSUFFICIENT_CAPACITY, "NAMESPACE INSUFFICIENT CAPACITY" }, + { NVME_SC_NS_ID_UNAVAILABLE, "NAMESPACE IDENTIFIER UNAVAILABLE" }, + { NVME_SC_NS_ALREADY_ATTACHED, "NAMESPACE ALREADY ATTACHED" }, + { NVME_SC_NS_IS_PRIVATE, "NAMESPACE IS PRIVATE" }, + { NVME_SC_NS_NOT_ATTACHED, "NS NOT ATTACHED" }, + { NVME_SC_THIN_PROV_NOT_SUPPORTED, "THIN PROVISIONING NOT SUPPORTED" }, + { NVME_SC_CTRLR_LIST_INVALID, "CONTROLLER LIST INVALID" }, + { NVME_SC_SELT_TEST_IN_PROGRESS, "DEVICE SELT-TEST IN PROGRESS" }, + { NVME_SC_BOOT_PART_WRITE_PROHIB, "BOOT PARTITION WRITE PROHIBITED" }, + { NVME_SC_INVALID_CTRLR_ID, "INVALID CONTROLLER IDENTIFIER" }, + { NVME_SC_INVALID_SEC_CTRLR_STATE, "INVALID SECONDARY CONTROLLER STATE" }, + { NVME_SC_INVALID_NUM_OF_CTRLR_RESRC, "INVALID NUMBER OF CONTROLLER RESOURCES" }, + { NVME_SC_INVALID_RESOURCE_ID, "INVALID RESOURCE IDENTIFIER" }, + { NVME_SC_CONFLICTING_ATTRIBUTES, "CONFLICTING ATTRIBUTES" }, { NVME_SC_INVALID_PROTECTION_INFO, "INVALID PROTECTION INFO" }, { NVME_SC_ATTEMPTED_WRITE_TO_RO_PAGE, "WRITE TO RO PAGE" }, @@ -211,6 +275,7 @@ static struct nvme_status_string media_error_status[] { NVME_SC_REFERENCE_TAG_CHECK_ERROR, "REFERENCE TAG CHECK ERROR" }, { NVME_SC_COMPARE_FAILURE, "COMPARE FAILURE" }, { NVME_SC_ACCESS_DENIED, "ACCESS DENIED" }, + { NVME_SC_DEALLOCATED_OR_UNWRITTEN, "DEALLOCATED OR UNWRITTEN LOGICAL BLOCK" }, { 0xFFFF, "MEDIA ERROR" } }; From owner-svn-src-head@freebsd.org Sun Mar 11 08:27:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CF62F39465; Sun, 11 Mar 2018 08:27:12 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 282637FE3C; Sun, 11 Mar 2018 08:27:12 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D9541AD0E; Sun, 11 Mar 2018 08:27:12 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2B8RBfC007301; Sun, 11 Mar 2018 08:27:11 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2B8RBgp007300; Sun, 11 Mar 2018 08:27:11 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201803110827.w2B8RBgp007300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Sun, 11 Mar 2018 08:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330764 - head/usr.sbin/bhyvectl X-SVN-Group: head X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: head/usr.sbin/bhyvectl X-SVN-Commit-Revision: 330764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 08:27:12 -0000 Author: grehan Date: Sun Mar 11 08:27:11 2018 New Revision: 330764 URL: https://svnweb.freebsd.org/changeset/base/330764 Log: Add CR2 get/set support. Reported/Tested by: Fabian Freyer Reviewed by: araujo Differential Revision: https://reviews.freebsd.org/D14648 MFC after: 3 weeks Modified: head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- head/usr.sbin/bhyvectl/bhyvectl.c Sun Mar 11 08:07:40 2018 (r330763) +++ head/usr.sbin/bhyvectl/bhyvectl.c Sun Mar 11 08:27:11 2018 (r330764) @@ -109,6 +109,8 @@ usage(bool cpu_intel) " [--desc-access=]\n" " [--set-cr0=]\n" " [--get-cr0]\n" + " [--set-cr2=]\n" + " [--get-cr2]\n" " [--set-cr3=]\n" " [--get-cr3]\n" " [--set-cr4=]\n" @@ -254,7 +256,8 @@ static int create, destroy, get_memmap, get_memseg; static int get_intinfo; static int get_active_cpus, get_suspended_cpus; static uint64_t memsize; -static int set_cr0, get_cr0, set_cr3, get_cr3, set_cr4, get_cr4; +static int set_cr0, get_cr0, set_cr2, get_cr2, set_cr3, get_cr3; +static int set_cr4, get_cr4; static int set_efer, get_efer; static int set_dr0, get_dr0; static int set_dr1, get_dr1; @@ -551,6 +554,7 @@ enum { SET_MEM, SET_EFER, SET_CR0, + SET_CR2, SET_CR3, SET_CR4, SET_DR0, @@ -662,7 +666,7 @@ cpu_vendor_intel(void) static int get_all_registers(struct vmctx *ctx, int vcpu) { - uint64_t cr0, cr3, cr4, dr0, dr1, dr2, dr3, dr6, dr7; + uint64_t cr0, cr2, cr3, cr4, dr0, dr1, dr2, dr3, dr6, dr7; uint64_t rsp, rip, rflags, efer; uint64_t rax, rbx, rcx, rdx, rsi, rdi, rbp; uint64_t r8, r9, r10, r11, r12, r13, r14, r15; @@ -680,6 +684,12 @@ get_all_registers(struct vmctx *ctx, int vcpu) printf("cr0[%d]\t\t0x%016lx\n", vcpu, cr0); } + if (!error && (get_cr2 || get_all)) { + error = vm_get_register(ctx, vcpu, VM_REG_GUEST_CR2, &cr2); + if (error == 0) + printf("cr2[%d]\t\t0x%016lx\n", vcpu, cr2); + } + if (!error && (get_cr3 || get_all)) { error = vm_get_register(ctx, vcpu, VM_REG_GUEST_CR3, &cr3); if (error == 0) @@ -1322,6 +1332,7 @@ setup_options(bool cpu_intel) { "set-mem", REQ_ARG, 0, SET_MEM }, { "set-efer", REQ_ARG, 0, SET_EFER }, { "set-cr0", REQ_ARG, 0, SET_CR0 }, + { "set-cr2", REQ_ARG, 0, SET_CR2 }, { "set-cr3", REQ_ARG, 0, SET_CR3 }, { "set-cr4", REQ_ARG, 0, SET_CR4 }, { "set-dr0", REQ_ARG, 0, SET_DR0 }, @@ -1384,6 +1395,7 @@ setup_options(bool cpu_intel) { "get-memseg", NO_ARG, &get_memseg, 1 }, { "get-efer", NO_ARG, &get_efer, 1 }, { "get-cr0", NO_ARG, &get_cr0, 1 }, + { "get-cr2", NO_ARG, &get_cr2, 1 }, { "get-cr3", NO_ARG, &get_cr3, 1 }, { "get-cr4", NO_ARG, &get_cr4, 1 }, { "get-dr0", NO_ARG, &get_dr0, 1 }, @@ -1668,7 +1680,7 @@ main(int argc, char *argv[]) int error, ch, vcpu, ptenum; vm_paddr_t gpa_pmap; struct vm_exit vmexit; - uint64_t rax, cr0, cr3, cr4, dr0, dr1, dr2, dr3, dr6, dr7; + uint64_t rax, cr0, cr2, cr3, cr4, dr0, dr1, dr2, dr3, dr6, dr7; uint64_t rsp, rip, rflags, efer, pat; uint64_t eptp, bm, addr, u64, pteval[4], *pte, info[2]; struct vmctx *ctx; @@ -1708,6 +1720,10 @@ main(int argc, char *argv[]) cr0 = strtoul(optarg, NULL, 0); set_cr0 = 1; break; + case SET_CR2: + cr2 = strtoul(optarg, NULL, 0); + set_cr2 = 1; + break; case SET_CR3: cr3 = strtoul(optarg, NULL, 0); set_cr3 = 1; @@ -1870,6 +1886,9 @@ main(int argc, char *argv[]) if (!error && set_cr0) error = vm_set_register(ctx, vcpu, VM_REG_GUEST_CR0, cr0); + + if (!error && set_cr2) + error = vm_set_register(ctx, vcpu, VM_REG_GUEST_CR2, cr2); if (!error && set_cr3) error = vm_set_register(ctx, vcpu, VM_REG_GUEST_CR3, cr3); From owner-svn-src-head@freebsd.org Sun Mar 11 08:07:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09B8DF37CAF; Sun, 11 Mar 2018 08:07:41 +0000 (UTC) (envelope-from joneum@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFBE47F1B0; Sun, 11 Mar 2018 08:07:40 +0000 (UTC) (envelope-from joneum@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AABEE1A9B9; Sun, 11 Mar 2018 08:07:40 +0000 (UTC) (envelope-from joneum@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2B87epn097707; Sun, 11 Mar 2018 08:07:40 GMT (envelope-from joneum@FreeBSD.org) Received: (from joneum@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2B87eqq097706; Sun, 11 Mar 2018 08:07:40 GMT (envelope-from joneum@FreeBSD.org) Message-Id: <201803110807.w2B87eqq097706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: joneum set sender to joneum@FreeBSD.org using -f From: Jochen Neumeister Date: Sun, 11 Mar 2018 08:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330763 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: joneum X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 330763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 08:07:41 -0000 Author: joneum (ports committer) Date: Sun Mar 11 08:07:40 2018 New Revision: 330763 URL: https://svnweb.freebsd.org/changeset/base/330763 Log: sorry for that. Fix next typo Pointy hat to: joneum Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sun Mar 11 08:02:14 2018 (r330762) +++ head/share/misc/committers-ports.dot Sun Mar 11 08:07:40 2018 (r330763) @@ -131,7 +131,7 @@ jkim [label="Jung-uk Kim\njkim@FreeBSD.org\n2007/09/12 jlaffaye [label="Julien Laffaye\njlaffaye@FreeBSD.org\n2011/06/06"] jmd [label="Johannes M. Dieterich\njmd@FreeBSD.org\n2017/01/09"] jmelo [label="Jean Milanez Melo\njmelo@FreeBSD.org\n2006/03/31"] -joneum [label="Jochen Neumeister\joneum@FreeBSD.org\n2017/05/11"] +joneum [label="Jochen Neumeister\njoneum@FreeBSD.org\n2017/05/11"] joerg [label="Joerg Wunsch\njoerg@FreeBSD.org\n1994/08/22"] johans [label="Johan Selst\njohans@FreeBSD.org\n2006/04/01"] josef [label="Josef El-Rayes\njosef@FreeBSD.org\n2004/12/20"] From owner-svn-src-head@freebsd.org Sun Mar 11 08:54:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95E3FF3B1A0; Sun, 11 Mar 2018 08:54:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 67F4681205; Sun, 11 Mar 2018 08:54:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 6FB1C1A58E4; Sun, 11 Mar 2018 19:54:38 +1100 (AEDT) Date: Sun, 11 Mar 2018 19:54:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330745 - head/sys/kern In-Reply-To: <201803102207.w2AM7vKk093818@repo.freebsd.org> Message-ID: <20180311180535.E1452@besplex.bde.org> References: <201803102207.w2AM7vKk093818@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=sHrrFP9dtV93zn__-SYA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 08:54:51 -0000 On Sat, 10 Mar 2018, Ian Lepore wrote: > Author: ian > ... > Log: > Make root mount timeout logic work for filesystems other than ufs. > ... > These changes are based on the patch attached to the PR, but it's rewritten > enough that all mistakes belong to me. > > PR: 208882 > X-MFC after: sufficient testing, and hopefully in time for 11.1 This clones overflow bug, and I just noticed that the existing delays are misplaced too. > Modified: head/sys/kern/vfs_mountroot.c > ============================================================================== > --- head/sys/kern/vfs_mountroot.c Sat Mar 10 20:46:36 2018 (r330744) > +++ head/sys/kern/vfs_mountroot.c Sat Mar 10 22:07:57 2018 (r330745) > @@ -755,15 +755,31 @@ parse_mount(char **conf) > if (error != 0) > goto out; > > - ma = NULL; > - ma = mount_arg(ma, "fstype", fs, -1); > - ma = mount_arg(ma, "fspath", "/", -1); > - ma = mount_arg(ma, "from", dev, -1); > - ma = mount_arg(ma, "errmsg", errmsg, ERRMSGL); > - ma = mount_arg(ma, "ro", NULL, 0); > - ma = parse_mountroot_options(ma, opts); > - error = kernel_mount(ma, MNT_ROOTFS); > + delay = hz / 10; > + timeout = root_mount_timeout * hz; Old bugs cloned from vfs_mountroot_wait_if_necessary(): - when hz < 10, delay is 0 which means infinity for pause(), and also for the loop - when hz >= 10 but is not a multiple of 10, there is a minor inaccuracy - when hz is "infinity" or just large, root_mount_timeout * hz overflows. These bugs can be fixed using sbt_pause(). > > + for (;;) { > + ma = NULL; > + ma = mount_arg(ma, "fstype", fs, -1); > + ma = mount_arg(ma, "fspath", "/", -1); > + ma = mount_arg(ma, "from", dev, -1); > + ma = mount_arg(ma, "errmsg", errmsg, ERRMSGL); > + ma = mount_arg(ma, "ro", NULL, 0); > + ma = parse_mountroot_options(ma, opts); > + > + error = kernel_mount(ma, MNT_ROOTFS); > + if (error == 0 || timeout <= 0) > + break; > + > + if (root_mount_timeout * hz == timeout || > + (bootverbose && timeout % hz == 0)) { > + printf("Mounting from %s:%s failed with error %d; " > + "retrying for %d more second%s\n", fs, dev, error, > + timeout / hz, (timeout / hz > 1) ? "s" : ""); > + } > + pause("rmretry", delay); > + timeout -= delay; > + } > out: > if (error) { > printf("Mounting from %s:%s failed with error %d", Misplaced delays: the order is to try each device in vfs.root.mountfrom in the outer loop with delays in the inner loop, but should be to try each device in the inner loop with delays in the outer loop. I use a generic vfs.root.mountfrom with entries for many different FreeBSD versions and target systems. Renaming and renumbering devices causes problems, but it can usually be arranged that the preferred device either exists initially or never exists. Retrying for never-existing devices in the inner loop wastes many seconds. Retrying in the outer loop would waste at most * 0.1 seconds. Only the error reporting for the correct is complicated. Currently, failure is reported once for devices probed but not found, so later devices in my list are not probed and not reported. The above gives a new bug: double error reporting for the first retry and the final failure for devices early on the list that never exist. I want to see exactly 1 report for all nonexistent devices early in the list. In the usual case, there is 1 failure and no retries for devices early in the list; then mount succeeds on the first try for some device and the probe completes (it is too difficult to probe the list after 1 success). Bruce From owner-svn-src-head@freebsd.org Sun Mar 11 10:47:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5152CF434CA; Sun, 11 Mar 2018 10:47:41 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0558E86345; Sun, 11 Mar 2018 10:47:41 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 004451C483; Sun, 11 Mar 2018 10:47:41 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2BAleMC078170; Sun, 11 Mar 2018 10:47:40 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BAleVb078169; Sun, 11 Mar 2018 10:47:40 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <201803111047.w2BAleVb078169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Sun, 11 Mar 2018 10:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330765 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 330765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 10:47:41 -0000 Author: fernape (ports committer) Date: Sun Mar 11 10:47:40 2018 New Revision: 330765 URL: https://svnweb.freebsd.org/changeset/base/330765 Log: Add myself (fernape) to commiters-port.dot Approved by: tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D14639 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sun Mar 11 08:27:11 2018 (r330764) +++ head/share/misc/committers-ports.dot Sun Mar 11 10:47:40 2018 (r330765) @@ -103,6 +103,7 @@ erwin [label="Erwin Lansing\nerwin@FreeBSD.org\n2003/0 eugen [label="Eugene Grosbein\neugen@FreeBSD.org\n2017/03/04"] farrokhi [label="Babak Farrokhi\nfarrokhi@FreeBSD.org\n2006/11/07"] feld [label="Mark Felder\nfeld@FreeBSD.org\n2013/06/25"] +fernape [label="Fernando Apesteguia\nfernape@FreeBSD.org\n2018/03/03"] fjoe [label="Max Khon\nfjoe@FreeBSD.org\n2001/08/06"] flo [label="Florian Smeets\nflo@FreeBSD.org\n2010/12/07"] fluffy [label="Dima Panov\nfluffy@FreeBSD.org\n2009/08/10"] @@ -663,6 +664,7 @@ tabthorpe -> gblach tcberner -> adridg tcberner -> joneum tcberner -> yuri +tcberner -> fernape thierry -> jadawin thierry -> riggs @@ -671,6 +673,7 @@ tmclaugh -> itetcu tmclaugh -> xride tz -> joneum +tz -> fernape vsevolod -> eugen From owner-svn-src-head@freebsd.org Sun Mar 11 16:17:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 523DAF3695C; Sun, 11 Mar 2018 16:17:54 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07E607298C; Sun, 11 Mar 2018 16:17:54 +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 D89CC1F8B4; Sun, 11 Mar 2018 16:17:53 +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 w2BGHrrC044202; Sun, 11 Mar 2018 16:17:53 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BGHrRh044201; Sun, 11 Mar 2018 16:17:53 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803111617.w2BGHrRh044201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 11 Mar 2018 16:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330766 - head/sys/i386/include X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/i386/include X-SVN-Commit-Revision: 330766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 16:17:54 -0000 Author: brooks Date: Sun Mar 11 16:17:53 2018 New Revision: 330766 URL: https://svnweb.freebsd.org/changeset/base/330766 Log: Remove obsolete pcaudioio.h. Nothing uses the #define's values or the types. (Some NTP code does use an audio_info_t, but it is in #ifdef'd support for Solaris and is not this audio_info_t). Sponsored by: DARPA, AFRL Deleted: head/sys/i386/include/pcaudioio.h From owner-svn-src-head@freebsd.org Sun Mar 11 16:57:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F56CF3A704; Sun, 11 Mar 2018 16:57:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39D6F73C83; Sun, 11 Mar 2018 16:57:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 347591FF10; Sun, 11 Mar 2018 16:57:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2BGvFQa063836; Sun, 11 Mar 2018 16:57:15 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BGvFZ9063835; Sun, 11 Mar 2018 16:57:15 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803111657.w2BGvFZ9063835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 11 Mar 2018 16:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330767 - head/sys/x86/isa X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/x86/isa X-SVN-Commit-Revision: 330767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 16:57:15 -0000 Author: ian Date: Sun Mar 11 16:57:14 2018 New Revision: 330767 URL: https://svnweb.freebsd.org/changeset/base/330767 Log: Convert atrtc the new style rtc debugging output. Remove the db show command handler which provided much the same information. Removing the possibility of accessing the hardware regs from the debugger context paves the way for simplifying the locking code in the driver. Modified: head/sys/x86/isa/atrtc.c Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Sun Mar 11 16:17:53 2018 (r330766) +++ head/sys/x86/isa/atrtc.c Sun Mar 11 16:57:14 2018 (r330767) @@ -318,6 +318,7 @@ atrtc_settime(device_t dev __unused, struct timespec * struct bcd_clocktime bct; clock_ts_to_bcd(ts, &bct, false); + clock_dbgprint_bcd(dev, CLOCK_DBG_WRITE, &bct); mtx_lock(&atrtc_time_lock); RTC_LOCK; @@ -385,6 +386,7 @@ atrtc_gettime(device_t dev, struct timespec *ts) /* dow is unused in timespec conversion and we have no nsec info. */ bct.dow = 0; bct.nsec = 0; + clock_dbgprint_bcd(dev, CLOCK_DBG_READ, &bct); return (clock_bcd_to_ts(&bct, ts, false)); } @@ -416,16 +418,3 @@ static devclass_t atrtc_devclass; DRIVER_MODULE(atrtc, isa, atrtc_driver, atrtc_devclass, 0, 0); DRIVER_MODULE(atrtc, acpi, atrtc_driver, atrtc_devclass, 0, 0); ISA_PNP_INFO(atrtc_ids); - -#include "opt_ddb.h" -#ifdef DDB -#include - -DB_SHOW_COMMAND(rtc, rtc) -{ - printf("%02x/%02x/%02x %02x:%02x:%02x, A = %02x, B = %02x, C = %02x\n", - rtcin(RTC_YEAR), rtcin(RTC_MONTH), rtcin(RTC_DAY), - rtcin(RTC_HRS), rtcin(RTC_MIN), rtcin(RTC_SEC), - rtcin(RTC_STATUSA), rtcin(RTC_STATUSB), rtcin(RTC_INTR)); -} -#endif /* DDB */ From owner-svn-src-head@freebsd.org Sun Mar 11 17:21:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFD96F3DCC3; Sun, 11 Mar 2018 17:21:48 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EEBA74C80; Sun, 11 Mar 2018 17:21:48 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79D09203AD; Sun, 11 Mar 2018 17:21:48 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2BHLmJC076946; Sun, 11 Mar 2018 17:21:48 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BHLmhl076945; Sun, 11 Mar 2018 17:21:48 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <201803111721.w2BHLmhl076945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Sun, 11 Mar 2018 17:21:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330768 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 330768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 17:21:49 -0000 Author: fernape (ports committer) Date: Sun Mar 11 17:21:48 2018 New Revision: 330768 URL: https://svnweb.freebsd.org/changeset/base/330768 Log: Add myself (fernape) to calendar.freebsd As indicated in Committers guide Chapter 6, point 9 "Optional: Update Ports with Personal Information" Approved by: tcberner Differential Revision: https://reviews.freebsd.org/D14653 Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sun Mar 11 16:57:14 2018 (r330767) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sun Mar 11 17:21:48 2018 (r330768) @@ -266,6 +266,7 @@ 07/10 David Schultz born in Oakland, California, United States, 1982 07/10 Ben Woods born in Perth, Western Australia, Australia, 1984 07/11 Jesus R. Camou born in Hermosillo, Sonora, Mexico, 1983 +07/14 Fernando Apesteguia born in Madrid, Spain, 1981 07/15 Gary Jennejohn born in Rochester, New York, United States, 1950 07/16 Suleiman Souhlal born in Roma, Italy, 1983 07/16 Davide Italiano born in Milazzo, Italy, 1989 From owner-svn-src-head@freebsd.org Sun Mar 11 18:03:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8533CF42360; Sun, 11 Mar 2018 18:03:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32C6976D83; Sun, 11 Mar 2018 18:03:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B8EA20A3C; Sun, 11 Mar 2018 18:03:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2BI3u1N002047; Sun, 11 Mar 2018 18:03:56 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BI3tJ0002045; Sun, 11 Mar 2018 18:03:55 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201803111803.w2BI3tJ0002045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 11 Mar 2018 18:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330771 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 330771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 18:03:56 -0000 Author: ae Date: Sun Mar 11 18:03:55 2018 New Revision: 330771 URL: https://svnweb.freebsd.org/changeset/base/330771 Log: Remove obsoleted and unused key_sendup() function. Also remove declaration for nonexistend key_usrreq() function. MFC after: 2 weeks Modified: head/sys/netipsec/keysock.c head/sys/netipsec/keysock.h Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Sun Mar 11 17:43:04 2018 (r330770) +++ head/sys/netipsec/keysock.c Sun Mar 11 18:03:55 2018 (r330771) @@ -172,90 +172,6 @@ key_sendup0(struct rawcb *rp, struct mbuf *m, int prom return error; } -/* XXX this interface should be obsoleted. */ -int -key_sendup(struct socket *so, struct sadb_msg *msg, u_int len, int target) -{ - struct mbuf *m, *n, *mprev; - int tlen; - - /* sanity check */ - if (so == NULL || msg == NULL) - panic("%s: NULL pointer was passed.\n", __func__); - - KEYDBG(KEY_DUMP, - printf("%s: \n", __func__); - kdebug_sadb(msg)); - - /* - * we increment statistics here, just in case we have ENOBUFS - * in this function. - */ - PFKEYSTAT_INC(in_total); - PFKEYSTAT_ADD(in_bytes, len); - PFKEYSTAT_INC(in_msgtype[msg->sadb_msg_type]); - - /* - * Get mbuf chain whenever possible (not clusters), - * to save socket buffer. We'll be generating many SADB_ACQUIRE - * messages to listening key sockets. If we simply allocate clusters, - * sbappendaddr() will raise ENOBUFS due to too little sbspace(). - * sbspace() computes # of actual data bytes AND mbuf region. - * - * TODO: SADB_ACQUIRE filters should be implemented. - */ - tlen = len; - m = mprev = NULL; - while (tlen > 0) { - if (tlen == len) { - MGETHDR(n, M_NOWAIT, MT_DATA); - if (n == NULL) { - PFKEYSTAT_INC(in_nomem); - return ENOBUFS; - } - n->m_len = MHLEN; - } else { - MGET(n, M_NOWAIT, MT_DATA); - if (n == NULL) { - PFKEYSTAT_INC(in_nomem); - return ENOBUFS; - } - n->m_len = MLEN; - } - if (tlen >= MCLBYTES) { /*XXX better threshold? */ - if (!(MCLGET(n, M_NOWAIT))) { - m_free(n); - m_freem(m); - PFKEYSTAT_INC(in_nomem); - return ENOBUFS; - } - n->m_len = MCLBYTES; - } - - if (tlen < n->m_len) - n->m_len = tlen; - n->m_next = NULL; - if (m == NULL) - m = mprev = n; - else { - mprev->m_next = n; - mprev = n; - } - tlen -= n->m_len; - n = NULL; - } - m->m_pkthdr.len = len; - m->m_pkthdr.rcvif = NULL; - m_copyback(m, 0, len, (caddr_t)msg); - - /* avoid duplicated statistics */ - PFKEYSTAT_ADD(in_total, -1); - PFKEYSTAT_ADD(in_bytes, -len); - PFKEYSTAT_ADD(in_msgtype[msg->sadb_msg_type], -1); - - return key_sendup_mbuf(so, m, target); -} - /* so can be NULL if target != KEY_SENDUP_ONE */ int key_sendup_mbuf(struct socket *so, struct mbuf *m, int target) Modified: head/sys/netipsec/keysock.h ============================================================================== --- head/sys/netipsec/keysock.h Sun Mar 11 17:43:04 2018 (r330770) +++ head/sys/netipsec/keysock.h Sun Mar 11 18:03:55 2018 (r330771) @@ -78,12 +78,8 @@ VNET_PCPUSTAT_DECLARE(struct pfkeystat, pfkeystat); VNET_PCPUSTAT_ADD(struct pfkeystat, pfkeystat, name, (val)) #define PFKEYSTAT_INC(name) PFKEYSTAT_ADD(name, 1) -extern int key_output(struct mbuf *m, struct socket *so, ...); -extern int key_usrreq(struct socket *, int, struct mbuf *, - struct mbuf *, struct mbuf *); - -extern int key_sendup(struct socket *, struct sadb_msg *, u_int, int); -extern int key_sendup_mbuf(struct socket *, struct mbuf *, int); +int key_output(struct mbuf *m, struct socket *so, ...); +int key_sendup_mbuf(struct socket *, struct mbuf *, int); #endif /* _KERNEL */ #endif /*_NETIPSEC_KEYSOCK_H_*/ From owner-svn-src-head@freebsd.org Sun Mar 11 18:10:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8659F42BEC; Sun, 11 Mar 2018 18:10:59 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63BE3770B3; Sun, 11 Mar 2018 18:10:59 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EA6A20A65; Sun, 11 Mar 2018 18:10:59 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2BIAxQS002375; Sun, 11 Mar 2018 18:10:59 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BIAxTw002374; Sun, 11 Mar 2018 18:10:59 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201803111810.w2BIAxTw002374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 11 Mar 2018 18:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330772 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 330772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 18:10:59 -0000 Author: ae Date: Sun Mar 11 18:10:59 2018 New Revision: 330772 URL: https://svnweb.freebsd.org/changeset/base/330772 Log: Check that we have PF_KEY sockets before iterating over all RAW sockets. MFC after: 2 weeks Modified: head/sys/netipsec/keysock.c Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Sun Mar 11 18:03:55 2018 (r330771) +++ head/sys/netipsec/keysock.c Sun Mar 11 18:10:59 2018 (r330772) @@ -202,6 +202,11 @@ key_sendup_mbuf(struct socket *so, struct mbuf *m, int PFKEYSTAT_INC(in_msgtype[msg->sadb_msg_type]); } mtx_lock(&rawcb_mtx); + if (V_key_cb.any_count == 0) { + mtx_unlock(&rawcb_mtx); + m_freem(m); + return (0); + } LIST_FOREACH(rp, &V_rawcb_list, list) { if (rp->rcb_proto.sp_family != PF_KEY) From owner-svn-src-head@freebsd.org Sun Mar 11 18:20:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E5ABF43710; Sun, 11 Mar 2018 18:20:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 928C677791; Sun, 11 Mar 2018 18:20:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DA1120BE2; Sun, 11 Mar 2018 18:20:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2BIKogr008441; Sun, 11 Mar 2018 18:20:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BIKood008438; Sun, 11 Mar 2018 18:20:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803111820.w2BIKood008438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 11 Mar 2018 18:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330773 - in head/sys: isa x86/isa X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: isa x86/isa X-SVN-Commit-Revision: 330773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 18:20:51 -0000 Author: ian Date: Sun Mar 11 18:20:49 2018 New Revision: 330773 URL: https://svnweb.freebsd.org/changeset/base/330773 Log: Use separate mutexes for atrtc and i8254 locking. Change all the strange un-function-like RTC_LOCK/UNLOCK macro usage into normal function calls. Since there is no longer any need to handle register access from a debugger context, those function calls can just be regular mutex lock/unlock calls. Requested by: bde Modified: head/sys/isa/rtc.h head/sys/x86/isa/atrtc.c head/sys/x86/isa/clock.c Modified: head/sys/isa/rtc.h ============================================================================== --- head/sys/isa/rtc.h Sun Mar 11 18:10:59 2018 (r330772) +++ head/sys/isa/rtc.h Sun Mar 11 18:20:49 2018 (r330773) @@ -114,7 +114,6 @@ #define RTC_CENTURY 0x32 /* current century */ #ifdef _KERNEL -extern struct mtx clock_lock; extern struct mtx atrtc_time_lock; extern int atrtcclock_disable; int rtcin(int reg); Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Sun Mar 11 18:10:59 2018 (r330772) +++ head/sys/x86/isa/atrtc.c Sun Mar 11 18:20:49 2018 (r330773) @@ -56,15 +56,15 @@ __FBSDID("$FreeBSD$"); #include "clock_if.h" /* - * clock_lock protects low-level access to individual hardware registers. + * atrtc_lock protects low-level access to individual hardware registers. * atrtc_time_lock protects the entire sequence of accessing multiple registers * to read or write the date and time. */ -#define RTC_LOCK do { if (!kdb_active) mtx_lock_spin(&clock_lock); } while (0) -#define RTC_UNLOCK do { if (!kdb_active) mtx_unlock_spin(&clock_lock); } while (0) +static struct mtx atrtc_lock; +MTX_SYSINIT(atrtc_lock_init, &atrtc_lock, "atrtc", MTX_SPIN | MTX_NOPROFILE); struct mtx atrtc_time_lock; -MTX_SYSINIT(atrtc_lock_init, &atrtc_time_lock, "atrtc", MTX_DEF); +MTX_SYSINIT(atrtc_time_lock_init, &atrtc_time_lock, "atrtc", MTX_DEF); int atrtcclock_disable = 0; @@ -108,9 +108,9 @@ rtcin(int reg) { u_char val; - RTC_LOCK; + mtx_lock_spin(&atrtc_lock); val = rtcin_locked(reg); - RTC_UNLOCK; + mtx_unlock_spin(&atrtc_lock); return (val); } @@ -118,9 +118,9 @@ void writertc(int reg, u_char val) { - RTC_LOCK; + mtx_lock_spin(&atrtc_lock); rtcout_locked(reg, val); - RTC_UNLOCK; + mtx_unlock_spin(&atrtc_lock); } static void @@ -321,7 +321,7 @@ atrtc_settime(device_t dev __unused, struct timespec * clock_dbgprint_bcd(dev, CLOCK_DBG_WRITE, &bct); mtx_lock(&atrtc_time_lock); - RTC_LOCK; + mtx_lock_spin(&atrtc_lock); /* Disable RTC updates and interrupts. */ rtcout_locked(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR); @@ -344,7 +344,7 @@ atrtc_settime(device_t dev __unused, struct timespec * rtcout_locked(RTC_STATUSB, rtc_statusb); rtcin_locked(RTC_INTR); - RTC_UNLOCK; + mtx_unlock_spin(&atrtc_lock); mtx_unlock(&atrtc_time_lock); return (0); @@ -371,7 +371,7 @@ atrtc_gettime(device_t dev, struct timespec *ts) mtx_lock(&atrtc_time_lock); while (rtcin(RTC_STATUSA) & RTCSA_TUP) continue; - RTC_LOCK; + mtx_lock_spin(&atrtc_lock); bct.sec = rtcin_locked(RTC_SEC); bct.min = rtcin_locked(RTC_MIN); bct.hour = rtcin_locked(RTC_HRS); @@ -381,7 +381,7 @@ atrtc_gettime(device_t dev, struct timespec *ts) #ifdef USE_RTC_CENTURY bct.year |= rtcin_locked(RTC_CENTURY) << 8; #endif - RTC_UNLOCK; + mtx_unlock_spin(&atrtc_lock); mtx_unlock(&atrtc_time_lock); /* dow is unused in timespec conversion and we have no nsec info. */ bct.dow = 0; Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Sun Mar 11 18:10:59 2018 (r330772) +++ head/sys/x86/isa/clock.c Sun Mar 11 18:20:49 2018 (r330773) @@ -83,7 +83,7 @@ TUNABLE_INT("hw.i8254.freq", &i8254_freq); int i8254_max_count; static int i8254_timecounter = 1; -struct mtx clock_lock; +static struct mtx clock_lock; static struct intsrc *i8254_intsrc; static uint16_t i8254_lastcount; static uint16_t i8254_offset; From owner-svn-src-head@freebsd.org Sun Mar 11 18:37:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB6DEF449C3; Sun, 11 Mar 2018 18:37:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AFD778337; Sun, 11 Mar 2018 18:37:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6619320F0B; Sun, 11 Mar 2018 18:37:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2BIbtiK018105; Sun, 11 Mar 2018 18:37:55 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BIbt0M018104; Sun, 11 Mar 2018 18:37:55 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201803111837.w2BIbt0M018104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 11 Mar 2018 18:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330775 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 330775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 18:37:55 -0000 Author: ae Date: Sun Mar 11 18:37:55 2018 New Revision: 330775 URL: https://svnweb.freebsd.org/changeset/base/330775 Log: Replace panic() with KASSERTs. MFC after: 2 weeks Modified: head/sys/netipsec/keysock.c Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Sun Mar 11 18:31:21 2018 (r330774) +++ head/sys/netipsec/keysock.c Sun Mar 11 18:37:55 2018 (r330775) @@ -182,10 +182,9 @@ key_sendup_mbuf(struct socket *so, struct mbuf *m, int struct rawcb *rp; int error = 0; - if (m == NULL) - panic("key_sendup_mbuf: NULL pointer was passed.\n"); - if (so == NULL && target == KEY_SENDUP_ONE) - panic("%s: NULL pointer was passed.\n", __func__); + KASSERT(m != NULL, ("NULL mbuf pointer was passed.")); + KASSERT(so != NULL || target != KEY_SENDUP_ONE, + ("NULL socket pointer was passed.")); PFKEYSTAT_INC(in_total); PFKEYSTAT_ADD(in_bytes, m->m_pkthdr.len); From owner-svn-src-head@freebsd.org Sun Mar 11 18:46:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16916F453B0; Sun, 11 Mar 2018 18:46:41 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6BCC78969; Sun, 11 Mar 2018 18:46:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A91E321092; Sun, 11 Mar 2018 18:46:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2BIkebr023051; Sun, 11 Mar 2018 18:46:40 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BIkem5023050; Sun, 11 Mar 2018 18:46:40 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201803111846.w2BIkem5023050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 11 Mar 2018 18:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330777 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 330777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 18:46:41 -0000 Author: ae Date: Sun Mar 11 18:46:40 2018 New Revision: 330777 URL: https://svnweb.freebsd.org/changeset/base/330777 Log: Add KASSERT to check that proper targed was used. MFC after: 2 weeks Modified: head/sys/netipsec/keysock.c Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Sun Mar 11 18:43:36 2018 (r330776) +++ head/sys/netipsec/keysock.c Sun Mar 11 18:46:40 2018 (r330777) @@ -185,6 +185,8 @@ key_sendup_mbuf(struct socket *so, struct mbuf *m, int KASSERT(m != NULL, ("NULL mbuf pointer was passed.")); KASSERT(so != NULL || target != KEY_SENDUP_ONE, ("NULL socket pointer was passed.")); + KASSERT(target == KEY_SENDUP_ONE || target == KEY_SENDUP_ALL || + target == KEY_SENDUP_REGISTERED, ("Wrong target %d", target)); PFKEYSTAT_INC(in_total); PFKEYSTAT_ADD(in_bytes, m->m_pkthdr.len); From owner-svn-src-head@freebsd.org Sun Mar 11 18:54:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3325F45CE9; Sun, 11 Mar 2018 18:54:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 925AC78FD3; Sun, 11 Mar 2018 18:54:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 891082121A; Sun, 11 Mar 2018 18:54:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2BIsjvI028230; Sun, 11 Mar 2018 18:54:45 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BIsjsj028229; Sun, 11 Mar 2018 18:54:45 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803111854.w2BIsjsj028229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 11 Mar 2018 18:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330778 - head/sys/x86/isa X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/x86/isa X-SVN-Commit-Revision: 330778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 18:54:46 -0000 Author: ian Date: Sun Mar 11 18:54:45 2018 New Revision: 330778 URL: https://svnweb.freebsd.org/changeset/base/330778 Log: Everywhere that multiple registers are accessed in sequence, lock/unlock just once around the whole group of accesses. Modified: head/sys/x86/isa/atrtc.c Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Sun Mar 11 18:46:40 2018 (r330777) +++ head/sys/x86/isa/atrtc.c Sun Mar 11 18:54:45 2018 (r330778) @@ -127,8 +127,10 @@ static void atrtc_start(void) { - writertc(RTC_STATUSA, rtc_statusa); - writertc(RTC_STATUSB, RTCSB_24HR); + mtx_lock_spin(&atrtc_lock); + rtcout_locked(RTC_STATUSA, rtc_statusa); + rtcout_locked(RTC_STATUSB, RTCSB_24HR); + mtx_unlock_spin(&atrtc_lock); } static void @@ -144,8 +146,10 @@ atrtc_enable_intr(void) { rtc_statusb |= RTCSB_PINTR; - writertc(RTC_STATUSB, rtc_statusb); - rtcin(RTC_INTR); + mtx_lock_spin(&atrtc_lock); + rtcout_locked(RTC_STATUSB, rtc_statusb); + rtcin_locked(RTC_INTR); + mtx_unlock_spin(&atrtc_lock); } static void @@ -153,8 +157,10 @@ atrtc_disable_intr(void) { rtc_statusb &= ~RTCSB_PINTR; - writertc(RTC_STATUSB, rtc_statusb); - rtcin(RTC_INTR); + mtx_lock_spin(&atrtc_lock); + rtcout_locked(RTC_STATUSB, rtc_statusb); + rtcin_locked(RTC_INTR); + mtx_unlock_spin(&atrtc_lock); } void @@ -162,11 +168,13 @@ atrtc_restore(void) { /* Restore all of the RTC's "status" (actually, control) registers. */ - rtcin(RTC_STATUSA); /* dummy to get rtc_reg set */ - writertc(RTC_STATUSB, RTCSB_24HR); - writertc(RTC_STATUSA, rtc_statusa); - writertc(RTC_STATUSB, rtc_statusb); - rtcin(RTC_INTR); + mtx_lock_spin(&atrtc_lock); + rtcin_locked(RTC_STATUSA); /* dummy to get rtc_reg set */ + rtcout_locked(RTC_STATUSB, RTCSB_24HR); + rtcout_locked(RTC_STATUSA, rtc_statusa); + rtcout_locked(RTC_STATUSB, rtc_statusb); + rtcin_locked(RTC_INTR); + mtx_unlock_spin(&atrtc_lock); } /********************************************************************** From owner-svn-src-head@freebsd.org Sun Mar 11 19:14:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB99EF4745E; Sun, 11 Mar 2018 19:14:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8236979CA1; Sun, 11 Mar 2018 19:14:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D12021550; Sun, 11 Mar 2018 19:14:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2BJE1TP037752; Sun, 11 Mar 2018 19:14:01 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BJE1XA037751; Sun, 11 Mar 2018 19:14:01 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201803111914.w2BJE1XA037751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 11 Mar 2018 19:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330779 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 330779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 19:14:02 -0000 Author: ae Date: Sun Mar 11 19:14:01 2018 New Revision: 330779 URL: https://svnweb.freebsd.org/changeset/base/330779 Log: Rework key_sendup_mbuf() a bit: o count in_nomem counter when we have failed to allocate mbuf for promisc socket; o count in_msgtarget counter when we have secussfully sent data to socket; o Since we are sending messages in a loop, returning error on first fail interrupts the loop, and all remaining sockets will not receive this message. So, do not return error when we have failed to send data to ALL or REGISTERED target. Return error only for KEY_SENDUP_ONE case. Now, when some socket has overfilled its receive buffer, this will not break other sockets. MFC after: 2 weeks Modified: head/sys/netipsec/keysock.c Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Sun Mar 11 18:54:45 2018 (r330778) +++ head/sys/netipsec/keysock.c Sun Mar 11 19:14:01 2018 (r330779) @@ -178,7 +178,6 @@ key_sendup_mbuf(struct socket *so, struct mbuf *m, int { struct mbuf *n; struct keycb *kp; - int sendup; struct rawcb *rp; int error = 0; @@ -217,69 +216,50 @@ key_sendup_mbuf(struct socket *so, struct mbuf *m, int continue; } - kp = (struct keycb *)rp; - /* * If you are in promiscuous mode, and when you get broadcasted * reply, you'll get two PF_KEY messages. * (based on pf_key@inner.net message on 14 Oct 1998) */ - if (((struct keycb *)rp)->kp_promisc) { - if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) != NULL) { - (void)key_sendup0(rp, n, 1); - n = NULL; - } + kp = (struct keycb *)rp; + if (kp->kp_promisc) { + n = m_copym(m, 0, M_COPYALL, M_NOWAIT); + if (n != NULL) + key_sendup0(rp, n, 1); + else + PFKEYSTAT_INC(in_nomem); } /* the exact target will be processed later */ if (so && sotorawcb(so) == rp) continue; - sendup = 0; - switch (target) { - case KEY_SENDUP_ONE: - /* the statement has no effect */ - if (so && sotorawcb(so) == rp) - sendup++; - break; - case KEY_SENDUP_ALL: - sendup++; - break; - case KEY_SENDUP_REGISTERED: - if (kp->kp_registered) - sendup++; - break; - } - PFKEYSTAT_INC(in_msgtarget[target]); - - if (!sendup) + if (target == KEY_SENDUP_ONE || ( + target == KEY_SENDUP_REGISTERED && kp->kp_registered == 0)) continue; - if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { - m_freem(m); + /* KEY_SENDUP_ALL + KEY_SENDUP_REGISTERED */ + n = m_copym(m, 0, M_COPYALL, M_NOWAIT); + if (n == NULL) { PFKEYSTAT_INC(in_nomem); - mtx_unlock(&rawcb_mtx); - return ENOBUFS; + /* Try send to another socket */ + continue; } - if ((error = key_sendup0(rp, n, 0)) != 0) { - m_freem(m); - mtx_unlock(&rawcb_mtx); - return error; - } - - n = NULL; + if (key_sendup0(rp, n, 0) == 0) + PFKEYSTAT_INC(in_msgtarget[target]); } - if (so) { + if (so) { /* KEY_SENDUP_ONE */ error = key_sendup0(sotorawcb(so), m, 0); - m = NULL; + if (error == 0) + PFKEYSTAT_INC(in_msgtarget[KEY_SENDUP_ONE]); } else { error = 0; m_freem(m); } mtx_unlock(&rawcb_mtx); - return error; + return (error); } /* From owner-svn-src-head@freebsd.org Sun Mar 11 19:23:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 817D8F47F61; Sun, 11 Mar 2018 19:22:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54B387A2D4; Sun, 11 Mar 2018 19:22:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FB2F216D5; Sun, 11 Mar 2018 19:22:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2BJMxaC043087; Sun, 11 Mar 2018 19:22:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BJMwr8043084; Sun, 11 Mar 2018 19:22:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803111922.w2BJMwr8043084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 11 Mar 2018 19:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330780 - in head/sys: amd64/include isa x86/isa X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: amd64/include isa x86/isa X-SVN-Commit-Revision: 330780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 19:23:00 -0000 Author: ian Date: Sun Mar 11 19:22:58 2018 New Revision: 330780 URL: https://svnweb.freebsd.org/changeset/base/330780 Log: Eliminate atrtc_time_lock, and use atrtc_lock for efirtc locking. Modified: head/sys/amd64/include/efi.h head/sys/isa/rtc.h head/sys/x86/isa/atrtc.c Modified: head/sys/amd64/include/efi.h ============================================================================== --- head/sys/amd64/include/efi.h Sun Mar 11 19:14:01 2018 (r330779) +++ head/sys/amd64/include/efi.h Sun Mar 11 19:22:58 2018 (r330780) @@ -48,9 +48,9 @@ #ifdef _KERNEL #include -#define EFI_TIME_LOCK() mtx_lock(&atrtc_time_lock); -#define EFI_TIME_UNLOCK() mtx_unlock(&atrtc_time_lock); -#define EFI_TIME_OWNED() mtx_assert(&atrtc_time_lock, MA_OWNED); +#define EFI_TIME_LOCK() mtx_lock_spin(&atrtc_lock); +#define EFI_TIME_UNLOCK() mtx_unlock_spin(&atrtc_lock); +#define EFI_TIME_OWNED() mtx_assert(&atrtc_lock, MA_OWNED); #endif #endif /* __AMD64_INCLUDE_EFI_H_ */ Modified: head/sys/isa/rtc.h ============================================================================== --- head/sys/isa/rtc.h Sun Mar 11 19:14:01 2018 (r330779) +++ head/sys/isa/rtc.h Sun Mar 11 19:22:58 2018 (r330780) @@ -114,7 +114,7 @@ #define RTC_CENTURY 0x32 /* current century */ #ifdef _KERNEL -extern struct mtx atrtc_time_lock; +extern struct mtx atrtc_lock; extern int atrtcclock_disable; int rtcin(int reg); void atrtc_restore(void); Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Sun Mar 11 19:14:01 2018 (r330779) +++ head/sys/x86/isa/atrtc.c Sun Mar 11 19:22:58 2018 (r330780) @@ -56,16 +56,15 @@ __FBSDID("$FreeBSD$"); #include "clock_if.h" /* - * atrtc_lock protects low-level access to individual hardware registers. - * atrtc_time_lock protects the entire sequence of accessing multiple registers - * to read or write the date and time. + * atrtc_lock protects access to the RTC ioports, which are accessed by this + * driver, the nvram(4) driver (via rtcin()/writertc() calls), and the rtc code + * in efi runtime services. The efirt wrapper code directly locks atrtc lock + * using the EFI_TIME_LOCK/UNLOCK() macros which are defined to use this mutex + * on x86 platforms. */ -static struct mtx atrtc_lock; +struct mtx atrtc_lock; MTX_SYSINIT(atrtc_lock_init, &atrtc_lock, "atrtc", MTX_SPIN | MTX_NOPROFILE); -struct mtx atrtc_time_lock; -MTX_SYSINIT(atrtc_time_lock_init, &atrtc_time_lock, "atrtc", MTX_DEF); - int atrtcclock_disable = 0; static int rtc_reg = -1; @@ -328,7 +327,6 @@ atrtc_settime(device_t dev __unused, struct timespec * clock_ts_to_bcd(ts, &bct, false); clock_dbgprint_bcd(dev, CLOCK_DBG_WRITE, &bct); - mtx_lock(&atrtc_time_lock); mtx_lock_spin(&atrtc_lock); /* Disable RTC updates and interrupts. */ @@ -353,7 +351,6 @@ atrtc_settime(device_t dev __unused, struct timespec * rtcin_locked(RTC_INTR); mtx_unlock_spin(&atrtc_lock); - mtx_unlock(&atrtc_time_lock); return (0); } @@ -376,7 +373,6 @@ atrtc_gettime(device_t dev, struct timespec *ts) * to make sure that no more than 240us pass after we start reading, * and try again if so. */ - mtx_lock(&atrtc_time_lock); while (rtcin(RTC_STATUSA) & RTCSA_TUP) continue; mtx_lock_spin(&atrtc_lock); @@ -390,7 +386,6 @@ atrtc_gettime(device_t dev, struct timespec *ts) bct.year |= rtcin_locked(RTC_CENTURY) << 8; #endif mtx_unlock_spin(&atrtc_lock); - mtx_unlock(&atrtc_time_lock); /* dow is unused in timespec conversion and we have no nsec info. */ bct.dow = 0; bct.nsec = 0; From owner-svn-src-head@freebsd.org Sun Mar 11 19:26:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFC10F483FC; Sun, 11 Mar 2018 19:26:35 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 609827A51D; Sun, 11 Mar 2018 19:26:35 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40D22216D8; Sun, 11 Mar 2018 19:26:35 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2BJQZnk043245; Sun, 11 Mar 2018 19:26:35 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BJQZ0g043244; Sun, 11 Mar 2018 19:26:35 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201803111926.w2BJQZ0g043244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 11 Mar 2018 19:26:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330781 - head/lib/libipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/lib/libipsec X-SVN-Commit-Revision: 330781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 19:26:35 -0000 Author: ae Date: Sun Mar 11 19:26:34 2018 New Revision: 330781 URL: https://svnweb.freebsd.org/changeset/base/330781 Log: Update pfkey_open() function to set socket's write buffer size to 128k and receive buffer size to 2MB. In case if system has bigger default values, do not lower them. This should partially solve the problem, when setkey(8) returns EAGAIN error on systems with many SAs or SPs. PR: 88336 Obtained from: NetBSD/ipsec-tools MFC after: 2 weeks Modified: head/lib/libipsec/pfkey.c Modified: head/lib/libipsec/pfkey.c ============================================================================== --- head/lib/libipsec/pfkey.c Sun Mar 11 19:22:58 2018 (r330780) +++ head/lib/libipsec/pfkey.c Sun Mar 11 19:26:34 2018 (r330781) @@ -1595,10 +1595,12 @@ pfkey_send_x5(so, type, spid) * others : success and return value of socket. */ int -pfkey_open() +pfkey_open(void) { int so; - const int bufsiz = 128 * 1024; /*is 128K enough?*/ + int bufsiz_current, bufsiz_wanted; + int ret; + socklen_t len; if ((so = socket(PF_KEY, SOCK_RAW, PF_KEY_V2)) < 0) { __ipsec_set_strerror(strerror(errno)); @@ -1609,8 +1611,28 @@ pfkey_open() * This is a temporary workaround for KAME PR 154. * Don't really care even if it fails. */ - (void)setsockopt(so, SOL_SOCKET, SO_SNDBUF, &bufsiz, sizeof(bufsiz)); - (void)setsockopt(so, SOL_SOCKET, SO_RCVBUF, &bufsiz, sizeof(bufsiz)); + /* Try to have 128k. If we have more, do not lower it. */ + bufsiz_wanted = 128 * 1024; + len = sizeof(bufsiz_current); + ret = getsockopt(so, SOL_SOCKET, SO_SNDBUF, + &bufsiz_current, &len); + if ((ret < 0) || (bufsiz_current < bufsiz_wanted)) + (void)setsockopt(so, SOL_SOCKET, SO_SNDBUF, + &bufsiz_wanted, sizeof(bufsiz_wanted)); + + /* Try to have have at least 2MB. If we have more, do not lower it. */ + bufsiz_wanted = 2 * 1024 * 1024; + len = sizeof(bufsiz_current); + ret = getsockopt(so, SOL_SOCKET, SO_RCVBUF, + &bufsiz_current, &len); + if (ret < 0) + bufsiz_current = 128 * 1024; + + for (; bufsiz_wanted > bufsiz_current; bufsiz_wanted /= 2) { + if (setsockopt(so, SOL_SOCKET, SO_RCVBUF, + &bufsiz_wanted, sizeof(bufsiz_wanted)) == 0) + break; + } __ipsec_errcode = EIPSEC_NO_ERROR; return so; From owner-svn-src-head@freebsd.org Sun Mar 11 19:56:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C7E5F4A61D; Sun, 11 Mar 2018 19:56:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FC3C7BD88; Sun, 11 Mar 2018 19:56:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AB2621B9E; Sun, 11 Mar 2018 19:56:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2BJu8is058397; Sun, 11 Mar 2018 19:56:08 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BJu8vt058396; Sun, 11 Mar 2018 19:56:08 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803111956.w2BJu8vt058396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 11 Mar 2018 19:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330782 - head/sys/x86/isa X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/x86/isa X-SVN-Commit-Revision: 330782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 19:56:08 -0000 Author: ian Date: Sun Mar 11 19:56:07 2018 New Revision: 330782 URL: https://svnweb.freebsd.org/changeset/base/330782 Log: Remove MTX_NOPROFILE from atrtc_lock, it was inappropriately copy/pasted from the i8254 driver when I created separate mutexes for each. The i8254 driver could be the active timecounter, leading to recursion during mutex profiling, but the atrtc driver cannot be a timecounter, so it isn't needed. Modified: head/sys/x86/isa/atrtc.c Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Sun Mar 11 19:26:34 2018 (r330781) +++ head/sys/x86/isa/atrtc.c Sun Mar 11 19:56:07 2018 (r330782) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); * on x86 platforms. */ struct mtx atrtc_lock; -MTX_SYSINIT(atrtc_lock_init, &atrtc_lock, "atrtc", MTX_SPIN | MTX_NOPROFILE); +MTX_SYSINIT(atrtc_lock_init, &atrtc_lock, "atrtc", MTX_SPIN); int atrtcclock_disable = 0; From owner-svn-src-head@freebsd.org Sun Mar 11 19:58:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5E9FF4A868; Sun, 11 Mar 2018 19:58:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13EF77BF80; Sun, 11 Mar 2018 19:58:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w2BJw0Rl066292 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 11 Mar 2018 21:58:04 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w2BJw0Rl066292 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w2BJw00A066291; Sun, 11 Mar 2018 21:58:00 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 11 Mar 2018 21:58:00 +0200 From: Konstantin Belousov To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330780 - in head/sys: amd64/include isa x86/isa Message-ID: <20180311195800.GC76926@kib.kiev.ua> References: <201803111922.w2BJMwr8043084@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201803111922.w2BJMwr8043084@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 19:58:12 -0000 On Sun, Mar 11, 2018 at 07:22:58PM +0000, Ian Lepore wrote: > Author: ian > Date: Sun Mar 11 19:22:58 2018 > New Revision: 330780 > URL: https://svnweb.freebsd.org/changeset/base/330780 > > Log: > Eliminate atrtc_time_lock, and use atrtc_lock for efirtc locking. > > Modified: > head/sys/amd64/include/efi.h > head/sys/isa/rtc.h > head/sys/x86/isa/atrtc.c > > Modified: head/sys/amd64/include/efi.h > ============================================================================== > --- head/sys/amd64/include/efi.h Sun Mar 11 19:14:01 2018 (r330779) > +++ head/sys/amd64/include/efi.h Sun Mar 11 19:22:58 2018 (r330780) > @@ -48,9 +48,9 @@ > #ifdef _KERNEL > #include > > -#define EFI_TIME_LOCK() mtx_lock(&atrtc_time_lock); > -#define EFI_TIME_UNLOCK() mtx_unlock(&atrtc_time_lock); > -#define EFI_TIME_OWNED() mtx_assert(&atrtc_time_lock, MA_OWNED); > +#define EFI_TIME_LOCK() mtx_lock_spin(&atrtc_lock); > +#define EFI_TIME_UNLOCK() mtx_unlock_spin(&atrtc_lock); > +#define EFI_TIME_OWNED() mtx_assert(&atrtc_lock, MA_OWNED); I do not understand how this can work. You changed EFI_TIME_LOCK() to spinlock. As result, the spinlock is taken before efi_enter() is called. efi_enter() locks the pmap and efi_lock, both of which are sleepable mutexes. Also, arch efirt code is allowed to take arch-specific sleepable mutexes and perhaps some spinlocks (but currently does not). The first context switch when either of the listed sleepable mutexes are contested and the thread is taken off CPU would panic. I suspect that some invariants check might fire earlier. From owner-svn-src-head@freebsd.org Sun Mar 11 19:58:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E74C4F4A935 for ; Sun, 11 Mar 2018 19:58:49 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65BDA7C0DA for ; Sun, 11 Mar 2018 19:58:49 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 551ef653-2566-11e8-b951-f99fef315fd9 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 outbound2.ore.mailhop.org (Halon) with ESMTPSA id 551ef653-2566-11e8-b951-f99fef315fd9; Sun, 11 Mar 2018 19:56:48 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w2BJvcQZ014192; Sun, 11 Mar 2018 13:57:38 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1520798258.84937.147.camel@freebsd.org> Subject: Re: svn commit: r330782 - head/sys/x86/isa From: Ian Lepore To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 11 Mar 2018 13:57:38 -0600 In-Reply-To: <201803111956.w2BJu8vt058396@repo.freebsd.org> References: <201803111956.w2BJu8vt058396@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 19:58:50 -0000 On Sun, 2018-03-11 at 19:56 +0000, Ian Lepore wrote: > Author: ian > Date: Sun Mar 11 19:56:07 2018 > New Revision: 330782 > URL: https://svnweb.freebsd.org/changeset/base/330782 > > Log: >   Remove MTX_NOPROFILE from atrtc_lock, it was inappropriately copy/pasted >   from the i8254 driver when I created separate mutexes for each.  The i8254 >   driver could be the active timecounter, leading to recursion during mutex >   profiling, but the atrtc driver cannot be a timecounter, so it isn't needed. > > Modified: >   head/sys/x86/isa/atrtc.c Oops, should have included: Pointed out by: bde. -- Ian From owner-svn-src-head@freebsd.org Sun Mar 11 20:13:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFB4FF4B8A3; Sun, 11 Mar 2018 20:13:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61D2C7CBD4; Sun, 11 Mar 2018 20:13:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 592F721EB3; Sun, 11 Mar 2018 20:13:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2BKDGNr068441; Sun, 11 Mar 2018 20:13:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BKDGJW068438; Sun, 11 Mar 2018 20:13:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803112013.w2BKDGJW068438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 11 Mar 2018 20:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330783 - in head/sys: amd64/include isa x86/isa X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: amd64/include isa x86/isa X-SVN-Commit-Revision: 330783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 20:13:17 -0000 Author: ian Date: Sun Mar 11 20:13:15 2018 New Revision: 330783 URL: https://svnweb.freebsd.org/changeset/base/330783 Log: Revert r330780, it was improperly tested and results in taking a spin mutex before acquiring sleep mutexes. Reported by: kib@ Modified: head/sys/amd64/include/efi.h head/sys/isa/rtc.h head/sys/x86/isa/atrtc.c Modified: head/sys/amd64/include/efi.h ============================================================================== --- head/sys/amd64/include/efi.h Sun Mar 11 19:56:07 2018 (r330782) +++ head/sys/amd64/include/efi.h Sun Mar 11 20:13:15 2018 (r330783) @@ -48,9 +48,9 @@ #ifdef _KERNEL #include -#define EFI_TIME_LOCK() mtx_lock_spin(&atrtc_lock); -#define EFI_TIME_UNLOCK() mtx_unlock_spin(&atrtc_lock); -#define EFI_TIME_OWNED() mtx_assert(&atrtc_lock, MA_OWNED); +#define EFI_TIME_LOCK() mtx_lock(&atrtc_time_lock); +#define EFI_TIME_UNLOCK() mtx_unlock(&atrtc_time_lock); +#define EFI_TIME_OWNED() mtx_assert(&atrtc_time_lock, MA_OWNED); #endif #endif /* __AMD64_INCLUDE_EFI_H_ */ Modified: head/sys/isa/rtc.h ============================================================================== --- head/sys/isa/rtc.h Sun Mar 11 19:56:07 2018 (r330782) +++ head/sys/isa/rtc.h Sun Mar 11 20:13:15 2018 (r330783) @@ -114,7 +114,7 @@ #define RTC_CENTURY 0x32 /* current century */ #ifdef _KERNEL -extern struct mtx atrtc_lock; +extern struct mtx atrtc_time_lock; extern int atrtcclock_disable; int rtcin(int reg); void atrtc_restore(void); Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Sun Mar 11 19:56:07 2018 (r330782) +++ head/sys/x86/isa/atrtc.c Sun Mar 11 20:13:15 2018 (r330783) @@ -56,15 +56,16 @@ __FBSDID("$FreeBSD$"); #include "clock_if.h" /* - * atrtc_lock protects access to the RTC ioports, which are accessed by this - * driver, the nvram(4) driver (via rtcin()/writertc() calls), and the rtc code - * in efi runtime services. The efirt wrapper code directly locks atrtc lock - * using the EFI_TIME_LOCK/UNLOCK() macros which are defined to use this mutex - * on x86 platforms. + * atrtc_lock protects low-level access to individual hardware registers. + * atrtc_time_lock protects the entire sequence of accessing multiple registers + * to read or write the date and time. */ -struct mtx atrtc_lock; +static struct mtx atrtc_lock; MTX_SYSINIT(atrtc_lock_init, &atrtc_lock, "atrtc", MTX_SPIN); +struct mtx atrtc_time_lock; +MTX_SYSINIT(atrtc_time_lock_init, &atrtc_time_lock, "atrtc", MTX_DEF); + int atrtcclock_disable = 0; static int rtc_reg = -1; @@ -327,6 +328,7 @@ atrtc_settime(device_t dev __unused, struct timespec * clock_ts_to_bcd(ts, &bct, false); clock_dbgprint_bcd(dev, CLOCK_DBG_WRITE, &bct); + mtx_lock(&atrtc_time_lock); mtx_lock_spin(&atrtc_lock); /* Disable RTC updates and interrupts. */ @@ -351,6 +353,7 @@ atrtc_settime(device_t dev __unused, struct timespec * rtcin_locked(RTC_INTR); mtx_unlock_spin(&atrtc_lock); + mtx_unlock(&atrtc_time_lock); return (0); } @@ -373,6 +376,7 @@ atrtc_gettime(device_t dev, struct timespec *ts) * to make sure that no more than 240us pass after we start reading, * and try again if so. */ + mtx_lock(&atrtc_time_lock); while (rtcin(RTC_STATUSA) & RTCSA_TUP) continue; mtx_lock_spin(&atrtc_lock); @@ -386,6 +390,7 @@ atrtc_gettime(device_t dev, struct timespec *ts) bct.year |= rtcin_locked(RTC_CENTURY) << 8; #endif mtx_unlock_spin(&atrtc_lock); + mtx_unlock(&atrtc_time_lock); /* dow is unused in timespec conversion and we have no nsec info. */ bct.dow = 0; bct.nsec = 0; From owner-svn-src-head@freebsd.org Sun Mar 11 20:20:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0502AF4BE6B for ; Sun, 11 Mar 2018 20:20:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 836477CE9D for ; Sun, 11 Mar 2018 20:20:43 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 8c7d885f-2569-11e8-b951-f99fef315fd9 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 outbound2.ore.mailhop.org (Halon) with ESMTPSA id 8c7d885f-2569-11e8-b951-f99fef315fd9; Sun, 11 Mar 2018 20:19:49 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w2BKKd4A014277; Sun, 11 Mar 2018 14:20:40 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1520799639.84937.154.camel@freebsd.org> Subject: Re: svn commit: r330780 - in head/sys: amd64/include isa x86/isa From: Ian Lepore To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 11 Mar 2018 14:20:39 -0600 In-Reply-To: <20180311195800.GC76926@kib.kiev.ua> References: <201803111922.w2BJMwr8043084@repo.freebsd.org> <20180311195800.GC76926@kib.kiev.ua> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 20:20:44 -0000 On Sun, 2018-03-11 at 21:58 +0200, Konstantin Belousov wrote: > On Sun, Mar 11, 2018 at 07:22:58PM +0000, Ian Lepore wrote: > > > > Author: ian > > Date: Sun Mar 11 19:22:58 2018 > > New Revision: 330780 > > URL: https://svnweb.freebsd.org/changeset/base/330780 > > > > Log: > >   Eliminate atrtc_time_lock, and use atrtc_lock for efirtc locking. > > > > Modified: > >   head/sys/amd64/include/efi.h > >   head/sys/isa/rtc.h > >   head/sys/x86/isa/atrtc.c > > > > Modified: head/sys/amd64/include/efi.h > > ============================================================================== > > --- head/sys/amd64/include/efi.h Sun Mar 11 19:14:01 2018 (r330779) > > +++ head/sys/amd64/include/efi.h Sun Mar 11 19:22:58 2018 (r330780) > > @@ -48,9 +48,9 @@ > >  #ifdef _KERNEL > >  #include > >   > > -#define EFI_TIME_LOCK() mtx_lock(&atrtc_time_lock); > > -#define EFI_TIME_UNLOCK() mtx_unlock(&atrtc_time_lock); > > -#define EFI_TIME_OWNED() mtx_assert(&atrtc_time_lock, MA_OWNED); > > +#define EFI_TIME_LOCK() mtx_lock_spin(&atrtc_lock); > > +#define EFI_TIME_UNLOCK() mtx_unlock_spin(&atrtc_lock); > > +#define EFI_TIME_OWNED() mtx_assert(&atrtc_lock, MA_OWNED); > I do not understand how this can work. You changed EFI_TIME_LOCK() to > spinlock.  As result, the spinlock is taken before efi_enter() is called. > efi_enter() locks the pmap and efi_lock, both of which are sleepable > mutexes.  Also, arch efirt code is allowed to take arch-specific > sleepable mutexes and perhaps some spinlocks (but currently does not). > > The first context switch when either of the listed sleepable mutexes > are contested and the thread is taken off CPU would panic.  I suspect > that some invariants check might fire earlier. > Oops, sure enough; I reverted it. I think I knew that about efi_enter() at one time, but I had completely forgotten it did any locking.  I just realized my only efi-capable machine that I tested this on has virtually all debugging and witness disabled, so I didn't really give it much of a test after all. Unfortunately, this reverts one type of wrong locking back to another.  The need is to prevent access to the atrtc hardware if efi is accessing it, and the locking I just reverted to that uses a sleepable mutex only protects against inittodr()/resettodr() access, but not against nvram(4) or if the atrtc is being used as an eventtimer (of course nobody uses it for that, but the driver supports it). I have some pending changes that cause the atrtc driver to just not attach at all if the efirtc driver attached, but they're stacked up behind some other changes in phab.  And that still doesn't fix the nvram(4) part of it. -- Ian From owner-svn-src-head@freebsd.org Sun Mar 11 21:25:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A418F50A1E; Sun, 11 Mar 2018 21:25:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0126D804D7; Sun, 11 Mar 2018 21:25:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w2BLPd8g086177 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 11 Mar 2018 23:25:43 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w2BLPd8g086177 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w2BLPdrF086175; Sun, 11 Mar 2018 23:25:39 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 11 Mar 2018 23:25:39 +0200 From: Konstantin Belousov To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330780 - in head/sys: amd64/include isa x86/isa Message-ID: <20180311212539.GD76926@kib.kiev.ua> References: <201803111922.w2BJMwr8043084@repo.freebsd.org> <20180311195800.GC76926@kib.kiev.ua> <1520799639.84937.154.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1520799639.84937.154.camel@freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 21:25:51 -0000 On Sun, Mar 11, 2018 at 02:20:39PM -0600, Ian Lepore wrote: > On Sun, 2018-03-11 at 21:58 +0200, Konstantin Belousov wrote: > > On Sun, Mar 11, 2018 at 07:22:58PM +0000, Ian Lepore wrote: > > > > > > Author: ian > > > Date: Sun Mar 11 19:22:58 2018 > > > New Revision: 330780 > > > URL: https://svnweb.freebsd.org/changeset/base/330780 > > > > > > Log: > > > š Eliminate atrtc_time_lock, and use atrtc_lock for efirtc locking. > > > > > > Modified: > > > š head/sys/amd64/include/efi.h > > > š head/sys/isa/rtc.h > > > š head/sys/x86/isa/atrtc.c > > > > > > Modified: head/sys/amd64/include/efi.h > > > ============================================================================== > > > --- head/sys/amd64/include/efi.h Sun Mar 11 19:14:01 2018 (r330779) > > > +++ head/sys/amd64/include/efi.h Sun Mar 11 19:22:58 2018 (r330780) > > > @@ -48,9 +48,9 @@ > > > š#ifdef _KERNEL > > > š#include > > > š > > > -#define EFI_TIME_LOCK() mtx_lock(&atrtc_time_lock); > > > -#define EFI_TIME_UNLOCK() mtx_unlock(&atrtc_time_lock); > > > -#define EFI_TIME_OWNED() mtx_assert(&atrtc_time_lock, MA_OWNED); > > > +#define EFI_TIME_LOCK() mtx_lock_spin(&atrtc_lock); > > > +#define EFI_TIME_UNLOCK() mtx_unlock_spin(&atrtc_lock); > > > +#define EFI_TIME_OWNED() mtx_assert(&atrtc_lock, MA_OWNED); > > I do not understand how this can work. You changed EFI_TIME_LOCK() to > > spinlock.ššAs result, the spinlock is taken before efi_enter() is called. > > efi_enter() locks the pmap and efi_lock, both of which are sleepable > > mutexes.ššAlso, arch efirt code is allowed to take arch-specific > > sleepable mutexes and perhaps some spinlocks (but currently does not). > > > > The first context switch when either of the listed sleepable mutexes > > are contested and the thread is taken off CPU would panic.ššI suspect > > that some invariants check might fire earlier. > > > > Oops, sure enough; I reverted it. > > I think I knew that about efi_enter() at one time, but I had completely > forgotten it did any locking. šI just realized my only efi-capable > machine that I tested this on has virtually all debugging and witness > disabled, so I didn't really give it much of a test after all. > > Unfortunately, this reverts one type of wrong locking back to another. > šThe need is to prevent access to the atrtc hardware if efi is > accessing it, and the locking I just reverted to that uses a sleepable > mutex only protects against inittodr()/resettodr() access, but not > against nvram(4) or if the atrtc is being used as an eventtimer (of > course nobody uses it for that, but the driver supports it). > > I have some pending changes that cause the atrtc driver to just not > attach at all if the efirtc driver attached, but they're stacked up > behind some other changes in phab. šAnd that still doesn't fix the > nvram(4) part of it. Not attaching atrtc if efirtc is attached sounds reasonable. But then you should also disable efirt attach if atrtc is on. One possible issue is that efirt is typicall loadable, while atrtc is compiled into the kernel, which means that efirt would become virtually unusable. For nvram(4), you can take the atrtc_time_lock around accesses in addition to the atrtc_lock, instead of providing exclusivity on the level of drivers attach. From owner-svn-src-head@freebsd.org Sun Mar 11 23:14:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A09A5F2EEBC; Sun, 11 Mar 2018 23:14:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43EAA84409; Sun, 11 Mar 2018 23:14:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 163C823B30; Sun, 11 Mar 2018 23:14:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2BNEo7t059054; Sun, 11 Mar 2018 23:14:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2BNEoOX059053; Sun, 11 Mar 2018 23:14:50 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201803112314.w2BNEoOX059053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 11 Mar 2018 23:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330785 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 330785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 23:14:51 -0000 Author: manu Date: Sun Mar 11 23:14:50 2018 New Revision: 330785 URL: https://svnweb.freebsd.org/changeset/base/330785 Log: arm: Remove SoC Specific -MMCCAM kernelconfig One should use the GENERIC-MMCCAM for this. Deleted: head/sys/arm/conf/BEAGLEBONE-MMCCAM head/sys/arm/conf/IMX6-MMCCAM From owner-svn-src-head@freebsd.org Mon Mar 12 01:41:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F46CF3AC20; Mon, 12 Mar 2018 01:41:17 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C27E288E48; Mon, 12 Mar 2018 01:41:16 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD64525135; Mon, 12 Mar 2018 01:41:16 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2C1fGP9029646; Mon, 12 Mar 2018 01:41:16 GMT (envelope-from gad@FreeBSD.org) Received: (from gad@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2C1fGrU029645; Mon, 12 Mar 2018 01:41:16 GMT (envelope-from gad@FreeBSD.org) Message-Id: <201803120141.w2C1fGrU029645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gad set sender to gad@FreeBSD.org using -f From: Garance A Drosehn Date: Mon, 12 Mar 2018 01:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330787 - head/usr.sbin/lpr/common_source X-SVN-Group: head X-SVN-Commit-Author: gad X-SVN-Commit-Paths: head/usr.sbin/lpr/common_source X-SVN-Commit-Revision: 330787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 01:41:17 -0000 Author: gad Date: Mon Mar 12 01:41:16 2018 New Revision: 330787 URL: https://svnweb.freebsd.org/changeset/base/330787 Log: Fix the resource leak of a 'FILE *' which could happen in routine ctl_readcf() if a call to malloc failed. PR: 204955 Reported by: David Binderman Modified: head/usr.sbin/lpr/common_source/ctlinfo.c Modified: head/usr.sbin/lpr/common_source/ctlinfo.c ============================================================================== --- head/usr.sbin/lpr/common_source/ctlinfo.c Mon Mar 12 00:33:01 2018 (r330786) +++ head/usr.sbin/lpr/common_source/ctlinfo.c Mon Mar 12 01:41:16 2018 (r330787) @@ -292,8 +292,10 @@ ctl_readcf(const char *ptrname, const char *cfname) msize = sroom2 + CTI_LINEMAX; msize = roundup(msize, 8); cstart = malloc(msize); - if (cstart == NULL) + if (cstart == NULL) { + fclose(cfile); return NULL; + } memset(cstart, 0, msize); cpriv = (struct cjprivate *)cstart; cpriv->pub.cji_priv = cpriv; From owner-svn-src-head@freebsd.org Mon Mar 12 03:17:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AED3F4353E; Mon, 12 Mar 2018 03:17:05 +0000 (UTC) (envelope-from dexuan.bsd@gmail.com) Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED3568C0B6; Mon, 12 Mar 2018 03:17:04 +0000 (UTC) (envelope-from dexuan.bsd@gmail.com) Received: by mail-lf0-x242.google.com with SMTP id l191-v6so20965872lfe.1; Sun, 11 Mar 2018 20:17:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=m0BriEnHIwwJO/s4ChZE2/2xCTAZBxX8RGTJsQkG95c=; b=or6/gWqB4Q66nGp73qdkVaOWCAqxu7Wwltn2aek66yTht6cwIU4sT/Nc2CSz8ViUKz a7veL0JVAv3CN6svfJpiBninzTXpGTOUAbup2cUYKIqtIV9lPJ/WB8aCELanDX3jMwPM MMOcN9f2sF2KSTTRhgf2pSKyNTLA+lqhY56+Nd3hqyIyZnHvd5ewTeeGvXax7LnJObzL Z9FIEeFWgVSJhsrwL3r2NUqAzjZPmKyIGYtKyYVNGbtZd9b6HilYiYFfgkRHtulARSxx Mf9RdqX/w7HuDqaBNdFLPrAI0edmC7aPVyToCkh+rieiErS7emdku5ALs0mpscQY/vAe g5JA== 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=m0BriEnHIwwJO/s4ChZE2/2xCTAZBxX8RGTJsQkG95c=; b=dY1Nfcop+9Vl5LG6LHNGSbYNLZsEKhGMj+4kehk6+J9VyVsO5Hd5QP0qXqrOfSL+O7 Q+dS3dV7z2bRvaqfYLQ4Ss7/amNtroULsh6kVgDZqJjm1ScB3a81GUO4evCev4ewPtTy +fVuuxwIcVcy5FmfvAaTOKvfgnzaDxzYjFzRB2pSULTOHlRfVMVi51Id+LOOrdhXSJWw I/2Hz+HfWITvbcRzB+PXKm5pSaI7nyBcob3Jlrsy+Y5xt+iERt3vFB+qHQcEkbYVFP6b NDC+j9ezC8B+oZlZzMFztte5e5+lXi+ds3MnJrFpeE9Ubuj2W585WvXqMnY0cRoLVm45 vaTg== X-Gm-Message-State: AElRT7FWi0bPjZ01ubfQrxdRZg8HGFFfpPHSrfCzHRM3SZoq23kkX0Ht dPji3nCxEYxIJ/9h1Hln1VHZEZGDvn4EuPAo8p8= X-Google-Smtp-Source: AG47ELuor/GJ1i4vGj+7YcyAwuvfCwGm4AV7M6BXkzGIfqydizIsB+eSiE1Vdc/Hn/+SzxG9GA9a0cU3Bp47bmkw9jk= X-Received: by 10.46.89.213 with SMTP id g82mr4153059ljf.105.1520824622575; Sun, 11 Mar 2018 20:17:02 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:d8e8:0:0:0:0:0 with HTTP; Sun, 11 Mar 2018 20:17:02 -0700 (PDT) In-Reply-To: <201801291807.w0TI7EVD092154@repo.freebsd.org> References: <201801291807.w0TI7EVD092154@repo.freebsd.org> From: Dexuan-BSD Cui Date: Sun, 11 Mar 2018 20:17:02 -0700 Message-ID: Subject: Re: svn commit: r328554 - head/sys/cam/scsi To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Dexuan Cui Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 03:17:05 -0000 Hi imp and all, I think this patch is very important, because it can fix a panic I noticed recently when I try to hot-remove a SCSI disk from a VM running on Azure/Hyper-V. The panic is almost 100% reproducible with stable/11, but not in the latest CURRENT code, so finally I identified this fix in the CURRENT branch. Can you please MFC this patch to 11 and 10? It looks there is a major difference in the CAM code between 11/10 and the CURRENT code, and we may have to MFC more related patches. If this is difficult, I hope at least we can provide a minimal re-written version of the patch to 11 and 10? Looking forward to your insight! Thanks, -- Dexuan On Mon, Jan 29, 2018 at 10:07 AM, Warner Losh wrote: > Author: imp > Date: Mon Jan 29 18:07:14 2018 > New Revision: 328554 > URL: https://svnweb.freebsd.org/changeset/base/328554 > > Log: > Do the book-keeping on release before we release the reference. The > periph was going away on final release, and then returning and we > started dancing in free memory. > > Sponsored by: Netflix > > Modified: > head/sys/cam/scsi/scsi_da.c > > Modified: head/sys/cam/scsi/scsi_da.c > ============================================================================== > --- head/sys/cam/scsi/scsi_da.c Mon Jan 29 17:32:30 2018 (r328553) > +++ head/sys/cam/scsi/scsi_da.c Mon Jan 29 18:07:14 2018 (r328554) > @@ -1549,12 +1549,12 @@ da_periph_unhold(struct cam_periph *periph, da_ref_tok > struct da_softc *softc = periph->softc; > > token_sanity(token); > - cam_periph_unhold(periph); > DA_PERIPH_PRINT(periph, "Unholding device %s (%d)\n", > da_ref_text[token], token); > cnt = atomic_fetchadd_int(&softc->ref_flags[token], -1); > if (cnt != 1) > panic("Unholding %d with cnt = %d", token, cnt); > + cam_periph_unhold(periph); > } > > static inline int > @@ -1583,12 +1583,12 @@ da_periph_release(struct cam_periph *periph, da_ref_to > struct da_softc *softc = periph->softc; > > token_sanity(token); > - cam_periph_release(periph); > DA_PERIPH_PRINT(periph, "releasing device %s (%d)\n", > da_ref_text[token], token); > cnt = atomic_fetchadd_int(&softc->ref_flags[token], -1); > if (cnt != 1) > panic("Releasing %d with cnt = %d", token, cnt); > + cam_periph_release(periph); > } > > static inline void > @@ -1598,12 +1598,12 @@ da_periph_release_locked(struct cam_periph *periph, da > struct da_softc *softc = periph->softc; > > token_sanity(token); > - cam_periph_release_locked(periph); > DA_PERIPH_PRINT(periph, "releasing device (locked) %s (%d)\n", > da_ref_text[token], token); > cnt = atomic_fetchadd_int(&softc->ref_flags[token], -1); > if (cnt != 1) > panic("Unholding %d with cnt = %d", token, cnt); > + cam_periph_release_locked(periph); > } > > #define cam_periph_hold POISON > From owner-svn-src-head@freebsd.org Mon Mar 12 03:54:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C51F4F45DEE; Mon, 12 Mar 2018 03:54:39 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 786578D912; Mon, 12 Mar 2018 03:54:39 +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 5A8CF26754; Mon, 12 Mar 2018 03:54:39 +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 w2C3sdaK097655; Mon, 12 Mar 2018 03:54:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2C3scFa097651; Mon, 12 Mar 2018 03:54:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803120354.w2C3scFa097651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 12 Mar 2018 03:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330788 - in head/stand/mips/beri: boot2 common loader X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand/mips/beri: boot2 common loader X-SVN-Commit-Revision: 330788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 03:54:40 -0000 Author: kevans Date: Mon Mar 12 03:54:38 2018 New Revision: 330788 URL: https://svnweb.freebsd.org/changeset/base/330788 Log: beri loader: Replace getc/putc with beri_ prefixed versions This matches a convention that we use, at least in ubldr, to prefix getc/putc with a loader-specific prefix to avoid collisions. This was encountered while trying to build the beri loader with MK_LOADER_LUA=yes. No objection from: brooks Reported by: emaste Modified: head/stand/mips/beri/boot2/boot2.c head/stand/mips/beri/common/altera_jtag_uart.c head/stand/mips/beri/common/cons.h head/stand/mips/beri/loader/beri_console.c Modified: head/stand/mips/beri/boot2/boot2.c ============================================================================== --- head/stand/mips/beri/boot2/boot2.c Mon Mar 12 01:41:16 2018 (r330787) +++ head/stand/mips/beri/boot2/boot2.c Mon Mar 12 03:54:38 2018 (r330788) @@ -627,7 +627,7 @@ static int xputc(int c) { if (ioctrl & IO_KEYBOARD) - putc(c); + beri_putc(c); #if 0 if (ioctrl & IO_SERIAL) sio_putc(c); @@ -642,7 +642,7 @@ xgetc(int fn) return 0; for (;;) { if (ioctrl & IO_KEYBOARD && keyhit(0)) - return fn ? 1 : getc(); + return fn ? 1 : beri_getc(); #if 0 if (ioctrl & IO_SERIAL && sio_ischar()) return fn ? 1 : sio_getc(); Modified: head/stand/mips/beri/common/altera_jtag_uart.c ============================================================================== --- head/stand/mips/beri/common/altera_jtag_uart.c Mon Mar 12 01:41:16 2018 (r330787) +++ head/stand/mips/beri/common/altera_jtag_uart.c Mon Mar 12 03:54:38 2018 (r330788) @@ -159,7 +159,7 @@ keyhit(int seconds) } int -getc(void) +beri_getc(void) { while (!(uart_readable())); @@ -168,7 +168,7 @@ getc(void) } void -putc(int ch) +beri_putc(int ch) { uart_data_write(ch); Modified: head/stand/mips/beri/common/cons.h ============================================================================== --- head/stand/mips/beri/common/cons.h Mon Mar 12 01:41:16 2018 (r330787) +++ head/stand/mips/beri/common/cons.h Mon Mar 12 03:54:38 2018 (r330788) @@ -33,8 +33,8 @@ #ifndef _CONS_H_ #define _CONS_H_ -int getc(void); +int beri_getc(void); int keyhit(int); -void putc(int); +void beri_putc(int); #endif Modified: head/stand/mips/beri/loader/beri_console.c ============================================================================== --- head/stand/mips/beri/loader/beri_console.c Mon Mar 12 01:41:16 2018 (r330787) +++ head/stand/mips/beri/loader/beri_console.c Mon Mar 12 03:54:38 2018 (r330788) @@ -72,14 +72,14 @@ static void c_out(int c) { - putc(c); + beri_putc(c); } static int c_in(void) { - return (getc()); + return (beri_getc()); } static int From owner-svn-src-head@freebsd.org Mon Mar 12 05:02:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1C50F49E7A; Mon, 12 Mar 2018 05:02:22 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A86648F935; Mon, 12 Mar 2018 05:02:22 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A35582721F; Mon, 12 Mar 2018 05:02:22 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2C52M3m032165; Mon, 12 Mar 2018 05:02:22 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2C52MUv032163; Mon, 12 Mar 2018 05:02:22 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201803120502.w2C52MUv032163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 12 Mar 2018 05:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330789 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 330789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 05:02:23 -0000 Author: scottl Date: Mon Mar 12 05:02:22 2018 New Revision: 330789 URL: https://svnweb.freebsd.org/changeset/base/330789 Log: Implement a sysctl to dump in-flight I/O state for debugging. The tool to parse it will be committed in a separate action. Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mps/mps.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Mon Mar 12 03:54:38 2018 (r330788) +++ head/sys/dev/mpr/mpr.c Mon Mar 12 05:02:22 2018 (r330789) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -107,6 +108,7 @@ static void mpr_enqueue_request(struct mpr_softc *sc, static int mpr_get_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts); static int mpr_wait_db_ack(struct mpr_softc *sc, int timeout, int sleep_flag); static int mpr_debug_sysctl(SYSCTL_HANDLER_ARGS); +static int mpr_dump_reqs(SYSCTL_HANDLER_ARGS); static void mpr_parse_debug(struct mpr_softc *sc, char *list); SYSCTL_NODE(_hw, OID_AUTO, mpr, CTLFLAG_RD, 0, "MPR Driver Parameters"); @@ -1910,6 +1912,10 @@ mpr_setup_sysctl(struct mpr_softc *sc) &sc->spinup_wait_time, DEFAULT_SPINUP_WAIT, "seconds to wait for " "spinup after SATA ID error"); + SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "dump_reqs", CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_SKIP, sc, 0, + mpr_dump_reqs, "I", "Dump Active Requests"); + SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "use_phy_num", CTLFLAG_RD, &sc->use_phynum, 0, "Use the phy number for enumeration"); @@ -2051,6 +2057,70 @@ mpr_parse_debug(struct mpr_softc *sc, char *list) break; } return; +} + +struct mpr_dumpreq_hdr { + uint32_t smid; + uint32_t state; + uint32_t numframes; + uint32_t deschi; + uint32_t desclo; +}; + +static int +mpr_dump_reqs(SYSCTL_HANDLER_ARGS) +{ + struct mpr_softc *sc; + struct mpr_chain *chain, *chain1; + struct mpr_command *cm; + struct mpr_dumpreq_hdr hdr; + struct sbuf *sb; + uint32_t smid, state; + int i, numreqs, error = 0; + + sc = (struct mpr_softc *)arg1; + + if ((error = priv_check(curthread, PRIV_DRIVER)) != 0) { + printf("priv check error %d\n", error); + return (error); + } + + state = MPR_CM_STATE_INQUEUE; + smid = 1; + numreqs = sc->num_reqs; + + if (req->newptr != NULL) + return (EINVAL); + + if (smid == 0 || smid > sc->num_reqs) + return (EINVAL); + if (numreqs <= 0 || (numreqs + smid > sc->num_reqs)) + numreqs = sc->num_reqs; + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + + /* Best effort, no locking */ + for (i = smid; i < numreqs; i++) { + cm = &sc->commands[i]; + if (cm->cm_state != state) + continue; + hdr.smid = i; + hdr.state = cm->cm_state; + hdr.numframes = 1; + hdr.deschi = cm->cm_desc.Words.High; + hdr.desclo = cm->cm_desc.Words.Low; + TAILQ_FOREACH_SAFE(chain, &cm->cm_chain_list, chain_link, + chain1) + hdr.numframes++; + sbuf_bcat(sb, &hdr, sizeof(hdr)); + sbuf_bcat(sb, cm->cm_req, 128); + TAILQ_FOREACH_SAFE(chain, &cm->cm_chain_list, chain_link, + chain1) + sbuf_bcat(sb, chain->chain, 128); + } + + error = sbuf_finish(sb); + sbuf_delete(sb); + return (error); } int Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Mon Mar 12 03:54:38 2018 (r330788) +++ head/sys/dev/mps/mps.c Mon Mar 12 05:02:22 2018 (r330789) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -106,6 +107,7 @@ static void mps_enqueue_request(struct mps_softc *sc, static int mps_get_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts); static int mps_wait_db_ack(struct mps_softc *sc, int timeout, int sleep_flag); static int mps_debug_sysctl(SYSCTL_HANDLER_ARGS); +static int mps_dump_reqs(SYSCTL_HANDLER_ARGS); static void mps_parse_debug(struct mps_softc *sc, char *list); SYSCTL_NODE(_hw, OID_AUTO, mps, CTLFLAG_RD, 0, "MPS Driver Parameters"); @@ -1793,6 +1795,10 @@ mps_setup_sysctl(struct mps_softc *sc) OID_AUTO, "encl_table_dump", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, mps_mapping_encl_dump, "A", "Enclosure Table Dump"); + SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "dump_reqs", CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_SKIP, sc, 0, + mps_dump_reqs, "I", "Dump Active Requests"); + SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "use_phy_num", CTLFLAG_RD, &sc->use_phynum, 0, "Use the phy number for enumeration"); @@ -1923,6 +1929,70 @@ mps_parse_debug(struct mps_softc *sc, char *list) } return; +} + +struct mps_dumpreq_hdr { + uint32_t smid; + uint32_t state; + uint32_t numframes; + uint32_t deschi; + uint32_t desclo; +}; + +static int +mps_dump_reqs(SYSCTL_HANDLER_ARGS) +{ + struct mps_softc *sc; + struct mps_chain *chain, *chain1; + struct mps_command *cm; + struct mps_dumpreq_hdr hdr; + struct sbuf *sb; + uint32_t smid, state; + int i, numreqs, error = 0; + + sc = (struct mps_softc *)arg1; + + if ((error = priv_check(curthread, PRIV_DRIVER)) != 0) { + printf("priv check error %d\n", error); + return (error); + } + + state = MPS_CM_STATE_INQUEUE; + smid = 1; + numreqs = sc->num_reqs; + + if (req->newptr != NULL) + return (EINVAL); + + if (smid == 0 || smid > sc->num_reqs) + return (EINVAL); + if (numreqs <= 0 || (numreqs + smid > sc->num_reqs)) + numreqs = sc->num_reqs; + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + + /* Best effort, no locking */ + for (i = smid; i < numreqs; i++) { + cm = &sc->commands[i]; + if (cm->cm_state != state) + continue; + hdr.smid = i; + hdr.state = cm->cm_state; + hdr.numframes = 1; + hdr.deschi = cm->cm_desc.Words.High; + hdr.desclo = cm->cm_desc.Words.Low; + TAILQ_FOREACH_SAFE(chain, &cm->cm_chain_list, chain_link, + chain1) + hdr.numframes++; + sbuf_bcat(sb, &hdr, sizeof(hdr)); + sbuf_bcat(sb, cm->cm_req, 128); + TAILQ_FOREACH_SAFE(chain, &cm->cm_chain_list, chain_link, + chain1) + sbuf_bcat(sb, chain->chain, 128); + } + + error = sbuf_finish(sb); + sbuf_delete(sb); + return (error); } int From owner-svn-src-head@freebsd.org Mon Mar 12 05:03:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD2A6F4A024; Mon, 12 Mar 2018 05:03:33 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B8278FAFB; Mon, 12 Mar 2018 05:03:33 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 865BB27234; Mon, 12 Mar 2018 05:03:33 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2C53Xm9032256; Mon, 12 Mar 2018 05:03:33 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2C53XeO032250; Mon, 12 Mar 2018 05:03:33 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201803120503.w2C53XeO032250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 12 Mar 2018 05:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330790 - head/usr.sbin/mpsutil X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/usr.sbin/mpsutil X-SVN-Commit-Revision: 330790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 05:03:34 -0000 Author: scottl Date: Mon Mar 12 05:03:32 2018 New Revision: 330790 URL: https://svnweb.freebsd.org/changeset/base/330790 Log: Add a new 'debug' command tree and 'dump_reqs' command to grab and parse command and chain frames of in-flight I/O from the driver. Sponsored by: Netflix Added: head/usr.sbin/mpsutil/mps_debug.c (contents, props changed) Modified: head/usr.sbin/mpsutil/Makefile head/usr.sbin/mpsutil/mps_show.c head/usr.sbin/mpsutil/mpsutil.c head/usr.sbin/mpsutil/mpsutil.h Modified: head/usr.sbin/mpsutil/Makefile ============================================================================== --- head/usr.sbin/mpsutil/Makefile Mon Mar 12 05:02:22 2018 (r330789) +++ head/usr.sbin/mpsutil/Makefile Mon Mar 12 05:03:32 2018 (r330790) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= mpsutil -SRCS= mps_cmd.c mps_flash.c mps_show.c mpsutil.c +SRCS= mps_cmd.c mps_debug.c mps_flash.c mps_show.c mpsutil.c MAN= mpsutil.8 WARNS?= 3 Added: head/usr.sbin/mpsutil/mps_debug.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/mpsutil/mps_debug.c Mon Mar 12 05:03:32 2018 (r330790) @@ -0,0 +1,190 @@ +/*- + * Copyright (c) 2018 Netflix, Inc. + * All rights reserved. + * Written by: Scott Long + * + * 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. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 +__RCSID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "mpsutil.h" + +MPS_TABLE(top, debug); + +struct mps_dumpreq_hdr { + uint32_t smid; + uint32_t state; + uint32_t numframes; + uint32_t deschi; + uint32_t desclo; +}; + +static int find_sgl(char *); +static void print_sgl(char *, int, int); + +#define MPS_FRAME_LEN 128 + +static int +debug_dumpreqs(int ac, char **av) +{ + struct mps_dumpreq_hdr *hdr; + char *buf, sysctlbuf[128]; + size_t len; + int numframes, error, offset; + + len = 0; + buf = NULL; + snprintf(sysctlbuf, sizeof(sysctlbuf), "dev.%s.%d.dump_reqs", + is_mps ? "mps" : "mpr", mps_unit); + + error = sysctlbyname(sysctlbuf, NULL, &len, NULL, 0); + if (error) + return (error); + + if (len == 0) + return (0); + + buf = malloc(len); + if (buf == NULL) + return (ENOMEM); + + error = sysctlbyname(sysctlbuf, buf, &len, NULL, 0); + if (error) { + printf("len= %zd, error= %d errno= %d\n", len, error, errno); + return (error); + } + + while (len >= MPS_FRAME_LEN) { + hdr = (struct mps_dumpreq_hdr *)buf; + numframes = hdr->numframes; + + printf("SMID= %d state= %#x numframes= %d desc.hi= %#08x " + "desc.lo= %#08x\n", hdr->smid, hdr->state, + hdr->numframes, hdr->deschi, hdr->desclo); + + buf += sizeof(struct mps_dumpreq_hdr); + len -= sizeof(struct mps_dumpreq_hdr); + + if ((offset = find_sgl(buf)) != -1) + print_sgl(buf, offset, numframes); + + buf += MPS_FRAME_LEN * numframes; + len -= MPS_FRAME_LEN * numframes; + } + + return (error); +} + +static int +find_sgl(char *buf) +{ + MPI2_REQUEST_HEADER *req; + MPI2_SCSI_IO_REQUEST *scsi; + int offset = 0; + + req = (MPI2_REQUEST_HEADER *)buf; + + switch (req->Function) { + case MPI2_FUNCTION_SCSI_IO_REQUEST: + scsi = (MPI2_SCSI_IO_REQUEST *)buf; + offset = scsi->SGLOffset0; + break; + default: + offset = -1; + } + + return (offset); +} + +#define SGL_FLAGS "\10LastElement\7EndOfBuffer\4Local\3Host2IOC\2Addr64\1EndOfList" + +static void +print_sgl(char *buf, int offset, int numframes) +{ + MPI2_SGE_SIMPLE64 *sge; + MPI2_SGE_CHAIN_UNION *sgc; + MPI2_REQUEST_HEADER *req; + u_int i = 0, flags; + char *frame, tmpbuf[128]; + + req = (MPI2_REQUEST_HEADER *)buf; + frame = (char *)buf; + sge = (MPI2_SGE_SIMPLE64 *)&frame[offset * 4]; + printf("SGL for command\n"); + + hexdump(frame, MPS_FRAME_LEN, NULL, 0); + while (frame != NULL) { + flags = sge->FlagsLength >> MPI2_SGE_FLAGS_SHIFT; + bzero(tmpbuf, sizeof(tmpbuf)); + mps_parse_flags(flags, SGL_FLAGS, tmpbuf, sizeof(tmpbuf)); + printf("seg%d flags=%x %s len= 0x%06x addr=0x%016jx\n", i, + flags, tmpbuf, sge->FlagsLength & 0xffffff, + mps_to_u64(&sge->Address)); + if (flags & (MPI2_SGE_FLAGS_END_OF_LIST | + MPI2_SGE_FLAGS_END_OF_BUFFER)) + break; + sge++; + i++; + if (flags & MPI2_SGE_FLAGS_LAST_ELEMENT) { + sgc = (MPI2_SGE_CHAIN_UNION *)sge; + if ((sgc->Flags & MPI2_SGE_FLAGS_CHAIN_ELEMENT) == 0) { + printf("Invalid chain element\n"); + break; + } + bzero(tmpbuf, sizeof(tmpbuf)); + mps_parse_flags(sgc->Flags, SGL_FLAGS, tmpbuf, + sizeof(tmpbuf)); + if (sgc->Flags & MPI2_SGE_FLAGS_64_BIT_ADDRESSING) + printf("chain64 flags=0x%x %s len=0x%x " + "Offset=0x%x addr=0x%016jx\n", sgc->Flags, + tmpbuf, sgc->Length, sgc->NextChainOffset, + mps_to_u64(&sgc->u.Address64)); + else + printf("chain32 flags=0x%x %s len=0x%x " + "Offset=0x%x addr=0x%08x\n", sgc->Flags, + tmpbuf, sgc->Length, sgc->NextChainOffset, + sgc->u.Address32); + if (--numframes <= 0) + break; + frame += MPS_FRAME_LEN; + sge = (MPI2_SGE_SIMPLE64 *)frame; + hexdump(frame, MPS_FRAME_LEN, NULL, 0); + } + } +} + +MPS_COMMAND(debug, dumpreqs, debug_dumpreqs, "", "Dump the active request queue") Modified: head/usr.sbin/mpsutil/mps_show.c ============================================================================== --- head/usr.sbin/mpsutil/mps_show.c Mon Mar 12 05:02:22 2018 (r330789) +++ head/usr.sbin/mpsutil/mps_show.c Mon Mar 12 05:03:32 2018 (r330790) @@ -202,6 +202,7 @@ static int show_iocfacts(int ac, char **av) { MPI2_IOC_FACTS_REPLY *facts; + char tmpbuf[128]; int error, fd; fd = mps_open(mps_unit); @@ -217,6 +218,14 @@ show_iocfacts(int ac, char **av) return (errno); } +#define IOCCAP "\3ScsiTaskFull" "\4DiagTrace" "\5SnapBuf" "\6ExtBuf" \ + "\7EEDP" "\10BiDirTarg" "\11Multicast" "\14TransRetry" "\15IR" \ + "\16EventReplay" "\17RaidAccel" "\20MSIXIndex" "\21HostDisc" \ + "\22FastPath" "\23RDPQArray" "\24AtomicReqDesc" "\25PCIeSRIOV" + + bzero(tmpbuf, sizeof(tmpbuf)); + mps_parse_flags(facts->IOCCapabilities, IOCCAP, tmpbuf, sizeof(tmpbuf)); + printf(" MsgVersion: %02d.%02d\n", facts->MsgVersion >> 8, facts->MsgVersion & 0xff); printf(" MsgLength: %d\n", facts->MsgLength); @@ -236,14 +245,19 @@ show_iocfacts(int ac, char **av) printf(" MaxMSIxVectors: %d\n", facts->MaxMSIxVectors); printf(" RequestCredit: %d\n", facts->RequestCredit); printf(" ProductID: 0x%x\n", facts->ProductID); - printf(" IOCCapabilities: 0x%x\n", facts->IOCCapabilities); + printf(" IOCCapabilities: 0x%x %s\n", facts->IOCCapabilities, + tmpbuf); printf(" FWVersion: 0x%08x\n", facts->FWVersion.Word); printf(" IOCRequestFrameSize: %d\n", facts->IOCRequestFrameSize); printf(" MaxInitiators: %d\n", facts->MaxInitiators); printf(" MaxTargets: %d\n", facts->MaxTargets); printf(" MaxSasExpanders: %d\n", facts->MaxSasExpanders); printf(" MaxEnclosures: %d\n", facts->MaxEnclosures); - printf(" ProtocolFlags: 0x%x\n", facts->ProtocolFlags); + + bzero(tmpbuf, sizeof(tmpbuf)); + mps_parse_flags(facts->ProtocolFlags, + "\4NvmeDevices\2ScsiTarget\1ScsiInitiator", tmpbuf, sizeof(tmpbuf)); + printf(" ProtocolFlags: 0x%x %s\n", facts->ProtocolFlags, tmpbuf); printf(" HighPriorityCredit: %d\n", facts->HighPriorityCredit); printf("MaxRepDescPostQDepth: %d\n", facts->MaxReplyDescriptorPostQueueDepth); Modified: head/usr.sbin/mpsutil/mpsutil.c ============================================================================== --- head/usr.sbin/mpsutil/mpsutil.c Mon Mar 12 05:02:22 2018 (r330789) +++ head/usr.sbin/mpsutil/mpsutil.c Mon Mar 12 05:03:32 2018 (r330790) @@ -205,3 +205,32 @@ hexdump(const void *ptr, int length, const char *hdr, printf("\n"); } } + +#define PCHAR(c) { if (retval < tmpsz) { *outbuf++ = (c); retval++; } } + +int +mps_parse_flags(uintmax_t num, const char *q, char *outbuf, int tmpsz) +{ + int n, tmp, retval = 0; + + if (num == 0) + return (retval); + + /* %b conversion flag format. */ + tmp = retval; + while (*q) { + n = *q++; + if (num & (1 << (n - 1))) { + PCHAR(retval != tmp ? ',' : '<'); + for (; (n = *q) > ' '; ++q) + PCHAR(n); + } else + for (; *q > ' '; ++q) + continue; + } + if (retval != tmp) + PCHAR('>'); + + return (retval); +} + Modified: head/usr.sbin/mpsutil/mpsutil.h ============================================================================== --- head/usr.sbin/mpsutil/mpsutil.h Mon Mar 12 05:02:22 2018 (r330789) +++ head/usr.sbin/mpsutil/mpsutil.h Mon Mar 12 05:03:32 2018 (r330790) @@ -42,6 +42,8 @@ #include #include #include +#include +#include #define MPSUTIL_VERSION "1.0.0" @@ -102,6 +104,7 @@ void hexdump(const void *ptr, int length, const char * #define HD_OMIT_HEX (1 << 17) #define HD_OMIT_CHARS (1 << 18) #define HD_REVERSED (1 << 19) +int mps_parse_flags(uintmax_t, const char *, char *, int); int mps_open(int unit); int mps_table_handler(struct mpsutil_command **start, @@ -140,6 +143,13 @@ mps_read_ioc_page(int fd, U8 PageNumber, U16 *IOCStatu return (mps_read_config_page(fd, MPI2_CONFIG_PAGETYPE_IOC, PageNumber, 0, IOCStatus)); +} + +static __inline uint64_t +mps_to_u64(U64 *data) +{ + + return (((uint64_t)(data->High) << 32 ) | data->Low); } MPI2_IOC_FACTS_REPLY * mps_get_iocfacts(int fd); From owner-svn-src-head@freebsd.org Mon Mar 12 05:41:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 462C9F4C5D7; Mon, 12 Mar 2018 05:41:28 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFA2A68C9E; Mon, 12 Mar 2018 05:41:27 +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 EA99727827; Mon, 12 Mar 2018 05:41:27 +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 w2C5fRGS050338; Mon, 12 Mar 2018 05:41:27 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2C5fRs3050337; Mon, 12 Mar 2018 05:41:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803120541.w2C5fRs3050337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 12 Mar 2018 05:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330791 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 330791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 05:41:28 -0000 Author: cem Date: Mon Mar 12 05:41:27 2018 New Revision: 330791 URL: https://svnweb.freebsd.org/changeset/base/330791 Log: Implement NO_WCAST_QUAL for gcc4.2 architectures Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Mon Mar 12 05:03:32 2018 (r330790) +++ head/sys/conf/kern.mk Mon Mar 12 05:41:27 2018 (r330791) @@ -68,6 +68,9 @@ CWARNEXTRA+= -Wno-error=misleading-indentation \ .else # For gcc 4.2, eliminate the too-often-wrong warnings about uninitialized vars. CWARNEXTRA?= -Wno-uninitialized +# GCC 4.2 doesn't have -Wno-error=cast-qual, so just disable the warning for +# the few files that are already known to generate cast-qual warnings. +NO_WCAST_QUAL= -Wno-cast-qual .endif .endif From owner-svn-src-head@freebsd.org Mon Mar 12 07:52:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E58FF51D89; Mon, 12 Mar 2018 07:52:31 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC7316D67B; Mon, 12 Mar 2018 07:52:30 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f52.google.com with SMTP id m69-v6so21677108lfe.8; Mon, 12 Mar 2018 00:52:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7of32cH8T5wV8VHhWnZwiudGCTnmDRWymdmdnxklSAc=; b=PvkWKksUB6oRMtxX3PtXnpc4em4Zc6lwBvSvOUEqBA+RhKeAFHYRtLQTSfhUA04Zij cuDfXpi2xMCe+ETwzXkxDQZz82OAw6yxwYcgibKdgeyie5kPJB+Hb42kFp4By5rxHx4e CLxRbjji1kR7mkhQwz2o2oHmjo/yUlbmaFdJrIaQmH/HXSZ1/cq1i5boKG8PS+ELXi5E RXGCxjNo3ES3igWVO8aueKjDbJOJOFlkF4DFfnxHFySBU+AjiIBbBkCsFpzw5QdJZvNo 78+EBLfjAPh6bz+eXGZbUEAG4O+KUg05dbBAXajdKDwiy/drnIoF0RbcaCR+ZXKTh9CS ATfg== X-Gm-Message-State: AElRT7FwTI5QyHpKNWliC8NghCAbRVxsq9ARU0pzJLWClGKzytL3dw3i kg/sB9PtYzmmpqvwiYtGkk7oRcYT X-Google-Smtp-Source: AG47ELvGiIyW8mY4nhspcvRpR4hJ9ht6IZzcyNSoDUZ/yKK+haAdFPGmUyiUywAG703UZt8pqwIzHw== X-Received: by 10.46.54.1 with SMTP id d1mr4669749lja.84.1520841142809; Mon, 12 Mar 2018 00:52:22 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id r13sm1538279ljd.60.2018.03.12.00.52.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Mar 2018 00:52:22 -0700 (PDT) Subject: Re: svn commit: r330338 - head/sys/amd64/amd64 To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803031510.w23FAbeC065867@repo.freebsd.org> <2557369.6nFzd3kAUm@ralph.baldwin.cx> From: Andriy Gapon Message-ID: Date: Mon, 12 Mar 2018 09:52:21 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <2557369.6nFzd3kAUm@ralph.baldwin.cx> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 07:52:31 -0000 On 09/03/2018 21:22, John Baldwin wrote: > On Saturday, March 03, 2018 03:10:37 PM Andriy Gapon wrote: >> Author: avg >> Date: Sat Mar 3 15:10:37 2018 >> New Revision: 330338 >> URL: https://svnweb.freebsd.org/changeset/base/330338 >> >> Log: >> db_nextframe/amd64: catch up with r328083 to recognize fast_syscall_common >> >> Since that change the system call stack traces look like this: >> ... >> sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe0028e13ac0 >> amd64_syscall() at amd64_syscall+0x79b/frame 0xfffffe0028e13bf0 >> fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0028e13bf0 >> So, db_nextframe() stopped recognizing the system call frame. >> This commit should fix that. >> >> Reviewed by: kib >> MFC after: 4 days >> >> Modified: >> head/sys/amd64/amd64/db_trace.c >> >> Modified: head/sys/amd64/amd64/db_trace.c >> ============================================================================== >> --- head/sys/amd64/amd64/db_trace.c Sat Mar 3 13:20:44 2018 (r330337) >> +++ head/sys/amd64/amd64/db_trace.c Sat Mar 3 15:10:37 2018 (r330338) >> @@ -212,7 +212,9 @@ db_nextframe(struct amd64_frame **fp, db_addr_t *ip, s >> strcmp(name, "Xcpususpend") == 0 || >> strcmp(name, "Xrendezvous") == 0) >> frame_type = INTERRUPT; >> - else if (strcmp(name, "Xfast_syscall") == 0) >> + else if (strcmp(name, "Xfast_syscall") == 0 || >> + strcmp(name, "Xfast_syscall_pti") == 0 || >> + strcmp(name, "fast_syscall_common") == 0) >> frame_type = SYSCALL; > > I think you actually just want to replace Xfast_syscall with > fast_syscall_common. Neither Xfast_syscall nor Xfast_syscall_pti call any > functions before jumping to the common label, so when unwinding from a system > call you should always get the common label. (That is, I think we should > remove Xfast_syscall and Xfast_syscall_pti here. Any stack trace that > happens to find those symbols during unwinding won't have a valid SYSCALL > frame to unwind.) > I kept / added those to, sort of, decouple db_nextframe from the current implementation details. I hope that the extra code does not create too much overhead. -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Mar 12 09:40:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19EBBF300BC; Mon, 12 Mar 2018 09:40:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C45FA71AF3; Mon, 12 Mar 2018 09:40:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF20A1D26; Mon, 12 Mar 2018 09:40:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2C9ekSU070291; Mon, 12 Mar 2018 09:40:46 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2C9ekns070289; Mon, 12 Mar 2018 09:40:46 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201803120940.w2C9ekns070289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 12 Mar 2018 09:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330792 - in head: sbin/ipfw sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head: sbin/ipfw sys/netpfil/ipfw X-SVN-Commit-Revision: 330792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 09:40:47 -0000 Author: ae Date: Mon Mar 12 09:40:46 2018 New Revision: 330792 URL: https://svnweb.freebsd.org/changeset/base/330792 Log: Do not try to reassemble IPv6 fragments in "reass" rule. ip_reass() expects IPv4 packet and will just corrupt any IPv6 packets that it gets. Until proper IPv6 fragments handling function will be implemented, pass IPv6 packets to next rule. PR: 170604 MFC after: 1 week Modified: head/sbin/ipfw/ipfw.8 head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Mon Mar 12 05:41:27 2018 (r330791) +++ head/sbin/ipfw/ipfw.8 Mon Mar 12 09:40:46 2018 (r330792) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 26, 2017 +.Dd March 12, 2018 .Dt IPFW 8 .Os .Sh NAME @@ -1135,7 +1135,7 @@ Regardless of matched a packet or not by the .Cm tcp-setmss rule, the search continues with the next rule. .It Cm reass -Queue and reassemble IP fragments. +Queue and reassemble IPv4 fragments. If the packet is not fragmented, counters are updated and processing continues with the next rule. If the packet is the last logical fragment, the packet is reassembled and, if Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Mon Mar 12 05:41:27 2018 (r330791) +++ head/sys/netpfil/ipfw/ip_fw2.c Mon Mar 12 09:40:46 2018 (r330792) @@ -3018,8 +3018,10 @@ do { \ case O_REASS: { int ip_off; - IPFW_INC_RULE_COUNTER(f, pktlen); l = 0; /* in any case exit inner loop */ + if (is_ipv6) /* IPv6 is not supported yet */ + break; + IPFW_INC_RULE_COUNTER(f, pktlen); ip_off = ntohs(ip->ip_off); /* if not fragmented, go to next rule */ From owner-svn-src-head@freebsd.org Mon Mar 12 11:28:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77D54F39BB3; Mon, 12 Mar 2018 11:28:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2255F76184; Mon, 12 Mar 2018 11:28:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1577D2F11; Mon, 12 Mar 2018 11:28:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CBS9oS023511; Mon, 12 Mar 2018 11:28:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CBS9O4023510; Mon, 12 Mar 2018 11:28:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803121128.w2CBS9O4023510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 12 Mar 2018 11:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330793 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 330793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 11:28:10 -0000 Author: avg Date: Mon Mar 12 11:28:09 2018 New Revision: 330793 URL: https://svnweb.freebsd.org/changeset/base/330793 Log: fix r297857, do not modify CPU extension bits under virtual machines r297857 was meant for real hardware only. PR: 213155 Submitted by: mainland@apeiron.net MFC after: 1 week Modified: head/sys/x86/x86/identcpu.c Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Mon Mar 12 09:40:46 2018 (r330792) +++ head/sys/x86/x86/identcpu.c Mon Mar 12 11:28:09 2018 (r330793) @@ -1395,7 +1395,8 @@ fix_cpuid(void) * See BIOS and Kernel Developer’s Guide (BKDG) for AMD Family 15h * Models 60h-6Fh Processors, Publication # 50742. */ - if (cpu_vendor_id == CPU_VENDOR_AMD && CPUID_TO_FAMILY(cpu_id) == 0x15) { + if (vm_guest == VM_GUEST_NO && cpu_vendor_id == CPU_VENDOR_AMD && + CPUID_TO_FAMILY(cpu_id) == 0x15) { msr = rdmsr(MSR_EXTFEATURES); if ((msr & ((uint64_t)1 << 54)) == 0) { msr |= (uint64_t)1 << 54; From owner-svn-src-head@freebsd.org Mon Mar 12 13:29:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94220F4643C; Mon, 12 Mar 2018 13:29:58 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 346C07B695; Mon, 12 Mar 2018 13:29:57 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6F71A260370; Mon, 12 Mar 2018 14:29:56 +0100 (CET) Subject: Re: svn commit: r330783 - in head/sys: amd64/include isa x86/isa To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803112013.w2BKDGJW068438@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <28322248-a2e4-3770-d6d1-54b9fdd2ad94@selasky.org> Date: Mon, 12 Mar 2018 14:29:52 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201803112013.w2BKDGJW068438@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 13:29:58 -0000 On 03/11/18 21:13, Ian Lepore wrote: > -struct mtx atrtc_lock; > +static struct mtx atrtc_lock; > MTX_SYSINIT(atrtc_lock_init, &atrtc_lock, "atrtc", MTX_SPIN); > > +struct mtx atrtc_time_lock; > +MTX_SYSINIT(atrtc_time_lock_init, &atrtc_time_lock, "atrtc", MTX_DEF); One of my boxes panics now because there are two locks with same name! I have: debug.witness.skipspin=0 In /boot/loader.conf. --HPS From owner-svn-src-head@freebsd.org Mon Mar 12 13:32:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15898F468A9; Mon, 12 Mar 2018 13:32:52 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF2617BB19; Mon, 12 Mar 2018 13:32:51 +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 BA05A47CC; Mon, 12 Mar 2018 13:32:51 +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 w2CDWpLc087774; Mon, 12 Mar 2018 13:32:51 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CDWprd087773; Mon, 12 Mar 2018 13:32:51 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201803121332.w2CDWprd087773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 12 Mar 2018 13:32:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330795 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 330795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 13:32:52 -0000 Author: bz Date: Mon Mar 12 13:32:51 2018 New Revision: 330795 URL: https://svnweb.freebsd.org/changeset/base/330795 Log: The vmresult table was missing most of the values apart from two due to extra "_" in the names we grep for. Add the "_" to the pattern. Reviewed by: jhb MFC after: 3 days Sponsored by: iXsystems, Inc. Modified: head/lib/libsysdecode/mktables Modified: head/lib/libsysdecode/mktables ============================================================================== --- head/lib/libsysdecode/mktables Mon Mar 12 12:21:19 2018 (r330794) +++ head/lib/libsysdecode/mktables Mon Mar 12 13:32:51 2018 (r330795) @@ -146,7 +146,7 @@ gen_table "socktype" "SOCK_[A-Z]+[[:space:]]+[1 gen_table "thrcreateflags" "THR_[A-Z]+[[:space:]]+0x[0-9]+" "sys/thr.h" gen_table "umtxop" "UMTX_OP_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/umtx.h" gen_table "vmprot" "VM_PROT_[A-Z]+[[:space:]]+\(\(vm_prot_t\)[[:space:]]+0x[0-9]+\)" "vm/vm.h" -gen_table "vmresult" "KERN_[A-Z]+[[:space:]]+[0-9]+" "vm/vm_param.h" +gen_table "vmresult" "KERN_[A-Z_]+[[:space:]]+[0-9]+" "vm/vm_param.h" gen_table "wait6opt" "W[A-Z]+[[:space:]]+[0-9]+" "sys/wait.h" gen_table "seekwhence" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h" gen_table "fcntlcmd" "F_[A-Z0-9_]+[[:space:]]+[0-9]+[[:space:]]+" "sys/fcntl.h" "F_CANCEL|F_..LCK" From owner-svn-src-head@freebsd.org Mon Mar 12 15:17:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF352F4E25A; Mon, 12 Mar 2018 15:17:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D114804FD; Mon, 12 Mar 2018 15:17:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86331575F; Mon, 12 Mar 2018 15:17:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CFHGVB037812; Mon, 12 Mar 2018 15:17:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CFHG4I037811; Mon, 12 Mar 2018 15:17:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803121517.w2CFHG4I037811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Mar 2018 15:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330796 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 330796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 15:17:17 -0000 Author: imp Date: Mon Mar 12 15:17:16 2018 New Revision: 330796 URL: https://svnweb.freebsd.org/changeset/base/330796 Log: Tighten up periph lock to avoid some races Make sure the periph lock is held around rmw access to softc data, espeically flags, including work flags in iosched. Add asserts for the periph lock where it should be held. PR: 226510 Sponsored by: Netflix Differential Review: https://reviews.freebsd.org/D14456 Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Mar 12 13:32:51 2018 (r330795) +++ head/sys/cam/scsi/scsi_da.c Mon Mar 12 15:17:16 2018 (r330796) @@ -1909,6 +1909,7 @@ daoninvalidate(struct cam_periph *periph) { struct da_softc *softc; + cam_periph_assert(periph, MA_OWNED); softc = (struct da_softc *)periph->softc; /* @@ -2038,6 +2039,7 @@ daasync(void *callback_arg, u_int32_t code, * Handle all UNIT ATTENTIONs except our own, * as they will be handled by daerror(). */ + cam_periph_lock(periph); if (xpt_path_periph(ccb->ccb_h.path) != periph && scsi_extract_sense_ccb(ccb, &error_code, &sense_key, &asc, &ascq)) { @@ -2056,16 +2058,19 @@ daasync(void *callback_arg, u_int32_t code, dareprobe(periph); } } + cam_periph_unlock(periph); break; } case AC_SCSI_AEN: softc = (struct da_softc *)periph->softc; + cam_periph_lock(periph); if (!cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR)) { if (da_periph_acquire(periph, DA_REF_TUR) == 0) { cam_iosched_set_work_flags(softc->cam_iosched, DA_WORK_TUR); daschedule(periph); } } + cam_periph_unlock(periph); /* FALLTHROUGH */ case AC_SENT_BDR: case AC_BUS_RESET: @@ -2077,15 +2082,19 @@ daasync(void *callback_arg, u_int32_t code, * Don't fail on the expected unit attention * that will occur. */ + cam_periph_lock(periph); softc->flags |= DA_FLAG_RETRY_UA; LIST_FOREACH(ccbh, &softc->pending_ccbs, periph_links.le) ccbh->ccb_state |= DA_CCB_RETRY_UA; + cam_periph_unlock(periph); break; } case AC_INQ_CHANGED: + cam_periph_lock(periph); softc = (struct da_softc *)periph->softc; softc->flags &= ~DA_FLAG_PROBED; dareprobe(periph); + cam_periph_unlock(periph); break; default: break; @@ -2115,7 +2124,9 @@ dasysctlinit(void *context, int pending) snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); sysctl_ctx_init(&softc->sysctl_ctx); + cam_periph_lock(periph); softc->flags |= DA_FLAG_SCTX_INIT; + cam_periph_unlock(periph); softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_kern_cam_da), OID_AUTO, tmpstr2, CTLFLAG_RD, 0, tmpstr, "device_index"); @@ -2647,7 +2658,7 @@ daregister(struct cam_periph *periph, void *arg) callout_init_mtx(&softc->sendordered_c, cam_periph_mtx(periph), 0); callout_reset(&softc->sendordered_c, (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL, - dasendorderedtag, softc); + dasendorderedtag, periph); cam_periph_unlock(periph); /* @@ -3075,6 +3086,7 @@ dastart(struct cam_periph *periph, union ccb *start_cc { struct da_softc *softc; + cam_periph_assert(periph, MA_OWNED); softc = (struct da_softc *)periph->softc; CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dastart\n")); @@ -4625,7 +4637,9 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) ((have_sense) && (error_code == SSD_CURRENT_ERROR) && (sense_key == SSD_KEY_ILLEGAL_REQUEST)))) { + cam_periph_lock(periph); softc->flags &= ~DA_FLAG_CAN_RC16; + cam_periph_unlock(periph); free(rdcap, M_SCSIDA); xpt_release_ccb(done_ccb); softc->state = DA_STATE_PROBE_RC; @@ -5012,6 +5026,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) "GEOM::rotation_rate", M_NOWAIT); } + cam_periph_assert(periph, MA_OWNED); if (ata_params->capabilities1 & ATA_SUPPORT_DMA) softc->flags |= DA_FLAG_CAN_ATA_DMA; @@ -5110,6 +5125,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) { int error; + cam_periph_lock(periph); if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { error = 0; softc->valid_logdir_len = 0; @@ -5163,6 +5179,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) } } } + cam_periph_unlock(periph); free(csio->data_ptr, M_SCSIDA); @@ -5180,6 +5197,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) { int error; + cam_periph_lock(periph); if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { off_t entries_offset, max_entries; error = 0; @@ -5250,6 +5268,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) } } } + cam_periph_unlock(periph); free(csio->data_ptr, M_SCSIDA); @@ -5341,7 +5360,9 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) * Supported Capabilities page, clear the * flag... */ + cam_periph_lock(periph); softc->flags &= ~DA_FLAG_CAN_ATA_SUPCAP; + cam_periph_unlock(periph); /* * And clear zone capabilities. */ @@ -5438,8 +5459,10 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) if (error == ERESTART) return; else if (error != 0) { + cam_periph_lock(periph); softc->flags &= ~DA_FLAG_CAN_ATA_ZONE; softc->flags &= ~DA_ZONE_FLAG_SET_MASK; + cam_periph_unlock(periph); if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { @@ -5588,6 +5611,8 @@ daerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t periph = xpt_path_periph(ccb->ccb_h.path); softc = (struct da_softc *)periph->softc; + cam_periph_assert(periph, MA_OWNED); + /* * Automatically detect devices that do not support * READ(6)/WRITE(6) and upgrade to using 10 byte cdbs. @@ -5682,6 +5707,7 @@ daprevent(struct cam_periph *periph, int action) union ccb *ccb; int error; + cam_periph_assert(periph, MA_OWNED); softc = (struct da_softc *)periph->softc; if (((action == PR_ALLOW) @@ -5837,8 +5863,10 @@ dasetgeom(struct cam_periph *periph, uint32_t block_le static void dasendorderedtag(void *arg) { - struct da_softc *softc = arg; + struct cam_periph *periph = arg; + struct da_softc *softc = periph->softc; + cam_periph_assert(periph, MA_OWNED); if (da_send_ordered) { if (!LIST_EMPTY(&softc->pending_ccbs)) { if ((softc->flags & DA_FLAG_WAS_OTAG) == 0) @@ -5846,10 +5874,11 @@ dasendorderedtag(void *arg) softc->flags &= ~DA_FLAG_WAS_OTAG; } } + /* Queue us up again */ callout_reset(&softc->sendordered_c, (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL, - dasendorderedtag, softc); + dasendorderedtag, periph); } /* From owner-svn-src-head@freebsd.org Mon Mar 12 15:26:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB9C6F4EF8D; Mon, 12 Mar 2018 15:26:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A43E80D0E; Mon, 12 Mar 2018 15:26:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 952075929; Mon, 12 Mar 2018 15:26:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CFQBxf042984; Mon, 12 Mar 2018 15:26:11 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CFQBKv042983; Mon, 12 Mar 2018 15:26:11 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803121526.w2CFQBKv042983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 12 Mar 2018 15:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330797 - head/sys/x86/isa X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/x86/isa X-SVN-Commit-Revision: 330797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 15:26:12 -0000 Author: ian Date: Mon Mar 12 15:26:11 2018 New Revision: 330797 URL: https://svnweb.freebsd.org/changeset/base/330797 Log: Give the atrtc_time_lock a unique name. Reported by: hps@ Modified: head/sys/x86/isa/atrtc.c Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Mon Mar 12 15:17:16 2018 (r330796) +++ head/sys/x86/isa/atrtc.c Mon Mar 12 15:26:11 2018 (r330797) @@ -64,7 +64,7 @@ static struct mtx atrtc_lock; MTX_SYSINIT(atrtc_lock_init, &atrtc_lock, "atrtc", MTX_SPIN); struct mtx atrtc_time_lock; -MTX_SYSINIT(atrtc_time_lock_init, &atrtc_time_lock, "atrtc", MTX_DEF); +MTX_SYSINIT(atrtc_time_lock_init, &atrtc_time_lock, "atrtc_time", MTX_DEF); int atrtcclock_disable = 0; From owner-svn-src-head@freebsd.org Mon Mar 12 15:34:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EBF1F4F88F for ; Mon, 12 Mar 2018 15:34:55 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2576581340 for ; Mon, 12 Mar 2018 15:34:54 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: d6b70d63-260a-11e8-bb8e-b35b57339d60 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 outbound1.ore.mailhop.org (Halon) with ESMTPSA id d6b70d63-260a-11e8-bb8e-b35b57339d60; Mon, 12 Mar 2018 15:34:23 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w2CFYpRP016438; Mon, 12 Mar 2018 09:34:51 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1520868891.84937.177.camel@freebsd.org> Subject: Re: svn commit: r330780 - in head/sys: amd64/include isa x86/isa From: Ian Lepore To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 12 Mar 2018 09:34:51 -0600 In-Reply-To: <20180311212539.GD76926@kib.kiev.ua> References: <201803111922.w2BJMwr8043084@repo.freebsd.org> <20180311195800.GC76926@kib.kiev.ua> <1520799639.84937.154.camel@freebsd.org> <20180311212539.GD76926@kib.kiev.ua> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 15:34:55 -0000 On Sun, 2018-03-11 at 23:25 +0200, Konstantin Belousov wrote: > On Sun, Mar 11, 2018 at 02:20:39PM -0600, Ian Lepore wrote: > > > > On Sun, 2018-03-11 at 21:58 +0200, Konstantin Belousov wrote: > > > > > > On Sun, Mar 11, 2018 at 07:22:58PM +0000, Ian Lepore wrote: > > > > > > > > > > > > [...] > > > > Unfortunately, this reverts one type of wrong locking back to another. > >  The need is to prevent access to the atrtc hardware if efi is > > accessing it, and the locking I just reverted to that uses a sleepable > > mutex only protects against inittodr()/resettodr() access, but not > > against nvram(4) or if the atrtc is being used as an eventtimer (of > > course nobody uses it for that, but the driver supports it). > > > > I have some pending changes that cause the atrtc driver to just not > > attach at all if the efirtc driver attached, but they're stacked up > > behind some other changes in phab.  And that still doesn't fix the > > nvram(4) part of it. > Not attaching atrtc if efirtc is attached sounds reasonable. But then > you should also disable efirt attach if atrtc is on. One possible issue > is that efirt is typicall loadable, while atrtc is compiled into the > kernel, which means that efirt would become virtually unusable. > Even if efirt is loaded (in loader(8)) the efirtc driver will still attach instead of atrtc, because it's a direct child of nexus and gets the first opportunity to probe and attach.  But you raise a good point, I should make it handle the case where it gets kldload'd when atrtc is already attached. > For nvram(4), you can take the atrtc_time_lock around accesses in addition > to the atrtc_lock, instead of providing exclusivity on the level of drivers > attach. It occurs to me that an even better fix for all of this would be to remove support for atrtc being an eventtimer.  That allows removing the interrupt filter handler, and then there's no need for a spinlock at all, a sleepable mutex works fine for all accesses. Does anybody really need an eventtimer that runs only at a fixed periodic rate of 32khz in 2018? -- Ian From owner-svn-src-head@freebsd.org Mon Mar 12 15:35:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EE8FF4F90E; Mon, 12 Mar 2018 15:35:26 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4A228145E; Mon, 12 Mar 2018 15:35:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB8555AB3; Mon, 12 Mar 2018 15:35:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CFZPlF047900; Mon, 12 Mar 2018 15:35:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CFZP83047893; Mon, 12 Mar 2018 15:35:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803121535.w2CFZP83047893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 12 Mar 2018 15:35:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330798 - in head/sys: compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: compat/linux i386/linux X-SVN-Commit-Revision: 330798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 15:35:26 -0000 Author: emaste Date: Mon Mar 12 15:35:24 2018 New Revision: 330798 URL: https://svnweb.freebsd.org/changeset/base/330798 Log: Linuxulator: apply style(9) to return Sponsored by: Turing Robotic Industries Inc. Modified: head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_signal.c head/sys/compat/linux/linux_stats.c head/sys/compat/linux/linux_util.c head/sys/i386/linux/imgact_linux.c head/sys/i386/linux/linux_machdep.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Mon Mar 12 15:26:11 2018 (r330797) +++ head/sys/compat/linux/linux_ioctl.c Mon Mar 12 15:35:24 2018 (r330798) @@ -385,7 +385,7 @@ linux_to_bsd_speed(int code, struct speedtab *table) for ( ; table->sp_code != -1; table++) if (table->sp_code == code) return (table->sp_speed); - return -1; + return (-1); } static int @@ -394,7 +394,7 @@ bsd_to_linux_speed(int speed, struct speedtab *table) for ( ; table->sp_speed != -1; table++) if (table->sp_speed == speed) return (table->sp_code); - return -1; + return (-1); } static void @@ -2668,7 +2668,7 @@ static int linux_ioctl_drm(struct thread *td, struct linux_ioctl_args *args) { args->cmd = SETDIR(args->cmd); - return sys_ioctl(td, (struct ioctl_args *)args); + return (sys_ioctl(td, (struct ioctl_args *)args)); } #ifdef COMPAT_LINUX32 @@ -3275,9 +3275,9 @@ linux_to_bsd_v4l2_format(struct l_v4l2_format *lvf, st * XXX TODO - needs 32 -> 64 bit conversion: * (unused by webcams?) */ - return EINVAL; + return (EINVAL); memcpy(&vf->fmt, &lvf->fmt, sizeof(vf->fmt)); - return 0; + return (0); } static int @@ -3293,9 +3293,9 @@ bsd_to_linux_v4l2_format(struct v4l2_format *vf, struc * XXX TODO - needs 32 -> 64 bit conversion: * (unused by webcams?) */ - return EINVAL; + return (EINVAL); memcpy(&lvf->fmt, &vf->fmt, sizeof(vf->fmt)); - return 0; + return (0); } static int linux_ioctl_v4l2(struct thread *td, struct linux_ioctl_args *args) @@ -3315,7 +3315,7 @@ linux_ioctl_v4l2(struct thread *td, struct linux_ioctl case LINUX_VIDIOC_RESERVED: case LINUX_VIDIOC_LOG_STATUS: if ((args->cmd & IOC_DIRMASK) != LINUX_IOC_VOID) - return ENOIOCTL; + return (ENOIOCTL); args->cmd = (args->cmd & 0xffff) | IOC_VOID; break; Modified: head/sys/compat/linux/linux_signal.c ============================================================================== --- head/sys/compat/linux/linux_signal.c Mon Mar 12 15:26:11 2018 (r330797) +++ head/sys/compat/linux/linux_signal.c Mon Mar 12 15:35:24 2018 (r330798) @@ -279,7 +279,7 @@ linux_rt_sigprocmask(struct thread *td, struct linux_r #endif if (args->sigsetsize != sizeof(l_sigset_t)) - return EINVAL; + return (EINVAL); if (args->mask != NULL) { error = copyin(args->mask, &set, sizeof(l_sigset_t)); @@ -377,7 +377,7 @@ linux_rt_sigpending(struct thread *td, struct linux_rt l_sigset_t lset; if (args->sigsetsize > sizeof(lset)) - return EINVAL; + return (EINVAL); /* NOT REACHED */ #ifdef DEBUG Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Mon Mar 12 15:26:11 2018 (r330797) +++ head/sys/compat/linux/linux_stats.c Mon Mar 12 15:35:24 2018 (r330798) @@ -436,7 +436,7 @@ linux_statfs64(struct thread *td, struct linux_statfs6 int error; if (args->bufsize != sizeof(struct l_statfs64)) - return EINVAL; + return (EINVAL); LCONVPATHEXIST(td, args->path, &path); Modified: head/sys/compat/linux/linux_util.c ============================================================================== --- head/sys/compat/linux/linux_util.c Mon Mar 12 15:26:11 2018 (r330797) +++ head/sys/compat/linux/linux_util.c Mon Mar 12 15:35:24 2018 (r330798) @@ -116,7 +116,7 @@ linux_driver_get_name_dev(device_t dev) const char *device_name = device_get_name(dev); if (device_name == NULL) - return NULL; + return (NULL); TAILQ_FOREACH(de, &devices, list) { if (strcmp(device_name, de->entry.bsd_driver_name) == 0) return (de->entry.linux_driver_name); @@ -133,7 +133,7 @@ linux_driver_get_major_minor(const char *node, int *ma size_t sz; if (node == NULL || major == NULL || minor == NULL) - return 1; + return (1); sz = sizeof("pts/") - 1; if (strncmp(node, "pts/", sz) == 0 && node[sz] != '\0') { Modified: head/sys/i386/linux/imgact_linux.c ============================================================================== --- head/sys/i386/linux/imgact_linux.c Mon Mar 12 15:26:11 2018 (r330797) +++ head/sys/i386/linux/imgact_linux.c Mon Mar 12 15:35:24 2018 (r330798) @@ -69,7 +69,7 @@ exec_linux_imgact(struct image_params *imgp) int error; if (((a_out->a_magic >> 16) & 0xff) != 0x64) - return -1; + return (-1); /* * Set file/virtual offset based on a.out variant. Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Mon Mar 12 15:26:11 2018 (r330797) +++ head/sys/i386/linux/linux_machdep.c Mon Mar 12 15:35:24 2018 (r330798) @@ -775,7 +775,7 @@ int linux_mq_open(struct thread *td, struct linux_mq_open_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_open(td, (struct kmq_open_args *) args); + return (sys_kmq_open(td, (struct kmq_open_args *)args)); #else return (ENOSYS); #endif @@ -785,7 +785,7 @@ int linux_mq_unlink(struct thread *td, struct linux_mq_unlink_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_unlink(td, (struct kmq_unlink_args *) args); + return (sys_kmq_unlink(td, (struct kmq_unlink_args *)args)); #else return (ENOSYS); #endif @@ -795,7 +795,7 @@ int linux_mq_timedsend(struct thread *td, struct linux_mq_timedsend_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_timedsend(td, (struct kmq_timedsend_args *) args); + return (sys_kmq_timedsend(td, (struct kmq_timedsend_args *)args)); #else return (ENOSYS); #endif @@ -805,7 +805,7 @@ int linux_mq_timedreceive(struct thread *td, struct linux_mq_timedreceive_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_timedreceive(td, (struct kmq_timedreceive_args *) args); + return (sys_kmq_timedreceive(td, (struct kmq_timedreceive_args *)args)); #else return (ENOSYS); #endif @@ -815,7 +815,7 @@ int linux_mq_notify(struct thread *td, struct linux_mq_notify_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_notify(td, (struct kmq_notify_args *) args); + return (sys_kmq_notify(td, (struct kmq_notify_args *)args)); #else return (ENOSYS); #endif @@ -825,7 +825,7 @@ int linux_mq_getsetattr(struct thread *td, struct linux_mq_getsetattr_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_setattr(td, (struct kmq_setattr_args *) args); + return (sys_kmq_setattr(td, (struct kmq_setattr_args *)args)); #else return (ENOSYS); #endif From owner-svn-src-head@freebsd.org Mon Mar 12 15:45:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEF97F5035B; Mon, 12 Mar 2018 15:45:51 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D50B81C9E; Mon, 12 Mar 2018 15:45:51 +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 7703A5C31; Mon, 12 Mar 2018 15:45:51 +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 w2CFjpFK052668; Mon, 12 Mar 2018 15:45:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CFjpxf052666; Mon, 12 Mar 2018 15:45:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803121545.w2CFjpxf052666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 12 Mar 2018 15:45:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330799 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 15:45:52 -0000 Author: emaste Date: Mon Mar 12 15:45:50 2018 New Revision: 330799 URL: https://svnweb.freebsd.org/changeset/base/330799 Log: ANSIfy sys/kern/imgact_* Modified: head/sys/kern/imgact_elf.c head/sys/kern/imgact_gzip.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Mon Mar 12 15:35:24 2018 (r330798) +++ head/sys/kern/imgact_elf.c Mon Mar 12 15:45:50 2018 (r330799) @@ -1467,9 +1467,7 @@ done: * program header entry. */ static void -cb_put_phdr(entry, closure) - vm_map_entry_t entry; - void *closure; +cb_put_phdr(vm_map_entry_t entry, void *closure) { struct phdr_closure *phc = (struct phdr_closure *)closure; Elf_Phdr *phdr = phc->phdr; Modified: head/sys/kern/imgact_gzip.c ============================================================================== --- head/sys/kern/imgact_gzip.c Mon Mar 12 15:35:24 2018 (r330798) +++ head/sys/kern/imgact_gzip.c Mon Mar 12 15:45:50 2018 (r330799) @@ -69,8 +69,7 @@ static int do_aout_hdr(struct imgact_gzip *); static int Flush(void *vp, u_char *, u_long siz); static int -exec_gzip_imgact(imgp) - struct image_params *imgp; +exec_gzip_imgact(struct image_params *imgp) { int error; const u_char *p = (const u_char *) imgp->image_header; From owner-svn-src-head@freebsd.org Mon Mar 12 15:56:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D6E3F50D91; Mon, 12 Mar 2018 15:56:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0776582626; Mon, 12 Mar 2018 15:56:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w2CFuIqj034698 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 12 Mar 2018 17:56:21 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w2CFuIqj034698 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w2CFuHAB034697; Mon, 12 Mar 2018 17:56:17 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 12 Mar 2018 17:56:17 +0200 From: Konstantin Belousov To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330780 - in head/sys: amd64/include isa x86/isa Message-ID: <20180312155617.GF76926@kib.kiev.ua> References: <201803111922.w2BJMwr8043084@repo.freebsd.org> <20180311195800.GC76926@kib.kiev.ua> <1520799639.84937.154.camel@freebsd.org> <20180311212539.GD76926@kib.kiev.ua> <1520868891.84937.177.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1520868891.84937.177.camel@freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 15:56:29 -0000 On Mon, Mar 12, 2018 at 09:34:51AM -0600, Ian Lepore wrote: > On Sun, 2018-03-11 at 23:25 +0200, Konstantin Belousov wrote: > > On Sun, Mar 11, 2018 at 02:20:39PM -0600, Ian Lepore wrote: > > > > > > On Sun, 2018-03-11 at 21:58 +0200, Konstantin Belousov wrote: > > > > > > > > On Sun, Mar 11, 2018 at 07:22:58PM +0000, Ian Lepore wrote: > > > > > > > > > > > > > > > [...] > > > > > > Unfortunately, this reverts one type of wrong locking back to another. > > > šThe need is to prevent access to the atrtc hardware if efi is > > > accessing it, and the locking I just reverted to that uses a sleepable > > > mutex only protects against inittodr()/resettodr() access, but not > > > against nvram(4) or if the atrtc is being used as an eventtimer (of > > > course nobody uses it for that, but the driver supports it). > > > > > > I have some pending changes that cause the atrtc driver to just not > > > attach at all if the efirtc driver attached, but they're stacked up > > > behind some other changes in phab. šAnd that still doesn't fix the > > > nvram(4) part of it. > > Not attaching atrtc if efirtc is attached sounds reasonable. But then > > you should also disable efirt attach if atrtc is on. One possible issue > > is that efirt is typicall loadable, while atrtc is compiled into the > > kernel, which means that efirt would become virtually unusable. > > > > Even if efirt is loaded (in loader(8)) the efirtc driver will still > attach instead of atrtc, because it's a direct child of nexus and gets > the first opportunity to probe and attach. šBut you raise a good point, > I should make it handle the case where it gets kldload'd when atrtc is > already attached. > > > For nvram(4), you can take the atrtc_time_lock around accesses in addition > > to the atrtc_lock, instead of providing exclusivity on the level of drivers > > attach. > > It occurs to me that an even better fix for all of this would be to > remove support for atrtc being an eventtimer. šThat allows removing the > interrupt filter handler, and then there's no need for a spinlock at > all, a sleepable mutex works fine for all accesses. > > Does anybody really need an eventtimer that runs only at a fixed > periodic rate of 32khz in 2018? Problem is that atrtc is what old machines use. If we have HPET or better LAPIC timers, then we do not need atrtc at all, of course. But e.g. 486 do not have them. I am not even sure about early amd64 machines. Definitely any machine that needs EFIRT has both HPET and LAPIC, I like the idea of not providing eventtimer backed by atrtc if feasible. Might be, make this a compile or runtime option, unless this over-complicates the code. From owner-svn-src-head@freebsd.org Mon Mar 12 16:31:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEC3DF534B6; Mon, 12 Mar 2018 16:31: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 635B18416B; Mon, 12 Mar 2018 16:31:26 +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 5E29162A9; Mon, 12 Mar 2018 16:31:26 +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 w2CGVQx6072745; Mon, 12 Mar 2018 16:31:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CGVQxA072743; Mon, 12 Mar 2018 16:31:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201803121631.w2CGVQxA072743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 12 Mar 2018 16:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330802 - in head: sbin/nvmecontrol sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: sbin/nvmecontrol sys/dev/nvme X-SVN-Commit-Revision: 330802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 16:31:26 -0000 Author: mav Date: Mon Mar 12 16:31:25 2018 New Revision: 330802 URL: https://svnweb.freebsd.org/changeset/base/330802 Log: Print fuses and fna fields in identify data. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sbin/nvmecontrol/identify.c head/sys/dev/nvme/nvme.h Modified: head/sbin/nvmecontrol/identify.c ============================================================================== --- head/sbin/nvmecontrol/identify.c Mon Mar 12 16:04:10 2018 (r330801) +++ head/sbin/nvmecontrol/identify.c Mon Mar 12 16:31:25 2018 (r330802) @@ -196,6 +196,17 @@ print_controller(struct nvme_controller_data *cdata) printf("Timestamp feature: %sSupported\n", ((oncs >> NVME_CTRLR_DATA_ONCS_TIMESTAMP_SHIFT) & NVME_CTRLR_DATA_ONCS_TIMESTAMP_MASK) ? "" : "Not "); + printf("Fused Operation Support: %s%s\n", + (cdata->fuses == 0) ? "Not Supported" : "", + ((cdata->fuses >> NVME_CTRLR_DATA_FUSES_CNW_SHIFT) & + NVME_CTRLR_DATA_FUSES_CNW_MASK) ? "Compare and Write" : ""); + printf("Format NVM Attributes: %s%s Erase, %s Format\n", + ((cdata->fna >> NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_SHIFT) & + NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_MASK) ? "Crypto Erase, " : "", + ((cdata->fna >> NVME_CTRLR_DATA_FNA_ERASE_ALL_SHIFT) & + NVME_CTRLR_DATA_FNA_ERASE_ALL_MASK) ? "All-NVM" : "Per-NS", + ((cdata->fna >> NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT) & + NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK) ? "All-NVM" : "Per-NS"); printf("Volatile Write Cache: %s\n", vwc_present ? "Present" : "Not Present"); Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Mon Mar 12 16:04:10 2018 (r330801) +++ head/sys/dev/nvme/nvme.h Mon Mar 12 16:31:25 2018 (r330802) @@ -244,6 +244,18 @@ #define NVME_CTRLR_DATA_ONCS_TIMESTAMP_SHIFT (6) #define NVME_CTRLR_DATA_ONCS_TIMESTAMP_MASK (0x1) +/** Fused Operation Support */ +#define NVME_CTRLR_DATA_FUSES_CNW_SHIFT (0) +#define NVME_CTRLR_DATA_FUSES_CNW_MASK (0x1) + +/** Format NVM Attributes */ +#define NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT (0) +#define NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK (0x1) +#define NVME_CTRLR_DATA_FNA_ERASE_ALL_SHIFT (1) +#define NVME_CTRLR_DATA_FNA_ERASE_ALL_MASK (0x1) +#define NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_SHIFT (2) +#define NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_MASK (0x1) + /** volatile write cache */ #define NVME_CTRLR_DATA_VWC_PRESENT_SHIFT (0) #define NVME_CTRLR_DATA_VWC_PRESENT_MASK (0x1) From owner-svn-src-head@freebsd.org Mon Mar 12 16:44:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED44BF2A599 for ; Mon, 12 Mar 2018 16:44:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FD3484E2F for ; Mon, 12 Mar 2018 16:44:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x236.google.com with SMTP id v10so5562299iob.6 for ; Mon, 12 Mar 2018 09:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2M8kfs6Tm7DmbyzHLgnC2NF7gw/2jo9LhR0j5ZcrncQ=; b=JR5DDFJrGnG14QG1O3wk4jINJgpWMc+uOzjstcNTtp1zDR6gBXNsvFF4/rouDIua1A V+v5AgZUsNPsOBMOyIDSAI4qgHvKtUIFKJ/8Ia5EoHxQSPmgqR0NiN8U8AL8Lv+0gtVg uJBSmr1Ie4W4CJZ52luIcmVqZPIbsYSghxAguObyuLVMC4/GwpS7BNCoAwNGvneIfIyJ bi/h7UVUwGg4IZ2A06ZejKIHheuUXlmySgGitF0Mo7w/dEoOSvEEP5UWGkHVs/4xaJ1j QI7WMv+mTtQp0nX4qCYpQWwj+3tkcWuW78i+xP7NV7UGTRQZmyGis5i0EdcXp2kCNUQ8 /Gew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=2M8kfs6Tm7DmbyzHLgnC2NF7gw/2jo9LhR0j5ZcrncQ=; b=La+tEoM4pg+dBJ5sICTuspr21K4qXgoPHi9WEy8EQSh7N/ADDD7UIEgIYrUWuHjlBC 506ilU5F4AWwnMgKtdz47GE9sRqcTHjcD9C7mr62oaIWI7W9tcJsKJZC0M85VCvxLfFr JLO2HvLST1SBBfYEFIu32LzYHGAgK4yMWnaKrPOptBXUvYCEIsdc5HUnbyx+iMb7CK+f ViO6edIcP3rP5hxd0pgHY4HkI/RIfDq9wJ3v5xSB7J++o9mPzbkEeUNYqAsARVFUmRXZ m5/qC2M46ALTIJ1ZlA4PRDo7MFdtH+roC0hl+Tm5feLc9YEBiN9KqzR5kxhTUAJflz3+ GxMA== X-Gm-Message-State: AElRT7FXbETmG5RW2sDriRFtAnyPebPl1tl7F6qndcN1gkmU88hQXPOT kncFzG1cSeq2yUpCwdaiadlFbQ7hpZWo720eYKC4/g== X-Google-Smtp-Source: AG47ELuM7QVveg66mAiI0RJFmu+F7xrbxvu+ol7XZ9yafB3UfKRvicSG0OeaYAVa2FcxqWWo7LMj4MLh/OwygrIrG50= X-Received: by 10.107.180.83 with SMTP id d80mr9319650iof.168.1520873085568; Mon, 12 Mar 2018 09:44:45 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Mon, 12 Mar 2018 09:44:44 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201801291807.w0TI7EVD092154@repo.freebsd.org> From: Warner Losh Date: Mon, 12 Mar 2018 10:44:44 -0600 X-Google-Sender-Auth: AjwHSHmz-e7MEFJN_AQrTux88zE Message-ID: Subject: Re: svn commit: r328554 - head/sys/cam/scsi To: Dexuan-BSD Cui Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Dexuan Cui Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 16:44:47 -0000 I think this is a good idea to MFC. We've had no reports of it causing issues. There's more extensive locking changes / tweaks needed for da that just went in that likely should also be MFC'd. Warner On Sun, Mar 11, 2018 at 9:17 PM, Dexuan-BSD Cui wrote: > Hi imp and all, > I think this patch is very important, because it can fix a panic I > noticed recently when I try to hot-remove a SCSI disk from a VM > running on Azure/Hyper-V. > > The panic is almost 100% reproducible with stable/11, but not in the > latest CURRENT code, so finally I identified this fix in the CURRENT > branch. > > Can you please MFC this patch to 11 and 10? > It looks there is a major difference in the CAM code between 11/10 > and the CURRENT code, and we may have to MFC more related patches. If > this is difficult, I hope at least we can provide a minimal re-written > version of the patch to 11 and 10? > > Looking forward to your insight! > > Thanks, > -- Dexuan > > > On Mon, Jan 29, 2018 at 10:07 AM, Warner Losh wrote: > > Author: imp > > Date: Mon Jan 29 18:07:14 2018 > > New Revision: 328554 > > URL: https://svnweb.freebsd.org/changeset/base/328554 > > > > Log: > > Do the book-keeping on release before we release the reference. The > > periph was going away on final release, and then returning and we > > started dancing in free memory. > > > > Sponsored by: Netflix > > > > Modified: > > head/sys/cam/scsi/scsi_da.c > > > > Modified: head/sys/cam/scsi/scsi_da.c > > ============================================================ > ================== > > --- head/sys/cam/scsi/scsi_da.c Mon Jan 29 17:32:30 2018 (r328553) > > +++ head/sys/cam/scsi/scsi_da.c Mon Jan 29 18:07:14 2018 (r328554) > > @@ -1549,12 +1549,12 @@ da_periph_unhold(struct cam_periph *periph, > da_ref_tok > > struct da_softc *softc = periph->softc; > > > > token_sanity(token); > > - cam_periph_unhold(periph); > > DA_PERIPH_PRINT(periph, "Unholding device %s (%d)\n", > > da_ref_text[token], token); > > cnt = atomic_fetchadd_int(&softc->ref_flags[token], -1); > > if (cnt != 1) > > panic("Unholding %d with cnt = %d", token, cnt); > > + cam_periph_unhold(periph); > > } > > > > static inline int > > @@ -1583,12 +1583,12 @@ da_periph_release(struct cam_periph *periph, > da_ref_to > > struct da_softc *softc = periph->softc; > > > > token_sanity(token); > > - cam_periph_release(periph); > > DA_PERIPH_PRINT(periph, "releasing device %s (%d)\n", > > da_ref_text[token], token); > > cnt = atomic_fetchadd_int(&softc->ref_flags[token], -1); > > if (cnt != 1) > > panic("Releasing %d with cnt = %d", token, cnt); > > + cam_periph_release(periph); > > } > > > > static inline void > > @@ -1598,12 +1598,12 @@ da_periph_release_locked(struct cam_periph > *periph, da > > struct da_softc *softc = periph->softc; > > > > token_sanity(token); > > - cam_periph_release_locked(periph); > > DA_PERIPH_PRINT(periph, "releasing device (locked) %s (%d)\n", > > da_ref_text[token], token); > > cnt = atomic_fetchadd_int(&softc->ref_flags[token], -1); > > if (cnt != 1) > > panic("Unholding %d with cnt = %d", token, cnt); > > + cam_periph_release_locked(periph); > > } > > > > #define cam_periph_hold POISON > > > From owner-svn-src-head@freebsd.org Mon Mar 12 16:58:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 469C9F2B873; Mon, 12 Mar 2018 16:58:57 +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 964A485C81; Mon, 12 Mar 2018 16:58:56 +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 w2CGws7m079444; Mon, 12 Mar 2018 09:58:54 -0700 (PDT) (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 w2CGwsmx079443; Mon, 12 Mar 2018 09:58:54 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803121658.w2CGwsmx079443@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r330792 - in head: sbin/ipfw sys/netpfil/ipfw In-Reply-To: <201803120940.w2C9ekns070289@repo.freebsd.org> To: "Andrey V. Elsukov" Date: Mon, 12 Mar 2018 09:58:54 -0700 (PDT) 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 16:58:57 -0000 > Author: ae > Date: Mon Mar 12 09:40:46 2018 > New Revision: 330792 > URL: https://svnweb.freebsd.org/changeset/base/330792 > > Log: > Do not try to reassemble IPv6 fragments in "reass" rule. > > ip_reass() expects IPv4 packet and will just corrupt any IPv6 packets > that it gets. Until proper IPv6 fragments handling function will be > implemented, pass IPv6 packets to next rule. Thank you! This should simplify some discussion occuring about /etc/rc.firewall in workstation mode and the fact it does not handly fragmentation correctly, part of fixing that invovled be sure to only pass ipv4 to a reass rule, with this fix that shall no longer be necessary. https://reviews.freebsd.org/D9920 > PR: 170604 > MFC after: 1 week > > Modified: > head/sbin/ipfw/ipfw.8 > head/sys/netpfil/ipfw/ip_fw2.c > > Modified: head/sbin/ipfw/ipfw.8 > ============================================================================== > --- head/sbin/ipfw/ipfw.8 Mon Mar 12 05:41:27 2018 (r330791) > +++ head/sbin/ipfw/ipfw.8 Mon Mar 12 09:40:46 2018 (r330792) > @@ -1,7 +1,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd November 26, 2017 > +.Dd March 12, 2018 > .Dt IPFW 8 > .Os > .Sh NAME > @@ -1135,7 +1135,7 @@ Regardless of matched a packet or not by the > .Cm tcp-setmss > rule, the search continues with the next rule. > .It Cm reass > -Queue and reassemble IP fragments. > +Queue and reassemble IPv4 fragments. > If the packet is not fragmented, counters are updated and > processing continues with the next rule. > If the packet is the last logical fragment, the packet is reassembled and, if > > Modified: head/sys/netpfil/ipfw/ip_fw2.c > ============================================================================== > --- head/sys/netpfil/ipfw/ip_fw2.c Mon Mar 12 05:41:27 2018 (r330791) > +++ head/sys/netpfil/ipfw/ip_fw2.c Mon Mar 12 09:40:46 2018 (r330792) > @@ -3018,8 +3018,10 @@ do { \ > case O_REASS: { > int ip_off; > > - IPFW_INC_RULE_COUNTER(f, pktlen); > l = 0; /* in any case exit inner loop */ > + if (is_ipv6) /* IPv6 is not supported yet */ > + break; > + IPFW_INC_RULE_COUNTER(f, pktlen); > ip_off = ntohs(ip->ip_off); > > /* if not fragmented, go to next rule */ > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Mar 12 17:05:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D968DF2C20B; Mon, 12 Mar 2018 17:05:54 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82946864ED; Mon, 12 Mar 2018 17:05:54 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 796D46884; Mon, 12 Mar 2018 17:05:54 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CH5sZq093240; Mon, 12 Mar 2018 17:05:54 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CH5r0v093236; Mon, 12 Mar 2018 17:05:53 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201803121705.w2CH5r0v093236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 12 Mar 2018 17:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330803 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 330803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 17:05:55 -0000 Author: tsoome Date: Mon Mar 12 17:05:53 2018 New Revision: 330803 URL: https://svnweb.freebsd.org/changeset/base/330803 Log: e1000g: this statement may fall through The gcc 7 does check for switch statement fall through cases, and if legit, such complaint can besilenced by /* FALLTHROUGH */ comment. Unfortunately such comment is quite limited, but will still notify the reader. This patch is backport from illumos, see https://www.illumos.org/rb/r/941/ Reviewed by: eadler Differential Revision: https://reviews.freebsd.org/D14663 Modified: head/sys/dev/e1000/e1000_82575.c head/sys/dev/e1000/e1000_mbx.c head/sys/dev/e1000/e1000_phy.c head/sys/dev/e1000/e1000_vf.c Modified: head/sys/dev/e1000/e1000_82575.c ============================================================================== --- head/sys/dev/e1000/e1000_82575.c Mon Mar 12 16:31:25 2018 (r330802) +++ head/sys/dev/e1000/e1000_82575.c Mon Mar 12 17:05:53 2018 (r330803) @@ -1679,7 +1679,7 @@ static s32 e1000_setup_serdes_link_82575(struct e1000_ case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX: /* disable PCS autoneg and support parallel detect only */ pcs_autoneg = FALSE; - /* fall through to default case */ + /* FALLTHROUGH */ default: if (hw->mac.type == e1000_82575 || hw->mac.type == e1000_82576) { @@ -1806,6 +1806,7 @@ static s32 e1000_get_media_type_82575(struct e1000_hw break; } /* fall through for I2C based SGMII */ + /* FALLTHROUGH */ case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES: /* read media type from SFP EEPROM */ ret_val = e1000_set_sfp_media_type_82575(hw); Modified: head/sys/dev/e1000/e1000_mbx.c ============================================================================== --- head/sys/dev/e1000/e1000_mbx.c Mon Mar 12 16:31:25 2018 (r330802) +++ head/sys/dev/e1000/e1000_mbx.c Mon Mar 12 17:05:53 2018 (r330803) @@ -779,6 +779,7 @@ s32 e1000_init_mbx_params_pf(struct e1000_hw *hw) mbx->stats.reqs = 0; mbx->stats.acks = 0; mbx->stats.rsts = 0; + /* FALLTHROUGH */ default: return E1000_SUCCESS; } Modified: head/sys/dev/e1000/e1000_phy.c ============================================================================== --- head/sys/dev/e1000/e1000_phy.c Mon Mar 12 16:31:25 2018 (r330802) +++ head/sys/dev/e1000/e1000_phy.c Mon Mar 12 17:05:53 2018 (r330803) @@ -1298,6 +1298,7 @@ s32 e1000_copper_link_setup_m88_gen2(struct e1000_hw * phy_data |= M88E1000_PSCR_AUTO_X_1000T; break; } + /* FALLTHROUGH */ case 0: default: phy_data |= M88E1000_PSCR_AUTO_X_MODE; Modified: head/sys/dev/e1000/e1000_vf.c ============================================================================== --- head/sys/dev/e1000/e1000_vf.c Mon Mar 12 16:31:25 2018 (r330802) +++ head/sys/dev/e1000/e1000_vf.c Mon Mar 12 17:05:53 2018 (r330803) @@ -488,8 +488,10 @@ s32 e1000_promisc_set_vf(struct e1000_hw *hw, enum e10 break; case e1000_promisc_enabled: msgbuf |= E1000_VF_SET_PROMISC_MULTICAST; + /* FALLTHROUGH */ case e1000_promisc_unicast: msgbuf |= E1000_VF_SET_PROMISC_UNICAST; + /* FALLTHROUGH */ case e1000_promisc_disabled: break; default: From owner-svn-src-head@freebsd.org Mon Mar 12 17:51:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61DF3F308F0; Mon, 12 Mar 2018 17:51:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 087A368A23; Mon, 12 Mar 2018 17:51:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 723D910A87D; Mon, 12 Mar 2018 13:51:32 -0400 (EDT) From: John Baldwin To: Eugene Grosbein Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330711 - head/sbin/sysctl Date: Mon, 12 Mar 2018 09:27:07 -0700 Message-ID: <2456392.O6IgoD01Hy@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <5AA3552D.5080203@grosbein.net> References: <201803092337.w29NbJSX093826@repo.freebsd.org> <5AA3552D.5080203@grosbein.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 12 Mar 2018 13:51:32 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 17:51:34 -0000 On Saturday, March 10, 2018 10:46:53 AM Eugene Grosbein wrote: > 10.03.2018 6:37, John Baldwin wrote: > > > Author: jhb > > Date: Fri Mar 9 23:37:19 2018 > > New Revision: 330711 > > URL: https://svnweb.freebsd.org/changeset/base/330711 > > > > Log: > > Permit sysctl(8) to set an array of numeric values for a single node. > > > > Most sysctl nodes only return a single value, but some nodes return an > > array of values (e.g. kern.cp_time). sysctl(8) understand how to display > > the values of a node that returns multiple values (it prints out each > > numeric value separated by spaces). However, until now sysctl(8) has > > only been able to set sysctl nodes to a single value. This change > > allows sysctl to accept a new value for a numeric sysctl node that contains > > multiple values separated by either spaces or commas. sysctl(8) parses > > this list into an array of values and passes the array as the "new" value > > to sysctl(2). > > Note well: we already have some examples of complex sysctl comma-separated "list" values such as: > > security.mac.portacl.rules=uid:53:tcp:53,uid:53:udp:53 Yes, but those are stored as strings (CTLTYPE_STRING) and require string parsing in the kernel. This permits nodes that just need a flat array of integers to be set without requiring string parsing in the kernel. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Mar 12 19:03:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 109E2F36C41; Mon, 12 Mar 2018 19:03:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 53DA56BEB9; Mon, 12 Mar 2018 19:03:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id C98BE1A21DD; Tue, 13 Mar 2018 06:02:56 +1100 (AEDT) Date: Tue, 13 Mar 2018 06:02:56 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330780 - in head/sys: amd64/include isa x86/isa In-Reply-To: <20180312155617.GF76926@kib.kiev.ua> Message-ID: <20180313045728.A3796@besplex.bde.org> References: <201803111922.w2BJMwr8043084@repo.freebsd.org> <20180311195800.GC76926@kib.kiev.ua> <1520799639.84937.154.camel@freebsd.org> <20180311212539.GD76926@kib.kiev.ua> <1520868891.84937.177.camel@freebsd.org> <20180312155617.GF76926@kib.kiev.ua> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VJytp5HX c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=c6azyYfdoJQ0Fgpok8kA:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 19:03:02 -0000 On Mon, 12 Mar 2018, Konstantin Belousov wrote: > On Mon, Mar 12, 2018 at 09:34:51AM -0600, Ian Lepore wrote: >> On Sun, 2018-03-11 at 23:25 +0200, Konstantin Belousov wrote: >>> On Sun, Mar 11, 2018 at 02:20:39PM -0600, Ian Lepore wrote: >>>> >>>> On Sun, 2018-03-11 at 21:58 +0200, Konstantin Belousov wrote: >>>>> >>>>> On Sun, Mar 11, 2018 at 07:22:58PM +0000, Ian Lepore wrote: >>>>>> >>>>>> >>>>>> [...] >>>> >>>> Unfortunately, this reverts one type of wrong locking back to another. >>>> =9AThe need is to prevent access to the atrtc hardware if efi is >>>> accessing it, and the locking I just reverted to that uses a sleepable >>>> mutex only protects against inittodr()/resettodr() access, but not >>>> against nvram(4) or if the atrtc is being used as an eventtimer (of >>>> course nobody uses it for that, but the driver supports it). >>>> >>>> I have some pending changes that cause the atrtc driver to just not >>>> attach at all if the efirtc driver attached, but they're stacked up >>>> behind some other changes in phab. =9AAnd that still doesn't fix the >>>> nvram(4) part of it. >>> Not attaching atrtc if efirtc is attached sounds reasonable. But then >>> you should also disable efirt attach if atrtc is on. One possible issue >>> is that efirt is typicall loadable, while atrtc is compiled into the >>> kernel, which means that efirt would become virtually unusable. >> >> Even if efirt is loaded (in loader(8)) the efirtc driver will still >> attach instead of atrtc, because it's a direct child of nexus and gets >> the first opportunity to probe and attach. =9ABut you raise a good point= , >> I should make it handle the case where it gets kldload'd when atrtc is >> already attached. >> >>> For nvram(4), you can take the atrtc_time_lock around accesses in addit= ion >>> to the atrtc_lock, instead of providing exclusivity on the level of dri= vers >>> attach. >> >> It occurs to me that an even better fix for all of this would be to >> remove support for atrtc being an eventtimer. =9AThat allows removing th= e >> interrupt filter handler, and then there's no need for a spinlock at >> all, a sleepable mutex works fine for all accesses. Sleep mutexes never work fine for real time clocks. They give unbounded time for clock accesses. >> Does anybody really need an eventtimer that runs only at a fixed >> periodic rate of 32khz in 2018? > > Problem is that atrtc is what old machines use. If we have HPET or > better LAPIC timers, then we do not need atrtc at all, of course. > But e.g. 486 do not have them. I am not even sure about early amd64 > machines. The early AMD development board "Solo 2" has LAPIC. It even has HPET for a timecounter but not for an event timer. My 2006 laptop doesn't have HPET. My version of FreeBSD-5 uses the 1 Hz RTC update interrupt for fixing up the timecounter after stopping in ddb. This should also be used for fixing up the timecounter after suspension. This doesn't need full event timer support, but it needs full interrupt support including spin mutexes. > Definitely any machine that needs EFIRT has both HPET and LAPIC, I like > the idea of not providing eventtimer backed by atrtc if feasible. Might > be, make this a compile or runtime option, unless this over-complicates > the code. It's just more complicated to make it optional. The top-level event timer code supports using "any" timer in the system with very little driver support, at least for drivers/hardware that only support periodic interrupt= s. Everyone with a 486 needs an atrtc that runs at 128 Hz like it used to. 32 kHz wastes a lot of CPU even on newer systems. Just reading 1 status register in rtc_intr() takes at least 1 usec. That is about 3% of the CPU at 32 kHz. rtcin() used to read 4 ISA registers (2 intentional delays which are FUD mainly for 20-30 year old systems). That is about 12% for the CPU at 32 kHz. Probably more like 20%. I optimized rtcin() especially for this case (where the index register is almost constant). SCHED_4BSD only needs 16 Hz, and only profiling needs more than 128 Hz. I used hz =3D stathz =3D lapic_timer_hz =3D 100 (all periodic) for some tim= e before event timers existed. This doesn't support fine-grained timeouts, but I don't want them. It gives much too synchronization between hardclock and statclock interrupts. but not much more than with the the old default lapic_timer_hz of 2000. Bruce From owner-svn-src-head@freebsd.org Mon Mar 12 19:03:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E756DF36CEB for ; Mon, 12 Mar 2018 19:03:31 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 704256C002 for ; Mon, 12 Mar 2018 19:03:31 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: ed7ad2f1-2627-11e8-b951-f99fef315fd9 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 outbound2.ore.mailhop.org (Halon) with ESMTPSA id ed7ad2f1-2627-11e8-b951-f99fef315fd9; Mon, 12 Mar 2018 19:02:37 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w2CJ3SfN016997; Mon, 12 Mar 2018 13:03:28 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1520881408.84937.232.camel@freebsd.org> Subject: Re: svn commit: r330780 - in head/sys: amd64/include isa x86/isa From: Ian Lepore To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 12 Mar 2018 13:03:28 -0600 In-Reply-To: <20180312155617.GF76926@kib.kiev.ua> References: <201803111922.w2BJMwr8043084@repo.freebsd.org> <20180311195800.GC76926@kib.kiev.ua> <1520799639.84937.154.camel@freebsd.org> <20180311212539.GD76926@kib.kiev.ua> <1520868891.84937.177.camel@freebsd.org> <20180312155617.GF76926@kib.kiev.ua> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 19:03:32 -0000 On Mon, 2018-03-12 at 17:56 +0200, Konstantin Belousov wrote: > On Mon, Mar 12, 2018 at 09:34:51AM -0600, Ian Lepore wrote: > > > > On Sun, 2018-03-11 at 23:25 +0200, Konstantin Belousov wrote: > > > > > > On Sun, Mar 11, 2018 at 02:20:39PM -0600, Ian Lepore wrote: > > > > > > > > > > > > On Sun, 2018-03-11 at 21:58 +0200, Konstantin Belousov wrote: > > > > > > > > > > > > > > > On Sun, Mar 11, 2018 at 07:22:58PM +0000, Ian Lepore wrote: > > > > > > > > > > > > > > > > > > > > > > > > [...] > > > > Unfortunately, this reverts one type of wrong locking back to another. > > > >  The need is to prevent access to the atrtc hardware if efi is > > > > accessing it, and the locking I just reverted to that uses a sleepable > > > > mutex only protects against inittodr()/resettodr() access, but not > > > > against nvram(4) or if the atrtc is being used as an eventtimer (of > > > > course nobody uses it for that, but the driver supports it). > > > > > > > > I have some pending changes that cause the atrtc driver to just not > > > > attach at all if the efirtc driver attached, but they're stacked up > > > > behind some other changes in phab.  And that still doesn't fix the > > > > nvram(4) part of it. > > > Not attaching atrtc if efirtc is attached sounds reasonable. But then > > > you should also disable efirt attach if atrtc is on. One possible issue > > > is that efirt is typicall loadable, while atrtc is compiled into the > > > kernel, which means that efirt would become virtually unusable. > > > > > Even if efirt is loaded (in loader(8)) the efirtc driver will still > > attach instead of atrtc, because it's a direct child of nexus and gets > > the first opportunity to probe and attach.  But you raise a good point, > > I should make it handle the case where it gets kldload'd when atrtc is > > already attached. > > > > > > > > For nvram(4), you can take the atrtc_time_lock around accesses in addition > > > to the atrtc_lock, instead of providing exclusivity on the level of drivers > > > attach. > > It occurs to me that an even better fix for all of this would be to > > remove support for atrtc being an eventtimer.  That allows removing the > > interrupt filter handler, and then there's no need for a spinlock at > > all, a sleepable mutex works fine for all accesses. > > > > Does anybody really need an eventtimer that runs only at a fixed > > periodic rate of 32khz in 2018? > Problem is that atrtc is what old machines use. If we have HPET or > better LAPIC timers, then we do not need atrtc at all, of course. > But e.g. 486 do not have them. I am not even sure about early amd64 > machines. I think not unless someone has manually configured it that way.  The i8254 timer should be used as both timecounter and eventtimer if there is no lapic or hpet.  i8254 has an ET priority of 100 compared to atrtc's 0.  That's by code inspection...  I might still have some industrial SBCs around here old enough to not have hpet or lapic, I'll see if I can get one running. -- Ian From owner-svn-src-head@freebsd.org Mon Mar 12 21:17:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CAABF4B84C for ; Mon, 12 Mar 2018 21:17:31 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C39D73690 for ; Mon, 12 Mar 2018 21:17:22 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 9d3d7712-263a-11e8-b951-f99fef315fd9 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 outbound2.ore.mailhop.org (Halon) with ESMTPSA id 9d3d7712-263a-11e8-b951-f99fef315fd9; Mon, 12 Mar 2018 21:16:22 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w2CLHELc017309; Mon, 12 Mar 2018 15:17:14 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1520889433.84937.255.camel@freebsd.org> Subject: Re: svn commit: r330780 - in head/sys: amd64/include isa x86/isa From: Ian Lepore To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 12 Mar 2018 15:17:13 -0600 In-Reply-To: <1520881408.84937.232.camel@freebsd.org> References: <201803111922.w2BJMwr8043084@repo.freebsd.org> <20180311195800.GC76926@kib.kiev.ua> <1520799639.84937.154.camel@freebsd.org> <20180311212539.GD76926@kib.kiev.ua> <1520868891.84937.177.camel@freebsd.org> <20180312155617.GF76926@kib.kiev.ua> <1520881408.84937.232.camel@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 21:17:31 -0000 On Mon, 2018-03-12 at 13:03 -0600, Ian Lepore wrote: > On Mon, 2018-03-12 at 17:56 +0200, Konstantin Belousov wrote: > > > > On Mon, Mar 12, 2018 at 09:34:51AM -0600, Ian Lepore wrote: > > > > > > [...] > > > > > > Does anybody really need an eventtimer that runs only at a fixed > > > periodic rate of 32khz in 2018? > > Problem is that atrtc is what old machines use. If we have HPET or > > better LAPIC timers, then we do not need atrtc at all, of course. > > But e.g. 486 do not have them. I am not even sure about early amd64 > > machines. > I think not unless someone has manually configured it that way.  The > i8254 timer should be used as both timecounter and eventtimer if there > is no lapic or hpet.  i8254 has an ET priority of 100 compared to > atrtc's 0.  That's by code inspection...  I might still have some > industrial SBCs around here old enough to not have hpet or lapic, I'll > see if I can get one running. > I found a nice old (2001 vintage) SBC based on a 586-class cyrix chip that has no lapic or hpet timers.  It had a copy of freebsd 11-current from Nov 2015 already installed and it booted right up.  It was using the i8254 hardware as both timecounter and eventtimer.  I rebooted it from a drive that had a copy of 12-current from yesterday and it behaved the same. Then I rebooted and set hint.attimer.0.clock=0 to prevent the i8254 driver from attaching an eventtimer.  That left only the atrtc eventimer, and the result of that was that the system just becomes comatose after saying "Timecounters tick every 0.967 msec".  So I booted the old 11-current image with i8254 disabled, and that behaved just the same. So, the eventtimer code in the atrtc driver doesn't even work, and has been broken (and unreported) since at least Nov 2015.  That sounds to me like even more evidence that we should just remove eventtimer stuff from the atrtc driver. -- Ian From owner-svn-src-head@freebsd.org Mon Mar 12 21:39:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5549F4D18E; Mon, 12 Mar 2018 21:39:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C5F674C87; Mon, 12 Mar 2018 21:39:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 509AE11249; Mon, 12 Mar 2018 21:39:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CLdSJM038138; Mon, 12 Mar 2018 21:39:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CLdRva038132; Mon, 12 Mar 2018 21:39:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803122139.w2CLdRva038132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Mar 2018 21:39:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330806 - in head/stand: common i386/libi386 libsa ofw/libofw uboot/lib zfs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: common i386/libi386 libsa ofw/libofw uboot/lib zfs X-SVN-Commit-Revision: 330806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 21:39:28 -0000 Author: imp Date: Mon Mar 12 21:39:27 2018 New Revision: 330806 URL: https://svnweb.freebsd.org/changeset/base/330806 Log: Minor cosmetic changes. Make sure { on the same line as struct for all struct *devdesc. Move some type definitions to next to the dv_type define, since that's what sets the d_type. Modified: head/stand/common/disk.h head/stand/i386/libi386/libi386.h head/stand/libsa/stand.h head/stand/ofw/libofw/libofw.h head/stand/uboot/lib/libuboot.h head/stand/zfs/libzfs.h Modified: head/stand/common/disk.h ============================================================================== --- head/stand/common/disk.h Mon Mar 12 17:37:38 2018 (r330805) +++ head/stand/common/disk.h Mon Mar 12 21:39:27 2018 (r330806) @@ -81,8 +81,8 @@ #ifndef _DISK_H #define _DISK_H -struct disk_devdesc -{ +/* Note: Must match the 'struct devdesc' in stand.h */ +struct disk_devdesc { struct devsw *d_dev; int d_type; int d_unit; Modified: head/stand/i386/libi386/libi386.h ============================================================================== --- head/stand/i386/libi386/libi386.h Mon Mar 12 17:37:38 2018 (r330805) +++ head/stand/i386/libi386/libi386.h Mon Mar 12 21:39:27 2018 (r330806) @@ -29,12 +29,10 @@ /* * i386 fully-qualified device descriptor. - * Note, this must match the 'struct devdesc' declaration - * in bootstrap.h and also with struct zfs_devdesc for zfs - * support. + * Note, this must match struct zfs_devdesc for zfs support. */ -struct i386_devdesc -{ +/* Note: Must match the 'struct devdesc' in stand.h */ +struct i386_devdesc { struct devsw *d_dev; int d_type; int d_unit; Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Mon Mar 12 17:37:38 2018 (r330805) +++ head/stand/libsa/stand.h Mon Mar 12 21:39:27 2018 (r330806) @@ -138,6 +138,12 @@ extern struct fs_ops pkgfs_fsops; struct devsw { const char dv_name[8]; int dv_type; /* opaque type constant, arch-dependant */ +#define DEVT_NONE 0 +#define DEVT_DISK 1 +#define DEVT_NET 2 +#define DEVT_CD 3 +#define DEVT_ZFS 4 +#define DEVT_FD 5 int (*dv_init)(void); /* early probe call */ int (*dv_strategy)(void *devdata, int rw, daddr_t blk, size_t size, char *buf, size_t *rsize); @@ -160,16 +166,9 @@ extern int errno; * versions may be larger, but should be allowed to * overlap. */ -struct devdesc -{ +struct devdesc { struct devsw *d_dev; int d_type; -#define DEVT_NONE 0 -#define DEVT_DISK 1 -#define DEVT_NET 2 -#define DEVT_CD 3 -#define DEVT_ZFS 4 -#define DEVT_FD 5 int d_unit; void *d_opendata; }; Modified: head/stand/ofw/libofw/libofw.h ============================================================================== --- head/stand/ofw/libofw/libofw.h Mon Mar 12 17:37:38 2018 (r330805) +++ head/stand/ofw/libofw/libofw.h Mon Mar 12 21:39:27 2018 (r330806) @@ -27,7 +27,7 @@ #include "openfirm.h" -/* Note: Must match the 'struct devdesc' in bootstrap.h */ +/* Note: Must match the 'struct devdesc' in stand.h */ struct ofw_devdesc { struct devsw *d_dev; int d_type; Modified: head/stand/uboot/lib/libuboot.h ============================================================================== --- head/stand/uboot/lib/libuboot.h Mon Mar 12 17:37:38 2018 (r330805) +++ head/stand/uboot/lib/libuboot.h Mon Mar 12 21:39:27 2018 (r330806) @@ -27,8 +27,8 @@ * $FreeBSD$ */ -struct uboot_devdesc -{ +/* Note: Must match the 'struct devdesc' in stand.h */ +struct uboot_devdesc { struct devsw *d_dev; int d_type; int d_unit; Modified: head/stand/zfs/libzfs.h ============================================================================== --- head/stand/zfs/libzfs.h Mon Mar 12 17:37:38 2018 (r330805) +++ head/stand/zfs/libzfs.h Mon Mar 12 21:39:27 2018 (r330806) @@ -33,12 +33,11 @@ /* * ZFS fully-qualified device descriptor. - * Note, this must match the 'struct devdesc' declaration in bootstrap.h. * Arch-specific device descriptors should be binary compatible with this * structure if they are to support ZFS. */ -struct zfs_devdesc -{ +/* Note: Must match the 'struct devdesc' in stand.h */ +struct zfs_devdesc { struct devsw *d_dev; int d_type; int d_unit; From owner-svn-src-head@freebsd.org Mon Mar 12 21:39:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD76EF4D1D3; Mon, 12 Mar 2018 21:39:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6ED7D74D75; Mon, 12 Mar 2018 21:39:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69E0A1124A; Mon, 12 Mar 2018 21:39:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CLdcH6038197; Mon, 12 Mar 2018 21:39:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CLdcCV038195; Mon, 12 Mar 2018 21:39:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803122139.w2CLdcCV038195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Mar 2018 21:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330807 - in head/stand/efi: libefi loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand/efi: libefi loader X-SVN-Commit-Revision: 330807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 21:39:39 -0000 Author: imp Date: Mon Mar 12 21:39:38 2018 New Revision: 330807 URL: https://svnweb.freebsd.org/changeset/base/330807 Log: We can't use d_opendata for blkio storage. open_disk uses d_opendata for it's own purpse. We can't store blkio there. Fortunately, blkio is stored elsewhere and we never actually retrieve blkio from d_opendata. Eliminate it as a source of confusion. Eliminate all stores of d_opendata in efi since this layer doesn't own that field. Modified: head/stand/efi/libefi/efipart.c head/stand/efi/loader/main.c Modified: head/stand/efi/libefi/efipart.c ============================================================================== --- head/stand/efi/libefi/efipart.c Mon Mar 12 21:39:27 2018 (r330806) +++ head/stand/efi/libefi/efipart.c Mon Mar 12 21:39:38 2018 (r330807) @@ -748,7 +748,6 @@ efipart_print_common(struct devsw *dev, pdinfo_list_t pd_dev.d_unit = pd->pd_unit; pd_dev.d_slice = -1; pd_dev.d_partition = -1; - pd_dev.d_opendata = blkio; ret = disk_open(&pd_dev, blkio->Media->BlockSize * (blkio->Media->LastBlock + 1), blkio->Media->BlockSize); Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Mon Mar 12 21:39:27 2018 (r330806) +++ head/stand/efi/loader/main.c Mon Mar 12 21:39:38 2018 (r330807) @@ -177,7 +177,6 @@ set_devdesc_currdev(struct devsw *dev, int unit) currdev.d_dev = dev; currdev.d_type = currdev.d_dev->dv_type; currdev.d_unit = unit; - currdev.d_opendata = NULL; devname = efi_fmtdev(&currdev); env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, @@ -205,7 +204,6 @@ find_currdev(EFI_LOADED_IMAGE *img) currdev.d_dev = &zfs_dev; currdev.d_unit = 0; currdev.d_type = currdev.d_dev->dv_type; - currdev.d_opendata = NULL; currdev.pool_guid = pool_guid; currdev.root_guid = 0; devname = efi_fmtdev(&currdev); @@ -227,7 +225,6 @@ find_currdev(EFI_LOADED_IMAGE *img) currdev.d_dev = &efipart_hddev; currdev.d_type = currdev.d_dev->dv_type; currdev.d_unit = dp->pd_unit; - currdev.d_opendata = NULL; currdev.d_slice = -1; currdev.d_partition = -1; From owner-svn-src-head@freebsd.org Mon Mar 12 21:39:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26902F4D20B; Mon, 12 Mar 2018 21:39:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B322274DED; Mon, 12 Mar 2018 21:39:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0EA31124B; Mon, 12 Mar 2018 21:39:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CLdgph038250; Mon, 12 Mar 2018 21:39:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CLdgPV038249; Mon, 12 Mar 2018 21:39:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803122139.w2CLdgPV038249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Mar 2018 21:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330808 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 330808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 21:39:45 -0000 Author: imp Date: Mon Mar 12 21:39:42 2018 New Revision: 330808 URL: https://svnweb.freebsd.org/changeset/base/330808 Log: Make struct libi386_devdesc match the struct devdesc better Move data to top and call it d_opendata. Modified: head/stand/i386/libi386/libi386.h Modified: head/stand/i386/libi386/libi386.h ============================================================================== --- head/stand/i386/libi386/libi386.h Mon Mar 12 21:39:38 2018 (r330807) +++ head/stand/i386/libi386/libi386.h Mon Mar 12 21:39:42 2018 (r330808) @@ -36,22 +36,17 @@ struct i386_devdesc { struct devsw *d_dev; int d_type; int d_unit; + void *d_opendata; union { struct { - void *data; int slice; int partition; off_t offset; } biosdisk; struct { - void *data; - } bioscd; - struct - { - void *data; uint64_t pool_guid; uint64_t root_guid; } zfs; From owner-svn-src-head@freebsd.org Mon Mar 12 21:39:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D395F4D245; Mon, 12 Mar 2018 21:39:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C43E74F05; Mon, 12 Mar 2018 21:39:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 508DE1124C; Mon, 12 Mar 2018 21:39:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CLdqHS038332; Mon, 12 Mar 2018 21:39:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CLdn7d038304; Mon, 12 Mar 2018 21:39:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803122139.w2CLdn7d038304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Mar 2018 21:39:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330809 - in head/stand: common efi/libefi efi/loader i386/libi386 i386/loader mips/beri/loader ofw/libofw sparc64/loader uboot/common uboot/lib userboot/userboot zfs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: common efi/libefi efi/loader i386/libi386 i386/loader mips/beri/loader ofw/libofw sparc64/loader uboot/common uboot/lib userboot/userboot zfs X-SVN-Commit-Revision: 330809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 21:39:55 -0000 Author: imp Date: Mon Mar 12 21:39:49 2018 New Revision: 330809 URL: https://svnweb.freebsd.org/changeset/base/330809 Log: Use the actual struct devdesc at the start of all *_devdesc structs The current system is fragile and requires very careful layout of all *_devdesc structures. It also makes it hard to change the base devdesc. Take a page from CAM and put the 'header' in all the derived classes and adjust the code to match. For OFW, move the iHandle h_handle out of a slot conflicting with d_opendata. Due to quirks in the alignment rules, this worked. However changing the code to use d_opendata storage now that it's a pointer is hard, so just have a separate field for it. All other cleanups were to make the *_devdesc structures match where they'd taken some liberties that were none-the-less compatible enough to work. Modified: head/stand/common/disk.c head/stand/common/disk.h head/stand/efi/libefi/efipart.c head/stand/efi/libefi/efizfs.c head/stand/efi/loader/main.c head/stand/i386/libi386/bioscd.c head/stand/i386/libi386/biosdisk.c head/stand/i386/libi386/bootinfo32.c head/stand/i386/libi386/devicename.c head/stand/i386/libi386/libi386.h head/stand/i386/loader/chain.c head/stand/i386/loader/main.c head/stand/mips/beri/loader/beri_disk_cfi.c head/stand/mips/beri/loader/beri_disk_sdcard.c head/stand/mips/beri/loader/devicename.c head/stand/ofw/libofw/devicename.c head/stand/ofw/libofw/libofw.h head/stand/sparc64/loader/main.c head/stand/uboot/common/main.c head/stand/uboot/lib/devicename.c head/stand/uboot/lib/disk.c head/stand/uboot/lib/libuboot.h head/stand/userboot/userboot/devicename.c head/stand/userboot/userboot/main.c head/stand/userboot/userboot/userboot_disk.c head/stand/zfs/libzfs.h head/stand/zfs/zfs.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/common/disk.c Mon Mar 12 21:39:49 2018 (r330809) @@ -86,7 +86,7 @@ ptblread(void *d, void *buf, size_t blocks, uint64_t o struct open_disk *od; dev = (struct disk_devdesc *)d; - od = (struct open_disk *)dev->d_opendata; + od = (struct open_disk *)dev->dd.d_opendata; /* * The strategy function assumes the offset is in units of 512 byte @@ -98,7 +98,7 @@ ptblread(void *d, void *buf, size_t blocks, uint64_t o * As the GPT backup partition is located at the end of the disk, * to avoid reading past disk end, flag bcache not to use RA. */ - return (dev->d_dev->dv_strategy(dev, F_READ | F_NORA, offset, + return (dev->dd.d_dev->dv_strategy(dev, F_READ | F_NORA, offset, blocks * od->sectorsize, (char *)buf, NULL)); } @@ -114,7 +114,7 @@ ptable_print(void *arg, const char *pname, const struc int res; pa = (struct print_args *)arg; - od = (struct open_disk *)pa->dev->d_opendata; + od = (struct open_disk *)pa->dev->dd.d_opendata; sprintf(line, " %s%s: %s", pa->prefix, pname, parttype2str(part->type)); if (pa->verbose) @@ -127,8 +127,8 @@ ptable_print(void *arg, const char *pname, const struc res = 0; if (part->type == PART_FREEBSD) { /* Open slice with BSD label */ - dev.d_dev = pa->dev->d_dev; - dev.d_unit = pa->dev->d_unit; + dev.dd.d_dev = pa->dev->dd.d_dev; + dev.dd.d_unit = pa->dev->dd.d_unit; dev.d_slice = part->index; dev.d_partition = -1; if (disk_open(&dev, part->end - part->start + 1, @@ -158,7 +158,7 @@ disk_print(struct disk_devdesc *dev, char *prefix, int struct print_args pa; /* Disk should be opened */ - od = (struct open_disk *)dev->d_opendata; + od = (struct open_disk *)dev->dd.d_opendata; pa.dev = dev; pa.prefix = prefix; pa.verbose = verbose; @@ -171,8 +171,8 @@ disk_read(struct disk_devdesc *dev, void *buf, uint64_ struct open_disk *od; int ret; - od = (struct open_disk *)dev->d_opendata; - ret = dev->d_dev->dv_strategy(dev, F_READ, dev->d_offset + offset, + od = (struct open_disk *)dev->dd.d_opendata; + ret = dev->dd.d_dev->dv_strategy(dev, F_READ, dev->d_offset + offset, blocks * od->sectorsize, buf, NULL); return (ret); @@ -184,8 +184,8 @@ disk_write(struct disk_devdesc *dev, void *buf, uint64 struct open_disk *od; int ret; - od = (struct open_disk *)dev->d_opendata; - ret = dev->d_dev->dv_strategy(dev, F_WRITE, dev->d_offset + offset, + od = (struct open_disk *)dev->dd.d_opendata; + ret = dev->dd.d_dev->dv_strategy(dev, F_WRITE, dev->d_offset + offset, blocks * od->sectorsize, buf, NULL); return (ret); @@ -194,7 +194,7 @@ disk_write(struct disk_devdesc *dev, void *buf, uint64 int disk_ioctl(struct disk_devdesc *dev, u_long cmd, void *data) { - struct open_disk *od = dev->d_opendata; + struct open_disk *od = dev->dd.d_opendata; if (od == NULL) return (ENOTTY); @@ -238,7 +238,7 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize DEBUG("no memory"); return (ENOMEM); } - dev->d_opendata = od; + dev->dd.d_opendata = od; od->entrysize = 0; od->mediasize = mediasize; od->sectorsize = sectorsize; @@ -348,7 +348,7 @@ disk_close(struct disk_devdesc *dev) { struct open_disk *od; - od = (struct open_disk *)dev->d_opendata; + od = (struct open_disk *)dev->dd.d_opendata; DEBUG("%s closed => %p", disk_fmtdev(dev), od); ptable_close(od->table); free(od); @@ -361,7 +361,7 @@ disk_fmtdev(struct disk_devdesc *dev) static char buf[128]; char *cp; - cp = buf + sprintf(buf, "%s%d", dev->d_dev->dv_name, dev->d_unit); + cp = buf + sprintf(buf, "%s%d", dev->dd.d_dev->dv_name, dev->dd.d_unit); if (dev->d_slice >= 0) { #ifdef LOADER_GPT_SUPPORT if (dev->d_partition == 255) { @@ -423,7 +423,7 @@ disk_parsedev(struct disk_devdesc *dev, const char *de if (*cp != '\0' && *cp != ':') return (EINVAL); - dev->d_unit = unit; + dev->dd.d_unit = unit; dev->d_slice = slice; dev->d_partition = partition; if (path != NULL) Modified: head/stand/common/disk.h ============================================================================== --- head/stand/common/disk.h Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/common/disk.h Mon Mar 12 21:39:49 2018 (r330809) @@ -83,10 +83,7 @@ /* Note: Must match the 'struct devdesc' in stand.h */ struct disk_devdesc { - struct devsw *d_dev; - int d_type; - int d_unit; - void *d_opendata; + struct devdesc dd; int d_slice; int d_partition; uint64_t d_offset; Modified: head/stand/efi/libefi/efipart.c ============================================================================== --- head/stand/efi/libefi/efipart.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/efi/libefi/efipart.c Mon Mar 12 21:39:49 2018 (r330809) @@ -744,8 +744,8 @@ efipart_print_common(struct devsw *dev, pdinfo_list_t continue; pd->pd_blkio = blkio; - pd_dev.d_dev = dev; - pd_dev.d_unit = pd->pd_unit; + pd_dev.dd.d_dev = dev; + pd_dev.dd.d_unit = pd->pd_unit; pd_dev.d_slice = -1; pd_dev.d_partition = -1; ret = disk_open(&pd_dev, blkio->Media->BlockSize * @@ -820,7 +820,7 @@ efipart_open(struct open_file *f, ...) if (pd->pd_bcache == NULL) pd->pd_bcache = bcache_allocate(); - if (dev->d_dev->dv_type == DEVT_DISK) { + if (dev->dd.d_dev->dv_type == DEVT_DISK) { int rc; rc = disk_open(dev, @@ -859,7 +859,7 @@ efipart_close(struct open_file *f) bcache_free(pd->pd_bcache); pd->pd_bcache = NULL; } - if (dev->d_dev->dv_type == DEVT_DISK) + if (dev->dd.d_dev->dv_type == DEVT_DISK) return (disk_close(dev)); return (0); } @@ -879,7 +879,7 @@ efipart_ioctl(struct open_file *f, u_long cmd, void *d if (pd == NULL) return (EINVAL); - if (dev->d_dev->dv_type == DEVT_DISK) { + if (dev->dd.d_dev->dv_type == DEVT_DISK) { rc = disk_ioctl(dev, cmd, data); if (rc != ENOTTY) return (rc); @@ -966,7 +966,7 @@ efipart_strategy(void *devdata, int rw, daddr_t blk, s bcd.dv_devdata = devdata; bcd.dv_cache = pd->pd_bcache; - if (dev->d_dev->dv_type == DEVT_DISK) { + if (dev->dd.d_dev->dv_type == DEVT_DISK) { daddr_t offset; offset = dev->d_offset * pd->pd_blkio->Media->BlockSize; @@ -1010,7 +1010,7 @@ efipart_realstrategy(void *devdata, int rw, daddr_t bl * partition. */ disk_blocks = 0; - if (dev->d_dev->dv_type == DEVT_DISK) { + if (dev->dd.d_dev->dv_type == DEVT_DISK) { if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { /* DIOCGMEDIASIZE does return bytes. */ disk_blocks /= blkio->Media->BlockSize; Modified: head/stand/efi/libefi/efizfs.c ============================================================================== --- head/stand/efi/libefi/efizfs.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/efi/libefi/efizfs.c Mon Mar 12 21:39:49 2018 (r330809) @@ -29,8 +29,7 @@ __FBSDID("$FreeBSD$"); #include -#include -#include +#include #ifdef EFI_ZFS_BOOT #include Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/efi/loader/main.c Mon Mar 12 21:39:49 2018 (r330809) @@ -201,9 +201,9 @@ find_currdev(EFI_LOADED_IMAGE *img) if (pool_guid != 0) { struct zfs_devdesc currdev; - currdev.d_dev = &zfs_dev; - currdev.d_unit = 0; - currdev.d_type = currdev.d_dev->dv_type; + currdev.dd.d_dev = &zfs_dev; + currdev.dd.d_unit = 0; + currdev.dd.d_type = currdev.dd.d_dev->dv_type; currdev.pool_guid = pool_guid; currdev.root_guid = 0; devname = efi_fmtdev(&currdev); @@ -222,9 +222,9 @@ find_currdev(EFI_LOADED_IMAGE *img) STAILQ_FOREACH(dp, pdi_list, pd_link) { struct disk_devdesc currdev; - currdev.d_dev = &efipart_hddev; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_unit = dp->pd_unit; + currdev.dd.d_dev = &efipart_hddev; + currdev.dd.d_type = currdev.dd.d_dev->dv_type; + currdev.dd.d_unit = dp->pd_unit; currdev.d_slice = -1; currdev.d_partition = -1; Modified: head/stand/i386/libi386/bioscd.c ============================================================================== --- head/stand/i386/libi386/bioscd.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/i386/libi386/bioscd.c Mon Mar 12 21:39:49 2018 (r330809) @@ -90,7 +90,7 @@ static struct bcinfo { } bcinfo [MAXBCDEV]; static int nbcinfo = 0; -#define BC(dev) (bcinfo[(dev)->d_unit]) +#define BC(dev) (bcinfo[(dev)->dd.d_unit]) static int bc_read(int unit, daddr_t dblk, int blks, caddr_t dest); static int bc_init(void); @@ -211,7 +211,7 @@ bc_open(struct open_file *f, ...) va_start(ap, f); dev = va_arg(ap, struct i386_devdesc *); va_end(ap); - if (dev->d_unit >= nbcinfo) { + if (dev->dd.d_unit >= nbcinfo) { DEBUG("attempt to open nonexistent disk"); return(ENXIO); } @@ -271,7 +271,7 @@ bc_realstrategy(void *devdata, int rw, daddr_t dblk, s if ((rw & F_MASK) != F_READ) return(EROFS); dev = (struct i386_devdesc *)devdata; - unit = dev->d_unit; + unit = dev->dd.d_unit; blks = size / BIOSCD_SECSIZE; if (dblk % (BIOSCD_SECSIZE / DEV_BSIZE) != 0) return (EINVAL); @@ -427,7 +427,7 @@ bc_getdev(struct i386_devdesc *dev) int major; int rootdev; - unit = dev->d_unit; + unit = dev->dd.d_unit; biosdev = bc_unit2bios(unit); DEBUG("unit %d BIOS device %d", unit, biosdev); if (biosdev == -1) /* not a BIOS device */ Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/i386/libi386/biosdisk.c Mon Mar 12 21:39:49 2018 (r330809) @@ -120,7 +120,7 @@ static struct bdinfo } bdinfo [MAXBDDEV]; static int nbdinfo = 0; -#define BD(dev) (bdinfo[(dev)->d_unit]) +#define BD(dev) (bdinfo[(dev)->dd.d_unit]) static int bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest); @@ -349,8 +349,8 @@ bd_print(int verbose) bdinfo[i].bd_sectorsize); if ((ret = pager_output(line)) != 0) break; - dev.d_dev = &biosdisk; - dev.d_unit = i; + dev.dd.d_dev = &biosdisk; + dev.dd.d_unit = i; dev.d_slice = -1; dev.d_partition = -1; if (disk_open(&dev, @@ -389,7 +389,7 @@ bd_open(struct open_file *f, ...) dev = va_arg(ap, struct disk_devdesc *); va_end(ap); - if (dev->d_unit < 0 || dev->d_unit >= nbdinfo) + if (dev->dd.d_unit < 0 || dev->dd.d_unit >= nbdinfo) return (EIO); BD(dev).bd_open++; if (BD(dev).bd_bcache == NULL) @@ -402,10 +402,10 @@ bd_open(struct open_file *f, ...) * During bd_probe() we tested if the mulitplication of bd_sectors * would overflow so it should be safe to perform here. */ - disk.d_dev = dev->d_dev; - disk.d_type = dev->d_type; - disk.d_unit = dev->d_unit; - disk.d_opendata = NULL; + disk.dd.d_dev = dev->dd.d_dev; + disk.dd.d_type = dev->dd.d_type; + disk.dd.d_unit = dev->dd.d_unit; + disk.dd.d_opendata = NULL; disk.d_slice = -1; disk.d_partition = -1; disk.d_offset = 0; @@ -431,7 +431,7 @@ bd_open(struct open_file *f, ...) return (err); /* if we already know there is no GELI, skip the rest */ - if (geli_status[dev->d_unit][dev->d_slice] != ISGELI_UNKNOWN) + if (geli_status[dev->dd.d_unit][dev->d_slice] != ISGELI_UNKNOWN) return (err); struct dsk dskp; @@ -440,9 +440,9 @@ bd_open(struct open_file *f, ...) struct pentry *entry; int geli_part = 0; - dskp.drive = bd_unit2bios(dev->d_unit); - dskp.type = dev->d_type; - dskp.unit = dev->d_unit; + dskp.drive = bd_unit2bios(dev->dd.d_unit); + dskp.type = dev->dd.d_type; + dskp.unit = dev->dd.d_unit; dskp.slice = dev->d_slice; dskp.part = dev->d_partition; dskp.start = dev->d_offset; @@ -466,13 +466,13 @@ bd_open(struct open_file *f, ...) dskp.slice = entry->part.index; dskp.start = entry->part.start; if (is_geli(&dskp) == 0) { - geli_status[dev->d_unit][dskp.slice] = ISGELI_YES; + geli_status[dev->dd.d_unit][dskp.slice] = ISGELI_YES; return (0); } if (geli_taste(bios_read, &dskp, entry->part.end - entry->part.start) == 0) { if (geli_havekey(&dskp) == 0) { - geli_status[dev->d_unit][dskp.slice] = ISGELI_YES; + geli_status[dev->dd.d_unit][dskp.slice] = ISGELI_YES; geli_part++; continue; } @@ -486,18 +486,18 @@ bd_open(struct open_file *f, ...) &dskp) == 0) { setenv("kern.geom.eli.passphrase", gelipw, 1); bzero(gelipw, sizeof(gelipw)); - geli_status[dev->d_unit][dskp.slice] = ISGELI_YES; + geli_status[dev->dd.d_unit][dskp.slice] = ISGELI_YES; geli_part++; continue; } } else - geli_status[dev->d_unit][dskp.slice] = ISGELI_NO; + geli_status[dev->dd.d_unit][dskp.slice] = ISGELI_NO; } /* none of the partitions on this disk have GELI */ if (geli_part == 0) { /* found no GELI */ - geli_status[dev->d_unit][dev->d_slice] = ISGELI_NO; + geli_status[dev->dd.d_unit][dev->d_slice] = ISGELI_NO; } #endif /* LOADER_GELI_SUPPORT */ @@ -834,10 +834,10 @@ bd_read(struct disk_devdesc *dev, daddr_t dblk, int bl char *tmpbuf; /* if we already know there is no GELI, skip the rest */ - if (geli_status[dev->d_unit][dev->d_slice] != ISGELI_YES) + if (geli_status[dev->dd.d_unit][dev->d_slice] != ISGELI_YES) return (bd_io(dev, dblk, blks, dest, 0)); - if (geli_status[dev->d_unit][dev->d_slice] == ISGELI_YES) { + if (geli_status[dev->dd.d_unit][dev->d_slice] == ISGELI_YES) { /* * Align reads to DEV_GELIBOOT_BSIZE bytes because partial * sectors cannot be decrypted. Round the requested LBA down to @@ -871,9 +871,9 @@ bd_read(struct disk_devdesc *dev, daddr_t dblk, int bl if (err) return (err); - dskp.drive = bd_unit2bios(dev->d_unit); - dskp.type = dev->d_type; - dskp.unit = dev->d_unit; + dskp.drive = bd_unit2bios(dev->dd.d_unit); + dskp.type = dev->dd.d_type; + dskp.unit = dev->dd.d_unit; dskp.slice = dev->d_slice; dskp.part = dev->d_partition; dskp.start = dev->d_offset; @@ -950,8 +950,8 @@ bd_getdev(struct i386_devdesc *d) int i, unit; dev = (struct disk_devdesc *)d; - biosdev = bd_unit2bios(dev->d_unit); - DEBUG("unit %d BIOS device %d", dev->d_unit, biosdev); + biosdev = bd_unit2bios(dev->dd.d_unit); + DEBUG("unit %d BIOS device %d", dev->dd.d_unit, biosdev); if (biosdev == -1) /* not a BIOS device */ return(-1); if (disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize, @@ -962,7 +962,7 @@ bd_getdev(struct i386_devdesc *d) if (biosdev < 0x80) { /* floppy (or emulated floppy) or ATAPI device */ - if (bdinfo[dev->d_unit].bd_type == DT_ATAPI) { + if (bdinfo[dev->dd.d_unit].bd_type == DT_ATAPI) { /* is an ATAPI disk */ major = WFDMAJOR; } else { @@ -996,9 +996,9 @@ bios_read(void *vdev __unused, void *xpriv, off_t off, struct disk_devdesc dev; struct dsk *priv = xpriv; - dev.d_dev = &biosdisk; - dev.d_type = priv->type; - dev.d_unit = priv->unit; + dev.dd.d_dev = &biosdisk; + dev.dd.d_type = priv->type; + dev.dd.d_unit = priv->unit; dev.d_slice = priv->slice; dev.d_partition = priv->part; dev.d_offset = priv->start; Modified: head/stand/i386/libi386/bootinfo32.c ============================================================================== --- head/stand/i386/libi386/bootinfo32.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/i386/libi386/bootinfo32.c Mon Mar 12 21:39:49 2018 (r330809) @@ -181,16 +181,16 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_o /* XXX - use a default bootdev of 0. Is this ok??? */ bootdevnr = 0; - switch(rootdev->d_type) { + switch(rootdev->dd.d_type) { case DEVT_CD: /* Pass in BIOS device number. */ - bi.bi_bios_dev = bc_unit2bios(rootdev->d_unit); + bi.bi_bios_dev = bc_unit2bios(rootdev->dd.d_unit); bootdevnr = bc_getdev(rootdev); break; case DEVT_DISK: /* pass in the BIOS device number of the current disk */ - bi.bi_bios_dev = bd_unit2bios(rootdev->d_unit); + bi.bi_bios_dev = bd_unit2bios(rootdev->dd.d_unit); bootdevnr = bd_getdev(rootdev); break; @@ -199,7 +199,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_o break; default: - printf("WARNING - don't know how to boot from device type %d\n", rootdev->d_type); + printf("WARNING - don't know how to boot from device type %d\n", rootdev->dd.d_type); } if (bootdevnr == -1) { printf("root device %s invalid\n", i386_fmtdev(rootdev)); Modified: head/stand/i386/libi386/devicename.c ============================================================================== --- head/stand/i386/libi386/devicename.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/i386/libi386/devicename.c Mon Mar 12 21:39:49 2018 (r330809) @@ -135,7 +135,7 @@ i386_parsedev(struct i386_devdesc **dev, const char *d goto fail; } - idev->d_unit = unit; + idev->dd.d_unit = unit; if (path != NULL) *path = (*cp == 0) ? cp : cp + 1; break; @@ -148,8 +148,8 @@ i386_parsedev(struct i386_devdesc **dev, const char *d err = EINVAL; goto fail; } - idev->d_dev = dv; - idev->d_type = dv->dv_type; + idev->dd.d_dev = dv; + idev->dd.d_type = dv->dv_type; if (dev == NULL) { free(idev); } else { @@ -169,14 +169,14 @@ i386_fmtdev(void *vdev) struct i386_devdesc *dev = (struct i386_devdesc *)vdev; static char buf[128]; /* XXX device length constant? */ - switch(dev->d_type) { + switch(dev->dd.d_type) { case DEVT_NONE: strcpy(buf, "(no device)"); break; case DEVT_CD: case DEVT_NET: - sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); + sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); break; case DEVT_DISK: Modified: head/stand/i386/libi386/libi386.h ============================================================================== --- head/stand/i386/libi386/libi386.h Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/i386/libi386/libi386.h Mon Mar 12 21:39:49 2018 (r330809) @@ -33,10 +33,7 @@ */ /* Note: Must match the 'struct devdesc' in stand.h */ struct i386_devdesc { - struct devsw *d_dev; - int d_type; - int d_unit; - void *d_opendata; + struct devdesc dd; union { struct Modified: head/stand/i386/loader/chain.c ============================================================================== --- head/stand/i386/loader/chain.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/i386/loader/chain.c Mon Mar 12 21:39:49 2018 (r330809) @@ -111,7 +111,7 @@ command_chain(int argc, char *argv[]) relocater_data[0].dest = 0x7C00; relocater_data[0].size = SECTOR_SIZE; - relocator_edx = bd_unit2bios(rootdev->d_unit); + relocator_edx = bd_unit2bios(rootdev->dd.d_unit); relocator_esi = relocater_size; relocator_ds = 0; relocator_es = 0; Modified: head/stand/i386/loader/main.c ============================================================================== --- head/stand/i386/loader/main.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/i386/loader/main.c Mon Mar 12 21:39:49 2018 (r330809) @@ -254,18 +254,18 @@ extract_currdev(void) int biosdev = -1; /* Assume we are booting from a BIOS disk by default */ - new_currdev.d_dev = &biosdisk; + new_currdev.dd.d_dev = &biosdisk; /* new-style boot loaders such as pxeldr and cdldr */ if (kargs->bootinfo == 0) { if ((kargs->bootflags & KARGS_FLAGS_CD) != 0) { /* we are booting from a CD with cdboot */ - new_currdev.d_dev = &bioscd; - new_currdev.d_unit = bc_bios2unit(initial_bootdev); + new_currdev.dd.d_dev = &bioscd; + new_currdev.dd.d_unit = bc_bios2unit(initial_bootdev); } else if ((kargs->bootflags & KARGS_FLAGS_PXE) != 0) { /* we are booting from pxeldr */ - new_currdev.d_dev = &pxedisk; - new_currdev.d_unit = 0; + new_currdev.dd.d_dev = &pxedisk; + new_currdev.dd.d_unit = 0; } else { /* we don't know what our boot device is */ new_currdev.d_kind.biosdisk.slice = -1; @@ -295,7 +295,7 @@ extract_currdev(void) new_currdev.d_kind.zfs.pool_guid = kargs->zfspool; new_currdev.d_kind.zfs.root_guid = 0; } - new_currdev.d_dev = &zfs_dev; + new_currdev.dd.d_dev = &zfs_dev; #endif } else if ((initial_bootdev & B_MAGICMASK) != B_DEVMAGIC) { /* The passed-in boot device is bad */ @@ -316,21 +316,21 @@ extract_currdev(void) if ((biosdev == 0) && (B_TYPE(initial_bootdev) != 2)) /* biosdev doesn't match major */ biosdev = 0x80 + B_UNIT(initial_bootdev); /* assume harddisk */ } - new_currdev.d_type = new_currdev.d_dev->dv_type; + new_currdev.dd.d_type = new_currdev.dd.d_dev->dv_type; /* * If we are booting off of a BIOS disk and we didn't succeed in determining * which one we booted off of, just use disk0: as a reasonable default. */ - if ((new_currdev.d_type == biosdisk.dv_type) && - ((new_currdev.d_unit = bd_bios2unit(biosdev)) == -1)) { + if ((new_currdev.dd.d_type == biosdisk.dv_type) && + ((new_currdev.dd.d_unit = bd_bios2unit(biosdev)) == -1)) { printf("Can't work out which disk we are booting from.\n" "Guessed BIOS device 0x%x not found by probes, defaulting to disk0:\n", biosdev); - new_currdev.d_unit = 0; + new_currdev.dd.d_unit = 0; } #ifdef LOADER_ZFS_SUPPORT - if (new_currdev.d_type == DEVT_ZFS) + if (new_currdev.dd.d_type == DEVT_ZFS) init_zfs_bootenv(zfs_fmtdev(&new_currdev)); #endif Modified: head/stand/mips/beri/loader/beri_disk_cfi.c ============================================================================== --- head/stand/mips/beri/loader/beri_disk_cfi.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/mips/beri/loader/beri_disk_cfi.c Mon Mar 12 21:39:49 2018 (r330809) @@ -98,7 +98,7 @@ beri_cfi_disk_open(struct open_file *f, ...) dev = va_arg(ap, struct disk_devdesc *); va_end(ap); - if (dev->d_unit != 0) + if (dev->dd.d_unit != 0) return (EIO); return (disk_open(dev, cfi_get_mediasize(), cfi_get_sectorsize())); } @@ -127,8 +127,8 @@ beri_cfi_disk_print(int verbose) ret = pager_output(line); if (ret != 0) return (ret); - dev.d_dev = &beri_cfi_disk; - dev.d_unit = 0; + dev.dd.d_dev = &beri_cfi_disk; + dev.dd.d_unit = 0; dev.d_slice = -1; dev.d_partition = -1; if (disk_open(&dev, cfi_get_mediasize(), cfi_get_sectorsize()) == 0) { Modified: head/stand/mips/beri/loader/beri_disk_sdcard.c ============================================================================== --- head/stand/mips/beri/loader/beri_disk_sdcard.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/mips/beri/loader/beri_disk_sdcard.c Mon Mar 12 21:39:49 2018 (r330809) @@ -103,7 +103,7 @@ beri_sdcard_disk_open(struct open_file *f, ...) return (ENXIO); } - if (dev->d_unit != 0) + if (dev->dd.d_unit != 0) return (EIO); return (disk_open(dev, altera_sdcard_get_mediasize(), altera_sdcard_get_sectorsize())); @@ -133,8 +133,8 @@ beri_sdcard_disk_print(int verbose) ret = pager_output(line); if (ret != 0) return (ret); - dev.d_dev = &beri_sdcard_disk; - dev.d_unit = 0; + dev.dd.d_dev = &beri_sdcard_disk; + dev.dd.d_unit = 0; dev.d_slice = -1; dev.d_partition = -1; if (disk_open(&dev, altera_sdcard_get_mediasize(), Modified: head/stand/mips/beri/loader/devicename.c ============================================================================== --- head/stand/mips/beri/loader/devicename.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/mips/beri/loader/devicename.c Mon Mar 12 21:39:49 2018 (r330809) @@ -139,7 +139,7 @@ beri_arch_parsedev(struct disk_devdesc **dev, const ch goto fail; } - idev->d_unit = unit; + idev->dd.d_unit = unit; if (path != NULL) *path = (*cp == 0) ? cp : cp + 1; break; @@ -148,8 +148,8 @@ beri_arch_parsedev(struct disk_devdesc **dev, const ch err = EINVAL; goto fail; } - idev->d_dev = dv; - idev->d_type = dv->dv_type; + idev->dd.d_dev = dv; + idev->dd.d_type = dv->dv_type; if (dev == NULL) { free(idev); } else { @@ -175,7 +175,7 @@ beri_arch_fmtdev(void *vdev) break; case DEVT_CD: - sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); + sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); break; case DEVT_DISK: @@ -183,7 +183,7 @@ beri_arch_fmtdev(void *vdev) case DEVT_NET: case DEVT_ZFS: - sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); + sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); break; } return(buf); Modified: head/stand/ofw/libofw/devicename.c ============================================================================== --- head/stand/ofw/libofw/devicename.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/ofw/libofw/devicename.c Mon Mar 12 21:39:49 2018 (r330809) @@ -113,9 +113,9 @@ found: return ENOMEM; } strcpy(idev->d_path, name); - idev->d_dev = dv; - idev->d_type = dv->dv_type; - if (idev->d_type == DEVT_ZFS) { + idev->dd.d_dev = dv; + idev->dd.d_type = dv->dv_type; + if (idev->dd.d_type == DEVT_ZFS) { p = devspec + strlen(dv->dv_name); err = zfs_parsedev((struct zfs_devdesc *)idev, p, path); if (err != 0) { Modified: head/stand/ofw/libofw/libofw.h ============================================================================== --- head/stand/ofw/libofw/libofw.h Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/ofw/libofw/libofw.h Mon Mar 12 21:39:49 2018 (r330809) @@ -27,14 +27,13 @@ #include "openfirm.h" -/* Note: Must match the 'struct devdesc' in stand.h */ struct ofw_devdesc { - struct devsw *d_dev; - int d_type; - int d_unit; - ihandle_t d_handle; + struct devdesc dd; union { - char d_path[256]; + struct { + ihandle_t d_handle; + char d_path[256]; + }; struct { uint64_t pool_guid; uint64_t root_guid; Modified: head/stand/sparc64/loader/main.c ============================================================================== --- head/stand/sparc64/loader/main.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/sparc64/loader/main.c Mon Mar 12 21:39:49 2018 (r330809) @@ -806,8 +806,8 @@ sparc64_zfs_probe(void) if (guid != 0) { zfs_currdev.pool_guid = guid; zfs_currdev.root_guid = 0; - zfs_currdev.d_dev = &zfs_dev; - zfs_currdev.d_type = zfs_currdev.d_dev->dv_type; + zfs_currdev.dd.d_dev = &zfs_dev; + zfs_currdev.dd.d_type = zfs_currdev.dd.d_dev->dv_type; } } #endif /* LOADER_ZFS_SUPPORT */ Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/uboot/common/main.c Mon Mar 12 21:39:49 2018 (r330809) @@ -318,7 +318,7 @@ print_disk_probe_info() strcpy(partition, ""); printf(" Checking unit=%d slice=%s partition=%s...", - currdev.d_unit, slice, partition); + currdev.dd.d_unit, slice, partition); } @@ -338,8 +338,8 @@ probe_disks(int devidx, int load_type, int load_unit, if (load_type == -1) { printf(" Probing all disk devices...\n"); /* Try each disk in succession until one works. */ - for (currdev.d_unit = 0; currdev.d_unit < UB_MAX_DEV; - currdev.d_unit++) { + for (currdev.dd.d_unit = 0; currdev.dd.d_unit < UB_MAX_DEV; + currdev.dd.d_unit++) { print_disk_probe_info(); open_result = devsw[devidx]->dv_open(&f, &currdev); if (open_result == 0) { @@ -355,8 +355,8 @@ probe_disks(int devidx, int load_type, int load_unit, printf(" Probing all %s devices...\n", device_typename(load_type)); /* Try each disk of given type in succession until one works. */ for (unit = 0; unit < UB_MAX_DEV; unit++) { - currdev.d_unit = uboot_diskgetunit(load_type, unit); - if (currdev.d_unit == -1) + currdev.dd.d_unit = uboot_diskgetunit(load_type, unit); + if (currdev.dd.d_unit == -1) break; print_disk_probe_info(); open_result = devsw[devidx]->dv_open(&f, &currdev); @@ -369,7 +369,7 @@ probe_disks(int devidx, int load_type, int load_unit, return (-1); } - if ((currdev.d_unit = uboot_diskgetunit(load_type, load_unit)) != -1) { + if ((currdev.dd.d_unit = uboot_diskgetunit(load_type, load_unit)) != -1) { print_disk_probe_info(); open_result = devsw[devidx]->dv_open(&f,&currdev); if (open_result == 0) { @@ -459,9 +459,9 @@ main(int argc, char **argv) printf("Found U-Boot device: %s\n", devsw[i]->dv_name); - currdev.d_dev = devsw[i]; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_unit = 0; + currdev.dd.d_dev = devsw[i]; + currdev.dd.d_type = currdev.dd.d_dev->dv_type; + currdev.dd.d_unit = 0; if ((load_type == -1 || (load_type & DEV_TYP_STOR)) && strcmp(devsw[i]->dv_name, "disk") == 0) { Modified: head/stand/uboot/lib/devicename.c ============================================================================== --- head/stand/uboot/lib/devicename.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/uboot/lib/devicename.c Mon Mar 12 21:39:49 2018 (r330809) @@ -136,7 +136,7 @@ uboot_parsedev(struct uboot_devdesc **dev, const char err = EINVAL; goto fail; } - idev->d_unit = unit; + idev->dd.d_unit = unit; if (path != NULL) *path = (*cp == 0) ? cp : cp + 1; @@ -146,8 +146,8 @@ uboot_parsedev(struct uboot_devdesc **dev, const char err = EINVAL; goto fail; } - idev->d_dev = dv; - idev->d_type = dv->dv_type; + idev->dd.d_dev = dv; + idev->dd.d_type = dv->dv_type; if (dev == NULL) { free(idev); } else { @@ -167,7 +167,7 @@ uboot_fmtdev(void *vdev) struct uboot_devdesc *dev = (struct uboot_devdesc *)vdev; static char buf[128]; - switch(dev->d_type) { + switch(dev->dd.d_type) { case DEVT_NONE: strcpy(buf, "(no device)"); break; @@ -178,7 +178,7 @@ uboot_fmtdev(void *vdev) #endif case DEVT_NET: - sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); + sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); break; } return(buf); Modified: head/stand/uboot/lib/disk.c ============================================================================== --- head/stand/uboot/lib/disk.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/uboot/lib/disk.c Mon Mar 12 21:39:49 2018 (r330809) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include "libuboot.h" #define stor_printf(fmt, args...) do { \ - printf("%s%d: ", dev->d_dev->dv_name, dev->d_unit); \ + printf("%s%d: ", dev->dd.d_dev->dv_name, dev->dd.d_unit); \ printf(fmt, ##args); \ } while (0) @@ -65,7 +65,7 @@ static struct { u_int bsize; /* block size */ } stor_info[UB_MAX_DEV]; -#define SI(dev) (stor_info[(dev)->d_unit]) +#define SI(dev) (stor_info[(dev)->dd.d_unit]) static int stor_info_no = 0; static int stor_opendev(struct disk_devdesc *); @@ -190,7 +190,7 @@ stor_opendev(struct disk_devdesc *dev) { int err; - if (dev->d_unit < 0 || dev->d_unit >= stor_info_no) + if (dev->dd.d_unit < 0 || dev->dd.d_unit >= stor_info_no) return (EIO); if (SI(dev).opened == 0) { @@ -252,8 +252,8 @@ stor_print(int verbose) return (ret); for (i = 0; i < stor_info_no; i++) { - dev.d_dev = &uboot_storage; - dev.d_unit = i; + dev.dd.d_dev = &uboot_storage; + dev.dd.d_unit = i; dev.d_slice = -1; dev.d_partition = -1; snprintf(line, sizeof(line), "\tdisk%d (%s)\n", i, Modified: head/stand/uboot/lib/libuboot.h ============================================================================== --- head/stand/uboot/lib/libuboot.h Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/uboot/lib/libuboot.h Mon Mar 12 21:39:49 2018 (r330809) @@ -29,10 +29,7 @@ /* Note: Must match the 'struct devdesc' in stand.h */ struct uboot_devdesc { - struct devsw *d_dev; - int d_type; - int d_unit; - void *d_opendata; + struct devdesc dd; union { struct { int slice; Modified: head/stand/userboot/userboot/devicename.c ============================================================================== --- head/stand/userboot/userboot/devicename.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/userboot/userboot/devicename.c Mon Mar 12 21:39:49 2018 (r330809) @@ -139,7 +139,7 @@ userboot_parsedev(struct disk_devdesc **dev, const cha goto fail; } - idev->d_unit = unit; + idev->dd.d_unit = unit; if (path != NULL) *path = (*cp == 0) ? cp : cp + 1; break; @@ -158,8 +158,8 @@ userboot_parsedev(struct disk_devdesc **dev, const cha err = EINVAL; goto fail; } - idev->d_dev = dv; - idev->d_type = dv->dv_type; + idev->dd.d_dev = dv; + idev->dd.d_type = dv->dv_type; if (dev == NULL) { free(idev); } else { @@ -179,27 +179,27 @@ userboot_fmtdev(void *vdev) struct disk_devdesc *dev = (struct disk_devdesc *)vdev; static char buf[128]; /* XXX device length constant? */ - switch(dev->d_type) { + switch(dev->dd.d_type) { case DEVT_NONE: strcpy(buf, "(no device)"); break; case DEVT_CD: - sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); + sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); break; case DEVT_DISK: return (disk_fmtdev(vdev)); case DEVT_NET: - sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); + sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); break; case DEVT_ZFS: #if defined(USERBOOT_ZFS_SUPPORT) return (zfs_fmtdev(vdev)); #else - sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); + sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); #endif break; } Modified: head/stand/userboot/userboot/main.c ============================================================================== --- head/stand/userboot/userboot/main.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/userboot/userboot/main.c Mon Mar 12 21:39:49 2018 (r330809) @@ -159,13 +159,14 @@ extract_currdev(void) //bzero(&dev, sizeof(dev)); #if defined(USERBOOT_ZFS_SUPPORT) + CT_ASSERT(sizeof(struct disk_devdesc) >= sizeof(struct zfs_devdesc)); if (userboot_zfs_found) { struct zfs_devdesc zdev; /* Leave the pool/root guid's unassigned */ bzero(&zdev, sizeof(zdev)); - zdev.d_dev = &zfs_dev; - zdev.d_type = zdev.d_dev->dv_type; + zdev.dd.d_dev = &zfs_dev; + zdev.dd.d_type = zdev.dd.d_dev->dv_type; dev = *(struct disk_devdesc *)&zdev; init_zfs_bootenv(zfs_fmtdev(&dev)); @@ -173,23 +174,23 @@ extract_currdev(void) #endif if (userboot_disk_maxunit > 0) { - dev.d_dev = &userboot_disk; - dev.d_type = dev.d_dev->dv_type; - dev.d_unit = 0; + dev.dd.d_dev = &userboot_disk; + dev.dd.d_type = dev.dd.d_dev->dv_type; + dev.dd.d_unit = 0; dev.d_slice = 0; dev.d_partition = 0; /* * If we cannot auto-detect the partition type then * access the disk as a raw device. */ - if (dev.d_dev->dv_open(NULL, &dev)) { + if (dev.dd.d_dev->dv_open(NULL, &dev)) { dev.d_slice = -1; dev.d_partition = -1; } } else { - dev.d_dev = &host_dev; - dev.d_type = dev.d_dev->dv_type; - dev.d_unit = 0; + dev.dd.d_dev = &host_dev; + dev.dd.d_type = dev.dd.d_dev->dv_type; + dev.dd.d_unit = 0; } env_setenv("currdev", EV_VOLATILE, userboot_fmtdev(&dev), Modified: head/stand/userboot/userboot/userboot_disk.c ============================================================================== --- head/stand/userboot/userboot/userboot_disk.c Mon Mar 12 21:39:42 2018 (r330808) +++ head/stand/userboot/userboot/userboot_disk.c Mon Mar 12 21:39:49 2018 (r330809) @@ -135,8 +135,8 @@ userdisk_print(int verbose) ret = pager_output(line); if (ret != 0) break; - dev.d_dev = &userboot_disk; - dev.d_unit = i; + dev.dd.d_dev = &userboot_disk; + dev.dd.d_unit = i; dev.d_slice = -1; dev.d_partition = -1; if (disk_open(&dev, ud_info[i].mediasize, @@ -164,13 +164,13 @@ userdisk_open(struct open_file *f, ...) dev = va_arg(ap, struct disk_devdesc *); va_end(ap); - if (dev->d_unit < 0 || dev->d_unit >= userdisk_maxunit) + if (dev->dd.d_unit < 0 || dev->dd.d_unit >= userdisk_maxunit) return (EIO); - ud_info[dev->d_unit].ud_open++; - if (ud_info[dev->d_unit].ud_bcache == NULL) - ud_info[dev->d_unit].ud_bcache = bcache_allocate(); - return (disk_open(dev, ud_info[dev->d_unit].mediasize, - ud_info[dev->d_unit].sectorsize)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Mar 12 21:40:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2EA7F4D29F; Mon, 12 Mar 2018 21:40:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A107F75064; Mon, 12 Mar 2018 21:40:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBC2311250; Mon, 12 Mar 2018 21:40:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CLe0X1038432; Mon, 12 Mar 2018 21:40:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CLdxKX038384; Mon, 12 Mar 2018 21:39:59 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803122139.w2CLdxKX038384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Mar 2018 21:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330810 - in head/stand: efi/libefi efi/loader i386/libi386 i386/loader libsa mips/beri/loader ofw/libofw sparc64/loader uboot/common uboot/lib userboot/userboot zfs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: efi/libefi efi/loader i386/libi386 i386/loader libsa mips/beri/loader ofw/libofw sparc64/loader uboot/common uboot/lib userboot/userboot zfs X-SVN-Commit-Revision: 330810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 21:40:04 -0000 Author: imp Date: Mon Mar 12 21:39:59 2018 New Revision: 330810 URL: https://svnweb.freebsd.org/changeset/base/330810 Log: Remove d_type from devdesc. It's not needed as we can fetch it from d_dev->dv_type when we need it. Modified: head/stand/efi/libefi/devicename.c head/stand/efi/loader/main.c head/stand/i386/libi386/biosdisk.c head/stand/i386/libi386/bootinfo32.c head/stand/i386/libi386/devicename.c head/stand/i386/loader/main.c head/stand/libsa/stand.h head/stand/mips/beri/loader/devicename.c head/stand/ofw/libofw/devicename.c head/stand/sparc64/loader/main.c head/stand/uboot/common/main.c head/stand/uboot/lib/devicename.c head/stand/userboot/userboot/devicename.c head/stand/userboot/userboot/main.c head/stand/zfs/zfs.c Modified: head/stand/efi/libefi/devicename.c ============================================================================== --- head/stand/efi/libefi/devicename.c Mon Mar 12 21:39:49 2018 (r330809) +++ head/stand/efi/libefi/devicename.c Mon Mar 12 21:39:59 2018 (r330810) @@ -161,7 +161,6 @@ efi_parsedev(struct devdesc **dev, const char *devspec } idev->d_dev = dv; - idev->d_type = dv->dv_type; if (dev != NULL) *dev = idev; @@ -180,7 +179,7 @@ efi_fmtdev(void *vdev) struct devdesc *dev = (struct devdesc *)vdev; static char buf[SPECNAMELEN + 1]; - switch(dev->d_type) { + switch(dev->d_dev->dv_type) { case DEVT_NONE: strcpy(buf, "(no device)"); break; Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Mon Mar 12 21:39:49 2018 (r330809) +++ head/stand/efi/loader/main.c Mon Mar 12 21:39:59 2018 (r330810) @@ -175,7 +175,6 @@ set_devdesc_currdev(struct devsw *dev, int unit) char *devname; currdev.d_dev = dev; - currdev.d_type = currdev.d_dev->dv_type; currdev.d_unit = unit; devname = efi_fmtdev(&currdev); @@ -203,7 +202,6 @@ find_currdev(EFI_LOADED_IMAGE *img) currdev.dd.d_dev = &zfs_dev; currdev.dd.d_unit = 0; - currdev.dd.d_type = currdev.dd.d_dev->dv_type; currdev.pool_guid = pool_guid; currdev.root_guid = 0; devname = efi_fmtdev(&currdev); @@ -223,7 +221,6 @@ find_currdev(EFI_LOADED_IMAGE *img) struct disk_devdesc currdev; currdev.dd.d_dev = &efipart_hddev; - currdev.dd.d_type = currdev.dd.d_dev->dv_type; currdev.dd.d_unit = dp->pd_unit; currdev.d_slice = -1; currdev.d_partition = -1; @@ -845,7 +842,7 @@ command_chain(int argc, char *argv[]) struct disk_devdesc *d_dev; pdinfo_t *hd, *pd; - switch (dev->d_type) { + switch (dev->d_dev->dv_type) { #ifdef EFI_ZFS_BOOT case DEVT_ZFS: z_dev = (struct zfs_devdesc *)dev; Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Mon Mar 12 21:39:49 2018 (r330809) +++ head/stand/i386/libi386/biosdisk.c Mon Mar 12 21:39:59 2018 (r330810) @@ -403,7 +403,6 @@ bd_open(struct open_file *f, ...) * would overflow so it should be safe to perform here. */ disk.dd.d_dev = dev->dd.d_dev; - disk.dd.d_type = dev->dd.d_type; disk.dd.d_unit = dev->dd.d_unit; disk.dd.d_opendata = NULL; disk.d_slice = -1; @@ -441,7 +440,7 @@ bd_open(struct open_file *f, ...) int geli_part = 0; dskp.drive = bd_unit2bios(dev->dd.d_unit); - dskp.type = dev->dd.d_type; + dskp.type = dev->dd.d_dev->dv_type; dskp.unit = dev->dd.d_unit; dskp.slice = dev->d_slice; dskp.part = dev->d_partition; @@ -872,7 +871,7 @@ bd_read(struct disk_devdesc *dev, daddr_t dblk, int bl return (err); dskp.drive = bd_unit2bios(dev->dd.d_unit); - dskp.type = dev->dd.d_type; + dskp.type = dev->dd.d_dev->dv_type; dskp.unit = dev->dd.d_unit; dskp.slice = dev->d_slice; dskp.part = dev->d_partition; @@ -997,7 +996,6 @@ bios_read(void *vdev __unused, void *xpriv, off_t off, struct dsk *priv = xpriv; dev.dd.d_dev = &biosdisk; - dev.dd.d_type = priv->type; dev.dd.d_unit = priv->unit; dev.d_slice = priv->slice; dev.d_partition = priv->part; Modified: head/stand/i386/libi386/bootinfo32.c ============================================================================== --- head/stand/i386/libi386/bootinfo32.c Mon Mar 12 21:39:49 2018 (r330809) +++ head/stand/i386/libi386/bootinfo32.c Mon Mar 12 21:39:59 2018 (r330810) @@ -181,7 +181,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_o /* XXX - use a default bootdev of 0. Is this ok??? */ bootdevnr = 0; - switch(rootdev->dd.d_type) { + switch(rootdev->dd.d_dev->dv_type) { case DEVT_CD: /* Pass in BIOS device number. */ bi.bi_bios_dev = bc_unit2bios(rootdev->dd.d_unit); @@ -199,7 +199,8 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_o break; default: - printf("WARNING - don't know how to boot from device type %d\n", rootdev->dd.d_type); + printf("WARNING - don't know how to boot from device type %d\n", + rootdev->dd.d_dev->dv_type); } if (bootdevnr == -1) { printf("root device %s invalid\n", i386_fmtdev(rootdev)); Modified: head/stand/i386/libi386/devicename.c ============================================================================== --- head/stand/i386/libi386/devicename.c Mon Mar 12 21:39:49 2018 (r330809) +++ head/stand/i386/libi386/devicename.c Mon Mar 12 21:39:59 2018 (r330810) @@ -149,7 +149,6 @@ i386_parsedev(struct i386_devdesc **dev, const char *d goto fail; } idev->dd.d_dev = dv; - idev->dd.d_type = dv->dv_type; if (dev == NULL) { free(idev); } else { @@ -169,7 +168,7 @@ i386_fmtdev(void *vdev) struct i386_devdesc *dev = (struct i386_devdesc *)vdev; static char buf[128]; /* XXX device length constant? */ - switch(dev->dd.d_type) { + switch(dev->dd.d_dev->dv_type) { case DEVT_NONE: strcpy(buf, "(no device)"); break; Modified: head/stand/i386/loader/main.c ============================================================================== --- head/stand/i386/loader/main.c Mon Mar 12 21:39:49 2018 (r330809) +++ head/stand/i386/loader/main.c Mon Mar 12 21:39:59 2018 (r330810) @@ -316,13 +316,12 @@ extract_currdev(void) if ((biosdev == 0) && (B_TYPE(initial_bootdev) != 2)) /* biosdev doesn't match major */ biosdev = 0x80 + B_UNIT(initial_bootdev); /* assume harddisk */ } - new_currdev.dd.d_type = new_currdev.dd.d_dev->dv_type; /* * If we are booting off of a BIOS disk and we didn't succeed in determining * which one we booted off of, just use disk0: as a reasonable default. */ - if ((new_currdev.dd.d_type == biosdisk.dv_type) && + if ((new_currdev.dd.d_dev->dv_type == biosdisk.dv_type) && ((new_currdev.dd.d_unit = bd_bios2unit(biosdev)) == -1)) { printf("Can't work out which disk we are booting from.\n" "Guessed BIOS device 0x%x not found by probes, defaulting to disk0:\n", biosdev); @@ -330,7 +329,7 @@ extract_currdev(void) } #ifdef LOADER_ZFS_SUPPORT - if (new_currdev.dd.d_type == DEVT_ZFS) + if (new_currdev.dd.d_dev->dv_type == DEVT_ZFS) init_zfs_bootenv(zfs_fmtdev(&new_currdev)); #endif Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Mon Mar 12 21:39:49 2018 (r330809) +++ head/stand/libsa/stand.h Mon Mar 12 21:39:59 2018 (r330810) @@ -168,7 +168,6 @@ extern int errno; */ struct devdesc { struct devsw *d_dev; - int d_type; int d_unit; void *d_opendata; }; Modified: head/stand/mips/beri/loader/devicename.c ============================================================================== --- head/stand/mips/beri/loader/devicename.c Mon Mar 12 21:39:49 2018 (r330809) +++ head/stand/mips/beri/loader/devicename.c Mon Mar 12 21:39:59 2018 (r330810) @@ -149,7 +149,6 @@ beri_arch_parsedev(struct disk_devdesc **dev, const ch goto fail; } idev->dd.d_dev = dv; - idev->dd.d_type = dv->dv_type; if (dev == NULL) { free(idev); } else { @@ -169,7 +168,7 @@ beri_arch_fmtdev(void *vdev) struct disk_devdesc *dev = (struct disk_devdesc *)vdev; static char buf[128]; /* XXX device length constant? */ - switch(dev->d_type) { + switch(dev->dd.d_dev->dv_type) { case DEVT_NONE: strcpy(buf, "(no device)"); break; Modified: head/stand/ofw/libofw/devicename.c ============================================================================== --- head/stand/ofw/libofw/devicename.c Mon Mar 12 21:39:49 2018 (r330809) +++ head/stand/ofw/libofw/devicename.c Mon Mar 12 21:39:59 2018 (r330810) @@ -114,8 +114,7 @@ found: } strcpy(idev->d_path, name); idev->dd.d_dev = dv; - idev->dd.d_type = dv->dv_type; - if (idev->dd.d_type == DEVT_ZFS) { + if (dv->dv_type == DEVT_ZFS) { p = devspec + strlen(dv->dv_name); err = zfs_parsedev((struct zfs_devdesc *)idev, p, path); if (err != 0) { Modified: head/stand/sparc64/loader/main.c ============================================================================== --- head/stand/sparc64/loader/main.c Mon Mar 12 21:39:49 2018 (r330809) +++ head/stand/sparc64/loader/main.c Mon Mar 12 21:39:59 2018 (r330810) @@ -807,7 +807,6 @@ sparc64_zfs_probe(void) zfs_currdev.pool_guid = guid; zfs_currdev.root_guid = 0; zfs_currdev.dd.d_dev = &zfs_dev; - zfs_currdev.dd.d_type = zfs_currdev.dd.d_dev->dv_type; } } #endif /* LOADER_ZFS_SUPPORT */ Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Mon Mar 12 21:39:49 2018 (r330809) +++ head/stand/uboot/common/main.c Mon Mar 12 21:39:59 2018 (r330810) @@ -460,7 +460,6 @@ main(int argc, char **argv) printf("Found U-Boot device: %s\n", devsw[i]->dv_name); currdev.dd.d_dev = devsw[i]; - currdev.dd.d_type = currdev.dd.d_dev->dv_type; currdev.dd.d_unit = 0; if ((load_type == -1 || (load_type & DEV_TYP_STOR)) && Modified: head/stand/uboot/lib/devicename.c ============================================================================== --- head/stand/uboot/lib/devicename.c Mon Mar 12 21:39:49 2018 (r330809) +++ head/stand/uboot/lib/devicename.c Mon Mar 12 21:39:59 2018 (r330810) @@ -147,7 +147,6 @@ uboot_parsedev(struct uboot_devdesc **dev, const char goto fail; } idev->dd.d_dev = dv; - idev->dd.d_type = dv->dv_type; if (dev == NULL) { free(idev); } else { @@ -167,7 +166,7 @@ uboot_fmtdev(void *vdev) struct uboot_devdesc *dev = (struct uboot_devdesc *)vdev; static char buf[128]; - switch(dev->dd.d_type) { + switch(dev->dd.d_dev->dv_type) { case DEVT_NONE: strcpy(buf, "(no device)"); break; Modified: head/stand/userboot/userboot/devicename.c ============================================================================== --- head/stand/userboot/userboot/devicename.c Mon Mar 12 21:39:49 2018 (r330809) +++ head/stand/userboot/userboot/devicename.c Mon Mar 12 21:39:59 2018 (r330810) @@ -159,7 +159,6 @@ userboot_parsedev(struct disk_devdesc **dev, const cha goto fail; } idev->dd.d_dev = dv; - idev->dd.d_type = dv->dv_type; if (dev == NULL) { free(idev); } else { @@ -179,7 +178,7 @@ userboot_fmtdev(void *vdev) struct disk_devdesc *dev = (struct disk_devdesc *)vdev; static char buf[128]; /* XXX device length constant? */ - switch(dev->dd.d_type) { + switch(dev->dd.d_dev->dv_type) { case DEVT_NONE: strcpy(buf, "(no device)"); break; Modified: head/stand/userboot/userboot/main.c ============================================================================== --- head/stand/userboot/userboot/main.c Mon Mar 12 21:39:49 2018 (r330809) +++ head/stand/userboot/userboot/main.c Mon Mar 12 21:39:59 2018 (r330810) @@ -166,7 +166,6 @@ extract_currdev(void) /* Leave the pool/root guid's unassigned */ bzero(&zdev, sizeof(zdev)); zdev.dd.d_dev = &zfs_dev; - zdev.dd.d_type = zdev.dd.d_dev->dv_type; dev = *(struct disk_devdesc *)&zdev; init_zfs_bootenv(zfs_fmtdev(&dev)); @@ -175,7 +174,6 @@ extract_currdev(void) if (userboot_disk_maxunit > 0) { dev.dd.d_dev = &userboot_disk; - dev.dd.d_type = dev.dd.d_dev->dv_type; dev.dd.d_unit = 0; dev.d_slice = 0; dev.d_partition = 0; @@ -189,7 +187,6 @@ extract_currdev(void) } } else { dev.dd.d_dev = &host_dev; - dev.dd.d_type = dev.dd.d_dev->dv_type; dev.dd.d_unit = 0; } Modified: head/stand/zfs/zfs.c ============================================================================== --- head/stand/zfs/zfs.c Mon Mar 12 21:39:49 2018 (r330809) +++ head/stand/zfs/zfs.c Mon Mar 12 21:39:59 2018 (r330810) @@ -688,7 +688,6 @@ zfs_parsedev(struct zfs_devdesc *dev, const char *devs if (path != NULL) *path = (*end == '\0') ? end : end + 1; dev->dd.d_dev = &zfs_dev; - dev->dd.d_type = zfs_dev.dv_type; return (0); } @@ -701,7 +700,7 @@ zfs_fmtdev(void *vdev) spa_t *spa; buf[0] = '\0'; - if (dev->dd.d_type != DEVT_ZFS) + if (dev->dd.d_dev->dv_type != DEVT_ZFS) return (buf); if (dev->pool_guid == 0) { From owner-svn-src-head@freebsd.org Mon Mar 12 21:40:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAD92F4D2BD; Mon, 12 Mar 2018 21:40:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8EB775086; Mon, 12 Mar 2018 21:40:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3E0111251; Mon, 12 Mar 2018 21:40:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CLe5kp038485; Mon, 12 Mar 2018 21:40:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CLe5pS038484; Mon, 12 Mar 2018 21:40:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803122140.w2CLe5pS038484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Mar 2018 21:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330811 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 330811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 21:40:08 -0000 Author: imp Date: Mon Mar 12 21:40:05 2018 New Revision: 330811 URL: https://svnweb.freebsd.org/changeset/base/330811 Log: GC unused routines. Sponsored by: Netflix Modified: head/stand/efi/libefi/env.c Modified: head/stand/efi/libefi/env.c ============================================================================== --- head/stand/efi/libefi/env.c Mon Mar 12 21:39:59 2018 (r330810) +++ head/stand/efi/libefi/env.c Mon Mar 12 21:40:05 2018 (r330811) @@ -35,35 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" -/* - * Simple wrappers to the underlying UEFI functions. - * See http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES - * for details. - */ -EFI_STATUS -efi_get_next_variable_name(UINTN *variable_name_size, CHAR16 *variable_name, - EFI_GUID *vendor_guid) -{ - return (RS->GetNextVariableName(variable_name_size, variable_name, - vendor_guid)); -} - -EFI_STATUS -efi_get_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, - UINT32 *attributes, UINTN *data_size, void *data) -{ - return (RS->GetVariable(variable_name, vendor_guid, attributes, - data_size, data)); -} - -EFI_STATUS -efi_set_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, - UINT32 attributes, UINTN data_size, void *data) -{ - return (RS->SetVariable(variable_name, vendor_guid, attributes, - data_size, data)); -} - void efi_init_environment(void) { From owner-svn-src-head@freebsd.org Mon Mar 12 21:40:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AB55F4D31A; Mon, 12 Mar 2018 21:40:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 889357517D; Mon, 12 Mar 2018 21:40:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2616811252; Mon, 12 Mar 2018 21:40:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CLe9FE038540; Mon, 12 Mar 2018 21:40:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CLe9kP038539; Mon, 12 Mar 2018 21:40:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803122140.w2CLe9kP038539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Mar 2018 21:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330812 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 330812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 21:40:15 -0000 Author: imp Date: Mon Mar 12 21:40:09 2018 New Revision: 330812 URL: https://svnweb.freebsd.org/changeset/base/330812 Log: Use the one-line-per-file pattern here, and sort the file names. Sponsored by: Netflix Modified: head/stand/efi/libefi/Makefile Modified: head/stand/efi/libefi/Makefile ============================================================================== --- head/stand/efi/libefi/Makefile Mon Mar 12 21:40:05 2018 (r330811) +++ head/stand/efi/libefi/Makefile Mon Mar 12 21:40:09 2018 (r330812) @@ -5,8 +5,20 @@ LIB= efi WARNS?= 2 -SRCS= delay.c devpath.c efi_console.c efichar.c efinet.c efipart.c env.c errno.c \ - handles.c wchar.c libefi.c efi_driver_utils.c efizfs.c devicename.c +SRCS= delay.c \ + devicename.c \ + devpath.c \ + efi_console.c \ + efi_driver_utils.c \ + efichar.c \ + efinet.c \ + efipart.c \ + efizfs.c \ + env.c \ + errno.c \ + handles.c \ + libefi.c \ + wchar.c .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" SRCS+= time.c From owner-svn-src-head@freebsd.org Mon Mar 12 21:40:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 829ECF4D329; Mon, 12 Mar 2018 21:40:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BFE1751AC; Mon, 12 Mar 2018 21:40:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w2CLdxR6011647 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 12 Mar 2018 23:40:02 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w2CLdxR6011647 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w2CLdxFW011646; Mon, 12 Mar 2018 23:39:59 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 12 Mar 2018 23:39:59 +0200 From: Konstantin Belousov To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330780 - in head/sys: amd64/include isa x86/isa Message-ID: <20180312213959.GJ76926@kib.kiev.ua> References: <201803111922.w2BJMwr8043084@repo.freebsd.org> <20180311195800.GC76926@kib.kiev.ua> <1520799639.84937.154.camel@freebsd.org> <20180311212539.GD76926@kib.kiev.ua> <1520868891.84937.177.camel@freebsd.org> <20180312155617.GF76926@kib.kiev.ua> <1520881408.84937.232.camel@freebsd.org> <1520889433.84937.255.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1520889433.84937.255.camel@freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 21:40:15 -0000 On Mon, Mar 12, 2018 at 03:17:13PM -0600, Ian Lepore wrote: > So, the eventtimer code in the atrtc driver doesn't even work, and has > been broken (and unreported) since at least Nov 2015. šThat sounds to > me like even more evidence that we should just remove eventtimer stuff > from the atrtc driver. Ok. From owner-svn-src-head@freebsd.org Mon Mar 12 21:40:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48CDAF4D37F; Mon, 12 Mar 2018 21:40:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BA7D7525F; Mon, 12 Mar 2018 21:40:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20CEB11253; Mon, 12 Mar 2018 21:40:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CLeEra038596; Mon, 12 Mar 2018 21:40:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CLeEOw038592; Mon, 12 Mar 2018 21:40:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803122140.w2CLeEOw038592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Mar 2018 21:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330813 - in head/stand/efi: boot1 include libefi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand/efi: boot1 include libefi X-SVN-Commit-Revision: 330813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 21:40:21 -0000 Author: imp Date: Mon Mar 12 21:40:14 2018 New Revision: 330813 URL: https://svnweb.freebsd.org/changeset/base/330813 Log: Move the env convenience routines out of boot1.c. These routines are more generally useful. Even though boot1 is on its way out, it's better to make these common during the transition than copy them. Added: head/stand/efi/libefi/efienv.c (contents, props changed) Modified: head/stand/efi/boot1/boot1.c head/stand/efi/include/efilib.h head/stand/efi/libefi/Makefile Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Mon Mar 12 21:40:09 2018 (r330812) +++ head/stand/efi/boot1/boot1.c Mon Mar 12 21:40:14 2018 (r330813) @@ -54,8 +54,6 @@ static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCO static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; -static EFI_GUID FreeBSDBootVarGUID = FREEBSD_BOOT_VAR_GUID; -static EFI_GUID GlobalBootVarGUID = UEFI_BOOT_VAR_GUID; /* * Provide Malloc / Free backed by EFIs AllocatePool / FreePool which ensures @@ -80,42 +78,6 @@ Free(void *buf, const char *file __unused, int line __ (void)BS->FreePool(buf); } -static EFI_STATUS -efi_getenv(EFI_GUID *g, const char *v, void *data, size_t *len) -{ - size_t ul; - CHAR16 *uv; - UINT32 attr; - UINTN dl; - EFI_STATUS rv; - - uv = NULL; - if (utf8_to_ucs2(v, &uv, &ul) != 0) - return (EFI_OUT_OF_RESOURCES); - dl = *len; - rv = RS->GetVariable(uv, g, &attr, &dl, data); - if (rv == EFI_SUCCESS) - *len = dl; - free(uv); - return (rv); -} - -static EFI_STATUS -efi_setenv_freebsd_wcs(const char *varname, CHAR16 *valstr) -{ - CHAR16 *var = NULL; - size_t len; - EFI_STATUS rv; - - if (utf8_to_ucs2(varname, &var, &len) != 0) - return (EFI_OUT_OF_RESOURCES); - rv = RS->SetVariable(var, &FreeBSDBootVarGUID, - EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, - (ucs2len(valstr) + 1) * sizeof(efi_char), valstr); - free(var); - return (rv); -} - /* * nodes_match returns TRUE if the imgpath isn't NULL and the nodes match, * FALSE otherwise. @@ -505,11 +467,11 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) boot_current = 0; sz = sizeof(boot_current); - efi_getenv(&GlobalBootVarGUID, "BootCurrent", &boot_current, &sz); + efi_global_getenv("BootCurrent", &boot_current, &sz); printf(" BootCurrent: %04x\n", boot_current); sz = sizeof(boot_order); - efi_getenv(&GlobalBootVarGUID, "BootOrder", &boot_order, &sz); + efi_global_getenv("BootOrder", &boot_order, &sz); printf(" BootOrder:"); for (i = 0; i < sz / sizeof(boot_order[0]); i++) printf(" %04x", boot_order[i]); Modified: head/stand/efi/include/efilib.h ============================================================================== --- head/stand/efi/include/efilib.h Mon Mar 12 21:40:09 2018 (r330812) +++ head/stand/efi/include/efilib.h Mon Mar 12 21:40:14 2018 (r330813) @@ -106,6 +106,17 @@ int wcscmp(CHAR16 *, CHAR16 *); void cpy8to16(const char *, CHAR16 *, size_t); void cpy16to8(const CHAR16 *, char *, size_t); +/* + * Routines for interacting with EFI's env vars in a more unix-like + * way than the standard APIs. In addition, convenience routines for + * the loader setting / getting FreeBSD specific variables. + */ + +EFI_STATUS efi_freebsd_getenv(const char *v, void *data, __size_t *len); +EFI_STATUS efi_getenv(EFI_GUID *g, const char *v, void *data, __size_t *len); +EFI_STATUS efi_global_getenv(const char *v, void *data, __size_t *len); +EFI_STATUS efi_setenv_freebsd_wcs(const char *varname, CHAR16 *valstr); + /* efipart.c */ int efipart_inithandles(void); Modified: head/stand/efi/libefi/Makefile ============================================================================== --- head/stand/efi/libefi/Makefile Mon Mar 12 21:40:09 2018 (r330812) +++ head/stand/efi/libefi/Makefile Mon Mar 12 21:40:14 2018 (r330813) @@ -11,6 +11,7 @@ SRCS= delay.c \ efi_console.c \ efi_driver_utils.c \ efichar.c \ + efienv.c \ efinet.c \ efipart.c \ efizfs.c \ Added: head/stand/efi/libefi/efienv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/libefi/efienv.c Mon Mar 12 21:40:14 2018 (r330813) @@ -0,0 +1,87 @@ +/*- + * Copyright (c) 2018 Netflix, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +static EFI_GUID FreeBSDBootVarGUID = FREEBSD_BOOT_VAR_GUID; +static EFI_GUID GlobalBootVarGUID = UEFI_BOOT_VAR_GUID; + +EFI_STATUS +efi_getenv(EFI_GUID *g, const char *v, void *data, size_t *len) +{ + size_t ul; + CHAR16 *uv; + UINT32 attr; + UINTN dl; + EFI_STATUS rv; + + uv = NULL; + if (utf8_to_ucs2(v, &uv, &ul) != 0) + return (EFI_OUT_OF_RESOURCES); + dl = *len; + rv = RS->GetVariable(uv, g, &attr, &dl, data); + if (rv == EFI_SUCCESS) + *len = dl; + free(uv); + return (rv); +} + +EFI_STATUS +efi_global_getenv(const char *v, void *data, size_t *len) +{ + + return (efi_getenv(&GlobalBootVarGUID, v, data, len)); +} + +EFI_STATUS +efi_freebsd_getenv(const char *v, void *data, size_t *len) +{ + + return (efi_getenv(&FreeBSDBootVarGUID, v, data, len)); +} + +EFI_STATUS +efi_setenv_freebsd_wcs(const char *varname, CHAR16 *valstr) +{ + CHAR16 *var = NULL; + size_t len; + EFI_STATUS rv; + + if (utf8_to_ucs2(varname, &var, &len) != 0) + return (EFI_OUT_OF_RESOURCES); + rv = RS->SetVariable(var, &FreeBSDBootVarGUID, + EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, + (ucs2len(valstr) + 1) * sizeof(efi_char), valstr); + free(var); + return (rv); +} + From owner-svn-src-head@freebsd.org Mon Mar 12 21:40:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0197CF4D38D; Mon, 12 Mar 2018 21:40:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5DC275276; Mon, 12 Mar 2018 21:40:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0C8611254; Mon, 12 Mar 2018 21:40:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CLeJpV038650; Mon, 12 Mar 2018 21:40:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CLeJev038649; Mon, 12 Mar 2018 21:40:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803122140.w2CLeJev038649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Mar 2018 21:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330814 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 330814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 21:40:22 -0000 Author: imp Date: Mon Mar 12 21:40:19 2018 New Revision: 330814 URL: https://svnweb.freebsd.org/changeset/base/330814 Log: Star BootCurrent entry when booting. Sponsored by: Netflix Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Mon Mar 12 21:40:14 2018 (r330813) +++ head/stand/efi/boot1/boot1.c Mon Mar 12 21:40:19 2018 (r330814) @@ -474,7 +474,8 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) efi_global_getenv("BootOrder", &boot_order, &sz); printf(" BootOrder:"); for (i = 0; i < sz / sizeof(boot_order[0]); i++) - printf(" %04x", boot_order[i]); + printf(" %04x%s", boot_order[i], + boot_order[i] == boot_current ? "[*]" : ""); printf("\n"); #ifdef TEST_FAILURE From owner-svn-src-head@freebsd.org Mon Mar 12 21:40:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BD99F4D3E0; Mon, 12 Mar 2018 21:40:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A876A7537A; Mon, 12 Mar 2018 21:40:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BC4E11255; Mon, 12 Mar 2018 21:40:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CLeO1e038702; Mon, 12 Mar 2018 21:40:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CLeOee038701; Mon, 12 Mar 2018 21:40:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803122140.w2CLeOee038701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Mar 2018 21:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330815 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 330815 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 21:40:28 -0000 Author: imp Date: Mon Mar 12 21:40:24 2018 New Revision: 330815 URL: https://svnweb.freebsd.org/changeset/base/330815 Log: Print the load and device path as well as BootCurrent and BootOrder Sponsored by: Netflix Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Mon Mar 12 21:40:19 2018 (r330814) +++ head/stand/efi/loader/main.c Mon Mar 12 21:40:24 2018 (r330815) @@ -312,6 +312,12 @@ main(int argc, CHAR16 *argv[]) int i, j, vargood, howto; UINTN k; int has_kbd; + CHAR16 *text; + UINT16 boot_current; + size_t sz; + UINT16 boot_order[100]; + EFI_DEVICE_PATH *imgpath; + EFI_STATUS status; #if !defined(__arm__) char buf[40]; #endif @@ -472,6 +478,36 @@ main(int argc, CHAR16 *argv[]) ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff); printf("\n%s", bootprog_info); + + text = efi_devpath_name(img->FilePath); + if (text != NULL) { + printf(" Load Path: %S\n", text); + efi_setenv_freebsd_wcs("LoaderPath", text); + efi_free_devpath_name(text); + } + + status = BS->HandleProtocol(img->DeviceHandle, &devid, (void **)&imgpath); + if (status == EFI_SUCCESS) { + text = efi_devpath_name(imgpath); + if (text != NULL) { + printf(" Load Device: %S\n", text); + efi_setenv_freebsd_wcs("LoaderDev", text); + efi_free_devpath_name(text); + } + } + + boot_current = 0; + sz = sizeof(boot_current); + efi_global_getenv("BootCurrent", &boot_current, &sz); + printf(" BootCurrent: %04x\n", boot_current); + + sz = sizeof(boot_order); + efi_global_getenv("BootOrder", &boot_order, &sz); + printf(" BootOrder:"); + for (i = 0; i < sz / sizeof(boot_order[0]); i++) + printf(" %04x%s", boot_order[i], + boot_order[i] == boot_current ? "[*]" : ""); + printf("\n"); /* * Disable the watchdog timer. By default the boot manager sets From owner-svn-src-head@freebsd.org Mon Mar 12 22:10:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B39A1F4F5D5; Mon, 12 Mar 2018 22:10:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6964376C49; Mon, 12 Mar 2018 22:10:07 +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 5F54B116FD; Mon, 12 Mar 2018 22:10:07 +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 w2CMA7jS053709; Mon, 12 Mar 2018 22:10:07 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CMA7lf053706; Mon, 12 Mar 2018 22:10:07 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803122210.w2CMA7lf053706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 12 Mar 2018 22:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330817 - in head/sys: kern mips/include mips/mips X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: kern mips/include mips/mips X-SVN-Commit-Revision: 330817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 22:10:07 -0000 Author: brooks Date: Mon Mar 12 22:10:06 2018 New Revision: 330817 URL: https://svnweb.freebsd.org/changeset/base/330817 Log: MIPS: Implement fue*word* and casueword* in assembly. Remove NO_FUEWORD so the 'e' variants are wrapped by the non-'e' variants. This is more correct and leaves sparc64 as the outlier. Reviewed by: jmallett, kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14603 Modified: head/sys/kern/subr_uio.c head/sys/mips/include/param.h head/sys/mips/mips/support.S Modified: head/sys/kern/subr_uio.c ============================================================================== --- head/sys/kern/subr_uio.c Mon Mar 12 21:49:59 2018 (r330816) +++ head/sys/kern/subr_uio.c Mon Mar 12 22:10:06 2018 (r330817) @@ -505,8 +505,8 @@ copyout_unmap(struct thread *td, vm_offset_t addr, siz /* * XXXKIB The temporal implementation of fue*() functions which do not * handle usermode -1 properly, mixing it with the fault code. Keep - * this until MD code is written. Currently sparc64 and mips do not - * have proper implementation. + * this until MD code is written. Currently sparc64 does not have a + * proper implementation. */ int Modified: head/sys/mips/include/param.h ============================================================================== --- head/sys/mips/include/param.h Mon Mar 12 21:49:59 2018 (r330816) +++ head/sys/mips/include/param.h Mon Mar 12 22:10:06 2018 (r330817) @@ -185,8 +185,4 @@ #define pgtok(x) ((x) * (PAGE_SIZE / 1024)) -#ifdef _KERNEL -#define NO_FUEWORD 1 -#endif - #endif /* !_MIPS_INCLUDE_PARAM_H_ */ Modified: head/sys/mips/mips/support.S ============================================================================== --- head/sys/mips/mips/support.S Mon Mar 12 21:49:59 2018 (r330816) +++ head/sys/mips/mips/support.S Mon Mar 12 22:10:06 2018 (r330817) @@ -285,8 +285,8 @@ END(copyerr) * user-space. */ #ifdef __mips_n64 -LEAF(fuword64) -XLEAF(fuword) +LEAF(fueword64) +XLEAF(fueword) PTR_LA v0, fswberr blt a0, zero, fswberr # make sure address is in user space nop @@ -294,14 +294,16 @@ XLEAF(fuword) PTR_L v1, PC_CURPCB(v1) PTR_S v0, U_PCB_ONFAULT(v1) ld v0, 0(a0) # fetch word - j ra PTR_S zero, U_PCB_ONFAULT(v1) -END(fuword64) + sd v0, 0(a1) # store word + j ra + li v0, 0 +END(fueword64) #endif -LEAF(fuword32) +LEAF(fueword32) #ifndef __mips_n64 -XLEAF(fuword) +XLEAF(fueword) #endif PTR_LA v0, fswberr blt a0, zero, fswberr # make sure address is in user space @@ -310,11 +312,13 @@ XLEAF(fuword) PTR_L v1, PC_CURPCB(v1) PTR_S v0, U_PCB_ONFAULT(v1) lw v0, 0(a0) # fetch word - j ra PTR_S zero, U_PCB_ONFAULT(v1) -END(fuword32) + sw v0, 0(a1) # store word + j ra + li v0, 0 +END(fueword32) -LEAF(fusword) +LEAF(fuesword) PTR_LA v0, fswberr blt a0, zero, fswberr # make sure address is in user space nop @@ -322,9 +326,11 @@ LEAF(fusword) PTR_L v1, PC_CURPCB(v1) PTR_S v0, U_PCB_ONFAULT(v1) lhu v0, 0(a0) # fetch short - j ra PTR_S zero, U_PCB_ONFAULT(v1) -END(fusword) + sh v0, 0(a1) # store short + j ra + li v0, 0 +END(fuesword) LEAF(fubyte) PTR_LA v0, fswberr @@ -371,17 +377,18 @@ END(suword64) #endif /* - * casuword(9) - * u_long casuword(u_long *p, u_long oldval, u_long newval) + * casueword(9) + * u_long casueword(u_long *p, u_long oldval, u_long *oldval_p, + * u_long newval) */ /* - * casuword32(9) - * uint32_t casuword(uint32_t *p, uint32_t oldval, - * uint32_t newval) + * casueword32(9) + * uint32_t casueword(uint32_t *p, uint32_t oldval, + * uint32_t newval) */ -LEAF(casuword32) +LEAF(casueword32) #ifndef __mips_n64 -XLEAF(casuword) +XLEAF(casueword) #endif PTR_LA v0, fswberr blt a0, zero, fswberr # make sure address is in user space @@ -390,26 +397,26 @@ XLEAF(casuword) PTR_L v1, PC_CURPCB(v1) PTR_S v0, U_PCB_ONFAULT(v1) 1: - move t0, a2 - ll v0, 0(a0) - bne a1, v0, 2f + move t0, a3 + ll t1, 0(a0) + bne a1, t1, 2f nop sc t0, 0(a0) # store word beqz t0, 1b nop j 3f - nop + li v0, 0 2: li v0, -1 3: PTR_S zero, U_PCB_ONFAULT(v1) jr ra - nop -END(casuword32) + sw t1, 0(a2) # unconditionally store old word +END(casueword32) #ifdef __mips_n64 -LEAF(casuword64) -XLEAF(casuword) +LEAF(casueword64) +XLEAF(casueword) PTR_LA v0, fswberr blt a0, zero, fswberr # make sure address is in user space nop @@ -417,22 +424,22 @@ XLEAF(casuword) PTR_L v1, PC_CURPCB(v1) PTR_S v0, U_PCB_ONFAULT(v1) 1: - move t0, a2 - lld v0, 0(a0) - bne a1, v0, 2f + move t0, a3 + lld t1, 0(a0) + bne a1, t1, 2f nop scd t0, 0(a0) # store double word beqz t0, 1b nop j 3f - nop + li v0, 0 2: li v0, -1 3: PTR_S zero, U_PCB_ONFAULT(v1) jr ra - nop -END(casuword64) + sd t1, 0(a2) # unconditionally store old word +END(casueword64) #endif /* From owner-svn-src-head@freebsd.org Mon Mar 12 22:58:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14731F52A16; Mon, 12 Mar 2018 22:58:08 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B978B79150; Mon, 12 Mar 2018 22:58:07 +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 A57A311E8E; Mon, 12 Mar 2018 22:58:07 +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 w2CMw7LH078833; Mon, 12 Mar 2018 22:58:07 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CMw7qb078832; Mon, 12 Mar 2018 22:58:07 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803122258.w2CMw7qb078832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 12 Mar 2018 22:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330819 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 330819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 22:58:08 -0000 Author: brooks Date: Mon Mar 12 22:58:07 2018 New Revision: 330819 URL: https://svnweb.freebsd.org/changeset/base/330819 Log: Reject CAMIOGET and CAMIOQUEUE ioctl's on pass(4) in 32-bit compat mode. These take a union ccb argument which is full of kernel pointers. Substantial translation efforts would be required to make this work. By rejecting the request we avoid processing or returning entierly wrong data. Reviewed by: imp, ken, markj, cem Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14654 Modified: head/sys/cam/scsi/scsi_pass.c Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Mon Mar 12 22:17:14 2018 (r330818) +++ head/sys/cam/scsi/scsi_pass.c Mon Mar 12 22:58:07 2018 (r330819) @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #include #include #include @@ -45,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1859,6 +1862,12 @@ passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr union ccb **user_ccb, *ccb; xpt_opcode fc; +#ifdef COMPAT_FREEBSD32 + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { + error = ENOTTY; + goto bailout; + } +#endif if ((softc->flags & PASS_FLAG_ZONE_VALID) == 0) { error = passcreatezone(periph); if (error != 0) @@ -2033,6 +2042,12 @@ camioqueue_error: struct pass_io_req *io_req; int old_error; +#ifdef COMPAT_FREEBSD32 + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { + error = ENOTTY; + goto bailout; + } +#endif user_ccb = (union ccb **)addr; old_error = 0; From owner-svn-src-head@freebsd.org Mon Mar 12 23:02:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89C6AF53085; Mon, 12 Mar 2018 23:02:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D2987959A; Mon, 12 Mar 2018 23:02:02 +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 366B111EF9; Mon, 12 Mar 2018 23:02:02 +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 w2CN22AI081218; Mon, 12 Mar 2018 23:02:02 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CN220A081217; Mon, 12 Mar 2018 23:02:02 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803122302.w2CN220A081217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 12 Mar 2018 23:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330820 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 330820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 23:02:02 -0000 Author: brooks Date: Mon Mar 12 23:02:01 2018 New Revision: 330820 URL: https://svnweb.freebsd.org/changeset/base/330820 Log: Reject ioctls to SCSI enclosures from 32-bit compat processes. The ioctl objects contain pointers and require translation and some refactoring of the infrastructure to work. For now prevent opertion on garbage values. This is very slightly overbroad in that ENCIOC_INIT is safe. Reviewed by: imp, kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14671 Modified: head/sys/cam/scsi/scsi_enc.c Modified: head/sys/cam/scsi/scsi_enc.c ============================================================================== --- head/sys/cam/scsi/scsi_enc.c Mon Mar 12 22:58:07 2018 (r330819) +++ head/sys/cam/scsi/scsi_enc.c Mon Mar 12 23:02:01 2018 (r330820) @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #include #include @@ -39,9 +41,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include #include @@ -354,6 +358,10 @@ enc_ioctl(struct cdev *dev, u_long cmd, caddr_t arg_ad void *addr; int error, i; +#ifdef COMPAT_FREEBSD32 + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) + return (ENOTTY); +#endif if (arg_addr) addr = *((caddr_t *) arg_addr); From owner-svn-src-head@freebsd.org Mon Mar 12 23:04:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4052F53377; Mon, 12 Mar 2018 23:04:42 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84A50797EB; Mon, 12 Mar 2018 23:04:42 +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 799B512031; Mon, 12 Mar 2018 23:04:42 +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 w2CN4gQV083719; Mon, 12 Mar 2018 23:04:42 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CN4g6w083718; Mon, 12 Mar 2018 23:04:42 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803122304.w2CN4g6w083718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 12 Mar 2018 23:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330821 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 23:04:43 -0000 Author: brooks Date: Mon Mar 12 23:04:42 2018 New Revision: 330821 URL: https://svnweb.freebsd.org/changeset/base/330821 Log: Use the stack for temporary storage in OTIOCCONS. The old code used the thread's pcb via the uap->data pointer. Reviewed by: ed Approved by: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14674 Modified: head/sys/kern/tty_compat.c Modified: head/sys/kern/tty_compat.c ============================================================================== --- head/sys/kern/tty_compat.c Mon Mar 12 23:02:01 2018 (r330820) +++ head/sys/kern/tty_compat.c Mon Mar 12 23:04:42 2018 (r330821) @@ -262,9 +262,11 @@ tty_ioctl_compat(struct tty *tp, u_long com, caddr_t d fflag, td)); } - case OTIOCCONS: - *(int *)data = 1; - return (tty_ioctl(tp, TIOCCONS, data, fflag, td)); + case OTIOCCONS: { + int one = 1; + + return (tty_ioctl(tp, TIOCCONS, (caddr_t)&one, fflag, td)); + } default: return (ENOIOCTL); From owner-svn-src-head@freebsd.org Mon Mar 12 23:28:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41C65F5475A; Mon, 12 Mar 2018 23:28:26 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3AB97A3C5; Mon, 12 Mar 2018 23:28:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D613612326; Mon, 12 Mar 2018 23:28:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2CNSPi0093836; Mon, 12 Mar 2018 23:28:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CNSPTQ093835; Mon, 12 Mar 2018 23:28:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803122328.w2CNSPTQ093835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 12 Mar 2018 23:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330822 - head/sys/i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/i386/linux X-SVN-Commit-Revision: 330822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 23:28:26 -0000 Author: emaste Date: Mon Mar 12 23:28:25 2018 New Revision: 330822 URL: https://svnweb.freebsd.org/changeset/base/330822 Log: imgact_linux.c: use standard indentation Sponsored by: Turing Robotic Industries Inc. Modified: head/sys/i386/linux/imgact_linux.c Modified: head/sys/i386/linux/imgact_linux.c ============================================================================== --- head/sys/i386/linux/imgact_linux.c Mon Mar 12 23:04:42 2018 (r330821) +++ head/sys/i386/linux/imgact_linux.c Mon Mar 12 23:28:25 2018 (r330822) @@ -60,176 +60,166 @@ static int exec_linux_imgact(struct image_params *ipar static int exec_linux_imgact(struct image_params *imgp) { - const struct exec *a_out = (const struct exec *) imgp->image_header; - struct vmspace *vmspace; - vm_offset_t vmaddr; - unsigned long virtual_offset, file_offset; - unsigned long bss_size; - ssize_t aresid; - int error; + const struct exec *a_out = (const struct exec *) imgp->image_header; + struct vmspace *vmspace; + vm_offset_t vmaddr; + unsigned long virtual_offset, file_offset; + unsigned long bss_size; + ssize_t aresid; + int error; - if (((a_out->a_magic >> 16) & 0xff) != 0x64) - return (-1); + if (((a_out->a_magic >> 16) & 0xff) != 0x64) + return (-1); - /* - * Set file/virtual offset based on a.out variant. - */ - switch ((int)(a_out->a_magic & 0xffff)) { - case 0413: - virtual_offset = 0; - file_offset = 1024; - break; - case 0314: - virtual_offset = 4096; - file_offset = 0; - break; - default: - return (-1); - } - bss_size = round_page(a_out->a_bss); + /* + * Set file/virtual offset based on a.out variant. + */ + switch ((int)(a_out->a_magic & 0xffff)) { + case 0413: + virtual_offset = 0; + file_offset = 1024; + break; + case 0314: + virtual_offset = 4096; + file_offset = 0; + break; + default: + return (-1); + } + bss_size = round_page(a_out->a_bss); #ifdef DEBUG - printf("imgact: text: %08lx, data: %08lx, bss: %08lx\n", - (u_long)a_out->a_text, (u_long)a_out->a_data, bss_size); + printf("imgact: text: %08lx, data: %08lx, bss: %08lx\n", + (u_long)a_out->a_text, (u_long)a_out->a_data, bss_size); #endif - /* - * Check various fields in header for validity/bounds. - */ - if (a_out->a_entry < virtual_offset || - a_out->a_entry >= virtual_offset + a_out->a_text || - a_out->a_text & PAGE_MASK || a_out->a_data & PAGE_MASK) - return (-1); + /* + * Check various fields in header for validity/bounds. + */ + if (a_out->a_entry < virtual_offset || + a_out->a_entry >= virtual_offset + a_out->a_text || + a_out->a_text & PAGE_MASK || a_out->a_data & PAGE_MASK) + return (-1); - /* text + data can't exceed file size */ - if (a_out->a_data + a_out->a_text > imgp->attr->va_size) - return (EFAULT); - /* - * text/data/bss must not exceed limits - */ - PROC_LOCK(imgp->proc); - if (a_out->a_text > maxtsiz || - a_out->a_data + bss_size > lim_cur_proc(imgp->proc, RLIMIT_DATA) || - racct_set(imgp->proc, RACCT_DATA, a_out->a_data + bss_size) != 0) { + /* text + data can't exceed file size */ + if (a_out->a_data + a_out->a_text > imgp->attr->va_size) + return (EFAULT); + /* + * text/data/bss must not exceed limits + */ + PROC_LOCK(imgp->proc); + if (a_out->a_text > maxtsiz || + a_out->a_data + bss_size > lim_cur_proc(imgp->proc, RLIMIT_DATA) || + racct_set(imgp->proc, RACCT_DATA, a_out->a_data + bss_size) != 0) { + PROC_UNLOCK(imgp->proc); + return (ENOMEM); + } PROC_UNLOCK(imgp->proc); - return (ENOMEM); - } - PROC_UNLOCK(imgp->proc); - VOP_UNLOCK(imgp->vp, 0); + VOP_UNLOCK(imgp->vp, 0); - /* - * Destroy old process VM and create a new one (with a new stack) - */ - error = exec_new_vmspace(imgp, &linux_sysvec); - if (error) - goto fail; - vmspace = imgp->proc->p_vmspace; - - /* - * Check if file_offset page aligned,. - * Currently we cannot handle misaligned file offsets, - * and so we read in the entire image (what a waste). - */ - if (file_offset & PAGE_MASK) { -#ifdef DEBUG - printf("imgact: Non page aligned binary %lu\n", file_offset); -#endif /* - * Map text+data+bss read/write/execute + * Destroy old process VM and create a new one (with a new stack) */ - vmaddr = virtual_offset; - error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr, - a_out->a_text + a_out->a_data + bss_size, 0, VMFS_NO_SPACE, - VM_PROT_ALL, VM_PROT_ALL, 0); + error = exec_new_vmspace(imgp, &linux_sysvec); if (error) - goto fail; - - error = vn_rdwr(UIO_READ, imgp->vp, (void *)vmaddr, file_offset, - a_out->a_text + a_out->a_data, UIO_USERSPACE, 0, - curthread->td_ucred, NOCRED, &aresid, curthread); - if (error != 0) goto fail; - if (aresid != 0) { - error = ENOEXEC; - goto fail; - } + vmspace = imgp->proc->p_vmspace; /* - * remove write enable on the 'text' part + * Check if file_offset page aligned,. + * Currently we cannot handle misaligned file offsets, + * and so we read in the entire image (what a waste). */ - error = vm_map_protect(&vmspace->vm_map, - vmaddr, - vmaddr + a_out->a_text, - VM_PROT_EXECUTE|VM_PROT_READ, - TRUE); - if (error) - goto fail; - } - else { + if (file_offset & PAGE_MASK) { #ifdef DEBUG - printf("imgact: Page aligned binary %lu\n", file_offset); + printf("imgact: Non page aligned binary %lu\n", file_offset); #endif - /* - * Map text+data read/execute - */ - vmaddr = virtual_offset; - error = vm_mmap(&vmspace->vm_map, &vmaddr, - a_out->a_text + a_out->a_data, - VM_PROT_READ | VM_PROT_EXECUTE, - VM_PROT_ALL, - MAP_PRIVATE | MAP_FIXED, - OBJT_VNODE, - imgp->vp, file_offset); - if (error) - goto fail; + /* + * Map text+data+bss read/write/execute + */ + vmaddr = virtual_offset; + error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr, + a_out->a_text + a_out->a_data + bss_size, 0, VMFS_NO_SPACE, + VM_PROT_ALL, VM_PROT_ALL, 0); + if (error) + goto fail; + error = vn_rdwr(UIO_READ, imgp->vp, (void *)vmaddr, file_offset, + a_out->a_text + a_out->a_data, UIO_USERSPACE, 0, + curthread->td_ucred, NOCRED, &aresid, curthread); + if (error != 0) + goto fail; + if (aresid != 0) { + error = ENOEXEC; + goto fail; + } + + /* + * remove write enable on the 'text' part + */ + error = vm_map_protect(&vmspace->vm_map, vmaddr, + vmaddr + a_out->a_text, VM_PROT_EXECUTE|VM_PROT_READ, TRUE); + if (error) + goto fail; + } else { #ifdef DEBUG - printf("imgact: startaddr=%08lx, length=%08lx\n", - (u_long)vmaddr, (u_long)a_out->a_text + (u_long)a_out->a_data); + printf("imgact: Page aligned binary %lu\n", file_offset); #endif - /* - * allow read/write of data - */ - error = vm_map_protect(&vmspace->vm_map, - vmaddr + a_out->a_text, - vmaddr + a_out->a_text + a_out->a_data, - VM_PROT_ALL, - FALSE); - if (error) - goto fail; + /* + * Map text+data read/execute + */ + vmaddr = virtual_offset; + error = vm_mmap(&vmspace->vm_map, &vmaddr, + a_out->a_text + a_out->a_data, + VM_PROT_READ | VM_PROT_EXECUTE, VM_PROT_ALL, + MAP_PRIVATE | MAP_FIXED, OBJT_VNODE, imgp->vp, file_offset); + if (error) + goto fail; - /* - * Allocate anon demand-zeroed area for uninitialized data - */ - if (bss_size != 0) { - vmaddr = virtual_offset + a_out->a_text + a_out->a_data; - error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr, - bss_size, 0, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0); - if (error) - goto fail; #ifdef DEBUG - printf("imgact: bssaddr=%08lx, length=%08lx\n", - (u_long)vmaddr, bss_size); + printf("imgact: startaddr=%08lx, length=%08lx\n", + (u_long)vmaddr, + (u_long)a_out->a_text + (u_long)a_out->a_data); #endif + /* + * allow read/write of data + */ + error = vm_map_protect(&vmspace->vm_map, vmaddr + a_out->a_text, + vmaddr + a_out->a_text + a_out->a_data, VM_PROT_ALL, FALSE); + if (error) + goto fail; + /* + * Allocate anon demand-zeroed area for uninitialized data + */ + if (bss_size != 0) { + vmaddr = virtual_offset + a_out->a_text + a_out->a_data; + error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr, + bss_size, 0, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0); + if (error) + goto fail; +#ifdef DEBUG + printf("imgact: bssaddr=%08lx, length=%08lx\n", (u_long)vmaddr, + bss_size); +#endif + } } - } - /* Fill in process VM information */ - vmspace->vm_tsize = round_page(a_out->a_text) >> PAGE_SHIFT; - vmspace->vm_dsize = round_page(a_out->a_data + bss_size) >> PAGE_SHIFT; - vmspace->vm_taddr = (caddr_t)(void *)(uintptr_t)virtual_offset; - vmspace->vm_daddr = (caddr_t)(void *)(uintptr_t) - (virtual_offset + a_out->a_text); + /* Fill in process VM information */ + vmspace->vm_tsize = round_page(a_out->a_text) >> PAGE_SHIFT; + vmspace->vm_dsize = round_page(a_out->a_data + bss_size) >> PAGE_SHIFT; + vmspace->vm_taddr = (caddr_t)(void *)(uintptr_t)virtual_offset; + vmspace->vm_daddr = + (caddr_t)(void *)(uintptr_t)(virtual_offset + a_out->a_text); - /* Fill in image_params */ - imgp->interpreted = 0; - imgp->entry_addr = a_out->a_entry; + /* Fill in image_params */ + imgp->interpreted = 0; + imgp->entry_addr = a_out->a_entry; - imgp->proc->p_sysent = &linux_sysvec; + imgp->proc->p_sysent = &linux_sysvec; fail: - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); - return (error); + vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + return (error); } /* From owner-svn-src-head@freebsd.org Tue Mar 13 00:40:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BC18A7C15B; Tue, 13 Mar 2018 00:40:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1B007C5F1; Tue, 13 Mar 2018 00:40:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7BDF12DB0; Tue, 13 Mar 2018 00:40:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2D0e5KH028657; Tue, 13 Mar 2018 00:40:05 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2D0e5iB028654; Tue, 13 Mar 2018 00:40:05 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803130040.w2D0e5iB028654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Mar 2018 00:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330823 - in head/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Commit-Revision: 330823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 00:40:06 -0000 Author: emaste Date: Tue Mar 13 00:40:05 2018 New Revision: 330823 URL: https://svnweb.freebsd.org/changeset/base/330823 Log: Apply some style(9) to Linuxulator linux_sysvec.c comments Modified: head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/i386/linux/linux_sysvec.c Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Mon Mar 12 23:28:25 2018 (r330822) +++ head/sys/amd64/linux/linux_sysvec.c Tue Mar 13 00:40:05 2018 (r330823) @@ -101,10 +101,9 @@ SYSCTL_PROC(_compat_linux, OID_AUTO, debug, #endif /* - * Allow the this functions to use the ldebug() facility - * even though they are not syscalls themselves. Map them - * to syscall 0. This is slightly less bogus than using - * ldebug(sigreturn). + * Allow the sendsig functions to use the ldebug() facility even though they + * are not syscalls themselves. Map them to syscall 0. This is slightly less + * bogus than using ldebug(sigreturn). */ #define LINUX_SYS_linux_rt_sendsig 0 @@ -253,8 +252,7 @@ linux_set_syscall_retval(struct thread *td, int error) /* * On Linux only %rcx and %r11 values are not preserved across - * the syscall. - * So, do not clobber %rdx and %r10 + * the syscall. So, do not clobber %rdx and %r10. */ td->td_retval[1] = frame->tf_rdx; frame->tf_r10 = frame->tf_rcx; @@ -335,9 +333,7 @@ linux_copyout_strings(struct image_params *imgp) size_t execpath_len; struct proc *p; - /* - * Calculate string base and vector table pointers. - */ + /* Calculate string base and vector table pointers. */ if (imgp->execpath != NULL && imgp->auxargs != NULL) execpath_len = strlen(imgp->execpath) + 1; else @@ -345,7 +341,7 @@ linux_copyout_strings(struct image_params *imgp) p = imgp->proc; arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; - destp = (caddr_t)arginfo - SPARE_USRSPACE - + destp = (caddr_t)arginfo - SPARE_USRSPACE - roundup(sizeof(canary), sizeof(char *)) - roundup(execpath_len, sizeof(char *)) - roundup(ARG_MAX - imgp->args->stringspace, sizeof(char *)); @@ -355,19 +351,14 @@ linux_copyout_strings(struct image_params *imgp) copyout(imgp->execpath, (void *)imgp->execpathp, execpath_len); } - /* - * Prepare the canary for SSP. - */ + /* Prepare the canary for SSP. */ arc4rand(canary, sizeof(canary), 0); imgp->canary = (uintptr_t)arginfo - roundup(execpath_len, sizeof(char *)) - roundup(sizeof(canary), sizeof(char *)); copyout(canary, (void *)imgp->canary, sizeof(canary)); - /* - * If we have a valid auxargs ptr, prepare some room - * on the stack. - */ + /* If we have a valid auxargs ptr, prepare some room on the stack. */ if (imgp->auxargs) { /* * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for @@ -393,29 +384,21 @@ linux_copyout_strings(struct image_params *imgp) imgp->args->envc + 2) * sizeof(char *)); } - /* - * vectp also becomes our initial stack base - */ + /* vectp also becomes our initial stack base. */ stack_base = (register_t *)vectp; stringp = imgp->args->begin_argv; argc = imgp->args->argc; envc = imgp->args->envc; - /* - * Copy out strings - arguments and environment. - */ + /* Copy out strings - arguments and environment. */ copyout(stringp, destp, ARG_MAX - imgp->args->stringspace); - /* - * Fill in "ps_strings" struct for ps, w, etc. - */ + /* Fill in "ps_strings" struct for ps, w, etc. */ suword(&arginfo->ps_argvstr, (long)(intptr_t)vectp); suword(&arginfo->ps_nargvstr, argc); - /* - * Fill in argument portion of vector table. - */ + /* Fill in argument portion of vector table. */ for (; argc > 0; --argc) { suword(vectp++, (long)(intptr_t)destp); while (*stringp++ != 0) @@ -423,15 +406,13 @@ linux_copyout_strings(struct image_params *imgp) destp++; } - /* a null vector table pointer separates the argp's from the envp's */ + /* A null vector table pointer separates the argp's from the envp's. */ suword(vectp++, 0); suword(&arginfo->ps_envstr, (long)(intptr_t)vectp); suword(&arginfo->ps_nenvstr, envc); - /* - * Fill in environment portion of vector table. - */ + /* Fill in environment portion of vector table. */ for (; envc > 0; --envc) { suword(vectp++, (long)(intptr_t)destp); while (*stringp++ != 0) @@ -439,7 +420,7 @@ linux_copyout_strings(struct image_params *imgp) destp++; } - /* end of vector table is a null pointer */ + /* The end of the vector table is a null pointer. */ suword(vectp, 0); return (stack_base); } @@ -681,12 +662,10 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse regs->tf_rdx = (register_t)&sfp->sf_sc; /* arg 3 in %rdx */ sf.sf_handler = catcher; - /* Fill in POSIX parts */ + /* Fill in POSIX parts. */ ksiginfo_to_lsiginfo(ksi, &sf.sf_si, sig); - /* - * Copy the sigframe out to the user's stack. - */ + /* Copy the sigframe out to the user's stack. */ if (copyout(&sf, sfp, sizeof(*sfp)) != 0) { #ifdef DEBUG printf("process %ld has trashed its stack\n", (long)p->p_pid); @@ -762,7 +741,7 @@ linux_vsyscall(struct thread *td) frame = td->td_frame; - /* Check %rip for vsyscall area */ + /* Check %rip for vsyscall area. */ if (__predict_true(frame->tf_rip < LINUX_VSYSCALL_START)) return (EINVAL); if ((frame->tf_rip & (LINUX_VSYSCALL_SZ - 1)) != 0) @@ -773,7 +752,7 @@ linux_vsyscall(struct thread *td) /* * vsyscall called as callq *(%rax), so we must - * use return address from %rsp and also fixup %rsp + * use return address from %rsp and also fixup %rsp. */ error = copyin((void *)frame->tf_rsp, &retqaddr, sizeof(retqaddr)); if (error) Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Mon Mar 12 23:28:25 2018 (r330822) +++ head/sys/amd64/linux32/linux32_sysvec.c Tue Mar 13 00:40:05 2018 (r330823) @@ -102,10 +102,9 @@ MODULE_VERSION(linux, 1); #endif /* - * Allow the sendsig functions to use the ldebug() facility - * even though they are not syscalls themselves. Map them - * to syscall 0. This is slightly less bogus than using - * ldebug(sigreturn). + * Allow the sendsig functions to use the ldebug() facility even though they + * are not syscalls themselves. Map them to syscall 0. This is slightly less + * bogus than using ldebug(sigreturn). */ #define LINUX32_SYS_linux_rt_sendsig 0 #define LINUX32_SYS_linux_sendsig 0 @@ -312,9 +311,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse printf(ARGS(rt_sendsig, "%p, %d, %p, %u"), catcher, sig, (void*)mask, code); #endif - /* - * Allocate space for the signal handler context. - */ + /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { fp = (struct l_rt_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + @@ -323,9 +320,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse fp = (struct l_rt_sigframe *)regs->tf_rsp - 1; mtx_unlock(&psp->ps_mtx); - /* - * Build the argument list for the signal handler. - */ + /* Build the argument list for the signal handler. */ sig = bsd_to_linux_signal(sig); bzero(&frame, sizeof(frame)); @@ -335,12 +330,11 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse frame.sf_siginfo = PTROUT(&fp->sf_si); frame.sf_ucontext = PTROUT(&fp->sf_sc); - /* Fill in POSIX parts */ + /* Fill in POSIX parts. */ ksiginfo_to_lsiginfo(ksi, &frame.sf_si, sig); /* - * Build the signal context to be used by sigreturn - * and libgcc unwind. + * Build the signal context to be used by sigreturn and libgcc unwind. */ frame.sf_sc.uc_flags = 0; /* XXX ??? */ frame.sf_sc.uc_link = 0; /* XXX ??? */ @@ -396,9 +390,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse sigexit(td, SIGILL); } - /* - * Build context to run handler in. - */ + /* Build context to run handler in. */ regs->tf_rsp = PTROUT(fp); regs->tf_rip = linux32_rt_sigcode; regs->tf_rflags &= ~(PSL_T | PSL_D); @@ -457,9 +449,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t catcher, sig, (void*)mask, code); #endif - /* - * Allocate space for the signal handler context. - */ + /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { fp = (struct l_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + @@ -469,9 +459,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t mtx_unlock(&psp->ps_mtx); PROC_UNLOCK(p); - /* - * Build the argument list for the signal handler. - */ + /* Build the argument list for the signal handler. */ sig = bsd_to_linux_signal(sig); bzero(&frame, sizeof(frame)); @@ -481,9 +469,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t bsd_to_linux_sigset(mask, &lmask); - /* - * Build the signal context to be used by sigreturn. - */ + /* Build the signal context to be used by sigreturn. */ frame.sf_sc.sc_mask = lmask.__mask; frame.sf_sc.sc_gs = regs->tf_gs; frame.sf_sc.sc_fs = regs->tf_fs; @@ -517,9 +503,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t sigexit(td, SIGILL); } - /* - * Build context to run handler in. - */ + /* Build context to run handler in. */ regs->tf_rsp = PTROUT(fp); regs->tf_rip = linux32_sigcode; regs->tf_rflags &= ~(PSL_T | PSL_D); @@ -569,9 +553,7 @@ linux_sigreturn(struct thread *td, struct linux_sigret if (copyin(args->sfp, &frame, sizeof(frame)) != 0) return (EFAULT); - /* - * Check for security violations. - */ + /* Check for security violations. */ #define EFLAGS_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) eflags = frame.sf_sc.sc_eflags; if (!EFLAGS_SECURE(eflags, regs->tf_rflags)) @@ -598,9 +580,7 @@ linux_sigreturn(struct thread *td, struct linux_sigret linux_to_bsd_sigset(&lmask, &bmask); kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); - /* - * Restore signal context. - */ + /* Restore signal context. */ regs->tf_rdi = frame.sf_sc.sc_edi; regs->tf_rsi = frame.sf_sc.sc_esi; regs->tf_rbp = frame.sf_sc.sc_ebp; @@ -660,9 +640,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_ context = &uc.uc_mcontext; - /* - * Check for security violations. - */ + /* Check for security violations. */ #define EFLAGS_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) eflags = context->sc_eflags; if (!EFLAGS_SECURE(eflags, regs->tf_rflags)) @@ -850,9 +828,7 @@ linux_copyout_strings(struct image_params *imgp) char canary[LINUX_AT_RANDOM_LEN]; size_t execpath_len; - /* - * Calculate string base and vector table pointers. - */ + /* Calculate string base and vector table pointers. */ if (imgp->execpath != NULL && imgp->auxargs != NULL) execpath_len = strlen(imgp->execpath) + 1; else @@ -869,19 +845,14 @@ linux_copyout_strings(struct image_params *imgp) copyout(imgp->execpath, (void *)imgp->execpathp, execpath_len); } - /* - * Prepare the canary for SSP. - */ + /* Prepare the canary for SSP. */ arc4rand(canary, sizeof(canary), 0); imgp->canary = (uintptr_t)arginfo - roundup(execpath_len, sizeof(char *)) - roundup(sizeof(canary), sizeof(char *)); copyout(canary, (void *)imgp->canary, sizeof(canary)); - /* - * If we have a valid auxargs ptr, prepare some room - * on the stack. - */ + /* If we have a valid auxargs ptr, prepare some room on the stack. */ if (imgp->auxargs) { /* * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for @@ -906,28 +877,20 @@ linux_copyout_strings(struct image_params *imgp) vectp = (u_int32_t *)(destp - (imgp->args->argc + imgp->args->envc + 2) * sizeof(u_int32_t)); - /* - * vectp also becomes our initial stack base - */ + /* vectp also becomes our initial stack base. */ stack_base = vectp; stringp = imgp->args->begin_argv; argc = imgp->args->argc; envc = imgp->args->envc; - /* - * Copy out strings - arguments and environment. - */ + /* Copy out strings - arguments and environment. */ copyout(stringp, destp, ARG_MAX - imgp->args->stringspace); - /* - * Fill in "ps_strings" struct for ps, w, etc. - */ + /* Fill in "ps_strings" struct for ps, w, etc. */ suword32(&arginfo->ps_argvstr, (uint32_t)(intptr_t)vectp); suword32(&arginfo->ps_nargvstr, argc); - /* - * Fill in argument portion of vector table. - */ + /* Fill in argument portion of vector table. */ for (; argc > 0; --argc) { suword32(vectp++, (uint32_t)(intptr_t)destp); while (*stringp++ != 0) @@ -935,15 +898,13 @@ linux_copyout_strings(struct image_params *imgp) destp++; } - /* a null vector table pointer separates the argp's from the envp's */ + /* A null vector table pointer separates the argp's from the envp's. */ suword32(vectp++, 0); suword32(&arginfo->ps_envstr, (uint32_t)(intptr_t)vectp); suword32(&arginfo->ps_nenvstr, envc); - /* - * Fill in environment portion of vector table. - */ + /* Fill in environment portion of vector table. */ for (; envc > 0; --envc) { suword32(vectp++, (uint32_t)(intptr_t)destp); while (*stringp++ != 0) @@ -951,7 +912,7 @@ linux_copyout_strings(struct image_params *imgp) destp++; } - /* end of vector table is a null pointer */ + /* The end of the vector table is a null pointer. */ suword32(vectp, 0); return ((register_t *)stack_base); Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Mon Mar 12 23:28:25 2018 (r330822) +++ head/sys/i386/linux/linux_sysvec.c Tue Mar 13 00:40:05 2018 (r330823) @@ -88,10 +88,9 @@ SYSCTL_PROC(_compat_linux, OID_AUTO, debug, CTLTYPE_ST #endif /* - * Allow the sendsig functions to use the ldebug() facility - * even though they are not syscalls themselves. Map them - * to syscall 0. This is slightly less bogus than using - * ldebug(sigreturn). + * Allow the sendsig functions to use the ldebug() facility even though they + * are not syscalls themselves. Map them to syscall 0. This is slightly less + * bogus than using ldebug(sigreturn). */ #define LINUX_SYS_linux_rt_sendsig 0 #define LINUX_SYS_linux_sendsig 0 @@ -306,9 +305,7 @@ linux_copyout_strings(struct image_params *imgp) size_t execpath_len; struct proc *p; - /* - * Calculate string base and vector table pointers. - */ + /* Calculate string base and vector table pointers. */ p = imgp->proc; if (imgp->execpath != NULL && imgp->auxargs != NULL) execpath_len = strlen(imgp->execpath) + 1; @@ -320,9 +317,7 @@ linux_copyout_strings(struct image_params *imgp) roundup(execpath_len, sizeof(char *)) - roundup(ARG_MAX - imgp->args->stringspace, sizeof(char *)); - /* - * install LINUX_PLATFORM - */ + /* Install LINUX_PLATFORM. */ copyout(linux_kplatform, ((caddr_t)arginfo - linux_szplatform), linux_szplatform); @@ -332,19 +327,14 @@ linux_copyout_strings(struct image_params *imgp) copyout(imgp->execpath, (void *)imgp->execpathp, execpath_len); } - /* - * Prepare the canary for SSP. - */ + /* Prepare the canary for SSP. */ arc4rand(canary, sizeof(canary), 0); imgp->canary = (uintptr_t)arginfo - linux_szplatform - roundup(execpath_len, sizeof(char *)) - roundup(sizeof(canary), sizeof(char *)); copyout(canary, (void *)imgp->canary, sizeof(canary)); - /* - * If we have a valid auxargs ptr, prepare some room - * on the stack. - */ + /* If we have a valid auxargs ptr, prepare some room on the stack. */ if (imgp->auxargs) { /* * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for @@ -368,29 +358,21 @@ linux_copyout_strings(struct image_params *imgp) sizeof(char *)); } - /* - * vectp also becomes our initial stack base - */ + /* vectp also becomes our initial stack base. */ stack_base = (register_t *)vectp; stringp = imgp->args->begin_argv; argc = imgp->args->argc; envc = imgp->args->envc; - /* - * Copy out strings - arguments and environment. - */ + /* Copy out strings - arguments and environment. */ copyout(stringp, destp, ARG_MAX - imgp->args->stringspace); - /* - * Fill in "ps_strings" struct for ps, w, etc. - */ + /* Fill in "ps_strings" struct for ps, w, etc. */ suword(&arginfo->ps_argvstr, (long)(intptr_t)vectp); suword(&arginfo->ps_nargvstr, argc); - /* - * Fill in argument portion of vector table. - */ + /* Fill in argument portion of vector table. */ for (; argc > 0; --argc) { suword(vectp++, (long)(intptr_t)destp); while (*stringp++ != 0) @@ -398,15 +380,13 @@ linux_copyout_strings(struct image_params *imgp) destp++; } - /* a null vector table pointer separates the argp's from the envp's */ + /* A null vector table pointer separates the argp's from the envp's. */ suword(vectp++, 0); suword(&arginfo->ps_envstr, (long)(intptr_t)vectp); suword(&arginfo->ps_nenvstr, envc); - /* - * Fill in environment portion of vector table. - */ + /* Fill in environment portion of vector table. */ for (; envc > 0; --envc) { suword(vectp++, (long)(intptr_t)destp); while (*stringp++ != 0) @@ -414,7 +394,7 @@ linux_copyout_strings(struct image_params *imgp) destp++; } - /* end of vector table is a null pointer */ + /* The end of the vector table is a null pointer. */ suword(vectp, 0); return (stack_base); @@ -444,9 +424,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse printf(ARGS(rt_sendsig, "%p, %d, %p, %u"), catcher, sig, (void*)mask, code); #endif - /* - * Allocate space for the signal handler context. - */ + /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { fp = (struct l_rt_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + @@ -455,9 +433,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse fp = (struct l_rt_sigframe *)regs->tf_esp - 1; mtx_unlock(&psp->ps_mtx); - /* - * Build the argument list for the signal handler. - */ + /* Build the argument list for the signal handler. */ sig = bsd_to_linux_signal(sig); bzero(&frame, sizeof(frame)); @@ -467,12 +443,10 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse frame.sf_siginfo = &fp->sf_si; frame.sf_ucontext = &fp->sf_sc; - /* Fill in POSIX parts */ + /* Fill in POSIX parts. */ ksiginfo_to_lsiginfo(ksi, &frame.sf_si, sig); - /* - * Build the signal context to be used by sigreturn. - */ + /* Build the signal context to be used by sigreturn. */ frame.sf_sc.uc_flags = 0; /* XXX ??? */ frame.sf_sc.uc_link = NULL; /* XXX ??? */ @@ -527,9 +501,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse sigexit(td, SIGILL); } - /* - * Build context to run handler in. - */ + /* Build context to run handler in. */ regs->tf_esp = (int)fp; regs->tf_eip = linux_rt_sigcode; regs->tf_eflags &= ~(PSL_T | PSL_VM | PSL_D); @@ -584,9 +556,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t catcher, sig, (void*)mask, code); #endif - /* - * Allocate space for the signal handler context. - */ + /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { fp = (struct l_sigframe *)((uintptr_t)td->td_sigstk.ss_sp + @@ -596,9 +566,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t mtx_unlock(&psp->ps_mtx); PROC_UNLOCK(p); - /* - * Build the argument list for the signal handler. - */ + /* Build the argument list for the signal handler. */ sig = bsd_to_linux_signal(sig); bzero(&frame, sizeof(frame)); @@ -608,9 +576,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t bsd_to_linux_sigset(mask, &lmask); - /* - * Build the signal context to be used by sigreturn. - */ + /* Build the signal context to be used by sigreturn. */ frame.sf_sc.sc_mask = lmask.__mask; frame.sf_sc.sc_gs = rgs(); frame.sf_sc.sc_fs = regs->tf_fs; @@ -644,9 +610,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t sigexit(td, SIGILL); } - /* - * Build context to run handler in. - */ + /* Build context to run handler in. */ regs->tf_esp = (int)fp; regs->tf_eip = linux_sigcode; regs->tf_eflags &= ~(PSL_T | PSL_VM | PSL_D); @@ -693,9 +657,7 @@ linux_sigreturn(struct thread *td, struct linux_sigret if (copyin(args->sfp, &frame, sizeof(frame)) != 0) return (EFAULT); - /* - * Check for security violations. - */ + /* Check for security violations. */ #define EFLAGS_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) eflags = frame.sf_sc.sc_eflags; if (!EFLAGS_SECURE(eflags, regs->tf_eflags)) @@ -721,9 +683,7 @@ linux_sigreturn(struct thread *td, struct linux_sigret linux_to_bsd_sigset(&lmask, &bmask); kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); - /* - * Restore signal context. - */ + /* Restore signal context. */ /* %gs was restored by the trampoline. */ regs->tf_fs = frame.sf_sc.sc_fs; regs->tf_es = frame.sf_sc.sc_es; @@ -782,9 +742,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_ context = &uc.uc_mcontext; - /* - * Check for security violations. - */ + /* Check for security violations. */ #define EFLAGS_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) eflags = context->sc_eflags; if (!EFLAGS_SECURE(eflags, regs->tf_eflags)) @@ -809,9 +767,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_ linux_to_bsd_sigset(&uc.uc_sigmask, &bmask); kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); - /* - * Restore signal context - */ + /* Restore signal context. */ /* %gs was restored by the trampoline. */ regs->tf_fs = context->sc_fs; regs->tf_es = context->sc_es; @@ -829,9 +785,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_ regs->tf_esp = context->sc_esp_at_signal; regs->tf_ss = context->sc_ss; - /* - * call sigaltstack & ignore results.. - */ + /* Call sigaltstack & ignore results. */ lss = &uc.uc_stack; ss.ss_sp = lss->ss_sp; ss.ss_size = lss->ss_size; @@ -928,7 +882,7 @@ exec_linux_setregs(struct thread *td, struct image_par exec_setregs(td, imgp, stack); - /* Linux sets %gs to 0, we default to _udatasel */ + /* Linux sets %gs to 0, we default to _udatasel. */ pcb->pcb_gs = 0; load_gs(0); From owner-svn-src-head@freebsd.org Tue Mar 13 02:59:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CC49B2A58E; Tue, 13 Mar 2018 02:59:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E755F83A8E; Tue, 13 Mar 2018 02:59:13 +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 E22BE14575; Tue, 13 Mar 2018 02:59:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2D2xDT0098716; Tue, 13 Mar 2018 02:59:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2D2xDwQ098715; Tue, 13 Mar 2018 02:59:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803130259.w2D2xDwQ098715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 13 Mar 2018 02:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330825 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 02:59:14 -0000 Author: kevans Date: Tue Mar 13 02:59:13 2018 New Revision: 330825 URL: https://svnweb.freebsd.org/changeset/base/330825 Log: lualoader: Sprinkle some verbose_loading salt Our module loading messages should be hidden without verbose_loading -- go ahead and do that as a first step. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Tue Mar 13 01:19:07 2018 (r330824) +++ head/stand/lua/config.lua Tue Mar 13 02:59:13 2018 (r330825) @@ -197,6 +197,7 @@ end config.env_changed = {} -- Values to restore env to (nil to unset) config.env_restore = {} +config.verbose = false -- The first item in every carousel is always the default item. function config.getCarouselIndex(id) @@ -490,6 +491,11 @@ function config.load(file) -- Cache the provided module_path at load time for later use config.module_path = loader.getenv("module_path") + local verbose = loader.getenv("verbose_loading") + if verbose == nil then + verbose = "no" + end + config.verbose = verbose:lower() == "yes" end -- Reload configuration @@ -512,7 +518,7 @@ function config.loadelf() end print(MSG_MODLOADING) - if not config.loadmod(modules) then + if not config.loadmod(modules, not config.verbose) then print(MSG_MODLOADFAIL) end end From owner-svn-src-head@freebsd.org Tue Mar 13 03:00:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03E69B2A796; Tue, 13 Mar 2018 03:00:19 +0000 (UTC) (envelope-from decui@microsoft.com) Received: from APC01-PU1-obe.outbound.protection.outlook.com (mail-pu1apc01on0137.outbound.protection.outlook.com [104.47.126.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT TLS CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9768C83C0A; Tue, 13 Mar 2018 03:00:16 +0000 (UTC) (envelope-from decui@microsoft.com) Received: from KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM (10.170.167.17) by KL1P15301MB0005.APCP153.PROD.OUTLOOK.COM (10.170.167.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.8; Tue, 13 Mar 2018 03:00:09 +0000 Received: from KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM ([10.170.167.17]) by KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM ([10.170.167.17]) with mapi id 15.20.0588.008; Tue, 13 Mar 2018 03:00:09 +0000 From: Dexuan Cui To: Warner Losh , Dexuan-BSD Cui CC: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: RE: svn commit: r328554 - head/sys/cam/scsi Thread-Topic: svn commit: r328554 - head/sys/cam/scsi Thread-Index: AQHTuiFyz8qBuyVRskydPzgJf0IYXaPNd2TA Date: Tue, 13 Mar 2018 03:00:08 +0000 Message-ID: References: <201801291807.w0TI7EVD092154@repo.freebsd.org> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=decui@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2018-03-13T02:59:18.4586269Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General x-originating-ip: [2601:600:a27f:df20:740e:7c66:ca1a:8f87] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; KL1P15301MB0005; 7:LqBqHEGhUjV0khkQDs7uHNQGIhiJCeFo9lvU7S+ZtFknDPQ/FMxAZHh0QM3045KFgZaLNaDshWGggsEZeOofGhvvoFXQdGX2Wp3NxUHYsH45GSmrot3HGSEx2AcadFe/XqvtFIZEFhQFLHoOZNTwP2NiCqoLpQkbU5xzvejUrny/S07pcp/rdGWUxhTTQjM59kPje4eg/2e7kG4bsaweq3m+Yv6wGCaAq69/ufoUtdP4Q64ieK04abj0ZzwdglBx; 20:rei/n9XEnL/9cnduZoXoV4jMg9B3B9V1iryuJ7o7g3rDOz+0NP9H4WJ41vT881CLMfkem6S93dr2fAEqXhJhWP8oNJM5LEmend2rmTA3qsm2ym2IX044WUGVRqr+Pak2QLa3pOYV8p068cg0HHgBTbG5mks5J5V3XiXDobSE3VI= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 82ee900e-db20-45ff-6c30-08d5888e8811 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:KL1P15301MB0005; x-ms-traffictypediagnostic: KL1P15301MB0005: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(56005881305849)(20558992708506)(89211679590171)(189930954265078)(85827821059158)(219752817060721)(155532106045638)(21748063052155)(265313219721884); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231221)(944501244)(52105095)(3002001)(6055026)(61426038)(61427038)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:KL1P15301MB0005; BCL:0; PCL:0; RULEID:; SRVR:KL1P15301MB0005; x-forefront-prvs: 0610D16BBE x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(396003)(346002)(366004)(39380400002)(39860400002)(13624006)(199004)(189003)(8990500004)(106356001)(39060400002)(86612001)(4326008)(6116002)(2950100002)(6246003)(25786009)(110136005)(790700001)(10090500001)(54906003)(86362001)(53366004)(99286004)(3280700002)(316002)(105586002)(229853002)(2906002)(53376002)(8936002)(46003)(10290500003)(7696005)(186003)(77096007)(22452003)(53936002)(6506007)(55016002)(102836004)(6436002)(68736007)(3660700001)(7736002)(81166006)(81156014)(59450400001)(53546011)(8676002)(54896002)(478600001)(9326002)(9686003)(97736004)(76176011)(7066003)(236005)(6306002)(74316002)(33656002)(606006)(2900100001)(966005)(53946003)(5660300001)(14454004)(579004)(10090945008); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1P15301MB0005; H:KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 3Fm6zKUgA2lHNOVrtI+83ZYdHEOpePbp5xYMxfEI1PCPiLNdU2nLG8tySMbNgEHolhqjrUFSjcSXsWQpKqQHuotxqAKCG+Gs9lmadTcK80LzjO6MJUedEVKo10F1PybNzM7DdaT+7QUSc988l6MArkdjwD9fVUthoaVTPrGG3PtWsjeryRrDHS2Heg/c6ALOZRckLeb6jRvnM5A9aFpr3ZQCpL7xOE3nHAWlayqrgsMEWvOs1nnEMMgPRzUB559a8idZnlP7eS9SnkcoLaAgkrrj/i43nZxbCysuIcgSL8AY2jzruYz7iIYrheCWTl9iOnO93MIbmv3OStLowiHelw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82ee900e-db20-45ff-6c30-08d5888e8811 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Mar 2018 03:00:08.8456 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1P15301MB0005 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 03:00:19 -0000 SGkgV2FybmVyLA0KU29ycnksIEkgbmVlZCB0byBtYWtlIGEgY29ycmVjdGlvbjogYWN1dGFsbHkg aXQgbG9va3MgdGhlIHBhbmljIGNhbiBOT1QgcmVwcm9kdWNlIHdpdGggc3RhYmxlLzExIG9yIHRo ZSBsYXRlc3QgbWFzdGVyIGJyYW5jaC4gVGhpcyBpcyBncmVhdCEgOi0pDQoNCkFjdHVhbGx5IEkg d2FzIHVzaW5nIGFuIG9sZCB2ZXJzaW9uIG9mIHRoZSBtYXN0ZXIgYnJhbmNoIHRoYXQgZG9lc27i gJl0IGhhdmUgcjMyODU1NCB5ZXQsIGFuZCBJIGNvdWxkIDEwMCUgcmVwcm9kdWNlIHRoZSBpc3N1 ZS4gSWYgSSBtYW51YWxseSBhcHBseSByMzI4NTU0LCBvciBJIHVzZSB0aGUgbGF0ZXN0IG1hc3Rl ciBicmFuY2gsIHRoZSBwYW5pYyBjYW7igJl0IGhhcHBlbiBhbnkgbW9yZS4NCg0KU28sIGl0IGxv b2tzIGhlcmUgd2UgZG9u4oCZdCBuZWVkIHRvIE1GQyBhbnkgcGF0Y2ggdG8gc3RhYmxlLzExLg0K DQpUaGFua3MsDQotLSBEZXh1YW4NCg0KRnJvbTogd2xvc2hAYnNkaW1wLmNvbSA8d2xvc2hAYnNk aW1wLmNvbT4gT24gQmVoYWxmIE9mIFdhcm5lciBMb3NoDQpTZW50OiBNb25kYXksIE1hcmNoIDEy LCAyMDE4IDA5OjQ1DQpUbzogRGV4dWFuLUJTRCBDdWkgPGRleHVhbi5ic2RAZ21haWwuY29tPg0K Q2M6IFdhcm5lciBMb3NoIDxpbXBAZnJlZWJzZC5vcmc+OyBzcmMtY29tbWl0dGVycyA8c3JjLWNv bW1pdHRlcnNAZnJlZWJzZC5vcmc+OyBzdm4tc3JjLWFsbEBmcmVlYnNkLm9yZzsgc3ZuLXNyYy1o ZWFkQGZyZWVic2Qub3JnOyBEZXh1YW4gQ3VpIDxkZWN1aUBtaWNyb3NvZnQuY29tPg0KU3ViamVj dDogUmU6IHN2biBjb21taXQ6IHIzMjg1NTQgLSBoZWFkL3N5cy9jYW0vc2NzaQ0KDQoNClRoaXMg c2VuZGVyIGZhaWxlZCBvdXIgZnJhdWQgZGV0ZWN0aW9uIGNoZWNrcyBhbmQgbWF5IG5vdCBiZSB3 aG8gdGhleSBhcHBlYXIgdG8gYmUuIExlYXJuIGFib3V0IHNwb29maW5nPGh0dHA6Ly9ha2EubXMv TGVhcm5BYm91dFNwb29maW5nPg0KDQpGZWVkYmFjazxodHRwOi8vYWthLm1zL1NhZmV0eVRpcHNG ZWVkYmFjaz4NCg0KSSB0aGluayB0aGlzIGlzIGEgZ29vZCBpZGVhIHRvIE1GQy4gV2UndmUgaGFk IG5vIHJlcG9ydHMgb2YgaXQgY2F1c2luZyBpc3N1ZXMuDQoNClRoZXJlJ3MgbW9yZSBleHRlbnNp dmUgbG9ja2luZyBjaGFuZ2VzIC8gdHdlYWtzIG5lZWRlZCBmb3IgZGEgdGhhdCBqdXN0IHdlbnQg aW4gdGhhdCBsaWtlbHkgc2hvdWxkIGFsc28gYmUgTUZDJ2QuDQoNCldhcm5lcg0KDQpPbiBTdW4s IE1hciAxMSwgMjAxOCBhdCA5OjE3IFBNLCBEZXh1YW4tQlNEIEN1aSA8ZGV4dWFuLmJzZEBnbWFp bC5jb208bWFpbHRvOmRleHVhbi5ic2RAZ21haWwuY29tPj4gd3JvdGU6DQpIaSBpbXAgYW5kIGFs bCwNCkkgdGhpbmsgdGhpcyBwYXRjaCBpcyB2ZXJ5IGltcG9ydGFudCwgYmVjYXVzZSBpdCBjYW4g Zml4IGEgcGFuaWMgSQ0Kbm90aWNlZCByZWNlbnRseSB3aGVuIEkgdHJ5IHRvIGhvdC1yZW1vdmUg YSBTQ1NJIGRpc2sgZnJvbSBhIFZNDQpydW5uaW5nIG9uIEF6dXJlL0h5cGVyLVYuDQoNClRoZSBw YW5pYyBpcyBhbG1vc3QgMTAwJSByZXByb2R1Y2libGUgd2l0aCBzdGFibGUvMTEsIGJ1dCBub3Qg aW4gdGhlDQpsYXRlc3QgQ1VSUkVOVCBjb2RlLCBzbyBmaW5hbGx5IEkgaWRlbnRpZmllZCB0aGlz IGZpeCBpbiB0aGUgQ1VSUkVOVA0KYnJhbmNoLg0KDQpDYW4geW91IHBsZWFzZSBNRkMgdGhpcyBw YXRjaCB0byAxMSBhbmQgMTA/DQpJdCBsb29rcyB0aGVyZSBpcyBhIG1ham9yIGRpZmZlcmVuY2Ug aW4gdGhlIENBTSBjb2RlIGJldHdlZW4gMTEvMTANCmFuZCB0aGUgQ1VSUkVOVCBjb2RlLCBhbmQg d2UgbWF5IGhhdmUgdG8gTUZDIG1vcmUgcmVsYXRlZCBwYXRjaGVzLiBJZg0KdGhpcyBpcyBkaWZm aWN1bHQsIEkgaG9wZSBhdCBsZWFzdCB3ZSBjYW4gcHJvdmlkZSBhIG1pbmltYWwgcmUtd3JpdHRl bg0KdmVyc2lvbiBvZiB0aGUgcGF0Y2ggdG8gMTEgYW5kIDEwPw0KDQpMb29raW5nIGZvcndhcmQg dG8geW91ciBpbnNpZ2h0IQ0KDQpUaGFua3MsDQotLSBEZXh1YW4NCg0KDQpPbiBNb24sIEphbiAy OSwgMjAxOCBhdCAxMDowNyBBTSwgV2FybmVyIExvc2ggPGltcEBmcmVlYnNkLm9yZzxtYWlsdG86 aW1wQGZyZWVic2Qub3JnPj4gd3JvdGU6DQo+IEF1dGhvcjogaW1wDQo+IERhdGU6IE1vbiBKYW4g MjkgMTg6MDc6MTQgMjAxOA0KPiBOZXcgUmV2aXNpb246IDMyODU1NA0KPiBVUkw6IGh0dHBzOi8v c3Zud2ViLmZyZWVic2Qub3JnL2NoYW5nZXNldC9iYXNlLzMyODU1NDxodHRwczovL25hMDEuc2Fm ZWxpbmtzLnByb3RlY3Rpb24ub3V0bG9vay5jb20vP3VybD1odHRwcyUzQSUyRiUyRnN2bndlYi5m cmVlYnNkLm9yZyUyRmNoYW5nZXNldCUyRmJhc2UlMkYzMjg1NTQmZGF0YT0wNCU3QzAxJTdDZGVj dWklNDBtaWNyb3NvZnQuY29tJTdDZTRkOGUzODAyYzhjNDhiZjk2OTgwOGQ1ODgzODkwNGYlN0M3 MmY5ODhiZjg2ZjE0MWFmOTFhYjJkN2NkMDExZGI0NyU3QzElN0MwJTdDNjM2NTY0Njk4OTA4NzUw MDU4JTdDVW5rbm93biU3Q1RXRnBiR1pzYjNkOGV5SldJam9pTUM0d0xqQXdNREFpTENKUUlqb2lW Mmx1TXpJaUxDSkJUaUk2SWsxaGFXd2lmUSUzRCUzRCU3QzEwMCZzZGF0YT1TdUt0aE5BNXU5Nlla WWZHbUZUS1RrQ0hJJTJGNW5JamU5dVdkcGhhcEFObFklM0QmcmVzZXJ2ZWQ9MD4NCj4NCj4gTG9n Og0KPiAgIERvIHRoZSBib29rLWtlZXBpbmcgb24gcmVsZWFzZSBiZWZvcmUgd2UgcmVsZWFzZSB0 aGUgcmVmZXJlbmNlLiBUaGUNCj4gICBwZXJpcGggd2FzIGdvaW5nIGF3YXkgb24gZmluYWwgcmVs ZWFzZSwgYW5kIHRoZW4gcmV0dXJuaW5nIGFuZCB3ZQ0KPiAgIHN0YXJ0ZWQgZGFuY2luZyBpbiBm cmVlIG1lbW9yeS4NCj4NCj4gICBTcG9uc29yZWQgYnk6IE5ldGZsaXgNCj4NCj4gTW9kaWZpZWQ6 DQo+ICAgaGVhZC9zeXMvY2FtL3Njc2kvc2NzaV9kYS5jDQo+DQo+IE1vZGlmaWVkOiBoZWFkL3N5 cy9jYW0vc2NzaS9zY3NpX2RhLmMNCj4gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQo+IC0tLSBoZWFk L3N5cy9jYW0vc2NzaS9zY3NpX2RhLmMgTW9uIEphbiAyOSAxNzozMjozMCAyMDE4ICAgICAgICAo cjMyODU1MykNCj4gKysrIGhlYWQvc3lzL2NhbS9zY3NpL3Njc2lfZGEuYyBNb24gSmFuIDI5IDE4 OjA3OjE0IDIwMTggICAgICAgIChyMzI4NTU0KQ0KPiBAQCAtMTU0OSwxMiArMTU0OSwxMiBAQCBk YV9wZXJpcGhfdW5ob2xkKHN0cnVjdCBjYW1fcGVyaXBoICpwZXJpcGgsIGRhX3JlZl90b2sNCj4g ICAgICAgICBzdHJ1Y3QgZGFfc29mdGMgKnNvZnRjID0gcGVyaXBoLT5zb2Z0YzsNCj4NCj4gICAg ICAgICB0b2tlbl9zYW5pdHkodG9rZW4pOw0KPiAtICAgICAgIGNhbV9wZXJpcGhfdW5ob2xkKHBl cmlwaCk7DQo+ICAgICAgICAgREFfUEVSSVBIX1BSSU5UKHBlcmlwaCwgIlVuaG9sZGluZyBkZXZp Y2UgJXMgKCVkKVxuIiwNCj4gICAgICAgICAgICAgZGFfcmVmX3RleHRbdG9rZW5dLCB0b2tlbik7 DQo+ICAgICAgICAgY250ID0gYXRvbWljX2ZldGNoYWRkX2ludCgmc29mdGMtPnJlZl9mbGFnc1t0 b2tlbl0sIC0xKTsNCj4gICAgICAgICBpZiAoY250ICE9IDEpDQo+ICAgICAgICAgICAgICAgICBw YW5pYygiVW5ob2xkaW5nICVkIHdpdGggY250ID0gJWQiLCB0b2tlbiwgY250KTsNCj4gKyAgICAg ICBjYW1fcGVyaXBoX3VuaG9sZChwZXJpcGgpOw0KPiAgfQ0KPg0KPiAgc3RhdGljIGlubGluZSBp bnQNCj4gQEAgLTE1ODMsMTIgKzE1ODMsMTIgQEAgZGFfcGVyaXBoX3JlbGVhc2Uoc3RydWN0IGNh bV9wZXJpcGggKnBlcmlwaCwgZGFfcmVmX3RvDQo+ICAgICAgICAgc3RydWN0IGRhX3NvZnRjICpz b2Z0YyA9IHBlcmlwaC0+c29mdGM7DQo+DQo+ICAgICAgICAgdG9rZW5fc2FuaXR5KHRva2VuKTsN Cj4gLSAgICAgICBjYW1fcGVyaXBoX3JlbGVhc2UocGVyaXBoKTsNCj4gICAgICAgICBEQV9QRVJJ UEhfUFJJTlQocGVyaXBoLCAicmVsZWFzaW5nIGRldmljZSAlcyAoJWQpXG4iLA0KPiAgICAgICAg ICAgICBkYV9yZWZfdGV4dFt0b2tlbl0sIHRva2VuKTsNCj4gICAgICAgICBjbnQgPSBhdG9taWNf ZmV0Y2hhZGRfaW50KCZzb2Z0Yy0+cmVmX2ZsYWdzW3Rva2VuXSwgLTEpOw0KPiAgICAgICAgIGlm IChjbnQgIT0gMSkNCj4gICAgICAgICAgICAgICAgIHBhbmljKCJSZWxlYXNpbmcgJWQgd2l0aCBj bnQgPSAlZCIsIHRva2VuLCBjbnQpOw0KPiArICAgICAgIGNhbV9wZXJpcGhfcmVsZWFzZShwZXJp cGgpOw0KPiAgfQ0KPg0KPiAgc3RhdGljIGlubGluZSB2b2lkDQo+IEBAIC0xNTk4LDEyICsxNTk4 LDEyIEBAIGRhX3BlcmlwaF9yZWxlYXNlX2xvY2tlZChzdHJ1Y3QgY2FtX3BlcmlwaCAqcGVyaXBo LCBkYQ0KPiAgICAgICAgIHN0cnVjdCBkYV9zb2Z0YyAqc29mdGMgPSBwZXJpcGgtPnNvZnRjOw0K Pg0KPiAgICAgICAgIHRva2VuX3Nhbml0eSh0b2tlbik7DQo+IC0gICAgICAgY2FtX3BlcmlwaF9y ZWxlYXNlX2xvY2tlZChwZXJpcGgpOw0KPiAgICAgICAgIERBX1BFUklQSF9QUklOVChwZXJpcGgs ICJyZWxlYXNpbmcgZGV2aWNlIChsb2NrZWQpICVzICglZClcbiIsDQo+ICAgICAgICAgICAgIGRh X3JlZl90ZXh0W3Rva2VuXSwgdG9rZW4pOw0KPiAgICAgICAgIGNudCA9IGF0b21pY19mZXRjaGFk ZF9pbnQoJnNvZnRjLT5yZWZfZmxhZ3NbdG9rZW5dLCAtMSk7DQo+ICAgICAgICAgaWYgKGNudCAh PSAxKQ0KPiAgICAgICAgICAgICAgICAgcGFuaWMoIlVuaG9sZGluZyAlZCB3aXRoIGNudCA9ICVk IiwgdG9rZW4sIGNudCk7DQo+ICsgICAgICAgY2FtX3BlcmlwaF9yZWxlYXNlX2xvY2tlZChwZXJp cGgpOw0KPiAgfQ0KPg0KPiAgI2RlZmluZSBjYW1fcGVyaXBoX2hvbGQgUE9JU09ODQo+DQoNCg== From owner-svn-src-head@freebsd.org Tue Mar 13 03:02:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 660E5B2AB99; Tue, 13 Mar 2018 03:02:10 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14915843B7; Tue, 13 Mar 2018 03:02:10 +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 0F7C71475B; Tue, 13 Mar 2018 03:02:10 +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 w2D329sm001574; Tue, 13 Mar 2018 03:02:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2D329pE001567; Tue, 13 Mar 2018 03:02:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201803130302.w2D329pE001567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 13 Mar 2018 03:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330826 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 330826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 03:02:10 -0000 Author: mav Date: Tue Mar 13 03:02:09 2018 New Revision: 330826 URL: https://svnweb.freebsd.org/changeset/base/330826 Log: Add `nvmecontrol format` subcommand. It allows to change namespace parameters, such as block size, metadata, protection information, etc. and/or erase the data. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Added: head/sbin/nvmecontrol/format.c (contents, props changed) Modified: head/sbin/nvmecontrol/Makefile head/sbin/nvmecontrol/identify.c head/sbin/nvmecontrol/logpage.c head/sbin/nvmecontrol/nvmecontrol.8 head/sbin/nvmecontrol/nvmecontrol.c head/sbin/nvmecontrol/nvmecontrol.h Modified: head/sbin/nvmecontrol/Makefile ============================================================================== --- head/sbin/nvmecontrol/Makefile Tue Mar 13 02:59:13 2018 (r330825) +++ head/sbin/nvmecontrol/Makefile Tue Mar 13 03:02:09 2018 (r330826) @@ -2,7 +2,7 @@ PACKAGE=runtime PROG= nvmecontrol -SRCS= nvmecontrol.c devlist.c firmware.c identify.c logpage.c \ +SRCS= nvmecontrol.c devlist.c firmware.c format.c identify.c logpage.c \ perftest.c reset.c nvme_util.c power.c util.c wdc.c MAN= nvmecontrol.8 Added: head/sbin/nvmecontrol/format.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/format.c Tue Mar 13 03:02:09 2018 (r330826) @@ -0,0 +1,175 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2018 Alexander Motin + * 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 "nvmecontrol.h" + +static void +format_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, FORMAT_USAGE); + exit(1); +} + +void +format(int argc, char *argv[]) +{ + struct nvme_controller_data cd; + struct nvme_namespace_data nsd; + struct nvme_pt_command pt; + char path[64]; + char *target; + uint32_t nsid; + int ch, fd; + int lbaf = -1, mset = -1, pi = -1, pil = -1, ses = 0; + + if (argc < 2) + format_usage(); + + while ((ch = getopt(argc, argv, "f:m:p:l:EC")) != -1) { + switch ((char)ch) { + case 'f': + lbaf = strtol(optarg, NULL, 0); + break; + case 'm': + mset = strtol(optarg, NULL, 0); + break; + case 'p': + pi = strtol(optarg, NULL, 0); + break; + case 'l': + pil = strtol(optarg, NULL, 0); + break; + case 'E': + ses = 1; + break; + case 'C': + ses = 2; + break; + default: + format_usage(); + } + } + + /* Check that a controller or namespace was specified. */ + if (optind >= argc) + format_usage(); + target = argv[optind]; + + /* + * Check if the specified device node exists before continuing. + * This is a cleaner check for cases where the correct controller + * is specified, but an invalid namespace on that controller. + */ + open_dev(target, &fd, 1, 1); + + /* + * If device node contains "ns", we consider it a namespace, + * otherwise, consider it a controller. + */ + if (strstr(target, NVME_NS_PREFIX) == NULL) { + nsid = NVME_GLOBAL_NAMESPACE_TAG; + + /* We have no previous parameters, so use defaults. */ + if (lbaf < 0) + lbaf = 0; + if (mset < 0) + mset = 0; + if (pi < 0) + pi = 0; + if (pil < 0) + pil = 0; + } else { + parse_ns_str(target, path, &nsid); + + /* + * We send FORMAT commands to the controller, not the namespace, + * since it is an admin cmd. The namespace ID will be specified + * in the command itself. So parse the namespace's device node + * string to get the controller substring and namespace ID. + */ + close(fd); + open_dev(path, &fd, 1, 1); + + /* Check that controller can execute this command. */ + read_controller_data(fd, &cd); + if (((cd.fna >> NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT) + & NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK) && ses == 0) { + fprintf(stderr, "H/w doesn't support per-NS format\n"); + exit(1); + } else if (((cd.fna >> NVME_CTRLR_DATA_FNA_ERASE_ALL_SHIFT) + & NVME_CTRLR_DATA_FNA_ERASE_ALL_MASK) && ses != 0) { + fprintf(stderr, "H/w doesn't support per-NS erase\n"); + exit(1); + } + + /* Try to keep previous namespace parameters. */ + read_namespace_data(fd, nsid, &nsd); + if (lbaf < 0) + lbaf = (nsd.flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) + & NVME_NS_DATA_FLBAS_FORMAT_MASK; + if (mset < 0) + mset = (nsd.flbas >> NVME_NS_DATA_FLBAS_EXTENDED_SHIFT) + & NVME_NS_DATA_FLBAS_EXTENDED_MASK; + if (pi < 0) + pi = (nsd.dps >> NVME_NS_DATA_DPS_MD_START_SHIFT) + & NVME_NS_DATA_DPS_MD_START_MASK; + if (pil < 0) + pil = (nsd.dps >> NVME_NS_DATA_DPS_PIT_SHIFT) + & NVME_NS_DATA_DPS_PIT_MASK; + } + + memset(&pt, 0, sizeof(pt)); + pt.cmd.opc_fuse = NVME_CMD_SET_OPC(NVME_OPC_FORMAT_NVM); + pt.cmd.nsid = htole32(nsid); + pt.cmd.cdw10 = htole32((ses << 9) + (pil << 8) + (pi << 5) + + (mset << 4) + lbaf); + + if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) + err(1, "format request failed"); + + if (nvme_completion_is_error(&pt.cpl)) + errx(1, "format request returned error"); + close(fd); + exit(0); +} Modified: head/sbin/nvmecontrol/identify.c ============================================================================== --- head/sbin/nvmecontrol/identify.c Tue Mar 13 02:59:13 2018 (r330825) +++ head/sbin/nvmecontrol/identify.c Tue Mar 13 03:02:09 2018 (r330826) @@ -384,8 +384,9 @@ identify_ns(int argc, char *argv[]) { struct nvme_namespace_data nsdata; char path[64]; - int ch, fd, hexflag = 0, hexlength, nsid; + int ch, fd, hexflag = 0, hexlength; int verboseflag = 0; + uint32_t nsid; while ((ch = getopt(argc, argv, "vx")) != -1) { switch ((char)ch) { Modified: head/sbin/nvmecontrol/logpage.c ============================================================================== --- head/sbin/nvmecontrol/logpage.c Tue Mar 13 02:59:13 2018 (r330825) +++ head/sbin/nvmecontrol/logpage.c Tue Mar 13 03:02:09 2018 (r330826) @@ -99,7 +99,7 @@ get_log_buffer(uint32_t size) } void -read_logpage(int fd, uint8_t log_page, int nsid, void *payload, +read_logpage(int fd, uint8_t log_page, uint32_t nsid, void *payload, uint32_t payload_size) { struct nvme_pt_command pt; @@ -909,13 +909,13 @@ logpage_help(void) void logpage(int argc, char *argv[]) { - int fd, nsid; + int fd; int log_page = 0, pageflag = false; int binflag = false, hexflag = false, ns_specified; int opt; char *p; char cname[64]; - uint32_t size; + uint32_t nsid, size; void *buf; const char *vendor = NULL; struct logpage_function *f; Modified: head/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.8 Tue Mar 13 02:59:13 2018 (r330825) +++ head/sbin/nvmecontrol/nvmecontrol.8 Tue Mar 13 03:02:09 2018 (r330826) @@ -1,4 +1,5 @@ .\" +.\" Copyright (c) 2018 Alexander Motin .\" Copyright (c) 2012 Intel Corporation .\" All rights reserved. .\" @@ -33,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 24, 2017 +.Dd March 12, 2018 .Dt NVMECONTROL 8 .Os .Sh NAME @@ -47,6 +48,7 @@ .Op Fl v .Op Fl x .Aq device id +.Aq namespace id .Nm .Ic perftest .Aq Fl n Ar num_threads @@ -73,6 +75,16 @@ .Op Fl a .Aq device id .Nm +.Ic format +.Op Fl f Ar fmt +.Op Fl m Ar mset +.Op Fl o Ar pi +.Op Fl l Ar pil +.Op Fl E +.Op Fl C +.Aq device id +.Aq namespace id +.Nm .Ic power .Op Fl l .Op Fl p power_state @@ -117,6 +129,27 @@ will list all valid vendors and pages. will print the page as hex. .Fl b will print the binary data for the page. +.Ss format +Format either specified namespace, or all namespaces of specified controller, +using specified parameters: +.Ar fmt +LBA Format, +.Ar mset +Metadata Settings, +.Ar pi +Protection Information, +.Ar pil +Protection Information Location. +When formatting specific namespace, existing values are used as defaults. +When formatting all namespaces, all parameters should be specified. +Some controllers may not support formatting or erasing specific or all +namespaces. +Option +.Fl E +enables User Data Erase during format. +Option +.Fl C +enables Cryptographic Erase during format. .Ss wdc The various wdc command retrieve log data from the wdc/hgst drives. The Modified: head/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.c Tue Mar 13 02:59:13 2018 (r330825) +++ head/sbin/nvmecontrol/nvmecontrol.c Tue Mar 13 03:02:09 2018 (r330826) @@ -55,6 +55,7 @@ static struct nvme_function funcs[] = { {"reset", reset, RESET_USAGE}, {"logpage", logpage, LOGPAGE_USAGE}, {"firmware", firmware, FIRMWARE_USAGE}, + {"format", format, FORMAT_USAGE}, {"power", power, POWER_USAGE}, {"wdc", wdc, WDC_USAGE}, {NULL, NULL, NULL}, @@ -163,7 +164,7 @@ read_controller_data(int fd, struct nvme_controller_da } void -read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata) +read_namespace_data(int fd, uint32_t nsid, struct nvme_namespace_data *nsdata) { struct nvme_pt_command pt; @@ -214,7 +215,7 @@ open_dev(const char *str, int *fd, int show_error, int } void -parse_ns_str(const char *ns_str, char *ctrlr_str, int *nsid) +parse_ns_str(const char *ns_str, char *ctrlr_str, uint32_t *nsid) { char *nsloc; Modified: head/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.h Tue Mar 13 02:59:13 2018 (r330825) +++ head/sbin/nvmecontrol/nvmecontrol.h Tue Mar 13 03:02:09 2018 (r330826) @@ -65,6 +65,9 @@ struct nvme_function { #define FIRMWARE_USAGE \ " nvmecontrol firmware [-s slot] [-f path_to_firmware] [-a] \n" +#define FORMAT_USAGE \ +" nvmecontrol format [-f fmt] [-m mset] [-p pi] [-l pil] [-E] [-C] \n" + #define POWER_USAGE \ " nvmecontrol power [-l] [-p new-state [-w workload-hint]] \n" @@ -77,15 +80,16 @@ void perftest(int argc, char *argv[]); void reset(int argc, char *argv[]); void logpage(int argc, char *argv[]); void firmware(int argc, char *argv[]); +void format(int argc, char *argv[]); void power(int argc, char *argv[]); void wdc(int argc, char *argv[]); int open_dev(const char *str, int *fd, int show_error, int exit_on_error); -void parse_ns_str(const char *ns_str, char *ctrlr_str, int *nsid); +void parse_ns_str(const char *ns_str, char *ctrlr_str, uint32_t *nsid); void read_controller_data(int fd, struct nvme_controller_data *cdata); -void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata); +void read_namespace_data(int fd, uint32_t nsid, struct nvme_namespace_data *nsdata); void print_hex(void *data, uint32_t length); -void read_logpage(int fd, uint8_t log_page, int nsid, void *payload, +void read_logpage(int fd, uint8_t log_page, uint32_t nsid, void *payload, uint32_t payload_size); void gen_usage(struct nvme_function *); void dispatch(int argc, char *argv[], struct nvme_function *f); From owner-svn-src-head@freebsd.org Tue Mar 13 09:38:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A77DFF32F6D; Tue, 13 Mar 2018 09:38:54 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1F07324C; Tue, 13 Mar 2018 09:38:54 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 471F71837C; Tue, 13 Mar 2018 09:38:54 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2D9csv5099300; Tue, 13 Mar 2018 09:38:54 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2D9csB4099299; Tue, 13 Mar 2018 09:38:54 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201803130938.w2D9csB4099299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Tue, 13 Mar 2018 09:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330834 - head/sys/dev/vt/hw/vga X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/sys/dev/vt/hw/vga X-SVN-Commit-Revision: 330834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 09:38:54 -0000 Author: royger Date: Tue Mar 13 09:38:53 2018 New Revision: 330834 URL: https://svnweb.freebsd.org/changeset/base/330834 Log: vt_vga: check if VGA is available from ACPI FADT table On x86 the IA-PC Boot Flags in the FADT can signal whether VGA is available or not. Sponsored by: Citrix systems R&D Reviewed by: marcel Differential revision: https://reviews.freebsd.org/D14397 Modified: head/sys/dev/vt/hw/vga/vt_vga.c Modified: head/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vt_vga.c Tue Mar 13 09:29:56 2018 (r330833) +++ head/sys/dev/vt/hw/vga/vt_vga.c Tue Mar 13 09:38:53 2018 (r330834) @@ -30,6 +30,8 @@ * SUCH DAMAGE. */ +#include "opt_acpi.h" + #include __FBSDID("$FreeBSD$"); @@ -46,6 +48,10 @@ __FBSDID("$FreeBSD$"); #include +#if ((defined(__amd64__) || defined(__i386__)) && defined(DEV_ACPI)) +#include +#endif + struct vga_softc { bus_space_tag_t vga_fb_tag; bus_space_handle_t vga_fb_handle; @@ -1196,11 +1202,39 @@ vga_initialize(struct vt_device *vd, int textmode) return (0); } +static bool +vga_acpi_disabled(void) +{ +#if ((defined(__amd64__) || defined(__i386__)) && defined(DEV_ACPI)) + ACPI_TABLE_FADT *fadt; + vm_paddr_t physaddr; + uint16_t flags; + + physaddr = acpi_find_table(ACPI_SIG_FADT); + if (physaddr == 0) + return (false); + + fadt = acpi_map_table(physaddr, ACPI_SIG_FADT); + if (fadt == NULL) { + printf("vt_vga: unable to map FADT ACPI table\n"); + return (false); + } + + flags = fadt->BootFlags; + acpi_unmap_table(fadt); + + if (flags & ACPI_FADT_NO_VGA) + return (true); +#endif + + return (false); +} + static int vga_probe(struct vt_device *vd) { - return (CN_INTERNAL); + return (vga_acpi_disabled() ? CN_DEAD : CN_INTERNAL); } static int From owner-svn-src-head@freebsd.org Tue Mar 13 09:42:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6531CF334FD; Tue, 13 Mar 2018 09:42:34 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17673736DF; Tue, 13 Mar 2018 09:42:34 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12383184FF; Tue, 13 Mar 2018 09:42:34 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2D9gXXY003965; Tue, 13 Mar 2018 09:42:33 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2D9gXhn003963; Tue, 13 Mar 2018 09:42:33 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201803130942.w2D9gXhn003963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Tue, 13 Mar 2018 09:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330835 - in head: share/man/man4 sys/x86/isa X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: in head: share/man/man4 sys/x86/isa X-SVN-Commit-Revision: 330835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 09:42:34 -0000 Author: royger Date: Tue Mar 13 09:42:33 2018 New Revision: 330835 URL: https://svnweb.freebsd.org/changeset/base/330835 Log: at_rtc: check in ACPI FADT boot flags if the RTC is present Or else disable the device. Note that the detection can be bypassed by setting the hw.atrtc.enable option in the loader configuration file. More information can be found on atrtc(4). Sponsored by: Citrix Systems R&D Reviewed by: ian Differential revision: https://reviews.freebsd.org/D14399 Modified: head/share/man/man4/atrtc.4 head/sys/x86/isa/atrtc.c Modified: head/share/man/man4/atrtc.4 ============================================================================== --- head/share/man/man4/atrtc.4 Tue Mar 13 09:38:53 2018 (r330834) +++ head/share/man/man4/atrtc.4 Tue Mar 13 09:42:33 2018 (r330835) @@ -33,13 +33,18 @@ .Sh SYNOPSIS This driver is a mandatory part of i386/amd64 kernels. .Pp -The following tunable is settable from the +The following tunables are settable from the .Xr loader 8 : .Bl -ohang .It Va hint.atrtc. Ns Ar X Ns Va .clock controls event timers functionality support. Setting to 0, disables it. Default value is 1. +.It Va hw.atrtc.enable +Forces enabling or disabling of the device(s). +Setting to 0 disables it, setting to 1 enables it, bypassing any platform +configuration hints. +Default value is -1 (autodetect). .El .Sh DESCRIPTION This driver uses RTC hardware to supply kernel with time-of-day clock Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Tue Mar 13 09:38:53 2018 (r330834) +++ head/sys/x86/isa/atrtc.c Tue Mar 13 09:42:33 2018 (r330835) @@ -32,6 +32,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_acpi.h" #include "opt_isa.h" #include @@ -55,6 +56,10 @@ __FBSDID("$FreeBSD$"); #include #include "clock_if.h" +#ifdef DEV_ACPI +#include +#endif + /* * atrtc_lock protects low-level access to individual hardware registers. * atrtc_time_lock protects the entire sequence of accessing multiple registers @@ -63,6 +68,10 @@ __FBSDID("$FreeBSD$"); static struct mtx atrtc_lock; MTX_SYSINIT(atrtc_lock_init, &atrtc_lock, "atrtc", MTX_SPIN); +/* Force RTC enabled/disabled. */ +static int atrtc_enabled = -1; +TUNABLE_INT("hw.atrtc.enabled", &atrtc_enabled); + struct mtx atrtc_time_lock; MTX_SYSINIT(atrtc_time_lock_init, &atrtc_time_lock, "atrtc_time", MTX_DEF); @@ -249,11 +258,43 @@ static struct isa_pnp_id atrtc_ids[] = { { 0 } }; +static bool +atrtc_acpi_disabled(void) +{ +#ifdef DEV_ACPI + ACPI_TABLE_FADT *fadt; + vm_paddr_t physaddr; + uint16_t flags; + + physaddr = acpi_find_table(ACPI_SIG_FADT); + if (physaddr == 0) + return (false); + + fadt = acpi_map_table(physaddr, ACPI_SIG_FADT); + if (fadt == NULL) { + printf("at_rtc: unable to map FADT ACPI table\n"); + return (false); + } + + flags = fadt->BootFlags; + acpi_unmap_table(fadt); + + if (flags & ACPI_FADT_NO_CMOS_RTC) + return (true); +#endif + + return (false); +} + static int atrtc_probe(device_t dev) { int result; - + + if ((atrtc_enabled == -1 && atrtc_acpi_disabled()) || + (atrtc_enabled == 0)) + return (ENXIO); + result = ISA_PNP_PROBE(device_get_parent(dev), dev, atrtc_ids); /* ENOENT means no PnP-ID, device is hinted. */ if (result == ENOENT) { From owner-svn-src-head@freebsd.org Tue Mar 13 09:58:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9835F34A25; Tue, 13 Mar 2018 09:58:29 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D50074201; Tue, 13 Mar 2018 09:58:29 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83FC31869A; Tue, 13 Mar 2018 09:58:29 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2D9wTL9009066; Tue, 13 Mar 2018 09:58:29 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2D9wTor009065; Tue, 13 Mar 2018 09:58:29 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201803130958.w2D9wTor009065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 13 Mar 2018 09:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330837 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 330837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 09:58:30 -0000 Author: tsoome Date: Tue Mar 13 09:58:29 2018 New Revision: 330837 URL: https://svnweb.freebsd.org/changeset/base/330837 Log: biosdisk.c should not set d_opendata. Same as 330807, d_opendata is owned by open_disk and we should not set it. M stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Tue Mar 13 09:46:09 2018 (r330836) +++ head/stand/i386/libi386/biosdisk.c Tue Mar 13 09:58:29 2018 (r330837) @@ -404,7 +404,6 @@ bd_open(struct open_file *f, ...) */ disk.dd.d_dev = dev->dd.d_dev; disk.dd.d_unit = dev->dd.d_unit; - disk.dd.d_opendata = NULL; disk.d_slice = -1; disk.d_partition = -1; disk.d_offset = 0; From owner-svn-src-head@freebsd.org Tue Mar 13 13:09:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14E3FF4C739; Tue, 13 Mar 2018 13:09:12 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B79547C120; Tue, 13 Mar 2018 13:09: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 B24E31A3CA; Tue, 13 Mar 2018 13:09: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 w2DD9BnF003965; Tue, 13 Mar 2018 13:09:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DD9BAD003960; Tue, 13 Mar 2018 13:09:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803131309.w2DD9BAD003960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Mar 2018 13:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330842 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 13:09:12 -0000 Author: emaste Date: Tue Mar 13 13:09:10 2018 New Revision: 330842 URL: https://svnweb.freebsd.org/changeset/base/330842 Log: Use C99 designated initializers for struct execsw It it makes use slightly more clear and facilitates grepping. Modified: head/sys/kern/imgact_aout.c head/sys/kern/imgact_binmisc.c head/sys/kern/imgact_elf.c head/sys/kern/imgact_gzip.c head/sys/kern/imgact_shell.c Modified: head/sys/kern/imgact_aout.c ============================================================================== --- head/sys/kern/imgact_aout.c Tue Mar 13 12:38:26 2018 (r330841) +++ head/sys/kern/imgact_aout.c Tue Mar 13 13:09:10 2018 (r330842) @@ -337,5 +337,8 @@ exec_aout_imgact(struct image_params *imgp) /* * Tell kern_execve.c about it, with a little help from the linker. */ -static struct execsw aout_execsw = { exec_aout_imgact, "a.out" }; +static struct execsw aout_execsw = { + .ex_imgact = exec_aout_imgact, + .ex_name = "a.out" +}; EXEC_SET(aout, aout_execsw); Modified: head/sys/kern/imgact_binmisc.c ============================================================================== --- head/sys/kern/imgact_binmisc.c Tue Mar 13 12:38:26 2018 (r330841) +++ head/sys/kern/imgact_binmisc.c Tue Mar 13 13:09:10 2018 (r330842) @@ -753,5 +753,8 @@ SYSUNINIT(imgact_binmisc, SI_SUB_EXEC, SI_ORDER_MIDDLE /* * Tell kern_execve.c about it, with a little help from the linker. */ -static struct execsw imgact_binmisc_execsw = { imgact_binmisc_exec, KMOD_NAME }; +static struct execsw imgact_binmisc_execsw = { + .ex_imgact = imgact_binmisc_exec, + .ex_name = KMOD_NAME +}; EXEC_SET(imgact_binmisc, imgact_binmisc_execsw); Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Tue Mar 13 12:38:26 2018 (r330841) +++ head/sys/kern/imgact_elf.c Tue Mar 13 13:09:10 2018 (r330842) @@ -2426,8 +2426,8 @@ __elfN(check_note)(struct image_params *imgp, Elf_Bran * Tell kern_execve.c about it, with a little help from the linker. */ static struct execsw __elfN(execsw) = { - __CONCAT(exec_, __elfN(imgact)), - __XSTRING(__CONCAT(ELF, __ELF_WORD_SIZE)) + .ex_imgact = __CONCAT(exec_, __elfN(imgact)), + .ex_name = __XSTRING(__CONCAT(ELF, __ELF_WORD_SIZE)) }; EXEC_SET(__CONCAT(elf, __ELF_WORD_SIZE), __elfN(execsw)); Modified: head/sys/kern/imgact_gzip.c ============================================================================== --- head/sys/kern/imgact_gzip.c Tue Mar 13 12:38:26 2018 (r330841) +++ head/sys/kern/imgact_gzip.c Tue Mar 13 13:09:10 2018 (r330842) @@ -387,5 +387,8 @@ Flush(void *vp, u_char * ptr, u_long siz) /* * Tell kern_execve.c about it, with a little help from the linker. */ -static struct execsw gzip_execsw = {exec_gzip_imgact, "gzip"}; +static struct execsw gzip_execsw = { + .ex_imgact = exec_gzip_imgact, + .ex_name = "gzip" +}; EXEC_SET(execgzip, gzip_execsw); Modified: head/sys/kern/imgact_shell.c ============================================================================== --- head/sys/kern/imgact_shell.c Tue Mar 13 12:38:26 2018 (r330841) +++ head/sys/kern/imgact_shell.c Tue Mar 13 13:09:10 2018 (r330842) @@ -255,5 +255,8 @@ exec_shell_imgact(struct image_params *imgp) /* * Tell kern_execve.c about it, with a little help from the linker. */ -static struct execsw shell_execsw = { exec_shell_imgact, "#!" }; +static struct execsw shell_execsw = { + .ex_imgact = exec_shell_imgact, + .ex_name = "#!" +}; EXEC_SET(shell, shell_execsw); From owner-svn-src-head@freebsd.org Tue Mar 13 15:01:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65943F54095; Tue, 13 Mar 2018 15:01: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1410881758; Tue, 13 Mar 2018 15:01: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 0F17B1B500; Tue, 13 Mar 2018 15:01: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 w2DF1Not064111; Tue, 13 Mar 2018 15:01:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DF1NUN064110; Tue, 13 Mar 2018 15:01:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803131501.w2DF1NUN064110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 13 Mar 2018 15:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330843 - head/sys/dev/efidev X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/efidev X-SVN-Commit-Revision: 330843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 15:01:24 -0000 Author: kevans Date: Tue Mar 13 15:01:23 2018 New Revision: 330843 URL: https://svnweb.freebsd.org/changeset/base/330843 Log: efirtc: Pass a dummy tmcap pointer to efi_get_time_locked As noted in the comment, UEFI spec claims the capabilities pointer is optional, but some implementations will choke and attempt to dereference it without checking. This specific problem was found on a Lenovo Thinkpad X220 that would panic in efirtc_identify. Modified: head/sys/dev/efidev/efirt.c Modified: head/sys/dev/efidev/efirt.c ============================================================================== --- head/sys/dev/efidev/efirt.c Tue Mar 13 13:09:10 2018 (r330842) +++ head/sys/dev/efidev/efirt.c Tue Mar 13 15:01:23 2018 (r330843) @@ -259,12 +259,19 @@ efi_get_time_locked(struct efi_tm *tm, struct efi_tmca int efi_get_time(struct efi_tm *tm) { + struct efi_tmcap dummy; int error; if (efi_runtime == NULL) return (ENXIO); EFI_TIME_LOCK() - error = efi_get_time_locked(tm, NULL); + /* + * UEFI spec states that the Capabilities argument to GetTime is + * optional, but some UEFI implementations choke when passed a NULL + * pointer. Pass a dummy efi_dmcap, even though we won't use it, + * to workaround such implementations. + */ + error = efi_get_time_locked(tm, &dummy); EFI_TIME_UNLOCK() return (error); } From owner-svn-src-head@freebsd.org Tue Mar 13 15:02:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AA53F54233; Tue, 13 Mar 2018 15:02: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BF0C819C5; Tue, 13 Mar 2018 15:02:47 +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 06F4D1B63E; Tue, 13 Mar 2018 15:02:47 +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 w2DF2knR064892; Tue, 13 Mar 2018 15:02:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DF2kRd064891; Tue, 13 Mar 2018 15:02:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803131502.w2DF2kRd064891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 13 Mar 2018 15:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330844 - head/sys/dev/efidev X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/efidev X-SVN-Commit-Revision: 330844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 15:02:47 -0000 Author: kevans Date: Tue Mar 13 15:02:46 2018 New Revision: 330844 URL: https://svnweb.freebsd.org/changeset/base/330844 Log: Correct minor typo in comment, efi_dmcap -> efi_tmcap Modified: head/sys/dev/efidev/efirt.c Modified: head/sys/dev/efidev/efirt.c ============================================================================== --- head/sys/dev/efidev/efirt.c Tue Mar 13 15:01:23 2018 (r330843) +++ head/sys/dev/efidev/efirt.c Tue Mar 13 15:02:46 2018 (r330844) @@ -268,7 +268,7 @@ efi_get_time(struct efi_tm *tm) /* * UEFI spec states that the Capabilities argument to GetTime is * optional, but some UEFI implementations choke when passed a NULL - * pointer. Pass a dummy efi_dmcap, even though we won't use it, + * pointer. Pass a dummy efi_tmcap, even though we won't use it, * to workaround such implementations. */ error = efi_get_time_locked(tm, &dummy); From owner-svn-src-head@freebsd.org Tue Mar 13 15:04:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8FC7F543CF; Tue, 13 Mar 2018 15:03:59 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67E1681BA1; Tue, 13 Mar 2018 15:03:59 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 485881B647; Tue, 13 Mar 2018 15:03:59 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2DF3xDu064991; Tue, 13 Mar 2018 15:03:59 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DF3wLJ064986; Tue, 13 Mar 2018 15:03:58 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201803131503.w2DF3wLJ064986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 13 Mar 2018 15:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330845 - in head/sys/powerpc: aim ofw powerpc X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/sys/powerpc: aim ofw powerpc X-SVN-Commit-Revision: 330845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 15:04:00 -0000 Author: nwhitehorn Date: Tue Mar 13 15:03:58 2018 New Revision: 330845 URL: https://svnweb.freebsd.org/changeset/base/330845 Log: Execute PowerPC64/AIM kernel from direct map region when possible. When the kernel can be in real mode in early boot, we can execute from high addresses aliased to the kernel's physical memory. If that high address has the first two bits set to 1 (0xc...), those addresses will automatically become part of the direct map. This reduces page table pressure from the kernel and it sets up the kernel to be used with radix translation, for which it has to be up here. This is accomplished by exploiting the fact that all PowerPC kernels are built as position-independent executables and relocate themselves on start. Before this patch, the kernel runs at 1:1 VA:PA, but that VA/PA is random and set by the bootloader. Very early, it processes its ELF relocations to operate wherever it happens to find itself. This patch uses that mechanism to re-enter and re-relocate the kernel a second time witha new base address set up in the early parts of powerpc_init(). Reviewed by: jhibbits Differential Revision: D14647 Modified: head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/locore64.S head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/ofw/ofwcall64.S head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Tue Mar 13 15:02:46 2018 (r330844) +++ head/sys/powerpc/aim/aim_machdep.c Tue Mar 13 15:03:58 2018 (r330845) @@ -160,15 +160,72 @@ extern void *dlmisstrap, *dlmisssize; extern void *dsmisstrap, *dsmisssize; extern void *ap_pcpu; +extern void __restartkernel(vm_offset_t, vm_offset_t, vm_offset_t, void *, uint32_t, register_t offset, register_t msr); +void aim_early_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, + void *mdp, uint32_t mdp_cookie); void aim_cpu_init(vm_offset_t toc); void +aim_early_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp, + uint32_t mdp_cookie) +{ + register_t scratch; + + /* + * If running from an FDT, make sure we are in real mode to avoid + * tromping on firmware page tables. Everything in the kernel assumes + * 1:1 mappings out of firmware, so this won't break anything not + * already broken. This doesn't work if there is live OF, since OF + * may internally use non-1:1 mappings. + */ + if (ofentry == 0) + mtmsr(mfmsr() & ~(PSL_IR | PSL_DR)); + +#ifdef __powerpc64__ + /* + * If in real mode, relocate to high memory so that the kernel + * can execute from the direct map. + */ + if (!(mfmsr() & PSL_DR) && + (vm_offset_t)&aim_early_init < DMAP_BASE_ADDRESS) + __restartkernel(fdt, 0, ofentry, mdp, mdp_cookie, + DMAP_BASE_ADDRESS, mfmsr()); +#endif + + /* Various very early CPU fix ups */ + switch (mfpvr() >> 16) { + /* + * PowerPC 970 CPUs have a misfeature requested by Apple that + * makes them pretend they have a 32-byte cacheline. Turn this + * off before we measure the cacheline size. + */ + case IBM970: + case IBM970FX: + case IBM970MP: + case IBM970GX: + scratch = mfspr(SPR_HID5); + scratch &= ~HID5_970_DCBZ_SIZE_HI; + mtspr(SPR_HID5, scratch); + break; + #ifdef __powerpc64__ + case IBMPOWER7: + case IBMPOWER7PLUS: + case IBMPOWER8: + case IBMPOWER8E: + /* XXX: get from ibm,slb-size in device tree */ + n_slbs = 32; + break; + #endif + } +} + +void aim_cpu_init(vm_offset_t toc) { size_t trap_offset, trapsize; vm_offset_t trap; - register_t msr, scratch; + register_t msr; uint8_t *cache_check; int cacheline_warn; #ifndef __powerpc64__ @@ -198,32 +255,6 @@ aim_cpu_init(vm_offset_t toc) * Bits 1-4, 10-15 (ppc32), 33-36, 42-47 (ppc64) */ psl_userstatic &= ~0x783f0000UL; - - /* Various very early CPU fix ups */ - switch (mfpvr() >> 16) { - /* - * PowerPC 970 CPUs have a misfeature requested by Apple that - * makes them pretend they have a 32-byte cacheline. Turn this - * off before we measure the cacheline size. - */ - case IBM970: - case IBM970FX: - case IBM970MP: - case IBM970GX: - scratch = mfspr(SPR_HID5); - scratch &= ~HID5_970_DCBZ_SIZE_HI; - mtspr(SPR_HID5, scratch); - break; - #ifdef __powerpc64__ - case IBMPOWER7: - case IBMPOWER7PLUS: - case IBMPOWER8: - case IBMPOWER8E: - /* XXX: get from ibm,slb-size in device tree */ - n_slbs = 32; - break; - #endif - } /* * Initialize the interrupt tables and figure out our cache line Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Tue Mar 13 15:02:46 2018 (r330844) +++ head/sys/powerpc/aim/locore64.S Tue Mar 13 15:03:58 2018 (r330845) @@ -105,7 +105,6 @@ ap_kexec_start: /* At 0x60 past start, copied to 0x60 mtsrr1 %r1 ba EXC_RST - /* * Now start the real text section */ @@ -149,9 +148,12 @@ ASENTRY_NOPROF(__start) subf %r31,%r31,%r2 /* Subtract from real TOC base to get base */ /* Set up the stack pointer */ - ld %r1,TOC_REF(tmpstk)(%r2) - addi %r1,%r1,TMPSTKSZ-96 - add %r1,%r1,%r31 + bl 1f + .llong tmpstk + TMPSTKSZ - 96 - . +1: mflr %r30 + ld %r1,0(%r30) + add %r1,%r1,%r30 + nop /* Relocate kernel */ std %r3,48(%r1) @@ -188,5 +190,21 @@ ASENTRY_NOPROF(__start) /* Unreachable */ b . + +ASENTRY_NOPROF(__restartkernel) + /* + * r3-r7: arguments to go to __start + * r8: offset from current kernel address to apply + * r9: MSR to set when (atomically) jumping to __start + r8 + */ + mtsrr1 %r9 + bl 1f +1: mflr %r25 + add %r25,%r8,%r25 + addi %r25,%r25,2f-1b + mtsrr0 %r25 + rfid +2: bl __start + nop #include Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Tue Mar 13 15:02:46 2018 (r330844) +++ head/sys/powerpc/aim/mmu_oea64.c Tue Mar 13 15:03:58 2018 (r330845) @@ -701,6 +701,7 @@ moea64_early_bootstrap(mmu_t mmup, vm_offset_t kernels { int i, j; vm_size_t physsz, hwphyssz; + vm_paddr_t kernelphysstart, kernelphysend; #ifndef __powerpc64__ /* We don't have a direct map since there is no BAT */ @@ -727,6 +728,9 @@ moea64_early_bootstrap(mmu_t mmup, vm_offset_t kernels __syncicache((void *)EXC_ISE, 0x80); #endif + kernelphysstart = kernelstart & ~DMAP_BASE_ADDRESS; + kernelphysend = kernelend & ~DMAP_BASE_ADDRESS; + /* Get physical memory regions from firmware */ mem_regions(&pregions, &pregions_sz, ®ions, ®ions_sz); CTR0(KTR_PMAP, "moea64_bootstrap: physical memory"); @@ -764,29 +768,30 @@ moea64_early_bootstrap(mmu_t mmup, vm_offset_t kernels if (phys_avail[j] < EXC_LAST) phys_avail[j] += EXC_LAST; - if (kernelstart >= phys_avail[j] && - kernelstart < phys_avail[j+1]) { - if (kernelend < phys_avail[j+1]) { + if (kernelphysstart >= phys_avail[j] && + kernelphysstart < phys_avail[j+1]) { + if (kernelphysend < phys_avail[j+1]) { phys_avail[2*phys_avail_count] = - (kernelend & ~PAGE_MASK) + PAGE_SIZE; + (kernelphysend & ~PAGE_MASK) + PAGE_SIZE; phys_avail[2*phys_avail_count + 1] = phys_avail[j+1]; phys_avail_count++; } - phys_avail[j+1] = kernelstart & ~PAGE_MASK; + phys_avail[j+1] = kernelphysstart & ~PAGE_MASK; } - if (kernelend >= phys_avail[j] && - kernelend < phys_avail[j+1]) { - if (kernelstart > phys_avail[j]) { + if (kernelphysend >= phys_avail[j] && + kernelphysend < phys_avail[j+1]) { + if (kernelphysstart > phys_avail[j]) { phys_avail[2*phys_avail_count] = phys_avail[j]; phys_avail[2*phys_avail_count + 1] = - kernelstart & ~PAGE_MASK; + kernelphysstart & ~PAGE_MASK; phys_avail_count++; } - phys_avail[j] = (kernelend & ~PAGE_MASK) + PAGE_SIZE; + phys_avail[j] = (kernelphysend & ~PAGE_MASK) + + PAGE_SIZE; } } Modified: head/sys/powerpc/ofw/ofwcall64.S ============================================================================== --- head/sys/powerpc/ofw/ofwcall64.S Tue Mar 13 15:02:46 2018 (r330844) +++ head/sys/powerpc/ofw/ofwcall64.S Tue Mar 13 15:03:58 2018 (r330845) @@ -42,7 +42,7 @@ ofwstk: .space OFWSTKSZ rtas_regsave: - .space 24 /* 3 * sizeof(register_t) */ + .space 32 /* 4 * sizeof(register_t) */ GLOBAL(ofmsr) .llong 0, 0, 0, 0, 0 /* msr/sprg0-3 used in Open Firmware */ GLOBAL(rtasmsr) @@ -64,8 +64,8 @@ TOC_ENTRY(rtas_regsave) */ ASENTRY_NOPROF(ofwcall) - mflr %r0 - std %r0,16(%r1) + mflr %r8 + std %r8,16(%r1) stdu %r1,-208(%r1) /* @@ -106,7 +106,7 @@ ASENTRY_NOPROF(ofwcall) /* Get OF stack pointer */ ld %r7,TOC_REF(ofwstk)(%r2) - addi %r7,%r7,OFWSTKSZ-32 + addi %r7,%r7,OFWSTKSZ-40 /* * Set the MSR to the OF value. This has the side effect of disabling @@ -129,6 +129,8 @@ ASENTRY_NOPROF(ofwcall) std %r5,8(%r1) /* Save real stack pointer */ std %r2,16(%r1) /* Save old TOC */ std %r6,24(%r1) /* Save old MSR */ + std %r8,32(%r1) /* Save high 32-bits of the kernel's PC */ + li %r5,0 stw %r5,4(%r1) stw %r5,0(%r1) @@ -137,15 +139,23 @@ ASENTRY_NOPROF(ofwcall) mtctr %r4 bctrl - /* Reload stack pointer and MSR from the OFW stack */ + /* Reload stack pointer, MSR, and reference PC from the OFW stack */ + ld %r7,32(%r1) ld %r6,24(%r1) ld %r2,16(%r1) ld %r1,8(%r1) - /* Now set the real MSR */ - mtmsrd %r6 - isync + /* Get back to the MSR/PC we want, using the cached high bits of PC */ + mtsrr1 %r6 + clrrdi %r7,%r7,32 + bl 1f +1: mflr %r8 + or %r8,%r8,%r7 + addi %r8,%r8,2f-1b + mtsrr0 %r8 + rfid /* Turn on MMU, exceptions, and 64-bit mode */ +2: /* Sign-extend the return value from OF */ extsw %r3,%r3 @@ -186,8 +196,8 @@ ASENTRY_NOPROF(ofwcall) */ ASENTRY_NOPROF(rtascall) - mflr %r0 - std %r0,16(%r1) + mflr %r9 + std %r9,16(%r1) stdu %r1,-208(%r1) /* @@ -248,24 +258,41 @@ ASENTRY_NOPROF(rtascall) std %r7,0(%r1) /* Save 64-bit stack pointer */ std %r2,8(%r1) /* Save TOC */ std %r6,16(%r1) /* Save MSR */ + std %r9,24(%r1) /* Save reference PC for high 32 bits */ /* Finally, branch to RTAS */ mtctr %r5 bctrl /* - * Reload stack pointer and MSR from the reg save area in r1. We are - * running in 32-bit mode at this point, so it doesn't matter if r1 + * Reload stack pointer, MSR, reg PC from the reg save area in r1. We + * are running in 32-bit mode at this point, so it doesn't matter if r1 * has become sign-extended. */ + ld %r7,24(%r1) ld %r6,16(%r1) ld %r2,8(%r1) ld %r1,0(%r1) - /* Now set the real MSR */ - mtmsrd %r6 - isync + /* + * Get back to the right PC. We need to atomically re-enable + * exceptions, 64-bit mode, and the MMU. One thing that has likely + * happened is that, if we were running in the high-memory direct + * map, we no longer are as a result of LR truncation in RTAS. + * Fix this by copying the high-order bits of the LR at function + * entry onto the current PC and then jumping there while flipping + * all the MSR bits. + */ + mtsrr1 %r6 + clrrdi %r7,%r7,32 + bl 1f +1: mflr %r8 + or %r8,%r8,%r7 + addi %r8,%r8,2f-1b + mtsrr0 %r8 + rfid /* Turn on MMU, exceptions, and 64-bit mode */ +2: /* Sign-extend the return value from RTAS */ extsw %r3,%r3 Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Tue Mar 13 15:02:46 2018 (r330844) +++ head/sys/powerpc/powerpc/machdep.c Tue Mar 13 15:03:58 2018 (r330845) @@ -237,6 +237,8 @@ extern unsigned char __sbss_start[]; extern unsigned char __sbss_end[]; extern unsigned char _end[]; +void aim_early_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, + void *mdp, uint32_t mdp_cookie); void aim_cpu_init(vm_offset_t toc); void booke_cpu_init(void); @@ -247,7 +249,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs struct pcpu *pc; struct cpuref bsp; vm_offset_t startkernel, endkernel; - void *kmdp; char *env; bool ofw_bootargs = false; #ifdef DDB @@ -255,8 +256,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs vm_offset_t ksym_end; #endif - kmdp = NULL; - /* First guess at start/end kernel positions */ startkernel = __startkernel; endkernel = __endkernel; @@ -278,15 +277,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs #endif #ifdef AIM - /* - * If running from an FDT, make sure we are in real mode to avoid - * tromping on firmware page tables. Everything in the kernel assumes - * 1:1 mappings out of firmware, so this won't break anything not - * already broken. This doesn't work if there is live OF, since OF - * may internally use non-1:1 mappings. - */ - if (ofentry == 0) - mtmsr(mfmsr() & ~(PSL_IR | PSL_DR)); + aim_early_init(fdt, toc, ofentry, mdp, mdp_cookie); #endif /* @@ -295,14 +286,33 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs * boothowto. */ if (mdp != NULL) { + void *kmdp = NULL; + char *envp = NULL; + uintptr_t md_offset = 0; + vm_paddr_t kernelendphys; + +#ifdef AIM + if ((uintptr_t)&powerpc_init > DMAP_BASE_ADDRESS) + md_offset = DMAP_BASE_ADDRESS; +#endif + preload_metadata = mdp; + if (md_offset > 0) { + preload_metadata += md_offset; + preload_bootstrap_relocate(md_offset); + } kmdp = preload_search_by_type("elf kernel"); if (kmdp != NULL) { boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); - init_static_kenv(MD_FETCH(kmdp, MODINFOMD_ENVP, char *), - 0); - endkernel = ulmax(endkernel, MD_FETCH(kmdp, - MODINFOMD_KERNEND, vm_offset_t)); + envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); + if (envp != NULL) + envp += md_offset; + init_static_kenv(envp, 0); + kernelendphys = MD_FETCH(kmdp, MODINFOMD_KERNEND, + vm_offset_t); + if (kernelendphys != 0) + kernelendphys += md_offset; + endkernel = ulmax(endkernel, kernelendphys); #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); From owner-svn-src-head@freebsd.org Tue Mar 13 15:29:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB147F55DCA; Tue, 13 Mar 2018 15:29:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90631830E5; Tue, 13 Mar 2018 15:29:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 869221B994; Tue, 13 Mar 2018 15:29:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2DFTDLh075107; Tue, 13 Mar 2018 15:29:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DFTD7b075106; Tue, 13 Mar 2018 15:29:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201803131529.w2DFTD7b075106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 13 Mar 2018 15:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330846 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 330846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 15:29:14 -0000 Author: mav Date: Tue Mar 13 15:29:13 2018 New Revision: 330846 URL: https://svnweb.freebsd.org/changeset/base/330846 Log: Add some argument checks to be more user-friendly. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sbin/nvmecontrol/format.c Modified: head/sbin/nvmecontrol/format.c ============================================================================== --- head/sbin/nvmecontrol/format.c Tue Mar 13 15:03:58 2018 (r330845) +++ head/sbin/nvmecontrol/format.c Tue Mar 13 15:29:13 2018 (r330846) @@ -81,9 +81,13 @@ format(int argc, char *argv[]) pil = strtol(optarg, NULL, 0); break; case 'E': + if (ses == 2) + errx(1, "-E and -C are mutually exclusive"); ses = 1; break; case 'C': + if (ses == 1) + errx(1, "-E and -C are mutually exclusive"); ses = 2; break; default: @@ -109,19 +113,7 @@ format(int argc, char *argv[]) */ if (strstr(target, NVME_NS_PREFIX) == NULL) { nsid = NVME_GLOBAL_NAMESPACE_TAG; - - /* We have no previous parameters, so use defaults. */ - if (lbaf < 0) - lbaf = 0; - if (mset < 0) - mset = 0; - if (pi < 0) - pi = 0; - if (pil < 0) - pil = 0; } else { - parse_ns_str(target, path, &nsid); - /* * We send FORMAT commands to the controller, not the namespace, * since it is an admin cmd. The namespace ID will be specified @@ -129,25 +121,34 @@ format(int argc, char *argv[]) * string to get the controller substring and namespace ID. */ close(fd); + parse_ns_str(target, path, &nsid); open_dev(path, &fd, 1, 1); + } - /* Check that controller can execute this command. */ - read_controller_data(fd, &cd); - if (((cd.fna >> NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT) - & NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK) && ses == 0) { - fprintf(stderr, "H/w doesn't support per-NS format\n"); - exit(1); - } else if (((cd.fna >> NVME_CTRLR_DATA_FNA_ERASE_ALL_SHIFT) - & NVME_CTRLR_DATA_FNA_ERASE_ALL_MASK) && ses != 0) { - fprintf(stderr, "H/w doesn't support per-NS erase\n"); - exit(1); - } + /* Check that controller can execute this command. */ + read_controller_data(fd, &cd); + if (((cd.oacs >> NVME_CTRLR_DATA_OACS_FORMAT_SHIFT) & + NVME_CTRLR_DATA_OACS_FORMAT_MASK) == 0) + errx(1, "controller does not support format"); + if (((cd.fna >> NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_SHIFT) & + NVME_CTRLR_DATA_FNA_CRYPTO_ERASE_MASK) == 0 && ses == 2) + errx(1, "controller does not support cryptographic erase"); + if (nsid != NVME_GLOBAL_NAMESPACE_TAG) { + if (((cd.fna >> NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT) & + NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK) && ses == 0) + errx(1, "controller does not support per-NS format"); + if (((cd.fna >> NVME_CTRLR_DATA_FNA_ERASE_ALL_SHIFT) & + NVME_CTRLR_DATA_FNA_ERASE_ALL_MASK) && ses != 0) + errx(1, "controller does not support per-NS erase"); + /* Try to keep previous namespace parameters. */ read_namespace_data(fd, nsid, &nsd); if (lbaf < 0) lbaf = (nsd.flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) & NVME_NS_DATA_FLBAS_FORMAT_MASK; + if (lbaf > nsd.nlbaf) + errx(1, "LBA format is out of range"); if (mset < 0) mset = (nsd.flbas >> NVME_NS_DATA_FLBAS_EXTENDED_SHIFT) & NVME_NS_DATA_FLBAS_EXTENDED_MASK; @@ -157,6 +158,17 @@ format(int argc, char *argv[]) if (pil < 0) pil = (nsd.dps >> NVME_NS_DATA_DPS_PIT_SHIFT) & NVME_NS_DATA_DPS_PIT_MASK; + } else { + + /* We have no previous parameters, so default to zeroes. */ + if (lbaf < 0) + lbaf = 0; + if (mset < 0) + mset = 0; + if (pi < 0) + pi = 0; + if (pil < 0) + pil = 0; } memset(&pt, 0, sizeof(pt)); From owner-svn-src-head@freebsd.org Tue Mar 13 16:33:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A293F2FBCE; Tue, 13 Mar 2018 16:33:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31ABC87641; Tue, 13 Mar 2018 16:33:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13DD91C46B; Tue, 13 Mar 2018 16:33:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2DGX4YZ010481; Tue, 13 Mar 2018 16:33:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DGX0Ro010446; Tue, 13 Mar 2018 16:33:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803131633.w2DGX0Ro010446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 13 Mar 2018 16:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330864 - in head/stand: common efi/boot1 efi/loader/arch/arm ficl/aarch64 ficl/amd64 ficl/arm ficl/i386 ficl/mips ficl/mips64 ficl/powerpc ficl/riscv ficl/sparc64 i386/btx/lib i386/lib... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: common efi/boot1 efi/loader/arch/arm ficl/aarch64 ficl/amd64 ficl/arm ficl/i386 ficl/mips ficl/mips64 ficl/powerpc ficl/riscv ficl/sparc64 i386/btx/lib i386/libi386 i386/loader libsa of... X-SVN-Commit-Revision: 330864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 16:33:05 -0000 Author: imp Date: Tue Mar 13 16:33:00 2018 New Revision: 330864 URL: https://svnweb.freebsd.org/changeset/base/330864 Log: Prefer uintXX_t to u_intXX_t A foolish consistency is the hobgoblin of little minds, adored by little statesmen and philosophers and divines. With consistency a great soul has simply nothing to do. -- Ralph Waldo Emerson Modified: head/stand/common/bootstrap.h head/stand/common/isapnp.c head/stand/common/load_elf.c head/stand/common/load_elf_obj.c head/stand/common/metadata.c head/stand/common/misc.c head/stand/common/pnp.c head/stand/efi/boot1/ufs_module.c head/stand/efi/loader/arch/arm/exec.c head/stand/ficl/aarch64/sysdep.c head/stand/ficl/amd64/sysdep.c head/stand/ficl/arm/sysdep.c head/stand/ficl/i386/sysdep.c head/stand/ficl/mips/sysdep.c head/stand/ficl/mips64/sysdep.c head/stand/ficl/powerpc/sysdep.c head/stand/ficl/riscv/sysdep.c head/stand/ficl/sparc64/sysdep.c head/stand/i386/btx/lib/btxv86.h head/stand/i386/libi386/biosacpi.c head/stand/i386/libi386/biosdisk.c head/stand/i386/libi386/biospnp.c head/stand/i386/libi386/bootinfo32.c head/stand/i386/libi386/bootinfo64.c head/stand/i386/libi386/elf64_freebsd.c head/stand/i386/libi386/multiboot.c head/stand/i386/libi386/pxe.c head/stand/i386/loader/main.c head/stand/libsa/arp.c head/stand/libsa/bootp.c head/stand/libsa/bootparam.c head/stand/libsa/dosfs.h head/stand/libsa/ext2fs.c head/stand/libsa/net.h head/stand/libsa/rpc.c head/stand/ofw/libofw/openfirm.c head/stand/powerpc/boot1.chrp/boot1.c head/stand/powerpc/kboot/ppc64_elf_freebsd.c head/stand/powerpc/ofw/elf_freebsd.c head/stand/powerpc/ofw/main.c head/stand/powerpc/ofw/ppc64_elf_freebsd.c head/stand/sparc64/boot1/boot1.c head/stand/sparc64/loader/main.c head/stand/uboot/lib/elf_freebsd.c head/stand/userboot/userboot/bootinfo32.c head/stand/userboot/userboot/bootinfo64.c head/stand/userboot/userboot/elf64_freebsd.c Modified: head/stand/common/bootstrap.h ============================================================================== --- head/stand/common/bootstrap.h Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/common/bootstrap.h Tue Mar 13 16:33:00 2018 (r330864) @@ -150,7 +150,7 @@ void pnp_addident(struct pnpinfo *pi, char *ident); struct pnpinfo *pnp_allocinfo(void); void pnp_freeinfo(struct pnpinfo *pi); void pnp_addinfo(struct pnpinfo *pi); -char *pnp_eisaformat(u_int8_t *data); +char *pnp_eisaformat(uint8_t *data); /* * < 0 - No ISA in system @@ -168,7 +168,7 @@ extern int isapnp_readport; struct file_metadata { size_t md_size; - u_int16_t md_type; + uint16_t md_type; struct file_metadata *md_next; char md_data[1]; /* data are immediately appended */ }; @@ -210,7 +210,7 @@ struct preloaded_file struct file_format { /* Load function must return EFTYPE if it can't handle the module supplied */ - int (* l_load)(char *filename, u_int64_t dest, struct preloaded_file **result); + int (* l_load)(char *filename, uint64_t dest, struct preloaded_file **result); /* Only a loader that will load a kernel (first module) should have an exec handler */ int (* l_exec)(struct preloaded_file *mp); }; @@ -239,20 +239,20 @@ void file_removemetadata(struct preloaded_file *fp); #define ELF_RELOC_RELA 2 /* Relocation offset for some architectures */ -extern u_int64_t __elfN(relocation_offset); +extern uint64_t __elfN(relocation_offset); struct elf_file; typedef Elf_Addr (symaddr_fn)(struct elf_file *ef, Elf_Size symidx); -int __elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result); -int __elfN(obj_loadfile)(char *filename, u_int64_t dest, +int __elfN(loadfile)(char *filename, uint64_t dest, struct preloaded_file **result); +int __elfN(obj_loadfile)(char *filename, uint64_t dest, struct preloaded_file **result); int __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr, const void *reldata, int reltype, Elf_Addr relbase, Elf_Addr dataaddr, void *data, size_t len); -int __elfN(loadfile_raw)(char *filename, u_int64_t dest, +int __elfN(loadfile_raw)(char *filename, uint64_t dest, struct preloaded_file **result, int multiboot); -int __elfN(load_modmetadata)(struct preloaded_file *fp, u_int64_t dest); +int __elfN(load_modmetadata)(struct preloaded_file *fp, uint64_t dest); #endif /* Modified: head/stand/common/isapnp.c ============================================================================== --- head/stand/common/isapnp.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/common/isapnp.c Tue Mar 13 16:33:00 2018 (r330864) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); static void isapnp_write(int d, int r); static void isapnp_send_Initiation_LFSR(void); -static int isapnp_get_serial(u_int8_t *p); +static int isapnp_get_serial(uint8_t *p); static int isapnp_isolation_protocol(void); static void isapnp_enumerate(void); @@ -90,7 +90,7 @@ isapnp_send_Initiation_LFSR(void) * Get the device's serial number. Returns 1 if the serial is valid. */ static int -isapnp_get_serial(u_int8_t *data) +isapnp_get_serial(uint8_t *data) { int i, bit, valid = 0, sum = 0x6a; @@ -123,7 +123,7 @@ isapnp_get_serial(u_int8_t *data) * Returns nonzero if the device fails to report */ static int -isapnp_get_resource_info(u_int8_t *buffer, int len) +isapnp_get_resource_info(uint8_t *buffer, int len) { int i, j; u_char temp; @@ -229,7 +229,7 @@ isapnp_isolation_protocol(void) { int csn; struct pnpinfo *pi; - u_int8_t cardid[_PNP_ID_LEN]; + uint8_t cardid[_PNP_ID_LEN]; int ndevs; isapnp_send_Initiation_LFSR(); Modified: head/stand/common/load_elf.c ============================================================================== --- head/stand/common/load_elf.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/common/load_elf.c Tue Mar 13 16:33:00 2018 (r330864) @@ -70,11 +70,11 @@ typedef struct elf_file { caddr_t firstpage; size_t firstlen; int kernel; - u_int64_t off; + uint64_t off; } *elf_file_t; static int __elfN(loadimage)(struct preloaded_file *mp, elf_file_t ef, - u_int64_t loadaddr); + uint64_t loadaddr); static int __elfN(lookup_symbol)(struct preloaded_file *mp, elf_file_t ef, const char* name, Elf_Sym* sym); static int __elfN(reloc_ptr)(struct preloaded_file *mp, elf_file_t ef, @@ -87,7 +87,7 @@ static char *fake_modname(const char *name); const char *__elfN(kerneltype) = "elf kernel"; const char *__elfN(moduletype) = "elf module"; -u_int64_t __elfN(relocation_offset) = 0; +uint64_t __elfN(relocation_offset) = 0; extern void elf_wrong_field_size(void); #define CONVERT_FIELD(b, f, e) \ @@ -265,13 +265,13 @@ error: * will be saved in (result). */ int -__elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result) +__elfN(loadfile)(char *filename, uint64_t dest, struct preloaded_file **result) { return (__elfN(loadfile_raw)(filename, dest, result, 0)); } int -__elfN(loadfile_raw)(char *filename, u_int64_t dest, +__elfN(loadfile_raw)(char *filename, uint64_t dest, struct preloaded_file **result, int multiboot) { struct preloaded_file *fp, *kfp; @@ -419,7 +419,7 @@ out: * the Elf header, load the image at (off) */ static int -__elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off) +__elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, uint64_t off) { int i; u_int j; @@ -883,21 +883,21 @@ fake_modname(const char *name) struct mod_metadata64 { int md_version; /* structure version MDTV_* */ int md_type; /* type of entry MDT_* */ - u_int64_t md_data; /* specific data */ - u_int64_t md_cval; /* common string label */ + uint64_t md_data; /* specific data */ + uint64_t md_cval; /* common string label */ }; #endif #if defined(__amd64__) && __ELF_WORD_SIZE == 32 struct mod_metadata32 { int md_version; /* structure version MDTV_* */ int md_type; /* type of entry MDT_* */ - u_int32_t md_data; /* specific data */ - u_int32_t md_cval; /* common string label */ + uint32_t md_data; /* specific data */ + uint32_t md_cval; /* common string label */ }; #endif int -__elfN(load_modmetadata)(struct preloaded_file *fp, u_int64_t dest) +__elfN(load_modmetadata)(struct preloaded_file *fp, uint64_t dest) { struct elf_file ef; int err, i, j; Modified: head/stand/common/load_elf_obj.c ============================================================================== --- head/stand/common/load_elf_obj.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/common/load_elf_obj.c Tue Mar 13 16:33:00 2018 (r330864) @@ -63,7 +63,7 @@ typedef struct elf_file { } *elf_file_t; static int __elfN(obj_loadimage)(struct preloaded_file *mp, elf_file_t ef, - u_int64_t loadaddr); + uint64_t loadaddr); static int __elfN(obj_lookup_set)(struct preloaded_file *mp, elf_file_t ef, const char *name, Elf_Addr *startp, Elf_Addr *stopp, int *countp); static int __elfN(obj_reloc_ptr)(struct preloaded_file *mp, elf_file_t ef, @@ -81,7 +81,7 @@ const char *__elfN(obj_moduletype) = "elf obj module"; * will be saved in (result). */ int -__elfN(obj_loadfile)(char *filename, u_int64_t dest, +__elfN(obj_loadfile)(char *filename, uint64_t dest, struct preloaded_file **result) { struct preloaded_file *fp, *kfp; @@ -186,7 +186,7 @@ out: * the Elf header, load the image at (off) */ static int -__elfN(obj_loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off) +__elfN(obj_loadimage)(struct preloaded_file *fp, elf_file_t ef, uint64_t off) { Elf_Ehdr *hdr; Elf_Shdr *shdr, *cshdr, *lshdr; @@ -349,8 +349,8 @@ out: struct mod_metadata64 { int md_version; /* structure version MDTV_* */ int md_type; /* type of entry MDT_* */ - u_int64_t md_data; /* specific data */ - u_int64_t md_cval; /* common string label */ + uint64_t md_data; /* specific data */ + uint64_t md_cval; /* common string label */ }; #endif Modified: head/stand/common/metadata.c ============================================================================== --- head/stand/common/metadata.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/common/metadata.c Tue Mar 13 16:33:00 2018 (r330864) @@ -217,7 +217,7 @@ md_copyenv(vm_offset_t addr) static int align; #define COPY32(v, a, c) { \ - u_int32_t x = (v); \ + uint32_t x = (v); \ if (c) \ archsw.arch_copyin(&x, a, sizeof(x)); \ a += sizeof(x); \ Modified: head/stand/common/misc.c ============================================================================== --- head/stand/common/misc.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/common/misc.c Tue Mar 13 16:33:00 2018 (r330864) @@ -185,7 +185,7 @@ hexdump(caddr_t region, size_t len) for (x = 0; x < 16; x++) { if ((line + x) < (region + len)) { - emit("%02x ", *(u_int8_t *)(line + x)); + emit("%02x ", *(uint8_t *)(line + x)); } else { emit("-- "); } @@ -195,7 +195,7 @@ hexdump(caddr_t region, size_t len) emit(" |"); for (x = 0; x < 16; x++) { if ((line + x) < (region + len)) { - c = *(u_int8_t *)(line + x); + c = *(uint8_t *)(line + x); if ((c < ' ') || (c > '~')) /* !isprint(c) */ c = '.'; emit("%c", c); Modified: head/stand/common/pnp.c ============================================================================== --- head/stand/common/pnp.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/common/pnp.c Tue Mar 13 16:33:00 2018 (r330864) @@ -169,7 +169,7 @@ pnp_addinfo(struct pnpinfo *pi) * where 'AAA' is the EISA vendor ID, II is the product ID and RR the revision ID. */ char * -pnp_eisaformat(u_int8_t *data) +pnp_eisaformat(uint8_t *data) { static char idbuf[8]; const char hextoascii[] = "0123456789abcdef"; Modified: head/stand/efi/boot1/ufs_module.c ============================================================================== --- head/stand/efi/boot1/ufs_module.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/efi/boot1/ufs_module.c Tue Mar 13 16:33:00 2018 (r330864) @@ -44,7 +44,7 @@ static dev_info_t *devinfo; static dev_info_t *devices; static int -dskread(void *buf, u_int64_t lba, int nblk) +dskread(void *buf, uint64_t lba, int nblk) { int size; EFI_STATUS status; Modified: head/stand/efi/loader/arch/arm/exec.c ============================================================================== --- head/stand/efi/loader/arch/arm/exec.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/efi/loader/arch/arm/exec.c Tue Mar 13 16:33:00 2018 (r330864) @@ -47,7 +47,7 @@ extern vm_offset_t md_load(char *, vm_offset_t *); extern int bi_load(char *, vm_offset_t *, vm_offset_t *); static int -__elfN(arm_load)(char *filename, u_int64_t dest, +__elfN(arm_load)(char *filename, uint64_t dest, struct preloaded_file **result) { int r; Modified: head/stand/ficl/aarch64/sysdep.c ============================================================================== --- head/stand/ficl/aarch64/sysdep.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/ficl/aarch64/sysdep.c Tue Mar 13 16:33:00 2018 (r330864) @@ -25,12 +25,12 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) { DPUNS q; - u_int64_t qx; + uint64_t qx; - qx = (u_int64_t)x * (u_int64_t) y; + qx = (uint64_t)x * (uint64_t) y; - q.hi = (u_int32_t)( qx >> 32 ); - q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + q.hi = (uint32_t)( qx >> 32 ); + q.lo = (uint32_t)( qx & 0xFFFFFFFFL); return q; } @@ -38,7 +38,7 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) { UNSQR result; - u_int64_t qx, qh; + uint64_t qx, qh; qh = q.hi; qx = (qh << 32) | q.lo; Modified: head/stand/ficl/amd64/sysdep.c ============================================================================== --- head/stand/ficl/amd64/sysdep.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/ficl/amd64/sysdep.c Tue Mar 13 16:33:00 2018 (r330864) @@ -25,12 +25,12 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) { DPUNS q; - u_int64_t qx; + uint64_t qx; - qx = (u_int64_t)x * (u_int64_t) y; + qx = (uint64_t)x * (uint64_t) y; - q.hi = (u_int32_t)( qx >> 32 ); - q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + q.hi = (uint32_t)( qx >> 32 ); + q.lo = (uint32_t)( qx & 0xFFFFFFFFL); return q; } @@ -38,7 +38,7 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) { UNSQR result; - u_int64_t qx, qh; + uint64_t qx, qh; qh = q.hi; qx = (qh << 32) | q.lo; Modified: head/stand/ficl/arm/sysdep.c ============================================================================== --- head/stand/ficl/arm/sysdep.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/ficl/arm/sysdep.c Tue Mar 13 16:33:00 2018 (r330864) @@ -25,12 +25,12 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) { DPUNS q; - u_int64_t qx; + uint64_t qx; - qx = (u_int64_t)x * (u_int64_t) y; + qx = (uint64_t)x * (uint64_t) y; - q.hi = (u_int32_t)( qx >> 32 ); - q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + q.hi = (uint32_t)( qx >> 32 ); + q.lo = (uint32_t)( qx & 0xFFFFFFFFL); return q; } @@ -38,7 +38,7 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) { UNSQR result; - u_int64_t qx, qh; + uint64_t qx, qh; qh = q.hi; qx = (qh << 32) | q.lo; Modified: head/stand/ficl/i386/sysdep.c ============================================================================== --- head/stand/ficl/i386/sysdep.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/ficl/i386/sysdep.c Tue Mar 13 16:33:00 2018 (r330864) @@ -28,12 +28,12 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) { DPUNS q; - u_int64_t qx; + uint64_t qx; - qx = (u_int64_t)x * (u_int64_t) y; + qx = (uint64_t)x * (uint64_t) y; - q.hi = (u_int32_t)( qx >> 32 ); - q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + q.hi = (uint32_t)( qx >> 32 ); + q.lo = (uint32_t)( qx & 0xFFFFFFFFL); return q; } @@ -41,7 +41,7 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) { UNSQR result; - u_int64_t qx, qh; + uint64_t qx, qh; qh = q.hi; qx = (qh << 32) | q.lo; @@ -89,7 +89,7 @@ void ficlOutb(FICL_VM *pVM) { u_char c; - u_int32_t port; + uint32_t port; port=stackPopUNS(pVM->pStack); c=(u_char)stackPopINT(pVM->pStack); @@ -104,7 +104,7 @@ void ficlInb(FICL_VM *pVM) { u_char c; - u_int32_t port; + uint32_t port; port=stackPopUNS(pVM->pStack); c=inb(port); Modified: head/stand/ficl/mips/sysdep.c ============================================================================== --- head/stand/ficl/mips/sysdep.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/ficl/mips/sysdep.c Tue Mar 13 16:33:00 2018 (r330864) @@ -25,12 +25,12 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) { DPUNS q; - u_int64_t qx; + uint64_t qx; - qx = (u_int64_t)x * (u_int64_t) y; + qx = (uint64_t)x * (uint64_t) y; - q.hi = (u_int32_t)( qx >> 32 ); - q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + q.hi = (uint32_t)( qx >> 32 ); + q.lo = (uint32_t)( qx & 0xFFFFFFFFL); return q; } @@ -38,7 +38,7 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) { UNSQR result; - u_int64_t qx, qh; + uint64_t qx, qh; qh = q.hi; qx = (qh << 32) | q.lo; Modified: head/stand/ficl/mips64/sysdep.c ============================================================================== --- head/stand/ficl/mips64/sysdep.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/ficl/mips64/sysdep.c Tue Mar 13 16:33:00 2018 (r330864) @@ -25,12 +25,12 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) { DPUNS q; - u_int64_t qx; + uint64_t qx; - qx = (u_int64_t)x * (u_int64_t) y; + qx = (uint64_t)x * (uint64_t) y; - q.hi = (u_int32_t)( qx >> 32 ); - q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + q.hi = (uint32_t)( qx >> 32 ); + q.lo = (uint32_t)( qx & 0xFFFFFFFFL); return q; } @@ -38,7 +38,7 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) { UNSQR result; - u_int64_t qx, qh; + uint64_t qx, qh; qh = q.hi; qx = (qh << 32) | q.lo; Modified: head/stand/ficl/powerpc/sysdep.c ============================================================================== --- head/stand/ficl/powerpc/sysdep.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/ficl/powerpc/sysdep.c Tue Mar 13 16:33:00 2018 (r330864) @@ -25,12 +25,12 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) { DPUNS q; - u_int64_t qx; + uint64_t qx; - qx = (u_int64_t)x * (u_int64_t) y; + qx = (uint64_t)x * (uint64_t) y; - q.hi = (u_int32_t)( qx >> 32 ); - q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + q.hi = (uint32_t)( qx >> 32 ); + q.lo = (uint32_t)( qx & 0xFFFFFFFFL); return q; } @@ -38,7 +38,7 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) { UNSQR result; - u_int64_t qx, qh; + uint64_t qx, qh; qh = q.hi; qx = (qh << 32) | q.lo; Modified: head/stand/ficl/riscv/sysdep.c ============================================================================== --- head/stand/ficl/riscv/sysdep.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/ficl/riscv/sysdep.c Tue Mar 13 16:33:00 2018 (r330864) @@ -25,12 +25,12 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) { DPUNS q; - u_int64_t qx; + uint64_t qx; - qx = (u_int64_t)x * (u_int64_t) y; + qx = (uint64_t)x * (uint64_t) y; - q.hi = (u_int32_t)( qx >> 32 ); - q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + q.hi = (uint32_t)( qx >> 32 ); + q.lo = (uint32_t)( qx & 0xFFFFFFFFL); return q; } @@ -38,7 +38,7 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) { UNSQR result; - u_int64_t qx, qh; + uint64_t qx, qh; qh = q.hi; qx = (qh << 32) | q.lo; Modified: head/stand/ficl/sparc64/sysdep.c ============================================================================== --- head/stand/ficl/sparc64/sysdep.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/ficl/sparc64/sysdep.c Tue Mar 13 16:33:00 2018 (r330864) @@ -25,12 +25,12 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) { DPUNS q; - u_int64_t qx; + uint64_t qx; - qx = (u_int64_t)x * (u_int64_t) y; + qx = (uint64_t)x * (uint64_t) y; - q.hi = (u_int32_t)( qx >> 32 ); - q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + q.hi = (uint32_t)( qx >> 32 ); + q.lo = (uint32_t)( qx & 0xFFFFFFFFL); return q; } @@ -38,7 +38,7 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) { UNSQR result; - u_int64_t qx, qh; + uint64_t qx, qh; qh = q.hi; qx = (qh << 32) | q.lo; Modified: head/stand/i386/btx/lib/btxv86.h ============================================================================== --- head/stand/i386/btx/lib/btxv86.h Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/i386/btx/lib/btxv86.h Tue Mar 13 16:33:00 2018 (r330864) @@ -58,13 +58,13 @@ void __v86int(void); #define v86 __v86 #define v86int __v86int -extern u_int32_t __base; -extern u_int32_t __args; +extern uint32_t __base; +extern uint32_t __args; #define PTOV(pa) ((caddr_t)(pa) - __base) #define VTOP(va) ((vm_offset_t)(va) + __base) -#define VTOPSEG(va) (u_int16_t)(VTOP((caddr_t)va) >> 4) -#define VTOPOFF(va) (u_int16_t)(VTOP((caddr_t)va) & 0xf) +#define VTOPSEG(va) (uint16_t)(VTOP((caddr_t)va) >> 4) +#define VTOPOFF(va) (uint16_t)(VTOP((caddr_t)va) & 0xf) #define V86_CY(x) ((x) & PSL_C) #define V86_ZR(x) ((x) & PSL_Z) Modified: head/stand/i386/libi386/biosacpi.c ============================================================================== --- head/stand/i386/libi386/biosacpi.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/i386/libi386/biosacpi.c Tue Mar 13 16:33:00 2018 (r330864) @@ -122,7 +122,7 @@ static ACPI_TABLE_RSDP * biosacpi_search_rsdp(char *base, int length) { ACPI_TABLE_RSDP *rsdp; - u_int8_t *cp, sum; + uint8_t *cp, sum; int ofs, idx; /* search on 16-byte boundaries */ @@ -131,7 +131,7 @@ biosacpi_search_rsdp(char *base, int length) /* compare signature, validate checksum */ if (!strncmp(rsdp->Signature, ACPI_SIG_RSDP, strlen(ACPI_SIG_RSDP))) { - cp = (u_int8_t *)rsdp; + cp = (uint8_t *)rsdp; sum = 0; for (idx = 0; idx < RSDP_CHECKSUM_LENGTH; idx++) sum += *(cp + idx); Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/i386/libi386/biosdisk.c Tue Mar 13 16:33:00 2018 (r330864) @@ -916,7 +916,7 @@ bd_write(struct disk_devdesc *dev, daddr_t dblk, int b * disk. And, incidentally, what is returned is not the geometry as * such but the highest valid cylinder, head, and sector numbers. */ -u_int32_t +uint32_t bd_getbigeom(int bunit) { Modified: head/stand/i386/libi386/biospnp.c ============================================================================== --- head/stand/i386/libi386/biospnp.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/i386/libi386/biospnp.c Tue Mar 13 16:33:00 2018 (r330864) @@ -49,49 +49,49 @@ struct pnphandler biospnphandler = struct pnp_ICstructure { - u_int8_t pnp_signature[4]; - u_int8_t pnp_version; - u_int8_t pnp_length; - u_int16_t pnp_BIOScontrol; - u_int8_t pnp_checksum; - u_int32_t pnp_eventflag; - u_int16_t pnp_rmip; - u_int16_t pnp_rmcs; - u_int16_t pnp_pmip; - u_int32_t pnp_pmcs; - u_int8_t pnp_OEMdev[4]; - u_int16_t pnp_rmds; - u_int32_t pnp_pmds; + uint8_t pnp_signature[4]; + uint8_t pnp_version; + uint8_t pnp_length; + uint16_t pnp_BIOScontrol; + uint8_t pnp_checksum; + uint32_t pnp_eventflag; + uint16_t pnp_rmip; + uint16_t pnp_rmcs; + uint16_t pnp_pmip; + uint32_t pnp_pmcs; + uint8_t pnp_OEMdev[4]; + uint16_t pnp_rmds; + uint32_t pnp_pmds; } __packed; struct pnp_devNode { - u_int16_t dn_size; - u_int8_t dn_handle; - u_int8_t dn_id[4]; - u_int8_t dn_type[3]; - u_int16_t dn_attrib; - u_int8_t dn_data[1]; + uint16_t dn_size; + uint8_t dn_handle; + uint8_t dn_id[4]; + uint8_t dn_type[3]; + uint16_t dn_attrib; + uint8_t dn_data[1]; } __packed; struct pnp_isaConfiguration { - u_int8_t ic_revision; - u_int8_t ic_nCSN; - u_int16_t ic_rdport; - u_int16_t ic_reserved; + uint8_t ic_revision; + uint8_t ic_nCSN; + uint16_t ic_rdport; + uint16_t ic_reserved; } __packed; static struct pnp_ICstructure *pnp_Icheck = NULL; -static u_int16_t pnp_NumNodes; -static u_int16_t pnp_NodeSize; +static uint16_t pnp_NumNodes; +static uint16_t pnp_NodeSize; static void biospnp_scanresdata(struct pnpinfo *pi, struct pnp_devNode *dn); static int biospnp_call(int func, const char *fmt, ...); -#define vsegofs(vptr) (((u_int32_t)VTOPSEG(vptr) << 16) + VTOPOFF(vptr)) +#define vsegofs(vptr) (((uint32_t)VTOPSEG(vptr) << 16) + VTOPOFF(vptr)) -typedef void v86bios_t(u_int32_t, u_int32_t, u_int32_t, u_int32_t); +typedef void v86bios_t(uint32_t, uint32_t, uint32_t, uint32_t); v86bios_t *v86bios = (v86bios_t *)v86int; #define biospnp_f00(NumNodes, NodeSize) biospnp_call(0x00, "ll", NumNodes, NodeSize) @@ -155,7 +155,7 @@ biospnp_init(void) static void biospnp_enumerate(void) { - u_int8_t Node; + uint8_t Node; struct pnp_devNode *devNodeBuffer; int result; struct pnpinfo *pi; @@ -189,11 +189,11 @@ static void biospnp_scanresdata(struct pnpinfo *pi, struct pnp_devNode *dn) { u_int tag, i, rlen, dlen; - u_int8_t *p; + uint8_t *p; char *str; p = dn->dn_data; /* point to resource data */ - dlen = dn->dn_size - (p - (u_int8_t *)dn); /* length of resource data */ + dlen = dn->dn_size - (p - (uint8_t *)dn); /* length of resource data */ for (i = 0; i < dlen; i+= rlen) { tag = p[i]; @@ -213,8 +213,8 @@ biospnp_scanresdata(struct pnpinfo *pi, struct pnp_dev } } else { /* large resource */ - rlen = *(u_int16_t *)(p + i); - i += sizeof(u_int16_t); + rlen = *(uint16_t *)(p + i); + i += sizeof(uint16_t); switch(PNP_LRES_NUM(tag)) { @@ -249,14 +249,14 @@ biospnp_call(int func, const char *fmt, ...) { va_list ap; const char *p; - u_int8_t *argp; - u_int32_t args[4]; - u_int32_t i; + uint8_t *argp; + uint32_t args[4]; + uint32_t i; /* function number first */ - argp = (u_int8_t *)args; - *(u_int16_t *)argp = func; - argp += sizeof(u_int16_t); + argp = (uint8_t *)args; + *(uint16_t *)argp = func; + argp += sizeof(uint16_t); /* take args according to format */ va_start(ap, fmt); @@ -265,26 +265,26 @@ biospnp_call(int func, const char *fmt, ...) case 'w': i = va_arg(ap, u_int); - *(u_int16_t *)argp = i; - argp += sizeof(u_int16_t); + *(uint16_t *)argp = i; + argp += sizeof(uint16_t); break; case 'l': - i = va_arg(ap, u_int32_t); - *(u_int32_t *)argp = i; - argp += sizeof(u_int32_t); + i = va_arg(ap, uint32_t); + *(uint32_t *)argp = i; + argp += sizeof(uint32_t); break; } } va_end(ap); /* BIOS segment last */ - *(u_int16_t *)argp = pnp_Icheck->pnp_rmds; - argp += sizeof(u_int16_t); + *(uint16_t *)argp = pnp_Icheck->pnp_rmds; + argp += sizeof(uint16_t); /* prepare for call */ v86.ctl = V86_ADDR | V86_CALLF; - v86.addr = ((u_int32_t)pnp_Icheck->pnp_rmcs << 16) + pnp_Icheck->pnp_rmip; + v86.addr = ((uint32_t)pnp_Icheck->pnp_rmcs << 16) + pnp_Icheck->pnp_rmip; /* call with packed stack and return */ v86bios(args[0], args[1], args[2], args[3]); Modified: head/stand/i386/libi386/bootinfo32.c ============================================================================== --- head/stand/i386/libi386/bootinfo32.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/i386/libi386/bootinfo32.c Tue Mar 13 16:33:00 2018 (r330864) @@ -63,7 +63,7 @@ static struct bootinfo bi; * MOD_METADATA (variable) type-specific metadata */ #define COPY32(v, a, c) { \ - u_int32_t x = (v); \ + uint32_t x = (v); \ if (c) \ i386_copyin(&x, a, sizeof(x)); \ a += sizeof(x); \ Modified: head/stand/i386/libi386/bootinfo64.c ============================================================================== --- head/stand/i386/libi386/bootinfo64.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/i386/libi386/bootinfo64.c Tue Mar 13 16:33:00 2018 (r330864) @@ -64,7 +64,7 @@ static const size_t keybuf_size = sizeof(struct keybuf * MOD_METADATA (variable) type-specific metadata */ #define COPY32(v, a, c) { \ - u_int32_t x = (v); \ + uint32_t x = (v); \ if (c) \ i386_copyin(&x, a, sizeof(x)); \ a += sizeof(x); \ @@ -75,7 +75,7 @@ static const size_t keybuf_size = sizeof(struct keybuf COPY32(strlen(s) + 1, a, c); \ if (c) \ i386_copyin(s, a, strlen(s) + 1); \ - a += roundup(strlen(s) + 1, sizeof(u_int64_t));\ + a += roundup(strlen(s) + 1, sizeof(uint64_t));\ } #define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) @@ -87,7 +87,7 @@ static const size_t keybuf_size = sizeof(struct keybuf COPY32(sizeof(s), a, c); \ if (c) \ i386_copyin(&s, a, sizeof(s)); \ - a += roundup(sizeof(s), sizeof(u_int64_t)); \ + a += roundup(sizeof(s), sizeof(uint64_t)); \ } #define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) @@ -98,7 +98,7 @@ static const size_t keybuf_size = sizeof(struct keybuf COPY32(mm->md_size, a, c); \ if (c) \ i386_copyin(mm->md_data, a, mm->md_size); \ - a += roundup(mm->md_size, sizeof(u_int64_t));\ + a += roundup(mm->md_size, sizeof(uint64_t));\ } #define MOD_END(a, c) { \ @@ -112,7 +112,7 @@ bi_copymodules64(vm_offset_t addr) struct preloaded_file *fp; struct file_metadata *md; int c; - u_int64_t v; + uint64_t v; c = addr != 0; /* start with the first module on the list, should be the kernel */ @@ -190,9 +190,9 @@ bi_load64(char *args, vm_offset_t addr, vm_offset_t *m struct preloaded_file *xp, *kfp; struct i386_devdesc *rootdev; struct file_metadata *md; - u_int64_t kernend; - u_int64_t envp; - u_int64_t module; + uint64_t kernend; + uint64_t envp; + uint64_t module; vm_offset_t size; char *rootdevname; int howto; Modified: head/stand/i386/libi386/elf64_freebsd.c ============================================================================== --- head/stand/i386/libi386/elf64_freebsd.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/i386/libi386/elf64_freebsd.c Tue Mar 13 16:33:00 2018 (r330864) @@ -51,15 +51,15 @@ struct file_format amd64_elf_obj = { elf64_obj_loadfil #define PG_U 0x004 #define PG_PS 0x080 -typedef u_int64_t p4_entry_t; -typedef u_int64_t p3_entry_t; -typedef u_int64_t p2_entry_t; +typedef uint64_t p4_entry_t; +typedef uint64_t p3_entry_t; +typedef uint64_t p2_entry_t; extern p4_entry_t PT4[]; extern p3_entry_t PT3[]; extern p2_entry_t PT2[]; -u_int32_t entry_hi; -u_int32_t entry_lo; +uint32_t entry_hi; +uint32_t entry_lo; extern void amd64_tramp(); Modified: head/stand/i386/libi386/multiboot.c ============================================================================== --- head/stand/i386/libi386/multiboot.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/i386/libi386/multiboot.c Tue Mar 13 16:33:00 2018 (r330864) @@ -61,16 +61,16 @@ __FBSDID("$FreeBSD$"); #define METADATA_RESV_SIZE(mod_num) \ roundup(METADATA_FIXED_SIZE + METADATA_MODULE_SIZE * mod_num, PAGE_SIZE) -extern int elf32_loadfile_raw(char *filename, u_int64_t dest, +extern int elf32_loadfile_raw(char *filename, uint64_t dest, struct preloaded_file **result, int multiboot); -extern int elf64_load_modmetadata(struct preloaded_file *fp, u_int64_t dest); -extern int elf64_obj_loadfile(char *filename, u_int64_t dest, +extern int elf64_load_modmetadata(struct preloaded_file *fp, uint64_t dest); +extern int elf64_obj_loadfile(char *filename, uint64_t dest, struct preloaded_file **result); -static int multiboot_loadfile(char *, u_int64_t, struct preloaded_file **); +static int multiboot_loadfile(char *, uint64_t, struct preloaded_file **); static int multiboot_exec(struct preloaded_file *); -static int multiboot_obj_loadfile(char *, u_int64_t, struct preloaded_file **); +static int multiboot_obj_loadfile(char *, uint64_t, struct preloaded_file **); static int multiboot_obj_exec(struct preloaded_file *fp); struct file_format multiboot = { multiboot_loadfile, multiboot_exec }; @@ -108,7 +108,7 @@ max_addr(void) } static int -multiboot_loadfile(char *filename, u_int64_t dest, +multiboot_loadfile(char *filename, uint64_t dest, struct preloaded_file **result) { uint32_t *magic; @@ -394,7 +394,7 @@ error: } static int -multiboot_obj_loadfile(char *filename, u_int64_t dest, +multiboot_obj_loadfile(char *filename, uint64_t dest, struct preloaded_file **result) { struct preloaded_file *mfp, *kfp, *rfp; Modified: head/stand/i386/libi386/pxe.c ============================================================================== --- head/stand/i386/libi386/pxe.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/i386/libi386/pxe.c Tue Mar 13 16:33:00 2018 (r330864) @@ -85,11 +85,11 @@ static ssize_t pxe_netif_put(struct iodesc *desc, void static void pxe_netif_end(struct netif *nif); extern struct netif_stats pxe_st[]; -extern u_int16_t __bangpxeseg; -extern u_int16_t __bangpxeoff; +extern uint16_t __bangpxeseg; +extern uint16_t __bangpxeoff; extern void __bangpxeentry(void); -extern u_int16_t __pxenvseg; -extern u_int16_t __pxenvoff; +extern uint16_t __pxenvseg; +extern uint16_t __pxenvoff; extern void __pxenventry(void); struct netif_dif pxe_ifs[] = { Modified: head/stand/i386/loader/main.c ============================================================================== --- head/stand/i386/loader/main.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/i386/loader/main.c Tue Mar 13 16:33:00 2018 (r330864) @@ -60,8 +60,8 @@ CTASSERT(offsetof(struct bootinfo, bi_size) == BI_SIZE /* Arguments passed in from the boot1/boot2 loader */ static struct bootargs *kargs; -static u_int32_t initial_howto; -static u_int32_t initial_bootdev; +static uint32_t initial_howto; +static uint32_t initial_bootdev; static struct bootinfo *initial_bootinfo; struct arch_switch archsw; /* MI/MD interface boundary */ Modified: head/stand/libsa/arp.c ============================================================================== --- head/stand/libsa/arp.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/libsa/arp.c Tue Mar 13 16:33:00 2018 (r330864) @@ -164,7 +164,7 @@ arprecv(struct iodesc *d, void **pkt, void **payload, { ssize_t n; struct ether_arp *ah; - u_int16_t etype; /* host order */ + uint16_t etype; /* host order */ void *ptr; #ifdef ARP_DEBUG Modified: head/stand/libsa/bootp.c ============================================================================== --- head/stand/libsa/bootp.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/libsa/bootp.c Tue Mar 13 16:33:00 2018 (r330864) @@ -190,7 +190,7 @@ bootp(int sock) #ifdef SUPPORT_DHCP if(dhcp_ok) { - u_int32_t leasetime; + uint32_t leasetime; bp->bp_vend[6] = DHCPREQUEST; bp->bp_vend[7] = TAG_REQ_ADDR; bp->bp_vend[8] = 4; Modified: head/stand/libsa/bootparam.c ============================================================================== --- head/stand/libsa/bootparam.c Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/libsa/bootparam.c Tue Mar 13 16:33:00 2018 (r330864) @@ -77,7 +77,7 @@ n_short bp_server_port; /* net order */ * (Note, really four ints, NOT chars. Blech.) */ struct xdr_inaddr { - u_int32_t atype; + uint32_t atype; int32_t addr[4]; }; @@ -108,16 +108,16 @@ bp_whoami(int sockfd) { /* RPC structures for PMAPPROC_CALLIT */ struct args { - u_int32_t prog; - u_int32_t vers; - u_int32_t proc; - u_int32_t arglen; + uint32_t prog; + uint32_t vers; + uint32_t proc; + uint32_t arglen; struct xdr_inaddr xina; } *args; struct repl { - u_int16_t _pad; - u_int16_t port; - u_int32_t encap_len; + uint16_t _pad; + uint16_t port; + uint32_t encap_len; /* encapsulated data here */ n_long capsule[64]; } *repl; Modified: head/stand/libsa/dosfs.h ============================================================================== --- head/stand/libsa/dosfs.h Tue Mar 13 16:31:54 2018 (r330863) +++ head/stand/libsa/dosfs.h Tue Mar 13 16:33:00 2018 (r330864) @@ -47,12 +47,12 @@ * Macros to convert DOS-format 16-bit and 32-bit quantities */ -#define cv2(p) ((u_int16_t)(p)[0] | \ - ((u_int16_t)(p)[1] << 010)) -#define cv4(p) ((u_int32_t)(p)[0] | \ - ((u_int32_t)(p)[1] << 010) | \ - ((u_int32_t)(p)[2] << 020) | \ - ((u_int32_t)(p)[3] << 030)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Mar 13 16:40:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FE52F30630; Tue, 13 Mar 2018 16:40:30 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2219587D0C; Tue, 13 Mar 2018 16:40:30 +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 191581C476; Tue, 13 Mar 2018 16:40:30 +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 w2DGeTRA010864; Tue, 13 Mar 2018 16:40:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DGeTiC010859; Tue, 13 Mar 2018 16:40:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803131640.w2DGeTiC010859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 13 Mar 2018 16:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330866 - in head/sys: amd64/linux amd64/linux32 i386/linux kern sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 i386/linux kern sys X-SVN-Commit-Revision: 330866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 16:40:30 -0000 Author: emaste Date: Tue Mar 13 16:40:29 2018 New Revision: 330866 URL: https://svnweb.freebsd.org/changeset/base/330866 Log: Use C99 boolean type for translate_osrel Migrate to modern types before creating MD Linuxolator bits for new architectures. Reviewed by: cem Sponsored by: Turing Robotic Industries Inc. Differential Revision: https://reviews.freebsd.org/D14676 Modified: head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/i386/linux/linux_sysvec.c head/sys/kern/imgact_elf.c head/sys/sys/imgact_elf.h Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Tue Mar 13 16:33:41 2018 (r330865) +++ head/sys/amd64/linux/linux_sysvec.c Tue Mar 13 16:40:29 2018 (r330866) @@ -121,7 +121,7 @@ SET_DECLARE(linux_ioctl_handler_set, struct linux_ioct static register_t * linux_copyout_strings(struct image_params *imgp); static int elf_linux_fixup(register_t **stack_base, struct image_params *iparams); -static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel); +static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); static void linux_set_syscall_retval(struct thread *td, int error); @@ -846,7 +846,7 @@ SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER static char GNULINUX_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; -static boolean_t +static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel) { const Elf32_Word *desc; @@ -857,7 +857,7 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel desc = (const Elf32_Word *)p; if (desc[0] != GNULINUX_ABI_DESC) - return (FALSE); + return (false); /* * For Linux we encode osrel as follows (see linux_mib.c): @@ -865,7 +865,7 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel */ *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; - return (TRUE); + return (true); } static Elf_Brandnote linux64_brandnote = { Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Tue Mar 13 16:33:41 2018 (r330865) +++ head/sys/amd64/linux32/linux32_sysvec.c Tue Mar 13 16:40:29 2018 (r330866) @@ -127,7 +127,7 @@ static void linux_sendsig(sig_t catcher, ksiginfo_ static void exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack); static void linux32_fixlimit(struct rlimit *rl, int which); -static boolean_t linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); +static bool linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); @@ -1043,7 +1043,7 @@ SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER static char GNU_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; -static boolean_t +static bool linux32_trans_osrel(const Elf_Note *note, int32_t *osrel) { const Elf32_Word *desc; @@ -1054,7 +1054,7 @@ linux32_trans_osrel(const Elf_Note *note, int32_t *osr desc = (const Elf32_Word *)p; if (desc[0] != GNULINUX_ABI_DESC) - return (FALSE); + return (false); /* * For Linux we encode osrel as follows (see linux_mib.c): @@ -1062,7 +1062,7 @@ linux32_trans_osrel(const Elf_Note *note, int32_t *osr */ *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; - return (TRUE); + return (true); } static Elf_Brandnote linux32_brandnote = { Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Tue Mar 13 16:33:41 2018 (r330865) +++ head/sys/i386/linux/linux_sysvec.c Tue Mar 13 16:40:29 2018 (r330866) @@ -115,7 +115,7 @@ static void linux_sendsig(sig_t catcher, ksiginfo_ static void exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack); static register_t *linux_copyout_strings(struct image_params *imgp); -static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel); +static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); @@ -1017,7 +1017,7 @@ SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER static char GNU_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; -static boolean_t +static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel) { const Elf32_Word *desc; @@ -1028,7 +1028,7 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel desc = (const Elf32_Word *)p; if (desc[0] != GNULINUX_ABI_DESC) - return (FALSE); + return (false); /* * For Linux we encode osrel as follows (see linux_mib.c): @@ -1036,7 +1036,7 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel */ *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; - return (TRUE); + return (true); } static Elf_Brandnote linux_brandnote = { Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Tue Mar 13 16:33:41 2018 (r330865) +++ head/sys/kern/imgact_elf.c Tue Mar 13 16:40:29 2018 (r330866) @@ -96,9 +96,9 @@ static int __elfN(load_section)(struct image_params *i caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot, size_t pagesize); static int __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp); -static boolean_t __elfN(freebsd_trans_osrel)(const Elf_Note *note, +static bool __elfN(freebsd_trans_osrel)(const Elf_Note *note, int32_t *osrel); -static boolean_t kfreebsd_trans_osrel(const Elf_Note *note, int32_t *osrel); +static bool kfreebsd_trans_osrel(const Elf_Note *note, int32_t *osrel); static boolean_t __elfN(check_note)(struct image_params *imgp, Elf_Brandnote *checknote, int32_t *osrel); static vm_prot_t __elfN(trans_prot)(Elf_Word); @@ -155,7 +155,7 @@ Elf_Brandnote __elfN(freebsd_brandnote) = { .trans_osrel = __elfN(freebsd_trans_osrel) }; -static boolean_t +static bool __elfN(freebsd_trans_osrel)(const Elf_Note *note, int32_t *osrel) { uintptr_t p; @@ -164,7 +164,7 @@ __elfN(freebsd_trans_osrel)(const Elf_Note *note, int3 p += roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE); *osrel = *(const int32_t *)(p); - return (TRUE); + return (true); } static const char GNU_ABI_VENDOR[] = "GNU"; @@ -179,7 +179,7 @@ Elf_Brandnote __elfN(kfreebsd_brandnote) = { .trans_osrel = kfreebsd_trans_osrel }; -static boolean_t +static bool kfreebsd_trans_osrel(const Elf_Note *note, int32_t *osrel) { const Elf32_Word *desc; @@ -190,7 +190,7 @@ kfreebsd_trans_osrel(const Elf_Note *note, int32_t *os desc = (const Elf32_Word *)p; if (desc[0] != GNU_KFREEBSD_ABI_DESC) - return (FALSE); + return (false); /* * Debian GNU/kFreeBSD embed the earliest compatible kernel version @@ -198,7 +198,7 @@ kfreebsd_trans_osrel(const Elf_Note *note, int32_t *os */ *osrel = desc[1] * 100000 + desc[2] * 1000 + desc[3]; - return (TRUE); + return (true); } int Modified: head/sys/sys/imgact_elf.h ============================================================================== --- head/sys/sys/imgact_elf.h Tue Mar 13 16:33:41 2018 (r330865) +++ head/sys/sys/imgact_elf.h Tue Mar 13 16:40:29 2018 (r330866) @@ -63,7 +63,7 @@ typedef struct { Elf_Note hdr; const char * vendor; int flags; - boolean_t (*trans_osrel)(const Elf_Note *, int32_t *); + bool (*trans_osrel)(const Elf_Note *, int32_t *); #define BN_CAN_FETCH_OSREL 0x0001 /* Deprecated. */ #define BN_TRANSLATE_OSREL 0x0002 /* Use trans_osrel to fetch osrel */ /* after checking the image ABI specification, if needed. */ From owner-svn-src-head@freebsd.org Tue Mar 13 17:10:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49D4EF337F8; Tue, 13 Mar 2018 17:10:53 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8A5169B72; Tue, 13 Mar 2018 17:10:52 +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 E39CE1C915; Tue, 13 Mar 2018 17:10:52 +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 w2DHAqcS026328; Tue, 13 Mar 2018 17:10:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DHAq4s026325; Tue, 13 Mar 2018 17:10:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803131710.w2DHAq4s026325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 13 Mar 2018 17:10:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330868 - in head: stand/efi/loader sys/amd64/amd64 sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: stand/efi/loader sys/amd64/amd64 sys/arm64/arm64 X-SVN-Commit-Revision: 330868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 17:10:53 -0000 Author: kevans Date: Tue Mar 13 17:10:52 2018 New Revision: 330868 URL: https://svnweb.freebsd.org/changeset/base/330868 Log: EFIRT: SetVirtualAddressMap with 1:1 mapping after exiting boot services This fixes a problem encountered on the Lenovo Thinkpad X220/Yoga 11e where runtime services would try to inexplicably jump to other parts of memory where it shouldn't be when attempting to enumerate EFI vars, causing a panic. The virtual mapping is enabled by default and can be disabled by setting efi_disable_vmap in loader.conf(5). Reviewed by: kib (earlier version) MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14677 Modified: head/stand/efi/loader/bootinfo.c head/sys/amd64/amd64/efirt_machdep.c head/sys/arm64/arm64/efirt_machdep.c Modified: head/stand/efi/loader/bootinfo.c ============================================================================== --- head/stand/efi/loader/bootinfo.c Tue Mar 13 17:04:14 2018 (r330867) +++ head/stand/efi/loader/bootinfo.c Tue Mar 13 17:10:52 2018 (r330868) @@ -236,17 +236,48 @@ bi_copymodules(vm_offset_t addr) return(addr); } +static EFI_STATUS +efi_do_vmap(EFI_MEMORY_DESCRIPTOR *mm, UINTN sz, UINTN mmsz, UINT32 mmver) +{ + EFI_MEMORY_DESCRIPTOR *desc, *viter, *vmap; + EFI_STATUS ret; + int curr, ndesc, nset; + + nset = 0; + desc = mm; + ndesc = sz / mmsz; + vmap = malloc(sz); + if (vmap == NULL) + /* This isn't really an EFI error case, but pretend it is */ + return (EFI_OUT_OF_RESOURCES); + viter = vmap; + for (curr = 0; curr < ndesc; + curr++, desc = NextMemoryDescriptor(desc, mmsz)) { + if ((desc->Attribute & EFI_MEMORY_RUNTIME) != 0) { + ++nset; + desc->VirtualStart = desc->PhysicalStart; + *viter = *desc; + viter = NextMemoryDescriptor(viter, mmsz); + } + } + ret = RS->SetVirtualAddressMap(nset * mmsz, mmsz, mmver, vmap); + free(vmap); + return (ret); +} + static int bi_load_efi_data(struct preloaded_file *kfp) { EFI_MEMORY_DESCRIPTOR *mm; EFI_PHYSICAL_ADDRESS addr; EFI_STATUS status; + const char *efi_novmap; size_t efisz; UINTN efi_mapkey; UINTN mmsz, pages, retry, sz; UINT32 mmver; struct efi_map_header *efihdr; + bool do_vmap; #if defined(__amd64__) || defined(__aarch64__) struct efi_fb efifb; @@ -266,6 +297,11 @@ bi_load_efi_data(struct preloaded_file *kfp) } #endif + do_vmap = true; + efi_novmap = getenv("efi_disable_vmap"); + if (efi_novmap != NULL) + do_vmap = strcasecmp(efi_novmap, "YES") != 0; + efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; /* @@ -321,6 +357,13 @@ bi_load_efi_data(struct preloaded_file *kfp) } status = BS->ExitBootServices(IH, efi_mapkey); if (EFI_ERROR(status) == 0) { + /* + * This may be disabled by setting efi_disable_vmap in + * loader.conf(5). By default we will setup the virtual + * map entries. + */ + if (do_vmap) + efi_do_vmap(mm, sz, mmsz, mmver); efihdr->memory_size = sz; efihdr->descriptor_size = mmsz; efihdr->descriptor_version = mmver; Modified: head/sys/amd64/amd64/efirt_machdep.c ============================================================================== --- head/sys/amd64/amd64/efirt_machdep.c Tue Mar 13 17:04:14 2018 (r330867) +++ head/sys/amd64/amd64/efirt_machdep.c Tue Mar 13 17:10:52 2018 (r330868) @@ -165,7 +165,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz)) { if ((p->md_attr & EFI_MD_ATTR_RT) == 0) continue; - if (p->md_virt != NULL) { + if (p->md_virt != NULL && (uint64_t)p->md_virt != p->md_phys) { if (bootverbose) printf("EFI Runtime entry %d is mapped\n", i); goto fail; Modified: head/sys/arm64/arm64/efirt_machdep.c ============================================================================== --- head/sys/arm64/arm64/efirt_machdep.c Tue Mar 13 17:04:14 2018 (r330867) +++ head/sys/arm64/arm64/efirt_machdep.c Tue Mar 13 17:10:52 2018 (r330868) @@ -169,7 +169,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz)) { if ((p->md_attr & EFI_MD_ATTR_RT) == 0) continue; - if (p->md_virt != NULL) { + if (p->md_virt != NULL && (uint64_t)p->md_virt != p->md_phys) { if (bootverbose) printf("EFI Runtime entry %d is mapped\n", i); goto fail; From owner-svn-src-head@freebsd.org Tue Mar 13 18:14:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09731F3D33A; Tue, 13 Mar 2018 18:14:49 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf0-x241.google.com (mail-lf0-x241.google.com [IPv6:2a00:1450:4010:c07::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70C986CE18; Tue, 13 Mar 2018 18:14:48 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf0-x241.google.com with SMTP id h127-v6so782432lfg.12; Tue, 13 Mar 2018 11:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PD8VmU2ZCXijd5lFeUz1daQ3FR/UF1CRBXqF91NInKM=; b=nLp9zGQnUxByZXDqGiaxOSWgyXaO9/ROB55ryrf4QrrlR8x/riQqmKEJ9Eg9SaT0FU wWxEf6g/KKj74+SD0pRnLr+gdQ+nUYLv4d7J8WHuW0OhxFIy5Qy5wKkWEASZ8MnHIOzE lnKkZEQJ5UuLvU4COdl4NYPg/ARQmXUw7vKTVbqH5AUxIyntaji1OwQkGiJvK/x53LIj 6yCDqtYhu/XH/AlvFZVRTT8ezEaihIQ6Zhqek+Ozyuryw+Huv4UqTX8YKRKULN/XdUga iGCVtfqNATRpNMOu2S5rCSawYk04Qg3OgsmjhWDGrjDZesUSrhqyAr631Rdsq3Ie04/U 6vyQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alumni-cwru-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PD8VmU2ZCXijd5lFeUz1daQ3FR/UF1CRBXqF91NInKM=; b=hk3opffCQPbul+em68j5Z9+zSankSlWCkJmwb5LWxONcopqYGcVDlNnt6/NZYZ4M6U JXbjpxatOnR+J16Ap5tA9oeE2qKKKFBvYffNPj5pZUr76Txq9AregOt44e5siI3shEnh onSRKR5GBId94bTI6/EgP8wU7AFH1cWZDzIzzO6IfkwxzyIY9v8NGs6Ne1NgZqegfH1u FcSndnXCWm/x5c007l5Nh+5+0dAiXVtSDZD9DN+uVC9GvY+2V+btJYhrDeq2yRjSxhxl nGhTNdT3y6kKH5E1dIUbizIOjeBAtjB1zie/dQ5upe3QkIl1HeLzPPxs2OwOLOGwzb+U t4zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=PD8VmU2ZCXijd5lFeUz1daQ3FR/UF1CRBXqF91NInKM=; b=ESCOyF68RuM1tOf4F7OEXfcux6MvTF28uBQOb+T3sdOCrzAI5iU6Xctg5SltE03+je 5NFGbf21TDZVx4uFJzJzI6JTrtygoITtupvkbcdpo3A8EtB0ofkoF/FO5Hc1pJfUNQ+r go4Iz9na7wEQjj8EDZmkZV269s5TP3+HydNMV0WzyyrW4DULzKC9PPA9N+n5DHvzhxI7 /Bi0zQh2iiKUdm0DBdXq0/I1yrJJmIG219mCodh4kS2nub0+Az0c1HrnxbSM9rvtGbIK AnWYgWqjqYqrQOi4BuHrWzXBF5Tzg1uBv/S2wPthcOhI3B/iK857QhWtjR0C+II2YIL1 sa9A== X-Gm-Message-State: AElRT7HJxE/drmmqVqskMMDSIt7bU3Wc78dvQUxanjv9EX35E8SiCiI+ kkvGWWpRKFhkgL/S9OnjdIj76sahJA+7uF8j/Bk= X-Google-Smtp-Source: AG47ELtm+Xq4/MET5x3HiqOmQhHu4yRs+yVYwT8Dcm/3FJlG9/ZeV48WjVNwzDngxI1RE4+qmGjqUAnoj9qckJX4Djo= X-Received: by 2002:a19:114f:: with SMTP id g76-v6mr1287157lfi.0.1520964886720; Tue, 13 Mar 2018 11:14:46 -0700 (PDT) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.46.85.26 with HTTP; Tue, 13 Mar 2018 11:14:46 -0700 (PDT) In-Reply-To: <201803131503.w2DF3wLJ064986@repo.freebsd.org> References: <201803131503.w2DF3wLJ064986@repo.freebsd.org> From: Justin Hibbits Date: Tue, 13 Mar 2018 13:14:46 -0500 X-Google-Sender-Auth: UfgJL8f4Ze_y_i3_SbQ014EETA0 Message-ID: Subject: Re: svn commit: r330845 - in head/sys/powerpc: aim ofw powerpc To: Nathan Whitehorn Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 18:14:49 -0000 This broke the powerpc (32-bit) build. On Tue, Mar 13, 2018 at 10:03 AM, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Tue Mar 13 15:03:58 2018 > New Revision: 330845 > URL: https://svnweb.freebsd.org/changeset/base/330845 > > Log: > Execute PowerPC64/AIM kernel from direct map region when possible. > > When the kernel can be in real mode in early boot, we can execute from > high addresses aliased to the kernel's physical memory. If that high > address has the first two bits set to 1 (0xc...), those addresses will > automatically become part of the direct map. This reduces page table > pressure from the kernel and it sets up the kernel to be used with > radix translation, for which it has to be up here. > > This is accomplished by exploiting the fact that all PowerPC kernels are > built as position-independent executables and relocate themselves > on start. Before this patch, the kernel runs at 1:1 VA:PA, but that > VA/PA is random and set by the bootloader. Very early, it processes > its ELF relocations to operate wherever it happens to find itself. > This patch uses that mechanism to re-enter and re-relocate the kernel > a second time witha new base address set up in the early parts of > powerpc_init(). > > Reviewed by: jhibbits > Differential Revision: D14647 > > Modified: > head/sys/powerpc/aim/aim_machdep.c > head/sys/powerpc/aim/locore64.S > head/sys/powerpc/aim/mmu_oea64.c > head/sys/powerpc/ofw/ofwcall64.S > head/sys/powerpc/powerpc/machdep.c > > Modified: head/sys/powerpc/aim/aim_machdep.c > ============================================================================== > --- head/sys/powerpc/aim/aim_machdep.c Tue Mar 13 15:02:46 2018 (r330844) > +++ head/sys/powerpc/aim/aim_machdep.c Tue Mar 13 15:03:58 2018 (r330845) > @@ -160,15 +160,72 @@ extern void *dlmisstrap, *dlmisssize; > extern void *dsmisstrap, *dsmisssize; > > extern void *ap_pcpu; > +extern void __restartkernel(vm_offset_t, vm_offset_t, vm_offset_t, void *, uint32_t, register_t offset, register_t msr); > > +void aim_early_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, > + void *mdp, uint32_t mdp_cookie); > void aim_cpu_init(vm_offset_t toc); > > void > +aim_early_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp, > + uint32_t mdp_cookie) > +{ > + register_t scratch; > + > + /* > + * If running from an FDT, make sure we are in real mode to avoid > + * tromping on firmware page tables. Everything in the kernel assumes > + * 1:1 mappings out of firmware, so this won't break anything not > + * already broken. This doesn't work if there is live OF, since OF > + * may internally use non-1:1 mappings. > + */ > + if (ofentry == 0) > + mtmsr(mfmsr() & ~(PSL_IR | PSL_DR)); > + > +#ifdef __powerpc64__ > + /* > + * If in real mode, relocate to high memory so that the kernel > + * can execute from the direct map. > + */ > + if (!(mfmsr() & PSL_DR) && > + (vm_offset_t)&aim_early_init < DMAP_BASE_ADDRESS) > + __restartkernel(fdt, 0, ofentry, mdp, mdp_cookie, > + DMAP_BASE_ADDRESS, mfmsr()); > +#endif > + > + /* Various very early CPU fix ups */ > + switch (mfpvr() >> 16) { > + /* > + * PowerPC 970 CPUs have a misfeature requested by Apple that > + * makes them pretend they have a 32-byte cacheline. Turn this > + * off before we measure the cacheline size. > + */ > + case IBM970: > + case IBM970FX: > + case IBM970MP: > + case IBM970GX: > + scratch = mfspr(SPR_HID5); > + scratch &= ~HID5_970_DCBZ_SIZE_HI; > + mtspr(SPR_HID5, scratch); > + break; > + #ifdef __powerpc64__ > + case IBMPOWER7: > + case IBMPOWER7PLUS: > + case IBMPOWER8: > + case IBMPOWER8E: > + /* XXX: get from ibm,slb-size in device tree */ > + n_slbs = 32; > + break; > + #endif > + } > +} > + > +void > aim_cpu_init(vm_offset_t toc) > { > size_t trap_offset, trapsize; > vm_offset_t trap; > - register_t msr, scratch; > + register_t msr; scratch is used in powerpc, but not powerpc64. From owner-svn-src-head@freebsd.org Tue Mar 13 18:24:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51A9CF3F3D0; Tue, 13 Mar 2018 18:24:22 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F38226D621; Tue, 13 Mar 2018 18:24:21 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E70941D5C9; Tue, 13 Mar 2018 18:24:21 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2DIOLSR066233; Tue, 13 Mar 2018 18:24:21 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DIOLTb066232; Tue, 13 Mar 2018 18:24:21 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201803131824.w2DIOLTb066232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 13 Mar 2018 18:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330870 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 330870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 18:24:22 -0000 Author: nwhitehorn Date: Tue Mar 13 18:24:21 2018 New Revision: 330870 URL: https://svnweb.freebsd.org/changeset/base/330870 Log: Restore missing temporary variable, deleted by accident in r330845. This unbreaks the ppc32 AIM build. Reported by: jhibbits Modified: head/sys/powerpc/aim/aim_machdep.c Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Tue Mar 13 17:57:53 2018 (r330869) +++ head/sys/powerpc/aim/aim_machdep.c Tue Mar 13 18:24:21 2018 (r330870) @@ -228,9 +228,10 @@ aim_cpu_init(vm_offset_t toc) register_t msr; uint8_t *cache_check; int cacheline_warn; - #ifndef __powerpc64__ +#ifndef __powerpc64__ + register_t scratch; int ppc64; - #endif +#endif trap_offset = 0; cacheline_warn = 0; From owner-svn-src-head@freebsd.org Tue Mar 13 18:27:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3AD2F3F7B3; Tue, 13 Mar 2018 18:27: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C8E76D86B; Tue, 13 Mar 2018 18:27: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 376C41D5D1; Tue, 13 Mar 2018 18:27: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 w2DIROD2066383; Tue, 13 Mar 2018 18:27:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DIROIN066382; Tue, 13 Mar 2018 18:27:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201803131827.w2DIROIN066382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 13 Mar 2018 18:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330871 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 330871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 18:27:25 -0000 Author: kib Date: Tue Mar 13 18:27:23 2018 New Revision: 330871 URL: https://svnweb.freebsd.org/changeset/base/330871 Log: Revert the chunk from r330410 in vm_page_reclaim_run(). There, the pages freed might be managed but the page's lock is not owned. For KPI correctness, the page lock is requried around the call to vm_page_free_prep(), which is asserted. Reclaim loop already did the work which could be done by vm_page_free_prep(), so the lock is not needed and the only consequence of not owning it is the assert trigger. Instead of adding the locking to satisfy the assert, revert to the code that calls vm_page_free_phys() directly. Reported by: pho Discussed with: jeff Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Mar 13 18:24:21 2018 (r330870) +++ head/sys/vm/vm_page.c Tue Mar 13 18:27:23 2018 (r330871) @@ -2538,7 +2538,17 @@ unlock: } if (m_mtx != NULL) mtx_unlock(m_mtx); - vm_page_free_pages_toq(&free, false); + if ((m = SLIST_FIRST(&free)) != NULL) { + vmd = VM_DOMAIN(domain); + vm_domain_free_lock(vmd); + do { + MPASS(vm_phys_domain(m) == domain); + SLIST_REMOVE_HEAD(&free, plinks.s.ss); + vm_page_free_phys(vmd, m); + } while ((m = SLIST_FIRST(&free)) != NULL); + vm_domain_free_wakeup(vmd); + vm_domain_free_unlock(vmd); + } return (error); } From owner-svn-src-head@freebsd.org Tue Mar 13 18:30:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20D75F3FBA6; Tue, 13 Mar 2018 18:30:27 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB4FB6DB38; Tue, 13 Mar 2018 18:30:26 +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 AC2771D5D9; Tue, 13 Mar 2018 18:30:26 +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 w2DIUQSX066557; Tue, 13 Mar 2018 18:30:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DIUQLH066553; Tue, 13 Mar 2018 18:30:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201803131830.w2DIUQLH066553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 13 Mar 2018 18:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330872 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 330872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 18:30:27 -0000 Author: jhb Date: Tue Mar 13 18:30:26 2018 New Revision: 330872 URL: https://svnweb.freebsd.org/changeset/base/330872 Log: Add a "jail" keyword to list the name of a jail rather than its ID. Inspired by: mwlucas Reviewed by: jamie MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14683 Modified: head/bin/ps/extern.h head/bin/ps/keyword.c head/bin/ps/print.c head/bin/ps/ps.1 Modified: head/bin/ps/extern.h ============================================================================== --- head/bin/ps/extern.h Tue Mar 13 18:27:23 2018 (r330871) +++ head/bin/ps/extern.h Tue Mar 13 18:30:26 2018 (r330872) @@ -55,6 +55,7 @@ char *emulname(KINFO *, VARENT *); VARENT *find_varentry(VAR *); const char *fmt_argv(char **, char *, char *, size_t); double getpcpu(const KINFO *); +char *jailname(KINFO *, VARENT *); char *kvar(KINFO *, VARENT *); char *label(KINFO *, VARENT *); char *loginclass(KINFO *, VARENT *); Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Tue Mar 13 18:27:23 2018 (r330871) +++ head/bin/ps/keyword.c Tue Mar 13 18:30:26 2018 (r330872) @@ -108,6 +108,7 @@ static VAR var[] = { {"inblk", "INBLK", NULL, "read-blocks", USER, rvar, ROFF(ru_inblock), LONG, "ld", 0}, {"inblock", "", "inblk", NULL, 0, NULL, 0, CHAR, NULL, 0}, + {"jail", "JAIL", NULL, "jail-name", LJUST, jailname, 0, CHAR, NULL, 0}, {"jid", "JID", NULL, "jail-id", 0, kvar, KOFF(ki_jid), INT, "d", 0}, {"jobc", "JOBC", NULL, "job-control-count", 0, kvar, KOFF(ki_jobc), SHORT, "d", 0}, Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Tue Mar 13 18:27:23 2018 (r330871) +++ head/bin/ps/print.c Tue Mar 13 18:30:26 2018 (r330872) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -839,4 +840,17 @@ loginclass(KINFO *k, VARENT *ve __unused) return (strdup("-")); } return (strdup(k->ki_p->ki_loginclass)); +} + +char * +jailname(KINFO *k, VARENT *ve __unused) +{ + char *name; + + if (k->ki_p->ki_jid == 0) + return (strdup("-")); + name = jail_getname(k->ki_p->ki_jid); + if (name == NULL) + return (strdup("-")); + return (name); } Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Tue Mar 13 18:27:23 2018 (r330871) +++ head/bin/ps/ps.1 Tue Mar 13 18:30:26 2018 (r330872) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd January 23, 2018 +.Dd March 13, 2018 .Dt PS 1 .Os .Sh NAME @@ -576,6 +576,8 @@ group name (from egid) (alias .It Cm inblk total blocks read (alias .Cm inblock ) +.It Cm jail +jail name .It Cm jid jail ID .It Cm jobc From owner-svn-src-head@freebsd.org Tue Mar 13 19:49:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 130A7F4AB17; Tue, 13 Mar 2018 19:49:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2EFE70ECB; Tue, 13 Mar 2018 19:49:06 +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 AE0D71E289; Tue, 13 Mar 2018 19:49:06 +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 w2DJn62m006280; Tue, 13 Mar 2018 19:49:06 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DJn641006278; Tue, 13 Mar 2018 19:49:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201803131949.w2DJn641006278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 13 Mar 2018 19:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330875 - head/usr.sbin/usbconfig X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/usbconfig X-SVN-Commit-Revision: 330875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 19:49:07 -0000 Author: trasz Date: Tue Mar 13 19:49:06 2018 New Revision: 330875 URL: https://svnweb.freebsd.org/changeset/base/330875 Log: Add "usbconfig dump_all_desc", a subcommand to dump all device and config descriptors. Reviewed by: hselasky@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/usbconfig/usbconfig.8 head/usr.sbin/usbconfig/usbconfig.c Modified: head/usr.sbin/usbconfig/usbconfig.8 ============================================================================== --- head/usr.sbin/usbconfig/usbconfig.8 Tue Mar 13 19:28:03 2018 (r330874) +++ head/usr.sbin/usbconfig/usbconfig.8 Tue Mar 13 19:49:06 2018 (r330875) @@ -97,6 +97,8 @@ Remove a quirk. Add quirk for the currently selected USB device. .It Cm remove_quirk Ar quirk_name Remove a quirk for the currently selected USB device. +.It Cm dump_all_desc +Display the device and configuration descriptors. .It Cm dump_quirk_names Display the list of supported quirk names. .It Cm dump_device_quirks Modified: head/usr.sbin/usbconfig/usbconfig.c ============================================================================== --- head/usr.sbin/usbconfig/usbconfig.c Tue Mar 13 19:28:03 2018 (r330874) +++ head/usr.sbin/usbconfig/usbconfig.c Tue Mar 13 19:49:06 2018 (r330875) @@ -77,6 +77,7 @@ struct options { uint8_t got_power_on:1; uint8_t got_dump_device_quirks:1; uint8_t got_dump_quirk_names:1; + uint8_t got_dump_all_desc:1; uint8_t got_dump_device_desc:1; uint8_t got_dump_curr_config:1; uint8_t got_dump_all_config:1; @@ -112,6 +113,7 @@ enum { T_SHOW_IFACE_DRIVER, T_DUMP_QUIRK_NAMES, T_DUMP_DEVICE_QUIRKS, + T_DUMP_ALL_DESC, T_DUMP_DEVICE_DESC, T_DUMP_CURR_CONFIG_DESC, T_DUMP_ALL_CONFIG_DESC, @@ -144,6 +146,7 @@ static const struct token token[] = { {"remove_quirk", T_REMOVE_QUIRK, 1}, {"dump_quirk_names", T_DUMP_QUIRK_NAMES, 0}, {"dump_device_quirks", T_DUMP_DEVICE_QUIRKS, 0}, + {"dump_all_desc", T_DUMP_ALL_DESC, 0}, {"dump_device_desc", T_DUMP_DEVICE_DESC, 0}, {"dump_curr_config_desc", T_DUMP_CURR_CONFIG_DESC, 0}, {"dump_all_config_desc", T_DUMP_ALL_CONFIG_DESC, 0}, @@ -283,6 +286,7 @@ usage(void) " remove_quirk " "\n" " dump_quirk_names" "\n" " dump_device_quirks" "\n" + " dump_all_desc" "\n" " dump_device_desc" "\n" " dump_curr_config_desc" "\n" " dump_all_config_desc" "\n" @@ -489,7 +493,8 @@ flush_command(struct libusb20_backend *pbe, struct opt } } dump_any = - (opt->got_dump_device_desc || + (opt->got_dump_all_desc || + opt->got_dump_device_desc || opt->got_dump_curr_config || opt->got_dump_all_config || opt->got_dump_info); @@ -508,6 +513,10 @@ flush_command(struct libusb20_backend *pbe, struct opt } else if (opt->got_dump_curr_config) { printf("\n"); dump_config(pdev, 0); + } else if (opt->got_dump_all_desc) { + printf("\n"); + dump_device_desc(pdev); + dump_config(pdev, 1); } if (dump_any) { printf("\n"); @@ -694,6 +703,12 @@ main(int argc, char **argv) if (opt->got_get_template) duplicate_option(argv[n]); opt->got_get_template = 1; + opt->got_any++; + break; + case T_DUMP_ALL_DESC: + if (opt->got_dump_all_desc) + duplicate_option(argv[n]); + opt->got_dump_all_desc = 1; opt->got_any++; break; case T_DUMP_DEVICE_DESC: From owner-svn-src-head@freebsd.org Tue Mar 13 19:56:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A1C8F4B3A8; Tue, 13 Mar 2018 19:56:11 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 231DF7143E; Tue, 13 Mar 2018 19:56:11 +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 1DF301E403; Tue, 13 Mar 2018 19:56:11 +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 w2DJuAG0011166; Tue, 13 Mar 2018 19:56:10 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DJuAwP011165; Tue, 13 Mar 2018 19:56:10 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803131956.w2DJuAwP011165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 13 Mar 2018 19:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330876 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 330876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 19:56:11 -0000 Author: brooks Date: Tue Mar 13 19:56:10 2018 New Revision: 330876 URL: https://svnweb.freebsd.org/changeset/base/330876 Log: Fix ISP_FC_LIP and ISP_RESCAN on big-endian 64-bit systems. For _IO() ioctls, addr is a pointer to uap->data which is a caddr_t. When the caddr_t stores an int, dereferencing addr as an (int *) results in truncation on little-endian 64-bit systems and corruption (owing to extracting top bits) on big-endian 64-bit systems. In practice the value of chan was probably always zero on systems of the latter type as all such FreeBSD platforms use a register-based calling convention. Reviewed by: mav Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14673 Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Tue Mar 13 19:49:06 2018 (r330875) +++ head/sys/dev/isp/isp_freebsd.c Tue Mar 13 19:56:10 2018 (r330876) @@ -444,7 +444,7 @@ ispioctl(struct cdev *dev, u_long c, caddr_t addr, int case ISP_RESCAN: if (IS_FC(isp)) { - chan = *(int *)addr; + chan = *(intptr_t *)addr; if (chan < 0 || chan >= isp->isp_nchan) { retval = -ENXIO; break; @@ -461,7 +461,7 @@ ispioctl(struct cdev *dev, u_long c, caddr_t addr, int case ISP_FC_LIP: if (IS_FC(isp)) { - chan = *(int *)addr; + chan = *(intptr_t *)addr; if (chan < 0 || chan >= isp->isp_nchan) { retval = -ENXIO; break; From owner-svn-src-head@freebsd.org Tue Mar 13 20:31:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68011F4DAB4; Tue, 13 Mar 2018 20:31:09 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F146732BF; Tue, 13 Mar 2018 20:31:08 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09B6B1E9DB; Tue, 13 Mar 2018 20:31:08 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2DKV7Mj030469; Tue, 13 Mar 2018 20:31:07 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DKV7Ig030468; Tue, 13 Mar 2018 20:31:07 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201803132031.w2DKV7Ig030468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 13 Mar 2018 20:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330878 - head/lib/libdpv X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/lib/libdpv X-SVN-Commit-Revision: 330878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 20:31:09 -0000 Author: dteske Date: Tue Mar 13 20:31:07 2018 New Revision: 330878 URL: https://svnweb.freebsd.org/changeset/base/330878 Log: Fix typo and lint/igor warnings Modified: head/lib/libdpv/dpv.3 Modified: head/lib/libdpv/dpv.3 ============================================================================== --- head/lib/libdpv/dpv.3 Tue Mar 13 20:16:07 2018 (r330877) +++ head/lib/libdpv/dpv.3 Tue Mar 13 20:31:07 2018 (r330878) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jan 26, 2016 +.Dd Mar 13, 2018 .Dt DPV 3 .Os .Sh NAME @@ -36,7 +36,8 @@ .In dpv.h .Ft int .Fo dpv -.Fa "struct dpv_config *config, struct dpv_file_node *file_list" +.Fa "struct dpv_config *config" +.Fa "struct dpv_file_node *file_list" .Fc .Ft void .Fo dpv_free @@ -60,8 +61,7 @@ or The .Fn dpv .Fa config -argument contains the following properties for configuring global display -features: +argument properties for configuring global display features: .Bd -literal -offset indent struct dpv_config { uint8_t keep_tite; /* Cleaner exit for scripts */ @@ -113,11 +113,12 @@ member of the .Fn dpv .Fa config argument is a mask of bit fields indicating various processing options. -Possible flags are as follows: +Possible flags are: .Bl -tag -width DPV_NO_OVERRUN .It Dv DPV_TEST_MODE Enable test mode. -In test mode, the +In test mode, +the .Fn action callback of the .Fa config @@ -126,18 +127,21 @@ Appends .Dq [TEST MODE] to the status line .Po -to override, set the +to override, +set the .Va status_format member of the .Fn dpv .Fa config argument; -e.g., to +for example, +to .Dv DPV_STATUS_DEFAULT .Pc . .It Dv DPV_WIDE_MODE Enable wide mode. -In wide mode, the length of the +In wide mode, +the length of the .Va aprompt and .Va pprompt @@ -169,7 +173,8 @@ does not support color environment variable is ignored .Pc . .It Dv DPV_NO_OVERRUN -When enabled, callbacks for the current +When enabled, +callbacks for the current .Vt dpv_file_node are terminated when .Fn action @@ -189,7 +194,7 @@ argument to .Fn dpv is a pointer to a .Dq linked-list , -described as follows in +described in .In dpv.h : .Bd -literal -offset indent struct dpv_file_node { @@ -206,7 +211,8 @@ struct dpv_file_node { For each of the items in the .Fa file_list .Dq linked-list -argument, the +argument, +the .Fn action callback member of the .Fn dpv @@ -214,7 +220,7 @@ callback member of the argument is called. The .Fn action -function should perform a +function performs a .Dq nominal action on the file and return. The return value of @@ -231,7 +237,7 @@ provides a reference to the current .Vt dpv_file_node being processed. .Fa out -provides a file descriptor where the data should go. +provides a file descriptor where the data goes. .Pp If the .Va output @@ -244,7 +250,7 @@ the .Fa out file descriptor of .Fn action -will be zero and should be ignored. +will be zero and can be ignored. If .Fa output was set to DPV_OUTPUT_FILE, @@ -257,14 +263,16 @@ was set to DPV_OUTPUT_SHELL, will be an open file descriptor to a pipe for a spawned shell program. When .Fa out -is greater than zero, you should write any data you have read back to +is greater than zero, +write data that has been read back to .Fa out . .Pp To abort .Fn dpv , either from the .Fn action -callback or asynchronously from a signal handler, two globals are provided via +callback or asynchronously from a signal handler, +two globals are provided via .In dpv.h : .Bd -literal -offset indent extern int dpv_interrupt; /* Set to TRUE in interrupt handler */ @@ -272,11 +280,12 @@ extern int dpv_abort; /* Set to true in callback t .Ed .Pp These globals are not automatically reset and must be manually maintained. -Don't forget to reset these globals before subsequent invocations of +Do not forget to reset these globals before subsequent invocations of .Fn dpv when making multiple calls from the same program. .Pp -In addition, the +In addition, +the .Va status member of the .Fn action @@ -284,7 +293,7 @@ member of the argument can be used to control callbacks for the current file. The .Va status -member can be set to any of the following from +member can be set to any of the below from .In dpv.h : .Bd -literal -offset indent enum dpv_status { @@ -296,13 +305,17 @@ enum dpv_status { .Pp The default .Fa status -is zero, DPV_STATUS_RUNING, which keeps the callbacks coming for the current +is zero, +DPV_STATUS_RUNNING, +which keeps the callbacks coming for the current .Fn file . Setting .Ql file->status to anything other than DPV_STATUS_RUNNING will cause .Fn dpv -to loop to the next file, effecting the next callback, if any. +to loop to the next file, +effecting the next callback, +if any. .Pp The .Fn action @@ -318,7 +331,7 @@ Percentages are reported through the return value of the .Fn action callback. -Throughput statistics are calculated from the following global +Throughput statistics are calculated from the below global .Vt int in .In dpv.h : @@ -326,7 +339,7 @@ in extern int dpv_overall_read; .Ed .Pp -This should be set to the number of bytes that have been read for all files. +Set this to the number of bytes that have been read for all files. Throughput information is displayed in the status line .Pq only available when using Xr dialog 3 at the bottom of the screen. @@ -335,18 +348,20 @@ See DPV_DISPLAY_LIBDIALOG above. Note that .Va dpv_overall_read does not have to represent bytes. -For example, you can change the +For example, +the .Va status_format -to display something other than +can be changed to display something other than .Dq Li bytes and increment .Va dpv_overall_read accordingly -.Pq e.g., counting lines . +.Pq for example, counting lines . .Pp When .Fn dpv -is processing the current file, the +is processing the current file, +the .Va length and .Va read @@ -355,7 +370,8 @@ members of the .Fa file argument are used for calculating the display of mini progress bars .Po -if enabled; see +if enabled; +see .Va pbar_size above .Pc . @@ -381,7 +397,7 @@ function performs on private global variables initialized by .Fn dpv . .Sh ENVIRONMENT -The following environment variables are referenced by +The below environment variables are referenced by .Nm : .Bl -tag -width ".Ev USE_COLOR" .It Ev DIALOG @@ -398,17 +414,20 @@ or .Ql Xdialog .Pq for Dv DPV_DISPLAY_XDIALOG . .It Ev DIALOGRC -If set and non-NULL, path to +If set and non-NULL, +path to .Ql .dialogrc file. .It Ev HOME If .Ql Ev $DIALOGRC -is either not set or NULL, used as a prefix to +is either not set or NULL, +used as a prefix to .Ql .dialogrc -.Pq i.e., Ql $HOME/.dialogrc . +.Pq that is, Ql $HOME/.dialogrc . .It Ev USE_COLOR -If set and NULL, disables the use of color when using +If set and NULL, +disables the use of color when using .Xr dialog 1 .Pq does not apply to Xr Xdialog 1 . .It Ev msg_done Ev msg_fail Ev msg_pending @@ -418,7 +437,8 @@ Internationalization strings for overriding the defaul and .Ql Pending respectively. -To prevent their usage, explicitly set the +To prevent their usage, +explicitly set the .Va msg_done , .Va msg_fail , and @@ -471,11 +491,11 @@ This is a known issue with the .Ql --gauge widget in .Xr Xdialog 1 . -Embed escaped newlines within prompt text(s) to force line breaks. +Embed escaped newlines within prompt text to force line breaks. .Pp .Xr dialog 1 does not display the first character after a series of escaped escape-sequences -(e.g., ``\\\\n'' produces ``\\'' instead of ``\\n''). +(for example, ``\\\\n'' produces ``\\'' instead of ``\\n''). This is a known issue with .Xr dialog 1 and does not affect @@ -483,10 +503,10 @@ and does not affect or .Xr Xdialog 1 . .Pp -If your application ignores +If an application ignores .Ev USE_COLOR when set and NULL before calling -.Xr dpv 3 +.Fn dpv with color escape sequences anyway, .Xr dialog 3 and From owner-svn-src-head@freebsd.org Tue Mar 13 20:35:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94774F4E536; Tue, 13 Mar 2018 20:35:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40778745C1; Tue, 13 Mar 2018 20:35:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B5A41EA5B; Tue, 13 Mar 2018 20:35:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2DKZXMR034706; Tue, 13 Mar 2018 20:35:33 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DKZXoP034705; Tue, 13 Mar 2018 20:35:33 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201803132035.w2DKZXoP034705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 13 Mar 2018 20:35:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330879 - head/lib/libfigpar X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/lib/libfigpar X-SVN-Commit-Revision: 330879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 20:35:33 -0000 Author: dteske Date: Tue Mar 13 20:35:32 2018 New Revision: 330879 URL: https://svnweb.freebsd.org/changeset/base/330879 Log: Fix lint/igor warnings Modified: head/lib/libfigpar/figpar.3 Modified: head/lib/libfigpar/figpar.3 ============================================================================== --- head/lib/libfigpar/figpar.3 Tue Mar 13 20:31:07 2018 (r330878) +++ head/lib/libfigpar/figpar.3 Tue Mar 13 20:35:32 2018 (r330879) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Nov 2, 2015 +.Dd Mar 13, 2018 .Dt FIGPAR 3 .Os .Sh NAME @@ -38,22 +38,30 @@ .In figpar.h .Ft int .Fo parse_config -.Fa "struct figpar_config options[], const char *path" -.Fa "int \*[lp]*unknown\*[rp]\*[lp]struct figpar_config *option, uint32_t line" -.Fa "char *directive, char *value\*[rp], uint8_t processing_options" +.Fa "struct figpar_config options[]" +.Fa "const char *path" +.Fa "int \*[lp]*unknown\*[rp]\*[lp]struct figpar_config *option" +.Fa "uint32_t line" +.Fa "char *directive" +.Fa "char *value\*[rp]" +.Fa "uint8_t processing_options" .Fc .Ft "struct figpar_config *" .Fo get_config_option -.Fa "struct figpar_config options[], const char *directive" +.Fa "struct figpar_config options[]" +.Fa "const char *directive" .Fc .In string_m.h .Ft int .Fo replaceall -.Fa "char *source, const char *find, const char *replace" +.Fa "char *source" +.Fa "const char *find" +.Fa "const char *replace" .Fc .Ft unsigned int .Fo strcount -.Fa "const char *source, const char *find" +.Fa "const char *source" +.Fa "const char *find" .Fc .Ft void .Fo strexpand @@ -70,7 +78,8 @@ .Sh DESCRIPTION The .Nm -library provides a light-weight, portable framework for parsing configuration +library provides a light-weight, +portable framework for parsing configuration files. The library uses .Xr open 2 , @@ -87,8 +96,9 @@ provides raw data to a set of callback functions. These callback functions can in-turn initiate abort through their return value, allowing custom syntax validation during parsing. .Pp -Configuration directives, types, and callback functions are provided through -data structures defined in +Configuration directives, +types, +and callback functions are provided through data structures defined in .In figpar.h : .Bd -literal -offset indent struct figpar_config { @@ -132,7 +142,7 @@ argument to .Fn parse_config is a mask of bit fields which indicate various processing options. -The possible flags are as follows: +The possible flags are: .Bl -tag -width FIGPAR_BREAK_ON_SEMICOLON .It Dv FIGPAR_BREAK_ON_EQUALS An equals sign @@ -151,7 +161,8 @@ Normally directives are matched case insensitively usi .Xr fnmatch 3 . This flag enables directive matching to be case sensitive. .It Dv FIGPAR_REQUIRE_EQUALS -If a directive is not followed by an equals, processing is aborted. +If a directive is not followed by an equals, +processing is aborted. .It Dv FIGPAR_STRICT_EQUALS Equals must be part of the directive to be considered a delimiter between directive and value. @@ -159,7 +170,7 @@ directive and value. .Pp The .Fa options -struct array pointer can be NULL and every directive will invoke the +struct array pointer can be NULL and every directive will run the .Fn unknown function argument. .Pp @@ -168,13 +179,16 @@ The directive for each figpar_config item in the options argument is matched against each parsed directive using .Xr fnmatch 3 until a match is found. -If a match is found, the +If a match is found, +the .Fn action -function for that figpar_config directive is invoked with the line number, -directive, and value. -Otherwise if no match, the +function for that figpar_config directive is run with the line number, +directive, +and value. +Otherwise if no match, +the .Fn unknown -function is invoked +function is run .Pq with the same arguments . .Pp If either @@ -197,19 +211,20 @@ is entirely optional as-is the use of .Fa "enum figpar_cfgtype" or .Fa "union figpar_cfgvalue" . -For example, you could choose to pass a NULL pointer to +For example, +a NULL pointer can be passed to .Fn parse_config -for the first argument and then provide a simple +for the first argument while providing a simple .Fa unknown function based on .Xr queue 3 -that populates a singly-linked list of your own struct containing the +that populates a singly-linked list of a struct containing the .Fa directive and .Fa value . .Pp -In addition, the following miscellaneous string manipulation routines are -provided by +In addition, +miscellaneous string manipulation routines are provided by .In string_m.h : .Bl -tag -width strexpandnl() .It Fn replaceall @@ -224,8 +239,7 @@ Count the number of occurrences of one string that app .Fa source string. Return value is the total count. -An example use would be if you need to know how large a block of memory needs -to be for a +An example use would be to show how large a block of memory needs to be for a .Fn replaceall series. .It Fn strexpand From owner-svn-src-head@freebsd.org Tue Mar 13 20:39:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E24DF4E9D2; Tue, 13 Mar 2018 20:39:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FF7374842; Tue, 13 Mar 2018 20:39:07 +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 0859F1EA63; Tue, 13 Mar 2018 20:39:07 +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 w2DKd62j034861; Tue, 13 Mar 2018 20:39:06 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DKd6r2034860; Tue, 13 Mar 2018 20:39:06 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803132039.w2DKd6r2034860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 13 Mar 2018 20:39:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330880 - head/sys/dev/md X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/dev/md X-SVN-Commit-Revision: 330880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 20:39:07 -0000 Author: brooks Date: Tue Mar 13 20:39:06 2018 New Revision: 330880 URL: https://svnweb.freebsd.org/changeset/base/330880 Log: Don't overflow the kernel struct mdio in the MDIOCLIST ioctl. Always terminate the list with -1 and document the ioctl behavior. This preserves existing behavior as seen from userspace with the addition of the unconditional termination which will not be seen by working consumers of MDIOCLIST. Because this ioctl can only be performed by root (in default configurations) and is not used in the base system this bug is not deemed to warrant either a security advisory or an eratta notice. Reviewed by: kib Obtained from: CheriBSD Discussed with: security-officer (gordon) MFC after: 3 days Security: kernel heap buffer overflow Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14685 Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Tue Mar 13 20:35:32 2018 (r330879) +++ head/sys/dev/md/md.c Tue Mar 13 20:39:06 2018 (r330880) @@ -1750,13 +1750,24 @@ err_after_new: strlen(sc->file) + 1); return (error); case MDIOCLIST: + /* + * Write the number of md devices to mdio->md_pad[0]. + * Write the unit number of the first (MDNPAD - 2) units + * to mdio->md_pad[1::(MDNPAD - 2)] and terminate the + * list with -1. + * + * XXX: There is currently no mechanism to retrieve unit + * numbers for more than (MDNPAD - 2) units. + * + * XXX: Due to the use of LIST_INSERT_HEAD in mdnew(), the + * list of visible unit numbers not stable. + */ i = 1; LIST_FOREACH(sc, &md_softc_list, list) { - if (i == MDNPAD - 1) - mdio->md_pad[i] = -1; - else + if (i < MDNPAD - 1) mdio->md_pad[i++] = sc->unit; } + mdio->md_pad[MIN(i, MDNPAD - 1)] = -1; mdio->md_pad[0] = i - 1; return (0); default: From owner-svn-src-head@freebsd.org Tue Mar 13 20:54:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A69A3F4FA93; Tue, 13 Mar 2018 20:54:18 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5722D75448; Tue, 13 Mar 2018 20:54:18 +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 51EB11ED90; Tue, 13 Mar 2018 20:54:18 +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 w2DKsIlY044893; Tue, 13 Mar 2018 20:54:18 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DKsIv8044892; Tue, 13 Mar 2018 20:54:18 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803132054.w2DKsIv8044892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 13 Mar 2018 20:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330881 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 330881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 20:54:18 -0000 Author: brooks Date: Tue Mar 13 20:54:18 2018 New Revision: 330881 URL: https://svnweb.freebsd.org/changeset/base/330881 Log: md_pad is used by MDIOCLIST and not available for future use. MFC after: 1 week Modified: head/sys/sys/mdioctl.h Modified: head/sys/sys/mdioctl.h ============================================================================== --- head/sys/sys/mdioctl.h Tue Mar 13 20:39:06 2018 (r330880) +++ head/sys/sys/mdioctl.h Tue Mar 13 20:54:18 2018 (r330881) @@ -64,7 +64,7 @@ struct md_ioctl { int md_fwheads; /* firmware heads */ int md_fwsectors; /* firmware sectors */ char *md_label; /* label of the device */ - int md_pad[MDNPAD]; /* padding for future ideas */ + int md_pad[MDNPAD]; /* storage for MDIOCLIST */ }; #define MD_NAME "md" From owner-svn-src-head@freebsd.org Tue Mar 13 21:42:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02213F530A8; Tue, 13 Mar 2018 21:42:39 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9D077796F; Tue, 13 Mar 2018 21:42:38 +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 A85551F55E; Tue, 13 Mar 2018 21:42:38 +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 w2DLgcJQ070080; Tue, 13 Mar 2018 21:42:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DLgc2F070077; Tue, 13 Mar 2018 21:42:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201803132142.w2DLgc2F070077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 13 Mar 2018 21:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330882 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 330882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 21:42:39 -0000 Author: jhb Date: Tue Mar 13 21:42:38 2018 New Revision: 330882 URL: https://svnweb.freebsd.org/changeset/base/330882 Log: Simplify error handling in t4_tom.ko module loading. - Change t4_ddp_mod_load() to return void instead of always returning success. This avoids having to pretend to have proper support for unloading when only part of t4_tom_mod_load() has run. - If t4_register_uld() fails, don't invoke t4_tom_mod_unload() directly. The module handling code in the kernel invokes MOD_UNLOAD on a module whose MOD_LOAD fails with an error already. Reviewed by: np (part of a larger patch) MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Tue Mar 13 20:54:18 2018 (r330881) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Tue Mar 13 21:42:38 2018 (r330882) @@ -1939,7 +1939,7 @@ t4_aio_queue_ddp(struct socket *so, struct kaiocb *job return (0); } -int +void t4_ddp_mod_load(void) { @@ -1948,7 +1948,6 @@ t4_ddp_mod_load(void) TAILQ_INIT(&ddp_orphan_pagesets); mtx_init(&ddp_orphan_pagesets_lock, "ddp orphans", NULL, MTX_DEF); TASK_INIT(&ddp_orphan_task, 0, ddp_free_orphan_pagesets, NULL); - return (0); } void Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Tue Mar 13 20:54:18 2018 (r330881) +++ head/sys/dev/cxgbe/tom/t4_tom.c Tue Mar 13 21:42:38 2018 (r330882) @@ -1170,7 +1170,6 @@ t4_aio_queue_tom(struct socket *so, struct kaiocb *job static int t4_tom_mod_load(void) { - int rc; struct protosw *tcp_protosw, *tcp6_protosw; /* CPL handlers */ @@ -1178,9 +1177,7 @@ t4_tom_mod_load(void) t4_init_listen_cpl_handlers(); t4_init_cpl_io_handlers(); - rc = t4_ddp_mod_load(); - if (rc != 0) - return (rc); + t4_ddp_mod_load(); tcp_protosw = pffindproto(PF_INET, IPPROTO_TCP, SOCK_STREAM); if (tcp_protosw == NULL) @@ -1202,11 +1199,7 @@ t4_tom_mod_load(void) ifaddr_evhandler = EVENTHANDLER_REGISTER(ifaddr_event, t4_tom_ifaddr_event, NULL, EVENTHANDLER_PRI_ANY); - rc = t4_register_uld(&tom_uld_info); - if (rc != 0) - t4_tom_mod_unload(); - - return (rc); + return (t4_register_uld(&tom_uld_info)); } static void Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Tue Mar 13 20:54:18 2018 (r330881) +++ head/sys/dev/cxgbe/tom/t4_tom.h Tue Mar 13 21:42:38 2018 (r330882) @@ -389,7 +389,7 @@ void t4_free_page_pods(struct ppod_reservation *); int t4_soreceive_ddp(struct socket *, struct sockaddr **, struct uio *, struct mbuf **, struct mbuf **, int *); int t4_aio_queue_ddp(struct socket *, struct kaiocb *); -int t4_ddp_mod_load(void); +void t4_ddp_mod_load(void); void t4_ddp_mod_unload(void); void ddp_assert_empty(struct toepcb *); void ddp_init_toep(struct toepcb *); From owner-svn-src-head@freebsd.org Tue Mar 13 22:54:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB6F8F57DF9; Tue, 13 Mar 2018 22:54:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 656937AB4A; Tue, 13 Mar 2018 22:54:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 605332003C; Tue, 13 Mar 2018 22:54:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2DMsUCc005594; Tue, 13 Mar 2018 22:54:30 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DMsU2r005593; Tue, 13 Mar 2018 22:54:30 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201803132254.w2DMsU2r005593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 13 Mar 2018 22:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330883 - head/stand/userboot/userboot X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/stand/userboot/userboot X-SVN-Commit-Revision: 330883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 22:54:30 -0000 Author: glebius Date: Tue Mar 13 22:54:29 2018 New Revision: 330883 URL: https://svnweb.freebsd.org/changeset/base/330883 Log: Fix typo that misteriously passes compilation. Modified: head/stand/userboot/userboot/main.c Modified: head/stand/userboot/userboot/main.c ============================================================================== --- head/stand/userboot/userboot/main.c Tue Mar 13 21:42:38 2018 (r330882) +++ head/stand/userboot/userboot/main.c Tue Mar 13 22:54:29 2018 (r330883) @@ -159,7 +159,7 @@ extract_currdev(void) //bzero(&dev, sizeof(dev)); #if defined(USERBOOT_ZFS_SUPPORT) - CT_ASSERT(sizeof(struct disk_devdesc) >= sizeof(struct zfs_devdesc)); + CTASSERT(sizeof(struct disk_devdesc) >= sizeof(struct zfs_devdesc)); if (userboot_zfs_found) { struct zfs_devdesc zdev; From owner-svn-src-head@freebsd.org Tue Mar 13 23:05:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5886F5897F; Tue, 13 Mar 2018 23:05:52 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 582397B3D2; Tue, 13 Mar 2018 23:05:52 +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 52CB5201C3; Tue, 13 Mar 2018 23:05:52 +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 w2DN5q0C010777; Tue, 13 Mar 2018 23:05:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DN5pnc010768; Tue, 13 Mar 2018 23:05:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201803132305.w2DN5pnc010768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 13 Mar 2018 23:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330884 - in head/sys: dev/cxgbe dev/cxgbe/firmware dev/cxgbe/tom modules/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: dev/cxgbe dev/cxgbe/firmware dev/cxgbe/tom modules/cxgbe/tom X-SVN-Commit-Revision: 330884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 23:05:53 -0000 Author: jhb Date: Tue Mar 13 23:05:51 2018 New Revision: 330884 URL: https://svnweb.freebsd.org/changeset/base/330884 Log: Support for TLS offload of TOE connections on T6 adapters. The TOE engine in Chelsio T6 adapters supports offloading of TLS encryption and TCP segmentation for offloaded connections. Sockets using TLS are required to use a set of custom socket options to upload RX and TX keys to the NIC and to enable RX processing. Currently these socket options are implemented as TCP options in the vendor specific range. A patched OpenSSL library will be made available in a port / package for use with the TLS TOE support. TOE sockets can either offload both transmit and reception of TLS records or just transmit. TLS offload (both RX and TX) is enabled by setting the dev.t6nex..tls sysctl to 1 and requires TOE to be enabled on the relevant interface. Transmit offload can be used on any "normal" or TLS TOE socket by using the custom socket option to program a transmit key. This permits most TOE sockets to transparently offload TLS when applications use a patched SSL library (e.g. using LD_LIBRARY_PATH to request use of a patched OpenSSL library). Receive offload can only be used with TOE sockets using the TLS mode. The dev.t6nex.0.toe.tls_rx_ports sysctl can be set to a list of TCP port numbers. Any connection with either a local or remote port number in that list will be created as a TLS socket rather than a plain TOE socket. Note that although this sysctl accepts an arbitrary list of port numbers, the sysctl(8) tool is only able to set sysctl nodes to a single value. A TLS socket will hang without receiving data if used by an application that is not using a patched SSL library. Thus, the tls_rx_ports node should be used with care. For a server mostly concerned with offloading TLS transmit, this node is not needed as plain TOE sockets will fall back to software crypto when using an unpatched SSL library. New per-interface statistics nodes are added giving counts of TLS packets and payload bytes (payload bytes do not include TLS headers or authentication tags/MACs) offloaded via the TOE engine, e.g.: dev.cc.0.stats.rx_tls_octets: 149 dev.cc.0.stats.rx_tls_records: 13 dev.cc.0.stats.tx_tls_octets: 26501823 dev.cc.0.stats.tx_tls_records: 1620 TLS transmit work requests are constructed by a new variant of t4_push_frames() called t4_push_tls_records() in tom/t4_tls.c. TLS transmit work requests require a buffer containing IVs. If the IVs are too large to fit into the work request, a separate buffer is allocated when constructing a work request. This buffer is associated with the transmit descriptor and freed when the descriptor is ACKed by the adapter. Received TLS frames use two new CPL messages. The first message is a CPL_TLS_DATA containing the decryped payload of a single TLS record. The handler places the mbuf containing the received payload on an mbufq in the TOE pcb. The second message is a CPL_RX_TLS_CMP message which includes a copy of the TLS header and indicates if there were any errors. The handler for this message places the TLS header into the socket buffer followed by the saved mbuf with the payload data. Both of these handlers are contained in tom/t4_tls.c. A few routines were exposed from t4_cpl_io.c for use by t4_tls.c including send_rx_credits(), a new send_rx_modulate(), and t4_close_conn(). TLS keys for both transmit and receive are stored in onboard memory in the NIC in the "TLS keys" memory region. In some cases a TLS socket can hang with pending data available in the NIC that is not delivered to the host. As a workaround, TLS sockets are more aggressive about sending CPL_RX_DATA_ACK messages anytime that any data is read from a TLS socket. In addition, a fallback timer will periodically send CPL_RX_DATA_ACK messages to the NIC for connections that are still in the handshake phase. Once the connection has finished the handshake and programmed RX keys via the socket option, the timer is stopped. A new function select_ulp_mode() is used to determine what sub-mode a given TOE socket should use (plain TOE, DDP, or TLS). The existing set_tcpddp_ulp_mode() function has been renamed to set_ulp_mode() and handles initialization of TLS-specific state when necessary in addition to DDP-specific state. Since TLS sockets do not receive individual TCP segments but always receive full TLS records, they can receive more data than is available in the current window (e.g. if a 16k TLS record is received but the socket buffer is itself 16k). To cope with this, just drop the window to 0 when this happens, but track the overage and "eat" the overage as it is read from the socket buffer not opening the window (or adding rx_credits) for the overage bytes. Reviewed by: np (earlier version) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D14529 Added: head/sys/dev/cxgbe/tom/t4_tls.c (contents, props changed) head/sys/dev/cxgbe/tom/t4_tls.h (contents, props changed) Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/firmware/t6fw_cfg.txt head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h head/sys/modules/cxgbe/tom/Makefile Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Mar 13 22:54:29 2018 (r330883) +++ head/sys/dev/cxgbe/adapter.h Tue Mar 13 23:05:51 2018 (r330884) @@ -297,6 +297,10 @@ struct port_info { struct port_stats stats; u_int tnl_cong_drops; u_int tx_parse_error; + u_long tx_tls_records; + u_long tx_tls_octets; + u_long rx_tls_records; + u_long rx_tls_octets; struct callout tick; }; Modified: head/sys/dev/cxgbe/firmware/t6fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t6fw_cfg.txt Tue Mar 13 22:54:29 2018 (r330883) +++ head/sys/dev/cxgbe/firmware/t6fw_cfg.txt Tue Mar 13 23:05:51 2018 (r330884) @@ -163,10 +163,12 @@ nserver = 512 nhpfilter = 0 nhash = 16384 - protocol = ofld, rddp, rdmac, iscsi_initiator_pdu, iscsi_target_pdu, iscsi_t10dif, crypto_lookaside + protocol = ofld, rddp, rdmac, iscsi_initiator_pdu, iscsi_target_pdu, iscsi_t10dif, tlskeys, crypto_lookaside tp_l2t = 4096 tp_ddp = 2 tp_ddp_iscsi = 2 + tp_tls_key = 3 + tp_tls_mxrxsize = 17408 # 16384 + 1024, governs max rx data, pm max xfer len, rx coalesce sizes tp_stag = 2 tp_pbl = 5 tp_rq = 7 @@ -273,7 +275,7 @@ [fini] version = 0x1 - checksum = 0x7191019f + checksum = 0x9e8952d2 # # $FreeBSD$ # Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Tue Mar 13 22:54:29 2018 (r330883) +++ head/sys/dev/cxgbe/offload.h Tue Mar 13 23:05:51 2018 (r330884) @@ -151,6 +151,9 @@ struct tom_tunables { int sndbuf; int ddp; int rx_coalesce; + int tls; + int *tls_rx_ports; + int num_tls_rx_ports; int tx_align; int tx_zcopy; }; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Mar 13 22:54:29 2018 (r330883) +++ head/sys/dev/cxgbe/t4_main.c Tue Mar 13 23:05:51 2018 (r330884) @@ -591,6 +591,7 @@ static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); static int sysctl_tc_params(SYSCTL_HANDLER_ARGS); #endif #ifdef TCP_OFFLOAD +static int sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS); static int sysctl_tp_tick(SYSCTL_HANDLER_ARGS); static int sysctl_tp_dack_timer(SYSCTL_HANDLER_ARGS); static int sysctl_tp_timer(SYSCTL_HANDLER_ARGS); @@ -1390,6 +1391,7 @@ t4_detach_common(device_t dev) free(sc->sge.iqmap, M_CXGBE); free(sc->sge.eqmap, M_CXGBE); free(sc->tids.ftid_tab, M_CXGBE); + free(sc->tt.tls_rx_ports, M_CXGBE); t4_destroy_dma_tag(sc); if (mtx_initialized(&sc->sc_lock)) { sx_xlock(&t4_list_lock); @@ -5433,6 +5435,14 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_coalesce", CTLFLAG_RW, &sc->tt.rx_coalesce, 0, "receive coalescing"); + sc->tt.tls = 0; + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tls", CTLFLAG_RW, + &sc->tt.tls, 0, "Inline TLS allowed"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tls_rx_ports", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, sysctl_tls_rx_ports, + "I", "TCP ports that use inline TLS+TOE RX"); + sc->tt.tx_align = 1; SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_align", CTLFLAG_RW, &sc->tt.tx_align, 0, "chop and align payload"); @@ -5836,6 +5846,19 @@ cxgbe_sysctls(struct port_info *pi) "# of buffer-group 3 truncated packets"); #undef SYSCTL_ADD_T4_PORTSTAT + + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "tx_tls_records", + CTLFLAG_RD, &pi->tx_tls_records, + "# of TLS records transmitted"); + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "tx_tls_octets", + CTLFLAG_RD, &pi->tx_tls_octets, + "# of payload octets in transmitted TLS records"); + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_tls_records", + CTLFLAG_RD, &pi->rx_tls_records, + "# of TLS records received"); + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_tls_octets", + CTLFLAG_RD, &pi->rx_tls_octets, + "# of payload octets in received TLS records"); } static int @@ -8257,6 +8280,68 @@ done: #endif #ifdef TCP_OFFLOAD +static int +sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + int *old_ports, *new_ports; + int i, new_count, rc; + + if (req->newptr == NULL && req->oldptr == NULL) + return (SYSCTL_OUT(req, NULL, imax(sc->tt.num_tls_rx_ports, 1) * + sizeof(sc->tt.tls_rx_ports[0]))); + + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4tlsrx"); + if (rc) + return (rc); + + if (sc->tt.num_tls_rx_ports == 0) { + i = -1; + rc = SYSCTL_OUT(req, &i, sizeof(i)); + } else + rc = SYSCTL_OUT(req, sc->tt.tls_rx_ports, + sc->tt.num_tls_rx_ports * sizeof(sc->tt.tls_rx_ports[0])); + if (rc == 0 && req->newptr != NULL) { + new_count = req->newlen / sizeof(new_ports[0]); + new_ports = malloc(new_count * sizeof(new_ports[0]), M_CXGBE, + M_WAITOK); + rc = SYSCTL_IN(req, new_ports, new_count * + sizeof(new_ports[0])); + if (rc) + goto err; + + /* Allow setting to a single '-1' to clear the list. */ + if (new_count == 1 && new_ports[0] == -1) { + ADAPTER_LOCK(sc); + old_ports = sc->tt.tls_rx_ports; + sc->tt.tls_rx_ports = NULL; + sc->tt.num_tls_rx_ports = 0; + ADAPTER_UNLOCK(sc); + free(old_ports, M_CXGBE); + } else { + for (i = 0; i < new_count; i++) { + if (new_ports[i] < 1 || + new_ports[i] > IPPORT_MAX) { + rc = EINVAL; + goto err; + } + } + + ADAPTER_LOCK(sc); + old_ports = sc->tt.tls_rx_ports; + sc->tt.tls_rx_ports = new_ports; + sc->tt.num_tls_rx_ports = new_count; + ADAPTER_UNLOCK(sc); + free(old_ports, M_CXGBE); + new_ports = NULL; + } + err: + free(new_ports, M_CXGBE); + } + end_synchronized_op(sc, 0); + return (rc); +} + static void unit_conv(char *buf, size_t len, u_int val, u_int factor) { Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Tue Mar 13 22:54:29 2018 (r330883) +++ head/sys/dev/cxgbe/tom/t4_connect.c Tue Mar 13 23:05:51 2018 (r330884) @@ -142,6 +142,10 @@ do_act_establish(struct sge_iq *iq, const struct rss_h } make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); + + if (toep->ulp_mode == ULP_MODE_TLS) + tls_establish(toep); + done: INP_WUNLOCK(inp); CURVNET_RESTORE(); @@ -268,6 +272,11 @@ calc_opt2a(struct socket *so, struct toepcb *toep) if (toep->ulp_mode == ULP_MODE_TCPDDP) opt2 |= F_RX_FC_VALID | F_RX_FC_DDP; #endif + if (toep->ulp_mode == ULP_MODE_TLS) { + opt2 |= F_RX_FC_VALID; + opt2 &= ~V_RX_COALESCE(M_RX_COALESCE); + opt2 |= F_RX_FC_DISABLE; + } return (htobe32(opt2)); } @@ -378,10 +387,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); toep->vnet = so->so_vnet; - if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) - set_tcpddp_ulp_mode(toep); - else - toep->ulp_mode = ULP_MODE_NONE; + set_ulp_mode(toep, select_ulp_mode(so, sc)); SOCKBUF_LOCK(&so->so_rcv); /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ toep->rx_credits = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Mar 13 22:54:29 2018 (r330883) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Mar 13 23:05:51 2018 (r330884) @@ -73,9 +73,6 @@ __FBSDID("$FreeBSD$"); #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" -#define IS_AIOTX_MBUF(m) \ - ((m)->m_flags & M_EXT && (m)->m_ext.ext_flags & EXT_FLAG_AIOTX) - static void t4_aiotx_cancel(struct kaiocb *job); static void t4_aiotx_queue_toep(struct toepcb *toep); @@ -106,7 +103,7 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par { struct wrqe *wr; struct fw_flowc_wr *flowc; - unsigned int nparams = ftxp ? 8 : 6, flowclen; + unsigned int nparams, flowclen, paramidx; struct vi_info *vi = toep->vi; struct port_info *pi = vi->pi; struct adapter *sc = pi->adapter; @@ -116,6 +113,15 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par KASSERT(!(toep->flags & TPF_FLOWC_WR_SENT), ("%s: flowc for tid %u sent already", __func__, toep->tid)); + if (ftxp != NULL) + nparams = 8; + else + nparams = 6; + if (toep->ulp_mode == ULP_MODE_TLS) + nparams++; + if (toep->tls.fcplenmax != 0) + nparams++; + flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); wr = alloc_wrqe(roundup2(flowclen, 16), toep->ofld_txq); @@ -131,39 +137,45 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par flowc->flowid_len16 = htonl(V_FW_WR_LEN16(howmany(flowclen, 16)) | V_FW_WR_FLOWID(toep->tid)); - flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN; - flowc->mnemval[0].val = htobe32(pfvf); - flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; - flowc->mnemval[1].val = htobe32(pi->tx_chan); - flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT; - flowc->mnemval[2].val = htobe32(pi->tx_chan); - flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; - flowc->mnemval[3].val = htobe32(toep->ofld_rxq->iq.abs_id); +#define FLOWC_PARAM(__m, __v) \ + do { \ + flowc->mnemval[paramidx].mnemonic = FW_FLOWC_MNEM_##__m; \ + flowc->mnemval[paramidx].val = htobe32(__v); \ + paramidx++; \ + } while (0) + + paramidx = 0; + + FLOWC_PARAM(PFNVFN, pfvf); + FLOWC_PARAM(CH, pi->tx_chan); + FLOWC_PARAM(PORT, pi->tx_chan); + FLOWC_PARAM(IQID, toep->ofld_rxq->iq.abs_id); if (ftxp) { uint32_t sndbuf = min(ftxp->snd_space, sc->tt.sndbuf); - flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDNXT; - flowc->mnemval[4].val = htobe32(ftxp->snd_nxt); - flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_RCVNXT; - flowc->mnemval[5].val = htobe32(ftxp->rcv_nxt); - flowc->mnemval[6].mnemonic = FW_FLOWC_MNEM_SNDBUF; - flowc->mnemval[6].val = htobe32(sndbuf); - flowc->mnemval[7].mnemonic = FW_FLOWC_MNEM_MSS; - flowc->mnemval[7].val = htobe32(ftxp->mss); + FLOWC_PARAM(SNDNXT, ftxp->snd_nxt); + FLOWC_PARAM(RCVNXT, ftxp->rcv_nxt); + FLOWC_PARAM(SNDBUF, sndbuf); + FLOWC_PARAM(MSS, ftxp->mss); CTR6(KTR_CXGBE, "%s: tid %u, mss %u, sndbuf %u, snd_nxt 0x%x, rcv_nxt 0x%x", __func__, toep->tid, ftxp->mss, sndbuf, ftxp->snd_nxt, ftxp->rcv_nxt); } else { - flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDBUF; - flowc->mnemval[4].val = htobe32(512); - flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_MSS; - flowc->mnemval[5].val = htobe32(512); + FLOWC_PARAM(SNDBUF, 512); + FLOWC_PARAM(MSS, 512); CTR2(KTR_CXGBE, "%s: tid %u", __func__, toep->tid); } + if (toep->ulp_mode == ULP_MODE_TLS) + FLOWC_PARAM(ULP_MODE, toep->ulp_mode); + if (toep->tls.fcplenmax != 0) + FLOWC_PARAM(TXDATAPLEN_MAX, toep->tls.fcplenmax); +#undef FLOWC_PARAM + KASSERT(paramidx == nparams, ("nparams mismatch")); + txsd->tx_credits = howmany(flowclen, 16); txsd->plen = 0; KASSERT(toep->tx_credits >= txsd->tx_credits && toep->txsd_avail > 0, @@ -421,7 +433,7 @@ make_established(struct toepcb *toep, uint32_t snd_isn soisconnected(so); } -static int +int send_rx_credits(struct adapter *sc, struct toepcb *toep, int credits) { struct wrqe *wr; @@ -443,6 +455,23 @@ send_rx_credits(struct adapter *sc, struct toepcb *toe } void +send_rx_modulate(struct adapter *sc, struct toepcb *toep) +{ + struct wrqe *wr; + struct cpl_rx_data_ack *req; + + wr = alloc_wrqe(sizeof(*req), toep->ctrlq); + if (wr == NULL) + return; + req = wrtod(wr); + + INIT_TP_WR_MIT_CPL(req, CPL_RX_DATA_ACK, toep->tid); + req->credit_dack = htobe32(F_RX_MODULATE_RX); + + t4_wrq_tx(sc, wr); +} + +void t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) { struct adapter *sc = tod->tod_softc; @@ -459,8 +488,18 @@ t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) ("%s: sb %p has more data (%d) than last time (%d).", __func__, sb, sbused(sb), toep->sb_cc)); - toep->rx_credits += toep->sb_cc - sbused(sb); + credits = toep->sb_cc - sbused(sb); toep->sb_cc = sbused(sb); + if (toep->ulp_mode == ULP_MODE_TLS) { + if (toep->tls.rcv_over >= credits) { + toep->tls.rcv_over -= credits; + credits = 0; + } else { + credits -= toep->tls.rcv_over; + toep->tls.rcv_over = 0; + } + } + toep->rx_credits += credits; if (toep->rx_credits > 0 && (tp->rcv_wnd <= 32 * 1024 || toep->rx_credits >= 64 * 1024 || @@ -471,7 +510,8 @@ t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) toep->rx_credits -= credits; tp->rcv_wnd += credits; tp->rcv_adv += credits; - } + } else if (toep->flags & TPF_FORCE_CREDITS) + send_rx_modulate(sc, toep); } void @@ -489,8 +529,8 @@ t4_rcvd(struct toedev *tod, struct tcpcb *tp) /* * Close a connection by sending a CPL_CLOSE_CON_REQ message. */ -static int -close_conn(struct adapter *sc, struct toepcb *toep) +int +t4_close_conn(struct adapter *sc, struct toepcb *toep) { struct wrqe *wr; struct cpl_close_con_req *req; @@ -691,6 +731,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep KASSERT(toep->ulp_mode == ULP_MODE_NONE || toep->ulp_mode == ULP_MODE_TCPDDP || + toep->ulp_mode == ULP_MODE_TLS || toep->ulp_mode == ULP_MODE_RDMA, ("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, toep)); @@ -905,7 +946,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep /* Send a FIN if requested, but only if there's no more data to send */ if (m == NULL && toep->flags & TPF_SEND_FIN) - close_conn(sc, toep); + t4_close_conn(sc, toep); } static inline void @@ -1097,7 +1138,7 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, /* Send a FIN if requested, but only if there are no more PDUs to send */ if (mbufq_first(pduq) == NULL && toep->flags & TPF_SEND_FIN) - close_conn(sc, toep); + t4_close_conn(sc, toep); } int @@ -1116,6 +1157,8 @@ t4_tod_output(struct toedev *tod, struct tcpcb *tp) if (toep->ulp_mode == ULP_MODE_ISCSI) t4_push_pdus(sc, toep, 0); + else if (tls_tx_key(toep)) + t4_push_tls_records(sc, toep, 0); else t4_push_frames(sc, toep, 0); @@ -1140,6 +1183,8 @@ t4_send_fin(struct toedev *tod, struct tcpcb *tp) if (tp->t_state >= TCPS_ESTABLISHED) { if (toep->ulp_mode == ULP_MODE_ISCSI) t4_push_pdus(sc, toep, 0); + else if (tls_tx_key(toep)) + t4_push_tls_records(sc, toep, 0); else t4_push_frames(sc, toep, 0); } @@ -1772,6 +1817,10 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header credits -= txsd->tx_credits; toep->tx_credits += txsd->tx_credits; plen += txsd->plen; + if (txsd->iv_buffer) { + free(txsd->iv_buffer, M_CXGBE); + txsd->iv_buffer = NULL; + } txsd++; toep->txsd_avail++; KASSERT(toep->txsd_avail <= toep->txsd_total, @@ -1797,6 +1846,8 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header CURVNET_SET(toep->vnet); if (toep->ulp_mode == ULP_MODE_ISCSI) t4_push_pdus(sc, toep, plen); + else if (tls_tx_key(toep)) + t4_push_tls_records(sc, toep, plen); else t4_push_frames(sc, toep, plen); CURVNET_RESTORE(); @@ -1826,6 +1877,12 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header tid, plen); #endif sbdrop_locked(sb, plen); + if (tls_tx_key(toep)) { + struct tls_ofld_info *tls_ofld = &toep->tls; + + MPASS(tls_ofld->sb_off >= plen); + tls_ofld->sb_off -= plen; + } if (!TAILQ_EMPTY(&toep->aiotx_jobq)) t4_aiotx_queue_toep(toep); sowwakeup_locked(so); /* unlocks so_snd */ @@ -2298,6 +2355,9 @@ t4_aio_queue_aiotx(struct socket *so, struct kaiocb *j return (EOPNOTSUPP); if (!sc->tt.tx_zcopy) + return (EOPNOTSUPP); + + if (is_tls_offload(toep) || tls_tx_key(toep)) return (EOPNOTSUPP); SOCKBUF_LOCK(&so->so_snd); Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Tue Mar 13 22:54:29 2018 (r330883) +++ head/sys/dev/cxgbe/tom/t4_listen.c Tue Mar 13 23:05:51 2018 (r330884) @@ -1056,6 +1056,11 @@ calc_opt2p(struct adapter *sc, struct port_info *pi, i if (ulp_mode == ULP_MODE_TCPDDP) opt2 |= F_RX_FC_VALID | F_RX_FC_DDP; #endif + if (ulp_mode == ULP_MODE_TLS) { + opt2 |= F_RX_FC_VALID; + opt2 &= ~V_RX_COALESCE(M_RX_COALESCE); + opt2 |= F_RX_FC_DISABLE; + } return htobe32(opt2); } @@ -1347,11 +1352,15 @@ found: INIT_TP_WR_MIT_CPL(rpl5, CPL_PASS_ACCEPT_RPL, tid); } - if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) { - ulp_mode = ULP_MODE_TCPDDP; + ulp_mode = select_ulp_mode(so, sc); + switch (ulp_mode) { + case ULP_MODE_TCPDDP: synqe->flags |= TPF_SYNQE_TCPDDP; - } else - ulp_mode = ULP_MODE_NONE; + break; + case ULP_MODE_TLS: + synqe->flags |= TPF_SYNQE_TLS; + break; + } rpl->opt0 = calc_opt0(so, vi, e, mtu_idx, rscale, rx_credits, ulp_mode); rpl->opt2 = calc_opt2p(sc, pi, rxqid, &cpl->tcpopt, &th, ulp_mode); @@ -1407,8 +1416,8 @@ found: REJECT_PASS_ACCEPT(); } - CTR5(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p, synqe %p, SYNACK", - __func__, stid, tid, lctx, synqe); + CTR6(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p, synqe %p, SYNACK mode %d", + __func__, stid, tid, lctx, synqe, ulp_mode); INP_WLOCK(inp); synqe->flags |= TPF_SYNQE_HAS_L2TE; @@ -1557,9 +1566,11 @@ reset: toep->tid = tid; toep->l2te = &sc->l2t->l2tab[synqe->l2e_idx]; if (synqe->flags & TPF_SYNQE_TCPDDP) - set_tcpddp_ulp_mode(toep); + set_ulp_mode(toep, ULP_MODE_TCPDDP); + else if (synqe->flags & TPF_SYNQE_TLS) + set_ulp_mode(toep, ULP_MODE_TLS); else - toep->ulp_mode = ULP_MODE_NONE; + set_ulp_mode(toep, ULP_MODE_NONE); /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ toep->rx_credits = synqe->rcv_bufsize; Added: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/tom/t4_tls.c Tue Mar 13 23:05:51 2018 (r330884) @@ -0,0 +1,1642 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017-2018 Chelsio Communications, Inc. + * All rights reserved. + * Written by: John Baldwin + * + * 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 "opt_inet.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef TCP_OFFLOAD +#include "common/common.h" +#include "common/t4_tcb.h" +#include "tom/t4_tom_l2t.h" +#include "tom/t4_tom.h" + +/* + * The TCP sequence number of a CPL_TLS_DATA mbuf is saved here while + * the mbuf is in the ulp_pdu_reclaimq. + */ +#define tls_tcp_seq PH_loc.thirtytwo[0] + +/* + * Handshake lock used for the handshake timer. Having a global lock + * is perhaps not ideal, but it avoids having to use callout_drain() + * in tls_uninit_toep() which can't block. Also, the timer shouldn't + * actually fire for most connections. + */ +static struct mtx tls_handshake_lock; + +static void +t4_set_tls_tcb_field(struct toepcb *toep, uint16_t word, uint64_t mask, + uint64_t val) +{ + struct adapter *sc = td_adapter(toep->td); + + t4_set_tcb_field(sc, toep->ctrlq, toep->tid, word, mask, val, 0, 0, + toep->ofld_rxq->iq.abs_id); +} + +/* TLS and DTLS common routines */ +int +tls_tx_key(struct toepcb *toep) +{ + struct tls_ofld_info *tls_ofld = &toep->tls; + + return (tls_ofld->tx_key_addr >= 0); +} + +int +tls_rx_key(struct toepcb *toep) +{ + struct tls_ofld_info *tls_ofld = &toep->tls; + + return (tls_ofld->rx_key_addr >= 0); +} + +static int +key_size(struct toepcb *toep) +{ + struct tls_ofld_info *tls_ofld = &toep->tls; + + return ((tls_ofld->key_location == TLS_SFO_WR_CONTEXTLOC_IMMEDIATE) ? + tls_ofld->k_ctx.tx_key_info_size : KEY_IN_DDR_SIZE); +} + +/* Set TLS Key-Id in TCB */ +static void +t4_set_tls_keyid(struct toepcb *toep, unsigned int key_id) +{ + + t4_set_tls_tcb_field(toep, W_TCB_RX_TLS_KEY_TAG, + V_TCB_RX_TLS_KEY_TAG(M_TCB_RX_TLS_BUF_TAG), + V_TCB_RX_TLS_KEY_TAG(key_id)); +} + +/* Clear TF_RX_QUIESCE to re-enable receive. */ +static void +t4_clear_rx_quiesce(struct toepcb *toep) +{ + + t4_set_tls_tcb_field(toep, W_TCB_T_FLAGS, V_TF_RX_QUIESCE(1), 0); +} + +static void +tls_clr_ofld_mode(struct toepcb *toep) +{ + + tls_stop_handshake_timer(toep); + + /* Operate in PDU extraction mode only. */ + t4_set_tls_tcb_field(toep, W_TCB_ULP_RAW, + V_TCB_ULP_RAW(M_TCB_ULP_RAW), + V_TCB_ULP_RAW(V_TF_TLS_ENABLE(1))); + t4_clear_rx_quiesce(toep); +} + +static void +tls_clr_quiesce(struct toepcb *toep) +{ + + tls_stop_handshake_timer(toep); + t4_clear_rx_quiesce(toep); +} + +/* + * Calculate the TLS data expansion size + */ +static int +tls_expansion_size(struct toepcb *toep, int data_len, int full_pdus_only, + unsigned short *pdus_per_ulp) +{ + struct tls_ofld_info *tls_ofld = &toep->tls; + struct tls_scmd *scmd = &tls_ofld->scmd0; + int expn_size = 0, frag_count = 0, pad_per_pdu = 0, + pad_last_pdu = 0, last_frag_size = 0, max_frag_size = 0; + int exp_per_pdu = 0; + int hdr_len = TLS_HEADER_LENGTH; + + do { + max_frag_size = tls_ofld->k_ctx.frag_size; + if (G_SCMD_CIPH_MODE(scmd->seqno_numivs) == + SCMD_CIPH_MODE_AES_GCM) { + frag_count = (data_len / max_frag_size); + exp_per_pdu = GCM_TAG_SIZE + AEAD_EXPLICIT_DATA_SIZE + + hdr_len; + expn_size = frag_count * exp_per_pdu; + if (full_pdus_only) { + *pdus_per_ulp = data_len / (exp_per_pdu + + max_frag_size); + if (*pdus_per_ulp > 32) + *pdus_per_ulp = 32; + else if(!*pdus_per_ulp) + *pdus_per_ulp = 1; + expn_size = (*pdus_per_ulp) * exp_per_pdu; + break; + } + if ((last_frag_size = data_len % max_frag_size) > 0) { + frag_count += 1; + expn_size += exp_per_pdu; + } + break; + } else if (G_SCMD_CIPH_MODE(scmd->seqno_numivs) != + SCMD_CIPH_MODE_NOP) { + /* Calculate the number of fragments we can make */ + frag_count = (data_len / max_frag_size); + if (frag_count > 0) { + pad_per_pdu = (((howmany((max_frag_size + + tls_ofld->mac_length), + CIPHER_BLOCK_SIZE)) * + CIPHER_BLOCK_SIZE) - + (max_frag_size + + tls_ofld->mac_length)); + if (!pad_per_pdu) + pad_per_pdu = CIPHER_BLOCK_SIZE; + exp_per_pdu = pad_per_pdu + + tls_ofld->mac_length + + hdr_len + CIPHER_BLOCK_SIZE; + expn_size = frag_count * exp_per_pdu; + } + if (full_pdus_only) { + *pdus_per_ulp = data_len / (exp_per_pdu + + max_frag_size); + if (*pdus_per_ulp > 32) + *pdus_per_ulp = 32; + else if (!*pdus_per_ulp) + *pdus_per_ulp = 1; + expn_size = (*pdus_per_ulp) * exp_per_pdu; + break; + } + /* Consider the last fragment */ + if ((last_frag_size = data_len % max_frag_size) > 0) { + pad_last_pdu = (((howmany((last_frag_size + + tls_ofld->mac_length), + CIPHER_BLOCK_SIZE)) * + CIPHER_BLOCK_SIZE) - + (last_frag_size + + tls_ofld->mac_length)); + if (!pad_last_pdu) + pad_last_pdu = CIPHER_BLOCK_SIZE; + expn_size += (pad_last_pdu + + tls_ofld->mac_length + hdr_len + + CIPHER_BLOCK_SIZE); + } + } + } while (0); + + return (expn_size); +} + +/* Copy Key to WR */ +static void +tls_copy_tx_key(struct toepcb *toep, void *dst) +{ + struct tls_ofld_info *tls_ofld = &toep->tls; + struct ulptx_sc_memrd *sc_memrd; + struct ulptx_idata *sc; + + if (tls_ofld->k_ctx.tx_key_info_size <= 0) + return; + + if (tls_ofld->key_location == TLS_SFO_WR_CONTEXTLOC_DDR) { + sc = dst; + sc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_NOOP)); + sc->len = htobe32(0); + sc_memrd = (struct ulptx_sc_memrd *)(sc + 1); + sc_memrd->cmd_to_len = htobe32(V_ULPTX_CMD(ULP_TX_SC_MEMRD) | + V_ULP_TX_SC_MORE(1) | + V_ULPTX_LEN16(tls_ofld->k_ctx.tx_key_info_size >> 4)); + sc_memrd->addr = htobe32(tls_ofld->tx_key_addr >> 5); + } else if (tls_ofld->key_location == TLS_SFO_WR_CONTEXTLOC_IMMEDIATE) { + memcpy(dst, &tls_ofld->k_ctx.tx, + tls_ofld->k_ctx.tx_key_info_size); + } +} + +/* TLS/DTLS content type for CPL SFO */ +static inline unsigned char +tls_content_type(unsigned char content_type) +{ + /* + * XXX: Shouldn't this map CONTENT_TYPE_APP_DATA to DATA and + * default to "CUSTOM" for all other types including + * heartbeat? + */ + switch (content_type) { + case CONTENT_TYPE_CCS: + return CPL_TX_TLS_SFO_TYPE_CCS; + case CONTENT_TYPE_ALERT: + return CPL_TX_TLS_SFO_TYPE_ALERT; + case CONTENT_TYPE_HANDSHAKE: + return CPL_TX_TLS_SFO_TYPE_HANDSHAKE; + case CONTENT_TYPE_HEARTBEAT: + return CPL_TX_TLS_SFO_TYPE_HEARTBEAT; + } + return CPL_TX_TLS_SFO_TYPE_DATA; +} + +static unsigned char +get_cipher_key_size(unsigned int ck_size) +{ + switch (ck_size) { + case AES_NOP: /* NOP */ + return 15; + case AES_128: /* AES128 */ + return CH_CK_SIZE_128; + case AES_192: /* AES192 */ + return CH_CK_SIZE_192; + case AES_256: /* AES256 */ + return CH_CK_SIZE_256; + default: + return CH_CK_SIZE_256; + } +} + +static unsigned char +get_mac_key_size(unsigned int mk_size) +{ + switch (mk_size) { + case SHA_NOP: /* NOP */ + return CH_MK_SIZE_128; + case SHA_GHASH: /* GHASH */ + case SHA_512: /* SHA512 */ + return CH_MK_SIZE_512; + case SHA_224: /* SHA2-224 */ + return CH_MK_SIZE_192; + case SHA_256: /* SHA2-256*/ + return CH_MK_SIZE_256; + case SHA_384: /* SHA384 */ + return CH_MK_SIZE_512; + case SHA1: /* SHA1 */ + default: + return CH_MK_SIZE_160; + } +} + +static unsigned int +get_proto_ver(int proto_ver) +{ + switch (proto_ver) { + case TLS1_2_VERSION: + return TLS_1_2_VERSION; + case TLS1_1_VERSION: + return TLS_1_1_VERSION; + case DTLS1_2_VERSION: + return DTLS_1_2_VERSION; + default: + return TLS_VERSION_MAX; + } +} + +static void +tls_rxkey_flit1(struct tls_keyctx *kwr, struct tls_key_context *kctx) +{ + + if (kctx->state.enc_mode == CH_EVP_CIPH_GCM_MODE) { + kwr->u.rxhdr.ivinsert_to_authinsrt = + htobe64(V_TLS_KEYCTX_TX_WR_IVINSERT(6ULL) | + V_TLS_KEYCTX_TX_WR_AADSTRTOFST(1ULL) | + V_TLS_KEYCTX_TX_WR_AADSTOPOFST(5ULL) | + V_TLS_KEYCTX_TX_WR_AUTHSRTOFST(14ULL) | + V_TLS_KEYCTX_TX_WR_AUTHSTOPOFST(16ULL) | + V_TLS_KEYCTX_TX_WR_CIPHERSRTOFST(14ULL) | + V_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST(0ULL) | + V_TLS_KEYCTX_TX_WR_AUTHINSRT(16ULL)); + kwr->u.rxhdr.ivpresent_to_rxmk_size &= + ~(V_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT(1)); + kwr->u.rxhdr.authmode_to_rxvalid &= + ~(V_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL(1)); + } else { + kwr->u.rxhdr.ivinsert_to_authinsrt = + htobe64(V_TLS_KEYCTX_TX_WR_IVINSERT(6ULL) | + V_TLS_KEYCTX_TX_WR_AADSTRTOFST(1ULL) | + V_TLS_KEYCTX_TX_WR_AADSTOPOFST(5ULL) | + V_TLS_KEYCTX_TX_WR_AUTHSRTOFST(22ULL) | + V_TLS_KEYCTX_TX_WR_AUTHSTOPOFST(0ULL) | + V_TLS_KEYCTX_TX_WR_CIPHERSRTOFST(22ULL) | + V_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST(0ULL) | + V_TLS_KEYCTX_TX_WR_AUTHINSRT(0ULL)); + } +} + +/* Rx key */ +static void +prepare_rxkey_wr(struct tls_keyctx *kwr, struct tls_key_context *kctx) +{ + unsigned int ck_size = kctx->cipher_secret_size; + unsigned int mk_size = kctx->mac_secret_size; + int proto_ver = kctx->proto_ver; + + kwr->u.rxhdr.flitcnt_hmacctrl = + ((kctx->tx_key_info_size >> 4) << 3) | kctx->hmac_ctrl; + + kwr->u.rxhdr.protover_ciphmode = + V_TLS_KEYCTX_TX_WR_PROTOVER(get_proto_ver(proto_ver)) | + V_TLS_KEYCTX_TX_WR_CIPHMODE(kctx->state.enc_mode); + + kwr->u.rxhdr.authmode_to_rxvalid = + V_TLS_KEYCTX_TX_WR_AUTHMODE(kctx->state.auth_mode) | + V_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL(1) | + V_TLS_KEYCTX_TX_WR_SEQNUMCTRL(3) | + V_TLS_KEYCTX_TX_WR_RXVALID(1); + + kwr->u.rxhdr.ivpresent_to_rxmk_size = + V_TLS_KEYCTX_TX_WR_IVPRESENT(0) | + V_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT(1) | + V_TLS_KEYCTX_TX_WR_RXCK_SIZE(get_cipher_key_size(ck_size)) | + V_TLS_KEYCTX_TX_WR_RXMK_SIZE(get_mac_key_size(mk_size)); + + tls_rxkey_flit1(kwr, kctx); + + /* No key reversal for GCM */ + if (kctx->state.enc_mode != CH_EVP_CIPH_GCM_MODE) { + t4_aes_getdeckey(kwr->keys.edkey, kctx->rx.key, + (kctx->cipher_secret_size << 3)); + memcpy(kwr->keys.edkey + kctx->cipher_secret_size, + kctx->rx.key + kctx->cipher_secret_size, + (IPAD_SIZE + OPAD_SIZE)); + } else { + memcpy(kwr->keys.edkey, kctx->rx.key, + (kctx->tx_key_info_size - SALT_SIZE)); + memcpy(kwr->u.rxhdr.rxsalt, kctx->rx.salt, SALT_SIZE); + } +} + +/* Tx key */ +static void +prepare_txkey_wr(struct tls_keyctx *kwr, struct tls_key_context *kctx) +{ + unsigned int ck_size = kctx->cipher_secret_size; + unsigned int mk_size = kctx->mac_secret_size; + + kwr->u.txhdr.ctxlen = + (kctx->tx_key_info_size >> 4); + kwr->u.txhdr.dualck_to_txvalid = + V_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT(1) | + V_TLS_KEYCTX_TX_WR_SALT_PRESENT(1) | + V_TLS_KEYCTX_TX_WR_TXCK_SIZE(get_cipher_key_size(ck_size)) | + V_TLS_KEYCTX_TX_WR_TXMK_SIZE(get_mac_key_size(mk_size)) | + V_TLS_KEYCTX_TX_WR_TXVALID(1); + + memcpy(kwr->keys.edkey, kctx->tx.key, HDR_KCTX_SIZE); + if (kctx->state.enc_mode == CH_EVP_CIPH_GCM_MODE) { + memcpy(kwr->u.txhdr.txsalt, kctx->tx.salt, SALT_SIZE); + kwr->u.txhdr.dualck_to_txvalid &= + ~(V_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT(1)); + } + kwr->u.txhdr.dualck_to_txvalid = htons(kwr->u.txhdr.dualck_to_txvalid); +} + +/* TLS Key memory management */ +int +tls_init_kmap(struct adapter *sc, struct tom_data *td) +{ + + td->key_map = vmem_create("T4TLS key map", sc->vres.key.start, + sc->vres.key.size, 8, 0, M_FIRSTFIT | M_NOWAIT); + if (td->key_map == NULL) + return (ENOMEM); + return (0); +} + +void +tls_free_kmap(struct tom_data *td) +{ + + if (td->key_map != NULL) + vmem_destroy(td->key_map); +} + +static int +get_new_keyid(struct toepcb *toep, struct tls_key_context *k_ctx) +{ + struct tom_data *td = toep->td; + vmem_addr_t addr; + + if (vmem_alloc(td->key_map, TLS_KEY_CONTEXT_SZ, M_NOWAIT | M_FIRSTFIT, + &addr) != 0) + return (-1); + + return (addr); +} + +static void +free_keyid(struct toepcb *toep, int keyid) +{ + struct tom_data *td = toep->td; + + vmem_free(td->key_map, keyid, TLS_KEY_CONTEXT_SZ); +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Mar 13 23:36:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CC2C68BF; Tue, 13 Mar 2018 23:36:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 107FA7C699; Tue, 13 Mar 2018 23:36:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B8DA2065E; Tue, 13 Mar 2018 23:36:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2DNaFP0025633; Tue, 13 Mar 2018 23:36:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DNaFme025632; Tue, 13 Mar 2018 23:36:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803132336.w2DNaFme025632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 13 Mar 2018 23:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330885 - head/sys/modules/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/modules/cam X-SVN-Commit-Revision: 330885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 23:36:16 -0000 Author: imp Date: Tue Mar 13 23:36:15 2018 New Revision: 330885 URL: https://svnweb.freebsd.org/changeset/base/330885 Log: We need opt_compat.h after r330819 and 330820. Add opt_compat.h to fix the stand-alone build case. Sponsored by: Netflix. Modified: head/sys/modules/cam/Makefile Modified: head/sys/modules/cam/Makefile ============================================================================== --- head/sys/modules/cam/Makefile Tue Mar 13 23:05:51 2018 (r330884) +++ head/sys/modules/cam/Makefile Tue Mar 13 23:36:15 2018 (r330885) @@ -8,6 +8,7 @@ KMOD= cam # See sys/conf/options for the flags that go into the different opt_*.h files. SRCS= opt_cam.h +SRCS= opt_compat.h SRCS+= opt_ada.h SRCS+= opt_scsi.h SRCS+= opt_cd.h From owner-svn-src-head@freebsd.org Tue Mar 13 23:37:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FE636A50; Tue, 13 Mar 2018 23:37:34 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 032517C835; Tue, 13 Mar 2018 23:37:34 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F261B20661; Tue, 13 Mar 2018 23:37:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2DNbXHO025718; Tue, 13 Mar 2018 23:37:33 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DNbXDi025717; Tue, 13 Mar 2018 23:37:33 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201803132337.w2DNbXDi025717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 13 Mar 2018 23:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330886 - head/share/examples X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/share/examples X-SVN-Commit-Revision: 330886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 23:37:34 -0000 Author: dteske Date: Tue Mar 13 23:37:33 2018 New Revision: 330886 URL: https://svnweb.freebsd.org/changeset/base/330886 Log: Install files added in SVN's r295373, r295457, r295542 Reported by: woodsb02 MFC after: 3 days X-MFC to: stable/11 Modified: head/share/examples/Makefile Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Tue Mar 13 23:36:15 2018 (r330885) +++ head/share/examples/Makefile Tue Mar 13 23:37:33 2018 (r330886) @@ -76,6 +76,12 @@ XFILES= BSD_daemon/FreeBSD.pfa \ indent/indent.pro \ ipfw/change_rules.sh \ jails/README \ + jails/VIMAGE \ + jails/jail.xxx.conf \ + jails/jib \ + jails/jng \ + jails/rc.conf.jails \ + jails/rcjail.xxx.conf \ kld/Makefile \ kld/cdev/Makefile \ kld/cdev/README \ From owner-svn-src-head@freebsd.org Wed Mar 14 00:05:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6B15F2D3A1; Wed, 14 Mar 2018 00:04:59 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 446847DB0F; Wed, 14 Mar 2018 00:04:59 +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 3CDDA20B15; Wed, 14 Mar 2018 00:04:59 +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 w2E04xU0040380; Wed, 14 Mar 2018 00:04:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2E04w3k040374; Wed, 14 Mar 2018 00:04:58 GMT (envelope-from np@FreeBSD.org) Message-Id: <201803140004.w2E04w3k040374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 14 Mar 2018 00:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330887 - head/usr.sbin/cxgbetool X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/usr.sbin/cxgbetool X-SVN-Commit-Revision: 330887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 00:05:00 -0000 Author: np Date: Wed Mar 14 00:04:58 2018 New Revision: 330887 URL: https://svnweb.freebsd.org/changeset/base/330887 Log: cxgbetool(8): Add the ability to decode hardware TCBs. Obtained from: Chelsio Communications MFC after: 1 week Sponsored by: Chelsio Communications Added: head/usr.sbin/cxgbetool/tcb_common.c (contents, props changed) head/usr.sbin/cxgbetool/tcb_common.h (contents, props changed) head/usr.sbin/cxgbetool/tcbinfot4.c (contents, props changed) head/usr.sbin/cxgbetool/tcbinfot5.c (contents, props changed) head/usr.sbin/cxgbetool/tcbinfot6.c (contents, props changed) head/usr.sbin/cxgbetool/tcbshowt4.c (contents, props changed) head/usr.sbin/cxgbetool/tcbshowt5.c (contents, props changed) head/usr.sbin/cxgbetool/tcbshowt6.c (contents, props changed) Modified: head/usr.sbin/cxgbetool/Makefile head/usr.sbin/cxgbetool/cxgbetool.c Directory Properties: head/usr.sbin/cxgbetool/reg_defs_t5.c (props changed) head/usr.sbin/cxgbetool/reg_defs_t6.c (props changed) Modified: head/usr.sbin/cxgbetool/Makefile ============================================================================== --- head/usr.sbin/cxgbetool/Makefile Tue Mar 13 23:37:33 2018 (r330886) +++ head/usr.sbin/cxgbetool/Makefile Wed Mar 14 00:04:58 2018 (r330887) @@ -2,6 +2,11 @@ PROG= cxgbetool MAN= cxgbetool.8 +SRCS= cxgbetool.c +SRCS+= tcb_common.c +SRCS+= tcbinfot4.c tcbshowt4.c +SRCS+= tcbinfot5.c tcbshowt5.c +SRCS+= tcbinfot6.c tcbshowt6.c CFLAGS+= -I${SRCTOP}/sys/dev/cxgbe -I${SRCTOP}/sys -I. WARNS?= 2 Modified: head/usr.sbin/cxgbetool/cxgbetool.c ============================================================================== --- head/usr.sbin/cxgbetool/cxgbetool.c Tue Mar 13 23:37:33 2018 (r330886) +++ head/usr.sbin/cxgbetool/cxgbetool.c Wed Mar 14 00:04:58 2018 (r330887) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include "t4_ioctl.h" +#include "tcb_common.h" #define in_range(val, lo, hi) ( val < 0 || (val <= hi && val >= lo)) #define max(x, y) ((x) > (y) ? (x) : (y)) @@ -2102,6 +2103,7 @@ memdump(int argc, const char *argv[]) static void show_tcb(uint32_t *buf, uint32_t len) { + unsigned char *tcb = (unsigned char *)buf; const char *s; int i, n = 8; @@ -2112,6 +2114,10 @@ show_tcb(uint32_t *buf, uint32_t len) } printf("\n"); } + set_tcb_info(TIDTYPE_TCB, chip_id); + set_print_style(PRNTSTYL_COMP); + swizzle_tcb(tcb); + parse_n_display_xcb(tcb); } #define A_TP_CMM_TCB_BASE 0x7d10 Added: head/usr.sbin/cxgbetool/tcb_common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/cxgbetool/tcb_common.c Wed Mar 14 00:04:58 2018 (r330887) @@ -0,0 +1,703 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "tcb_common.h" + +/***:----------------------------------------------------------------------- + ***: externals + ***:----------------------------------------------------------------------- + */ + +extern _TCBVAR g_tcb_info4[]; +extern _TCBVAR g_scb_info4[]; +extern _TCBVAR g_fcb_info4[]; +extern void t4_display_tcb_aux_0(_TCBVAR *tvp,int aux); +extern void t4_display_tcb_aux_1(_TCBVAR *tvp,int aux); +extern void t4_display_tcb_aux_2(_TCBVAR *tvp,int aux); +extern void t4_display_tcb_aux_3(_TCBVAR *tvp,int aux); + +extern _TCBVAR g_tcb_info5[]; +extern _TCBVAR g_scb_info5[]; +extern _TCBVAR g_fcb_info5[]; +extern void t5_display_tcb_aux_0(_TCBVAR *tvp,int aux); +extern void t5_display_tcb_aux_1(_TCBVAR *tvp,int aux); +extern void t5_display_tcb_aux_2(_TCBVAR *tvp,int aux); +extern void t5_display_tcb_aux_3(_TCBVAR *tvp,int aux); + +extern _TCBVAR g_tcb_info6[]; +extern _TCBVAR g_scb_info6[]; +extern _TCBVAR g_fcb_info6[]; +extern void t6_display_tcb_aux_0(_TCBVAR *tvp,int aux); +extern void t6_display_tcb_aux_1(_TCBVAR *tvp,int aux); +extern void t6_display_tcb_aux_2(_TCBVAR *tvp,int aux); +extern void t6_display_tcb_aux_3(_TCBVAR *tvp,int aux); +extern void t6_display_tcb_aux_4(_TCBVAR *tvp,int aux); + +/***:----------------------------------------------------------------------- + ***: globals + ***:----------------------------------------------------------------------- + */ + +_TCBVAR *g_tcb_info=g_tcb_info5; +_TCBVAR *g_scb_info=g_scb_info5; +_TCBVAR *g_fcb_info=g_fcb_info5; +static int g_tN=0; + +static int g_prntstyl=PRNTSTYL_COMP; + +static int g_got_scb=0; +static int g_got_fcb=0; + + +/***:----------------------------------------------------------------------- +***: error exit functions +***:----------------------------------------------------------------------- +*/ + +/**: err_exit functions +*: ------------------ +*/ + +void tcb_prflush(void) +{ + fflush(stdout); + fflush(stderr); +} + + +void tcb_code_err_exit(char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + printf("Coding Error in: "); + vprintf(fmt, args); + printf("\n"); + tcb_prflush(); + va_end(args); + exit(1); +} + +/***:----------------------------------------------------------------------- +***: tcb_hexdump functions +***:----------------------------------------------------------------------- +*/ + +void +tcb_hexdump(unsigned base, unsigned char *buf, unsigned int size) +{ + unsigned offset; + + for (offset = 0; offset < size; ++offset) { + if (!(offset % 16)) printf("\n0x%4.4x: ", base + offset); + else if (!(offset % 8)) printf(" "); + printf("%2.2x ", (unsigned char)buf[offset]); + } +} + +int tcb_strmatch_nc(char *cs, char *ct) { + while (*cs) + if (tolower(*cs++) != tolower(*ct++)) return (FALSE); + return (!(*ct)); /*return TRUE if *ct NULL at same time as *cs==NULL*/ +} + + +/*: ------------------------------------------------------------------------- +string functions +tcb_strmatch_nc: Similar to exact match, but case insensitive. +*/ + + +int +tcb_strncmp_nc(char *cs, char *ct, int n) +{ + /*case insensitive version of the standard strncmp() function */ + int i = 0; + int ret; + + + ret = 0; + for (i = 0; i < n && 0 == ret && !(EOS == *cs && EOS == *ct); ++i) { + /* this is weird, but it matched GCC linux when strings don't + * have any upper case characters. + */ + ret = tolower(*cs++) - tolower(*ct++); + } + return ret; +} + +int +tcb_startswith_nc(char *cs, char *ct) +{ /* return true if cs start with ct */ + return (0 == tcb_strncmp_nc(cs, ct, (int)strlen(ct))); +} + + + + +/***:----------------------------------------------------------------------- + ***: START OF WINDOWS FUNCTIONS + ***:----------------------------------------------------------------------- + */ + + +/***:----------------------------------------------------------------------- + ***: print utilties + ***:----------------------------------------------------------------------- + */ + +static int g_PR_indent=1; + +void PR(char *fmt, ...) +{ + int fmt_len; + va_list args; + va_start(args,fmt); + + if (g_PR_indent) printf(" "); + g_PR_indent=0; + fmt_len=(int) strlen(fmt); + if (fmt_len>0 && fmt[fmt_len-1]=='\n') g_PR_indent=1; + + vprintf(fmt,args); + tcb_prflush(); + va_end(args); +} + + +/***:----------------------------------------------------------------------- + ***: val() + ***:----------------------------------------------------------------------- + */ + +_TCBVAR * +lu_tcbvar(char *name) +{ + _TCBVAR *tvp=g_tcb_info; + + while (tvp->name!=NULL) { + if (tcb_strmatch_nc(name,tvp->name)) return tvp; + else if (tcb_strmatch_nc(name,tvp->aka )) return tvp; + tvp+=1; + } + tcb_code_err_exit("lu_tcbvar: bad name %s\n",name); + return NULL; +} + +unsigned +val(char *name) +{ + _TCBVAR *tvp; + + tvp=lu_tcbvar(name); + return tvp->val; +} + +ui64 +val64(char *name) +{ + _TCBVAR *tvp; + + tvp=lu_tcbvar(name); + return tvp->rawval; +} + + + +/***:----------------------------------------------------------------------- + ***: get_tcb_bits + ***:----------------------------------------------------------------------- + */ + + +static int +get_tcb_bit(unsigned char *A, int bit) +{ + int ret=0; + int ix,shift; + + ix = 127 - (bit>>3); + shift=bit&0x7; + /* prdbg(" ix: %u, shift=%u\n",ix,shift); */ + ret=(A[ix] >> shift) & 1; + return ret; +} + +static ui64 +get_tcb_bits (unsigned char *A, int hi, int lo) +{ + ui64 ret=0; + + if (lo>hi) { + int temp=lo; + lo=hi; + hi=temp; + } + + while (hi>=lo) { + ret = (ret<<1) | get_tcb_bit(A,hi); + --hi; + } + + return ret; +} + + +void +decompress_val(_TCBVAR *tvp,unsigned ulp_type,unsigned tx_max, + unsigned rcv_nxt,unsigned rx_frag0_start_idx_raw) +{ + unsigned rawval=(unsigned) tvp->rawval; + + switch(tvp->comp) { + case COMP_NONE: tvp->val=rawval; break; + case COMP_ULP: tvp->val=rawval; break; + case COMP_TX_MAX: + tvp->val=(tx_max - rawval) & 0xFFFFFFFF; + break; + case COMP_RCV_NXT: + if (tcb_startswith_nc(tvp->name,"rx_frag")) { + unsigned fragx=0; + if (!tcb_strmatch_nc(tvp->name,"rx_frag0_start_idx_raw")) + fragx=rawval; + tvp->val=(rcv_nxt+rx_frag0_start_idx_raw+fragx) & 0xFFFFFFFF; + } else { + tvp->val=(rcv_nxt - rawval) & 0xFFFFFFFF; + } + break; + case COMP_PTR: tvp->val=rawval; break; + case COMP_LEN: + { + tvp->val=rawval; + if (PM_MODE_RDDP==ulp_type || PM_MODE_DDP==ulp_type || + PM_MODE_IANDP==ulp_type) { + /* TP does this internally. Not sure if I should show the + * unaltered value or the raw value. For now I + * will diplay the raw value. For now I've added the code + * mainly to stop windows compiler from warning about ulp_type + * being an unreferenced parameter. + */ + tvp->val=0; + tvp->val=rawval; /* comment this out to display altered value */ + } + } + break; + default: + tcb_code_err_exit("decompress_val, bad switch: %d",tvp->comp); + break; + } + + + +} + + +void +get_tcb_field(_TCBVAR *tvp,unsigned char *buf) +{ + assert(tvp->hi-tvp->lo+1<=64); + assert(tvp->hi>=tvp->lo); + + tvp->rawval=get_tcb_bits(buf,tvp->lo,tvp->hi); + /* assume no compression and 32-bit value for now */ + tvp->val=(unsigned) (tvp->rawval & 0xFFFFFFFF); + + +} + + +/***:----------------------------------------------------------------------- + ***: spr_* functions + ***:----------------------------------------------------------------------- + */ + +char * +spr_tcp_state (unsigned state) +{ + char *ret="UNKNOWN"; + + if ( 0 == state) {ret = "CLOSED";} + else if ( 1 == state) {ret = "LISTEN";} + else if ( 2 == state) {ret = "SYN_SENT";} + else if ( 3 == state) {ret = "SYN_RCVD";} + else if ( 4 == state) {ret = "ESTABLISHED";} + else if ( 5 == state) {ret = "CLOSE_WAIT";} + else if ( 6 == state) {ret = "FIN_WAIT_1";} + else if ( 7 == state) {ret = "CLOSING";} + else if ( 8 == state) {ret = "LAST_ACK";} + else if ( 9 == state) {ret = "FIN_WAIT_2";} + else if (10 == state) {ret = "TIME_WAIT";} + else if (11 == state) {ret = "ESTABLISHED_RX";} + else if (12 == state) {ret = "ESTABLISHED_TX";} + else if (13 == state) {ret = "SYN_PEND";} + else if (14 == state) {ret = "ESC_1_STATE";} + else if (15 == state) {ret = "ESC_2_STATE";} + + return ret; +} + +char * +spr_cctrl_sel(unsigned sel0,unsigned sel1) +{ + unsigned sel=(sel1<<1) | sel0; + char *ret="UNKNOWN"; + + if ( 0 == sel) {ret = "Reno";} + else if ( 1 == sel) {ret = "Tahoe";} + else if ( 2 == sel) {ret = "NewReno";} + else if ( 3 == sel) {ret = "HighSpeed";} + + return ret; +} + + +char * +spr_ulp_type(unsigned ulp_type) +{ + char *ret="UNKNOWN"; + + /*The tp.h PM_MODE_XXX call 1 DDP and 5 IANDP, but external + * documentation (tcb.h" calls 5 ddp, and doesn't mention 1 or 3. + */ + + if ( PM_MODE_PASS == ulp_type) {ret = "TOE";} + else if ( PM_MODE_DDP == ulp_type) {ret = "DDP";} + else if ( PM_MODE_ISCSI == ulp_type) {ret = "ISCSI";} + else if ( PM_MODE_IWARP == ulp_type) {ret = "IWARP";} + else if ( PM_MODE_RDDP == ulp_type) {ret = "RDMA";} + else if ( PM_MODE_IANDP == ulp_type) {ret = "IANDP_DDP";} + else if ( PM_MODE_FCOE == ulp_type) {ret = "FCoE";} + else if ( PM_MODE_USER == ulp_type) {ret = "USER";} + else if ( PM_MODE_TLS == ulp_type) {ret = "TLS";} + else if ( PM_MODE_DTLS == ulp_type) {ret = "DTLS";} + + return ret; +} + +char * +spr_ip_version(unsigned ip_version) +{ + char *ret="UNKNOWN"; + + if ( 0 == ip_version) {ret = "IPv4";} + else if ( 1 == ip_version) {ret = "IPv6";} + + return ret; +} + + + +/***:----------------------------------------------------------------------- + ***: display_tcb() + ***:----------------------------------------------------------------------- + */ + +void +display_tcb_compressed(_TCBVAR *tvp,int aux) +{ + + if (g_tN==4) { + t4_display_tcb_aux_0(tvp,aux); + if (1==aux) t4_display_tcb_aux_1(tvp,aux); + else if (2==aux) t4_display_tcb_aux_2(tvp,aux); + else if (3==aux) t4_display_tcb_aux_3(tvp,aux); + + } else if (g_tN==5) { + t5_display_tcb_aux_0(tvp,aux); + if (1==aux) t5_display_tcb_aux_1(tvp,aux); + else if (2==aux) t5_display_tcb_aux_2(tvp,aux); + else if (3==aux) t5_display_tcb_aux_3(tvp,aux); + } else if (g_tN==6) { + t6_display_tcb_aux_0(tvp,aux); + if (1==aux) t6_display_tcb_aux_1(tvp,aux); + else if (2==aux) t6_display_tcb_aux_2(tvp,aux); + else if (3==aux) t6_display_tcb_aux_3(tvp,aux); + else if (4==aux) t6_display_tcb_aux_4(tvp,aux); + } +} + + + + +/***:----------------------------------------------------------------------- + ***: parse_n_decode_tcb + ***:----------------------------------------------------------------------- + */ + + +unsigned +parse_tcb( _TCBVAR *base_tvp, unsigned char *buf) +{ /* parse the TCB */ + _TCBVAR *tvp=base_tvp; + unsigned ulp_type; + int aux=1; /* assume TOE or iSCSI */ + unsigned tx_max=0, rcv_nxt=0, rx_frag0_start_idx_raw=0; + int got_tx_max=0, got_rcv_nxt=0, got_rx_frag0_start_idx_raw=0; + + + /* parse the TCB */ + while (tvp->name!=NULL) { + get_tcb_field(tvp,buf); + if (!got_tx_max && tcb_strmatch_nc("tx_max",tvp->name)) { + tx_max=tvp->val; + got_tx_max=1; + } + if (!got_rcv_nxt && tcb_strmatch_nc("rcv_nxt",tvp->name)) { + rcv_nxt=tvp->val; + got_rcv_nxt=1; + } + if (!got_rx_frag0_start_idx_raw && + tcb_strmatch_nc("rx_frag0_start_idx_raw",tvp->name)) { + rx_frag0_start_idx_raw=tvp->val; + got_rx_frag0_start_idx_raw=1; + } + tvp+=1; + } + + tvp=base_tvp; + ulp_type=tvp->val; /* ULP type is always first variable in TCB */ + if (PM_MODE_IANDP==ulp_type || PM_MODE_FCOE==ulp_type) aux=3; + else if (PM_MODE_RDDP==ulp_type) aux=2; + else if (6==g_tN && (PM_MODE_TLS==ulp_type || PM_MODE_DTLS==ulp_type)) aux=4; + else aux=1; + + assert(got_tx_max && got_rcv_nxt && got_rx_frag0_start_idx_raw); + + /* decompress the compressed values */ + tvp=base_tvp; + while (tvp->name!=NULL) { + decompress_val(tvp,ulp_type,tx_max,rcv_nxt,rx_frag0_start_idx_raw); + tvp+=1; + } + + return aux; +} + + + +void +parse_scb( _TCBVAR *base_tvp, unsigned char *buf) +{ /* parse the SCB */ + _TCBVAR *tvp=base_tvp; + + while (tvp->name!=NULL) { + if (tcb_strmatch_nc("scb_slush",tvp->name)) { + /* the scb_slush field is all of remaining memory */ + tvp->rawval=0; + tvp->val=0; + } else { + get_tcb_field(tvp,buf); + } + tvp+=1; + } +} + + +void +parse_fcb( _TCBVAR *base_tvp, unsigned char *buf) +{ /* parse the FCB */ + _TCBVAR *tvp=base_tvp; + + while (tvp->name!=NULL) { + get_tcb_field(tvp,buf); + tvp+=1; + } +} + + +void +display_list_tcb(_TCBVAR *base_tvp,int aux) +{ + _TCBVAR *tvp=base_tvp; + while (tvp->name!=NULL) { + if (tvp->aux==0 || tvp->aux==aux) { + if (tvp->hi-tvp->lo+1<=32) { + printf(" %4d:%4d %31s: %10u (0x%1x)",tvp->lo,tvp->hi,tvp->name, + (unsigned) tvp->rawval,(unsigned) tvp->rawval); + if (COMP_TX_MAX==tvp->comp || COMP_RCV_NXT==tvp->comp) + printf(" -> %1u (0x%x)", tvp->val,tvp->val); + } else { + printf(" %4d:%4d %31s: 0x%1llx",tvp->lo,tvp->hi,tvp->name, + tvp->rawval); + } + printf("\n"); + } + tvp+=1; + } +} + +void +display_tcb(_TCBVAR *tvp,unsigned char *buf,int aux) +{ + if (g_prntstyl==PRNTSTYL_VERBOSE || + g_prntstyl==PRNTSTYL_RAW) { + tcb_hexdump(0,buf,128); + printf("\n"); + } + + if (g_prntstyl==PRNTSTYL_VERBOSE || + g_prntstyl==PRNTSTYL_LIST) { + display_list_tcb(tvp,aux); + } + + if (g_prntstyl==PRNTSTYL_VERBOSE || + g_prntstyl==PRNTSTYL_COMP) { + display_tcb_compressed(tvp,aux); + } + +} + +void +parse_n_display_tcb(unsigned char *buf) +{ + _TCBVAR *tvp=g_tcb_info; + int aux; + + aux=parse_tcb(tvp,buf); + display_tcb(tvp,buf,aux); +} + +void +parse_n_display_scb(unsigned char *buf) +{ + _TCBVAR *tvp=g_scb_info; + + parse_scb(tvp,buf); + if (g_prntstyl==PRNTSTYL_VERBOSE || + g_prntstyl==PRNTSTYL_RAW) { + tcb_hexdump(0,buf,128); + printf("\n"); + } + if (g_prntstyl==PRNTSTYL_VERBOSE || + g_prntstyl==PRNTSTYL_LIST || + g_prntstyl==PRNTSTYL_COMP) { + display_list_tcb(tvp,0); + } +} + +void +parse_n_display_fcb(unsigned char *buf) +{ + _TCBVAR *tvp=g_fcb_info; + + parse_fcb(tvp,buf); + if (g_prntstyl==PRNTSTYL_VERBOSE || + g_prntstyl==PRNTSTYL_RAW) { + tcb_hexdump(0,buf,128); + printf("\n"); + } + + if (g_prntstyl==PRNTSTYL_VERBOSE || + g_prntstyl==PRNTSTYL_LIST || + g_prntstyl==PRNTSTYL_COMP) { + display_list_tcb(tvp,0); + } +} + +void +parse_n_display_xcb(unsigned char *buf) +{ + if (g_got_scb) parse_n_display_scb(buf); + else if (g_got_fcb) parse_n_display_fcb(buf); + else parse_n_display_tcb(buf); +} + +/***:----------------------------------------------------------------------- + ***: swizzle_tcb + ***:----------------------------------------------------------------------- + */ + +void +swizzle_tcb(unsigned char *buf) +{ + int i,j,k; + + for (i=0, j=128-16 ; i +#include +#include +#include +#include +#include + + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef EOS +#define EOS '\0' +#endif + +#ifndef __variable_sizes + +/* windows has _UI64_MAX. C99 has ULLONG_MAX, but I don't compile +with C99 for portability with windows, so the ui64 is a guess. +I'll add an assert to cl_main to confirm these sizes are accurate. +*/ +#ifdef _UI64_MAX /* windows */ +#if (_UI64_MAX == 0xFFFFFFFFFFFFFFFF) +typedef __int64 si64; +typedef unsigned __int64 ui64; +#endif +#else /*else of #ifdef _UI64_MAX */ +typedef long long int si64; +typedef unsigned long long int ui64; +#endif /*endif of #ifdef _UI64_MAX */ +#endif /* endif of #ifndef __variable_sizes */ + + + + +typedef struct tcb_var { + char *name; + int aux; + int lo; + int hi; + + char *faka; + int flo; + int fhi; + + char *aka; + + int comp; + + char *desc; + char *akadesc; + + ui64 rawval; + unsigned val; + +} _TCBVAR; + + +enum comp_types { + + COMP_NONE=0, + COMP_ULP, + COMP_TX_MAX, + COMP_RCV_NXT, + COMP_PTR, + COMP_LEN, + +}; + + +enum tidtypes { + TIDTYPE_TCB=0, + TIDTYPE_SCB=1, + TIDTYPE_FCB=2, + +}; + + +enum prntstyls { + PRNTSTYL_VERBOSE=0, + PRNTSTYL_LIST=1, + PRNTSTYL_COMP=2, + PRNTSTYL_RAW=3, + +}; + + +/* from tp/src/tp.h */ +#define PM_MODE_PASS 0 +#define PM_MODE_DDP 1 +#define PM_MODE_ISCSI 2 +#define PM_MODE_IWARP 3 +#define PM_MODE_RDDP 4 +#define PM_MODE_IANDP 5 +#define PM_MODE_FCOE 6 +#define PM_MODE_USER 7 +#define PM_MODE_TLS 8 +#define PM_MODE_DTLS 9 + + + +#define SEQ_ADD(a,b) (((a)+(b)) & 0xFFFFFFFF) +#define SEQ_SUB(a,b) (((a)-(b)) & 0xFFFFFFFF) + +///* functions needed by the tcbshowtN.c code */ +extern unsigned val(char *name); +extern ui64 val64(char *name); +extern void PR(char *fmt, ...); +extern char *spr_tcp_state(unsigned state); +extern char *spr_ip_version(unsigned ipver); +extern char *spr_cctrl_sel(unsigned cctrl_sel0,unsigned cctrl_sel1); +extern char *spr_ulp_type(unsigned ulp_type); + + +extern unsigned parse_tcb( _TCBVAR *base_tvp, unsigned char *buf); +extern void display_tcb(_TCBVAR *tvp,unsigned char *buf,int aux); +extern void parse_n_display_xcb(unsigned char *buf); + +extern void swizzle_tcb(unsigned char *buf); +extern void set_tidtype(unsigned int tidtype); +extern void set_tcb_info(unsigned int tidtype, unsigned int cardtype); +extern void set_print_style(unsigned int prntstyl); + +#endif /* __tcb_common_h */ Added: head/usr.sbin/cxgbetool/tcbinfot4.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/cxgbetool/tcbinfot4.c Wed Mar 14 00:04:58 2018 (r330887) @@ -0,0 +1,1423 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* Auto-generated file. Avoid direct editing. */ +/* Edits will be lost when file regenerated. */ +#include +#include "tcb_common.h" +_TCBVAR g_tcb_info4[]={ + {"ulp_type" , 0, 0, 3, /* name,aux,lo,hi */ + NULL , 0, 0, /* faka,flo,fhi */ + "ulp_type" , /* aka */ + COMP_NONE , /* comp */ + "ULP mode: 0 =toe, 2=iscsi, 4=rdma, 5=ddp, remaining values are reserved", /*desc*/ + NULL, /*akadesc */ + }, + {"ulp_raw" , 0, 4, 11, /* name,aux,lo,hi */ + NULL , 0, 0, /* faka,flo,fhi */ + "ulp" , /* aka */ + COMP_ULP , /* comp */ + "ULP subtype", /*desc*/ + NULL, /*akadesc */ + }, + {"l2t_ix" , 0, 12, 23, /* name,aux,lo,hi */ + NULL , 0, 0, /* faka,flo,fhi */ + "l2t_ix" , /* aka */ + COMP_NONE , /* comp */ + "Destination MAC address index", /*desc*/ + NULL, /*akadesc */ + }, + {"smac_sel" , 0, 24, 31, /* name,aux,lo,hi */ + NULL , 0, 0, /* faka,flo,fhi */ + "smac_sel" , /* aka */ + COMP_NONE , /* comp */ + "Source MAC address index", /*desc*/ + NULL, /*akadesc */ + }, + {"TF_MIGRATING" , 0, 32, 32, /* name,aux,lo,hi */ + "t_flags" , 0, 0, /* faka,flo,fhi */ + "migrating" , /* aka */ + COMP_NONE , /* comp */ + NULL, /*desc*/ + NULL, /*akadesc */ + }, + {"TF_NON_OFFLOAD" , 0, 33, 33, /* name,aux,lo,hi */ + "t_flags" , 1, 1, /* faka,flo,fhi */ + "non_offload" , /* aka */ + COMP_NONE , /* comp */ + NULL, /*desc*/ + NULL, /*akadesc */ + }, + {"TF_LOCK_TID" , 0, 34, 34, /* name,aux,lo,hi */ + "t_flags" , 2, 2, /* faka,flo,fhi */ + "lock_tid" , /* aka */ + COMP_NONE , /* comp */ + NULL, /*desc*/ + NULL, /*akadesc */ + }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Mar 14 00:07:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B7A6F2D734; Wed, 14 Mar 2018 00:07:41 +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 DFEAF7DD13; Wed, 14 Mar 2018 00:07:40 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 9E6045A9F12; Wed, 14 Mar 2018 00:07:39 +0000 (UTC) Date: Wed, 14 Mar 2018 00:07:39 +0000 From: Brooks Davis To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330885 - head/sys/modules/cam Message-ID: <20180314000739.GA22416@spindle.one-eyed-alien.net> References: <201803132336.w2DNaFme025632@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline In-Reply-To: <201803132336.w2DNaFme025632@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 00:07:41 -0000 --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 13, 2018 at 11:36:15PM +0000, Warner Losh wrote: > Author: imp > Date: Tue Mar 13 23:36:15 2018 > New Revision: 330885 > URL: https://svnweb.freebsd.org/changeset/base/330885 >=20 > Log: > We need opt_compat.h after r330819 and 330820. > =20 > Add opt_compat.h to fix the stand-alone build case. Sorry about that. I only tested with buildkernel. I'll MFC this before either of those. -- Brooks --J2SCkAp4GZ/dPZZf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJaqGfLAAoJEKzQXbSebgfADXkH/jLwcW3zsKw/NRFITzdTGP8w 2QhaoV06tL0coyW5hjryjXfEXeamOCh1ubg7sNvNCpgM3xDgJAWyu9oG62NpdNdz y0wA8t6nheaeOk2Ak8mIqjH08E0WCqQ7SgQj0gdq1IcXF1NCliMQMDpsEmT8lDtc QUPzhSki8jc5GablzBgrmQs/VmYk2Lnf0Una8CWiceLDrs6nTsNgJ4FlZ8QYENZN aYL616bLbA1c8JeehKFq2l1JNW/SPLLbgivv7JH1g4x2s/y7zE2AEgKjXe3LHYcz cs/pefp3evdcGve2zdKivGgCIukp4ERcHtA0NCdsGFonWs4R2Wozu2rrLaD75FY= =Qr28 -----END PGP SIGNATURE----- --J2SCkAp4GZ/dPZZf-- From owner-svn-src-head@freebsd.org Wed Mar 14 02:35:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DD87F4315A; Wed, 14 Mar 2018 02:35: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 242C8835D7; Wed, 14 Mar 2018 02:35:50 +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 1BDEA221D5; Wed, 14 Mar 2018 02:35:50 +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 w2E2Zn3L014920; Wed, 14 Mar 2018 02:35:49 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2E2ZnqF014919; Wed, 14 Mar 2018 02:35:49 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803140235.w2E2ZnqF014919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 14 Mar 2018 02:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330891 - head/stand/uboot/common X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/uboot/common X-SVN-Commit-Revision: 330891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 02:35:50 -0000 Author: kevans Date: Wed Mar 14 02:35:49 2018 New Revision: 330891 URL: https://svnweb.freebsd.org/changeset/base/330891 Log: ubldr: Bump heap size from 512K to 1M lualoader in itself only uses another ~200K, but there seems to be no reason not to bump it a little higher to give us some more wiggle room. With this, I can boot using a menu-enabled lualoader, no problem and reasonably fast. Some heap usage datapoints from the review: forthloader, no menus, kernel loaded: heap base at 0x1203d5b0, top at 0x1208e000, used 330320 lualoader, no menus, kernel loaded: heap base at 0x42050028, top at 0x420ab000, used 372696 lualoader, menus, kernel loaded: heap base at 0x42050028, top at 0x420d5000, used 544728 Since then, the no menu case for lualoader should have decreased slightly as I've made some changes to make sure that it no longer loads any of th emenu bits with beastie disabled. While here, split heap size out into a HEAP_SIZE macro. Reviewed by: ian, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14471 Modified: head/stand/uboot/common/main.c Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Wed Mar 14 01:38:47 2018 (r330890) +++ head/stand/uboot/common/main.c Wed Mar 14 02:35:49 2018 (r330891) @@ -41,6 +41,10 @@ __FBSDID("$FreeBSD$"); #define nitems(x) (sizeof((x)) / sizeof((x)[0])) #endif +#ifndef HEAP_SIZE +#define HEAP_SIZE (1 * 1024 * 1024) +#endif + struct uboot_devdesc currdev; struct arch_switch archsw; /* MI/MD interface boundary */ int devs_no; @@ -421,7 +425,7 @@ main(int argc, char **argv) * of our bss and the bottom of the u-boot stack to avoid overlap. */ uboot_heap_start = round_page((uintptr_t)end); - uboot_heap_end = uboot_heap_start + 512 * 1024; + uboot_heap_end = uboot_heap_start + HEAP_SIZE; setheap((void *)uboot_heap_start, (void *)uboot_heap_end); /* From owner-svn-src-head@freebsd.org Wed Mar 14 02:45:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3A3CF43C0B for ; Wed, 14 Mar 2018 02:45:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C3EE83C30 for ; Wed, 14 Mar 2018 02:45:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22f.google.com with SMTP id d13-v6so2695364itf.0 for ; Tue, 13 Mar 2018 19:45:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=681Yubwpa9XEuCFXlVnvIwxe9ncjhQp20ZyNdG1+jus=; b=0WuSp10gn3v33Aqhivlt4hecSq9SWaY9NB2Hi77SGVm+zjV3Vxx8R7+JSPduHyR/Br tP/apYrAChc9H37+zJ+e4lg+S2BQvJHNYEr/fDt5c4vDI86VFYiEEUODqzi6k63FMEHH SLeVmuqhcMshOeGNsiLtUotavD1ne47NOU/AhR2qGqpp2qvZksyouVTyoaPeaK4MtYE7 MhUS3P2wujAb/6sRxj5ZRGpBWx7ArOSmlf9Om8QwaKd6yMvEYeDl/IZ98jK3ecc1fXVA HfcOO2rpjDtoPETep7K3u+9za7ZsrTXrWuE/u8mNrBBqWNGLhLwmQzSvX3Qn+N5tQS8M 5i4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=681Yubwpa9XEuCFXlVnvIwxe9ncjhQp20ZyNdG1+jus=; b=IQ2CJktoHwY5rYJzgWvaRz/WYfXLjeAlFqm+bh0tXAc5j5/ERVg1xRYi4rQt0HsBUL FGxBagoU/r7EuUSdnDnzCn3zvhjb3aRLU1rpZdQS8cDB/dkUBKEp/zKEXqBNKhIxDgrn dlc2HfkpjRWW+wMeFrhy4Oh01hwJkUkgqnIQPZV6EUIew2MBzBH/9V0K3GgRZgcJr2JH a3q7m6MVaAmy8EVFnCAEDkkBoBr8gTyXTpzCQuQ6WXgYvK129qYlVxqIbo9jBdPkYA4T 7aNrdMFn5n339Q4DmkPzyDqFpfo7NYip1Yqq1Uei4CQ1zKBzGRpFOc88BXedocRZNSvQ bxwg== X-Gm-Message-State: AElRT7GUF40yUgdhYwjxtu97aK0bPH/gEVifVdYshz85vtDpTSaPCYC4 7MFTH7ufYbVqPvR059Ek7481bs10JR0mqe0huPMgcA== X-Google-Smtp-Source: AG47ELs7FvzFjYs6v3TqvXJL77i9NAyMGimxykxpwYRgOAwJlXHj+QPODUJbTCEx7fyIh2MhUzAF9zqCp0GcvEkZyUY= X-Received: by 2002:a24:6f04:: with SMTP id x4-v6mr312559itb.51.1520995543553; Tue, 13 Mar 2018 19:45:43 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Tue, 13 Mar 2018 19:45:41 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:bcea:d775:d975:818] Received: by 10.79.203.196 with HTTP; Tue, 13 Mar 2018 19:45:41 -0700 (PDT) In-Reply-To: <20180314000739.GA22416@spindle.one-eyed-alien.net> References: <201803132336.w2DNaFme025632@repo.freebsd.org> <20180314000739.GA22416@spindle.one-eyed-alien.net> From: Warner Losh Date: Tue, 13 Mar 2018 20:45:41 -0600 X-Google-Sender-Auth: wl3g4fTl57Ce8T1BpNTCRiq1Ejg Message-ID: Subject: Re: svn commit: r330885 - head/sys/modules/cam To: Brooks Davis Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 02:45:45 -0000 On Mar 13, 2018 6:07 PM, "Brooks Davis" wrote: On Tue, Mar 13, 2018 at 11:36:15PM +0000, Warner Losh wrote: > Author: imp > Date: Tue Mar 13 23:36:15 2018 > New Revision: 330885 > URL: https://svnweb.freebsd.org/changeset/base/330885 > > Log: > We need opt_compat.h after r330819 and 330820. > > Add opt_compat.h to fix the stand-alone build case. Sorry about that. I only tested with buildkernel. I'll MFC this before either of those. Don't fret. I was on the review and missed it too. Warner From owner-svn-src-head@freebsd.org Wed Mar 14 03:00:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61B25F46D30; Wed, 14 Mar 2018 03:00:19 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E8C08472C; Wed, 14 Mar 2018 03:00:19 +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 0918F224F7; Wed, 14 Mar 2018 03:00:19 +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 w2E30IGh024762; Wed, 14 Mar 2018 03:00:18 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2E30HmE024745; Wed, 14 Mar 2018 03:00:17 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803140300.w2E30HmE024745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 14 Mar 2018 03:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330894 - in head/sys/contrib/zstd: . contrib/meson doc doc/images lib lib/common lib/compress lib/decompress lib/deprecated lib/dictBuilder lib/legacy programs tests zlibWrapper zlibWr... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/contrib/zstd: . contrib/meson doc doc/images lib lib/common lib/compress lib/decompress lib/deprecated lib/dictBuilder lib/legacy programs tests zlibWrapper zlibWrapper/examples X-SVN-Commit-Revision: 330894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 03:00:20 -0000 Author: cem Date: Wed Mar 14 03:00:17 2018 New Revision: 330894 URL: https://svnweb.freebsd.org/changeset/base/330894 Log: Update to Zstandard 1.3.3 Includes patch to conditionalize use of __builtin_clz(ll) on __has_builtin(). The issue is tracked upstream at https://github.com/facebook/zstd/pull/884 . Otherwise, these are vanilla Zstandard 1.3.3 files. Note that the 1.3.4 release should be due out soon. Sponsored by: Dell EMC Isilon Added: head/sys/contrib/zstd/doc/images/zstd_logo86.png (contents, props changed) head/sys/contrib/zstd/lib/compress/zstd_compress_internal.h - copied, changed from r330893, head/sys/contrib/zstd/lib/compress/zstd_compress.h head/sys/contrib/zstd/tests/seqgen.c (contents, props changed) head/sys/contrib/zstd/tests/seqgen.h (contents, props changed) Deleted: head/sys/contrib/zstd/lib/compress/zstd_compress.h Modified: head/sys/contrib/zstd/Makefile head/sys/contrib/zstd/NEWS head/sys/contrib/zstd/README.md head/sys/contrib/zstd/circle.yml head/sys/contrib/zstd/contrib/meson/meson.build head/sys/contrib/zstd/doc/zstd_compression_format.md head/sys/contrib/zstd/doc/zstd_manual.html head/sys/contrib/zstd/lib/BUCK head/sys/contrib/zstd/lib/common/bitstream.h head/sys/contrib/zstd/lib/common/mem.h head/sys/contrib/zstd/lib/common/pool.c head/sys/contrib/zstd/lib/common/xxhash.c head/sys/contrib/zstd/lib/common/zstd_common.c head/sys/contrib/zstd/lib/common/zstd_internal.h head/sys/contrib/zstd/lib/compress/zstd_compress.c head/sys/contrib/zstd/lib/compress/zstd_double_fast.c head/sys/contrib/zstd/lib/compress/zstd_double_fast.h head/sys/contrib/zstd/lib/compress/zstd_fast.c head/sys/contrib/zstd/lib/compress/zstd_fast.h head/sys/contrib/zstd/lib/compress/zstd_lazy.c head/sys/contrib/zstd/lib/compress/zstd_lazy.h head/sys/contrib/zstd/lib/compress/zstd_ldm.h head/sys/contrib/zstd/lib/compress/zstd_opt.c head/sys/contrib/zstd/lib/compress/zstd_opt.h head/sys/contrib/zstd/lib/compress/zstdmt_compress.c head/sys/contrib/zstd/lib/compress/zstdmt_compress.h head/sys/contrib/zstd/lib/decompress/zstd_decompress.c head/sys/contrib/zstd/lib/deprecated/zbuff_compress.c head/sys/contrib/zstd/lib/dictBuilder/zdict.c head/sys/contrib/zstd/lib/legacy/zstd_v01.c head/sys/contrib/zstd/lib/legacy/zstd_v02.c head/sys/contrib/zstd/lib/legacy/zstd_v03.c head/sys/contrib/zstd/lib/legacy/zstd_v04.c head/sys/contrib/zstd/lib/legacy/zstd_v05.c head/sys/contrib/zstd/lib/legacy/zstd_v06.c head/sys/contrib/zstd/lib/legacy/zstd_v07.c head/sys/contrib/zstd/lib/zstd.h head/sys/contrib/zstd/programs/BUCK head/sys/contrib/zstd/programs/Makefile head/sys/contrib/zstd/programs/bench.c head/sys/contrib/zstd/programs/bench.h head/sys/contrib/zstd/programs/dibio.c head/sys/contrib/zstd/programs/fileio.c head/sys/contrib/zstd/programs/fileio.h head/sys/contrib/zstd/programs/platform.h head/sys/contrib/zstd/programs/util.h head/sys/contrib/zstd/programs/zstd.1 head/sys/contrib/zstd/programs/zstd.1.md head/sys/contrib/zstd/programs/zstdcli.c head/sys/contrib/zstd/tests/Makefile head/sys/contrib/zstd/tests/decodecorpus.c head/sys/contrib/zstd/tests/fullbench.c head/sys/contrib/zstd/tests/fuzzer.c head/sys/contrib/zstd/tests/paramgrill.c head/sys/contrib/zstd/tests/playTests.sh head/sys/contrib/zstd/tests/zbufftest.c head/sys/contrib/zstd/tests/zstreamtest.c head/sys/contrib/zstd/zlibWrapper/BUCK head/sys/contrib/zstd/zlibWrapper/examples/zwrapbench.c head/sys/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c Modified: head/sys/contrib/zstd/Makefile ============================================================================== --- head/sys/contrib/zstd/Makefile Wed Mar 14 02:56:43 2018 (r330893) +++ head/sys/contrib/zstd/Makefile Wed Mar 14 03:00:17 2018 (r330894) @@ -72,9 +72,12 @@ zstdmt: zlibwrapper: $(MAKE) -C $(ZWRAPDIR) test +.PHONY: check +check: shortest + .PHONY: test shortest test shortest: - $(MAKE) -C $(PRGDIR) allVariants + $(MAKE) -C $(PRGDIR) allVariants MOREFLAGS="-g -DZSTD_DEBUG=1" $(MAKE) -C $(TESTDIR) $@ .PHONY: examples @@ -127,11 +130,6 @@ uninstall: travis-install: $(MAKE) install PREFIX=~/install_test_dir -.PHONY: gppbuild -gppbuild: clean - g++ -v - CC=g++ $(MAKE) -C programs all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" - .PHONY: gcc5build gcc5build: clean gcc-5 -v @@ -163,7 +161,7 @@ aarch64build: clean CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allzstd ppcbuild: clean - CC=powerpc-linux-gnu-gcc CLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allzstd + CC=powerpc-linux-gnu-gcc CFLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allzstd ppc64build: clean CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allzstd Modified: head/sys/contrib/zstd/NEWS ============================================================================== --- head/sys/contrib/zstd/NEWS Wed Mar 14 02:56:43 2018 (r330893) +++ head/sys/contrib/zstd/NEWS Wed Mar 14 03:00:17 2018 (r330894) @@ -1,3 +1,15 @@ +v1.3.3 +perf: faster zstd_opt strategy (levels 17-19) +fix : bug #944 : multithreading with shared ditionary and large data, reported by @gsliepen +cli : fix : content size written in header by default +cli : fix : improved LZ4 format support, by @felixhandte +cli : new : hidden command `-S`, to benchmark multiple files while generating one result per file +api : fix : support large skippable frames, by @terrelln +api : fix : streaming interface was adding a useless 3-bytes null block to small frames +api : change : when setting `pledgedSrcSize`, use `ZSTD_CONTENTSIZE_UNKNOWN` macro value to mean "unknown" +build: fix : compilation under rhel6 and centos6, reported by @pixelb +build: added `check` target + v1.3.2 new : long range mode, using --long command, by Stella Lau (@stellamplau) new : ability to generate and decode magicless frames (#591) Modified: head/sys/contrib/zstd/README.md ============================================================================== --- head/sys/contrib/zstd/README.md Wed Mar 14 02:56:43 2018 (r330893) +++ head/sys/contrib/zstd/README.md Wed Mar 14 03:00:17 2018 (r330894) @@ -1,15 +1,16 @@ - __Zstandard__, or `zstd` as short version, is a fast lossless compression algorithm, - targeting real-time compression scenarios at zlib-level and better compression ratios. +

Zstandard

-It is provided as an open-source BSD-licensed **C** library, -and a command line utility producing and decoding `.zst` and `.gz` files. -For other programming languages, -you can consult a list of known ports on [Zstandard homepage](http://www.zstd.net/#other-languages). +__Zstandard__, or `zstd` as short version, is a fast lossless compression algorithm, +targeting real-time compression scenarios at zlib-level and better compression ratios. +It's backed by a very fast entropy stage, provided by [Huff0 and FSE library](https://github.com/Cyan4973/FiniteStateEntropy). -| dev branch status | -|-------------------| -| [![Build Status][travisDevBadge]][travisLink] [![Build status][AppveyorDevBadge]][AppveyorLink] [![Build status][CircleDevBadge]][CircleLink] +The project is provided as an open-source BSD-licensed **C** library, +and a command line utility producing and decoding `.zst`, `.gz`, `.xz` and `.lz4` files. +Should your project require another programming language, +a list of known ports and bindings is provided on [Zstandard homepage](http://www.zstd.net/#other-languages). +Development branch status : [![Build Status][travisDevBadge]][travisLink] [![Build status][AppveyorDevBadge]][AppveyorLink] [![Build status][CircleDevBadge]][CircleLink] + [travisDevBadge]: https://travis-ci.org/facebook/zstd.svg?branch=dev "Continuous Integration test suite" [travisLink]: https://travis-ci.org/facebook/zstd [AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/xt38wbdxjk5mrbem/branch/dev?svg=true "Windows test suite" @@ -17,8 +18,9 @@ you can consult a list of known ports on [Zstandard ho [CircleDevBadge]: https://circleci.com/gh/facebook/zstd/tree/dev.svg?style=shield "Short test suite" [CircleLink]: https://circleci.com/gh/facebook/zstd +### Benchmarks -As a reference, several fast compression algorithms were tested and compared +For reference, several fast compression algorithms were tested and compared on a server running Linux Debian (`Linux version 4.8.0-1-amd64`), with a Core i7-6700K CPU @ 4.0GHz, using [lzbench], an open-source in-memory benchmark by @inikep @@ -43,7 +45,9 @@ on the [Silesia compression corpus]. [LZ4]: http://www.lz4.org/ Zstd can also offer stronger compression ratios at the cost of compression speed. -Speed vs Compression trade-off is configurable by small increments. Decompression speed is preserved and remains roughly the same at all settings, a property shared by most LZ compression algorithms, such as [zlib] or lzma. +Speed vs Compression trade-off is configurable by small increments. +Decompression speed is preserved and remains roughly the same at all settings, +a property shared by most LZ compression algorithms, such as [zlib] or lzma. The following tests were run on a server running Linux Debian (`Linux version 4.8.0-1-amd64`) @@ -56,8 +60,8 @@ Compression Speed vs Ratio | Decompression Speed ---------------------------|-------------------- ![Compression Speed vs Ratio](doc/images/Cspeed4.png "Compression Speed vs Ratio") | ![Decompression Speed](doc/images/Dspeed4.png "Decompression Speed") -Several algorithms can produce higher compression ratios, but at slower speeds, falling outside of the graph. -For a larger picture including very slow modes, [click on this link](doc/images/DCspeed5.png) . +A few other algorithms can produce higher compression ratios at slower speeds, falling outside of the graph. +For a larger picture including slow modes, [click on this link](doc/images/DCspeed5.png). ### The case for Small Data compression @@ -84,7 +88,7 @@ Training works if there is some correlation in a famil Hence, deploying one dictionary per type of data will provide the greatest benefits. Dictionary gains are mostly effective in the first few KB. Then, the compression algorithm will gradually use previously decoded content to better compress the rest of the file. -#### Dictionary compression How To : +#### Dictionary compression How To: 1) Create the dictionary @@ -99,19 +103,16 @@ Dictionary gains are mostly effective in the first few `zstd -D dictionaryName --decompress FILE.zst` -### Build +### Build instructions -Once you have the repository cloned, there are multiple ways provided to build Zstandard. - #### Makefile -If your system is compatible with a standard `make` (or `gmake`) binary generator, -you can simply run it at the root directory. -It will generate `zstd` within root directory. +If your system is compatible with standard `make` (or `gmake`), +invoking `make` in root directory will generate `zstd` cli in root directory. -Other available options include : -- `make install` : create and install zstd binary, library and man page -- `make test` : create and run `zstd` and test tools on local platform +Other available options include: +- `make install` : create and install zstd cli, library and man pages +- `make check` : create and run `zstd`, tests its behavior on local platform #### cmake @@ -125,9 +126,9 @@ A Meson project is provided within `contrib/meson`. #### Visual Studio (Windows) -Going into `build` directory, you will find additional possibilities : -- Projects for Visual Studio 2005, 2008 and 2010 - + VS2010 project is compatible with VS2012, VS2013 and VS2015 +Going into `build` directory, you will find additional possibilities: +- Projects for Visual Studio 2005, 2008 and 2010. + + VS2010 project is compatible with VS2012, VS2013 and VS2015. - Automated build scripts for Visual compiler by @KrzysFR , in `build/VS_scripts`, which will build `zstd` cli and `libzstd` library without any need to open Visual Studio solution. @@ -143,11 +144,7 @@ Zstandard is dual-licensed under [BSD](LICENSE) and [G ### Contributing -The "dev" branch is the one where all contributions will be merged before reaching "master". -If you plan to propose a patch, please commit into the "dev" branch or its own feature branch. +The "dev" branch is the one where all contributions are merged before reaching "master". +If you plan to propose a patch, please commit into the "dev" branch, or its own feature branch. Direct commit to "master" are not permitted. For more information, please read [CONTRIBUTING](CONTRIBUTING.md). - -### Miscellaneous - -Zstd entropy stage is provided by [Huff0 and FSE, from Finite State Entropy library](https://github.com/Cyan4973/FiniteStateEntropy). Modified: head/sys/contrib/zstd/circle.yml ============================================================================== --- head/sys/contrib/zstd/circle.yml Wed Mar 14 02:56:43 2018 (r330893) +++ head/sys/contrib/zstd/circle.yml Wed Mar 14 03:00:17 2018 (r330894) @@ -3,13 +3,11 @@ dependencies: - sudo dpkg --add-architecture i386 - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; sudo apt-get -y -qq update - sudo apt-get -y install gcc-powerpc-linux-gnu gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross - - sudo apt-get -y install libstdc++-7-dev clang gcc g++ gcc-5 gcc-6 gcc-7 zlib1g-dev liblzma-dev - - sudo apt-get -y install linux-libc-dev:i386 libc6-dev-i386 test: override: - ? | - if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then cc -v; make all && make clean && make -C lib libzstd-nomt && make clean; fi && + if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then cc -v; CFLAGS="-O0 -Werror" make all && make clean; fi && if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gnu90build && make clean; fi : parallel: true @@ -20,32 +18,17 @@ test: parallel: true - ? | if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make c11build && make clean; fi && - if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make cmakebuild && make clean; fi + if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make ppc64build && make clean; fi : parallel: true - ? | - if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make gppbuild && make clean; fi && - if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gcc5build && make clean; fi - : - parallel: true - - ? | - if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make gcc6build && make clean; fi && - if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make clangbuild && make clean; fi - : - parallel: true - - ? | - if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make m32build && make clean; fi && - if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make armbuild && make clean; fi - : - parallel: true - - ? | if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make aarch64build && make clean; fi && if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make ppcbuild && make clean; fi : parallel: true - ? | - if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make ppc64build && make clean; fi && - if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gcc7build && make clean; fi + if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make -j regressiontest && make clean; fi && + if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make armbuild && make clean; fi : parallel: true - ? | @@ -54,8 +37,8 @@ test: : parallel: true - ? | - if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make -j regressiontest && make clean; fi && - if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then true; fi # Could add another test here + if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make cxxtest && make clean; fi && + if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make -C lib libzstd-nomt && make clean; fi : parallel: true Modified: head/sys/contrib/zstd/contrib/meson/meson.build ============================================================================== --- head/sys/contrib/zstd/contrib/meson/meson.build Wed Mar 14 02:56:43 2018 (r330893) +++ head/sys/contrib/zstd/contrib/meson/meson.build Wed Mar 14 03:00:17 2018 (r330894) @@ -2,14 +2,39 @@ project('zstd', 'c', license: 'BSD') libm = meson.get_compiler('c').find_library('m', required: true) -lib_dir = join_paths(meson.source_root(), '..', '..', 'lib') +lib_dir = join_paths('..', '..', 'lib') common_dir = join_paths(lib_dir, 'common') compress_dir = join_paths(lib_dir, 'compress') decompress_dir = join_paths(lib_dir, 'decompress') dictbuilder_dir = join_paths(lib_dir, 'dictBuilder') deprecated_dir = join_paths(lib_dir, 'deprecated') -libzstd_srcs = [join_paths(common_dir, 'entropy_common.c'), join_paths(common_dir, 'fse_decompress.c'), join_paths(common_dir, 'threading.c'), join_paths(common_dir, 'pool.c'), join_paths(common_dir, 'zstd_common.c'), join_paths(common_dir, 'error_private.c'), join_paths(common_dir, 'xxhash.c'), join_paths(compress_dir, 'fse_compress.c'), join_paths(compress_dir, 'huf_compress.c'), join_paths(compress_dir, 'zstd_compress.c'), join_paths(compress_dir, 'zstdmt_compress.c'), join_paths(decompress_dir, 'huf_decompress.c'), join_paths(decompress_dir, 'zstd_decompress.c'), join_paths(dictbuilder_dir, 'cover.c'), join_paths(dictbuilder_dir, 'divsufsort.c'), join_paths(dictbuilder_dir, 'zdict.c'), join_paths(deprecated_dir, 'zbuff_common.c'), join_paths(deprecated_dir, 'zbuff_compress.c'), join_paths(deprecated_dir, 'zbuff_decompress.c')] +libzstd_srcs = [ + join_paths(common_dir, 'entropy_common.c'), + join_paths(common_dir, 'fse_decompress.c'), + join_paths(common_dir, 'threading.c'), + join_paths(common_dir, 'pool.c'), + join_paths(common_dir, 'zstd_common.c'), + join_paths(common_dir, 'error_private.c'), + join_paths(common_dir, 'xxhash.c'), + join_paths(compress_dir, 'fse_compress.c'), + join_paths(compress_dir, 'huf_compress.c'), + join_paths(compress_dir, 'zstd_compress.c'), + join_paths(compress_dir, 'zstd_fast.c'), + join_paths(compress_dir, 'zstd_double_fast.c'), + join_paths(compress_dir, 'zstd_lazy.c'), + join_paths(compress_dir, 'zstd_opt.c'), + join_paths(compress_dir, 'zstd_ldm.c'), + join_paths(compress_dir, 'zstdmt_compress.c'), + join_paths(decompress_dir, 'huf_decompress.c'), + join_paths(decompress_dir, 'zstd_decompress.c'), + join_paths(dictbuilder_dir, 'cover.c'), + join_paths(dictbuilder_dir, 'divsufsort.c'), + join_paths(dictbuilder_dir, 'zdict.c'), + join_paths(deprecated_dir, 'zbuff_common.c'), + join_paths(deprecated_dir, 'zbuff_compress.c'), + join_paths(deprecated_dir, 'zbuff_decompress.c') +] libzstd_includes = [include_directories(common_dir, dictbuilder_dir, compress_dir, lib_dir)] @@ -19,7 +44,15 @@ if get_option('legacy_support') legacy_dir = join_paths(lib_dir, 'legacy') libzstd_includes += [include_directories(legacy_dir)] - libzstd_srcs += [join_paths(legacy_dir, 'zstd_v01.c'), join_paths(legacy_dir, 'zstd_v02.c'), join_paths(legacy_dir, 'zstd_v03.c'), join_paths(legacy_dir, 'zstd_v04.c'), join_paths(legacy_dir, 'zstd_v05.c'), join_paths(legacy_dir, 'zstd_v06.c'), join_paths(legacy_dir, 'zstd_v07.c')] + libzstd_srcs += [ + join_paths(legacy_dir, 'zstd_v01.c'), + join_paths(legacy_dir, 'zstd_v02.c'), + join_paths(legacy_dir, 'zstd_v03.c'), + join_paths(legacy_dir, 'zstd_v04.c'), + join_paths(legacy_dir, 'zstd_v05.c'), + join_paths(legacy_dir, 'zstd_v06.c'), + join_paths(legacy_dir, 'zstd_v07.c') + ] else libzstd_cflags = [] endif @@ -39,16 +72,20 @@ libzstd = library('zstd', dependencies: libzstd_deps, install: true) -programs_dir = join_paths(meson.source_root(), '..', '..', 'programs') +programs_dir = join_paths('..', '..', 'programs') zstd = executable('zstd', - join_paths(programs_dir, 'bench.c'), join_paths(programs_dir, 'datagen.c'), join_paths(programs_dir, 'dibio.c'), join_paths(programs_dir, 'fileio.c'), join_paths(programs_dir, 'zstdcli.c'), + join_paths(programs_dir, 'bench.c'), + join_paths(programs_dir, 'datagen.c'), + join_paths(programs_dir, 'dibio.c'), + join_paths(programs_dir, 'fileio.c'), + join_paths(programs_dir, 'zstdcli.c'), include_directories: libzstd_includes, c_args: ['-DZSTD_NODICT', '-DZSTD_NOBENCH'], link_with: libzstd, install: true) -tests_dir = join_paths(meson.source_root(), '..', '..', 'tests') +tests_dir = join_paths('..', '..', 'tests') datagen_c = join_paths(programs_dir, 'datagen.c') test_includes = libzstd_includes + [include_directories(programs_dir)] Added: head/sys/contrib/zstd/doc/images/zstd_logo86.png ============================================================================== Binary file. No diff available. Modified: head/sys/contrib/zstd/doc/zstd_compression_format.md ============================================================================== --- head/sys/contrib/zstd/doc/zstd_compression_format.md Wed Mar 14 02:56:43 2018 (r330893) +++ head/sys/contrib/zstd/doc/zstd_compression_format.md Wed Mar 14 03:00:17 2018 (r330894) @@ -91,10 +91,10 @@ Overview Frames ------ -Zstandard compressed data is made of up one or more __frames__. +Zstandard compressed data is made of one or more __frames__. Each frame is independent and can be decompressed indepedently of other frames. The decompressed content of multiple concatenated frames is the concatenation of -each frames decompressed content. +each frame decompressed content. There are two frame formats defined by Zstandard: Zstandard frames and Skippable frames. @@ -182,7 +182,7 @@ data must be regenerated within a single continuous me In this case, `Window_Descriptor` byte is skipped, but `Frame_Content_Size` is necessarily present. As a consequence, the decoder must allocate a memory segment -of size equal or bigger than `Frame_Content_Size`. +of size equal or larger than `Frame_Content_Size`. In order to preserve the decoder from unreasonable memory requirements, a decoder is allowed to reject a compressed frame Modified: head/sys/contrib/zstd/doc/zstd_manual.html ============================================================================== --- head/sys/contrib/zstd/doc/zstd_manual.html Wed Mar 14 02:56:43 2018 (r330893) +++ head/sys/contrib/zstd/doc/zstd_manual.html Wed Mar 14 03:00:17 2018 (r330894) @@ -1,10 +1,10 @@ -zstd 1.3.2 Manual +zstd 1.3.3 Manual -

zstd 1.3.2 Manual

+

zstd 1.3.3 Manual


Contents

    @@ -19,16 +19,17 @@
  1. Streaming decompression - HowTo
  2. START OF ADVANCED AND EXPERIMENTAL FUNCTIONS
  3. Advanced types
  4. -
  5. Frame size functions
  6. -
  7. Context memory usage
  8. -
  9. Advanced compression functions
  10. -
  11. Advanced decompression functions
  12. -
  13. Advanced streaming functions
  14. -
  15. Buffer-less and synchronous inner streaming functions
  16. -
  17. Buffer-less streaming compression (synchronous mode)
  18. -
  19. Buffer-less streaming decompression (synchronous mode)
  20. -
  21. New advanced API (experimental)
  22. -
  23. Block level API
  24. +
  25. Custom memory allocation functions
  26. +
  27. Frame size functions
  28. +
  29. Context memory usage
  30. +
  31. Advanced compression functions
  32. +
  33. Advanced decompression functions
  34. +
  35. Advanced streaming functions
  36. +
  37. Buffer-less and synchronous inner streaming functions
  38. +
  39. Buffer-less streaming compression (synchronous mode)
  40. +
  41. Buffer-less streaming decompression (synchronous mode)
  42. +
  43. New advanced API (experimental)
  44. +
  45. Block level API

Introduction

@@ -111,7 +112,7 @@ unsigned long long ZSTD_getFrameContentSize(const void
   @return : content size to be decompressed, as a 64-bits value _if known and not empty_, 0 otherwise. 
 


-

Helper functions

#define ZSTD_COMPRESSBOUND(srcSize)   ((srcSize) + ((srcSize)>>8) + (((srcSize) < 128 KB) ? ((128 KB - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0))  /* this formula ensures that bound(A) + bound(B) <= bound(A+B) as long as A and B >= 128 KB */
+

Helper functions

#define ZSTD_COMPRESSBOUND(srcSize)   ((srcSize) + ((srcSize)>>8) + (((srcSize) < (128<<10)) ? (((128<<10) - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0))  /* this formula ensures that bound(A) + bound(B) <= bound(A+B) as long as A and B >= 128 KB */
 size_t      ZSTD_compressBound(size_t srcSize); /*!< maximum compressed size in worst case scenario */
 unsigned    ZSTD_isError(size_t code);          /*!< tells if a `size_t` function result is an error code */
 const char* ZSTD_getErrorName(size_t code);     /*!< provides readable string from an error code */
@@ -346,17 +347,15 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_o
     ZSTD_frameParameters fParams;
 } ZSTD_parameters;
 

-

Custom memory allocation functions

typedef void* (*ZSTD_allocFunction) (void* opaque, size_t size);
-typedef void  (*ZSTD_freeFunction) (void* opaque, void* address);
-typedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; void* opaque; } ZSTD_customMem;
-/* use this constant to defer to stdlib's functions */
-static const ZSTD_customMem ZSTD_defaultCMem = { NULL, NULL, NULL };
-

-

Frame size functions


+

Custom memory allocation functions


 
+
typedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; void* opaque; } ZSTD_customMem;
+

+

Frame size functions


+
 
size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize);
 

`src` should point to the start of a ZSTD encoded frame or skippable frame - `srcSize` must be at least as large as the frame + `srcSize` must be >= first frame size @return : the compressed size of the first frame starting at `src`, suitable to pass to `ZSTD_decompress` or similar, or an error code if input is invalid @@ -391,7 +390,7 @@ static const ZSTD_customMem ZSTD_defaultCMem = { NULL, @return : size of the Frame Header


-

Context memory usage


+

Context memory usage


 
 
size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);
 size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);
@@ -450,7 +449,7 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_di
  
 


-

Advanced compression functions


+

Advanced compression functions


 
 
ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem);
 

Create a ZSTD compression context using external alloc and free functions @@ -462,7 +461,8 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_di It must outlive context usage. workspaceSize: Use ZSTD_estimateCCtxSize() or ZSTD_estimateCStreamSize() to determine how large workspace must be to support scenario. - @return : pointer to ZSTD_CCtx*, or NULL if error (size too small) + @return : pointer to ZSTD_CCtx* (same address as workspace, but different type), + or NULL if error (typically size too small) Note : zstd will never resize nor malloc() when using a static cctx. If it needs more memory than available, it will simply error out. Note 2 : there is no corresponding "free" function. @@ -505,7 +505,8 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_di to determine how large workspace must be. cParams : use ZSTD_getCParams() to transform a compression level into its relevants cParams. - @return : pointer to ZSTD_CDict*, or NULL if error (size too small) + @return : pointer to ZSTD_CDict* (same address as workspace, but different type), + or NULL if error (typically, size too small). Note : there is no corresponding "free" function. Since workspace was allocated externally, it must be freed externally. @@ -518,7 +519,7 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_di

ZSTD_parameters ZSTD_getParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);
 

same as ZSTD_getCParams(), but @return a full `ZSTD_parameters` object instead of sub-component `ZSTD_compressionParameters`. - All fields of `ZSTD_frameParameters` are set to default (0) + All fields of `ZSTD_frameParameters` are set to default : contentSize=1, checksum=0, noDictID=0


size_t ZSTD_checkCParams(ZSTD_compressionParameters params);
@@ -545,7 +546,7 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_di
 

Same as ZSTD_compress_usingCDict(), with fine-tune control over frame parameters


-

Advanced decompression functions


+

Advanced decompression functions


 
 
unsigned ZSTD_isFrame(const void* buffer, size_t size);
 

Tells if the content of `buffer` starts with a valid Frame Identifier. @@ -564,7 +565,8 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_di It must outlive context usage. workspaceSize: Use ZSTD_estimateDCtxSize() or ZSTD_estimateDStreamSize() to determine how large workspace must be to support scenario. - @return : pointer to ZSTD_DCtx*, or NULL if error (size too small) + @return : pointer to ZSTD_DCtx* (same address as workspace, but different type), + or NULL if error (typically size too small) Note : zstd will never resize nor malloc() when using a static dctx. If it needs more memory than available, it will simply error out. Note 2 : static dctx is incompatible with legacy support @@ -627,24 +629,26 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_di When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code.


-

Advanced streaming functions


+

Advanced streaming functions


 
 

Advanced Streaming compression functions

ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem);
 ZSTD_CStream* ZSTD_initStaticCStream(void* workspace, size_t workspaceSize);    /**< same as ZSTD_initStaticCCtx() */
-size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pledgedSrcSize);   /**< pledgedSrcSize must be correct, a size of 0 means unknown.  for a frame size of 0 use initCStream_advanced */
+size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pledgedSrcSize);   /**< pledgedSrcSize must be correct. If it is not known at init time, use ZSTD_CONTENTSIZE_UNKNOWN. Note that, for compatibility with older programs, "0" also disables frame content size field. It may be enabled in the future. */
 size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel); /**< creates of an internal CDict (incompatible with static CCtx), except if dict == NULL or dictSize < 8, in which case no dict is used. Note: dict is loaded with ZSTD_dm_auto (treated as a full zstd dictionary if it begins with ZSTD_MAGIC_DICTIONARY, else as raw content) and ZSTD_dlm_byCopy.*/
 size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, const void* dict, size_t dictSize,
-                                             ZSTD_parameters params, unsigned long long pledgedSrcSize);  /**< pledgedSrcSize is optional and can be 0 (meaning unknown). note: if the contentSizeFlag is set, pledgedSrcSize == 0 means the source size is actually 0. dict is loaded with ZSTD_dm_auto and ZSTD_dlm_byCopy. */
+                                             ZSTD_parameters params, unsigned long long pledgedSrcSize);  /**< pledgedSrcSize must be correct. If srcSize is not known at init time, use value ZSTD_CONTENTSIZE_UNKNOWN. dict is loaded with ZSTD_dm_auto and ZSTD_dlm_byCopy. */
 size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict);  /**< note : cdict will just be referenced, and must outlive compression session */
-size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* cdict, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize);  /**< same as ZSTD_initCStream_usingCDict(), with control over frame parameters */
+size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* cdict, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize);  /**< same as ZSTD_initCStream_usingCDict(), with control over frame parameters. pledgedSrcSize must be correct. If srcSize is not known at init time, use value ZSTD_CONTENTSIZE_UNKNOWN. */
 

size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize);
 

start a new compression job, using same parameters from previous job. This is typically useful to skip dictionary loading stage, since it will re-use it in-place.. Note that zcs must be init at least once before using ZSTD_resetCStream(). - pledgedSrcSize==0 means "srcSize unknown". + If pledgedSrcSize is not known at reset time, use macro ZSTD_CONTENTSIZE_UNKNOWN. If pledgedSrcSize > 0, its value must be correct, as it will be written in header, and controlled at the end. - @return : 0, or an error code (which can be tested using ZSTD_isError()) + For the time being, pledgedSrcSize==0 is interpreted as "srcSize unknown" for compatibility with older programs, + but it may change to mean "empty" in some future version, so prefer using macro ZSTD_CONTENTSIZE_UNKNOWN. + @return : 0, or an error code (which can be tested using ZSTD_isError())


Advanced Streaming decompression functions

ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem);
@@ -655,14 +659,14 @@ size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, c
 size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict);  /**< note : ddict is referenced, it must outlive decompression session */
 size_t ZSTD_resetDStream(ZSTD_DStream* zds);  /**< re-use decompression parameters from previous init; saves dictionary loading */
 

-

Buffer-less and synchronous inner streaming functions

+

Buffer-less and synchronous inner streaming functions

   This is an advanced API, giving full control over buffer management, for users which need direct control over memory.
   But it's also a complex one, with several restrictions, documented below.
   Prefer normal streaming API for an easier experience.
  
 
-

Buffer-less streaming compression (synchronous mode)

+

Buffer-less streaming compression (synchronous mode)

   A ZSTD_CCtx object is required to track streaming operations.
   Use ZSTD_createCCtx() / ZSTD_freeCCtx() to manage resource.
   ZSTD_CCtx object can be re-used multiple times within successive compression operations.
@@ -693,12 +697,12 @@ size_t ZSTD_resetDStream(ZSTD_DStream* zds);  /**<
 
 

Buffer-less streaming compression functions

size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel);
 size_t ZSTD_compressBegin_usingDict(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, int compressionLevel);
-size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize); /**< pledgedSrcSize is optional and can be 0 (meaning unknown). note: if the contentSizeFlag is set, pledgedSrcSize == 0 means the source size is actually 0 */
+size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize); /**< pledgedSrcSize : If srcSize is not known at init time, use ZSTD_CONTENTSIZE_UNKNOWN */
 size_t ZSTD_compressBegin_usingCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict); /**< note: fails if cdict==NULL */
-size_t ZSTD_compressBegin_usingCDict_advanced(ZSTD_CCtx* const cctx, const ZSTD_CDict* const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize);   /* compression parameters are already set within cdict. pledgedSrcSize=0 means null-size */
-size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned long long pledgedSrcSize); /**<  note: if pledgedSrcSize can be 0, indicating unknown size.  if it is non-zero, it must be accurate.  for 0 size frames, use compressBegin_advanced */
+size_t ZSTD_compressBegin_usingCDict_advanced(ZSTD_CCtx* const cctx, const ZSTD_CDict* const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize);   /* compression parameters are already set within cdict. pledgedSrcSize must be correct. If srcSize is not known, use macro ZSTD_CONTENTSIZE_UNKNOWN */
+size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned long long pledgedSrcSize); /**<  note: if pledgedSrcSize is not known, use ZSTD_CONTENTSIZE_UNKNOWN */
 

-

Buffer-less streaming decompression (synchronous mode)

+

Buffer-less streaming decompression (synchronous mode)

   A ZSTD_DCtx object is required to track streaming operations.
   Use ZSTD_createDCtx() / ZSTD_freeDCtx() to manage it.
   A ZSTD_DCtx object can be re-used multiple times.
@@ -784,7 +788,7 @@ size_t ZSTD_decodingBufferSize_min(unsigned long long 
 

typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;
 

-

New advanced API (experimental)


+

New advanced API (experimental)


 
 
typedef enum {
     /* Question : should we have a format ZSTD_f_auto ?
@@ -848,18 +852,19 @@ size_t ZSTD_decodingBufferSize_min(unsigned long long 
                               * Special: value 0 means "do not change strategy". */
 
     /* frame parameters */
-    ZSTD_p_contentSizeFlag=200, /* Content size is written into frame header _whenever known_ (default:1)
-                              * note that content size must be known at the beginning,
-                              * it is sent using ZSTD_CCtx_setPledgedSrcSize() */
+    ZSTD_p_contentSizeFlag=200, /* Content size will be written into frame header _whenever known_ (default:1)
+                              * Content size must be known at the beginning of compression,
+                              * it is provided using ZSTD_CCtx_setPledgedSrcSize() */
     ZSTD_p_checksumFlag,     /* A 32-bits checksum of content is written at end of frame (default:0) */
-    ZSTD_p_dictIDFlag,       /* When applicable, dictID of dictionary is provided in frame header (default:1) */
+    ZSTD_p_dictIDFlag,       /* When applicable, dictionary's ID is written into frame header (default:1) */
 
     /* multi-threading parameters */
     ZSTD_p_nbThreads=400,    /* Select how many threads a compression job can spawn (default:1)
                               * More threads improve speed, but also increase memory usage.
                               * Can only receive a value > 1 if ZSTD_MULTITHREAD is enabled.
                               * Special: value 0 means "do not change nbThreads" */
-    ZSTD_p_jobSize,          /* Size of a compression job. Each compression job is completed in parallel.
+    ZSTD_p_jobSize,          /* Size of a compression job. This value is only enforced in streaming (non-blocking) mode.
+                              * Each compression job is completed in parallel, so indirectly controls the nb of active threads.
                               * 0 means default, which is dynamically determined based on compression parameters.
                               * Job size must be a minimum of overlapSize, or 1 KB, whichever is largest
                               * The minimum size is automatically and transparently enforced */
@@ -904,7 +909,8 @@ size_t ZSTD_decodingBufferSize_min(unsigned long long 
 
size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned value);
 

Set one compression parameter, selected by enum ZSTD_cParameter. Note : when `value` is an enum, cast it to unsigned for proper type checking. - @result : 0, or an error code (which can be tested with ZSTD_isError()). + @result : informational value (typically, the one being set, possibly corrected), + or an error code (which can be tested with ZSTD_isError()).


size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long long pledgedSrcSize);
@@ -913,7 +919,7 @@ size_t ZSTD_decodingBufferSize_min(unsigned long long 
  @result : 0, or an error code (which can be tested with ZSTD_isError()).
   Note 1 : 0 means zero, empty.
            In order to mean "unknown content size", pass constant ZSTD_CONTENTSIZE_UNKNOWN.
-           Note that ZSTD_CONTENTSIZE_UNKNOWN is default value for new compression jobs.
+           ZSTD_CONTENTSIZE_UNKNOWN is default value for any new compression job.
   Note 2 : If all data is provided and consumed in a single round,
            this value is overriden by srcSize instead. 
 


@@ -985,13 +991,19 @@ size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, c - Compression parameters cannot be changed once compression is started. - outpot->pos must be <= dstCapacity, input->pos must be <= srcSize - outpot->pos and input->pos will be updated. They are guaranteed to remain below their respective limit. - - @return provides the minimum amount of data still to flush from internal buffers + - In single-thread mode (default), function is blocking : it completed its job before returning to caller. + - In multi-thread mode, function is non-blocking : it just acquires a copy of input, and distribute job to internal worker threads, + and then immediately returns, just indicating that there is some data remaining to be flushed. + The function nonetheless guarantees forward progress : it will return only after it reads or write at least 1+ byte. + - Exception : in multi-threading mode, if the first call requests a ZSTD_e_end directive, it is blocking : it will complete compression before giving back control to caller. + - @return provides the minimum amount of data remaining to be flushed from internal buffers or an error code, which can be tested using ZSTD_isError(). - if @return != 0, flush is not fully completed, there is some data left within internal buffers. - - after a ZSTD_e_end directive, if internal buffer is not fully flushed, + if @return != 0, flush is not fully completed, there is still some data left within internal buffers. + This is useful to determine if a ZSTD_e_flush or ZSTD_e_end directive is completed. + - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0), only ZSTD_e_end or ZSTD_e_flush operations are allowed. - It is necessary to fully flush internal buffers - before starting a new compression job, or changing compression parameters. + Before starting a new compression job, or changing compression parameters, + it is required to fully flush internal buffers.


@@ -1166,7 +1178,7 @@ size_t ZSTD_DCtx_refPrefix_advanced(ZSTD_DCtx* dctx, c


-

Block level API


+

Block level API


 
 

Frame metadata cost is typically ~18 bytes, which can be non-negligible for very small blocks (< 100 bytes). User will have to take in charge required information to regenerate data, such as compressed and content sizes. Modified: head/sys/contrib/zstd/lib/BUCK ============================================================================== --- head/sys/contrib/zstd/lib/BUCK Wed Mar 14 02:56:43 2018 (r330893) +++ head/sys/contrib/zstd/lib/BUCK Wed Mar 14 03:00:17 2018 (r330894) @@ -15,15 +15,9 @@ cxx_library( header_namespace='', visibility=['PUBLIC'], exported_headers=subdir_glob([ - ('compress', 'zstdmt_compress.h'), + ('compress', 'zstd*.h'), ]), - headers=subdir_glob([ - ('compress', 'zstd_opt.h'), - ]), - srcs=[ - 'compress/zstd_compress.c', - 'compress/zstdmt_compress.c', - ], + srcs=glob(['compress/zstd*.c']), deps=[':common'], ) @@ -31,7 +25,7 @@ cxx_library( name='decompress', header_namespace='', visibility=['PUBLIC'], - srcs=['decompress/zstd_decompress.c'], + srcs=glob(['decompress/zstd*.c']), deps=[ ':common', ':legacy', @@ -58,6 +52,9 @@ cxx_library( ]), srcs=glob(['legacy/*.c']), deps=[':common'], + exported_preprocessor_flags=[ + '-DZSTD_LEGACY_SUPPORT=4', + ], ) cxx_library( @@ -75,6 +72,15 @@ cxx_library( ) cxx_library( + name='compiler', + header_namespace='', + visibility=['PUBLIC'], + exported_headers=subdir_glob([ + ('common', 'compiler.h'), + ]), +) + +cxx_library( name='bitstream', header_namespace='', visibility=['PUBLIC'], @@ -100,6 +106,7 @@ cxx_library( ], deps=[ ':bitstream', + ':compiler', ':errors', ':mem', ], @@ -133,7 +140,10 @@ cxx_library( ('common', 'pool.h'), ]), srcs=['common/pool.c'], - deps=[':threading'], + deps=[ + ':threading', + ':zstd_common', + ], ) cxx_library( @@ -144,6 +154,12 @@ cxx_library( ('common', 'threading.h'), ]), srcs=['common/threading.c'], + exported_preprocessor_flags=[ + '-DZSTD_MULTITHREAD', + ], + exported_linker_flags=[ + '-pthread', + ], ) cxx_library( @@ -154,6 +170,9 @@ cxx_library( ('common', 'xxhash.h'), ]), srcs=['common/xxhash.c'], + exported_preprocessor_flags=[ + '-DXXH_NAMESPACE=ZSTD_', + ], ) cxx_library( @@ -166,6 +185,7 @@ cxx_library( ]), srcs=['common/zstd_common.c'], deps=[ + ':compiler', ':errors', ':mem', ], @@ -175,6 +195,7 @@ cxx_library( name='common', deps=[ ':bitstream', + ':compiler', ':entropy', ':errors', ':mem', Modified: head/sys/contrib/zstd/lib/common/bitstream.h ============================================================================== --- head/sys/contrib/zstd/lib/common/bitstream.h Wed Mar 14 02:56:43 2018 (r330893) +++ head/sys/contrib/zstd/lib/common/bitstream.h Wed Mar 14 03:00:17 2018 (r330894) @@ -167,7 +167,7 @@ MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD /*-************************************************************** * Internal functions ****************************************************************/ -MEM_STATIC unsigned BIT_highbit32 (register U32 val) +MEM_STATIC unsigned BIT_highbit32 (U32 val) { assert(val != 0); { Modified: head/sys/contrib/zstd/lib/common/mem.h ============================================================================== --- head/sys/contrib/zstd/lib/common/mem.h Wed Mar 14 02:56:43 2018 (r330893) +++ head/sys/contrib/zstd/lib/common/mem.h Wed Mar 14 03:00:17 2018 (r330894) @@ -56,8 +56,6 @@ MEM_STATIC void MEM_check(void) { MEM_STATIC_ASSERT((s typedef int32_t S32; typedef uint64_t U64; typedef int64_t S64; - typedef intptr_t iPtrDiff; - typedef uintptr_t uPtrDiff; #else typedef unsigned char BYTE; typedef unsigned short U16; @@ -66,8 +64,6 @@ MEM_STATIC void MEM_check(void) { MEM_STATIC_ASSERT((s typedef signed int S32; typedef unsigned long long U64; typedef signed long long S64; - typedef ptrdiff_t iPtrDiff; - typedef size_t uPtrDiff; #endif @@ -123,20 +119,26 @@ MEM_STATIC void MEM_write64(void* memPtr, U64 value) { /* currently only defined for gcc and icc */ #if defined(_MSC_VER) || (defined(__INTEL_COMPILER) && defined(WIN32)) __pragma( pack(push, 1) ) - typedef union { U16 u16; U32 u32; U64 u64; size_t st; } unalign; + typedef struct { U16 v; } unalign16; + typedef struct { U32 v; } unalign32; + typedef struct { U64 v; } unalign64; + typedef struct { size_t v; } unalignArch; __pragma( pack(pop) ) #else - typedef union { U16 u16; U32 u32; U64 u64; size_t st; } __attribute__((packed)) unalign; + typedef struct { U16 v; } __attribute__((packed)) unalign16; + typedef struct { U32 v; } __attribute__((packed)) unalign32; + typedef struct { U64 v; } __attribute__((packed)) unalign64; + typedef struct { size_t v; } __attribute__((packed)) unalignArch; #endif -MEM_STATIC U16 MEM_read16(const void* ptr) { return ((const unalign*)ptr)->u16; } -MEM_STATIC U32 MEM_read32(const void* ptr) { return ((const unalign*)ptr)->u32; } -MEM_STATIC U64 MEM_read64(const void* ptr) { return ((const unalign*)ptr)->u64; } -MEM_STATIC size_t MEM_readST(const void* ptr) { return ((const unalign*)ptr)->st; } +MEM_STATIC U16 MEM_read16(const void* ptr) { return ((const unalign16*)ptr)->v; } +MEM_STATIC U32 MEM_read32(const void* ptr) { return ((const unalign32*)ptr)->v; } +MEM_STATIC U64 MEM_read64(const void* ptr) { return ((const unalign64*)ptr)->v; } +MEM_STATIC size_t MEM_readST(const void* ptr) { return ((const unalignArch*)ptr)->v; } -MEM_STATIC void MEM_write16(void* memPtr, U16 value) { ((unalign*)memPtr)->u16 = value; } -MEM_STATIC void MEM_write32(void* memPtr, U32 value) { ((unalign*)memPtr)->u32 = value; } -MEM_STATIC void MEM_write64(void* memPtr, U64 value) { ((unalign*)memPtr)->u64 = value; } +MEM_STATIC void MEM_write16(void* memPtr, U16 value) { ((unalign16*)memPtr)->v = value; } +MEM_STATIC void MEM_write32(void* memPtr, U32 value) { ((unalign32*)memPtr)->v = value; } +MEM_STATIC void MEM_write64(void* memPtr, U64 value) { ((unalign64*)memPtr)->v = value; } #else Modified: head/sys/contrib/zstd/lib/common/pool.c ============================================================================== --- head/sys/contrib/zstd/lib/common/pool.c Wed Mar 14 02:56:43 2018 (r330893) +++ head/sys/contrib/zstd/lib/common/pool.c Wed Mar 14 03:00:17 2018 (r330894) @@ -11,7 +11,6 @@ /* ====== Dependencies ======= */ #include /* size_t */ -#include /* malloc, calloc, free */ #include "pool.h" /* ====== Compiler specifics ====== */ @@ -115,7 +114,7 @@ POOL_ctx* POOL_create_advanced(size_t numThreads, size * and full queues. */ ctx->queueSize = queueSize + 1; - ctx->queue = (POOL_job*) malloc(ctx->queueSize * sizeof(POOL_job)); + ctx->queue = (POOL_job*)ZSTD_malloc(ctx->queueSize * sizeof(POOL_job), customMem); ctx->queueHead = 0; ctx->queueTail = 0; ctx->numThreadsBusy = 0; Modified: head/sys/contrib/zstd/lib/common/xxhash.c ============================================================================== --- head/sys/contrib/zstd/lib/common/xxhash.c Wed Mar 14 02:56:43 2018 (r330893) +++ head/sys/contrib/zstd/lib/common/xxhash.c Wed Mar 14 03:00:17 2018 (r330894) @@ -212,7 +212,7 @@ static U64 XXH_read64(const void* memPtr) #if defined(_MSC_VER) /* Visual Studio */ # define XXH_swap32 _byteswap_ulong # define XXH_swap64 _byteswap_uint64 -#elif (GCC_VERSION >= 403 && !defined(__riscv)) +#elif GCC_VERSION >= 403 # define XXH_swap32 __builtin_bswap32 # define XXH_swap64 __builtin_bswap64 #else Modified: head/sys/contrib/zstd/lib/common/zstd_common.c ============================================================================== --- head/sys/contrib/zstd/lib/common/zstd_common.c Wed Mar 14 02:56:43 2018 (r330893) +++ head/sys/contrib/zstd/lib/common/zstd_common.c Wed Mar 14 03:00:17 2018 (r330894) @@ -31,20 +31,26 @@ const char* ZSTD_versionString(void) { return ZSTD_VER * ZSTD Error Management ******************************************/ /*! ZSTD_isError() : -* tells if a return value is an error code */ + * tells if a return value is an error code */ unsigned ZSTD_isError(size_t code) { return ERR_isError(code); } /*! ZSTD_getErrorName() : -* provides error code string from function result (useful for debugging) */ + * provides error code string from function result (useful for debugging) */ const char* ZSTD_getErrorName(size_t code) { return ERR_getErrorName(code); } /*! ZSTD_getError() : -* convert a `size_t` function result into a proper ZSTD_errorCode enum */ + * convert a `size_t` function result into a proper ZSTD_errorCode enum */ ZSTD_ErrorCode ZSTD_getErrorCode(size_t code) { return ERR_getErrorCode(code); } /*! ZSTD_getErrorString() : -* provides error code string from enum */ + * provides error code string from enum */ const char* ZSTD_getErrorString(ZSTD_ErrorCode code) { return ERR_getErrorString(code); } + +/*! g_debuglog_enable : + * turn on/off debug traces (global switch) */ +#if defined(ZSTD_DEBUG) && (ZSTD_DEBUG >= 2) +int g_debuglog_enable = 1; +#endif /*=************************************************************** Modified: head/sys/contrib/zstd/lib/common/zstd_internal.h ============================================================================== --- head/sys/contrib/zstd/lib/common/zstd_internal.h Wed Mar 14 02:56:43 2018 (r330893) +++ head/sys/contrib/zstd/lib/common/zstd_internal.h Wed Mar 14 03:00:17 2018 (r330894) @@ -11,6 +11,10 @@ #ifndef ZSTD_CCOMMON_H_MODULE #define ZSTD_CCOMMON_H_MODULE +/* this module contains definitions which must be identical + * across compression, decompression and dictBuilder. + * It also contains a few functions useful to at least 2 of them + * and which benefit from being inlined */ /*-************************************* * Dependencies @@ -50,21 +54,26 @@ extern "C" { #if defined(ZSTD_DEBUG) && (ZSTD_DEBUG>=2) # include +extern int g_debuglog_enable; /* recommended values for ZSTD_DEBUG display levels : * 1 : no display, enables assert() only - * 2 : reserved for currently active debugging path - * 3 : events once per object lifetime (CCtx, CDict) + * 2 : reserved for currently active debug path + * 3 : events once per object lifetime (CCtx, CDict, etc.) * 4 : events once per frame * 5 : events once per block * 6 : events once per sequence (*very* verbose) */ -# define DEBUGLOG(l, ...) { \ - if (l<=ZSTD_DEBUG) { \ - fprintf(stderr, __FILE__ ": "); \ - fprintf(stderr, __VA_ARGS__); \ - fprintf(stderr, " \n"); \ +# define RAWLOG(l, ...) { \ + if ((g_debuglog_enable) & (l<=ZSTD_DEBUG)) { \ + fprintf(stderr, __VA_ARGS__); \ } } +# define DEBUGLOG(l, ...) { \ + if ((g_debuglog_enable) & (l<=ZSTD_DEBUG)) { \ + fprintf(stderr, __FILE__ ": " __VA_ARGS__); \ + fprintf(stderr, " \n"); \ + } } #else -# define DEBUGLOG(l, ...) {} /* disabled */ +# define RAWLOG(l, ...) {} /* disabled */ +# define DEBUGLOG(l, ...) {} /* disabled */ #endif @@ -85,9 +94,7 @@ extern "C" { #define ZSTD_OPT_NUM (1<<12) #define ZSTD_REP_NUM 3 /* number of repcodes */ -#define ZSTD_REP_CHECK (ZSTD_REP_NUM) /* number of repcodes to check by the optimal parser */ #define ZSTD_REP_MOVE (ZSTD_REP_NUM-1) -#define ZSTD_REP_MOVE_OPT (ZSTD_REP_NUM) static const U32 repStartValue[ZSTD_REP_NUM] = { 1, 4, 8 }; #define KB *(1 <<10) @@ -134,28 +141,40 @@ typedef enum { set_basic, set_rle, set_compressed, set #define LLFSELog 9 #define OffFSELog 8 -static const U32 LL_bits[MaxLL+1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 2, 2, 3, 3, 4, 6, 7, 8, 9,10,11,12, +static const U32 LL_bits[MaxLL+1] = { 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 2, 2, 3, 3, + 4, 6, 7, 8, 9,10,11,12, 13,14,15,16 }; -static const S16 LL_defaultNorm[MaxLL+1] = { 4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 1, 1, 1, 1, 1, +static const S16 LL_defaultNorm[MaxLL+1] = { 4, 3, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 3, 2, 1, 1, 1, 1, 1, -1,-1,-1,-1 }; #define LL_DEFAULTNORMLOG 6 /* for static allocation */ static const U32 LL_defaultNormLog = LL_DEFAULTNORMLOG; -static const U32 ML_bits[MaxML+1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 7, 8, 9,10,11, +static const U32 ML_bits[MaxML+1] = { 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 2, 2, 3, 3, + 4, 4, 5, 7, 8, 9,10,11, 12,13,14,15,16 }; -static const S16 ML_defaultNorm[MaxML+1] = { 1, 4, 3, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,-1,-1, +static const S16 ML_defaultNorm[MaxML+1] = { 1, 4, 3, 2, 2, 2, 2, 2, + 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1,-1,-1, -1,-1,-1,-1,-1 }; #define ML_DEFAULTNORMLOG 6 /* for static allocation */ static const U32 ML_defaultNormLog = ML_DEFAULTNORMLOG; -static const S16 OF_defaultNorm[DefaultMaxOff+1] = { 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1,-1,-1,-1,-1,-1 }; +static const S16 OF_defaultNorm[DefaultMaxOff+1] = { 1, 1, 1, 1, 1, 1, 2, 2, + 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + -1,-1,-1,-1,-1 }; #define OF_DEFAULTNORMLOG 5 /* for static allocation */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Mar 14 05:25:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7020CF56574; Wed, 14 Mar 2018 05:25:19 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCE056CEE0; Wed, 14 Mar 2018 05:25:18 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0McEkx-1fFZrX2ihz-00Jedu; Wed, 14 Mar 2018 06:25:17 +0100 Date: Wed, 14 Mar 2018 06:25:10 +0100 From: "O. Hartmann" To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330884 - in head/sys: dev/cxgbe dev/cxgbe/firmware dev/cxgbe/tom modules/cxgbe/tom Message-ID: <20180314062510.0e575da4@freyja.zeit4.iv.bundesimmobilien.de> In-Reply-To: <201803132305.w2DN5pnc010768@repo.freebsd.org> References: <201803132305.w2DN5pnc010768@repo.freebsd.org> Organization: Walstatt MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:/hPSB2sWmFH5jiqUEHl3nMqk8PE4vkV0IWpMr1SO9jHcK/S4Pa3 dPG3xf8xbrh+9lalooqvfMIynGuNjO4bP2mjLm8w0VbvHQo4hIEmAaTcua5sgWik14A6DGp zlQsmJq4H+MWha/cxBC8Yz5wj35BnupCJpQFzvRr75/jQD/YW3As5vSqgKoK4hgHQ0JQeBc J89leEuxfsWhe8CaL7ikg== X-UI-Out-Filterresults: notjunk:1;V01:K0:NOYfab7eNFY=:tD7cQLFce4zRH5SlklPUZA Ueibz5nlaI2vWduYBPPXyrAhCp6ERkKud/bov72MCku8DuDdCAc6KTGKyv0NbTKFnm6gWjJMI qKHPzNviTUk9RcBvo+oVHNTYFEVUjihO+B7uvSyrO1+hwOS8EWi9CUAr7YHgsvdI8A0cSS/8Q vwHf3Tvr4BP9G9gH5XOWV8fvTLHnFm5HsYNMGhec5WZedhNLewLHlga4VGq++HIib7wvEA7xl 0xNqH//dR1k1DpzEBk8k1qsmwxLKpKkWPcHZjeWoCAVQxQeIjbbeVwItquWolTzS4DcxzU4ms LI4c1KIH+bOVA4dhtlkqbnFPGjbVGWi8DAHnFQV1IlGcJio/Oo4rTYXGxWnciRKknM0V3A0nm rwratcBBxz8r8FSfjybwGUeV7w8TwZIs0kfr+yqEu9xZwPmvtDNOCvHpZFnw2wgPGdEhvn9Nd gYivJ57GBGWEOkZSItNzEkHXf1DM/K0chJZr4Y+graRuVhGuYYQWtZwMeBiL4DAvNcsuV3shm 2oEyD4WLZR2Iit6IDRhP+v0XjJ0XlZVqGqCK43oTIAw6ISLj7GziYOKq2+2rTJ+hnlJvoxF4z f+bEZaJ0jntQw0sONp2vu06Hiacu6pfbeVxpqz6ZuVWFizJ5IXHaSfgJ5vHG6Kv+VzWr8wQWj 8rd3XgM+gE5aGd0UoxBFfshvz8PHMixx4yeUOb7TuIIBKd9lIQQksIeav0FtWE8zPcJpt2kEp FPz2xjdyFDnEqS9OUfGoDVVX32/bctsjwwwAnVjYEyOsmGkPUi4YqMCx/19r/IuOmqrF8WwoH I99EfQwwXa/NQHVVuO8n1ZcDtYzbiK/TlCchondPxwNwQLsZkI= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 05:25:20 -0000 On Tue, 13 Mar 2018 23:05:51 +0000 (UTC) John Baldwin wrote: > Author: jhb > Date: Tue Mar 13 23:05:51 2018 > New Revision: 330884 > URL: https://svnweb.freebsd.org/changeset/base/330884 > > Log: > Support for TLS offload of TOE connections on T6 adapters. > > The TOE engine in Chelsio T6 adapters supports offloading of TLS > encryption and TCP segmentation for offloaded connections. Sockets > using TLS are required to use a set of custom socket options to upload > RX and TX keys to the NIC and to enable RX processing. Currently > these socket options are implemented as TCP options in the vendor > specific range. A patched OpenSSL library will be made available in a > port / package for use with the TLS TOE support. > > TOE sockets can either offload both transmit and reception of TLS > records or just transmit. TLS offload (both RX and TX) is enabled by > setting the dev.t6nex..tls sysctl to 1 and requires TOE to be > enabled on the relevant interface. Transmit offload can be used on > any "normal" or TLS TOE socket by using the custom socket option to > program a transmit key. This permits most TOE sockets to > transparently offload TLS when applications use a patched SSL library > (e.g. using LD_LIBRARY_PATH to request use of a patched OpenSSL > library). Receive offload can only be used with TOE sockets using the > TLS mode. The dev.t6nex.0.toe.tls_rx_ports sysctl can be set to a > list of TCP port numbers. Any connection with either a local or > remote port number in that list will be created as a TLS socket rather > than a plain TOE socket. Note that although this sysctl accepts an > arbitrary list of port numbers, the sysctl(8) tool is only able to set > sysctl nodes to a single value. A TLS socket will hang without > receiving data if used by an application that is not using a patched > SSL library. Thus, the tls_rx_ports node should be used with care. > For a server mostly concerned with offloading TLS transmit, this node > is not needed as plain TOE sockets will fall back to software crypto > when using an unpatched SSL library. > > New per-interface statistics nodes are added giving counts of TLS > packets and payload bytes (payload bytes do not include TLS headers or > authentication tags/MACs) offloaded via the TOE engine, e.g.: > > dev.cc.0.stats.rx_tls_octets: 149 > dev.cc.0.stats.rx_tls_records: 13 > dev.cc.0.stats.tx_tls_octets: 26501823 > dev.cc.0.stats.tx_tls_records: 1620 > > TLS transmit work requests are constructed by a new variant of > t4_push_frames() called t4_push_tls_records() in tom/t4_tls.c. > > TLS transmit work requests require a buffer containing IVs. If the > IVs are too large to fit into the work request, a separate buffer is > allocated when constructing a work request. This buffer is associated > with the transmit descriptor and freed when the descriptor is ACKed by > the adapter. > > Received TLS frames use two new CPL messages. The first message is a > CPL_TLS_DATA containing the decryped payload of a single TLS record. > The handler places the mbuf containing the received payload on an > mbufq in the TOE pcb. The second message is a CPL_RX_TLS_CMP message > which includes a copy of the TLS header and indicates if there were > any errors. The handler for this message places the TLS header into > the socket buffer followed by the saved mbuf with the payload data. > Both of these handlers are contained in tom/t4_tls.c. > > A few routines were exposed from t4_cpl_io.c for use by t4_tls.c > including send_rx_credits(), a new send_rx_modulate(), and > t4_close_conn(). > > TLS keys for both transmit and receive are stored in onboard memory > in the NIC in the "TLS keys" memory region. > > In some cases a TLS socket can hang with pending data available in the > NIC that is not delivered to the host. As a workaround, TLS sockets > are more aggressive about sending CPL_RX_DATA_ACK messages anytime that > any data is read from a TLS socket. In addition, a fallback timer will > periodically send CPL_RX_DATA_ACK messages to the NIC for connections > that are still in the handshake phase. Once the connection has > finished the handshake and programmed RX keys via the socket option, > the timer is stopped. > > A new function select_ulp_mode() is used to determine what sub-mode a > given TOE socket should use (plain TOE, DDP, or TLS). The existing > set_tcpddp_ulp_mode() function has been renamed to set_ulp_mode() and > handles initialization of TLS-specific state when necessary in > addition to DDP-specific state. > > Since TLS sockets do not receive individual TCP segments but always > receive full TLS records, they can receive more data than is available > in the current window (e.g. if a 16k TLS record is received but the > socket buffer is itself 16k). To cope with this, just drop the window > to 0 when this happens, but track the overage and "eat" the overage as > it is read from the socket buffer not opening the window (or adding > rx_credits) for the overage bytes. > > Reviewed by: np (earlier version) > Sponsored by: Chelsio Communications > Differential Revision: https://reviews.freebsd.org/D14529 > > Added: > head/sys/dev/cxgbe/tom/t4_tls.c (contents, props changed) > head/sys/dev/cxgbe/tom/t4_tls.h (contents, props changed) > Modified: > head/sys/dev/cxgbe/adapter.h > head/sys/dev/cxgbe/firmware/t6fw_cfg.txt > head/sys/dev/cxgbe/offload.h > head/sys/dev/cxgbe/t4_main.c > head/sys/dev/cxgbe/tom/t4_connect.c > head/sys/dev/cxgbe/tom/t4_cpl_io.c > head/sys/dev/cxgbe/tom/t4_listen.c > head/sys/dev/cxgbe/tom/t4_tom.c > head/sys/dev/cxgbe/tom/t4_tom.h > head/sys/modules/cxgbe/tom/Makefile > > Modified: head/sys/dev/cxgbe/adapter.h > ============================================================================== > --- head/sys/dev/cxgbe/adapter.h Tue Mar 13 22:54:29 2018 > (r330883) +++ head/sys/dev/cxgbe/adapter.h Tue Mar 13 23:05:51 > 2018 (r330884) @@ -297,6 +297,10 @@ struct port_info { > struct port_stats stats; > u_int tnl_cong_drops; > u_int tx_parse_error; > + u_long tx_tls_records; > + u_long tx_tls_octets; > + u_long rx_tls_records; > + u_long rx_tls_octets; > > struct callout tick; > }; > > Modified: head/sys/dev/cxgbe/firmware/t6fw_cfg.txt > ============================================================================== > --- head/sys/dev/cxgbe/firmware/t6fw_cfg.txt Tue Mar 13 22:54:29 > 2018 (r330883) +++ head/sys/dev/cxgbe/firmware/t6fw_cfg.txt Tue > Mar 13 23:05:51 2018 (r330884) @@ -163,10 +163,12 @@ > nserver = 512 > nhpfilter = 0 > nhash = 16384 > - protocol = ofld, rddp, rdmac, iscsi_initiator_pdu, iscsi_target_pdu, > iscsi_t10dif, crypto_lookaside > + protocol = ofld, rddp, rdmac, iscsi_initiator_pdu, iscsi_target_pdu, > iscsi_t10dif, tlskeys, crypto_lookaside tp_l2t = 4096 > tp_ddp = 2 > tp_ddp_iscsi = 2 > + tp_tls_key = 3 > + tp_tls_mxrxsize = 17408 # 16384 + 1024, governs max rx data, pm > max xfer len, rx coalesce sizes tp_stag = 2 > tp_pbl = 5 > tp_rq = 7 > @@ -273,7 +275,7 @@ > > [fini] > version = 0x1 > - checksum = 0x7191019f > + checksum = 0x9e8952d2 > # > # $FreeBSD$ > # > > Modified: head/sys/dev/cxgbe/offload.h > ============================================================================== > --- head/sys/dev/cxgbe/offload.h Tue Mar 13 22:54:29 2018 > (r330883) +++ head/sys/dev/cxgbe/offload.h Tue Mar 13 23:05:51 > 2018 (r330884) @@ -151,6 +151,9 @@ struct tom_tunables { > int sndbuf; > int ddp; > int rx_coalesce; > + int tls; > + int *tls_rx_ports; > + int num_tls_rx_ports; > int tx_align; > int tx_zcopy; > }; > > Modified: head/sys/dev/cxgbe/t4_main.c > ============================================================================== > --- head/sys/dev/cxgbe/t4_main.c Tue Mar 13 22:54:29 2018 > (r330883) +++ head/sys/dev/cxgbe/t4_main.c Tue Mar 13 23:05:51 > 2018 (r330884) @@ -591,6 +591,7 @@ static int > sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); static int > sysctl_tc_params(SYSCTL_HANDLER_ARGS); #endif > #ifdef TCP_OFFLOAD > +static int sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS); > static int sysctl_tp_tick(SYSCTL_HANDLER_ARGS); > static int sysctl_tp_dack_timer(SYSCTL_HANDLER_ARGS); > static int sysctl_tp_timer(SYSCTL_HANDLER_ARGS); > @@ -1390,6 +1391,7 @@ t4_detach_common(device_t dev) > free(sc->sge.iqmap, M_CXGBE); > free(sc->sge.eqmap, M_CXGBE); > free(sc->tids.ftid_tab, M_CXGBE); > + free(sc->tt.tls_rx_ports, M_CXGBE); > t4_destroy_dma_tag(sc); > if (mtx_initialized(&sc->sc_lock)) { > sx_xlock(&t4_list_lock); > @@ -5433,6 +5435,14 @@ t4_sysctls(struct adapter *sc) > SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_coalesce", > CTLFLAG_RW, &sc->tt.rx_coalesce, 0, "receive > coalescing"); > + sc->tt.tls = 0; > + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tls", CTLFLAG_RW, > + &sc->tt.tls, 0, "Inline TLS allowed"); > + > + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tls_rx_ports", > + CTLTYPE_INT | CTLFLAG_RW, sc, 0, sysctl_tls_rx_ports, > + "I", "TCP ports that use inline TLS+TOE RX"); > + > sc->tt.tx_align = 1; > SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_align", > CTLFLAG_RW, &sc->tt.tx_align, 0, "chop and align > payload"); @@ -5836,6 +5846,19 @@ cxgbe_sysctls(struct port_info *pi) > "# of buffer-group 3 truncated packets"); > > #undef SYSCTL_ADD_T4_PORTSTAT > + > + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "tx_tls_records", > + CTLFLAG_RD, &pi->tx_tls_records, > + "# of TLS records transmitted"); > + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "tx_tls_octets", > + CTLFLAG_RD, &pi->tx_tls_octets, > + "# of payload octets in transmitted TLS records"); > + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_tls_records", > + CTLFLAG_RD, &pi->rx_tls_records, > + "# of TLS records received"); > + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_tls_octets", > + CTLFLAG_RD, &pi->rx_tls_octets, > + "# of payload octets in received TLS records"); > } > > static int > @@ -8257,6 +8280,68 @@ done: > #endif > > #ifdef TCP_OFFLOAD > +static int > +sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS) > +{ > + struct adapter *sc = arg1; > + int *old_ports, *new_ports; > + int i, new_count, rc; > + > + if (req->newptr == NULL && req->oldptr == NULL) > + return (SYSCTL_OUT(req, NULL, imax(sc->tt.num_tls_rx_ports, > 1) * > + sizeof(sc->tt.tls_rx_ports[0]))); > + > + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4tlsrx"); > + if (rc) > + return (rc); > + > + if (sc->tt.num_tls_rx_ports == 0) { > + i = -1; > + rc = SYSCTL_OUT(req, &i, sizeof(i)); > + } else > + rc = SYSCTL_OUT(req, sc->tt.tls_rx_ports, > + sc->tt.num_tls_rx_ports * > sizeof(sc->tt.tls_rx_ports[0])); > + if (rc == 0 && req->newptr != NULL) { > + new_count = req->newlen / sizeof(new_ports[0]); > + new_ports = malloc(new_count * sizeof(new_ports[0]), M_CXGBE, > + M_WAITOK); > + rc = SYSCTL_IN(req, new_ports, new_count * > + sizeof(new_ports[0])); > + if (rc) > + goto err; > + > + /* Allow setting to a single '-1' to clear the list. */ > + if (new_count == 1 && new_ports[0] == -1) { > + ADAPTER_LOCK(sc); > + old_ports = sc->tt.tls_rx_ports; > + sc->tt.tls_rx_ports = NULL; > + sc->tt.num_tls_rx_ports = 0; > + ADAPTER_UNLOCK(sc); > + free(old_ports, M_CXGBE); > + } else { > + for (i = 0; i < new_count; i++) { > + if (new_ports[i] < 1 || > + new_ports[i] > IPPORT_MAX) { > + rc = EINVAL; > + goto err; > + } > + } > + > + ADAPTER_LOCK(sc); > + old_ports = sc->tt.tls_rx_ports; > + sc->tt.tls_rx_ports = new_ports; > + sc->tt.num_tls_rx_ports = new_count; > + ADAPTER_UNLOCK(sc); > + free(old_ports, M_CXGBE); > + new_ports = NULL; > + } > + err: > + free(new_ports, M_CXGBE); > + } > + end_synchronized_op(sc, 0); > + return (rc); > +} > + > static void > unit_conv(char *buf, size_t len, u_int val, u_int factor) > { > > Modified: head/sys/dev/cxgbe/tom/t4_connect.c > ============================================================================== > --- head/sys/dev/cxgbe/tom/t4_connect.c Tue Mar 13 22:54:29 > 2018 (r330883) +++ head/sys/dev/cxgbe/tom/t4_connect.c Tue Mar > 13 23:05:51 2018 (r330884) @@ -142,6 +142,10 @@ > do_act_establish(struct sge_iq *iq, const struct rss_h } > > make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); > + > + if (toep->ulp_mode == ULP_MODE_TLS) > + tls_establish(toep); > + > done: > INP_WUNLOCK(inp); > CURVNET_RESTORE(); > @@ -268,6 +272,11 @@ calc_opt2a(struct socket *so, struct toepcb *toep) > if (toep->ulp_mode == ULP_MODE_TCPDDP) > opt2 |= F_RX_FC_VALID | F_RX_FC_DDP; > #endif > + if (toep->ulp_mode == ULP_MODE_TLS) { > + opt2 |= F_RX_FC_VALID; > + opt2 &= ~V_RX_COALESCE(M_RX_COALESCE); > + opt2 |= F_RX_FC_DISABLE; > + } > > return (htobe32(opt2)); > } > @@ -378,10 +387,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru > DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); > > toep->vnet = so->so_vnet; > - if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) > - set_tcpddp_ulp_mode(toep); > - else > - toep->ulp_mode = ULP_MODE_NONE; > + set_ulp_mode(toep, select_ulp_mode(so, sc)); > SOCKBUF_LOCK(&so->so_rcv); > /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ > toep->rx_credits = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); > > Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c > ============================================================================== > --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Mar 13 22:54:29 2018 > (r330883) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Mar 13 23:05:51 > 2018 (r330884) @@ -73,9 +73,6 @@ __FBSDID("$FreeBSD$"); > #include "tom/t4_tom_l2t.h" > #include "tom/t4_tom.h" > > -#define > IS_AIOTX_MBUF(m) \ > - ((m)->m_flags & M_EXT && (m)->m_ext.ext_flags & EXT_FLAG_AIOTX) > - > static void t4_aiotx_cancel(struct kaiocb *job); > static void t4_aiotx_queue_toep(struct toepcb *toep); > > @@ -106,7 +103,7 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par > { > struct wrqe *wr; > struct fw_flowc_wr *flowc; > - unsigned int nparams = ftxp ? 8 : 6, flowclen; > + unsigned int nparams, flowclen, paramidx; > struct vi_info *vi = toep->vi; > struct port_info *pi = vi->pi; > struct adapter *sc = pi->adapter; > @@ -116,6 +113,15 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par > KASSERT(!(toep->flags & TPF_FLOWC_WR_SENT), > ("%s: flowc for tid %u sent already", __func__, toep->tid)); > > + if (ftxp != NULL) > + nparams = 8; > + else > + nparams = 6; > + if (toep->ulp_mode == ULP_MODE_TLS) > + nparams++; > + if (toep->tls.fcplenmax != 0) > + nparams++; > + > flowclen = sizeof(*flowc) + nparams * sizeof(struct > fw_flowc_mnemval); > wr = alloc_wrqe(roundup2(flowclen, 16), toep->ofld_txq); > @@ -131,39 +137,45 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par > flowc->flowid_len16 = htonl(V_FW_WR_LEN16(howmany(flowclen, 16)) | > V_FW_WR_FLOWID(toep->tid)); > > - flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN; > - flowc->mnemval[0].val = htobe32(pfvf); > - flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; > - flowc->mnemval[1].val = htobe32(pi->tx_chan); > - flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT; > - flowc->mnemval[2].val = htobe32(pi->tx_chan); > - flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; > - flowc->mnemval[3].val = htobe32(toep->ofld_rxq->iq.abs_id); > +#define FLOWC_PARAM(__m, __v) \ > + do { \ > + flowc->mnemval[paramidx].mnemonic = FW_FLOWC_MNEM_##__m; \ > + flowc->mnemval[paramidx].val = htobe32(__v); \ > + paramidx++; \ > + } while (0) > + > + paramidx = 0; > + > + FLOWC_PARAM(PFNVFN, pfvf); > + FLOWC_PARAM(CH, pi->tx_chan); > + FLOWC_PARAM(PORT, pi->tx_chan); > + FLOWC_PARAM(IQID, toep->ofld_rxq->iq.abs_id); > if (ftxp) { > uint32_t sndbuf = min(ftxp->snd_space, sc->tt.sndbuf); > > - flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDNXT; > - flowc->mnemval[4].val = htobe32(ftxp->snd_nxt); > - flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_RCVNXT; > - flowc->mnemval[5].val = htobe32(ftxp->rcv_nxt); > - flowc->mnemval[6].mnemonic = FW_FLOWC_MNEM_SNDBUF; > - flowc->mnemval[6].val = htobe32(sndbuf); > - flowc->mnemval[7].mnemonic = FW_FLOWC_MNEM_MSS; > - flowc->mnemval[7].val = htobe32(ftxp->mss); > + FLOWC_PARAM(SNDNXT, ftxp->snd_nxt); > + FLOWC_PARAM(RCVNXT, ftxp->rcv_nxt); > + FLOWC_PARAM(SNDBUF, sndbuf); > + FLOWC_PARAM(MSS, ftxp->mss); > > CTR6(KTR_CXGBE, > "%s: tid %u, mss %u, sndbuf %u, snd_nxt 0x%x, rcv_nxt > 0x%x", __func__, toep->tid, ftxp->mss, sndbuf, ftxp->snd_nxt, > ftxp->rcv_nxt); > } else { > - flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDBUF; > - flowc->mnemval[4].val = htobe32(512); > - flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_MSS; > - flowc->mnemval[5].val = htobe32(512); > + FLOWC_PARAM(SNDBUF, 512); > + FLOWC_PARAM(MSS, 512); > > CTR2(KTR_CXGBE, "%s: tid %u", __func__, toep->tid); > } > + if (toep->ulp_mode == ULP_MODE_TLS) > + FLOWC_PARAM(ULP_MODE, toep->ulp_mode); > + if (toep->tls.fcplenmax != 0) > + FLOWC_PARAM(TXDATAPLEN_MAX, toep->tls.fcplenmax); > +#undef FLOWC_PARAM > > + KASSERT(paramidx == nparams, ("nparams mismatch")); > + > txsd->tx_credits = howmany(flowclen, 16); > txsd->plen = 0; > KASSERT(toep->tx_credits >= txsd->tx_credits && toep->txsd_avail > 0, > @@ -421,7 +433,7 @@ make_established(struct toepcb *toep, uint32_t snd_isn > soisconnected(so); > } > > -static int > +int > send_rx_credits(struct adapter *sc, struct toepcb *toep, int credits) > { > struct wrqe *wr; > @@ -443,6 +455,23 @@ send_rx_credits(struct adapter *sc, struct toepcb *toe > } > > void > +send_rx_modulate(struct adapter *sc, struct toepcb *toep) > +{ > + struct wrqe *wr; > + struct cpl_rx_data_ack *req; > + > + wr = alloc_wrqe(sizeof(*req), toep->ctrlq); > + if (wr == NULL) > + return; > + req = wrtod(wr); > + > + INIT_TP_WR_MIT_CPL(req, CPL_RX_DATA_ACK, toep->tid); > + req->credit_dack = htobe32(F_RX_MODULATE_RX); > + > + t4_wrq_tx(sc, wr); > +} > + > +void > t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) > { > struct adapter *sc = tod->tod_softc; > @@ -459,8 +488,18 @@ t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) > ("%s: sb %p has more data (%d) than last time (%d).", > __func__, sb, sbused(sb), toep->sb_cc)); > > - toep->rx_credits += toep->sb_cc - sbused(sb); > + credits = toep->sb_cc - sbused(sb); > toep->sb_cc = sbused(sb); > + if (toep->ulp_mode == ULP_MODE_TLS) { > + if (toep->tls.rcv_over >= credits) { > + toep->tls.rcv_over -= credits; > + credits = 0; > + } else { > + credits -= toep->tls.rcv_over; > + toep->tls.rcv_over = 0; > + } > + } > + toep->rx_credits += credits; > > if (toep->rx_credits > 0 && > (tp->rcv_wnd <= 32 * 1024 || toep->rx_credits >= 64 * 1024 || > @@ -471,7 +510,8 @@ t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) > toep->rx_credits -= credits; > tp->rcv_wnd += credits; > tp->rcv_adv += credits; > - } > + } else if (toep->flags & TPF_FORCE_CREDITS) > + send_rx_modulate(sc, toep); > } > > void > @@ -489,8 +529,8 @@ t4_rcvd(struct toedev *tod, struct tcpcb *tp) > /* > * Close a connection by sending a CPL_CLOSE_CON_REQ message. > */ > -static int > -close_conn(struct adapter *sc, struct toepcb *toep) > +int > +t4_close_conn(struct adapter *sc, struct toepcb *toep) > { > struct wrqe *wr; > struct cpl_close_con_req *req; > @@ -691,6 +731,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep > > KASSERT(toep->ulp_mode == ULP_MODE_NONE || > toep->ulp_mode == ULP_MODE_TCPDDP || > + toep->ulp_mode == ULP_MODE_TLS || > toep->ulp_mode == ULP_MODE_RDMA, > ("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, toep)); > > @@ -905,7 +946,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep > > /* Send a FIN if requested, but only if there's no more data to send > */ if (m == NULL && toep->flags & TPF_SEND_FIN) > - close_conn(sc, toep); > + t4_close_conn(sc, toep); > } > > static inline void > @@ -1097,7 +1138,7 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, > > /* Send a FIN if requested, but only if there are no more PDUs to > send */ if (mbufq_first(pduq) == NULL && toep->flags & TPF_SEND_FIN) > - close_conn(sc, toep); > + t4_close_conn(sc, toep); > } > > int > @@ -1116,6 +1157,8 @@ t4_tod_output(struct toedev *tod, struct tcpcb *tp) > > if (toep->ulp_mode == ULP_MODE_ISCSI) > t4_push_pdus(sc, toep, 0); > + else if (tls_tx_key(toep)) > + t4_push_tls_records(sc, toep, 0); > else > t4_push_frames(sc, toep, 0); > > @@ -1140,6 +1183,8 @@ t4_send_fin(struct toedev *tod, struct tcpcb *tp) > if (tp->t_state >= TCPS_ESTABLISHED) { > if (toep->ulp_mode == ULP_MODE_ISCSI) > t4_push_pdus(sc, toep, 0); > + else if (tls_tx_key(toep)) > + t4_push_tls_records(sc, toep, 0); > else > t4_push_frames(sc, toep, 0); > } > @@ -1772,6 +1817,10 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header > credits -= txsd->tx_credits; > toep->tx_credits += txsd->tx_credits; > plen += txsd->plen; > + if (txsd->iv_buffer) { > + free(txsd->iv_buffer, M_CXGBE); > + txsd->iv_buffer = NULL; > + } > txsd++; > toep->txsd_avail++; > KASSERT(toep->txsd_avail <= toep->txsd_total, > @@ -1797,6 +1846,8 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header > CURVNET_SET(toep->vnet); > if (toep->ulp_mode == ULP_MODE_ISCSI) > t4_push_pdus(sc, toep, plen); > + else if (tls_tx_key(toep)) > + t4_push_tls_records(sc, toep, plen); > else > t4_push_frames(sc, toep, plen); > CURVNET_RESTORE(); > @@ -1826,6 +1877,12 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header > tid, plen); > #endif > sbdrop_locked(sb, plen); > + if (tls_tx_key(toep)) { > + struct tls_ofld_info *tls_ofld = &toep->tls; > + > + MPASS(tls_ofld->sb_off >= plen); > + tls_ofld->sb_off -= plen; > + } > if (!TAILQ_EMPTY(&toep->aiotx_jobq)) > t4_aiotx_queue_toep(toep); > sowwakeup_locked(so); /* unlocks so_snd */ > @@ -2298,6 +2355,9 @@ t4_aio_queue_aiotx(struct socket *so, struct kaiocb *j > return (EOPNOTSUPP); > > if (!sc->tt.tx_zcopy) > + return (EOPNOTSUPP); > + > + if (is_tls_offload(toep) || tls_tx_key(toep)) > return (EOPNOTSUPP); > > SOCKBUF_LOCK(&so->so_snd); > > Modified: head/sys/dev/cxgbe/tom/t4_listen.c > ============================================================================== > --- head/sys/dev/cxgbe/tom/t4_listen.c Tue Mar 13 22:54:29 2018 > (r330883) +++ head/sys/dev/cxgbe/tom/t4_listen.c Tue Mar 13 23:05:51 > 2018 (r330884) @@ -1056,6 +1056,11 @@ calc_opt2p(struct adapter *sc, > struct port_info *pi, i if (ulp_mode == ULP_MODE_TCPDDP) > opt2 |= F_RX_FC_VALID | F_RX_FC_DDP; > #endif > + if (ulp_mode == ULP_MODE_TLS) { > + opt2 |= F_RX_FC_VALID; > + opt2 &= ~V_RX_COALESCE(M_RX_COALESCE); > + opt2 |= F_RX_FC_DISABLE; > + } > > return htobe32(opt2); > } > @@ -1347,11 +1352,15 @@ found: > > INIT_TP_WR_MIT_CPL(rpl5, CPL_PASS_ACCEPT_RPL, tid); > } > - if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) { > - ulp_mode = ULP_MODE_TCPDDP; > + ulp_mode = select_ulp_mode(so, sc); > + switch (ulp_mode) { > + case ULP_MODE_TCPDDP: > synqe->flags |= TPF_SYNQE_TCPDDP; > - } else > - ulp_mode = ULP_MODE_NONE; > + break; > + case ULP_MODE_TLS: > + synqe->flags |= TPF_SYNQE_TLS; > + break; > + } > rpl->opt0 = calc_opt0(so, vi, e, mtu_idx, rscale, rx_credits, > ulp_mode); rpl->opt2 = calc_opt2p(sc, pi, rxqid, &cpl->tcpopt, &th, ulp_mode); > > @@ -1407,8 +1416,8 @@ found: > REJECT_PASS_ACCEPT(); > } > > - CTR5(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p, synqe %p, SYNACK", > - __func__, stid, tid, lctx, synqe); > + CTR6(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p, synqe %p, SYNACK mode > %d", > + __func__, stid, tid, lctx, synqe, ulp_mode); > > INP_WLOCK(inp); > synqe->flags |= TPF_SYNQE_HAS_L2TE; > @@ -1557,9 +1566,11 @@ reset: > toep->tid = tid; > toep->l2te = &sc->l2t->l2tab[synqe->l2e_idx]; > if (synqe->flags & TPF_SYNQE_TCPDDP) > - set_tcpddp_ulp_mode(toep); > + set_ulp_mode(toep, ULP_MODE_TCPDDP); > + else if (synqe->flags & TPF_SYNQE_TLS) > + set_ulp_mode(toep, ULP_MODE_TLS); > else > - toep->ulp_mode = ULP_MODE_NONE; > + set_ulp_mode(toep, ULP_MODE_NONE); > /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ > toep->rx_credits = synqe->rcv_bufsize; > > > Added: head/sys/dev/cxgbe/tom/t4_tls.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/cxgbe/tom/t4_tls.c Tue Mar 13 23:05:51 2018 > (r330884) @@ -0,0 +1,1642 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2017-2018 Chelsio Communications, Inc. > + * All rights reserved. > + * Written by: John Baldwin > + * > + * 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 "opt_inet.h" > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#ifdef TCP_OFFLOAD > +#include "common/common.h" > +#include "common/t4_tcb.h" > +#include "tom/t4_tom_l2t.h" > +#include "tom/t4_tom.h" > + > +/* > + * The TCP sequence number of a CPL_TLS_DATA mbuf is saved here while > + * the mbuf is in the ulp_pdu_reclaimq. > + */ > +#define tls_tcp_seq PH_loc.thirtytwo[0] > + > +/* > + * Handshake lock used for the handshake timer. Having a global lock > + * is perhaps not ideal, but it avoids having to use callout_drain() > + * in tls_uninit_toep() which can't block. Also, the timer shouldn't > + * actually fire for most connections. > + */ > +static struct mtx tls_handshake_lock; > + > +static void > +t4_set_tls_tcb_field(struct toepcb *toep, uint16_t word, uint64_t mask, > + uint64_t val) > +{ > + struct adapter *sc = td_adapter(toep->td); > + > + t4_set_tcb_field(sc, toep->ctrlq, toep->tid, word, mask, val, 0, 0, > + toep->ofld_rxq->iq.abs_id); > +} > + > +/* TLS and DTLS common routines */ > +int > +tls_tx_key(struct toepcb *toep) > +{ > + struct tls_ofld_info *tls_ofld = &toep->tls; > + > + return (tls_ofld->tx_key_addr >= 0); > +} > + > +int > +tls_rx_key(struct toepcb *toep) > +{ > + struct tls_ofld_info *tls_ofld = &toep->tls; > + > + return (tls_ofld->rx_key_addr >= 0); > +} > + > +static int > +key_size(struct toepcb *toep) > +{ > + struct tls_ofld_info *tls_ofld = &toep->tls; > + > + return ((tls_ofld->key_location == TLS_SFO_WR_CONTEXTLOC_IMMEDIATE) ? > + tls_ofld->k_ctx.tx_key_info_size : KEY_IN_DDR_SIZE); > +} > + > +/* Set TLS Key-Id in TCB */ > +static void > +t4_set_tls_keyid(struct toepcb *toep, unsigned int key_id) > +{ > + > + t4_set_tls_tcb_field(toep, W_TCB_RX_TLS_KEY_TAG, > + V_TCB_RX_TLS_KEY_TAG(M_TCB_RX_TLS_BUF_TAG), > + V_TCB_RX_TLS_KEY_TAG(key_id)); > +} > + > +/* Clear TF_RX_QUIESCE to re-enable receive. */ > +static void > +t4_clear_rx_quiesce(struct toepcb *toep) > +{ > + > + t4_set_tls_tcb_field(toep, W_TCB_T_FLAGS, V_TF_RX_QUIESCE(1), 0); > +} > + > +static void > +tls_clr_ofld_mode(struct toepcb *toep) > +{ > + > + tls_stop_handshake_timer(toep); > + > + /* Operate in PDU extraction mode only. */ > + t4_set_tls_tcb_field(toep, W_TCB_ULP_RAW, > + V_TCB_ULP_RAW(M_TCB_ULP_RAW), > + V_TCB_ULP_RAW(V_TF_TLS_ENABLE(1))); > + t4_clear_rx_quiesce(toep); > +} > + > +static void > +tls_clr_quiesce(struct toepcb *toep) > +{ > + > + tls_stop_handshake_timer(toep); > + t4_clear_rx_quiesce(toep); > +} > + > +/* > + * Calculate the TLS data expansion size > + */ > +static int > +tls_expansion_size(struct toepcb *toep, int data_len, int full_pdus_only, > + unsigned short *pdus_per_ulp) > +{ > + struct tls_ofld_info *tls_ofld = &toep->tls; > + struct tls_scmd *scmd = &tls_ofld->scmd0; > + int expn_size = 0, frag_count = 0, pad_per_pdu = 0, > + pad_last_pdu = 0, last_frag_size = 0, max_frag_size = 0; > + int exp_per_pdu = 0; > + int hdr_len = TLS_HEADER_LENGTH; > + > + do { > + max_frag_size = tls_ofld->k_ctx.frag_size; > + if (G_SCMD_CIPH_MODE(scmd->seqno_numivs) == > + SCMD_CIPH_MODE_AES_GCM) { > + frag_count = (data_len / max_frag_size); > + exp_per_pdu = GCM_TAG_SIZE + AEAD_EXPLICIT_DATA_SIZE > + > + hdr_len; > + expn_size = frag_count * exp_per_pdu; > + if (full_pdus_only) { > + *pdus_per_ulp = data_len / (exp_per_pdu + > + max_frag_size); > + if (*pdus_per_ulp > 32) > + *pdus_per_ulp = 32; > + else if(!*pdus_per_ulp) > + *pdus_per_ulp = 1; > + expn_size = (*pdus_per_ulp) * exp_per_pdu; > + break; > + } > + if ((last_frag_size = data_len % max_frag_size) > 0) > { > + frag_count += 1; > + expn_size += exp_per_pdu; > + } > + break; > + } else if (G_SCMD_CIPH_MODE(scmd->seqno_numivs) != > + SCMD_CIPH_MODE_NOP) { > + /* Calculate the number of fragments we can make */ > + frag_count = (data_len / max_frag_size); > + if (frag_count > 0) { > + pad_per_pdu = (((howmany((max_frag_size + > + tls_ofld->mac_length), > + CIPHER_BLOCK_SIZE)) * > + CIPHER_BLOCK_SIZE) - > + (max_frag_size + > + tls_ofld->mac_length)); > + if (!pad_per_pdu) > + pad_per_pdu = CIPHER_BLOCK_SIZE; > + exp_per_pdu = pad_per_pdu + > + tls_ofld->mac_length + > + hdr_len + CIPHER_BLOCK_SIZE; > + expn_size = frag_count * exp_per_pdu; > + } > + if (full_pdus_only) { > + *pdus_per_ulp = data_len / (exp_per_pdu + > + max_frag_size); > + if (*pdus_per_ulp > 32) > + *pdus_per_ulp = 32; > + else if (!*pdus_per_ulp) > + *pdus_per_ulp = 1; > + expn_size = (*pdus_per_ulp) * exp_per_pdu; > + break; > + } > + /* Consider the last fragment */ > + if ((last_frag_size = data_len % max_frag_size) > 0) > { > + pad_last_pdu = (((howmany((last_frag_size + > + > tls_ofld->mac_length), > + CIPHER_BLOCK_SIZE)) * > + CIPHER_BLOCK_SIZE) - > + (last_frag_size + > + tls_ofld->mac_length)); > + if (!pad_last_pdu) > + pad_last_pdu = CIPHER_BLOCK_SIZE; > + expn_size += (pad_last_pdu + > + tls_ofld->mac_length + hdr_len > + > + CIPHER_BLOCK_SIZE); > + } > + } > + } while (0); > + > + return (expn_size); > +} > + > +/* Copy Key to WR */ > +static void > +tls_copy_tx_key(struct toepcb *toep, void *dst) > +{ > + struct tls_ofld_info *tls_ofld = &toep->tls; > + struct ulptx_sc_memrd *sc_memrd; > + struct ulptx_idata *sc; > + > + if (tls_ofld->k_ctx.tx_key_info_size <= 0) > + return; > + > + if (tls_ofld->key_location == TLS_SFO_WR_CONTEXTLOC_DDR) { > + sc = dst; > + sc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_NOOP)); > + sc->len = htobe32(0); > + sc_memrd = (struct ulptx_sc_memrd *)(sc + 1); > + sc_memrd->cmd_to_len = htobe32(V_ULPTX_CMD(ULP_TX_SC_MEMRD) | > + V_ULP_TX_SC_MORE(1) | > + V_ULPTX_LEN16(tls_ofld->k_ctx.tx_key_info_size >> 4)); > + sc_memrd->addr = htobe32(tls_ofld->tx_key_addr >> 5); > + } else if (tls_ofld->key_location == > TLS_SFO_WR_CONTEXTLOC_IMMEDIATE) { > + memcpy(dst, &tls_ofld->k_ctx.tx, > + tls_ofld->k_ctx.tx_key_info_size); > + } > +} > + > +/* TLS/DTLS content type for CPL SFO */ > +static inline unsigned char > +tls_content_type(unsigned char content_type) > +{ > + /* > + * XXX: Shouldn't this map CONTENT_TYPE_APP_DATA to DATA and > + * default to "CUSTOM" for all other types including > + * heartbeat? > + */ > + switch (content_type) { > + case CONTENT_TYPE_CCS: > + return CPL_TX_TLS_SFO_TYPE_CCS; > + case CONTENT_TYPE_ALERT: > + return CPL_TX_TLS_SFO_TYPE_ALERT; > + case CONTENT_TYPE_HANDSHAKE: > + return CPL_TX_TLS_SFO_TYPE_HANDSHAKE; > + case CONTENT_TYPE_HEARTBEAT: > + return CPL_TX_TLS_SFO_TYPE_HEARTBEAT; > + } > + return CPL_TX_TLS_SFO_TYPE_DATA; > +} > + > +static unsigned char > +get_cipher_key_size(unsigned int ck_size) > +{ > + switch (ck_size) { > + case AES_NOP: /* NOP */ > + return 15; > + case AES_128: /* AES128 */ > + return CH_CK_SIZE_128; > + case AES_192: /* AES192 */ > + return CH_CK_SIZE_192; > + case AES_256: /* AES256 */ > + return CH_CK_SIZE_256; > + default: > + return CH_CK_SIZE_256; > + } > +} > + > +static unsigned char > +get_mac_key_size(unsigned int mk_size) > +{ > + switch (mk_size) { > + case SHA_NOP: /* NOP */ > + return CH_MK_SIZE_128; > + case SHA_GHASH: /* GHASH */ > + case SHA_512: /* SHA512 */ > + return CH_MK_SIZE_512; > + case SHA_224: /* SHA2-224 */ > + return CH_MK_SIZE_192; > + case SHA_256: /* SHA2-256*/ > + return CH_MK_SIZE_256; > + case SHA_384: /* SHA384 */ > + return CH_MK_SIZE_512; > + case SHA1: /* SHA1 */ > + default: > + return CH_MK_SIZE_160; > + } > +} > + > +static unsigned int > +get_proto_ver(int proto_ver) > +{ > + switch (proto_ver) { > + case TLS1_2_VERSION: > + return TLS_1_2_VERSION; > + case TLS1_1_VERSION: > + return TLS_1_1_VERSION; > + case DTLS1_2_VERSION: > + return DTLS_1_2_VERSION; > + default: > + return TLS_VERSION_MAX; > + } > +} > + > +static void > +tls_rxkey_flit1(struct tls_keyctx *kwr, struct tls_key_context *kctx) > +{ > + > + if (kctx->state.enc_mode == CH_EVP_CIPH_GCM_MODE) { > + kwr->u.rxhdr.ivinsert_to_authinsrt = > + htobe64(V_TLS_KEYCTX_TX_WR_IVINSERT(6ULL) | > + V_TLS_KEYCTX_TX_WR_AADSTRTOFST(1ULL) | > + V_TLS_KEYCTX_TX_WR_AADSTOPOFST(5ULL) | > + V_TLS_KEYCTX_TX_WR_AUTHSRTOFST(14ULL) | > + V_TLS_KEYCTX_TX_WR_AUTHSTOPOFST(16ULL) | > + V_TLS_KEYCTX_TX_WR_CIPHERSRTOFST(14ULL) | > + V_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST(0ULL) | > + V_TLS_KEYCTX_TX_WR_AUTHINSRT(16ULL)); > + kwr->u.rxhdr.ivpresent_to_rxmk_size &= > + ~(V_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT(1)); > + kwr->u.rxhdr.authmode_to_rxvalid &= > + ~(V_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL(1)); > + } else { > + kwr->u.rxhdr.ivinsert_to_authinsrt = > + htobe64(V_TLS_KEYCTX_TX_WR_IVINSERT(6ULL) | > + V_TLS_KEYCTX_TX_WR_AADSTRTOFST(1ULL) | > + V_TLS_KEYCTX_TX_WR_AADSTOPOFST(5ULL) | > + V_TLS_KEYCTX_TX_WR_AUTHSRTOFST(22ULL) | > + V_TLS_KEYCTX_TX_WR_AUTHSTOPOFST(0ULL) | > + V_TLS_KEYCTX_TX_WR_CIPHERSRTOFST(22ULL) | > + V_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST(0ULL) | > + V_TLS_KEYCTX_TX_WR_AUTHINSRT(0ULL)); > + } > +} > + > +/* Rx key */ > +static void > +prepare_rxkey_wr(struct tls_keyctx *kwr, struct tls_key_context *kctx) > +{ > + unsigned int ck_size = kctx->cipher_secret_size; > + unsigned int mk_size = kctx->mac_secret_size; > + int proto_ver = kctx->proto_ver; > + > + kwr->u.rxhdr.flitcnt_hmacctrl = > + ((kctx->tx_key_info_size >> 4) << 3) | kctx->hmac_ctrl; > + > + kwr->u.rxhdr.protover_ciphmode = > + V_TLS_KEYCTX_TX_WR_PROTOVER(get_proto_ver(proto_ver)) | > + V_TLS_KEYCTX_TX_WR_CIPHMODE(kctx->state.enc_mode); > + > + kwr->u.rxhdr.authmode_to_rxvalid = > + V_TLS_KEYCTX_TX_WR_AUTHMODE(kctx->state.auth_mode) | > + V_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL(1) | > + V_TLS_KEYCTX_TX_WR_SEQNUMCTRL(3) | > + V_TLS_KEYCTX_TX_WR_RXVALID(1); > + > + kwr->u.rxhdr.ivpresent_to_rxmk_size = > + V_TLS_KEYCTX_TX_WR_IVPRESENT(0) | > + V_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT(1) | > + V_TLS_KEYCTX_TX_WR_RXCK_SIZE(get_cipher_key_size(ck_size)) | > + V_TLS_KEYCTX_TX_WR_RXMK_SIZE(get_mac_key_size(mk_size)); > + > + tls_rxkey_flit1(kwr, kctx); > + > + /* No key reversal for GCM */ > + if (kctx->state.enc_mode != CH_EVP_CIPH_GCM_MODE) { > + t4_aes_getdeckey(kwr->keys.edkey, kctx->rx.key, > + (kctx->cipher_secret_size << 3)); > + memcpy(kwr->keys.edkey + kctx->cipher_secret_size, > + kctx->rx.key + kctx->cipher_secret_size, > + (IPAD_SIZE + OPAD_SIZE)); > + } else { > + memcpy(kwr->keys.edkey, kctx->rx.key, > + (kctx->tx_key_info_size - SALT_SIZE)); > + memcpy(kwr->u.rxhdr.rxsalt, kctx->rx.salt, SALT_SIZE); > + } > +} > + > +/* Tx key */ > +static void > +prepare_txkey_wr(struct tls_keyctx *kwr, struct tls_key_context *kctx) > +{ > + unsigned int ck_size = kctx->cipher_secret_size; > + unsigned int mk_size = kctx->mac_secret_size; > + > + kwr->u.txhdr.ctxlen = > + (kctx->tx_key_info_size >> 4); > + kwr->u.txhdr.dualck_to_txvalid = > + V_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT(1) | > + V_TLS_KEYCTX_TX_WR_SALT_PRESENT(1) | > + V_TLS_KEYCTX_TX_WR_TXCK_SIZE(get_cipher_key_size(ck_size)) | > + V_TLS_KEYCTX_TX_WR_TXMK_SIZE(get_mac_key_size(mk_size)) | > + V_TLS_KEYCTX_TX_WR_TXVALID(1); > + > + memcpy(kwr->keys.edkey, kctx->tx.key, HDR_KCTX_SIZE); > + if (kctx->state.enc_mode == CH_EVP_CIPH_GCM_MODE) { > + memcpy(kwr->u.txhdr.txsalt, kctx->tx.salt, SALT_SIZE); > + kwr->u.txhdr.dualck_to_txvalid &= > + ~(V_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT(1)); > + } > + kwr->u.txhdr.dualck_to_txvalid = > htons(kwr->u.txhdr.dualck_to_txvalid); +} > + > +/* TLS Key memory management */ > +int > +tls_init_kmap(struct adapter *sc, struct tom_data *td) > +{ > + > + td->key_map = vmem_create("T4TLS key map", sc->vres.key.start, > + sc->vres.key.size, 8, 0, M_FIRSTFIT | M_NOWAIT); > + if (td->key_map == NULL) > + return (ENOMEM); > + return (0); > +} > + > +void > +tls_free_kmap(struct tom_data *td) > +{ > + > + if (td->key_map != NULL) > + vmem_destroy(td->key_map); > +} > + > +static int > +get_new_keyid(struct toepcb *toep, struct tls_key_context *k_ctx) > +{ > + struct tom_data *td = toep->td; > + vmem_addr_t addr; > + > + if (vmem_alloc(td->key_map, TLS_KEY_CONTEXT_SZ, M_NOWAIT | > M_FIRSTFIT, > + &addr) != 0) > + return (-1); > + > + return (addr); > +} > + > +static void > +free_keyid(struct toepcb *toep, int keyid) > +{ > + struct tom_data *td = toep->td; > + > + vmem_free(td->key_map, keyid, TLS_KEY_CONTEXT_SZ); > +} > + > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > 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" Building a kernel fails on CURRENT revision 330908 with the follwoing error: [...] ===> gpio/gpioiic (all) --- all_subdir_cxgbe --- --- cm.o --- In file included from /usr/src/sys/dev/cxgbe/iw_cxgbe/cm.c:68: /usr/src/sys/dev/cxgbe/tom/t4_tom.h:327:28: error: use of undeclared identifier 'ULP_MODE_TLS' return (toep->ulp_mode == ULP_MODE_TLS); ^ /usr/src/sys/dev/cxgbe/tom/t4_tom.h:333:12: error: incomplete definition of type 'struct adapter' return (sc->tt.tls && sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS); ~~^ /usr/src/sys/dev/cxgbe/offload.h:139:8: note: forward declaration of 'struct adapter' struct adapter; Kind regards, oh From owner-svn-src-head@freebsd.org Wed Mar 14 06:36:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 035BDF59466; Wed, 14 Mar 2018 06:36:54 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51C476F62B; Wed, 14 Mar 2018 06:36:53 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M9K5G-1emhAq3lle-00CmKn; Wed, 14 Mar 2018 07:36:51 +0100 Date: Wed, 14 Mar 2018 07:36:49 +0100 From: "O. Hartmann" To: "O. Hartmann" Cc: John Baldwin , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r330884 - in head/sys: dev/cxgbe dev/cxgbe/firmware dev/cxgbe/tom modules/cxgbe/tom Message-ID: <20180314073649.654776b3@freyja.zeit4.iv.bundesimmobilien.de> In-Reply-To: <20180314062510.0e575da4@freyja.zeit4.iv.bundesimmobilien.de> References: <201803132305.w2DN5pnc010768@repo.freebsd.org> <20180314062510.0e575da4@freyja.zeit4.iv.bundesimmobilien.de> Organization: Walstatt MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:dvoAxol4Tgm4n2tEq2Ed6m8TXpecddPQOX7hVsV9RYpG1Tmu47n noEn1iz2Hchy2mBXBSsnSJtyjlHpJ0DWDX4I+X7QG38rQ1NcdJTvwZ6hri4aX9XWhwWcSSt sHwaAmjZzlvw7LJNQRRK0HS/exCa4MiHCgZEGV1q/w8KrfUQrxGzkFmsX8A9J3gpjTaD3gL rH/RwRnOW8fIjIW0hHs8A== X-UI-Out-Filterresults: notjunk:1;V01:K0:0pdMtaXHbRA=:+OIh65ORIhsCr3vS/Y4YNl LmV/S/6y6dgt4RV5R5vPHXHS/9y/KMeoXipmlYe/CkxZqGp6p5DOWXL8D6myxU5r/AsJVOOBM 0velQlFoGVHt7PjlwMyszHreTo2CMIRnkGZcPys+93rfzyy/QQcNbYl+tt7OvEwa09ouji9Xa CEG37v4/a6soF1Z9j9felblicAlvsSSYb8VXYbZG3kT+HdDSAuqqcVbrXu0GzxUTLoJsjMZTf 3tBgNTL5K4mPURV3jxHgRdkzQk2ZJdZILszE1WK4Y4+uEx4qMICbLeFd0WE49N4XxdTYpxvJA 3QfI4n4vFlJFdvhoSXDdDA40PNZKBbaUk46wLsM5la8W8AfJ0cqQzKH+YWh7BSq2Ehd4fLqbA Bx3Eq4N2qr2826OCAbzR+BfByxDSoLH+o9Rb8pGD6k8v0AZ+wL597+pziMR+oXt3dsq8cxLVB kmjwQI4fNubPO/mhgkkh4ViBrTWmhIoGBubAsvSYqydr8en4BneFxezyUjqt9g5C7ikLJaYN0 f3VjOB2Xbun6rYQFhinc86b7atNYLt/1yN2QoGSRK2RhWLLhbbztCJVZnays0AO+mUmVOLz4D 7S6wxZHqkpqIfk1VIYpasd8VrC93XR5JiykxgVHOABjpQvKcOtjR/T5Ozfq3blRfD6zMiN2Ui 2bf08OFKceEiXIntSi5B4R2UI5VfJRo6KaKuvpz3qXtuvhIrQixbwJ8XYkDfs6eY1iHf4643Y 6cfnyVF7NiT3ctV+xR0+7DfygjFoM6pZ9Q6NTxegjDFXKcBnm6Wzp0N78lcf9ElxccjRRf+ol FkBtHX/iyl7aU693g+BHalIIdPhVFbK+UBZRD1lTTGRlyKJVZM= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 06:36:54 -0000 On Wed, 14 Mar 2018 06:25:10 +0100 "O. Hartmann" wrote: > On Tue, 13 Mar 2018 23:05:51 +0000 (UTC) > John Baldwin wrote: > > > Author: jhb > > Date: Tue Mar 13 23:05:51 2018 > > New Revision: 330884 > > URL: https://svnweb.freebsd.org/changeset/base/330884 > > > > Log: > > Support for TLS offload of TOE connections on T6 adapters. > > > > The TOE engine in Chelsio T6 adapters supports offloading of TLS > > encryption and TCP segmentation for offloaded connections. Sockets > > using TLS are required to use a set of custom socket options to upload > > RX and TX keys to the NIC and to enable RX processing. Currently > > these socket options are implemented as TCP options in the vendor > > specific range. A patched OpenSSL library will be made available in a > > port / package for use with the TLS TOE support. > > > > TOE sockets can either offload both transmit and reception of TLS > > records or just transmit. TLS offload (both RX and TX) is enabled by > > setting the dev.t6nex..tls sysctl to 1 and requires TOE to be > > enabled on the relevant interface. Transmit offload can be used on > > any "normal" or TLS TOE socket by using the custom socket option to > > program a transmit key. This permits most TOE sockets to > > transparently offload TLS when applications use a patched SSL library > > (e.g. using LD_LIBRARY_PATH to request use of a patched OpenSSL > > library). Receive offload can only be used with TOE sockets using the > > TLS mode. The dev.t6nex.0.toe.tls_rx_ports sysctl can be set to a > > list of TCP port numbers. Any connection with either a local or > > remote port number in that list will be created as a TLS socket rather > > than a plain TOE socket. Note that although this sysctl accepts an > > arbitrary list of port numbers, the sysctl(8) tool is only able to set > > sysctl nodes to a single value. A TLS socket will hang without > > receiving data if used by an application that is not using a patched > > SSL library. Thus, the tls_rx_ports node should be used with care. > > For a server mostly concerned with offloading TLS transmit, this node > > is not needed as plain TOE sockets will fall back to software crypto > > when using an unpatched SSL library. > > > > New per-interface statistics nodes are added giving counts of TLS > > packets and payload bytes (payload bytes do not include TLS headers or > > authentication tags/MACs) offloaded via the TOE engine, e.g.: > > > > dev.cc.0.stats.rx_tls_octets: 149 > > dev.cc.0.stats.rx_tls_records: 13 > > dev.cc.0.stats.tx_tls_octets: 26501823 > > dev.cc.0.stats.tx_tls_records: 1620 > > > > TLS transmit work requests are constructed by a new variant of > > t4_push_frames() called t4_push_tls_records() in tom/t4_tls.c. > > > > TLS transmit work requests require a buffer containing IVs. If the > > IVs are too large to fit into the work request, a separate buffer is > > allocated when constructing a work request. This buffer is associated > > with the transmit descriptor and freed when the descriptor is ACKed by > > the adapter. > > > > Received TLS frames use two new CPL messages. The first message is a > > CPL_TLS_DATA containing the decryped payload of a single TLS record. > > The handler places the mbuf containing the received payload on an > > mbufq in the TOE pcb. The second message is a CPL_RX_TLS_CMP message > > which includes a copy of the TLS header and indicates if there were > > any errors. The handler for this message places the TLS header into > > the socket buffer followed by the saved mbuf with the payload data. > > Both of these handlers are contained in tom/t4_tls.c. > > > > A few routines were exposed from t4_cpl_io.c for use by t4_tls.c > > including send_rx_credits(), a new send_rx_modulate(), and > > t4_close_conn(). > > > > TLS keys for both transmit and receive are stored in onboard memory > > in the NIC in the "TLS keys" memory region. > > > > In some cases a TLS socket can hang with pending data available in the > > NIC that is not delivered to the host. As a workaround, TLS sockets > > are more aggressive about sending CPL_RX_DATA_ACK messages anytime that > > any data is read from a TLS socket. In addition, a fallback timer will > > periodically send CPL_RX_DATA_ACK messages to the NIC for connections > > that are still in the handshake phase. Once the connection has > > finished the handshake and programmed RX keys via the socket option, > > the timer is stopped. > > > > A new function select_ulp_mode() is used to determine what sub-mode a > > given TOE socket should use (plain TOE, DDP, or TLS). The existing > > set_tcpddp_ulp_mode() function has been renamed to set_ulp_mode() and > > handles initialization of TLS-specific state when necessary in > > addition to DDP-specific state. > > > > Since TLS sockets do not receive individual TCP segments but always > > receive full TLS records, they can receive more data than is available > > in the current window (e.g. if a 16k TLS record is received but the > > socket buffer is itself 16k). To cope with this, just drop the window > > to 0 when this happens, but track the overage and "eat" the overage as > > it is read from the socket buffer not opening the window (or adding > > rx_credits) for the overage bytes. > > > > Reviewed by: np (earlier version) > > Sponsored by: Chelsio Communications > > Differential Revision: https://reviews.freebsd.org/D14529 > > > > Added: > > head/sys/dev/cxgbe/tom/t4_tls.c (contents, props changed) > > head/sys/dev/cxgbe/tom/t4_tls.h (contents, props changed) > > Modified: > > head/sys/dev/cxgbe/adapter.h > > head/sys/dev/cxgbe/firmware/t6fw_cfg.txt > > head/sys/dev/cxgbe/offload.h > > head/sys/dev/cxgbe/t4_main.c > > head/sys/dev/cxgbe/tom/t4_connect.c > > head/sys/dev/cxgbe/tom/t4_cpl_io.c > > head/sys/dev/cxgbe/tom/t4_listen.c > > head/sys/dev/cxgbe/tom/t4_tom.c > > head/sys/dev/cxgbe/tom/t4_tom.h > > head/sys/modules/cxgbe/tom/Makefile > > > > Modified: head/sys/dev/cxgbe/adapter.h > > ============================================================================== > > --- head/sys/dev/cxgbe/adapter.h Tue Mar 13 22:54:29 2018 > > (r330883) +++ head/sys/dev/cxgbe/adapter.h Tue Mar 13 23:05:51 > > 2018 (r330884) @@ -297,6 +297,10 @@ struct port_info { > > struct port_stats stats; > > u_int tnl_cong_drops; > > u_int tx_parse_error; > > + u_long tx_tls_records; > > + u_long tx_tls_octets; > > + u_long rx_tls_records; > > + u_long rx_tls_octets; > > > > struct callout tick; > > }; > > > > Modified: head/sys/dev/cxgbe/firmware/t6fw_cfg.txt > > ============================================================================== > > --- head/sys/dev/cxgbe/firmware/t6fw_cfg.txt Tue Mar 13 22:54:29 > > 2018 (r330883) +++ head/sys/dev/cxgbe/firmware/t6fw_cfg.txt > > Tue Mar 13 23:05:51 2018 (r330884) @@ -163,10 +163,12 @@ > > nserver = 512 > > nhpfilter = 0 > > nhash = 16384 > > - protocol = ofld, rddp, rdmac, iscsi_initiator_pdu, > > iscsi_target_pdu, iscsi_t10dif, crypto_lookaside > > + protocol = ofld, rddp, rdmac, iscsi_initiator_pdu, > > iscsi_target_pdu, iscsi_t10dif, tlskeys, crypto_lookaside tp_l2t = 4096 > > tp_ddp = 2 > > tp_ddp_iscsi = 2 > > + tp_tls_key = 3 > > + tp_tls_mxrxsize = 17408 # 16384 + 1024, governs max rx data, pm > > max xfer len, rx coalesce sizes tp_stag = 2 > > tp_pbl = 5 > > tp_rq = 7 > > @@ -273,7 +275,7 @@ > > > > [fini] > > version = 0x1 > > - checksum = 0x7191019f > > + checksum = 0x9e8952d2 > > # > > # $FreeBSD$ > > # > > > > Modified: head/sys/dev/cxgbe/offload.h > > ============================================================================== > > --- head/sys/dev/cxgbe/offload.h Tue Mar 13 22:54:29 2018 > > (r330883) +++ head/sys/dev/cxgbe/offload.h Tue Mar 13 23:05:51 > > 2018 (r330884) @@ -151,6 +151,9 @@ struct tom_tunables { > > int sndbuf; > > int ddp; > > int rx_coalesce; > > + int tls; > > + int *tls_rx_ports; > > + int num_tls_rx_ports; > > int tx_align; > > int tx_zcopy; > > }; > > > > Modified: head/sys/dev/cxgbe/t4_main.c > > ============================================================================== > > --- head/sys/dev/cxgbe/t4_main.c Tue Mar 13 22:54:29 2018 > > (r330883) +++ head/sys/dev/cxgbe/t4_main.c Tue Mar 13 23:05:51 > > 2018 (r330884) @@ -591,6 +591,7 @@ static int > > sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); static int > > sysctl_tc_params(SYSCTL_HANDLER_ARGS); #endif > > #ifdef TCP_OFFLOAD > > +static int sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS); > > static int sysctl_tp_tick(SYSCTL_HANDLER_ARGS); > > static int sysctl_tp_dack_timer(SYSCTL_HANDLER_ARGS); > > static int sysctl_tp_timer(SYSCTL_HANDLER_ARGS); > > @@ -1390,6 +1391,7 @@ t4_detach_common(device_t dev) > > free(sc->sge.iqmap, M_CXGBE); > > free(sc->sge.eqmap, M_CXGBE); > > free(sc->tids.ftid_tab, M_CXGBE); > > + free(sc->tt.tls_rx_ports, M_CXGBE); > > t4_destroy_dma_tag(sc); > > if (mtx_initialized(&sc->sc_lock)) { > > sx_xlock(&t4_list_lock); > > @@ -5433,6 +5435,14 @@ t4_sysctls(struct adapter *sc) > > SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_coalesce", > > CTLFLAG_RW, &sc->tt.rx_coalesce, 0, "receive > > coalescing"); > > + sc->tt.tls = 0; > > + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tls", CTLFLAG_RW, > > + &sc->tt.tls, 0, "Inline TLS allowed"); > > + > > + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tls_rx_ports", > > + CTLTYPE_INT | CTLFLAG_RW, sc, 0, sysctl_tls_rx_ports, > > + "I", "TCP ports that use inline TLS+TOE RX"); > > + > > sc->tt.tx_align = 1; > > SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_align", > > CTLFLAG_RW, &sc->tt.tx_align, 0, "chop and align > > payload"); @@ -5836,6 +5846,19 @@ cxgbe_sysctls(struct port_info *pi) > > "# of buffer-group 3 truncated packets"); > > > > #undef SYSCTL_ADD_T4_PORTSTAT > > + > > + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "tx_tls_records", > > + CTLFLAG_RD, &pi->tx_tls_records, > > + "# of TLS records transmitted"); > > + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "tx_tls_octets", > > + CTLFLAG_RD, &pi->tx_tls_octets, > > + "# of payload octets in transmitted TLS records"); > > + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_tls_records", > > + CTLFLAG_RD, &pi->rx_tls_records, > > + "# of TLS records received"); > > + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_tls_octets", > > + CTLFLAG_RD, &pi->rx_tls_octets, > > + "# of payload octets in received TLS records"); > > } > > > > static int > > @@ -8257,6 +8280,68 @@ done: > > #endif > > > > #ifdef TCP_OFFLOAD > > +static int > > +sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS) > > +{ > > + struct adapter *sc = arg1; > > + int *old_ports, *new_ports; > > + int i, new_count, rc; > > + > > + if (req->newptr == NULL && req->oldptr == NULL) > > + return (SYSCTL_OUT(req, NULL, imax(sc->tt.num_tls_rx_ports, > > 1) * > > + sizeof(sc->tt.tls_rx_ports[0]))); > > + > > + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, > > "t4tlsrx"); > > + if (rc) > > + return (rc); > > + > > + if (sc->tt.num_tls_rx_ports == 0) { > > + i = -1; > > + rc = SYSCTL_OUT(req, &i, sizeof(i)); > > + } else > > + rc = SYSCTL_OUT(req, sc->tt.tls_rx_ports, > > + sc->tt.num_tls_rx_ports * > > sizeof(sc->tt.tls_rx_ports[0])); > > + if (rc == 0 && req->newptr != NULL) { > > + new_count = req->newlen / sizeof(new_ports[0]); > > + new_ports = malloc(new_count * sizeof(new_ports[0]), > > M_CXGBE, > > + M_WAITOK); > > + rc = SYSCTL_IN(req, new_ports, new_count * > > + sizeof(new_ports[0])); > > + if (rc) > > + goto err; > > + > > + /* Allow setting to a single '-1' to clear the list. */ > > + if (new_count == 1 && new_ports[0] == -1) { > > + ADAPTER_LOCK(sc); > > + old_ports = sc->tt.tls_rx_ports; > > + sc->tt.tls_rx_ports = NULL; > > + sc->tt.num_tls_rx_ports = 0; > > + ADAPTER_UNLOCK(sc); > > + free(old_ports, M_CXGBE); > > + } else { > > + for (i = 0; i < new_count; i++) { > > + if (new_ports[i] < 1 || > > + new_ports[i] > IPPORT_MAX) { > > + rc = EINVAL; > > + goto err; > > + } > > + } > > + > > + ADAPTER_LOCK(sc); > > + old_ports = sc->tt.tls_rx_ports; > > + sc->tt.tls_rx_ports = new_ports; > > + sc->tt.num_tls_rx_ports = new_count; > > + ADAPTER_UNLOCK(sc); > > + free(old_ports, M_CXGBE); > > + new_ports = NULL; > > + } > > + err: > > + free(new_ports, M_CXGBE); > > + } > > + end_synchronized_op(sc, 0); > > + return (rc); > > +} > > + > > static void > > unit_conv(char *buf, size_t len, u_int val, u_int factor) > > { > > > > Modified: head/sys/dev/cxgbe/tom/t4_connect.c > > ============================================================================== > > --- head/sys/dev/cxgbe/tom/t4_connect.c Tue Mar 13 22:54:29 > > 2018 (r330883) +++ head/sys/dev/cxgbe/tom/t4_connect.c Tue Mar > > 13 23:05:51 2018 (r330884) @@ -142,6 +142,10 @@ > > do_act_establish(struct sge_iq *iq, const struct rss_h } > > > > make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); > > + > > + if (toep->ulp_mode == ULP_MODE_TLS) > > + tls_establish(toep); > > + > > done: > > INP_WUNLOCK(inp); > > CURVNET_RESTORE(); > > @@ -268,6 +272,11 @@ calc_opt2a(struct socket *so, struct toepcb *toep) > > if (toep->ulp_mode == ULP_MODE_TCPDDP) > > opt2 |= F_RX_FC_VALID | F_RX_FC_DDP; > > #endif > > + if (toep->ulp_mode == ULP_MODE_TLS) { > > + opt2 |= F_RX_FC_VALID; > > + opt2 &= ~V_RX_COALESCE(M_RX_COALESCE); > > + opt2 |= F_RX_FC_DISABLE; > > + } > > > > return (htobe32(opt2)); > > } > > @@ -378,10 +387,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru > > DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); > > > > toep->vnet = so->so_vnet; > > - if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) > > - set_tcpddp_ulp_mode(toep); > > - else > > - toep->ulp_mode = ULP_MODE_NONE; > > + set_ulp_mode(toep, select_ulp_mode(so, sc)); > > SOCKBUF_LOCK(&so->so_rcv); > > /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ > > toep->rx_credits = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); > > > > Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c > > ============================================================================== > > --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Mar 13 22:54:29 2018 > > (r330883) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Mar 13 23:05:51 > > 2018 (r330884) @@ -73,9 +73,6 @@ __FBSDID("$FreeBSD$"); > > #include "tom/t4_tom_l2t.h" > > #include "tom/t4_tom.h" > > > > -#define > > IS_AIOTX_MBUF(m) \ > > - ((m)->m_flags & M_EXT && (m)->m_ext.ext_flags & EXT_FLAG_AIOTX) > > - > > static void t4_aiotx_cancel(struct kaiocb *job); > > static void t4_aiotx_queue_toep(struct toepcb *toep); > > > > @@ -106,7 +103,7 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par > > { > > struct wrqe *wr; > > struct fw_flowc_wr *flowc; > > - unsigned int nparams = ftxp ? 8 : 6, flowclen; > > + unsigned int nparams, flowclen, paramidx; > > struct vi_info *vi = toep->vi; > > struct port_info *pi = vi->pi; > > struct adapter *sc = pi->adapter; > > @@ -116,6 +113,15 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par > > KASSERT(!(toep->flags & TPF_FLOWC_WR_SENT), > > ("%s: flowc for tid %u sent already", __func__, toep->tid)); > > > > + if (ftxp != NULL) > > + nparams = 8; > > + else > > + nparams = 6; > > + if (toep->ulp_mode == ULP_MODE_TLS) > > + nparams++; > > + if (toep->tls.fcplenmax != 0) > > + nparams++; > > + > > flowclen = sizeof(*flowc) + nparams * sizeof(struct > > fw_flowc_mnemval); > > wr = alloc_wrqe(roundup2(flowclen, 16), toep->ofld_txq); > > @@ -131,39 +137,45 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par > > flowc->flowid_len16 = htonl(V_FW_WR_LEN16(howmany(flowclen, 16)) | > > V_FW_WR_FLOWID(toep->tid)); > > > > - flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN; > > - flowc->mnemval[0].val = htobe32(pfvf); > > - flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; > > - flowc->mnemval[1].val = htobe32(pi->tx_chan); > > - flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT; > > - flowc->mnemval[2].val = htobe32(pi->tx_chan); > > - flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; > > - flowc->mnemval[3].val = htobe32(toep->ofld_rxq->iq.abs_id); > > +#define FLOWC_PARAM(__m, __v) \ > > + do { \ > > + flowc->mnemval[paramidx].mnemonic = FW_FLOWC_MNEM_##__m; \ > > + flowc->mnemval[paramidx].val = htobe32(__v); \ > > + paramidx++; \ > > + } while (0) > > + > > + paramidx = 0; > > + > > + FLOWC_PARAM(PFNVFN, pfvf); > > + FLOWC_PARAM(CH, pi->tx_chan); > > + FLOWC_PARAM(PORT, pi->tx_chan); > > + FLOWC_PARAM(IQID, toep->ofld_rxq->iq.abs_id); > > if (ftxp) { > > uint32_t sndbuf = min(ftxp->snd_space, sc->tt.sndbuf); > > > > - flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDNXT; > > - flowc->mnemval[4].val = htobe32(ftxp->snd_nxt); > > - flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_RCVNXT; > > - flowc->mnemval[5].val = htobe32(ftxp->rcv_nxt); > > - flowc->mnemval[6].mnemonic = FW_FLOWC_MNEM_SNDBUF; > > - flowc->mnemval[6].val = htobe32(sndbuf); > > - flowc->mnemval[7].mnemonic = FW_FLOWC_MNEM_MSS; > > - flowc->mnemval[7].val = htobe32(ftxp->mss); > > + FLOWC_PARAM(SNDNXT, ftxp->snd_nxt); > > + FLOWC_PARAM(RCVNXT, ftxp->rcv_nxt); > > + FLOWC_PARAM(SNDBUF, sndbuf); > > + FLOWC_PARAM(MSS, ftxp->mss); > > > > CTR6(KTR_CXGBE, > > "%s: tid %u, mss %u, sndbuf %u, snd_nxt 0x%x, rcv_nxt > > 0x%x", __func__, toep->tid, ftxp->mss, sndbuf, ftxp->snd_nxt, > > ftxp->rcv_nxt); > > } else { > > - flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDBUF; > > - flowc->mnemval[4].val = htobe32(512); > > - flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_MSS; > > - flowc->mnemval[5].val = htobe32(512); > > + FLOWC_PARAM(SNDBUF, 512); > > + FLOWC_PARAM(MSS, 512); > > > > CTR2(KTR_CXGBE, "%s: tid %u", __func__, toep->tid); > > } > > + if (toep->ulp_mode == ULP_MODE_TLS) > > + FLOWC_PARAM(ULP_MODE, toep->ulp_mode); > > + if (toep->tls.fcplenmax != 0) > > + FLOWC_PARAM(TXDATAPLEN_MAX, toep->tls.fcplenmax); > > +#undef FLOWC_PARAM > > > > + KASSERT(paramidx == nparams, ("nparams mismatch")); > > + > > txsd->tx_credits = howmany(flowclen, 16); > > txsd->plen = 0; > > KASSERT(toep->tx_credits >= txsd->tx_credits && toep->txsd_avail > > > 0, @@ -421,7 +433,7 @@ make_established(struct toepcb *toep, uint32_t > > snd_isn soisconnected(so); > > } > > > > -static int > > +int > > send_rx_credits(struct adapter *sc, struct toepcb *toep, int credits) > > { > > struct wrqe *wr; > > @@ -443,6 +455,23 @@ send_rx_credits(struct adapter *sc, struct toepcb *toe > > } > > > > void > > +send_rx_modulate(struct adapter *sc, struct toepcb *toep) > > +{ > > + struct wrqe *wr; > > + struct cpl_rx_data_ack *req; > > + > > + wr = alloc_wrqe(sizeof(*req), toep->ctrlq); > > + if (wr == NULL) > > + return; > > + req = wrtod(wr); > > + > > + INIT_TP_WR_MIT_CPL(req, CPL_RX_DATA_ACK, toep->tid); > > + req->credit_dack = htobe32(F_RX_MODULATE_RX); > > + > > + t4_wrq_tx(sc, wr); > > +} > > + > > +void > > t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) > > { > > struct adapter *sc = tod->tod_softc; > > @@ -459,8 +488,18 @@ t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) > > ("%s: sb %p has more data (%d) than last time (%d).", > > __func__, sb, sbused(sb), toep->sb_cc)); > > > > - toep->rx_credits += toep->sb_cc - sbused(sb); > > + credits = toep->sb_cc - sbused(sb); > > toep->sb_cc = sbused(sb); > > + if (toep->ulp_mode == ULP_MODE_TLS) { > > + if (toep->tls.rcv_over >= credits) { > > + toep->tls.rcv_over -= credits; > > + credits = 0; > > + } else { > > + credits -= toep->tls.rcv_over; > > + toep->tls.rcv_over = 0; > > + } > > + } > > + toep->rx_credits += credits; > > > > if (toep->rx_credits > 0 && > > (tp->rcv_wnd <= 32 * 1024 || toep->rx_credits >= 64 * 1024 || > > @@ -471,7 +510,8 @@ t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) > > toep->rx_credits -= credits; > > tp->rcv_wnd += credits; > > tp->rcv_adv += credits; > > - } > > + } else if (toep->flags & TPF_FORCE_CREDITS) > > + send_rx_modulate(sc, toep); > > } > > > > void > > @@ -489,8 +529,8 @@ t4_rcvd(struct toedev *tod, struct tcpcb *tp) > > /* > > * Close a connection by sending a CPL_CLOSE_CON_REQ message. > > */ > > -static int > > -close_conn(struct adapter *sc, struct toepcb *toep) > > +int > > +t4_close_conn(struct adapter *sc, struct toepcb *toep) > > { > > struct wrqe *wr; > > struct cpl_close_con_req *req; > > @@ -691,6 +731,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep > > > > KASSERT(toep->ulp_mode == ULP_MODE_NONE || > > toep->ulp_mode == ULP_MODE_TCPDDP || > > + toep->ulp_mode == ULP_MODE_TLS || > > toep->ulp_mode == ULP_MODE_RDMA, > > ("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, > > toep)); > > @@ -905,7 +946,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep > > > > /* Send a FIN if requested, but only if there's no more data to > > send */ if (m == NULL && toep->flags & TPF_SEND_FIN) > > - close_conn(sc, toep); > > + t4_close_conn(sc, toep); > > } > > > > static inline void > > @@ -1097,7 +1138,7 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, > > > > /* Send a FIN if requested, but only if there are no more PDUs to > > send */ if (mbufq_first(pduq) == NULL && toep->flags & TPF_SEND_FIN) > > - close_conn(sc, toep); > > + t4_close_conn(sc, toep); > > } > > > > int > > @@ -1116,6 +1157,8 @@ t4_tod_output(struct toedev *tod, struct tcpcb *tp) > > > > if (toep->ulp_mode == ULP_MODE_ISCSI) > > t4_push_pdus(sc, toep, 0); > > + else if (tls_tx_key(toep)) > > + t4_push_tls_records(sc, toep, 0); > > else > > t4_push_frames(sc, toep, 0); > > > > @@ -1140,6 +1183,8 @@ t4_send_fin(struct toedev *tod, struct tcpcb *tp) > > if (tp->t_state >= TCPS_ESTABLISHED) { > > if (toep->ulp_mode == ULP_MODE_ISCSI) > > t4_push_pdus(sc, toep, 0); > > + else if (tls_tx_key(toep)) > > + t4_push_tls_records(sc, toep, 0); > > else > > t4_push_frames(sc, toep, 0); > > } > > @@ -1772,6 +1817,10 @@ do_fw4_ack(struct sge_iq *iq, const struct > > rss_header credits -= txsd->tx_credits; > > toep->tx_credits += txsd->tx_credits; > > plen += txsd->plen; > > + if (txsd->iv_buffer) { > > + free(txsd->iv_buffer, M_CXGBE); > > + txsd->iv_buffer = NULL; > > + } > > txsd++; > > toep->txsd_avail++; > > KASSERT(toep->txsd_avail <= toep->txsd_total, > > @@ -1797,6 +1846,8 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header > > CURVNET_SET(toep->vnet); > > if (toep->ulp_mode == ULP_MODE_ISCSI) > > t4_push_pdus(sc, toep, plen); > > + else if (tls_tx_key(toep)) > > + t4_push_tls_records(sc, toep, plen); > > else > > t4_push_frames(sc, toep, plen); > > CURVNET_RESTORE(); > > @@ -1826,6 +1877,12 @@ do_fw4_ack(struct sge_iq *iq, const struct > > rss_header tid, plen); > > #endif > > sbdrop_locked(sb, plen); > > + if (tls_tx_key(toep)) { > > + struct tls_ofld_info *tls_ofld = > > &toep->tls; + > > + MPASS(tls_ofld->sb_off >= plen); > > + tls_ofld->sb_off -= plen; > > + } > > if (!TAILQ_EMPTY(&toep->aiotx_jobq)) > > t4_aiotx_queue_toep(toep); > > sowwakeup_locked(so); /* unlocks so_snd */ > > @@ -2298,6 +2355,9 @@ t4_aio_queue_aiotx(struct socket *so, struct kaiocb *j > > return (EOPNOTSUPP); > > > > if (!sc->tt.tx_zcopy) > > + return (EOPNOTSUPP); > > + > > + if (is_tls_offload(toep) || tls_tx_key(toep)) > > return (EOPNOTSUPP); > > > > SOCKBUF_LOCK(&so->so_snd); > > > > Modified: head/sys/dev/cxgbe/tom/t4_listen.c > > ============================================================================== > > --- head/sys/dev/cxgbe/tom/t4_listen.c Tue Mar 13 22:54:29 2018 > > (r330883) +++ head/sys/dev/cxgbe/tom/t4_listen.c Tue Mar 13 23:05:51 > > 2018 (r330884) @@ -1056,6 +1056,11 @@ calc_opt2p(struct adapter *sc, > > struct port_info *pi, i if (ulp_mode == ULP_MODE_TCPDDP) > > opt2 |= F_RX_FC_VALID | F_RX_FC_DDP; > > #endif > > + if (ulp_mode == ULP_MODE_TLS) { > > + opt2 |= F_RX_FC_VALID; > > + opt2 &= ~V_RX_COALESCE(M_RX_COALESCE); > > + opt2 |= F_RX_FC_DISABLE; > > + } > > > > return htobe32(opt2); > > } > > @@ -1347,11 +1352,15 @@ found: > > > > INIT_TP_WR_MIT_CPL(rpl5, CPL_PASS_ACCEPT_RPL, tid); > > } > > - if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) { > > - ulp_mode = ULP_MODE_TCPDDP; > > + ulp_mode = select_ulp_mode(so, sc); > > + switch (ulp_mode) { > > + case ULP_MODE_TCPDDP: > > synqe->flags |= TPF_SYNQE_TCPDDP; > > - } else > > - ulp_mode = ULP_MODE_NONE; > > + break; > > + case ULP_MODE_TLS: > > + synqe->flags |= TPF_SYNQE_TLS; > > + break; > > + } > > rpl->opt0 = calc_opt0(so, vi, e, mtu_idx, rscale, rx_credits, > > ulp_mode); rpl->opt2 = calc_opt2p(sc, pi, rxqid, &cpl->tcpopt, &th, > > ulp_mode); > > @@ -1407,8 +1416,8 @@ found: > > REJECT_PASS_ACCEPT(); > > } > > > > - CTR5(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p, synqe %p, SYNACK", > > - __func__, stid, tid, lctx, synqe); > > + CTR6(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p, synqe %p, SYNACK > > mode %d", > > + __func__, stid, tid, lctx, synqe, ulp_mode); > > > > INP_WLOCK(inp); > > synqe->flags |= TPF_SYNQE_HAS_L2TE; > > @@ -1557,9 +1566,11 @@ reset: > > toep->tid = tid; > > toep->l2te = &sc->l2t->l2tab[synqe->l2e_idx]; > > if (synqe->flags & TPF_SYNQE_TCPDDP) > > - set_tcpddp_ulp_mode(toep); > > + set_ulp_mode(toep, ULP_MODE_TCPDDP); > > + else if (synqe->flags & TPF_SYNQE_TLS) > > + set_ulp_mode(toep, ULP_MODE_TLS); > > else > > - toep->ulp_mode = ULP_MODE_NONE; > > + set_ulp_mode(toep, ULP_MODE_NONE); > > /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ > > toep->rx_credits = synqe->rcv_bufsize; > > > > > > Added: head/sys/dev/cxgbe/tom/t4_tls.c > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly > > added) +++ head/sys/dev/cxgbe/tom/t4_tls.c Tue Mar 13 23:05:51 2018 > > (r330884) @@ -0,0 +1,1642 @@ > > +/*- > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > + * > > + * Copyright (c) 2017-2018 Chelsio Communications, Inc. > > + * All rights reserved. > > + * Written by: John Baldwin > > + * > > + * 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 "opt_inet.h" > > + > > +#include > > +__FBSDID("$FreeBSD$"); > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#ifdef TCP_OFFLOAD > > +#include "common/common.h" > > +#include "common/t4_tcb.h" > > +#include "tom/t4_tom_l2t.h" > > +#include "tom/t4_tom.h" > > + > > +/* > > + * The TCP sequence number of a CPL_TLS_DATA mbuf is saved here while > > + * the mbuf is in the ulp_pdu_reclaimq. > > + */ > > +#define tls_tcp_seq PH_loc.thirtytwo[0] > > + > > +/* > > + * Handshake lock used for the handshake timer. Having a global lock > > + * is perhaps not ideal, but it avoids having to use callout_drain() > > + * in tls_uninit_toep() which can't block. Also, the timer shouldn't > > + * actually fire for most connections. > > + */ > > +static struct mtx tls_handshake_lock; > > + > > +static void > > +t4_set_tls_tcb_field(struct toepcb *toep, uint16_t word, uint64_t mask, > > + uint64_t val) > > +{ > > + struct adapter *sc = td_adapter(toep->td); > > + > > + t4_set_tcb_field(sc, toep->ctrlq, toep->tid, word, mask, val, 0, 0, > > + toep->ofld_rxq->iq.abs_id); > > +} > > + > > +/* TLS and DTLS common routines */ > > +int > > +tls_tx_key(struct toepcb *toep) > > +{ > > + struct tls_ofld_info *tls_ofld = &toep->tls; > > + > > + return (tls_ofld->tx_key_addr >= 0); > > +} > > + > > +int > > +tls_rx_key(struct toepcb *toep) > > +{ > > + struct tls_ofld_info *tls_ofld = &toep->tls; > > + > > + return (tls_ofld->rx_key_addr >= 0); > > +} > > + > > +static int > > +key_size(struct toepcb *toep) > > +{ > > + struct tls_ofld_info *tls_ofld = &toep->tls; > > + > > + return ((tls_ofld->key_location == > > TLS_SFO_WR_CONTEXTLOC_IMMEDIATE) ? > > + tls_ofld->k_ctx.tx_key_info_size : KEY_IN_DDR_SIZE); > > +} > > + > > +/* Set TLS Key-Id in TCB */ > > +static void > > +t4_set_tls_keyid(struct toepcb *toep, unsigned int key_id) > > +{ > > + > > + t4_set_tls_tcb_field(toep, W_TCB_RX_TLS_KEY_TAG, > > + V_TCB_RX_TLS_KEY_TAG(M_TCB_RX_TLS_BUF_TAG), > > + V_TCB_RX_TLS_KEY_TAG(key_id)); > > +} > > + > > +/* Clear TF_RX_QUIESCE to re-enable receive. */ > > +static void > > +t4_clear_rx_quiesce(struct toepcb *toep) > > +{ > > + > > + t4_set_tls_tcb_field(toep, W_TCB_T_FLAGS, V_TF_RX_QUIESCE(1), 0); > > +} > > + > > +static void > > +tls_clr_ofld_mode(struct toepcb *toep) > > +{ > > + > > + tls_stop_handshake_timer(toep); > > + > > + /* Operate in PDU extraction mode only. */ > > + t4_set_tls_tcb_field(toep, W_TCB_ULP_RAW, > > + V_TCB_ULP_RAW(M_TCB_ULP_RAW), > > + V_TCB_ULP_RAW(V_TF_TLS_ENABLE(1))); > > + t4_clear_rx_quiesce(toep); > > +} > > + > > +static void > > +tls_clr_quiesce(struct toepcb *toep) > > +{ > > + > > + tls_stop_handshake_timer(toep); > > + t4_clear_rx_quiesce(toep); > > +} > > + > > +/* > > + * Calculate the TLS data expansion size > > + */ > > +static int > > +tls_expansion_size(struct toepcb *toep, int data_len, int full_pdus_only, > > + unsigned short *pdus_per_ulp) > > +{ > > + struct tls_ofld_info *tls_ofld = &toep->tls; > > + struct tls_scmd *scmd = &tls_ofld->scmd0; > > + int expn_size = 0, frag_count = 0, pad_per_pdu = 0, > > + pad_last_pdu = 0, last_frag_size = 0, max_frag_size = 0; > > + int exp_per_pdu = 0; > > + int hdr_len = TLS_HEADER_LENGTH; > > + > > + do { > > + max_frag_size = tls_ofld->k_ctx.frag_size; > > + if (G_SCMD_CIPH_MODE(scmd->seqno_numivs) == > > + SCMD_CIPH_MODE_AES_GCM) { > > + frag_count = (data_len / max_frag_size); > > + exp_per_pdu = GCM_TAG_SIZE + > > AEAD_EXPLICIT_DATA_SIZE + > > + hdr_len; > > + expn_size = frag_count * exp_per_pdu; > > + if (full_pdus_only) { > > + *pdus_per_ulp = data_len / (exp_per_pdu + > > + max_frag_size); > > + if (*pdus_per_ulp > 32) > > + *pdus_per_ulp = 32; > > + else if(!*pdus_per_ulp) > > + *pdus_per_ulp = 1; > > + expn_size = (*pdus_per_ulp) * exp_per_pdu; > > + break; > > + } > > + if ((last_frag_size = data_len % max_frag_size) > > > 0) { > > + frag_count += 1; > > + expn_size += exp_per_pdu; > > + } > > + break; > > + } else if (G_SCMD_CIPH_MODE(scmd->seqno_numivs) != > > + SCMD_CIPH_MODE_NOP) { > > + /* Calculate the number of fragments we can make */ > > + frag_count = (data_len / max_frag_size); > > + if (frag_count > 0) { > > + pad_per_pdu = (((howmany((max_frag_size + > > + > > tls_ofld->mac_length), > > + CIPHER_BLOCK_SIZE)) * > > + CIPHER_BLOCK_SIZE) - > > + (max_frag_size + > > + tls_ofld->mac_length)); > > + if (!pad_per_pdu) > > + pad_per_pdu = CIPHER_BLOCK_SIZE; > > + exp_per_pdu = pad_per_pdu + > > + tls_ofld->mac_length + > > + hdr_len + CIPHER_BLOCK_SIZE; > > + expn_size = frag_count * exp_per_pdu; > > + } > > + if (full_pdus_only) { > > + *pdus_per_ulp = data_len / (exp_per_pdu + > > + max_frag_size); > > + if (*pdus_per_ulp > 32) > > + *pdus_per_ulp = 32; > > + else if (!*pdus_per_ulp) > > + *pdus_per_ulp = 1; > > + expn_size = (*pdus_per_ulp) * exp_per_pdu; > > + break; > > + } > > + /* Consider the last fragment */ > > + if ((last_frag_size = data_len % max_frag_size) > > > 0) { > > + pad_last_pdu = (((howmany((last_frag_size + > > + > > tls_ofld->mac_length), > > + CIPHER_BLOCK_SIZE)) > > * > > + CIPHER_BLOCK_SIZE) - > > + (last_frag_size + > > + tls_ofld->mac_length)); > > + if (!pad_last_pdu) > > + pad_last_pdu = CIPHER_BLOCK_SIZE; > > + expn_size += (pad_last_pdu + > > + tls_ofld->mac_length + > > hdr_len + > > + CIPHER_BLOCK_SIZE); > > + } > > + } > > + } while (0); > > + > > + return (expn_size); > > +} > > + > > +/* Copy Key to WR */ > > +static void > > +tls_copy_tx_key(struct toepcb *toep, void *dst) > > +{ > > + struct tls_ofld_info *tls_ofld = &toep->tls; > > + struct ulptx_sc_memrd *sc_memrd; > > + struct ulptx_idata *sc; > > + > > + if (tls_ofld->k_ctx.tx_key_info_size <= 0) > > + return; > > + > > + if (tls_ofld->key_location == TLS_SFO_WR_CONTEXTLOC_DDR) { > > + sc = dst; > > + sc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_NOOP)); > > + sc->len = htobe32(0); > > + sc_memrd = (struct ulptx_sc_memrd *)(sc + 1); > > + sc_memrd->cmd_to_len = > > htobe32(V_ULPTX_CMD(ULP_TX_SC_MEMRD) | > > + V_ULP_TX_SC_MORE(1) | > > + V_ULPTX_LEN16(tls_ofld->k_ctx.tx_key_info_size >> 4)); > > + sc_memrd->addr = htobe32(tls_ofld->tx_key_addr >> 5); > > + } else if (tls_ofld->key_location == > > TLS_SFO_WR_CONTEXTLOC_IMMEDIATE) { > > + memcpy(dst, &tls_ofld->k_ctx.tx, > > + tls_ofld->k_ctx.tx_key_info_size); > > + } > > +} > > + > > +/* TLS/DTLS content type for CPL SFO */ > > +static inline unsigned char > > +tls_content_type(unsigned char content_type) > > +{ > > + /* > > + * XXX: Shouldn't this map CONTENT_TYPE_APP_DATA to DATA and > > + * default to "CUSTOM" for all other types including > > + * heartbeat? > > + */ > > + switch (content_type) { > > + case CONTENT_TYPE_CCS: > > + return CPL_TX_TLS_SFO_TYPE_CCS; > > + case CONTENT_TYPE_ALERT: > > + return CPL_TX_TLS_SFO_TYPE_ALERT; > > + case CONTENT_TYPE_HANDSHAKE: > > + return CPL_TX_TLS_SFO_TYPE_HANDSHAKE; > > + case CONTENT_TYPE_HEARTBEAT: > > + return CPL_TX_TLS_SFO_TYPE_HEARTBEAT; > > + } > > + return CPL_TX_TLS_SFO_TYPE_DATA; > > +} > > + > > +static unsigned char > > +get_cipher_key_size(unsigned int ck_size) > > +{ > > + switch (ck_size) { > > + case AES_NOP: /* NOP */ > > + return 15; > > + case AES_128: /* AES128 */ > > + return CH_CK_SIZE_128; > > + case AES_192: /* AES192 */ > > + return CH_CK_SIZE_192; > > + case AES_256: /* AES256 */ > > + return CH_CK_SIZE_256; > > + default: > > + return CH_CK_SIZE_256; > > + } > > +} > > + > > +static unsigned char > > +get_mac_key_size(unsigned int mk_size) > > +{ > > + switch (mk_size) { > > + case SHA_NOP: /* NOP */ > > + return CH_MK_SIZE_128; > > + case SHA_GHASH: /* GHASH */ > > + case SHA_512: /* SHA512 */ > > + return CH_MK_SIZE_512; > > + case SHA_224: /* SHA2-224 */ > > + return CH_MK_SIZE_192; > > + case SHA_256: /* SHA2-256*/ > > + return CH_MK_SIZE_256; > > + case SHA_384: /* SHA384 */ > > + return CH_MK_SIZE_512; > > + case SHA1: /* SHA1 */ > > + default: > > + return CH_MK_SIZE_160; > > + } > > +} > > + > > +static unsigned int > > +get_proto_ver(int proto_ver) > > +{ > > + switch (proto_ver) { > > + case TLS1_2_VERSION: > > + return TLS_1_2_VERSION; > > + case TLS1_1_VERSION: > > + return TLS_1_1_VERSION; > > + case DTLS1_2_VERSION: > > + return DTLS_1_2_VERSION; > > + default: > > + return TLS_VERSION_MAX; > > + } > > +} > > + > > +static void > > +tls_rxkey_flit1(struct tls_keyctx *kwr, struct tls_key_context *kctx) > > +{ > > + > > + if (kctx->state.enc_mode == CH_EVP_CIPH_GCM_MODE) { > > + kwr->u.rxhdr.ivinsert_to_authinsrt = > > + htobe64(V_TLS_KEYCTX_TX_WR_IVINSERT(6ULL) | > > + V_TLS_KEYCTX_TX_WR_AADSTRTOFST(1ULL) | > > + V_TLS_KEYCTX_TX_WR_AADSTOPOFST(5ULL) | > > + V_TLS_KEYCTX_TX_WR_AUTHSRTOFST(14ULL) | > > + V_TLS_KEYCTX_TX_WR_AUTHSTOPOFST(16ULL) | > > + V_TLS_KEYCTX_TX_WR_CIPHERSRTOFST(14ULL) | > > + V_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST(0ULL) | > > + V_TLS_KEYCTX_TX_WR_AUTHINSRT(16ULL)); > > + kwr->u.rxhdr.ivpresent_to_rxmk_size &= > > + ~(V_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT(1)); > > + kwr->u.rxhdr.authmode_to_rxvalid &= > > + ~(V_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL(1)); > > + } else { > > + kwr->u.rxhdr.ivinsert_to_authinsrt = > > + htobe64(V_TLS_KEYCTX_TX_WR_IVINSERT(6ULL) | > > + V_TLS_KEYCTX_TX_WR_AADSTRTOFST(1ULL) | > > + V_TLS_KEYCTX_TX_WR_AADSTOPOFST(5ULL) | > > + V_TLS_KEYCTX_TX_WR_AUTHSRTOFST(22ULL) | > > + V_TLS_KEYCTX_TX_WR_AUTHSTOPOFST(0ULL) | > > + V_TLS_KEYCTX_TX_WR_CIPHERSRTOFST(22ULL) | > > + V_TLS_KEYCTX_TX_WR_CIPHERSTOPOFST(0ULL) | > > + V_TLS_KEYCTX_TX_WR_AUTHINSRT(0ULL)); > > + } > > +} > > + > > +/* Rx key */ > > +static void > > +prepare_rxkey_wr(struct tls_keyctx *kwr, struct tls_key_context *kctx) > > +{ > > + unsigned int ck_size = kctx->cipher_secret_size; > > + unsigned int mk_size = kctx->mac_secret_size; > > + int proto_ver = kctx->proto_ver; > > + > > + kwr->u.rxhdr.flitcnt_hmacctrl = > > + ((kctx->tx_key_info_size >> 4) << 3) | kctx->hmac_ctrl; > > + > > + kwr->u.rxhdr.protover_ciphmode = > > + V_TLS_KEYCTX_TX_WR_PROTOVER(get_proto_ver(proto_ver)) | > > + V_TLS_KEYCTX_TX_WR_CIPHMODE(kctx->state.enc_mode); > > + > > + kwr->u.rxhdr.authmode_to_rxvalid = > > + V_TLS_KEYCTX_TX_WR_AUTHMODE(kctx->state.auth_mode) | > > + V_TLS_KEYCTX_TX_WR_CIPHAUTHSEQCTRL(1) | > > + V_TLS_KEYCTX_TX_WR_SEQNUMCTRL(3) | > > + V_TLS_KEYCTX_TX_WR_RXVALID(1); > > + > > + kwr->u.rxhdr.ivpresent_to_rxmk_size = > > + V_TLS_KEYCTX_TX_WR_IVPRESENT(0) | > > + V_TLS_KEYCTX_TX_WR_RXOPAD_PRESENT(1) | > > + V_TLS_KEYCTX_TX_WR_RXCK_SIZE(get_cipher_key_size(ck_size)) > > | > > + V_TLS_KEYCTX_TX_WR_RXMK_SIZE(get_mac_key_size(mk_size)); > > + > > + tls_rxkey_flit1(kwr, kctx); > > + > > + /* No key reversal for GCM */ > > + if (kctx->state.enc_mode != CH_EVP_CIPH_GCM_MODE) { > > + t4_aes_getdeckey(kwr->keys.edkey, kctx->rx.key, > > + (kctx->cipher_secret_size << 3)); > > + memcpy(kwr->keys.edkey + kctx->cipher_secret_size, > > + kctx->rx.key + kctx->cipher_secret_size, > > + (IPAD_SIZE + OPAD_SIZE)); > > + } else { > > + memcpy(kwr->keys.edkey, kctx->rx.key, > > + (kctx->tx_key_info_size - SALT_SIZE)); > > + memcpy(kwr->u.rxhdr.rxsalt, kctx->rx.salt, SALT_SIZE); > > + } > > +} > > + > > +/* Tx key */ > > +static void > > +prepare_txkey_wr(struct tls_keyctx *kwr, struct tls_key_context *kctx) > > +{ > > + unsigned int ck_size = kctx->cipher_secret_size; > > + unsigned int mk_size = kctx->mac_secret_size; > > + > > + kwr->u.txhdr.ctxlen = > > + (kctx->tx_key_info_size >> 4); > > + kwr->u.txhdr.dualck_to_txvalid = > > + V_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT(1) | > > + V_TLS_KEYCTX_TX_WR_SALT_PRESENT(1) | > > + V_TLS_KEYCTX_TX_WR_TXCK_SIZE(get_cipher_key_size(ck_size)) > > | > > + V_TLS_KEYCTX_TX_WR_TXMK_SIZE(get_mac_key_size(mk_size)) | > > + V_TLS_KEYCTX_TX_WR_TXVALID(1); > > + > > + memcpy(kwr->keys.edkey, kctx->tx.key, HDR_KCTX_SIZE); > > + if (kctx->state.enc_mode == CH_EVP_CIPH_GCM_MODE) { > > + memcpy(kwr->u.txhdr.txsalt, kctx->tx.salt, SALT_SIZE); > > + kwr->u.txhdr.dualck_to_txvalid &= > > + ~(V_TLS_KEYCTX_TX_WR_TXOPAD_PRESENT(1)); > > + } > > + kwr->u.txhdr.dualck_to_txvalid = > > htons(kwr->u.txhdr.dualck_to_txvalid); +} > > + > > +/* TLS Key memory management */ > > +int > > +tls_init_kmap(struct adapter *sc, struct tom_data *td) > > +{ > > + > > + td->key_map = vmem_create("T4TLS key map", sc->vres.key.start, > > + sc->vres.key.size, 8, 0, M_FIRSTFIT | M_NOWAIT); > > + if (td->key_map == NULL) > > + return (ENOMEM); > > + return (0); > > +} > > + > > +void > > +tls_free_kmap(struct tom_data *td) > > +{ > > + > > + if (td->key_map != NULL) > > + vmem_destroy(td->key_map); > > +} > > + > > +static int > > +get_new_keyid(struct toepcb *toep, struct tls_key_context *k_ctx) > > +{ > > + struct tom_data *td = toep->td; > > + vmem_addr_t addr; > > + > > + if (vmem_alloc(td->key_map, TLS_KEY_CONTEXT_SZ, M_NOWAIT | > > M_FIRSTFIT, > > + &addr) != 0) > > + return (-1); > > + > > + return (addr); > > +} > > + > > +static void > > +free_keyid(struct toepcb *toep, int keyid) > > +{ > > + struct tom_data *td = toep->td; > > + > > + vmem_free(td->key_map, keyid, TLS_KEY_CONTEXT_SZ); > > +} > > + > > > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > _______________________________________________ > > 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" > > Building a kernel fails on CURRENT revision 330908 with the follwoing error: > > [...] > ===> gpio/gpioiic (all) > --- all_subdir_cxgbe --- > --- cm.o --- > In file included from /usr/src/sys/dev/cxgbe/iw_cxgbe/cm.c:68: > /usr/src/sys/dev/cxgbe/tom/t4_tom.h:327:28: error: use of undeclared > identifier 'ULP_MODE_TLS' return (toep->ulp_mode == ULP_MODE_TLS); > ^ > /usr/src/sys/dev/cxgbe/tom/t4_tom.h:333:12: error: incomplete definition of > type 'struct adapter' return (sc->tt.tls && sc->cryptocaps & > FW_CAPS_CONFIG_TLSKEYS); ~~^ > /usr/src/sys/dev/cxgbe/offload.h:139:8: note: forward declaration of 'struct > adapter' struct adapter; > > > > Kind regards, > > oh problem occurs when WITH_OFED=YES is set in /etc/src.conf. From owner-svn-src-head@freebsd.org Wed Mar 14 09:20:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50E5FF33CF2; Wed, 14 Mar 2018 09:20:04 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 030F777129; Wed, 14 Mar 2018 09:20:04 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F212825FF6; Wed, 14 Mar 2018 09:20:03 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2E9K3vr019123; Wed, 14 Mar 2018 09:20:03 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2E9K3mn019118; Wed, 14 Mar 2018 09:20:03 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201803140920.w2E9K3mn019118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Wed, 14 Mar 2018 09:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330925 - in head/sys: conf powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: in head/sys: conf powerpc/powernv X-SVN-Commit-Revision: 330925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 09:20:04 -0000 Author: wma Date: Wed Mar 14 09:20:03 2018 New Revision: 330925 URL: https://svnweb.freebsd.org/changeset/base/330925 Log: PowerNV: Fix I2C to compile if FDT is disabled Submitted by: Wojciech Macek Obtained from: Semihalf Sponsored by: IBM, QCM Technologies Modified: head/sys/conf/files.powerpc head/sys/powerpc/powernv/opal_i2c.c head/sys/powerpc/powernv/opal_i2cm.c head/sys/powerpc/powernv/powernv_centaur.c head/sys/powerpc/powernv/powernv_xscom.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Wed Mar 14 08:48:40 2018 (r330924) +++ head/sys/conf/files.powerpc Wed Mar 14 09:20:03 2018 (r330925) @@ -186,8 +186,8 @@ powerpc/powermac/vcoregpio.c optional powermac powerpc/powernv/opal.c optional powernv powerpc/powernv/opal_console.c optional powernv powerpc/powernv/opal_dev.c optional powernv -powerpc/powernv/opal_i2c.c optional iicbus fdt powernv -powerpc/powernv/opal_i2cm.c optional iicbus fdt powernv +powerpc/powernv/opal_i2c.c optional iicbus powernv +powerpc/powernv/opal_i2cm.c optional iicbus powernv powerpc/powernv/opal_pci.c optional powernv pci powerpc/powernv/opalcall.S optional powernv powerpc/powernv/platform_powernv.c optional powernv Modified: head/sys/powerpc/powernv/opal_i2c.c ============================================================================== --- head/sys/powerpc/powernv/opal_i2c.c Wed Mar 14 08:48:40 2018 (r330924) +++ head/sys/powerpc/powernv/opal_i2c.c Wed Mar 14 09:20:03 2018 (r330925) @@ -120,7 +120,9 @@ static int opal_i2c_probe(device_t dev) { +#ifdef FDT if (!(ofw_bus_is_compatible(dev, "ibm,opal-i2c"))) +#endif return (ENXIO); device_set_desc(dev, "opal-i2c"); @@ -131,6 +133,7 @@ opal_i2c_probe(device_t dev) static int opal_i2c_attach(device_t dev) { +#ifdef FDT struct opal_i2c_softc *sc; int len; @@ -150,6 +153,9 @@ opal_i2c_attach(device_t dev) I2C_LOCK_INIT(sc); return (bus_generic_attach(dev)); +#else + return (ENXIO); +#endif } static int Modified: head/sys/powerpc/powernv/opal_i2cm.c ============================================================================== --- head/sys/powerpc/powernv/opal_i2cm.c Wed Mar 14 08:48:40 2018 (r330924) +++ head/sys/powerpc/powernv/opal_i2cm.c Wed Mar 14 09:20:03 2018 (r330925) @@ -57,14 +57,17 @@ struct opal_i2cm_softc static int opal_i2cm_attach(device_t); static int opal_i2cm_probe(device_t); +#ifdef FDT static const struct ofw_bus_devinfo * opal_i2cm_get_devinfo(device_t, device_t); +#endif static device_method_t opal_i2cm_methods[] = { /* Device interface */ DEVMETHOD(device_probe, opal_i2cm_probe), DEVMETHOD(device_attach, opal_i2cm_attach), +#ifdef FDT /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, opal_i2cm_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), @@ -72,6 +75,7 @@ static device_method_t opal_i2cm_methods[] = { DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), +#endif DEVMETHOD_END }; @@ -82,8 +86,10 @@ static int opal_i2cm_probe(device_t dev) { +#ifdef FDT if (!(ofw_bus_is_compatible(dev, "ibm,centaur-i2cm") || ofw_bus_is_compatible(dev, "ibm,power8-i2cm"))) +#endif return (ENXIO); device_set_desc(dev, "centaur-i2cm"); @@ -93,6 +99,7 @@ opal_i2cm_probe(device_t dev) static int opal_i2cm_attach(device_t dev) { +#ifdef FDT phandle_t child; device_t cdev; struct ofw_bus_devinfo *dinfo; @@ -116,13 +123,18 @@ opal_i2cm_attach(device_t dev) } return (bus_generic_attach(dev)); +#else + return (ENXIO); +#endif } +#ifdef FDT static const struct ofw_bus_devinfo * opal_i2cm_get_devinfo(device_t dev, device_t child) { return (device_get_ivars(child)); } +#endif DEFINE_CLASS_0(opal_i2cm, opal_i2cm_driver, opal_i2cm_methods, sizeof(struct opal_i2cm_softc)); Modified: head/sys/powerpc/powernv/powernv_centaur.c ============================================================================== --- head/sys/powerpc/powernv/powernv_centaur.c Wed Mar 14 08:48:40 2018 (r330924) +++ head/sys/powerpc/powernv/powernv_centaur.c Wed Mar 14 09:20:03 2018 (r330925) @@ -57,14 +57,17 @@ struct powernv_centaur_softc static int powernv_centaur_attach(device_t); static int powernv_centaur_probe(device_t); +#ifdef FDT static const struct ofw_bus_devinfo * powernv_centaur_get_devinfo(device_t, device_t); +#endif static device_method_t powernv_centaur_methods[] = { /* Device interface */ DEVMETHOD(device_probe, powernv_centaur_probe), DEVMETHOD(device_attach, powernv_centaur_attach), +#ifdef FDT /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, powernv_centaur_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), @@ -72,7 +75,7 @@ static device_method_t powernv_centaur_methods[] = { DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - +#endif DEVMETHOD_END }; @@ -82,7 +85,9 @@ static int powernv_centaur_probe(device_t dev) { +#ifdef FDT if (!(ofw_bus_is_compatible(dev, "ibm,centaur"))) +#endif return (ENXIO); device_set_desc(dev, "centaur"); @@ -92,6 +97,7 @@ powernv_centaur_probe(device_t dev) static int powernv_centaur_attach(device_t dev) { +#ifdef FDT phandle_t child; device_t cdev; struct ofw_bus_devinfo *dinfo; @@ -115,13 +121,18 @@ powernv_centaur_attach(device_t dev) } return (bus_generic_attach(dev)); +#else + return (ENXIO); +#endif } +#ifdef FDT static const struct ofw_bus_devinfo * powernv_centaur_get_devinfo(device_t dev, device_t child) { return (device_get_ivars(child)); } +#endif DEFINE_CLASS_0(powernv_centaur, powernv_centaur_driver, powernv_centaur_methods, sizeof(struct powernv_centaur_softc)); Modified: head/sys/powerpc/powernv/powernv_xscom.c ============================================================================== --- head/sys/powerpc/powernv/powernv_xscom.c Wed Mar 14 08:48:40 2018 (r330924) +++ head/sys/powerpc/powernv/powernv_xscom.c Wed Mar 14 09:20:03 2018 (r330925) @@ -57,14 +57,17 @@ struct powernv_xscom_softc static int powernv_xscom_attach(device_t); static int powernv_xscom_probe(device_t); +#ifdef FDT static const struct ofw_bus_devinfo * powernv_xscom_get_devinfo(device_t, device_t); +#endif static device_method_t powernv_xscom_methods[] = { /* Device interface */ DEVMETHOD(device_probe, powernv_xscom_probe), DEVMETHOD(device_attach, powernv_xscom_attach), +#ifdef FDT /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, powernv_xscom_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), @@ -72,6 +75,7 @@ static device_method_t powernv_xscom_methods[] = { DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), +#endif DEVMETHOD_END }; @@ -82,7 +86,9 @@ static int powernv_xscom_probe(device_t dev) { +#ifdef FDT if (!(ofw_bus_is_compatible(dev, "ibm,xscom"))) +#endif return (ENXIO); device_set_desc(dev, "xscom"); @@ -92,6 +98,7 @@ powernv_xscom_probe(device_t dev) static int powernv_xscom_attach(device_t dev) { +#ifdef FDT phandle_t child; device_t cdev; struct ofw_bus_devinfo *dinfo; @@ -115,13 +122,18 @@ powernv_xscom_attach(device_t dev) } return (bus_generic_attach(dev)); +#else + return (ENXIO); +#endif } +#ifdef FDT static const struct ofw_bus_devinfo * powernv_xscom_get_devinfo(device_t dev, device_t child) { return (device_get_ivars(child)); } +#endif DEFINE_CLASS_0(powernv_xscom, powernv_xscom_driver, powernv_xscom_methods, sizeof(struct powernv_xscom_softc)); From owner-svn-src-head@freebsd.org Wed Mar 14 12:44:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37C87F4FA1C; Wed, 14 Mar 2018 12:44:50 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0E657EDF8; Wed, 14 Mar 2018 12:44:49 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f44.google.com with SMTP id e5-v6so546914lfb.7; Wed, 14 Mar 2018 05:44:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GoU7R3s4zH3CS6xLNxpUzZ772/EB1SYCeHiqVpgEUd8=; b=I5nmqAFstrL5iURN03T9Av+j7/C5WXTqBjivlhFuanDoCd5nUgQxKsfaeQ8nI9/sPj XcJwJo1R3qkVBv1vkrcOXAfC6WkS5AOB6MitcrMHjCrcYsoDNfNd5uRt5hnJ2i2DMoyy G95q4ROOmlyi+a8iLG4Dvuu3IFS0BMePdx7JohGHLOkaVYWMPB0HVQJoTZA0fWdcROXp BdPSxMyco/le7XEb8ja+A/9Oq5bDFN3oNUQoQqmMlgag5Ysu0T0RSYSTfwE5k7Gydxir qcSqKiQJOTMA0vLPODmxmUl3fN4o0FKbT/h2EJZi2n2zs7xGiq4V0mn5LCBR0dzw3JdE QEwA== X-Gm-Message-State: AElRT7EGDj9Uon1UPDOneTnX0R7mxf2x2aEohxbfzqEFlBZIIlDLX6Dc OdMAorpmxbK348NP38D1myIwJb9i X-Google-Smtp-Source: AG47ELvYG6QDZQp6hJ3yCQ3d9yxPyMdUC0UOmyvZQvaNS/oFCzpGvJ9OxjWV9qqLMxTErp3Cdo5z7Q== X-Received: by 10.46.22.89 with SMTP id 25mr3329757ljw.86.1521031479859; Wed, 14 Mar 2018 05:44:39 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id f16sm572532lja.48.2018.03.14.05.44.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Mar 2018 05:44:38 -0700 (PDT) Subject: Re: svn commit: r330883 - head/stand/userboot/userboot To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803132254.w2DMsU2r005593@repo.freebsd.org> From: Andriy Gapon Message-ID: <45a6c658-1133-ad46-d8df-48ee5bbccddf@FreeBSD.org> Date: Wed, 14 Mar 2018 14:44:37 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201803132254.w2DMsU2r005593@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 12:44:50 -0000 On 14/03/2018 00:54, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Mar 13 22:54:29 2018 > New Revision: 330883 > URL: https://svnweb.freebsd.org/changeset/base/330883 > > Log: > Fix typo that misteriously passes compilation. > > Modified: > head/stand/userboot/userboot/main.c > > Modified: head/stand/userboot/userboot/main.c > ============================================================================== > --- head/stand/userboot/userboot/main.c Tue Mar 13 21:42:38 2018 (r330882) > +++ head/stand/userboot/userboot/main.c Tue Mar 13 22:54:29 2018 (r330883) > @@ -159,7 +159,7 @@ extract_currdev(void) > //bzero(&dev, sizeof(dev)); > > #if defined(USERBOOT_ZFS_SUPPORT) > - CT_ASSERT(sizeof(struct disk_devdesc) >= sizeof(struct zfs_devdesc)); > + CTASSERT(sizeof(struct disk_devdesc) >= sizeof(struct zfs_devdesc)); > if (userboot_zfs_found) { > struct zfs_devdesc zdev; It seems that this was compiled to a call to an external CT_ASSERT function. Probably not enough warning flags to fail on a function without a prototype? Also, not sure how it worked at run-time. Maybe userboot.so is linked and loaded in such a way that it allows undefined symbols as long as they are not used. So, probably extract_currdev() just didn't get called. Anyway, thank you for spotting and fixing. -- Andriy Gapon From owner-svn-src-head@freebsd.org Wed Mar 14 13:20:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 395E4F51901; Wed, 14 Mar 2018 13:20:37 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFCDB804D2; Wed, 14 Mar 2018 13:20:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA9F748F; Wed, 14 Mar 2018 13:20:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EDKafo039165; Wed, 14 Mar 2018 13:20:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EDKaoW039162; Wed, 14 Mar 2018 13:20:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803141320.w2EDKaoW039162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 14 Mar 2018 13:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330927 - in head/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Commit-Revision: 330927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 13:20:37 -0000 Author: emaste Date: Wed Mar 14 13:20:36 2018 New Revision: 330927 URL: https://svnweb.freebsd.org/changeset/base/330927 Log: Remove stray ; at end of linux_vdso_deinstall() Modified: head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/i386/linux/linux_sysvec.c Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Wed Mar 14 09:57:58 2018 (r330926) +++ head/sys/amd64/linux/linux_sysvec.c Wed Mar 14 13:20:36 2018 (r330927) @@ -839,7 +839,7 @@ linux_vdso_deinstall(void *param) { __elfN(linux_shared_page_fini)(linux_shared_page_obj); -}; +} SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)linux_vdso_deinstall, NULL); Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Wed Mar 14 09:57:58 2018 (r330926) +++ head/sys/amd64/linux32/linux32_sysvec.c Wed Mar 14 13:20:36 2018 (r330927) @@ -1036,7 +1036,7 @@ linux_vdso_deinstall(void *param) { __elfN(linux_shared_page_fini)(linux_shared_page_obj); -}; +} SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)linux_vdso_deinstall, NULL); Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Wed Mar 14 09:57:58 2018 (r330926) +++ head/sys/i386/linux/linux_sysvec.c Wed Mar 14 13:20:36 2018 (r330927) @@ -1010,7 +1010,7 @@ linux_vdso_deinstall(void *param) { __elfN(linux_shared_page_fini)(linux_shared_page_obj); -}; +} SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)linux_vdso_deinstall, NULL); From owner-svn-src-head@freebsd.org Wed Mar 14 13:20:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5018F5192C for ; Wed, 14 Mar 2018 13:20:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D8DD805CC for ; Wed, 14 Mar 2018 13:20:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id e7so4369861ioj.1 for ; Wed, 14 Mar 2018 06:20:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=3ZUkfVhp2AjkLbAQ7O0VBGHSB8WCLJKzipKiSfaqzYc=; b=bgVUsoPsbg1sClDs0c3caFrDo8Og0BWTZ7aXoYavSpP1DVXtoP7egTndl0jVxXuGhd nacxQK578yafxwy+jErOKeR08Gr8F90HKYQFvMUhi+yhrUNk+Wuk0uWzgLGxzP+BMqDE np0iVL97QyXQ360ycNLLZkkgFJ6yG5VHsSN3/3peV5wmdrgQjDeI5w73Wgmew3t/e9zn zzU/7m5buooriGks8yXd3hKnCxDn8Wa4OJJXiac8Yh2LRWHdXE5/UUpzuJfzS21r+XGJ 3/GcXFyUqCUpns3lcTDkrKmvDYyiHyaavClZV2p1GC8uN5552YJRO2gk5FTwiE1HpXT0 2q3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=3ZUkfVhp2AjkLbAQ7O0VBGHSB8WCLJKzipKiSfaqzYc=; b=oq6s4GutqWki9/dltkyn4S4ZUZaaTeJZpRO138BE4g/kZMwNRVYtJ6FDFgVWo2kWpH YOogISlg15BBzWOFipxgCKUGMMrP6/z586ndFlHj7Y+NJSZzwJ0KzqJKVQ7k39KCaUU/ bI7c7jW1T2ewLYH5dh5kYuxHL/nLjA6NWVwgNOFlSVG7I9XUMm5ZFy2nxCbK1VL5RRhy RB1wXEKVpEu6aviPHj26YtAMvSgLWemfhMKrjWBfQrG1jOVRu90CnmUIRrHMDwD5SQxc KFj8luzX9fd+hobTeHwCoJ0GBUH1b7zjPrw66im1Zf1/l9Z6wDz8QHNGRSMPJEbCj7PC ZuSg== X-Gm-Message-State: AElRT7GJ1mnxgZn21RXAJvKS58rRMaLp4FdFir3oM52ZEdb0YQQZyN8C 6ddnUmSB+0NkFilvon1xOGgZRRi0xsdIlFt2OTCngA== X-Google-Smtp-Source: AG47ELv1kSK5WUFXVttsrN9tBKgDpVbdkO758pq0ytai8Gs6MvG4iBke3Bc6X3vif9AOOMmz5OTTt9zNQEGJUWviP9c= X-Received: by 10.107.18.162 with SMTP id 34mr4612343ios.168.1521033643671; Wed, 14 Mar 2018 06:20:43 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Wed, 14 Mar 2018 06:20:42 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:bcea:d775:d975:818] Received: by 10.79.203.196 with HTTP; Wed, 14 Mar 2018 06:20:42 -0700 (PDT) In-Reply-To: <45a6c658-1133-ad46-d8df-48ee5bbccddf@FreeBSD.org> References: <201803132254.w2DMsU2r005593@repo.freebsd.org> <45a6c658-1133-ad46-d8df-48ee5bbccddf@FreeBSD.org> From: Warner Losh Date: Wed, 14 Mar 2018 07:20:42 -0600 X-Google-Sender-Auth: N0emh7PIhhRXKD3eidjgj05fleU Message-ID: Subject: Re: svn commit: r330883 - head/stand/userboot/userboot To: Andriy Gapon Cc: Gleb Smirnoff , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 13:20:46 -0000 On Mar 14, 2018 6:45 AM, "Andriy Gapon" wrote: On 14/03/2018 00:54, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Mar 13 22:54:29 2018 > New Revision: 330883 > URL: https://svnweb.freebsd.org/changeset/base/330883 > > Log: > Fix typo that misteriously passes compilation. > > Modified: > head/stand/userboot/userboot/main.c > > Modified: head/stand/userboot/userboot/main.c > ============================================================ ================== > --- head/stand/userboot/userboot/main.c Tue Mar 13 21:42:38 2018 (r330882) > +++ head/stand/userboot/userboot/main.c Tue Mar 13 22:54:29 2018 (r330883) > @@ -159,7 +159,7 @@ extract_currdev(void) > //bzero(&dev, sizeof(dev)); > > #if defined(USERBOOT_ZFS_SUPPORT) > - CT_ASSERT(sizeof(struct disk_devdesc) >= sizeof(struct zfs_devdesc)); > + CTASSERT(sizeof(struct disk_devdesc) >= sizeof(struct zfs_devdesc)); > if (userboot_zfs_found) { > struct zfs_devdesc zdev; It seems that this was compiled to a call to an external CT_ASSERT function. Probably not enough warning flags to fail on a function without a prototype? Also, not sure how it worked at run-time. Maybe userboot.so is linked and loaded in such a way that it allows undefined symbols as long as they are not used. So, probably extract_currdev() just didn't get called. Anyway, thank you for spotting and fixing. I'll have to see if I can tighten up the warns to prevent this in the future. Warner From owner-svn-src-head@freebsd.org Wed Mar 14 14:21:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C84CFF54E50 for ; Wed, 14 Mar 2018 14:21:24 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 525FB829DF for ; Wed, 14 Mar 2018 14:21:23 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: d788596d-2792-11e8-b951-f99fef315fd9 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 outbound2.ore.mailhop.org (Halon) with ESMTPSA id d788596d-2792-11e8-b951-f99fef315fd9; Wed, 14 Mar 2018 14:20:27 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w2EELKCr022775; Wed, 14 Mar 2018 08:21:20 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1521037280.84937.285.camel@freebsd.org> Subject: Re: svn commit: r330925 - in head/sys: conf powerpc/powernv From: Ian Lepore To: Wojciech Macek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 14 Mar 2018 08:21:20 -0600 In-Reply-To: <201803140920.w2E9K3mn019118@repo.freebsd.org> References: <201803140920.w2E9K3mn019118@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 14:21:25 -0000 On Wed, 2018-03-14 at 09:20 +0000, Wojciech Macek wrote: > Author: wma > Date: Wed Mar 14 09:20:03 2018 > New Revision: 330925 > URL: https://svnweb.freebsd.org/changeset/base/330925 > > Log: >   PowerNV: Fix I2C to compile if FDT is disabled >    >   Submitted by:          Wojciech Macek >   Obtained from:         Semihalf >   Sponsored by:          IBM, QCM Technologies > This seems to be a nonsensical commit.  What's the point of compiling in a driver which is hard-coded to return failure from the probe and attach routines?  The pre-change code seemed more correct: the driver can only possibly work if FDT/OFW data is available, so only compile it in when that option is in effect. -- Ian From owner-svn-src-head@freebsd.org Wed Mar 14 14:45:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD23FF564E5; Wed, 14 Mar 2018 14: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B37983C2E; Wed, 14 Mar 2018 14:45:57 +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 6C0541210; Wed, 14 Mar 2018 14:45:57 +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 w2EEjvFP084705; Wed, 14 Mar 2018 14:45:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EEjvK4084703; Wed, 14 Mar 2018 14:45:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803141445.w2EEjvK4084703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 14 Mar 2018 14:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330929 - in head: . release/packages X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: . release/packages X-SVN-Commit-Revision: 330929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 14:45:58 -0000 Author: kevans Date: Wed Mar 14 14:45:57 2018 New Revision: 330929 URL: https://svnweb.freebsd.org/changeset/base/330929 Log: pkgbase: Fix post-install script for kernel packages kernel.ucl uses a hardcoded boot/kernel for kldxref, which is the incorrect directory when we're installing extra kernels that aren't the "default" kernel (placed at boot/kernel). Fix this by instead using a new %KERNELDIR% that we now replace in Makefile.inc1 with "kernel" for the default kernel and "kernel.${_kernel}" for these extra kernels so that, e.g. /boot/kernel.SHIVA, will get properly kldxref'd upon update and avoid outdated linker.hints. Reviewed by: gjb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14689 Modified: head/Makefile.inc1 head/release/packages/kernel.ucl Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Mar 14 14:32:01 2018 (r330928) +++ head/Makefile.inc1 Wed Mar 14 14:45:57 2018 (r330929) @@ -1698,6 +1698,7 @@ create-kernel-packages-flavor${flavor:C,^""$,${_defaul pwd_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VPWD_MKDB_ENDIAN` ; \ sed -e "s/%VERSION%/${PKG_VERSION}/" \ -e "s/%PKGNAME%/kernel-${INSTALLKERNEL:tl}${flavor}/" \ + -e "s/%KERNELDIR%/kernel/" \ -e "s/%COMMENT%/FreeBSD ${INSTALLKERNEL} kernel ${flavor}/" \ -e "s/%DESC%/FreeBSD ${INSTALLKERNEL} kernel ${flavor}/" \ -e "s/%CAP_MKDB_ENDIAN%/$${cap_arg}/g" \ @@ -1733,6 +1734,7 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_ pwd_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VPWD_MKDB_ENDIAN` ; \ sed -e "s/%VERSION%/${PKG_VERSION}/" \ -e "s/%PKGNAME%/kernel-${_kernel:tl}${flavor}/" \ + -e "s/%KERNELDIR%/kernel.${_kernel}/" \ -e "s/%COMMENT%/FreeBSD ${_kernel} kernel ${flavor}/" \ -e "s/%DESC%/FreeBSD ${_kernel} kernel ${flavor}/" \ -e "s/%CAP_MKDB_ENDIAN%/$${cap_arg}/g" \ Modified: head/release/packages/kernel.ucl ============================================================================== --- head/release/packages/kernel.ucl Wed Mar 14 14:32:01 2018 (r330928) +++ head/release/packages/kernel.ucl Wed Mar 14 14:45:57 2018 (r330929) @@ -17,6 +17,6 @@ desc = < Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 947D2F56DFF; Wed, 14 Mar 2018 14:53:37 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F8E48464D; Wed, 14 Mar 2018 14:53:36 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w2EErXkH006774 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 14 Mar 2018 07:53:34 -0700 Subject: Re: svn commit: r330925 - in head/sys: conf powerpc/powernv To: Ian Lepore , Wojciech Macek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803140920.w2E9K3mn019118@repo.freebsd.org> <1521037280.84937.285.camel@freebsd.org> From: Nathan Whitehorn Message-ID: <35bd7933-3d70-3e3f-1400-467ca6b9b561@freebsd.org> Date: Wed, 14 Mar 2018 07:53:33 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1521037280.84937.285.camel@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVY3OLlw8Wbf75t+CumguRFq1HzQySHQ01HGbXNVIh97Xlzwf++3AkvUPc5wnF2SE9ecfYaYKkrzyeDy4kqAtEgsuRXQE6QQIfs= X-Sonic-ID: C;ekDAd5cn6BGlXiAFsE207w== M;hIL7d5cn6BGlXiAFsE207w== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 14:53:37 -0000 On 03/14/18 07:21, Ian Lepore wrote: > On Wed, 2018-03-14 at 09:20 +0000, Wojciech Macek wrote: >> Author: wma >> Date: Wed Mar 14 09:20:03 2018 >> New Revision: 330925 >> URL: https://svnweb.freebsd.org/changeset/base/330925 >> >> Log: >>   PowerNV: Fix I2C to compile if FDT is disabled >> >>   Submitted by:          Wojciech Macek >>   Obtained from:         Semihalf >>   Sponsored by:          IBM, QCM Technologies >> > This seems to be a nonsensical commit.  What's the point of compiling > in a driver which is hard-coded to return failure from the probe and > attach routines?  The pre-change code seemed more correct: the driver > can only possibly work if FDT/OFW data is available, so only compile it > in when that option is in effect. > > -- Ian > It's even worse than that: the files.powerpc uses of fdt are *also* wrong, because it depends on OF, not FDT per se, which is unconditionally available on all AIM-type PowerPC kernels, so there is no need to test for *anything*. -Nathan From owner-svn-src-head@freebsd.org Wed Mar 14 15:03:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B437F57936; Wed, 14 Mar 2018 15:03:07 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96986850D8; Wed, 14 Mar 2018 15:03:06 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w2EEq46A005522 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 14 Mar 2018 07:52:04 -0700 Subject: Re: svn commit: r330925 - in head/sys: conf powerpc/powernv To: Wojciech Macek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803140920.w2E9K3mn019118@repo.freebsd.org> From: Nathan Whitehorn Message-ID: Date: Wed, 14 Mar 2018 07:52:03 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201803140920.w2E9K3mn019118@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVbhHv716Be7hz3hsySgGTGdD4UnUt/z4QuM5NLg6szxJD47Tvhwy5jv8VmKTqqOdKANprgb7eVJM3/3JcxhAunosXCRad3FfbE= X-Sonic-ID: C;AnFRQpcn6BGVdSAFsE207w== M;ANrBQpcn6BGVdSAFsE207w== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 15:03:07 -0000 On 03/14/18 02:20, Wojciech Macek wrote: > Author: wma > Date: Wed Mar 14 09:20:03 2018 > New Revision: 330925 > URL: https://svnweb.freebsd.org/changeset/base/330925 > > Log: > PowerNV: Fix I2C to compile if FDT is disabled > > Submitted by: Wojciech Macek > Obtained from: Semihalf > Sponsored by: IBM, QCM Technologies I don't think this makes any sense, for several reasons: 1. You are gating on #ifdef FDT for things that are using the OF_* API and aren't actually FDT-specific, so the #ifdef checks are testing the wrong thing. 2. It isn't possible to even build a PowerPC/AIM kernel, like PowerNV, without the Open Firmware support code that this uses, so there is no circumstance in which this helps anything. 3. The PowerNV platform is non-functional without a device tree intrinsically, so, even if you could build a kernel like this somehow, it would be impossible for it to work. Given all of that, why was this necessary? It seems to just add pointless #ifdef to code that does not need it. -Nathan > > Modified: > head/sys/conf/files.powerpc > head/sys/powerpc/powernv/opal_i2c.c > head/sys/powerpc/powernv/opal_i2cm.c > head/sys/powerpc/powernv/powernv_centaur.c > head/sys/powerpc/powernv/powernv_xscom.c > > Modified: head/sys/conf/files.powerpc > ============================================================================== > --- head/sys/conf/files.powerpc Wed Mar 14 08:48:40 2018 (r330924) > +++ head/sys/conf/files.powerpc Wed Mar 14 09:20:03 2018 (r330925) > @@ -186,8 +186,8 @@ powerpc/powermac/vcoregpio.c optional powermac > powerpc/powernv/opal.c optional powernv > powerpc/powernv/opal_console.c optional powernv > powerpc/powernv/opal_dev.c optional powernv > -powerpc/powernv/opal_i2c.c optional iicbus fdt powernv > -powerpc/powernv/opal_i2cm.c optional iicbus fdt powernv > +powerpc/powernv/opal_i2c.c optional iicbus powernv > +powerpc/powernv/opal_i2cm.c optional iicbus powernv > powerpc/powernv/opal_pci.c optional powernv pci > powerpc/powernv/opalcall.S optional powernv > powerpc/powernv/platform_powernv.c optional powernv > > Modified: head/sys/powerpc/powernv/opal_i2c.c > ============================================================================== > --- head/sys/powerpc/powernv/opal_i2c.c Wed Mar 14 08:48:40 2018 (r330924) > +++ head/sys/powerpc/powernv/opal_i2c.c Wed Mar 14 09:20:03 2018 (r330925) > @@ -120,7 +120,9 @@ static int > opal_i2c_probe(device_t dev) > { > > +#ifdef FDT > if (!(ofw_bus_is_compatible(dev, "ibm,opal-i2c"))) > +#endif > return (ENXIO); > > device_set_desc(dev, "opal-i2c"); > @@ -131,6 +133,7 @@ opal_i2c_probe(device_t dev) > static int > opal_i2c_attach(device_t dev) > { > +#ifdef FDT > struct opal_i2c_softc *sc; > int len; > > @@ -150,6 +153,9 @@ opal_i2c_attach(device_t dev) > I2C_LOCK_INIT(sc); > > return (bus_generic_attach(dev)); > +#else > + return (ENXIO); > +#endif > } > > static int > > Modified: head/sys/powerpc/powernv/opal_i2cm.c > ============================================================================== > --- head/sys/powerpc/powernv/opal_i2cm.c Wed Mar 14 08:48:40 2018 (r330924) > +++ head/sys/powerpc/powernv/opal_i2cm.c Wed Mar 14 09:20:03 2018 (r330925) > @@ -57,14 +57,17 @@ struct opal_i2cm_softc > > static int opal_i2cm_attach(device_t); > static int opal_i2cm_probe(device_t); > +#ifdef FDT > static const struct ofw_bus_devinfo * > opal_i2cm_get_devinfo(device_t, device_t); > +#endif > > static device_method_t opal_i2cm_methods[] = { > /* Device interface */ > DEVMETHOD(device_probe, opal_i2cm_probe), > DEVMETHOD(device_attach, opal_i2cm_attach), > > +#ifdef FDT > /* ofw_bus interface */ > DEVMETHOD(ofw_bus_get_devinfo, opal_i2cm_get_devinfo), > DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), > @@ -72,6 +75,7 @@ static device_method_t opal_i2cm_methods[] = { > DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), > DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), > DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), > +#endif > > DEVMETHOD_END > }; > @@ -82,8 +86,10 @@ static int > opal_i2cm_probe(device_t dev) > { > > +#ifdef FDT > if (!(ofw_bus_is_compatible(dev, "ibm,centaur-i2cm") || > ofw_bus_is_compatible(dev, "ibm,power8-i2cm"))) > +#endif > return (ENXIO); > > device_set_desc(dev, "centaur-i2cm"); > @@ -93,6 +99,7 @@ opal_i2cm_probe(device_t dev) > static int > opal_i2cm_attach(device_t dev) > { > +#ifdef FDT > phandle_t child; > device_t cdev; > struct ofw_bus_devinfo *dinfo; > @@ -116,13 +123,18 @@ opal_i2cm_attach(device_t dev) > } > > return (bus_generic_attach(dev)); > +#else > + return (ENXIO); > +#endif > } > > +#ifdef FDT > static const struct ofw_bus_devinfo * > opal_i2cm_get_devinfo(device_t dev, device_t child) > { > return (device_get_ivars(child)); > } > +#endif > > DEFINE_CLASS_0(opal_i2cm, opal_i2cm_driver, opal_i2cm_methods, > sizeof(struct opal_i2cm_softc)); > > Modified: head/sys/powerpc/powernv/powernv_centaur.c > ============================================================================== > --- head/sys/powerpc/powernv/powernv_centaur.c Wed Mar 14 08:48:40 2018 (r330924) > +++ head/sys/powerpc/powernv/powernv_centaur.c Wed Mar 14 09:20:03 2018 (r330925) > @@ -57,14 +57,17 @@ struct powernv_centaur_softc > > static int powernv_centaur_attach(device_t); > static int powernv_centaur_probe(device_t); > +#ifdef FDT > static const struct ofw_bus_devinfo * > powernv_centaur_get_devinfo(device_t, device_t); > +#endif > > static device_method_t powernv_centaur_methods[] = { > /* Device interface */ > DEVMETHOD(device_probe, powernv_centaur_probe), > DEVMETHOD(device_attach, powernv_centaur_attach), > > +#ifdef FDT > /* ofw_bus interface */ > DEVMETHOD(ofw_bus_get_devinfo, powernv_centaur_get_devinfo), > DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), > @@ -72,7 +75,7 @@ static device_method_t powernv_centaur_methods[] = { > DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), > DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), > DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), > - > +#endif > DEVMETHOD_END > }; > > @@ -82,7 +85,9 @@ static int > powernv_centaur_probe(device_t dev) > { > > +#ifdef FDT > if (!(ofw_bus_is_compatible(dev, "ibm,centaur"))) > +#endif > return (ENXIO); > > device_set_desc(dev, "centaur"); > @@ -92,6 +97,7 @@ powernv_centaur_probe(device_t dev) > static int > powernv_centaur_attach(device_t dev) > { > +#ifdef FDT > phandle_t child; > device_t cdev; > struct ofw_bus_devinfo *dinfo; > @@ -115,13 +121,18 @@ powernv_centaur_attach(device_t dev) > } > > return (bus_generic_attach(dev)); > +#else > + return (ENXIO); > +#endif > } > > +#ifdef FDT > static const struct ofw_bus_devinfo * > powernv_centaur_get_devinfo(device_t dev, device_t child) > { > return (device_get_ivars(child)); > } > +#endif > > DEFINE_CLASS_0(powernv_centaur, powernv_centaur_driver, powernv_centaur_methods, > sizeof(struct powernv_centaur_softc)); > > Modified: head/sys/powerpc/powernv/powernv_xscom.c > ============================================================================== > --- head/sys/powerpc/powernv/powernv_xscom.c Wed Mar 14 08:48:40 2018 (r330924) > +++ head/sys/powerpc/powernv/powernv_xscom.c Wed Mar 14 09:20:03 2018 (r330925) > @@ -57,14 +57,17 @@ struct powernv_xscom_softc > > static int powernv_xscom_attach(device_t); > static int powernv_xscom_probe(device_t); > +#ifdef FDT > static const struct ofw_bus_devinfo * > powernv_xscom_get_devinfo(device_t, device_t); > +#endif > > static device_method_t powernv_xscom_methods[] = { > /* Device interface */ > DEVMETHOD(device_probe, powernv_xscom_probe), > DEVMETHOD(device_attach, powernv_xscom_attach), > > +#ifdef FDT > /* ofw_bus interface */ > DEVMETHOD(ofw_bus_get_devinfo, powernv_xscom_get_devinfo), > DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), > @@ -72,6 +75,7 @@ static device_method_t powernv_xscom_methods[] = { > DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), > DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), > DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), > +#endif > > DEVMETHOD_END > }; > @@ -82,7 +86,9 @@ static int > powernv_xscom_probe(device_t dev) > { > > +#ifdef FDT > if (!(ofw_bus_is_compatible(dev, "ibm,xscom"))) > +#endif > return (ENXIO); > > device_set_desc(dev, "xscom"); > @@ -92,6 +98,7 @@ powernv_xscom_probe(device_t dev) > static int > powernv_xscom_attach(device_t dev) > { > +#ifdef FDT > phandle_t child; > device_t cdev; > struct ofw_bus_devinfo *dinfo; > @@ -115,13 +122,18 @@ powernv_xscom_attach(device_t dev) > } > > return (bus_generic_attach(dev)); > +#else > + return (ENXIO); > +#endif > } > > +#ifdef FDT > static const struct ofw_bus_devinfo * > powernv_xscom_get_devinfo(device_t dev, device_t child) > { > return (device_get_ivars(child)); > } > +#endif > > DEFINE_CLASS_0(powernv_xscom, powernv_xscom_driver, powernv_xscom_methods, > sizeof(struct powernv_xscom_softc)); > From owner-svn-src-head@freebsd.org Wed Mar 14 16:14:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22FFAF5B945; Wed, 14 Mar 2018 16:14:33 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2442683AC; Wed, 14 Mar 2018 16:14:32 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 1190A2603AE; Wed, 14 Mar 2018 17:14:31 +0100 (CET) Subject: Re: svn commit: r330885 - head/sys/modules/cam To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803132336.w2DNaFme025632@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Wed, 14 Mar 2018 17:14:26 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201803132336.w2DNaFme025632@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 16:14:33 -0000 On 03/14/18 00:36, Warner Losh wrote: > Author: imp > Date: Tue Mar 13 23:36:15 2018 > New Revision: 330885 > URL: https://svnweb.freebsd.org/changeset/base/330885 > > Log: > We need opt_compat.h after r330819 and 330820. > > Add opt_compat.h to fix the stand-alone build case. > > Sponsored by: Netflix. > > Modified: > head/sys/modules/cam/Makefile > > Modified: head/sys/modules/cam/Makefile > ============================================================================== > --- head/sys/modules/cam/Makefile Tue Mar 13 23:05:51 2018 (r330884) > +++ head/sys/modules/cam/Makefile Tue Mar 13 23:36:15 2018 (r330885) > @@ -8,6 +8,7 @@ KMOD= cam > > # See sys/conf/options for the flags that go into the different opt_*.h files. > SRCS= opt_cam.h > +SRCS= opt_compat.h > SRCS+= opt_ada.h > SRCS+= opt_scsi.h > SRCS+= opt_cd.h > > Hi, Should this be SRCS+= ? --HPS From owner-svn-src-head@freebsd.org Wed Mar 14 16:16:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71C29F5BACA; Wed, 14 Mar 2018 16:16:26 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12CA768590; Wed, 14 Mar 2018 16:16:26 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0919D1FA3; Wed, 14 Mar 2018 16:16:26 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EGGPvE030625; Wed, 14 Mar 2018 16:16:25 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EGGPOp030624; Wed, 14 Mar 2018 16:16:25 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201803141616.w2EGGPOp030624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Wed, 14 Mar 2018 16:16:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330930 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 330930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 16:16:26 -0000 Author: nwhitehorn Date: Wed Mar 14 16:16:25 2018 New Revision: 330930 URL: https://svnweb.freebsd.org/changeset/base/330930 Log: The expression (aim | fdt) is always true on PowerPC. The last PowerPC platform that can run without a device tree (PS3) still uses the OF_*() functions to check if one exists and OF_* is used unconditionally in core parts of the system like powerpc/machdep.c. Reflect this reality in files.powerpc, for example by changing occurrences of aim | fdt to standard. Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Wed Mar 14 14:45:57 2018 (r330929) +++ head/sys/conf/files.powerpc Wed Mar 14 16:16:25 2018 (r330930) @@ -32,7 +32,7 @@ dev/adb/adb_buttons.c optional adb dev/agp/agp_apple.c optional agp powermac dev/fb/fb.c optional sc # ofwbus depends on simplebus. -dev/fdt/simplebus.c optional aim | fdt +dev/fdt/simplebus.c optional standard dev/hwpmc/hwpmc_e500.c optional hwpmc dev/hwpmc/hwpmc_mpc7xxx.c optional hwpmc dev/hwpmc/hwpmc_powerpc.c optional hwpmc @@ -55,7 +55,7 @@ dev/ofw/ofw_if.m optional aim dev/ofw/ofw_bus_subr.c optional aim dev/ofw/ofw_console.c optional aim dev/ofw/ofw_disk.c optional ofwd aim -dev/ofw/ofwbus.c optional aim | fdt +dev/ofw/ofwbus.c optional aim dev/ofw/ofwpci.c optional pci dev/ofw/ofw_standard.c optional aim powerpc dev/ofw/ofw_subr.c optional aim powerpc @@ -74,7 +74,7 @@ dev/syscons/scgfbrndr.c optional sc dev/syscons/scterm-teken.c optional sc dev/syscons/scvtb.c optional sc dev/tsec/if_tsec.c optional tsec -dev/tsec/if_tsec_fdt.c optional tsec fdt +dev/tsec/if_tsec_fdt.c optional tsec dev/uart/uart_cpu_powerpc.c optional uart dev/usb/controller/ehci_fsl.c optional ehci mpc85xx dev/vt/hw/ofwfb/ofwfb.c optional vt aim @@ -136,12 +136,12 @@ powerpc/mambo/mambo_disk.c optional mambo powerpc/mikrotik/platform_rb.c optional mikrotik powerpc/mikrotik/rb_led.c optional mikrotik powerpc/mpc85xx/atpic.c optional mpc85xx isa -powerpc/mpc85xx/ds1553_bus_fdt.c optional ds1553 fdt +powerpc/mpc85xx/ds1553_bus_fdt.c optional ds1553 powerpc/mpc85xx/ds1553_core.c optional ds1553 powerpc/mpc85xx/fsl_diu.c optional mpc85xx diu powerpc/mpc85xx/fsl_espi.c optional mpc85xx spibus powerpc/mpc85xx/fsl_sata.c optional mpc85xx ata -powerpc/mpc85xx/i2c.c optional iicbus fdt +powerpc/mpc85xx/i2c.c optional iicbus powerpc/mpc85xx/isa.c optional mpc85xx isa powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx @@ -158,7 +158,7 @@ powerpc/ofw/ofw_real.c optional aim powerpc/ofw/ofw_syscons.c optional sc aim powerpc/ofw/ofwcall32.S optional aim powerpc powerpc/ofw/ofwcall64.S optional aim powerpc64 -powerpc/ofw/openpic_ofw.c optional aim | fdt +powerpc/ofw/openpic_ofw.c optional standard powerpc/ofw/rtas.c optional aim powerpc/powermac/ata_kauai.c optional powermac ata | powermac atamacio powerpc/powermac/ata_macio.c optional powermac ata | powermac atamacio From owner-svn-src-head@freebsd.org Wed Mar 14 16:19:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CBCAF5BE4B; Wed, 14 Mar 2018 16:19:35 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com [IPv6:2a00:1450:4010:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D24F16882F; Wed, 14 Mar 2018 16:19:34 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf0-x22c.google.com with SMTP id y19-v6so5707760lfd.4; Wed, 14 Mar 2018 09:19:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=fycUc9k7JlUKV1cVGIpm1kkvnGnSz2Rs58NOnkCqq3Q=; b=FDDHlwNaYfAIZoEUazt0da/d/PpeiJyrnWGzLZzpiit+g68F9DtqlkY+GTuq+j3YV0 ofifY+fgraCgKe52mr28QlbLpmS0qYHFydy03eDg+tTsjQiBFhfK/f4lfAH4WKgL6td8 b0UoGhsTeHmii/hOILShQbssMrbWsjJ0AVczGGoTj26XYHQfh8vFXBZkyOZyKeqoKqJD TWW5fOXFQ/Q1O4dVDlSnBDJYf6vzRaPYcN4DNvOhbhywOwXV2FyMj8vi2aYziK4IhRL5 KTFIyFrfwPSvgi9bbAyhYU7B+VeprsqeGAHKWbi6ubpOKWIxrrcS3+qaSUPSrqXePuow Bwvg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alumni-cwru-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=fycUc9k7JlUKV1cVGIpm1kkvnGnSz2Rs58NOnkCqq3Q=; b=k8Km1d1GqQ1C6WygHpwTHYK2yxJSnsbULCt/sl4cPshmSvgh3WJFdEx0JZ5ctrx4uM zjCAJvi4PH1zshf++/KtwVpc736SW/OSbE9N+nQl45vXUnoH0LNYvQK3orG++BUFQq7Q 6jfWvr6Kq8pZBMyUBMMM5WLYR+0+XCgtXBtnbwTbQaVcXgW6637ypvFvv/SflPUALUgB oXWDroG02IlzMqTAKNFHO3FM6O9s3GpoabbcANATitIA2nEB6dBs7L0GKb6509ndOqcN lgoK3PKGLXtZA+oeZ7Usj/U8TO892f7CJ3ZDkCgzhZukJQO5gyFIbh0c+f1DKKRfUc8X 8ajQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=fycUc9k7JlUKV1cVGIpm1kkvnGnSz2Rs58NOnkCqq3Q=; b=frKIfixWPcjggQxAJYu/ZjcF8Kf/f30bbY8F/DzKISRlSmHWth97KUS9LQIesNgI2i Bev+vcDBk+DPmK2qt1sTTX035Lwjipu0ev6ckjpZ2+r5pqTCPJjM3i0bJUAs9mR0Pgb4 w0QyWa9E+GwzVdFCTJTTaF5ly0OpaIE28y6F/xe7+CXoaFqfyOqSCWSMCUevfjXygXHY afsnHKRMtlkMuP7y5mhEvgJKZ9T9IKVx6wkT7P0NMJXvcWV+IxPG7GWOmxWo9b7x+X/s ep2FFUTHlgHzEeHeZbGrtLSyL2QKx0BhEjJwwhmQqPTMmQKK3582BYXMfjeZTumtSfsF ig0g== X-Gm-Message-State: AElRT7GFLW1SClK2T1aEG+o/CF7E9wefvgwUAg25DeRV+ctEFSwFB2dD MARWjsViqzItRtfiB17/6B0eRCiYNjmAhX02WtE= X-Google-Smtp-Source: AG47ELs8nhiFCIAcq92uSNZNv/99GieWwwtmsLzUTEvoEO0iE2qTTJCKjz3VvvseyCS1UsArRTQYhlXrstdcHTweAEU= X-Received: by 2002:a19:2744:: with SMTP id n65-v6mr4030337lfn.67.1521044372198; Wed, 14 Mar 2018 09:19:32 -0700 (PDT) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.46.85.26 with HTTP; Wed, 14 Mar 2018 09:19:31 -0700 (PDT) In-Reply-To: <201803141616.w2EGGPOp030624@repo.freebsd.org> References: <201803141616.w2EGGPOp030624@repo.freebsd.org> From: Justin Hibbits Date: Wed, 14 Mar 2018 11:19:31 -0500 X-Google-Sender-Auth: Y6EbzJXZz7cCyc4VJ72cuGaU1Yc Message-ID: Subject: Re: svn commit: r330930 - head/sys/conf To: Nathan Whitehorn Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 16:19:35 -0000 On Wed, Mar 14, 2018 at 11:16 AM, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Wed Mar 14 16:16:25 2018 > New Revision: 330930 > URL: https://svnweb.freebsd.org/changeset/base/330930 > > Log: > The expression (aim | fdt) is always true on PowerPC. The last PowerPC > platform that can run without a device tree (PS3) still uses the OF_*() > functions to check if one exists and OF_* is used unconditionally in > core parts of the system like powerpc/machdep.c. Reflect this reality > in files.powerpc, for example by changing occurrences of aim | fdt to > standard. > > Modified: > head/sys/conf/files.powerpc > > Modified: head/sys/conf/files.powerpc > ============================================================================== > --- head/sys/conf/files.powerpc Wed Mar 14 14:45:57 2018 (r330929) > +++ head/sys/conf/files.powerpc Wed Mar 14 16:16:25 2018 (r330930) > @@ -32,7 +32,7 @@ dev/adb/adb_buttons.c optional adb > dev/agp/agp_apple.c optional agp powermac > dev/fb/fb.c optional sc > # ofwbus depends on simplebus. > -dev/fdt/simplebus.c optional aim | fdt > +dev/fdt/simplebus.c optional standard > dev/hwpmc/hwpmc_e500.c optional hwpmc > dev/hwpmc/hwpmc_mpc7xxx.c optional hwpmc > dev/hwpmc/hwpmc_powerpc.c optional hwpmc > @@ -55,7 +55,7 @@ dev/ofw/ofw_if.m optional aim > dev/ofw/ofw_bus_subr.c optional aim > dev/ofw/ofw_console.c optional aim > dev/ofw/ofw_disk.c optional ofwd aim > -dev/ofw/ofwbus.c optional aim | fdt > +dev/ofw/ofwbus.c optional aim ofwbus is used by Book-E too, not just AIM. And 'aim' is not defined for Book-E platforms. Maybe it should be 'standard' instead? - Justin From owner-svn-src-head@freebsd.org Wed Mar 14 16:43:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBD1E6CE; Wed, 14 Mar 2018 16:42: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 6C28269F38; Wed, 14 Mar 2018 16:42:58 +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 w2EGgtBn088820; Wed, 14 Mar 2018 09:42:55 -0700 (PDT) (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 w2EGgtYM088819; Wed, 14 Mar 2018 09:42:55 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803141642.w2EGgtYM088819@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r330930 - head/sys/conf In-Reply-To: <201803141616.w2EGGPOp030624@repo.freebsd.org> To: Nathan Whitehorn Date: Wed, 14 Mar 2018 09:42:55 -0700 (PDT) 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 16:43:00 -0000 > Author: nwhitehorn > Date: Wed Mar 14 16:16:25 2018 > New Revision: 330930 > URL: https://svnweb.freebsd.org/changeset/base/330930 > > Log: > The expression (aim | fdt) is always true on PowerPC. The last PowerPC > platform that can run without a device tree (PS3) still uses the OF_*() > functions to check if one exists and OF_* is used unconditionally in > core parts of the system like powerpc/machdep.c. Reflect this reality > in files.powerpc, for example by changing occurrences of aim | fdt to > standard. > > Modified: > head/sys/conf/files.powerpc > > Modified: head/sys/conf/files.powerpc > ============================================================================== > --- head/sys/conf/files.powerpc Wed Mar 14 14:45:57 2018 (r330929) > +++ head/sys/conf/files.powerpc Wed Mar 14 16:16:25 2018 (r330930) > @@ -32,7 +32,7 @@ dev/adb/adb_buttons.c optional adb > dev/agp/agp_apple.c optional agp powermac > dev/fb/fb.c optional sc > # ofwbus depends on simplebus. > -dev/fdt/simplebus.c optional aim | fdt > +dev/fdt/simplebus.c optional standard optionaly standard? > dev/hwpmc/hwpmc_e500.c optional hwpmc > dev/hwpmc/hwpmc_mpc7xxx.c optional hwpmc > dev/hwpmc/hwpmc_powerpc.c optional hwpmc > @@ -55,7 +55,7 @@ dev/ofw/ofw_if.m optional aim > dev/ofw/ofw_bus_subr.c optional aim > dev/ofw/ofw_console.c optional aim > dev/ofw/ofw_disk.c optional ofwd aim > -dev/ofw/ofwbus.c optional aim | fdt > +dev/ofw/ofwbus.c optional aim > dev/ofw/ofwpci.c optional pci > dev/ofw/ofw_standard.c optional aim powerpc > dev/ofw/ofw_subr.c optional aim powerpc > @@ -74,7 +74,7 @@ dev/syscons/scgfbrndr.c optional sc > dev/syscons/scterm-teken.c optional sc > dev/syscons/scvtb.c optional sc > dev/tsec/if_tsec.c optional tsec > -dev/tsec/if_tsec_fdt.c optional tsec fdt > +dev/tsec/if_tsec_fdt.c optional tsec > dev/uart/uart_cpu_powerpc.c optional uart > dev/usb/controller/ehci_fsl.c optional ehci mpc85xx > dev/vt/hw/ofwfb/ofwfb.c optional vt aim > @@ -136,12 +136,12 @@ powerpc/mambo/mambo_disk.c optional mambo > powerpc/mikrotik/platform_rb.c optional mikrotik > powerpc/mikrotik/rb_led.c optional mikrotik > powerpc/mpc85xx/atpic.c optional mpc85xx isa > -powerpc/mpc85xx/ds1553_bus_fdt.c optional ds1553 fdt > +powerpc/mpc85xx/ds1553_bus_fdt.c optional ds1553 > powerpc/mpc85xx/ds1553_core.c optional ds1553 > powerpc/mpc85xx/fsl_diu.c optional mpc85xx diu > powerpc/mpc85xx/fsl_espi.c optional mpc85xx spibus > powerpc/mpc85xx/fsl_sata.c optional mpc85xx ata > -powerpc/mpc85xx/i2c.c optional iicbus fdt > +powerpc/mpc85xx/i2c.c optional iicbus > powerpc/mpc85xx/isa.c optional mpc85xx isa > powerpc/mpc85xx/lbc.c optional mpc85xx > powerpc/mpc85xx/mpc85xx.c optional mpc85xx > @@ -158,7 +158,7 @@ powerpc/ofw/ofw_real.c optional aim > powerpc/ofw/ofw_syscons.c optional sc aim > powerpc/ofw/ofwcall32.S optional aim powerpc > powerpc/ofw/ofwcall64.S optional aim powerpc64 > -powerpc/ofw/openpic_ofw.c optional aim | fdt > +powerpc/ofw/openpic_ofw.c optional standard And here too > powerpc/ofw/rtas.c optional aim > powerpc/powermac/ata_kauai.c optional powermac ata | powermac atamacio > powerpc/powermac/ata_macio.c optional powermac ata | powermac atamacio > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Mar 14 16:43:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 515A87C0 for ; Wed, 14 Mar 2018 16:43:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D78486A092 for ; Wed, 14 Mar 2018 16:43:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x235.google.com with SMTP id d13-v6so5425986itf.0 for ; Wed, 14 Mar 2018 09:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=YLqB7unhpM7dijXOpq6bHvtaIxWppwK13pyYFUu/pQQ=; b=CGGQZgBeJksauwTNOtrCOrhJKcQMLDIKpO3dMEUmDXye5HasEUuqw5ikamrN2ZNc8W O9JeSVfBUyg2uvFXtMyQijm7J30seOixwei+2z6zq8GyUX/dT+GsHXZt/XoTGa/xWbBG XEeAJhEMf5tCTAjiXsc0MbaM+8cNQgGZAndWKQTkJX+jeHKVnHSecS/2JFOcVQpn3x7a UkFVA4kb+6136131dnoEXFa5nB2nlB3udqCIhMmM9YY3nVNZylyll278IGIYc6O4Mhkp vFaT4iPD1UPBntOtHg6GM7DWaJELdfF/uGNsh4AyXzYtsAl1o0UcAmSCCLbt3NaFRfWu cxCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=YLqB7unhpM7dijXOpq6bHvtaIxWppwK13pyYFUu/pQQ=; b=S05zFcHQjOhxDX2aWwwG6cTK6Xj+DYfVcglHrMVd/4XMijt1tCinT5wUaR1YO/GsNz w5F1rskjwzPupRPFbykj6uansqxib5zwEtTgC6W3aWD3db25Cq/eAy1k/CKVkTfqKLEu AUVe4akwyCEYnuVkzlSHBBKoCydJEmHjwHKOrHSXaBqSCH/K0MTLioVy4yYoBeJpVSHq 0UXJtwBequ3D4yg4uyM+KsROoPr65xnRULcSc/dQLxvZz5czooeGM4lhY9fajhtBk9Sy nNvq6QB/tQo6Thoicg3Ppd/qKM4evPzOKfzXz4A1vHXbMCtgRxXW1PjZZzjZ0L1hZWJI 7u2g== X-Gm-Message-State: AElRT7F9DN7X0/ngf01bi/znzH4kf6tupVBKKGkxTptMmb6QZPSV7X4F FK/DoDv4Xq/Z40a+BEEtMezrgKVhNGly8f70wGe7Tg== X-Google-Smtp-Source: AG47ELt3aKP1lBUMKkZuuoeEVk0Yc/P/HkzCqcql6YHMBe5x7qeKAgDo8SG7pof2ljty/jsb5lVMHg4qA+ARadgeJ3Y= X-Received: by 10.36.16.147 with SMTP id 141mr2771893ity.73.1521045827128; Wed, 14 Mar 2018 09:43:47 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Wed, 14 Mar 2018 09:43:46 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201803132336.w2DNaFme025632@repo.freebsd.org> From: Warner Losh Date: Wed, 14 Mar 2018 10:43:46 -0600 X-Google-Sender-Auth: HQUzLTL9OAobKUI1VotX0UpYi84 Message-ID: Subject: Re: svn commit: r330885 - head/sys/modules/cam To: Hans Petter Selasky Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 16:43:48 -0000 On Wed, Mar 14, 2018 at 10:14 AM, Hans Petter Selasky wrote: > On 03/14/18 00:36, Warner Losh wrote: > >> Author: imp >> Date: Tue Mar 13 23:36:15 2018 >> New Revision: 330885 >> URL: https://svnweb.freebsd.org/changeset/base/330885 >> >> Log: >> We need opt_compat.h after r330819 and 330820. >> Add opt_compat.h to fix the stand-alone build case. >> Sponsored by: Netflix. >> >> Modified: >> head/sys/modules/cam/Makefile >> >> Modified: head/sys/modules/cam/Makefile >> ============================================================ >> ================== >> --- head/sys/modules/cam/Makefile Tue Mar 13 23:05:51 2018 >> (r330884) >> +++ head/sys/modules/cam/Makefile Tue Mar 13 23:36:15 2018 >> (r330885) >> @@ -8,6 +8,7 @@ KMOD= cam >> # See sys/conf/options for the flags that go into the different >> opt_*.h files. >> SRCS= opt_cam.h >> +SRCS= opt_compat.h >> SRCS+= opt_ada.h >> SRCS+= opt_scsi.h >> SRCS+= opt_cd.h >> >> >> > Hi, > > Should this be SRCS+= ? Yes. I had an unclean build and it worked. Good eye. Wanrer From owner-svn-src-head@freebsd.org Wed Mar 14 16:44:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27B5783C; Wed, 14 Mar 2018 16:44:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDAB56A1CF; Wed, 14 Mar 2018 16:44:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C48262427; Wed, 14 Mar 2018 16:44:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EGiGll046072; Wed, 14 Mar 2018 16:44:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EGiGbx046071; Wed, 14 Mar 2018 16:44:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803141644.w2EGiGbx046071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 14 Mar 2018 16:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330931 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 330931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 16:44:17 -0000 Author: imp Date: Wed Mar 14 16:44:16 2018 New Revision: 330931 URL: https://svnweb.freebsd.org/changeset/base/330931 Log: Allow NULL ccb to cam_iosched_bio_complete When the ccb is NULL to cam_iosched_bio_complete, just update the other statistics, but not the time. If many operations are collapsed together, this is needed to keep stats properly for the grouped bp. This should fix trim accounting. Sponsored by: Netflix Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Wed Mar 14 16:16:25 2018 (r330930) +++ head/sys/cam/cam_iosched.c Wed Mar 14 16:44:16 2018 (r330931) @@ -1493,7 +1493,7 @@ cam_iosched_bio_complete(struct cam_iosched_softc *isc printf("Completing command with bio_cmd == %#x\n", bp->bio_cmd); } - if (!(bp->bio_flags & BIO_ERROR)) + if (!(bp->bio_flags & BIO_ERROR) && done_ccb != NULL) cam_iosched_io_metric_update(isc, cam_iosched_sbintime_t(done_ccb->ccb_h.qos.periph_data), bp->bio_cmd, bp->bio_bcount); From owner-svn-src-head@freebsd.org Wed Mar 14 16:44:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 798298D3; Wed, 14 Mar 2018 16:44:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AEEB6A2DF; Wed, 14 Mar 2018 16:44:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25B352428; Wed, 14 Mar 2018 16:44:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EGipWx046142; Wed, 14 Mar 2018 16:44:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EGioti046140; Wed, 14 Mar 2018 16:44:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803141644.w2EGioti046140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 14 Mar 2018 16:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330932 - in head/sys: cam/nvme dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: cam/nvme dev/nvme X-SVN-Commit-Revision: 330932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 16:44:51 -0000 Author: imp Date: Wed Mar 14 16:44:50 2018 New Revision: 330932 URL: https://svnweb.freebsd.org/changeset/base/330932 Log: Implement trim collapsing in nda When multiple trims are in the queue, collapse them as much as possible. At present, this usually results in only a few trims being collapsed together, but more work on that will make it possible to do hundreds (up to some configurable max). Sponsored by: Netflix Modified: head/sys/cam/nvme/nvme_da.c head/sys/dev/nvme/nvme.h Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Wed Mar 14 16:44:16 2018 (r330931) +++ head/sys/cam/nvme/nvme_da.c Wed Mar 14 16:44:50 2018 (r330932) @@ -93,12 +93,10 @@ typedef enum { } nda_ccb_state; /* Offsets into our private area for storing information */ -#define ccb_state ppriv_field0 -#define ccb_bp ppriv_ptr1 +#define ccb_state ccb_h.ppriv_field0 +#define ccb_bp ccb_h.ppriv_ptr1 /* For NDA_CCB_BUFFER_IO */ +#define ccb_trim ccb_h.ppriv_ptr1 /* For NDA_CCB_TRIM */ -struct trim_request { - TAILQ_HEAD(, bio) bps; -}; struct nda_softc { struct cam_iosched_softc *cam_iosched; int outstanding_cmds; /* Number of active commands */ @@ -107,12 +105,13 @@ struct nda_softc { nda_flags flags; nda_quirks quirks; int unmappedio; + quad_t deletes; + quad_t dsm_req; uint32_t nsid; /* Namespace ID for this nda device */ struct disk *disk; struct task sysctl_task; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; - struct trim_request trim_req; #ifdef CAM_IO_STATS struct sysctl_ctx_list sysctl_stats_ctx; struct sysctl_oid *sysctl_stats_tree; @@ -122,6 +121,14 @@ struct nda_softc { #endif }; +struct nda_trim_request { + union { + struct nvme_dsm_range dsm; + uint8_t data[NVME_MAX_DSM_TRIM]; + }; + TAILQ_HEAD(, bio) bps; +}; + /* Need quirk table */ static disk_strategy_t ndastrategy; @@ -150,11 +157,14 @@ static void ndasuspend(void *arg); #ifndef NDA_DEFAULT_RETRY #define NDA_DEFAULT_RETRY 4 #endif +#ifndef NDA_MAX_TRIM_ENTRIES +#define NDA_MAX_TRIM_ENTRIES 256 /* Number of DSM trims to use, max 256 */ +#endif - //static int nda_retry_count = NDA_DEFAULT_RETRY; static int nda_send_ordered = NDA_DEFAULT_SEND_ORDERED; static int nda_default_timeout = NDA_DEFAULT_TIMEOUT; +static int nda_max_trim_entries = NDA_MAX_TRIM_ENTRIES; /* * All NVMe media is non-rotational, so all nvme device instances @@ -361,6 +371,9 @@ ndastrategy(struct bio *bp) return; } + if (bp->bio_cmd == BIO_DELETE) + softc->deletes++; + /* * Place it in the queue of disk activities for this disk */ @@ -401,7 +414,7 @@ ndadump(void *arg, void *virtual, vm_offset_t physical memset(&nvmeio, 0, sizeof(nvmeio)); if (length > 0) { xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - nvmeio.ccb_h.ccb_state = NDA_CCB_DUMP; + nvmeio.ccb_state = NDA_CCB_DUMP; nda_nvme_write(softc, &nvmeio, virtual, lba, length, count); error = cam_periph_runccb((union ccb *)&nvmeio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); @@ -414,7 +427,7 @@ ndadump(void *arg, void *virtual, vm_offset_t physical /* Flush */ xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - nvmeio.ccb_h.ccb_state = NDA_CCB_DUMP; + nvmeio.ccb_state = NDA_CCB_DUMP; nda_nvme_flush(softc, &nvmeio); error = cam_periph_runccb((union ccb *)&nvmeio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); @@ -610,6 +623,14 @@ ndasysctlinit(void *context, int pending) OID_AUTO, "unmapped_io", CTLFLAG_RD | CTLFLAG_MPSAFE, &softc->unmappedio, 0, "Unmapped I/O leaf"); + SYSCTL_ADD_QUAD(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "deletes", CTLFLAG_RD | CTLFLAG_MPSAFE, + &softc->deletes, "Number of BIO_DELETE requests"); + + SYSCTL_ADD_QUAD(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "dsm_req", CTLFLAG_RD | CTLFLAG_MPSAFE, + &softc->dsm_req, "Number of DSM requests sent to SIM"); + SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, @@ -902,24 +923,42 @@ ndastart(struct cam_periph *periph, union ccb *start_c } case BIO_DELETE: { - struct nvme_dsm_range *dsm_range; + struct nvme_dsm_range *dsm_range, *dsm_end; + struct nda_trim_request *trim; + struct bio *bp1; + int ents; - dsm_range = - malloc(sizeof(*dsm_range), M_NVMEDA, M_ZERO | M_NOWAIT); - if (dsm_range == NULL) { + trim = malloc(sizeof(*trim), M_NVMEDA, M_ZERO | M_NOWAIT); + if (trim == NULL) { biofinish(bp, NULL, ENOMEM); xpt_release_ccb(start_ccb); ndaschedule(periph); return; } - dsm_range->length = - htole32(bp->bio_bcount / softc->disk->d_sectorsize); - dsm_range->starting_lba = - htole64(bp->bio_offset / softc->disk->d_sectorsize); - bp->bio_driver2 = dsm_range; - nda_nvme_trim(softc, &start_ccb->nvmeio, dsm_range, 1); - start_ccb->ccb_h.ccb_state = NDA_CCB_TRIM; - start_ccb->ccb_h.flags |= CAM_UNLOCKED; + TAILQ_INIT(&trim->bps); + bp1 = bp; + ents = sizeof(trim->data) / sizeof(struct nvme_dsm_range); + ents = min(ents, nda_max_trim_entries); + dsm_range = &trim->dsm; + dsm_end = dsm_range + ents; + do { + TAILQ_INSERT_TAIL(&trim->bps, bp1, bio_queue); + dsm_range->length = + htole32(bp1->bio_bcount / softc->disk->d_sectorsize); + dsm_range->starting_lba = + htole32(bp1->bio_offset / softc->disk->d_sectorsize); + dsm_range++; + if (dsm_range >= dsm_end) + break; + bp1 = cam_iosched_next_trim(softc->cam_iosched); + /* XXX -- Could collapse adjacent ranges, but we don't for now */ + /* XXX -- Could limit based on total payload size */ + } while (bp1 != NULL); + start_ccb->ccb_trim = trim; + softc->dsm_req++; + nda_nvme_trim(softc, &start_ccb->nvmeio, &trim->dsm, + dsm_range - &trim->dsm); + start_ccb->ccb_state = NDA_CCB_TRIM; /* * Note: We can have multiple TRIMs in flight, so we don't call * cam_iosched_submit_trim(softc->cam_iosched); @@ -932,10 +971,10 @@ ndastart(struct cam_periph *periph, union ccb *start_c nda_nvme_flush(softc, nvmeio); break; } - start_ccb->ccb_h.ccb_state = NDA_CCB_BUFFER_IO; - start_ccb->ccb_h.flags |= CAM_UNLOCKED; + start_ccb->ccb_state = NDA_CCB_BUFFER_IO; + start_ccb->ccb_bp = bp; out: - start_ccb->ccb_h.ccb_bp = bp; + start_ccb->ccb_h.flags |= CAM_UNLOCKED; softc->outstanding_cmds++; softc->refcount++; cam_periph_unlock(periph); @@ -963,16 +1002,14 @@ ndadone(struct cam_periph *periph, union ccb *done_ccb CAM_DEBUG(path, CAM_DEBUG_TRACE, ("ndadone\n")); - state = nvmeio->ccb_h.ccb_state & NDA_CCB_TYPE_MASK; + state = nvmeio->ccb_state & NDA_CCB_TYPE_MASK; switch (state) { case NDA_CCB_BUFFER_IO: case NDA_CCB_TRIM: { - struct bio *bp; int error; cam_periph_lock(periph); - bp = (struct bio *)done_ccb->ccb_h.ccb_bp; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { error = ndaerror(done_ccb, 0, 0); if (error == ERESTART) { @@ -991,59 +1028,68 @@ ndadone(struct cam_periph *periph, union ccb *done_ccb panic("REQ_CMP with QFRZN"); error = 0; } - bp->bio_error = error; - if (error != 0) { - bp->bio_resid = bp->bio_bcount; - bp->bio_flags |= BIO_ERROR; - } else { - bp->bio_resid = 0; - } - if (state == NDA_CCB_TRIM) - free(bp->bio_driver2, M_NVMEDA); - softc->outstanding_cmds--; + if (state == NDA_CCB_BUFFER_IO) { + struct bio *bp; - /* - * We need to call cam_iosched before we call biodone so that we - * don't measure any activity that happens in the completion - * routine, which in the case of sendfile can be quite - * extensive. - */ - cam_iosched_bio_complete(softc->cam_iosched, bp, done_ccb); - xpt_release_ccb(done_ccb); - if (state == NDA_CCB_TRIM) { -#ifdef notyet + bp = (struct bio *)done_ccb->ccb_bp; + bp->bio_error = error; + if (error != 0) { + bp->bio_resid = bp->bio_bcount; + bp->bio_flags |= BIO_ERROR; + } else { + bp->bio_resid = 0; + } + softc->outstanding_cmds--; + + /* + * We need to call cam_iosched before we call biodone so that we + * don't measure any activity that happens in the completion + * routine, which in the case of sendfile can be quite + * extensive. + */ + cam_iosched_bio_complete(softc->cam_iosched, bp, done_ccb); + xpt_release_ccb(done_ccb); + ndaschedule(periph); + cam_periph_unlock(periph); + biodone(bp); + } else { /* state == NDA_CCB_TRIM */ + struct nda_trim_request *trim; + struct bio *bp1, *bp2; TAILQ_HEAD(, bio) queue; - struct bio *bp1; + trim = nvmeio->ccb_trim; TAILQ_INIT(&queue); - TAILQ_CONCAT(&queue, &softc->trim_req.bps, bio_queue); -#endif + TAILQ_CONCAT(&queue, &trim->bps, bio_queue); + free(trim, M_NVMEDA); + /* * Since we can have multiple trims in flight, we don't * need to call this here. * cam_iosched_trim_done(softc->cam_iosched); */ + /* + * The the I/O scheduler that we're finishing the I/O + * so we can keep book. The first one we pass in the CCB + * which has the timing information. The rest we pass in NULL + * so we can keep proper counts. + */ + bp1 = TAILQ_FIRST(&queue); + cam_iosched_bio_complete(softc->cam_iosched, bp1, done_ccb); + xpt_release_ccb(done_ccb); ndaschedule(periph); cam_periph_unlock(periph); -#ifdef notyet -/* Not yet collapsing several BIO_DELETE requests into one TRIM */ - while ((bp1 = TAILQ_FIRST(&queue)) != NULL) { - TAILQ_REMOVE(&queue, bp1, bio_queue); - bp1->bio_error = error; + while ((bp2 = TAILQ_FIRST(&queue)) != NULL) { + TAILQ_REMOVE(&queue, bp2, bio_queue); + bp2->bio_error = error; if (error != 0) { - bp1->bio_flags |= BIO_ERROR; - bp1->bio_resid = bp1->bio_bcount; + bp2->bio_flags |= BIO_ERROR; + bp2->bio_resid = bp1->bio_bcount; } else - bp1->bio_resid = 0; - biodone(bp1); + bp2->bio_resid = 0; + if (bp1 != bp2) + cam_iosched_bio_complete(softc->cam_iosched, bp2, NULL); + biodone(bp2); } -#else - biodone(bp); -#endif - } else { - ndaschedule(periph); - cam_periph_unlock(periph); - biodone(bp); } return; } Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Wed Mar 14 16:44:16 2018 (r330931) +++ head/sys/dev/nvme/nvme.h Wed Mar 14 16:44:50 2018 (r330932) @@ -484,6 +484,9 @@ struct nvme_dsm_range { uint64_t starting_lba; } __packed; +/* Largest DSM Trim that can be done */ +#define NVME_MAX_DSM_TRIM 4096 + _Static_assert(sizeof(struct nvme_dsm_range) == 16, "bad size for nvme_dsm_ranage"); /* status code types */ From owner-svn-src-head@freebsd.org Wed Mar 14 16:44:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 763D0920; Wed, 14 Mar 2018 16:44:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C88156A3BD; Wed, 14 Mar 2018 16:44:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 751F32429; Wed, 14 Mar 2018 16:44:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EGivQa046196; Wed, 14 Mar 2018 16:44:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EGivZA046195; Wed, 14 Mar 2018 16:44:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803141644.w2EGivZA046195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 14 Mar 2018 16:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330933 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 330933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 16:44:59 -0000 Author: imp Date: Wed Mar 14 16:44:57 2018 New Revision: 330933 URL: https://svnweb.freebsd.org/changeset/base/330933 Log: Fix inverted logic that counted all completions as errors, except when they were actual errors. Sponsored by: Netflix Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Wed Mar 14 16:44:50 2018 (r330932) +++ head/sys/cam/cam_iosched.c Wed Mar 14 16:44:57 2018 (r330933) @@ -1473,18 +1473,18 @@ cam_iosched_bio_complete(struct cam_iosched_softc *isc printf("done: %p %#x\n", bp, bp->bio_cmd); if (bp->bio_cmd == BIO_WRITE) { retval = cam_iosched_limiter_iodone(&isc->write_stats, bp); - if (!(bp->bio_flags & BIO_ERROR)) + if ((bp->bio_flags & BIO_ERROR) != 0) isc->write_stats.errs++; isc->write_stats.out++; isc->write_stats.pending--; } else if (bp->bio_cmd == BIO_READ) { retval = cam_iosched_limiter_iodone(&isc->read_stats, bp); - if (!(bp->bio_flags & BIO_ERROR)) + if ((bp->bio_flags & BIO_ERROR) != 0) isc->read_stats.errs++; isc->read_stats.out++; isc->read_stats.pending--; } else if (bp->bio_cmd == BIO_DELETE) { - if (!(bp->bio_flags & BIO_ERROR)) + if ((bp->bio_flags & BIO_ERROR) != 0) isc->trim_stats.errs++; isc->trim_stats.out++; isc->trim_stats.pending--; From owner-svn-src-head@freebsd.org Wed Mar 14 16:45:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2DB69C9; Wed, 14 Mar 2018 16:45:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E84A46A4BD; Wed, 14 Mar 2018 16:45:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CB26242A; Wed, 14 Mar 2018 16:45:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EGj4Fk046264; Wed, 14 Mar 2018 16:45:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EGj41j046263; Wed, 14 Mar 2018 16:45:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803141645.w2EGj41j046263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 14 Mar 2018 16:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330934 - head/sys/modules/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/modules/cam X-SVN-Commit-Revision: 330934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 16:45:07 -0000 Author: imp Date: Wed Mar 14 16:45:04 2018 New Revision: 330934 URL: https://svnweb.freebsd.org/changeset/base/330934 Log: This should have been += so clean builds work. Noticed by: hps@ Modified: head/sys/modules/cam/Makefile Modified: head/sys/modules/cam/Makefile ============================================================================== --- head/sys/modules/cam/Makefile Wed Mar 14 16:44:57 2018 (r330933) +++ head/sys/modules/cam/Makefile Wed Mar 14 16:45:04 2018 (r330934) @@ -8,7 +8,7 @@ KMOD= cam # See sys/conf/options for the flags that go into the different opt_*.h files. SRCS= opt_cam.h -SRCS= opt_compat.h +SRCS+= opt_compat.h SRCS+= opt_ada.h SRCS+= opt_scsi.h SRCS+= opt_cd.h From owner-svn-src-head@freebsd.org Wed Mar 14 17:08:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D584F2B64A; Wed, 14 Mar 2018 17:08:29 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from pv33p00im-asmtp001.me.com (pv33p00im-asmtp001.me.com [17.142.194.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B86B36B818; Wed, 14 Mar 2018 17:08:28 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.pv33p00im-asmtp001.me.com by pv33p00im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P5L00900BCHI700@pv33p00im-asmtp001.me.com>; Wed, 14 Mar 2018 17:08:17 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1521047297; bh=TAXoB+StXcej1KkQol0X9tJkrakNsRmANZ096y7v8Nw=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=hCRjya7ZjDNpunqNuKMjXt0X/C4GzVY6Uud2kaBuebx4bIlIor8iMK409YypIlzlV P5O1SN4cHrKDvEvbrCQuQ8ikeh3Q4GZpHqJXbc00mnflGR9AUsLl6o/7z5+3YU0v0h /NjABRr586oq2P1DIT0gBARBODs6MuWQHvFvOjtu8MKq2VIIACHtdRDZLHEIVNZXPq WzAgElIIUy/2eQpbEpirndNzDCCqOGqJ5Afl/MHOVrhicATH8bkC1wybcW1rN80N4n RwYtM6rv4COGMrnvLsgNAXo4zm6x2vqeZt2LZsfqRJXmAKudJbLQpDT2prYKILBBXb wQWRbrLofi56g== Received: from icloud.com ([127.0.0.1]) by pv33p00im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P5L00OKUBLQ4330@pv33p00im-asmtp001.me.com>; Wed, 14 Mar 2018 17:08:15 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-14_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1803140191 User-Agent: Microsoft-MacOutlook/10.a.0.180210 Date: Wed, 14 Mar 2018 10:08:13 -0700 Subject: Re: svn commit: r330932 - in head/sys: cam/nvme dev/nvme From: Ravi Pokala To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <22796282-7844-4E9A-AC32-10B09822FD25@mac.com> Thread-topic: svn commit: r330932 - in head/sys: cam/nvme dev/nvme References: <201803141644.w2EGioti046140@repo.freebsd.org> In-reply-to: <201803141644.w2EGioti046140@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 17:08:29 -0000 Hi Warner, The TRIM command takes a buffer of range structures, and this change consol= idates multiple range structures into the buffer for a single TRIM command, = correct? Whereas the old functionality was to populate the buffer with a sin= gle range structure? So if we wanted to trim ranges [P..T], [A..E], [K..O], the old functionalit= y would be: TRIM:[P..T] ; TRIM:[A..E] ; TRIM:[K..O] The new functionality would be: TRIM:[P..T], [A..E], [K..O] Right? > + /* XXX -- Could collapse adjacent ranges, but we don't for now */ > + /* XXX -- Could limit based on total payload size */ And that future enhancement would make it: TRIM:[A..E], [K..T] Is that correct? Thanks, Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Warner Losh Date: 2018-03-14, Wednesday at 09:44 To: , , Subject: svn commit: r330932 - in head/sys: cam/nvme dev/nvme > Author: imp > Date: Wed Mar 14 16:44:50 2018 > New Revision: 330932 > URL: https://svnweb.freebsd.org/changeset/base/330932 >=20 > Log: > Implement trim collapsing in nda > =20 > When multiple trims are in the queue, collapse them as much as > possible. At present, this usually results in only a few trims being > collapsed together, but more work on that will make it possible to do > hundreds (up to some configurable max). > =20 > Sponsored by: Netflix From owner-svn-src-head@freebsd.org Wed Mar 14 17:16:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEA12F2C02E for ; Wed, 14 Mar 2018 17:16:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 635C96BE7D for ; Wed, 14 Mar 2018 17:16:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id l12so5226610ioc.10 for ; Wed, 14 Mar 2018 10:16:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=qMy42KClhMDzjHxMoAr4dnI+vIVkfLrBRK6G0cbiiZs=; b=ldERe3k2XvDyI5jbg8IVce4kz/LOXIJO9PffmP3mERf2e5NOmsMfbXOY/PnWXU0Dia 2wjfiB7Wwczf6uLDgEuFkXWnHYdRPlkzQ5B/VcFgG1IMuqlIcI3Y7PD4QdM1Ie8PNqXe tZUhi+p+acFJZIcuuOJH2psa5DUFi0+UAd2oMAIpP0wlu345zs6bUHMHrOc+QDkbG6ZU k1SOvoiWnh49BCrPmlnRvcWyfStkeQKCb3NUWgyT3WvnRrKiE9s1Xb937OYZ3WoE3Eku Cfu86aKZ9+Y7b2108zznvDOgvglz2xcys8xsA1Y6vdRpOf2Ir+U89Q7eBywjrDmkKUJ3 Q+UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=qMy42KClhMDzjHxMoAr4dnI+vIVkfLrBRK6G0cbiiZs=; b=Qlo0wRS2ml+mNtXhfD+jEEi4uqTH7UpxmaNHh+/g+DrIO/eWr1knZ1w3RdWBlPTKEy Etz/sjeXpWNHIW7P74j2gY329DgMEj/0/2D/a3gGUCmxjqh/JhKHPxQzvQ1VpX46EdzJ QJ5O/P0dWnpgGk8u2DddCZtqBgUamOOkNu/zOvYjeU2uekQ9p5NBbU4/Hbd3IUcFCzKX n78wFOpnWx2y4Icj4XCmpnG3Q+QwbXSznSgQ22rZhII/J5yeOyKiPmmdCbRefMd2IczY 5enhaQZE4HR9P5S58XzIjWt+yzeHukbWqXYD8t1wVNdOE96c2KlfgGHiKBcHkzcMac3d Hjjw== X-Gm-Message-State: AElRT7HLg3I0ax49T6EeOuVzs5wp/4FGOO14qhNaZ7rcPnOW7zH3EO+m /BP/BluloJRQhibuEFoOoc2EE7jhX5m5rTSJBXFaIw== X-Google-Smtp-Source: AG47ELt9KF4HfadbqSET7nCzhfLO/0FcWX6Dy2d0jgfMK8lJ9KuGbnd7wUY+FJej5h9w4eYLFJbvtjcfW5hl3jamzgE= X-Received: by 10.107.18.162 with SMTP id 34mr5522556ios.168.1521047817533; Wed, 14 Mar 2018 10:16:57 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Wed, 14 Mar 2018 10:16:56 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <22796282-7844-4E9A-AC32-10B09822FD25@mac.com> References: <201803141644.w2EGioti046140@repo.freebsd.org> <22796282-7844-4E9A-AC32-10B09822FD25@mac.com> From: Warner Losh Date: Wed, 14 Mar 2018 11:16:56 -0600 X-Google-Sender-Auth: Nt8IVSvNg4Q03LsHOdK3LDq6Cas Message-ID: Subject: Re: svn commit: r330932 - in head/sys: cam/nvme dev/nvme To: Ravi Pokala Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 17:16:59 -0000 On Wed, Mar 14, 2018 at 11:08 AM, Ravi Pokala wrote: > Hi Warner, > > The TRIM command takes a buffer of range structures, and this change > consolidates multiple range structures into the buffer for a single TRIM > command, correct? Whereas the old functionality was to populate the buffe= r > with a single range structure? > > So if we wanted to trim ranges [P..T], [A..E], [K..O], the old > functionality would be: > > TRIM:[P..T] ; TRIM:[A..E] ; TRIM:[K..O] > > The new functionality would be: > > TRIM:[P..T], [A..E], [K..O] > > Right? Correct. This helps a lot, at least for the drives I have access to. I'm working on adaptive features to allow us to know when it will help. > + /* XXX -- Could collapse adjacent ranges, > but we don't for now */ > > + /* XXX -- Could limit based on total > payload size */ > > And that future enhancement would make it: > > TRIM:[A..E], [K..T] > > Is that correct? > Yes. That's right. This code doesn't do that now. We also need to work on read biasing and a few other things as well, independent of what we send down to the driver. That's the scheduling bits. Some of the dynamic stuff will be only in the dynamic scheduler, but we need to not do trims first. I think that a strategy of collecting N BIO_DELETEs before we send down the DSM TRIM to the drive rather than sending them down asap would be useful (with some reasonable timeout so things don't get stuck for too long). Collecting TRIMs don't hang anything in the system, except reclaiming blocks on delete, as far as I can tell... I accidentally queued 10M trims and didn't drain them for 8 hours w/o anybody but the graphs for the machine that report queue length noticing... Warner > Thanks, > > Ravi (rpokala@) > > =EF=BB=BF-----Original Message----- > From: on behalf of Warner Losh > > Date: 2018-03-14, Wednesday at 09:44 > To: , , < > svn-src-head@freebsd.org> > Subject: svn commit: r330932 - in head/sys: cam/nvme dev/nvme > > > Author: imp > > Date: Wed Mar 14 16:44:50 2018 > > New Revision: 330932 > > URL: https://svnweb.freebsd.org/changeset/base/330932 > > > > Log: > > Implement trim collapsing in nda > > > > When multiple trims are in the queue, collapse them as much as > > possible. At present, this usually results in only a few trims being > > collapsed together, but more work on that will make it possible to do > > hundreds (up to some configurable max). > > > > Sponsored by: Netflix > > > > From owner-svn-src-head@freebsd.org Wed Mar 14 17:22:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8433AF2C867; Wed, 14 Mar 2018 17:22:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92CEB6C45B; Wed, 14 Mar 2018 17:22:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id DD6FF10AC13; Wed, 14 Mar 2018 13:22:29 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330884 - in head/sys: dev/cxgbe dev/cxgbe/firmware dev/cxgbe/tom modules/cxgbe/tom Date: Tue, 13 Mar 2018 17:06:12 -0700 Message-ID: <2410730.L0NrraExMU@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201803132305.w2DN5pnc010768@repo.freebsd.org> References: <201803132305.w2DN5pnc010768@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 14 Mar 2018 13:22:30 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 17:22:31 -0000 On Tuesday, March 13, 2018 11:05:51 PM John Baldwin wrote: > Author: jhb > Date: Tue Mar 13 23:05:51 2018 > New Revision: 330884 > URL: https://svnweb.freebsd.org/changeset/base/330884 > > Log: > Support for TLS offload of TOE connections on T6 adapters. > > The TOE engine in Chelsio T6 adapters supports offloading of TLS > encryption and TCP segmentation for offloaded connections. Sockets > using TLS are required to use a set of custom socket options to upload > RX and TX keys to the NIC and to enable RX processing. Currently > these socket options are implemented as TCP options in the vendor > specific range. A patched OpenSSL library will be made available in a > port / package for use with the TLS TOE support. Note that making use of this requires a patched SSL library. There is not yet a port for one, but I'm working with brnrd@ to make a package of a patched OpenSSL. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Mar 14 17:53:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5600F2FE0F; Wed, 14 Mar 2018 17:53:13 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EAAD6DBC5; Wed, 14 Mar 2018 17:53:12 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from helicon.physics.ucla.edu (helicon.physics.ucla.edu [169.232.156.253]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w2EHr4NC030327 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 14 Mar 2018 10:53:04 -0700 Subject: Re: svn commit: r330930 - head/sys/conf To: Justin Hibbits Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803141616.w2EGGPOp030624@repo.freebsd.org> From: Nathan Whitehorn Message-ID: <76363d7d-e21d-6e97-f638-855342242422@freebsd.org> Date: Wed, 14 Mar 2018 10:53:04 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVYJY8NSNe1sKCX5bG0mM0HMZEChF7BWn9n9PE5RtekAM/3R7KkabCPAerVHR7eQ/cbD4Hm8z2RMhZUmQhiYnehOKgFefpqWCwI= X-Sonic-ID: C;GtSbi7An6BGjDyAFsE207w== M;LI3Vi7An6BGjDyAFsE207w== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 17:53:13 -0000 On 03/14/18 09:19, Justin Hibbits wrote: > On Wed, Mar 14, 2018 at 11:16 AM, Nathan Whitehorn > wrote: >> Author: nwhitehorn >> Date: Wed Mar 14 16:16:25 2018 >> New Revision: 330930 >> URL: https://svnweb.freebsd.org/changeset/base/330930 >> >> Log: >> The expression (aim | fdt) is always true on PowerPC. The last PowerPC >> platform that can run without a device tree (PS3) still uses the OF_*() >> functions to check if one exists and OF_* is used unconditionally in >> core parts of the system like powerpc/machdep.c. Reflect this reality >> in files.powerpc, for example by changing occurrences of aim | fdt to >> standard. >> >> Modified: >> head/sys/conf/files.powerpc >> >> Modified: head/sys/conf/files.powerpc >> ============================================================================== >> --- head/sys/conf/files.powerpc Wed Mar 14 14:45:57 2018 (r330929) >> +++ head/sys/conf/files.powerpc Wed Mar 14 16:16:25 2018 (r330930) >> @@ -32,7 +32,7 @@ dev/adb/adb_buttons.c optional adb >> dev/agp/agp_apple.c optional agp powermac >> dev/fb/fb.c optional sc >> # ofwbus depends on simplebus. >> -dev/fdt/simplebus.c optional aim | fdt >> +dev/fdt/simplebus.c optional standard >> dev/hwpmc/hwpmc_e500.c optional hwpmc >> dev/hwpmc/hwpmc_mpc7xxx.c optional hwpmc >> dev/hwpmc/hwpmc_powerpc.c optional hwpmc >> @@ -55,7 +55,7 @@ dev/ofw/ofw_if.m optional aim >> dev/ofw/ofw_bus_subr.c optional aim >> dev/ofw/ofw_console.c optional aim >> dev/ofw/ofw_disk.c optional ofwd aim >> -dev/ofw/ofwbus.c optional aim | fdt >> +dev/ofw/ofwbus.c optional aim > ofwbus is used by Book-E too, not just AIM. And 'aim' is not defined > for Book-E platforms. Maybe it should be 'standard' instead? > > - Justin > See the comment above this line (which isn't in the diff): ofwbus.c can also be brought in by conf/files through the definition of options FDT. This block is just a safety valve for (AIM && !FDT) to make sure we always get it. We could also mark all of these standard; config is smart enough to deduplicate things. Would you prefer that? -Nathan From owner-svn-src-head@freebsd.org Wed Mar 14 17:53:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2731F2FEB5; Wed, 14 Mar 2018 17:53:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1E36DD09; Wed, 14 Mar 2018 17:53:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46FFB2F27; Wed, 14 Mar 2018 17:53:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EHrc7n081238; Wed, 14 Mar 2018 17:53:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EHrbrE081231; Wed, 14 Mar 2018 17:53:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803141753.w2EHrbrE081231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 14 Mar 2018 17:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330935 - in head/sys: cam cam/ata cam/nvme cam/scsi conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: cam cam/ata cam/nvme cam/scsi conf X-SVN-Commit-Revision: 330935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 17:53:38 -0000 Author: imp Date: Wed Mar 14 17:53:37 2018 New Revision: 330935 URL: https://svnweb.freebsd.org/changeset/base/330935 Log: Create a sysctl kern.cam.{,a,n}da.X.invalidate kern.cam.{,a,n}da.X.invalidate=1 forces *daX to detach by calling cam_periph_invalidate on the underlying periph. This is for testing purposes only. Include only with options CAM_TEST_FAILURE and rename the former [AN]DA_TEST_FAILURE, and fix nda to compile with it set. We're using it at work to harden geom and the buffer cache to be resilient in the face of drive failure. Today, it far too often results in a panic. While much work was done on SIM initiated removal for the USB thumnb drive removal work, little has been done for periph initiated removal. This simulates what *daerror() does for some errors nicely: we get the same panics with it that we do with failing drives. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D14581 Modified: head/sys/cam/ata/ata_da.c head/sys/cam/cam_periph.c head/sys/cam/cam_periph.h head/sys/cam/nvme/nvme_da.c head/sys/cam/scsi/scsi_da.c head/sys/conf/NOTES head/sys/conf/options Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Wed Mar 14 16:45:04 2018 (r330934) +++ head/sys/cam/ata/ata_da.c Wed Mar 14 17:53:37 2018 (r330935) @@ -238,7 +238,7 @@ struct ada_softc { int write_cache; int unmappedio; int rotating; -#ifdef ADA_TEST_FAILURE +#ifdef CAM_TEST_FAILURE int force_read_error; int force_write_error; int periodic_read_error; @@ -1475,7 +1475,7 @@ adasysctlinit(void *context, int pending) "max_seq_zones", CTLFLAG_RD, &softc->max_seq_zones, "Maximum Number of Open Sequential Write Required Zones"); -#ifdef ADA_TEST_FAILURE +#ifdef CAM_TEST_FAILURE /* * Add a 'door bell' sysctl which allows one to set it from userland * and cause something bad to happen. For the moment, we only allow @@ -1493,6 +1493,10 @@ adasysctlinit(void *context, int pending) OID_AUTO, "periodic_read_error", CTLFLAG_RW | CTLFLAG_MPSAFE, &softc->periodic_read_error, 0, "Force a read error every N reads (don't set too low)."); + SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "invalidate", CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, + periph, 0, cam_periph_invalidate_sysctl, "I", + "Write 1 to invalidate the drive immediately"); #endif #ifdef CAM_IO_STATS @@ -2293,7 +2297,7 @@ adastart(struct cam_periph *periph, union ccb *start_c data_ptr = bp; } -#ifdef ADA_TEST_FAILURE +#ifdef CAM_TEST_FAILURE int fail = 0; /* Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Wed Mar 14 16:45:04 2018 (r330934) +++ head/sys/cam/cam_periph.c Wed Mar 14 17:53:37 2018 (r330935) @@ -2066,3 +2066,25 @@ cam_periph_devctl_notify(union ccb *ccb) free(sbmsg, M_CAMPERIPH); } +/* + * Sysctl to force an invalidation of the drive right now. Can be + * called with CTLFLAG_MPSAFE since we take periph lock. + */ +int +cam_periph_invalidate_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct cam_periph *periph; + int error, value; + + periph = arg1; + value = 0; + error = sysctl_handle_int(oidp, &value, 0, req); + if (error != 0 || req->newptr == NULL || value != 1) + return (error); + + cam_periph_lock(periph); + cam_periph_invalidate(periph); + cam_periph_unlock(periph); + + return (0); +} Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Wed Mar 14 16:45:04 2018 (r330934) +++ head/sys/cam/cam_periph.h Wed Mar 14 17:53:37 2018 (r330935) @@ -37,6 +37,7 @@ #include #ifdef _KERNEL +#include #include #include @@ -198,6 +199,7 @@ void cam_periph_freeze_after_event(struct cam_periph u_int duration_ms); int cam_periph_error(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags); +int cam_periph_invalidate_sysctl(SYSCTL_HANDLER_ARGS); static __inline struct mtx * cam_periph_mtx(struct cam_periph *periph) Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Wed Mar 14 16:45:04 2018 (r330934) +++ head/sys/cam/nvme/nvme_da.c Wed Mar 14 17:53:37 2018 (r330935) @@ -112,6 +112,12 @@ struct nda_softc { struct task sysctl_task; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; +#ifdef CAM_TEST_FAILURE + int force_read_error; + int force_write_error; + int periodic_read_error; + int periodic_read_count; +#endif #ifdef CAM_IO_STATS struct sysctl_ctx_list sysctl_stats_ctx; struct sysctl_oid *sysctl_stats_tree; @@ -666,6 +672,13 @@ ndasysctlinit(void *context, int pending) "Device pack invalidations."); #endif +#ifdef CAM_TEST_FAILURE + SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "invalidate", CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, + periph, 0, cam_periph_invalidate_sysctl, "I", + "Write 1 to invalidate the drive immediately"); +#endif + cam_iosched_sysctl_init(softc->cam_iosched, &softc->sysctl_ctx, softc->sysctl_tree); @@ -876,7 +889,7 @@ ndastart(struct cam_periph *periph, union ccb *start_c /* FALLTHROUGH */ case BIO_READ: { -#ifdef NDA_TEST_FAILURE +#ifdef CAM_TEST_FAILURE int fail = 0; /* Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Mar 14 16:45:04 2018 (r330934) +++ head/sys/cam/scsi/scsi_da.c Wed Mar 14 17:53:37 2018 (r330935) @@ -2203,6 +2203,13 @@ dasysctlinit(void *context, int pending) 0, "Rotating media"); +#ifdef CAM_TEST_FAILURE + SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "invalidate", CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, + periph, 0, cam_periph_invalidate_sysctl, "I", + "Write 1 to invalidate the drive immediately"); +#endif + /* * Add some addressing info. */ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Mar 14 16:45:04 2018 (r330934) +++ head/sys/conf/NOTES Wed Mar 14 17:53:37 2018 (r330935) @@ -1356,6 +1356,7 @@ options SCSI_NO_SENSE_STRINGS options SCSI_NO_OP_STRINGS options SCSI_DELAY=5000 # Be pessimistic about Joe SCSI device options CAM_IOSCHED_DYNAMIC +options CAM_TEST_FAILURE # Options for the CAM CDROM driver: # CHANGER_MIN_BUSY_SECONDS: Guaranteed minimum time quantum for a changer LUN Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Mar 14 16:45:04 2018 (r330934) +++ head/sys/conf/options Wed Mar 14 17:53:37 2018 (r330935) @@ -335,12 +335,12 @@ CAM_DEBUG_LUN opt_cam.h CAM_DEBUG_FLAGS opt_cam.h CAM_BOOT_DELAY opt_cam.h CAM_IOSCHED_DYNAMIC opt_cam.h +CAM_TEST_FAILURE opt_cam.h SCSI_DELAY opt_scsi.h SCSI_NO_SENSE_STRINGS opt_scsi.h SCSI_NO_OP_STRINGS opt_scsi.h # Options used only in cam/ata/ata_da.c -ADA_TEST_FAILURE opt_ada.h ATA_STATIC_ID opt_ada.h # Options used only in cam/scsi/scsi_cd.c From owner-svn-src-head@freebsd.org Wed Mar 14 17:59:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 980F3F30512; Wed, 14 Mar 2018 17:59:04 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf0-x244.google.com (mail-lf0-x244.google.com [IPv6:2a00:1450:4010:c07::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2DE26E090; Wed, 14 Mar 2018 17:59:03 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf0-x244.google.com with SMTP id m69-v6so6126619lfe.8; Wed, 14 Mar 2018 10:59:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=XdmrOrzpJJzHOkbpFJMbhkZdJa1tVZnL8eo6Uq/nNPg=; b=jcH+GRf9RJkAI4xT5E/Re7kOvDh/caXBstb6OfMbmtdAxqY4x+GpmHr48tqVjbzSq1 h+nx8w+G70iCOivjQTtLsU9xSDoWLuUn78FJEjCauKalfrzkeIWARR2kOVLhy/OUEUrS jN60qS6t+Zfm4AarlfP7M+9ATbY7AJLEr4TrNpVl9OA+wZJ2MjciWTwLf+omNAYYJLIm bZT1y23jpeyjMnPdMVyKXR8i6i7ko4NGoTyZLC6vsi46krhvBccNr/WO2eK3J+76Augh zSfXTif3Z0nsYuLhgD218Pwbbb6w0T19atF5AJdPV6HiqxQTjmJxV1aFMt3gVdzAmD9j Nu5Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alumni-cwru-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=XdmrOrzpJJzHOkbpFJMbhkZdJa1tVZnL8eo6Uq/nNPg=; b=VjBsGbfj34gG782usEhA3/Qv59avXJvoO31dGne3YitEk2m7HxOZf+M9E9NYYYYf3H C5A0WoZ/yAUKttnHZlfqqmR0Qblxha7SSn4nrA8k5mkZGBuOyiu5fexmhp+G6NeukLih e5DTVbgiQp68RrziIyru4ZG5Io9qDf5p3oWMkJdX9KJnGSLhmVOgBaNGKuXOtUwjXGwm JO8HV1stqd2T6TuSWbQL+qZG99DoWNYx5xI90ISEGd2EnR1eqSpzTmbiq5Kf0Zi4aStr uojHiakN9Fr/kUFcECQXIWt5h0blmANvrFCbTh0L27YcLjYceaWJ4m+mYh6kwJd+Bv7s aaHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=XdmrOrzpJJzHOkbpFJMbhkZdJa1tVZnL8eo6Uq/nNPg=; b=adYZWfaKyZipXPzqGdj4ve3wT+mDT7bwt5EZDyVbg16S6+RLP8jOVa8GYx+f/cKeSD ZpeTrPpyu3+E/S5uzn1AG0GsgR5W1DfyCQ85OE+EO5YmNciBoO2/qigQ/4dZL04xhvfr JBgjd1+UseqyYqkTkNPq/p/XnUNmUMZ7VG5ubql5uuL5TZhH63DKy2LRl3YeVjqxfdKq 4KWo+sCUxhtWRD3Z9HOuurRix7lNa25TEC8NGunh5hj7gg95BfPTJXroIv7ttK64GKh7 LdrT4Gi6/ty/JvLopl5/asvO0AGj3OxHK6f+tUvJBRzdwBtzSXSJb4FjJb8+f6IJff27 nfIw== X-Gm-Message-State: AElRT7Fp79jzc1MfErXcd9cVo3LOkSLHvhK/qtzdCApuiOQb7YYkOO/V jZzqIOON038DsTMfo+9+oZwVPuXIpEqygv866eE= X-Google-Smtp-Source: AG47ELvraFY6hvsezWueB+nDjFWlrxBi+SKr5aIzhFB+dcMLBfi37d7U7yvzxMdYfLUh7wV7nHIvGAq2NIo0Ac7Sa1k= X-Received: by 2002:a19:d5c2:: with SMTP id m185-v6mr3929104lfg.5.1521050342157; Wed, 14 Mar 2018 10:59:02 -0700 (PDT) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.46.85.26 with HTTP; Wed, 14 Mar 2018 10:59:01 -0700 (PDT) In-Reply-To: <76363d7d-e21d-6e97-f638-855342242422@freebsd.org> References: <201803141616.w2EGGPOp030624@repo.freebsd.org> <76363d7d-e21d-6e97-f638-855342242422@freebsd.org> From: Justin Hibbits Date: Wed, 14 Mar 2018 12:59:01 -0500 X-Google-Sender-Auth: TZxz2Djoflh2Ellbx8IwiubujVM Message-ID: Subject: Re: svn commit: r330930 - head/sys/conf To: Nathan Whitehorn Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 17:59:04 -0000 On Wed, Mar 14, 2018 at 12:53 PM, Nathan Whitehorn wrote: > > > On 03/14/18 09:19, Justin Hibbits wrote: >> >> On Wed, Mar 14, 2018 at 11:16 AM, Nathan Whitehorn >> wrote: >>> >>> Author: nwhitehorn >>> Date: Wed Mar 14 16:16:25 2018 >>> New Revision: 330930 >>> URL: https://svnweb.freebsd.org/changeset/base/330930 >>> >>> Log: >>> The expression (aim | fdt) is always true on PowerPC. The last PowerPC >>> platform that can run without a device tree (PS3) still uses the >>> OF_*() >>> functions to check if one exists and OF_* is used unconditionally in >>> core parts of the system like powerpc/machdep.c. Reflect this reality >>> in files.powerpc, for example by changing occurrences of aim | fdt to >>> standard. >>> >>> Modified: >>> head/sys/conf/files.powerpc >>> >>> Modified: head/sys/conf/files.powerpc >>> >>> ============================================================================== >>> --- head/sys/conf/files.powerpc Wed Mar 14 14:45:57 2018 (r330929) >>> +++ head/sys/conf/files.powerpc Wed Mar 14 16:16:25 2018 (r330930) >>> @@ -32,7 +32,7 @@ dev/adb/adb_buttons.c optional adb >>> dev/agp/agp_apple.c optional agp powermac >>> dev/fb/fb.c optional sc >>> # ofwbus depends on simplebus. >>> -dev/fdt/simplebus.c optional aim | fdt >>> +dev/fdt/simplebus.c optional standard >>> dev/hwpmc/hwpmc_e500.c optional hwpmc >>> dev/hwpmc/hwpmc_mpc7xxx.c optional hwpmc >>> dev/hwpmc/hwpmc_powerpc.c optional hwpmc >>> @@ -55,7 +55,7 @@ dev/ofw/ofw_if.m optional aim >>> dev/ofw/ofw_bus_subr.c optional aim >>> dev/ofw/ofw_console.c optional aim >>> dev/ofw/ofw_disk.c optional ofwd aim >>> -dev/ofw/ofwbus.c optional aim | fdt >>> +dev/ofw/ofwbus.c optional aim >> >> ofwbus is used by Book-E too, not just AIM. And 'aim' is not defined >> for Book-E platforms. Maybe it should be 'standard' instead? >> >> - Justin >> > > See the comment above this line (which isn't in the diff): ofwbus.c can also > be brought in by conf/files through the definition of options FDT. This > block is just a safety valve for (AIM && !FDT) to make sure we always get > it. We could also mark all of these standard; config is smart enough to > deduplicate things. Would you prefer that? > -Nathan > Just mark them standard, since they are really standard. - Justin From owner-svn-src-head@freebsd.org Wed Mar 14 18:07:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9519F30FE2; Wed, 14 Mar 2018 18:07:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 527BB6E68B; Wed, 14 Mar 2018 18:07:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EE8430A2; Wed, 14 Mar 2018 18:07:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EI7fjM086348; Wed, 14 Mar 2018 18:07:41 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EI7fd6086347; Wed, 14 Mar 2018 18:07:41 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201803141807.w2EI7fd6086347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Wed, 14 Mar 2018 18:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330936 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 330936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 18:07:41 -0000 Author: nwhitehorn Date: Wed Mar 14 18:07:40 2018 New Revision: 330936 URL: https://svnweb.freebsd.org/changeset/base/330936 Log: Fix fat-fingering ("optional standard") and move all the OF code to being marked "standard", which is less confusing than having it conditional on AIM CPUs here, and then picked up through options FDT from conf/files on Book-E. Request by: jhibbits Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Wed Mar 14 17:53:37 2018 (r330935) +++ head/sys/conf/files.powerpc Wed Mar 14 18:07:40 2018 (r330936) @@ -31,8 +31,6 @@ dev/adb/adb_if.m optional adb dev/adb/adb_buttons.c optional adb dev/agp/agp_apple.c optional agp powermac dev/fb/fb.c optional sc -# ofwbus depends on simplebus. -dev/fdt/simplebus.c optional standard dev/hwpmc/hwpmc_e500.c optional hwpmc dev/hwpmc/hwpmc_mpc7xxx.c optional hwpmc dev/hwpmc/hwpmc_powerpc.c optional hwpmc @@ -46,19 +44,21 @@ dev/iicbus/max6690.c optional max6690 powermac dev/iicbus/ofw_iicbus.c optional iicbus aim dev/nand/nfc_fsl.c optional nand mpc85xx dev/nand/nfc_rb.c optional nand mpc85xx -# ofw can be either aim or fdt: fdt case handled in files. aim only powerpc specific. -dev/ofw/openfirm.c optional aim -dev/ofw/openfirmio.c optional aim -dev/ofw/ofw_bus_if.m optional aim -dev/ofw/ofw_cpu.c optional aim -dev/ofw/ofw_if.m optional aim -dev/ofw/ofw_bus_subr.c optional aim +# Most ofw stuff below is brought in by conf/files for options FDT, but +# we always want it, even on non-FDT platforms. +dev/fdt/simplebus.c standard +dev/ofw/openfirm.c standard +dev/ofw/openfirmio.c standard +dev/ofw/ofw_bus_if.m standard +dev/ofw/ofw_cpu.c standard +dev/ofw/ofw_if.m standard +dev/ofw/ofw_bus_subr.c standard dev/ofw/ofw_console.c optional aim dev/ofw/ofw_disk.c optional ofwd aim -dev/ofw/ofwbus.c optional aim +dev/ofw/ofwbus.c standard dev/ofw/ofwpci.c optional pci dev/ofw/ofw_standard.c optional aim powerpc -dev/ofw/ofw_subr.c optional aim powerpc +dev/ofw/ofw_subr.c standard dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac dev/quicc/quicc_bfe_fdt.c optional quicc mpc85xx dev/scc/scc_bfe_macio.c optional scc powermac From owner-svn-src-head@freebsd.org Wed Mar 14 18:09:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79D19F3122A; Wed, 14 Mar 2018 18:09:26 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 159EE6E829; Wed, 14 Mar 2018 18:09:25 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from helicon.physics.ucla.edu (helicon.physics.ucla.edu [169.232.156.253]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w2EI9Mjq017291 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 14 Mar 2018 11:09:22 -0700 Subject: Re: svn commit: r330930 - head/sys/conf To: Justin Hibbits Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803141616.w2EGGPOp030624@repo.freebsd.org> <76363d7d-e21d-6e97-f638-855342242422@freebsd.org> From: Nathan Whitehorn Message-ID: Date: Wed, 14 Mar 2018 11:09:22 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVZ7CsFEyoWlPb5mGuKNwH6UkUu9u07UB9l3eLB62j5Mh7qfvBNsooq3pemaS12XjsteutfQo341ezcAmD6VymIBJo3IrymDXBc= X-Sonic-ID: C;ym5T0rIn6BGnfCAFsE207w== M;fkp40rIn6BGnfCAFsE207w== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 18:09:26 -0000 On 03/14/18 10:59, Justin Hibbits wrote: > On Wed, Mar 14, 2018 at 12:53 PM, Nathan Whitehorn > wrote: >> >> On 03/14/18 09:19, Justin Hibbits wrote: >>> On Wed, Mar 14, 2018 at 11:16 AM, Nathan Whitehorn >>> wrote: >>>> Author: nwhitehorn >>>> Date: Wed Mar 14 16:16:25 2018 >>>> New Revision: 330930 >>>> URL: https://svnweb.freebsd.org/changeset/base/330930 >>>> >>>> Log: >>>> The expression (aim | fdt) is always true on PowerPC. The last PowerPC >>>> platform that can run without a device tree (PS3) still uses the >>>> OF_*() >>>> functions to check if one exists and OF_* is used unconditionally in >>>> core parts of the system like powerpc/machdep.c. Reflect this reality >>>> in files.powerpc, for example by changing occurrences of aim | fdt to >>>> standard. >>>> >>>> Modified: >>>> head/sys/conf/files.powerpc >>>> >>>> Modified: head/sys/conf/files.powerpc >>>> >>>> ============================================================================== >>>> --- head/sys/conf/files.powerpc Wed Mar 14 14:45:57 2018 (r330929) >>>> +++ head/sys/conf/files.powerpc Wed Mar 14 16:16:25 2018 (r330930) >>>> @@ -32,7 +32,7 @@ dev/adb/adb_buttons.c optional adb >>>> dev/agp/agp_apple.c optional agp powermac >>>> dev/fb/fb.c optional sc >>>> # ofwbus depends on simplebus. >>>> -dev/fdt/simplebus.c optional aim | fdt >>>> +dev/fdt/simplebus.c optional standard >>>> dev/hwpmc/hwpmc_e500.c optional hwpmc >>>> dev/hwpmc/hwpmc_mpc7xxx.c optional hwpmc >>>> dev/hwpmc/hwpmc_powerpc.c optional hwpmc >>>> @@ -55,7 +55,7 @@ dev/ofw/ofw_if.m optional aim >>>> dev/ofw/ofw_bus_subr.c optional aim >>>> dev/ofw/ofw_console.c optional aim >>>> dev/ofw/ofw_disk.c optional ofwd aim >>>> -dev/ofw/ofwbus.c optional aim | fdt >>>> +dev/ofw/ofwbus.c optional aim >>> ofwbus is used by Book-E too, not just AIM. And 'aim' is not defined >>> for Book-E platforms. Maybe it should be 'standard' instead? >>> >>> - Justin >>> >> See the comment above this line (which isn't in the diff): ofwbus.c can also >> be brought in by conf/files through the definition of options FDT. This >> block is just a safety valve for (AIM && !FDT) to make sure we always get >> it. We could also mark all of these standard; config is smart enough to >> deduplicate things. Would you prefer that? >> -Nathan >> > Just mark them standard, since they are really standard. > > - Justin > Done in r330936. -Nathan From owner-svn-src-head@freebsd.org Wed Mar 14 18:27:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F094F32DD7; Wed, 14 Mar 2018 18:27:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0E276FF48; Wed, 14 Mar 2018 18:27:06 +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 E7D3133CB; Wed, 14 Mar 2018 18:27:06 +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 w2EIR6PL098043; Wed, 14 Mar 2018 18:27:06 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EIR6U8098042; Wed, 14 Mar 2018 18:27:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201803141827.w2EIR6U8098042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 14 Mar 2018 18:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330937 - head/sys/dev/iscsi X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/iscsi X-SVN-Commit-Revision: 330937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 18:27:07 -0000 Author: trasz Date: Wed Mar 14 18:27:06 2018 New Revision: 330937 URL: https://svnweb.freebsd.org/changeset/base/330937 Log: Fix typo in a warning message. MFC after: 2 weeks Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Wed Mar 14 18:07:40 2018 (r330936) +++ head/sys/dev/iscsi/iscsi.c Wed Mar 14 18:27:06 2018 (r330937) @@ -1281,10 +1281,10 @@ iscsi_pdu_handle_async_message(struct icl_pdu *respons iscsi_session_terminate(is); break; case BHSAM_EVENT_TARGET_TERMINATES_CONNECTION: - ISCSI_SESSION_WARN(is, "target indicates it will drop drop the connection"); + ISCSI_SESSION_WARN(is, "target indicates it will drop the connection"); break; case BHSAM_EVENT_TARGET_TERMINATES_SESSION: - ISCSI_SESSION_WARN(is, "target indicates it will drop drop the session"); + ISCSI_SESSION_WARN(is, "target indicates it will drop the session"); break; default: /* From owner-svn-src-head@freebsd.org Wed Mar 14 19:09:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55674F374C1; Wed, 14 Mar 2018 19:09:07 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A83C71A97; Wed, 14 Mar 2018 19:09:07 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0117B3DED; Wed, 14 Mar 2018 19:09:06 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EJ96Ho018192; Wed, 14 Mar 2018 19:09:06 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EJ96IP018188; Wed, 14 Mar 2018 19:09:06 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201803141909.w2EJ96IP018188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 14 Mar 2018 19:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330939 - in head: lib/libdpv lib/libfigpar usr.bin/dpv usr.sbin/bsdconfig X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: in head: lib/libdpv lib/libfigpar usr.bin/dpv usr.sbin/bsdconfig X-SVN-Commit-Revision: 330939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 19:09:07 -0000 Author: dteske Date: Wed Mar 14 19:09:06 2018 New Revision: 330939 URL: https://svnweb.freebsd.org/changeset/base/330939 Log: Use full month in dpv(3), figpar(3), and bsdconfig(8) manuals Reported by: maxim Modified: head/lib/libdpv/dpv.3 head/lib/libfigpar/figpar.3 head/usr.bin/dpv/dpv.1 head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/lib/libdpv/dpv.3 ============================================================================== --- head/lib/libdpv/dpv.3 Wed Mar 14 19:04:40 2018 (r330938) +++ head/lib/libdpv/dpv.3 Wed Mar 14 19:09:06 2018 (r330939) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Mar 13, 2018 +.Dd March 13, 2018 .Dt DPV 3 .Os .Sh NAME Modified: head/lib/libfigpar/figpar.3 ============================================================================== --- head/lib/libfigpar/figpar.3 Wed Mar 14 19:04:40 2018 (r330938) +++ head/lib/libfigpar/figpar.3 Wed Mar 14 19:09:06 2018 (r330939) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Mar 13, 2018 +.Dd March 13, 2018 .Dt FIGPAR 3 .Os .Sh NAME Modified: head/usr.bin/dpv/dpv.1 ============================================================================== --- head/usr.bin/dpv/dpv.1 Wed Mar 14 19:04:40 2018 (r330938) +++ head/usr.bin/dpv/dpv.1 Wed Mar 14 19:09:06 2018 (r330939) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jan 26, 2016 +.Dd January 26, 2016 .Dt DPV 1 .Os .Sh NAME Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Wed Mar 14 19:04:40 2018 (r330938) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Wed Mar 14 19:09:06 2018 (r330939) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jun 5, 2013 +.Dd June 5, 2013 .Dt BSDCONFIG 8 .Os .Sh NAME From owner-svn-src-head@freebsd.org Wed Mar 14 19:09:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 781F4F375F7; Wed, 14 Mar 2018 19:09:59 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F1E471C1F; Wed, 14 Mar 2018 19:09:59 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A1A53DEE; Wed, 14 Mar 2018 19:09:59 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EJ9x4x018273; Wed, 14 Mar 2018 19:09:59 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EJ9xtj018272; Wed, 14 Mar 2018 19:09:59 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201803141909.w2EJ9xtj018272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 14 Mar 2018 19:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330940 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 330940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 19:09:59 -0000 Author: bapt Date: Wed Mar 14 19:09:58 2018 New Revision: 330940 URL: https://svnweb.freebsd.org/changeset/base/330940 Log: Update to 2018-03-06 MFC after: 3 days Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Wed Mar 14 19:09:06 2018 (r330939) +++ head/share/misc/pci_vendors Wed Mar 14 19:09:58 2018 (r330940) @@ -1,9 +1,10 @@ # $FreeBSD$ +# # List of PCI ID's # -# Version: 2018.02.15 -# Date: 2018-02-15 03:15:01 +# Version: 2018.03.06 +# Date: 2018-03-06 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -26,6 +27,17 @@ 0010 Allied Telesis, Inc (Wrong ID) # This is a relabelled RTL-8139 8139 AT-2500TX V3 Ethernet +0014 Loongson Technology LLC + 7a02 APB (Advanced Peripheral Bus) Controller + 7a03 Gigabit Ethernet Controller + 7a04 OTG USB Controller + 7a05 Vivante GPU (Graphics Processing Unit) + 7a06 DC (Display Controller) + 7a07 HDA (High Definition Audio) Controller + 7a08 SATA AHCI Controller + 7a0f DMA (Direct Memory Access) Controller + 7a14 EHCI USB Controller + 7a24 OHCI USB Controller 001c PEAK-System Technik GmbH 0001 PCAN-PCI CAN-Bus controller 001c 0004 2 Channel CAN Bus SJC1000 @@ -753,7 +765,9 @@ 131b Kaveri [Radeon R4 Graphics] 131c Kaveri [Radeon R7 Graphics] 131d Kaveri [Radeon R6 Graphics] - 15dd Vega [Radeon Vega 8 Mobile] + 15dd Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] + 103c 83c6 Radeon Vega 8 Mobile + 1458 d000 Radeon RX Vega 11 15ff Vega [Radeon Vega 28 Mobile] 1714 BeaverCreek HDMI Audio [Radeon HD 6500D and 6400G-6600G series] 103c 168b ProBook 4535s @@ -1601,10 +1615,12 @@ 103c 2100 FirePro M4100 6602 Mars 6603 Mars - 6604 Opal XT [Radeon R7 M265] + 6604 Opal XT [Radeon R7 M265/M365X/M465] 103c 8006 FirePro M4170 + 103c 814f Litho XT [Radeon R7 M365X] + 103c 82aa Litho XT [Radeon R7 M465] 17aa 3643 Radeon R7 A360 - 6605 Opal PRO [Radeon R7 M260] + 6605 Opal PRO [Radeon R7 M260X] 103c 2259 FirePro M4150 6606 Mars XTX [Radeon HD 8790M] 1028 0684 FirePro W4170M @@ -1679,6 +1695,7 @@ 103c 80be Radeon R5 M330 103c 8136 Radeon R5 M330 103c 8329 Radeon R7 M520 + 17aa 3633 Radeon R5 A330 17aa 3804 Radeon R5 M330 17aa 3809 Radeon R5 M330 17aa 381a Radeon R5 M430 @@ -2298,8 +2315,11 @@ 1043 04fb Radeon RX 480 1043 04fd Radeon RX 480 8GB 1458 22f0 Radeon RX 570 + 1458 22f7 Radeon RX 570 Gaming 4G 1462 3411 Radeon RX 470 1462 3413 Radeon RX 480 + 1462 3416 Radeon RX 570 + 1462 3418 Radeon RX 580 Armor 4G OC 148c 2372 Radeon RX 480 148c 2373 Radeon RX 470 1682 9470 Radeon RX 470 @@ -2334,7 +2354,14 @@ 106b 0179 Radeon Pro 560 1642 1727 Polaris 21 XL [Radeon RX 560D] 1682 956d Polaris 21 XL [Radeon RX 560D] - 67ff Baffin [Radeon RX 560] + 67ff Baffin [Radeon RX 550 640SP / RX 560] + 1002 0b04 Radeon RX 560 + 1043 04bc Radeon RX 560 + 1458 22ed Radeon RX 560 + 148c 2381 Radeon RX 560 + 1682 9560 Radeon RX 560 + 1da2 e348 Radeon RX 560 + 1da2 e367 Radeon RX 550 640SP 6800 Wimbledon XT [Radeon HD 7970M] 1002 0124 Radeon HD 7970M 8086 2110 Radeon HD 7970M @@ -2349,7 +2376,9 @@ 6808 Pitcairn XT GL [FirePro W7000] 1002 0310 FirePro S7000 1002 0420 Radeon Sky 500 + 103c 030c MED-X7000 13cc 3d25 MXRT-7500 + 15c3 030c MED-X7000 6809 Pitcairn LE GL [FirePro W5000] 13cc 3d23 MXRT-5500 13cc 3d24 MXRT-5550 @@ -2411,8 +2440,6 @@ 682d Chelsea XT GL [FirePro M4000] 682f Chelsea LP [Radeon HD 7730M] 103c 1851 Radeon HD 7750M - 6830 Cape Verde [Radeon HD 7800M Series] - 6831 Cape Verde [AMD Radeon HD 7700M Series] 6835 Cape Verde PRX [Radeon R9 255 OEM] 6837 Cape Verde LE [Radeon HD 7730/8730] 1462 2796 Radeon HD 8730 @@ -3026,6 +3053,7 @@ 103c 2269 Radeon R7 M260 103c 22c6 Radeon R7 M260 103c 22c8 Radeon R7 M260 + 103c 2b45 Radeon R7 A360 103c 808c Radeon R7 M260 103c 8099 Radeon R7 M360 103c 80b5 Radeon R7 M360 @@ -3062,7 +3090,8 @@ 148c 9380 Radeon R9 380 # Make naming scheme consistent 174b e308 Radeon R9 380 Nitro 4G D5 - 694c Vega [Radeon RX Vega M] + 694c Polaris 22 [Radeon RX Vega M GH] + 694e Polaris 22 [Radeon RX Vega M GL] 6980 Polaris12 6981 Polaris12 6985 Lexa XT [Radeon PRO WX 3100] @@ -3351,11 +3380,13 @@ 9553 RV710/M92 [Mobility Radeon HD 4530/4570/545v] 1025 015e Mobility Radeon HD 4570 1025 017d Mobility Radeon HD 4570 - 1025 0205 Mobility Radeon HD 4570 + 1025 0205 Mobility Radeon HD 4570 / 545v 1025 0206 Mobility Radeon HD 4570 1025 0237 Mobility Radeon HD 4570 - 1028 02be Mobility Radeon HD 4570 + 1028 02be Mobility Radeon HD 4570 / 545v 1028 02e8 Mobility Radeon HD 4530 + 103c 143c Mobility Radeon HD 545v + 103c 1446 Mobility Radeon HD 545v 103c 3624 Mobility Radeon HD 4530 103c 3628 Mobility Radeon HD 4530 103c 3636 Mobility Radeon HD 4530 @@ -3363,6 +3394,12 @@ 1043 1b42 Mobility Radeon HD 4570 104d 9056 Mobility Radeon HD 4570 1179 ff82 Satellite L505-13T GPU (Mobility Radeon HD 5145) + 144d c07f Mobility Radeon HD 545v + 144d c571 Mobility Radeon HD 545v + 1462 1006 Mobility Radeon HD 545v + 17aa 2129 Mobility Radeon HD 545v + 17aa 215b Mobility Radeon HD 545v + 17aa 21bb Mobility Radeon HD 545v 9555 RV710/M92 [Mobility Radeon HD 4350/4550] 103c 1411 ProBook 4720s GPU (Mobility Radeon HD 4350) 9557 RV711 GL [FirePro RG220] @@ -3409,7 +3446,7 @@ 95c6 RV620 LE [Radeon HD 3450 AGP] 95c9 RV620 LE [Radeon HD 3450 PCI] 95cc RV620 GL [FirePro V3700] - 95cd RV620 [FirePro 2450] + 95cd RV620 GL [FirePro 2450] 95cf RV620 GL [FirePro 2260] 960f RS780 HDMI Audio [Radeon 3000/3100 / HD 3200/3300] 9610 RS780 [Radeon HD 3200] @@ -3485,7 +3522,19 @@ 985d Mullins 985e Mullins 985f Mullins - 9874 Carrizo + 9874 Wani [Radeon R5/R6/R7 Graphics] + 1002 1871 Radeon R5 Graphics + 1002 1e20 Radeon R7 Graphics + 1028 06bd Radeon R6 Graphics + 103c 2b44 Radeon R6 Graphics + 103c 8221 Radeon R5 Graphics + 103c 8223 Radeon R5 Graphics + 103c 8238 Radeon R7 Graphics + 103c 8353 Radeon R7 Graphics + 1458 d000 Radeon R7 Graphics + 17aa 5113 Radeon R6 Graphics + 17aa 5116 Radeon R6 Graphics + 17aa 5118 Radeon R5 Graphics 9900 Trinity [Radeon HD 7660G] 103c 1985 Pavilion 17-e163sg Notebook PC # AMD A10-5800K CPU @@ -9871,7 +9920,7 @@ 0863 C79 [GeForce 9400M] 106b 00aa MacBook5,1 0864 C79 [GeForce 9300] - 0865 C79 [GeForce 9300/ION] + 0865 C79 [GeForce 9300 / ION] 0866 C79 [GeForce 9400M G] 106b 00b1 GeForce 9400M 0867 C79 [GeForce 9400] @@ -9895,12 +9944,12 @@ 1043 1c12 GeForce G102M 1043 1c52 GeForce G205M 0874 C79 [ION] - 0876 ION VGA [GeForce 9400M] + 0876 C79 [GeForce 9400M / ION] 087a C79 [GeForce 9400] - 087d ION VGA + 087d C79 [ION] 19da a123 IONITX-F-E - 087e ION LE VGA - 087f ION LE VGA + 087e C79 [ION LE] + 087f C79 [ION LE] 08a0 MCP89 [GeForce 320M] 08a2 MCP89 [GeForce 320M] 08a3 MCP89 [GeForce 320M] @@ -9931,6 +9980,7 @@ 0a64 GT218 [ION] 0a65 GT218 [GeForce 210] 1043 8334 EN210 SILENT + 1458 36a9 GV-N210D3-1GI (rev. 6.0/6.1) 1462 8094 N210 [Geforce 210] PCIe graphics adapter 0a66 GT218 [GeForce 310] 0a67 GT218 [GeForce 315] @@ -9941,7 +9991,7 @@ 1028 040b Latitude E6510 17aa 2142 ThinkPad T410 0a6e GT218M [GeForce 305M] - 0a6f GT218 [ION] + 0a6f GT218M [ION] 0a70 GT218M [GeForce 310M] 0a71 GT218M [GeForce 305M] 0a72 GT218M [GeForce 310M] @@ -9949,7 +9999,7 @@ 0a74 GT218M [GeForce G210M] 1b0a 903a GeForce G210 0a75 GT218M [GeForce 310M] - 0a76 GT218 [ION 2] + 0a76 GT218M [ION 2] 0a78 GT218GL [Quadro FX 380 LP] 0a7a GT218M [GeForce 315M] 104d 907e GeForce 315M @@ -10869,6 +10919,7 @@ 1288 GK208B [GeForce GT 720] 1289 GK208 [GeForce GT 710] 128b GK208B [GeForce GT 710] + 1043 85f7 GT710-SL-1GD5 1290 GK208M [GeForce GT 730M] 103c 2afa GeForce GT 730A 103c 2b04 GeForce GT 730A @@ -11040,6 +11091,7 @@ 1bb7 GP104GLM [Quadro P4000 Mobile] 1462 11e9 Quadro P4000 Max-Q 1bb8 GP104GLM [Quadro P3000 Mobile] + 1bbb GP104GLM [Quadro P3200 Mobile] 1bc7 GP104 [P104-101] 1be0 GP104M [GeForce GTX 1080 Mobile] 1028 07c0 GeForce GTX 1080 Max-Q @@ -11079,6 +11131,8 @@ 1cb6 GP107GL [Quadro P620] 1d01 GP108 [GeForce GT 1030] 1d10 GP108M [GeForce MX150] + 1d12 GP108M [GeForce MX150] + 1d72 1701 Mi Notebook Pro [GeForce MX150] 1d33 GP108GL [Quadro P500] 1d81 GV100 [TITAN V] 1db1 GV100GL [Tesla V100 SXM2] @@ -11424,6 +11478,7 @@ 8821 RTL8821AE 802.11ac PCIe Wireless Network Adapter b723 RTL8723BE PCIe Wireless Network Adapter 10ec 8739 Dell Wireless 1801 + b822 RTL8822BE 802.11a/b/g/n/ac WiFi adapter c821 RTL8821CE 802.11ac PCIe Wireless Network Adapter 10ed Ascii Corporation 7310 V7310 @@ -13354,6 +13409,7 @@ 0102 Extended IDE Controller 0103 EX-IDE Type-B 010f NVMe Controller + 0115 XG4 NVMe SSD Controller 0404 DVD Decoder card 0406 Tecra Video Capture device 0407 DVD Decoder card (Version 2) @@ -13482,6 +13538,7 @@ 1028 01d7 XPS M1210 1028 01f3 Inspiron 1420 1028 022f Inspiron 1525 + 103c 1521 HP EliteBook 8540w 103c 30b5 Presario V3242AU 103c 30b7 Presario V6133CL 103c 30cc Pavilion dv6700 @@ -13533,6 +13590,7 @@ 1028 01f5 Inspiron 1501 1028 024f Latitude e6500 103c 03b5 Presario V3242AU + 103c 1521 HP EliteBook 8540w 103c 30b7 Presario V6133CL 103c 30cf Pavilion dv9500/9600/9700 series 1183 0843 Alienware Aurora m9700 @@ -15032,7 +15090,7 @@ 12a2 Newgen Systems Corporation 12a3 Lucent Technologies 8105 T8105 H100 Digital Switch -12a4 NTT Electronics Technology Company +12a4 NTT Electronics Corporation 12a5 Vision Dynamics Ltd. 12a6 Scalable Networks, Inc. 12a7 AMO GmbH @@ -18684,6 +18742,7 @@ 15b3 0026 ConnectX-3 IB FDR Dual Port Mezzanine Card 15b3 0028 ConnectX-3 VPI Dual QSFP+ Port QDR Infiniband 40Gb/s or 10Gb Ethernet 15b3 0059 ConnectX-3 VPI IB FDR/40 GbE Single Port QSFP+ Mezzanine Card + 15b3 0064 ConnectX-3 EN 10/40 GbE Single Port QSFP+ Adapter (MCX313A-BCBT) 15b3 0065 ConnectX-3 VPI IB FDR/40 GbE Dual Port QSFP+ Adapter 15b3 0066 ConnectX-3 IB FDR10 Dual Port Mezzanine Card 15b3 0067 ConnectX-3 VPI IB FDR/40 GbE Single Port QSFP+ Adapter @@ -18731,9 +18790,10 @@ 15b3 0050 ConnectX-4 100 GbE Dual Port QSFP28 Adapter 1014 MT27700 Family [ConnectX-4 Virtual Function] 1015 MT27710 Family [ConnectX-4 Lx] + 15b3 0001 ConnectX-4 Lx EN network interface card, 25GbE single-port SFP28, PCIe3.0 x8, tall bracket, ROHS R6 + 15b3 0003 Stand-up ConnectX-4 Lx EN, 25GbE dual-port SFP28, PCIe3.0 x8, MCX4121A-ACAT 15b3 0004 ConnectX-4 Lx Stand-up dual-port 10GbE MCX4121A-XCAT 15b3 0005 Mellanox Technologies ConnectX-4 Lx Stand-up single-port 40GbE MCX4131A-BCAT - 15b3 0016 ConnectX-4 Lx 25 GbE Dual Port SFP28 Adapter 15b3 0020 MCX4411A-ACQN, ConnectX-4 Lx EN OCP, 1x25Gb 15b3 0021 MCX4421A-ACQN ConnectX-4 Lx EN OCP,2x25G 15b3 0025 ConnectX-4 Lx 25 GbE Dual Port SFP28 rNDC @@ -20665,6 +20725,7 @@ 5808 DDRdrive X8 dd52 DDRdrive X1-30 19e5 Huawei Technologies Co., Ltd. + 1710 iBMA Virtual Network Adapter 1711 Hi1710 [iBMC Intelligent Management system chip w/VGA support] 19e7 NET (Network Equipment Technologies) 1001 STIX DSP Card @@ -20717,12 +20778,15 @@ 0200 TILE-Gx processor 0201 TILE-Gx Processor Virtual Function 2000 TILE-Gx PCI Express Root Port -1a4a SLAC National Accelerator Lab PPA-REG +1a4a SLAC National Accelerator Lab TID-AIR 1000 MCOR Power Supply Controller 1010 AMC EVR - Stockholm Timing Board 2000 PGPCard - 4 Lane 2001 PGPCard - 8 Lane Plus EVR 2010 PCI-Express EVR +# PC-260-101-03 + 2020 PGP-GEN3 PCIe + 2030 data_dev 1a51 Hectronic AB 1a55 Rohde & Schwarz DVS GmbH 0010 SDStationOEM @@ -21246,6 +21310,7 @@ 100e AR-ARKA-FX1 [Arkville 64B DPDK Data Mover] 1d6c 2001 DPDK-Aware Virtual Function [Arkville VF] 4200 A5PL-E1-10GETI [10 GbE Ethernet Traffic Instrument] +1d72 Xiaomi 1d78 DERA 1d7c Aerotech, Inc. 1d87 Fuzhou Rockchip Electronics Co., Ltd From owner-svn-src-head@freebsd.org Wed Mar 14 19:23:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B372F3AB8A; Wed, 14 Mar 2018 19:23:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF13972C26; Wed, 14 Mar 2018 19:23:17 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA0E94135; Wed, 14 Mar 2018 19:23:17 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EJNH5S028448; Wed, 14 Mar 2018 19:23:17 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EJNHHa028446; Wed, 14 Mar 2018 19:23:17 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201803141923.w2EJNHHa028446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 14 Mar 2018 19:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330943 - head/lib/libdpv X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/lib/libdpv X-SVN-Commit-Revision: 330943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 19:23:18 -0000 Author: dteske Date: Wed Mar 14 19:23:17 2018 New Revision: 330943 URL: https://svnweb.freebsd.org/changeset/base/330943 Log: Fix bad error messages from dpv(3) Before = dpv: <__func__>: posix_spawnp(3): No such file or directory After = dpv: : No such file or directory Most notably, show the 2nd argument being passed to posix_spawnp(3) so we know what path/cmd failed. Also, we don't need to have "posix_spawnp(3)" in the error message nor the function because that can [a] change and [b] traversed using a debugger if necessary. Modified: head/lib/libdpv/dialog_util.c head/lib/libdpv/util.c Modified: head/lib/libdpv/dialog_util.c ============================================================================== --- head/lib/libdpv/dialog_util.c Wed Mar 14 19:18:35 2018 (r330942) +++ head/lib/libdpv/dialog_util.c Wed Mar 14 19:23:17 2018 (r330943) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2018 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -328,8 +328,7 @@ dialog_spawn_gauge(char *init_prompt, pid_t *pid) posix_spawn_file_actions_addclose(&action, stdin_pipe[1]); error = posix_spawnp(pid, dialog, &action, (const posix_spawnattr_t *)NULL, dargv, environ); - if (error != 0) - err(EXIT_FAILURE, "%s: posix_spawnp(3)", __func__); + if (error != 0) err(EXIT_FAILURE, "%s", dialog); /* NB: Do not free(3) *dargv[], else SIGSEGV */ Modified: head/lib/libdpv/util.c ============================================================================== --- head/lib/libdpv/util.c Wed Mar 14 19:18:35 2018 (r330942) +++ head/lib/libdpv/util.c Wed Mar 14 19:23:17 2018 (r330943) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2018 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -100,8 +100,7 @@ shell_spawn_pipecmd(const char *cmd, const char *label posix_spawn_file_actions_addclose(&action, stdin_pipe[1]); error = posix_spawnp(pid, shellcmd, &action, (const posix_spawnattr_t *)NULL, shellcmd_argv, environ); - if (error != 0) - err(EXIT_FAILURE, "%s: posix_spawnp(3)", __func__); + if (error != 0) err(EXIT_FAILURE, "%s", shellcmd); return stdin_pipe[1]; } From owner-svn-src-head@freebsd.org Wed Mar 14 19:51:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EED3FF40AB7; Wed, 14 Mar 2018 19:51: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FA2E73D61; Wed, 14 Mar 2018 19:51: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 9A23E447E; Wed, 14 Mar 2018 19:51: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 w2EJpSCj043031; Wed, 14 Mar 2018 19:51:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EJpSHp043030; Wed, 14 Mar 2018 19:51:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803141951.w2EJpSHp043030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 14 Mar 2018 19:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330944 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 330944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 19:51:29 -0000 Author: hselasky Date: Wed Mar 14 19:51:28 2018 New Revision: 330944 URL: https://svnweb.freebsd.org/changeset/base/330944 Log: Fix compliancy of the kstrtoXXX() functions in the LinuxKPI, by skipping one newline character at the end, if any. Found by: greg@unrelenting.technology MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Wed Mar 14 19:23:17 2018 (r330943) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Wed Mar 14 19:51:28 2018 (r330944) @@ -295,6 +295,9 @@ kstrtoul(const char *cp, unsigned int base, unsigned l *res = strtoul(cp, &end, base); + /* skip newline character, if any */ + if (*end == '\n') + end++; if (*cp == 0 || *end != 0) return (-EINVAL); return (0); @@ -307,6 +310,9 @@ kstrtol(const char *cp, unsigned int base, long *res) *res = strtol(cp, &end, base); + /* skip newline character, if any */ + if (*end == '\n') + end++; if (*cp == 0 || *end != 0) return (-EINVAL); return (0); @@ -320,6 +326,9 @@ kstrtoint(const char *cp, unsigned int base, int *res) *res = temp = strtol(cp, &end, base); + /* skip newline character, if any */ + if (*end == '\n') + end++; if (*cp == 0 || *end != 0) return (-EINVAL); if (temp != (int)temp) @@ -335,6 +344,9 @@ kstrtouint(const char *cp, unsigned int base, unsigned *res = temp = strtoul(cp, &end, base); + /* skip newline character, if any */ + if (*end == '\n') + end++; if (*cp == 0 || *end != 0) return (-EINVAL); if (temp != (unsigned int)temp) @@ -350,6 +362,9 @@ kstrtou32(const char *cp, unsigned int base, u32 *res) *res = temp = strtoul(cp, &end, base); + /* skip newline character, if any */ + if (*end == '\n') + end++; if (*cp == 0 || *end != 0) return (-EINVAL); if (temp != (u32)temp) From owner-svn-src-head@freebsd.org Wed Mar 14 20:07:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B2C9F41CE1; Wed, 14 Mar 2018 20:07:53 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D41A747B2; Wed, 14 Mar 2018 20:07:53 +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 278944732; Wed, 14 Mar 2018 20:07:53 +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 w2EK7qFv049115; Wed, 14 Mar 2018 20:07:52 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EK7qSU049114; Wed, 14 Mar 2018 20:07:52 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803142007.w2EK7qSU049114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 14 Mar 2018 20:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330945 - head/sys/modules/isp X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/modules/isp X-SVN-Commit-Revision: 330945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 20:07:53 -0000 Author: brooks Date: Wed Mar 14 20:07:52 2018 New Revision: 330945 URL: https://svnweb.freebsd.org/changeset/base/330945 Log: Add opt_compat.h to isp(4) as required by r330876. MFC with: r330876 Modified: head/sys/modules/isp/Makefile Modified: head/sys/modules/isp/Makefile ============================================================================== --- head/sys/modules/isp/Makefile Wed Mar 14 19:51:28 2018 (r330944) +++ head/sys/modules/isp/Makefile Wed Mar 14 20:07:52 2018 (r330945) @@ -4,7 +4,7 @@ KMOD= isp SRCS= bus_if.h device_if.h pci_if.h \ - opt_cam.h opt_ddb.h opt_isp.h \ + opt_cam.h opt_compat.h opt_ddb.h opt_isp.h \ isp.c isp_library.c isp_target.c isp_freebsd.c isp_pci.c .if ${MACHINE} == sparc64 From owner-svn-src-head@freebsd.org Wed Mar 14 20:46:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3FF9F46409; Wed, 14 Mar 2018 20:46:26 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 761D275FED; Wed, 14 Mar 2018 20:46:26 +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 6CDA24D31; Wed, 14 Mar 2018 20:46:26 +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 w2EKkQ98069660; Wed, 14 Mar 2018 20:46:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EKkQZ0069657; Wed, 14 Mar 2018 20:46:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201803142046.w2EKkQZ0069657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 14 Mar 2018 20:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330946 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 330946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 20:46:27 -0000 Author: jhb Date: Wed Mar 14 20:46:25 2018 New Revision: 330946 URL: https://svnweb.freebsd.org/changeset/base/330946 Log: Remove TLS-related inlines from t4_tom.h to fix iw_cxgbe(4) build. - Remove the one use of is_tls_offload() and the function. AIO special handling only needs to be disabled when a TOE socket is actively doing TLS offload on transmit. The TOE socket's mode (which affects receive operation) doesn't matter, so remove the check for the socket's mode and only check if a TOE socket has TLS transmit keys configured to determine if an AIO write request should fall back to the normal socket handling instead of the TOE fast path. - Move can_tls_offload() into t4_tls.c. It is not used in critical paths, so inlining isn't that important. Change return type to bool while here. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_tls.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Mar 14 20:07:52 2018 (r330945) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Mar 14 20:46:25 2018 (r330946) @@ -2357,7 +2357,7 @@ t4_aio_queue_aiotx(struct socket *so, struct kaiocb *j if (!sc->tt.tx_zcopy) return (EOPNOTSUPP); - if (is_tls_offload(toep) || tls_tx_key(toep)) + if (tls_tx_key(toep)) return (EOPNOTSUPP); SOCKBUF_LOCK(&so->so_snd); Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Wed Mar 14 20:07:52 2018 (r330945) +++ head/sys/dev/cxgbe/tom/t4_tls.c Wed Mar 14 20:46:25 2018 (r330946) @@ -73,6 +73,13 @@ t4_set_tls_tcb_field(struct toepcb *toep, uint16_t wor } /* TLS and DTLS common routines */ +bool +can_tls_offload(struct adapter *sc) +{ + + return (sc->tt.tls && sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS); +} + int tls_tx_key(struct toepcb *toep) { Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Wed Mar 14 20:07:52 2018 (r330945) +++ head/sys/dev/cxgbe/tom/t4_tom.h Wed Mar 14 20:46:25 2018 (r330946) @@ -321,18 +321,6 @@ mbuf_ulp_submode(struct mbuf *m) return (m->m_pkthdr.PH_per.eight[0]); } -static inline int -is_tls_offload(struct toepcb *toep) -{ - return (toep->ulp_mode == ULP_MODE_TLS); -} - -static inline int -can_tls_offload(struct adapter *sc) -{ - return (sc->tt.tls && sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS); -} - /* t4_tom.c */ struct toepcb *alloc_toepcb(struct vi_info *, int, int, int); struct toepcb *hold_toepcb(struct toepcb *); @@ -430,6 +418,7 @@ void handle_ddp_tcb_rpl(struct toepcb *, const struct void insert_ddp_data(struct toepcb *, uint32_t); /* t4_tls.c */ +bool can_tls_offload(struct adapter *); int t4_ctloutput_tls(struct socket *, struct sockopt *); void t4_push_tls_records(struct adapter *, struct toepcb *, int); void t4_tls_mod_load(void); From owner-svn-src-head@freebsd.org Wed Mar 14 20:49:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91218F466E8; Wed, 14 Mar 2018 20:49:52 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CA6F7620E; Wed, 14 Mar 2018 20:49:52 +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 2E61B4D32; Wed, 14 Mar 2018 20:49:52 +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 w2EKnqbf069829; Wed, 14 Mar 2018 20:49:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EKnqdY069828; Wed, 14 Mar 2018 20:49:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201803142049.w2EKnqdY069828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 14 Mar 2018 20:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330947 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 330947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 20:49:52 -0000 Author: jhb Date: Wed Mar 14 20:49:51 2018 New Revision: 330947 URL: https://svnweb.freebsd.org/changeset/base/330947 Log: Fix the check for an empty send socket buffer on a TOE TLS socket. Compare sbavail() with the cached sb_off of already-sent data instead of always comparing with zero. This will correctly close the connection and send the FIN if the socket buffer contains some previously-sent data but no unsent data. Reported by: Harsh Jain @ Chelsio Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_tls.c Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Wed Mar 14 20:46:25 2018 (r330946) +++ head/sys/dev/cxgbe/tom/t4_tls.c Wed Mar 14 20:49:51 2018 (r330947) @@ -1175,7 +1175,8 @@ t4_push_tls_records(struct adapter *sc, struct toepcb * Send a FIN if requested, but only if there's no * more data to send. */ - if (sbavail(sb) == 0 && toep->flags & TPF_SEND_FIN) { + if (sbavail(sb) == tls_ofld->sb_off && + toep->flags & TPF_SEND_FIN) { if (sowwakeup) sowwakeup_locked(so); else From owner-svn-src-head@freebsd.org Wed Mar 14 20:55:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4555CF46D1F; Wed, 14 Mar 2018 20:55:29 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E71F1766BC; Wed, 14 Mar 2018 20:55:28 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC8C34EBE; Wed, 14 Mar 2018 20:55:28 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EKtSYQ074486; Wed, 14 Mar 2018 20:55:28 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EKtSAj074484; Wed, 14 Mar 2018 20:55:28 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201803142055.w2EKtSAj074484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 14 Mar 2018 20:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330948 - in head/lib: libdpv libfigpar X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: in head/lib: libdpv libfigpar X-SVN-Commit-Revision: 330948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 20:55:29 -0000 Author: dteske Date: Wed Mar 14 20:55:28 2018 New Revision: 330948 URL: https://svnweb.freebsd.org/changeset/base/330948 Log: Bump copyright following recent changes Modified: head/lib/libdpv/dpv.3 head/lib/libfigpar/figpar.3 Modified: head/lib/libdpv/dpv.3 ============================================================================== --- head/lib/libdpv/dpv.3 Wed Mar 14 20:49:51 2018 (r330947) +++ head/lib/libdpv/dpv.3 Wed Mar 14 20:55:28 2018 (r330948) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2013-2016 Devin Teske +.\" Copyright (c) 2013-2018 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: head/lib/libfigpar/figpar.3 ============================================================================== --- head/lib/libfigpar/figpar.3 Wed Mar 14 20:49:51 2018 (r330947) +++ head/lib/libfigpar/figpar.3 Wed Mar 14 20:55:28 2018 (r330948) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2013-2015 Devin Teske +.\" Copyright (c) 2013-2018 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without From owner-svn-src-head@freebsd.org Wed Mar 14 21:11:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B86F6F49F80; Wed, 14 Mar 2018 21:11:42 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64ACA772B1; Wed, 14 Mar 2018 21:11:42 +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 5F9F650F7; Wed, 14 Mar 2018 21:11:42 +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 w2ELBgdP081184; Wed, 14 Mar 2018 21:11:42 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2ELBfGT081179; Wed, 14 Mar 2018 21:11:41 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803142111.w2ELBfGT081179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 14 Mar 2018 21:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330949 - in head/sys: dev/aac dev/aacraid modules/aac modules/aacraid sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: dev/aac dev/aacraid modules/aac modules/aacraid sys X-SVN-Commit-Revision: 330949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 21:11:43 -0000 Author: brooks Date: Wed Mar 14 21:11:41 2018 New Revision: 330949 URL: https://svnweb.freebsd.org/changeset/base/330949 Log: Fix FSACTL_GET_NEXT_ADAPTER_FIB under 32-bit compat. This includes FSACTL_LNX_GET_NEXT_ADAPTER_FIB. Reviewed by: cem Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14672 Modified: head/sys/dev/aac/aac.c head/sys/dev/aacraid/aacraid.c head/sys/modules/aac/Makefile head/sys/modules/aacraid/Makefile head/sys/sys/aac_ioctl.h Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Wed Mar 14 20:55:28 2018 (r330948) +++ head/sys/dev/aac/aac.c Wed Mar 14 21:11:41 2018 (r330949) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #define AAC_DRIVERNAME "aac" #include "opt_aac.h" +#include "opt_compat.h" /* #include */ #include @@ -45,7 +46,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -3521,7 +3524,19 @@ aac_getnext_aif(struct aac_softc *sc, caddr_t arg) fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - if ((error = copyin(arg, &agf, sizeof(agf))) == 0) { +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) { + struct get_adapter_fib_ioctl32 agf32; + error = copyin(arg, &agf32, sizeof(agf32)); + if (error == 0) { + agf.AdapterFibContext = agf32.AdapterFibContext; + agf.Wait = agf32.Wait; + agf.AifFib = (caddr_t)(uintptr_t)agf32.AifFib; + } + } else +#endif + error = copyin(arg, &agf, sizeof(agf)); + if (error == 0) { for (ctx = sc->fibctx; ctx; ctx = ctx->next) { if (agf.AdapterFibContext == ctx->unique) break; Modified: head/sys/dev/aacraid/aacraid.c ============================================================================== --- head/sys/dev/aacraid/aacraid.c Wed Mar 14 20:55:28 2018 (r330948) +++ head/sys/dev/aacraid/aacraid.c Wed Mar 14 21:11:41 2018 (r330949) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #define AAC_DRIVERNAME "aacraid" #include "opt_aacraid.h" +#include "opt_compat.h" /* #include */ #include @@ -46,7 +47,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -3381,7 +3384,19 @@ aac_getnext_aif(struct aac_softc *sc, caddr_t arg) fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); mtx_lock(&sc->aac_io_lock); - if ((error = copyin(arg, &agf, sizeof(agf))) == 0) { +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) { + struct get_adapter_fib_ioctl32 agf32; + error = copyin(arg, &agf32, sizeof(agf32)); + if (error == 0) { + agf.AdapterFibContext = agf32.AdapterFibContext; + agf.Wait = agf32.Wait; + agf.AifFib = (caddr_t)(uintptr_t)agf32.AifFib; + } + } else +#endif + error = copyin(arg, &agf, sizeof(agf)); + if (error == 0) { for (ctx = sc->fibctx; ctx; ctx = ctx->next) { if (agf.AdapterFibContext == ctx->unique) break; Modified: head/sys/modules/aac/Makefile ============================================================================== --- head/sys/modules/aac/Makefile Wed Mar 14 20:55:28 2018 (r330948) +++ head/sys/modules/aac/Makefile Wed Mar 14 21:11:41 2018 (r330949) @@ -8,7 +8,7 @@ SUBDIR= aac_linux KMOD= aac SRCS= aac.c aac_pci.c aac_disk.c aac_cam.c -SRCS+= opt_scsi.h opt_cam.h opt_aac.h +SRCS+= opt_scsi.h opt_cam.h opt_compat.h opt_aac.h SRCS+= device_if.h bus_if.h pci_if.h # To enable debug output from the driver, uncomment these two lines. Modified: head/sys/modules/aacraid/Makefile ============================================================================== --- head/sys/modules/aacraid/Makefile Wed Mar 14 20:55:28 2018 (r330948) +++ head/sys/modules/aacraid/Makefile Wed Mar 14 21:11:41 2018 (r330949) @@ -8,7 +8,7 @@ SUBDIR= aacraid_linux KMOD= aacraid SRCS= aacraid.c aacraid_pci.c aacraid_cam.c -SRCS+= opt_scsi.h opt_cam.h opt_aacraid.h +SRCS+= opt_scsi.h opt_cam.h opt_compat.h opt_aacraid.h SRCS+= device_if.h bus_if.h pci_if.h # To enable debug output from the driver, uncomment these two lines. Modified: head/sys/sys/aac_ioctl.h ============================================================================== --- head/sys/sys/aac_ioctl.h Wed Mar 14 20:55:28 2018 (r330948) +++ head/sys/sys/aac_ioctl.h Wed Mar 14 21:11:41 2018 (r330949) @@ -175,6 +175,14 @@ struct get_adapter_fib_ioctl { caddr_t AifFib; }; +#ifdef _KERNEL +struct get_adapter_fib_ioctl32 { + u_int32_t AdapterFibContext; + int Wait; + u_int32_t AifFib; +}; +#endif + struct aac_query_disk { int32_t ContainerNumber; int32_t Bus; From owner-svn-src-head@freebsd.org Wed Mar 14 21:21:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79EE1F4A8E7; Wed, 14 Mar 2018 21:21:04 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2ED2077898; Wed, 14 Mar 2018 21:21:04 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29D4F5257; Wed, 14 Mar 2018 21:21:04 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2ELL33H088650; Wed, 14 Mar 2018 21:21:03 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2ELL3XX088649; Wed, 14 Mar 2018 21:21:03 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201803142121.w2ELL3XX088649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 14 Mar 2018 21:21:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330950 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: smh X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 21:21:04 -0000 Author: smh Date: Wed Mar 14 21:21:03 2018 New Revision: 330950 URL: https://svnweb.freebsd.org/changeset/base/330950 Log: Prevent ZFS TRIM breaking VTOC8 partitions Update the ZFS TRIM code to ensure it respects VTOC8 partition headers as documented by the ZFS On-Disk Specification section 1.3 Before this a zpool create on a VTOC8 partitioned device would overwrite the partition metadata. Reported by: marius Reviewed by: marius agv MFC after: 1 week Sponsored by: Multiplay Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Wed Mar 14 21:11:41 2018 (r330949) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Wed Mar 14 21:21:03 2018 (r330950) @@ -802,7 +802,9 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_label } /* - * TRIM the whole thing so that we start with a clean slate. + * TRIM the whole thing, excluding the blank space and boot header + * as specified by ZFS On-Disk Specification (section 1.3), so that + * we start with a clean slate. * It's just an optimization, so we don't care if it fails. * Don't TRIM if removing so that we don't interfere with zpool * disaster recovery. @@ -810,7 +812,8 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_label if (zfs_trim_enabled && vdev_trim_on_init && !vd->vdev_notrim && (reason == VDEV_LABEL_CREATE || reason == VDEV_LABEL_SPARE || reason == VDEV_LABEL_L2CACHE)) - zio_wait(zio_trim(NULL, spa, vd, 0, vd->vdev_psize)); + zio_wait(zio_trim(NULL, spa, vd, VDEV_SKIP_SIZE, + vd->vdev_psize - VDEV_SKIP_SIZE)); /* * Initialize its label. From owner-svn-src-head@freebsd.org Wed Mar 14 21:22:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71594F4AB8A for ; Wed, 14 Mar 2018 21:22:40 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0CE677C27 for ; Wed, 14 Mar 2018 21:22:39 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22b.google.com with SMTP id e194so6709814wmd.3 for ; Wed, 14 Mar 2018 14:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=IOJ67JowcSbu0ggXrBXDO807fyXCOGPEsmjm+hgKSIg=; b=I1D08fEG2BZ2nhHb5z2q2257H6yDmeFkLnFL2Sf23Jhho9DAJS1pxmpGijOPcPT9GW GRHYCRDZ/i/NVuYyH1ipTbnKVgmASnuM5mXWaWlCXd6BdA26gZ2AJHrv88KVkaMJw6KP HBduwFy8LiThZF0J3To3dRRKhZZNJC9DdRogTGl7j3xm5bEX7NpWBE3xjJL6/3h9EXcN 11l59q46Cbh6ROK26xuyBLSaTqwCBCi8BH96NU22w77dr+WJ9dQy30GV8+9lP3DqRXCA QO4VhNlHybSAVXYZhNfgPd4d/MVoHJF67RkFbsVhPwId8jRSPpvXga6/dgDddM7bNRnq tBcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=IOJ67JowcSbu0ggXrBXDO807fyXCOGPEsmjm+hgKSIg=; b=rapma/GaYTy40upo5cIgYLB8fWtYFEKNMsjc37fbIG4w+LOfsQm/yFxJxSVCpSP06j b87K71O95EqIy9Gh9bkBGWc8vtuKXvZCh6GrCQQhyv576Npxexzb4jw1UP5D/BLQSY5f oqLYZJ1bwbc78yv+xlXMsTy7hTweIm7y+D47U2wuHDPhl25ZWgjHpF01HkNDPS1DBdCV E+RQnAV3t4npGuHXg7B6DLRdsnmIMy383yQEIw0Fn2sEYfs6ECGp8nc6Ny3IUqZdgphJ z+0BU/vmBS50/VbtX6dN3xCSgmYDN1dIHPULCTO6vMTDAGbb3zoN0Au9ID1jXUPmIbTb YYow== X-Gm-Message-State: AElRT7Ha/JEncXifiWcnY1mmoijDuoXksBtONOxz+LTIz7MAGiIvJz/y uGy/fnfv/EMBr+Dwh/6KGYHWRO6ists= X-Google-Smtp-Source: AG47ELuCy6IKRETs38CRj8xZubXt0LujoPZ6uwPty/ZmkzIN7fyvOt6u269AbRa05QDAl3K5IQlMQg== X-Received: by 10.28.158.205 with SMTP id h196mr2632268wme.25.1521062558297; Wed, 14 Mar 2018 14:22:38 -0700 (PDT) Received: from [10.10.1.111] ([185.97.61.1]) by smtp.gmail.com with ESMTPSA id 93sm3478941wrh.46.2018.03.14.14.22.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Mar 2018 14:22:37 -0700 (PDT) Subject: Re: svn commit: r330950 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803142121.w2ELL3XX088649@repo.freebsd.org> From: Steven Hartland Message-ID: Date: Wed, 14 Mar 2018 21:22:59 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201803142121.w2ELL3XX088649@repo.freebsd.org> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 21:22:40 -0000 Missed the differential review: https://reviews.freebsd.org/D14695 On 14/03/2018 21:21, Steven Hartland wrote: > Author: smh > Date: Wed Mar 14 21:21:03 2018 > New Revision: 330950 > URL: https://svnweb.freebsd.org/changeset/base/330950 > > Log: > Prevent ZFS TRIM breaking VTOC8 partitions > > Update the ZFS TRIM code to ensure it respects VTOC8 partition headers as > documented by the ZFS On-Disk Specification section 1.3 > > Before this a zpool create on a VTOC8 partitioned device would overwrite the > partition metadata. > > Reported by: marius > Reviewed by: marius agv > MFC after: 1 week > Sponsored by: Multiplay > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Wed Mar 14 21:11:41 2018 (r330949) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Wed Mar 14 21:21:03 2018 (r330950) > @@ -802,7 +802,9 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_label > } > > /* > - * TRIM the whole thing so that we start with a clean slate. > + * TRIM the whole thing, excluding the blank space and boot header > + * as specified by ZFS On-Disk Specification (section 1.3), so that > + * we start with a clean slate. > * It's just an optimization, so we don't care if it fails. > * Don't TRIM if removing so that we don't interfere with zpool > * disaster recovery. > @@ -810,7 +812,8 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_label > if (zfs_trim_enabled && vdev_trim_on_init && !vd->vdev_notrim && > (reason == VDEV_LABEL_CREATE || reason == VDEV_LABEL_SPARE || > reason == VDEV_LABEL_L2CACHE)) > - zio_wait(zio_trim(NULL, spa, vd, 0, vd->vdev_psize)); > + zio_wait(zio_trim(NULL, spa, vd, VDEV_SKIP_SIZE, > + vd->vdev_psize - VDEV_SKIP_SIZE)); > > /* > * Initialize its label. > From owner-svn-src-head@freebsd.org Wed Mar 14 21:32:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4119DF4B3B6; Wed, 14 Mar 2018 21:32:24 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBAA5781C0; Wed, 14 Mar 2018 21:32:23 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E66B7553B; Wed, 14 Mar 2018 21:32:23 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2ELWNxa094475; Wed, 14 Mar 2018 21:32:23 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2ELWNAS094473; Wed, 14 Mar 2018 21:32:23 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201803142132.w2ELWNAS094473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 14 Mar 2018 21:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330951 - head/sys/dev/mps X-SVN-Group: head X-SVN-Commit-Author: smh X-SVN-Commit-Paths: head/sys/dev/mps X-SVN-Commit-Revision: 330951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 21:32:24 -0000 Author: smh Date: Wed Mar 14 21:32:23 2018 New Revision: 330951 URL: https://svnweb.freebsd.org/changeset/base/330951 Log: Fix mps deadlock when handling panic During shutdown mps waits for its SSU requests to complete however when performing a reboot after handling a panic the scheduler is stopped so getmicrotime which is used can be non-functional. Switch to using the same method as shutdown_panic to ensure we actually complete. In addition reduce the timeout when RB_NOSYNC is set in howto as we expect this to fail. Reviewed by: slm MFC after: 1 week Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D12776 Modified: head/sys/dev/mps/mps_sas_lsi.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Wed Mar 14 21:21:03 2018 (r330950) +++ head/sys/dev/mps/mps_sas_lsi.c Wed Mar 14 21:32:23 2018 (r330951) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -126,7 +127,7 @@ int mpssas_get_sas_address_for_sata_disk(struct mps_so u64 *sas_address, u16 handle, u32 device_info, u8 *is_SATA_SSD); static int mpssas_volume_add(struct mps_softc *sc, u16 handle); -static void mpssas_SSU_to_SATA_devices(struct mps_softc *sc); +static void mpssas_SSU_to_SATA_devices(struct mps_softc *sc, int howto); static void mpssas_stop_unit_done(struct cam_periph *periph, union ccb *done_ccb); @@ -1122,7 +1123,7 @@ out: * Return nothing. */ static void -mpssas_SSU_to_SATA_devices(struct mps_softc *sc) +mpssas_SSU_to_SATA_devices(struct mps_softc *sc, int howto) { struct mpssas_softc *sassc = sc->sassc; union ccb *ccb; @@ -1130,7 +1131,7 @@ mpssas_SSU_to_SATA_devices(struct mps_softc *sc) target_id_t targetid; struct mpssas_target *target; char path_str[64]; - struct timeval cur_time, start_time; + int timeout; /* * For each target, issue a StartStopUnit command to stop the device. @@ -1193,17 +1194,23 @@ mpssas_SSU_to_SATA_devices(struct mps_softc *sc) } /* - * Wait until all of the SSU commands have completed or time has - * expired (60 seconds). Pause for 100ms each time through. If any - * command times out, the target will be reset in the SCSI command - * timeout routine. + * Timeout after 60 seconds by default or 10 seconds if howto has + * RB_NOSYNC set which indicates we're likely handling a panic. */ - getmicrotime(&start_time); - while (sc->SSU_refcount) { + timeout = 600; + if (howto & RB_NOSYNC) + timeout = 100; + + /* + * Wait until all of the SSU commands have completed or timeout has + * expired. Pause for 100ms each time through. If any command + * times out, the target will be reset in the SCSI command timeout + * routine. + */ + while (sc->SSU_refcount > 0) { pause("mpswait", hz/10); - getmicrotime(&cur_time); - if ((cur_time.tv_sec - start_time.tv_sec) > 60) { + if (--timeout == 0) { mps_dprint(sc, MPS_FAULT, "Time has expired waiting " "for SSU commands to complete.\n"); break; @@ -1245,7 +1252,7 @@ mpssas_stop_unit_done(struct cam_periph *periph, union * Return nothing. */ void -mpssas_ir_shutdown(struct mps_softc *sc) +mpssas_ir_shutdown(struct mps_softc *sc, int howto) { u16 volume_mapping_flags; u16 ioc_pg8_flags = le16toh(sc->ioc_pg8.Flags); @@ -1350,5 +1357,5 @@ out: } } } - mpssas_SSU_to_SATA_devices(sc); + mpssas_SSU_to_SATA_devices(sc, howto); } Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Wed Mar 14 21:21:03 2018 (r330950) +++ head/sys/dev/mps/mpsvar.h Wed Mar 14 21:32:23 2018 (r330951) @@ -772,7 +772,7 @@ int mps_config_get_volume_wwid(struct mps_softc *sc, u int mps_config_get_raid_pd_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, Mpi2RaidPhysDiskPage0_t *config_page, u32 page_address); -void mpssas_ir_shutdown(struct mps_softc *sc); +void mpssas_ir_shutdown(struct mps_softc *sc, int howto); int mps_reinit(struct mps_softc *sc); void mpssas_handle_reinit(struct mps_softc *sc); From owner-svn-src-head@freebsd.org Wed Mar 14 22:11:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E059EF4D7C8; Wed, 14 Mar 2018 22:11:45 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96C8179896; Wed, 14 Mar 2018 22:11:45 +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 91CDD5B2B; Wed, 14 Mar 2018 22:11:45 +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 w2EMBjJo010881; Wed, 14 Mar 2018 22:11:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EMBjVd010880; Wed, 14 Mar 2018 22:11:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803142211.w2EMBjVd010880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 14 Mar 2018 22:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330952 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 22:11:46 -0000 Author: cem Date: Wed Mar 14 22:11:45 2018 New Revision: 330952 URL: https://svnweb.freebsd.org/changeset/base/330952 Log: vfs_bio.c: Apply cleanups motivated by Coverity analysis It is believed that the conditions Coverity indicated were actually impossible to hit. So this patch just adds a cleanup to only compute v_mount once in brelse(), and in vfs_bio_getpages() always initializes error to zero to appease the static analyzer. No functional change intended. Submitted by: Darrick Lew Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D14613 Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Mar 14 21:32:23 2018 (r330951) +++ head/sys/kern/vfs_bio.c Wed Mar 14 22:11:45 2018 (r330952) @@ -2450,6 +2450,7 @@ buf_dirty_count_severe(void) void brelse(struct buf *bp) { + struct mount *v_mnt; int qindex; /* @@ -2560,11 +2561,13 @@ brelse(struct buf *bp) * around to prevent it from being reconstituted and starting a second * background write. */ + + v_mnt = bp->b_vp != NULL ? bp->b_vp->v_mount : NULL; + if ((bp->b_flags & B_VMIO) && (bp->b_flags & B_NOCACHE || (bp->b_ioflags & BIO_ERROR && bp->b_iocmd == BIO_READ)) && - !(bp->b_vp->v_mount != NULL && - (bp->b_vp->v_mount->mnt_vfc->vfc_flags & VFCF_NETWORK) != 0 && - !vn_isdisk(bp->b_vp, NULL) && (bp->b_flags & B_DELWRI))) { + (v_mnt == NULL || (v_mnt->mnt_vfc->vfc_flags & VFCF_NETWORK) == 0 || + vn_isdisk(bp->b_vp, NULL) || (bp->b_flags & B_DELWRI) == 0)) { vfs_vmio_invalidate(bp); allocbuf(bp, 0); } @@ -4977,6 +4980,7 @@ vfs_bio_getpages(struct vnode *vp, vm_page_t *ma, int object = vp->v_object; mp = vp->v_mount; + error = 0; la = IDX_TO_OFF(ma[count - 1]->pindex); if (la >= object->un_pager.vnp.vnp_size) return (VM_PAGER_BAD); From owner-svn-src-head@freebsd.org Wed Mar 14 22:20:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EBBCF4DFCB; Wed, 14 Mar 2018 22:20:48 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp001.me.com (mr11p00im-asmtp001.me.com [17.110.69.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5F2079D37; Wed, 14 Mar 2018 22:20:47 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp001.me.com by mr11p00im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P5L00600P6EET00@mr11p00im-asmtp001.me.com>; Wed, 14 Mar 2018 22:20:33 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1521066033; bh=dH39DvZpAsXDT2rENC7KQgbwvgwgJlnZKn/NXClJB7U=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=iSs0A+zChB0pM++LDdXXYGArzeagjblwZFX6COLGbjdBiEujAiuRtR1H88758bJvu 8ltTw03AdE+FsjmYDGdo2H7I/kjEZf0C/eKYqsjceLWsz3/skGH11MawJG2Z3lT58e vbDTAMUTZXNNNpsYx51+Wu/Wys2pTONshYn9cHC6iN5RBo6ABiguKBBkG3e2lguj5w viZ+Su3vKVtrh2KY+nkswHfK5/DvEbdXeGTFJH+0XhO4R5BmA0lNeR9/WshxMV4IsV 2bP8OMjb+VtR0iArTlz+hFDv6OOIvoIqD0O7lWSo/n8Ic16Jl7m6xuv7jf0E1dxPbw oDVNg11VD094A== Received: from icloud.com ([127.0.0.1]) by mr11p00im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P5L00N5QQ27QW10@mr11p00im-asmtp001.me.com>; Wed, 14 Mar 2018 22:20:33 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-14_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1803140239 User-Agent: Microsoft-MacOutlook/10.b.0.180311 Date: Wed, 14 Mar 2018 15:20:31 -0700 Subject: Re: svn commit: r330952 - head/sys/kern From: Ravi Pokala To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <7219A600-5C72-43D6-9E8B-7BBC1D097AF2@mac.com> Thread-topic: svn commit: r330952 - head/sys/kern References: <201803142211.w2EMBjVd010880@repo.freebsd.org> In-reply-to: <201803142211.w2EMBjVd010880@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 22:20:48 -0000 -----Original Message----- From: on behalf of Conrad Meyer Date: 2018-03-14, Wednesday at 15:11 To: , , Subject: svn commit: r330952 - head/sys/kern > Author: cem > Date: Wed Mar 14 22:11:45 2018 > New Revision: 330952 > URL: https://svnweb.freebsd.org/changeset/base/330952 > > Log: > vfs_bio.c: Apply cleanups motivated by Coverity analysis What's the Coverity ID? Thanks, Ravi (rpokala@) From owner-svn-src-head@freebsd.org Wed Mar 14 22:50:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC0B8F4F86E for ; Wed, 14 Mar 2018 22:50:29 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 653BB7AED1 for ; Wed, 14 Mar 2018 22:50:29 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm0-x22d.google.com with SMTP id h76so7058602wme.4 for ; Wed, 14 Mar 2018 15:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FJ0KObVfYEJuc6+g7DzWChT5CV4sxhgpEmS2qITuFZ8=; b=m8kr9lBTgh/bcWX2aVIoTdizqo9EDVNhrLIf0GyPuHLwCnAv1FAJXFxDzpiXzk2xzg KZqL0N4RUjiTYnMtTrDMDEcJWjnD1IMbq2A37K5ESrJxp1AwXbYk662HlQ3TBtC7GIV6 JznYjazuRNIp/jf+m/iR35QOnJYGIm54U+8+M45BmWXcTod6Ge1lmIZmoMGSNiBGLZ2M 7VA61u+EV+2Ig/vDuotSSXc2glhj7SFO7i9SKL4h75KdM7h2TVgyb3tIiaMs+vxmd26V nvLbAHd7Hibwil0cwi34EW0KUYOwkxWXLKt27/vhyYN1hdKVSRN+a8NnHA2dEpgV/oyI FTLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FJ0KObVfYEJuc6+g7DzWChT5CV4sxhgpEmS2qITuFZ8=; b=R8VidZ9ZcfPN08c1JTWjbobtTU51vOrvpq7ddYuY6UxhASo/8+LzQICdbwjqTUyvqJ Iy2qc2qpJI2rKDBE2tlfpB9atbMVdrQ22PhI8CAbdYibcGkz4PU0I918LotdGGscRdnC iRL107FwY0XqQ4YL3wkxev25gwyZyOsvkPcIOJMBhwF4a4Hc83hy7jQtirJzuPvXHODX vSWEVLiqYfRZqTDySosNNzqH+8yVyNVBT8YtbulJL21bklblUfsa8ohf43ApiGEu05ZG Smr7a1aH+c2y2raTsfnkcvlNSrhg9Ul0lAKWRo4D48+8rwlmCmDXXP+Y3EHE6zeSQmTX 6zxg== X-Gm-Message-State: AElRT7Hk+TNwrJ2b+dxIsVS7VxJ5mB7jVe/whp6UlYEA44V6TC7u1cvN SH6aZoYUnL+FryYGWmPVk6a3kg== X-Google-Smtp-Source: AG47ELu+bty+4sg7dgU/SNvtcsTUNvLikp1UMCWjRusIKZ7v48e8u+x6EKFiJdNVsJ5HC7lxOF0fmQ== X-Received: by 10.28.108.7 with SMTP id h7mr2825729wmc.35.1521067823304; Wed, 14 Mar 2018 15:50:23 -0700 (PDT) Received: from mutt-hbsd ([5.254.112.154]) by smtp.gmail.com with ESMTPSA id m9sm4205930wrg.79.2018.03.14.15.50.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Mar 2018 15:50:22 -0700 (PDT) Date: Wed, 14 Mar 2018 18:50:09 -0400 From: Shawn Webb To: Alan Somers Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329984 - in head: cddl/contrib/opensolaris/lib/libzpool/common sys/cddl/compat/opensolaris/sys Message-ID: <20180314225009.gu3awgryggsxqmff@mutt-hbsd> References: <201802251429.w1PEThjY035303@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6hriqc5dgbphwzer" Content-Disposition: inline In-Reply-To: <201802251429.w1PEThjY035303@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171215 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 22:50:30 -0000 --6hriqc5dgbphwzer Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 25, 2018 at 02:29:43PM +0000, Alan Somers wrote: > Author: asomers > Date: Sun Feb 25 14:29:43 2018 > New Revision: 329984 > URL: https://svnweb.freebsd.org/changeset/base/329984 >=20 > Log: > Don't declare __assfail as static > =20 > It gets called by dmu_buf_init_user, which is inline but not static. S= o it > needs global linkage itself. > =20 > Reported by: GCC-6 > MFC after: 17 days > X-MFC-With: 329722 >=20 Hey Alan, This commit breaks compiling world with ASAN. Some applications, like zfs, will fail with this error: /lib/libuutil.so.2: Undefined symbol "__assfail" Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --6hriqc5dgbphwzer Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlqppx0ACgkQaoRlj1JF bu4UmQ//UXvruRxifAAXzUyTuhNu++/qKJv1GqV7joVYk71vYfNuSz/kWtXH6G1M f9KZA8+4eK2RlvaJi/UOEWgN1MjJK2HQMu1DxtqjeuTx4i2qTD1eRHGRRO6beEdk mIh6sru587E8yFCHGefYvRq097Fc9gtyIInkU3MbdiF8avfiqbRSy+KCxUcUeo6P bH3A57XONjN8Af+B3U+L+CR1pPiwh5oWKAcFNcOKDBp7v8YdsLZQNwUccfgUNVzk DlkW3bnGU62z/qfsI4yDtNp8tgpqy22AX3Ii1WMcy0lnMM/MrXRM1yrw9MDX93ew UTlzf3Z37TlIPHdMuj+FdmNQUk6RWZl6rNiwuOaZIR47pV/FgzboEXKdWui0av4d CFtfQtYkp+Lu9vAOwV7ahy8mDNVGfVp8MZsyPH5mFzw/SkQGvnMZA8n/ciNu+8ys 12HSBHlaBh9sCvJ0fHIbdfITmYkDgwqip00yyHaET4itWz5xcpuiQvKDWNMHisKZ NvRRuzzooqO50vN9/V1fQ7Zc8Jsa9mZTqJ4w2K8wg7m4PckJhVhVR7y27m9WWBol ZX1wmwXBHnYpS7WwRAHp+fx9ELGKrxMVn9rM7v+KwIuv2sr0DI7p85QfK7503HN5 oUwkJ9dI3CZJ2UK/fAmZvia4rbMWutpFwyM5Q17Mr7WQTkjvFeQ= =8pIF -----END PGP SIGNATURE----- --6hriqc5dgbphwzer-- From owner-svn-src-head@freebsd.org Wed Mar 14 22:51:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6555BF4F991; Wed, 14 Mar 2018 22:51:35 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x229.google.com (mail-lf0-x229.google.com [IPv6:2a00:1450:4010:c07::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF2DA7B2A5; Wed, 14 Mar 2018 22:51:34 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x229.google.com with SMTP id e5-v6so3225992lfb.7; Wed, 14 Mar 2018 15:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ivQ+5w6gqTTydb1tqWIWXFraOTP1/upmkImTTfJeDec=; b=uW15boNDWjtrJL9ymmyRINKGBpwqGdQw/V0FJ9lGJvZ3mwGPfFvfQgWr/BJT/KJRcA 5xiNRQSYoPKd9OoCj208jRpEanZc80It7ojaE/b+lucBZCaYKtf2oqGiNj4qpUDk2ZS2 ZcnzPt3Rv5jujXqv8DQsIpDYQEgmt2PjErnDnm+C10S6kZMJNVdS92nCH6IA0Pn7tJIC 01WYdWJx10Q4knsaU82ps/pS79yQZF5dNU2AwnPieCKBb72X9Z1oWamqYnLsr3qRxEGf aJhLHLDwlGMcRM62Cu2Tw5FLuEz8ickycz3t+Y6UuVFfHGqmIG93tH9/+sDjHEgVvKfd J4FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ivQ+5w6gqTTydb1tqWIWXFraOTP1/upmkImTTfJeDec=; b=IZvGTnN8FOCC6CHNFYnuQ6RfTwf0c5KeaphBUF8hnR0+pC8xlK72fYnsUXb0VMkY4+ AMfIxA9HbxSQpicHNfLsvunX1/VfOY7LDpNSo2WugtNkuMbAfmfSpptZ6VwkYfldAFId E5x54SFmhCH5ATL6TbIJ+5wq3tsqipTbg3aOpyXeAo9B5/UzPiVX8Yt/Rw6WydtohLM3 ZTMsTm94U9LUua5jRoev6olD7kOz+dXh2D+AUCHaghBvyIWtvmkrdG4r+TpoQTyWEJ5b BADw6Lz8gW1JCjzNVTa6SCGodqkViztF5cDHnI3IoizXZeXGry4hyZCDr+Q3mWzGXOML t3gg== X-Gm-Message-State: AElRT7G2WM9wOqTbRs7/SoS6cZsajSJUIrT8S+g04hEWtZOXIYVmH6N+ V26K7l7k6i9IGoSkZRSRbvOczTxeWaijBpChsHM= X-Google-Smtp-Source: AG47ELvbQ31C/QxnTUcrXLcOsOiqeRpEPIDYlkNq7dj9CLsbUclbcGfDTTEh8yZ+sTsuiXaHGKPpSh7PfZDAFp4zKw8= X-Received: by 2002:a19:6d03:: with SMTP id i3-v6mr2115996lfc.34.1521067888317; Wed, 14 Mar 2018 15:51:28 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.2.195 with HTTP; Wed, 14 Mar 2018 15:51:27 -0700 (PDT) In-Reply-To: <20180314225009.gu3awgryggsxqmff@mutt-hbsd> References: <201802251429.w1PEThjY035303@repo.freebsd.org> <20180314225009.gu3awgryggsxqmff@mutt-hbsd> From: Alan Somers Date: Wed, 14 Mar 2018 16:51:27 -0600 X-Google-Sender-Auth: wzY93_gut6vTAIVG8GkPbp6e9tY Message-ID: Subject: Re: svn commit: r329984 - in head: cddl/contrib/opensolaris/lib/libzpool/common sys/cddl/compat/opensolaris/sys To: Shawn Webb Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 22:51:35 -0000 On Wed, Mar 14, 2018 at 4:50 PM, Shawn Webb wrote: > On Sun, Feb 25, 2018 at 02:29:43PM +0000, Alan Somers wrote: > > Author: asomers > > Date: Sun Feb 25 14:29:43 2018 > > New Revision: 329984 > > URL: https://svnweb.freebsd.org/changeset/base/329984 > > > > Log: > > Don't declare __assfail as static > > > > It gets called by dmu_buf_init_user, which is inline but not static. > So it > > needs global linkage itself. > > > > Reported by: GCC-6 > > MFC after: 17 days > > X-MFC-With: 329722 > > > > Hey Alan, > > This commit breaks compiling world with ASAN. > > Some applications, like zfs, will fail with this error: > > /lib/libuutil.so.2: Undefined symbol "__assfail" > > Thanks, > How does one build world with ASAN ? From owner-svn-src-head@freebsd.org Wed Mar 14 22:52:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 899E6F4FBD6; Wed, 14 Mar 2018 22:52:28 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f174.google.com (mail-io0-f174.google.com [209.85.223.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACEF57B4A0; Wed, 14 Mar 2018 22:52:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f174.google.com with SMTP id d11so15981iop.6; Wed, 14 Mar 2018 15:52:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=EJKhYOfqoQupUx11I9Sze+AEcGgMQFHna0T+R8n11QM=; b=QLZ5sftrgpQ0pKfJXkZwBw+vBU0p7SoU34DH1unNp5d9EIPvmcNS3fYASr5A5aTbQd Z5X/jMObphMSuIZIVLCdqSoQ0M0m2rcW6636E3ib0Xo5etEuRTve+Xi9SVfflGGdUEFL UOYb+KvIM7yV2p2NlFa7kE6f+ksbbpbHpwo+DXF/VgktK5DU0jpTA5Bcjw8nLTxpJ3zb xIXXMXChdPbZwgTO4Z04Nra4xib7DrenmptQNWljHGashXBlL8n4pN2++YEZWpwBfNgT rtJdPm9lx+H2Zc18McYIcoWDSowsyb6G4hUo0wJEYc3ffnwIiVWHNgJA/aqUP+F8Md57 Bl4g== X-Gm-Message-State: AElRT7FHp9MMwP1TBZNsm7c+VZJg7IoRYaLTGUkhQV1ZsSjRb49TnhB2 f58zlX2Bd5jZBIb0lzLc1fvloeZl X-Google-Smtp-Source: AG47ELuwIEB9VkuCzDottK4pcC+iIk3gof3xUTg+YC5O9Rl+ocqzGiKfDbhzvOYJJ6lv3wDlyP4Hsw== X-Received: by 10.107.24.4 with SMTP id 4mr6726092ioy.149.1521067588350; Wed, 14 Mar 2018 15:46:28 -0700 (PDT) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com. [209.85.214.46]) by smtp.gmail.com with ESMTPSA id k198-v6sm1796342itk.5.2018.03.14.15.46.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Mar 2018 15:46:28 -0700 (PDT) Received: by mail-it0-f46.google.com with SMTP id e98-v6so1486999itd.4; Wed, 14 Mar 2018 15:46:28 -0700 (PDT) X-Received: by 10.36.161.2 with SMTP id y2mr3985720ite.53.1521067587927; Wed, 14 Mar 2018 15:46:27 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.153.132 with HTTP; Wed, 14 Mar 2018 15:46:27 -0700 (PDT) In-Reply-To: <7219A600-5C72-43D6-9E8B-7BBC1D097AF2@mac.com> References: <201803142211.w2EMBjVd010880@repo.freebsd.org> <7219A600-5C72-43D6-9E8B-7BBC1D097AF2@mac.com> From: Conrad Meyer Date: Wed, 14 Mar 2018 15:46:27 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r330952 - head/sys/kern To: Ravi Pokala Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 22:52:28 -0000 I believe they didn't come from the public FreeBSD Coverity instance, and I don't think ID numbers are portable between instances. You might be able to look up similar issues in the public instance, though. Best, Conrad On Wed, Mar 14, 2018 at 3:20 PM, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Conrad Meyer > Date: 2018-03-14, Wednesday at 15:11 > To: , , > Subject: svn commit: r330952 - head/sys/kern > >> Author: cem >> Date: Wed Mar 14 22:11:45 2018 >> New Revision: 330952 >> URL: https://svnweb.freebsd.org/changeset/base/330952 >> >> Log: >> vfs_bio.c: Apply cleanups motivated by Coverity analysis > > What's the Coverity ID? > > Thanks, > > Ravi (rpokala@) > > > From owner-svn-src-head@freebsd.org Wed Mar 14 22:56:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 620B5F4FF3A; Wed, 14 Mar 2018 22:56:07 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6F557B766; Wed, 14 Mar 2018 22:56:06 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x242.google.com with SMTP id t132-v6so7285306lfe.2; Wed, 14 Mar 2018 15:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=lCf5xpMuYQMAtv8ltbgifZpOFCWFVt/VbCAqtC0L+5o=; b=tSIj3ZUiMOA2zHrZsne3PfX3kvumoDjR4K9QERDk+TyTpvO7UGHUyCqsGsL80mME8t 7eIaqLYKyxxUOA5MnsxBmZAjpwXMMJLY0f+jwwvzZV15it3MXst28yVRyULBedPWJ8z3 pCN+gbkHWFS2etx57ZR79xEJvObU1z7ser0VNbzT5xiyEJFKTjMsrF6gYzu3fTF9U5Fd 8Nf8tnqQe1sokzNklmjSJhMBTMXrpBaTfvlfZHYoW0cHeB8f3ZuO6DlNlQkB4WcUVO1J Vxk0htTFM3BLgkPwNi9iXcKsXnp4xkmlrnxUBkMf7ir5OTrAKqVAiGVHLMuPw9Y0eR11 Ku8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=lCf5xpMuYQMAtv8ltbgifZpOFCWFVt/VbCAqtC0L+5o=; b=I5/Imzou69rN4KMGsVxjejUn/XW/Wuvqu/FA51kyc1Kp0gsItKk0dqRJo5KA0Rln2k LB0AY91ICZdtX89YnA46lJ0Zl/G8UNdnJIkhYgnb7Vos3XyZm0AaRurq0q2E8GGKh9A0 0h3CnpwaJq7/y05OOlufoWNBnN7z54C9NBxbyTtV3NGt+PWXkNfguhBNVPY/X0GF0wbH CM3s3nE36Dfnyd4NxTLMwi1TYccInoI7U4tiSP9TgdQB5qakBIXA8sGFCuuXlI+rReNe /LPsHfJVJdVXgnEIFEksRg+iwF6IuB8qj40bEDGfK0OnYdC3WVtXF+R9+PPx1vVUJ8Or 1Q0A== X-Gm-Message-State: AElRT7GxitswHmtUQfprRe0p8MFyCcMbpuLfTllIKR3/1N2HHzRsL0gv YSL4L4oj1Tfl8zHm9hNRqn2LW1CtWq0jl55Vito= X-Google-Smtp-Source: AG47ELuZhc99YE1dJLPKePSZEax40p+LlUfCBK5ERG9VOc5t82LTb90RTlqqxrsxGDuPyhpG/FUG3W5SBjmQOyPYt3k= X-Received: by 10.46.154.213 with SMTP id p21mr1314641ljj.59.1521068165170; Wed, 14 Mar 2018 15:56:05 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.2.195 with HTTP; Wed, 14 Mar 2018 15:56:04 -0700 (PDT) In-Reply-To: References: <201803142211.w2EMBjVd010880@repo.freebsd.org> <7219A600-5C72-43D6-9E8B-7BBC1D097AF2@mac.com> From: Alan Somers Date: Wed, 14 Mar 2018 16:56:04 -0600 X-Google-Sender-Auth: i65UtCOv1lekUN9jjwcQboCg3cY Message-ID: Subject: Re: svn commit: r330952 - head/sys/kern To: "Conrad E. Meyer" Cc: Ravi Pokala , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 22:56:07 -0000 Well, you _would_ be able to, except the public instance has been down for 3 weeks :( https://scan.coverity.com/ On Wed, Mar 14, 2018 at 4:46 PM, Conrad Meyer wrote: > I believe they didn't come from the public FreeBSD Coverity instance, > and I don't think ID numbers are portable between instances. You > might be able to look up similar issues in the public instance, > though. > > Best, > Conrad > > On Wed, Mar 14, 2018 at 3:20 PM, Ravi Pokala wrote: > > -----Original Message----- > > From: on behalf of Conrad Meyer > > > Date: 2018-03-14, Wednesday at 15:11 > > To: , , < > svn-src-head@freebsd.org> > > Subject: svn commit: r330952 - head/sys/kern > > > >> Author: cem > >> Date: Wed Mar 14 22:11:45 2018 > >> New Revision: 330952 > >> URL: https://svnweb.freebsd.org/changeset/base/330952 > >> > >> Log: > >> vfs_bio.c: Apply cleanups motivated by Coverity analysis > > > > What's the Coverity ID? > > > > Thanks, > > > > Ravi (rpokala@) > > > > > > > > From owner-svn-src-head@freebsd.org Wed Mar 14 22:56:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EB07F4FF9C for ; Wed, 14 Mar 2018 22:56:38 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3A6B7B8A1 for ; Wed, 14 Mar 2018 22:56:37 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm0-x22b.google.com with SMTP id i194so7041921wmg.1 for ; Wed, 14 Mar 2018 15:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+G2LKilQWpU4xzD85C+CWtGPeZGoTIcECSNak5eGcVU=; b=EgWhiCBhjDc++HvrOH1+2D1XjQhHU5bBKEP8ZWJyUyk6tbBR9DK58a+cGnXxR+1anS KjjQ5b2jTFdHwx9CRU+s5EiOHPLOwhVwKfRvgWS8XIyHvbZKh7rLGOmqCEGEfox/W1Xw xpQWRZRd9s3G0tBl9M8Rj0J0PdDWA+qugajwPXH/cW2rmuqUrWaGvgBbCZ/29WYHx4WU 2atIIfnMExhRnhJ+0YUZsIlEy6Kfwh7i6RR331csHFDCdqWC3Ranou2sTGsCHu45MMCl /UOAq51UxmSOX0KuAun1RQTl4PqoskhxuVMXIdaocNsv5uYw4eKyMjgBHUnH7yT6XmoT /R1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+G2LKilQWpU4xzD85C+CWtGPeZGoTIcECSNak5eGcVU=; b=Oezoy6NBd1HvR+r4DkPOYg9VbmssgEh5tTOCFqldZTjXLV9Xp4o0AyrAAE1Tmj3Ntd yhhRvZd2pj1YKNuLpSB+bu/QvDk544zWtI59oJ46P6bxPZ4+m8N6dKpio0hRK6JRi1O1 YKYr3SZbfzBxuebBHwoJnBmpN9vL25AYZE0Um8+lnuMgCrM349W3TSSeVzcVWj3rIOeP zNYvLbdN7eot1+IaPZq6TMnAQi8cM2fjMJI7neVeNjyV3hxoU6CCV76gBEAnYL8qzaaX vRhBVNdvU25pL4Z9mccnKWcA3lX96/J8zUXJUIhp52TALWoxhsdz39/lFxC0NhZOqCjt UFVg== X-Gm-Message-State: AElRT7FB5v7W55oD266JElJxBbqiwMW8sqK7lI+jCwtPQEy1pwF2Kd1f pXEE7G0mjk4g4Pqqj4L4EsjPjg== X-Google-Smtp-Source: AG47ELv4jDzf6G/Q8XIZqAy1sDnAvEyWZ0+F/m7i8tiEuu3uG8lpCIqLJwjgmI3/vbB4y01PBDATrw== X-Received: by 10.28.137.147 with SMTP id l141mr2787388wmd.141.1521068196537; Wed, 14 Mar 2018 15:56:36 -0700 (PDT) Received: from mutt-hbsd ([5.254.112.154]) by smtp.gmail.com with ESMTPSA id z39sm5490694wrz.19.2018.03.14.15.56.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Mar 2018 15:56:35 -0700 (PDT) Date: Wed, 14 Mar 2018 18:56:23 -0400 From: Shawn Webb To: Alan Somers Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329984 - in head: cddl/contrib/opensolaris/lib/libzpool/common sys/cddl/compat/opensolaris/sys Message-ID: <20180314225623.zp6ufw5h7bua4etf@mutt-hbsd> References: <201802251429.w1PEThjY035303@repo.freebsd.org> <20180314225009.gu3awgryggsxqmff@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ye3dpcyzgfytrpzo" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171215 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 22:56:38 -0000 --ye3dpcyzgfytrpzo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 14, 2018 at 04:51:27PM -0600, Alan Somers wrote: > On Wed, Mar 14, 2018 at 4:50 PM, Shawn Webb > wrote: >=20 > > On Sun, Feb 25, 2018 at 02:29:43PM +0000, Alan Somers wrote: > > > Author: asomers > > > Date: Sun Feb 25 14:29:43 2018 > > > New Revision: 329984 > > > URL: https://svnweb.freebsd.org/changeset/base/329984 > > > > > > Log: > > > Don't declare __assfail as static > > > > > > It gets called by dmu_buf_init_user, which is inline but not static. > > So it > > > needs global linkage itself. > > > > > > Reported by: GCC-6 > > > MFC after: 17 days > > > X-MFC-With: 329722 > > > > > > > Hey Alan, > > > > This commit breaks compiling world with ASAN. > > > > Some applications, like zfs, will fail with this error: > > > > /lib/libuutil.so.2: Undefined symbol "__assfail" > > > > Thanks, > > >=20 > How does one build world with ASAN ? HardenedBSD has a feature branch in its playground repo for ASAN-ified world. We introduced two new MK_* toggles: MK_ASAN and MK_ASAN_RECOVER. MK_ASAN is self-explanitory. MK_ASAN_RECOVER tells the sanitizer framework to let the application continue running instead of abort execution. Here's where the magic gets set: https://github.com/HardenedBSD/hardenedBSD-playground/blob/hardened/current= /asan/share/mk/bsd.prog.mk#L125-L134 Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --ye3dpcyzgfytrpzo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlqpqJcACgkQaoRlj1JF bu64kw//ZnaTKF5HLdKL0M8/lDw/6dPnkHE9y8hBIyl24jWJUeXrv/7qCbBlRvuf I3x3o1LO8EVvyPWJYtnAXOvnn1odFSZ6RpnOvM6QZHEvW3aOwhXC6xjRMVCxTdoa R30NbCyly76ZOghcXGZoZdCY/0c6cUdVxgiXqPDca+dVQRZhLMs0nqHKazewiiUE +u+f8w3R0SZcAWYcctYfrMSIHyi/7z4Nhe5uz99Kc8MsVrdTw47FARsApod35E0F H7srtVsLclK34vlgCWW5wjTXaedto6CMoYAB+PiINQ67c3KDdkOOkJhNVw5koVir nr4uwmqEHkCDmLOr0A/w1BpekLib7PGlKYiK+T6PqfFbRqXfrulJeLjC6ci/MYOi V6YG8yhVrd/pisLvMVemquDexP/FJG3/1B8H/H14wrGDDqSg1i4F+cPwqXtfy0NI u3Xg26nv/qK/ydXcHOnFadAPytFxVl+5k+ijP+kWwyfjAk2G4q/R88Uz6zWAmbI+ xjmXBuMG4aNvjaTnb5gfLphRof9EcyrAGF9CAyYQBJr/asqVZIDhI/LCmonnlJvl j0rJ1RzJPioRFPCCpZ7ePlRhBCO7cPIiwQrzUE6rTEpMPu9r8hybvoK35eALab1r PJaPtrJjysTM11GKkX6HjvaKE5RToiX6Rzu7BWUf1wMweBuk9Fg= =SzXb -----END PGP SIGNATURE----- --ye3dpcyzgfytrpzo-- From owner-svn-src-head@freebsd.org Wed Mar 14 23:01:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F037F502ED; Wed, 14 Mar 2018 23:01:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 002AF7BBF7; Wed, 14 Mar 2018 23:01:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF148618B; Wed, 14 Mar 2018 23:01:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EN14Ff037528; Wed, 14 Mar 2018 23:01:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EN14nu037527; Wed, 14 Mar 2018 23:01:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803142301.w2EN14nu037527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 14 Mar 2018 23:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330953 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 330953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 23:01:05 -0000 Author: imp Date: Wed Mar 14 23:01:04 2018 New Revision: 330953 URL: https://svnweb.freebsd.org/changeset/base/330953 Log: Don't make the namespace devices eternal. We'll need to delete namespaces soon, so go ahead and stop making these devices eternal. It doesn't help much, and will be getting in the way soon. Sponsored by: Netflix Modified: head/sys/dev/nvme/nvme_ns.c Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Wed Mar 14 22:11:45 2018 (r330952) +++ head/sys/dev/nvme/nvme_ns.c Wed Mar 14 23:01:04 2018 (r330953) @@ -577,21 +577,9 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t */ unit = device_get_unit(ctrlr->dev) * NVME_MAX_NAMESPACES + ns->id - 1; -/* - * MAKEDEV_ETERNAL was added in r210923, for cdevs that will never - * be destroyed. This avoids refcounting on the cdev object. - * That should be OK case here, as long as we're not supporting PCIe - * surprise removal nor namespace deletion. - */ -#ifdef MAKEDEV_ETERNAL_KLD - ns->cdev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &nvme_ns_cdevsw, unit, - NULL, UID_ROOT, GID_WHEEL, 0600, "nvme%dns%d", - device_get_unit(ctrlr->dev), ns->id); -#else ns->cdev = make_dev_credf(0, &nvme_ns_cdevsw, unit, NULL, UID_ROOT, GID_WHEEL, 0600, "nvme%dns%d", device_get_unit(ctrlr->dev), ns->id); -#endif #ifdef NVME_UNMAPPED_BIO_SUPPORT ns->cdev->si_flags |= SI_UNMAPPED; #endif From owner-svn-src-head@freebsd.org Wed Mar 14 23:01:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10208F5044D; Wed, 14 Mar 2018 23:01:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AFAB7BD1B; Wed, 14 Mar 2018 23:01:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95DC2619C; Wed, 14 Mar 2018 23:01:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EN1Ixm037585; Wed, 14 Mar 2018 23:01:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EN1I7B037584; Wed, 14 Mar 2018 23:01:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803142301.w2EN1I7B037584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 14 Mar 2018 23:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330954 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 330954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 23:01:19 -0000 Author: imp Date: Wed Mar 14 23:01:18 2018 New Revision: 330954 URL: https://svnweb.freebsd.org/changeset/base/330954 Log: When tearing down a queue pair, also delete the queue entries. The NVME standard has required in section 7.2.6, since at least 1.1, that a clean shutdown is signalled by deleting the subission and the completion queues before setting the shutdown bit in CC. The 1.0 standard, apparently, did not and many of the early Intel cards didn't care. Some newer cards care, at least one whose beta firmware can scramble the card on an unclean shutdown. Linux has done this for some time. To make it possible to move forward with an evaluation of this pre-release card with wonky firmware, delete the queues on the card when we delete the qpair structures. Sponsored by: Netflix Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Wed Mar 14 23:01:04 2018 (r330953) +++ head/sys/dev/nvme/nvme_ctrlr.c Wed Mar 14 23:01:18 2018 (r330954) @@ -514,6 +514,34 @@ nvme_ctrlr_create_qpairs(struct nvme_controller *ctrlr } static int +nvme_ctrlr_destroy_qpair(struct nvme_controller *ctrlr, struct nvme_qpair *qpair) +{ + struct nvme_completion_poll_status status; + + status.done = 0; + nvme_ctrlr_cmd_delete_io_sq(qpair->ctrlr, qpair, + nvme_completion_poll_cb, &status); + while (!atomic_load_acq_int(&status.done)) + pause("nvme", 1); + if (nvme_completion_is_error(&status.cpl)) { + nvme_printf(ctrlr, "nvme_create_io_sq failed!\n"); + return (ENXIO); + } + + status.done = 0; + nvme_ctrlr_cmd_delete_io_cq(ctrlr, qpair, + nvme_completion_poll_cb, &status); + while (!atomic_load_acq_int(&status.done)) + pause("nvme", 1); + if (nvme_completion_is_error(&status.cpl)) { + nvme_printf(ctrlr, "nvme_create_io_cq failed!\n"); + return (ENXIO); + } + + return (0); +} + +static int nvme_ctrlr_construct_namespaces(struct nvme_controller *ctrlr) { struct nvme_namespace *ns; @@ -1274,6 +1302,7 @@ nvme_ctrlr_destruct(struct nvme_controller *ctrlr, dev destroy_dev(ctrlr->cdev); for (i = 0; i < ctrlr->num_io_queues; i++) { + nvme_ctrlr_destroy_qpair(ctrlr, &ctrlr->ioq[i]); nvme_io_qpair_destroy(&ctrlr->ioq[i]); } From owner-svn-src-head@freebsd.org Wed Mar 14 23:06:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1732F5081F; Wed, 14 Mar 2018 23:06:11 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com [IPv6:2a00:1450:4010:c07::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EB3F7C1C9; Wed, 14 Mar 2018 23:06:11 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x22e.google.com with SMTP id e5-v6so3265231lfb.7; Wed, 14 Mar 2018 16:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=/O+oTxbLJSd6GeRVzUN2D+eWPQ42ca6YHX/RIKzqKNE=; b=HggjDVi0+HpavgRURRvTicVx4QQw0RIRXfd6nchag2Z81FJKaQDwxK84AWdwCemqK+ CZfzzKm7f38kl+sTugHS/dzgQBeqF5bssgeKERPeCIhyP0CeYLKu8kDFfoweTexspBOF EoTKHkfINVrIT5YEUHjIac13hjPGyj7eBpNz1s9n7wFRNQWVRzJW/wq6asSdp9dBbTOu DcHncVRPgpZQZyABhC/5ocQEKX71L37ghNdFniUcwSkt7QgWFiDagCh/MTYkw86sb6Zw GAs+P4WSuMkOFjhfgqZB0Rclyrvn/FubnLKXa6Fg7UxWsWgER5lgJ/Jg6hUoU9sudGVe ReuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=/O+oTxbLJSd6GeRVzUN2D+eWPQ42ca6YHX/RIKzqKNE=; b=SNx33tuzLc//SldClF4t5SxDj53dLF3JCmj2NdzZB5GkmrJV9H9oqVA5SJmXfiJ8a4 4AMN5Gr+0joib263CeEuEd9HuGVQH5SMOHunyKpKNiIBco4a3tr7sn+vg6de/LqzVL62 HYv1Z7ZQ8pGSv/bwn6cE3cQTVzhgL8OpFaJgctEn2yZcsSphRs304cs7Ggb1ejv5BUZK P/ZJQDDvWudDDJhj+1JDLUSm4FUK0Zk5XQSyXgC++pmuSi9bQIBiCIRwXMiYoIFDGLJX KEaIN8r8TDymVP735TFBZtUwXdTuPtJ4CngnW+acwPU/AQs7iFuNugVkF755YriY4LPg s22Q== X-Gm-Message-State: AElRT7GxsaNKixht7cqU39VGc1Hcg1EchHrAFrif2GTFigbJ4GDZNo3T /YKn091WZx5BZdjlbDIIjQP6w/vquI9DDsrPzcE= X-Google-Smtp-Source: AG47ELt6CAWWIyGyOvz9lk1/9ODj0faDuWpRngjt98dZ9TOrgSisii9velI0M2pTN17CYI6ThEgK73LwbGRVBllnnYs= X-Received: by 10.46.157.135 with SMTP id c7mr2838949ljj.46.1521068769714; Wed, 14 Mar 2018 16:06:09 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.2.195 with HTTP; Wed, 14 Mar 2018 16:06:09 -0700 (PDT) In-Reply-To: <20180314225623.zp6ufw5h7bua4etf@mutt-hbsd> References: <201802251429.w1PEThjY035303@repo.freebsd.org> <20180314225009.gu3awgryggsxqmff@mutt-hbsd> <20180314225623.zp6ufw5h7bua4etf@mutt-hbsd> From: Alan Somers Date: Wed, 14 Mar 2018 17:06:09 -0600 X-Google-Sender-Auth: mtzKjN0uTjC4Hg8b-LMUpzx65so Message-ID: Subject: Re: svn commit: r329984 - in head: cddl/contrib/opensolaris/lib/libzpool/common sys/cddl/compat/opensolaris/sys To: Shawn Webb Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 23:06:12 -0000 On Wed, Mar 14, 2018 at 4:56 PM, Shawn Webb wrote: > On Wed, Mar 14, 2018 at 04:51:27PM -0600, Alan Somers wrote: > > On Wed, Mar 14, 2018 at 4:50 PM, Shawn Webb > > wrote: > > > > > On Sun, Feb 25, 2018 at 02:29:43PM +0000, Alan Somers wrote: > > > > Author: asomers > > > > Date: Sun Feb 25 14:29:43 2018 > > > > New Revision: 329984 > > > > URL: https://svnweb.freebsd.org/changeset/base/329984 > > > > > > > > Log: > > > > Don't declare __assfail as static > > > > > > > > It gets called by dmu_buf_init_user, which is inline but not > static. > > > So it > > > > needs global linkage itself. > > > > > > > > Reported by: GCC-6 > > > > MFC after: 17 days > > > > X-MFC-With: 329722 > > > > > > > > > > Hey Alan, > > > > > > This commit breaks compiling world with ASAN. > > > > > > Some applications, like zfs, will fail with this error: > > > > > > /lib/libuutil.so.2: Undefined symbol "__assfail" > > > > > > Thanks, > > > > > > > How does one build world with ASAN ? > > HardenedBSD has a feature branch in its playground repo for ASAN-ified > world. > > We introduced two new MK_* toggles: MK_ASAN and MK_ASAN_RECOVER. > MK_ASAN is self-explanitory. MK_ASAN_RECOVER tells the sanitizer > framework to let the application continue running instead of abort > execution. > > Here's where the magic gets set: > > https://github.com/HardenedBSD/hardenedBSD-playground/blob/hardened/ > current/asan/share/mk/bsd.prog.mk#L125-L134 > > Thanks, > I don't use HardenedBSD. Can you provide an invocation that will demonstrate the breakage on FreeBSD head? I tried a few things, and they all either worked, or failed with errors other than the one you showed. From owner-svn-src-head@freebsd.org Wed Mar 14 23:12:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF292F50DB8 for ; Wed, 14 Mar 2018 23:12:05 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wr0-x230.google.com (mail-wr0-x230.google.com [IPv6:2a00:1450:400c:c0c::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1E867C6E3 for ; Wed, 14 Mar 2018 23:12:04 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wr0-x230.google.com with SMTP id s18so6367514wrg.9 for ; Wed, 14 Mar 2018 16:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3heOQTW182WIoLtztSyvVajSB//2/CI2J2dUJEfROq8=; b=PXie4MIi0hO9lZcZlUD0fXCjWcPHMMPFJK8Z/1SMrYcevCikU1bI/ZbtrMjRyDMMWr SqDS4fYqoRLN5An1m9dU4pKrErhALTf1tNxVyAMgUM/DA9aT6OiZ/W3tPPy9jdPq1XXI pLs9gCWF5Z0RE8hluj77Dwcf+K3B09TiFbs/pQFVvBHcXvNy1DrSDA07frt8ynToH+tN C/LzXC/Y9V70TY54EA6NE/GIlWeUUgfwqJxK1PTMw/4+BUy5SrJ3wFH+EP77B6IOCSwF tDgb05tdnOrrpV1M7dn8/2LF4JgM8eHFbBwVDg3K1c6meIpZFQBmzrDFUA1qm7pYh585 TcFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3heOQTW182WIoLtztSyvVajSB//2/CI2J2dUJEfROq8=; b=rpASEFcbwsRhrNBUM8QQLn0EIVbKqYszewYgIaMegEKB1ZfVGc33x9jhdKEtOLX0aC peEOJXFYUdh1fxHPyJriN5NuFaSN6KSiJlHt9Sp58YuCf+zWVGPc2b/44YxwsiM8zgmd fp9mxn95CzNeLHRNzwcSFz9wH6+2bLTYKR8tcmijmJeXX8ImPTaxedILXB2QNVw639Rb zPZcg14BWT/hwUDSecdDBlpn1eUTM7vGzTMiL+HG8LjF6j8IQ6BZE1unNqeZDaSXO8H7 Sv5paZyJ41BqwDbTmV0q0yl5TqO386mnvnHpi+pE2p6I+SqbjhhJHBZyhTqkBDdO4hyn +6iQ== X-Gm-Message-State: AElRT7ECxBHoQyjy/MhiykPi2SXRmphG+tClqwlAI/AYtohXcB20GsKH GOIfYI9SxLDHrZvglCm2Uo6/sQ== X-Google-Smtp-Source: AG47ELtM/XRVI35t5243L0k4rbw+i/WfKNeq2re5oA9wFoNlTqVVxTRq6ETs8cBMOXtPW1dn6EOQHw== X-Received: by 10.223.136.146 with SMTP id f18mr5431548wrf.57.1521069123780; Wed, 14 Mar 2018 16:12:03 -0700 (PDT) Received: from mutt-hbsd (torsrv0.snydernet.net. [185.100.86.154]) by smtp.gmail.com with ESMTPSA id d4sm2561482wmh.42.2018.03.14.16.12.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Mar 2018 16:12:03 -0700 (PDT) Date: Wed, 14 Mar 2018 19:11:50 -0400 From: Shawn Webb To: Alan Somers Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329984 - in head: cddl/contrib/opensolaris/lib/libzpool/common sys/cddl/compat/opensolaris/sys Message-ID: <20180314231150.whi6ndflt77iyybw@mutt-hbsd> References: <201802251429.w1PEThjY035303@repo.freebsd.org> <20180314225009.gu3awgryggsxqmff@mutt-hbsd> <20180314225623.zp6ufw5h7bua4etf@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gu7ci6sptypsxkle" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171215 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 23:12:06 -0000 --gu7ci6sptypsxkle Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 14, 2018 at 05:06:09PM -0600, Alan Somers wrote: > On Wed, Mar 14, 2018 at 4:56 PM, Shawn Webb > wrote: >=20 > > On Wed, Mar 14, 2018 at 04:51:27PM -0600, Alan Somers wrote: > > > On Wed, Mar 14, 2018 at 4:50 PM, Shawn Webb > > > wrote: > > > > > > > On Sun, Feb 25, 2018 at 02:29:43PM +0000, Alan Somers wrote: > > > > > Author: asomers > > > > > Date: Sun Feb 25 14:29:43 2018 > > > > > New Revision: 329984 > > > > > URL: https://svnweb.freebsd.org/changeset/base/329984 > > > > > > > > > > Log: > > > > > Don't declare __assfail as static > > > > > > > > > > It gets called by dmu_buf_init_user, which is inline but not > > static. > > > > So it > > > > > needs global linkage itself. > > > > > > > > > > Reported by: GCC-6 > > > > > MFC after: 17 days > > > > > X-MFC-With: 329722 > > > > > > > > > > > > > Hey Alan, > > > > > > > > This commit breaks compiling world with ASAN. > > > > > > > > Some applications, like zfs, will fail with this error: > > > > > > > > /lib/libuutil.so.2: Undefined symbol "__assfail" > > > > > > > > Thanks, > > > > > > > > > > How does one build world with ASAN ? > > > > HardenedBSD has a feature branch in its playground repo for ASAN-ified > > world. > > > > We introduced two new MK_* toggles: MK_ASAN and MK_ASAN_RECOVER. > > MK_ASAN is self-explanitory. MK_ASAN_RECOVER tells the sanitizer > > framework to let the application continue running instead of abort > > execution. > > > > Here's where the magic gets set: > > > > https://github.com/HardenedBSD/hardenedBSD-playground/blob/hardened/ > > current/asan/share/mk/bsd.prog.mk#L125-L134 > > > > Thanks, > > >=20 > I don't use HardenedBSD. Can you provide an invocation that will > demonstrate the breakage on FreeBSD head? I tried a few things, and they > all either worked, or failed with errors other than the one you showed. No worries. I've just reverted the commit in that feature branch. If I have time, I'll see about porting the ASAN work to vanilla FreeBSD. But my time is extremely limited these days. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --gu7ci6sptypsxkle Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlqprDEACgkQaoRlj1JF bu5JjQ/+L+8YxLuF6A8521Jf1Z1MHyP/n13HmM30KPIKWIrM/9phA+9qxm6IUnWG ixOoF/RsTn07M2BkJLL/LzFoluIXiY+CFv01bI7eRu8raLugppbNsU7L4LDJlThK I3xlxfhwRhu175VAIfl5+PPxcBRKMcsu0yAkucoijKXqMVjwnyEu+EOwv1GhdNC4 y/JduSI459khEpOA9kHfXAZ/8dl9m7XLG1vgcs/Ix+m+4KDMXXb7oU/xlxc4yES5 eRRzWmWk2CAK0SQDDdCC3tTgOqZXpJT0JpvJrHXR6J1D0nEBL2ehIA/+dZKwUJqX BPYQr3vYhVL3cEINK10j/EUkTbba0kYkuGCi+XhDZqTI7flSUF24w8xqRr2SEhyk 19OaT1Zwy/nGQgKRrdyKF2mXib+m+55Noo3rF/VPLHlSJttXPQUFKyxGUYd03D5x iAWRdziSHPh2XSPebGCPEF71XRKsfM7zyfwPpE4ItpX8AaTxUZvWq/x9HZoIjXTN eYBTppg6lwoTm+UZKvyLcJ5t/oyqt6a7rEE62lZsBdWMpoyJ3/cRylfZ1KnVYjhY 2wysY1Rm7vd30lq+m/hB0K2l2DlpQjpbd9m71apgJ7x8fQc8CNHIvQ79t7R5vK1d IDozYqUHKi5fEojJHgmgL7JzD1ObWWpQoaDihcFMpWqYe1laZLo= =0VSS -----END PGP SIGNATURE----- --gu7ci6sptypsxkle-- From owner-svn-src-head@freebsd.org Wed Mar 14 23:19:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC70DF5134B; Wed, 14 Mar 2018 23:19:02 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E20F7CC1C; Wed, 14 Mar 2018 23:19:02 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id d71so6368906iog.4; Wed, 14 Mar 2018 16:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=GaShFCSPkuEZt1uEWC4xOw8UUCOYY+BeoBbowlqu8eM=; b=J9nTtdxK3c45quIUgPfE6UEyllPybvhKSqXIJUhB6sJefXI+8t9VE0h1L27Rc0hiyX gxPEd4fFXcyRKy1UuwZPx1MhYLdTp4ocjjk/DAUqvHYQaIcdHWUpvmlsAKJj3UazIWGW ztNZIPRiJf76qfWNjFa2KwPBE+3OEYU/NOZHGSwB3tM/Jq+OnvzZ5Xum1FufTGwIbuzI PWuBjlL0O91Qu+eF8Lx9VUd0Uot3yadq5ECtmmfkUg2P3sbev8RD9X17MjBFBhtXZr8+ lRMoflkDY4cS5TbIRBKd0pETzXgjtDJOjxuZIp2GIoUp5aXX6j0FVAfqLNkEs+Fysh/x 9EsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=GaShFCSPkuEZt1uEWC4xOw8UUCOYY+BeoBbowlqu8eM=; b=T5qStay0o8mg9Qt5+QRHGvZO8ay4Nvq0I4xCV1R+imMlRtUYNyN01CiI6ItNkmVclr F7QkGMi97PJfLN53GWoapr05uduI3qrKMRbuPzZLfPzVQLsUCTg+DsI+KKHSwF0Y30fj QfUgTvMX5zSErGeWadRgFysq4eLFe9OUIgbrn8CskT5CmOIbm2yEk4eDB4RK/uEG4hdo fKfR669O9VoaSsEGtnbDEfNKs+b9o4q9WeLqaMkajRH9NzSU3uXGpslEr8hjWmXDZoQd BIKl4El4wpGhw2wNEQY2632g0fA5I0B5JEdasWtp63BxxTybh0Fcz63bNids8niYUxxK tEiw== X-Gm-Message-State: AElRT7GCwcwer7Xw59e8N9J87pnI8BjJPC+10aIaHOMhdCCvaCeBHQdb 1rVbuQ5tE1V5GXDOjDoElWbOSMRa+SghHgD7NbIUnw== X-Google-Smtp-Source: AG47ELtJiXQ77g7NrZSFg8MIHb9pY+yCeI6sz4KS/+jwuTJaI46MPWiTjhgk3VTU3jWq2AcQ9HAWVbTB7tJonEJPzFM= X-Received: by 10.107.134.85 with SMTP id i82mr3458020iod.210.1521069541621; Wed, 14 Mar 2018 16:19:01 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.163.13 with HTTP; Wed, 14 Mar 2018 16:18:41 -0700 (PDT) In-Reply-To: <201712282146.vBSLk9Uo033652@repo.freebsd.org> References: <201712282146.vBSLk9Uo033652@repo.freebsd.org> From: Ed Maste Date: Wed, 14 Mar 2018 19:18:41 -0400 X-Google-Sender-Auth: JIw29IQXDS_VQ-i_L5pdjpgPXbw Message-ID: Subject: Re: svn commit: r327314 - head/sys/x86/x86 To: Marius Strobl Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 23:19:03 -0000 On 28 December 2017 at 16:46, Marius Strobl wrote: > Author: marius > Date: Thu Dec 28 21:46:09 2017 > New Revision: 327314 > URL: https://svnweb.freebsd.org/changeset/base/327314 > > Log: > With the advent of interrupt remapping, Intel has repurposed bit 11 > (now: Interrupt_Index[15]) and assigned the previously reserved bits > ... Will you MFC this to stable/11 so it can arrive in 11.2? From owner-svn-src-head@freebsd.org Wed Mar 14 23:20:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3902AF51416; Wed, 14 Mar 2018 23:20:03 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x22d.google.com (mail-lf0-x22d.google.com [IPv6:2a00:1450:4010:c07::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 847637CD82; Wed, 14 Mar 2018 23:20:02 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x22d.google.com with SMTP id e5-v6so3301494lfb.7; Wed, 14 Mar 2018 16:20:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=GZSy6Q2lLfWuyVUvhjmo4r+sMwCm5hjZZbA/uTrYzX0=; b=R1P4czo0tNRsAzNoz6/DHG59plOyz3FyLjVy6lvD9FPezQYR1F+X/7uI0gbSD08xle Aa5Fva8L9fzKyTRKSNUUpTi9Tzgxdm9f3PctsDmPnUv/8MVp2LXzaihTWIko7M8P1tBJ W55i0wDEP8buVkCXlE7/pBW2xvsdPOOU3UM7ZTqWPwuJYXrvxwpdwfUDIGBgEvUMQ+5V pQrcTPTZEx4BHRrSvHSEWmGE2ZXNSUSxMCNEH2mhwMoa67Zh7RO1jiL8DGiPp+FDaHLe dtqBvuTSBqaGwgcCYx/TnxM0BkIVwiXdUXg/romedYFxRocZN9F2FUGWVm4sfIyFFzID SBSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=GZSy6Q2lLfWuyVUvhjmo4r+sMwCm5hjZZbA/uTrYzX0=; b=Zd8pEb8nNG0ltpnuW+xxnBVwFSzVpeqjTisHyg40cyVt5qvg4bn+4Xur63DhGaLQrW 7CbvvjWZYEhuWQ+zTynyiKybnidz/PbGzdHSkPcKz1/MZuwKpJpgN1lidj6eUqK7D8Jo gv8I2o/icCx5YNyLUwapv78lZ9mHZB64JzWL0sPLFD5h7v6bwU0Pw1fc2Ck5Zt6Gd8Wk a0xT0dLeecZums02B5s38VgxrU/snwS6hlKte7I7sONKYOmzsnfOF98muIkhKISho1Ra IHkvlVhNXfw5G1ApSIotVl4jztIxQysp6zk/y/vrrEoi+JJ8AXDt9Xbp7rJIX4vCoRCJ UyRQ== X-Gm-Message-State: AElRT7G/72bU2JZCY4XbnT16gG/jHgosnVKB7KnNm6fh1c31cSgjsJZB 7bWNXMleFCGWoHdzhgqjPGXj5kpf/YVJsBuA0jg= X-Google-Smtp-Source: AG47ELt66OXeUUCn3pUsAdkJNbNowKpCS9sjJPQg9/i5wThY9Xq0gz+vkyUgKaGqnnBxnHGQiiq97VkUbqm+2z2BfYM= X-Received: by 10.46.20.30 with SMTP id u30mr4804095ljd.12.1521069601221; Wed, 14 Mar 2018 16:20:01 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.2.195 with HTTP; Wed, 14 Mar 2018 16:20:00 -0700 (PDT) In-Reply-To: <20180314231150.whi6ndflt77iyybw@mutt-hbsd> References: <201802251429.w1PEThjY035303@repo.freebsd.org> <20180314225009.gu3awgryggsxqmff@mutt-hbsd> <20180314225623.zp6ufw5h7bua4etf@mutt-hbsd> <20180314231150.whi6ndflt77iyybw@mutt-hbsd> From: Alan Somers Date: Wed, 14 Mar 2018 17:20:00 -0600 X-Google-Sender-Auth: 99JibYKM-Xx4QLude-UA7b9PhBE Message-ID: Subject: Re: svn commit: r329984 - in head: cddl/contrib/opensolaris/lib/libzpool/common sys/cddl/compat/opensolaris/sys To: Shawn Webb Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 23:20:03 -0000 On Wed, Mar 14, 2018 at 5:11 PM, Shawn Webb wrote: > On Wed, Mar 14, 2018 at 05:06:09PM -0600, Alan Somers wrote: > > On Wed, Mar 14, 2018 at 4:56 PM, Shawn Webb > > wrote: > > > > > On Wed, Mar 14, 2018 at 04:51:27PM -0600, Alan Somers wrote: > > > > On Wed, Mar 14, 2018 at 4:50 PM, Shawn Webb < > shawn.webb@hardenedbsd.org> > > > > wrote: > > > > > > > > > On Sun, Feb 25, 2018 at 02:29:43PM +0000, Alan Somers wrote: > > > > > > Author: asomers > > > > > > Date: Sun Feb 25 14:29:43 2018 > > > > > > New Revision: 329984 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/329984 > > > > > > > > > > > > Log: > > > > > > Don't declare __assfail as static > > > > > > > > > > > > It gets called by dmu_buf_init_user, which is inline but not > > > static. > > > > > So it > > > > > > needs global linkage itself. > > > > > > > > > > > > Reported by: GCC-6 > > > > > > MFC after: 17 days > > > > > > X-MFC-With: 329722 > > > > > > > > > > > > > > > > Hey Alan, > > > > > > > > > > This commit breaks compiling world with ASAN. > > > > > > > > > > Some applications, like zfs, will fail with this error: > > > > > > > > > > /lib/libuutil.so.2: Undefined symbol "__assfail" > > > > > > > > > > Thanks, > > > > > > > > > > > > > How does one build world with ASAN ? > > > > > > HardenedBSD has a feature branch in its playground repo for ASAN-ified > > > world. > > > > > > We introduced two new MK_* toggles: MK_ASAN and MK_ASAN_RECOVER. > > > MK_ASAN is self-explanitory. MK_ASAN_RECOVER tells the sanitizer > > > framework to let the application continue running instead of abort > > > execution. > > > > > > Here's where the magic gets set: > > > > > > https://github.com/HardenedBSD/hardenedBSD-playground/blob/hardened/ > > > current/asan/share/mk/bsd.prog.mk#L125-L134 > > > > > > Thanks, > > > > > > > I don't use HardenedBSD. Can you provide an invocation that will > > demonstrate the breakage on FreeBSD head? I tried a few things, and they > > all either worked, or failed with errors other than the one you showed. > > No worries. I've just reverted the commit in that feature branch. If I > have time, I'll see about porting the ASAN work to vanilla FreeBSD. > But my time is extremely limited these days. > > Thanks, > Ok. BTW, that commit is due for MFC as of today. Unless I hear from you otherwise, I'll go ahead and MFC it. From owner-svn-src-head@freebsd.org Wed Mar 14 23:28:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60D29F51CAA; Wed, 14 Mar 2018 23:28:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14A317D51A; Wed, 14 Mar 2018 23:28:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B2EF65FC; Wed, 14 Mar 2018 23:28:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2ENSSI1050586; Wed, 14 Mar 2018 23:28:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2ENSS7h050585; Wed, 14 Mar 2018 23:28:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803142328.w2ENSS7h050585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 14 Mar 2018 23:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330955 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 330955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 23:28:29 -0000 Author: imp Date: Wed Mar 14 23:28:28 2018 New Revision: 330955 URL: https://svnweb.freebsd.org/changeset/base/330955 Log: Fix error messages in cut and pasted code. Also, fix an unnecessary deref to get ctrlr. Noticed by: rpokala@ Sponsored by: Netflix Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Wed Mar 14 23:01:18 2018 (r330954) +++ head/sys/dev/nvme/nvme_ctrlr.c Wed Mar 14 23:28:28 2018 (r330955) @@ -519,12 +519,12 @@ nvme_ctrlr_destroy_qpair(struct nvme_controller *ctrlr struct nvme_completion_poll_status status; status.done = 0; - nvme_ctrlr_cmd_delete_io_sq(qpair->ctrlr, qpair, + nvme_ctrlr_cmd_delete_io_sq(ctrlr, qpair, nvme_completion_poll_cb, &status); while (!atomic_load_acq_int(&status.done)) pause("nvme", 1); if (nvme_completion_is_error(&status.cpl)) { - nvme_printf(ctrlr, "nvme_create_io_sq failed!\n"); + nvme_printf(ctrlr, "nvme_destroy_io_sq failed!\n"); return (ENXIO); } @@ -534,7 +534,7 @@ nvme_ctrlr_destroy_qpair(struct nvme_controller *ctrlr while (!atomic_load_acq_int(&status.done)) pause("nvme", 1); if (nvme_completion_is_error(&status.cpl)) { - nvme_printf(ctrlr, "nvme_create_io_cq failed!\n"); + nvme_printf(ctrlr, "nvme_destroy_io_cq failed!\n"); return (ENXIO); } From owner-svn-src-head@freebsd.org Wed Mar 14 23:42:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 554F0F52998; Wed, 14 Mar 2018 23:42:29 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02F557E0B3; Wed, 14 Mar 2018 23:42:29 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F20F368E9; Wed, 14 Mar 2018 23:42:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2ENgS7B060454; Wed, 14 Mar 2018 23:42:28 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2ENgSvf060453; Wed, 14 Mar 2018 23:42:28 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201803142342.w2ENgSvf060453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 14 Mar 2018 23:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330956 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 330956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 23:42:29 -0000 Author: jkim Date: Wed Mar 14 23:42:28 2018 New Revision: 330956 URL: https://svnweb.freebsd.org/changeset/base/330956 Log: Remove local definitions for _STA method in favor of ACPICA. These macros were added in ACPICA 20051216, more than a decade ago. Modified: head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Wed Mar 14 23:28:28 2018 (r330955) +++ head/sys/dev/acpica/acpivar.h Wed Mar 14 23:42:28 2018 (r330956) @@ -320,20 +320,14 @@ void acpi_EnterDebugger(void); #define ACPI_OSC_BAD_REVISION (1 << 3) #define ACPI_OSC_CAPS_MASKED (1 << 4) -/* Values for the device _STA (status) method. */ -#define ACPI_STA_PRESENT (1 << 0) -#define ACPI_STA_ENABLED (1 << 1) -#define ACPI_STA_SHOW_IN_UI (1 << 2) -#define ACPI_STA_FUNCTIONAL (1 << 3) -#define ACPI_STA_BATT_PRESENT (1 << 4) - #define ACPI_DEVINFO_PRESENT(x, flags) \ (((x) & (flags)) == (flags)) #define ACPI_DEVICE_PRESENT(x) \ - ACPI_DEVINFO_PRESENT(x, ACPI_STA_PRESENT | ACPI_STA_FUNCTIONAL) + ACPI_DEVINFO_PRESENT(x, ACPI_STA_DEVICE_PRESENT | \ + ACPI_STA_DEVICE_FUNCTIONING) #define ACPI_BATTERY_PRESENT(x) \ - ACPI_DEVINFO_PRESENT(x, ACPI_STA_PRESENT | ACPI_STA_FUNCTIONAL | \ - ACPI_STA_BATT_PRESENT) + ACPI_DEVINFO_PRESENT(x, ACPI_STA_DEVICE_PRESENT | \ + ACPI_STA_DEVICE_FUNCTIONING | ACPI_STA_BATTERY_PRESENT) /* Callback function type for walking subtables within a table. */ typedef void acpi_subtable_handler(ACPI_SUBTABLE_HEADER *, void *); From owner-svn-src-head@freebsd.org Wed Mar 14 23:45:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 018C2F52C5D; Wed, 14 Mar 2018 23:45:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A13167E2BE; Wed, 14 Mar 2018 23:45:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 977C868EC; Wed, 14 Mar 2018 23:45:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2ENjoiV060662; Wed, 14 Mar 2018 23:45:50 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2ENjm72060638; Wed, 14 Mar 2018 23:45:48 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201803142345.w2ENjm72060638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 14 Mar 2018 23:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330957 - in head/sys: contrib/dev/acpica contrib/dev/acpica/components/debugger contrib/dev/acpica/components/dispatcher contrib/dev/acpica/components/events contrib/dev/acpica/compone... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/sys: contrib/dev/acpica contrib/dev/acpica/components/debugger contrib/dev/acpica/components/dispatcher contrib/dev/acpica/components/events contrib/dev/acpica/components/executer contrib/dev/... X-SVN-Commit-Revision: 330957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 23:45:51 -0000 Author: jkim Date: Wed Mar 14 23:45:48 2018 New Revision: 330957 URL: https://svnweb.freebsd.org/changeset/base/330957 Log: Merge ACPICA 20180313. Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/components/debugger/dbdisply.c head/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c head/sys/contrib/dev/acpica/components/events/evevent.c head/sys/contrib/dev/acpica/components/events/evgpe.c head/sys/contrib/dev/acpica/components/events/evgpeblk.c head/sys/contrib/dev/acpica/components/events/evrgnini.c head/sys/contrib/dev/acpica/components/events/evxface.c head/sys/contrib/dev/acpica/components/events/evxfgpe.c head/sys/contrib/dev/acpica/components/executer/exdebug.c head/sys/contrib/dev/acpica/components/hardware/hwgpe.c head/sys/contrib/dev/acpica/components/hardware/hwsleep.c head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c head/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c head/sys/contrib/dev/acpica/components/namespace/nseval.c head/sys/contrib/dev/acpica/components/namespace/nsload.c head/sys/contrib/dev/acpica/components/namespace/nsparse.c head/sys/contrib/dev/acpica/components/namespace/nsxfname.c head/sys/contrib/dev/acpica/components/parser/psargs.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/tables/tbdata.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbxfload.c head/sys/contrib/dev/acpica/components/utilities/utosi.c head/sys/contrib/dev/acpica/components/utilities/utxfinit.c head/sys/contrib/dev/acpica/include/acevents.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/dev/acpica/acpi.c Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/changes.txt Wed Mar 14 23:45:48 2018 (r330957) @@ -1,4 +1,50 @@ ---------------------------------------- +13 March 2018. Summary of changes for version 20180313: + + +1) ACPICA kernel-resident subsystem: + +Implemented various improvements to the GPE support: + +1) Dispatch all active GPEs at initialization time so that no GPEs are +lost. +2) Enable runtime GPEs earlier. Some systems expect GPEs to be enabled +before devices are enumerated. +3) Don't unconditionally clear ACPI IRQs during suspend/resume, so that +IRQs are not lost. +4) Add parallel GPE handling to eliminate the possibility of dispatching +the same GPE twice. +5) Dispatch any pending GPEs after enabling for the first time. + +AcpiGetObjectInfo - removed support for the _STA method. This was causing +problems on some platforms. + +Added a new _OSI string, "Windows 2017.2". + +Cleaned up and simplified the module-level code support. These changes +are in preparation for the eventual removal of the legacy MLC support +(deferred execution), replaced by the new MLC architecture which executes +the MLC as a table is loaded (DSDT/SSDTs). + +Changed a compile-time option to a runtime option. Changes the option to +ignore ACPI table load-time package resolution errors into a runtime +option. Used only for platforms that generate many AE_NOT_FOUND errors +during boot. AcpiGbl_IgnorePackageResolutionErrors. + +Fixed the ACPI_ERROR_NAMESPACE macro. This change involves putting some +ACPI_ERROR_NAMESPACE parameters inside macros. By doing so, we avoid +compilation errors from unused variables (seen with some compilers). + + +2) iASL Compiler/Disassembler and Tools: + +ASLTS: parallelized execution in order to achieve an (approximately) 2X +performance increase. + +ASLTS: Updated to use the iASL __LINE__ and __METHOD__ macros. Improves +error reporting. + +---------------------------------------- 09 February 2018. Summary of changes for version 20180209: Modified: head/sys/contrib/dev/acpica/components/debugger/dbdisply.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbdisply.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/debugger/dbdisply.c Wed Mar 14 23:45:48 2018 (r330957) @@ -820,9 +820,8 @@ AcpiDbDisplayObjectType ( return; } - AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n", - ACPI_FORMAT_UINT64 (Info->Address), - Info->CurrentStatus, Info->Flags); + AcpiOsPrintf ("ADR: %8.8X%8.8X, Flags: %X\n", + ACPI_FORMAT_UINT64 (Info->Address), Info->Flags); AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n", Info->HighestDstates[0], Info->HighestDstates[1], Modified: head/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c Wed Mar 14 23:45:48 2018 (r330957) @@ -546,34 +546,33 @@ AcpiDsResolvePackageElement ( ScopeInfo.Scope.Node = Element->Reference.Node; /* Prefix node */ - Status = AcpiNsLookup (&ScopeInfo, - (char *) Element->Reference.Aml, /* Pointer to AML path */ + Status = AcpiNsLookup (&ScopeInfo, (char *) Element->Reference.Aml, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, &ResolvedNode); if (ACPI_FAILURE (Status)) { -#if defined ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS && !defined ACPI_APPLICATION - /* - * For the kernel-resident ACPICA, optionally be silent about the - * NOT_FOUND case. Although this is potentially a serious problem, - * it can generate a lot of noise/errors on platforms whose - * firmware carries around a bunch of unused Package objects. - * To disable these errors, define ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS - * in the OS-specific header. - * - * All errors are always reported for ACPICA applications such as - * AcpiExec. - */ - if (Status == AE_NOT_FOUND) + if ((Status == AE_NOT_FOUND) && AcpiGbl_IgnorePackageResolutionErrors) { - /* Reference name not found, set the element to NULL */ + /* + * Optionally be silent about the NOT_FOUND case for the referenced + * name. Although this is potentially a serious problem, + * it can generate a lot of noise/errors on platforms whose + * firmware carries around a bunch of unused Package objects. + * To disable these errors, set this global to TRUE: + * AcpiGbl_IgnorePackageResolutionErrors + * + * If the AML actually tries to use such a package, the unresolved + * element(s) will be replaced with NULL elements. + */ + /* Referenced name not found, set the element to NULL */ + AcpiUtRemoveReference (*ElementPtr); *ElementPtr = NULL; return_VOID; } -#endif + Status2 = AcpiNsExternalizeName (ACPI_UINT32_MAX, (char *) Element->Reference.Aml, NULL, &ExternalPath); Modified: head/sys/contrib/dev/acpica/components/events/evevent.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evevent.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/events/evevent.c Wed Mar 14 23:45:48 2018 (r330957) @@ -344,6 +344,7 @@ AcpiEvFixedEventDetect ( UINT32 FixedStatus; UINT32 FixedEnable; UINT32 i; + ACPI_STATUS Status; ACPI_FUNCTION_NAME (EvFixedEventDetect); @@ -353,8 +354,12 @@ AcpiEvFixedEventDetect ( * Read the fixed feature status and enable registers, as all the cases * depend on their values. Ignore errors here. */ - (void) AcpiHwRegisterRead (ACPI_REGISTER_PM1_STATUS, &FixedStatus); - (void) AcpiHwRegisterRead (ACPI_REGISTER_PM1_ENABLE, &FixedEnable); + Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_STATUS, &FixedStatus); + Status |= AcpiHwRegisterRead (ACPI_REGISTER_PM1_ENABLE, &FixedEnable); + if (ACPI_FAILURE (Status)) + { + return (IntStatus); + } ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, "Fixed Event Block: Enable %08X Status %08X\n", Modified: head/sys/contrib/dev/acpica/components/events/evgpe.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evgpe.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/events/evgpe.c Wed Mar 14 23:45:48 2018 (r330957) @@ -226,7 +226,7 @@ AcpiEvUpdateGpeEnableMask ( * * RETURN: Status * - * DESCRIPTION: Clear a GPE of stale events and enable it. + * DESCRIPTION: Enable a GPE. * ******************************************************************************/ @@ -240,14 +240,6 @@ AcpiEvEnableGpe ( ACPI_FUNCTION_TRACE (EvEnableGpe); - /* Clear the GPE (of stale events) */ - - Status = AcpiHwClearGpe (GpeEventInfo); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - /* Enable the requested GPE */ Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE); @@ -542,17 +534,12 @@ UINT32 AcpiEvGpeDetect ( ACPI_GPE_XRUPT_INFO *GpeXruptList) { - ACPI_STATUS Status; ACPI_GPE_BLOCK_INFO *GpeBlock; ACPI_NAMESPACE_NODE *GpeDevice; ACPI_GPE_REGISTER_INFO *GpeRegisterInfo; ACPI_GPE_EVENT_INFO *GpeEventInfo; UINT32 GpeNumber; - ACPI_GPE_HANDLER_INFO *GpeHandlerInfo; UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED; - UINT8 EnabledStatusByte; - UINT64 StatusReg; - UINT64 EnableReg; ACPI_CPU_FLAGS Flags; UINT32 i; UINT32 j; @@ -608,105 +595,25 @@ AcpiEvGpeDetect ( continue; } - /* Read the Status Register */ - - Status = AcpiHwRead (&StatusReg, &GpeRegisterInfo->StatusAddress); - if (ACPI_FAILURE (Status)) - { - goto UnlockAndExit; - } - - /* Read the Enable Register */ - - Status = AcpiHwRead (&EnableReg, &GpeRegisterInfo->EnableAddress); - if (ACPI_FAILURE (Status)) - { - goto UnlockAndExit; - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, - "Read registers for GPE %02X-%02X: Status=%02X, Enable=%02X, " - "RunEnable=%02X, WakeEnable=%02X\n", - GpeRegisterInfo->BaseGpeNumber, - GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1), - (UINT32) StatusReg, (UINT32) EnableReg, - GpeRegisterInfo->EnableForRun, - GpeRegisterInfo->EnableForWake)); - - /* Check if there is anything active at all in this register */ - - EnabledStatusByte = (UINT8) (StatusReg & EnableReg); - if (!EnabledStatusByte) - { - /* No active GPEs in this register, move on */ - - continue; - } - /* Now look at the individual GPEs in this byte register */ for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) { - /* Examine one GPE bit */ + /* Detect and dispatch one GPE bit */ GpeEventInfo = &GpeBlock->EventInfo[((ACPI_SIZE) i * ACPI_GPE_REGISTER_WIDTH) + j]; GpeNumber = j + GpeRegisterInfo->BaseGpeNumber; - - if (EnabledStatusByte & (1 << j)) - { - /* Invoke global event handler if present */ - - AcpiGpeCount++; - if (AcpiGbl_GlobalEventHandler) - { - AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE, - GpeDevice, GpeNumber, - AcpiGbl_GlobalEventHandlerContext); - } - - /* Found an active GPE */ - - if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == - ACPI_GPE_DISPATCH_RAW_HANDLER) - { - /* Dispatch the event to a raw handler */ - - GpeHandlerInfo = GpeEventInfo->Dispatch.Handler; - - /* - * There is no protection around the namespace node - * and the GPE handler to ensure a safe destruction - * because: - * 1. The namespace node is expected to always - * exist after loading a table. - * 2. The GPE handler is expected to be flushed by - * AcpiOsWaitEventsComplete() before the - * destruction. - */ - AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); - IntStatus |= GpeHandlerInfo->Address ( - GpeDevice, GpeNumber, GpeHandlerInfo->Context); - Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); - } - else - { - /* - * Dispatch the event to a standard handler or - * method. - */ - IntStatus |= AcpiEvGpeDispatch (GpeDevice, - GpeEventInfo, GpeNumber); - } - } + AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + IntStatus |= AcpiEvDetectGpe ( + GpeDevice, GpeEventInfo, GpeNumber); + Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); } } GpeBlock = GpeBlock->Next; } -UnlockAndExit: - AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); return (IntStatus); } @@ -894,6 +801,137 @@ AcpiEvFinishGpe ( /******************************************************************************* * + * FUNCTION: AcpiEvDetectGpe + * + * PARAMETERS: GpeDevice - Device node. NULL for GPE0/GPE1 + * GpeEventInfo - Info for this GPE + * GpeNumber - Number relative to the parent GPE block + * + * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED + * + * DESCRIPTION: Detect and dispatch a General Purpose Event to either a function + * (e.g. EC) or method (e.g. _Lxx/_Exx) handler. + * NOTE: GPE is W1C, so it is possible to handle a single GPE from both + * task and irq context in parallel as long as the process to + * detect and mask the GPE is atomic. + * However the atomicity of ACPI_GPE_DISPATCH_RAW_HANDLER is + * dependent on the raw handler itself. + * + ******************************************************************************/ + +UINT32 +AcpiEvDetectGpe ( + ACPI_NAMESPACE_NODE *GpeDevice, + ACPI_GPE_EVENT_INFO *GpeEventInfo, + UINT32 GpeNumber) +{ + UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED; + UINT8 EnabledStatusByte; + UINT64 StatusReg; + UINT64 EnableReg; + UINT32 RegisterBit; + ACPI_GPE_REGISTER_INFO *GpeRegisterInfo; + ACPI_GPE_HANDLER_INFO *GpeHandlerInfo; + ACPI_CPU_FLAGS Flags; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (EvGpeDetect); + + + Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); + + /* Get the info block for the entire GPE register */ + + GpeRegisterInfo = GpeEventInfo->RegisterInfo; + + /* Get the register bitmask for this GPE */ + + RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo); + + /* GPE currently enabled (enable bit == 1)? */ + + Status = AcpiHwRead (&EnableReg, &GpeRegisterInfo->EnableAddress); + if (ACPI_FAILURE (Status)) + { + goto ErrorExit; + } + + /* GPE currently active (status bit == 1)? */ + + Status = AcpiHwRead (&StatusReg, &GpeRegisterInfo->StatusAddress); + if (ACPI_FAILURE (Status)) + { + goto ErrorExit; + } + + /* Check if there is anything active at all in this GPE */ + + ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, + "Read registers for GPE %02X: Status=%02X, Enable=%02X, " + "RunEnable=%02X, WakeEnable=%02X\n", + GpeNumber, + (UINT32) (StatusReg & RegisterBit), + (UINT32) (EnableReg & RegisterBit), + GpeRegisterInfo->EnableForRun, + GpeRegisterInfo->EnableForWake)); + + EnabledStatusByte = (UINT8) (StatusReg & EnableReg); + if (!(EnabledStatusByte & RegisterBit)) + { + goto ErrorExit; + } + + /* Invoke global event handler if present */ + + AcpiGpeCount++; + if (AcpiGbl_GlobalEventHandler) + { + AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE, + GpeDevice, GpeNumber, + AcpiGbl_GlobalEventHandlerContext); + } + + /* Found an active GPE */ + + if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == + ACPI_GPE_DISPATCH_RAW_HANDLER) + { + /* Dispatch the event to a raw handler */ + + GpeHandlerInfo = GpeEventInfo->Dispatch.Handler; + + /* + * There is no protection around the namespace node + * and the GPE handler to ensure a safe destruction + * because: + * 1. The namespace node is expected to always + * exist after loading a table. + * 2. The GPE handler is expected to be flushed by + * AcpiOsWaitEventsComplete() before the + * destruction. + */ + AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + IntStatus |= GpeHandlerInfo->Address ( + GpeDevice, GpeNumber, GpeHandlerInfo->Context); + Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); + } + else + { + /* Dispatch the event to a standard handler or method. */ + + IntStatus |= AcpiEvGpeDispatch (GpeDevice, + GpeEventInfo, GpeNumber); + } + +ErrorExit: + AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + return (IntStatus); +} + + +/******************************************************************************* + * * FUNCTION: AcpiEvGpeDispatch * * PARAMETERS: GpeDevice - Device node. NULL for GPE0/GPE1 @@ -904,8 +942,6 @@ AcpiEvFinishGpe ( * * DESCRIPTION: Dispatch a General Purpose Event to either a function (e.g. EC) * or method (e.g. _Lxx/_Exx) handler. - * - * This function executes at interrupt level. * ******************************************************************************/ Modified: head/sys/contrib/dev/acpica/components/events/evgpeblk.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evgpeblk.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/events/evgpeblk.c Wed Mar 14 23:45:48 2018 (r330957) @@ -585,7 +585,7 @@ ACPI_STATUS AcpiEvInitializeGpeBlock ( ACPI_GPE_XRUPT_INFO *GpeXruptInfo, ACPI_GPE_BLOCK_INFO *GpeBlock, - void *Ignored) + void *Context) { ACPI_STATUS Status; ACPI_GPE_EVENT_INFO *GpeEventInfo; @@ -593,6 +593,8 @@ AcpiEvInitializeGpeBlock ( UINT32 GpeIndex; UINT32 i; UINT32 j; + BOOLEAN *IsPollingNeeded = Context; + ACPI_ERROR_ONLY (UINT32 GpeNumber); ACPI_FUNCTION_TRACE (EvInitializeGpeBlock); @@ -622,14 +624,14 @@ AcpiEvInitializeGpeBlock ( GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j; GpeEventInfo = &GpeBlock->EventInfo[GpeIndex]; + ACPI_ERROR_ONLY(GpeNumber = GpeBlock->BlockBaseNumber + GpeIndex); + GpeEventInfo->Flags |= ACPI_GPE_INITIALIZED; /* * Ignore GPEs that have no corresponding _Lxx/_Exx method * and GPEs that are used to wake the system */ - if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_NONE) || - (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_HANDLER) || - (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_RAW_HANDLER) || + if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) != ACPI_GPE_DISPATCH_METHOD) || (GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE)) { continue; @@ -640,8 +642,16 @@ AcpiEvInitializeGpeBlock ( { ACPI_EXCEPTION ((AE_INFO, Status, "Could not enable GPE 0x%02X", - GpeIndex + GpeBlock->BlockBaseNumber)); + GpeNumber)); continue; + } + + GpeEventInfo->Flags |= ACPI_GPE_AUTO_ENABLED; + + if (IsPollingNeeded && + ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo)) + { + *IsPollingNeeded = TRUE; } GpeEnabledCount++; Modified: head/sys/contrib/dev/acpica/components/events/evrgnini.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evrgnini.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/events/evrgnini.c Wed Mar 14 23:45:48 2018 (r330957) @@ -736,9 +736,12 @@ AcpiEvInitializeRegion ( * Node's object was replaced by this Method object and we * saved the handler in the method object. * + * Note: Only used for the legacy MLC support. Will + * be removed in the future. + * * See AcpiNsExecModuleCode */ - if (!AcpiGbl_ParseTableAsTermList && + if (!AcpiGbl_ExecuteTablesAsMethods && ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL) { HandlerObj = ObjDesc->Method.Dispatch.Handler; Modified: head/sys/contrib/dev/acpica/components/events/evxface.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evxface.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/events/evxface.c Wed Mar 14 23:45:48 2018 (r330957) @@ -1257,6 +1257,15 @@ AcpiRemoveGpeHandler ( Handler->OriginallyEnabled) { (void) AcpiEvAddGpeReference (GpeEventInfo); + if (ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo)) + { + /* Poll edge triggered GPEs to handle existing events */ + + AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + (void) AcpiEvDetectGpe ( + GpeDevice, GpeEventInfo, GpeNumber); + Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); + } } AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); Modified: head/sys/contrib/dev/acpica/components/events/evxfgpe.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evxfgpe.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/events/evxfgpe.c Wed Mar 14 23:45:48 2018 (r330957) @@ -188,6 +188,7 @@ AcpiUpdateAllGpes ( void) { ACPI_STATUS Status; + BOOLEAN IsPollingNeeded = FALSE; ACPI_FUNCTION_TRACE (AcpiUpdateAllGpes); @@ -204,7 +205,8 @@ AcpiUpdateAllGpes ( goto UnlockAndExit; } - Status = AcpiEvWalkGpeList (AcpiEvInitializeGpeBlock, NULL); + Status = AcpiEvWalkGpeList (AcpiEvInitializeGpeBlock, + &IsPollingNeeded); if (ACPI_SUCCESS (Status)) { AcpiGbl_AllGpesInitialized = TRUE; @@ -212,6 +214,13 @@ AcpiUpdateAllGpes ( UnlockAndExit: (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); + + if (IsPollingNeeded && AcpiGbl_AllGpesInitialized) + { + /* Poll GPEs to handle already triggered events */ + + AcpiEvGpeDetect (AcpiGbl_GpeXruptListHead); + } return_ACPI_STATUS (Status); } @@ -259,6 +268,16 @@ AcpiEnableGpe ( ACPI_GPE_DISPATCH_NONE) { Status = AcpiEvAddGpeReference (GpeEventInfo); + if (ACPI_SUCCESS (Status) && + ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo)) + { + /* Poll edge-triggered GPEs to handle existing events */ + + AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + (void) AcpiEvDetectGpe ( + GpeDevice, GpeEventInfo, GpeNumber); + Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); + } } else { @@ -608,6 +627,16 @@ AcpiSetupGpeForWake ( */ GpeEventInfo->Flags = (ACPI_GPE_DISPATCH_NOTIFY | ACPI_GPE_LEVEL_TRIGGERED); + } + else if (GpeEventInfo->Flags & ACPI_GPE_AUTO_ENABLED) + { + /* + * A reference to this GPE has been added during the GPE block + * initialization, so drop it now to prevent the GPE from being + * permanently enabled and clear its ACPI_GPE_AUTO_ENABLED flag. + */ + (void) AcpiEvRemoveGpeReference (GpeEventInfo); + GpeEventInfo->Flags &= ~~ACPI_GPE_AUTO_ENABLED; } /* Modified: head/sys/contrib/dev/acpica/components/executer/exdebug.c ============================================================================== --- head/sys/contrib/dev/acpica/components/executer/exdebug.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/executer/exdebug.c Wed Mar 14 23:45:48 2018 (r330957) @@ -204,15 +204,14 @@ AcpiExDoDebugObject ( return_VOID; } - /* Null string or newline -- don't emit the line header */ + /* Newline -- don't emit the line header */ if (SourceDesc && (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_OPERAND) && (SourceDesc->Common.Type == ACPI_TYPE_STRING)) { - if ((SourceDesc->String.Length == 0) || - ((SourceDesc->String.Length == 1) && - (*SourceDesc->String.Pointer == '\n'))) + if ((SourceDesc->String.Length == 1) && + (*SourceDesc->String.Pointer == '\n')) { AcpiOsPrintf ("\n"); return_VOID; Modified: head/sys/contrib/dev/acpica/components/hardware/hwgpe.c ============================================================================== --- head/sys/contrib/dev/acpica/components/hardware/hwgpe.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/hardware/hwgpe.c Wed Mar 14 23:45:48 2018 (r330957) @@ -658,7 +658,6 @@ AcpiHwDisableAllGpes ( Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL); - Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL); return_ACPI_STATUS (Status); } Modified: head/sys/contrib/dev/acpica/components/hardware/hwsleep.c ============================================================================== --- head/sys/contrib/dev/acpica/components/hardware/hwsleep.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/hardware/hwsleep.c Wed Mar 14 23:45:48 2018 (r330957) @@ -198,16 +198,8 @@ AcpiHwLegacySleep ( return_ACPI_STATUS (Status); } - /* Clear all fixed and general purpose status bits */ - - Status = AcpiHwClearAcpiStatus (); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - /* - * 1) Disable/Clear all GPEs + * 1) Disable all GPEs * 2) Enable all wakeup GPEs */ Status = AcpiHwDisableAllGpes (); @@ -427,7 +419,7 @@ AcpiHwLegacyWake ( * might get fired there * * Restore the GPEs: - * 1) Disable/Clear all GPEs + * 1) Disable all GPEs * 2) Enable all runtime GPEs */ Status = AcpiHwDisableAllGpes (); Modified: head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c ============================================================================== --- head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c Wed Mar 14 23:45:48 2018 (r330957) @@ -337,7 +337,7 @@ AcpiEnterSleepStateS4bios ( } /* - * 1) Disable/Clear all GPEs + * 1) Disable all GPEs * 2) Enable all wakeup GPEs */ Status = AcpiHwDisableAllGpes (); Modified: head/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c Wed Mar 14 23:45:48 2018 (r330957) @@ -208,9 +208,8 @@ AcpiNsDumpOneDevice ( } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, - " HID: %s, ADR: %8.8X%8.8X, Status: %X\n", - Info->HardwareId.Value, ACPI_FORMAT_UINT64 (Info->Address), - Info->CurrentStatus)); + " HID: %s, ADR: %8.8X%8.8X\n", + Info->HardwareId.Value, ACPI_FORMAT_UINT64 (Info->Address))); ACPI_FREE (Info); } Modified: head/sys/contrib/dev/acpica/components/namespace/nseval.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nseval.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/namespace/nseval.c Wed Mar 14 23:45:48 2018 (r330957) @@ -429,7 +429,17 @@ AcpiNsEvaluate ( Status = AE_OK; } + else if (ACPI_FAILURE(Status)) + { + /* If ReturnObject exists, delete it */ + if (Info->ReturnObject) + { + AcpiUtRemoveReference (Info->ReturnObject); + Info->ReturnObject = NULL; + } + } + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "*** Completed evaluation of object %s ***\n", Info->RelativePathname)); @@ -457,6 +467,17 @@ Cleanup: * DESCRIPTION: Execute all elements of the global module-level code list. * Each element is executed as a single control method. * + * NOTE: With this option enabled, each block of detected executable AML + * code that is outside of any control method is wrapped with a temporary + * control method object and placed on a global list. The methods on this + * list are executed below. + * + * This function executes the module-level code for all tables only after + * all of the tables have been loaded. It is a legacy option and is + * not compatible with other ACPI implementations. See AcpiNsLoadTable. + * + * This function will be removed when the legacy option is removed. + * ******************************************************************************/ void @@ -477,6 +498,9 @@ AcpiNsExecModuleCodeList ( Next = AcpiGbl_ModuleCodeList; if (!Next) { + ACPI_DEBUG_PRINT ((ACPI_DB_INIT_NAMES, + "Legacy MLC block list is empty\n")); + return_VOID; } Modified: head/sys/contrib/dev/acpica/components/namespace/nsload.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsload.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/namespace/nsload.c Wed Mar 14 23:45:48 2018 (r330957) @@ -270,23 +270,17 @@ Unlock: "**** Completed Table Object Initialization\n")); /* - * Execute any module-level code that was detected during the table load - * phase. Although illegal since ACPI 2.0, there are many machines that - * contain this type of code. Each block of detected executable AML code - * outside of any control method is wrapped with a temporary control - * method object and placed on a global list. The methods on this list - * are executed below. + * This case handles the legacy option that groups all module-level + * code blocks together and defers execution until all of the tables + * are loaded. Execute all of these blocks at this time. + * Execute any module-level code that was detected during the table + * load phase. * - * This case executes the module-level code for each table immediately - * after the table has been loaded. This provides compatibility with - * other ACPI implementations. Optionally, the execution can be deferred - * until later, see AcpiInitializeObjects. + * Note: this option is deprecated and will be eliminated in the + * future. Use of this option can cause problems with AML code that + * depends upon in-order immediate execution of module-level code. */ - if (!AcpiGbl_ParseTableAsTermList && !AcpiGbl_GroupModuleLevelCode) - { - AcpiNsExecModuleCodeList (); - } - + AcpiNsExecModuleCodeList (); return_ACPI_STATUS (Status); } Modified: head/sys/contrib/dev/acpica/components/namespace/nsparse.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsparse.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/namespace/nsparse.c Wed Mar 14 23:45:48 2018 (r330957) @@ -171,9 +171,18 @@ * * RETURN: Status * - * DESCRIPTION: Load ACPI/AML table by executing the entire table as a - * TermList. + * DESCRIPTION: Load ACPI/AML table by executing the entire table as a single + * large control method. * + * NOTE: The point of this is to execute any module-level code in-place + * as the table is parsed. Some AML code depends on this behavior. + * + * It is a run-time option at this time, but will eventually become + * the default. + * + * Note: This causes the table to only have a single-pass parse. + * However, this is compatible with other ACPI implementations. + * ******************************************************************************/ ACPI_STATUS @@ -403,8 +412,19 @@ AcpiNsParseTable ( ACPI_FUNCTION_TRACE (NsParseTable); - if (AcpiGbl_ParseTableAsTermList) + if (AcpiGbl_ExecuteTablesAsMethods) { + /* + * This case executes the AML table as one large control method. + * The point of this is to execute any module-level code in-place + * as the table is parsed. Some AML code depends on this behavior. + * + * It is a run-time option at this time, but will eventually become + * the default. + * + * Note: This causes the table to only have a single-pass parse. + * However, this is compatible with other ACPI implementations. + */ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_PARSE, "%s: **** Start table execution pass\n", ACPI_GET_FUNCTION_NAME)); Modified: head/sys/contrib/dev/acpica/components/namespace/nsxfname.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsxfname.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/namespace/nsxfname.c Wed Mar 14 23:45:48 2018 (r330957) @@ -376,7 +376,7 @@ AcpiNsCopyDeviceId ( * namespace node and possibly by running several standard * control methods (Such as in the case of a device.) * - * For Device and Processor objects, run the Device _HID, _UID, _CID, _STA, + * For Device and Processor objects, run the Device _HID, _UID, _CID, * _CLS, _ADR, _SxW, and _SxD methods. * * Note: Allocates the return buffer, must be freed by the caller. @@ -385,8 +385,9 @@ AcpiNsCopyDeviceId ( * discovery namespace traversal. Therefore, no complex methods can be * executed, especially those that access operation regions. Therefore, do * not add any additional methods that could cause problems in this area. - * this was the fate of the _SUB method which was found to cause such - * problems and was removed (11/2015). + * Because of this reason support for the following methods has been removed: + * 1) _SUB method was removed (11/2015) + * 2) _STA method was removed (02/2018) * ******************************************************************************/ @@ -517,25 +518,12 @@ AcpiGetObjectInfo ( { /* * Get extra info for ACPI Device/Processor objects only: - * Run the _STA, _ADR and, SxW, and _SxD methods. + * Run the _ADR and, SxW, and _SxD methods. * * Notes: none of these methods are required, so they may or may * not be present for this device. The Info->Valid bitfield is used * to indicate which methods were found and run successfully. - * - * For _STA, if the method does not exist, then (as per the ACPI - * specification), the returned CurrentStatus flags will indicate - * that the device is present/functional/enabled. Otherwise, the - * CurrentStatus flags reflect the value returned from _STA. */ - - /* Execute the Device._STA method */ - - Status = AcpiUtExecute_STA (Node, &Info->CurrentStatus); - if (ACPI_SUCCESS (Status)) - { - Valid |= ACPI_VALID_STA; - } /* Execute the Device._ADR method */ Modified: head/sys/contrib/dev/acpica/components/parser/psargs.c ============================================================================== --- head/sys/contrib/dev/acpica/components/parser/psargs.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/parser/psargs.c Wed Mar 14 23:45:48 2018 (r330957) @@ -1051,6 +1051,9 @@ AcpiPsGetNextArg ( if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP) { + /* Free method call op and corresponding namestring sub-ob */ + + AcpiPsFreeOp (Arg->Common.Value.Arg); AcpiPsFreeOp (Arg); Arg = NULL; WalkState->ArgCount = 1; Modified: head/sys/contrib/dev/acpica/components/parser/psloop.c ============================================================================== --- head/sys/contrib/dev/acpica/components/parser/psloop.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/parser/psloop.c Wed Mar 14 23:45:48 2018 (r330957) @@ -287,10 +287,18 @@ AcpiPsGetArguments ( WalkState->ArgCount, WalkState->PassNumber)); /* - * Handle executable code at "module-level". This refers to - * executable opcodes that appear outside of any control method. + * This case handles the legacy option that groups all module-level + * code blocks together and defers execution until all of the tables + * are loaded. Execute all of these blocks at this time. + * Execute any module-level code that was detected during the table + * load phase. + * + * Note: this option is deprecated and will be eliminated in the + * future. Use of this option can cause problems with AML code that + * depends upon in-order immediate execution of module-level code. */ - if ((WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2) && + if (AcpiGbl_GroupModuleLevelCode && + (WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2) && ((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) == 0)) { /* @@ -439,6 +447,16 @@ AcpiPsGetArguments ( * DESCRIPTION: Wrap the module-level code with a method object and link the * object to the global list. Note, the mutex field of the method * object is used to link multiple module-level code objects. + * + * NOTE: In this legacy option, each block of detected executable AML + * code that is outside of any control method is wrapped with a temporary + * control method object and placed on a global list below. + * + * This function executes the module-level code for all tables only after + * all of the tables have been loaded. It is a legacy option and is + * not compatible with other ACPI implementations. See AcpiNsLoadTable. + * + * This function will be removed when the legacy option is removed. * ******************************************************************************/ Modified: head/sys/contrib/dev/acpica/components/parser/psobject.c ============================================================================== --- head/sys/contrib/dev/acpica/components/parser/psobject.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/parser/psobject.c Wed Mar 14 23:45:48 2018 (r330957) @@ -182,7 +182,7 @@ static ACPI_STATUS AcpiPsGetAmlOpcode ( ACPI_WALK_STATE *WalkState) { - UINT32 AmlOffset; + ACPI_ERROR_ONLY (UINT32 AmlOffset); ACPI_FUNCTION_TRACE_PTR (PsGetAmlOpcode, WalkState); @@ -217,8 +217,8 @@ AcpiPsGetAmlOpcode ( if (WalkState->PassNumber == 2) { - AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml, - WalkState->ParserState.AmlStart); + ACPI_ERROR_ONLY(AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml, + WalkState->ParserState.AmlStart)); ACPI_ERROR ((AE_INFO, "Unknown opcode 0x%.2X at table offset 0x%.4X, ignoring", Modified: head/sys/contrib/dev/acpica/components/tables/tbdata.c ============================================================================== --- head/sys/contrib/dev/acpica/components/tables/tbdata.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/tables/tbdata.c Wed Mar 14 23:45:48 2018 (r330957) @@ -1190,12 +1190,18 @@ AcpiTbLoadTable ( Status = AcpiNsLoadTable (TableIndex, ParentNode); - /* Execute any module-level code that was found in the table */ - - if (!AcpiGbl_ParseTableAsTermList && AcpiGbl_GroupModuleLevelCode) - { - AcpiNsExecModuleCodeList (); - } + /* + * This case handles the legacy option that groups all module-level + * code blocks together and defers execution until all of the tables + * are loaded. Execute all of these blocks at this time. + * Execute any module-level code that was detected during the table + * load phase. + * + * Note: this option is deprecated and will be eliminated in the + * future. Use of this option can cause problems with AML code that + * depends upon in-order immediate execution of module-level code. + */ + AcpiNsExecModuleCodeList (); /* * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is Modified: head/sys/contrib/dev/acpica/components/tables/tbinstal.c ============================================================================== --- head/sys/contrib/dev/acpica/components/tables/tbinstal.c Wed Mar 14 23:42:28 2018 (r330956) +++ head/sys/contrib/dev/acpica/components/tables/tbinstal.c Wed Mar 14 23:45:48 2018 (r330957) @@ -356,11 +356,11 @@ AcpiTbOverrideTable ( ACPI_TABLE_DESC *OldTableDesc) { ACPI_STATUS Status; - char *OverrideType; ACPI_TABLE_DESC NewTableDesc; ACPI_TABLE_HEADER *Table; ACPI_PHYSICAL_ADDRESS Address; UINT32 Length; + ACPI_ERROR_ONLY (char *OverrideType); /* (1) Attempt logical override (returns a logical address) */ @@ -370,7 +370,7 @@ AcpiTbOverrideTable ( { AcpiTbAcquireTempTable (&NewTableDesc, ACPI_PTR_TO_PHYSADDR (Table), ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL); - OverrideType = "Logical"; + ACPI_ERROR_ONLY (OverrideType = "Logical"); goto FinishOverride; } @@ -382,7 +382,7 @@ AcpiTbOverrideTable ( { AcpiTbAcquireTempTable (&NewTableDesc, Address, ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL); - OverrideType = "Physical"; + ACPI_ERROR_ONLY (OverrideType = "Physical"); goto FinishOverride; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Mar 14 23:59:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D666F5391D; Wed, 14 Mar 2018 23:59:27 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E2617E8E9; Wed, 14 Mar 2018 23:59:26 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.15.2/8.15.2/ALCHEMY.FRANKEN.DE) with ESMTPS id w2ENxISs076904 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 15 Mar 2018 00:59:19 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.15.2/8.15.2/Submit) id w2ENxIKV076903; Thu, 15 Mar 2018 00:59:18 +0100 (CET) (envelope-from marius) Date: Thu, 15 Mar 2018 00:59:18 +0100 From: Marius Strobl To: Ed Maste Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327314 - head/sys/x86/x86 Message-ID: <20180314235918.GZ12352@alchemy.franken.de> References: <201712282146.vBSLk9Uo033652@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (alchemy.franken.de [0.0.0.0]); Thu, 15 Mar 2018 00:59:19 +0100 (CET) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 23:59:27 -0000 On Wed, Mar 14, 2018 at 07:18:41PM -0400, Ed Maste wrote: > On 28 December 2017 at 16:46, Marius Strobl wrote: > > Author: marius > > Date: Thu Dec 28 21:46:09 2017 > > New Revision: 327314 > > URL: https://svnweb.freebsd.org/changeset/base/327314 > > > > Log: > > With the advent of interrupt remapping, Intel has repurposed bit 11 > > (now: Interrupt_Index[15]) and assigned the previously reserved bits > > ... > > Will you MFC this to stable/11 so it can arrive in 11.2? Yes, in fact I was working on the MFCs when your e-mail arrived but am struggling with some unrelated build fuck-ups. Marius From owner-svn-src-head@freebsd.org Wed Mar 14 23:23:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C041F51950 for ; Wed, 14 Mar 2018 23:23:47 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C259F7D2FA for ; Wed, 14 Mar 2018 23:23:46 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm0-x235.google.com with SMTP id i194so7123553wmg.1 for ; Wed, 14 Mar 2018 16:23:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lVXBLdLLVdRAH8WvtTTwn3KL2AMuSLfFRit7UstUkL8=; b=iVh0TJXpMd0m82D0W5awkUECone5LeHF97W4EAv5iiervIeQBt5TTbeEyBgObDmblf jbffkd8hjh13LX22hWxIY1AoOQo2d+7nbtBz14LHAZtaPvcmsN+oI+paQTG9PLjBgPFf yk/WEoAdjkXC2OhQtZJGdg5+f91t75GvRUudn2vZIo4ci4+urTOKEJKnaTbN7PhKOe/U Yb7eJbDc1/cXD1QbHuzAb+C3GPX3+HGvPK4588a3TR+x4/iCPf5LI7wPtyXMLtOUDHZj w7iN6SldjPyLuoVPzO1i7d1iYiaQrkum5fEBLwCw6yJ82B84vJdA/Ck43y6S/shTWIHp rdGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lVXBLdLLVdRAH8WvtTTwn3KL2AMuSLfFRit7UstUkL8=; b=brSKjHnGscIp747vXB6CElTCpUmW+0qhKq0Kk4a3qi7iqnktX3oeMop9gmfjiUI4UG KUlZLW5v0+jj5BPuzITtDk31YJn0nSL3uvvP54wGSQAWQK6Odkia4vEnVnmh79MBlRre 3Yatjtgy8dNMGnZ79UO/X6WHUaXCxUbQj1fXimTezyQYkwnULXyuzqaSt83S7QYMQPnT VAGuvB75PinoyIG8Ay4D3Ke9N4ZqJ6LDCwWqIbI/ZnLo7Ibb6bhmdwu/CVQCUe+40cLE eoUNQ4kEI7cd8fvxgUKiwsm3tNltwr64t7LxGmgleLpFA16vfKRymOQ0VCONfi3ATK1C YtVA== X-Gm-Message-State: AElRT7F3QIxDBQKkl0NRgaQEL4Wt0GPNkWQIkh/9xZRupZes6VxM5N6e z3IoRzfrx2pyh0SyxbGIhRTgxw== X-Google-Smtp-Source: AG47ELsuwdSiH5usvsdkaDD24gzPIPlUlpCqH1mbCe4o94bIisTdJUPQWOXWQiZ98QYnp6jcSUheRw== X-Received: by 10.80.177.86 with SMTP id l22mr6737356edd.88.1521069825566; Wed, 14 Mar 2018 16:23:45 -0700 (PDT) Received: from mutt-hbsd (bzq-62-219-3-47.dcenter.bezeqint.net. [62.219.3.47]) by smtp.gmail.com with ESMTPSA id b10sm939871edk.32.2018.03.14.16.23.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Mar 2018 16:23:44 -0700 (PDT) Date: Wed, 14 Mar 2018 19:23:30 -0400 From: Shawn Webb To: Alan Somers Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329984 - in head: cddl/contrib/opensolaris/lib/libzpool/common sys/cddl/compat/opensolaris/sys Message-ID: <20180314232330.sjeqpbb3hwc37mhb@mutt-hbsd> References: <201802251429.w1PEThjY035303@repo.freebsd.org> <20180314225009.gu3awgryggsxqmff@mutt-hbsd> <20180314225623.zp6ufw5h7bua4etf@mutt-hbsd> <20180314231150.whi6ndflt77iyybw@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rpfwgcyxd2hi5f2b" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171215 X-Mailman-Approved-At: Thu, 15 Mar 2018 00:01:53 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 23:23:47 -0000 --rpfwgcyxd2hi5f2b Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 14, 2018 at 05:20:00PM -0600, Alan Somers wrote: > On Wed, Mar 14, 2018 at 5:11 PM, Shawn Webb > wrote: >=20 > > On Wed, Mar 14, 2018 at 05:06:09PM -0600, Alan Somers wrote: > > > On Wed, Mar 14, 2018 at 4:56 PM, Shawn Webb > > > wrote: > > > > > > > On Wed, Mar 14, 2018 at 04:51:27PM -0600, Alan Somers wrote: > > > > > On Wed, Mar 14, 2018 at 4:50 PM, Shawn Webb < > > shawn.webb@hardenedbsd.org> > > > > > wrote: > > > > > > > > > > > On Sun, Feb 25, 2018 at 02:29:43PM +0000, Alan Somers wrote: > > > > > > > Author: asomers > > > > > > > Date: Sun Feb 25 14:29:43 2018 > > > > > > > New Revision: 329984 > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/329984 > > > > > > > > > > > > > > Log: > > > > > > > Don't declare __assfail as static > > > > > > > > > > > > > > It gets called by dmu_buf_init_user, which is inline but not > > > > static. > > > > > > So it > > > > > > > needs global linkage itself. > > > > > > > > > > > > > > Reported by: GCC-6 > > > > > > > MFC after: 17 days > > > > > > > X-MFC-With: 329722 > > > > > > > > > > > > > > > > > > > Hey Alan, > > > > > > > > > > > > This commit breaks compiling world with ASAN. > > > > > > > > > > > > Some applications, like zfs, will fail with this error: > > > > > > > > > > > > /lib/libuutil.so.2: Undefined symbol "__assfail" > > > > > > > > > > > > Thanks, > > > > > > > > > > > > > > > > How does one build world with ASAN ? > > > > > > > > HardenedBSD has a feature branch in its playground repo for ASAN-if= ied > > > > world. > > > > > > > > We introduced two new MK_* toggles: MK_ASAN and MK_ASAN_RECOVER. > > > > MK_ASAN is self-explanitory. MK_ASAN_RECOVER tells the sanitizer > > > > framework to let the application continue running instead of abort > > > > execution. > > > > > > > > Here's where the magic gets set: > > > > > > > > https://github.com/HardenedBSD/hardenedBSD-playground/blob/hardened/ > > > > current/asan/share/mk/bsd.prog.mk#L125-L134 > > > > > > > > Thanks, > > > > > > > > > > I don't use HardenedBSD. Can you provide an invocation that will > > > demonstrate the breakage on FreeBSD head? I tried a few things, and = they > > > all either worked, or failed with errors other than the one you showe= d. > > > > No worries. I've just reverted the commit in that feature branch. If I > > have time, I'll see about porting the ASAN work to vanilla FreeBSD. > > But my time is extremely limited these days. > > > > Thanks, > > >=20 > Ok. BTW, that commit is due for MFC as of today. Unless I hear from you > otherwise, I'll go ahead and MFC it. That's totally fine. The ASAN-ified work is done in a feature branch that will only track HEAD. Given that I'm abusing ASAN in this particular case, the ASAN-ified world should never land in any production build. I don't plan to test 11-STABLE with ASAN. Thanks for letting me know, though. --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --rpfwgcyxd2hi5f2b Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlqpru4ACgkQaoRlj1JF bu4AQA/+Oeo5XFuGPbeH0h/UkXPF7mTZoqiLPNNxDneiiJchRQwRpp5nHPz9IzSD /KHcghgvDDXeMLh+k/KURJaS4nPyYSuojS90oi5JMoYFcDfATyedUgSSxXXAUbN4 ldRPoMfxqdl4p1ne6TP6aN8A9Z08epkbzYHxMlnTDUz2CAyRSnNlHXb3acr9rhUN jnd2wbXoiV6tBjPTvnETCGIs4mGSCF2Cj6n+HGfxjerxgWcHtnDf4NJZ60UK5D4m lgK65V1moW40/a7ibElQS+Gily8zd/F7fcoHr+Dq0iOh9ein+Nr55WHyNfFixhlP y5O1PFxdCspofqmSqr7QuWvloFLo7wfldspjqlyaK5y/Gi8jQjrnnjDpE1IroqRf cEW/PtaftradvbAY1+Xzlec7qSJZnpHyDbnfhlbV92/VmLpbMT4nzdB8F+it0wn2 h318CS+EtipI2ZQgc4QXz0Qls3Eldf8hTTOeZQcf9u2D6oaKHhufhqY3+yLmGjp3 c1o1VDPrAKqQTr8HtQcivls8q8AoobJ55ISPEa8H9ysKfcBigV41ECGXlzyJwXYd 1tMeQhKXuFM8zqBvrqLZMNgIPIBHldJr5O3bkOwl5aU2D7PFsI7nvaDdW7V5WCw4 6/KarKr90eB50gGkduA/9tXHE7YK2ZVw5UBp+A9pI/IDZ9s+F+8= =p20Z -----END PGP SIGNATURE----- --rpfwgcyxd2hi5f2b-- From owner-svn-src-head@freebsd.org Thu Mar 15 00:57:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 727BCF56BF4; Thu, 15 Mar 2018 00:57:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21BC980DF4; Thu, 15 Mar 2018 00:57:58 +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 150CE739B; Thu, 15 Mar 2018 00:57:58 +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 w2F0vvLd096172; Thu, 15 Mar 2018 00:57:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2F0vvhe096171; Thu, 15 Mar 2018 00:57:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803150057.w2F0vvhe096171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Mar 2018 00:57:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330962 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 330962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 00:57:58 -0000 Author: emaste Date: Thu Mar 15 00:57:57 2018 New Revision: 330962 URL: https://svnweb.freebsd.org/changeset/base/330962 Log: Remove KERNEL_RETPOLINE from BROKEN_OPTIONS on i386 Clang will compile both amd64 and i386 with retpoline. Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Thu Mar 15 00:44:34 2018 (r330961) +++ head/sys/conf/kern.opts.mk Thu Mar 15 00:57:57 2018 (r330962) @@ -87,7 +87,7 @@ BROKEN_OPTIONS+= OFED .endif # Things that don't work based on toolchain support. -.if ${MACHINE} != "amd64" +.if ${MACHINE} != "i386" && ${MACHINE} != "amd64" BROKEN_OPTIONS+= KERNEL_RETPOLINE .endif From owner-svn-src-head@freebsd.org Thu Mar 15 01:07:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5996CF574BC; Thu, 15 Mar 2018 01:07:22 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FD30813E8; Thu, 15 Mar 2018 01:07:22 +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 007087531; Thu, 15 Mar 2018 01:07:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2F17Lto001606; Thu, 15 Mar 2018 01:07:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2F17L4Y001605; Thu, 15 Mar 2018 01:07:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201803150107.w2F17L4Y001605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 15 Mar 2018 01:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330963 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 330963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 01:07:22 -0000 Author: mav Date: Thu Mar 15 01:07:21 2018 New Revision: 330963 URL: https://svnweb.freebsd.org/changeset/base/330963 Log: Increase ABOUT FIRMWARE command timeout to 5s. It seems default timeout of 100ms is not enough for my 2694L card, while it was perfectly fine for others, even for full-height 2694. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Thu Mar 15 00:57:57 2018 (r330962) +++ head/sys/dev/isp/isp.c Thu Mar 15 01:07:21 2018 (r330963) @@ -876,6 +876,7 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) } } } else if (IS_26XX(isp)) { + isp_prt(isp, ISP_LOGDEBUG1, "loading firmware from flash"); MBSINIT(&mbs, MBOX_LOAD_FLASH_FIRMWARE, MBLOGALL, 5000000); mbs.ibitm = 0x01; mbs.obitm = 0x07; @@ -913,9 +914,12 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) * we still need to (re)start it. */ MBSINIT(&mbs, MBOX_EXEC_FIRMWARE, MBLOGALL, 5000000); - if (IS_24XX(isp)) { + if (IS_26XX(isp)) { mbs.param[1] = code_org >> 16; mbs.param[2] = code_org; + } else if (IS_24XX(isp)) { + mbs.param[1] = code_org >> 16; + mbs.param[2] = code_org; if (isp->isp_loaded_fw) { mbs.param[3] = 0; } else { @@ -954,7 +958,7 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) * Ask the chip for the current firmware version. * This should prove that the new firmware is working. */ - MBSINIT(&mbs, MBOX_ABOUT_FIRMWARE, MBLOGALL, 0); + MBSINIT(&mbs, MBOX_ABOUT_FIRMWARE, MBLOGALL, 5000000); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { return; @@ -6739,7 +6743,7 @@ static const char *scsi_mbcmd_names[] = { static const uint32_t mbpfc[] = { ISP_FC_OPMAP(0x01, 0x01), /* 0x00: MBOX_NO_OP */ ISP_FC_OPMAP(0x1f, 0x01), /* 0x01: MBOX_LOAD_RAM */ - ISP_FC_OPMAP_HALF(0x07, 0xff, 0x00, 0x03), /* 0x02: MBOX_EXEC_FIRMWARE */ + ISP_FC_OPMAP_HALF(0x07, 0xff, 0x00, 0x1f), /* 0x02: MBOX_EXEC_FIRMWARE */ ISP_FC_OPMAP(0xdf, 0x01), /* 0x03: MBOX_DUMP_RAM */ ISP_FC_OPMAP(0x07, 0x07), /* 0x04: MBOX_WRITE_RAM_WORD */ ISP_FC_OPMAP(0x03, 0x07), /* 0x05: MBOX_READ_RAM_WORD */ From owner-svn-src-head@freebsd.org Thu Mar 15 05:58:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DF8EF5034D; Thu, 15 Mar 2018 05:58:36 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B8016E152; Thu, 15 Mar 2018 05:58:36 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 267B71255B; Thu, 15 Mar 2018 05:58:36 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2F5warL052189; Thu, 15 Mar 2018 05:58:36 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2F5wZDa052186; Thu, 15 Mar 2018 05:58:35 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201803150558.w2F5wZDa052186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 15 Mar 2018 05:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330970 - in head/stand/efi: include libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand/efi: include libefi X-SVN-Commit-Revision: 330970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 05:58:36 -0000 Author: tsoome Date: Thu Mar 15 05:58:35 2018 New Revision: 330970 URL: https://svnweb.freebsd.org/changeset/base/330970 Log: libefi: UEFI_BOOT_VAR_GUID duplicates EFI_GLOBAL_VARIABLE Drop UEFI_BOOT_VAR_GUID and use EFI_GLOBAL_VARIABLE. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D14696 Modified: head/stand/efi/include/efi.h head/stand/efi/libefi/efienv.c Modified: head/stand/efi/include/efi.h ============================================================================== --- head/stand/efi/include/efi.h Thu Mar 15 05:13:29 2018 (r330969) +++ head/stand/efi/include/efi.h Thu Mar 15 05:58:35 2018 (r330970) @@ -59,7 +59,5 @@ Revision History */ #define FREEBSD_BOOT_VAR_GUID \ { 0xCFEE69AD, 0xA0DE, 0x47A9, {0x93, 0xA8, 0xF6, 0x31, 0x06, 0xF8, 0xAE, 0x99} } -#define UEFI_BOOT_VAR_GUID \ - { 0x8be4df61, 0x93ca, 0x11d2, {0xaa, 0x0d, 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c} } #endif Modified: head/stand/efi/libefi/efienv.c ============================================================================== --- head/stand/efi/libefi/efienv.c Thu Mar 15 05:13:29 2018 (r330969) +++ head/stand/efi/libefi/efienv.c Thu Mar 15 05:58:35 2018 (r330970) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include static EFI_GUID FreeBSDBootVarGUID = FREEBSD_BOOT_VAR_GUID; -static EFI_GUID GlobalBootVarGUID = UEFI_BOOT_VAR_GUID; +static EFI_GUID GlobalBootVarGUID = EFI_GLOBAL_VARIABLE; EFI_STATUS efi_getenv(EFI_GUID *g, const char *v, void *data, size_t *len) From owner-svn-src-head@freebsd.org Thu Mar 15 06:19:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7BC1F51087; Thu, 15 Mar 2018 06:19:46 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E6C46ED2D; Thu, 15 Mar 2018 06:19:46 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44D5212861; Thu, 15 Mar 2018 06:19:46 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2F6Jkjf063626; Thu, 15 Mar 2018 06:19:46 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2F6JjEP063620; Thu, 15 Mar 2018 06:19:45 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201803150619.w2F6JjEP063620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 15 Mar 2018 06:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330971 - in head/sys: conf powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: in head/sys: conf powerpc/powernv X-SVN-Commit-Revision: 330971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 06:19:47 -0000 Author: wma Date: Thu Mar 15 06:19:45 2018 New Revision: 330971 URL: https://svnweb.freebsd.org/changeset/base/330971 Log: Reverting r330925 for now Modified: head/sys/conf/files.powerpc head/sys/powerpc/powernv/opal_i2c.c head/sys/powerpc/powernv/opal_i2cm.c head/sys/powerpc/powernv/powernv_centaur.c head/sys/powerpc/powernv/powernv_xscom.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Thu Mar 15 05:58:35 2018 (r330970) +++ head/sys/conf/files.powerpc Thu Mar 15 06:19:45 2018 (r330971) @@ -186,8 +186,8 @@ powerpc/powermac/vcoregpio.c optional powermac powerpc/powernv/opal.c optional powernv powerpc/powernv/opal_console.c optional powernv powerpc/powernv/opal_dev.c optional powernv -powerpc/powernv/opal_i2c.c optional iicbus powernv -powerpc/powernv/opal_i2cm.c optional iicbus powernv +powerpc/powernv/opal_i2c.c optional iicbus fdt powernv +powerpc/powernv/opal_i2cm.c optional iicbus fdt powernv powerpc/powernv/opal_pci.c optional powernv pci powerpc/powernv/opalcall.S optional powernv powerpc/powernv/platform_powernv.c optional powernv Modified: head/sys/powerpc/powernv/opal_i2c.c ============================================================================== --- head/sys/powerpc/powernv/opal_i2c.c Thu Mar 15 05:58:35 2018 (r330970) +++ head/sys/powerpc/powernv/opal_i2c.c Thu Mar 15 06:19:45 2018 (r330971) @@ -120,9 +120,7 @@ static int opal_i2c_probe(device_t dev) { -#ifdef FDT if (!(ofw_bus_is_compatible(dev, "ibm,opal-i2c"))) -#endif return (ENXIO); device_set_desc(dev, "opal-i2c"); @@ -133,7 +131,6 @@ opal_i2c_probe(device_t dev) static int opal_i2c_attach(device_t dev) { -#ifdef FDT struct opal_i2c_softc *sc; int len; @@ -153,9 +150,6 @@ opal_i2c_attach(device_t dev) I2C_LOCK_INIT(sc); return (bus_generic_attach(dev)); -#else - return (ENXIO); -#endif } static int Modified: head/sys/powerpc/powernv/opal_i2cm.c ============================================================================== --- head/sys/powerpc/powernv/opal_i2cm.c Thu Mar 15 05:58:35 2018 (r330970) +++ head/sys/powerpc/powernv/opal_i2cm.c Thu Mar 15 06:19:45 2018 (r330971) @@ -57,17 +57,14 @@ struct opal_i2cm_softc static int opal_i2cm_attach(device_t); static int opal_i2cm_probe(device_t); -#ifdef FDT static const struct ofw_bus_devinfo * opal_i2cm_get_devinfo(device_t, device_t); -#endif static device_method_t opal_i2cm_methods[] = { /* Device interface */ DEVMETHOD(device_probe, opal_i2cm_probe), DEVMETHOD(device_attach, opal_i2cm_attach), -#ifdef FDT /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, opal_i2cm_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), @@ -75,7 +72,6 @@ static device_method_t opal_i2cm_methods[] = { DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), -#endif DEVMETHOD_END }; @@ -86,10 +82,8 @@ static int opal_i2cm_probe(device_t dev) { -#ifdef FDT if (!(ofw_bus_is_compatible(dev, "ibm,centaur-i2cm") || ofw_bus_is_compatible(dev, "ibm,power8-i2cm"))) -#endif return (ENXIO); device_set_desc(dev, "centaur-i2cm"); @@ -99,7 +93,6 @@ opal_i2cm_probe(device_t dev) static int opal_i2cm_attach(device_t dev) { -#ifdef FDT phandle_t child; device_t cdev; struct ofw_bus_devinfo *dinfo; @@ -123,18 +116,13 @@ opal_i2cm_attach(device_t dev) } return (bus_generic_attach(dev)); -#else - return (ENXIO); -#endif } -#ifdef FDT static const struct ofw_bus_devinfo * opal_i2cm_get_devinfo(device_t dev, device_t child) { return (device_get_ivars(child)); } -#endif DEFINE_CLASS_0(opal_i2cm, opal_i2cm_driver, opal_i2cm_methods, sizeof(struct opal_i2cm_softc)); Modified: head/sys/powerpc/powernv/powernv_centaur.c ============================================================================== --- head/sys/powerpc/powernv/powernv_centaur.c Thu Mar 15 05:58:35 2018 (r330970) +++ head/sys/powerpc/powernv/powernv_centaur.c Thu Mar 15 06:19:45 2018 (r330971) @@ -57,17 +57,14 @@ struct powernv_centaur_softc static int powernv_centaur_attach(device_t); static int powernv_centaur_probe(device_t); -#ifdef FDT static const struct ofw_bus_devinfo * powernv_centaur_get_devinfo(device_t, device_t); -#endif static device_method_t powernv_centaur_methods[] = { /* Device interface */ DEVMETHOD(device_probe, powernv_centaur_probe), DEVMETHOD(device_attach, powernv_centaur_attach), -#ifdef FDT /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, powernv_centaur_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), @@ -75,7 +72,7 @@ static device_method_t powernv_centaur_methods[] = { DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), -#endif + DEVMETHOD_END }; @@ -85,9 +82,7 @@ static int powernv_centaur_probe(device_t dev) { -#ifdef FDT if (!(ofw_bus_is_compatible(dev, "ibm,centaur"))) -#endif return (ENXIO); device_set_desc(dev, "centaur"); @@ -97,7 +92,6 @@ powernv_centaur_probe(device_t dev) static int powernv_centaur_attach(device_t dev) { -#ifdef FDT phandle_t child; device_t cdev; struct ofw_bus_devinfo *dinfo; @@ -121,18 +115,13 @@ powernv_centaur_attach(device_t dev) } return (bus_generic_attach(dev)); -#else - return (ENXIO); -#endif } -#ifdef FDT static const struct ofw_bus_devinfo * powernv_centaur_get_devinfo(device_t dev, device_t child) { return (device_get_ivars(child)); } -#endif DEFINE_CLASS_0(powernv_centaur, powernv_centaur_driver, powernv_centaur_methods, sizeof(struct powernv_centaur_softc)); Modified: head/sys/powerpc/powernv/powernv_xscom.c ============================================================================== --- head/sys/powerpc/powernv/powernv_xscom.c Thu Mar 15 05:58:35 2018 (r330970) +++ head/sys/powerpc/powernv/powernv_xscom.c Thu Mar 15 06:19:45 2018 (r330971) @@ -57,17 +57,14 @@ struct powernv_xscom_softc static int powernv_xscom_attach(device_t); static int powernv_xscom_probe(device_t); -#ifdef FDT static const struct ofw_bus_devinfo * powernv_xscom_get_devinfo(device_t, device_t); -#endif static device_method_t powernv_xscom_methods[] = { /* Device interface */ DEVMETHOD(device_probe, powernv_xscom_probe), DEVMETHOD(device_attach, powernv_xscom_attach), -#ifdef FDT /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, powernv_xscom_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), @@ -75,7 +72,6 @@ static device_method_t powernv_xscom_methods[] = { DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), -#endif DEVMETHOD_END }; @@ -86,9 +82,7 @@ static int powernv_xscom_probe(device_t dev) { -#ifdef FDT if (!(ofw_bus_is_compatible(dev, "ibm,xscom"))) -#endif return (ENXIO); device_set_desc(dev, "xscom"); @@ -98,7 +92,6 @@ powernv_xscom_probe(device_t dev) static int powernv_xscom_attach(device_t dev) { -#ifdef FDT phandle_t child; device_t cdev; struct ofw_bus_devinfo *dinfo; @@ -122,18 +115,13 @@ powernv_xscom_attach(device_t dev) } return (bus_generic_attach(dev)); -#else - return (ENXIO); -#endif } -#ifdef FDT static const struct ofw_bus_devinfo * powernv_xscom_get_devinfo(device_t dev, device_t child) { return (device_get_ivars(child)); } -#endif DEFINE_CLASS_0(powernv_xscom, powernv_xscom_driver, powernv_xscom_methods, sizeof(struct powernv_xscom_softc)); From owner-svn-src-head@freebsd.org Thu Mar 15 08:49:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CE85F59B3E; Thu, 15 Mar 2018 08:49:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21415747C7; Thu, 15 Mar 2018 08:49:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B53B13F77; Thu, 15 Mar 2018 08:49:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2F8nLEa040189; Thu, 15 Mar 2018 08:49:21 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2F8nLri040186; Thu, 15 Mar 2018 08:49:21 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803150849.w2F8nLri040186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Mar 2018 08:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330974 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 330974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 08:49:22 -0000 Author: avg Date: Thu Mar 15 08:49:21 2018 New Revision: 330974 URL: https://svnweb.freebsd.org/changeset/base/330974 Log: MFV r330973: 9164 assert: newds == os->os_dsl_dataset illumos/illumos-gate@5f5913bb83405db87f982abee80162a479d363af https://github.com/illumos/illumos-gate/commit/5f5913bb83405db87f982abee80162a479d363af https://www.illumos.org/issues/9164 This issue has been reported by Alan Somers as https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225877 dmu_objset_refresh_ownership() first disowns a dataset (and releases it) and then owns it again. There is an assert that the new dataset object is the same as the old dataset object. When running ZFS Test Suite on FreeBSD we see this panic from zpool_upgrade_007_pos test: panic: solaris assert: newds == os->os_dsl_dataset (0xfffff80045f4c000 == 0xfffff80021ab4800) I see that the old dataset has dsl_dataset_evict_async() pending in ds_dbu.dbu_tqent and its ds_dbuf is NULL. Reviewed by: Matt Ahrens Reviewed by: Don Brady Approved by: Richard Lowe Author: Andriy Gapon PR: 225877 Reported by: asomers MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Thu Mar 15 08:46:49 2018 (r330973) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Thu Mar 15 08:49:21 2018 (r330974) @@ -670,23 +670,21 @@ dmu_objset_rele(objset_t *os, void *tag) * same name so that it can be partially torn down and reconstructed. */ void -dmu_objset_refresh_ownership(objset_t *os, void *tag) +dmu_objset_refresh_ownership(dsl_dataset_t *ds, dsl_dataset_t **newds, + void *tag) { dsl_pool_t *dp; - dsl_dataset_t *ds, *newds; char name[ZFS_MAX_DATASET_NAME_LEN]; - ds = os->os_dsl_dataset; VERIFY3P(ds, !=, NULL); VERIFY3P(ds->ds_owner, ==, tag); VERIFY(dsl_dataset_long_held(ds)); dsl_dataset_name(ds, name); - dp = dmu_objset_pool(os); + dp = ds->ds_dir->dd_pool; dsl_pool_config_enter(dp, FTAG); - dmu_objset_disown(os, tag); - VERIFY0(dsl_dataset_own(dp, name, tag, &newds)); - VERIFY3P(newds, ==, os->os_dsl_dataset); + dsl_dataset_disown(ds, tag); + VERIFY0(dsl_dataset_own(dp, name, tag, newds)); dsl_pool_config_exit(dp, FTAG); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Thu Mar 15 08:46:49 2018 (r330973) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Thu Mar 15 08:49:21 2018 (r330974) @@ -153,7 +153,8 @@ int dmu_objset_own(const char *name, dmu_objset_type_t boolean_t readonly, void *tag, objset_t **osp); int dmu_objset_own_obj(struct dsl_pool *dp, uint64_t obj, dmu_objset_type_t type, boolean_t readonly, void *tag, objset_t **osp); -void dmu_objset_refresh_ownership(objset_t *os, void *tag); +void dmu_objset_refresh_ownership(struct dsl_dataset *ds, + struct dsl_dataset **newds, void *tag); void dmu_objset_rele(objset_t *os, void *tag); void dmu_objset_disown(objset_t *os, void *tag); int dmu_objset_from_ds(struct dsl_dataset *ds, objset_t **osp); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Mar 15 08:46:49 2018 (r330973) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Mar 15 08:49:21 2018 (r330974) @@ -5115,14 +5115,14 @@ zfs_ioc_userspace_upgrade(zfs_cmd_t *zc) * objset needs to be closed & reopened (to grow the * objset_phys_t). Suspend/resume the fs will do that. */ - dsl_dataset_t *ds; + dsl_dataset_t *ds, *newds; ds = dmu_objset_ds(zfsvfs->z_os); error = zfs_suspend_fs(zfsvfs); if (error == 0) { - dmu_objset_refresh_ownership(zfsvfs->z_os, + dmu_objset_refresh_ownership(ds, &newds, zfsvfs); - error = zfs_resume_fs(zfsvfs, ds); + error = zfs_resume_fs(zfsvfs, newds); } } if (error == 0) From owner-svn-src-head@freebsd.org Thu Mar 15 08:52:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D80F2F5A05D; Thu, 15 Mar 2018 08:52:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 830E974CD4; Thu, 15 Mar 2018 08:52:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D755140F2; Thu, 15 Mar 2018 08:52:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2F8qngF045126; Thu, 15 Mar 2018 08:52:49 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2F8qnRB045125; Thu, 15 Mar 2018 08:52:49 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803150852.w2F8qnRB045125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Mar 2018 08:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330975 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade X-SVN-Commit-Revision: 330975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 08:52:50 -0000 Author: avg Date: Thu Mar 15 08:52:49 2018 New Revision: 330975 URL: https://svnweb.freebsd.org/changeset/base/330975 Log: re-enable zpool_upgrade_007_pos test after the fix in r330974 The test was disabled in r329248. PR: 225877 Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade/zpool_upgrade_test.sh Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade/zpool_upgrade_test.sh ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade/zpool_upgrade_test.sh Thu Mar 15 08:49:21 2018 (r330974) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade/zpool_upgrade_test.sh Thu Mar 15 08:52:49 2018 (r330975) @@ -207,7 +207,6 @@ zpool_upgrade_007_pos_body() . $(atf_get_srcdir)/zpool_upgrade.cfg verify_disk_count "$DISKS" 2 - atf_skip "PR 225877 - panic: solaris assert: newds == os->os_dsl_dataset during" ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_upgrade_007_pos.ksh || atf_fail "Testcase failed" } From owner-svn-src-head@freebsd.org Thu Mar 15 09:16:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92236F5BD5E; Thu, 15 Mar 2018 09:16:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44FCE75F91; Thu, 15 Mar 2018 09:16:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FE8714413; Thu, 15 Mar 2018 09:16:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2F9GBlZ055324; Thu, 15 Mar 2018 09:16:11 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2F9GAxo055322; Thu, 15 Mar 2018 09:16:10 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803150916.w2F9GAxo055322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Mar 2018 09:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330977 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 330977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 09:16:11 -0000 Author: avg Date: Thu Mar 15 09:16:10 2018 New Revision: 330977 URL: https://svnweb.freebsd.org/changeset/base/330977 Log: g_access: deal with races created by geoms that drop the topology lock The problem is that g_access() must be called with the GEOM topology lock held. And that gives a false impression that the lock is indeed held across the call. But this isn't always true because many classes, ZVOL being one of the many, need to drop the lock. It's either to perform an I/O on the first open or to acquire a different lock (like in g_mirror_access). That, of course, can break many assumptions. For example, g_slice_access() adds an extra exclusive count on the first open. As described above, an underlying geom may drop the topology lock and that would open a race with another thread that would also request another extra exclusive count. In general, two consumers may be granted incompatible accesses. To avoid this problem the code is changed to mark a geom with special flag before calling its access method and clear the flag afterwards. If another thread sees that flag, then it means that the topology lock has been dropped (either by the geom in question or downstream from it), so it is not safe to make another access call. So, the second thread would use g_topology_sleep() to wait until the flag is cleared and only then would it proceed with the access. Also see http://docs.freebsd.org/cgi/mid.cgi?809d9254-ee56-59d8-69a4-08838e985cea PR: 225960 Reported by: asomers Reviewed by: markj, mav MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14533 Modified: head/sys/geom/geom.h head/sys/geom/geom_subr.c Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Thu Mar 15 09:04:23 2018 (r330976) +++ head/sys/geom/geom.h Thu Mar 15 09:16:10 2018 (r330977) @@ -159,8 +159,10 @@ struct g_geom { void *spare1; void *softc; unsigned flags; -#define G_GEOM_WITHER 1 -#define G_GEOM_VOLATILE_BIO 2 +#define G_GEOM_WITHER 0x01 +#define G_GEOM_VOLATILE_BIO 0x02 +#define G_GEOM_IN_ACCESS 0x04 +#define G_GEOM_ACCESS_WAIT 0x08 LIST_HEAD(,g_geom_alias) aliases; }; Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Thu Mar 15 09:04:23 2018 (r330976) +++ head/sys/geom/geom_subr.c Thu Mar 15 09:16:10 2018 (r330977) @@ -876,7 +876,11 @@ int g_access(struct g_consumer *cp, int dcr, int dcw, int dce) { struct g_provider *pp; + struct g_geom *gp; int pw, pe; +#ifdef INVARIANTS + int sr, sw, se; +#endif int error; g_topology_assert(); @@ -884,6 +888,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int pp = cp->provider; KASSERT(pp != NULL, ("access but not attached")); G_VALID_PROVIDER(pp); + gp = pp->geom; g_trace(G_T_ACCESS, "g_access(%p(%s), %d, %d, %d)", cp, pp->name, dcr, dcw, dce); @@ -892,7 +897,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int KASSERT(cp->acw + dcw >= 0, ("access resulting in negative acw")); KASSERT(cp->ace + dce >= 0, ("access resulting in negative ace")); KASSERT(dcr != 0 || dcw != 0 || dce != 0, ("NOP access request")); - KASSERT(pp->geom->access != NULL, ("NULL geom->access")); + KASSERT(gp->access != NULL, ("NULL geom->access")); /* * If our class cares about being spoiled, and we have been, we @@ -904,6 +909,27 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int return (ENXIO); /* + * A number of GEOM classes either need to perform an I/O on the first + * open or to acquire a different subsystem's lock. To do that they + * may have to drop the topology lock. + * Other GEOM classes perform special actions when opening a lower rank + * geom for the first time. As a result, more than one thread may + * end up performing the special actions. + * So, we prevent concurrent "first" opens by marking the consumer with + * special flag. + * + * Note that if the geom's access method never drops the topology lock, + * then we will never see G_GEOM_IN_ACCESS here. + */ + while ((gp->flags & G_GEOM_IN_ACCESS) != 0) { + g_trace(G_T_ACCESS, + "%s: race on geom %s via provider %s and consumer of %s", + __func__, gp->name, pp->name, cp->geom->name); + gp->flags |= G_GEOM_ACCESS_WAIT; + g_topology_sleep(gp, 0); + } + + /* * Figure out what counts the provider would have had, if this * consumer had (r0w0e0) at this time. */ @@ -918,7 +944,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int pp, pp->name); /* If foot-shooting is enabled, any open on rank#1 is OK */ - if ((g_debugflags & 16) && pp->geom->rank == 1) + if ((g_debugflags & 16) && gp->rank == 1) ; /* If we try exclusive but already write: fail */ else if (dce > 0 && pw > 0) @@ -935,11 +961,27 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int /* Ok then... */ - error = pp->geom->access(pp, dcr, dcw, dce); +#ifdef INVARIANTS + sr = cp->acr; + sw = cp->acw; + se = cp->ace; +#endif + gp->flags |= G_GEOM_IN_ACCESS; + error = gp->access(pp, dcr, dcw, dce); KASSERT(dcr > 0 || dcw > 0 || dce > 0 || error == 0, ("Geom provider %s::%s dcr=%d dcw=%d dce=%d error=%d failed " - "closing ->access()", pp->geom->class->name, pp->name, dcr, dcw, + "closing ->access()", gp->class->name, pp->name, dcr, dcw, dce, error)); + + g_topology_assert(); + gp->flags &= ~G_GEOM_IN_ACCESS; + KASSERT(cp->acr == sr && cp->acw == sw && cp->ace == se, + ("Access counts changed during geom->access")); + if ((gp->flags & G_GEOM_ACCESS_WAIT) != 0) { + gp->flags &= ~G_GEOM_ACCESS_WAIT; + wakeup(gp); + } + if (!error) { /* * If we open first write, spoil any partner consumers. @@ -949,7 +991,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int if (pp->acw == 0 && dcw != 0) g_spoil(pp, cp); else if (pp->acw != 0 && pp->acw == -dcw && pp->error == 0 && - !(pp->geom->flags & G_GEOM_WITHER)) + !(gp->flags & G_GEOM_WITHER)) g_post_event(g_new_provider_event, pp, M_WAITOK, pp, NULL); From owner-svn-src-head@freebsd.org Thu Mar 15 09:28:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E474F5CAD0; Thu, 15 Mar 2018 09:28:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39CB97688C; Thu, 15 Mar 2018 09:28:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 328DE145BD; Thu, 15 Mar 2018 09:28:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2F9SBQW060414; Thu, 15 Mar 2018 09:28:11 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2F9SB7O060413; Thu, 15 Mar 2018 09:28:11 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803150928.w2F9SB7O060413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Mar 2018 09:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330979 - head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies X-SVN-Commit-Revision: 330979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 09:28:11 -0000 Author: avg Date: Thu Mar 15 09:28:10 2018 New Revision: 330979 URL: https://svnweb.freebsd.org/changeset/base/330979 Log: re-enable zfs_copies_006_pos test after a fix in r330977 The test was disabled in r329408. PR: 225960 Modified: head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh Modified: head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh Thu Mar 15 09:22:20 2018 (r330978) +++ head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh Thu Mar 15 09:28:10 2018 (r330979) @@ -170,7 +170,6 @@ zfs_copies_006_pos_body() . $(atf_get_srcdir)/zfs_copies.cfg verify_disk_count "$DISKS" 1 - atf_skip "PR 225960 g_access leak when unmounting UFS on a zvol" ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zfs_copies_006_pos.ksh || atf_fail "Testcase failed" } From owner-svn-src-head@freebsd.org Thu Mar 15 12:35:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C463F4E2F7; Thu, 15 Mar 2018 12:35:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2832C7E53E; Thu, 15 Mar 2018 12:35:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BD551628E; Thu, 15 Mar 2018 12:35:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FCZM10055374; Thu, 15 Mar 2018 12:35:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FCZM14055373; Thu, 15 Mar 2018 12:35:22 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803151235.w2FCZM14055373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Mar 2018 12:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330992 - head/tests/sys/cddl/zfs/include X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/tests/sys/cddl/zfs/include X-SVN-Commit-Revision: 330992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 12:35:23 -0000 Author: avg Date: Thu Mar 15 12:35:22 2018 New Revision: 330992 URL: https://svnweb.freebsd.org/changeset/base/330992 Log: zfs test suite: fix a typo, da0 vs $disk Modified: head/tests/sys/cddl/zfs/include/libtest.kshlib Modified: head/tests/sys/cddl/zfs/include/libtest.kshlib ============================================================================== --- head/tests/sys/cddl/zfs/include/libtest.kshlib Thu Mar 15 12:05:17 2018 (r330991) +++ head/tests/sys/cddl/zfs/include/libtest.kshlib Thu Mar 15 12:35:22 2018 (r330992) @@ -678,7 +678,7 @@ function set_partition # { typeset disk=$1 - diskinfo da0 | awk '{print $3}' + diskinfo $disk | awk '{print $3}' } function get_available_disk_size # From owner-svn-src-head@freebsd.org Thu Mar 15 12:40:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44DCFF4E8EE; Thu, 15 Mar 2018 12:40:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC34D7E8DB; Thu, 15 Mar 2018 12:40:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE65D162A4; Thu, 15 Mar 2018 12:40:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FCehmP055698; Thu, 15 Mar 2018 12:40:43 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FCehPa055697; Thu, 15 Mar 2018 12:40:43 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803151240.w2FCehPa055697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Mar 2018 12:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330993 - head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy X-SVN-Commit-Revision: 330993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 12:40:44 -0000 Author: avg Date: Thu Mar 15 12:40:43 2018 New Revision: 330993 URL: https://svnweb.freebsd.org/changeset/base/330993 Log: zfs test suite: align zfs_destroy_005_neg: with upstream The change is to account for a different order in which the recursive destroy may be attempted. If we first try a dataset that can be destroyed then it will be destroyed, but if we first try a dataset that cannot be destroyed then we will not attempt to destroy the other dataset. Modified: head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh Modified: head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh Thu Mar 15 12:35:22 2018 (r330992) +++ head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh Thu Mar 15 12:40:43 2018 (r330993) @@ -121,10 +121,30 @@ negative_test "-r -rf" "$CTR $FS $VOL" typeset mtpt_dir=$(get_prop mountpoint $FS) make_dir_busy $mtpt_dir negative_test "-R -rR" $CTR -check_dataset datasetexists $CTR $FS $VOL $VOLSNAP $VOLCLONE -log_must datasetnonexists $FSSNAP $FSCLONE # +# Checking the outcome of the test above is tricky, because the order in +# which datasets are destroyed is not deterministic. Both $FS and $VOL are +# busy, and the remaining datasets will be different depending on whether we +# tried (and failed) to delete $FS or $VOL first. + +# The following datasets will exist independent of the order +check_dataset datasetexists $CTR $FS $VOL + +if datasetexists $VOLSNAP && datasetnonexists $FSSNAP; then + # The recursive destroy failed on $FS + check_dataset datasetnonexists $FSSNAP $FSCLONE + check_dataset datasetexists $VOLSNAP $VOLCLONE +elif datasetexists $FSSNAP && datasetnonexists $VOLSNAP; then + # The recursive destroy failed on $VOL + check_dataset datasetnonexists $VOLSNAP $VOLCLONE + check_dataset datasetexists $FSSNAP $FSCLONE +else + log_must zfs list -rtall + log_fail "Unexpected datasets remaining" +fi + +# # Create the clones for test environment, then verify 'zfs destroy $FS' # failed without '-f'. # @@ -148,7 +168,17 @@ if is_global_zone; then make_dir_busy $TESTDIR1 negative_test "-R -rR" $CTR log_must datasetexists $CTR $VOL - log_must datasetnonexists $FS $FSSNAP $FSCLONE $VOLSNAP $VOLCLONE + log_must datasetnonexists $VOLSNAP $VOLCLONE + + # Here again, the non-determinism of destroy order is a factor. $FS, + # $FSSNAP and $FSCLONE will still exist here iff we attempted to destroy + # $VOL (and failed) first. So check that either all of the datasets are + # present, or they're all gone. + if datasetexists $FS; then + check_dataset datasetexists $FS $FSSNAP $FSCLONE + else + check_dataset datasetnonexists $FS $FSSNAP $FSCLONE + fi # # Create the clones for test environment and make the volume busy. From owner-svn-src-head@freebsd.org Thu Mar 15 12:42:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D056F4EBC1; Thu, 15 Mar 2018 12:42:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D06517EC90; Thu, 15 Mar 2018 12:42:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB50A163F7; Thu, 15 Mar 2018 12:42:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FCgJKq060159; Thu, 15 Mar 2018 12:42:19 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FCgJvG060158; Thu, 15 Mar 2018 12:42:19 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803151242.w2FCgJvG060158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Mar 2018 12:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330994 - head/tests/sys/cddl/zfs/tests/hotplug X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/tests/sys/cddl/zfs/tests/hotplug X-SVN-Commit-Revision: 330994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 12:42:20 -0000 Author: avg Date: Thu Mar 15 12:42:19 2018 New Revision: 330994 URL: https://svnweb.freebsd.org/changeset/base/330994 Log: zfs test suite: destroy old gnops before creating new ones Modified: head/tests/sys/cddl/zfs/tests/hotplug/setup.ksh Modified: head/tests/sys/cddl/zfs/tests/hotplug/setup.ksh ============================================================================== --- head/tests/sys/cddl/zfs/tests/hotplug/setup.ksh Thu Mar 15 12:40:43 2018 (r330993) +++ head/tests/sys/cddl/zfs/tests/hotplug/setup.ksh Thu Mar 15 12:42:19 2018 (r330994) @@ -31,5 +31,6 @@ . $STF_SUITE/tests/hotplug/hotplug.kshlib +log_must destroy_gnops $ALL_DISKS log_must create_gnops $ALL_DISKS log_pass From owner-svn-src-head@freebsd.org Thu Mar 15 12:44:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E70D0F4EE64; Thu, 15 Mar 2018 12:44:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 993147EE8F; Thu, 15 Mar 2018 12:44:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9415F1640B; Thu, 15 Mar 2018 12:44:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FCiDsl060383; Thu, 15 Mar 2018 12:44:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FCiDS8060382; Thu, 15 Mar 2018 12:44:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803151244.w2FCiDS8060382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Mar 2018 12:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330995 - head/tests/sys/cddl/zfs/tests/slog X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/tests/sys/cddl/zfs/tests/slog X-SVN-Commit-Revision: 330995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 12:44:14 -0000 Author: avg Date: Thu Mar 15 12:44:13 2018 New Revision: 330995 URL: https://svnweb.freebsd.org/changeset/base/330995 Log: zfs test suite: fix a typo, TESTPOOL vs TESTPOOL2 Modified: head/tests/sys/cddl/zfs/tests/slog/slog.kshlib Modified: head/tests/sys/cddl/zfs/tests/slog/slog.kshlib ============================================================================== --- head/tests/sys/cddl/zfs/tests/slog/slog.kshlib Thu Mar 15 12:42:19 2018 (r330994) +++ head/tests/sys/cddl/zfs/tests/slog/slog.kshlib Thu Mar 15 12:44:13 2018 (r330995) @@ -34,7 +34,7 @@ function cleanup { poolexists $TESTPOOL && log_must $ZPOOL status $TESTPOOL - poolexists $TESTPOOL && log_must $ZPOOL status $TESTPOOL2 + poolexists $TESTPOOL2 && log_must $ZPOOL status $TESTPOOL2 destroy_pool $TESTPOOL destroy_pool $TESTPOOL2 } From owner-svn-src-head@freebsd.org Thu Mar 15 12:45:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 159E7F4EFD3; Thu, 15 Mar 2018 12:45:48 +0000 (UTC) (envelope-from meyser@xenet.de) Received: from server1.xenet.de (server1.xenet.de [213.221.94.201]) by mx1.freebsd.org (Postfix) with ESMTP id 88F697F0E0; Thu, 15 Mar 2018 12:45:46 +0000 (UTC) (envelope-from meyser@xenet.de) Received: from [10.0.0.68] (xenet.gate.xenet.de [213.221.94.32]) (authenticated bits=0) by server1.xenet.de (8.12.5/8.12.5) with ESMTP id w2FCPrNY012339; Thu, 15 Mar 2018 13:25:53 +0100 (CET) (envelope-from meyser@xenet.de) Subject: Re: svn commit: r330886 - head/share/examples To: Devin Teske , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803132337.w2DNbXDi025717@repo.freebsd.org> From: Matthias Meyser Organization: XeNET GmbH, Clausthal-Zellerfeld Message-ID: Date: Thu, 15 Mar 2018 13:25:58 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201803132337.w2DNbXDi025717@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE-1901 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 12:45:48 -0000 Am 14.03.2018 um 00:37 schrieb Devin Teske: > Author: dteske > Date: Tue Mar 13 23:37:33 2018 > New Revision: 330886 > URL: https://svnweb.freebsd.org/changeset/base/330886 > > Log: > Install files added in SVN's r295373, r295457, r295542 > > Reported by: woodsb02 > MFC after: 3 days > X-MFC to: stable/11 PR: 214994 (2016) is missing https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214994 Please change to fixed > > Modified: > head/share/examples/Makefile > > Modified: head/share/examples/Makefile > ============================================================================== > --- head/share/examples/Makefile Tue Mar 13 23:36:15 2018 (r330885) > +++ head/share/examples/Makefile Tue Mar 13 23:37:33 2018 (r330886) > @@ -76,6 +76,12 @@ XFILES= BSD_daemon/FreeBSD.pfa \ > indent/indent.pro \ > ipfw/change_rules.sh \ > jails/README \ > + jails/VIMAGE \ > + jails/jail.xxx.conf \ > + jails/jib \ > + jails/jng \ > + jails/rc.conf.jails \ > + jails/rcjail.xxx.conf \ > kld/Makefile \ > kld/cdev/Makefile \ > kld/cdev/README \ > -- Matthias Meyser | XeNET GmbH Tel.: +49-5323-9489050 | 38678 Clausthal-Zellerfeld, Marktstrasse 40 Fax: +49-5323-9489059 | Registergericht: Amtsgericht Braunschweig HRB 110823 Email: Meyser@xenet.de | Geschaeftsfuehrer: Matthias Meyser From owner-svn-src-head@freebsd.org Thu Mar 15 12:47:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CF21F4F239; Thu, 15 Mar 2018 12:47:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27A257F2C4; Thu, 15 Mar 2018 12:47:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 087E116410; Thu, 15 Mar 2018 12:47:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FClYUt060566; Thu, 15 Mar 2018 12:47:34 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FClYZe060563; Thu, 15 Mar 2018 12:47:34 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803151247.w2FClYZe060563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Mar 2018 12:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330996 - in head/tests/sys/cddl/zfs: include tests/cache tests/cli_root/zpool_add X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/tests/sys/cddl/zfs: include tests/cache tests/cli_root/zpool_add X-SVN-Commit-Revision: 330996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 12:47:35 -0000 Author: avg Date: Thu Mar 15 12:47:34 2018 New Revision: 330996 URL: https://svnweb.freebsd.org/changeset/base/330996 Log: zfs test suite: support device paths with intermediate directories The code assumed that disks (devices) used for testing are always named like /dev/foo, but there is no reason for that restriction and we can easily support paths like /dev/stripe/bar. Modified: head/tests/sys/cddl/zfs/include/libtest.kshlib head/tests/sys/cddl/zfs/tests/cache/cache.kshlib head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib Modified: head/tests/sys/cddl/zfs/include/libtest.kshlib ============================================================================== --- head/tests/sys/cddl/zfs/include/libtest.kshlib Thu Mar 15 12:44:13 2018 (r330995) +++ head/tests/sys/cddl/zfs/include/libtest.kshlib Thu Mar 15 12:47:34 2018 (r330996) @@ -640,7 +640,7 @@ function wipe_partition_table # [/dev/null 2>&1; then + if gpart list ${diskname#/dev/} >/dev/null 2>&1; then wait_for 5 1 $GPART destroy -F $diskname else log_note "No GPT partitions detected on $diskname" Modified: head/tests/sys/cddl/zfs/tests/cache/cache.kshlib ============================================================================== --- head/tests/sys/cddl/zfs/tests/cache/cache.kshlib Thu Mar 15 12:44:13 2018 (r330995) +++ head/tests/sys/cddl/zfs/tests/cache/cache.kshlib Thu Mar 15 12:47:34 2018 (r330996) @@ -90,9 +90,7 @@ function verify_cache_device # Zpool status returns on the device name sans the /dev, so # if the device contains /dev/ remove it. - if [[ $device =~ "^/dev/" ]]; then - device=`basename ${device}` - fi + device=${device#"/dev/"} if [[ $WRAPPER == *"smi"* ]]; then $ECHO $device | $EGREP "^c[0-F]+([td][0-F]+)+$" > /dev/null 2>&1 Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib Thu Mar 15 12:44:13 2018 (r330995) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib Thu Mar 15 12:47:34 2018 (r330996) @@ -55,9 +55,7 @@ function iscontained for vdev in $@; do # remove /dev/dsk in vdev if there is - $ECHO $vdev | $GREP "^/dev/" >/dev/null 2>&1 - (( $? == 0 )) && \ - vdev=${vdev##*/} + vdev=${vdev#/dev/} $ZPOOL status "$pool" | $AWK '$1 == vdevname {exit 1}' \ vdevname=$vdev >/dev/null 2>&1 From owner-svn-src-head@freebsd.org Thu Mar 15 13:46:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 714EAF534BB; Thu, 15 Mar 2018 13:46:29 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 274C581D17; Thu, 15 Mar 2018 13:46:29 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 223A716D39; Thu, 15 Mar 2018 13:46:29 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FDkTCs091601; Thu, 15 Mar 2018 13:46:29 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FDkStM091599; Thu, 15 Mar 2018 13:46:28 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201803151346.w2FDkStM091599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 15 Mar 2018 13:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331000 - head/lib/libc/net X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/lib/libc/net X-SVN-Commit-Revision: 331000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 13:46:29 -0000 Author: hrs Date: Thu Mar 15 13:46:28 2018 New Revision: 331000 URL: https://svnweb.freebsd.org/changeset/base/331000 Log: Make getnameinfo(3) salen requirement less strict and document details of salen in getnameinfo(3) manual page. getnameinfo(3) returned EAI_FAIL when salen was not equal to the length corresponding to the value specified by sa->sa_family. However, POSIX or RFC 3493 does not require it and RFC 4038 Sec.6.2.3 shows an example passing sizeof(struct sockaddr_storage) to salen. This change makes the requirement less strict by accepting salen up to sizeof(struct sockaddr_storage). It also includes two more changes: one is to fix return values because both SUSv4 and RFC 3493 require EAI_FAMILY when the address length is invalid, another is to fix sa_len dependency in PF_LOCAL. Pointed out by: Christophe Beauval Reviewed by: ae Differential Revision: https://reviews.freebsd.org/D14585 Modified: head/lib/libc/net/getnameinfo.3 head/lib/libc/net/getnameinfo.c Modified: head/lib/libc/net/getnameinfo.3 ============================================================================== --- head/lib/libc/net/getnameinfo.3 Thu Mar 15 13:07:15 2018 (r330999) +++ head/lib/libc/net/getnameinfo.3 Thu Mar 15 13:46:28 2018 (r331000) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 28, 2016 +.Dd March 15, 2018 .Dt GETNAMEINFO 3 .Os .Sh NAME @@ -80,6 +80,20 @@ or UNIX-domain respectively that is .Fa salen bytes long. +If +.Fa salen +is shorter than the length corresponding to the specified +address family or longer than +.Fn sizeof "struct sockaddr_storage" , +it returns +.Er EAI_FAMILY . +Note that +.Va sa->sa_len +should be consistent with +.Fa salen +though the value of +.Va sa->sa_len +is not directly used in this function. .Pp The host and service names associated with .Fa sa Modified: head/lib/libc/net/getnameinfo.c ============================================================================== --- head/lib/libc/net/getnameinfo.c Thu Mar 15 13:07:15 2018 (r330999) +++ head/lib/libc/net/getnameinfo.c Thu Mar 15 13:46:28 2018 (r331000) @@ -124,26 +124,36 @@ getnameinfo(const struct sockaddr *sa, socklen_t salen afd = find_afd(sa->sa_family); if (afd == NULL) return (EAI_FAMILY); + /* + * getnameinfo() accepts an salen of sizeof(struct sockaddr_storage) + * at maximum as shown in RFC 4038 Sec.6.2.3. + */ + if (salen > sizeof(struct sockaddr_storage)) + return (EAI_FAMILY); + switch (sa->sa_family) { case PF_LOCAL: /* - * PF_LOCAL uses variable sa->sa_len depending on the + * PF_LOCAL uses variable salen depending on the * content length of sun_path. Require 1 byte in * sun_path at least. */ - if (salen > afd->a_socklen || - salen <= afd->a_socklen - + if (salen <= afd->a_socklen - sizeofmember(struct sockaddr_un, sun_path)) - return (EAI_FAIL); + return (EAI_FAMILY); + else if (salen > afd->a_socklen) + salen = afd->a_socklen; break; case PF_LINK: if (salen <= afd->a_socklen - sizeofmember(struct sockaddr_dl, sdl_data)) - return (EAI_FAIL); + return (EAI_FAMILY); break; default: - if (salen != afd->a_socklen) - return (EAI_FAIL); + if (salen < afd->a_socklen) + return (EAI_FAMILY); + else + salen = afd->a_socklen; break; } @@ -517,7 +527,7 @@ getnameinfo_un(const struct afd *afd, if (serv != NULL && servlen > 0) *serv = '\0'; if (host != NULL && hostlen > 0) { - pathlen = sa->sa_len - afd->a_off; + pathlen = salen - afd->a_off; if (pathlen + 1 > hostlen) { *host = '\0'; From owner-svn-src-head@freebsd.org Thu Mar 15 14:23:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16C1EF55ED6; Thu, 15 Mar 2018 14:23:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B65AF834AC; Thu, 15 Mar 2018 14:23:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC54817364; Thu, 15 Mar 2018 14:23:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FENVdX011483; Thu, 15 Mar 2018 14:23:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FENVFw011481; Thu, 15 Mar 2018 14:23:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803151423.w2FENVFw011481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Mar 2018 14:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331001 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_export X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/tests/sys/cddl/zfs/tests/cli_root/zpool_export X-SVN-Commit-Revision: 331001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 14:23:32 -0000 Author: avg Date: Thu Mar 15 14:23:31 2018 New Revision: 331001 URL: https://svnweb.freebsd.org/changeset/base/331001 Log: zfs test suite: move definition of DISK to the cfg file in zpool_export The variable is used not only by the setup script but also by the atf test bodies. Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/setup.ksh head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/zpool_export.cfg Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/setup.ksh ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/setup.ksh Thu Mar 15 13:46:28 2018 (r331000) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/setup.ksh Thu Mar 15 14:23:31 2018 (r331001) @@ -31,6 +31,4 @@ . $STF_SUITE/include/libtest.kshlib -DISK=${DISKS%% *} - default_setup $DISK Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/zpool_export.cfg ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/zpool_export.cfg Thu Mar 15 13:46:28 2018 (r331000) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/zpool_export.cfg Thu Mar 15 14:23:31 2018 (r331001) @@ -30,3 +30,5 @@ # . $STF_SUITE/tests/cli_root/cli.cfg + +export DISK=${DISKS%% *} From owner-svn-src-head@freebsd.org Thu Mar 15 14:35:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06F2CF56A62; Thu, 15 Mar 2018 14:35:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1D4083C59; Thu, 15 Mar 2018 14:35:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CD75174E3; Thu, 15 Mar 2018 14:35:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FEZkn2016289; Thu, 15 Mar 2018 14:35:46 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FEZk8b016287; Thu, 15 Mar 2018 14:35:46 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803151435.w2FEZk8b016287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Mar 2018 14:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331002 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_get X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/tests/sys/cddl/zfs/tests/cli_root/zpool_get X-SVN-Commit-Revision: 331002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 14:35:47 -0000 Author: avg Date: Thu Mar 15 14:35:46 2018 New Revision: 331002 URL: https://svnweb.freebsd.org/changeset/base/331002 Log: zfs test suite: move definition of DISK to the cfg file in zpool_get The variable is used not only by the setup script but also by the atf test bodies. This should have been in r331001. Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/setup.ksh head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/setup.ksh ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/setup.ksh Thu Mar 15 14:23:31 2018 (r331001) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/setup.ksh Thu Mar 15 14:35:46 2018 (r331002) @@ -32,6 +32,4 @@ . ${STF_SUITE}/include/libtest.kshlib verify_runnable "both" -DISK=${DISKS%% *} - default_setup $DISK Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg Thu Mar 15 14:23:31 2018 (r331001) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg Thu Mar 15 14:35:46 2018 (r331002) @@ -69,3 +69,5 @@ typeset -a properties=( "feature@skein" # "feature@edonr" Edonr is not yet implemented on FreeBSD ) + +export DISK=${DISKS%% *} From owner-svn-src-head@freebsd.org Thu Mar 15 14:41:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1FD0F570FA; Thu, 15 Mar 2018 14:41:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A84DC83F97; Thu, 15 Mar 2018 14:41:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A354C1761F; Thu, 15 Mar 2018 14:41:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FEf9eX017317; Thu, 15 Mar 2018 14:41:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FEf9oo017316; Thu, 15 Mar 2018 14:41:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803151441.w2FEf9oo017316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Mar 2018 14:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331003 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_get X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/tests/sys/cddl/zfs/tests/cli_root/zpool_get X-SVN-Commit-Revision: 331003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 14:41:10 -0000 Author: avg Date: Thu Mar 15 14:41:09 2018 New Revision: 331003 URL: https://svnweb.freebsd.org/changeset/base/331003 Log: zfs test suite: add new pool properties / features to the zpool_get list Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg Thu Mar 15 14:35:46 2018 (r331002) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg Thu Mar 15 14:41:09 2018 (r331003) @@ -53,6 +53,7 @@ typeset -a properties=( "freeing" "fragmentation" "leaked" + "bootsize" "feature@async_destroy" "feature@empty_bpobj" "feature@lz4_compress" @@ -68,6 +69,8 @@ typeset -a properties=( "feature@sha512" "feature@skein" # "feature@edonr" Edonr is not yet implemented on FreeBSD + "feature@device_removal" + "feature@obsolete_counts" ) export DISK=${DISKS%% *} From owner-svn-src-head@freebsd.org Thu Mar 15 14:47:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2BF4F578D6; Thu, 15 Mar 2018 14:47:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 726BB84630; Thu, 15 Mar 2018 14:47:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67B5C17677; Thu, 15 Mar 2018 14:47:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FElsNK021539; Thu, 15 Mar 2018 14:47:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FEls3r021537; Thu, 15 Mar 2018 14:47:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803151447.w2FEls3r021537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 15 Mar 2018 14:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331004 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_history X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/tests/sys/cddl/zfs/tests/cli_root/zpool_history X-SVN-Commit-Revision: 331004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 14:47:54 -0000 Author: avg Date: Thu Mar 15 14:47:53 2018 New Revision: 331004 URL: https://svnweb.freebsd.org/changeset/base/331004 Log: zfs test suite: move definition of DISK to the cfg file in zpool_get The variable is used not only by the setup script but also by the atf test bodies. Another one that should have been in r331001. Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/setup.ksh head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/zpool_history.cfg Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/setup.ksh ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/setup.ksh Thu Mar 15 14:41:09 2018 (r331003) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/setup.ksh Thu Mar 15 14:47:53 2018 (r331004) @@ -31,5 +31,4 @@ . $STF_SUITE/include/libtest.kshlib -DISK=${DISKS%% *} default_container_volume_setup $DISK Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/zpool_history.cfg ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/zpool_history.cfg Thu Mar 15 14:41:09 2018 (r331003) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/zpool_history.cfg Thu Mar 15 14:47:53 2018 (r331004) @@ -28,3 +28,5 @@ # . $STF_SUITE/tests/cli_root/cli.cfg + +export DISK=${DISKS%% *} From owner-svn-src-head@freebsd.org Thu Mar 15 15:05:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE42DF58C0E; Thu, 15 Mar 2018 15:05:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72B908532A; Thu, 15 Mar 2018 15:05:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5398A17979; Thu, 15 Mar 2018 15:05:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FF5QV2031524; Thu, 15 Mar 2018 15:05:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FF5QBC031523; Thu, 15 Mar 2018 15:05:26 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201803151505.w2FF5QBC031523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 15 Mar 2018 15:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331005 - head/share/termcap X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/termcap X-SVN-Commit-Revision: 331005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 15:05:27 -0000 Author: bapt Date: Thu Mar 15 15:05:26 2018 New Revision: 331005 URL: https://svnweb.freebsd.org/changeset/base/331005 Log: Fix tab vs space indentation MFC after: 3 days Modified: head/share/termcap/termcap Modified: head/share/termcap/termcap ============================================================================== --- head/share/termcap/termcap Thu Mar 15 14:47:53 2018 (r331004) +++ head/share/termcap/termcap Thu Mar 15 15:05:26 2018 (r331005) @@ -4664,24 +4664,24 @@ Eterm|Eterm Terminal Emulator (X11 Window System):\ # Termcap for xterm-termite xterm-termite|VTE-based terminal:\ - :NP:am:hs:mi:ms:ut:xn:\ - :Co#256:co#80:it#8:li#24:pa#32767:\ - :@7=\EOF:@8=\EOM:AB=\E[48;5;%dm:AF=\E[38;5;%dm:AL=\E[%dL:\ - :DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:F1=\E[23~:F2=\E[24~:\ - :IC=\E[%d@:K2=\EOE:Km=\E[M:LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:\ - :SA=\E[?7h:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ZH=\E[3m:\ - :ZR=\E[23m:al=\E[L:bl=^G:bt=\E[Z:cb=\E[1K:cd=\E[J:ce=\E[K:\ - :ch=\E[%i%dG:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\ - :cs=\E[%i%d;%dr:cv=\E[%i%dd:dc=\E[P:dl=\E[M:do=^J:\ - :ds=\E]2;\007:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\ - :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ - :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kB=\E[Z:kD=\E[3~:\ - :kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l:\ - :kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:ku=\EOA:le=^H:md=\E[1m:\ - :me=\E[m:mr=\E[7m:nd=\E[C:op=\E[39;49m:r1=\Ec:rc=\E8:\ - :sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:ta=^I:te=\E[?1049l:\ - :ti=\E[?1049h:ts=\E]2;:u6=\E[%i%d;%dR:u7=\E[6n:ue=\E[24m:\ - :up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l: + :NP:am:hs:mi:ms:ut:xn:\ + :Co#256:co#80:it#8:li#24:pa#32767:\ + :@7=\EOF:@8=\EOM:AB=\E[48;5;%dm:AF=\E[38;5;%dm:AL=\E[%dL:\ + :DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:F1=\E[23~:F2=\E[24~:\ + :IC=\E[%d@:K2=\EOE:Km=\E[M:LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:\ + :SA=\E[?7h:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ZH=\E[3m:\ + :ZR=\E[23m:al=\E[L:bl=^G:bt=\E[Z:cb=\E[1K:cd=\E[J:ce=\E[K:\ + :ch=\E[%i%dG:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\ + :cs=\E[%i%d;%dr:cv=\E[%i%dd:dc=\E[P:dl=\E[M:do=^J:\ + :ds=\E]2;\007:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\ + :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ + :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kB=\E[Z:kD=\E[3~:\ + :kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l:\ + :kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:ku=\EOA:le=^H:md=\E[1m:\ + :me=\E[m:mr=\E[7m:nd=\E[C:op=\E[39;49m:r1=\Ec:rc=\E8:\ + :sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:ta=^I:te=\E[?1049l:\ + :ti=\E[?1049h:ts=\E]2;:u6=\E[%i%d;%dR:u7=\E[6n:ue=\E[24m:\ + :up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l: # # END OF TERMCAP From owner-svn-src-head@freebsd.org Thu Mar 15 15:13:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF55EF59493; Thu, 15 Mar 2018 15:13:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 913CD85AA0; Thu, 15 Mar 2018 15:13:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C17317B0C; Thu, 15 Mar 2018 15:13:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FFDHHC036589; Thu, 15 Mar 2018 15:13:17 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FFDH1x036588; Thu, 15 Mar 2018 15:13:17 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201803151513.w2FFDH1x036588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 15 Mar 2018 15:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331006 - head/share/termcap X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/termcap X-SVN-Commit-Revision: 331006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 15:13:18 -0000 Author: bapt Date: Thu Mar 15 15:13:17 2018 New Revision: 331006 URL: https://svnweb.freebsd.org/changeset/base/331006 Log: Add termcap entries for the st terminal (https://st.sucksless.org) MFC after: 3 days Modified: head/share/termcap/termcap Modified: head/share/termcap/termcap ============================================================================== --- head/share/termcap/termcap Thu Mar 15 15:05:26 2018 (r331005) +++ head/share/termcap/termcap Thu Mar 15 15:13:17 2018 (r331006) @@ -4683,6 +4683,43 @@ xterm-termite|VTE-based terminal:\ :ti=\E[?1049h:ts=\E]2;:u6=\E[%i%d;%dR:u7=\E[6n:ue=\E[24m:\ :up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l: +# Termcap for st terminal taken from the st-0.8 sources +st|simpleterm:\ + :am:hs:mi:ms:xn:\ + :co#80:it#8:li#24:\ + :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\ + :K1=\E[1~:K2=\EOu:K3=\E[5~:K4=\E[4~:K5=\E[6~:LE=\E[%dD:\ + :RI=\E[%dC:SF=\E[%dS:UP=\E[%dA:ae=\E(B:al=\E[L:as=\E(0:\ + :bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\ + :cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:\ + :dl=\E[M:do=\n:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\ + :is=\E[4l\E>\E[?1034l:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\ + :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:\ + :kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:\ + :ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\ + :ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[0m:mh=\E[2m:\ + :mr=\E[7m:nd=\E[C:rc=\E8:sc=\E7:se=\E[27m:sf=\n:so=\E[7m:\ + :sr=\EM:st=\EH:ta=^I:te=\E[?1049l:ti=\E[?1049h:ts=\E]0;:\ + :ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\ + :ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?25h: + +st-256color|simpleterm with 256 colors:\ + :cc:\ + :Co#256:pa#32767:\ + :AB=\E[48;5;%dm:AF=\E[38;5;%dm:\ + :..Ic=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\:\ + :oc=\E]104\007:tc=st: + +st-meta|simpleterm with meta key:\ + :km:\ + :is=\E[4l\E>\E[?1034h:mm=\E[?1034h:mo=\E[?1034l:\ + :rs=\E[4l\E>\E[?1034h:tc=st: + +st-meta-256color|simpleterm with meta key and 256 colors:\ + :km:\ + :is=\E[4l\E>\E[?1034h:mm=\E[?1034h:mo=\E[?1034l:\ + :rs=\E[4l\E>\E[?1034h:tc=st-256color: + # # END OF TERMCAP # ------------------------ From owner-svn-src-head@freebsd.org Thu Mar 15 15:14:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CAEEF59589; Thu, 15 Mar 2018 15:14:14 +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 3E4CC85BE8; Thu, 15 Mar 2018 15:14:14 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=62684 helo=[10.0.0.100]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1ewSGb-000MLU-5X; Thu, 15 Mar 2018 12:45:57 +0000 From: Devin Teske Message-Id: Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r330886 - head/share/examples Date: Thu, 15 Mar 2018 07:46:01 -0700 In-Reply-To: Cc: Devin Teske , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Matthias Meyser References: <201803132337.w2DNbXDi025717@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) Sender: devin@shxd.cx Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 15:14:14 -0000 > On Mar 15, 2018, at 5:25 AM, Matthias Meyser wrote: >=20 > Am 14.03.2018 um 00:37 schrieb Devin Teske: >> Author: dteske >> Date: Tue Mar 13 23:37:33 2018 >> New Revision: 330886 >> URL: https://svnweb.freebsd.org/changeset/base/330886 = >> Log: >> Install files added in SVN's r295373, r295457, r295542 >> Reported by: woodsb02 >> MFC after: 3 days >> X-MFC to: stable/11 >=20 > PR: 214994 (2016) is missing >=20 > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D214994 = >=20 > Please change to fixed >=20 Thanks. --=20 Devin= From owner-svn-src-head@freebsd.org Thu Mar 15 15:19:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3C91F59B25; Thu, 15 Mar 2018 15:19:27 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 303C2860C6; Thu, 15 Mar 2018 15:19:26 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f48.google.com with SMTP id a22-v6so10733856lfg.9; Thu, 15 Mar 2018 08:19:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5Pz+o7WPKO+WG/fsLNkmNrFKXL6LkmepzuJlGEL5pUI=; b=GtLXyiDDZdhoOHkQiwsYfTuZGRoS4DxzPktsUo40xaCrJsNv7nJKpSu9uBWRRiguh1 /jiUxMktpO4b+CaM2bbWfGEf5RcXq/J5hsTYjR9a8fvADCUj/BDPHI6j9ipyfKzo6O5M AlhPaJMvH0xw6/uu4QM/YvxhaKu+FSc51QShqlV6cxGjzJQUDgjCUefgwqfMGwIxNqCK 3Bb3W/yti0AlNz5ORRcgUu6qDvR67EHS0XP06IBY9zrMIKq5OXjJ7ggeGbqCx3ZXb1vq Fs3Rha9jTDodVTO3bqCaSIILpAUqWrYQwkSDF3FGYeKXKKSrnJ7mzfvtoJUrfGCIwnkl YnqA== X-Gm-Message-State: AElRT7G0iCjXE7IbBzrXD/z1qHX2I80gBbfYwRgmZjvRASvx2Djz34gZ yuBVnPtN8T2B5BpJUY4JA0XRdQ0/ X-Google-Smtp-Source: AG47ELv2RTLcpebruohTp5cRkJyfINxEQXgRAZ7I4/ZlMBPqU7Me8sCP/EE7iJPvFjSp+jocyt+eSw== X-Received: by 2002:a19:e48e:: with SMTP id x14-v6mr6839739lfi.115.1521127164675; Thu, 15 Mar 2018 08:19:24 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id v4sm1106154lje.53.2018.03.15.08.19.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 08:19:23 -0700 (PDT) Subject: Re: svn commit: r331006 - head/share/termcap To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803151513.w2FFDH1x036588@repo.freebsd.org> From: Andriy Gapon Message-ID: Date: Thu, 15 Mar 2018 17:19:22 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201803151513.w2FFDH1x036588@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 15:19:27 -0000 On 15/03/2018 17:13, Baptiste Daroussin wrote: > Add termcap entries for the st terminal (https://st.sucksless.org) Just in case anyone else got curious, the correct URL is https://st.suckless.org -- Andriy Gapon From owner-svn-src-head@freebsd.org Thu Mar 15 15:20:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C146EF59C80; Thu, 15 Mar 2018 15:20:49 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71B3186281; Thu, 15 Mar 2018 15:20:49 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1235) id 68D2FAB67; Thu, 15 Mar 2018 15:20:49 +0000 (UTC) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 354C16B3D7; Thu, 15 Mar 2018 16:20:49 +0100 (CET) Date: Thu, 15 Mar 2018 16:20:49 +0100 From: Baptiste Daroussin To: Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331006 - head/share/termcap Message-ID: <20180315152049.qakrhrr23tm5nist@ivaldir.net> References: <201803151513.w2FFDH1x036588@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="g5aadzweaip7jshd" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180223 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 15:20:49 -0000 --g5aadzweaip7jshd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 15, 2018 at 05:19:22PM +0200, Andriy Gapon wrote: > On 15/03/2018 17:13, Baptiste Daroussin wrote: > > Add termcap entries for the st terminal (https://st.sucksless.org) >=20 > Just in case anyone else got curious, the correct URL is https://st.suckl= ess.org Thanks and sorry for the typo Bapt --g5aadzweaip7jshd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlqqj1EACgkQY4mL3PG3 PlpGJg/+LHjWGQ6jxgOaIXzYdPA0dWKw7zDus5eih9glxlfRJb+T0y8IUNOreV4e RSPACrr/FHDP7BKvhy5SQc9ktCjGnfQaPMVcqBM2VS7w482gO3k7yyaRPsPett93 Bs+o21MD09v50i/Xe09knd/qdsIp9kLfaA3OWf/nUPJq6eoqDaEyaL0m8kfHJzym yvGycbH5NxjTQmqYTGL5ACJwKol9ABa3z4VANuGzq8KlSW73sGDp0HgOl+nd8zTr lOynB/9YX7o9tXd3u82w13gSy2TDyUsIVYBDgoFfU1ZoKusRxD8AZP2ADobbdCjx OAnuIfX4NZuanuHj5R0yd/Pdqndurl2isTyMdd6ZW//Gk5mDW1/DpMKDR4R8BRKh z6M/0e7Hpqo9eHg6qUrJzOPC531gH1zqqKM7ku/8wtlzAWKBanjpTyFFocRM6xpO +BPSeB+ptKlxrDOs2+/s0fRMwVCdR71/J6GNUVhR5lsNtI8L41abGM7tyMsfdMuE QAhO8ALwJ/kWoNXGnIacDFjzgxFq3i134PlIF55qWLpzIUQUlJMbYiEEHcVZ1u3p BJFZOFA5y/5jH4BPLITdjBUI0/pA/8kUBlioDplUOFjEAlfpY4b/CtJy9D4jl2uH nFh/noZxnDS/uqXkCDUw+Wf7k4Cd0VFvwsr9YlWeVz4QKrZIOaw= =qXKI -----END PGP SIGNATURE----- --g5aadzweaip7jshd-- From owner-svn-src-head@freebsd.org Thu Mar 15 16:17:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CD1EF5E151; Thu, 15 Mar 2018 16:17:03 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BDB069270; Thu, 15 Mar 2018 16:17:03 +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 25AEC18455; Thu, 15 Mar 2018 16:17:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FGH2Xx067264; Thu, 15 Mar 2018 16:17:02 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FGH2MT067263; Thu, 15 Mar 2018 16:17:02 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803151617.w2FGH2MT067263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 15 Mar 2018 16:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331007 - head/sys/crypto/aesni X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/crypto/aesni X-SVN-Commit-Revision: 331007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 16:17:03 -0000 Author: cem Date: Thu Mar 15 16:17:02 2018 New Revision: 331007 URL: https://svnweb.freebsd.org/changeset/base/331007 Log: aesni(4): Stylistic/comment enhancements Improve clarity of a comment and style(9) some areas. No functional change. Reported by: markj (on review of a mostly-copied driver) Sponsored by: Dell EMC Isilon Modified: head/sys/crypto/aesni/aesni.c Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Thu Mar 15 15:13:17 2018 (r331006) +++ head/sys/crypto/aesni/aesni.c Thu Mar 15 16:17:02 2018 (r331007) @@ -327,8 +327,8 @@ unhandled: return (EINVAL); } /* - * Free sessions goes first, so if first session is used, we need to - * allocate one. + * Free sessions are inserted at the head of the list. So if the first + * session is used, none are free and we must allocate a new one. */ ses = TAILQ_FIRST(&sc->sessions); if (ses == NULL || ses->used) { @@ -403,11 +403,13 @@ aesni_freesession(device_t dev, uint64_t tid) static int aesni_process(device_t dev, struct cryptop *crp, int hint __unused) { - struct aesni_softc *sc = device_get_softc(dev); - struct aesni_session *ses = NULL; + struct aesni_softc *sc; + struct aesni_session *ses; struct cryptodesc *crd, *enccrd, *authcrd; int error, needauth; + sc = device_get_softc(dev); + ses = NULL; error = 0; enccrd = NULL; authcrd = NULL; @@ -538,7 +540,7 @@ static device_method_t aesni_methods[] = { DEVMETHOD(cryptodev_freesession, aesni_freesession), DEVMETHOD(cryptodev_process, aesni_process), - {0, 0}, + DEVMETHOD_END }; static driver_t aesni_driver = { From owner-svn-src-head@freebsd.org Thu Mar 15 16:37:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 684CCF5FACA; Thu, 15 Mar 2018 16:37:44 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E7A26A7D7; Thu, 15 Mar 2018 16:37:44 +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 0967E18793; Thu, 15 Mar 2018 16:37:44 +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 w2FGbhsn077487; Thu, 15 Mar 2018 16:37:43 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FGbhvr077486; Thu, 15 Mar 2018 16:37:43 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803151637.w2FGbhvr077486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Mar 2018 16:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331008 - head/sys/dev/md X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/dev/md X-SVN-Commit-Revision: 331008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 16:37:44 -0000 Author: brooks Date: Thu Mar 15 16:37:43 2018 New Revision: 331008 URL: https://svnweb.freebsd.org/changeset/base/331008 Log: Restore the behavior of returning the total number of units by unconditionally incrementing i in the loop; Reported by: cem MFC with: r330880 Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14685 Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Thu Mar 15 16:17:02 2018 (r331007) +++ head/sys/dev/md/md.c Thu Mar 15 16:37:43 2018 (r331008) @@ -1765,7 +1765,8 @@ err_after_new: i = 1; LIST_FOREACH(sc, &md_softc_list, list) { if (i < MDNPAD - 1) - mdio->md_pad[i++] = sc->unit; + mdio->md_pad[i] = sc->unit; + i++; } mdio->md_pad[MIN(i, MDNPAD - 1)] = -1; mdio->md_pad[0] = i - 1; From owner-svn-src-head@freebsd.org Thu Mar 15 17:36:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D640FC8; Thu, 15 Mar 2018 17:36:14 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 309F96D764; Thu, 15 Mar 2018 17:36:14 +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 26D4D190F4; Thu, 15 Mar 2018 17:36:14 +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 w2FHaDnW007603; Thu, 15 Mar 2018 17:36:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FHaDtL007601; Thu, 15 Mar 2018 17:36:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201803151736.w2FHaDtL007601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 15 Mar 2018 17:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331013 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 331013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 17:36:14 -0000 Author: trasz Date: Thu Mar 15 17:36:13 2018 New Revision: 331013 URL: https://svnweb.freebsd.org/changeset/base/331013 Log: Fix iSCSI target crash on session reinstation. The crash scenario goes like this: there's a thread waiting on "reinstate"; because it doesn't update the timeout counter it gets terminated by the callout; at this point the maintenance thread starts the termination routine. The first thread finishes waiting, proceeds to icl_conn_handoff(), and drops the refcount, which allows the maintenance thread to free its resources. At this point another thread receives a PDU. Boom. PR: 222898, 219866 Reported by: Eugene M. Zheganin Tested by: Eugene M. Zheganin Reviewed by: mav@ (earlier version) MFC after: 2 weeks Sponsored by: playkey.net Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_frontend_iscsi.h Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Thu Mar 15 17:15:40 2018 (r331012) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Thu Mar 15 17:36:13 2018 (r331013) @@ -1164,11 +1164,11 @@ cfiscsi_maintenance_thread(void *arg) for (;;) { CFISCSI_SESSION_LOCK(cs); - if (cs->cs_terminating == false) + if (cs->cs_terminating == false || cs->cs_handoff_in_progress) cv_wait(&cs->cs_maintenance_cv, &cs->cs_lock); CFISCSI_SESSION_UNLOCK(cs); - if (cs->cs_terminating) { + if (cs->cs_terminating && cs->cs_handoff_in_progress == false) { /* * We used to wait up to 30 seconds to deliver queued @@ -1196,8 +1196,6 @@ static void cfiscsi_session_terminate(struct cfiscsi_session *cs) { - if (cs->cs_terminating) - return; cs->cs_terminating = true; cv_signal(&cs->cs_maintenance_cv); #ifdef ICL_KERNEL_PROXY @@ -1268,6 +1266,13 @@ cfiscsi_session_new(struct cfiscsi_softc *softc, const cv_init(&cs->cs_login_cv, "cfiscsi_login"); #endif + /* + * The purpose of this is to avoid racing with session shutdown. + * Otherwise we could have the maintenance thread call icl_conn_close() + * before we call icl_conn_handoff(). + */ + cs->cs_handoff_in_progress = true; + cs->cs_conn = icl_new_conn(offload, false, "cfiscsi", &cs->cs_lock); if (cs->cs_conn == NULL) { free(cs, M_CFISCSI); @@ -1378,8 +1383,18 @@ cfiscsi_accept(struct socket *so, struct sockaddr *sa, icl_conn_handoff_sock(cs->cs_conn, so); cs->cs_initiator_sa = sa; cs->cs_portal_id = portal_id; + cs->cs_handoff_in_progress = false; cs->cs_waiting_for_ctld = true; cv_signal(&cfiscsi_softc.accept_cv); + + CFISCSI_SESSION_LOCK(cs); + /* + * Wake up the maintenance thread if we got scheduled for termination + * somewhere between cfiscsi_session_new() and icl_conn_handoff_sock(). + */ + if (cs->cs_terminating) + cfiscsi_session_terminate(cs); + CFISCSI_SESSION_UNLOCK(cs); } #endif @@ -1559,6 +1574,7 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *ci) mtx_lock(&softc->lock); if (ct->ct_online == 0) { mtx_unlock(&softc->lock); + cs->cs_handoff_in_progress = false; cfiscsi_session_terminate(cs); cfiscsi_target_release(ct); ci->status = CTL_ISCSI_ERROR; @@ -1569,7 +1585,6 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *ci) cs->cs_target = ct; mtx_unlock(&softc->lock); - refcount_acquire(&cs->cs_outstanding_ctl_pdus); restart: if (!cs->cs_terminating) { mtx_lock(&softc->lock); @@ -1606,8 +1621,8 @@ restart: #endif error = icl_conn_handoff(cs->cs_conn, cihp->socket); if (error != 0) { + cs->cs_handoff_in_progress = false; cfiscsi_session_terminate(cs); - refcount_release(&cs->cs_outstanding_ctl_pdus); ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), "%s: icl_conn_handoff failed with error %d", @@ -1632,7 +1647,16 @@ restart: } #endif - refcount_release(&cs->cs_outstanding_ctl_pdus); + CFISCSI_SESSION_LOCK(cs); + cs->cs_handoff_in_progress = false; + + /* + * Wake up the maintenance thread if we got scheduled for termination. + */ + if (cs->cs_terminating) + cfiscsi_session_terminate(cs); + CFISCSI_SESSION_UNLOCK(cs); + ci->status = CTL_ISCSI_OK; } Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.h Thu Mar 15 17:15:40 2018 (r331012) +++ head/sys/cam/ctl/ctl_frontend_iscsi.h Thu Mar 15 17:36:13 2018 (r331013) @@ -85,6 +85,7 @@ struct cfiscsi_session { int cs_timeout; struct cv cs_maintenance_cv; bool cs_terminating; + bool cs_handoff_in_progress; bool cs_tasks_aborted; int cs_max_recv_data_segment_length; int cs_max_send_data_segment_length; From owner-svn-src-head@freebsd.org Thu Mar 15 18:12:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89D96F3FA01; Thu, 15 Mar 2018 18:12:56 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37F1C7006C; Thu, 15 Mar 2018 18:12:56 +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 32BC51972E; Thu, 15 Mar 2018 18:12:56 +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 w2FICuSX029192; Thu, 15 Mar 2018 18:12:56 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FICuYG029191; Thu, 15 Mar 2018 18:12:56 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803151812.w2FICuYG029191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Mar 2018 18:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331014 - head/sys/dev/md X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/dev/md X-SVN-Commit-Revision: 331014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 18:12:57 -0000 Author: brooks Date: Thu Mar 15 18:12:55 2018 New Revision: 331014 URL: https://svnweb.freebsd.org/changeset/base/331014 Log: Move implementation of ioctls into kern_*() functions. Move locks from outside ioctl to the individual implementations. This is the first step of changing the implementations to act on a kernel-internal request struct rather than on struct md_ioctl and to removing the use of kern_ioctl in mountroot. Reviewed by: cem, kib, markj (prior version) Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14700 Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Thu Mar 15 17:36:13 2018 (r331013) +++ head/sys/dev/md/md.c Thu Mar 15 18:12:55 2018 (r331014) @@ -1607,13 +1607,253 @@ mdcreate_null(struct md_s *sc, struct md_ioctl *mdio, } static int -xmdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td) +kern_mdattach_locked(struct thread *td, struct md_ioctl *mdio) { - struct md_ioctl *mdio; struct md_s *sc; - int error, i; unsigned sectsize; + int error, i; + sx_assert(&md_sx, SA_XLOCKED); + + switch (mdio->md_type) { + case MD_MALLOC: + case MD_PRELOAD: + case MD_VNODE: + case MD_SWAP: + case MD_NULL: + break; + default: + return (EINVAL); + } + if (mdio->md_sectorsize == 0) + sectsize = DEV_BSIZE; + else + sectsize = mdio->md_sectorsize; + if (sectsize > MAXPHYS || mdio->md_mediasize < sectsize) + return (EINVAL); + if (mdio->md_options & MD_AUTOUNIT) + sc = mdnew(-1, &error, mdio->md_type); + else { + if (mdio->md_unit > INT_MAX) + return (EINVAL); + sc = mdnew(mdio->md_unit, &error, mdio->md_type); + } + if (sc == NULL) + return (error); + if (mdio->md_label != NULL) + error = copyinstr(mdio->md_label, sc->label, + sizeof(sc->label), NULL); + if (error != 0) + goto err_after_new; + if (mdio->md_options & MD_AUTOUNIT) + mdio->md_unit = sc->unit; + sc->mediasize = mdio->md_mediasize; + sc->sectorsize = sectsize; + error = EDOOFUS; + switch (sc->type) { + case MD_MALLOC: + sc->start = mdstart_malloc; + error = mdcreate_malloc(sc, mdio); + break; + case MD_PRELOAD: + /* + * We disallow attaching preloaded memory disks via + * ioctl. Preloaded memory disks are automatically + * attached in g_md_init(). + */ + error = EOPNOTSUPP; + break; + case MD_VNODE: + sc->start = mdstart_vnode; + error = mdcreate_vnode(sc, mdio, td); + break; + case MD_SWAP: + sc->start = mdstart_swap; + error = mdcreate_swap(sc, mdio, td); + break; + case MD_NULL: + sc->start = mdstart_null; + error = mdcreate_null(sc, mdio, td); + break; + } +err_after_new: + if (error != 0) { + mddestroy(sc, td); + return (error); + } + + /* Prune off any residual fractional sector */ + i = sc->mediasize % sc->sectorsize; + sc->mediasize -= i; + + mdinit(sc); + return (0); +} + +static int +kern_mdattach(struct thread *td, struct md_ioctl *mdio) +{ + int error; + + sx_xlock(&md_sx); + error = kern_mdattach_locked(td, mdio); + sx_xunlock(&md_sx); + return (error); +} + +static int +kern_mddetach_locked(struct thread *td, struct md_ioctl *mdio) +{ + struct md_s *sc; + + sx_assert(&md_sx, SA_XLOCKED); + + if (mdio->md_mediasize != 0 || + (mdio->md_options & ~MD_FORCE) != 0) + return (EINVAL); + + sc = mdfind(mdio->md_unit); + if (sc == NULL) + return (ENOENT); + if (sc->opencount != 0 && !(sc->flags & MD_FORCE) && + !(mdio->md_options & MD_FORCE)) + return (EBUSY); + return (mddestroy(sc, td)); +} + +static int +kern_mddetach(struct thread *td, struct md_ioctl *mdio) +{ + int error; + + sx_xlock(&md_sx); + error = kern_mddetach_locked(td, mdio); + sx_xunlock(&md_sx); + return (error); +} + +static int +kern_mdresize_locked(struct md_ioctl *mdio) +{ + struct md_s *sc; + + sx_assert(&md_sx, SA_XLOCKED); + + if ((mdio->md_options & ~(MD_FORCE | MD_RESERVE)) != 0) + return (EINVAL); + + sc = mdfind(mdio->md_unit); + if (sc == NULL) + return (ENOENT); + if (mdio->md_mediasize < sc->sectorsize) + return (EINVAL); + if (mdio->md_mediasize < sc->mediasize && + !(sc->flags & MD_FORCE) && + !(mdio->md_options & MD_FORCE)) + return (EBUSY); + return (mdresize(sc, mdio)); +} + +static int +kern_mdresize(struct md_ioctl *mdio) +{ + int error; + + sx_xlock(&md_sx); + error = kern_mdresize_locked(mdio); + sx_xunlock(&md_sx); + return (error); +} + +static int +kern_mdquery_locked(struct md_ioctl *mdio) +{ + struct md_s *sc; + int error; + + sx_assert(&md_sx, SA_XLOCKED); + + sc = mdfind(mdio->md_unit); + if (sc == NULL) + return (ENOENT); + mdio->md_type = sc->type; + mdio->md_options = sc->flags; + mdio->md_mediasize = sc->mediasize; + mdio->md_sectorsize = sc->sectorsize; + error = 0; + if (mdio->md_label != NULL) { + error = copyout(sc->label, mdio->md_label, + strlen(sc->label) + 1); + if (error != 0) + return (error); + } + if (sc->type == MD_VNODE || + (sc->type == MD_PRELOAD && mdio->md_file != NULL)) + error = copyout(sc->file, mdio->md_file, + strlen(sc->file) + 1); + return (error); +} + +static int +kern_mdquery(struct md_ioctl *mdio) +{ + int error; + + sx_xlock(&md_sx); + error = kern_mdquery_locked(mdio); + sx_xunlock(&md_sx); + return (error); +} + +static int +kern_mdlist_locked(struct md_ioctl *mdio) +{ + struct md_s *sc; + int i; + + sx_assert(&md_sx, SA_XLOCKED); + + /* + * Write the number of md devices to mdio->md_pad[0]. + * Write the unit number of the first (MDNPAD - 2) units + * to mdio->md_pad[1::(MDNPAD - 2)] and terminate the + * list with -1. + * + * XXX: There is currently no mechanism to retrieve unit + * numbers for more than (MDNPAD - 2) units. + * + * XXX: Due to the use of LIST_INSERT_HEAD in mdnew(), the + * list of visible unit numbers not stable. + */ + i = 1; + LIST_FOREACH(sc, &md_softc_list, list) { + if (i < MDNPAD - 1) + mdio->md_pad[i] = sc->unit; + i++; + } + mdio->md_pad[MIN(i, MDNPAD - 1)] = -1; + mdio->md_pad[0] = i - 1; + return (0); +} + +static int +kern_mdlist(struct md_ioctl *mdio) +{ + int error; + + sx_xlock(&md_sx); + error = kern_mdlist_locked(mdio); + sx_xunlock(&md_sx); + return (error); +} + +static int +mdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, + struct thread *td) +{ + struct md_ioctl *mdio; + int error; + if (md_debug) printf("mdctlioctl(%s %lx %p %x %p)\n", devtoname(dev), cmd, addr, flags, td); @@ -1632,158 +1872,24 @@ xmdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr error = 0; switch (cmd) { case MDIOCATTACH: - switch (mdio->md_type) { - case MD_MALLOC: - case MD_PRELOAD: - case MD_VNODE: - case MD_SWAP: - case MD_NULL: - break; - default: - return (EINVAL); - } - if (mdio->md_sectorsize == 0) - sectsize = DEV_BSIZE; - else - sectsize = mdio->md_sectorsize; - if (sectsize > MAXPHYS || mdio->md_mediasize < sectsize) - return (EINVAL); - if (mdio->md_options & MD_AUTOUNIT) - sc = mdnew(-1, &error, mdio->md_type); - else { - if (mdio->md_unit > INT_MAX) - return (EINVAL); - sc = mdnew(mdio->md_unit, &error, mdio->md_type); - } - if (sc == NULL) - return (error); - if (mdio->md_label != NULL) - error = copyinstr(mdio->md_label, sc->label, - sizeof(sc->label), NULL); - if (error != 0) - goto err_after_new; - if (mdio->md_options & MD_AUTOUNIT) - mdio->md_unit = sc->unit; - sc->mediasize = mdio->md_mediasize; - sc->sectorsize = sectsize; - error = EDOOFUS; - switch (sc->type) { - case MD_MALLOC: - sc->start = mdstart_malloc; - error = mdcreate_malloc(sc, mdio); - break; - case MD_PRELOAD: - /* - * We disallow attaching preloaded memory disks via - * ioctl. Preloaded memory disks are automatically - * attached in g_md_init(). - */ - error = EOPNOTSUPP; - break; - case MD_VNODE: - sc->start = mdstart_vnode; - error = mdcreate_vnode(sc, mdio, td); - break; - case MD_SWAP: - sc->start = mdstart_swap; - error = mdcreate_swap(sc, mdio, td); - break; - case MD_NULL: - sc->start = mdstart_null; - error = mdcreate_null(sc, mdio, td); - break; - } -err_after_new: - if (error != 0) { - mddestroy(sc, td); - return (error); - } - - /* Prune off any residual fractional sector */ - i = sc->mediasize % sc->sectorsize; - sc->mediasize -= i; - - mdinit(sc); - return (0); + error = kern_mdattach(td, mdio); + break; case MDIOCDETACH: - if (mdio->md_mediasize != 0 || - (mdio->md_options & ~MD_FORCE) != 0) - return (EINVAL); - - sc = mdfind(mdio->md_unit); - if (sc == NULL) - return (ENOENT); - if (sc->opencount != 0 && !(sc->flags & MD_FORCE) && - !(mdio->md_options & MD_FORCE)) - return (EBUSY); - return (mddestroy(sc, td)); + error = kern_mddetach(td, mdio); + break; case MDIOCRESIZE: - if ((mdio->md_options & ~(MD_FORCE | MD_RESERVE)) != 0) - return (EINVAL); - - sc = mdfind(mdio->md_unit); - if (sc == NULL) - return (ENOENT); - if (mdio->md_mediasize < sc->sectorsize) - return (EINVAL); - if (mdio->md_mediasize < sc->mediasize && - !(sc->flags & MD_FORCE) && - !(mdio->md_options & MD_FORCE)) - return (EBUSY); - return (mdresize(sc, mdio)); + error = kern_mdresize(mdio); + break; case MDIOCQUERY: - sc = mdfind(mdio->md_unit); - if (sc == NULL) - return (ENOENT); - mdio->md_type = sc->type; - mdio->md_options = sc->flags; - mdio->md_mediasize = sc->mediasize; - mdio->md_sectorsize = sc->sectorsize; - error = 0; - if (mdio->md_label != NULL) { - error = copyout(sc->label, mdio->md_label, - strlen(sc->label) + 1); - } - if (sc->type == MD_VNODE || - (sc->type == MD_PRELOAD && mdio->md_file != NULL)) - error = copyout(sc->file, mdio->md_file, - strlen(sc->file) + 1); - return (error); + error = kern_mdquery(mdio); + break; case MDIOCLIST: - /* - * Write the number of md devices to mdio->md_pad[0]. - * Write the unit number of the first (MDNPAD - 2) units - * to mdio->md_pad[1::(MDNPAD - 2)] and terminate the - * list with -1. - * - * XXX: There is currently no mechanism to retrieve unit - * numbers for more than (MDNPAD - 2) units. - * - * XXX: Due to the use of LIST_INSERT_HEAD in mdnew(), the - * list of visible unit numbers not stable. - */ - i = 1; - LIST_FOREACH(sc, &md_softc_list, list) { - if (i < MDNPAD - 1) - mdio->md_pad[i] = sc->unit; - i++; - } - mdio->md_pad[MIN(i, MDNPAD - 1)] = -1; - mdio->md_pad[0] = i - 1; - return (0); + error = kern_mdlist(mdio); + break; default: - return (ENOIOCTL); + error = ENOIOCTL; }; -} -static int -mdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td) -{ - int error; - - sx_xlock(&md_sx); - error = xmdctlioctl(dev, cmd, addr, flags, td); - sx_xunlock(&md_sx); return (error); } From owner-svn-src-head@freebsd.org Thu Mar 15 18:29:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F8C6F41F76; Thu, 15 Mar 2018 18:29:57 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAF3670B7D; Thu, 15 Mar 2018 18:29:56 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEC3D198E1; Thu, 15 Mar 2018 18:29:56 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FITurc034740; Thu, 15 Mar 2018 18:29:56 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FITu8s034739; Thu, 15 Mar 2018 18:29:56 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201803151829.w2FITu8s034739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Thu, 15 Mar 2018 18:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331015 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 331015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 18:29:57 -0000 Author: dab Date: Thu Mar 15 18:29:56 2018 New Revision: 331015 URL: https://svnweb.freebsd.org/changeset/base/331015 Log: Modify rc.d/fsck to handle new status from fsck/fsck_ffs r328013 introduced a new error code from fsck_ffs that indicates that it could not completely fix the file system; this happens when it prints the message PLEASE RERUN FSCK. However, this status can happen when fsck is run in "preen" mode and the rc.d/fsck script does not handle that error code. Modify rc.d/fsck so that if "fsck -p" ("preen") returns the new status code (16) it will run "fsck -y", as it currently does for a status code of 8 (the "standard error exit"). Reported by: markj Reviewed by: mckusick, markj, ian, rgrimes MFC after: 3 days Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D14679 Modified: head/etc/rc.d/fsck Modified: head/etc/rc.d/fsck ============================================================================== --- head/etc/rc.d/fsck Thu Mar 15 18:12:55 2018 (r331014) +++ head/etc/rc.d/fsck Thu Mar 15 18:29:56 2018 (r331015) @@ -57,7 +57,7 @@ fsck_start() echo "Reboot failed; help!" stop_boot ;; - 8) + 8|16) if checkyesno fsck_y_enable; then echo "File system preen failed, trying fsck -y ${fsck_y_flags}" fsck -y ${fsck_y_flags} From owner-svn-src-head@freebsd.org Thu Mar 15 18:46:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F10D0F46485; Thu, 15 Mar 2018 18:46:58 +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 73EF371739; Thu, 15 Mar 2018 18:46: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 w2FIksEo094471; Thu, 15 Mar 2018 11:46:54 -0700 (PDT) (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 w2FIkr5u094470; Thu, 15 Mar 2018 11:46:53 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803151846.w2FIkr5u094470@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331015 - head/etc/rc.d In-Reply-To: <201803151829.w2FITu8s034739@repo.freebsd.org> To: David Bright Date: Thu, 15 Mar 2018 11:46:53 -0700 (PDT) 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 18:46:59 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: dab > Date: Thu Mar 15 18:29:56 2018 > New Revision: 331015 > URL: https://svnweb.freebsd.org/changeset/base/331015 > > Log: > Modify rc.d/fsck to handle new status from fsck/fsck_ffs > > r328013 introduced a new error code from fsck_ffs that indicates that > it could not completely fix the file system; this happens when it > prints the message PLEASE RERUN FSCK. However, this status can happen > when fsck is run in "preen" mode and the rc.d/fsck script does not > handle that error code. Modify rc.d/fsck so that if "fsck -p" > ("preen") returns the new status code (16) it will run "fsck -y", as > it currently does for a status code of 8 (the "standard error exit"). It will run "fsck -y" IFF fsck_y_enable is set to yes, otherwise it drops to single user as it does for error 8. > Reported by: markj > Reviewed by: mckusick, markj, ian, rgrimes > MFC after: 3 days > Sponsored by: Dell EMC > Differential Revision: https://reviews.freebsd.org/D14679 > > Modified: > head/etc/rc.d/fsck > > Modified: head/etc/rc.d/fsck > ============================================================================== > --- head/etc/rc.d/fsck Thu Mar 15 18:12:55 2018 (r331014) > +++ head/etc/rc.d/fsck Thu Mar 15 18:29:56 2018 (r331015) > @@ -57,7 +57,7 @@ fsck_start() > echo "Reboot failed; help!" > stop_boot > ;; > - 8) > + 8|16) > if checkyesno fsck_y_enable; then > echo "File system preen failed, trying fsck -y ${fsck_y_flags}" > fsck -y ${fsck_y_flags} > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Mar 15 19:03:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7FD0F49BD1; Thu, 15 Mar 2018 19:03: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59537722D5; Thu, 15 Mar 2018 19:03: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 5426319F1E; Thu, 15 Mar 2018 19:03: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 w2FJ3sBF054405; Thu, 15 Mar 2018 19:03:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FJ3s6A054404; Thu, 15 Mar 2018 19:03:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201803151903.w2FJ3s6A054404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 15 Mar 2018 19:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331016 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 331016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 19:03:54 -0000 Author: markj Date: Thu Mar 15 19:03:54 2018 New Revision: 331016 URL: https://svnweb.freebsd.org/changeset/base/331016 Log: Add a space between a section number and a following comma. Fix some nits from igor while here. MFC after: 3 days Modified: head/lib/libc/sys/sendfile.2 Modified: head/lib/libc/sys/sendfile.2 ============================================================================== --- head/lib/libc/sys/sendfile.2 Thu Mar 15 18:29:56 2018 (r331015) +++ head/lib/libc/sys/sendfile.2 Thu Mar 15 19:03:54 2018 (r331016) @@ -129,8 +129,8 @@ Starting with .Nm sending files off the .Xr ffs 7 -filesystem doesn't block on I/O -(see +filesystem does not block on I/O +(see .Sx IMPLEMENTATION NOTES ), so the condition no longer applies. However, it is safe if an application utilizes @@ -140,8 +140,8 @@ and on performs the same action as it did in older .Fx -versions, e.g. -.Xr aio_read 2, +versions, e.g., +.Xr aio_read 2 , .Xr read 2 or .Nm @@ -210,7 +210,7 @@ The .Fx implementation of .Fn sendfile -doesn't block on disk I/O when it sends a file off the +does not block on disk I/O when it sends a file off the .Xr ffs 7 filesystem. The syscall returns success before the actual I/O completes, and data From owner-svn-src-head@freebsd.org Thu Mar 15 19:23:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B69DF4B667; Thu, 15 Mar 2018 19:23:08 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 222557340D; Thu, 15 Mar 2018 19:23:08 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CC831A21F; Thu, 15 Mar 2018 19:23:08 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FJN7TA064586; Thu, 15 Mar 2018 19:23:07 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FJN7G7064582; Thu, 15 Mar 2018 19:23:07 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201803151923.w2FJN7G7064582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 15 Mar 2018 19:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331018 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 331018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 19:23:08 -0000 Author: jeff Date: Thu Mar 15 19:23:07 2018 New Revision: 331018 URL: https://svnweb.freebsd.org/changeset/base/331018 Log: Eliminate pageout wakeup races. Take another step towards lockless vmd_free_count manipulation. Reduce the scope of the free lock by using a pageout lock to synchronize sleep and wakeup. Only trigger the pageout daemon on transitions between states. Drive all wakeup operations directly as side-effects from freeing memory rather than requiring an additional function call. Reviewed by: markj, kib Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D14612 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_pageout.c head/sys/vm/vm_pagequeue.h head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Mar 15 19:08:33 2018 (r331017) +++ head/sys/vm/vm_page.c Thu Mar 15 19:23:07 2018 (r331018) @@ -139,14 +139,15 @@ extern int vmem_startup_count(void); struct vm_domain vm_dom[MAXMEMDOM]; struct mtx_padalign __exclusive_cache_line pa_lock[PA_LOCK_COUNT]; + struct mtx_padalign __exclusive_cache_line vm_domainset_lock; +/* The following fields are protected by the domainset lock. */ domainset_t __exclusive_cache_line vm_min_domains; domainset_t __exclusive_cache_line vm_severe_domains; static int vm_min_waiters; static int vm_severe_waiters; static int vm_pageproc_waiters; - /* * bogus page -- for I/O to/from partially complete buffers, * or for paging into sparsely invalid regions. @@ -184,7 +185,6 @@ static void vm_page_insert_radixdone(vm_page_t m, vm_o vm_page_t mpred); static int vm_page_reclaim_run(int req_class, int domain, u_long npages, vm_page_t m_run, vm_paddr_t high); -static void vm_domain_free_wakeup(struct vm_domain *); static int vm_domain_alloc_fail(struct vm_domain *vmd, vm_object_t object, int req); @@ -430,6 +430,7 @@ vm_page_domain_init(int domain) MTX_DEF | MTX_DUPOK); } mtx_init(&vmd->vmd_free_mtx, "vm page free queue", NULL, MTX_DEF); + mtx_init(&vmd->vmd_pageout_mtx, "vm pageout lock", NULL, MTX_DEF); snprintf(vmd->vmd_name, sizeof(vmd->vmd_name), "%d", domain); } @@ -731,8 +732,8 @@ vm_page_startup(vm_offset_t vaddr) vmd = VM_DOMAIN(seg->domain); vm_domain_free_lock(vmd); vm_phys_free_contig(m, pagecount); - vm_domain_freecnt_adj(vmd, (int)pagecount); vm_domain_free_unlock(vmd); + vm_domain_freecnt_inc(vmd, pagecount); vm_cnt.v_page_count += (u_int)pagecount; vmd = VM_DOMAIN(seg->domain); @@ -1694,7 +1695,6 @@ vm_page_alloc_domain_after(vm_object_t object, vm_pind struct vm_domain *vmd; vm_page_t m; int flags; - u_int free_count; KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && (object != NULL || (req & VM_ALLOC_SBUSY) == 0) && @@ -1747,6 +1747,9 @@ again: #endif } } + if (m != NULL) + vm_domain_freecnt_dec(vmd, 1); + vm_domain_free_unlock(vmd); if (m == NULL) { /* * Not allocatable, give up. @@ -1760,15 +1763,7 @@ again: * At this point we had better have found a good page. */ KASSERT(m != NULL, ("missing page")); - free_count = vm_domain_freecnt_adj(vmd, -1); - vm_domain_free_unlock(vmd); - /* - * Don't wakeup too often - wakeup the pageout daemon when - * we would be nearly out of memory. - */ - if (vm_paging_needed(vmd, free_count)) - pagedaemon_wakeup(vmd->vmd_domain); #if VM_NRESERVLEVEL > 0 found: #endif @@ -1804,7 +1799,6 @@ found: if (object != NULL) { if (vm_page_insert_after(m, object, pindex, mpred)) { - pagedaemon_wakeup(domain); if (req & VM_ALLOC_WIRED) { vm_wire_sub(1); m->wire_count = 0; @@ -1961,13 +1955,14 @@ retry: goto retry; #endif } + if (m_ret != NULL) + vm_domain_freecnt_dec(vmd, npages); + vm_domain_free_unlock(vmd); if (m_ret == NULL) { if (vm_domain_alloc_fail(vmd, object, req)) goto again; return (NULL); } - vm_domain_freecnt_adj(vmd, -npages); - vm_domain_free_unlock(vmd); #if VM_NRESERVLEVEL > 0 found: #endif @@ -2006,7 +2001,6 @@ found: m->oflags = oflags; if (object != NULL) { if (vm_page_insert_after(m, object, pindex, mpred)) { - pagedaemon_wakeup(domain); if ((req & VM_ALLOC_WIRED) != 0) vm_wire_sub(npages); KASSERT(m->object == NULL, @@ -2035,9 +2029,6 @@ found: pmap_page_set_memattr(m, memattr); pindex++; } - vmd = VM_DOMAIN(domain); - if (vm_paging_needed(vmd, vmd->vmd_free_count)) - pagedaemon_wakeup(domain); return (m_ret); } @@ -2100,7 +2091,7 @@ vm_page_alloc_freelist_domain(int domain, int freelist { struct vm_domain *vmd; vm_page_t m; - u_int flags, free_count; + u_int flags; /* * Do not allocate reserved pages unless the req has asked for it. @@ -2111,13 +2102,14 @@ again: if (vm_domain_available(vmd, req, 1)) m = vm_phys_alloc_freelist_pages(domain, freelist, VM_FREEPOOL_DIRECT, 0); + if (m != NULL) + vm_domain_freecnt_dec(vmd, 1); + vm_domain_free_unlock(vmd); if (m == NULL) { if (vm_domain_alloc_fail(vmd, NULL, req)) goto again; return (NULL); } - free_count = vm_domain_freecnt_adj(vmd, -1); - vm_domain_free_unlock(vmd); vm_page_alloc_check(m); /* @@ -2138,8 +2130,6 @@ again: } /* Unmanaged pages don't use "act_count". */ m->oflags = VPO_UNMANAGED; - if (vm_paging_needed(vmd, free_count)) - pagedaemon_wakeup(domain); return (m); } @@ -2539,15 +2529,19 @@ unlock: if (m_mtx != NULL) mtx_unlock(m_mtx); if ((m = SLIST_FIRST(&free)) != NULL) { + int cnt; + vmd = VM_DOMAIN(domain); + cnt = 0; vm_domain_free_lock(vmd); do { MPASS(vm_phys_domain(m) == domain); SLIST_REMOVE_HEAD(&free, plinks.s.ss); vm_page_free_phys(vmd, m); + cnt++; } while ((m = SLIST_FIRST(&free)) != NULL); - vm_domain_free_wakeup(vmd); vm_domain_free_unlock(vmd); + vm_domain_freecnt_inc(vmd, cnt); } return (error); } @@ -2710,7 +2704,7 @@ vm_domain_set(struct vm_domain *vmd) /* * Clear the domain from the appropriate page level domainset. */ -static void +void vm_domain_clear(struct vm_domain *vmd) { @@ -2731,6 +2725,22 @@ vm_domain_clear(struct vm_domain *vmd) wakeup(&vm_severe_domains); } } + + /* + * If pageout daemon needs pages, then tell it that there are + * some free. + */ + if (vmd->vmd_pageout_pages_needed && + vmd->vmd_free_count >= vmd->vmd_pageout_free_min) { + wakeup(&vmd->vmd_pageout_pages_needed); + vmd->vmd_pageout_pages_needed = 0; + } + + /* See comments in vm_wait_doms(). */ + if (vm_pageproc_waiters) { + vm_pageproc_waiters = 0; + wakeup(&vm_pageproc_waiters); + } mtx_unlock(&vm_domainset_lock); } @@ -2769,7 +2779,7 @@ u_int vm_wait_count(void) { - return (vm_severe_waiters + vm_min_waiters); + return (vm_severe_waiters + vm_min_waiters + vm_pageproc_waiters); } static void @@ -2787,9 +2797,8 @@ vm_wait_doms(const domainset_t *wdoms) if (curproc == pageproc) { mtx_lock(&vm_domainset_lock); vm_pageproc_waiters++; - msleep(&vm_pageproc_waiters, &vm_domainset_lock, PVM, + msleep(&vm_pageproc_waiters, &vm_domainset_lock, PVM | PDROP, "pageprocwait", 1); - mtx_unlock(&vm_domainset_lock); } else { /* * XXX Ideally we would wait only until the allocation could @@ -2819,14 +2828,17 @@ vm_wait_domain(int domain) domainset_t wdom; vmd = VM_DOMAIN(domain); - vm_domain_free_assert_locked(vmd); + vm_domain_free_assert_unlocked(vmd); if (curproc == pageproc) { - vmd->vmd_pageout_pages_needed = 1; - msleep(&vmd->vmd_pageout_pages_needed, - vm_domain_free_lockptr(vmd), PDROP | PSWP, "VMWait", 0); + mtx_lock(&vm_domainset_lock); + if (vmd->vmd_free_count < vmd->vmd_pageout_free_min) { + vmd->vmd_pageout_pages_needed = 1; + msleep(&vmd->vmd_pageout_pages_needed, + &vm_domainset_lock, PDROP | PSWP, "VMWait", 0); + } else + mtx_unlock(&vm_domainset_lock); } else { - vm_domain_free_unlock(vmd); if (pageproc == NULL) panic("vm_wait in early boot"); DOMAINSET_ZERO(&wdom); @@ -2876,7 +2888,7 @@ static int vm_domain_alloc_fail(struct vm_domain *vmd, vm_object_t object, int req) { - vm_domain_free_assert_locked(vmd); + vm_domain_free_assert_unlocked(vmd); atomic_add_int(&vmd->vmd_pageout_deficit, max((u_int)req >> VM_ALLOC_COUNT_SHIFT, 1)); @@ -2888,10 +2900,8 @@ vm_domain_alloc_fail(struct vm_domain *vmd, vm_object_ VM_OBJECT_WLOCK(object); if (req & VM_ALLOC_WAITOK) return (EAGAIN); - } else { - vm_domain_free_unlock(vmd); - pagedaemon_wakeup(vmd->vmd_domain); } + return (0); } @@ -3063,46 +3073,6 @@ vm_page_activate(vm_page_t m) } /* - * vm_domain_free_wakeup: - * - * Helper routine for vm_page_free_toq(). This routine is called - * when a page is added to the free queues. - * - * The page queues must be locked. - */ -static void -vm_domain_free_wakeup(struct vm_domain *vmd) -{ - - vm_domain_free_assert_locked(vmd); - - /* - * if pageout daemon needs pages, then tell it that there are - * some free. - */ - if (vmd->vmd_pageout_pages_needed && - vmd->vmd_free_count >= vmd->vmd_pageout_free_min) { - wakeup(&vmd->vmd_pageout_pages_needed); - vmd->vmd_pageout_pages_needed = 0; - } - /* - * wakeup processes that are waiting on memory if we hit a - * high water mark. And wakeup scheduler process if we have - * lots of memory. this process will swapin processes. - */ - if ((vmd->vmd_minset && !vm_paging_min(vmd)) || - (vmd->vmd_severeset && !vm_paging_severe(vmd))) - vm_domain_clear(vmd); - - /* See comments in vm_wait(); */ - if (vm_pageproc_waiters) { - vm_pageproc_waiters = 0; - wakeup(&vm_pageproc_waiters); - } - -} - -/* * vm_page_free_prep: * * Prepares the given page to be put on the free list, @@ -3183,7 +3153,8 @@ vm_page_free_prep(vm_page_t m, bool pagequeue_locked) /* * Insert the page into the physical memory allocator's free page - * queues. This is the last step to free a page. + * queues. This is the last step to free a page. The caller is + * responsible for adjusting the free page count. */ static void vm_page_free_phys(struct vm_domain *vmd, vm_page_t m) @@ -3191,7 +3162,6 @@ vm_page_free_phys(struct vm_domain *vmd, vm_page_t m) vm_domain_free_assert_locked(vmd); - vm_domain_freecnt_adj(vmd, 1); #if VM_NRESERVLEVEL > 0 if (!vm_reserv_free_page(m)) #endif @@ -3203,24 +3173,28 @@ vm_page_free_phys_pglist(struct pglist *tq) { struct vm_domain *vmd; vm_page_t m; + int cnt; if (TAILQ_EMPTY(tq)) return; vmd = NULL; + cnt = 0; TAILQ_FOREACH(m, tq, listq) { if (vmd != vm_pagequeue_domain(m)) { if (vmd != NULL) { - vm_domain_free_wakeup(vmd); vm_domain_free_unlock(vmd); + vm_domain_freecnt_inc(vmd, cnt); + cnt = 0; } vmd = vm_pagequeue_domain(m); vm_domain_free_lock(vmd); } vm_page_free_phys(vmd, m); + cnt++; } if (vmd != NULL) { - vm_domain_free_wakeup(vmd); vm_domain_free_unlock(vmd); + vm_domain_freecnt_inc(vmd, cnt); } } @@ -3243,8 +3217,8 @@ vm_page_free_toq(vm_page_t m) vmd = vm_pagequeue_domain(m); vm_domain_free_lock(vmd); vm_page_free_phys(vmd, m); - vm_domain_free_wakeup(vmd); vm_domain_free_unlock(vmd); + vm_domain_freecnt_inc(vmd, 1); } /* Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Mar 15 19:08:33 2018 (r331017) +++ head/sys/vm/vm_pageout.c Thu Mar 15 19:23:07 2018 (r331018) @@ -1790,7 +1790,13 @@ vm_pageout_worker(void *arg) * The pageout daemon worker is never done, so loop forever. */ while (TRUE) { - vm_domain_free_lock(vmd); + vm_domain_pageout_lock(vmd); + /* + * We need to clear wanted before we check the limits. This + * prevents races with wakers who will check wanted after they + * reach the limit. + */ + atomic_store_int(&vmd->vmd_pageout_wanted, 0); /* * Might the page daemon need to run again? @@ -1801,7 +1807,7 @@ vm_pageout_worker(void *arg) * we have performed a level >= 1 (page reclamation) * scan, then sleep a bit and try again. */ - vm_domain_free_unlock(vmd); + vm_domain_pageout_unlock(vmd); if (pass > 1) pause("pwait", hz / VM_INACT_SCAN_RATE); } else { @@ -1809,12 +1815,18 @@ vm_pageout_worker(void *arg) * No, sleep until the next wakeup or until pages * need to have their reference stats updated. */ - vmd->vmd_pageout_wanted = false; if (mtx_sleep(&vmd->vmd_pageout_wanted, - vm_domain_free_lockptr(vmd), PDROP | PVM, + vm_domain_pageout_lockptr(vmd), PDROP | PVM, "psleep", hz / VM_INACT_SCAN_RATE) == 0) VM_CNT_INC(v_pdwakeups); } + /* Prevent spurious wakeups by ensuring that wanted is set. */ + atomic_store_int(&vmd->vmd_pageout_wanted, 1); + + /* + * Use the controller to calculate how many pages to free in + * this interval. + */ shortage = pidctrl_daemon(&vmd->vmd_pid, vmd->vmd_free_count); if (shortage && pass == 0) pass = 1; @@ -1970,10 +1982,14 @@ pagedaemon_wakeup(int domain) struct vm_domain *vmd; vmd = VM_DOMAIN(domain); - vm_domain_free_assert_unlocked(vmd); + vm_domain_pageout_assert_unlocked(vmd); + if (curproc == pageproc) + return; - if (!vmd->vmd_pageout_wanted && curthread->td_proc != pageproc) { - vmd->vmd_pageout_wanted = true; + if (atomic_fetchadd_int(&vmd->vmd_pageout_wanted, 1) == 0) { + vm_domain_pageout_lock(vmd); + atomic_store_int(&vmd->vmd_pageout_wanted, 1); wakeup(&vmd->vmd_pageout_wanted); + vm_domain_pageout_unlock(vmd); } } Modified: head/sys/vm/vm_pagequeue.h ============================================================================== --- head/sys/vm/vm_pagequeue.h Thu Mar 15 19:08:33 2018 (r331017) +++ head/sys/vm/vm_pagequeue.h Thu Mar 15 19:23:07 2018 (r331018) @@ -76,17 +76,31 @@ struct vm_pagequeue { #include struct sysctl_oid; +/* + * One vm_domain per-numa domain. Contains pagequeues, free page structures, + * and accounting. + * + * Lock Key: + * f vmd_free_mtx + * p vmd_pageout_mtx + * d vm_domainset_lock + * a atomic + * c const after boot +*/ struct vm_domain { struct vm_pagequeue vmd_pagequeues[PQ_COUNT]; struct mtx_padalign vmd_free_mtx; - struct vmem *vmd_kernel_arena; - u_int vmd_domain; /* Domain number. */ - u_int vmd_page_count; - long vmd_segs; /* bitmask of the segments */ + struct mtx_padalign vmd_pageout_mtx; + struct vmem *vmd_kernel_arena; /* (c) per-domain kva arena. */ + u_int vmd_domain; /* (c) Domain number. */ + u_int vmd_page_count; /* (c) Total page count. */ + long vmd_segs; /* (c) bitmask of the segments */ + u_int __aligned(CACHE_LINE_SIZE) vmd_free_count; /* (a,f) free page count */ + u_int vmd_pageout_deficit; /* (a) Estimated number of pages deficit */ + uint8_t vmd_pad[CACHE_LINE_SIZE - (sizeof(u_int) * 2)]; - /* Paging control variables, locked by domain_free_mtx. */ + /* Paging control variables, used within single threaded page daemon. */ struct pidctrl vmd_pid; /* Pageout controller. */ - u_int vmd_free_count; boolean_t vmd_oom; int vmd_oom_seq; int vmd_last_active_scan; @@ -94,11 +108,10 @@ struct vm_domain { struct vm_page vmd_marker; /* marker for pagedaemon private use */ struct vm_page vmd_inacthead; /* marker for LRU-defeating insertions */ - int vmd_pageout_pages_needed; /* page daemon waiting for pages? */ - int vmd_pageout_deficit; /* Estimated number of pages deficit */ - bool vmd_pageout_wanted; /* pageout daemon wait channel */ - bool vmd_minset; /* Are we in vm_min_domains? */ - bool vmd_severeset; /* Are we in vm_severe_domains? */ + int vmd_pageout_wanted; /* (a, p) pageout daemon wait channel */ + int vmd_pageout_pages_needed; /* (d) page daemon waiting for pages? */ + bool vmd_minset; /* (d) Are we in vm_min_domains? */ + bool vmd_severeset; /* (d) Are we in vm_severe_domains? */ int vmd_inactq_scans; enum { VM_LAUNDRY_IDLE = 0, @@ -142,6 +155,17 @@ extern struct vm_domain vm_dom[MAXMEMDOM]; #define vm_domain_free_unlock(d) \ mtx_unlock(vm_domain_free_lockptr((d))) +#define vm_domain_pageout_lockptr(d) \ + (&(d)->vmd_pageout_mtx) +#define vm_domain_pageout_assert_locked(n) \ + mtx_assert(vm_domain_pageout_lockptr((n)), MA_OWNED) +#define vm_domain_pageout_assert_unlocked(n) \ + mtx_assert(vm_domain_pageout_lockptr((n)), MA_NOTOWNED) +#define vm_domain_pageout_lock(d) \ + mtx_lock(vm_domain_pageout_lockptr((d))) +#define vm_domain_pageout_unlock(d) \ + mtx_unlock(vm_domain_pageout_lockptr((d))) + static __inline void vm_pagequeue_cnt_add(struct vm_pagequeue *pq, int addend) { @@ -155,6 +179,7 @@ vm_pagequeue_cnt_add(struct vm_pagequeue *pq, int adde #define vm_pagequeue_cnt_dec(pq) vm_pagequeue_cnt_add((pq), -1) void vm_domain_set(struct vm_domain *vmd); +void vm_domain_clear(struct vm_domain *vmd); int vm_domain_available(struct vm_domain *vmd, int req, int npages); /* @@ -221,18 +246,40 @@ vm_laundry_target(struct vm_domain *vmd) return (vm_paging_target(vmd)); } -static inline u_int -vm_domain_freecnt_adj(struct vm_domain *vmd, int adj) +void pagedaemon_wakeup(int domain); + +static inline void +vm_domain_freecnt_inc(struct vm_domain *vmd, int adj) { - u_int ret; + u_int old, new; - vm_domain_free_assert_locked(vmd); - ret = vmd->vmd_free_count += adj; - if ((!vmd->vmd_minset && vm_paging_min(vmd)) || - (!vmd->vmd_severeset && vm_paging_severe(vmd))) - vm_domain_set(vmd); + old = atomic_fetchadd_int(&vmd->vmd_free_count, adj); + new = old + adj; + /* + * Only update bitsets on transitions. Notice we short-circuit the + * rest of the checks if we're above min already. + */ + if (old < vmd->vmd_free_min && (new >= vmd->vmd_free_min || + (old < vmd->vmd_free_severe && new >= vmd->vmd_free_severe) || + (old < vmd->vmd_pageout_free_min && + new >= vmd->vmd_pageout_free_min))) + vm_domain_clear(vmd); +} - return (ret); +static inline void +vm_domain_freecnt_dec(struct vm_domain *vmd, int adj) +{ + u_int old, new; + + old = atomic_fetchadd_int(&vmd->vmd_free_count, -adj); + new = old - adj; + KASSERT(new >= 0, ("vm_domain_freecnt_dec: free count underflow")); + if (vm_paging_needed(vmd, new) && !vm_paging_needed(vmd, old)) + pagedaemon_wakeup(vmd->vmd_domain); + /* Only update bitsets on transitions. */ + if ((old >= vmd->vmd_free_min && new < vmd->vmd_free_min) || + (old >= vmd->vmd_free_severe && new < vmd->vmd_free_severe)) + vm_domain_set(vmd); } Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Thu Mar 15 19:08:33 2018 (r331017) +++ head/sys/vm/vm_reserv.c Thu Mar 15 19:23:07 2018 (r331018) @@ -593,7 +593,7 @@ vm_reserv_extend_contig(int req, vm_object_t object, v } for (i = 0; i < npages; i++) vm_reserv_populate(rv, index + i); - vm_domain_freecnt_adj(vmd, -npages); + vm_domain_freecnt_dec(vmd, npages); out: vm_domain_free_unlock(vmd); return (m); @@ -789,7 +789,7 @@ vm_reserv_extend(int req, vm_object_t object, vm_pinde struct vm_domain *vmd; vm_page_t m, msucc; vm_reserv_t rv; - int index, free_count; + int index; VM_OBJECT_ASSERT_WLOCKED(object); @@ -822,13 +822,9 @@ vm_reserv_extend(int req, vm_object_t object, vm_pinde m = NULL; if (m != NULL) { vm_reserv_populate(rv, index); - free_count = vm_domain_freecnt_adj(vmd, -1); - } else - free_count = vmd->vmd_free_count; + vm_domain_freecnt_dec(vmd, 1); + } vm_domain_free_unlock(vmd); - - if (vm_paging_needed(vmd, free_count)) - pagedaemon_wakeup(domain); return (m); } From owner-svn-src-head@freebsd.org Thu Mar 15 21:31:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C1E1F55763; Thu, 15 Mar 2018 21:31:20 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32BD779F51; Thu, 15 Mar 2018 21:31:20 +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 2DBF91B611; Thu, 15 Mar 2018 21:31:20 +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 w2FLVKhS027593; Thu, 15 Mar 2018 21:31:20 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FLVKsw027592; Thu, 15 Mar 2018 21:31:20 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803152131.w2FLVKsw027592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Mar 2018 21:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331029 - head X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 331029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 21:31:20 -0000 Author: brooks Date: Thu Mar 15 21:31:19 2018 New Revision: 331029 URL: https://svnweb.freebsd.org/changeset/base/331029 Log: Finish removal of dataacq.h (r330716) and pcaudioio.h (r330766). Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Mar 15 20:46:34 2018 (r331028) +++ head/ObsoleteFiles.inc Thu Mar 15 21:31:19 2018 (r331029) @@ -38,6 +38,12 @@ # xargs -n1 | sort | uniq -d; # done +# 20180311: remove sys/sys/i386/include/pcaudioio.h +.if ${TARGET_ARCH} == "i386" +OLD_FILES+=usr/include/machine/pcaudioio.h +.endif +# 20180310: remove sys/sys/dataacq.h +OLD_FILES+=usr/include/sys/dataacq.h # 20180306: remove DTrace scripts made obsolete by dwatch(1) OLD_FILES+=usr/share/dtrace/watch_execve OLD_FILES+=usr/share/dtrace/watch_kill From owner-svn-src-head@freebsd.org Thu Mar 15 21:38:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ED1EF560FA; Thu, 15 Mar 2018 21:38:39 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB5BF7A6E1; Thu, 15 Mar 2018 21:38:38 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f43.google.com with SMTP id y19-v6so12413557lfd.4; Thu, 15 Mar 2018 14:38:38 -0700 (PDT) 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=WqExMa9mnswUv/rFUClpX/LtPSXl2Cm7ottgKQ4QAKU=; b=D2FGMyb7niNI8uWH9bwwObciUbBKbKgpxzI3x0SyHByN7qhozCaEAj6Zq0/MMU8dPn f9W/JwVFSpTFpCD2Krqzyc9I04WDeWxfSCLGnam6ZIXfwsGVgORTCDfCKBdCRothgHZd ha8deS2CFvBw4w5cqUX077WTkuKIZFHmQ9z3hiYkIDvj0u1I3iX/LTeVe0NuctWJbguB mUXQ1hDeNExh40ysbMg7XAp8N8RNXM8GBo2uHbrVnRYRS1RsG7JEO6dCDFi8bsPi8big vCv2maumW5DXeNacr7gtkz63MnJwrBHbuQ1MNNC+0yKaI9HR9vpmKwCBEZDP8KGXkRSF OjwA== X-Gm-Message-State: AElRT7HrZPL+70eAGZRywMJK45OvyVdngSX7uDNrpopmyyUXijexqUzQ hN/hMjCqAXHA64H228vMSF1waz0qOok= X-Google-Smtp-Source: AG47ELvCQYC7geUqr13waump5jGH2181YYb3o1BALPfgjKxYtFWN4TLgfzRkGaqpieN2bUGYOL6cRg== X-Received: by 2002:a19:4d46:: with SMTP id a67-v6mr7763933lfb.36.1521149569349; Thu, 15 Mar 2018 14:32:49 -0700 (PDT) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com. [209.85.215.46]) by smtp.gmail.com with ESMTPSA id l5sm1276055lje.58.2018.03.15.14.32.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 14:32:49 -0700 (PDT) Received: by mail-lf0-f46.google.com with SMTP id f75-v6so12362772lfg.6; Thu, 15 Mar 2018 14:32:49 -0700 (PDT) X-Received: by 10.46.114.26 with SMTP id n26mr7535840ljc.74.1521149569036; Thu, 15 Mar 2018 14:32:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.54.1 with HTTP; Thu, 15 Mar 2018 14:32:28 -0700 (PDT) In-Reply-To: <201803151923.w2FJN7G7064582@repo.freebsd.org> References: <201803151923.w2FJN7G7064582@repo.freebsd.org> From: Kyle Evans Date: Thu, 15 Mar 2018 16:32:28 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331018 - head/sys/vm To: Jeff Roberson Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 21:38:39 -0000 On Thu, Mar 15, 2018 at 2:23 PM, Jeff Roberson wrote: > Author: jeff > Date: Thu Mar 15 19:23:07 2018 > New Revision: 331018 > URL: https://svnweb.freebsd.org/changeset/base/331018 > > Log: > Eliminate pageout wakeup races. Take another step towards lockless > vmd_free_count manipulation. Reduce the scope of the free lock by > using a pageout lock to synchronize sleep and wakeup. Only trigger > the pageout daemon on transitions between states. Drive all wakeup > operations directly as side-effects from freeing memory rather than > requiring an additional function call. > > Reviewed by: markj, kib > Tested by: pho > Sponsored by: Netflix, Dell/EMC Isilon > Differential Revision: https://reviews.freebsd.org/D14612 > Hey, Just a heads up: this broke the GCC builds [1] with the following (excerpt): 20:00:47 /usr/src/sys/vm/vm_pagequeue.h:249: warning: redundant redeclaration of 'pagedaemon_wakeup' [-Wredundant-decls] 20:00:47 /usr/src/sys/vm/vm_pageout.h:98: warning: previous declaration of 'pagedaemon_wakeup' was here Thanks, Kyle Evans [1] https://ci.freebsd.org/job/FreeBSD-head-mips64-build/1108/console From owner-svn-src-head@freebsd.org Thu Mar 15 21:42:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 977EDF566CB; Thu, 15 Mar 2018 21:42:49 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 400A87ACA1; Thu, 15 Mar 2018 21:42:49 +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 3ACB01B7E6; Thu, 15 Mar 2018 21:42:49 +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 w2FLgnbL036607; Thu, 15 Mar 2018 21:42:49 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FLgngd036606; Thu, 15 Mar 2018 21:42:49 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803152142.w2FLgngd036606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Mar 2018 21:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331030 - head/sys/dev/md X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/dev/md X-SVN-Commit-Revision: 331030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 21:42:50 -0000 Author: brooks Date: Thu Mar 15 21:42:49 2018 New Revision: 331030 URL: https://svnweb.freebsd.org/changeset/base/331030 Log: Add a request structure and make the implementation use it. This allows compatibility translation to take place on the stack (md_ioctl is too big) and is more suitable as a public interface within the kernel than the kern_ioctl interface. Except for the initialization of the md_req from the md_ioctl (including detection of kernel md_file pointers) and the updating of the md_ioctl prior to return, this is a mechanical replacment of md_ioctl and mdio with md_req and mdr. Reviewed by: markj, cem, kib (assorted versions) Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14704 Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Thu Mar 15 21:31:19 2018 (r331029) +++ head/sys/dev/md/md.c Thu Mar 15 21:42:49 2018 (r331030) @@ -114,6 +114,21 @@ #define MD_NSECT (10000 * 2) #endif +struct md_req { + unsigned md_unit; /* unit number */ + enum md_types md_type; /* type of disk */ + off_t md_mediasize; /* size of disk in bytes */ + unsigned md_sectorsize; /* sectorsize */ + unsigned md_options; /* options */ + int md_fwheads; /* firmware heads */ + int md_fwsectors; /* firmware sectors */ + char *md_file; /* pathname of file to mount */ + enum uio_seg md_file_seg; /* location of md_file */ + char *md_label; /* label of the device (userspace) */ + int *md_units; /* pointer to units array (kernel) */ + size_t md_units_nitems; /* items in md_units array */ +}; + static MALLOC_DEFINE(M_MD, "md_disk", "Memory Disk"); static MALLOC_DEFINE(M_MDSECT, "md_sectors", "Memory Disk Sectors"); @@ -1285,29 +1300,29 @@ mdinit(struct md_s *sc) } static int -mdcreate_malloc(struct md_s *sc, struct md_ioctl *mdio) +mdcreate_malloc(struct md_s *sc, struct md_req *mdr) { uintptr_t sp; int error; off_t u; error = 0; - if (mdio->md_options & ~(MD_AUTOUNIT | MD_COMPRESS | MD_RESERVE)) + if (mdr->md_options & ~(MD_AUTOUNIT | MD_COMPRESS | MD_RESERVE)) return (EINVAL); - if (mdio->md_sectorsize != 0 && !powerof2(mdio->md_sectorsize)) + if (mdr->md_sectorsize != 0 && !powerof2(mdr->md_sectorsize)) return (EINVAL); /* Compression doesn't make sense if we have reserved space */ - if (mdio->md_options & MD_RESERVE) - mdio->md_options &= ~MD_COMPRESS; - if (mdio->md_fwsectors != 0) - sc->fwsectors = mdio->md_fwsectors; - if (mdio->md_fwheads != 0) - sc->fwheads = mdio->md_fwheads; - sc->flags = mdio->md_options & (MD_COMPRESS | MD_FORCE); + if (mdr->md_options & MD_RESERVE) + mdr->md_options &= ~MD_COMPRESS; + if (mdr->md_fwsectors != 0) + sc->fwsectors = mdr->md_fwsectors; + if (mdr->md_fwheads != 0) + sc->fwheads = mdr->md_fwheads; + sc->flags = mdr->md_options & (MD_COMPRESS | MD_FORCE); sc->indir = dimension(sc->mediasize / sc->sectorsize); sc->uma = uma_zcreate(sc->name, sc->sectorsize, NULL, NULL, NULL, NULL, 0x1ff, 0); - if (mdio->md_options & MD_RESERVE) { + if (mdr->md_options & MD_RESERVE) { off_t nsectors; nsectors = sc->mediasize / sc->sectorsize; @@ -1368,19 +1383,15 @@ mdsetcred(struct md_s *sc, struct ucred *cred) } static int -mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, struct thread *td) +mdcreate_vnode(struct md_s *sc, struct md_req *mdr, struct thread *td) { struct vattr vattr; struct nameidata nd; char *fname; int error, flags; - /* - * Kernel-originated requests must have the filename appended - * to the mdio structure to protect against malicious software. - */ - fname = mdio->md_file; - if ((void *)fname != (void *)(mdio + 1)) { + fname = mdr->md_file; + if (mdr->md_file_seg == UIO_USERSPACE) { error = copyinstr(fname, sc->file, sizeof(sc->file), NULL); if (error != 0) return (error); @@ -1391,8 +1402,8 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, * If the user specified that this is a read only device, don't * set the FWRITE mask before trying to open the backing store. */ - flags = FREAD | ((mdio->md_options & MD_READONLY) ? 0 : FWRITE) \ - | ((mdio->md_options & MD_VERIFY) ? O_VERIFY : 0); + flags = FREAD | ((mdr->md_options & MD_READONLY) ? 0 : FWRITE) \ + | ((mdr->md_options & MD_VERIFY) ? O_VERIFY : 0); NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, sc->file, td); error = vn_open(&nd, &flags, 0, NULL); if (error != 0) @@ -1416,13 +1427,13 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, nd.ni_vp->v_vflag |= VV_MD; VOP_UNLOCK(nd.ni_vp, 0); - if (mdio->md_fwsectors != 0) - sc->fwsectors = mdio->md_fwsectors; - if (mdio->md_fwheads != 0) - sc->fwheads = mdio->md_fwheads; + if (mdr->md_fwsectors != 0) + sc->fwsectors = mdr->md_fwsectors; + if (mdr->md_fwheads != 0) + sc->fwheads = mdr->md_fwheads; snprintf(sc->ident, sizeof(sc->ident), "MD-DEV%ju-INO%ju", (uintmax_t)vattr.va_fsid, (uintmax_t)vattr.va_fileid); - sc->flags = mdio->md_options & (MD_FORCE | MD_ASYNC | MD_VERIFY); + sc->flags = mdr->md_options & (MD_FORCE | MD_ASYNC | MD_VERIFY); if (!(flags & FWRITE)) sc->flags |= MD_READONLY; sc->vnode = nd.ni_vp; @@ -1488,7 +1499,7 @@ mddestroy(struct md_s *sc, struct thread *td) } static int -mdresize(struct md_s *sc, struct md_ioctl *mdio) +mdresize(struct md_s *sc, struct md_req *mdr) { int error, res; vm_pindex_t oldpages, newpages; @@ -1498,11 +1509,11 @@ mdresize(struct md_s *sc, struct md_ioctl *mdio) case MD_NULL: break; case MD_SWAP: - if (mdio->md_mediasize <= 0 || - (mdio->md_mediasize % PAGE_SIZE) != 0) + if (mdr->md_mediasize <= 0 || + (mdr->md_mediasize % PAGE_SIZE) != 0) return (EDOM); oldpages = OFF_TO_IDX(round_page(sc->mediasize)); - newpages = OFF_TO_IDX(round_page(mdio->md_mediasize)); + newpages = OFF_TO_IDX(round_page(mdr->md_mediasize)); if (newpages < oldpages) { VM_OBJECT_WLOCK(sc->object); vm_object_page_remove(sc->object, newpages, 0, 0); @@ -1518,7 +1529,7 @@ mdresize(struct md_s *sc, struct md_ioctl *mdio) oldpages), sc->cred); if (!res) return (ENOMEM); - if ((mdio->md_options & MD_RESERVE) || + if ((mdr->md_options & MD_RESERVE) || (sc->flags & MD_RESERVE)) { error = swap_pager_reserve(sc->object, oldpages, newpages - oldpages); @@ -1539,7 +1550,7 @@ mdresize(struct md_s *sc, struct md_ioctl *mdio) return (EOPNOTSUPP); } - sc->mediasize = mdio->md_mediasize; + sc->mediasize = mdr->md_mediasize; g_topology_lock(); g_resize_provider(sc->pp, sc->mediasize); g_topology_unlock(); @@ -1547,7 +1558,7 @@ mdresize(struct md_s *sc, struct md_ioctl *mdio) } static int -mdcreate_swap(struct md_s *sc, struct md_ioctl *mdio, struct thread *td) +mdcreate_swap(struct md_s *sc, struct md_req *mdr, struct thread *td) { vm_ooffset_t npage; int error; @@ -1565,19 +1576,19 @@ mdcreate_swap(struct md_s *sc, struct md_ioctl *mdio, * Note the truncation. */ - if ((mdio->md_options & MD_VERIFY) != 0) + if ((mdr->md_options & MD_VERIFY) != 0) return (EINVAL); - npage = mdio->md_mediasize / PAGE_SIZE; - if (mdio->md_fwsectors != 0) - sc->fwsectors = mdio->md_fwsectors; - if (mdio->md_fwheads != 0) - sc->fwheads = mdio->md_fwheads; + npage = mdr->md_mediasize / PAGE_SIZE; + if (mdr->md_fwsectors != 0) + sc->fwsectors = mdr->md_fwsectors; + if (mdr->md_fwheads != 0) + sc->fwheads = mdr->md_fwheads; sc->object = vm_pager_allocate(OBJT_SWAP, NULL, PAGE_SIZE * npage, VM_PROT_DEFAULT, 0, td->td_ucred); if (sc->object == NULL) return (ENOMEM); - sc->flags = mdio->md_options & (MD_FORCE | MD_RESERVE); - if (mdio->md_options & MD_RESERVE) { + sc->flags = mdr->md_options & (MD_FORCE | MD_RESERVE); + if (mdr->md_options & MD_RESERVE) { if (swap_pager_reserve(sc->object, 0, npage) < 0) { error = EDOM; goto finish; @@ -1593,7 +1604,7 @@ mdcreate_swap(struct md_s *sc, struct md_ioctl *mdio, } static int -mdcreate_null(struct md_s *sc, struct md_ioctl *mdio, struct thread *td) +mdcreate_null(struct md_s *sc, struct md_req *mdr, struct thread *td) { /* @@ -1607,7 +1618,7 @@ mdcreate_null(struct md_s *sc, struct md_ioctl *mdio, } static int -kern_mdattach_locked(struct thread *td, struct md_ioctl *mdio) +kern_mdattach_locked(struct thread *td, struct md_req *mdr) { struct md_s *sc; unsigned sectsize; @@ -1615,7 +1626,7 @@ kern_mdattach_locked(struct thread *td, struct md_ioct sx_assert(&md_sx, SA_XLOCKED); - switch (mdio->md_type) { + switch (mdr->md_type) { case MD_MALLOC: case MD_PRELOAD: case MD_VNODE: @@ -1625,35 +1636,35 @@ kern_mdattach_locked(struct thread *td, struct md_ioct default: return (EINVAL); } - if (mdio->md_sectorsize == 0) + if (mdr->md_sectorsize == 0) sectsize = DEV_BSIZE; else - sectsize = mdio->md_sectorsize; - if (sectsize > MAXPHYS || mdio->md_mediasize < sectsize) + sectsize = mdr->md_sectorsize; + if (sectsize > MAXPHYS || mdr->md_mediasize < sectsize) return (EINVAL); - if (mdio->md_options & MD_AUTOUNIT) - sc = mdnew(-1, &error, mdio->md_type); + if (mdr->md_options & MD_AUTOUNIT) + sc = mdnew(-1, &error, mdr->md_type); else { - if (mdio->md_unit > INT_MAX) + if (mdr->md_unit > INT_MAX) return (EINVAL); - sc = mdnew(mdio->md_unit, &error, mdio->md_type); + sc = mdnew(mdr->md_unit, &error, mdr->md_type); } if (sc == NULL) return (error); - if (mdio->md_label != NULL) - error = copyinstr(mdio->md_label, sc->label, + if (mdr->md_label != NULL) + error = copyinstr(mdr->md_label, sc->label, sizeof(sc->label), NULL); if (error != 0) goto err_after_new; - if (mdio->md_options & MD_AUTOUNIT) - mdio->md_unit = sc->unit; - sc->mediasize = mdio->md_mediasize; + if (mdr->md_options & MD_AUTOUNIT) + mdr->md_unit = sc->unit; + sc->mediasize = mdr->md_mediasize; sc->sectorsize = sectsize; error = EDOOFUS; switch (sc->type) { case MD_MALLOC: sc->start = mdstart_malloc; - error = mdcreate_malloc(sc, mdio); + error = mdcreate_malloc(sc, mdr); break; case MD_PRELOAD: /* @@ -1665,15 +1676,15 @@ kern_mdattach_locked(struct thread *td, struct md_ioct break; case MD_VNODE: sc->start = mdstart_vnode; - error = mdcreate_vnode(sc, mdio, td); + error = mdcreate_vnode(sc, mdr, td); break; case MD_SWAP: sc->start = mdstart_swap; - error = mdcreate_swap(sc, mdio, td); + error = mdcreate_swap(sc, mdr, td); break; case MD_NULL: sc->start = mdstart_null; - error = mdcreate_null(sc, mdio, td); + error = mdcreate_null(sc, mdr, td); break; } err_after_new: @@ -1691,122 +1702,122 @@ err_after_new: } static int -kern_mdattach(struct thread *td, struct md_ioctl *mdio) +kern_mdattach(struct thread *td, struct md_req *mdr) { int error; sx_xlock(&md_sx); - error = kern_mdattach_locked(td, mdio); + error = kern_mdattach_locked(td, mdr); sx_xunlock(&md_sx); return (error); } static int -kern_mddetach_locked(struct thread *td, struct md_ioctl *mdio) +kern_mddetach_locked(struct thread *td, struct md_req *mdr) { struct md_s *sc; sx_assert(&md_sx, SA_XLOCKED); - if (mdio->md_mediasize != 0 || - (mdio->md_options & ~MD_FORCE) != 0) + if (mdr->md_mediasize != 0 || + (mdr->md_options & ~MD_FORCE) != 0) return (EINVAL); - sc = mdfind(mdio->md_unit); + sc = mdfind(mdr->md_unit); if (sc == NULL) return (ENOENT); if (sc->opencount != 0 && !(sc->flags & MD_FORCE) && - !(mdio->md_options & MD_FORCE)) + !(mdr->md_options & MD_FORCE)) return (EBUSY); return (mddestroy(sc, td)); } static int -kern_mddetach(struct thread *td, struct md_ioctl *mdio) +kern_mddetach(struct thread *td, struct md_req *mdr) { int error; sx_xlock(&md_sx); - error = kern_mddetach_locked(td, mdio); + error = kern_mddetach_locked(td, mdr); sx_xunlock(&md_sx); return (error); } static int -kern_mdresize_locked(struct md_ioctl *mdio) +kern_mdresize_locked(struct md_req *mdr) { struct md_s *sc; sx_assert(&md_sx, SA_XLOCKED); - if ((mdio->md_options & ~(MD_FORCE | MD_RESERVE)) != 0) + if ((mdr->md_options & ~(MD_FORCE | MD_RESERVE)) != 0) return (EINVAL); - sc = mdfind(mdio->md_unit); + sc = mdfind(mdr->md_unit); if (sc == NULL) return (ENOENT); - if (mdio->md_mediasize < sc->sectorsize) + if (mdr->md_mediasize < sc->sectorsize) return (EINVAL); - if (mdio->md_mediasize < sc->mediasize && + if (mdr->md_mediasize < sc->mediasize && !(sc->flags & MD_FORCE) && - !(mdio->md_options & MD_FORCE)) + !(mdr->md_options & MD_FORCE)) return (EBUSY); - return (mdresize(sc, mdio)); + return (mdresize(sc, mdr)); } static int -kern_mdresize(struct md_ioctl *mdio) +kern_mdresize(struct md_req *mdr) { int error; sx_xlock(&md_sx); - error = kern_mdresize_locked(mdio); + error = kern_mdresize_locked(mdr); sx_xunlock(&md_sx); return (error); } static int -kern_mdquery_locked(struct md_ioctl *mdio) +kern_mdquery_locked(struct md_req *mdr) { struct md_s *sc; int error; sx_assert(&md_sx, SA_XLOCKED); - sc = mdfind(mdio->md_unit); + sc = mdfind(mdr->md_unit); if (sc == NULL) return (ENOENT); - mdio->md_type = sc->type; - mdio->md_options = sc->flags; - mdio->md_mediasize = sc->mediasize; - mdio->md_sectorsize = sc->sectorsize; + mdr->md_type = sc->type; + mdr->md_options = sc->flags; + mdr->md_mediasize = sc->mediasize; + mdr->md_sectorsize = sc->sectorsize; error = 0; - if (mdio->md_label != NULL) { - error = copyout(sc->label, mdio->md_label, + if (mdr->md_label != NULL) { + error = copyout(sc->label, mdr->md_label, strlen(sc->label) + 1); if (error != 0) return (error); } if (sc->type == MD_VNODE || - (sc->type == MD_PRELOAD && mdio->md_file != NULL)) - error = copyout(sc->file, mdio->md_file, + (sc->type == MD_PRELOAD && mdr->md_file != NULL)) + error = copyout(sc->file, mdr->md_file, strlen(sc->file) + 1); return (error); } static int -kern_mdquery(struct md_ioctl *mdio) +kern_mdquery(struct md_req *mdr) { int error; sx_xlock(&md_sx); - error = kern_mdquery_locked(mdio); + error = kern_mdquery_locked(mdr); sx_xunlock(&md_sx); return (error); } static int -kern_mdlist_locked(struct md_ioctl *mdio) +kern_mdlist_locked(struct md_req *mdr) { struct md_s *sc; int i; @@ -1814,9 +1825,9 @@ kern_mdlist_locked(struct md_ioctl *mdio) sx_assert(&md_sx, SA_XLOCKED); /* - * Write the number of md devices to mdio->md_pad[0]. - * Write the unit number of the first (MDNPAD - 2) units - * to mdio->md_pad[1::(MDNPAD - 2)] and terminate the + * Write the number of md devices to mdr->md_units[0]. + * Write the unit number of the first (mdr->md_units_nitems - 2) + * units to mdr->md_units[1::(mdr->md_units - 2)] and terminate the * list with -1. * * XXX: There is currently no mechanism to retrieve unit @@ -1827,22 +1838,22 @@ kern_mdlist_locked(struct md_ioctl *mdio) */ i = 1; LIST_FOREACH(sc, &md_softc_list, list) { - if (i < MDNPAD - 1) - mdio->md_pad[i] = sc->unit; + if (i < mdr->md_units_nitems - 1) + mdr->md_units[i] = sc->unit; i++; } - mdio->md_pad[MIN(i, MDNPAD - 1)] = -1; - mdio->md_pad[0] = i - 1; + mdr->md_units[MIN(i, mdr->md_units_nitems - 1)] = -1; + mdr->md_units[0] = i - 1; return (0); } static int -kern_mdlist(struct md_ioctl *mdio) +kern_mdlist(struct md_req *mdr) { int error; sx_xlock(&md_sx); - error = kern_mdlist_locked(mdio); + error = kern_mdlist_locked(mdr); sx_xunlock(&md_sx); return (error); } @@ -1851,6 +1862,7 @@ static int mdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td) { + struct md_req mdr; struct md_ioctl *mdio; int error; @@ -1858,37 +1870,67 @@ mdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr, printf("mdctlioctl(%s %lx %p %x %p)\n", devtoname(dev), cmd, addr, flags, td); - mdio = (struct md_ioctl *)addr; - if (mdio->md_version != MDIOVERSION) - return (EINVAL); + switch (cmd) { + case MDIOCATTACH: + case MDIOCDETACH: + case MDIOCRESIZE: + case MDIOCQUERY: + case MDIOCLIST: + mdio = (struct md_ioctl *)addr; + if (mdio->md_version != MDIOVERSION) + return (EINVAL); + mdr.md_unit = mdio->md_unit; + mdr.md_type = mdio->md_type; + mdr.md_mediasize = mdio->md_mediasize; + mdr.md_sectorsize = mdio->md_sectorsize; + mdr.md_options = mdio->md_options; + mdr.md_fwheads = mdio->md_fwheads; + mdr.md_fwsectors = mdio->md_fwsectors; + mdr.md_file = mdio->md_file; + /* If the file is adjacent to the md_ioctl it's in kernel. */ + if ((void *)mdio->md_file == (void *)(mdio + 1)) + mdr.md_file_seg = UIO_SYSSPACE; + else + mdr.md_file_seg = UIO_USERSPACE; + mdr.md_label = mdio->md_label; + mdr.md_units = &mdio->md_pad[0]; + mdr.md_units_nitems = nitems(mdio->md_pad); + break; + } - /* - * We assert the version number in the individual ioctl - * handlers instead of out here because (a) it is possible we - * may add another ioctl in the future which doesn't read an - * mdio, and (b) the correct return value for an unknown ioctl - * is ENOIOCTL, not EINVAL. - */ error = 0; switch (cmd) { case MDIOCATTACH: - error = kern_mdattach(td, mdio); + error = kern_mdattach(td, &mdr); break; case MDIOCDETACH: - error = kern_mddetach(td, mdio); + error = kern_mddetach(td, &mdr); break; case MDIOCRESIZE: - error = kern_mdresize(mdio); + error = kern_mdresize(&mdr); break; case MDIOCQUERY: - error = kern_mdquery(mdio); + error = kern_mdquery(&mdr); break; case MDIOCLIST: - error = kern_mdlist(mdio); + error = kern_mdlist(&mdr); break; default: error = ENOIOCTL; - }; + } + + switch (cmd) { + case MDIOCATTACH: + case MDIOCQUERY: + mdio->md_unit = mdr.md_unit; + mdio->md_type = mdr.md_type; + mdio->md_mediasize = mdr.md_mediasize; + mdio->md_sectorsize = mdr.md_sectorsize; + mdio->md_options = mdr.md_options; + mdio->md_fwheads = mdr.md_fwheads; + mdio->md_fwsectors = mdr.md_fwsectors; + break; + } return (error); } From owner-svn-src-head@freebsd.org Thu Mar 15 23:32:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E12D8F5E0A6; Thu, 15 Mar 2018 23:32:29 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8F497F950; Thu, 15 Mar 2018 23:32:29 +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 B402D1C909; Thu, 15 Mar 2018 23:32:29 +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 w2FNWT5e091679; Thu, 15 Mar 2018 23:32:29 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FNWT88091678; Thu, 15 Mar 2018 23:32:29 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201803152332.w2FNWT88091678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 15 Mar 2018 23:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331040 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 331040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 23:32:30 -0000 Author: avos Date: Thu Mar 15 23:32:29 2018 New Revision: 331040 URL: https://svnweb.freebsd.org/changeset/base/331040 Log: Correct comment for IFM_IEEE80211_VHT media variant. Modified: head/sys/net/if_media.h Modified: head/sys/net/if_media.h ============================================================================== --- head/sys/net/if_media.h Thu Mar 15 23:02:52 2018 (r331039) +++ head/sys/net/if_media.h Thu Mar 15 23:32:29 2018 (r331040) @@ -270,7 +270,7 @@ uint64_t ifmedia_baudrate(int); #define IFM_IEEE80211_OFDM27 23 /* OFDM 27Mbps */ /* NB: not enough bits to express MCS fully */ #define IFM_IEEE80211_MCS 24 /* HT MCS rate */ -#define IFM_IEEE80211_VHT 25 /* HT MCS rate */ +#define IFM_IEEE80211_VHT 25 /* VHT MCS rate */ #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ #define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */ From owner-svn-src-head@freebsd.org Fri Mar 16 00:09:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8BA1F60A3E; Fri, 16 Mar 2018 00:09:16 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57B8780F8F; Fri, 16 Mar 2018 00:09: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 52B5D1CDE0; Fri, 16 Mar 2018 00:09: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 w2G09GRR007313; Fri, 16 Mar 2018 00:09:16 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2G09GbV007312; Fri, 16 Mar 2018 00:09:16 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201803160009.w2G09GbV007312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 16 Mar 2018 00:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331041 - 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: 331041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 00:09:16 -0000 Author: avos Date: Fri Mar 16 00:09:16 2018 New Revision: 331041 URL: https://svnweb.freebsd.org/changeset/base/331041 Log: urtw(4): provide names for some commonly used rate indices + drop now-unused urtw_rate2rtl() Modified: head/sys/dev/usb/wlan/if_urtw.c Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Thu Mar 15 23:32:29 2018 (r331040) +++ head/sys/dev/usb/wlan/if_urtw.c Fri Mar 16 00:09:16 2018 (r331041) @@ -65,6 +65,12 @@ __FBSDID("$FreeBSD$"); #include #include +/* copy some rate indices from if_rtwn_ridx.h */ +#define URTW_RIDX_CCK5 2 +#define URTW_RIDX_CCK11 3 +#define URTW_RIDX_OFDM6 4 +#define URTW_RIDX_OFDM24 8 + static SYSCTL_NODE(_hw_usb, OID_AUTO, urtw, CTLFLAG_RW, 0, "USB Realtek 8187L"); #ifdef URTW_DEBUG int urtw_debug = 0; @@ -682,7 +688,6 @@ static void urtw_ledtask(void *, int); static void urtw_watchdog(void *); static void urtw_set_multi(void *); static int urtw_isbmode(uint16_t); -static uint16_t urtw_rate2rtl(uint32_t); static uint16_t urtw_rtl2rate(uint32_t); static usb_error_t urtw_set_rate(struct urtw_softc *); static usb_error_t urtw_update_msr(struct urtw_softc *); @@ -866,7 +871,7 @@ urtw_attach(device_t dev) sc->sc_rts_retry = URTW_DEFAULT_RTS_RETRY; sc->sc_tx_retry = URTW_DEFAULT_TX_RETRY; - sc->sc_currate = 3; + sc->sc_currate = URTW_RIDX_CCK11; sc->sc_preamble_mode = urtw_preamble_mode; ic->ic_softc = sc; @@ -1766,8 +1771,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_ flags |= URTW_TX_FLAG_CTS; if (rtsenable) { flags |= URTW_TX_FLAG_RTS; - flags |= (urtw_rate2rtl(11) & 0xf) << - URTW_TX_FLAG_RTSRATE_SHIFT; + flags |= URTW_RIDX_CCK5 << URTW_TX_FLAG_RTSRATE_SHIFT; tx->rtsdur = rtsdur; } tx->flag = htole32(flags); @@ -1788,7 +1792,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_ flags |= URTW_TX_FLAG_RTS; tx->rtsdur = rtsdur; } - flags |= (urtw_rate2rtl(11) & 0xf) << URTW_TX_FLAG_RTSRATE_SHIFT; + flags |= URTW_RIDX_CCK5 << URTW_TX_FLAG_RTSRATE_SHIFT; tx->flag = htole32(flags); tx->retry = 3; /* CW minimum */ tx->retry |= 7 << 4; /* CW maximum */ @@ -1908,9 +1912,9 @@ urtw_set_rate(struct urtw_softc *sc) uint16_t data; usb_error_t error; - basic_rate = urtw_rate2rtl(48); - min_rr_rate = urtw_rate2rtl(12); - max_rr_rate = urtw_rate2rtl(48); + basic_rate = URTW_RIDX_OFDM24; + min_rr_rate = URTW_RIDX_OFDM6; + max_rr_rate = URTW_RIDX_OFDM24; urtw_write8_m(sc, URTW_RESP_RATE, max_rr_rate << URTW_RESP_MAX_RATE_SHIFT | @@ -1925,19 +1929,6 @@ urtw_set_rate(struct urtw_softc *sc) urtw_write16_m(sc, URTW_BRSR, data); fail: return (error); -} - -static uint16_t -urtw_rate2rtl(uint32_t rate) -{ - unsigned int i; - - for (i = 0; i < nitems(urtw_ratetable); i++) { - if (rate == urtw_ratetable[i].reg) - return urtw_ratetable[i].val; - } - - return (3); } static uint16_t From owner-svn-src-head@freebsd.org Fri Mar 16 00:38:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A32CF62740; Fri, 16 Mar 2018 00:38:11 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E27A181F6C; Fri, 16 Mar 2018 00:38:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD6851D2C9; Fri, 16 Mar 2018 00:38:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2G0cAqE022137; Fri, 16 Mar 2018 00:38:10 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2G0cAAT022135; Fri, 16 Mar 2018 00:38:10 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201803160038.w2G0cAAT022135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 16 Mar 2018 00:38:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331042 - 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: 331042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 00:38:11 -0000 Author: avos Date: Fri Mar 16 00:38:10 2018 New Revision: 331042 URL: https://svnweb.freebsd.org/changeset/base/331042 Log: urtw(4), zyd(4): reduce code verbosity. No functional change intended. Modified: head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Fri Mar 16 00:09:16 2018 (r331041) +++ head/sys/dev/usb/wlan/if_urtw.c Fri Mar 16 00:38:10 2018 (r331042) @@ -1661,14 +1661,17 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_ sc->sc_xfer[URTW_8187B_BULK_TX_VO] }; struct usb_xfer *xfer; - int dur = 0, rtsdur = 0, rtsenable = 0, ctsenable = 0, rate, - pkttime = 0, txdur = 0, isshort = 0, xferlen; + int dur = 0, rtsdur = 0, rtsenable = 0, ctsenable = 0, rate, type, + pkttime = 0, txdur = 0, isshort = 0, xferlen, ismcast; uint16_t acktime, rtstime, ctstime; uint32_t flags; usb_error_t error; URTW_ASSERT_LOCKED(sc); + ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); + type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; + /* * Software crypto. */ @@ -1697,13 +1700,13 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_ ieee80211_radiotap_tx(vap, m0); } - if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_MGT || - (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL || + if (type == IEEE80211_FC0_TYPE_MGT || + type == IEEE80211_FC0_TYPE_CTL || (m0->m_flags & M_EAPOL) != 0) { rate = tp->mgmtrate; } else { /* for data frames */ - if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + if (ismcast) rate = tp->mcastrate; else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) rate = tp->ucastrate; @@ -1713,7 +1716,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_ sc->sc_stats.txrates[sc->sc_currate]++; - if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + if (ismcast) txdur = pkttime = urtw_compute_txtime(m0->m_pkthdr.len + IEEE80211_CRC_LEN, rate, 0, 0); else { @@ -1776,8 +1779,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_ } tx->flag = htole32(flags); tx->txdur = txdur; - if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == - IEEE80211_FC0_TYPE_MGT && + if (type == IEEE80211_FC0_TYPE_MGT && (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == IEEE80211_FC0_SUBTYPE_PROBE_RESP) tx->retry = 1; @@ -1805,7 +1807,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_ data->m = m0; if (sc->sc_flags & URTW_RTL8187B) { - switch (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) { + switch (type) { case IEEE80211_FC0_TYPE_CTL: case IEEE80211_FC0_TYPE_MGT: xfer = sc->sc_xfer[URTW_8187B_BULK_TX_EP12]; Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Fri Mar 16 00:09:16 2018 (r331041) +++ head/sys/dev/usb/wlan/if_zyd.c Fri Mar 16 00:38:10 2018 (r331042) @@ -2443,7 +2443,7 @@ zyd_tx_start(struct zyd_softc *sc, struct mbuf *m0, st struct ieee80211_frame *wh; const struct ieee80211_txparam *tp = ni->ni_txparms; struct ieee80211_key *k; - int rate, totlen; + int rate, totlen, type, ismcast; static const uint8_t ratediv[] = ZYD_TX_RATEDIV; uint8_t phy; uint16_t pktlen; @@ -2454,13 +2454,16 @@ zyd_tx_start(struct zyd_softc *sc, struct mbuf *m0, st STAILQ_REMOVE_HEAD(&sc->tx_free, next); sc->tx_nfree--; - if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_MGT || - (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL || + ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); + type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; + + if (type == IEEE80211_FC0_TYPE_MGT || + type == IEEE80211_FC0_TYPE_CTL || (m0->m_flags & M_EAPOL) != 0) { rate = tp->mgmtrate; } else { /* for data frames */ - if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + if (ismcast) rate = tp->mcastrate; else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) rate = tp->ucastrate; @@ -2498,7 +2501,7 @@ zyd_tx_start(struct zyd_softc *sc, struct mbuf *m0, st desc->len = htole16(totlen); desc->flags = ZYD_TX_FLAG_BACKOFF; - if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { + if (!ismcast) { /* multicast frames are not sent at OFDM rates in 802.11b/g */ if (totlen > vap->iv_rtsthreshold) { desc->flags |= ZYD_TX_FLAG_RTS; From owner-svn-src-head@freebsd.org Fri Mar 16 01:03:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B551F64701; Fri, 16 Mar 2018 01:03:11 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0F938306B; Fri, 16 Mar 2018 01:03:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CACFE1D762; Fri, 16 Mar 2018 01:03:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2G13Ads036570; Fri, 16 Mar 2018 01:03:10 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2G13AH7036566; Fri, 16 Mar 2018 01:03:10 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201803160103.w2G13AH7036566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 16 Mar 2018 01:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331043 - in head/sys/dev/rtwn: . rtl8188e rtl8192c rtl8812a X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn: . rtl8188e rtl8192c rtl8812a X-SVN-Commit-Revision: 331043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 01:03:11 -0000 Author: avos Date: Fri Mar 16 01:03:10 2018 New Revision: 331043 URL: https://svnweb.freebsd.org/changeset/base/331043 Log: rtwn(4): de-hardcode ('h/w rate index' - 'corresponding MCS index') constant Modified: head/sys/dev/rtwn/if_rtwn_ridx.h head/sys/dev/rtwn/rtl8188e/r88e_rx.c head/sys/dev/rtwn/rtl8192c/r92c_rx.c head/sys/dev/rtwn/rtl8812a/r12a_rx.c Modified: head/sys/dev/rtwn/if_rtwn_ridx.h ============================================================================== --- head/sys/dev/rtwn/if_rtwn_ridx.h Fri Mar 16 00:38:10 2018 (r331042) +++ head/sys/dev/rtwn/if_rtwn_ridx.h Fri Mar 16 01:03:10 2018 (r331043) @@ -36,8 +36,10 @@ #define RTWN_RIDX_OFDM36 9 #define RTWN_RIDX_OFDM48 10 #define RTWN_RIDX_OFDM54 11 -#define RTWN_RIDX_HT_MCS(i) (12 + (i)) +#define RTWN_RIDX_HT_MCS_SHIFT 12 +#define RTWN_RIDX_HT_MCS(i) (RTWN_RIDX_HT_MCS_SHIFT + (i)) + #define RTWN_RIDX_COUNT 28 #define RTWN_RIDX_UNKNOWN (uint8_t)-1 @@ -53,8 +55,7 @@ static __inline uint8_t rate2ridx(uint8_t rate) { if (rate & IEEE80211_RATE_MCS) { - /* 11n rates start at idx 12 */ - return ((rate & 0xf) + 12); + return ((rate & 0xf) + RTWN_RIDX_HT_MCS_SHIFT); } switch (rate) { /* 11g */ Modified: head/sys/dev/rtwn/rtl8188e/r88e_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_rx.c Fri Mar 16 00:38:10 2018 (r331042) +++ head/sys/dev/rtwn/rtl8188e/r88e_rx.c Fri Mar 16 01:03:10 2018 (r331043) @@ -108,7 +108,8 @@ r88e_ratectl_tx_complete(struct rtwn_softc *sc, uint8_ txs.long_retries = ntries; if (rpt->final_rate > RTWN_RIDX_OFDM54) { /* MCS */ txs.final_rate = - (rpt->final_rate - 12) | IEEE80211_RATE_MCS; + rpt->final_rate - RTWN_RIDX_HT_MCS_SHIFT; + txs.final_rate |= IEEE80211_RATE_MCS; } else txs.final_rate = ridx2rate[rpt->final_rate]; if (rpt->rptb1 & R88E_RPTB1_PKT_OK) Modified: head/sys/dev/rtwn/rtl8192c/r92c_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_rx.c Fri Mar 16 00:38:10 2018 (r331042) +++ head/sys/dev/rtwn/rtl8192c/r92c_rx.c Fri Mar 16 01:03:10 2018 (r331043) @@ -140,7 +140,8 @@ r92c_get_rx_stats(struct rtwn_softc *sc, struct ieee80 else rxs->c_pktflags |= IEEE80211_RX_F_OFDM; } else { /* MCS0~15. */ - rxs->c_rate = IEEE80211_RATE_MCS | (rate - 12); + rxs->c_rate = + IEEE80211_RATE_MCS | (rate - RTWN_RIDX_HT_MCS_SHIFT); rxs->c_pktflags |= IEEE80211_RX_F_HT; } } Modified: head/sys/dev/rtwn/rtl8812a/r12a_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8812a/r12a_rx.c Fri Mar 16 00:38:10 2018 (r331042) +++ head/sys/dev/rtwn/rtl8812a/r12a_rx.c Fri Mar 16 01:03:10 2018 (r331043) @@ -115,7 +115,8 @@ r12a_ratectl_tx_complete(struct rtwn_softc *sc, uint8_ txs.long_retries = ntries; if (rpt->final_rate > RTWN_RIDX_OFDM54) { /* MCS */ txs.final_rate = - (rpt->final_rate - 12) | IEEE80211_RATE_MCS; + rpt->final_rate - RTWN_RIDX_HT_MCS_SHIFT; + txs.final_rate |= IEEE80211_RATE_MCS; } else txs.final_rate = ridx2rate[rpt->final_rate]; if (rpt->txrptb0 & R12A_TXRPTB0_RETRY_OVER) @@ -310,7 +311,8 @@ r12a_get_rx_stats(struct rtwn_softc *sc, struct ieee80 rxs->c_pktflags |= IEEE80211_RX_F_OFDM; } else { /* MCS0~15. */ /* TODO: VHT rates */ - rxs->c_rate = IEEE80211_RATE_MCS | (rate - 12); + rxs->c_rate = + IEEE80211_RATE_MCS | (rate - RTWN_RIDX_HT_MCS_SHIFT); rxs->c_pktflags |= IEEE80211_RX_F_HT; } From owner-svn-src-head@freebsd.org Fri Mar 16 02:46:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 071B6F4396F; Fri, 16 Mar 2018 02:46:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD42186E71; Fri, 16 Mar 2018 02:46:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A82571E687; Fri, 16 Mar 2018 02:46:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2G2k8jA086295; Fri, 16 Mar 2018 02:46:08 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2G2k8n8086294; Fri, 16 Mar 2018 02:46:08 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803160246.w2G2k8n8086294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 16 Mar 2018 02:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331045 - head/sys/modules/imx/imx_spi X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/modules/imx/imx_spi X-SVN-Commit-Revision: 331045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 02:46:09 -0000 Author: ian Date: Fri Mar 16 02:46:08 2018 New Revision: 331045 URL: https://svnweb.freebsd.org/changeset/base/331045 Log: Add required interface header. Reported by: andreast@ Modified: head/sys/modules/imx/imx_spi/Makefile Modified: head/sys/modules/imx/imx_spi/Makefile ============================================================================== --- head/sys/modules/imx/imx_spi/Makefile Fri Mar 16 02:44:18 2018 (r331044) +++ head/sys/modules/imx/imx_spi/Makefile Fri Mar 16 02:46:08 2018 (r331045) @@ -9,6 +9,7 @@ SRCS= imx_spi.c SRCS+= \ bus_if.h \ device_if.h \ + gpio_if.h \ ofw_bus_if.h \ opt_platform.h \ spibus_if.h \ From owner-svn-src-head@freebsd.org Fri Mar 16 05:23:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A097FF51B54; Fri, 16 Mar 2018 05:23:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48F5D6C372; Fri, 16 Mar 2018 05:23:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43F841FF0B; Fri, 16 Mar 2018 05:23:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2G5NnHW066217; Fri, 16 Mar 2018 05:23:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2G5NnPs066215; Fri, 16 Mar 2018 05:23:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803160523.w2G5NnPs066215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 16 Mar 2018 05:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331046 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 331046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 05:23:50 -0000 Author: imp Date: Fri Mar 16 05:23:48 2018 New Revision: 331046 URL: https://svnweb.freebsd.org/changeset/base/331046 Log: Try polling the qpairs on timeout. On some systems, we're getting timeouts when we use multiple queues on drives that work perfectly well on other systems. On a hunch, Jim Harris suggested I poll the completion queue when we get a timeout. This patch polls the completion queue if no fatal status was indicated. If it had pending I/O, we complete that request and return. Otherwise, if aborts are enabled and no fatal status, we abort the command and return. Otherwise we reset the card. This may clear up the problem, or we may see it result in lots of timeouts and a performance problem. Either way, we'll know the next step. We may also need to pay attention to the fatal status bit of the controller. PR: 211713 Suggested by: Jim Harris Sponsored by: Netflix Modified: head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Fri Mar 16 02:46:08 2018 (r331045) +++ head/sys/dev/nvme/nvme_private.h Fri Mar 16 05:23:48 2018 (r331046) @@ -426,7 +426,7 @@ int nvme_qpair_construct(struct nvme_qpair *qpair, uin struct nvme_controller *ctrlr); void nvme_qpair_submit_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr); -void nvme_qpair_process_completions(struct nvme_qpair *qpair); +bool nvme_qpair_process_completions(struct nvme_qpair *qpair); void nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req); void nvme_qpair_reset(struct nvme_qpair *qpair); Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Fri Mar 16 02:46:08 2018 (r331045) +++ head/sys/dev/nvme/nvme_qpair.c Fri Mar 16 05:23:48 2018 (r331046) @@ -469,11 +469,12 @@ nvme_qpair_manual_complete_request(struct nvme_qpair * nvme_free_request(req); } -void +bool nvme_qpair_process_completions(struct nvme_qpair *qpair) { struct nvme_tracker *tr; struct nvme_completion cpl; + int done = 0; qpair->num_intr_handler_calls++; @@ -484,7 +485,7 @@ nvme_qpair_process_completions(struct nvme_qpair *qpai * associated with this interrupt will get retried when the * reset is complete. */ - return; + return (false); while (1) { cpl = qpair->cpl[qpair->cq_head]; @@ -500,6 +501,7 @@ nvme_qpair_process_completions(struct nvme_qpair *qpai if (tr != NULL) { nvme_qpair_complete_tracker(qpair, tr, &cpl, TRUE); qpair->sq_head = cpl.sqhd; + done++; } else { nvme_printf(qpair->ctrlr, "cpl does not map to outstanding cmd\n"); @@ -516,6 +518,7 @@ nvme_qpair_process_completions(struct nvme_qpair *qpai nvme_mmio_write_4(qpair->ctrlr, doorbell[qpair->id].cq_hdbl, qpair->cq_head); } + return (done != 0); } static void @@ -770,19 +773,30 @@ nvme_timeout(void *arg) uint32_t csts; uint8_t cfs; - /* Read csts to get value of cfs - controller fatal status. */ + /* + * Read csts to get value of cfs - controller fatal status. + * If no fatal status, try to call the completion routine, and + * if completes transactions, report a missed interrupt and + * return (this may need to be rate limited). Otherwise, if + * aborts are enabled and the controller is not reporting + * fatal status, abort the command. Otherwise, just reset the + * controller and hope for the best. + */ csts = nvme_mmio_read_4(ctrlr, csts); - cfs = (csts >> NVME_CSTS_REG_CFS_SHIFT) & NVME_CSTS_REG_CFS_MASK; + if (cfs == 0 && nvme_qpair_process_completions(qpair)) { + nvme_printf(ctrlr, "Missing interrupt\n"); + return; + } if (ctrlr->enable_aborts && cfs == 0) { - /* - * If aborts are enabled, only use them if the controller is - * not reporting fatal status. - */ + nvme_printf(ctrlr, "Aborting command due to a timeout.\n"); nvme_ctrlr_cmd_abort(ctrlr, tr->cid, qpair->id, nvme_abort_complete, tr); - } else + } else { + nvme_printf(ctrlr, "Resetting controller due to a timeout%s.\n", + cfs ? " and fatal error status" : ""); nvme_ctrlr_reset(ctrlr); + } } void From owner-svn-src-head@freebsd.org Fri Mar 16 05:38:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C044AF52BDD for ; Fri, 16 Mar 2018 05:38:35 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x232.google.com (mail-yw0-x232.google.com [IPv6:2607:f8b0:4002:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61A566CE17 for ; Fri, 16 Mar 2018 05:38:35 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x232.google.com with SMTP id y203so6248181ywg.5 for ; Thu, 15 Mar 2018 22:38:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RQ7NNk95QbXFTYSl0PTb0rap+c8sllx6vxa+goE5hPw=; b=kK+ozeaBy78Gig90/JkPirHSdM1XyYgj3+mYCh/FdiTqjRXGBv5f4uZsEWXyuFWSGP /KFNfRJ7oVwnOXKVfkjzQZbiAG6SGSklTm6U9Z4hnl5NE6w4Pel+Q2E6BZITAsleAYyS aShmoYd2d1AhDrBCOpQWf3evWO9sS1oetGLKc= 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=RQ7NNk95QbXFTYSl0PTb0rap+c8sllx6vxa+goE5hPw=; b=EH18Psnsn4s4VqYpTR3bDFPoURUvR+7QA/k7eVGLIpUblFkYMfSdjgi9+c6Q82d7a8 siCRevFkdm8sphP8fwJdzF+dWe3DvOVx+BcLsfh6Q57JxYBPwwuUfTvFnlpy7o31JddC yz4PiBbjHfHoSQHmCbVRlmWLH6gYJB9I7FcZteLA6CDZAsQQaTX3U2zGZ8rNITD3Yozg 5Csc3RpX70N6nuGeVYU+NyJNCchALedd0RhcsaL0E/pQmHOzh6oEUQYEycVC0KChsh8k kzDTPYc3SN4gkiqb6kiIEX41XnexMboCN+PsnIU/RAP58L9Cn0uOpwLd1WJU/BO4uMyj NwZg== X-Gm-Message-State: AElRT7HpwrETNe726D7iO7i0XNVjIkNNxS9eweBkQa14NmEB0be76/LE +GmA5FtyNEDR3tEtf75s9v3LxgCf8jHFmcnB2OD7tQ== X-Google-Smtp-Source: AG47ELvigL+RweZhjbYT2kOFbSqIGxAGoGvYe7A7BkkRkyBM4ElXXJs6dyowvNM1ONiNdUwmHeNK2Gdwtgkpi/XkPhA= X-Received: by 2002:a25:ae5b:: with SMTP id g27-v6mr258693ybe.87.1521178714648; Thu, 15 Mar 2018 22:38:34 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:23d2:0:0:0:0:0 with HTTP; Thu, 15 Mar 2018 22:38:04 -0700 (PDT) In-Reply-To: <201607201659.u6KGxaNs010929@repo.freebsd.org> References: <201607201659.u6KGxaNs010929@repo.freebsd.org> From: Eitan Adler Date: Thu, 15 Mar 2018 22:38:04 -0700 Message-ID: Subject: Re: svn commit: r303099 - head/sys/kern To: "Conrad E. Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 05:38:35 -0000 On 20 July 2016 at 09:59, Conrad E. Meyer wrote: > Author: cem > Date: Wed Jul 20 16:59:36 2016 > New Revision: 303099 > URL: https://svnweb.freebsd.org/changeset/base/303099 > > Log: > Extend ELF coredump to support more than 65535 segments r303099, r303105, r303114, r308177 Is this and related safe to MFC? If so did I miss any ? -- Eitan Adler From owner-svn-src-head@freebsd.org Fri Mar 16 07:05:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CA80F55B09; Fri, 16 Mar 2018 07:05:10 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D6826F7A5; Fri, 16 Mar 2018 07:05:10 +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 1DEBE20E15; Fri, 16 Mar 2018 07:05:10 +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 w2G759ld016778; Fri, 16 Mar 2018 07:05:09 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2G759Ie016777; Fri, 16 Mar 2018 07:05:09 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803160705.w2G759Ie016777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 16 Mar 2018 07:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331048 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 331048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 07:05:10 -0000 Author: cem Date: Fri Mar 16 07:05:09 2018 New Revision: 331048 URL: https://svnweb.freebsd.org/changeset/base/331048 Log: Fix GCC build: Remove redundant pagedaemon_wakeup declaration Introduced in r331018. Reported by: kevans Sponsored by: Dell EMC Isilon Modified: head/sys/vm/vm_pageout.h Modified: head/sys/vm/vm_pageout.h ============================================================================== --- head/sys/vm/vm_pageout.h Fri Mar 16 05:29:30 2018 (r331047) +++ head/sys/vm/vm_pageout.h Fri Mar 16 07:05:09 2018 (r331048) @@ -95,7 +95,6 @@ extern int vm_pageout_page_count; * Signal pageout-daemon and wait for it. */ -void pagedaemon_wakeup(int domain); void vm_wait(vm_object_t obj); void vm_waitpfault(void); void vm_wait_domain(int domain); From owner-svn-src-head@freebsd.org Fri Mar 16 07:11:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9D48F560A2; Fri, 16 Mar 2018 07:11:54 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E3556FBD1; Fri, 16 Mar 2018 07:11:54 +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 6916020F64; Fri, 16 Mar 2018 07:11:54 +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 w2G7BsYt021502; Fri, 16 Mar 2018 07:11:54 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2G7Bs4Z021500; Fri, 16 Mar 2018 07:11:54 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803160711.w2G7Bs4Z021500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 16 Mar 2018 07:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331049 - in head/sys: conf crypto/chacha20 modules modules/chacha20 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: conf crypto/chacha20 modules modules/chacha20 X-SVN-Commit-Revision: 331049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 07:11:54 -0000 Author: cem Date: Fri Mar 16 07:11:53 2018 New Revision: 331049 URL: https://svnweb.freebsd.org/changeset/base/331049 Log: Garbage collect unused chacha20 code Two copies of chacha20 were imported into the tree on Apr 15 2017 (r316982) and Apr 16 2017 (r317015). Only the latter is actually used by anything, so just go ahead and garbage collect the unused version while it's still only in CURRENT. I'm not making any judgement on which implementation is better. If I pulled the wrong one, feel free to swap the existing implementation out and replace it with the other code (conforming to the API that actually gets used in randomdev, of course). We only need one generic implementation. Sponsored by: Dell EMC Isilon Deleted: head/sys/crypto/chacha20/chacha20.c head/sys/crypto/chacha20/chacha20.h head/sys/modules/chacha20/ Modified: head/sys/conf/files head/sys/modules/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Mar 16 07:05:09 2018 (r331048) +++ head/sys/conf/files Fri Mar 16 07:11:53 2018 (r331049) @@ -652,7 +652,6 @@ crypto/blowfish/bf_ecb.c optional ipsec | ipsec_suppor crypto/blowfish/bf_skey.c optional crypto | ipsec | ipsec_support crypto/camellia/camellia.c optional crypto | ipsec | ipsec_support crypto/camellia/camellia-api.c optional crypto | ipsec | ipsec_support -crypto/chacha20/chacha20.c optional chacha20 crypto/des/des_ecb.c optional crypto | ipsec | ipsec_support | netsmb crypto/des/des_setkey.c optional crypto | ipsec | ipsec_support | netsmb crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Mar 16 07:05:09 2018 (r331048) +++ head/sys/modules/Makefile Fri Mar 16 07:11:53 2018 (r331049) @@ -86,7 +86,6 @@ SUBDIR= \ cd9660_iconv \ ${_ce} \ ${_cfi} \ - chacha20 \ ${_chromebook_platform} \ ${_ciss} \ cloudabi \ From owner-svn-src-head@freebsd.org Fri Mar 16 12:12:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63540F495F4; Fri, 16 Mar 2018 12:12: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A20F7B8B8; Fri, 16 Mar 2018 12:12:42 +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 1516B23D51; Fri, 16 Mar 2018 12:12:42 +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 w2GCCf5X073068; Fri, 16 Mar 2018 12:12:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GCCfK6073067; Fri, 16 Mar 2018 12:12:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803161212.w2GCCfK6073067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 16 Mar 2018 12:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331053 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 331053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 12:12:42 -0000 Author: emaste Date: Fri Mar 16 12:12:41 2018 New Revision: 331053 URL: https://svnweb.freebsd.org/changeset/base/331053 Log: ANSIfy i386/vm86.c Modified: head/sys/i386/i386/vm86.c Modified: head/sys/i386/i386/vm86.c ============================================================================== --- head/sys/i386/i386/vm86.c Fri Mar 16 08:45:28 2018 (r331052) +++ head/sys/i386/i386/vm86.c Fri Mar 16 12:12:41 2018 (r331053) @@ -130,8 +130,7 @@ POPL(struct vm86frame *vmf) } int -vm86_emulate(vmf) - struct vm86frame *vmf; +vm86_emulate(struct vm86frame *vmf) { struct vm86_kernel *vm86; caddr_t addr; @@ -588,10 +587,7 @@ vm86_intcall(int intnum, struct vm86frame *vmf) * caller's cs:ip routine. */ int -vm86_datacall(intnum, vmf, vmc) - int intnum; - struct vm86frame *vmf; - struct vm86context *vmc; +vm86_datacall(int intnum, struct vm86frame *vmf, struct vm86context *vmc) { pt_entry_t *pte = (pt_entry_t *)vm86paddr; vm_paddr_t page; @@ -636,11 +632,8 @@ vm86_getaddr(struct vm86context *vmc, u_short sel, u_s } int -vm86_getptr(vmc, kva, sel, off) - struct vm86context *vmc; - vm_offset_t kva; - u_short *sel; - u_short *off; +vm86_getptr(struct vm86context *vmc, vm_offset_t kva, u_short *sel, + u_short *off) { int i; @@ -655,9 +648,7 @@ vm86_getptr(vmc, kva, sel, off) } int -vm86_sysarch(td, args) - struct thread *td; - char *args; +vm86_sysarch(struct thread *td, char *args) { int error = 0; struct i386_vm86_args ua; From owner-svn-src-head@freebsd.org Fri Mar 16 13:33:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CDD3F4F919; Fri, 16 Mar 2018 13:33:43 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09EE77ED58; Fri, 16 Mar 2018 13:33:43 +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 04D3B2493D; Fri, 16 Mar 2018 13:33:43 +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 w2GDXgFD014109; Fri, 16 Mar 2018 13:33:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GDXg14014108; Fri, 16 Mar 2018 13:33:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803161333.w2GDXg14014108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 16 Mar 2018 13:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331054 - head/sys/modules/sgx X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/modules/sgx X-SVN-Commit-Revision: 331054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 13:33:43 -0000 Author: emaste Date: Fri Mar 16 13:33:42 2018 New Revision: 331054 URL: https://svnweb.freebsd.org/changeset/base/331054 Log: Move assym.s to DPSRC in sgx module assym.s is only to be included by other .s files, and should not actually be assembled by itself. Modified: head/sys/modules/sgx/Makefile Modified: head/sys/modules/sgx/Makefile ============================================================================== --- head/sys/modules/sgx/Makefile Fri Mar 16 12:12:41 2018 (r331053) +++ head/sys/modules/sgx/Makefile Fri Mar 16 13:33:42 2018 (r331054) @@ -3,8 +3,9 @@ .PATH: ${SRCTOP}/sys/amd64/sgx KMOD= sgx -SRCS= sgx.c sgxvar.h assym.s sgx_support.S +SRCS= sgx.c sgxvar.h sgx_support.S SRCS+= opt_compat.h opt_hwpmc_hooks.h opt_kstack_pages.h +DPSRCS= assym.s sgx_support.o: assym.s ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ From owner-svn-src-head@freebsd.org Fri Mar 16 14:46:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D43D1F544DB; Fri, 16 Mar 2018 14:46:39 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8125B81BDC; Fri, 16 Mar 2018 14:46:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7588625446; Fri, 16 Mar 2018 14:46:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2GEkd4c049155; Fri, 16 Mar 2018 14:46:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GEkcLa049146; Fri, 16 Mar 2018 14:46:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803161446.w2GEkcLa049146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 16 Mar 2018 14:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331056 - in head/sys: amd64/linux amd64/linux32 compat/linux conf i386/linux modules/linux modules/linux_common X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 compat/linux conf i386/linux modules/linux modules/linux_common X-SVN-Commit-Revision: 331056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 14:46:40 -0000 Author: emaste Date: Fri Mar 16 14:46:38 2018 New Revision: 331056 URL: https://svnweb.freebsd.org/changeset/base/331056 Log: Share a single bsd-linux errno table across MD consumers Three copies of the linuxulator linux_sysvec.c contained identical BSD to Linux errno translation tables, and future work to support other architectures will also use the same table. Move the table to a common file to be used by all. Make it 'const int' to place it in .rodata. (Some existing Linux architectures use MD errno values, but x86 and Arm share the generic set.) This change should introduce no functional change; a followup will add missing errno values. MFC after: 3 weeks Sponsored by: Turing Robotic Industries Inc. Differential Revision: https://reviews.freebsd.org/D14665 Added: head/sys/compat/linux/linux_errno.c (contents, props changed) Modified: head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/compat/linux/linux_emul.h head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/linux/linux_sysvec.c head/sys/modules/linux/Makefile head/sys/modules/linux_common/Makefile Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Fri Mar 16 14:05:45 2018 (r331055) +++ head/sys/amd64/linux/linux_sysvec.c Fri Mar 16 14:46:38 2018 (r331056) @@ -130,26 +130,6 @@ static void linux_exec_setregs(struct thread *td, stru u_long stack); static int linux_vsyscall(struct thread *td); -/* - * Linux syscalls return negative errno's, we do positive and map them - * Reference: - * FreeBSD: src/sys/sys/errno.h - * Linux: linux-2.6.17.8/include/asm-generic/errno-base.h - * linux-2.6.17.8/include/asm-generic/errno.h - */ -static int bsd_to_linux_errno[ELAST + 1] = { - -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, - -10, -35, -12, -13, -14, -15, -16, -17, -18, -19, - -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, - -30, -31, -32, -33, -34, -11,-115,-114, -88, -89, - -90, -91, -92, -93, -94, -95, -96, -97, -98, -99, - -100,-101,-102,-103,-104,-105,-106,-107,-108,-109, - -110,-111, -40, -36,-112,-113, -39, -11, -87,-122, - -116, -66, -6, -6, -6, -6, -6, -37, -38, -9, - -6, -6, -43, -42, -75,-125, -84, -61, -16, -74, - -72, -67, -71 -}; - #define LINUX_T_UNKNOWN 255 static int _bsd_to_linux_trapcode[] = { LINUX_T_UNKNOWN, /* 0 */ @@ -774,7 +754,7 @@ struct sysentvec elf_linux_sysvec = { .sv_table = linux_sysent, .sv_mask = 0, .sv_errsize = ELAST + 1, - .sv_errtbl = bsd_to_linux_errno, + .sv_errtbl = bsd_to_linux_errno_generic, .sv_transtrap = translate_traps, .sv_fixup = elf_linux_fixup, .sv_sendsig = linux_rt_sendsig, Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Fri Mar 16 14:05:45 2018 (r331055) +++ head/sys/amd64/linux32/linux32_sysvec.c Fri Mar 16 14:46:38 2018 (r331056) @@ -131,26 +131,6 @@ static bool linux32_trans_osrel(const Elf_Note *note, static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); -/* - * Linux syscalls return negative errno's, we do positive and map them - * Reference: - * FreeBSD: src/sys/sys/errno.h - * Linux: linux-2.6.17.8/include/asm-generic/errno-base.h - * linux-2.6.17.8/include/asm-generic/errno.h - */ -static int bsd_to_linux_errno[ELAST + 1] = { - -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, - -10, -35, -12, -13, -14, -15, -16, -17, -18, -19, - -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, - -30, -31, -32, -33, -34, -11,-115,-114, -88, -89, - -90, -91, -92, -93, -94, -95, -96, -97, -98, -99, - -100,-101,-102,-103,-104,-105,-106,-107,-108,-109, - -110,-111, -40, -36,-112,-113, -39, -11, -87,-122, - -116, -66, -6, -6, -6, -6, -6, -37, -38, -9, - -6, -6, -43, -42, -75,-125, -84, -61, -16, -74, - -72, -67, -71 -}; - #define LINUX_T_UNKNOWN 255 static int _bsd_to_linux_trapcode[] = { LINUX_T_UNKNOWN, /* 0 */ @@ -973,7 +953,7 @@ struct sysentvec elf_linux_sysvec = { .sv_table = linux32_sysent, .sv_mask = 0, .sv_errsize = ELAST + 1, - .sv_errtbl = bsd_to_linux_errno, + .sv_errtbl = bsd_to_linux_errno_generic, .sv_transtrap = translate_traps, .sv_fixup = elf_linux_fixup, .sv_sendsig = linux_sendsig, Modified: head/sys/compat/linux/linux_emul.h ============================================================================== --- head/sys/compat/linux/linux_emul.h Fri Mar 16 14:05:45 2018 (r331055) +++ head/sys/compat/linux/linux_emul.h Fri Mar 16 14:46:38 2018 (r331056) @@ -77,4 +77,6 @@ struct linux_pemuldata { struct linux_pemuldata *pem_find(struct proc *); +extern const int bsd_to_linux_errno_generic[]; + #endif /* !_LINUX_EMUL_H_ */ Added: head/sys/compat/linux/linux_errno.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linux/linux_errno.c Fri Mar 16 14:46:38 2018 (r331056) @@ -0,0 +1,143 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 1994-1996 Søren Schmidt + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +/* + * Linux syscalls return negative errno's, we do positive and map them + * Reference: + * FreeBSD: src/sys/sys/errno.h + * Linux: linux-2.6.17.8/include/asm-generic/errno-base.h + * linux-2.6.17.8/include/asm-generic/errno.h + */ +const int bsd_to_linux_errno_generic[ELAST + 1] = { + -0, + -1, + -2, + -3, + -4, + -5, + -6, + -7, + -8, + -9, + + -10, + -35, /* EDEADLK */ + -12, + -13, + -14, + -15, + -16, + -17, + -18, + -19, + + -20, + -21, + -22, + -23, + -24, + -25, + -26, + -27, + -28, + -29, + + -30, + -31, + -32, + -33, + -34, + -11, /* EAGAIN */ + -115, + -114, + -88, + -89, + + -90, + -91, + -92, + -93, + -94, + -95, + -96, + -97, + -98, + -99, + + -100, + -101, + -102, + -103, + -104, + -105, + -106, + -107, + -108, + -109, + + -110, + -111, + -40, + -36, + -112, + -113, + -39, + -11, + -87, + -122, + + -116, + -66, + -6, /* EBADRPC -> ENXIO */ + -6, /* ERPCMISMATCH -> ENXIO */ + -6, /* EPROGUNAVAIL -> ENXIO */ + -6, /* EPROGMISMATCH -> ENXIO */ + -6, /* EPROCUNAVAIL -> ENXIO */ + -37, + -38, + -9, + + -6, /* EAUTH -> ENXIO */ + -6, /* ENEEDAUTH -> ENXIO */ + -43, + -42, + -75, + -125, + -84, + -61, + -16, /* EDOOFUS -> EBUSY */ + -74, + + -72, + -67, + -71, +}; Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Fri Mar 16 14:05:45 2018 (r331055) +++ head/sys/conf/files.amd64 Fri Mar 16 14:46:38 2018 (r331056) @@ -616,6 +616,7 @@ amd64/linux32/linux32_support.s optional compat_linux3 amd64/linux32/linux32_sysent.c optional compat_linux32 amd64/linux32/linux32_sysvec.c optional compat_linux32 compat/linux/linux_emul.c optional compat_linux32 +compat/linux/linux_errno.c optional compat_linux32 compat/linux/linux_file.c optional compat_linux32 compat/linux/linux_fork.c optional compat_linux32 compat/linux/linux_futex.c optional compat_linux32 Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri Mar 16 14:05:45 2018 (r331055) +++ head/sys/conf/files.i386 Fri Mar 16 14:46:38 2018 (r331056) @@ -88,6 +88,7 @@ compat/linprocfs/linprocfs.c optional linprocfs compat/linsysfs/linsysfs.c optional linsysfs compat/linux/linux_event.c optional compat_linux compat/linux/linux_emul.c optional compat_linux +compat/linux/linux_errno.c optional compat_linux compat/linux/linux_file.c optional compat_linux compat/linux/linux_fork.c optional compat_linux compat/linux/linux_futex.c optional compat_linux Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Fri Mar 16 14:05:45 2018 (r331055) +++ head/sys/i386/linux/linux_sysvec.c Fri Mar 16 14:46:38 2018 (r331056) @@ -126,26 +126,6 @@ static eventhandler_tag linux_exit_tag; static eventhandler_tag linux_exec_tag; static eventhandler_tag linux_thread_dtor_tag; -/* - * Linux syscalls return negative errno's, we do positive and map them - * Reference: - * FreeBSD: src/sys/sys/errno.h - * Linux: linux-2.6.17.8/include/asm-generic/errno-base.h - * linux-2.6.17.8/include/asm-generic/errno.h - */ -static int bsd_to_linux_errno[ELAST + 1] = { - -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, - -10, -35, -12, -13, -14, -15, -16, -17, -18, -19, - -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, - -30, -31, -32, -33, -34, -11,-115,-114, -88, -89, - -90, -91, -92, -93, -94, -95, -96, -97, -98, -99, - -100,-101,-102,-103,-104,-105,-106,-107,-108,-109, - -110,-111, -40, -36,-112,-113, -39, -11, -87,-122, - -116, -66, -6, -6, -6, -6, -6, -37, -38, -9, - -6, -6, -43, -42, -75,-125, -84, -61, -16, -74, - -72, -67, -71 -}; - #define LINUX_T_UNKNOWN 255 static int _bsd_to_linux_trapcode[] = { LINUX_T_UNKNOWN, /* 0 */ @@ -913,7 +893,7 @@ struct sysentvec linux_sysvec = { .sv_table = linux_sysent, .sv_mask = 0, .sv_errsize = ELAST + 1, - .sv_errtbl = bsd_to_linux_errno, + .sv_errtbl = bsd_to_linux_errno_generic, .sv_transtrap = translate_traps, .sv_fixup = linux_fixup, .sv_sendsig = linux_sendsig, @@ -950,7 +930,7 @@ struct sysentvec elf_linux_sysvec = { .sv_table = linux_sysent, .sv_mask = 0, .sv_errsize = ELAST + 1, - .sv_errtbl = bsd_to_linux_errno, + .sv_errtbl = bsd_to_linux_errno_generic, .sv_transtrap = translate_traps, .sv_fixup = elf_linux_fixup, .sv_sendsig = linux_sendsig, Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Fri Mar 16 14:05:45 2018 (r331055) +++ head/sys/modules/linux/Makefile Fri Mar 16 14:46:38 2018 (r331056) @@ -31,7 +31,7 @@ OBJS= ${VDSO}.so .if ${MACHINE_CPUARCH} == "i386" SRCS+= linux_ptrace.c imgact_linux.c linux_util.c linux_mib.c linux_mmap.c \ - linux_emul.c opt_cpu.h linux.c + linux_emul.c linux_errno.c opt_cpu.h linux.c .endif .if ${MACHINE_CPUARCH} == "i386" Modified: head/sys/modules/linux_common/Makefile ============================================================================== --- head/sys/modules/linux_common/Makefile Fri Mar 16 14:05:45 2018 (r331055) +++ head/sys/modules/linux_common/Makefile Fri Mar 16 14:46:38 2018 (r331056) @@ -4,9 +4,11 @@ KMOD= linux_common SRCS= linux_common.c linux_mib.c linux_mmap.c linux_util.c linux_emul.c \ + linux_errno.c \ linux.c opt_compat.h device_if.h vnode_if.h bus_if.h EXPORT_SYMS= +EXPORT_SYMS+= bsd_to_linux_errno_generic EXPORT_SYMS+= linux_emul_path EXPORT_SYMS+= linux_ioctl_register_handler EXPORT_SYMS+= linux_ioctl_unregister_handler From owner-svn-src-head@freebsd.org Fri Mar 16 14:51:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20878F54C1B; Fri, 16 Mar 2018 14:51:48 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66ECC82252; Fri, 16 Mar 2018 14:51:47 +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 61E3C255A7; Fri, 16 Mar 2018 14:51:47 +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 w2GEpl4Z053142; Fri, 16 Mar 2018 14:51:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GEpl3T053141; Fri, 16 Mar 2018 14:51:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803161451.w2GEpl3T053141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 16 Mar 2018 14:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331057 - 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: 331057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 14:51:48 -0000 Author: emaste Date: Fri Mar 16 14:51:47 2018 New Revision: 331057 URL: https://svnweb.freebsd.org/changeset/base/331057 Log: linux_errno.c: add newer errno values Also introduce a static assert to ensure the list is kept up to date. Sponsored by: Turing Robotic Industries Inc. Modified: head/sys/compat/linux/linux_errno.c Modified: head/sys/compat/linux/linux_errno.c ============================================================================== --- head/sys/compat/linux/linux_errno.c Fri Mar 16 14:46:38 2018 (r331056) +++ head/sys/compat/linux/linux_errno.c Fri Mar 16 14:51:47 2018 (r331057) @@ -28,14 +28,15 @@ * $FreeBSD$ */ +#include #include /* * Linux syscalls return negative errno's, we do positive and map them * Reference: * FreeBSD: src/sys/sys/errno.h - * Linux: linux-2.6.17.8/include/asm-generic/errno-base.h - * linux-2.6.17.8/include/asm-generic/errno.h + * Linux: include/uapi/asm-generic/errno-base.h + * include/uapi/asm-generic/errno.h */ const int bsd_to_linux_errno_generic[ELAST + 1] = { -0, @@ -140,4 +141,11 @@ const int bsd_to_linux_errno_generic[ELAST + 1] = { -72, -67, -71, + -1, /* ENOTCAPABLE -> EPERM */ + -1, /* ECAPMODE -> EPERM */ + -131, /* ENOTRECOVERABLE */ + -130, /* EOWNERDEAD */ }; + +_Static_assert(ELAST == 96, + "missing errno entries in bsd_to_linux_errno_generic"); From owner-svn-src-head@freebsd.org Fri Mar 16 15:15:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34E9BF56489; Fri, 16 Mar 2018 15:15:26 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D91868314D; Fri, 16 Mar 2018 15:15:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D018F258F3; Fri, 16 Mar 2018 15:15:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2GFFP4Q064174; Fri, 16 Mar 2018 15:15:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GFFPdF064173; Fri, 16 Mar 2018 15:15:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803161515.w2GFFPdF064173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 16 Mar 2018 15:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331060 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 331060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 15:15:26 -0000 Author: emaste Date: Fri Mar 16 15:15:25 2018 New Revision: 331060 URL: https://svnweb.freebsd.org/changeset/base/331060 Log: Chase r331057 in libsysdecode erno table Modified: head/lib/libsysdecode/errno.c Modified: head/lib/libsysdecode/errno.c ============================================================================== --- head/lib/libsysdecode/errno.c Fri Mar 16 15:10:13 2018 (r331059) +++ head/lib/libsysdecode/errno.c Fri Mar 16 15:15:25 2018 (r331060) @@ -41,8 +41,8 @@ __FBSDID("$FreeBSD$"); * Linux syscalls return negative errno's, we do positive and map them * Reference: * FreeBSD: src/sys/sys/errno.h - * Linux: linux-2.6.17.8/include/asm-generic/errno-base.h - * linux-2.6.17.8/include/asm-generic/errno.h + * Linux: include/uapi/asm-generic/errno-base.h + * include/uapi/asm-generic/errno.h */ static int bsd_to_linux_errno[ELAST + 1] = { -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, @@ -54,7 +54,7 @@ static int bsd_to_linux_errno[ELAST + 1] = { -110,-111, -40, -36,-112,-113, -39, -11, -87,-122, -116, -66, -6, -6, -6, -6, -6, -37, -38, -9, -6, -6, -43, -42, -75,-125, -84, -61, -16, -74, - -72, -67, -71 + -72, -67, -71, -1, -1, -131, -130 }; #endif From owner-svn-src-head@freebsd.org Fri Mar 16 15:26:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D7D9F5727B; Fri, 16 Mar 2018 15:26:08 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C5AE84A68; Fri, 16 Mar 2018 15:26:08 +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 0561325A95; Fri, 16 Mar 2018 15:26:08 +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 w2GFQ7HW071566; Fri, 16 Mar 2018 15:26:07 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GFQ7gR071565; Fri, 16 Mar 2018 15:26:07 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201803161526.w2GFQ7gR071565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 16 Mar 2018 15:26:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331061 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 331061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 15:26:08 -0000 Author: tuexen Date: Fri Mar 16 15:26:07 2018 New Revision: 331061 URL: https://svnweb.freebsd.org/changeset/base/331061 Log: Set the inp_vflag consistently for accepted TCP/IPv6 connections when net.inet6.ip6.v6only=0. Without this patch, the inp_vflag would have INP_IPV4 and the INP_IPV6 flags for accepted TCP/IPv6 connections if the sysctl variable net.inet6.ip6.v6only is 0. This resulted in netstat to report the source and destination addresses as IPv4 addresses, even they are IPv6 addresses. PR: 226421 Reviewed by: bz, hiren, kib MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D13514 Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Fri Mar 16 15:15:25 2018 (r331060) +++ head/sys/netinet/tcp_syncache.c Fri Mar 16 15:26:07 2018 (r331061) @@ -695,6 +695,8 @@ syncache_socket(struct syncache *sc, struct socket *ls inp->inp_inc.inc_flags = sc->sc_inc.inc_flags; #ifdef INET6 if (sc->sc_inc.inc_flags & INC_ISIPV6) { + inp->inp_vflag &= ~INP_IPV4; + inp->inp_vflag |= INP_IPV6; inp->in6p_laddr = sc->sc_inc.inc6_laddr; } else { inp->inp_vflag &= ~INP_IPV6; From owner-svn-src-head@freebsd.org Fri Mar 16 16:06:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96B22F5A207; Fri, 16 Mar 2018 16:06:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49BD486902; Fri, 16 Mar 2018 16:06:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44AE9260B1; Fri, 16 Mar 2018 16:06:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2GG6QEL091705; Fri, 16 Mar 2018 16:06:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GG6QCJ091704; Fri, 16 Mar 2018 16:06:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803161606.w2GG6QCJ091704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 16 Mar 2018 16:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331063 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 331063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 16:06:26 -0000 Author: ian Date: Fri Mar 16 16:06:25 2018 New Revision: 331063 URL: https://svnweb.freebsd.org/changeset/base/331063 Log: Add the header file needed for the recently-added call to pagedaemon_wakeup(). Modified: head/sys/arm/arm/pmap-v4.c Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Fri Mar 16 16:04:06 2018 (r331062) +++ head/sys/arm/arm/pmap-v4.c Fri Mar 16 16:06:25 2018 (r331063) @@ -168,6 +168,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-head@freebsd.org Fri Mar 16 16:14:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3719F5AC09; Fri, 16 Mar 2018 16:14:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8216F8717D; Fri, 16 Mar 2018 16:14:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f176.google.com with SMTP id e7so2773820iof.2; Fri, 16 Mar 2018 09:14:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Jt98sQBX2I0PDA8TyvsZOVu4EwAmXNqm6709//+n6Ic=; b=E4IdyS31pLrC6UoLeqRaVNfxklP8ITlcSzqt1IQoa7/KSV9Vwd2viA3smb1mWZZ7VF RNlXsvY2gsjOiMJVEfLWVSoqA9MMcS1Zn61WPVRznyqItlyhSBLi0G5BFsrZdnX6twA9 OKWWaK+QQUa0Hyzwg0XPmPsoG7U3CCcoFZLi0+wf4pC4ZzjQ0p9Y6u3CIvw9QTbGsdLp LO5XW75EldPLodiG53XU7jZtI83h/kc7XMHBh1oGSjew0dZSEfeUeygpB3OxiaE5EKDV 7XklxaXnQvmdmd/yzpYusxCYfh7rOwqsCh1K8U/fLcpu0uLIF1F7yXxtAqUOmVOVQBzv hqJw== X-Gm-Message-State: AElRT7HVe15uY9DDk81HvYkUjhCZQkOZSzcXXYBUKx2F+QeyC8qXL0Ex TnovfbKsy/I03HmmXp2HHV2ai50D X-Google-Smtp-Source: AG47ELssIS2ZNGpXDygx5u3vRoV9NXTzWQvPivi69SDAGajcCLjas5EvjfZdt8l9xWJSP/yfRY8QOw== X-Received: by 10.107.36.204 with SMTP id k195mr2408542iok.131.1521216534914; Fri, 16 Mar 2018 09:08:54 -0700 (PDT) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com. [209.85.214.54]) by smtp.gmail.com with ESMTPSA id c101sm2675834ioj.33.2018.03.16.09.08.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Mar 2018 09:08:54 -0700 (PDT) Received: by mail-it0-f54.google.com with SMTP id r10-v6so2407633iti.3; Fri, 16 Mar 2018 09:08:54 -0700 (PDT) X-Received: by 2002:a24:5053:: with SMTP id m80-v6mr2928483itb.58.1521216534632; Fri, 16 Mar 2018 09:08:54 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.153.132 with HTTP; Fri, 16 Mar 2018 09:08:54 -0700 (PDT) In-Reply-To: <201803161606.w2GG6QCJ091704@repo.freebsd.org> References: <201803161606.w2GG6QCJ091704@repo.freebsd.org> From: Conrad Meyer Date: Fri, 16 Mar 2018 09:08:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331063 - head/sys/arm/arm To: Ian Lepore Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 16:14:21 -0000 I probably broke this with r331048 -- sorry. I build-tested amd64 only. Apologies, Conrad On Fri, Mar 16, 2018 at 9:06 AM, Ian Lepore wrote: > Author: ian > Date: Fri Mar 16 16:06:25 2018 > New Revision: 331063 > URL: https://svnweb.freebsd.org/changeset/base/331063 > > Log: > Add the header file needed for the recently-added call to pagedaemon_wakeup(). > > Modified: > head/sys/arm/arm/pmap-v4.c > > Modified: head/sys/arm/arm/pmap-v4.c > ============================================================================== > --- head/sys/arm/arm/pmap-v4.c Fri Mar 16 16:04:06 2018 (r331062) > +++ head/sys/arm/arm/pmap-v4.c Fri Mar 16 16:06:25 2018 (r331063) > @@ -168,6 +168,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > > #include > From owner-svn-src-head@freebsd.org Fri Mar 16 16:23:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A76DCF5B6E2 for ; Fri, 16 Mar 2018 16:23:27 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3542A8797A for ; Fri, 16 Mar 2018 16:23:27 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 59e17a8f-2936-11e8-91c6-33ffc249f3e8 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 outbound1.eu.mailhop.org (Halon) with ESMTPSA id 59e17a8f-2936-11e8-91c6-33ffc249f3e8; Fri, 16 Mar 2018 16:23:26 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w2GGNK8T029045; Fri, 16 Mar 2018 10:23:20 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1521217400.99081.57.camel@freebsd.org> Subject: Re: svn commit: r331063 - head/sys/arm/arm From: Ian Lepore To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 16 Mar 2018 10:23:20 -0600 In-Reply-To: References: <201803161606.w2GG6QCJ091704@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 16:23:27 -0000 On Fri, 2018-03-16 at 09:08 -0700, Conrad Meyer wrote: > I probably broke this with r331048 -- sorry.  I build-tested amd64 > only. > > Apologies, > Conrad > No big deal.  It was apparently the only arch missing the file; I was running a lintkernels build and this is the only one that failed. -- Ian > On Fri, Mar 16, 2018 at 9:06 AM, Ian Lepore wrote: > > > > Author: ian > > Date: Fri Mar 16 16:06:25 2018 > > New Revision: 331063 > > URL: https://svnweb.freebsd.org/changeset/base/331063 From owner-svn-src-head@freebsd.org Fri Mar 16 16:56:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB1A2F5DBC5; Fri, 16 Mar 2018 16:56:57 +0000 (UTC) (envelope-from krion@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E866694DA; Fri, 16 Mar 2018 16:56:57 +0000 (UTC) (envelope-from krion@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 468D026833; Fri, 16 Mar 2018 16:56:57 +0000 (UTC) (envelope-from krion@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2GGuv3M016659; Fri, 16 Mar 2018 16:56:57 GMT (envelope-from krion@FreeBSD.org) Received: (from krion@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GGuvOv016658; Fri, 16 Mar 2018 16:56:57 GMT (envelope-from krion@FreeBSD.org) Message-Id: <201803161656.w2GGuvOv016658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: krion set sender to krion@FreeBSD.org using -f From: Kirill Ponomarev Date: Fri, 16 Mar 2018 16:56:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331064 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: krion X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 331064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 16:56:57 -0000 Author: krion (ports committer) Date: Fri Mar 16 16:56:56 2018 New Revision: 331064 URL: https://svnweb.freebsd.org/changeset/base/331064 Log: Extend SSID maximum string length to 32 chars to support longer SSID names. Approved by: adrian Differential Revision: https://reviews.freebsd.org/D14710 Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Fri Mar 16 16:06:25 2018 (r331063) +++ head/sbin/ifconfig/ifieee80211.c Fri Mar 16 16:56:56 2018 (r331064) @@ -3503,7 +3503,7 @@ list_scan(int s) getchaninfo(s); - ssidmax = verbose ? IEEE80211_NWID_LEN : 14; + ssidmax = verbose ? IEEE80211_NWID_LEN : 32; printf("%-*.*s %-17.17s %4s %4s %-7s %3s %4s\n" , ssidmax, ssidmax, "SSID/MESH ID" , "BSSID" From owner-svn-src-head@freebsd.org Fri Mar 16 17:29:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAC0FF5FF74; Fri, 16 Mar 2018 17:29:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 396FA6AB83; Fri, 16 Mar 2018 17:29:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 0D32942D1F1; Sat, 17 Mar 2018 04:29:21 +1100 (AEDT) Date: Sat, 17 Mar 2018 04:29:20 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331063 - head/sys/arm/arm In-Reply-To: <201803161606.w2GG6QCJ091704@repo.freebsd.org> Message-ID: <20180317041629.Y23257@besplex.bde.org> References: <201803161606.w2GG6QCJ091704@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=s2U_WbHignoRvRs-tPAA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 17:29:23 -0000 On Fri, 16 Mar 2018, Ian Lepore wrote: > Log: > Add the header file needed for the recently-added call to pagedaemon_wakeup(). > > Modified: > head/sys/arm/arm/pmap-v4.c > > Modified: head/sys/arm/arm/pmap-v4.c > ============================================================================== > --- head/sys/arm/arm/pmap-v4.c Fri Mar 16 16:04:06 2018 (r331062) > +++ head/sys/arm/arm/pmap-v4.c Fri Mar 16 16:06:25 2018 (r331063) > @@ -168,6 +168,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > > #include It used to be in the correct header (vm/vm_pageout.h). Another bug in this function is its name. It is missing a vm_ prefix. It was the only name in vm_pageout.h with this bug (macros there have a prefix of VM_; variables and functions have a prefix of vm_). vm_pagequeue.h was almost as clean. It is now polluted by: - nested include of sys/pidcontrol.h - prototype for this function - call to this function. Bruce From owner-svn-src-head@freebsd.org Fri Mar 16 17:50:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1431F61477; Fri, 16 Mar 2018 17:50:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F3536BD2B; Fri, 16 Mar 2018 17:50:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A02726FBB; Fri, 16 Mar 2018 17:50:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2GHoinO042216; Fri, 16 Mar 2018 17:50:44 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GHoiwb042214; Fri, 16 Mar 2018 17:50:44 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201803161750.w2GHoiwb042214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Mar 2018 17:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331065 - in head/contrib/llvm/lib: Analysis IR X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/contrib/llvm/lib: Analysis IR X-SVN-Commit-Revision: 331065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 17:50:45 -0000 Author: dim Date: Fri Mar 16 17:50:44 2018 New Revision: 331065 URL: https://svnweb.freebsd.org/changeset/base/331065 Log: Pull in r327638 from upstream llvm trunk (by Matthew Simpson): [ConstantFolding, InstSimplify] Handle more vector GEPs This patch addresses some additional cases where the compiler crashes upon encountering vector GEPs. This should fix PR36116. Differential Revision: https://reviews.llvm.org/D44219 Reference: https://bugs.llvm.org/show_bug.cgi?id=36116 This fixes an assertion when building the emulators/snes9x port. Reported by: jbeich PR: 225471 MFC after: 3 months X-MFC-With: r327952 Modified: head/contrib/llvm/lib/Analysis/InstructionSimplify.cpp head/contrib/llvm/lib/IR/ConstantFold.cpp Modified: head/contrib/llvm/lib/Analysis/InstructionSimplify.cpp ============================================================================== --- head/contrib/llvm/lib/Analysis/InstructionSimplify.cpp Fri Mar 16 16:56:56 2018 (r331064) +++ head/contrib/llvm/lib/Analysis/InstructionSimplify.cpp Fri Mar 16 17:50:44 2018 (r331065) @@ -3697,7 +3697,7 @@ static Value *SimplifyGEPInst(Type *SrcTy, ArrayRef P. - if (match(Ops[1], m_Zero())) + if (match(Ops[1], m_Zero()) && Ops[0]->getType() == GEPTy) return Ops[0]; Type *Ty = SrcTy; @@ -3706,7 +3706,7 @@ static Value *SimplifyGEPInst(Type *SrcTy, ArrayRef P if P points to a type of zero size. - if (TyAllocSize == 0) + if (TyAllocSize == 0 && Ops[0]->getType() == GEPTy) return Ops[0]; // The following transforms are only safe if the ptrtoint cast Modified: head/contrib/llvm/lib/IR/ConstantFold.cpp ============================================================================== --- head/contrib/llvm/lib/IR/ConstantFold.cpp Fri Mar 16 16:56:56 2018 (r331064) +++ head/contrib/llvm/lib/IR/ConstantFold.cpp Fri Mar 16 17:50:44 2018 (r331065) @@ -2018,8 +2018,16 @@ static bool isInBoundsIndices(ArrayRef Idxs) // If the first index is one and all the rest are zero, it's in bounds, // by the one-past-the-end rule. - if (!cast(Idxs[0])->isOne()) - return false; + if (auto *CI = dyn_cast(Idxs[0])) { + if (!CI->isOne()) + return false; + } else { + auto *CV = cast(Idxs[0]); + CI = dyn_cast_or_null(CV->getSplatValue()); + if (!CI || !CI->isOne()) + return false; + } + for (unsigned i = 1, e = Idxs.size(); i != e; ++i) if (!cast(Idxs[i])->isNullValue()) return false; @@ -2049,15 +2057,18 @@ Constant *llvm::ConstantFoldGetElementPtr(Type *Pointe ArrayRef Idxs) { if (Idxs.empty()) return C; - if (isa(C)) { - Type *GEPTy = GetElementPtrInst::getGEPReturnType( - C, makeArrayRef((Value * const *)Idxs.data(), Idxs.size())); + Type *GEPTy = GetElementPtrInst::getGEPReturnType( + C, makeArrayRef((Value *const *)Idxs.data(), Idxs.size())); + + if (isa(C)) return UndefValue::get(GEPTy); - } Constant *Idx0 = cast(Idxs[0]); if (Idxs.size() == 1 && (Idx0->isNullValue() || isa(Idx0))) - return C; + return GEPTy->isVectorTy() && !C->getType()->isVectorTy() + ? ConstantVector::getSplat( + cast(GEPTy)->getNumElements(), C) + : C; if (C->isNullValue()) { bool isNull = true; From owner-svn-src-head@freebsd.org Fri Mar 16 18:04:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68405F62295; Fri, 16 Mar 2018 18:04:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B00A6C72D; Fri, 16 Mar 2018 18:04:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15F15272B3; Fri, 16 Mar 2018 18:04:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2GI4D8S052405; Fri, 16 Mar 2018 18:04:13 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GI4Di5052404; Fri, 16 Mar 2018 18:04:13 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201803161804.w2GI4Di5052404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 16 Mar 2018 18:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331066 - head/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Commit-Revision: 331066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 18:04:14 -0000 Author: dim Date: Fri Mar 16 18:04:13 2018 New Revision: 331066 URL: https://svnweb.freebsd.org/changeset/base/331066 Log: Pull in r321999 from upstream clang trunk (by Ivan A. Kosarev): [CodeGen] Fix TBAA info for accesses to members of base classes Resolves: Bug 35724 - regression (r315984): fatal error: error in backend: Broken function found (Did not see access type in access path!) https://bugs.llvm.org/show_bug.cgi?id=35724 Differential Revision: https://reviews.llvm.org/D41547 This fixes "Did not see access type in access path" fatal errors when building the devel/gdb port (version 8.1). Reported by: jbeich PR: 226658 MFC after: 3 months X-MFC-With: r327952 Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp Fri Mar 16 17:50:44 2018 (r331065) +++ head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp Fri Mar 16 18:04:13 2018 (r331066) @@ -1034,8 +1034,12 @@ Address CodeGenFunction::EmitPointerWithAlignment(cons // Derived-to-base conversions. case CK_UncheckedDerivedToBase: case CK_DerivedToBase: { - Address Addr = EmitPointerWithAlignment(CE->getSubExpr(), BaseInfo, - TBAAInfo); + // TODO: Support accesses to members of base classes in TBAA. For now, we + // conservatively pretend that the complete object is of the base class + // type. + if (TBAAInfo) + *TBAAInfo = CGM.getTBAAAccessInfo(E->getType()); + Address Addr = EmitPointerWithAlignment(CE->getSubExpr(), BaseInfo); auto Derived = CE->getSubExpr()->getType()->getPointeeCXXRecordDecl(); return GetAddressOfBaseClass(Addr, Derived, CE->path_begin(), CE->path_end(), From owner-svn-src-head@freebsd.org Fri Mar 16 18:12:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABD93F62D42; Fri, 16 Mar 2018 18:12:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EE9E6D1B0; Fri, 16 Mar 2018 18:12:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59DAF2742C; Fri, 16 Mar 2018 18:12:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2GICoFf057286; Fri, 16 Mar 2018 18:12:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GICoYV057285; Fri, 16 Mar 2018 18:12:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803161812.w2GICoYV057285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 16 Mar 2018 18:12:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331067 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 331067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 18:12:50 -0000 Author: imp Date: Fri Mar 16 18:12:50 2018 New Revision: 331067 URL: https://svnweb.freebsd.org/changeset/base/331067 Log: Only print boot order / boot current if we can get the variables from the loader. Some UEFI implementations don't return all of them. Sponsored by: Netflix Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Fri Mar 16 18:04:13 2018 (r331066) +++ head/stand/efi/boot1/boot1.c Fri Mar 16 18:12:50 2018 (r331067) @@ -467,16 +467,18 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) boot_current = 0; sz = sizeof(boot_current); - efi_global_getenv("BootCurrent", &boot_current, &sz); - printf(" BootCurrent: %04x\n", boot_current); + if (efi_global_getenv("BootCurrent", &boot_current, &sz) == EFI_SUCCESS) { + printf(" BootCurrent: %04x\n", boot_current); - sz = sizeof(boot_order); - efi_global_getenv("BootOrder", &boot_order, &sz); - printf(" BootOrder:"); - for (i = 0; i < sz / sizeof(boot_order[0]); i++) - printf(" %04x%s", boot_order[i], - boot_order[i] == boot_current ? "[*]" : ""); - printf("\n"); + sz = sizeof(boot_order); + if (efi_global_getenv("BootOrder", &boot_order, &sz) == EFI_SUCCESS) { + printf(" BootOrder:"); + for (i = 0; i < sz / sizeof(boot_order[0]); i++) + printf(" %04x%s", boot_order[i], + boot_order[i] == boot_current ? "[*]" : ""); + printf("\n"); + } + } #ifdef TEST_FAILURE /* From owner-svn-src-head@freebsd.org Fri Mar 16 18:16:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E969EF63191; Fri, 16 Mar 2018 18:16:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 958FC6D6AE; Fri, 16 Mar 2018 18:16:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9067827435; Fri, 16 Mar 2018 18:16:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2GIGRPQ057464; Fri, 16 Mar 2018 18:16:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GIGR3h057463; Fri, 16 Mar 2018 18:16:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803161816.w2GIGR3h057463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 16 Mar 2018 18:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331068 - head/sys/dev/efidev X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/efidev X-SVN-Commit-Revision: 331068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 18:16:28 -0000 Author: ian Date: Fri Mar 16 18:16:27 2018 New Revision: 331068 URL: https://svnweb.freebsd.org/changeset/base/331068 Log: Use EFI RTC capabilities info when registering, add bootverbose diagnostics. Make some small improvements to the efirtc driver by obtaining the clock capabilities (resolution and whether the sub-second counters are reset) and using the info when registering the clock. When the hardware zeroes out the subsecond info on clock-set, schedule clock updates to happen just before top-of-second, so that the RTC time is closely in-sync with kernel time. Also, in the identify() routine, always add the driver if EFI runtime services are available, then decide in probe() whether to attach the driver or not. If not attaching and bootverbose is on, say why. All of this is basically to avoid "silent failure" -- if someone thinks there should be an efi rtc and it's not attaching, at least they can set bootverbose and maybe get a clue from the output. Differential Revision: https://reviews.freebsd.org/D14565 (timed out) Modified: head/sys/dev/efidev/efirtc.c Modified: head/sys/dev/efidev/efirtc.c ============================================================================== --- head/sys/dev/efidev/efirtc.c Fri Mar 16 18:12:50 2018 (r331067) +++ head/sys/dev/efidev/efirtc.c Fri Mar 16 18:16:27 2018 (r331068) @@ -41,21 +41,20 @@ __FBSDID("$FreeBSD$"); #include "clock_if.h" +static bool efirtc_zeroes_subseconds; +static struct timespec efirtc_resadj; + +static const u_int us_per_s = 1000000; +static const u_int ns_per_s = 1000000000; +static const u_int ns_per_us = 1000; + static void efirtc_identify(driver_t *driver, device_t parent) { - struct efi_tm tm; - int error; - /* - * Check if we can read the time. This will stop us attaching when - * there is no EFI Runtime support, or the gettime function is - * unimplemented, e.g. on some builds of U-Boot. - */ - error = efi_get_time(&tm); - if (error != 0) + /* Don't add the driver unless we have working runtime services. */ + if (efi_rt_ok() != 0) return; - if (device_find_child(parent, "efirtc", -1) != NULL) return; if (BUS_ADD_CHILD(parent, 0, "efirtc", -1) == NULL) @@ -65,16 +64,58 @@ efirtc_identify(driver_t *driver, device_t parent) static int efirtc_probe(device_t dev) { + struct efi_tm tm; + int error; - device_quiet(dev); - return (0); + /* + * Check whether we can read the time. This will stop us from attaching + * when there is EFI Runtime support but the gettime function is + * unimplemented, e.g. on some builds of U-Boot. + */ + if ((error = efi_get_time(&tm)) != 0) { + if (bootverbose) + device_printf(dev, "cannot read EFI realtime clock\n"); + return (error); + } + device_set_desc(dev, "EFI Realtime Clock"); + return (BUS_PROBE_DEFAULT); } static int efirtc_attach(device_t dev) { + struct efi_tmcap tmcap; + long res; + int error; - clock_register(dev, 1000000); + bzero(&tmcap, sizeof(tmcap)); + if ((error = efi_get_time_capabilities(&tmcap)) != 0) { + device_printf(dev, "cannot get EFI time capabilities"); + return (error); + } + + /* Translate resolution in Hz to tick length in usec. */ + if (tmcap.tc_res == 0) + res = us_per_s; /* 0 is insane, assume 1 Hz. */ + else if (tmcap.tc_res > us_per_s) + res = 1; /* 1us is the best we can represent */ + else + res = us_per_s / tmcap.tc_res; + + /* Clock rounding adjustment is 1/2 of resolution, in nsec. */ + efirtc_resadj.tv_nsec = (res * ns_per_us) / 2; + + /* Does the clock zero the subseconds when time is set? */ + efirtc_zeroes_subseconds = tmcap.tc_stz; + + /* + * Register. If the clock zeroes out the subseconds when it's set, + * schedule the SetTime calls to happen just before top-of-second. + */ + clock_register_flags(dev, res, CLOCKF_SETTIME_NO_ADJ); + if (efirtc_zeroes_subseconds) + clock_schedule(dev, ns_per_s - ns_per_us); + return (0); } @@ -105,6 +146,7 @@ efirtc_gettime(device_t dev, struct timespec *ts) ct.year = tm.tm_year; ct.nsec = tm.tm_nsec; + clock_dbgprint_ct(dev, CLOCK_DBG_READ, &ct); return (clock_ct_to_ts(&ct, ts)); } @@ -114,7 +156,17 @@ efirtc_settime(device_t dev, struct timespec *ts) struct clocktime ct; struct efi_tm tm; + /* + * We request a timespec with no resolution-adjustment so that we can + * apply it ourselves based on whether or not the clock zeroes the + * sub-second part of the time when setting the time. + */ + ts->tv_sec -= utc_offset(); + if (!efirtc_zeroes_subseconds) + timespecadd(ts, &efirtc_resadj); + clock_ts_to_ct(ts, &ct); + clock_dbgprint_ct(dev, CLOCK_DBG_WRITE, &ct); bzero(&tm, sizeof(tm)); tm.tm_sec = ct.sec; From owner-svn-src-head@freebsd.org Fri Mar 16 18:16:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD909F631CC; Fri, 16 Mar 2018 18:16:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CA2B6D763; Fri, 16 Mar 2018 18:16:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F3A827436; Fri, 16 Mar 2018 18:16:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2GIGVjw057514; Fri, 16 Mar 2018 18:16:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GIGVgs057513; Fri, 16 Mar 2018 18:16:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803161816.w2GIGVgs057513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 16 Mar 2018 18:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331069 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 331069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 18:16:34 -0000 Author: imp Date: Fri Mar 16 18:16:31 2018 New Revision: 331069 URL: https://svnweb.freebsd.org/changeset/base/331069 Log: Make not getting BootOrder a warning, not a fatal error when printing. Sponsored by: Netflix Modified: head/usr.sbin/efibootmgr/efibootmgr.c Modified: head/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.c Fri Mar 16 18:16:27 2018 (r331068) +++ head/usr.sbin/efibootmgr/efibootmgr.c Fri Mar 16 18:16:31 2018 (r331069) @@ -285,8 +285,10 @@ print_order(void) uint8_t *data; size_t size, i; - if (efi_get_variable(EFI_GLOBAL_GUID, "BootOrder", &data, &size, &attrs) < 0) - errx(1, "Couldn't get value for BootOrder\n"); + if (efi_get_variable(EFI_GLOBAL_GUID, "BootOrder", &data, &size, &attrs) < 0) { + printf("BootOrder : Couldn't get value for BootOrder\n"); + return; + } if (size % 2 == 1) errx(1, "Bad BootOrder variable: odd length"); From owner-svn-src-head@freebsd.org Fri Mar 16 18:50:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6303B9; Fri, 16 Mar 2018 18:50:27 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A2596EB99; Fri, 16 Mar 2018 18:50:27 +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 3AF2A278D9; Fri, 16 Mar 2018 18:50:27 +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 w2GIoRak072912; Fri, 16 Mar 2018 18:50:27 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GIoRoE072911; Fri, 16 Mar 2018 18:50:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803161850.w2GIoRoE072911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 16 Mar 2018 18:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331070 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 331070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 18:50:27 -0000 Author: cem Date: Fri Mar 16 18:50:26 2018 New Revision: 331070 URL: https://svnweb.freebsd.org/changeset/base/331070 Log: random(4): Poll for signals during large reads Occasionally poll for signals during large reads of the /dev/u?random devices. This allows cancellation via SIGINT of accidental invocations of very large reads. (A 2GB /dev/random read, which takes about 10 seconds on my 2017 AMD Zen processor, can be aborted.) I believe this behavior was intended since 2014 (r273997), just not fully implemented. This is motivated by a potential getrandom(2) interface that may not explicitly forbid extremely large reads on 64-bit platforms -- even larger than the 2GB limit imposed on devfs I/O by default. Such reads, if they are to be allowed, should be cancellable by the user or administrator. Reviewed by: delphij Approved by: secteam (delphij) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D14684 Modified: head/sys/dev/random/randomdev.c Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Fri Mar 16 18:16:31 2018 (r331069) +++ head/sys/dev/random/randomdev.c Fri Mar 16 18:50:26 2018 (r331070) @@ -130,7 +130,13 @@ READ_RANDOM_UIO(struct uio *uio, bool nonblock) uint8_t *random_buf; int error, spamcount; ssize_t read_len, total_read, c; + /* 16 MiB takes about 0.08 s CPU time on my 2017 AMD Zen CPU */ +#define SIGCHK_PERIOD (16 * 1024 * 1024) + const size_t sigchk_period = SIGCHK_PERIOD; + CTASSERT(SIGCHK_PERIOD % PAGE_SIZE == 0); +#undef SIGCHK_PERIOD + random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); p_random_alg_context->ra_pre_read(); error = 0; @@ -167,11 +173,22 @@ READ_RANDOM_UIO(struct uio *uio, bool nonblock) read_len = MIN(read_len, PAGE_SIZE); p_random_alg_context->ra_read(random_buf, read_len); c = MIN(uio->uio_resid, read_len); + /* + * uiomove() may yield the CPU before each 'c' bytes + * (up to PAGE_SIZE) are copied out. + */ error = uiomove(random_buf, c, uio); total_read += c; + /* + * Poll for signals every few MBs to avoid very long + * uninterruptible syscalls. + */ + if (error == 0 && uio->uio_resid != 0 && + total_read % sigchk_period == 0) + error = tsleep_sbt(&random_alg_context, PCATCH, + "randrd", SBT_1NS, 0, C_HARDCLOCK); } - if (total_read != uio->uio_resid && (error == ERESTART || error == EINTR)) - /* Return partial read, not error. */ + if (error == ERESTART || error == EINTR) error = 0; } free(random_buf, M_ENTROPY); From owner-svn-src-head@freebsd.org Fri Mar 16 20:43:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CD21F4C186; Fri, 16 Mar 2018 20:43:41 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E75BB736B2; Fri, 16 Mar 2018 20:43:40 +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 E2424B72; Fri, 16 Mar 2018 20:43:40 +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 w2GKhel2032655; Fri, 16 Mar 2018 20:43:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GKheIG032654; Fri, 16 Mar 2018 20:43:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803162043.w2GKheIG032654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 16 Mar 2018 20:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331073 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 331073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 20:43:41 -0000 Author: cem Date: Fri Mar 16 20:43:40 2018 New Revision: 331073 URL: https://svnweb.freebsd.org/changeset/base/331073 Log: libdtrace: Eliminate a minor UB by fully initializing parameter struct The dtt_flags value is dereferenced by dt_type_pointer() and must be initialized first. Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Fri Mar 16 20:04:52 2018 (r331072) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Fri Mar 16 20:43:40 2018 (r331073) @@ -3069,9 +3069,10 @@ dt_cook_op1(dt_node_t *dnp, uint_t idflags) "cannot take address of bit-field\n"); } - dtt.dtt_object = NULL; - dtt.dtt_ctfp = cp->dn_ctfp; - dtt.dtt_type = cp->dn_type; + dtt = (dtrace_typeinfo_t){ + .dtt_ctfp = cp->dn_ctfp, + .dtt_type = cp->dn_type, + }; if (dt_type_pointer(&dtt) == -1) { xyerror(D_TYPE_ERR, "cannot find type for \"&\": %s*\n", From owner-svn-src-head@freebsd.org Fri Mar 16 20:59:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22DF8F4D2E1; Fri, 16 Mar 2018 20:59:57 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF524740BA; Fri, 16 Mar 2018 20:59:56 +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 B6165CF4; Fri, 16 Mar 2018 20:59:56 +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 w2GKxuQh037884; Fri, 16 Mar 2018 20:59:56 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GKxup1037883; Fri, 16 Mar 2018 20:59:56 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803162059.w2GKxup1037883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 16 Mar 2018 20:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331074 - head/contrib/telnet/telnetd X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/contrib/telnet/telnetd X-SVN-Commit-Revision: 331074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 20:59:57 -0000 Author: cem Date: Fri Mar 16 20:59:56 2018 New Revision: 331074 URL: https://svnweb.freebsd.org/changeset/base/331074 Log: telnetd(8): Fix dereference of uninitialized value 'IF' Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/contrib/telnet/telnetd/telnetd.c Modified: head/contrib/telnet/telnetd/telnetd.c ============================================================================== --- head/contrib/telnet/telnetd/telnetd.c Fri Mar 16 20:43:40 2018 (r331073) +++ head/contrib/telnet/telnetd/telnetd.c Fri Mar 16 20:59:56 2018 (r331074) @@ -925,7 +925,7 @@ telnet(int f, int p, char *host) edithost(HE, host_name); if (hostinfo && *IM) putf(IM, ptyibuf2); - if (IF && if_fd != -1) { + if (if_fd != -1) { if (fstat(if_fd, &statbuf) != -1 && statbuf.st_size > 0) { if_buf = (char *) mmap (0, statbuf.st_size, PROT_READ, 0, if_fd, 0); From owner-svn-src-head@freebsd.org Fri Mar 16 21:03:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B05CDF4D862; Fri, 16 Mar 2018 21:03:54 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CDCF74748; Fri, 16 Mar 2018 21:03:54 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57D71E6E; Fri, 16 Mar 2018 21:03:54 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2GL3s8v042720; Fri, 16 Mar 2018 21:03:54 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GL3sfV042719; Fri, 16 Mar 2018 21:03:54 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201803162103.w2GL3sfV042719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 16 Mar 2018 21:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331075 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 331075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 21:03:54 -0000 Author: dteske Date: Fri Mar 16 21:03:54 2018 New Revision: 331075 URL: https://svnweb.freebsd.org/changeset/base/331075 Log: Add myself to committers-ports.dot Reviewed by: imp Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D14688 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Fri Mar 16 20:59:56 2018 (r331074) +++ head/share/misc/committers-ports.dot Fri Mar 16 21:03:54 2018 (r331075) @@ -93,6 +93,7 @@ delphij [label="Xin Li\ndelphij@FreeBSD.org\n2006/05/0 demon [label="Dmitry Sivachenko\ndemon@FreeBSD.org\n2000/11/13"] dhn [label="Dennis Herrmann\ndhn@FreeBSD.org\n2009/03/03"] dryice [label="Dryice Dong Liu\ndryice@FreeBSD.org\n2006/12/25"] +dteske [label="Devin Teske\ndteske@FreeBSD.org\n2018/03/01"] dumbbell [label="Jean-Sebastien Pedron\ndumbbell@FreeBSD.org\n2017/01/10"] dvl [label="Dan Langille\ndvl@FreeBSD.org\n2014/08/10"] eadler [label="Eitan Adler\neadler@FreeBSD.org\n2011/08/17"] @@ -433,6 +434,8 @@ glewis -> jkim ijliao -> leeym +imp -> dteske + itetcu -> ak itetcu -> araujo itetcu -> dryice @@ -507,6 +510,7 @@ makc -> jhale makc -> rakuco mat -> bmah +mat -> dteske mat -> dvl mat -> gordon mat -> mmokhi From owner-svn-src-head@freebsd.org Fri Mar 16 21:10:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D58DCF4E087; Fri, 16 Mar 2018 21:10:36 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8351975053; Fri, 16 Mar 2018 21:10:36 +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 7E5C0E8A; Fri, 16 Mar 2018 21:10:36 +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 w2GLAaVk043861; Fri, 16 Mar 2018 21:10:36 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GLAa4j043860; Fri, 16 Mar 2018 21:10:36 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803162110.w2GLAa4j043860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 16 Mar 2018 21:10:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331076 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 331076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 21:10:37 -0000 Author: cem Date: Fri Mar 16 21:10:36 2018 New Revision: 331076 URL: https://svnweb.freebsd.org/changeset/base/331076 Log: libdtrace: Fix another uninitialized dtt_flags UB Like r331073, eliminate a UB by fully initializing the struct with a designated initializer. Note that the similar src_dtt is not fully used, so a similar treatment was not absolutely required. I chose to leave it alone. It wouldn't hurt to do the same thing, though. Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_xlator.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_xlator.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_xlator.c Fri Mar 16 21:03:54 2018 (r331075) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_xlator.c Fri Mar 16 21:10:36 2018 (r331076) @@ -343,9 +343,11 @@ out: src_dtt.dtt_ctfp = src_ctfp; src_dtt.dtt_type = src_type; - dst_dtt.dtt_object = dt_module_lookup_by_ctf(dtp, dst_ctfp)->dm_name; - dst_dtt.dtt_ctfp = dst_ctfp; - dst_dtt.dtt_type = dst_type; + dst_dtt = (dtrace_typeinfo_t){ + .dtt_object = dt_module_lookup_by_ctf(dtp, dst_ctfp)->dm_name, + .dtt_ctfp = dst_ctfp, + .dtt_type = dst_type, + }; return (dt_xlator_create(dtp, &src_dtt, &dst_dtt, NULL, NULL, NULL)); } From owner-svn-src-head@freebsd.org Fri Mar 16 22:23:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E580F52818; Fri, 16 Mar 2018 22:23:05 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D32977EF5; Fri, 16 Mar 2018 22:23: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 17CE41A97; Fri, 16 Mar 2018 22:23: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 w2GMN4dU083690; Fri, 16 Mar 2018 22:23:04 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GMN4np083689; Fri, 16 Mar 2018 22:23:04 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803162223.w2GMN4np083689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 16 Mar 2018 22:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331077 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 331077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 22:23:05 -0000 Author: brooks Date: Fri Mar 16 22:23:04 2018 New Revision: 331077 URL: https://svnweb.freebsd.org/changeset/base/331077 Log: Add _IOC_NEWLEN() and _IOC_NEWTYPE() macros. These macros take an existing ioctl(2) command and replace the length with the specified length or length of the specified type respectively. These can be used to define commands for 32-bit compatibility with fewer opportunities for cut-and-paste errors then a whole new definition. Reviewed by: cem, kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14706 Modified: head/sys/sys/ioccom.h Modified: head/sys/sys/ioccom.h ============================================================================== --- head/sys/sys/ioccom.h Fri Mar 16 21:10:36 2018 (r331076) +++ head/sys/sys/ioccom.h Fri Mar 16 22:23:04 2018 (r331077) @@ -61,6 +61,10 @@ #define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t)) /* this should be _IORW, but stdio got there first */ #define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t)) +/* Replace length/type in an ioctl command. */ +#define _IOC_NEWLEN(ioc, len) \ + (((~(IOCPARM_MASK << 16)) & (ioc)) | (((len) & IOCPARM_MASK) << 16)) +#define _IOC_NEWTYPE(ioc, type) _IOC_NEWLEN((ioc), sizeof(type)) #ifdef _KERNEL From owner-svn-src-head@freebsd.org Fri Mar 16 22:25:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80C67F52A21; Fri, 16 Mar 2018 22:25:34 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E6D2780D9; Fri, 16 Mar 2018 22:25:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2905F1AA2; Fri, 16 Mar 2018 22:25:34 +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 w2GMPXI2083815; Fri, 16 Mar 2018 22:25:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GMPXWV083814; Fri, 16 Mar 2018 22:25:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803162225.w2GMPXWV083814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 16 Mar 2018 22:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331078 - head/contrib/elftoolchain/nm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/contrib/elftoolchain/nm X-SVN-Commit-Revision: 331078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 22:25:34 -0000 Author: cem Date: Fri Mar 16 22:25:33 2018 New Revision: 331078 URL: https://svnweb.freebsd.org/changeset/base/331078 Log: elftoolchain nm(1): Initialize allocated memory before use In out of memory scenarios (where one of these allocations failed but other(s) did not), nm(1) could reference the uninitialized value of these allocations (undefined behavior). Always initialize any successful allocations as the most expedient resolution of the issue. However, I would encourage upstream elftoolchain contributors to clean up the error path to just abort immediately, rather than proceeding sloppily when one allocation fails. Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/contrib/elftoolchain/nm/nm.c Modified: head/contrib/elftoolchain/nm/nm.c ============================================================================== --- head/contrib/elftoolchain/nm/nm.c Fri Mar 16 22:23:04 2018 (r331077) +++ head/contrib/elftoolchain/nm/nm.c Fri Mar 16 22:25:33 2018 (r331078) @@ -1310,14 +1310,17 @@ read_elf(Elf *elf, const char *filename, Elf_Kind kind line_info = malloc(sizeof(struct line_info_head)); func_info = malloc(sizeof(struct func_info_head)); var_info = malloc(sizeof(struct var_info_head)); + if (line_info != NULL) + SLIST_INIT(line_info); + if (func_info != NULL) + SLIST_INIT(func_info); + if (var_info != NULL) + SLIST_INIT(var_info); if (line_info == NULL || func_info == NULL || var_info == NULL) { warn("malloc"); (void) dwarf_finish(dbg, &de); goto process_sym; } - SLIST_INIT(line_info); - SLIST_INIT(func_info); - SLIST_INIT(var_info); while ((ret = dwarf_next_cu_header(dbg, NULL, NULL, NULL, NULL, NULL, &de)) == DW_DLV_OK) { From owner-svn-src-head@freebsd.org Fri Mar 16 23:54:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D5C7F58118; Fri, 16 Mar 2018 23:54:52 +0000 (UTC) (envelope-from srs0=0tss=gg=sigsegv.be=kristof@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB2397B26E; Fri, 16 Mar 2018 23:54:51 +0000 (UTC) (envelope-from srs0=0tss=gg=sigsegv.be=kristof@codepro.be) Received: from [10.0.2.164] (ptr-8ripyyhkqcx2a97vzlt.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:2419:4e02:d0f6:472b:f1e:1101]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 7E8712704D; Sat, 17 Mar 2018 00:54:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sigsegv.be; s=mail; t=1521244489; bh=wlw7Sll/wYwSzOPzvd0/Mtcg+lUBp2GhcNU1lQ/22R4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jp4TBGl+jUOyZM4E1rXlcuPmcj7ddwjZIdjZFxnEr28XqsxXqNOCTJOGD4A2XCmXB wq2YFdrYdUc6ZOi2r0326RQaccrNZFjhJfGNpEHTHlJtsDnXv8MpmJ1R8JDZt0Zgpp dW34mwRgKewquadzrTh96p8TBUXr5MqVXmJpuevU= From: "Kristof Provost" To: "Kirill Ponomarev" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331064 - head/sbin/ifconfig Date: Sat, 17 Mar 2018 00:54:46 +0100 X-Mailer: MailMate (2.0BETAr6106) Message-ID: <90FB9B8F-DF2E-49E5-BD86-197CE3B312A4@sigsegv.be> In-Reply-To: <201803161656.w2GGuvOv016658@repo.freebsd.org> References: <201803161656.w2GGuvOv016658@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 23:54:52 -0000 On 16 Mar 2018, at 17:56, Kirill Ponomarev wrote: > Author: krion (ports committer) > Date: Fri Mar 16 16:56:56 2018 > New Revision: 331064 > URL: https://svnweb.freebsd.org/changeset/base/331064 > > Log: > Extend SSID maximum string length to 32 chars to support longer SSID > names. > > Approved by: adrian > Differential Revision: https://reviews.freebsd.org/D14710 > > Modified: > head/sbin/ifconfig/ifieee80211.c > > Modified: head/sbin/ifconfig/ifieee80211.c > ============================================================================== > --- head/sbin/ifconfig/ifieee80211.c Fri Mar 16 16:06:25 > 2018 (r331063) > +++ head/sbin/ifconfig/ifieee80211.c Fri Mar 16 16:56:56 > 2018 (r331064) > @@ -3503,7 +3503,7 @@ list_scan(int s) > > getchaninfo(s); > > - ssidmax = verbose ? IEEE80211_NWID_LEN : 14; > + ssidmax = verbose ? IEEE80211_NWID_LEN : 32; IEEE80211_NWID_LEN is 32, so this says ‘verbose ? 32 : 32’ now. > printf("%-*.*s %-17.17s %4s %4s %-7s %3s %4s\n" > , ssidmax, ssidmax, "SSID/MESH ID" > , "BSSID" Regards, Kristof From owner-svn-src-head@freebsd.org Sat Mar 17 01:40:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63C7EF5EDBB; Sat, 17 Mar 2018 01:40:10 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DDB67EBB3; Sat, 17 Mar 2018 01:40:10 +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 056313BF0; Sat, 17 Mar 2018 01:40:10 +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 w2H1e9Re078194; Sat, 17 Mar 2018 01:40:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2H1e9ci078192; Sat, 17 Mar 2018 01:40:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803170140.w2H1e9ci078192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 17 Mar 2018 01:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331082 - in head/sys/x86: isa x86 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys/x86: isa x86 X-SVN-Commit-Revision: 331082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 01:40:10 -0000 Author: emaste Date: Sat Mar 17 01:40:09 2018 New Revision: 331082 URL: https://svnweb.freebsd.org/changeset/base/331082 Log: ANSIfy sys/x86 Modified: head/sys/x86/isa/isa_dma.c head/sys/x86/x86/autoconf.c Modified: head/sys/x86/isa/isa_dma.c ============================================================================== --- head/sys/x86/isa/isa_dma.c Sat Mar 17 01:27:54 2018 (r331081) +++ head/sys/x86/isa/isa_dma.c Sat Mar 17 01:40:09 2018 (r331082) @@ -146,8 +146,7 @@ isa_dma_init(int chan, u_int bouncebufsize, int flag) * in open() or during its initialization. */ int -isa_dma_acquire(chan) - int chan; +isa_dma_acquire(int chan) { #ifdef DIAGNOSTIC if (chan & ~VALID_DMA_MASK) @@ -172,8 +171,7 @@ isa_dma_acquire(chan) * during close() or during its shutdown. */ void -isa_dma_release(chan) - int chan; +isa_dma_release(int chan) { #ifdef DIAGNOSTIC if (chan & ~VALID_DMA_MASK) @@ -207,8 +205,7 @@ isa_dma_release(chan) * external dma control by a board. */ void -isa_dmacascade(chan) - int chan; +isa_dmacascade(int chan) { #ifdef DIAGNOSTIC if (chan & ~VALID_DMA_MASK) Modified: head/sys/x86/x86/autoconf.c ============================================================================== --- head/sys/x86/x86/autoconf.c Sat Mar 17 01:27:54 2018 (r331081) +++ head/sys/x86/x86/autoconf.c Sat Mar 17 01:40:09 2018 (r331082) @@ -87,8 +87,7 @@ SYSINIT(configure3, SI_SUB_CONFIGURE, SI_ORDER_ANY, co * Determine i/o configuration for a machine. */ static void -configure_first(dummy) - void *dummy; +configure_first(void *dummy) { /* nexus0 is the top of the x86 device tree */ @@ -96,8 +95,7 @@ configure_first(dummy) } static void -configure(dummy) - void *dummy; +configure(void *dummy) { /* initialize new bus architecture */ @@ -114,8 +112,7 @@ configure(dummy) } static void -configure_final(dummy) - void *dummy; +configure_final(void *dummy) { cninit_finish(); From owner-svn-src-head@freebsd.org Sat Mar 17 01:48:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D5E7F5F7D0; Sat, 17 Mar 2018 01:48:30 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF18A7F26D; Sat, 17 Mar 2018 01:48:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C99AB3DA0; Sat, 17 Mar 2018 01:48:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2H1mTOJ083016; Sat, 17 Mar 2018 01:48:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2H1mR46082991; Sat, 17 Mar 2018 01:48:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803170148.w2H1mR46082991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 17 Mar 2018 01:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331083 - in head: lib/libufs sbin/dump sbin/fsck_ffs sbin/fsdb sbin/newfs sbin/quotacheck sbin/restore sbin/tunefs stand/libsa sys/fs/ext2fs sys/fs/nandfs sys/ufs/ffs sys/ufs/ufs usr.s... X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: lib/libufs sbin/dump sbin/fsck_ffs sbin/fsdb sbin/newfs sbin/quotacheck sbin/restore sbin/tunefs stand/libsa sys/fs/ext2fs sys/fs/nandfs sys/ufs/ffs sys/ufs/ufs usr.sbin/quot X-SVN-Commit-Revision: 331083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 01:48:30 -0000 Author: emaste Date: Sat Mar 17 01:48:27 2018 New Revision: 331083 URL: https://svnweb.freebsd.org/changeset/base/331083 Log: Prefix UFS symbols with UFS_ to reduce namespace pollution Followup to r313780. Also prefix ext2's and nandfs's versions with EXT2_ and NANDFS_. Reported by: kib Reviewed by: kib, mckusick Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9623 Modified: head/lib/libufs/inode.c head/sbin/dump/main.c head/sbin/dump/traverse.c head/sbin/fsck_ffs/dir.c head/sbin/fsck_ffs/fsutil.c head/sbin/fsck_ffs/inode.c head/sbin/fsck_ffs/pass1.c head/sbin/fsck_ffs/pass2.c head/sbin/fsck_ffs/suj.c head/sbin/fsdb/fsdb.c head/sbin/fsdb/fsdbutil.c head/sbin/newfs/mkfs.c head/sbin/quotacheck/quotacheck.c head/sbin/restore/dirs.c head/sbin/restore/interactive.c head/sbin/restore/tape.c head/sbin/tunefs/tunefs.c head/stand/libsa/nandfs.c head/stand/libsa/ufs.c head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/inode.h head/sys/fs/nandfs/nandfs.h head/sys/fs/nandfs/nandfs_vnops.c head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ffs/softdep.h head/sys/ufs/ufs/dinode.h head/sys/ufs/ufs/inode.h head/sys/ufs/ufs/ufs_lookup.c head/sys/ufs/ufs/ufs_vnops.c head/usr.sbin/quot/quot.c Modified: head/lib/libufs/inode.c ============================================================================== --- head/lib/libufs/inode.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/lib/libufs/inode.c Sat Mar 17 01:48:27 2018 (r331083) @@ -81,12 +81,12 @@ getino(struct uufsd *disk, void **dino, ino_t inode, i gotit: switch (disk->d_ufs) { case 1: dp1 = &((struct ufs1_dinode *)inoblock)[inode - min]; - *mode = dp1->di_mode & IFMT; + *mode = dp1->di_mode & UFS_IFMT; *dino = dp1; return (0); case 2: dp2 = &((struct ufs2_dinode *)inoblock)[inode - min]; - *mode = dp2->di_mode & IFMT; + *mode = dp2->di_mode & UFS_IFMT; *dino = dp2; return (0); default: Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/dump/main.c Sat Mar 17 01:48:27 2018 (r331083) @@ -550,7 +550,7 @@ main(int argc, char *argv[]) * Skip directory inodes deleted and maybe reallocated */ dp = getinode(ino, &mode); - if (mode != IFDIR) + if (mode != UFS_IFDIR) continue; (void)dumpino(dp, ino); } @@ -569,7 +569,7 @@ main(int argc, char *argv[]) * Skip inodes deleted and reallocated as directories. */ dp = getinode(ino, &mode); - if (mode == IFDIR) + if (mode == UFS_IFDIR) continue; (void)dumpino(dp, ino); } Modified: head/sbin/dump/traverse.c ============================================================================== --- head/sbin/dump/traverse.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/dump/traverse.c Sat Mar 17 01:48:27 2018 (r331083) @@ -195,7 +195,7 @@ mapfiles(ino_t maxino, long *tapesize) for (i = 0; i < inosused; i++, ino++) { if (ino < UFS_ROOTINO || (dp = getinode(ino, &mode)) == NULL || - (mode & IFMT) == 0) + (mode & UFS_IFMT) == 0) continue; if (ino >= maxino) { msg("Skipping inode %ju >= maxino %ju\n", @@ -209,19 +209,19 @@ mapfiles(ino_t maxino, long *tapesize) * (this is used in mapdirs()). */ SETINO(ino, usedinomap); - if (mode == IFDIR) + if (mode == UFS_IFDIR) SETINO(ino, dumpdirmap); if (WANTTODUMP(dp)) { SETINO(ino, dumpinomap); - if (mode != IFREG && - mode != IFDIR && - mode != IFLNK) + if (mode != UFS_IFREG && + mode != UFS_IFDIR && + mode != UFS_IFLNK) *tapesize += 1; else *tapesize += blockest(dp); continue; } - if (mode == IFDIR) { + if (mode == UFS_IFDIR) { if (!nonodump && (DIP(dp, di_flags) & UF_NODUMP)) CLRINO(ino, usedinomap); @@ -429,7 +429,7 @@ searchdir( * Add back to dumpdirmap and remove from usedinomap * to propagate nodump. */ - if (mode == IFDIR) { + if (mode == UFS_IFDIR) { SETINO(dp->d_ino, dumpdirmap); CLRINO(dp->d_ino, usedinomap); ret |= HASSUBDIRS; @@ -554,7 +554,7 @@ dumpino(union dinode *dp, ino_t ino) default: msg("Warning: undefined file type 0%o\n", - DIP(dp, di_mode) & IFMT); + DIP(dp, di_mode) & UFS_IFMT); return; } if (DIP(dp, di_size) > UFS_NDADDR * sblock->fs_bsize) { @@ -890,11 +890,11 @@ getinode(ino_t inum, int *modep) gotit: if (sblock->fs_magic == FS_UFS1_MAGIC) { dp1 = &((struct ufs1_dinode *)inoblock)[inum - minino]; - *modep = (dp1->di_mode & IFMT); + *modep = (dp1->di_mode & UFS_IFMT); return ((union dinode *)dp1); } dp2 = &((struct ufs2_dinode *)inoblock)[inum - minino]; - *modep = (dp2->di_mode & IFMT); + *modep = (dp2->di_mode & UFS_IFMT); return ((union dinode *)dp2); } Modified: head/sbin/fsck_ffs/dir.c ============================================================================== --- head/sbin/fsck_ffs/dir.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/fsck_ffs/dir.c Sat Mar 17 01:48:27 2018 (r331083) @@ -264,7 +264,7 @@ fileerror(ino_t cwd, ino_t ino, const char *errmesg) dp = ginode(ino); if (ftypeok(dp)) pfatal("%s=%s\n", - (DIP(dp, di_mode) & IFMT) == IFDIR ? "DIR" : "FILE", + (DIP(dp, di_mode) & UFS_IFMT) == UFS_IFDIR ? "DIR" : "FILE", pathbuf); else pfatal("NAME=%s\n", pathbuf); @@ -308,7 +308,8 @@ adjust(struct inodesc *idesc, int lcnt) } if (lcnt != 0) { pwarn("LINK COUNT %s", (lfdir == idesc->id_number) ? lfname : - ((DIP(dp, di_mode) & IFMT) == IFDIR ? "DIR" : "FILE")); + ((DIP(dp, di_mode) & UFS_IFMT) == UFS_IFDIR ? + "DIR" : "FILE")); pinode(idesc->id_number); printf(" COUNT %d SHOULD BE %d", DIP(dp, di_nlink), DIP(dp, di_nlink) - lcnt); @@ -388,7 +389,7 @@ linkup(ino_t orphan, ino_t parentdir, char *name) memset(&idesc, 0, sizeof(struct inodesc)); dp = ginode(orphan); - lostdir = (DIP(dp, di_mode) & IFMT) == IFDIR; + lostdir = (DIP(dp, di_mode) & UFS_IFMT) == UFS_IFDIR; pwarn("UNREF %s ", lostdir ? "DIR" : "FILE"); pinode(orphan); if (preen && DIP(dp, di_size) == 0) @@ -436,7 +437,7 @@ linkup(ino_t orphan, ino_t parentdir, char *name) } } dp = ginode(lfdir); - if ((DIP(dp, di_mode) & IFMT) != IFDIR) { + if ((DIP(dp, di_mode) & UFS_IFMT) != UFS_IFDIR) { pfatal("lost+found IS NOT A DIRECTORY"); if (reply("REALLOCATE") == 0) return (0); @@ -615,7 +616,7 @@ allocdir(ino_t parent, ino_t request, int mode) struct inoinfo *inp; struct dirtemplate *dirp; - ino = allocino(request, IFDIR|mode); + ino = allocino(request, UFS_IFDIR|mode); dirp = &dirhead; dirp->dot_ino = ino; dirp->dotdot_ino = parent; Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/fsck_ffs/fsutil.c Sat Mar 17 01:48:27 2018 (r331083) @@ -100,15 +100,15 @@ fsutilinit(void) int ftypeok(union dinode *dp) { - switch (DIP(dp, di_mode) & IFMT) { + switch (DIP(dp, di_mode) & UFS_IFMT) { - case IFDIR: - case IFREG: - case IFBLK: - case IFCHR: - case IFLNK: - case IFSOCK: - case IFIFO: + case UFS_IFDIR: + case UFS_IFREG: + case UFS_IFBLK: + case UFS_IFCHR: + case UFS_IFLNK: + case UFS_IFSOCK: + case UFS_IFIFO: return (1); default: Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/fsck_ffs/inode.c Sat Mar 17 01:48:27 2018 (r331083) @@ -71,8 +71,8 @@ ckinode(union dinode *dp, struct inodesc *idesc) idesc->id_lbn = -1; idesc->id_entryno = 0; idesc->id_filesize = DIP(dp, di_size); - mode = DIP(dp, di_mode) & IFMT; - if (mode == IFBLK || mode == IFCHR || (mode == IFLNK && + mode = DIP(dp, di_mode) & UFS_IFMT; + if (mode == UFS_IFBLK || mode == UFS_IFCHR || (mode == UFS_IFLNK && DIP(dp, di_size) < (unsigned)sblock.fs_maxsymlinklen)) return (KEEPON); if (sblock.fs_magic == FS_UFS1_MAGIC) @@ -347,7 +347,7 @@ getnextinode(ino_t inumber, int rebuildcg) * Try to determine if we have reached the end of the * allocated inodes. */ - mode = DIP(dp, di_mode) & IFMT; + mode = DIP(dp, di_mode) & UFS_IFMT; if (mode == 0) { if (memcmp(dp->dp2.di_db, ufs2_zino.di_db, UFS_NDADDR * sizeof(ufs2_daddr_t)) || @@ -362,9 +362,9 @@ getnextinode(ino_t inumber, int rebuildcg) ndb = howmany(DIP(dp, di_size), sblock.fs_bsize); if (ndb < 0) return (NULL); - if (mode == IFBLK || mode == IFCHR) + if (mode == UFS_IFBLK || mode == UFS_IFCHR) ndb++; - if (mode == IFLNK) { + if (mode == UFS_IFLNK) { /* * Fake ndb value so direct/indirect block checks below * will detect any garbage after symlink string. @@ -533,7 +533,7 @@ clri(struct inodesc *idesc, const char *type, int flag dp = ginode(idesc->id_number); if (flag == 1) { pwarn("%s %s", type, - (DIP(dp, di_mode) & IFMT) == IFDIR ? "DIR" : "FILE"); + (DIP(dp, di_mode) & UFS_IFMT) == UFS_IFDIR ? "DIR":"FILE"); pinode(idesc->id_number); } if (preen || reply("CLEAR") == 1) { @@ -681,13 +681,13 @@ allocino(ino_t request, int type) return (0); setbit(cg_inosused(cgp), ino % sblock.fs_ipg); cgp->cg_cs.cs_nifree--; - switch (type & IFMT) { - case IFDIR: + switch (type & UFS_IFMT) { + case UFS_IFDIR: inoinfo(ino)->ino_state = DSTATE; cgp->cg_cs.cs_ndir++; break; - case IFREG: - case IFLNK: + case UFS_IFREG: + case UFS_IFLNK: inoinfo(ino)->ino_state = FSTATE; break; default: Modified: head/sbin/fsck_ffs/pass1.c ============================================================================== --- head/sbin/fsck_ffs/pass1.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/fsck_ffs/pass1.c Sat Mar 17 01:48:27 2018 (r331083) @@ -251,7 +251,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r if ((dp = getnextinode(inumber, rebuildcg)) == NULL) return (0); - mode = DIP(dp, di_mode) & IFMT; + mode = DIP(dp, di_mode) & UFS_IFMT; if (mode == 0) { if ((sblock.fs_magic == FS_UFS1_MAGIC && (memcmp(dp->dp1.di_db, ufs1_zino.di_db, @@ -284,25 +284,25 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r kernmaxfilesize = sblock.fs_maxfilesize; if (DIP(dp, di_size) > kernmaxfilesize || DIP(dp, di_size) > sblock.fs_maxfilesize || - (mode == IFDIR && DIP(dp, di_size) > MAXDIRSIZE)) { + (mode == UFS_IFDIR && DIP(dp, di_size) > MAXDIRSIZE)) { if (debug) printf("bad size %ju:", (uintmax_t)DIP(dp, di_size)); goto unknown; } - if (!preen && mode == IFMT && reply("HOLD BAD BLOCK") == 1) { + if (!preen && mode == UFS_IFMT && reply("HOLD BAD BLOCK") == 1) { dp = ginode(inumber); DIP_SET(dp, di_size, sblock.fs_fsize); - DIP_SET(dp, di_mode, IFREG|0600); + DIP_SET(dp, di_mode, UFS_IFREG|0600); inodirty(); } - if ((mode == IFBLK || mode == IFCHR || mode == IFIFO || - mode == IFSOCK) && DIP(dp, di_size) != 0) { + if ((mode == UFS_IFBLK || mode == UFS_IFCHR || mode == UFS_IFIFO || + mode == UFS_IFSOCK) && DIP(dp, di_size) != 0) { if (debug) printf("bad special-file size %ju:", (uintmax_t)DIP(dp, di_size)); goto unknown; } - if ((mode == IFBLK || mode == IFCHR) && + if ((mode == UFS_IFBLK || mode == UFS_IFCHR) && (dev_t)DIP(dp, di_rdev) == NODEV) { if (debug) printf("bad special-file rdev NODEV:"); @@ -315,9 +315,9 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r (uintmax_t)DIP(dp, di_size), (uintmax_t)ndb); goto unknown; } - if (mode == IFBLK || mode == IFCHR) + if (mode == UFS_IFBLK || mode == UFS_IFCHR) ndb++; - if (mode == IFLNK) { + if (mode == UFS_IFLNK) { /* * Fake ndb value so direct/indirect block checks below * will detect any garbage after symlink string. @@ -357,7 +357,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r goto unknown; n_files++; inoinfo(inumber)->ino_linkcnt = DIP(dp, di_nlink); - if (mode == IFDIR) { + if (mode == UFS_IFDIR) { if (DIP(dp, di_size) == 0) inoinfo(inumber)->ino_state = DCLEAR; else if (DIP(dp, di_nlink) <= 0) Modified: head/sbin/fsck_ffs/pass2.c ============================================================================== --- head/sbin/fsck_ffs/pass2.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/fsck_ffs/pass2.c Sat Mar 17 01:48:27 2018 (r331083) @@ -112,8 +112,8 @@ pass2(void) exit(EEXIT); } dp = ginode(UFS_ROOTINO); - DIP_SET(dp, di_mode, DIP(dp, di_mode) & ~IFMT); - DIP_SET(dp, di_mode, DIP(dp, di_mode) | IFDIR); + DIP_SET(dp, di_mode, DIP(dp, di_mode) & ~UFS_IFMT); + DIP_SET(dp, di_mode, DIP(dp, di_mode) | UFS_IFDIR); inodirty(); break; @@ -184,7 +184,7 @@ pass2(void) } dp = &dino; memset(dp, 0, sizeof(struct ufs2_dinode)); - DIP_SET(dp, di_mode, IFDIR); + DIP_SET(dp, di_mode, UFS_IFDIR); DIP_SET(dp, di_size, inp->i_isize); for (i = 0; i < MIN(inp->i_numblks, UFS_NDADDR); i++) DIP_SET(dp, di_db[i], inp->i_blks[i]); @@ -478,7 +478,8 @@ again: break; dp = ginode(dirp->d_ino); inoinfo(dirp->d_ino)->ino_state = - (DIP(dp, di_mode) & IFMT) == IFDIR ? DSTATE : FSTATE; + (DIP(dp, di_mode) & UFS_IFMT) == UFS_IFDIR ? + DSTATE : FSTATE; inoinfo(dirp->d_ino)->ino_linkcnt = DIP(dp, di_nlink); goto again; Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/fsck_ffs/suj.c Sat Mar 17 01:48:27 2018 (r331083) @@ -605,7 +605,7 @@ ino_free(ino_t ino, int mode) if (ino < cgp->cg_irotor) cgp->cg_irotor = ino; cgp->cg_cs.cs_nifree++; - if ((mode & IFMT) == IFDIR) { + if ((mode & UFS_IFMT) == UFS_IFDIR) { freedir++; cgp->cg_cs.cs_ndir--; } @@ -748,7 +748,7 @@ ino_blkatoff(union dinode *ip, ino_t ino, ufs_lbn_t lb /* * Now direct and indirect. */ - if (DIP(ip, di_mode) == IFLNK && + if (DIP(ip, di_mode) == UFS_IFLNK && DIP(ip, di_size) < fs->fs_maxsymlinklen) return (0); if (lbn >= 0 && lbn < UFS_NDADDR) { @@ -853,7 +853,7 @@ ino_isat(ino_t parent, off_t diroff, ino_t child, int *isdot = 0; dip = ino_read(parent); *mode = DIP(dip, di_mode); - if ((*mode & IFMT) != IFDIR) { + if ((*mode & UFS_IFMT) != UFS_IFDIR) { if (debug) { /* * This can happen if the parent inode @@ -1013,7 +1013,7 @@ ino_visit(union dinode *ip, ino_t ino, ino_visitor vis int i; size = DIP(ip, di_size); - mode = DIP(ip, di_mode) & IFMT; + mode = DIP(ip, di_mode) & UFS_IFMT; fragcnt = 0; if ((flags & VISIT_EXT) && fs->fs_magic == FS_UFS2_MAGIC && ip->dp2.di_extsize) { @@ -1027,8 +1027,8 @@ ino_visit(union dinode *ip, ino_t ino, ino_visitor vis } } /* Skip datablocks for short links and devices. */ - if (mode == IFBLK || mode == IFCHR || - (mode == IFLNK && size < fs->fs_maxsymlinklen)) + if (mode == UFS_IFBLK || mode == UFS_IFCHR || + (mode == UFS_IFLNK && size < fs->fs_maxsymlinklen)) return (fragcnt); for (i = 0; i < UFS_NDADDR; i++) { if (DIP(ip, di_db[i]) == 0) @@ -1265,7 +1265,7 @@ ino_reclaim(union dinode *ip, ino_t ino, int mode) (uintmax_t)ino, DIP(ip, di_nlink), DIP(ip, di_mode)); /* We are freeing an inode or directory. */ - if ((DIP(ip, di_mode) & IFMT) == IFDIR) + if ((DIP(ip, di_mode) & UFS_IFMT) == UFS_IFDIR) ino_visit(ip, ino, ino_free_children, 0); DIP_SET(ip, di_nlink, 0); ino_visit(ip, ino, blk_free_visit, VISIT_EXT | VISIT_INDIR); @@ -1300,7 +1300,7 @@ ino_decr(ino_t ino) if (mode == 0) err_suj("Inode %d has a link of %d with 0 mode\n", ino, nlink); nlink--; - if ((mode & IFMT) == IFDIR) + if ((mode & UFS_IFMT) == UFS_IFDIR) reqlink = 2; else reqlink = 1; @@ -1335,13 +1335,13 @@ ino_adjust(struct suj_ino *sino) nlink = sino->si_nlink; ino = sino->si_ino; - mode = sino->si_mode & IFMT; + mode = sino->si_mode & UFS_IFMT; /* * If it's a directory with no dot links, it was truncated before * the name was cleared. We need to clear the dirent that * points at it. */ - if (mode == IFDIR && nlink == 1 && sino->si_dotlinks == 0) { + if (mode == UFS_IFDIR && nlink == 1 && sino->si_dotlinks == 0) { sino->si_nlink = nlink = 0; TAILQ_FOREACH(srec, &sino->si_recs, sr_next) { rrec = (struct jrefrec *)srec->sr_rec; @@ -1358,7 +1358,7 @@ ino_adjust(struct suj_ino *sino) * If it's a directory with no real names pointing to it go ahead * and truncate it. This will free any children. */ - if (mode == IFDIR && nlink - sino->si_dotlinks == 0) { + if (mode == UFS_IFDIR && nlink - sino->si_dotlinks == 0) { sino->si_nlink = nlink = 0; /* * Mark any .. links so they know not to free this inode @@ -1374,7 +1374,7 @@ ino_adjust(struct suj_ino *sino) } } ip = ino_read(ino); - mode = DIP(ip, di_mode) & IFMT; + mode = DIP(ip, di_mode) & UFS_IFMT; if (nlink > UFS_LINK_MAX) err_suj("ino %ju nlink manipulation error, new %ju, old %d\n", (uintmax_t)ino, (uintmax_t)nlink, DIP(ip, di_nlink)); @@ -1393,7 +1393,7 @@ ino_adjust(struct suj_ino *sino) if (mode != sino->si_mode && debug) printf("ino %ju, mode %o != %o\n", (uintmax_t)ino, mode, sino->si_mode); - if ((mode & IFMT) == IFDIR) + if ((mode & UFS_IFMT) == UFS_IFDIR) reqlink = 2; else reqlink = 1; @@ -1506,15 +1506,15 @@ ino_trunc(ino_t ino, off_t size) int mode; ip = ino_read(ino); - mode = DIP(ip, di_mode) & IFMT; + mode = DIP(ip, di_mode) & UFS_IFMT; cursize = DIP(ip, di_size); if (debug) printf("Truncating ino %ju, mode %o to size %jd from size %jd\n", (uintmax_t)ino, mode, size, cursize); /* Skip datablocks for short links and devices. */ - if (mode == 0 || mode == IFBLK || mode == IFCHR || - (mode == IFLNK && cursize < fs->fs_maxsymlinklen)) + if (mode == 0 || mode == UFS_IFBLK || mode == UFS_IFCHR || + (mode == UFS_IFLNK && cursize < fs->fs_maxsymlinklen)) return; /* Don't extend. */ if (size > cursize) @@ -1587,7 +1587,7 @@ ino_trunc(ino_t ino, off_t size) * uninitialized space later. */ off = blkoff(fs, size); - if (off && DIP(ip, di_mode) != IFDIR) { + if (off && DIP(ip, di_mode) != UFS_IFDIR) { uint8_t *buf; long clrsize; @@ -1635,7 +1635,7 @@ ino_check(struct suj_ino *sino) rrec = (struct jrefrec *)srec->sr_rec; isat = ino_isat(rrec->jr_parent, rrec->jr_diroff, rrec->jr_ino, &mode, &isdot); - if (isat && (mode & IFMT) != (rrec->jr_mode & IFMT)) + if (isat && (mode & UFS_IFMT) != (rrec->jr_mode & UFS_IFMT)) err_suj("Inode mode/directory type mismatch %o != %o\n", mode, rrec->jr_mode); if (debug) @@ -1646,7 +1646,7 @@ ino_check(struct suj_ino *sino) (uintmax_t)rrec->jr_parent, (uintmax_t)rrec->jr_diroff, rrec->jr_mode, isat, isdot); - mode = rrec->jr_mode & IFMT; + mode = rrec->jr_mode & UFS_IFMT; if (rrec->jr_op == JOP_REMREF) removes++; newlinks += isat; @@ -1915,7 +1915,7 @@ ino_unlinked(void) fs->fs_sujfree = 0; while (ino != 0) { ip = ino_read(ino); - mode = DIP(ip, di_mode) & IFMT; + mode = DIP(ip, di_mode) & UFS_IFMT; inon = DIP(ip, di_freelink); DIP_SET(ip, di_freelink, 0); /* @@ -2371,7 +2371,7 @@ suj_verifyino(union dinode *ip) return (-1); } - if (DIP(ip, di_mode) != (IFREG | IREAD)) { + if (DIP(ip, di_mode) != (UFS_IFREG | UFS_IREAD)) { printf("Invalid mode %o for journal inode %ju\n", DIP(ip, di_mode), (uintmax_t)sujino); return (-1); Modified: head/sbin/fsdb/fsdb.c ============================================================================== --- head/sbin/fsdb/fsdb.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/fsdb/fsdb.c Sat Mar 17 01:48:27 2018 (r331083) @@ -512,14 +512,14 @@ CMDFUNCSTART(findblk) /* Get on-disk inode aka dinode. */ curinum = inum; curinode = ginode(inum); - /* Find IFLNK dinode with allocated data blocks. */ - switch (DIP(curinode, di_mode) & IFMT) { - case IFDIR: - case IFREG: + /* Find UFS_IFLNK dinode with allocated data blocks. */ + switch (DIP(curinode, di_mode) & UFS_IFMT) { + case UFS_IFDIR: + case UFS_IFREG: if (DIP(curinode, di_blocks) == 0) continue; break; - case IFLNK: + case UFS_IFLNK: { uint64_t size = DIP(curinode, di_size); if (size > 0 && size < sblock.fs_maxsymlinklen && @@ -889,10 +889,10 @@ struct typemap { const char *typename; int typebits; } typenamemap[] = { - {"file", IFREG}, - {"dir", IFDIR}, - {"socket", IFSOCK}, - {"fifo", IFIFO}, + {"file", UFS_IFREG}, + {"dir", UFS_IFDIR}, + {"socket", UFS_IFSOCK}, + {"fifo", UFS_IFIFO}, }; CMDFUNCSTART(newtype) @@ -902,7 +902,7 @@ CMDFUNCSTART(newtype) if (!checkactive()) return 1; - type = DIP(curinode, di_mode) & IFMT; + type = DIP(curinode, di_mode) & UFS_IFMT; for (tp = typenamemap; tp < &typenamemap[nitems(typenamemap)]; tp++) { @@ -917,7 +917,7 @@ CMDFUNCSTART(newtype) warnx("try one of `file', `dir', `socket', `fifo'"); return 1; } - DIP_SET(curinode, di_mode, DIP(curinode, di_mode) & ~IFMT); + DIP_SET(curinode, di_mode, DIP(curinode, di_mode) & ~UFS_IFMT); DIP_SET(curinode, di_mode, DIP(curinode, di_mode) | type); inodirty(); printactive(0); Modified: head/sbin/fsdb/fsdbutil.c ============================================================================== --- head/sbin/fsdb/fsdbutil.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/fsdb/fsdbutil.c Sat Mar 17 01:48:27 2018 (r331083) @@ -120,20 +120,20 @@ printstat(const char *cp, ino_t inum, union dinode *dp time_t t; printf("%s: ", cp); - switch (DIP(dp, di_mode) & IFMT) { - case IFDIR: + switch (DIP(dp, di_mode) & UFS_IFMT) { + case UFS_IFDIR: puts("directory"); break; - case IFREG: + case UFS_IFREG: puts("regular file"); break; - case IFBLK: + case UFS_IFBLK: printf("block special (%#jx)", (uintmax_t)DIP(dp, di_rdev)); break; - case IFCHR: + case UFS_IFCHR: printf("character special (%#jx)", DIP(dp, di_rdev)); break; - case IFLNK: + case UFS_IFLNK: fputs("symlink",stdout); if (DIP(dp, di_size) > 0 && DIP(dp, di_size) < sblock.fs_maxsymlinklen && @@ -147,10 +147,10 @@ printstat(const char *cp, ino_t inum, union dinode *dp putchar('\n'); } break; - case IFSOCK: + case UFS_IFSOCK: puts("socket"); break; - case IFIFO: + case UFS_IFIFO: puts("fifo"); break; } @@ -338,7 +338,7 @@ checkactivedir(void) warnx("no current inode\n"); return 0; } - if ((DIP(curinode, di_mode) & IFMT) != IFDIR) { + if ((DIP(curinode, di_mode) & UFS_IFMT) != UFS_IFDIR) { warnx("inode %ju not a directory", (uintmax_t)curinum); return 0; } @@ -350,14 +350,14 @@ printactive(int doblocks) { if (!checkactive()) return 1; - switch (DIP(curinode, di_mode) & IFMT) { - case IFDIR: - case IFREG: - case IFBLK: - case IFCHR: - case IFLNK: - case IFSOCK: - case IFIFO: + switch (DIP(curinode, di_mode) & UFS_IFMT) { + case UFS_IFDIR: + case UFS_IFREG: + case UFS_IFBLK: + case UFS_IFCHR: + case UFS_IFLNK: + case UFS_IFSOCK: + case UFS_IFIFO: if (doblocks) printblocks(curinum, curinode); else @@ -368,7 +368,7 @@ printactive(int doblocks) break; default: printf("current inode %ju: screwy itype 0%o (mode 0%o)?\n", - (uintmax_t)curinum, DIP(curinode, di_mode) & IFMT, + (uintmax_t)curinum, DIP(curinode, di_mode) & UFS_IFMT, DIP(curinode, di_mode)); break; } Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/newfs/mkfs.c Sat Mar 17 01:48:27 2018 (r331083) @@ -883,7 +883,7 @@ fsinit(time_t utime) /* * create the root directory */ - node.dp1.di_mode = IFDIR | UMASK; + node.dp1.di_mode = UFS_IFDIR | UMASK; node.dp1.di_nlink = entries; node.dp1.di_size = makedir(root_dir, entries); node.dp1.di_db[0] = alloc(sblock.fs_fsize, node.dp1.di_mode); @@ -919,7 +919,7 @@ fsinit(time_t utime) /* * create the root directory */ - node.dp2.di_mode = IFDIR | UMASK; + node.dp2.di_mode = UFS_IFDIR | UMASK; node.dp2.di_nlink = entries; node.dp2.di_size = makedir(root_dir, entries); node.dp2.di_db[0] = alloc(sblock.fs_fsize, node.dp2.di_mode); @@ -1002,7 +1002,7 @@ goth: acg.cg_cs.cs_nbfree--; sblock.fs_cstotal.cs_nbfree--; fscs[0].cs_nbfree--; - if (mode & IFDIR) { + if (mode & UFS_IFDIR) { acg.cg_cs.cs_ndir++; sblock.fs_cstotal.cs_ndir++; fscs[0].cs_ndir++; Modified: head/sbin/quotacheck/quotacheck.c ============================================================================== --- head/sbin/quotacheck/quotacheck.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/quotacheck/quotacheck.c Sat Mar 17 01:48:27 2018 (r331083) @@ -370,7 +370,7 @@ chkquota(char *specname, struct quotafile *qfu, struct for (i = 0; i < inosused; i++, ino++) { if ((dp = getnextinode(ino)) == NULL || ino < UFS_ROOTINO || - (mode = DIP(dp, di_mode) & IFMT) == 0) + (mode = DIP(dp, di_mode) & UFS_IFMT) == 0) continue; /* * XXX: Do not account for UIDs or GIDs that appear @@ -405,16 +405,16 @@ chkquota(char *specname, struct quotafile *qfu, struct fup = addid((u_long)DIP(dp, di_gid), GRPQUOTA, (char *)0, mntpt); fup->fu_curinodes++; - if (mode == IFREG || mode == IFDIR || - mode == IFLNK) + if (mode == UFS_IFREG || mode == UFS_IFDIR || + mode == UFS_IFLNK) fup->fu_curblocks += DIP(dp, di_blocks); } if (qfu) { fup = addid((u_long)DIP(dp, di_uid), USRQUOTA, (char *)0, mntpt); fup->fu_curinodes++; - if (mode == IFREG || mode == IFDIR || - mode == IFLNK) + if (mode == UFS_IFREG || mode == UFS_IFDIR || + mode == UFS_IFLNK) fup->fu_curblocks += DIP(dp, di_blocks); } } Modified: head/sbin/restore/dirs.c ============================================================================== --- head/sbin/restore/dirs.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/restore/dirs.c Sat Mar 17 01:48:27 2018 (r331083) @@ -178,7 +178,7 @@ extractdirs(int genmode) for (;;) { curfile.name = ""; curfile.action = USING; - if (curfile.mode == 0 || (curfile.mode & IFMT) != IFDIR) + if (curfile.mode == 0 || (curfile.mode & UFS_IFMT) != UFS_IFDIR) break; itp = allocinotab(&curfile, seekpt); getfile(putdir, putdirattrs, xtrnull); @@ -205,7 +205,7 @@ void skipdirs(void) { - while (curfile.ino && (curfile.mode & IFMT) == IFDIR) { + while (curfile.ino && (curfile.mode & UFS_IFMT) == UFS_IFDIR) { skipfile(); } } Modified: head/sbin/restore/interactive.c ============================================================================== --- head/sbin/restore/interactive.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/restore/interactive.c Sat Mar 17 01:48:27 2018 (r331083) @@ -741,9 +741,9 @@ glob_stat(const char *name, struct stat *stp) (!vflag && dp->d_ino == UFS_WINO)) return (-1); if (inodetype(dp->d_ino) == NODE) - stp->st_mode = IFDIR; + stp->st_mode = UFS_IFDIR; else - stp->st_mode = IFREG; + stp->st_mode = UFS_IFREG; return (0); } Modified: head/sbin/restore/tape.c ============================================================================== --- head/sbin/restore/tape.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/restore/tape.c Sat Mar 17 01:48:27 2018 (r331083) @@ -592,19 +592,19 @@ extractfile(char *name) gid = curfile.gid; mode = curfile.mode; flags = curfile.file_flags; - switch (mode & IFMT) { + switch (mode & UFS_IFMT) { default: fprintf(stderr, "%s: unknown file mode 0%o\n", name, mode); skipfile(); return (FAIL); - case IFSOCK: + case UFS_IFSOCK: vprintf(stdout, "skipped socket %s\n", name); skipfile(); return (GOOD); - case IFDIR: + case UFS_IFDIR: if (mflag) { ep = lookupname(name); if (ep == NULL || ep->e_flags & EXTRACT) @@ -615,7 +615,7 @@ extractfile(char *name) vprintf(stdout, "extract file %s\n", name); return (genliteraldir(name, curfile.ino)); - case IFLNK: + case UFS_IFLNK: lnkbuf[0] = '\0'; pathlen = 0; buf = setupextattr(extsize); @@ -639,7 +639,7 @@ extractfile(char *name) } return (FAIL); - case IFIFO: + case UFS_IFIFO: vprintf(stdout, "extract fifo %s\n", name); if (Nflag) { skipfile(); @@ -667,8 +667,8 @@ extractfile(char *name) (void) chflags(name, flags); return (GOOD); - case IFCHR: - case IFBLK: + case UFS_IFCHR: + case UFS_IFBLK: vprintf(stdout, "extract special file %s\n", name); if (Nflag) { skipfile(); @@ -676,7 +676,7 @@ extractfile(char *name) } if (uflag) (void) unlink(name); - if (mknod(name, (mode & (IFCHR | IFBLK)) | 0600, + if (mknod(name, (mode & (UFS_IFCHR | UFS_IFBLK)) | 0600, (int)curfile.rdev) < 0) { fprintf(stderr, "%s: cannot create special file: %s\n", name, strerror(errno)); @@ -697,7 +697,7 @@ extractfile(char *name) (void) chflags(name, flags); return (GOOD); - case IFREG: + case UFS_IFREG: vprintf(stdout, "extract file %s\n", name); if (Nflag) { skipfile(); Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sbin/tunefs/tunefs.c Sat Mar 17 01:48:27 2018 (r331083) @@ -1021,7 +1021,7 @@ journal_alloc(int64_t size) if (sblock.fs_magic == FS_UFS1_MAGIC) { bzero(dp1, sizeof(*dp1)); dp1->di_size = size; - dp1->di_mode = IFREG | IREAD; + dp1->di_mode = UFS_IFREG | UFS_IREAD; dp1->di_nlink = 1; dp1->di_flags = SF_IMMUTABLE | SF_NOUNLINK | UF_NODUMP; dp1->di_atime = utime; @@ -1030,7 +1030,7 @@ journal_alloc(int64_t size) } else { bzero(dp2, sizeof(*dp2)); dp2->di_size = size; - dp2->di_mode = IFREG | IREAD; + dp2->di_mode = UFS_IFREG | UFS_IREAD; dp2->di_nlink = 1; dp2->di_flags = SF_IMMUTABLE | SF_NOUNLINK | UF_NODUMP; dp2->di_atime = utime; Modified: head/stand/libsa/nandfs.c ============================================================================== --- head/stand/libsa/nandfs.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/stand/libsa/nandfs.c Sat Mar 17 01:48:27 2018 (r331083) @@ -654,7 +654,7 @@ nandfs_lookup_path(struct nandfs *fs, const char *path while ((strp = strsep(&lpath, "/")) != NULL) { if (*strp == '\0') continue; - if ((node->inode->i_mode & IFMT) != IFDIR) { + if ((node->inode->i_mode & NANDFS_IFMT) != NANDFS_IFDIR) { nandfs_free_node(node); node = NULL; goto out; @@ -710,7 +710,7 @@ nandfs_lookup_path(struct nandfs *fs, const char *path NANDFS_DEBUG("%s: %.*s has mode %o\n", __func__, dirent->name_len, dirent->name, node->inode->i_mode); - if ((node->inode->i_mode & IFMT) == IFLNK) { + if ((node->inode->i_mode & NANDFS_IFMT) == NANDFS_IFLNK) { NANDFS_DEBUG("%s: %.*s is symlink\n", __func__, dirent->name_len, dirent->name); link_len = node->inode->i_size; Modified: head/stand/libsa/ufs.c ============================================================================== --- head/stand/libsa/ufs.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/stand/libsa/ufs.c Sat Mar 17 01:48:27 2018 (r331083) @@ -557,7 +557,7 @@ ufs_open(upath, f) /* * Check that current node is a directory. */ - if ((DIP(fp, di_mode) & IFMT) != IFDIR) { + if ((DIP(fp, di_mode) & UFS_IFMT) != UFS_IFDIR) { rc = ENOTDIR; goto out; } @@ -599,7 +599,7 @@ ufs_open(upath, f) /* * Check for symbolic link. */ - if ((DIP(fp, di_mode) & IFMT) == IFLNK) { + if ((DIP(fp, di_mode) & UFS_IFMT) == UFS_IFLNK) { int link_len = DIP(fp, di_size); int len; Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sys/fs/ext2fs/ext2_alloc.c Sat Mar 17 01:48:27 2018 (r331083) @@ -393,7 +393,7 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred * ext2_dirpref else obtain it using ino_to_cg. The preferred inode is * always the next inode. */ - if ((mode & IFMT) == IFDIR) { + if ((mode & EXT2_IFMT) == EXT2_IFDIR) { cg = ext2_dirpref(pip); if (fs->e2fs_contigdirs[cg] < 255) fs->e2fs_contigdirs[cg]++; @@ -1290,7 +1290,7 @@ gotit: e2fs_gd_get_i_unused(&fs->e2fs_gd[cg]) - 1); fs->e2fs->e2fs_ficount--; fs->e2fs_fmod = 1; - if ((mode & IFMT) == IFDIR) { + if ((mode & EXT2_IFMT) == EXT2_IFDIR) { e2fs_gd_set_ndirs(&fs->e2fs_gd[cg], e2fs_gd_get_ndirs(&fs->e2fs_gd[cg]) + 1); fs->e2fs_total_dir++; @@ -1395,7 +1395,7 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode) EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) e2fs_gd_set_i_unused(&fs->e2fs_gd[cg], e2fs_gd_get_i_unused(&fs->e2fs_gd[cg]) + 1); - if ((mode & IFMT) == IFDIR) { + if ((mode & EXT2_IFMT) == EXT2_IFDIR) { e2fs_gd_set_ndirs(&fs->e2fs_gd[cg], e2fs_gd_get_ndirs(&fs->e2fs_gd[cg]) - 1); fs->e2fs_total_dir--; Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Sat Mar 17 01:40:09 2018 (r331082) +++ head/sys/fs/ext2fs/ext2_dinode.h Sat Mar 17 01:48:27 2018 (r331083) @@ -105,7 +105,7 @@ * Structure of an inode on the disk */ struct ext2fs_dinode { - uint16_t e2di_mode; /* 0: IFMT, permissions; see below. */ + uint16_t e2di_mode; /* 0: EXT2_IFMT, permissions; below.*/ uint16_t e2di_uid; /* 2: Owner UID */ uint32_t e2di_size; /* 4: Size (in bytes) */ uint32_t e2di_atime; /* 8: Access time */ Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sys/fs/ext2fs/ext2_lookup.c Sat Mar 17 01:48:27 2018 (r331083) @@ -591,7 +591,7 @@ found: * may not delete it (unless she's root). This * implements append-only directories. */ - if ((dp->i_mode & ISVTX) && + if ((dp->i_mode & EXT2_ISVTX) && cred->cr_uid != 0 && cred->cr_uid != dp->i_uid && VTOI(tdp)->i_uid != cred->cr_uid) { Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Sat Mar 17 01:40:09 2018 (r331082) +++ head/sys/fs/ext2fs/ext2_vnops.c Sat Mar 17 01:48:27 2018 (r331083) @@ -352,7 +352,7 @@ ext2_getattr(struct vop_getattr_args *ap) */ vap->va_fsid = dev2udev(ip->i_devvp->v_rdev); vap->va_fileid = ip->i_number; - vap->va_mode = ip->i_mode & ~IFMT; + vap->va_mode = ip->i_mode & ~EXT2_IFMT; vap->va_nlink = ip->i_nlink; vap->va_uid = ip->i_uid; vap->va_gid = ip->i_gid; @@ -534,7 +534,7 @@ ext2_chmod(struct vnode *vp, int mode, struct ucred *c if (error) return (EFTYPE); } - if (!groupmember(ip->i_gid, cred) && (mode & ISGID)) { + if (!groupmember(ip->i_gid, cred) && (mode & EXT2_ISGID)) { error = priv_check_cred(cred, PRIV_VFS_SETGID, 0); if (error) return (error); @@ -584,9 +584,10 @@ ext2_chown(struct vnode *vp, uid_t uid, gid_t gid, str ip->i_gid = gid; ip->i_uid = uid; ip->i_flag |= IN_CHANGE; - if ((ip->i_mode & (ISUID | ISGID)) && (ouid != uid || ogid != gid)) { + if ((ip->i_mode & (EXT2_ISUID | EXT2_ISGID)) && + (ouid != uid || ogid != gid)) { if (priv_check_cred(cred, PRIV_VFS_RETAINSUGID, 0) != 0) - ip->i_mode &= ~(ISUID | ISGID); + ip->i_mode &= ~(EXT2_ISUID | EXT2_ISGID); } return (0); } @@ -843,7 +844,7 @@ abortit: error = EPERM; goto abortit; } - if ((ip->i_mode & IFMT) == IFDIR) { + if ((ip->i_mode & EXT2_IFMT) == EXT2_IFDIR) { /* * Avoid ".", "..", and aliases of "." for obvious reasons. */ @@ -974,7 +975,7 @@ abortit: * to it. Also, ensure source and target are compatible * (both directories, or both not directories). */ - if ((xp->i_mode & IFMT) == IFDIR) { + if ((xp->i_mode & EXT2_IFMT) == EXT2_IFDIR) { if (!ext2_dirempty(xp, dp->i_number, tcnp->cn_cred)) { error = ENOTEMPTY; goto bad; @@ -1318,7 +1319,7 @@ ext2_mkdir(struct vop_mkdir_args *ap) goto out; } dmode = vap->va_mode & 0777; - dmode |= IFDIR; + dmode |= EXT2_IFDIR; /* * Must simulate part of ext2_makeinode here to acquire the inode, * but not have it entered in the parent directory. The entry is @@ -1341,8 +1342,8 @@ ext2_mkdir(struct vop_mkdir_args *ap) * 'give it away' so that the SUID is still forced on. */ if ((dvp->v_mount->mnt_flag & MNT_SUIDDIR) && - (dp->i_mode & ISUID) && dp->i_uid) { - dmode |= ISUID; + (dp->i_mode & EXT2_ISUID) && dp->i_uid) { + dmode |= EXT2_ISUID; ip->i_uid = dp->i_uid; } else { ip->i_uid = cnp->cn_cred->cr_uid; @@ -1521,7 +1522,7 @@ ext2_symlink(struct vop_symlink_args *ap) struct inode *ip; int len, error; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Mar 17 01:57:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F0E5F600AD; Sat, 17 Mar 2018 01:57:14 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7C7E7FA1C; Sat, 17 Mar 2018 01:57:13 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.254.254.65] (senat1-01.HML3.ScaleEngine.net [209.51.186.5]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 85656147C0; Sat, 17 Mar 2018 01:57:07 +0000 (UTC) Subject: Re: svn commit: r331064 - head/sbin/ifconfig To: Kirill Ponomarev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803161656.w2GGuvOv016658@repo.freebsd.org> <90FB9B8F-DF2E-49E5-BD86-197CE3B312A4@sigsegv.be> From: Allan Jude Message-ID: <645c3f81-6b43-2426-bfc9-ade4bfdb382a@freebsd.org> Date: Fri, 16 Mar 2018 21:56:59 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <90FB9B8F-DF2E-49E5-BD86-197CE3B312A4@sigsegv.be> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 01:57:14 -0000 On 2018-03-16 19:54, Kristof Provost wrote: > On 16 Mar 2018, at 17:56, Kirill Ponomarev wrote: >> Author: krion (ports committer) >> Date: Fri Mar 16 16:56:56 2018 >> New Revision: 331064 >> URL: https://svnweb.freebsd.org/changeset/base/331064 >> >> Log: >>   Extend SSID maximum string length to 32 chars to support longer SSID >>   names. >> >>   Approved by:    adrian >>   Differential Revision:    https://reviews.freebsd.org/D14710 >> >> Modified: >>   head/sbin/ifconfig/ifieee80211.c >> >> Modified: head/sbin/ifconfig/ifieee80211.c >> ============================================================================== >> >> --- head/sbin/ifconfig/ifieee80211.c    Fri Mar 16 16:06:25 2018    >> (r331063) >> +++ head/sbin/ifconfig/ifieee80211.c    Fri Mar 16 16:56:56 2018    >> (r331064) >> @@ -3503,7 +3503,7 @@ list_scan(int s) >> >>      getchaninfo(s); >> >> -    ssidmax = verbose ? IEEE80211_NWID_LEN : 14; >> +    ssidmax = verbose ? IEEE80211_NWID_LEN : 32; > > IEEE80211_NWID_LEN is 32, so this says ‘verbose ? 32 : 32’ now. > >>      printf("%-*.*s  %-17.17s  %4s %4s   %-7s  %3s %4s\n" >>          , ssidmax, ssidmax, "SSID/MESH ID" >>          , "BSSID" > > Regards, > Kristof > It seems like what you were looking for was just 'ifconfig -v scan' I think the reason it is limited to 14, is so that it will fit in 80 col wide terminals in non-verbose mode. -- Allan Jude From owner-svn-src-head@freebsd.org Sat Mar 17 03:07:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAACFF636B9; Sat, 17 Mar 2018 03:07:27 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pl0-x22a.google.com (mail-pl0-x22a.google.com [IPv6:2607:f8b0:400e:c01::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5AA078246E; Sat, 17 Mar 2018 03:07:27 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pl0-x22a.google.com with SMTP id 61-v6so6978063plf.3; Fri, 16 Mar 2018 20:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9euALLbL3igT39wyNzrDr5QSDaKfCqbtZQE2P5EmXEc=; b=ULiyx9Pq0ofmLJRKuXBYx54KC8cAQRVjEXTPSTPIgjl6MA2CaXQv8mjAbNKXepqW7u EaGfCogzX/6d+k8Lonq43BUn5WUsOdtOhtDiwLryxUKlHLWAtmcI7bwYrHk0XLQtU0T6 VLjiABH/dTfUY6caVVwdEotVTxmEhEFS8YaWtNgTSxo0nfkVq5SvUKW3YrdwS3e8ksrJ qiqs1GLUjzufquXgwzXxiHK5+u6OX7ok+djROBN3SVUgWCW5j18fm5jnfU67kEv86GHc paQZCVEFZNUXddDUTVrPDaL6bR60UBmmb3Q4SWdjllrLw7Z8m3qDqDz1Ab0Ldi65opfp Z0uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=9euALLbL3igT39wyNzrDr5QSDaKfCqbtZQE2P5EmXEc=; b=BgbYax82WheicFztBcD5Zpq80Gs5CxOuJrPCva2WgdyyVoUDj/c+HZB8Rl/W4DoHot 584SPxdjc7k98d+D1RGQUCbOAwcrHTJtz1k2gY1MvU4yHIook28ZFSv5Fl1+veKE08rt Hn56IkzE5jieNfFNlUo8uVjW8Str4JagC6kqdpCebhUD7vymSmpanu6P29u/pL6MVNqs 1+ZeYnGQ5ch5hp86vhA5fxLyoejrQeePQsQ+a69WNlG0SZ9MHVbAIUBpvCOqd8H2s94l BJtA4Yqqg+LuKYH8r+vmEmuOT+ud2linqv4r8Goru55s9D+VyCXjwjd8lasLaLosz+Ll iqGA== X-Gm-Message-State: AElRT7EkjXwPMl3UeedSfuNlcF5Irb2e6H5+B67piwXIJWkfgr/+l9A+ urH7vrYME0spz+ZSdgxn1zAJzRiV X-Google-Smtp-Source: AG47ELvMbKpz4jFFxpu7NG8R9ek6y7LTUwdtYAOKaUhpCxQn5F7G4uAxtgGmi+WUyAJN3W5s5UpPVQ== X-Received: by 2002:a17:902:bcc6:: with SMTP id o6-v6mr4290866pls.16.1521256046170; Fri, 16 Mar 2018 20:07:26 -0700 (PDT) Received: from [192.168.1.105] (152.94.214.218.sta.wbroadband.net.au. [218.214.94.152]) by smtp.gmail.com with ESMTPSA id t28sm18772098pfk.138.2018.03.16.20.07.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Mar 2018 20:07:25 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r330952 - head/sys/kern To: Alan Somers Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Ravi Pokala , src-committers References: <201803142211.w2EMBjVd010880@repo.freebsd.org> <7219A600-5C72-43D6-9E8B-7BBC1D097AF2@mac.com> From: Kubilay Kocak Message-ID: Date: Sat, 17 Mar 2018 14:07:21 +1100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:59.0) Gecko/20100101 Thunderbird/59.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-AU Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 03:07:28 -0000 On 15/03/2018 9:56 am, Alan Somers wrote: > Well, you _would_ be able to, except the public instance has been down for > 3 weeks :( > https://scan.coverity.com/ Coverity Scan is back up as of this (17/03) morning (UTC+11). Anyone with an account should have received the email notification below with instructions to reset their passwords: -------- As you may be aware, there recently was an interruption in the availability of the Coverity Scan service. In February 2018, we discovered that servers used for the Coverity Scan service were accessed by an unauthorized third-party. The access appears to have started earlier in the month. We suspect that the access was to utilize our computing power for cryptocurrency mining. We have not found evidence that database files or artifacts uploaded by the open source community users of the Coverity Scan service were accessed. We retained a well-known computer forensics company to assist us in our investigation. We have closed the method of access, and the Coverity Scan service is again available as a free service to the open source community. The Coverity Scan service data is backed up frequently, and Coverity Scan service data will be restored. We regret any inconvenience caused by the downtime of the Coverity Scan service. We take our commitment to the Open Source community seriously. To that end, we are asking that all Coverity Scan users reset their passwords to regain access to the service. We are continually assessing and improving our systems and practices in this environment, and will work with the Coverity Scan Service community in this effort. Please note that the servers in question were not connected to any other Synopsys computer networks. This should have no impact on customers of our commercial products, and this event did not put any Synopsys corporate data or intellectual property at risk. Note: If you previously signed in to Coverity SCAN using Github, you need not establish a password at this time, but will need to re-authorize with Github the next time you sign in. > On Wed, Mar 14, 2018 at 4:46 PM, Conrad Meyer wrote: > >> I believe they didn't come from the public FreeBSD Coverity instance, >> and I don't think ID numbers are portable between instances. You >> might be able to look up similar issues in the public instance, >> though. >> >> Best, >> Conrad >> >> On Wed, Mar 14, 2018 at 3:20 PM, Ravi Pokala wrote: >>> -----Original Message----- >>> From: on behalf of Conrad Meyer >> >>> Date: 2018-03-14, Wednesday at 15:11 >>> To: , , < >> svn-src-head@freebsd.org> >>> Subject: svn commit: r330952 - head/sys/kern >>> >>>> Author: cem >>>> Date: Wed Mar 14 22:11:45 2018 >>>> New Revision: 330952 >>>> URL: https://svnweb.freebsd.org/changeset/base/330952 >>>> >>>> Log: >>>> vfs_bio.c: Apply cleanups motivated by Coverity analysis >>> >>> What's the Coverity ID? >>> >>> Thanks, >>> >>> Ravi (rpokala@) >>> >>> >>> >> >> > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Sat Mar 17 07:07:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 597F8F4BCD8; Sat, 17 Mar 2018 07:07:26 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B10516B54A; Sat, 17 Mar 2018 07:07:25 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([77.179.222.246]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M1FAK-1edDbR2TUW-00tGnK; Sat, 17 Mar 2018 08:07:17 +0100 Date: Sat, 17 Mar 2018 08:06:49 +0100 From: "O. Hartmann" To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331083 - in head: lib/libufs sbin/dump sbin/fsck_ffs sbin/fsdb sbin/newfs sbin/quotacheck sbin/restore sbin/tunefs stand/libsa sys/fs/ext2fs sys/fs/nandfs sys/ufs/ffs sys/ufs/ufs usr.s... Message-ID: <20180317080716.35306ccf@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201803170148.w2H1mR46082991@repo.freebsd.org> References: <201803170148.w2H1mR46082991@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/Gv+EGY8gAgcusfzMloOHe2C"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:HNh+6k1/ECjfnOXs26LbmOP4NubdtSKk6TFX+ptAoGcm9SzVk/t USnxt6783uNRmMNcFC50SjEgoBM6Sg+G3HtS2M2lssf3dgBm2YfQGwapU00Nl6BYEsjAa4n w1Mkj/r5fV0T7McgEsCgMOMy7bf3FvVEAUq3v0r0rRg5sa49f+8aVHaqoipxVSzxcnvbJYl lRYqLmINHQWQI+eGDjk8w== X-UI-Out-Filterresults: notjunk:1;V01:K0:tUkaxB2j27w=:lYbAxKWU0oOUgl+V6SUqCm 5/4dKBpHbIAQlPKHXIwqhQB0kf0al1idn/1hD3gmiNpXLjDQgw4PO6qdIh1EN4h9+sKm1JIXO 6jwpY+NTkDKCwnaAr/KoUz930qQkRsTESjoleRZGm+XVZHLhcd6xvhc3ZxgqgI2hPOR4t7oCq UJgAKCMgtnpwpFZsotu1xJqHQIYqv4flC0U0/ENByXRm/rRcxKLD6gCOmpJSbdaEq5aGssIqT ZM5HwUdzWm5U9MEY5BVkFYuPpCSypXRoJjbwjy+OKRNzpmxrK48kVyc38mHnJr/FPuBFkOU6T dHgI+Nj/1TBEPYyIBGB6c2tP5lYRPJ4eRpkEYyBW0M5f2e+vXY5oNDEeacSvadJcy5rEwYz3Y QROMuF1MRkAsuvvFg8xcMv3wAv+dzBLwUMcKC/EpDGiiErQYxagU97Cng90FFEgmVno1aIio7 tqqAwRqkuBwkh2rBic1Xj360BZa83IHxsFwxEF9c77fw8Z5mgvvmu+MJTuY65zTh/8T++4tAw HzWNE2f03lvxON8dbVv5NnVlcVVVsMN/O4o1VKziGdy/D/Tu0PDsdirmCjeF2HCDwLSWx55cL X71Ambv3uOvAbElWrr3jo0nb4JCgk5BdwmoW/EgeCovZSQndtpxdKPkqGb4zIG4zwAE3qc6JG S9BvBYTZ5l94sS18qmOBySA4+k6MNjBmwTBg2shOL+kpBAwS6XF8SSJZMHUO3oNhQAR2XLZnz lnbMuII56D4B3H9GJhczVG7MyHmN/I+Zrii1xGxMU2pjhzSwXHzZDUCEBQYz2mYoSmiP4wtmj 1Cj6+Dm34oVANj5kkNPdJTFwsdg1w== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 07:07:26 -0000 --Sig_/Gv+EGY8gAgcusfzMloOHe2C Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Sat, 17 Mar 2018 01:48:27 +0000 (UTC) Ed Maste schrieb: > Author: emaste > Date: Sat Mar 17 01:48:27 2018 > New Revision: 331083 > URL: https://svnweb.freebsd.org/changeset/base/331083 >=20 > Log: > Prefix UFS symbols with UFS_ to reduce namespace pollution > =20 > Followup to r313780. Also prefix ext2's and nandfs's versions with > EXT2_ and NANDFS_. > =20 > Reported by: kib > Reviewed by: kib, mckusick > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D9623 >=20 > Modified: > head/lib/libufs/inode.c > head/sbin/dump/main.c > head/sbin/dump/traverse.c > head/sbin/fsck_ffs/dir.c > head/sbin/fsck_ffs/fsutil.c > head/sbin/fsck_ffs/inode.c > head/sbin/fsck_ffs/pass1.c > head/sbin/fsck_ffs/pass2.c > head/sbin/fsck_ffs/suj.c > head/sbin/fsdb/fsdb.c > head/sbin/fsdb/fsdbutil.c > head/sbin/newfs/mkfs.c > head/sbin/quotacheck/quotacheck.c > head/sbin/restore/dirs.c > head/sbin/restore/interactive.c > head/sbin/restore/tape.c > head/sbin/tunefs/tunefs.c > head/stand/libsa/nandfs.c > head/stand/libsa/ufs.c > head/sys/fs/ext2fs/ext2_alloc.c > head/sys/fs/ext2fs/ext2_dinode.h > head/sys/fs/ext2fs/ext2_lookup.c > head/sys/fs/ext2fs/ext2_vnops.c > head/sys/fs/ext2fs/inode.h > head/sys/fs/nandfs/nandfs.h > head/sys/fs/nandfs/nandfs_vnops.c > head/sys/ufs/ffs/ffs_alloc.c > head/sys/ufs/ffs/ffs_softdep.c > head/sys/ufs/ffs/ffs_vnops.c > head/sys/ufs/ffs/softdep.h > head/sys/ufs/ufs/dinode.h > head/sys/ufs/ufs/inode.h > head/sys/ufs/ufs/ufs_lookup.c > head/sys/ufs/ufs/ufs_vnops.c > head/usr.sbin/quot/quot.c >=20 > Modified: head/lib/libufs/inode.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/libufs/inode.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/lib/libufs/inode.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -81,12 +81,12 @@ getino(struct uufsd *disk, void **dino, ino_t inode, i > gotit: switch (disk->d_ufs) { > case 1: > dp1 =3D &((struct ufs1_dinode *)inoblock)[inode - min]; > - *mode =3D dp1->di_mode & IFMT; > + *mode =3D dp1->di_mode & UFS_IFMT; > *dino =3D dp1; > return (0); > case 2: > dp2 =3D &((struct ufs2_dinode *)inoblock)[inode - min]; > - *mode =3D dp2->di_mode & IFMT; > + *mode =3D dp2->di_mode & UFS_IFMT; > *dino =3D dp2; > return (0); > default: >=20 > Modified: head/sbin/dump/main.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/sbin/dump/main.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/dump/main.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -550,7 +550,7 @@ main(int argc, char *argv[]) > * Skip directory inodes deleted and maybe reallocated > */ > dp =3D getinode(ino, &mode); > - if (mode !=3D IFDIR) > + if (mode !=3D UFS_IFDIR) > continue; > (void)dumpino(dp, ino); > } > @@ -569,7 +569,7 @@ main(int argc, char *argv[]) > * Skip inodes deleted and reallocated as directories. > */ > dp =3D getinode(ino, &mode); > - if (mode =3D=3D IFDIR) > + if (mode =3D=3D UFS_IFDIR) > continue; > (void)dumpino(dp, ino); > } >=20 > Modified: head/sbin/dump/traverse.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/sbin/dump/traverse.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/dump/traverse.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -195,7 +195,7 @@ mapfiles(ino_t maxino, long *tapesize) > for (i =3D 0; i < inosused; i++, ino++) { > if (ino < UFS_ROOTINO || > (dp =3D getinode(ino, &mode)) =3D=3D NULL || > - (mode & IFMT) =3D=3D 0) > + (mode & UFS_IFMT) =3D=3D 0) > continue; > if (ino >=3D maxino) { > msg("Skipping inode %ju >=3D maxino %ju\n", > @@ -209,19 +209,19 @@ mapfiles(ino_t maxino, long *tapesize) > * (this is used in mapdirs()). > */ > SETINO(ino, usedinomap); > - if (mode =3D=3D IFDIR) > + if (mode =3D=3D UFS_IFDIR) > SETINO(ino, dumpdirmap); > if (WANTTODUMP(dp)) { > SETINO(ino, dumpinomap); > - if (mode !=3D IFREG && > - mode !=3D IFDIR && > - mode !=3D IFLNK) > + if (mode !=3D UFS_IFREG && > + mode !=3D UFS_IFDIR && > + mode !=3D UFS_IFLNK) > *tapesize +=3D 1; > else > *tapesize +=3D blockest(dp); > continue; > } > - if (mode =3D=3D IFDIR) { > + if (mode =3D=3D UFS_IFDIR) { > if (!nonodump && > (DIP(dp, di_flags) & UF_NODUMP)) > CLRINO(ino, usedinomap); > @@ -429,7 +429,7 @@ searchdir( > * Add back to dumpdirmap and remove from usedinomap > * to propagate nodump. > */ > - if (mode =3D=3D IFDIR) { > + if (mode =3D=3D UFS_IFDIR) { > SETINO(dp->d_ino, dumpdirmap); > CLRINO(dp->d_ino, usedinomap); > ret |=3D HASSUBDIRS; > @@ -554,7 +554,7 @@ dumpino(union dinode *dp, ino_t ino) > =20 > default: > msg("Warning: undefined file type 0%o\n", > - DIP(dp, di_mode) & IFMT); > + DIP(dp, di_mode) & UFS_IFMT); > return; > } > if (DIP(dp, di_size) > UFS_NDADDR * sblock->fs_bsize) { > @@ -890,11 +890,11 @@ getinode(ino_t inum, int *modep) > gotit: > if (sblock->fs_magic =3D=3D FS_UFS1_MAGIC) { > dp1 =3D &((struct ufs1_dinode *)inoblock)[inum - minino]; > - *modep =3D (dp1->di_mode & IFMT); > + *modep =3D (dp1->di_mode & UFS_IFMT); > return ((union dinode *)dp1); > } > dp2 =3D &((struct ufs2_dinode *)inoblock)[inum - minino]; > - *modep =3D (dp2->di_mode & IFMT); > + *modep =3D (dp2->di_mode & UFS_IFMT); > return ((union dinode *)dp2); > } > =20 >=20 > Modified: head/sbin/fsck_ffs/dir.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/sbin/fsck_ffs/dir.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/fsck_ffs/dir.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -264,7 +264,7 @@ fileerror(ino_t cwd, ino_t ino, const char *errmesg) > dp =3D ginode(ino); > if (ftypeok(dp)) > pfatal("%s=3D%s\n", > - (DIP(dp, di_mode) & IFMT) =3D=3D IFDIR ? "DIR" : "FILE", > + (DIP(dp, di_mode) & UFS_IFMT) =3D=3D UFS_IFDIR ? "DIR" : "FILE", > pathbuf); > else > pfatal("NAME=3D%s\n", pathbuf); > @@ -308,7 +308,8 @@ adjust(struct inodesc *idesc, int lcnt) > } > if (lcnt !=3D 0) { > pwarn("LINK COUNT %s", (lfdir =3D=3D idesc->id_number) ? lfname : > - ((DIP(dp, di_mode) & IFMT) =3D=3D IFDIR ? "DIR" : "FILE")); > + ((DIP(dp, di_mode) & UFS_IFMT) =3D=3D UFS_IFDIR ? > + "DIR" : "FILE")); > pinode(idesc->id_number); > printf(" COUNT %d SHOULD BE %d", > DIP(dp, di_nlink), DIP(dp, di_nlink) - lcnt); > @@ -388,7 +389,7 @@ linkup(ino_t orphan, ino_t parentdir, char *name) > =20 > memset(&idesc, 0, sizeof(struct inodesc)); > dp =3D ginode(orphan); > - lostdir =3D (DIP(dp, di_mode) & IFMT) =3D=3D IFDIR; > + lostdir =3D (DIP(dp, di_mode) & UFS_IFMT) =3D=3D UFS_IFDIR; > pwarn("UNREF %s ", lostdir ? "DIR" : "FILE"); > pinode(orphan); > if (preen && DIP(dp, di_size) =3D=3D 0) > @@ -436,7 +437,7 @@ linkup(ino_t orphan, ino_t parentdir, char *name) > } > } > dp =3D ginode(lfdir); > - if ((DIP(dp, di_mode) & IFMT) !=3D IFDIR) { > + if ((DIP(dp, di_mode) & UFS_IFMT) !=3D UFS_IFDIR) { > pfatal("lost+found IS NOT A DIRECTORY"); > if (reply("REALLOCATE") =3D=3D 0) > return (0); > @@ -615,7 +616,7 @@ allocdir(ino_t parent, ino_t request, int mode) > struct inoinfo *inp; > struct dirtemplate *dirp; > =20 > - ino =3D allocino(request, IFDIR|mode); > + ino =3D allocino(request, UFS_IFDIR|mode); > dirp =3D &dirhead; > dirp->dot_ino =3D ino; > dirp->dotdot_ino =3D parent; >=20 > Modified: head/sbin/fsck_ffs/fsutil.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/sbin/fsck_ffs/fsutil.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/fsck_ffs/fsutil.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -100,15 +100,15 @@ fsutilinit(void) > int > ftypeok(union dinode *dp) > { > - switch (DIP(dp, di_mode) & IFMT) { > + switch (DIP(dp, di_mode) & UFS_IFMT) { > =20 > - case IFDIR: > - case IFREG: > - case IFBLK: > - case IFCHR: > - case IFLNK: > - case IFSOCK: > - case IFIFO: > + case UFS_IFDIR: > + case UFS_IFREG: > + case UFS_IFBLK: > + case UFS_IFCHR: > + case UFS_IFLNK: > + case UFS_IFSOCK: > + case UFS_IFIFO: > return (1); > =20 > default: >=20 > Modified: head/sbin/fsck_ffs/inode.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/sbin/fsck_ffs/inode.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/fsck_ffs/inode.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -71,8 +71,8 @@ ckinode(union dinode *dp, struct inodesc *idesc) > idesc->id_lbn =3D -1; > idesc->id_entryno =3D 0; > idesc->id_filesize =3D DIP(dp, di_size); > - mode =3D DIP(dp, di_mode) & IFMT; > - if (mode =3D=3D IFBLK || mode =3D=3D IFCHR || (mode =3D=3D IFLNK && > + mode =3D DIP(dp, di_mode) & UFS_IFMT; > + if (mode =3D=3D UFS_IFBLK || mode =3D=3D UFS_IFCHR || (mode =3D=3D UFS_= IFLNK && > DIP(dp, di_size) < (unsigned)sblock.fs_maxsymlinklen)) > return (KEEPON); > if (sblock.fs_magic =3D=3D FS_UFS1_MAGIC) > @@ -347,7 +347,7 @@ getnextinode(ino_t inumber, int rebuildcg) > * Try to determine if we have reached the end of the > * allocated inodes. > */ > - mode =3D DIP(dp, di_mode) & IFMT; > + mode =3D DIP(dp, di_mode) & UFS_IFMT; > if (mode =3D=3D 0) { > if (memcmp(dp->dp2.di_db, ufs2_zino.di_db, > UFS_NDADDR * sizeof(ufs2_daddr_t)) || > @@ -362,9 +362,9 @@ getnextinode(ino_t inumber, int rebuildcg) > ndb =3D howmany(DIP(dp, di_size), sblock.fs_bsize); > if (ndb < 0) > return (NULL); > - if (mode =3D=3D IFBLK || mode =3D=3D IFCHR) > + if (mode =3D=3D UFS_IFBLK || mode =3D=3D UFS_IFCHR) > ndb++; > - if (mode =3D=3D IFLNK) { > + if (mode =3D=3D UFS_IFLNK) { > /* > * Fake ndb value so direct/indirect block checks below > * will detect any garbage after symlink string. > @@ -533,7 +533,7 @@ clri(struct inodesc *idesc, const char *type, int flag > dp =3D ginode(idesc->id_number); > if (flag =3D=3D 1) { > pwarn("%s %s", type, > - (DIP(dp, di_mode) & IFMT) =3D=3D IFDIR ? "DIR" : "FILE"); > + (DIP(dp, di_mode) & UFS_IFMT) =3D=3D UFS_IFDIR ? "DIR":"FILE"); > pinode(idesc->id_number); > } > if (preen || reply("CLEAR") =3D=3D 1) { > @@ -681,13 +681,13 @@ allocino(ino_t request, int type) > return (0); > setbit(cg_inosused(cgp), ino % sblock.fs_ipg); > cgp->cg_cs.cs_nifree--; > - switch (type & IFMT) { > - case IFDIR: > + switch (type & UFS_IFMT) { > + case UFS_IFDIR: > inoinfo(ino)->ino_state =3D DSTATE; > cgp->cg_cs.cs_ndir++; > break; > - case IFREG: > - case IFLNK: > + case UFS_IFREG: > + case UFS_IFLNK: > inoinfo(ino)->ino_state =3D FSTATE; > break; > default: >=20 > Modified: head/sbin/fsck_ffs/pass1.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/sbin/fsck_ffs/pass1.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/fsck_ffs/pass1.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -251,7 +251,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r > =20 > if ((dp =3D getnextinode(inumber, rebuildcg)) =3D=3D NULL) > return (0); > - mode =3D DIP(dp, di_mode) & IFMT; > + mode =3D DIP(dp, di_mode) & UFS_IFMT; > if (mode =3D=3D 0) { > if ((sblock.fs_magic =3D=3D FS_UFS1_MAGIC && > (memcmp(dp->dp1.di_db, ufs1_zino.di_db, > @@ -284,25 +284,25 @@ checkinode(ino_t inumber, struct inodesc *idesc, in= t r > kernmaxfilesize =3D sblock.fs_maxfilesize; > if (DIP(dp, di_size) > kernmaxfilesize || > DIP(dp, di_size) > sblock.fs_maxfilesize || > - (mode =3D=3D IFDIR && DIP(dp, di_size) > MAXDIRSIZE)) { > + (mode =3D=3D UFS_IFDIR && DIP(dp, di_size) > MAXDIRSIZE)) { > if (debug) > printf("bad size %ju:", (uintmax_t)DIP(dp, di_size)); > goto unknown; > } > - if (!preen && mode =3D=3D IFMT && reply("HOLD BAD BLOCK") =3D=3D 1) { > + if (!preen && mode =3D=3D UFS_IFMT && reply("HOLD BAD BLOCK") =3D=3D 1)= { > dp =3D ginode(inumber); > DIP_SET(dp, di_size, sblock.fs_fsize); > - DIP_SET(dp, di_mode, IFREG|0600); > + DIP_SET(dp, di_mode, UFS_IFREG|0600); > inodirty(); > } > - if ((mode =3D=3D IFBLK || mode =3D=3D IFCHR || mode =3D=3D IFIFO || > - mode =3D=3D IFSOCK) && DIP(dp, di_size) !=3D 0) { > + if ((mode =3D=3D UFS_IFBLK || mode =3D=3D UFS_IFCHR || mode =3D=3D UFS_= IFIFO || > + mode =3D=3D UFS_IFSOCK) && DIP(dp, di_size) !=3D 0) { > if (debug) > printf("bad special-file size %ju:", > (uintmax_t)DIP(dp, di_size)); > goto unknown; > } > - if ((mode =3D=3D IFBLK || mode =3D=3D IFCHR) && > + if ((mode =3D=3D UFS_IFBLK || mode =3D=3D UFS_IFCHR) && > (dev_t)DIP(dp, di_rdev) =3D=3D NODEV) { > if (debug) > printf("bad special-file rdev NODEV:"); > @@ -315,9 +315,9 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r > (uintmax_t)DIP(dp, di_size), (uintmax_t)ndb); > goto unknown; > } > - if (mode =3D=3D IFBLK || mode =3D=3D IFCHR) > + if (mode =3D=3D UFS_IFBLK || mode =3D=3D UFS_IFCHR) > ndb++; > - if (mode =3D=3D IFLNK) { > + if (mode =3D=3D UFS_IFLNK) { > /* > * Fake ndb value so direct/indirect block checks below > * will detect any garbage after symlink string. > @@ -357,7 +357,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r > goto unknown; > n_files++; > inoinfo(inumber)->ino_linkcnt =3D DIP(dp, di_nlink); > - if (mode =3D=3D IFDIR) { > + if (mode =3D=3D UFS_IFDIR) { > if (DIP(dp, di_size) =3D=3D 0) > inoinfo(inumber)->ino_state =3D DCLEAR; > else if (DIP(dp, di_nlink) <=3D 0) >=20 > Modified: head/sbin/fsck_ffs/pass2.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/sbin/fsck_ffs/pass2.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/fsck_ffs/pass2.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -112,8 +112,8 @@ pass2(void) > exit(EEXIT); > } > dp =3D ginode(UFS_ROOTINO); > - DIP_SET(dp, di_mode, DIP(dp, di_mode) & ~IFMT); > - DIP_SET(dp, di_mode, DIP(dp, di_mode) | IFDIR); > + DIP_SET(dp, di_mode, DIP(dp, di_mode) & ~UFS_IFMT); > + DIP_SET(dp, di_mode, DIP(dp, di_mode) | UFS_IFDIR); > inodirty(); > break; > =20 > @@ -184,7 +184,7 @@ pass2(void) > } > dp =3D &dino; > memset(dp, 0, sizeof(struct ufs2_dinode)); > - DIP_SET(dp, di_mode, IFDIR); > + DIP_SET(dp, di_mode, UFS_IFDIR); > DIP_SET(dp, di_size, inp->i_isize); > for (i =3D 0; i < MIN(inp->i_numblks, UFS_NDADDR); i++) > DIP_SET(dp, di_db[i], inp->i_blks[i]); > @@ -478,7 +478,8 @@ again: > break; > dp =3D ginode(dirp->d_ino); > inoinfo(dirp->d_ino)->ino_state =3D > - (DIP(dp, di_mode) & IFMT) =3D=3D IFDIR ? DSTATE : FSTATE; > + (DIP(dp, di_mode) & UFS_IFMT) =3D=3D UFS_IFDIR ? > + DSTATE : FSTATE; > inoinfo(dirp->d_ino)->ino_linkcnt =3D DIP(dp, di_nlink); > goto again; > =20 >=20 > Modified: head/sbin/fsck_ffs/suj.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/sbin/fsck_ffs/suj.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/fsck_ffs/suj.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -605,7 +605,7 @@ ino_free(ino_t ino, int mode) > if (ino < cgp->cg_irotor) > cgp->cg_irotor =3D ino; > cgp->cg_cs.cs_nifree++; > - if ((mode & IFMT) =3D=3D IFDIR) { > + if ((mode & UFS_IFMT) =3D=3D UFS_IFDIR) { > freedir++; > cgp->cg_cs.cs_ndir--; > } > @@ -748,7 +748,7 @@ ino_blkatoff(union dinode *ip, ino_t ino, ufs_lbn_t lb > /* > * Now direct and indirect. > */ > - if (DIP(ip, di_mode) =3D=3D IFLNK && > + if (DIP(ip, di_mode) =3D=3D UFS_IFLNK && > DIP(ip, di_size) < fs->fs_maxsymlinklen) > return (0); > if (lbn >=3D 0 && lbn < UFS_NDADDR) { > @@ -853,7 +853,7 @@ ino_isat(ino_t parent, off_t diroff, ino_t child, int= =20 > *isdot =3D 0; > dip =3D ino_read(parent); > *mode =3D DIP(dip, di_mode); > - if ((*mode & IFMT) !=3D IFDIR) { > + if ((*mode & UFS_IFMT) !=3D UFS_IFDIR) { > if (debug) { > /* > * This can happen if the parent inode > @@ -1013,7 +1013,7 @@ ino_visit(union dinode *ip, ino_t ino, ino_visitor = vis > int i; > =20 > size =3D DIP(ip, di_size); > - mode =3D DIP(ip, di_mode) & IFMT; > + mode =3D DIP(ip, di_mode) & UFS_IFMT; > fragcnt =3D 0; > if ((flags & VISIT_EXT) && > fs->fs_magic =3D=3D FS_UFS2_MAGIC && ip->dp2.di_extsize) { > @@ -1027,8 +1027,8 @@ ino_visit(union dinode *ip, ino_t ino, ino_visitor = vis > } > } > /* Skip datablocks for short links and devices. */ > - if (mode =3D=3D IFBLK || mode =3D=3D IFCHR || > - (mode =3D=3D IFLNK && size < fs->fs_maxsymlinklen)) > + if (mode =3D=3D UFS_IFBLK || mode =3D=3D UFS_IFCHR || > + (mode =3D=3D UFS_IFLNK && size < fs->fs_maxsymlinklen)) > return (fragcnt); > for (i =3D 0; i < UFS_NDADDR; i++) { > if (DIP(ip, di_db[i]) =3D=3D 0) > @@ -1265,7 +1265,7 @@ ino_reclaim(union dinode *ip, ino_t ino, int mode) > (uintmax_t)ino, DIP(ip, di_nlink), DIP(ip, di_mode)); > =20 > /* We are freeing an inode or directory. */ > - if ((DIP(ip, di_mode) & IFMT) =3D=3D IFDIR) > + if ((DIP(ip, di_mode) & UFS_IFMT) =3D=3D UFS_IFDIR) > ino_visit(ip, ino, ino_free_children, 0); > DIP_SET(ip, di_nlink, 0); > ino_visit(ip, ino, blk_free_visit, VISIT_EXT | VISIT_INDIR); > @@ -1300,7 +1300,7 @@ ino_decr(ino_t ino) > if (mode =3D=3D 0) > err_suj("Inode %d has a link of %d with 0 mode\n", ino, nlink); > nlink--; > - if ((mode & IFMT) =3D=3D IFDIR) > + if ((mode & UFS_IFMT) =3D=3D UFS_IFDIR) > reqlink =3D 2; > else > reqlink =3D 1; > @@ -1335,13 +1335,13 @@ ino_adjust(struct suj_ino *sino) > =20 > nlink =3D sino->si_nlink; > ino =3D sino->si_ino; > - mode =3D sino->si_mode & IFMT; > + mode =3D sino->si_mode & UFS_IFMT; > /* > * If it's a directory with no dot links, it was truncated before > * the name was cleared. We need to clear the dirent that > * points at it. > */ > - if (mode =3D=3D IFDIR && nlink =3D=3D 1 && sino->si_dotlinks =3D=3D 0) { > + if (mode =3D=3D UFS_IFDIR && nlink =3D=3D 1 && sino->si_dotlinks =3D=3D= 0) { > sino->si_nlink =3D nlink =3D 0; > TAILQ_FOREACH(srec, &sino->si_recs, sr_next) { > rrec =3D (struct jrefrec *)srec->sr_rec; > @@ -1358,7 +1358,7 @@ ino_adjust(struct suj_ino *sino) > * If it's a directory with no real names pointing to it go ahead > * and truncate it. This will free any children. > */ > - if (mode =3D=3D IFDIR && nlink - sino->si_dotlinks =3D=3D 0) { > + if (mode =3D=3D UFS_IFDIR && nlink - sino->si_dotlinks =3D=3D 0) { > sino->si_nlink =3D nlink =3D 0; > /* > * Mark any .. links so they know not to free this inode > @@ -1374,7 +1374,7 @@ ino_adjust(struct suj_ino *sino) > } > } > ip =3D ino_read(ino); > - mode =3D DIP(ip, di_mode) & IFMT; > + mode =3D DIP(ip, di_mode) & UFS_IFMT; > if (nlink > UFS_LINK_MAX) > err_suj("ino %ju nlink manipulation error, new %ju, old %d\n", > (uintmax_t)ino, (uintmax_t)nlink, DIP(ip, di_nlink)); > @@ -1393,7 +1393,7 @@ ino_adjust(struct suj_ino *sino) > if (mode !=3D sino->si_mode && debug) > printf("ino %ju, mode %o !=3D %o\n", > (uintmax_t)ino, mode, sino->si_mode); > - if ((mode & IFMT) =3D=3D IFDIR) > + if ((mode & UFS_IFMT) =3D=3D UFS_IFDIR) > reqlink =3D 2; > else > reqlink =3D 1; > @@ -1506,15 +1506,15 @@ ino_trunc(ino_t ino, off_t size) > int mode; > =20 > ip =3D ino_read(ino); > - mode =3D DIP(ip, di_mode) & IFMT; > + mode =3D DIP(ip, di_mode) & UFS_IFMT; > cursize =3D DIP(ip, di_size); > if (debug) > printf("Truncating ino %ju, mode %o to size %jd from size %jd\n", > (uintmax_t)ino, mode, size, cursize); > =20 > /* Skip datablocks for short links and devices. */ > - if (mode =3D=3D 0 || mode =3D=3D IFBLK || mode =3D=3D IFCHR || > - (mode =3D=3D IFLNK && cursize < fs->fs_maxsymlinklen)) > + if (mode =3D=3D 0 || mode =3D=3D UFS_IFBLK || mode =3D=3D UFS_IFCHR || > + (mode =3D=3D UFS_IFLNK && cursize < fs->fs_maxsymlinklen)) > return; > /* Don't extend. */ > if (size > cursize) > @@ -1587,7 +1587,7 @@ ino_trunc(ino_t ino, off_t size) > * uninitialized space later. > */ > off =3D blkoff(fs, size); > - if (off && DIP(ip, di_mode) !=3D IFDIR) { > + if (off && DIP(ip, di_mode) !=3D UFS_IFDIR) { > uint8_t *buf; > long clrsize; > =20 > @@ -1635,7 +1635,7 @@ ino_check(struct suj_ino *sino) > rrec =3D (struct jrefrec *)srec->sr_rec; > isat =3D ino_isat(rrec->jr_parent, rrec->jr_diroff, > rrec->jr_ino, &mode, &isdot); > - if (isat && (mode & IFMT) !=3D (rrec->jr_mode & IFMT)) > + if (isat && (mode & UFS_IFMT) !=3D (rrec->jr_mode & UFS_IFMT)) > err_suj("Inode mode/directory type mismatch %o !=3D %o\n", > mode, rrec->jr_mode); > if (debug) > @@ -1646,7 +1646,7 @@ ino_check(struct suj_ino *sino) > (uintmax_t)rrec->jr_parent, > (uintmax_t)rrec->jr_diroff, > rrec->jr_mode, isat, isdot); > - mode =3D rrec->jr_mode & IFMT; > + mode =3D rrec->jr_mode & UFS_IFMT; > if (rrec->jr_op =3D=3D JOP_REMREF) > removes++; > newlinks +=3D isat; > @@ -1915,7 +1915,7 @@ ino_unlinked(void) > fs->fs_sujfree =3D 0; > while (ino !=3D 0) { > ip =3D ino_read(ino); > - mode =3D DIP(ip, di_mode) & IFMT; > + mode =3D DIP(ip, di_mode) & UFS_IFMT; > inon =3D DIP(ip, di_freelink); > DIP_SET(ip, di_freelink, 0); > /* > @@ -2371,7 +2371,7 @@ suj_verifyino(union dinode *ip) > return (-1); > } > =20 > - if (DIP(ip, di_mode) !=3D (IFREG | IREAD)) { > + if (DIP(ip, di_mode) !=3D (UFS_IFREG | UFS_IREAD)) { > printf("Invalid mode %o for journal inode %ju\n", > DIP(ip, di_mode), (uintmax_t)sujino); > return (-1); >=20 > Modified: head/sbin/fsdb/fsdb.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/sbin/fsdb/fsdb.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/fsdb/fsdb.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -512,14 +512,14 @@ CMDFUNCSTART(findblk) > /* Get on-disk inode aka dinode. */ > curinum =3D inum; > curinode =3D ginode(inum); > - /* Find IFLNK dinode with allocated data blocks. */ > - switch (DIP(curinode, di_mode) & IFMT) { > - case IFDIR: > - case IFREG: > + /* Find UFS_IFLNK dinode with allocated data blocks. */ > + switch (DIP(curinode, di_mode) & UFS_IFMT) { > + case UFS_IFDIR: > + case UFS_IFREG: > if (DIP(curinode, di_blocks) =3D=3D 0) > continue; > break; > - case IFLNK: > + case UFS_IFLNK: > { > uint64_t size =3D DIP(curinode, di_size); > if (size > 0 && size < sblock.fs_maxsymlinklen && > @@ -889,10 +889,10 @@ struct typemap { > const char *typename; > int typebits; > } typenamemap[] =3D { > - {"file", IFREG}, > - {"dir", IFDIR}, > - {"socket", IFSOCK}, > - {"fifo", IFIFO}, > + {"file", UFS_IFREG}, > + {"dir", UFS_IFDIR}, > + {"socket", UFS_IFSOCK}, > + {"fifo", UFS_IFIFO}, > }; > =20 > CMDFUNCSTART(newtype) > @@ -902,7 +902,7 @@ CMDFUNCSTART(newtype) > =20 > if (!checkactive()) > return 1; > - type =3D DIP(curinode, di_mode) & IFMT; > + type =3D DIP(curinode, di_mode) & UFS_IFMT; > for (tp =3D typenamemap; > tp < &typenamemap[nitems(typenamemap)]; > tp++) { > @@ -917,7 +917,7 @@ CMDFUNCSTART(newtype) > warnx("try one of `file', `dir', `socket', `fifo'"); > return 1; > } > - DIP_SET(curinode, di_mode, DIP(curinode, di_mode) & ~IFMT); > + DIP_SET(curinode, di_mode, DIP(curinode, di_mode) & ~UFS_IFMT); > DIP_SET(curinode, di_mode, DIP(curinode, di_mode) | type); > inodirty(); > printactive(0); >=20 > Modified: head/sbin/fsdb/fsdbutil.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/sbin/fsdb/fsdbutil.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/fsdb/fsdbutil.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -120,20 +120,20 @@ printstat(const char *cp, ino_t inum, union dinode = *dp > time_t t; > =20 > printf("%s: ", cp); > - switch (DIP(dp, di_mode) & IFMT) { > - case IFDIR: > + switch (DIP(dp, di_mode) & UFS_IFMT) { > + case UFS_IFDIR: > puts("directory"); > break; > - case IFREG: > + case UFS_IFREG: > puts("regular file"); > break; > - case IFBLK: > + case UFS_IFBLK: > printf("block special (%#jx)", (uintmax_t)DIP(dp, di_rdev)); > break; > - case IFCHR: > + case UFS_IFCHR: > printf("character special (%#jx)", DIP(dp, di_rdev)); > break; > - case IFLNK: > + case UFS_IFLNK: > fputs("symlink",stdout); > if (DIP(dp, di_size) > 0 && > DIP(dp, di_size) < sblock.fs_maxsymlinklen && > @@ -147,10 +147,10 @@ printstat(const char *cp, ino_t inum, union dinode = *dp > putchar('\n'); > } > break; > - case IFSOCK: > + case UFS_IFSOCK: > puts("socket"); > break; > - case IFIFO: > + case UFS_IFIFO: > puts("fifo"); > break; > } > @@ -338,7 +338,7 @@ checkactivedir(void) > warnx("no current inode\n"); > return 0; > } > - if ((DIP(curinode, di_mode) & IFMT) !=3D IFDIR) { > + if ((DIP(curinode, di_mode) & UFS_IFMT) !=3D UFS_IFDIR) { > warnx("inode %ju not a directory", (uintmax_t)curinum); > return 0; > } > @@ -350,14 +350,14 @@ printactive(int doblocks) > { > if (!checkactive()) > return 1; > - switch (DIP(curinode, di_mode) & IFMT) { > - case IFDIR: > - case IFREG: > - case IFBLK: > - case IFCHR: > - case IFLNK: > - case IFSOCK: > - case IFIFO: > + switch (DIP(curinode, di_mode) & UFS_IFMT) { > + case UFS_IFDIR: > + case UFS_IFREG: > + case UFS_IFBLK: > + case UFS_IFCHR: > + case UFS_IFLNK: > + case UFS_IFSOCK: > + case UFS_IFIFO: > if (doblocks) > printblocks(curinum, curinode); > else > @@ -368,7 +368,7 @@ printactive(int doblocks) > break; > default: > printf("current inode %ju: screwy itype 0%o (mode 0%o)?\n", > - (uintmax_t)curinum, DIP(curinode, di_mode) & IFMT, > + (uintmax_t)curinum, DIP(curinode, di_mode) & UFS_IFMT, > DIP(curinode, di_mode)); > break; > } >=20 > Modified: head/sbin/newfs/mkfs.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/sbin/newfs/mkfs.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/newfs/mkfs.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -883,7 +883,7 @@ fsinit(time_t utime) > /* > * create the root directory > */ > - node.dp1.di_mode =3D IFDIR | UMASK; > + node.dp1.di_mode =3D UFS_IFDIR | UMASK; > node.dp1.di_nlink =3D entries; > node.dp1.di_size =3D makedir(root_dir, entries); > node.dp1.di_db[0] =3D alloc(sblock.fs_fsize, node.dp1.di_mode); > @@ -919,7 +919,7 @@ fsinit(time_t utime) > /* > * create the root directory > */ > - node.dp2.di_mode =3D IFDIR | UMASK; > + node.dp2.di_mode =3D UFS_IFDIR | UMASK; > node.dp2.di_nlink =3D entries; > node.dp2.di_size =3D makedir(root_dir, entries); > node.dp2.di_db[0] =3D alloc(sblock.fs_fsize, node.dp2.di_mode); > @@ -1002,7 +1002,7 @@ goth: > acg.cg_cs.cs_nbfree--; > sblock.fs_cstotal.cs_nbfree--; > fscs[0].cs_nbfree--; > - if (mode & IFDIR) { > + if (mode & UFS_IFDIR) { > acg.cg_cs.cs_ndir++; > sblock.fs_cstotal.cs_ndir++; > fscs[0].cs_ndir++; >=20 > Modified: head/sbin/quotacheck/quotacheck.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/sbin/quotacheck/quotacheck.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/quotacheck/quotacheck.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -370,7 +370,7 @@ chkquota(char *specname, struct quotafile *qfu, struct > for (i =3D 0; i < inosused; i++, ino++) { > if ((dp =3D getnextinode(ino)) =3D=3D NULL || > ino < UFS_ROOTINO || > - (mode =3D DIP(dp, di_mode) & IFMT) =3D=3D 0) > + (mode =3D DIP(dp, di_mode) & UFS_IFMT) =3D=3D 0) > continue; > /* > * XXX: Do not account for UIDs or GIDs that appear > @@ -405,16 +405,16 @@ chkquota(char *specname, struct quotafile *qfu, str= uct > fup =3D addid((u_long)DIP(dp, di_gid), GRPQUOTA, > (char *)0, mntpt); > fup->fu_curinodes++; > - if (mode =3D=3D IFREG || mode =3D=3D IFDIR || > - mode =3D=3D IFLNK) > + if (mode =3D=3D UFS_IFREG || mode =3D=3D UFS_IFDIR || > + mode =3D=3D UFS_IFLNK) > fup->fu_curblocks +=3D DIP(dp, di_blocks); > } > if (qfu) { > fup =3D addid((u_long)DIP(dp, di_uid), USRQUOTA, > (char *)0, mntpt); > fup->fu_curinodes++; > - if (mode =3D=3D IFREG || mode =3D=3D IFDIR || > - mode =3D=3D IFLNK) > + if (mode =3D=3D UFS_IFREG || mode =3D=3D UFS_IFDIR || > + mode =3D=3D UFS_IFLNK) > fup->fu_curblocks +=3D DIP(dp, di_blocks); > } > } >=20 > Modified: head/sbin/restore/dirs.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/sbin/restore/dirs.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/restore/dirs.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -178,7 +178,7 @@ extractdirs(int genmode) > for (;;) { > curfile.name =3D ""; > curfile.action =3D USING; > - if (curfile.mode =3D=3D 0 || (curfile.mode & IFMT) !=3D IFDIR) > + if (curfile.mode =3D=3D 0 || (curfile.mode & UFS_IFMT) !=3D UFS_IFDIR) > break; > itp =3D allocinotab(&curfile, seekpt); > getfile(putdir, putdirattrs, xtrnull); > @@ -205,7 +205,7 @@ void > skipdirs(void) > { > =20 > - while (curfile.ino && (curfile.mode & IFMT) =3D=3D IFDIR) { > + while (curfile.ino && (curfile.mode & UFS_IFMT) =3D=3D UFS_IFDIR) { > skipfile(); > } > } >=20 > Modified: head/sbin/restore/interactive.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/sbin/restore/interactive.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/restore/interactive.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -741,9 +741,9 @@ glob_stat(const char *name, struct stat *stp) > (!vflag && dp->d_ino =3D=3D UFS_WINO)) > return (-1); > if (inodetype(dp->d_ino) =3D=3D NODE) > - stp->st_mode =3D IFDIR; > + stp->st_mode =3D UFS_IFDIR; > else > - stp->st_mode =3D IFREG; > + stp->st_mode =3D UFS_IFREG; > return (0); > } > =20 >=20 > Modified: head/sbin/restore/tape.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/sbin/restore/tape.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/restore/tape.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -592,19 +592,19 @@ extractfile(char *name) > gid =3D curfile.gid; > mode =3D curfile.mode; > flags =3D curfile.file_flags; > - switch (mode & IFMT) { > + switch (mode & UFS_IFMT) { > =20 > default: > fprintf(stderr, "%s: unknown file mode 0%o\n", name, mode); > skipfile(); > return (FAIL); > =20 > - case IFSOCK: > + case UFS_IFSOCK: > vprintf(stdout, "skipped socket %s\n", name); > skipfile(); > return (GOOD); > =20 > - case IFDIR: > + case UFS_IFDIR: > if (mflag) { > ep =3D lookupname(name); > if (ep =3D=3D NULL || ep->e_flags & EXTRACT) > @@ -615,7 +615,7 @@ extractfile(char *name) > vprintf(stdout, "extract file %s\n", name); > return (genliteraldir(name, curfile.ino)); > =20 > - case IFLNK: > + case UFS_IFLNK: > lnkbuf[0] =3D '\0'; > pathlen =3D 0; > buf =3D setupextattr(extsize); > @@ -639,7 +639,7 @@ extractfile(char *name) > } > return (FAIL); > =20 > - case IFIFO: > + case UFS_IFIFO: > vprintf(stdout, "extract fifo %s\n", name); > if (Nflag) { > skipfile(); > @@ -667,8 +667,8 @@ extractfile(char *name) > (void) chflags(name, flags); > return (GOOD); > =20 > - case IFCHR: > - case IFBLK: > + case UFS_IFCHR: > + case UFS_IFBLK: > vprintf(stdout, "extract special file %s\n", name); > if (Nflag) { > skipfile(); > @@ -676,7 +676,7 @@ extractfile(char *name) > } > if (uflag) > (void) unlink(name); > - if (mknod(name, (mode & (IFCHR | IFBLK)) | 0600, > + if (mknod(name, (mode & (UFS_IFCHR | UFS_IFBLK)) | 0600, > (int)curfile.rdev) < 0) { > fprintf(stderr, "%s: cannot create special file: %s\n", > name, strerror(errno)); > @@ -697,7 +697,7 @@ extractfile(char *name) > (void) chflags(name, flags); > return (GOOD); > =20 > - case IFREG: > + case UFS_IFREG: > vprintf(stdout, "extract file %s\n", name); > if (Nflag) { > skipfile(); >=20 > Modified: head/sbin/tunefs/tunefs.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/sbin/tunefs/tunefs.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sbin/tunefs/tunefs.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -1021,7 +1021,7 @@ journal_alloc(int64_t size) > if (sblock.fs_magic =3D=3D FS_UFS1_MAGIC) { > bzero(dp1, sizeof(*dp1)); > dp1->di_size =3D size; > - dp1->di_mode =3D IFREG | IREAD; > + dp1->di_mode =3D UFS_IFREG | UFS_IREAD; > dp1->di_nlink =3D 1; > dp1->di_flags =3D SF_IMMUTABLE | SF_NOUNLINK | UF_NODUMP; > dp1->di_atime =3D utime; > @@ -1030,7 +1030,7 @@ journal_alloc(int64_t size) > } else { > bzero(dp2, sizeof(*dp2)); > dp2->di_size =3D size; > - dp2->di_mode =3D IFREG | IREAD; > + dp2->di_mode =3D UFS_IFREG | UFS_IREAD; > dp2->di_nlink =3D 1; > dp2->di_flags =3D SF_IMMUTABLE | SF_NOUNLINK | UF_NODUMP; > dp2->di_atime =3D utime; >=20 > Modified: head/stand/libsa/nandfs.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/stand/libsa/nandfs.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/stand/libsa/nandfs.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -654,7 +654,7 @@ nandfs_lookup_path(struct nandfs *fs, const char *path > while ((strp =3D strsep(&lpath, "/")) !=3D NULL) { > if (*strp =3D=3D '\0') > continue; > - if ((node->inode->i_mode & IFMT) !=3D IFDIR) { > + if ((node->inode->i_mode & NANDFS_IFMT) !=3D NANDFS_IFDIR) { > nandfs_free_node(node); > node =3D NULL; > goto out; > @@ -710,7 +710,7 @@ nandfs_lookup_path(struct nandfs *fs, const char *path > NANDFS_DEBUG("%s: %.*s has mode %o\n", __func__, > dirent->name_len, dirent->name, node->inode->i_mode); > =20 > - if ((node->inode->i_mode & IFMT) =3D=3D IFLNK) { > + if ((node->inode->i_mode & NANDFS_IFMT) =3D=3D NANDFS_IFLNK) { > NANDFS_DEBUG("%s: %.*s is symlink\n", > __func__, dirent->name_len, dirent->name); > link_len =3D node->inode->i_size; >=20 > Modified: head/stand/libsa/ufs.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/stand/libsa/ufs.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/stand/libsa/ufs.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -557,7 +557,7 @@ ufs_open(upath, f) > /* > * Check that current node is a directory. > */ > - if ((DIP(fp, di_mode) & IFMT) !=3D IFDIR) { > + if ((DIP(fp, di_mode) & UFS_IFMT) !=3D UFS_IFDIR) { > rc =3D ENOTDIR; > goto out; > } > @@ -599,7 +599,7 @@ ufs_open(upath, f) > /* > * Check for symbolic link. > */ > - if ((DIP(fp, di_mode) & IFMT) =3D=3D IFLNK) { > + if ((DIP(fp, di_mode) & UFS_IFMT) =3D=3D UFS_IFLNK) { > int link_len =3D DIP(fp, di_size); > int len; > =20 >=20 > Modified: head/sys/fs/ext2fs/ext2_alloc.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/fs/ext2fs/ext2_alloc.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sys/fs/ext2fs/ext2_alloc.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -393,7 +393,7 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred= =20 > * ext2_dirpref else obtain it using ino_to_cg. The preferred inode is > * always the next inode. > */ > - if ((mode & IFMT) =3D=3D IFDIR) { > + if ((mode & EXT2_IFMT) =3D=3D EXT2_IFDIR) { > cg =3D ext2_dirpref(pip); > if (fs->e2fs_contigdirs[cg] < 255) > fs->e2fs_contigdirs[cg]++; > @@ -1290,7 +1290,7 @@ gotit: > e2fs_gd_get_i_unused(&fs->e2fs_gd[cg]) - 1); > fs->e2fs->e2fs_ficount--; > fs->e2fs_fmod =3D 1; > - if ((mode & IFMT) =3D=3D IFDIR) { > + if ((mode & EXT2_IFMT) =3D=3D EXT2_IFDIR) { > e2fs_gd_set_ndirs(&fs->e2fs_gd[cg], > e2fs_gd_get_ndirs(&fs->e2fs_gd[cg]) + 1); > fs->e2fs_total_dir++; > @@ -1395,7 +1395,7 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode) > EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) > e2fs_gd_set_i_unused(&fs->e2fs_gd[cg], > e2fs_gd_get_i_unused(&fs->e2fs_gd[cg]) + 1); > - if ((mode & IFMT) =3D=3D IFDIR) { > + if ((mode & EXT2_IFMT) =3D=3D EXT2_IFDIR) { > e2fs_gd_set_ndirs(&fs->e2fs_gd[cg], > e2fs_gd_get_ndirs(&fs->e2fs_gd[cg]) - 1); > fs->e2fs_total_dir--; >=20 > Modified: head/sys/fs/ext2fs/ext2_dinode.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/fs/ext2fs/ext2_dinode.h Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sys/fs/ext2fs/ext2_dinode.h Sat Mar 17 01:48:27 2018 (r331083) > @@ -105,7 +105,7 @@ > * Structure of an inode on the disk > */ > struct ext2fs_dinode { > - uint16_t e2di_mode; /* 0: IFMT, permissions; see below. */ > + uint16_t e2di_mode; /* 0: EXT2_IFMT, permissions; below.*/ > uint16_t e2di_uid; /* 2: Owner UID */ > uint32_t e2di_size; /* 4: Size (in bytes) */ > uint32_t e2di_atime; /* 8: Access time */ >=20 > Modified: head/sys/fs/ext2fs/ext2_lookup.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/fs/ext2fs/ext2_lookup.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sys/fs/ext2fs/ext2_lookup.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -591,7 +591,7 @@ found: > * may not delete it (unless she's root). This > * implements append-only directories. > */ > - if ((dp->i_mode & ISVTX) && > + if ((dp->i_mode & EXT2_ISVTX) && > cred->cr_uid !=3D 0 && > cred->cr_uid !=3D dp->i_uid && > VTOI(tdp)->i_uid !=3D cred->cr_uid) { >=20 > Modified: head/sys/fs/ext2fs/ext2_vnops.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/fs/ext2fs/ext2_vnops.c Sat Mar 17 01:40:09 2018 (r331082) > +++ head/sys/fs/ext2fs/ext2_vnops.c Sat Mar 17 01:48:27 2018 (r331083) > @@ -352,7 +352,7 @@ ext2_getattr(struct vop_getattr_args *ap) > */ > vap->va_fsid =3D dev2udev(ip->i_devvp->v_rdev); > vap->va_fileid =3D ip->i_number; > - vap->va_mode =3D ip->i_mode & ~IFMT; > + vap->va_mode =3D ip->i_mode & ~EXT2_IFMT; > vap->va_nlink =3D ip->i_nlink; > vap->va_uid =3D ip->i_uid; > vap->va_gid =3D ip->i_gid; > @@ -534,7 +534,7 @@ ext2_chmod(struct vnode *vp, int mode, struct ucred *c > if (error) > return (EFTYPE); > } > - if (!groupmember(ip->i_gid, cred) && (mode & ISGID)) { > + if (!groupmember(ip->i_gid, cred) && (mode & EXT2_ISGID)) { > error =3D priv_check_cred(cred, PRIV_VFS_SETGID, 0); > if (error) > return (error); > @@ -584,9 +584,10 @@ ext2_chown(struct vnode *vp, uid_t uid, gid_t gid, s= tr > ip->i_gid =3D gid; > ip->i_uid =3D uid; > ip->i_flag |=3D IN_CHANGE; > - if ((ip->i_mode & (ISUID | ISGID)) && (ouid !=3D uid || ogid !=3D gid))= { > + if ((ip->i_mode & (EXT2_ISUID | EXT2_ISGID)) && > + (ouid !=3D uid || ogid !=3D gid)) { > if (priv_check_cred(cred, PRIV_VFS_RETAINSUGID, 0) !=3D 0) > - ip->i_mode &=3D ~(ISUID | ISGID); > + ip->i_mode &=3D ~(EXT2_ISUID | EXT2_ISGID); > } > return (0); > } > @@ -843,7 +844,7 @@ abortit: > error =3D EPERM; > goto abortit; > } > - if ((ip->i_mode & IFMT) =3D=3D IFDIR) { > + if ((ip->i_mode & EXT2_IFMT) =3D=3D EXT2_IFDIR) { > /* > * Avoid ".", "..", and aliases of "." for obvious reasons. > */ > @@ -974,7 +975,7 @@ abortit: > * to it. Also, ensure source and target are compatible > * (both directories, or both not directories). > */ > - if ((xp->i_mode & IFMT) =3D=3D IFDIR) { > + if ((xp->i_mode & EXT2_IFMT) =3D=3D EXT2_IFDIR) { > if (!ext2_dirempty(xp, dp->i_number, tcnp->cn_cred)) { > error =3D ENOTEMPTY; > goto bad; > @@ -1318,7 +1319,7 @@ ext2_mkdir(struct vop_mkdir_args *ap) > goto out; > } > dmode =3D vap->va_mode & 0777; > - dmode |=3D IFDIR; > + dmode |=3D EXT2_IFDIR; > /* > * Must simulate part of ext2_makeinode here to acquire the inode, > * but not have it entered in the parent directory. The entry is > @@ -1341,8 +1342,8 @@ ext2_mkdir(struct vop_mkdir_args *ap) > * 'give it away' so that the SUID is still forced on. > */ > if ((dvp->v_mount->mnt_flag & MNT_SUIDDIR) && > - (dp->i_mode & ISUID) && dp->i_uid) { > - dmode |=3D ISUID; > + (dp->i_mode & EXT2_ISUID) && dp->i_uid) { > + dmode |=3D EXT2_ISUID; > ip->i_uid =3D dp->i_uid; > } else { > ip->i_uid =3D cnp->cn_cred->cr_uid; > @@ -1521,7 +1522,7 @@ ext2_symlink(struct vop_symlink_args *ap) > struct inode *ip; > int len, error; >=20 > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > 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" This commit breaks buildworld with error Building /usr/obj/usr/src/amd64.amd64/stand/libsa/nandfs.o --- all_subdir_sbin --- ERROR: ctfmerge: No ctf sections found to merge --- all_subdir_stand --- --- nandfs.o --- /usr/src/stand/libsa/nandfs.c:657:30: error: use of undeclared identifier '= NANDFS_IFMT' if ((node->inode->i_mode & NANDFS_IFMT) !=3D NANDFS_IFDIR) { ^ /usr/src/stand/libsa/nandfs.c:657:46: error: use of undeclared identifier '= NANDFS_IFDIR' if ((node->inode->i_mode & NANDFS_IFMT) !=3D NANDFS_IFDIR) { ^ /usr/src/stand/libsa/nandfs.c:713:30: error: use of undeclared identifier '= NANDFS_IFMT' if ((node->inode->i_mode & NANDFS_IFMT) =3D=3D NANDFS_IFLNK= ) { ^ /usr/src/stand/libsa/nandfs.c:713:46: error: use of undeclared identifier '= NANDFS_IFLNK' if ((node->inode->i_mode & NANDFS_IFMT) =3D=3D NANDFS_IFLNK= ) { ^ 4 errors generated. Kind regards, O. Hartmann --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/Gv+EGY8gAgcusfzMloOHe2C Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWqy+pAAKCRDS528fyFhY lLg6Af9HQFbQazOmViK2C36LFCh4F03LThhHJAkeQJCLJncIGQMgL+BqtyKhzXJV 6Ym28twjM87xTShb4fvvv5abXyRLAgCcn+ScnVjskQLsvpieY40khsrqQkYese8D UOK2xy4gp0omrCGXhWSf0TsJc5eN5OIMZwD33p6r8YomOMhzDA8a =rXOQ -----END PGP SIGNATURE----- --Sig_/Gv+EGY8gAgcusfzMloOHe2C-- From owner-svn-src-head@freebsd.org Sat Mar 17 07:23:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23CF0F4CEED; Sat, 17 Mar 2018 07:23:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 8C2C56C063; Sat, 17 Mar 2018 07:23:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id AD98E107F7C; Sat, 17 Mar 2018 18:23:40 +1100 (AEDT) Date: Sat, 17 Mar 2018 18:23:39 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Maste cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331083 - in head: lib/libufs sbin/dump sbin/fsck_ffs sbin/fsdb sbin/newfs sbin/quotacheck sbin/restore sbin/tunefs stand/libsa sys/fs/ext2fs sys/fs/nandfs sys/ufs/ffs sys/ufs/ufs usr.s... In-Reply-To: <201803170148.w2H1mR46082991@repo.freebsd.org> Message-ID: <20180317161131.W962@besplex.bde.org> References: <201803170148.w2H1mR46082991@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=OiG0oiQOHz3uAAuwjYQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 07:23:51 -0000 On Sat, 17 Mar 2018, Ed Maste wrote: > Log: > Prefix UFS symbols with UFS_ to reduce namespace pollution > > Followup to r313780. Also prefix ext2's and nandfs's versions with > EXT2_ and NANDFS_. S_IFMT is already MI. So this churnge is mostly wrong unless file systems do the identity translations from their "internal" IFMT to S_IFMT, etc., everywhere, but they mostly don't. Using IFMT, etc., was correct under the assumption that IFMT is just an old spelling of S_IFMT. Now it is assumed that FOOFS_IFMT is just a new spelling of S_IFMT. There are many more logically different translations that have to be physically the identity to work. UFS_IFMT is a wrong spelling for ffs. If ffs were actually different from ufs, then there would be different file systems layered under ufs (or is it different file systems layered under ffs?). ext2fs needs a separate set of mode macros less than ffs, since it has less trivial translation layer that converts from the on-disk inode to the in-core inode. Translations are less confusing for file flags since they are only the identity for ffs. All file systems use the MI SF_* and convert to that if necessary. ffs assumes that SF_* match its disk encoding and will never change. ext2fs has to do nontrivial translations of file flags and does this at low levels so that upper levels can just use SF_* like ffs, except with no assumptions. File modes should be handled similarly. IFMT is then just a better (shorter) spelling of S_IFMT like it used to be. Bruce From owner-svn-src-head@freebsd.org Sat Mar 17 11:41:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0379F5FCB8; Sat, 17 Mar 2018 11:41:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F5AB772B4; Sat, 17 Mar 2018 11:41:07 +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 61AD111F11; Sat, 17 Mar 2018 11:41:07 +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 w2HBf7K8090208; Sat, 17 Mar 2018 11:41:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2HBf6f9090203; Sat, 17 Mar 2018 11:41:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201803171141.w2HBf6f9090203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 17 Mar 2018 11:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331094 - in head: lib/libmd share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: lib/libmd share/man/man9 X-SVN-Commit-Revision: 331094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 11:41:08 -0000 Author: trasz Date: Sat Mar 17 11:41:06 2018 New Revision: 331094 URL: https://svnweb.freebsd.org/changeset/base/331094 Log: Fix formatting errors that resulted in apropos(1) output looking weird. MFC after: 2 weeks Modified: head/lib/libmd/sha512.3 head/share/man/man9/cnv.9 head/share/man/man9/owll.9 head/share/man/man9/rwlock.9 head/share/man/man9/zone.9 Modified: head/lib/libmd/sha512.3 ============================================================================== --- head/lib/libmd/sha512.3 Sat Mar 17 07:04:41 2018 (r331093) +++ head/lib/libmd/sha512.3 Sat Mar 17 11:41:06 2018 (r331094) @@ -26,7 +26,7 @@ .Nm SHA384_End , .Nm SHA384_File , .Nm SHA384_FileChunk , -.Nm SHA384_Data, +.Nm SHA384_Data , .Nm SHA512_256_Init , .Nm SHA512_256_Update , .Nm SHA512_256_Final , Modified: head/share/man/man9/cnv.9 ============================================================================== --- head/share/man/man9/cnv.9 Sat Mar 17 07:04:41 2018 (r331093) +++ head/share/man/man9/cnv.9 Sat Mar 17 11:41:06 2018 (r331094) @@ -29,9 +29,9 @@ .Dt CNV 9 .Os .Sh NAME -.Nm cnvlist_get, -.Nm cnvlist_take, -.Nm cnvlist_free, +.Nm cnvlist_get , +.Nm cnvlist_take , +.Nm cnvlist_free .Nd "API for managing name/value pairs by cookie." .Sh LIBRARY .Lb libnv Modified: head/share/man/man9/owll.9 ============================================================================== --- head/share/man/man9/owll.9 Sat Mar 17 07:04:41 2018 (r331093) +++ head/share/man/man9/owll.9 Sat Mar 17 11:41:06 2018 (r331094) @@ -29,9 +29,9 @@ .Os .Sh NAME .Nm owll -.Nm OWLL_WRITE_ONE, -.Nm OWLL_WRITE_ZERO, -.Nm OWLL_READ_DATA, +.Nm OWLL_WRITE_ONE , +.Nm OWLL_WRITE_ZERO , +.Nm OWLL_READ_DATA , .Nm OWLL_REASET_AND_PRESENCE .Nd Dallas Semiconductor 1-Wire Link Layer Interface .Sh SYNOPSIS Modified: head/share/man/man9/rwlock.9 ============================================================================== --- head/share/man/man9/rwlock.9 Sat Mar 17 07:04:41 2018 (r331093) +++ head/share/man/man9/rwlock.9 Sat Mar 17 11:41:06 2018 (r331094) @@ -30,7 +30,7 @@ .Sh NAME .Nm rwlock , .Nm rw_init , -.Nm rw_init_flags, +.Nm rw_init_flags , .Nm rw_destroy , .Nm rw_rlock , .Nm rw_wlock , Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Sat Mar 17 07:04:41 2018 (r331093) +++ head/share/man/man9/zone.9 Sat Mar 17 11:41:06 2018 (r331094) @@ -35,10 +35,10 @@ .Nm uma_zfree , .Nm uma_zfree_arg , .Nm uma_zdestroy , -.Nm uma_zone_set_max, -.Nm uma_zone_get_max, -.Nm uma_zone_get_cur, -.Nm uma_zone_set_warning, +.Nm uma_zone_set_max , +.Nm uma_zone_get_max , +.Nm uma_zone_get_cur , +.Nm uma_zone_set_warning , .Nm uma_zone_set_maxaction .Nd zone allocator .Sh SYNOPSIS From owner-svn-src-head@freebsd.org Sat Mar 17 12:59:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A1FE32E; Sat, 17 Mar 2018 12:59:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A96E47AAEC; Sat, 17 Mar 2018 12:59: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 A26A112A76; Sat, 17 Mar 2018 12:59: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 w2HCxvS4028083; Sat, 17 Mar 2018 12:59:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2HCxtwJ028059; Sat, 17 Mar 2018 12:59:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803171259.w2HCxtwJ028059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 17 Mar 2018 12:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331095 - in head: lib/libufs sbin/dump sbin/fsck_ffs sbin/fsdb sbin/newfs sbin/quotacheck sbin/restore sbin/tunefs stand/libsa sys/fs/ext2fs sys/fs/nandfs sys/ufs/ffs sys/ufs/ufs usr.s... X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: lib/libufs sbin/dump sbin/fsck_ffs sbin/fsdb sbin/newfs sbin/quotacheck sbin/restore sbin/tunefs stand/libsa sys/fs/ext2fs sys/fs/nandfs sys/ufs/ffs sys/ufs/ufs usr.sbin/quot X-SVN-Commit-Revision: 331095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 12:59:58 -0000 Author: emaste Date: Sat Mar 17 12:59:55 2018 New Revision: 331095 URL: https://svnweb.freebsd.org/changeset/base/331095 Log: Revert r313780 (UFS_ prefix) Modified: head/lib/libufs/inode.c head/sbin/dump/main.c head/sbin/dump/traverse.c head/sbin/fsck_ffs/dir.c head/sbin/fsck_ffs/fsutil.c head/sbin/fsck_ffs/inode.c head/sbin/fsck_ffs/pass1.c head/sbin/fsck_ffs/pass2.c head/sbin/fsck_ffs/suj.c head/sbin/fsdb/fsdb.c head/sbin/fsdb/fsdbutil.c head/sbin/newfs/mkfs.c head/sbin/quotacheck/quotacheck.c head/sbin/restore/dirs.c head/sbin/restore/interactive.c head/sbin/restore/tape.c head/sbin/tunefs/tunefs.c head/stand/libsa/nandfs.c head/stand/libsa/ufs.c head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/inode.h head/sys/fs/nandfs/nandfs.h head/sys/fs/nandfs/nandfs_vnops.c head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ffs/softdep.h head/sys/ufs/ufs/dinode.h head/sys/ufs/ufs/inode.h head/sys/ufs/ufs/ufs_lookup.c head/sys/ufs/ufs/ufs_vnops.c head/usr.sbin/quot/quot.c Modified: head/lib/libufs/inode.c ============================================================================== --- head/lib/libufs/inode.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/lib/libufs/inode.c Sat Mar 17 12:59:55 2018 (r331095) @@ -81,12 +81,12 @@ getino(struct uufsd *disk, void **dino, ino_t inode, i gotit: switch (disk->d_ufs) { case 1: dp1 = &((struct ufs1_dinode *)inoblock)[inode - min]; - *mode = dp1->di_mode & UFS_IFMT; + *mode = dp1->di_mode & IFMT; *dino = dp1; return (0); case 2: dp2 = &((struct ufs2_dinode *)inoblock)[inode - min]; - *mode = dp2->di_mode & UFS_IFMT; + *mode = dp2->di_mode & IFMT; *dino = dp2; return (0); default: Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/dump/main.c Sat Mar 17 12:59:55 2018 (r331095) @@ -550,7 +550,7 @@ main(int argc, char *argv[]) * Skip directory inodes deleted and maybe reallocated */ dp = getinode(ino, &mode); - if (mode != UFS_IFDIR) + if (mode != IFDIR) continue; (void)dumpino(dp, ino); } @@ -569,7 +569,7 @@ main(int argc, char *argv[]) * Skip inodes deleted and reallocated as directories. */ dp = getinode(ino, &mode); - if (mode == UFS_IFDIR) + if (mode == IFDIR) continue; (void)dumpino(dp, ino); } Modified: head/sbin/dump/traverse.c ============================================================================== --- head/sbin/dump/traverse.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/dump/traverse.c Sat Mar 17 12:59:55 2018 (r331095) @@ -195,7 +195,7 @@ mapfiles(ino_t maxino, long *tapesize) for (i = 0; i < inosused; i++, ino++) { if (ino < UFS_ROOTINO || (dp = getinode(ino, &mode)) == NULL || - (mode & UFS_IFMT) == 0) + (mode & IFMT) == 0) continue; if (ino >= maxino) { msg("Skipping inode %ju >= maxino %ju\n", @@ -209,19 +209,19 @@ mapfiles(ino_t maxino, long *tapesize) * (this is used in mapdirs()). */ SETINO(ino, usedinomap); - if (mode == UFS_IFDIR) + if (mode == IFDIR) SETINO(ino, dumpdirmap); if (WANTTODUMP(dp)) { SETINO(ino, dumpinomap); - if (mode != UFS_IFREG && - mode != UFS_IFDIR && - mode != UFS_IFLNK) + if (mode != IFREG && + mode != IFDIR && + mode != IFLNK) *tapesize += 1; else *tapesize += blockest(dp); continue; } - if (mode == UFS_IFDIR) { + if (mode == IFDIR) { if (!nonodump && (DIP(dp, di_flags) & UF_NODUMP)) CLRINO(ino, usedinomap); @@ -429,7 +429,7 @@ searchdir( * Add back to dumpdirmap and remove from usedinomap * to propagate nodump. */ - if (mode == UFS_IFDIR) { + if (mode == IFDIR) { SETINO(dp->d_ino, dumpdirmap); CLRINO(dp->d_ino, usedinomap); ret |= HASSUBDIRS; @@ -554,7 +554,7 @@ dumpino(union dinode *dp, ino_t ino) default: msg("Warning: undefined file type 0%o\n", - DIP(dp, di_mode) & UFS_IFMT); + DIP(dp, di_mode) & IFMT); return; } if (DIP(dp, di_size) > UFS_NDADDR * sblock->fs_bsize) { @@ -890,11 +890,11 @@ getinode(ino_t inum, int *modep) gotit: if (sblock->fs_magic == FS_UFS1_MAGIC) { dp1 = &((struct ufs1_dinode *)inoblock)[inum - minino]; - *modep = (dp1->di_mode & UFS_IFMT); + *modep = (dp1->di_mode & IFMT); return ((union dinode *)dp1); } dp2 = &((struct ufs2_dinode *)inoblock)[inum - minino]; - *modep = (dp2->di_mode & UFS_IFMT); + *modep = (dp2->di_mode & IFMT); return ((union dinode *)dp2); } Modified: head/sbin/fsck_ffs/dir.c ============================================================================== --- head/sbin/fsck_ffs/dir.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/fsck_ffs/dir.c Sat Mar 17 12:59:55 2018 (r331095) @@ -264,7 +264,7 @@ fileerror(ino_t cwd, ino_t ino, const char *errmesg) dp = ginode(ino); if (ftypeok(dp)) pfatal("%s=%s\n", - (DIP(dp, di_mode) & UFS_IFMT) == UFS_IFDIR ? "DIR" : "FILE", + (DIP(dp, di_mode) & IFMT) == IFDIR ? "DIR" : "FILE", pathbuf); else pfatal("NAME=%s\n", pathbuf); @@ -308,8 +308,7 @@ adjust(struct inodesc *idesc, int lcnt) } if (lcnt != 0) { pwarn("LINK COUNT %s", (lfdir == idesc->id_number) ? lfname : - ((DIP(dp, di_mode) & UFS_IFMT) == UFS_IFDIR ? - "DIR" : "FILE")); + ((DIP(dp, di_mode) & IFMT) == IFDIR ? "DIR" : "FILE")); pinode(idesc->id_number); printf(" COUNT %d SHOULD BE %d", DIP(dp, di_nlink), DIP(dp, di_nlink) - lcnt); @@ -389,7 +388,7 @@ linkup(ino_t orphan, ino_t parentdir, char *name) memset(&idesc, 0, sizeof(struct inodesc)); dp = ginode(orphan); - lostdir = (DIP(dp, di_mode) & UFS_IFMT) == UFS_IFDIR; + lostdir = (DIP(dp, di_mode) & IFMT) == IFDIR; pwarn("UNREF %s ", lostdir ? "DIR" : "FILE"); pinode(orphan); if (preen && DIP(dp, di_size) == 0) @@ -437,7 +436,7 @@ linkup(ino_t orphan, ino_t parentdir, char *name) } } dp = ginode(lfdir); - if ((DIP(dp, di_mode) & UFS_IFMT) != UFS_IFDIR) { + if ((DIP(dp, di_mode) & IFMT) != IFDIR) { pfatal("lost+found IS NOT A DIRECTORY"); if (reply("REALLOCATE") == 0) return (0); @@ -616,7 +615,7 @@ allocdir(ino_t parent, ino_t request, int mode) struct inoinfo *inp; struct dirtemplate *dirp; - ino = allocino(request, UFS_IFDIR|mode); + ino = allocino(request, IFDIR|mode); dirp = &dirhead; dirp->dot_ino = ino; dirp->dotdot_ino = parent; Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/fsck_ffs/fsutil.c Sat Mar 17 12:59:55 2018 (r331095) @@ -100,15 +100,15 @@ fsutilinit(void) int ftypeok(union dinode *dp) { - switch (DIP(dp, di_mode) & UFS_IFMT) { + switch (DIP(dp, di_mode) & IFMT) { - case UFS_IFDIR: - case UFS_IFREG: - case UFS_IFBLK: - case UFS_IFCHR: - case UFS_IFLNK: - case UFS_IFSOCK: - case UFS_IFIFO: + case IFDIR: + case IFREG: + case IFBLK: + case IFCHR: + case IFLNK: + case IFSOCK: + case IFIFO: return (1); default: Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/fsck_ffs/inode.c Sat Mar 17 12:59:55 2018 (r331095) @@ -71,8 +71,8 @@ ckinode(union dinode *dp, struct inodesc *idesc) idesc->id_lbn = -1; idesc->id_entryno = 0; idesc->id_filesize = DIP(dp, di_size); - mode = DIP(dp, di_mode) & UFS_IFMT; - if (mode == UFS_IFBLK || mode == UFS_IFCHR || (mode == UFS_IFLNK && + mode = DIP(dp, di_mode) & IFMT; + if (mode == IFBLK || mode == IFCHR || (mode == IFLNK && DIP(dp, di_size) < (unsigned)sblock.fs_maxsymlinklen)) return (KEEPON); if (sblock.fs_magic == FS_UFS1_MAGIC) @@ -347,7 +347,7 @@ getnextinode(ino_t inumber, int rebuildcg) * Try to determine if we have reached the end of the * allocated inodes. */ - mode = DIP(dp, di_mode) & UFS_IFMT; + mode = DIP(dp, di_mode) & IFMT; if (mode == 0) { if (memcmp(dp->dp2.di_db, ufs2_zino.di_db, UFS_NDADDR * sizeof(ufs2_daddr_t)) || @@ -362,9 +362,9 @@ getnextinode(ino_t inumber, int rebuildcg) ndb = howmany(DIP(dp, di_size), sblock.fs_bsize); if (ndb < 0) return (NULL); - if (mode == UFS_IFBLK || mode == UFS_IFCHR) + if (mode == IFBLK || mode == IFCHR) ndb++; - if (mode == UFS_IFLNK) { + if (mode == IFLNK) { /* * Fake ndb value so direct/indirect block checks below * will detect any garbage after symlink string. @@ -533,7 +533,7 @@ clri(struct inodesc *idesc, const char *type, int flag dp = ginode(idesc->id_number); if (flag == 1) { pwarn("%s %s", type, - (DIP(dp, di_mode) & UFS_IFMT) == UFS_IFDIR ? "DIR":"FILE"); + (DIP(dp, di_mode) & IFMT) == IFDIR ? "DIR" : "FILE"); pinode(idesc->id_number); } if (preen || reply("CLEAR") == 1) { @@ -681,13 +681,13 @@ allocino(ino_t request, int type) return (0); setbit(cg_inosused(cgp), ino % sblock.fs_ipg); cgp->cg_cs.cs_nifree--; - switch (type & UFS_IFMT) { - case UFS_IFDIR: + switch (type & IFMT) { + case IFDIR: inoinfo(ino)->ino_state = DSTATE; cgp->cg_cs.cs_ndir++; break; - case UFS_IFREG: - case UFS_IFLNK: + case IFREG: + case IFLNK: inoinfo(ino)->ino_state = FSTATE; break; default: Modified: head/sbin/fsck_ffs/pass1.c ============================================================================== --- head/sbin/fsck_ffs/pass1.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/fsck_ffs/pass1.c Sat Mar 17 12:59:55 2018 (r331095) @@ -251,7 +251,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r if ((dp = getnextinode(inumber, rebuildcg)) == NULL) return (0); - mode = DIP(dp, di_mode) & UFS_IFMT; + mode = DIP(dp, di_mode) & IFMT; if (mode == 0) { if ((sblock.fs_magic == FS_UFS1_MAGIC && (memcmp(dp->dp1.di_db, ufs1_zino.di_db, @@ -284,25 +284,25 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r kernmaxfilesize = sblock.fs_maxfilesize; if (DIP(dp, di_size) > kernmaxfilesize || DIP(dp, di_size) > sblock.fs_maxfilesize || - (mode == UFS_IFDIR && DIP(dp, di_size) > MAXDIRSIZE)) { + (mode == IFDIR && DIP(dp, di_size) > MAXDIRSIZE)) { if (debug) printf("bad size %ju:", (uintmax_t)DIP(dp, di_size)); goto unknown; } - if (!preen && mode == UFS_IFMT && reply("HOLD BAD BLOCK") == 1) { + if (!preen && mode == IFMT && reply("HOLD BAD BLOCK") == 1) { dp = ginode(inumber); DIP_SET(dp, di_size, sblock.fs_fsize); - DIP_SET(dp, di_mode, UFS_IFREG|0600); + DIP_SET(dp, di_mode, IFREG|0600); inodirty(); } - if ((mode == UFS_IFBLK || mode == UFS_IFCHR || mode == UFS_IFIFO || - mode == UFS_IFSOCK) && DIP(dp, di_size) != 0) { + if ((mode == IFBLK || mode == IFCHR || mode == IFIFO || + mode == IFSOCK) && DIP(dp, di_size) != 0) { if (debug) printf("bad special-file size %ju:", (uintmax_t)DIP(dp, di_size)); goto unknown; } - if ((mode == UFS_IFBLK || mode == UFS_IFCHR) && + if ((mode == IFBLK || mode == IFCHR) && (dev_t)DIP(dp, di_rdev) == NODEV) { if (debug) printf("bad special-file rdev NODEV:"); @@ -315,9 +315,9 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r (uintmax_t)DIP(dp, di_size), (uintmax_t)ndb); goto unknown; } - if (mode == UFS_IFBLK || mode == UFS_IFCHR) + if (mode == IFBLK || mode == IFCHR) ndb++; - if (mode == UFS_IFLNK) { + if (mode == IFLNK) { /* * Fake ndb value so direct/indirect block checks below * will detect any garbage after symlink string. @@ -357,7 +357,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r goto unknown; n_files++; inoinfo(inumber)->ino_linkcnt = DIP(dp, di_nlink); - if (mode == UFS_IFDIR) { + if (mode == IFDIR) { if (DIP(dp, di_size) == 0) inoinfo(inumber)->ino_state = DCLEAR; else if (DIP(dp, di_nlink) <= 0) Modified: head/sbin/fsck_ffs/pass2.c ============================================================================== --- head/sbin/fsck_ffs/pass2.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/fsck_ffs/pass2.c Sat Mar 17 12:59:55 2018 (r331095) @@ -112,8 +112,8 @@ pass2(void) exit(EEXIT); } dp = ginode(UFS_ROOTINO); - DIP_SET(dp, di_mode, DIP(dp, di_mode) & ~UFS_IFMT); - DIP_SET(dp, di_mode, DIP(dp, di_mode) | UFS_IFDIR); + DIP_SET(dp, di_mode, DIP(dp, di_mode) & ~IFMT); + DIP_SET(dp, di_mode, DIP(dp, di_mode) | IFDIR); inodirty(); break; @@ -184,7 +184,7 @@ pass2(void) } dp = &dino; memset(dp, 0, sizeof(struct ufs2_dinode)); - DIP_SET(dp, di_mode, UFS_IFDIR); + DIP_SET(dp, di_mode, IFDIR); DIP_SET(dp, di_size, inp->i_isize); for (i = 0; i < MIN(inp->i_numblks, UFS_NDADDR); i++) DIP_SET(dp, di_db[i], inp->i_blks[i]); @@ -478,8 +478,7 @@ again: break; dp = ginode(dirp->d_ino); inoinfo(dirp->d_ino)->ino_state = - (DIP(dp, di_mode) & UFS_IFMT) == UFS_IFDIR ? - DSTATE : FSTATE; + (DIP(dp, di_mode) & IFMT) == IFDIR ? DSTATE : FSTATE; inoinfo(dirp->d_ino)->ino_linkcnt = DIP(dp, di_nlink); goto again; Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/fsck_ffs/suj.c Sat Mar 17 12:59:55 2018 (r331095) @@ -605,7 +605,7 @@ ino_free(ino_t ino, int mode) if (ino < cgp->cg_irotor) cgp->cg_irotor = ino; cgp->cg_cs.cs_nifree++; - if ((mode & UFS_IFMT) == UFS_IFDIR) { + if ((mode & IFMT) == IFDIR) { freedir++; cgp->cg_cs.cs_ndir--; } @@ -748,7 +748,7 @@ ino_blkatoff(union dinode *ip, ino_t ino, ufs_lbn_t lb /* * Now direct and indirect. */ - if (DIP(ip, di_mode) == UFS_IFLNK && + if (DIP(ip, di_mode) == IFLNK && DIP(ip, di_size) < fs->fs_maxsymlinklen) return (0); if (lbn >= 0 && lbn < UFS_NDADDR) { @@ -853,7 +853,7 @@ ino_isat(ino_t parent, off_t diroff, ino_t child, int *isdot = 0; dip = ino_read(parent); *mode = DIP(dip, di_mode); - if ((*mode & UFS_IFMT) != UFS_IFDIR) { + if ((*mode & IFMT) != IFDIR) { if (debug) { /* * This can happen if the parent inode @@ -1013,7 +1013,7 @@ ino_visit(union dinode *ip, ino_t ino, ino_visitor vis int i; size = DIP(ip, di_size); - mode = DIP(ip, di_mode) & UFS_IFMT; + mode = DIP(ip, di_mode) & IFMT; fragcnt = 0; if ((flags & VISIT_EXT) && fs->fs_magic == FS_UFS2_MAGIC && ip->dp2.di_extsize) { @@ -1027,8 +1027,8 @@ ino_visit(union dinode *ip, ino_t ino, ino_visitor vis } } /* Skip datablocks for short links and devices. */ - if (mode == UFS_IFBLK || mode == UFS_IFCHR || - (mode == UFS_IFLNK && size < fs->fs_maxsymlinklen)) + if (mode == IFBLK || mode == IFCHR || + (mode == IFLNK && size < fs->fs_maxsymlinklen)) return (fragcnt); for (i = 0; i < UFS_NDADDR; i++) { if (DIP(ip, di_db[i]) == 0) @@ -1265,7 +1265,7 @@ ino_reclaim(union dinode *ip, ino_t ino, int mode) (uintmax_t)ino, DIP(ip, di_nlink), DIP(ip, di_mode)); /* We are freeing an inode or directory. */ - if ((DIP(ip, di_mode) & UFS_IFMT) == UFS_IFDIR) + if ((DIP(ip, di_mode) & IFMT) == IFDIR) ino_visit(ip, ino, ino_free_children, 0); DIP_SET(ip, di_nlink, 0); ino_visit(ip, ino, blk_free_visit, VISIT_EXT | VISIT_INDIR); @@ -1300,7 +1300,7 @@ ino_decr(ino_t ino) if (mode == 0) err_suj("Inode %d has a link of %d with 0 mode\n", ino, nlink); nlink--; - if ((mode & UFS_IFMT) == UFS_IFDIR) + if ((mode & IFMT) == IFDIR) reqlink = 2; else reqlink = 1; @@ -1335,13 +1335,13 @@ ino_adjust(struct suj_ino *sino) nlink = sino->si_nlink; ino = sino->si_ino; - mode = sino->si_mode & UFS_IFMT; + mode = sino->si_mode & IFMT; /* * If it's a directory with no dot links, it was truncated before * the name was cleared. We need to clear the dirent that * points at it. */ - if (mode == UFS_IFDIR && nlink == 1 && sino->si_dotlinks == 0) { + if (mode == IFDIR && nlink == 1 && sino->si_dotlinks == 0) { sino->si_nlink = nlink = 0; TAILQ_FOREACH(srec, &sino->si_recs, sr_next) { rrec = (struct jrefrec *)srec->sr_rec; @@ -1358,7 +1358,7 @@ ino_adjust(struct suj_ino *sino) * If it's a directory with no real names pointing to it go ahead * and truncate it. This will free any children. */ - if (mode == UFS_IFDIR && nlink - sino->si_dotlinks == 0) { + if (mode == IFDIR && nlink - sino->si_dotlinks == 0) { sino->si_nlink = nlink = 0; /* * Mark any .. links so they know not to free this inode @@ -1374,7 +1374,7 @@ ino_adjust(struct suj_ino *sino) } } ip = ino_read(ino); - mode = DIP(ip, di_mode) & UFS_IFMT; + mode = DIP(ip, di_mode) & IFMT; if (nlink > UFS_LINK_MAX) err_suj("ino %ju nlink manipulation error, new %ju, old %d\n", (uintmax_t)ino, (uintmax_t)nlink, DIP(ip, di_nlink)); @@ -1393,7 +1393,7 @@ ino_adjust(struct suj_ino *sino) if (mode != sino->si_mode && debug) printf("ino %ju, mode %o != %o\n", (uintmax_t)ino, mode, sino->si_mode); - if ((mode & UFS_IFMT) == UFS_IFDIR) + if ((mode & IFMT) == IFDIR) reqlink = 2; else reqlink = 1; @@ -1506,15 +1506,15 @@ ino_trunc(ino_t ino, off_t size) int mode; ip = ino_read(ino); - mode = DIP(ip, di_mode) & UFS_IFMT; + mode = DIP(ip, di_mode) & IFMT; cursize = DIP(ip, di_size); if (debug) printf("Truncating ino %ju, mode %o to size %jd from size %jd\n", (uintmax_t)ino, mode, size, cursize); /* Skip datablocks for short links and devices. */ - if (mode == 0 || mode == UFS_IFBLK || mode == UFS_IFCHR || - (mode == UFS_IFLNK && cursize < fs->fs_maxsymlinklen)) + if (mode == 0 || mode == IFBLK || mode == IFCHR || + (mode == IFLNK && cursize < fs->fs_maxsymlinklen)) return; /* Don't extend. */ if (size > cursize) @@ -1587,7 +1587,7 @@ ino_trunc(ino_t ino, off_t size) * uninitialized space later. */ off = blkoff(fs, size); - if (off && DIP(ip, di_mode) != UFS_IFDIR) { + if (off && DIP(ip, di_mode) != IFDIR) { uint8_t *buf; long clrsize; @@ -1635,7 +1635,7 @@ ino_check(struct suj_ino *sino) rrec = (struct jrefrec *)srec->sr_rec; isat = ino_isat(rrec->jr_parent, rrec->jr_diroff, rrec->jr_ino, &mode, &isdot); - if (isat && (mode & UFS_IFMT) != (rrec->jr_mode & UFS_IFMT)) + if (isat && (mode & IFMT) != (rrec->jr_mode & IFMT)) err_suj("Inode mode/directory type mismatch %o != %o\n", mode, rrec->jr_mode); if (debug) @@ -1646,7 +1646,7 @@ ino_check(struct suj_ino *sino) (uintmax_t)rrec->jr_parent, (uintmax_t)rrec->jr_diroff, rrec->jr_mode, isat, isdot); - mode = rrec->jr_mode & UFS_IFMT; + mode = rrec->jr_mode & IFMT; if (rrec->jr_op == JOP_REMREF) removes++; newlinks += isat; @@ -1915,7 +1915,7 @@ ino_unlinked(void) fs->fs_sujfree = 0; while (ino != 0) { ip = ino_read(ino); - mode = DIP(ip, di_mode) & UFS_IFMT; + mode = DIP(ip, di_mode) & IFMT; inon = DIP(ip, di_freelink); DIP_SET(ip, di_freelink, 0); /* @@ -2371,7 +2371,7 @@ suj_verifyino(union dinode *ip) return (-1); } - if (DIP(ip, di_mode) != (UFS_IFREG | UFS_IREAD)) { + if (DIP(ip, di_mode) != (IFREG | IREAD)) { printf("Invalid mode %o for journal inode %ju\n", DIP(ip, di_mode), (uintmax_t)sujino); return (-1); Modified: head/sbin/fsdb/fsdb.c ============================================================================== --- head/sbin/fsdb/fsdb.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/fsdb/fsdb.c Sat Mar 17 12:59:55 2018 (r331095) @@ -512,14 +512,14 @@ CMDFUNCSTART(findblk) /* Get on-disk inode aka dinode. */ curinum = inum; curinode = ginode(inum); - /* Find UFS_IFLNK dinode with allocated data blocks. */ - switch (DIP(curinode, di_mode) & UFS_IFMT) { - case UFS_IFDIR: - case UFS_IFREG: + /* Find IFLNK dinode with allocated data blocks. */ + switch (DIP(curinode, di_mode) & IFMT) { + case IFDIR: + case IFREG: if (DIP(curinode, di_blocks) == 0) continue; break; - case UFS_IFLNK: + case IFLNK: { uint64_t size = DIP(curinode, di_size); if (size > 0 && size < sblock.fs_maxsymlinklen && @@ -889,10 +889,10 @@ struct typemap { const char *typename; int typebits; } typenamemap[] = { - {"file", UFS_IFREG}, - {"dir", UFS_IFDIR}, - {"socket", UFS_IFSOCK}, - {"fifo", UFS_IFIFO}, + {"file", IFREG}, + {"dir", IFDIR}, + {"socket", IFSOCK}, + {"fifo", IFIFO}, }; CMDFUNCSTART(newtype) @@ -902,7 +902,7 @@ CMDFUNCSTART(newtype) if (!checkactive()) return 1; - type = DIP(curinode, di_mode) & UFS_IFMT; + type = DIP(curinode, di_mode) & IFMT; for (tp = typenamemap; tp < &typenamemap[nitems(typenamemap)]; tp++) { @@ -917,7 +917,7 @@ CMDFUNCSTART(newtype) warnx("try one of `file', `dir', `socket', `fifo'"); return 1; } - DIP_SET(curinode, di_mode, DIP(curinode, di_mode) & ~UFS_IFMT); + DIP_SET(curinode, di_mode, DIP(curinode, di_mode) & ~IFMT); DIP_SET(curinode, di_mode, DIP(curinode, di_mode) | type); inodirty(); printactive(0); Modified: head/sbin/fsdb/fsdbutil.c ============================================================================== --- head/sbin/fsdb/fsdbutil.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/fsdb/fsdbutil.c Sat Mar 17 12:59:55 2018 (r331095) @@ -120,20 +120,20 @@ printstat(const char *cp, ino_t inum, union dinode *dp time_t t; printf("%s: ", cp); - switch (DIP(dp, di_mode) & UFS_IFMT) { - case UFS_IFDIR: + switch (DIP(dp, di_mode) & IFMT) { + case IFDIR: puts("directory"); break; - case UFS_IFREG: + case IFREG: puts("regular file"); break; - case UFS_IFBLK: + case IFBLK: printf("block special (%#jx)", (uintmax_t)DIP(dp, di_rdev)); break; - case UFS_IFCHR: + case IFCHR: printf("character special (%#jx)", DIP(dp, di_rdev)); break; - case UFS_IFLNK: + case IFLNK: fputs("symlink",stdout); if (DIP(dp, di_size) > 0 && DIP(dp, di_size) < sblock.fs_maxsymlinklen && @@ -147,10 +147,10 @@ printstat(const char *cp, ino_t inum, union dinode *dp putchar('\n'); } break; - case UFS_IFSOCK: + case IFSOCK: puts("socket"); break; - case UFS_IFIFO: + case IFIFO: puts("fifo"); break; } @@ -338,7 +338,7 @@ checkactivedir(void) warnx("no current inode\n"); return 0; } - if ((DIP(curinode, di_mode) & UFS_IFMT) != UFS_IFDIR) { + if ((DIP(curinode, di_mode) & IFMT) != IFDIR) { warnx("inode %ju not a directory", (uintmax_t)curinum); return 0; } @@ -350,14 +350,14 @@ printactive(int doblocks) { if (!checkactive()) return 1; - switch (DIP(curinode, di_mode) & UFS_IFMT) { - case UFS_IFDIR: - case UFS_IFREG: - case UFS_IFBLK: - case UFS_IFCHR: - case UFS_IFLNK: - case UFS_IFSOCK: - case UFS_IFIFO: + switch (DIP(curinode, di_mode) & IFMT) { + case IFDIR: + case IFREG: + case IFBLK: + case IFCHR: + case IFLNK: + case IFSOCK: + case IFIFO: if (doblocks) printblocks(curinum, curinode); else @@ -368,7 +368,7 @@ printactive(int doblocks) break; default: printf("current inode %ju: screwy itype 0%o (mode 0%o)?\n", - (uintmax_t)curinum, DIP(curinode, di_mode) & UFS_IFMT, + (uintmax_t)curinum, DIP(curinode, di_mode) & IFMT, DIP(curinode, di_mode)); break; } Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/newfs/mkfs.c Sat Mar 17 12:59:55 2018 (r331095) @@ -883,7 +883,7 @@ fsinit(time_t utime) /* * create the root directory */ - node.dp1.di_mode = UFS_IFDIR | UMASK; + node.dp1.di_mode = IFDIR | UMASK; node.dp1.di_nlink = entries; node.dp1.di_size = makedir(root_dir, entries); node.dp1.di_db[0] = alloc(sblock.fs_fsize, node.dp1.di_mode); @@ -919,7 +919,7 @@ fsinit(time_t utime) /* * create the root directory */ - node.dp2.di_mode = UFS_IFDIR | UMASK; + node.dp2.di_mode = IFDIR | UMASK; node.dp2.di_nlink = entries; node.dp2.di_size = makedir(root_dir, entries); node.dp2.di_db[0] = alloc(sblock.fs_fsize, node.dp2.di_mode); @@ -1002,7 +1002,7 @@ goth: acg.cg_cs.cs_nbfree--; sblock.fs_cstotal.cs_nbfree--; fscs[0].cs_nbfree--; - if (mode & UFS_IFDIR) { + if (mode & IFDIR) { acg.cg_cs.cs_ndir++; sblock.fs_cstotal.cs_ndir++; fscs[0].cs_ndir++; Modified: head/sbin/quotacheck/quotacheck.c ============================================================================== --- head/sbin/quotacheck/quotacheck.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/quotacheck/quotacheck.c Sat Mar 17 12:59:55 2018 (r331095) @@ -370,7 +370,7 @@ chkquota(char *specname, struct quotafile *qfu, struct for (i = 0; i < inosused; i++, ino++) { if ((dp = getnextinode(ino)) == NULL || ino < UFS_ROOTINO || - (mode = DIP(dp, di_mode) & UFS_IFMT) == 0) + (mode = DIP(dp, di_mode) & IFMT) == 0) continue; /* * XXX: Do not account for UIDs or GIDs that appear @@ -405,16 +405,16 @@ chkquota(char *specname, struct quotafile *qfu, struct fup = addid((u_long)DIP(dp, di_gid), GRPQUOTA, (char *)0, mntpt); fup->fu_curinodes++; - if (mode == UFS_IFREG || mode == UFS_IFDIR || - mode == UFS_IFLNK) + if (mode == IFREG || mode == IFDIR || + mode == IFLNK) fup->fu_curblocks += DIP(dp, di_blocks); } if (qfu) { fup = addid((u_long)DIP(dp, di_uid), USRQUOTA, (char *)0, mntpt); fup->fu_curinodes++; - if (mode == UFS_IFREG || mode == UFS_IFDIR || - mode == UFS_IFLNK) + if (mode == IFREG || mode == IFDIR || + mode == IFLNK) fup->fu_curblocks += DIP(dp, di_blocks); } } Modified: head/sbin/restore/dirs.c ============================================================================== --- head/sbin/restore/dirs.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/restore/dirs.c Sat Mar 17 12:59:55 2018 (r331095) @@ -178,7 +178,7 @@ extractdirs(int genmode) for (;;) { curfile.name = ""; curfile.action = USING; - if (curfile.mode == 0 || (curfile.mode & UFS_IFMT) != UFS_IFDIR) + if (curfile.mode == 0 || (curfile.mode & IFMT) != IFDIR) break; itp = allocinotab(&curfile, seekpt); getfile(putdir, putdirattrs, xtrnull); @@ -205,7 +205,7 @@ void skipdirs(void) { - while (curfile.ino && (curfile.mode & UFS_IFMT) == UFS_IFDIR) { + while (curfile.ino && (curfile.mode & IFMT) == IFDIR) { skipfile(); } } Modified: head/sbin/restore/interactive.c ============================================================================== --- head/sbin/restore/interactive.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/restore/interactive.c Sat Mar 17 12:59:55 2018 (r331095) @@ -741,9 +741,9 @@ glob_stat(const char *name, struct stat *stp) (!vflag && dp->d_ino == UFS_WINO)) return (-1); if (inodetype(dp->d_ino) == NODE) - stp->st_mode = UFS_IFDIR; + stp->st_mode = IFDIR; else - stp->st_mode = UFS_IFREG; + stp->st_mode = IFREG; return (0); } Modified: head/sbin/restore/tape.c ============================================================================== --- head/sbin/restore/tape.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/restore/tape.c Sat Mar 17 12:59:55 2018 (r331095) @@ -592,19 +592,19 @@ extractfile(char *name) gid = curfile.gid; mode = curfile.mode; flags = curfile.file_flags; - switch (mode & UFS_IFMT) { + switch (mode & IFMT) { default: fprintf(stderr, "%s: unknown file mode 0%o\n", name, mode); skipfile(); return (FAIL); - case UFS_IFSOCK: + case IFSOCK: vprintf(stdout, "skipped socket %s\n", name); skipfile(); return (GOOD); - case UFS_IFDIR: + case IFDIR: if (mflag) { ep = lookupname(name); if (ep == NULL || ep->e_flags & EXTRACT) @@ -615,7 +615,7 @@ extractfile(char *name) vprintf(stdout, "extract file %s\n", name); return (genliteraldir(name, curfile.ino)); - case UFS_IFLNK: + case IFLNK: lnkbuf[0] = '\0'; pathlen = 0; buf = setupextattr(extsize); @@ -639,7 +639,7 @@ extractfile(char *name) } return (FAIL); - case UFS_IFIFO: + case IFIFO: vprintf(stdout, "extract fifo %s\n", name); if (Nflag) { skipfile(); @@ -667,8 +667,8 @@ extractfile(char *name) (void) chflags(name, flags); return (GOOD); - case UFS_IFCHR: - case UFS_IFBLK: + case IFCHR: + case IFBLK: vprintf(stdout, "extract special file %s\n", name); if (Nflag) { skipfile(); @@ -676,7 +676,7 @@ extractfile(char *name) } if (uflag) (void) unlink(name); - if (mknod(name, (mode & (UFS_IFCHR | UFS_IFBLK)) | 0600, + if (mknod(name, (mode & (IFCHR | IFBLK)) | 0600, (int)curfile.rdev) < 0) { fprintf(stderr, "%s: cannot create special file: %s\n", name, strerror(errno)); @@ -697,7 +697,7 @@ extractfile(char *name) (void) chflags(name, flags); return (GOOD); - case UFS_IFREG: + case IFREG: vprintf(stdout, "extract file %s\n", name); if (Nflag) { skipfile(); Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sbin/tunefs/tunefs.c Sat Mar 17 12:59:55 2018 (r331095) @@ -1021,7 +1021,7 @@ journal_alloc(int64_t size) if (sblock.fs_magic == FS_UFS1_MAGIC) { bzero(dp1, sizeof(*dp1)); dp1->di_size = size; - dp1->di_mode = UFS_IFREG | UFS_IREAD; + dp1->di_mode = IFREG | IREAD; dp1->di_nlink = 1; dp1->di_flags = SF_IMMUTABLE | SF_NOUNLINK | UF_NODUMP; dp1->di_atime = utime; @@ -1030,7 +1030,7 @@ journal_alloc(int64_t size) } else { bzero(dp2, sizeof(*dp2)); dp2->di_size = size; - dp2->di_mode = UFS_IFREG | UFS_IREAD; + dp2->di_mode = IFREG | IREAD; dp2->di_nlink = 1; dp2->di_flags = SF_IMMUTABLE | SF_NOUNLINK | UF_NODUMP; dp2->di_atime = utime; Modified: head/stand/libsa/nandfs.c ============================================================================== --- head/stand/libsa/nandfs.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/stand/libsa/nandfs.c Sat Mar 17 12:59:55 2018 (r331095) @@ -654,7 +654,7 @@ nandfs_lookup_path(struct nandfs *fs, const char *path while ((strp = strsep(&lpath, "/")) != NULL) { if (*strp == '\0') continue; - if ((node->inode->i_mode & NANDFS_IFMT) != NANDFS_IFDIR) { + if ((node->inode->i_mode & IFMT) != IFDIR) { nandfs_free_node(node); node = NULL; goto out; @@ -710,7 +710,7 @@ nandfs_lookup_path(struct nandfs *fs, const char *path NANDFS_DEBUG("%s: %.*s has mode %o\n", __func__, dirent->name_len, dirent->name, node->inode->i_mode); - if ((node->inode->i_mode & NANDFS_IFMT) == NANDFS_IFLNK) { + if ((node->inode->i_mode & IFMT) == IFLNK) { NANDFS_DEBUG("%s: %.*s is symlink\n", __func__, dirent->name_len, dirent->name); link_len = node->inode->i_size; Modified: head/stand/libsa/ufs.c ============================================================================== --- head/stand/libsa/ufs.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/stand/libsa/ufs.c Sat Mar 17 12:59:55 2018 (r331095) @@ -557,7 +557,7 @@ ufs_open(upath, f) /* * Check that current node is a directory. */ - if ((DIP(fp, di_mode) & UFS_IFMT) != UFS_IFDIR) { + if ((DIP(fp, di_mode) & IFMT) != IFDIR) { rc = ENOTDIR; goto out; } @@ -599,7 +599,7 @@ ufs_open(upath, f) /* * Check for symbolic link. */ - if ((DIP(fp, di_mode) & UFS_IFMT) == UFS_IFLNK) { + if ((DIP(fp, di_mode) & IFMT) == IFLNK) { int link_len = DIP(fp, di_size); int len; Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sys/fs/ext2fs/ext2_alloc.c Sat Mar 17 12:59:55 2018 (r331095) @@ -393,7 +393,7 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred * ext2_dirpref else obtain it using ino_to_cg. The preferred inode is * always the next inode. */ - if ((mode & EXT2_IFMT) == EXT2_IFDIR) { + if ((mode & IFMT) == IFDIR) { cg = ext2_dirpref(pip); if (fs->e2fs_contigdirs[cg] < 255) fs->e2fs_contigdirs[cg]++; @@ -1290,7 +1290,7 @@ gotit: e2fs_gd_get_i_unused(&fs->e2fs_gd[cg]) - 1); fs->e2fs->e2fs_ficount--; fs->e2fs_fmod = 1; - if ((mode & EXT2_IFMT) == EXT2_IFDIR) { + if ((mode & IFMT) == IFDIR) { e2fs_gd_set_ndirs(&fs->e2fs_gd[cg], e2fs_gd_get_ndirs(&fs->e2fs_gd[cg]) + 1); fs->e2fs_total_dir++; @@ -1395,7 +1395,7 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode) EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) e2fs_gd_set_i_unused(&fs->e2fs_gd[cg], e2fs_gd_get_i_unused(&fs->e2fs_gd[cg]) + 1); - if ((mode & EXT2_IFMT) == EXT2_IFDIR) { + if ((mode & IFMT) == IFDIR) { e2fs_gd_set_ndirs(&fs->e2fs_gd[cg], e2fs_gd_get_ndirs(&fs->e2fs_gd[cg]) - 1); fs->e2fs_total_dir--; Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Sat Mar 17 11:41:06 2018 (r331094) +++ head/sys/fs/ext2fs/ext2_dinode.h Sat Mar 17 12:59:55 2018 (r331095) @@ -105,7 +105,7 @@ * Structure of an inode on the disk */ struct ext2fs_dinode { - uint16_t e2di_mode; /* 0: EXT2_IFMT, permissions; below.*/ + uint16_t e2di_mode; /* 0: IFMT, permissions; see below. */ uint16_t e2di_uid; /* 2: Owner UID */ uint32_t e2di_size; /* 4: Size (in bytes) */ uint32_t e2di_atime; /* 8: Access time */ Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sys/fs/ext2fs/ext2_lookup.c Sat Mar 17 12:59:55 2018 (r331095) @@ -591,7 +591,7 @@ found: * may not delete it (unless she's root). This * implements append-only directories. */ - if ((dp->i_mode & EXT2_ISVTX) && + if ((dp->i_mode & ISVTX) && cred->cr_uid != 0 && cred->cr_uid != dp->i_uid && VTOI(tdp)->i_uid != cred->cr_uid) { Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Sat Mar 17 11:41:06 2018 (r331094) +++ head/sys/fs/ext2fs/ext2_vnops.c Sat Mar 17 12:59:55 2018 (r331095) @@ -352,7 +352,7 @@ ext2_getattr(struct vop_getattr_args *ap) */ vap->va_fsid = dev2udev(ip->i_devvp->v_rdev); vap->va_fileid = ip->i_number; - vap->va_mode = ip->i_mode & ~EXT2_IFMT; + vap->va_mode = ip->i_mode & ~IFMT; vap->va_nlink = ip->i_nlink; vap->va_uid = ip->i_uid; vap->va_gid = ip->i_gid; @@ -534,7 +534,7 @@ ext2_chmod(struct vnode *vp, int mode, struct ucred *c if (error) return (EFTYPE); } - if (!groupmember(ip->i_gid, cred) && (mode & EXT2_ISGID)) { + if (!groupmember(ip->i_gid, cred) && (mode & ISGID)) { error = priv_check_cred(cred, PRIV_VFS_SETGID, 0); if (error) return (error); @@ -584,10 +584,9 @@ ext2_chown(struct vnode *vp, uid_t uid, gid_t gid, str ip->i_gid = gid; ip->i_uid = uid; ip->i_flag |= IN_CHANGE; - if ((ip->i_mode & (EXT2_ISUID | EXT2_ISGID)) && - (ouid != uid || ogid != gid)) { + if ((ip->i_mode & (ISUID | ISGID)) && (ouid != uid || ogid != gid)) { if (priv_check_cred(cred, PRIV_VFS_RETAINSUGID, 0) != 0) - ip->i_mode &= ~(EXT2_ISUID | EXT2_ISGID); + ip->i_mode &= ~(ISUID | ISGID); } return (0); } @@ -844,7 +843,7 @@ abortit: error = EPERM; goto abortit; } - if ((ip->i_mode & EXT2_IFMT) == EXT2_IFDIR) { + if ((ip->i_mode & IFMT) == IFDIR) { /* * Avoid ".", "..", and aliases of "." for obvious reasons. */ @@ -975,7 +974,7 @@ abortit: * to it. Also, ensure source and target are compatible * (both directories, or both not directories). */ - if ((xp->i_mode & EXT2_IFMT) == EXT2_IFDIR) { + if ((xp->i_mode & IFMT) == IFDIR) { if (!ext2_dirempty(xp, dp->i_number, tcnp->cn_cred)) { error = ENOTEMPTY; goto bad; @@ -1319,7 +1318,7 @@ ext2_mkdir(struct vop_mkdir_args *ap) goto out; } dmode = vap->va_mode & 0777; - dmode |= EXT2_IFDIR; + dmode |= IFDIR; /* * Must simulate part of ext2_makeinode here to acquire the inode, * but not have it entered in the parent directory. The entry is @@ -1342,8 +1341,8 @@ ext2_mkdir(struct vop_mkdir_args *ap) * 'give it away' so that the SUID is still forced on. */ if ((dvp->v_mount->mnt_flag & MNT_SUIDDIR) && - (dp->i_mode & EXT2_ISUID) && dp->i_uid) { - dmode |= EXT2_ISUID; + (dp->i_mode & ISUID) && dp->i_uid) { + dmode |= ISUID; ip->i_uid = dp->i_uid; } else { ip->i_uid = cnp->cn_cred->cr_uid; @@ -1522,7 +1521,7 @@ ext2_symlink(struct vop_symlink_args *ap) struct inode *ip; int len, error; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Mar 17 14:50:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A6B7F4F39B; Sat, 17 Mar 2018 14:50:21 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2112E7F482; Sat, 17 Mar 2018 14:50:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1620C13BBA; Sat, 17 Mar 2018 14:50:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2HEoKXB083689; Sat, 17 Mar 2018 14:50:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2HEoKXK083688; Sat, 17 Mar 2018 14:50:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803171450.w2HEoKXK083688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 17 Mar 2018 14:50:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331096 - head/sys/modules/hyperv/vmbus X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/modules/hyperv/vmbus X-SVN-Commit-Revision: 331096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 14:50:21 -0000 Author: emaste Date: Sat Mar 17 14:50:20 2018 New Revision: 331096 URL: https://svnweb.freebsd.org/changeset/base/331096 Log: Move assym.s to DPSRCS in vmbus module assym.s is only to be included by other .s files, and should not actually be assembled by itself. Modified: head/sys/modules/hyperv/vmbus/Makefile Modified: head/sys/modules/hyperv/vmbus/Makefile ============================================================================== --- head/sys/modules/hyperv/vmbus/Makefile Sat Mar 17 12:59:55 2018 (r331095) +++ head/sys/modules/hyperv/vmbus/Makefile Sat Mar 17 14:50:20 2018 (r331096) @@ -13,6 +13,7 @@ SRCS= hyperv.c \ vmbus_et.c \ vmbus_if.c \ vmbus_res.c \ + vmbus_vector.S \ vmbus_xact.c SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h pci_if.h pcib_if.h vmbus_if.h @@ -22,8 +23,7 @@ SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h SRCS+= opt_apic.h .endif -SRCS+= assym.s \ - vmbus_vector.S +DPSRCS+= assym.s vmbus_vector.o: ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ From owner-svn-src-head@freebsd.org Sat Mar 17 16:04:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 468FCF548D5; Sat, 17 Mar 2018 16:04:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEA5F82296; Sat, 17 Mar 2018 16:04:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E981114866; Sat, 17 Mar 2018 16:04:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2HG46i2024373; Sat, 17 Mar 2018 16:04:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2HG46RM024372; Sat, 17 Mar 2018 16:04:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803171604.w2HG46RM024372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Mar 2018 16:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331097 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 331097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 16:04:07 -0000 Author: imp Date: Sat Mar 17 16:04:06 2018 New Revision: 331097 URL: https://svnweb.freebsd.org/changeset/base/331097 Log: Only take out the periph lock when we're modifying the flags of the softc for an async unit attention. CAM locks, sometimes, the periph lock and other times does not. We were taking the lock always and running into lock recursion issues on a non-recursive lock. Now we take it selectively. It's not clear why xpt takes the lock selectively before calling us, though, and that's still under investigation. Reported by: avg PR: 226510 (same panic, differnt circumstances) Sponsored by: Netflix Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sat Mar 17 14:50:20 2018 (r331096) +++ head/sys/cam/scsi/scsi_da.c Sat Mar 17 16:04:06 2018 (r331097) @@ -2039,26 +2039,30 @@ daasync(void *callback_arg, u_int32_t code, * Handle all UNIT ATTENTIONs except our own, * as they will be handled by daerror(). */ - cam_periph_lock(periph); if (xpt_path_periph(ccb->ccb_h.path) != periph && scsi_extract_sense_ccb(ccb, &error_code, &sense_key, &asc, &ascq)) { if (asc == 0x2A && ascq == 0x09) { xpt_print(ccb->ccb_h.path, "Capacity data has changed\n"); + cam_periph_lock(periph); softc->flags &= ~DA_FLAG_PROBED; + cam_periph_unlock(periph); dareprobe(periph); } else if (asc == 0x28 && ascq == 0x00) { + cam_periph_lock(periph); softc->flags &= ~DA_FLAG_PROBED; + cam_periph_unlock(periph); disk_media_changed(softc->disk, M_NOWAIT); } else if (asc == 0x3F && ascq == 0x03) { xpt_print(ccb->ccb_h.path, "INQUIRY data has changed\n"); + cam_periph_lock(periph); softc->flags &= ~DA_FLAG_PROBED; + cam_periph_unlock(periph); dareprobe(periph); } } - cam_periph_unlock(periph); break; } case AC_SCSI_AEN: From owner-svn-src-head@freebsd.org Sat Mar 17 17:05:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4FE8F58EBB; Sat, 17 Mar 2018 17:05:49 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5092484756; Sat, 17 Mar 2018 17:05:49 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47FFF151B5; Sat, 17 Mar 2018 17:05:49 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2HH5nCO054262; Sat, 17 Mar 2018 17:05:49 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2HH5mk1054256; Sat, 17 Mar 2018 17:05:48 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201803171705.w2HH5mk1054256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 17 Mar 2018 17:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331098 - in head/sys: net netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: net netinet netinet6 X-SVN-Commit-Revision: 331098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 17:05:50 -0000 Author: melifaro Date: Sat Mar 17 17:05:48 2018 New Revision: 331098 URL: https://svnweb.freebsd.org/changeset/base/331098 Log: Fix outgoing TCP/UDP packet drop on arp/ndp entry expiration. Current arp/nd code relies on the feedback from the datapath indicating that the entry is still used. This mechanism is incorporated into the arpresolve()/nd6_resolve() routines. After the inpcb route cache introduction, the packet path for the locally-originated packets changed, passing cached lle pointer to the ether_output() directly. This resulted in the arp/ndp entry expire each time exactly after the configured max_age interval. During the small window between the ARP/NDP request and reply from the router, most of the packets got lost. Fix this behaviour by plugging datapath notification code to the packet path used by route cache. Unify the notification code by using single inlined function with the per-AF callbacks. Reported by: sthaug at nethelp.no Reviewed by: ae MFC after: 2 weeks Modified: head/sys/net/if_ethersubr.c head/sys/net/if_llatbl.h head/sys/netinet/if_ether.c head/sys/netinet/in.c head/sys/netinet6/in6.c Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Sat Mar 17 16:04:06 2018 (r331097) +++ head/sys/net/if_ethersubr.c Sat Mar 17 17:05:48 2018 (r331098) @@ -311,7 +311,13 @@ ether_output(struct ifnet *ifp, struct mbuf *m, if (lle == NULL) { /* if we lookup, keep cache */ addref = 1; - } + } else + /* + * Notify LLE code that + * the entry was used + * by datapath. + */ + llentry_mark_used(lle); } if (lle != NULL) { phdr = lle->r_linkdata; Modified: head/sys/net/if_llatbl.h ============================================================================== --- head/sys/net/if_llatbl.h Sat Mar 17 16:04:06 2018 (r331097) +++ head/sys/net/if_llatbl.h Sat Mar 17 17:05:48 2018 (r331098) @@ -149,6 +149,7 @@ typedef void (llt_fill_sa_entry_t)(const struct llentr typedef void (llt_free_tbl_t)(struct lltable *); typedef void (llt_link_entry_t)(struct lltable *, struct llentry *); typedef void (llt_unlink_entry_t)(struct llentry *); +typedef void (llt_mark_used_t)(struct llentry *); typedef int (llt_foreach_cb_t)(struct lltable *, struct llentry *, void *); typedef int (llt_foreach_entry_t)(struct lltable *, llt_foreach_cb_t *, void *); @@ -173,6 +174,7 @@ struct lltable { llt_unlink_entry_t *llt_unlink_entry; llt_fill_sa_entry_t *llt_fill_sa_entry; llt_free_tbl_t *llt_free_tbl; + llt_mark_used_t *llt_mark_used; }; MALLOC_DECLARE(M_LLTABLE); @@ -245,6 +247,19 @@ lla_lookup(struct lltable *llt, u_int flags, const str { return (llt->llt_lookup(llt, flags, l3addr)); +} + +/* + * Notify the LLE code that the entry was used by datapath. + */ +static __inline void +llentry_mark_used(struct llentry *lle) +{ + + if (lle->r_skip_req == 0) + return; + if ((lle->r_flags & RLLE_VALID) != 0) + lle->lle_tbl->llt_mark_used(lle); } int lla_rt_output(struct rt_msghdr *, struct rt_addrinfo *); Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sat Mar 17 16:04:06 2018 (r331097) +++ head/sys/netinet/if_ether.c Sat Mar 17 17:05:48 2018 (r331098) @@ -504,12 +504,8 @@ arpresolve_full(struct ifnet *ifp, int is_gw, int flag } bcopy(lladdr, desten, ll_len); - /* Check if we have feedback request from arptimer() */ - if (la->r_skip_req != 0) { - LLE_REQ_LOCK(la); - la->r_skip_req = 0; /* Notify that entry was used */ - LLE_REQ_UNLOCK(la); - } + /* Notify LLE code that the entry was used by datapath */ + llentry_mark_used(la); if (pflags != NULL) *pflags = la->la_flags & (LLE_VALID|LLE_IFADDR); if (plle) { @@ -640,12 +636,8 @@ arpresolve(struct ifnet *ifp, int is_gw, struct mbuf * bcopy(la->r_linkdata, desten, la->r_hdrlen); if (pflags != NULL) *pflags = LLE_VALID | (la->r_flags & RLLE_IFADDR); - /* Check if we have feedback request from arptimer() */ - if (la->r_skip_req != 0) { - LLE_REQ_LOCK(la); - la->r_skip_req = 0; /* Notify that entry was used */ - LLE_REQ_UNLOCK(la); - } + /* Notify the LLE handling code that the entry was used. */ + llentry_mark_used(la); if (plle) { LLE_ADDREF(la); *plle = la; Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sat Mar 17 16:04:06 2018 (r331097) +++ head/sys/netinet/in.c Sat Mar 17 17:05:48 2018 (r331098) @@ -1068,6 +1068,19 @@ in_lltable_destroy_lle_unlocked(struct llentry *lle) } /* + * Called by the datapath to indicate that + * the entry was used. + */ +static void +in_lltable_mark_used(struct llentry *lle) +{ + + LLE_REQ_LOCK(lle); + lle->r_skip_req = 0; + LLE_REQ_UNLOCK(lle); +} + +/* * Called by LLE_FREE_LOCKED when number of references * drops to zero. */ @@ -1470,6 +1483,7 @@ in_lltattach(struct ifnet *ifp) llt->llt_fill_sa_entry = in_lltable_fill_sa_entry; llt->llt_free_entry = in_lltable_free_entry; llt->llt_match_prefix = in_lltable_match_prefix; + llt->llt_mark_used = in_lltable_mark_used; lltable_link(llt); return (llt); Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sat Mar 17 16:04:06 2018 (r331097) +++ head/sys/netinet6/in6.c Sat Mar 17 17:05:48 2018 (r331098) @@ -2148,6 +2148,25 @@ in6_lltable_rtcheck(struct ifnet *ifp, return 0; } +/* + * Called by the datapath to indicate that the entry was used. + */ +static void +in6_lltable_mark_used(struct llentry *lle) +{ + + LLE_REQ_LOCK(lle); + lle->r_skip_req = 0; + + /* + * Set the hit time so the callback function + * can determine the remaining time before + * transiting to the DELAY state. + */ + lle->lle_hittime = time_uptime; + LLE_REQ_UNLOCK(lle); +} + static inline uint32_t in6_lltable_hash_dst(const struct in6_addr *dst, uint32_t hsize) { @@ -2380,6 +2399,7 @@ in6_lltattach(struct ifnet *ifp) llt->llt_fill_sa_entry = in6_lltable_fill_sa_entry; llt->llt_free_entry = in6_lltable_free_entry; llt->llt_match_prefix = in6_lltable_match_prefix; + llt->llt_mark_used = in6_lltable_mark_used; lltable_link(llt); return (llt); From owner-svn-src-head@freebsd.org Sat Mar 17 17:18:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5342F59E64; Sat, 17 Mar 2018 17:18:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BD22850ED; Sat, 17 Mar 2018 17:18:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F90E15356; Sat, 17 Mar 2018 17:18:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2HHITkf059677; Sat, 17 Mar 2018 17:18:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2HHITua059676; Sat, 17 Mar 2018 17:18:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803171718.w2HHITua059676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Mar 2018 17:18:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331099 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 331099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 17:18:29 -0000 Author: imp Date: Sat Mar 17 17:18:29 2018 New Revision: 331099 URL: https://svnweb.freebsd.org/changeset/base/331099 Log: Add EFI to kernel options. Some parts of MI modules will soon depend on whether EFI is available or not. Add EFI to the list of kernel options so we can use it in the modules build. Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Sat Mar 17 17:05:48 2018 (r331098) +++ head/sys/conf/kern.opts.mk Sat Mar 17 17:18:29 2018 (r331099) @@ -30,6 +30,7 @@ __DEFAULT_YES_OPTIONS = \ CDDL \ CRYPT \ CUSE \ + EFI \ FORMAT_EXTENSIONS \ INET \ INET6 \ @@ -89,6 +90,11 @@ BROKEN_OPTIONS+= OFED # Things that don't work based on toolchain support. .if ${MACHINE} != "i386" && ${MACHINE} != "amd64" BROKEN_OPTIONS+= KERNEL_RETPOLINE +.endif + +# EFI doesn't exist on mips, powerpc, sparc or riscv. +.if ${MACHINE:Mmips} || ${MACHINE:Mpowerpc} || ${MACHINE:Msparc64} || ${MACHINE:Mriscv} +BROKEN_OPTIONS+=EFI .endif # expanded inline from bsd.mkopt.mk to avoid share/mk dependency From owner-svn-src-head@freebsd.org Sat Mar 17 17:18:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7EE8F59E8D; Sat, 17 Mar 2018 17:18:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7043F851C6; Sat, 17 Mar 2018 17:18:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69E0C15357; Sat, 17 Mar 2018 17:18:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2HHIbPW059731; Sat, 17 Mar 2018 17:18:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2HHIbEw059730; Sat, 17 Mar 2018 17:18:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803171718.w2HHIbEw059730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Mar 2018 17:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331100 - head/sys/modules/netgraph/checksum X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/modules/netgraph/checksum X-SVN-Commit-Revision: 331100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 17:18:38 -0000 Author: imp Date: Sat Mar 17 17:18:37 2018 New Revision: 331100 URL: https://svnweb.freebsd.org/changeset/base/331100 Log: Remove commented out code to generate opt_inet*.h. That's handled automatically by kern.opts.mk now. Include that instead. Modified: head/sys/modules/netgraph/checksum/Makefile Modified: head/sys/modules/netgraph/checksum/Makefile ============================================================================== --- head/sys/modules/netgraph/checksum/Makefile Sat Mar 17 17:18:29 2018 (r331099) +++ head/sys/modules/netgraph/checksum/Makefile Sat Mar 17 17:18:37 2018 (r331100) @@ -1,20 +1,9 @@ # $FreeBSD$ -.include +SYSDIR?=${SRCTOP}/sys +.include "${SYSDIR}/conf/kern.opts.mk" KMOD= ng_checksum SRCS= ng_checksum.c opt_inet.h opt_inet6.h - -#.if !defined(KERNBUILDDIR) -# -#.if ${MK_INET_SUPPORT} != "no" -#opt_inet.h: -# echo "#define INET 1" > ${.TARGET} -#.endif -#.if ${MK_INET6_SUPPORT} != "no" -#opt_inet6.h: -# echo "#define INET6 1" > ${.TARGET} -#.endif -#.endif .include From owner-svn-src-head@freebsd.org Sat Mar 17 17:18:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AEAEF59EBD; Sat, 17 Mar 2018 17:18:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFD848524D; Sat, 17 Mar 2018 17:18:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07DD515358; Sat, 17 Mar 2018 17:18:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2HHIfpE059784; Sat, 17 Mar 2018 17:18:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2HHIffP059783; Sat, 17 Mar 2018 17:18:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803171718.w2HHIffP059783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Mar 2018 17:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331101 - head/sys/modules/netmap X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/modules/netmap X-SVN-Commit-Revision: 331101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 17:18:45 -0000 Author: imp Date: Sat Mar 17 17:18:41 2018 New Revision: 331101 URL: https://svnweb.freebsd.org/changeset/base/331101 Log: Use FreeBSD-current conventions for building options rather than FreeBSD 10 conventions: inlude kern.opts.mk. Modified: head/sys/modules/netmap/Makefile Modified: head/sys/modules/netmap/Makefile ============================================================================== --- head/sys/modules/netmap/Makefile Sat Mar 17 17:18:37 2018 (r331100) +++ head/sys/modules/netmap/Makefile Sat Mar 17 17:18:41 2018 (r331101) @@ -3,12 +3,12 @@ # Compile netmap as a module, useful if you want a netmap bridge # or loadable drivers. -.include # FreeBSD 10 and earlier -# .include "${SYSDIR}/conf/kern.opts.mk" +SYSDIR?=${SRCTOP}/sys +.include "${SYSDIR}/conf/kern.opts.mk" -.PATH: ${SRCTOP}/sys/dev/netmap -.PATH.h: ${SRCTOP}/sys/net -CFLAGS += -I${SRCTOP}/sys/ -D INET +.PATH: ${SYSDIR}/dev/netmap +.PATH.h: ${SYSDIR}/net +CFLAGS += -I${SYSDIR}/ -D INET KMOD = netmap SRCS = device_if.h bus_if.h pci_if.h opt_netmap.h SRCS += netmap.c netmap.h netmap_kern.h From owner-svn-src-head@freebsd.org Sat Mar 17 17:18:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EDA7F59EEE; Sat, 17 Mar 2018 17:18:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9EC9B852B9; Sat, 17 Mar 2018 17:18:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 981A11535A; Sat, 17 Mar 2018 17:18:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2HHIkGs059836; Sat, 17 Mar 2018 17:18:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2HHIkZQ059835; Sat, 17 Mar 2018 17:18:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803171718.w2HHIkZQ059835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 17 Mar 2018 17:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331102 - head/sys/modules/iser X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/modules/iser X-SVN-Commit-Revision: 331102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 17:18:49 -0000 Author: imp Date: Sat Mar 17 17:18:46 2018 New Revision: 331102 URL: https://svnweb.freebsd.org/changeset/base/331102 Log: Use kern.opts.mk instead of bsd.own.mk (which includes src.opts.mk) here. Modified: head/sys/modules/iser/Makefile Modified: head/sys/modules/iser/Makefile ============================================================================== --- head/sys/modules/iser/Makefile Sat Mar 17 17:18:41 2018 (r331101) +++ head/sys/modules/iser/Makefile Sat Mar 17 17:18:46 2018 (r331102) @@ -1,8 +1,9 @@ # $FreeBSD$ -.PATH: ${SRCTOP}/sys/dev/iser/ +SYSDIR?=${SRCTOP}/sys +.include "${SYSDIR}/conf/kern.opts.mk" -.include +.PATH: ${SYSDIR}/dev/iser/ KMOD= iser @@ -18,7 +19,7 @@ SRCS+= bus_if.h SRCS+= device_if.h SRCS+= icl_conn_if.h -CFLAGS+= -I${SRCTOP}/sys/ +CFLAGS+= -I${SYSDIR}/ CFLAGS+= -I${SYSDIR}/ofed/include CFLAGS+= -I${SYSDIR}/ofed/include/uapi CFLAGS+= -I${SYSDIR}/compat/linuxkpi/common/include From owner-svn-src-head@freebsd.org Sat Mar 17 17:48:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE5ADF5C0BC; Sat, 17 Mar 2018 17:48:21 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D2FA868F5; Sat, 17 Mar 2018 17:48:21 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 781E2157F1; Sat, 17 Mar 2018 17:48:21 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2HHmLeg074611; Sat, 17 Mar 2018 17:48:21 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2HHmLFj074610; Sat, 17 Mar 2018 17:48:21 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201803171748.w2HHmLFj074610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 17 Mar 2018 17:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331103 - head/tests/sys/aio X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/aio X-SVN-Commit-Revision: 331103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 17:48:22 -0000 Author: asomers Date: Sat Mar 17 17:48:21 2018 New Revision: 331103 URL: https://svnweb.freebsd.org/changeset/base/331103 Log: aio: add an ATF test case for aio_fsync error conditions Modified: head/tests/sys/aio/aio_test.c Modified: head/tests/sys/aio/aio_test.c ============================================================================== --- head/tests/sys/aio/aio_test.c Sat Mar 17 17:18:46 2018 (r331102) +++ head/tests/sys/aio/aio_test.c Sat Mar 17 17:48:21 2018 (r331103) @@ -1040,6 +1040,42 @@ ATF_TC_BODY(aio_socket_short_write_cancel, tc) close(s[0]); } +/* + * test aio_fsync's behavior with bad inputs + */ +ATF_TC_WITHOUT_HEAD(aio_fsync_errors); +ATF_TC_BODY(aio_fsync_errors, tc) +{ + int fd; + struct aiocb iocb; + + ATF_REQUIRE_KERNEL_MODULE("aio"); + ATF_REQUIRE_UNSAFE_AIO(); + + fd = open(FILE_PATHNAME, O_RDWR | O_CREAT, 0600); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + unlink(FILE_PATHNAME); + + /* aio_fsync should return EINVAL unless op is O_SYNC */ + memset(&iocb, 0, sizeof(iocb)); + iocb.aio_fildes = fd; + ATF_CHECK_EQ(-1, aio_fsync(666, &iocb)); + ATF_CHECK_EQ(EINVAL, errno); + + /* aio_fsync should return EBADF if fd is not a valid descriptor */ + memset(&iocb, 0, sizeof(iocb)); + iocb.aio_fildes = 666; + ATF_CHECK_EQ(-1, aio_fsync(O_SYNC, &iocb)); + ATF_CHECK_EQ(EBADF, errno); + + /* aio_fsync should return EINVAL if sigev_notify is invalid */ + memset(&iocb, 0, sizeof(iocb)); + iocb.aio_fildes = fd; + iocb.aio_sigevent.sigev_notify = 666; + ATF_CHECK_EQ(-1, aio_fsync(666, &iocb)); + ATF_CHECK_EQ(EINVAL, errno); +} + /* * This test just performs a basic test of aio_fsync(). */ @@ -1153,6 +1189,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, md_suspend); ATF_TP_ADD_TC(tp, md_thread); ATF_TP_ADD_TC(tp, md_waitcomplete); + ATF_TP_ADD_TC(tp, aio_fsync_errors); ATF_TP_ADD_TC(tp, aio_fsync_test); ATF_TP_ADD_TC(tp, aio_large_read_test); ATF_TP_ADD_TC(tp, aio_socket_two_reads); From owner-svn-src-head@freebsd.org Sat Mar 17 17:52:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7BACF5C71F; Sat, 17 Mar 2018 17:52:47 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7933586F4F; Sat, 17 Mar 2018 17:52:47 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 737631598E; Sat, 17 Mar 2018 17:52:47 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2HHqlLg079477; Sat, 17 Mar 2018 17:52:47 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2HHqldu079476; Sat, 17 Mar 2018 17:52:47 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201803171752.w2HHqldu079476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 17 Mar 2018 17:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331104 - head/tests/sys/aio X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/aio X-SVN-Commit-Revision: 331104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 17:52:48 -0000 Author: asomers Date: Sat Mar 17 17:52:47 2018 New Revision: 331104 URL: https://svnweb.freebsd.org/changeset/base/331104 Log: aio_kqueue_test: fix the build when DEBUG=1 Also, make the debug output more verbose Modified: head/tests/sys/aio/aio_kqueue_test.c Modified: head/tests/sys/aio/aio_kqueue_test.c ============================================================================== --- head/tests/sys/aio/aio_kqueue_test.c Sat Mar 17 17:48:21 2018 (r331103) +++ head/tests/sys/aio/aio_kqueue_test.c Sat Mar 17 17:52:47 2018 (r331104) @@ -170,18 +170,25 @@ main (int argc, char *argv[]) kq_iocb = kq_returned.udata; #ifdef DEBUG printf("kevent %d %d errno %d return.ident %p " - "return.data %p return.udata %p %p\n", + "return.data %p return.udata %p %p" + " filter %d flags %#x fflags %#x\n", i, result, error, (void*)kq_returned.ident, (void*)kq_returned.data, kq_returned.udata, - kq_iocb); + kq_iocb, + kq_returned.filter, + kq_returned.flags, + kq_returned.fflags); + if (result > 0) + printf("\tsigev_notify_kevent_flags %#x\n", + ((struct aiocb*)(kq_returned.ident))->aio_sigevent.sigev_notify_kevent_flags); #endif if (kq_iocb) break; #ifdef DEBUG - printf("Try again left %d out of %lu %d\n", + printf("Try again left %d out of %d %d\n", pending, max_queue_per_proc, cancel); #endif } From owner-svn-src-head@freebsd.org Sat Mar 17 17:56:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B40EF5CA79; Sat, 17 Mar 2018 17:56:09 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD11487139; Sat, 17 Mar 2018 17:56:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7E4115991; Sat, 17 Mar 2018 17:56:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2HHu8xj079647; Sat, 17 Mar 2018 17:56:08 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2HHu871079646; Sat, 17 Mar 2018 17:56:08 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201803171756.w2HHu871079646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 17 Mar 2018 17:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331105 - head/sys/security/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/security/audit X-SVN-Commit-Revision: 331105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 17:56:09 -0000 Author: asomers Date: Sat Mar 17 17:56:08 2018 New Revision: 331105 URL: https://svnweb.freebsd.org/changeset/base/331105 Log: audit(4): fix a typo in a comment no functional change Modified: head/sys/security/audit/audit_bsm_klib.c Modified: head/sys/security/audit/audit_bsm_klib.c ============================================================================== --- head/sys/security/audit/audit_bsm_klib.c Sat Mar 17 17:52:47 2018 (r331104) +++ head/sys/security/audit/audit_bsm_klib.c Sat Mar 17 17:56:08 2018 (r331105) @@ -119,7 +119,7 @@ static const int aue_shmsys[] = { static const int aue_shmsys_count = sizeof(aue_shmsys) / sizeof(int); /* - * Check whether an event is aditable by comparing the mask of classes this + * Check whether an event is auditable by comparing the mask of classes this * event is part of against the given mask. */ int From owner-svn-src-head@freebsd.org Sat Mar 17 18:14:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB942F5DF27; Sat, 17 Mar 2018 18:14:49 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81DC187E28; Sat, 17 Mar 2018 18:14:49 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C1EF15C88; Sat, 17 Mar 2018 18:14:49 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2HIEnrf089639; Sat, 17 Mar 2018 18:14:49 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2HIEnn9089638; Sat, 17 Mar 2018 18:14:49 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201803171814.w2HIEnn9089638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sat, 17 Mar 2018 18:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331106 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 331106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 18:14:50 -0000 Author: jeff Date: Sat Mar 17 18:14:49 2018 New Revision: 331106 URL: https://svnweb.freebsd.org/changeset/base/331106 Log: Move the dirty queues inside the per-domain structure. This resolves a bug where we had not hit global dirty limits but a single queue was starved for space by dirty buffers. A single buf_daemon is maintained for now. Add a bd_speedup() when we are low on bufspace. This can happen due to SUJ keeping many bufs locked until a cg block is written. Document this with a comment. Fix sysctls to work with per-domain variables. Add more ddb debugging. Reported by: pho Reviewed by: kib Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D14705 Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sat Mar 17 17:56:08 2018 (r331105) +++ head/sys/kern/vfs_bio.c Sat Mar 17 18:14:49 2018 (r331106) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -100,6 +101,52 @@ struct buf_ops buf_ops_bio = { .bop_bdflush = bufbdflush, }; +struct bufqueue { + struct mtx_padalign bq_lock; + TAILQ_HEAD(, buf) bq_queue; + uint8_t bq_index; + uint16_t bq_subqueue; + int bq_len; +} __aligned(CACHE_LINE_SIZE); + +#define BQ_LOCKPTR(bq) (&(bq)->bq_lock) +#define BQ_LOCK(bq) mtx_lock(BQ_LOCKPTR((bq))) +#define BQ_UNLOCK(bq) mtx_unlock(BQ_LOCKPTR((bq))) +#define BQ_ASSERT_LOCKED(bq) mtx_assert(BQ_LOCKPTR((bq)), MA_OWNED) + +struct bufdomain { + struct bufqueue bd_subq[MAXCPU + 1]; /* Per-cpu sub queues + global */ + struct bufqueue bd_dirtyq; + struct bufqueue *bd_cleanq; + struct mtx_padalign bd_run_lock; + /* Constants */ + long bd_maxbufspace; + long bd_hibufspace; + long bd_lobufspace; + long bd_bufspacethresh; + int bd_hifreebuffers; + int bd_lofreebuffers; + int bd_hidirtybuffers; + int bd_lodirtybuffers; + int bd_dirtybufthresh; + int bd_lim; + /* atomics */ + int bd_wanted; + int __aligned(CACHE_LINE_SIZE) bd_numdirtybuffers; + int __aligned(CACHE_LINE_SIZE) bd_running; + long __aligned(CACHE_LINE_SIZE) bd_bufspace; + int __aligned(CACHE_LINE_SIZE) bd_freebuffers; +} __aligned(CACHE_LINE_SIZE); + +#define BD_LOCKPTR(bd) (&(bd)->bd_cleanq->bq_lock) +#define BD_LOCK(bd) mtx_lock(BD_LOCKPTR((bd))) +#define BD_UNLOCK(bd) mtx_unlock(BD_LOCKPTR((bd))) +#define BD_ASSERT_LOCKED(bd) mtx_assert(BD_LOCKPTR((bd)), MA_OWNED) +#define BD_RUN_LOCKPTR(bd) (&(bd)->bd_run_lock) +#define BD_RUN_LOCK(bd) mtx_lock(BD_RUN_LOCKPTR((bd))) +#define BD_RUN_UNLOCK(bd) mtx_unlock(BD_RUN_LOCKPTR((bd))) +#define BD_DOMAIN(bd) (bd - bdomain) + static struct buf *buf; /* buffer header pool */ extern struct buf *swbuf; /* Swap buffer header pool. */ caddr_t unmapped_buf; @@ -123,8 +170,8 @@ static int vfs_bio_clcheck(struct vnode *vp, int size, daddr_t lblkno, daddr_t blkno); static void breada(struct vnode *, daddr_t *, int *, int, struct ucred *, int, void (*)(struct buf *)); -static int buf_flush(struct vnode *vp, int); -static int flushbufqueues(struct vnode *, int, int); +static int buf_flush(struct vnode *vp, struct bufdomain *, int); +static int flushbufqueues(struct vnode *, struct bufdomain *, int, int); static void buf_daemon(void); static __inline void bd_wakeup(void); static int sysctl_runningspace(SYSCTL_HANDLER_ARGS); @@ -133,6 +180,16 @@ static void bufkva_free(struct buf *); static int buf_import(void *, void **, int, int, int); static void buf_release(void *, void **, int); static void maxbcachebuf_adjust(void); +static inline struct bufdomain *bufdomain(struct buf *); +static void bq_remove(struct bufqueue *bq, struct buf *bp); +static void bq_insert(struct bufqueue *bq, struct buf *bp, bool unlock); +static int buf_recycle(struct bufdomain *, bool kva); +static void bq_init(struct bufqueue *bq, int qindex, int cpu, + const char *lockname); +static void bd_init(struct bufdomain *bd); +static int bd_flushall(struct bufdomain *bd); +static int sysctl_bufdomain_long(SYSCTL_HANDLER_ARGS); +static int sysctl_bufdomain_int(SYSCTL_HANDLER_ARGS); static int sysctl_bufspace(SYSCTL_HANDLER_ARGS); int vmiodirenable = TRUE; @@ -147,7 +204,9 @@ static counter_u64_t bufkvaspace; SYSCTL_COUNTER_U64(_vfs, OID_AUTO, bufkvaspace, CTLFLAG_RD, &bufkvaspace, "Kernel virtual memory used for buffers"); static long maxbufspace; -SYSCTL_LONG(_vfs, OID_AUTO, maxbufspace, CTLFLAG_RW, &maxbufspace, 0, +SYSCTL_PROC(_vfs, OID_AUTO, maxbufspace, + CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &maxbufspace, + __offsetof(struct bufdomain, bd_maxbufspace), sysctl_bufdomain_long, "L", "Maximum allowed value of bufspace (including metadata)"); static long bufmallocspace; SYSCTL_LONG(_vfs, OID_AUTO, bufmallocspace, CTLFLAG_RD, &bufmallocspace, 0, @@ -156,14 +215,20 @@ static long maxbufmallocspace; SYSCTL_LONG(_vfs, OID_AUTO, maxmallocbufspace, CTLFLAG_RW, &maxbufmallocspace, 0, "Maximum amount of malloced memory for buffers"); static long lobufspace; -SYSCTL_LONG(_vfs, OID_AUTO, lobufspace, CTLFLAG_RW, &lobufspace, 0, +SYSCTL_PROC(_vfs, OID_AUTO, lobufspace, + CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &lobufspace, + __offsetof(struct bufdomain, bd_lobufspace), sysctl_bufdomain_long, "L", "Minimum amount of buffers we want to have"); long hibufspace; -SYSCTL_LONG(_vfs, OID_AUTO, hibufspace, CTLFLAG_RW, &hibufspace, 0, +SYSCTL_PROC(_vfs, OID_AUTO, hibufspace, + CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &hibufspace, + __offsetof(struct bufdomain, bd_hibufspace), sysctl_bufdomain_long, "L", "Maximum allowed value of bufspace (excluding metadata)"); long bufspacethresh; -SYSCTL_LONG(_vfs, OID_AUTO, bufspacethresh, CTLFLAG_RW, &bufspacethresh, - 0, "Bufspace consumed before waking the daemon to free some"); +SYSCTL_PROC(_vfs, OID_AUTO, bufspacethresh, + CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &bufspacethresh, + __offsetof(struct bufdomain, bd_bufspacethresh), sysctl_bufdomain_long, "L", + "Bufspace consumed before waking the daemon to free some"); static counter_u64_t buffreekvacnt; SYSCTL_COUNTER_U64(_vfs, OID_AUTO, buffreekvacnt, CTLFLAG_RW, &buffreekvacnt, "Number of times we have freed the KVA space from some buffer"); @@ -190,26 +255,37 @@ SYSCTL_INT(_vfs, OID_AUTO, altbufferflushes, CTLFLAG_R static int recursiveflushes; SYSCTL_INT(_vfs, OID_AUTO, recursiveflushes, CTLFLAG_RW, &recursiveflushes, 0, "Number of flushes skipped due to being recursive"); -static int numdirtybuffers; -SYSCTL_INT(_vfs, OID_AUTO, numdirtybuffers, CTLFLAG_RD, &numdirtybuffers, 0, +static int sysctl_numdirtybuffers(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_vfs, OID_AUTO, numdirtybuffers, + CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_RD, NULL, 0, sysctl_numdirtybuffers, "I", "Number of buffers that are dirty (has unwritten changes) at the moment"); static int lodirtybuffers; -SYSCTL_INT(_vfs, OID_AUTO, lodirtybuffers, CTLFLAG_RW, &lodirtybuffers, 0, +SYSCTL_PROC(_vfs, OID_AUTO, lodirtybuffers, + CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &lodirtybuffers, + __offsetof(struct bufdomain, bd_lodirtybuffers), sysctl_bufdomain_int, "L", "How many buffers we want to have free before bufdaemon can sleep"); static int hidirtybuffers; -SYSCTL_INT(_vfs, OID_AUTO, hidirtybuffers, CTLFLAG_RW, &hidirtybuffers, 0, +SYSCTL_PROC(_vfs, OID_AUTO, hidirtybuffers, + CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &hidirtybuffers, + __offsetof(struct bufdomain, bd_hidirtybuffers), sysctl_bufdomain_int, "L", "When the number of dirty buffers is considered severe"); int dirtybufthresh; -SYSCTL_INT(_vfs, OID_AUTO, dirtybufthresh, CTLFLAG_RW, &dirtybufthresh, - 0, "Number of bdwrite to bawrite conversions to clear dirty buffers"); +SYSCTL_PROC(_vfs, OID_AUTO, dirtybufthresh, + CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &dirtybufthresh, + __offsetof(struct bufdomain, bd_dirtybufthresh), sysctl_bufdomain_int, "L", + "Number of bdwrite to bawrite conversions to clear dirty buffers"); static int numfreebuffers; SYSCTL_INT(_vfs, OID_AUTO, numfreebuffers, CTLFLAG_RD, &numfreebuffers, 0, "Number of free buffers"); static int lofreebuffers; -SYSCTL_INT(_vfs, OID_AUTO, lofreebuffers, CTLFLAG_RW, &lofreebuffers, 0, +SYSCTL_PROC(_vfs, OID_AUTO, lofreebuffers, + CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &lofreebuffers, + __offsetof(struct bufdomain, bd_lofreebuffers), sysctl_bufdomain_int, "L", "Target number of free buffers"); static int hifreebuffers; -SYSCTL_INT(_vfs, OID_AUTO, hifreebuffers, CTLFLAG_RW, &hifreebuffers, 0, +SYSCTL_PROC(_vfs, OID_AUTO, hifreebuffers, + CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &hifreebuffers, + __offsetof(struct bufdomain, bd_hifreebuffers), sysctl_bufdomain_int, "L", "Threshold for clean buffer recycling"); static counter_u64_t getnewbufcalls; SYSCTL_COUNTER_U64(_vfs, OID_AUTO, getnewbufcalls, CTLFLAG_RD, @@ -294,66 +370,19 @@ static int bdirtywait; #define QUEUE_CLEAN 3 /* non-B_DELWRI buffers */ #define QUEUE_SENTINEL 4 /* not an queue index, but mark for sentinel */ -struct bufqueue { - struct mtx_padalign bq_lock; - TAILQ_HEAD(, buf) bq_queue; - uint8_t bq_index; - uint16_t bq_subqueue; - int bq_len; -} __aligned(CACHE_LINE_SIZE); +/* Maximum number of buffer domains. */ +#define BUF_DOMAINS 8 -#define BQ_LOCKPTR(bq) (&(bq)->bq_lock) -#define BQ_LOCK(bq) mtx_lock(BQ_LOCKPTR((bq))) -#define BQ_UNLOCK(bq) mtx_unlock(BQ_LOCKPTR((bq))) -#define BQ_ASSERT_LOCKED(bq) mtx_assert(BQ_LOCKPTR((bq)), MA_OWNED) +struct bufdomainset bdlodirty; /* Domains > lodirty */ +struct bufdomainset bdhidirty; /* Domains > hidirty */ -struct bufqueue __exclusive_cache_line bqempty; -struct bufqueue __exclusive_cache_line bqdirty; - -struct bufdomain { - struct bufqueue bd_subq[MAXCPU + 1]; /* Per-cpu sub queues + global */ - struct bufqueue *bd_cleanq; - struct mtx_padalign bd_run_lock; - /* Constants */ - long bd_maxbufspace; - long bd_hibufspace; - long bd_lobufspace; - long bd_bufspacethresh; - int bd_hifreebuffers; - int bd_lofreebuffers; - int bd_lim; - /* atomics */ - int bd_wanted; - int __aligned(CACHE_LINE_SIZE) bd_running; - long __aligned(CACHE_LINE_SIZE) bd_bufspace; - int __aligned(CACHE_LINE_SIZE) bd_freebuffers; -} __aligned(CACHE_LINE_SIZE); - -#define BD_LOCKPTR(bd) (&(bd)->bd_cleanq->bq_lock) -#define BD_LOCK(bd) mtx_lock(BD_LOCKPTR((bd))) -#define BD_UNLOCK(bd) mtx_unlock(BD_LOCKPTR((bd))) -#define BD_ASSERT_LOCKED(bd) mtx_assert(BD_LOCKPTR((bd)), MA_OWNED) -#define BD_RUN_LOCKPTR(bd) (&(bd)->bd_run_lock) -#define BD_RUN_LOCK(bd) mtx_lock(BD_RUN_LOCKPTR((bd))) -#define BD_RUN_UNLOCK(bd) mtx_unlock(BD_RUN_LOCKPTR((bd))) -#define BD_DOMAIN(bd) (bd - bdclean) - -/* Maximum number of clean buffer domains. */ -#define CLEAN_DOMAINS 8 - /* Configured number of clean queues. */ -static int __read_mostly clean_domains; +static int __read_mostly buf_domains; -struct bufdomain __exclusive_cache_line bdclean[CLEAN_DOMAINS]; +BITSET_DEFINE(bufdomainset, BUF_DOMAINS); +struct bufdomain __exclusive_cache_line bdomain[BUF_DOMAINS]; +struct bufqueue __exclusive_cache_line bqempty; -static void bq_remove(struct bufqueue *bq, struct buf *bp); -static void bq_insert(struct bufqueue *bq, struct buf *bp, bool unlock); -static int buf_recycle(struct bufdomain *, bool kva); -static void bq_init(struct bufqueue *bq, int qindex, int cpu, - const char *lockname); -static void bd_init(struct bufdomain *bd); -static int bd_flushall(struct bufdomain *bd); - /* * per-cpu empty buffer cache. */ @@ -393,6 +422,44 @@ sysctl_runningspace(SYSCTL_HANDLER_ARGS) return (error); } +static int +sysctl_bufdomain_int(SYSCTL_HANDLER_ARGS) +{ + int error; + int value; + int i; + + value = *(int *)arg1; + error = sysctl_handle_int(oidp, &value, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + *(int *)arg1 = value; + for (i = 0; i < buf_domains; i++) + *(int *)(((uintptr_t)&bdomain[i]) + arg2) = + value / buf_domains; + + return (error); +} + +static int +sysctl_bufdomain_long(SYSCTL_HANDLER_ARGS) +{ + long value; + int error; + int i; + + value = *(long *)arg1; + error = sysctl_handle_long(oidp, &value, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + *(long *)arg1 = value; + for (i = 0; i < buf_domains; i++) + *(long *)(((uintptr_t)&bdomain[i]) + arg2) = + value / buf_domains; + + return (error); +} + #if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) static int @@ -403,8 +470,8 @@ sysctl_bufspace(SYSCTL_HANDLER_ARGS) int i; lvalue = 0; - for (i = 0; i < clean_domains; i++) - lvalue += bdclean[i].bd_bufspace; + for (i = 0; i < buf_domains; i++) + lvalue += bdomain[i].bd_bufspace; if (sizeof(int) == sizeof(long) || req->oldlen >= sizeof(long)) return (sysctl_handle_long(oidp, &lvalue, 0, req)); if (lvalue > INT_MAX) @@ -421,12 +488,24 @@ sysctl_bufspace(SYSCTL_HANDLER_ARGS) int i; lvalue = 0; - for (i = 0; i < clean_domains; i++) - lvalue += bdclean[i].bd_bufspace; + for (i = 0; i < buf_domains; i++) + lvalue += bdomain[i].bd_bufspace; return (sysctl_handle_long(oidp, &lvalue, 0, req)); } #endif +static int +sysctl_numdirtybuffers(SYSCTL_HANDLER_ARGS) +{ + int value; + int i; + + value = 0; + for (i = 0; i < buf_domains; i++) + value += bdomain[i].bd_numdirtybuffers; + return (sysctl_handle_int(oidp, &value, 0, req)); +} + /* * bdirtywakeup: * @@ -444,18 +523,59 @@ bdirtywakeup(void) } /* + * bd_clear: + * + * Clear a domain from the appropriate bitsets when dirtybuffers + * is decremented. + */ +static void +bd_clear(struct bufdomain *bd) +{ + + mtx_lock(&bdirtylock); + if (bd->bd_numdirtybuffers <= bd->bd_lodirtybuffers) + BIT_CLR(BUF_DOMAINS, BD_DOMAIN(bd), &bdlodirty); + if (bd->bd_numdirtybuffers <= bd->bd_hidirtybuffers) + BIT_CLR(BUF_DOMAINS, BD_DOMAIN(bd), &bdhidirty); + mtx_unlock(&bdirtylock); +} + +/* + * bd_set: + * + * Set a domain in the appropriate bitsets when dirtybuffers + * is incremented. + */ +static void +bd_set(struct bufdomain *bd) +{ + + mtx_lock(&bdirtylock); + if (bd->bd_numdirtybuffers > bd->bd_lodirtybuffers) + BIT_SET(BUF_DOMAINS, BD_DOMAIN(bd), &bdlodirty); + if (bd->bd_numdirtybuffers > bd->bd_hidirtybuffers) + BIT_SET(BUF_DOMAINS, BD_DOMAIN(bd), &bdhidirty); + mtx_unlock(&bdirtylock); +} + +/* * bdirtysub: * * Decrement the numdirtybuffers count by one and wakeup any * threads blocked in bwillwrite(). */ static void -bdirtysub(void) +bdirtysub(struct buf *bp) { + struct bufdomain *bd; + int num; - if (atomic_fetchadd_int(&numdirtybuffers, -1) == - (lodirtybuffers + hidirtybuffers) / 2) + bd = bufdomain(bp); + num = atomic_fetchadd_int(&bd->bd_numdirtybuffers, -1); + if (num == (bd->bd_lodirtybuffers + bd->bd_hidirtybuffers) / 2) bdirtywakeup(); + if (num == bd->bd_lodirtybuffers || num == bd->bd_hidirtybuffers) + bd_clear(bd); } /* @@ -465,16 +585,21 @@ bdirtysub(void) * daemon if needed. */ static void -bdirtyadd(void) +bdirtyadd(struct buf *bp) { + struct bufdomain *bd; + int num; /* * Only do the wakeup once as we cross the boundary. The * buf daemon will keep running until the condition clears. */ - if (atomic_fetchadd_int(&numdirtybuffers, 1) == - (lodirtybuffers + hidirtybuffers) / 2) + bd = bufdomain(bp); + num = atomic_fetchadd_int(&bd->bd_numdirtybuffers, 1); + if (num == (bd->bd_lodirtybuffers + bd->bd_hidirtybuffers) / 2) bd_wakeup(); + if (num == bd->bd_lodirtybuffers || num == bd->bd_hidirtybuffers) + bd_set(bd); } /* @@ -539,11 +664,11 @@ bufspace_adjust(struct buf *bp, int bufsize) KASSERT((bp->b_flags & B_MALLOC) == 0, ("bufspace_adjust: malloc buf %p", bp)); - bd = &bdclean[bp->b_domain]; + bd = bufdomain(bp); diff = bufsize - bp->b_bufsize; if (diff < 0) { atomic_subtract_long(&bd->bd_bufspace, -diff); - } else { + } else if (diff > 0) { space = atomic_fetchadd_long(&bd->bd_bufspace, diff); /* Wake up the daemon on the transition. */ if (space < bd->bd_bufspacethresh && @@ -638,7 +763,7 @@ bufspace_wait(struct bufdomain *bd, struct vnode *vp, * recursion. */ td->td_pflags |= TDP_BUFNEED | TDP_NORUNNINGBUF; - fl = buf_flush(vp, flushbufqtarget); + fl = buf_flush(vp, bd, flushbufqtarget); td->td_pflags &= norunbuf; BD_LOCK(bd); if (fl != 0) @@ -700,6 +825,15 @@ bufspace_daemon(void *arg) if (buf_recycle(bd, false) != 0) { if (bd_flushall(bd)) continue; + /* + * Speedup dirty if we've run out of clean + * buffers. This is possible in particular + * because softdep may held many bufs locked + * pending writes to other bufs which are + * marked for delayed write, exhausting + * clean space until they are written. + */ + bd_speedup(); BD_LOCK(bd); if (bd->bd_wanted) { msleep(&bd->bd_wanted, BD_LOCKPTR(bd), @@ -1025,7 +1159,6 @@ bufinit(void) ("maxbcachebuf (%d) must be >= MAXBSIZE (%d)\n", maxbcachebuf, MAXBSIZE)); bq_init(&bqempty, QUEUE_EMPTY, -1, "bufq empty lock"); - bq_init(&bqdirty, QUEUE_DIRTY, -1, "bufq dirty lock"); mtx_init(&rbreqlock, "runningbufspace lock", NULL, MTX_DEF); mtx_init(&bdlock, "buffer daemon lock", NULL, MTX_DEF); mtx_init(&bdirtylock, "dirty buf lock", NULL, MTX_DEF); @@ -1093,7 +1226,6 @@ bufinit(void) */ hidirtybuffers = nbuf / 4 + 20; dirtybufthresh = hidirtybuffers * 9 / 10; - numdirtybuffers = 0; /* * To support extreme low-memory systems, make sure hidirtybuffers * cannot eat up all available buffer space. This occurs when our @@ -1128,22 +1260,26 @@ bufinit(void) * One queue per-256mb up to the max. More queues gives better * concurrency but less accurate LRU. */ - clean_domains = MIN(howmany(maxbufspace, 256*1024*1024), CLEAN_DOMAINS); - for (i = 0 ; i < clean_domains; i++) { + buf_domains = MIN(howmany(maxbufspace, 256*1024*1024), BUF_DOMAINS); + for (i = 0 ; i < buf_domains; i++) { struct bufdomain *bd; - bd = &bdclean[i]; + bd = &bdomain[i]; bd_init(bd); - bd->bd_freebuffers = nbuf / clean_domains; - bd->bd_hifreebuffers = hifreebuffers / clean_domains; - bd->bd_lofreebuffers = lofreebuffers / clean_domains; + bd->bd_freebuffers = nbuf / buf_domains; + bd->bd_hifreebuffers = hifreebuffers / buf_domains; + bd->bd_lofreebuffers = lofreebuffers / buf_domains; bd->bd_bufspace = 0; - bd->bd_maxbufspace = maxbufspace / clean_domains; - bd->bd_hibufspace = hibufspace / clean_domains; - bd->bd_lobufspace = lobufspace / clean_domains; - bd->bd_bufspacethresh = bufspacethresh / clean_domains; + bd->bd_maxbufspace = maxbufspace / buf_domains; + bd->bd_hibufspace = hibufspace / buf_domains; + bd->bd_lobufspace = lobufspace / buf_domains; + bd->bd_bufspacethresh = bufspacethresh / buf_domains; + bd->bd_numdirtybuffers = 0; + bd->bd_hidirtybuffers = hidirtybuffers / buf_domains; + bd->bd_lodirtybuffers = lodirtybuffers / buf_domains; + bd->bd_dirtybufthresh = dirtybufthresh / buf_domains; /* Don't allow more than 2% of bufs in the per-cpu caches. */ - bd->bd_lim = nbuf / clean_domains / 50 / mp_ncpus; + bd->bd_lim = nbuf / buf_domains / 50 / mp_ncpus; } getnewbufcalls = counter_u64_alloc(M_WAITOK); getnewbufrestarts = counter_u64_alloc(M_WAITOK); @@ -1327,6 +1463,13 @@ bpmap_qenter(struct buf *bp) (vm_offset_t)(bp->b_offset & PAGE_MASK)); } +static inline struct bufdomain * +bufdomain(struct buf *bp) +{ + + return (&bdomain[bp->b_domain]); +} + static struct bufqueue * bufqueue(struct buf *bp) { @@ -1339,9 +1482,9 @@ bufqueue(struct buf *bp) case QUEUE_EMPTY: return (&bqempty); case QUEUE_DIRTY: - return (&bqdirty); + return (&bufdomain(bp)->bd_dirtyq); case QUEUE_CLEAN: - return (&bdclean[bp->b_domain].bd_subq[bp->b_subqueue]); + return (&bufdomain(bp)->bd_subq[bp->b_subqueue]); default: break; } @@ -1404,14 +1547,14 @@ binsfree(struct buf *bp, int qindex) bq_remove(bq, bp); BQ_UNLOCK(bq); } + bd = bufdomain(bp); if (qindex == QUEUE_CLEAN) { - bd = &bdclean[bp->b_domain]; if (bd->bd_lim != 0) bq = &bd->bd_subq[PCPU_GET(cpuid)]; else bq = bd->bd_cleanq; } else - bq = &bqdirty; + bq = &bd->bd_dirtyq; bq_insert(bq, bp, true); } @@ -1439,7 +1582,7 @@ buf_free(struct buf *bp) if (!LIST_EMPTY(&bp->b_dep)) buf_deallocate(bp); bufkva_free(bp); - atomic_add_int(&bdclean[bp->b_domain].bd_freebuffers, 1); + atomic_add_int(&bufdomain(bp)->bd_freebuffers, 1); BUF_UNLOCK(bp); uma_zfree(buf_zone, bp); } @@ -1715,9 +1858,10 @@ bd_init(struct bufdomain *bd) int domain; int i; - domain = bd - bdclean; + domain = bd - bdomain; bd->bd_cleanq = &bd->bd_subq[mp_maxid + 1]; bq_init(bd->bd_cleanq, QUEUE_CLEAN, mp_maxid + 1, "bufq clean lock"); + bq_init(&bd->bd_dirtyq, QUEUE_DIRTY, -1, "bufq dirty lock"); for (i = 0; i <= mp_maxid; i++) bq_init(&bd->bd_subq[i], QUEUE_CLEAN, i, "bufq clean subqueue lock"); @@ -1809,7 +1953,7 @@ bq_insert(struct bufqueue *bq, struct buf *bp, bool un if (bp->b_qindex != QUEUE_NONE) panic("bq_insert: free buffer %p onto another queue?", bp); - bd = &bdclean[bp->b_domain]; + bd = bufdomain(bp); if (bp->b_flags & B_AGE) { /* Place this buf directly on the real queue. */ if (bq->bq_index == QUEUE_CLEAN) @@ -1926,8 +2070,8 @@ bufkva_reclaim(vmem_t *vmem, int flags) done = false; for (i = 0; i < 5; i++) { - for (q = 0; q < clean_domains; q++) - if (buf_recycle(&bdclean[q], true) != 0) + for (q = 0; q < buf_domains; q++) + if (buf_recycle(&bdomain[q], true) != 0) done = true; if (done) break; @@ -2319,7 +2463,7 @@ bdirty(struct buf *bp) if ((bp->b_flags & B_DELWRI) == 0) { bp->b_flags |= /* XXX B_DONE | */ B_DELWRI; reassignbuf(bp); - bdirtyadd(); + bdirtyadd(bp); } } @@ -2347,7 +2491,7 @@ bundirty(struct buf *bp) if (bp->b_flags & B_DELWRI) { bp->b_flags &= ~B_DELWRI; reassignbuf(bp); - bdirtysub(); + bdirtysub(bp); } /* * Since it is now being written, we can clear its deferred write flag. @@ -2419,9 +2563,9 @@ void bwillwrite(void) { - if (numdirtybuffers >= hidirtybuffers) { + if (buf_dirty_count_severe()) { mtx_lock(&bdirtylock); - while (numdirtybuffers >= hidirtybuffers) { + while (buf_dirty_count_severe()) { bdirtywait = 1; msleep(&bdirtywait, &bdirtylock, (PRIBIO + 4), "flswai", 0); @@ -2437,7 +2581,7 @@ int buf_dirty_count_severe(void) { - return(numdirtybuffers >= hidirtybuffers); + return (!BIT_EMPTY(BUF_DOMAINS, &bdhidirty)); } /* @@ -2523,7 +2667,7 @@ brelse(struct buf *bp) if (!LIST_EMPTY(&bp->b_dep)) buf_deallocate(bp); if (bp->b_flags & B_DELWRI) - bdirtysub(); + bdirtysub(bp); bp->b_flags &= ~(B_DELWRI | B_CACHE); if ((bp->b_flags & B_VMIO) == 0) { allocbuf(bp, 0); @@ -3138,9 +3282,9 @@ getnewbuf(struct vnode *vp, int slpflag, int slptimeo, else metadata = false; if (vp == NULL) - bd = &bdclean[0]; + bd = &bdomain[0]; else - bd = &bdclean[vp->v_bufobj.bo_domain]; + bd = &bdomain[vp->v_bufobj.bo_domain]; counter_u64_add(getnewbufcalls, 1); reserved = false; @@ -3186,11 +3330,11 @@ static struct kproc_desc buf_kp = { SYSINIT(bufdaemon, SI_SUB_KTHREAD_BUF, SI_ORDER_FIRST, kproc_start, &buf_kp); static int -buf_flush(struct vnode *vp, int target) +buf_flush(struct vnode *vp, struct bufdomain *bd, int target) { int flushed; - flushed = flushbufqueues(vp, target, 0); + flushed = flushbufqueues(vp, bd, target, 0); if (flushed == 0) { /* * Could not find any buffers without rollback @@ -3199,7 +3343,7 @@ buf_flush(struct vnode *vp, int target) */ if (vp != NULL && target > 2) target /= 2; - flushbufqueues(vp, target, 1); + flushbufqueues(vp, bd, target, 1); } return (flushed); } @@ -3207,6 +3351,8 @@ buf_flush(struct vnode *vp, int target) static void buf_daemon() { + struct bufdomain *bd; + int speedupreq; int lodirty; int i; @@ -3219,11 +3365,11 @@ buf_daemon() /* * Start the buf clean daemons as children threads. */ - for (i = 0 ; i < clean_domains; i++) { + for (i = 0 ; i < buf_domains; i++) { int error; error = kthread_add((void (*)(void *))bufspace_daemon, - &bdclean[i], curproc, NULL, 0, 0, "bufspacedaemon-%d", i); + &bdomain[i], curproc, NULL, 0, 0, "bufspacedaemon-%d", i); if (error) panic("error %d spawning bufspace daemon", error); } @@ -3238,20 +3384,30 @@ buf_daemon() mtx_unlock(&bdlock); kproc_suspend_check(bufdaemonproc); - lodirty = lodirtybuffers; - if (bd_speedupreq) { - lodirty = numdirtybuffers / 2; - bd_speedupreq = 0; - } + /* - * Do the flush. Limit the amount of in-transit I/O we - * allow to build up, otherwise we would completely saturate - * the I/O system. + * Save speedupreq for this pass and reset to capture new + * requests. */ - while (numdirtybuffers > lodirty) { - if (buf_flush(NULL, numdirtybuffers - lodirty) == 0) - break; - kern_yield(PRI_USER); + speedupreq = bd_speedupreq; + bd_speedupreq = 0; + + /* + * Flush each domain sequentially according to its level and + * the speedup request. + */ + for (i = 0; i < buf_domains; i++) { + bd = &bdomain[i]; + if (speedupreq) + lodirty = bd->bd_numdirtybuffers / 2; + else + lodirty = bd->bd_lodirtybuffers; + while (bd->bd_numdirtybuffers > lodirty) { + if (buf_flush(NULL, bd, + bd->bd_numdirtybuffers - lodirty) == 0) + break; + kern_yield(PRI_USER); + } } /* @@ -3265,7 +3421,7 @@ buf_daemon() * to avoid endless loops on unlockable buffers. */ mtx_lock(&bdlock); - if (numdirtybuffers <= lodirtybuffers) { + if (!BIT_EMPTY(BUF_DOMAINS, &bdlodirty)) { /* * We reached our low water mark, reset the * request and sleep until we are needed again. @@ -3304,7 +3460,8 @@ SYSCTL_INT(_vfs, OID_AUTO, flushwithdeps, CTLFLAG_RW, 0, "Number of buffers flushed with dependecies that require rollbacks"); static int -flushbufqueues(struct vnode *lvp, int target, int flushdeps) +flushbufqueues(struct vnode *lvp, struct bufdomain *bd, int target, + int flushdeps) { struct bufqueue *bq; struct buf *sentinel; @@ -3317,7 +3474,7 @@ flushbufqueues(struct vnode *lvp, int target, int flus bool unlock; flushed = 0; - bq = &bqdirty; + bq = &bd->bd_dirtyq; bp = NULL; sentinel = malloc(sizeof(struct buf), M_TEMP, M_WAITOK | M_ZERO); sentinel->b_qindex = QUEUE_SENTINEL; @@ -3653,7 +3810,7 @@ bp_unmapped_get_kva(struct buf *bp, daddr_t blkno, int panic("GB_NOWAIT_BD and GB_UNMAPPED %p", bp); } counter_u64_add(mappingrestarts, 1); - bufspace_wait(&bdclean[bp->b_domain], bp->b_vp, gbflags, 0, 0); + bufspace_wait(bufdomain(bp), bp->b_vp, gbflags, 0, 0); } has_addr: if (need_mapping) { @@ -3851,7 +4008,7 @@ loop: */ if (flags & GB_NOCREAT) return NULL; - if (bdclean[bo->bo_domain].bd_freebuffers == 0 && + if (bdomain[bo->bo_domain].bd_freebuffers == 0 && TD_IS_IDLETHREAD(curthread)) return NULL; @@ -3908,7 +4065,7 @@ loop: if (gbincore(bo, blkno)) { BO_UNLOCK(bo); bp->b_flags |= B_INVAL; - bufspace_release(&bdclean[bp->b_domain], maxsize); + bufspace_release(bufdomain(bp), maxsize); brelse(bp); goto loop; } @@ -3943,7 +4100,7 @@ loop: } allocbuf(bp, size); - bufspace_release(&bdclean[bp->b_domain], maxsize); + bufspace_release(bufdomain(bp), maxsize); bp->b_flags &= ~B_DONE; } CTR4(KTR_BUF, "getblk(%p, %ld, %d) = %p", vp, (long)blkno, size, bp); @@ -3972,7 +4129,7 @@ geteblk(int size, int flags) return (NULL); } allocbuf(bp, size); - bufspace_release(&bdclean[bp->b_domain], maxsize); + bufspace_release(bufdomain(bp), maxsize); bp->b_flags |= B_INVAL; /* b_dep cleared by getnewbuf() */ BUF_ASSERT_HELD(bp); return (bp); @@ -4841,7 +4998,7 @@ bufobj_init(struct bufobj *bo, void *private) static volatile int bufobj_cleanq; bo->bo_domain = - atomic_fetchadd_int(&bufobj_cleanq, 1) % clean_domains; + atomic_fetchadd_int(&bufobj_cleanq, 1) % buf_domains; rw_init(BO_LOCKPTR(bo), "bufobj interlock"); bo->bo_private = private; TAILQ_INIT(&bo->bo_clean.bv_hd); @@ -5164,6 +5321,7 @@ DB_SHOW_COMMAND(buffer, db_show_buffer) } db_printf("\n"); } + BUF_LOCKPRINTINFO(bp); #if defined(FULL_BUF_TRACKING) db_printf("b_io_tracking: b_io_tcnt = %u\n", bp->b_io_tcnt); @@ -5178,19 +5336,19 @@ DB_SHOW_COMMAND(buffer, db_show_buffer) db_printf("b_io_tracking: %s\n", bp->b_io_tracking); #endif db_printf(" "); - BUF_LOCKPRINTINFO(bp); } DB_SHOW_COMMAND(bufqueues, bufqueues) { struct bufdomain *bd; - int i, j; + struct buf *bp; + long total; + int i, j, cnt; db_printf("bqempty: %d\n", bqempty.bq_len); - db_printf("bqdirty: %d\n", bqdirty.bq_len); - for (i = 0; i < clean_domains; i++) { - bd = &bdclean[i]; + for (i = 0; i < buf_domains; i++) { + bd = &bdomain[i]; db_printf("Buf domain %d\n", i); db_printf("\tfreebufs\t%d\n", bd->bd_freebuffers); db_printf("\tlofreebufs\t%d\n", bd->bd_lofreebuffers); @@ -5202,13 +5360,43 @@ DB_SHOW_COMMAND(bufqueues, bufqueues) db_printf("\tlobufspace\t%ld\n", bd->bd_lobufspace); db_printf("\tbufspacethresh\t%ld\n", bd->bd_bufspacethresh); db_printf("\n"); - db_printf("\tcleanq count\t%d\n", bd->bd_cleanq->bq_len); + db_printf("\tnumdirtybuffers\t%d\n", bd->bd_numdirtybuffers); + db_printf("\tlodirtybuffers\t%d\n", bd->bd_lodirtybuffers); + db_printf("\thidirtybuffers\t%d\n", bd->bd_hidirtybuffers); + db_printf("\tdirtybufthresh\t%d\n", bd->bd_dirtybufthresh); + db_printf("\n"); + total = 0; + TAILQ_FOREACH(bp, &bd->bd_cleanq->bq_queue, b_freelist) + total += bp->b_bufsize; + db_printf("\tcleanq count\t%d (%ld)\n", + bd->bd_cleanq->bq_len, total); + total = 0; + TAILQ_FOREACH(bp, &bd->bd_dirtyq.bq_queue, b_freelist) + total += bp->b_bufsize; + db_printf("\tdirtyq count\t%d (%ld)\n", + bd->bd_dirtyq.bq_len, total); db_printf("\twakeup\t\t%d\n", bd->bd_wanted); db_printf("\tlim\t\t%d\n", bd->bd_lim); db_printf("\tCPU "); for (j = 0; j <= mp_maxid; j++) db_printf("%d, ", bd->bd_subq[j].bq_len); db_printf("\n"); + cnt = 0; + total = 0; + for (j = 0; j < nbuf; j++) + if (buf[j].b_domain == i && BUF_ISLOCKED(&buf[j])) { + cnt++; + total += buf[j].b_bufsize; + } + db_printf("\tLocked buffers: %d space %ld\n", cnt, total); + cnt = 0; + total = 0; + for (j = 0; j < nbuf; j++) + if (buf[j].b_domain == i) { + cnt++; + total += buf[j].b_bufsize; + } + db_printf("\tTotal buffers: %d space %ld\n", cnt, total); } } From owner-svn-src-head@freebsd.org Sat Mar 17 19:26:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23B3EF62988; Sat, 17 Mar 2018 19:26:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B51016ACA8; Sat, 17 Mar 2018 19:26:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA25E1671D; Sat, 17 Mar 2018 19:26:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2HJQXZb025199; Sat, 17 Mar 2018 19:26:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2HJQXpv025196; Sat, 17 Mar 2018 19:26:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201803171926.w2HJQXpv025196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Mar 2018 19:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331109 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 331109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 19:26:34 -0000 Author: mjg Date: Sat Mar 17 19:26:33 2018 New Revision: 331109 URL: https://svnweb.freebsd.org/changeset/base/331109 Log: locks: slightly depessimize lockstat The slow path is always taken when lockstat is enabled. This induces rdtsc (or other) calls to get the cycle count even when there was no contention. Still go to the slow path to not mess with the fast path, but avoid the heavy lifting unless necessary. This reduces sys and real time during -j 80 buildkernel: before: 3651.84s user 1105.59s system 5394% cpu 1:28.18 total after: 3685.99s user 975.74s system 5450% cpu 1:25.53 total disabled: 3697.96s user 411.13s system 5261% cpu 1:18.10 total So note this is still a significant hit. LOCK_PROFILING results are not affected. Modified: head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sat Mar 17 19:04:36 2018 (r331108) +++ head/sys/kern/kern_mutex.c Sat Mar 17 19:26:33 2018 (r331109) @@ -491,8 +491,25 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) int doing_lockprof; #endif + td = curthread; tid = (uintptr_t)td; + m = mtxlock2mtx(c); + +#ifdef KDTRACE_HOOKS + if (LOCKSTAT_PROFILE_ENABLED(adaptive__acquire)) { + while (v == MTX_UNOWNED) { + if (_mtx_obtain_lock_fetch(m, &v, tid)) + goto out_lockstat; + } + doing_lockprof = 1; + all_time -= lockstat_nsecs(&m->lock_object); + } +#endif +#ifdef LOCK_PROFILING + doing_lockprof = 1; +#endif + if (SCHEDULER_STOPPED_TD(td)) return; @@ -501,7 +518,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) #elif defined(KDTRACE_HOOKS) lock_delay_arg_init(&lda, NULL); #endif - m = mtxlock2mtx(c); + if (__predict_false(v == MTX_UNOWNED)) v = MTX_READ_VALUE(m); @@ -532,13 +549,6 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) CTR4(KTR_LOCK, "_mtx_lock_sleep: %s contested (lock=%p) at %s:%d", m->lock_object.lo_name, (void *)m->mtx_lock, file, line); -#ifdef LOCK_PROFILING - doing_lockprof = 1; -#elif defined(KDTRACE_HOOKS) - doing_lockprof = lockstat_enabled; - if (__predict_false(doing_lockprof)) - all_time -= lockstat_nsecs(&m->lock_object); -#endif for (;;) { if (v == MTX_UNOWNED) { @@ -660,10 +670,6 @@ retry_turnstile: #endif #ifdef KDTRACE_HOOKS all_time += lockstat_nsecs(&m->lock_object); -#endif - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(adaptive__acquire, m, contested, - waittime, file, line); -#ifdef KDTRACE_HOOKS if (sleep_time) LOCKSTAT_RECORD1(adaptive__block, m, sleep_time); @@ -672,7 +678,10 @@ retry_turnstile: */ if (lda.spin_cnt > sleep_cnt) LOCKSTAT_RECORD1(adaptive__spin, m, all_time - sleep_time); +out_lockstat: #endif + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(adaptive__acquire, m, contested, + waittime, file, line); } #ifdef SMP @@ -708,6 +717,20 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t tid = (uintptr_t)curthread; m = mtxlock2mtx(c); +#ifdef KDTRACE_HOOKS + if (LOCKSTAT_PROFILE_ENABLED(adaptive__acquire)) { + while (v == MTX_UNOWNED) { + if (_mtx_obtain_lock_fetch(m, &v, tid)) + goto out_lockstat; + } + doing_lockprof = 1; + spin_time -= lockstat_nsecs(&m->lock_object); + } +#endif +#ifdef LOCK_PROFILING + doing_lockprof = 1; +#endif + if (__predict_false(v == MTX_UNOWNED)) v = MTX_READ_VALUE(m); @@ -730,13 +753,7 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t PMC_SOFT_CALL( , , lock, failed); #endif lock_profile_obtain_lock_failed(&m->lock_object, &contested, &waittime); -#ifdef LOCK_PROFILING - doing_lockprof = 1; -#elif defined(KDTRACE_HOOKS) - doing_lockprof = lockstat_enabled; - if (__predict_false(doing_lockprof)) - spin_time -= lockstat_nsecs(&m->lock_object); -#endif + for (;;) { if (v == MTX_UNOWNED) { if (_mtx_obtain_lock_fetch(m, &v, tid)) @@ -767,13 +784,12 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t #endif #ifdef KDTRACE_HOOKS spin_time += lockstat_nsecs(&m->lock_object); -#endif - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m, - contested, waittime, file, line); -#ifdef KDTRACE_HOOKS if (lda.spin_cnt != 0) LOCKSTAT_RECORD1(spin__spin, m, spin_time); +out_lockstat: #endif + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m, + contested, waittime, file, line); } #endif /* SMP */ Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sat Mar 17 19:04:36 2018 (r331108) +++ head/sys/kern/kern_rwlock.c Sat Mar 17 19:26:33 2018 (r331109) @@ -438,9 +438,23 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) uintptr_t state; - int doing_lockprof; + int doing_lockprof = 0; #endif +#ifdef KDTRACE_HOOKS + if (LOCKSTAT_PROFILE_ENABLED(rw__acquire)) { + if (__rw_rlock_try(rw, td, &v, false LOCK_FILE_LINE_ARG)) + goto out_lockstat; + doing_lockprof = 1; + all_time -= lockstat_nsecs(&rw->lock_object); + state = v; + } +#endif +#ifdef LOCK_PROFILING + doing_lockprof = 1; + state = v; +#endif + if (SCHEDULER_STOPPED()) return; @@ -456,17 +470,6 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, lock_profile_obtain_lock_failed(&rw->lock_object, &contested, &waittime); -#ifdef LOCK_PROFILING - doing_lockprof = 1; - state = v; -#elif defined(KDTRACE_HOOKS) - doing_lockprof = lockstat_enabled; - if (__predict_false(doing_lockprof)) { - all_time -= lockstat_nsecs(&rw->lock_object); - state = v; - } -#endif - for (;;) { if (__rw_rlock_try(rw, td, &v, false LOCK_FILE_LINE_ARG)) break; @@ -615,6 +618,7 @@ retry_ts: LOCKSTAT_RECORD4(rw__spin, rw, all_time - sleep_time, LOCKSTAT_READER, (state & RW_LOCK_READ) == 0, (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); +out_lockstat: #endif /* * TODO: acquire "owner of record" here. Here be turnstile dragons @@ -892,10 +896,28 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) uintptr_t state; - int doing_lockprof; + int doing_lockprof = 0; #endif tid = (uintptr_t)curthread; + rw = rwlock2rw(c); + +#ifdef KDTRACE_HOOKS + if (LOCKSTAT_PROFILE_ENABLED(rw__acquire)) { + while (v == RW_UNLOCKED) { + if (_rw_write_lock_fetch(rw, &v, tid)) + goto out_lockstat; + } + doing_lockprof = 1; + all_time -= lockstat_nsecs(&rw->lock_object); + state = v; + } +#endif +#ifdef LOCK_PROFILING + doing_lockprof = 1; + state = v; +#endif + if (SCHEDULER_STOPPED()) return; @@ -904,7 +926,6 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC #elif defined(KDTRACE_HOOKS) lock_delay_arg_init(&lda, NULL); #endif - rw = rwlock2rw(c); if (__predict_false(v == RW_UNLOCKED)) v = RW_READ_VALUE(rw); @@ -929,17 +950,6 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC lock_profile_obtain_lock_failed(&rw->lock_object, &contested, &waittime); -#ifdef LOCK_PROFILING - doing_lockprof = 1; - state = v; -#elif defined(KDTRACE_HOOKS) - doing_lockprof = lockstat_enabled; - if (__predict_false(doing_lockprof)) { - all_time -= lockstat_nsecs(&rw->lock_object); - state = v; - } -#endif - for (;;) { if (v == RW_UNLOCKED) { if (_rw_write_lock_fetch(rw, &v, tid)) @@ -1101,6 +1111,7 @@ retry_ts: LOCKSTAT_RECORD4(rw__spin, rw, all_time - sleep_time, LOCKSTAT_WRITER, (state & RW_LOCK_READ) == 0, (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); +out_lockstat: #endif LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire, rw, contested, waittime, file, line, LOCKSTAT_WRITER); Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sat Mar 17 19:04:36 2018 (r331108) +++ head/sys/kern/kern_sx.c Sat Mar 17 19:26:33 2018 (r331109) @@ -565,6 +565,23 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO int extra_work = 0; tid = (uintptr_t)curthread; + +#ifdef KDTRACE_HOOKS + if (LOCKSTAT_PROFILE_ENABLED(sx__acquire)) { + while (x == SX_LOCK_UNLOCKED) { + if (atomic_fcmpset_acq_ptr(&sx->sx_lock, &x, tid)) + goto out_lockstat; + } + extra_work = 1; + all_time -= lockstat_nsecs(&sx->lock_object); + state = x; + } +#endif +#ifdef LOCK_PROFILING + extra_work = 1; + state = x; +#endif + if (SCHEDULER_STOPPED()) return (0); @@ -603,16 +620,6 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO lock_profile_obtain_lock_failed(&sx->lock_object, &contested, &waittime); -#ifdef LOCK_PROFILING - extra_work = 1; - state = x; -#elif defined(KDTRACE_HOOKS) - extra_work = lockstat_enabled; - if (__predict_false(extra_work)) { - all_time -= lockstat_nsecs(&sx->lock_object); - state = x; - } -#endif #ifndef INVARIANTS GIANT_SAVE(extra_work); #endif @@ -800,6 +807,7 @@ retry_sleepq: LOCKSTAT_RECORD4(sx__spin, sx, all_time - sleep_time, LOCKSTAT_WRITER, (state & SX_LOCK_SHARED) == 0, (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); +out_lockstat: #endif if (!error) LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, sx, @@ -932,6 +940,20 @@ _sx_slock_hard(struct sx *sx, int opts, uintptr_t x LO #endif int extra_work = 0; +#ifdef KDTRACE_HOOKS + if (LOCKSTAT_PROFILE_ENABLED(sx__acquire)) { + if (__sx_slock_try(sx, &x LOCK_FILE_LINE_ARG)) + goto out_lockstat; + extra_work = 1; + all_time -= lockstat_nsecs(&sx->lock_object); + state = x; + } +#endif +#ifdef LOCK_PROFILING + extra_work = 1; + state = x; +#endif + if (SCHEDULER_STOPPED()) return (0); @@ -951,16 +973,6 @@ _sx_slock_hard(struct sx *sx, int opts, uintptr_t x LO lock_profile_obtain_lock_failed(&sx->lock_object, &contested, &waittime); -#ifdef LOCK_PROFILING - extra_work = 1; - state = x; -#elif defined(KDTRACE_HOOKS) - extra_work = lockstat_enabled; - if (__predict_false(extra_work)) { - all_time -= lockstat_nsecs(&sx->lock_object); - state = x; - } -#endif #ifndef INVARIANTS GIANT_SAVE(extra_work); #endif @@ -1102,6 +1114,7 @@ retry_sleepq: LOCKSTAT_RECORD4(sx__spin, sx, all_time - sleep_time, LOCKSTAT_READER, (state & SX_LOCK_SHARED) == 0, (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); +out_lockstat: #endif if (error == 0) { LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, sx, From owner-svn-src-head@freebsd.org Sat Mar 17 21:49:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1839F436D0; Sat, 17 Mar 2018 21:49:18 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com [IPv6:2a00:1450:4010:c07::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4379A70135; Sat, 17 Mar 2018 21:49:18 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x22a.google.com with SMTP id y2-v6so18096524lfc.5; Sat, 17 Mar 2018 14:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=5/zxi4EdGbNR/sXiHUm93xASxSq4vP4/NGujnaM2yjQ=; b=Hy9REzRk3+PAaqKSz6OpZeEWjWbp6SC/mkSpFdd1FFpWQxInquOKRB2xc3SxKgRoLj Fx1ReQ7+cdYTm8zChg1oAciEcu1aAKiBxlnI+W4GKdyukXLs50xdnblS80lecdHZGSQt cn6kn6zTTscqKtIvjFbDMxKvlGn5ZovAHCL3qug5vtjIcN5NUZGjQD+lN2LWOF7Jgoyj v1xPJzCkfp74ALT8CXQw6mXwE0Y7qaVClFobrkl29CKqfoQDAGue65NXMjGVXtmoXTzj wW6yLi5GlxON7/i9ZbUMCNrnYXFqW1Iud6jM6ASKLVuGV4y4Vt8jZM0/xQjrZ7KPf7bX ms/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=5/zxi4EdGbNR/sXiHUm93xASxSq4vP4/NGujnaM2yjQ=; b=SxOPQPKZwMaghpJMC0S4QmtPdfdK/FCdrMDSmCHHKv52i0bvjVyzcExZ+SoQLsLb1j MyDynLKLsVAVQ0vhG6AqIuU66/5M8/inxJ0aZ0VxjU32eH/L4x8OPHfJJoMw/uE8jGaB BtNPOYoJRRjPY1WNuTgh9l2rRTtTTBZNyw+S06OzFiWH6xTDQZ9Qgv9S//+OmuqZvIlc kfRZHN8L68iLy4SLtOZnjKcQiS3s3W6WTu5RApLnK6cY9lwJEEECJ30IsC1K5KcCAZhM JH6eMVKXpc0iNnd6tn9sQKJKpp46MBsXNJRlPoZemUTyxKZqrakSboDJ3xSLgQp4DKjy Y8cw== X-Gm-Message-State: AElRT7HweBB9dfqGRLzrIOnKHwIT5+cd9jnjkpjROjCyu8QIhLCOrscZ 4BY+jrwCX5/feWCst/PNgX2yJjYSH786CTUiesJMWA== X-Google-Smtp-Source: AG47ELvIVchc5WSry7MFkInrNqdWl0nGMTEl/VDb6V/FMtcHec5N5n6Lt0TipneGf26DunAuuDgnTLvC7nWX3nhjFZg= X-Received: by 10.46.86.204 with SMTP id k73mr4453433lje.16.1521323356349; Sat, 17 Mar 2018 14:49:16 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.3.226 with HTTP; Sat, 17 Mar 2018 14:49:15 -0700 (PDT) In-Reply-To: <201803140300.w2E30HmE024745@repo.freebsd.org> References: <201803140300.w2E30HmE024745@repo.freebsd.org> From: Alan Somers Date: Sat, 17 Mar 2018 15:49:15 -0600 X-Google-Sender-Auth: U2udXk8kVtSxcqeCwjiAV0ffgVQ Message-ID: Subject: Re: svn commit: r330894 - in head/sys/contrib/zstd: . contrib/meson doc doc/images lib lib/common lib/compress lib/decompress lib/deprecated lib/dictBuilder lib/legacy programs tests zlibWrapper zlibWr... To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 21:49:19 -0000 On Tue, Mar 13, 2018 at 9:00 PM, Conrad Meyer wrote: > Author: cem > Date: Wed Mar 14 03:00:17 2018 > New Revision: 330894 > URL: https://svnweb.freebsd.org/changeset/base/330894 > > Log: > Update to Zstandard 1.3.3 > > Includes patch to conditionalize use of __builtin_clz(ll) on > __has_builtin(). > The issue is tracked upstream at https://github.com/facebook/ > zstd/pull/884 . > Otherwise, these are vanilla Zstandard 1.3.3 files. > > Note that the 1.3.4 release should be due out soon. > > Sponsored by: Dell EMC Isilon > > I think this broke the build on RISC-V. Could you please take a look? https://ci.freebsd.org/job/FreeBSD-head-riscv64-build/7028/console From owner-svn-src-head@freebsd.org Sat Mar 17 21:58:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC6E0F461D6; Sat, 17 Mar 2018 21:58:42 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55CF0707EF; Sat, 17 Mar 2018 21:58:42 +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 4336517DCD; Sat, 17 Mar 2018 21:58:42 +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 w2HLwg5j000608; Sat, 17 Mar 2018 21:58:42 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2HLwgbu000607; Sat, 17 Mar 2018 21:58:42 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201803172158.w2HLwgbu000607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 17 Mar 2018 21:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331113 - head/sbin/savecore X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sbin/savecore X-SVN-Commit-Revision: 331113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 21:58:42 -0000 Author: trasz Date: Sat Mar 17 21:58:41 2018 New Revision: 331113 URL: https://svnweb.freebsd.org/changeset/base/331113 Log: Xr crashinfo(8) from savecore(8). MFC after: 2 weeks Modified: head/sbin/savecore/savecore.8 Modified: head/sbin/savecore/savecore.8 ============================================================================== --- head/sbin/savecore/savecore.8 Sat Mar 17 20:37:01 2018 (r331112) +++ head/sbin/savecore/savecore.8 Sat Mar 17 21:58:41 2018 (r331113) @@ -174,6 +174,7 @@ is meant to be called near the end of the initializati .Xr xo_parse_args 3 , .Xr textdump 4 , .Xr tar 5 , +.Xr crashinfo 8 , .Xr decryptcore 8 , .Xr dumpon 8 , .Xr syslogd 8 From owner-svn-src-head@freebsd.org Sat Mar 17 22:40:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A9ACF4AFB0; Sat, 17 Mar 2018 22:40:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com [209.85.214.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF99171C0E; Sat, 17 Mar 2018 22:40:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f42.google.com with SMTP id g7-v6so6128005itf.1; Sat, 17 Mar 2018 15:40:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=NWixXrH87Cd7UgLyQLLFJh5uPVdXyrLj04unO2pCRXI=; b=lcLUdbT3RxoG0T79g/Tuxj2kIheLBrw3tLNyAh/1F2xVLjSVl/iFPexKKi/hqnXDdf R/s3cpCkt/sLlC2EJ9jGGyNJN/j6aQujyiIAC6PAn/eGwViIyBuw4qG/KDKMXl/Ko+FO hQ0aZHPIcltkyzthPqwZtw0SSlCAatGJWVNE6W3Ix5Lsn5ar9J3vN74EeVTwHTrI4pUd Nud6NYhFExve16qbXS6kCjYa5MoP1QViwma0vxJHRz/GiI3Nx4p+GnTGEUocgbVQGtJV YPwIzAjX5qrgBxHs85snv+dqqV/q668YOYpTbocxaMy6s3VqO8f3YOoBbbYScH4C7TYN CFjQ== X-Gm-Message-State: AElRT7FupS0EDaJ2sL8JtBjt0ZPnnSMQxMW/gmY/FsaBxLyZtkvk+1+F h5cJw1gAMH7i5h4WjRR2kX8PkoPJ X-Google-Smtp-Source: AG47ELvqAXG9xihwdsEdm+FFPl3Yf8Vfv3VTWJx6xqYrNn+548agiCsOi4G9QIzng4lTECGi9Exqpw== X-Received: by 2002:a24:5447:: with SMTP id t68-v6mr510304ita.67.1521326067656; Sat, 17 Mar 2018 15:34:27 -0700 (PDT) Received: from mail-io0-f179.google.com (mail-io0-f179.google.com. [209.85.223.179]) by smtp.gmail.com with ESMTPSA id v23sm6536979iov.57.2018.03.17.15.34.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Mar 2018 15:34:27 -0700 (PDT) Received: by mail-io0-f179.google.com with SMTP id h23so16575682iob.11; Sat, 17 Mar 2018 15:34:27 -0700 (PDT) X-Received: by 10.107.34.80 with SMTP id i77mr6651103ioi.220.1521326067251; Sat, 17 Mar 2018 15:34:27 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.153.132 with HTTP; Sat, 17 Mar 2018 15:34:26 -0700 (PDT) In-Reply-To: References: <201803140300.w2E30HmE024745@repo.freebsd.org> From: Conrad Meyer Date: Sat, 17 Mar 2018 15:34:26 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r330894 - in head/sys/contrib/zstd: . contrib/meson doc doc/images lib lib/common lib/compress lib/decompress lib/deprecated lib/dictBuilder lib/legacy programs tests zlibWrapper zlibWr... To: Alan Somers Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2018 22:40:01 -0000 Thanks for letting me know. I'll be able to take a look this weekend. Best, Conrad On Sat, Mar 17, 2018 at 2:49 PM, Alan Somers wrote: > On Tue, Mar 13, 2018 at 9:00 PM, Conrad Meyer wrote: >> >> Author: cem >> Date: Wed Mar 14 03:00:17 2018 >> New Revision: 330894 >> URL: https://svnweb.freebsd.org/changeset/base/330894 >> >> Log: >> Update to Zstandard 1.3.3 >> >> Includes patch to conditionalize use of __builtin_clz(ll) on >> __has_builtin(). >> The issue is tracked upstream at >> https://github.com/facebook/zstd/pull/884 . >> Otherwise, these are vanilla Zstandard 1.3.3 files. >> >> Note that the 1.3.4 release should be due out soon. >> >> Sponsored by: Dell EMC Isilon >> > > I think this broke the build on RISC-V. Could you please take a look? > > https://ci.freebsd.org/job/FreeBSD-head-riscv64-build/7028/console >