From owner-svn-src-all@freebsd.org Sun Aug 19 00:22:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D2E8107A524; Sun, 19 Aug 2018 00:22:32 +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 303B07DC72; Sun, 19 Aug 2018 00:22:32 +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 111331ED3F; Sun, 19 Aug 2018 00:22:32 +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 w7J0MVJn022124; Sun, 19 Aug 2018 00:22:31 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7J0MLBE022075; Sun, 19 Aug 2018 00:22:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808190022.w7J0MLBE022075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 19 Aug 2018 00:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338035 - in head/sys: crypto/ccp dev/aac dev/aacraid dev/adlink dev/ae dev/age dev/ahci dev/alc dev/ale dev/amdsmn dev/amdtemp dev/amr dev/an dev/bce dev/bfe dev/bge dev/bwi dev/bwn de... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: crypto/ccp dev/aac dev/aacraid dev/adlink dev/ae dev/age dev/ahci dev/alc dev/ale dev/amdsmn dev/amdtemp dev/amr dev/an dev/bce dev/bfe dev/bge dev/bwi dev/bwn dev/cas dev/ciss dev/dc dev... X-SVN-Commit-Revision: 338035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 00:22:32 -0000 Author: cem Date: Sun Aug 19 00:22:21 2018 New Revision: 338035 URL: https://svnweb.freebsd.org/changeset/base/338035 Log: Remove unused and easy to misuse PNP macro parameter Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element size, there is no functional change. Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci (Note that coccinelle invokes diff(1) via a PATH search and expects diff to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Modified: head/sys/crypto/ccp/ccp.c head/sys/dev/aac/aac_pci.c head/sys/dev/aacraid/aacraid_pci.c head/sys/dev/adlink/adlink.c head/sys/dev/ae/if_ae.c head/sys/dev/age/if_age.c head/sys/dev/ahci/ahci_pci.c head/sys/dev/alc/if_alc.c head/sys/dev/ale/if_ale.c head/sys/dev/amdsmn/amdsmn.c head/sys/dev/amdtemp/amdtemp.c head/sys/dev/amr/amr_pci.c head/sys/dev/an/if_an_pci.c head/sys/dev/bce/if_bce.c head/sys/dev/bfe/if_bfe.c head/sys/dev/bge/if_bge.c head/sys/dev/bwi/if_bwi_pci.c head/sys/dev/bwn/if_bwn_pci.c head/sys/dev/cas/if_cas.c head/sys/dev/ciss/ciss.c head/sys/dev/dc/if_dc.c head/sys/dev/drm2/i915/i915_drv.c head/sys/dev/drm2/radeon/radeon_drv.c head/sys/dev/ed/if_ed_pci.c head/sys/dev/ena/ena.c head/sys/dev/et/if_et.c head/sys/dev/fxp/if_fxp.c head/sys/dev/gem/if_gem_pci.c head/sys/dev/intpm/intpm.c head/sys/dev/ioat/ioat.c head/sys/dev/ipw/if_ipw.c head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ncr/ncr.c head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c head/sys/dev/ofw/ofw_bus_subr.h head/sys/dev/pccard/pccardvar.h head/sys/dev/pci/pcivar.h head/sys/dev/puc/puc_pci.c head/sys/dev/spibus/spi.h head/sys/dev/uart/uart_bus_pccard.c head/sys/dev/usb/usbdi.h head/sys/dev/xl/if_xl.c head/sys/isa/isavar.h head/sys/net/iflib.h head/sys/sys/module.h Modified: head/sys/crypto/ccp/ccp.c ============================================================================== --- head/sys/crypto/ccp/ccp.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/crypto/ccp/ccp.c Sun Aug 19 00:22:21 2018 (r338035) @@ -734,7 +734,7 @@ DRIVER_MODULE(ccp, pci, ccp_driver, ccp_devclass, NULL MODULE_VERSION(ccp, 1); MODULE_DEPEND(ccp, crypto, 1, 1, 1); MODULE_DEPEND(ccp, random_device, 1, 1, 1); -MODULE_PNP_INFO("W32:vendor/device", pci, ccp, ccp_ids, sizeof(ccp_ids[0]), +MODULE_PNP_INFO("W32:vendor/device", pci, ccp, ccp_ids, nitems(ccp_ids)); static int Modified: head/sys/dev/aac/aac_pci.c ============================================================================== --- head/sys/dev/aac/aac_pci.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/aac/aac_pci.c Sun Aug 19 00:22:21 2018 (r338035) @@ -494,7 +494,7 @@ static driver_t aacch_driver = { static devclass_t aacch_devclass; DRIVER_MODULE(aacch, pci, aacch_driver, aacch_devclass, NULL, NULL); MODULE_PNP_INFO("U16:vendor;U16:device;", pci, aac, - aac_identifiers, sizeof(aac_identifiers[0]), nitems(aac_identifiers) - 1); + aac_identifiers, nitems(aac_identifiers) - 1); static int aacch_probe(device_t dev) Modified: head/sys/dev/aacraid/aacraid_pci.c ============================================================================== --- head/sys/dev/aacraid/aacraid_pci.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/aacraid/aacraid_pci.c Sun Aug 19 00:22:21 2018 (r338035) @@ -106,7 +106,7 @@ struct aac_ident DRIVER_MODULE(aacraid, pci, aacraid_pci_driver, aacraid_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device", pci, aacraid, - aacraid_family_identifiers, sizeof(aacraid_family_identifiers[0]), + aacraid_family_identifiers, nitems(aacraid_family_identifiers) - 1); MODULE_DEPEND(aacraid, pci, 1, 1, 1); Modified: head/sys/dev/adlink/adlink.c ============================================================================== --- head/sys/dev/adlink/adlink.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/adlink/adlink.c Sun Aug 19 00:22:21 2018 (r338035) @@ -438,6 +438,6 @@ static driver_t adlink_driver = { }; DRIVER_MODULE(adlink, pci, adlink_driver, adlink_devclass, 0, 0); -MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, adlink, adlink_id, sizeof(adlink_id[0]), +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, adlink, adlink_id, nitems(adlink_id)); #endif /* _KERNEL */ Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/ae/if_ae.c Sun Aug 19 00:22:21 2018 (r338035) @@ -178,7 +178,7 @@ static devclass_t ae_devclass; DRIVER_MODULE(ae, pci, ae_driver, ae_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ae, ae_devs, - sizeof(ae_devs[0]), nitems(ae_devs)); + nitems(ae_devs)); DRIVER_MODULE(miibus, ae, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(ae, pci, 1, 1, 1); MODULE_DEPEND(ae, ether, 1, 1, 1); Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/age/if_age.c Sun Aug 19 00:22:21 2018 (r338035) @@ -184,7 +184,7 @@ static devclass_t age_devclass; DRIVER_MODULE(age, pci, age_driver, age_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, age, age_devs, - sizeof(age_devs[0]), nitems(age_devs)); + nitems(age_devs)); DRIVER_MODULE(miibus, age, miibus_driver, miibus_devclass, 0, 0); static struct resource_spec age_res_spec_mem[] = { Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/ahci/ahci_pci.c Sun Aug 19 00:22:21 2018 (r338035) @@ -667,7 +667,7 @@ static driver_t ahci_driver = { DRIVER_MODULE(ahci, pci, ahci_driver, ahci_devclass, NULL, NULL); /* Also matches class / subclass / progid XXX need to add when we have masking support */ MODULE_PNP_INFO("W32:vendor/device", pci, ahci, ahci_ids, - sizeof(ahci_ids[0]), nitems(ahci_ids) - 1); + nitems(ahci_ids) - 1); static device_method_t ahci_ata_methods[] = { DEVMETHOD(device_probe, ahci_ata_probe), DEVMETHOD(device_attach, ahci_pci_attach), Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/alc/if_alc.c Sun Aug 19 00:22:21 2018 (r338035) @@ -244,7 +244,7 @@ static devclass_t alc_devclass; DRIVER_MODULE(alc, pci, alc_driver, alc_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device", pci, alc, alc_ident_table, - sizeof(alc_ident_table[0]), nitems(alc_ident_table) - 1); + nitems(alc_ident_table) - 1); DRIVER_MODULE(miibus, alc, miibus_driver, miibus_devclass, 0, 0); static struct resource_spec alc_res_spec_mem[] = { Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/ale/if_ale.c Sun Aug 19 00:22:21 2018 (r338035) @@ -179,7 +179,7 @@ static devclass_t ale_devclass; DRIVER_MODULE(ale, pci, ale_driver, ale_devclass, NULL, NULL); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ale, ale_devs, - sizeof(ale_devs[0]), nitems(ale_devs)); + nitems(ale_devs)); DRIVER_MODULE(miibus, ale, miibus_driver, miibus_devclass, NULL, NULL); static struct resource_spec ale_res_spec_mem[] = { Modified: head/sys/dev/amdsmn/amdsmn.c ============================================================================== --- head/sys/dev/amdsmn/amdsmn.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/amdsmn/amdsmn.c Sun Aug 19 00:22:21 2018 (r338035) @@ -90,7 +90,7 @@ static devclass_t amdsmn_devclass; DRIVER_MODULE(amdsmn, hostb, amdsmn_driver, amdsmn_devclass, NULL, NULL); MODULE_VERSION(amdsmn, 1); MODULE_PNP_INFO("W32:vendor/device", pci, amdsmn, amdsmn_ids, - sizeof(amdsmn_ids[0]), nitems(amdsmn_ids)); + nitems(amdsmn_ids)); static bool amdsmn_match(device_t parent) Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/amdtemp/amdtemp.c Sun Aug 19 00:22:21 2018 (r338035) @@ -167,7 +167,7 @@ DRIVER_MODULE(amdtemp, hostb, amdtemp_driver, amdtemp_ MODULE_VERSION(amdtemp, 1); MODULE_DEPEND(amdtemp, amdsmn, 1, 1, 1); MODULE_PNP_INFO("U16:vendor;U16:device", pci, amdtemp, amdtemp_products, - sizeof(amdtemp_products[0]), nitems(amdtemp_products)); + nitems(amdtemp_products)); static int amdtemp_match(device_t dev) Modified: head/sys/dev/amr/amr_pci.c ============================================================================== --- head/sys/dev/amr/amr_pci.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/amr/amr_pci.c Sun Aug 19 00:22:21 2018 (r338035) @@ -142,7 +142,7 @@ static struct amr_ident static devclass_t amr_devclass; DRIVER_MODULE(amr, pci, amr_pci_driver, amr_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device", pci, amr, amr_device_ids, - sizeof(amr_device_ids[0]), nitems(amr_device_ids) - 1); + nitems(amr_device_ids) - 1); MODULE_DEPEND(amr, pci, 1, 1, 1); MODULE_DEPEND(amr, cam, 1, 1, 1); Modified: head/sys/dev/an/if_an_pci.c ============================================================================== --- head/sys/dev/an/if_an_pci.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/an/if_an_pci.c Sun Aug 19 00:22:21 2018 (r338035) @@ -274,6 +274,6 @@ static devclass_t an_devclass; DRIVER_MODULE(an, pci, an_pci_driver, an_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, an, - an_devs, sizeof(an_devs[0]), nitems(an_devs) - 1); + an_devs, nitems(an_devs) - 1); MODULE_DEPEND(an, pci, 1, 1, 1); MODULE_DEPEND(an, wlan, 1, 1, 1); Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/bce/if_bce.c Sun Aug 19 00:22:21 2018 (r338035) @@ -530,7 +530,7 @@ MODULE_DEPEND(bce, miibus, 1, 1, 1); DRIVER_MODULE(bce, pci, bce_driver, bce_devclass, NULL, NULL); DRIVER_MODULE(miibus, bce, miibus_driver, miibus_devclass, NULL, NULL); MODULE_PNP_INFO("U16:vendor;U16:device;U16:#;U16:#;D:#", pci, bce, - bce_devs, sizeof(bce_devs[0]), nitems(bce_devs) - 1); + bce_devs, nitems(bce_devs) - 1); /****************************************************************************/ /* Tunable device values */ Modified: head/sys/dev/bfe/if_bfe.c ============================================================================== --- head/sys/dev/bfe/if_bfe.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/bfe/if_bfe.c Sun Aug 19 00:22:21 2018 (r338035) @@ -158,7 +158,7 @@ static devclass_t bfe_devclass; DRIVER_MODULE(bfe, pci, bfe_driver, bfe_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bfe, bfe_devs, - sizeof(bfe_devs[0]), nitems(bfe_devs) - 1); + nitems(bfe_devs) - 1); DRIVER_MODULE(miibus, bfe, miibus_driver, miibus_devclass, 0, 0); /* Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/bge/if_bge.c Sun Aug 19 00:22:21 2018 (r338035) @@ -548,7 +548,7 @@ static devclass_t bge_devclass; DRIVER_MODULE(bge, pci, bge_driver, bge_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device", pci, bge, bge_devs, - sizeof(bge_devs[0]), nitems(bge_devs) - 1); + nitems(bge_devs) - 1); DRIVER_MODULE(miibus, bge, miibus_driver, miibus_devclass, 0, 0); static int bge_allow_asf = 1; Modified: head/sys/dev/bwi/if_bwi_pci.c ============================================================================== --- head/sys/dev/bwi/if_bwi_pci.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/bwi/if_bwi_pci.c Sun Aug 19 00:22:21 2018 (r338035) @@ -257,7 +257,7 @@ static driver_t bwi_driver = { static devclass_t bwi_devclass; DRIVER_MODULE(bwi, pci, bwi_driver, bwi_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bwi, bwi_devices, - sizeof(bwi_devices[0]), nitems(bwi_devices) - 1); + nitems(bwi_devices) - 1); MODULE_DEPEND(bwi, wlan, 1, 1, 1); /* 802.11 media layer */ MODULE_DEPEND(bwi, firmware, 1, 1, 1); /* firmware support */ MODULE_DEPEND(bwi, wlan_amrr, 1, 1, 1); Modified: head/sys/dev/bwn/if_bwn_pci.c ============================================================================== --- head/sys/dev/bwn/if_bwn_pci.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/bwn/if_bwn_pci.c Sun Aug 19 00:22:21 2018 (r338035) @@ -296,9 +296,9 @@ DEFINE_CLASS_0(bwn_pci, bwn_pci_driver, bwn_pci_method DRIVER_MODULE_ORDERED(bwn_pci, pci, bwn_pci_driver, bwn_pci_devclass, NULL, NULL, SI_ORDER_ANY); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bwn_siba, - siba_devices, sizeof(siba_devices[0]), nitems(siba_devices) - 1); + siba_devices, nitems(siba_devices) - 1); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bwn_bcma, - bcma_devices, sizeof(bcma_devices[0]), nitems(bcma_devices) - 1); + bcma_devices, nitems(bcma_devices) - 1); DRIVER_MODULE(bhndb, bwn_pci, bhndb_pci_driver, bhndb_devclass, NULL, NULL); MODULE_DEPEND(bwn_pci, bwn, 1, 1, 1); Modified: head/sys/dev/cas/if_cas.c ============================================================================== --- head/sys/dev/cas/if_cas.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/cas/if_cas.c Sun Aug 19 00:22:21 2018 (r338035) @@ -2617,7 +2617,7 @@ static const struct cas_pci_dev { DRIVER_MODULE(cas, pci, cas_pci_driver, cas_devclass, 0, 0); MODULE_PNP_INFO("W32:vendor/device", pci, cas, cas_pci_devlist, - sizeof(cas_pci_devlist[0]), nitems(cas_pci_devlist) - 1); + nitems(cas_pci_devlist) - 1); DRIVER_MODULE(miibus, cas, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(cas, pci, 1, 1, 1); Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/ciss/ciss.c Sun Aug 19 00:22:21 2018 (r338035) @@ -365,7 +365,7 @@ static struct static devclass_t ciss_devclass; DRIVER_MODULE(ciss, pci, ciss_pci_driver, ciss_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;", pci, ciss, ciss_vendor_data, - sizeof(ciss_vendor_data[0]), nitems(ciss_vendor_data) - 1); + nitems(ciss_vendor_data) - 1); MODULE_DEPEND(ciss, cam, 1, 1, 1); MODULE_DEPEND(ciss, pci, 1, 1, 1); Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/dc/if_dc.c Sun Aug 19 00:22:21 2018 (r338035) @@ -360,7 +360,7 @@ static devclass_t dc_devclass; DRIVER_MODULE_ORDERED(dc, pci, dc_driver, dc_devclass, NULL, NULL, SI_ORDER_ANY); MODULE_PNP_INFO("W32:vendor/device;U8:revision;D:#", pci, dc, dc_devs, - sizeof(dc_devs[0]), nitems(dc_devs) - 1); + nitems(dc_devs) - 1); DRIVER_MODULE(miibus, dc, miibus_driver, miibus_devclass, NULL, NULL); #define DC_SETBIT(sc, reg, x) \ Modified: head/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- head/sys/dev/drm2/i915/i915_drv.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/drm2/i915/i915_drv.c Sun Aug 19 00:22:21 2018 (r338035) @@ -1237,7 +1237,7 @@ MODULE_DEPEND(i915kms, iicbus, 1, 1, 1); MODULE_DEPEND(i915kms, iic, 1, 1, 1); MODULE_DEPEND(i915kms, iicbb, 1, 1, 1); MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:#", vgapci, i915, pciidlist, - sizeof(pciidlist[0]), nitems(pciidlist) - 1); + nitems(pciidlist) - 1); /* We give fast paths for the really cool registers */ #define NEEDS_FORCE_WAKE(dev_priv, reg) \ Modified: head/sys/dev/drm2/radeon/radeon_drv.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_drv.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/drm2/radeon/radeon_drv.c Sun Aug 19 00:22:21 2018 (r338035) @@ -402,4 +402,4 @@ MODULE_DEPEND(radeonkms, iic, 1, 1, 1); MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1); MODULE_DEPEND(radeonkms, firmware, 1, 1, 1); MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:#", vgapci, radeonkms, - pciidlist, sizeof(pciidlist[0]), nitems(pciidlist) - 1); + pciidlist, nitems(pciidlist) - 1); Modified: head/sys/dev/ed/if_ed_pci.c ============================================================================== --- head/sys/dev/ed/if_ed_pci.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/ed/if_ed_pci.c Sun Aug 19 00:22:21 2018 (r338035) @@ -145,5 +145,5 @@ static driver_t ed_pci_driver = { DRIVER_MODULE(ed, pci, ed_pci_driver, ed_devclass, 0, 0); MODULE_DEPEND(ed, pci, 1, 1, 1); MODULE_DEPEND(ed, ether, 1, 1, 1); -MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ed, pci_ids, sizeof(pci_ids[0]), +MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ed, pci_ids, nitems(pci_ids) - 1); Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/ena/ena.c Sun Aug 19 00:22:21 2018 (r338035) @@ -3948,7 +3948,7 @@ static driver_t ena_driver = { devclass_t ena_devclass; DRIVER_MODULE(ena, pci, ena_driver, ena_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device", pci, ena, ena_vendor_info_array, - sizeof(ena_vendor_info_array[0]), nitems(ena_vendor_info_array) - 1); + nitems(ena_vendor_info_array) - 1); MODULE_DEPEND(ena, pci, 1, 1, 1); MODULE_DEPEND(ena, ether, 1, 1, 1); Modified: head/sys/dev/et/if_et.c ============================================================================== --- head/sys/dev/et/if_et.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/et/if_et.c Sun Aug 19 00:22:21 2018 (r338035) @@ -189,7 +189,7 @@ static devclass_t et_devclass; DRIVER_MODULE(et, pci, et_driver, et_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, et, et_devices, - sizeof(et_devices[0]), nitems(et_devices) - 1); + nitems(et_devices) - 1); DRIVER_MODULE(miibus, et, miibus_driver, miibus_devclass, 0, 0); static int et_rx_intr_npkts = 32; Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/fxp/if_fxp.c Sun Aug 19 00:22:21 2018 (r338035) @@ -308,7 +308,7 @@ static devclass_t fxp_devclass; DRIVER_MODULE_ORDERED(fxp, pci, fxp_driver, fxp_devclass, NULL, NULL, SI_ORDER_ANY); MODULE_PNP_INFO("U16:vendor;U16:device", pci, fxp, fxp_ident_table, - sizeof(fxp_ident_table[0]), nitems(fxp_ident_table) - 1); + nitems(fxp_ident_table) - 1); DRIVER_MODULE(miibus, fxp, miibus_driver, miibus_devclass, NULL, NULL); static struct resource_spec fxp_res_spec_mem[] = { Modified: head/sys/dev/gem/if_gem_pci.c ============================================================================== --- head/sys/dev/gem/if_gem_pci.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/gem/if_gem_pci.c Sun Aug 19 00:22:21 2018 (r338035) @@ -116,7 +116,7 @@ static driver_t gem_pci_driver = { DRIVER_MODULE(gem, pci, gem_pci_driver, gem_devclass, 0, 0); MODULE_PNP_INFO("W32:vendor/device", pci, gem, gem_pci_devlist, - sizeof(gem_pci_devlist[0]), nitems(gem_pci_devlist) - 1); + nitems(gem_pci_devlist) - 1); MODULE_DEPEND(gem, pci, 1, 1, 1); MODULE_DEPEND(gem, ether, 1, 1, 1); Modified: head/sys/dev/intpm/intpm.c ============================================================================== --- head/sys/dev/intpm/intpm.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/intpm/intpm.c Sun Aug 19 00:22:21 2018 (r338035) @@ -896,4 +896,4 @@ DRIVER_MODULE(smbus, intsmb, smbus_driver, smbus_devcl MODULE_DEPEND(intsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); MODULE_VERSION(intsmb, 1); MODULE_PNP_INFO("W32:vendor/device;D:#", pci, intpm, intsmb_products, - sizeof(intsmb_products[0]), nitems(intsmb_products)); + nitems(intsmb_products)); Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/ioat/ioat.c Sun Aug 19 00:22:21 2018 (r338035) @@ -241,7 +241,7 @@ static struct _pcsid }; MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ioat, pci_ids, - sizeof(pci_ids[0]), nitems(pci_ids)); + nitems(pci_ids)); /* * OS <-> Driver linkage functions Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/ipw/if_ipw.c Sun Aug 19 00:22:21 2018 (r338035) @@ -203,7 +203,7 @@ static devclass_t ipw_devclass; DRIVER_MODULE(ipw, pci, ipw_driver, ipw_devclass, NULL, NULL); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ipw, ipw_ident_table, - sizeof(ipw_ident_table[0]), nitems(ipw_ident_table) - 1); + nitems(ipw_ident_table) - 1); MODULE_VERSION(ipw, 1); Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/ixgbe/if_ix.c Sun Aug 19 00:22:21 2018 (r338035) @@ -238,7 +238,7 @@ static driver_t ix_driver = { devclass_t ix_devclass; DRIVER_MODULE(ix, pci, ix_driver, ix_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device", pci, ix, ixgbe_vendor_info_array, - sizeof(ixgbe_vendor_info_array[0]), nitems(ixgbe_vendor_info_array) - 1); + nitems(ixgbe_vendor_info_array) - 1); MODULE_DEPEND(ix, pci, 1, 1, 1); MODULE_DEPEND(ix, ether, 1, 1, 1); Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/ixgbe/if_ixv.c Sun Aug 19 00:22:21 2018 (r338035) @@ -144,7 +144,7 @@ static driver_t ixv_driver = { devclass_t ixv_devclass; DRIVER_MODULE(ixv, pci, ixv_driver, ixv_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device", pci, ixv, ixv_vendor_info_array, - sizeof(ixv_vendor_info_array[0]), nitems(ixv_vendor_info_array) - 1); + nitems(ixv_vendor_info_array) - 1); MODULE_DEPEND(ixv, pci, 1, 1, 1); MODULE_DEPEND(ixv, ether, 1, 1, 1); #ifdef DEV_NETMAP Modified: head/sys/dev/ncr/ncr.c ============================================================================== --- head/sys/dev/ncr/ncr.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/ncr/ncr.c Sun Aug 19 00:22:21 2018 (r338035) @@ -7109,7 +7109,7 @@ static devclass_t ncr_devclass; DRIVER_MODULE(ncr, pci, ncr_driver, ncr_devclass, 0, 0); MODULE_PNP_INFO("W32:vendor/device;U16:#;D:#", pci, ncr, ncr_chip_table, - sizeof(ncr_chip_table[0]), nitems(ncr_chip_table)); + nitems(ncr_chip_table)); MODULE_DEPEND(ncr, cam, 1, 1, 1); MODULE_DEPEND(ncr, pci, 1, 1, 1); Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Sun Aug 19 00:22:21 2018 (r338035) @@ -3120,4 +3120,4 @@ DRIVER_MODULE(ntb_hw_intel, pci, ntb_intel_driver, ntb MODULE_DEPEND(ntb_hw_intel, ntb, 1, 1, 1); MODULE_VERSION(ntb_hw_intel, 1); MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ntb_hw_intel, pci_ids, - sizeof(pci_ids[0]), nitems(pci_ids)); + nitems(pci_ids)); Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/ofw/ofw_bus_subr.h Sun Aug 19 00:22:21 2018 (r338035) @@ -67,7 +67,7 @@ struct intr_map_data_fdt { #define SIMPLEBUS_PNP_DESCR "Z:compat;P:#;" #define SIMPLEBUS_PNP_INFO(t) \ - MODULE_PNP_INFO(SIMPLEBUS_PNP_DESCR, simplebus, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0])); + MODULE_PNP_INFO(SIMPLEBUS_PNP_DESCR, simplebus, t, t, sizeof(t) / sizeof(t[0])); /* Generic implementation of ofw_bus_if.m methods and helper routines */ int ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *, phandle_t); Modified: head/sys/dev/pccard/pccardvar.h ============================================================================== --- head/sys/dev/pccard/pccardvar.h Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/pccard/pccardvar.h Sun Aug 19 00:22:21 2018 (r338035) @@ -102,7 +102,7 @@ struct pccard_product { */ #define PCCARD_PNP_DESCR "D:#;V32:manufacturer;V32:product;Z:cisvendor;Z:cisproduct;" #define PCCARD_PNP_INFO(t) \ - MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), nitems(t) - 1); \ + MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, nitems(t) - 1) typedef int (*pccard_product_match_fn) (device_t dev, const struct pccard_product *ent, int vpfmatch); Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/pci/pcivar.h Sun Aug 19 00:22:21 2018 (r338035) @@ -311,7 +311,7 @@ struct pci_device_table { "M16:mask;U16:vendor;U16:device;U16:subvendor;U16:subdevice;" \ "U16:class;U16:subclass;U16:revid;" #define PCI_PNP_INFO(table) \ - MODULE_PNP_INFO(PCI_PNP_STR, pci, table, table, sizeof(table[0]), \ + MODULE_PNP_INFO(PCI_PNP_STR, pci, table, table, \ sizeof(table) / sizeof(table[0])) const struct pci_device_table *pci_match_device(device_t child, Modified: head/sys/dev/puc/puc_pci.c ============================================================================== --- head/sys/dev/puc/puc_pci.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/puc/puc_pci.c Sun Aug 19 00:22:21 2018 (r338035) @@ -200,4 +200,4 @@ static driver_t puc_pci_driver = { DRIVER_MODULE(puc, pci, puc_pci_driver, puc_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;U16:#;U16:#;D:#", pci, puc, - puc_pci_devices, sizeof(puc_pci_devices[0]), nitems(puc_pci_devices) - 1); + puc_pci_devices, nitems(puc_pci_devices) - 1); Modified: head/sys/dev/spibus/spi.h ============================================================================== --- head/sys/dev/spibus/spi.h Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/spibus/spi.h Sun Aug 19 00:22:21 2018 (r338035) @@ -43,4 +43,4 @@ struct spi_command { #define SPIBUS_PNP_DESCR "Z:compat;P:#;" #define SPIBUS_PNP_INFO(t) \ - MODULE_PNP_INFO(SPIBUS_PNP_DESCR, spibus, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0])); + MODULE_PNP_INFO(SPIBUS_PNP_DESCR, spibus, t, t, sizeof(t) / sizeof(t[0])); Modified: head/sys/dev/uart/uart_bus_pccard.c ============================================================================== --- head/sys/dev/uart/uart_bus_pccard.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/uart/uart_bus_pccard.c Sun Aug 19 00:22:21 2018 (r338035) @@ -103,4 +103,4 @@ uart_pccard_attach(device_t dev) DRIVER_MODULE(uart, pccard, uart_pccard_driver, uart_devclass, 0, 0); MODULE_PNP_INFO("U32:function_type;", pccard, uart, &uart_pccard_function, - sizeof(uart_pccard_function), 1); + 1); Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/usb/usbdi.h Sun Aug 19 00:22:21 2018 (r338035) @@ -342,13 +342,13 @@ struct usb_device_id { #define USB_STD_PNP_HOST_INFO USB_STD_PNP_INFO "T:mode=host;" #define USB_STD_PNP_DEVICE_INFO USB_STD_PNP_INFO "T:mode=device;" #define USB_PNP_HOST_INFO(table) \ - MODULE_PNP_INFO(USB_STD_PNP_HOST_INFO, uhub, table, table, sizeof(table[0]), \ + MODULE_PNP_INFO(USB_STD_PNP_HOST_INFO, uhub, table, table, \ sizeof(table) / sizeof(table[0])) #define USB_PNP_DEVICE_INFO(table) \ - MODULE_PNP_INFO(USB_STD_PNP_DEVICE_INFO, uhub, table, table, sizeof(table[0]), \ + MODULE_PNP_INFO(USB_STD_PNP_DEVICE_INFO, uhub, table, table, \ sizeof(table) / sizeof(table[0])) #define USB_PNP_DUAL_INFO(table) \ - MODULE_PNP_INFO(USB_STD_PNP_INFO, uhub, table, table, sizeof(table[0]), \ + MODULE_PNP_INFO(USB_STD_PNP_INFO, uhub, table, table, \ sizeof(table) / sizeof(table[0])) /* check that the size of the structure above is correct */ Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/dev/xl/if_xl.c Sun Aug 19 00:22:21 2018 (r338035) @@ -334,7 +334,7 @@ static devclass_t xl_devclass; DRIVER_MODULE_ORDERED(xl, pci, xl_driver, xl_devclass, NULL, NULL, SI_ORDER_ANY); DRIVER_MODULE(miibus, xl, miibus_driver, miibus_devclass, NULL, NULL); -MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, xl, xl_devs, sizeof(xl_devs[0]), +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, xl, xl_devs, nitems(xl_devs) - 1); static void Modified: head/sys/isa/isavar.h ============================================================================== --- head/sys/isa/isavar.h Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/isa/isavar.h Sun Aug 19 00:22:21 2018 (r338035) @@ -142,7 +142,7 @@ enum isa_device_ivars { #define ISA_PNP_DESCR "E:pnpid;D:#" #define ISA_PNP_INFO(t) \ - MODULE_PNP_INFO(ISA_PNP_DESCR, isa, t, t, sizeof(t[0]), nitems(t) - 1); \ + MODULE_PNP_INFO(ISA_PNP_DESCR, isa, t, t, nitems(t) - 1); \ /* * Simplified accessors for isa devices Modified: head/sys/net/iflib.h ============================================================================== --- head/sys/net/iflib.h Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/net/iflib.h Sun Aug 19 00:22:21 2018 (r338035) @@ -173,7 +173,7 @@ typedef struct pci_vendor_info { #define IFLIB_PNP_DESCR "U32:vendor;U32:device;U32:subvendor;U32:subdevice;" \ "U32:revision;U32:class;D:#" #define IFLIB_PNP_INFO(b, u, t) \ - MODULE_PNP_INFO(IFLIB_PNP_DESCR, b, u, t, sizeof(t[0]), nitems(t) - 1) + MODULE_PNP_INFO(IFLIB_PNP_DESCR, b, u, t, nitems(t) - 1) typedef struct if_txrx { int (*ift_txd_encap) (void *, if_pkt_info_t); Modified: head/sys/sys/module.h ============================================================================== --- head/sys/sys/module.h Sat Aug 18 23:24:53 2018 (r338034) +++ head/sys/sys/module.h Sun Aug 19 00:22:21 2018 (r338035) @@ -178,12 +178,12 @@ struct mod_pnp_match_info * to allow external tools to parse their internal device tables * to make an informed guess about what driver(s) to load. */ -#define MODULE_PNP_INFO(d, b, unique, t, l, n) \ +#define MODULE_PNP_INFO(d, b, unique, t, n) \ static const struct mod_pnp_match_info _module_pnp_##b##_##unique = { \ .descr = d, \ .bus = #b, \ .table = t, \ - .entry_len = l, \ + .entry_len = sizeof((t)[0]), \ .num_entry = n \ }; \ MODULE_METADATA(_md_##b##_pnpinfo_##unique, MDT_PNP_INFO, \ From owner-svn-src-all@freebsd.org Sun Aug 19 00:31:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FA41107A9D2 for ; Sun, 19 Aug 2018 00:31:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7C857E3CD for ; Sun, 19 Aug 2018 00:31:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x233.google.com with SMTP id e14-v6so16166171itf.1 for ; Sat, 18 Aug 2018 17:31:34 -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=XvgbRmC+1NI2Kxgi9RtrMKkwnMRkUh4D4q/1cDlLqFU=; b=qs0DVGjoeYqv30Y8NfimDg0StufARXUutC07AZqy3ymUreXQIsC35qljAt1X345z+r azx/sEQ/Jdvwn4EIu0tM5DdPZYhLre7kf7BDqa4deRy8JVBrcSROjDHm6Bgfi5R3YG82 juaowMFpzj5aeaAYA/nSiTIQ8aB5wwZDioWj+AajZeYuOYB43yTFdpdo/iXpYzbnfnv9 04VNwUnwb8BxBk6ifkumWmYQEELeylM4H7qKZYWucnagNYG2Bo4li9UWqed2sWHjaEHP Wi1aNNmUOwYmfH9ToP1QKcKgCnsy0B8pwpmIyOh6uo3+8KrGe2vN4XwMDVH4/nkexKNV xkcA== 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=XvgbRmC+1NI2Kxgi9RtrMKkwnMRkUh4D4q/1cDlLqFU=; b=E9BM7yibRXgofdouG5SlAmO9xMOSfz0HazmYQPJUxq3i7PX6wmQIdsht/HeDryalnR ezYh5s8zAfsQNpP1EB3za1NP9/Zx0sbJ06OciAEDTtikqYsbVXmxZIgEmr59CDem/UGg E1sctFUquZRiWM2WvnDURqfbbZ5cgshjWupta7ooTMi+7rso2Vew7QZcfKZgNat6x4nh R/sloiFRkOqarLCTLPXhURRwgIBUKRi5OGmqibaGAJhwdV9u/KB5hg8CF1ma44f3yUDr OWOtztM2yZZntHEqI9VuM6jK7Cm1u9QUDVDMdudVHukgzk99nsCMx/hr9iQgLEf7DHOe jJdg== X-Gm-Message-State: AOUpUlHQ1GqjHbD7MQ5mw/BUFQI/YZgkeq5IEfX+0cF8OmtB8TwmfCPU hlMH3VhQLGzVkRWG35Gt6lM82gVpzdHxCrr3gz538Q== X-Google-Smtp-Source: AA+uWPyTiBE1T2fXCg4v0S5QXrmKtcP3IpA8t0EBs6eAYbx0Nw1lEO/2M8YkCZ0850Zb7oKnhELPqTWXCWrmfdY+jA8= X-Received: by 2002:a24:9197:: with SMTP id i145-v6mr8298320ite.39.1534638693620; Sat, 18 Aug 2018 17:31:33 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:2806:0:0:0:0:0 with HTTP; Sat, 18 Aug 2018 17:31:33 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201808190022.w7J0MLBE022075@repo.freebsd.org> References: <201808190022.w7J0MLBE022075@repo.freebsd.org> From: Warner Losh Date: Sat, 18 Aug 2018 18:31:33 -0600 X-Google-Sender-Auth: 0bM7_9E4Ryu95EImPhVP8Xg0x_Q Message-ID: Subject: Re: svn commit: r338035 - in head/sys: crypto/ccp dev/aac dev/aacraid dev/adlink dev/ae dev/age dev/ahci dev/alc dev/ale dev/amdsmn dev/amdtemp dev/amr dev/an dev/bce dev/bfe dev/bge dev/bwi dev/bwn de... 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.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 00:31:35 -0000 I strongly object to this change. Please back this out. It totally screws the SoC WIP that hasn't landed. And you didn't even ask me. I'm rather irked. Warner On Sat, Aug 18, 2018 at 6:22 PM, Conrad Meyer wrote: > Author: cem > Date: Sun Aug 19 00:22:21 2018 > New Revision: 338035 > URL: https://svnweb.freebsd.org/changeset/base/338035 > > Log: > Remove unused and easy to misuse PNP macro parameter > > Inspired by r338025, just remove the element size parameter to the > MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to > have correct pointer (or array) type. Since all invocations of the macro > already had this property and the emitted PNP data continues to include > the > element size, there is no functional change. > > Mostly done with the coccinelle 'spatch' tool: > > $ cat modpnpsize0.cocci > @normaltables@ > identifier b,c; > expression a,d,e; > declarer MODULE_PNP_INFO; > @@ > MODULE_PNP_INFO(a,b,c,d, > -sizeof(d[0]), > e); > > @singletons@ > identifier b,c,d; > expression a; > declarer MODULE_PNP_INFO; > @@ > MODULE_PNP_INFO(a,b,c,&d, > -sizeof(d), > 1); > > $ rg -l MODULE_PNP_INFO -- sys | \ > xargs spatch --in-place --sp-file modpnpsize0.cocci > > (Note that coccinelle invokes diff(1) via a PATH search and expects diff > to > tolerate the -B flag, which BSD diff does not. So I had to link gdiff > into > PATH as diff to use spatch.) > > Tinderbox'd (-DMAKE_JUST_KERNELS). > > Modified: > head/sys/crypto/ccp/ccp.c > head/sys/dev/aac/aac_pci.c > head/sys/dev/aacraid/aacraid_pci.c > head/sys/dev/adlink/adlink.c > head/sys/dev/ae/if_ae.c > head/sys/dev/age/if_age.c > head/sys/dev/ahci/ahci_pci.c > head/sys/dev/alc/if_alc.c > head/sys/dev/ale/if_ale.c > head/sys/dev/amdsmn/amdsmn.c > head/sys/dev/amdtemp/amdtemp.c > head/sys/dev/amr/amr_pci.c > head/sys/dev/an/if_an_pci.c > head/sys/dev/bce/if_bce.c > head/sys/dev/bfe/if_bfe.c > head/sys/dev/bge/if_bge.c > head/sys/dev/bwi/if_bwi_pci.c > head/sys/dev/bwn/if_bwn_pci.c > head/sys/dev/cas/if_cas.c > head/sys/dev/ciss/ciss.c > head/sys/dev/dc/if_dc.c > head/sys/dev/drm2/i915/i915_drv.c > head/sys/dev/drm2/radeon/radeon_drv.c > head/sys/dev/ed/if_ed_pci.c > head/sys/dev/ena/ena.c > head/sys/dev/et/if_et.c > head/sys/dev/fxp/if_fxp.c > head/sys/dev/gem/if_gem_pci.c > head/sys/dev/intpm/intpm.c > head/sys/dev/ioat/ioat.c > head/sys/dev/ipw/if_ipw.c > head/sys/dev/ixgbe/if_ix.c > head/sys/dev/ixgbe/if_ixv.c > head/sys/dev/ncr/ncr.c > head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c > head/sys/dev/ofw/ofw_bus_subr.h > head/sys/dev/pccard/pccardvar.h > head/sys/dev/pci/pcivar.h > head/sys/dev/puc/puc_pci.c > head/sys/dev/spibus/spi.h > head/sys/dev/uart/uart_bus_pccard.c > head/sys/dev/usb/usbdi.h > head/sys/dev/xl/if_xl.c > head/sys/isa/isavar.h > head/sys/net/iflib.h > head/sys/sys/module.h > > Modified: head/sys/crypto/ccp/ccp.c > ============================================================ > ================== > --- head/sys/crypto/ccp/ccp.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/crypto/ccp/ccp.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -734,7 +734,7 @@ DRIVER_MODULE(ccp, pci, ccp_driver, ccp_devclass, NULL > MODULE_VERSION(ccp, 1); > MODULE_DEPEND(ccp, crypto, 1, 1, 1); > MODULE_DEPEND(ccp, random_device, 1, 1, 1); > -MODULE_PNP_INFO("W32:vendor/device", pci, ccp, ccp_ids, > sizeof(ccp_ids[0]), > +MODULE_PNP_INFO("W32:vendor/device", pci, ccp, ccp_ids, > nitems(ccp_ids)); > > static int > > Modified: head/sys/dev/aac/aac_pci.c > ============================================================ > ================== > --- head/sys/dev/aac/aac_pci.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/aac/aac_pci.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -494,7 +494,7 @@ static driver_t aacch_driver = { > static devclass_t aacch_devclass; > DRIVER_MODULE(aacch, pci, aacch_driver, aacch_devclass, NULL, NULL); > MODULE_PNP_INFO("U16:vendor;U16:device;", pci, aac, > - aac_identifiers, sizeof(aac_identifiers[0]), nitems(aac_identifiers) > - 1); > + aac_identifiers, nitems(aac_identifiers) - 1); > > static int > aacch_probe(device_t dev) > > Modified: head/sys/dev/aacraid/aacraid_pci.c > ============================================================ > ================== > --- head/sys/dev/aacraid/aacraid_pci.c Sat Aug 18 23:24:53 2018 > (r338034) > +++ head/sys/dev/aacraid/aacraid_pci.c Sun Aug 19 00:22:21 2018 > (r338035) > @@ -106,7 +106,7 @@ struct aac_ident > > DRIVER_MODULE(aacraid, pci, aacraid_pci_driver, aacraid_devclass, 0, 0); > MODULE_PNP_INFO("U16:vendor;U16:device", pci, aacraid, > - aacraid_family_identifiers, sizeof(aacraid_family_identifiers[0]), > + aacraid_family_identifiers, > nitems(aacraid_family_identifiers) - 1); > MODULE_DEPEND(aacraid, pci, 1, 1, 1); > > > Modified: head/sys/dev/adlink/adlink.c > ============================================================ > ================== > --- head/sys/dev/adlink/adlink.c Sat Aug 18 23:24:53 2018 > (r338034) > +++ head/sys/dev/adlink/adlink.c Sun Aug 19 00:22:21 2018 > (r338035) > @@ -438,6 +438,6 @@ static driver_t adlink_driver = { > }; > > DRIVER_MODULE(adlink, pci, adlink_driver, adlink_devclass, 0, 0); > -MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, adlink, adlink_id, > sizeof(adlink_id[0]), > +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, adlink, adlink_id, > nitems(adlink_id)); > #endif /* _KERNEL */ > > Modified: head/sys/dev/ae/if_ae.c > ============================================================ > ================== > --- head/sys/dev/ae/if_ae.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/ae/if_ae.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -178,7 +178,7 @@ static devclass_t ae_devclass; > > DRIVER_MODULE(ae, pci, ae_driver, ae_devclass, 0, 0); > MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ae, ae_devs, > - sizeof(ae_devs[0]), nitems(ae_devs)); > + nitems(ae_devs)); > DRIVER_MODULE(miibus, ae, miibus_driver, miibus_devclass, 0, 0); > MODULE_DEPEND(ae, pci, 1, 1, 1); > MODULE_DEPEND(ae, ether, 1, 1, 1); > > Modified: head/sys/dev/age/if_age.c > ============================================================ > ================== > --- head/sys/dev/age/if_age.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/age/if_age.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -184,7 +184,7 @@ static devclass_t age_devclass; > > DRIVER_MODULE(age, pci, age_driver, age_devclass, 0, 0); > MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, age, age_devs, > - sizeof(age_devs[0]), nitems(age_devs)); > + nitems(age_devs)); > DRIVER_MODULE(miibus, age, miibus_driver, miibus_devclass, 0, 0); > > static struct resource_spec age_res_spec_mem[] = { > > Modified: head/sys/dev/ahci/ahci_pci.c > ============================================================ > ================== > --- head/sys/dev/ahci/ahci_pci.c Sat Aug 18 23:24:53 2018 > (r338034) > +++ head/sys/dev/ahci/ahci_pci.c Sun Aug 19 00:22:21 2018 > (r338035) > @@ -667,7 +667,7 @@ static driver_t ahci_driver = { > DRIVER_MODULE(ahci, pci, ahci_driver, ahci_devclass, NULL, NULL); > /* Also matches class / subclass / progid XXX need to add when we have > masking support */ > MODULE_PNP_INFO("W32:vendor/device", pci, ahci, ahci_ids, > - sizeof(ahci_ids[0]), nitems(ahci_ids) - 1); > + nitems(ahci_ids) - 1); > static device_method_t ahci_ata_methods[] = { > DEVMETHOD(device_probe, ahci_ata_probe), > DEVMETHOD(device_attach, ahci_pci_attach), > > Modified: head/sys/dev/alc/if_alc.c > ============================================================ > ================== > --- head/sys/dev/alc/if_alc.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/alc/if_alc.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -244,7 +244,7 @@ static devclass_t alc_devclass; > > DRIVER_MODULE(alc, pci, alc_driver, alc_devclass, 0, 0); > MODULE_PNP_INFO("U16:vendor;U16:device", pci, alc, alc_ident_table, > - sizeof(alc_ident_table[0]), nitems(alc_ident_table) - 1); > + nitems(alc_ident_table) - 1); > DRIVER_MODULE(miibus, alc, miibus_driver, miibus_devclass, 0, 0); > > static struct resource_spec alc_res_spec_mem[] = { > > Modified: head/sys/dev/ale/if_ale.c > ============================================================ > ================== > --- head/sys/dev/ale/if_ale.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/ale/if_ale.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -179,7 +179,7 @@ static devclass_t ale_devclass; > > DRIVER_MODULE(ale, pci, ale_driver, ale_devclass, NULL, NULL); > MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ale, ale_devs, > - sizeof(ale_devs[0]), nitems(ale_devs)); > + nitems(ale_devs)); > DRIVER_MODULE(miibus, ale, miibus_driver, miibus_devclass, NULL, NULL); > > static struct resource_spec ale_res_spec_mem[] = { > > Modified: head/sys/dev/amdsmn/amdsmn.c > ============================================================ > ================== > --- head/sys/dev/amdsmn/amdsmn.c Sat Aug 18 23:24:53 2018 > (r338034) > +++ head/sys/dev/amdsmn/amdsmn.c Sun Aug 19 00:22:21 2018 > (r338035) > @@ -90,7 +90,7 @@ static devclass_t amdsmn_devclass; > DRIVER_MODULE(amdsmn, hostb, amdsmn_driver, amdsmn_devclass, NULL, NULL); > MODULE_VERSION(amdsmn, 1); > MODULE_PNP_INFO("W32:vendor/device", pci, amdsmn, amdsmn_ids, > - sizeof(amdsmn_ids[0]), nitems(amdsmn_ids)); > + nitems(amdsmn_ids)); > > static bool > amdsmn_match(device_t parent) > > Modified: head/sys/dev/amdtemp/amdtemp.c > ============================================================ > ================== > --- head/sys/dev/amdtemp/amdtemp.c Sat Aug 18 23:24:53 2018 > (r338034) > +++ head/sys/dev/amdtemp/amdtemp.c Sun Aug 19 00:22:21 2018 > (r338035) > @@ -167,7 +167,7 @@ DRIVER_MODULE(amdtemp, hostb, amdtemp_driver, amdtemp_ > MODULE_VERSION(amdtemp, 1); > MODULE_DEPEND(amdtemp, amdsmn, 1, 1, 1); > MODULE_PNP_INFO("U16:vendor;U16:device", pci, amdtemp, amdtemp_products, > - sizeof(amdtemp_products[0]), nitems(amdtemp_products)); > + nitems(amdtemp_products)); > > static int > amdtemp_match(device_t dev) > > Modified: head/sys/dev/amr/amr_pci.c > ============================================================ > ================== > --- head/sys/dev/amr/amr_pci.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/amr/amr_pci.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -142,7 +142,7 @@ static struct amr_ident > static devclass_t amr_devclass; > DRIVER_MODULE(amr, pci, amr_pci_driver, amr_devclass, 0, 0); > MODULE_PNP_INFO("U16:vendor;U16:device", pci, amr, amr_device_ids, > - sizeof(amr_device_ids[0]), nitems(amr_device_ids) - 1); > + nitems(amr_device_ids) - 1); > MODULE_DEPEND(amr, pci, 1, 1, 1); > MODULE_DEPEND(amr, cam, 1, 1, 1); > > > Modified: head/sys/dev/an/if_an_pci.c > ============================================================ > ================== > --- head/sys/dev/an/if_an_pci.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/an/if_an_pci.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -274,6 +274,6 @@ static devclass_t an_devclass; > > DRIVER_MODULE(an, pci, an_pci_driver, an_devclass, 0, 0); > MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, an, > - an_devs, sizeof(an_devs[0]), nitems(an_devs) - 1); > + an_devs, nitems(an_devs) - 1); > MODULE_DEPEND(an, pci, 1, 1, 1); > MODULE_DEPEND(an, wlan, 1, 1, 1); > > Modified: head/sys/dev/bce/if_bce.c > ============================================================ > ================== > --- head/sys/dev/bce/if_bce.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/bce/if_bce.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -530,7 +530,7 @@ MODULE_DEPEND(bce, miibus, 1, 1, 1); > DRIVER_MODULE(bce, pci, bce_driver, bce_devclass, NULL, NULL); > DRIVER_MODULE(miibus, bce, miibus_driver, miibus_devclass, NULL, NULL); > MODULE_PNP_INFO("U16:vendor;U16:device;U16:#;U16:#;D:#", pci, bce, > - bce_devs, sizeof(bce_devs[0]), nitems(bce_devs) - 1); > + bce_devs, nitems(bce_devs) - 1); > > /*********************************************************** > *****************/ > /* Tunable device values > */ > > Modified: head/sys/dev/bfe/if_bfe.c > ============================================================ > ================== > --- head/sys/dev/bfe/if_bfe.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/bfe/if_bfe.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -158,7 +158,7 @@ static devclass_t bfe_devclass; > > DRIVER_MODULE(bfe, pci, bfe_driver, bfe_devclass, 0, 0); > MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bfe, bfe_devs, > - sizeof(bfe_devs[0]), nitems(bfe_devs) - 1); > + nitems(bfe_devs) - 1); > DRIVER_MODULE(miibus, bfe, miibus_driver, miibus_devclass, 0, 0); > > /* > > Modified: head/sys/dev/bge/if_bge.c > ============================================================ > ================== > --- head/sys/dev/bge/if_bge.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/bge/if_bge.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -548,7 +548,7 @@ static devclass_t bge_devclass; > > DRIVER_MODULE(bge, pci, bge_driver, bge_devclass, 0, 0); > MODULE_PNP_INFO("U16:vendor;U16:device", pci, bge, bge_devs, > - sizeof(bge_devs[0]), nitems(bge_devs) - 1); > + nitems(bge_devs) - 1); > DRIVER_MODULE(miibus, bge, miibus_driver, miibus_devclass, 0, 0); > > static int bge_allow_asf = 1; > > Modified: head/sys/dev/bwi/if_bwi_pci.c > ============================================================ > ================== > --- head/sys/dev/bwi/if_bwi_pci.c Sat Aug 18 23:24:53 2018 > (r338034) > +++ head/sys/dev/bwi/if_bwi_pci.c Sun Aug 19 00:22:21 2018 > (r338035) > @@ -257,7 +257,7 @@ static driver_t bwi_driver = { > static devclass_t bwi_devclass; > DRIVER_MODULE(bwi, pci, bwi_driver, bwi_devclass, 0, 0); > MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bwi, bwi_devices, > - sizeof(bwi_devices[0]), nitems(bwi_devices) - 1); > + nitems(bwi_devices) - 1); > MODULE_DEPEND(bwi, wlan, 1, 1, 1); /* 802.11 media layer */ > MODULE_DEPEND(bwi, firmware, 1, 1, 1); /* firmware support */ > MODULE_DEPEND(bwi, wlan_amrr, 1, 1, 1); > > Modified: head/sys/dev/bwn/if_bwn_pci.c > ============================================================ > ================== > --- head/sys/dev/bwn/if_bwn_pci.c Sat Aug 18 23:24:53 2018 > (r338034) > +++ head/sys/dev/bwn/if_bwn_pci.c Sun Aug 19 00:22:21 2018 > (r338035) > @@ -296,9 +296,9 @@ DEFINE_CLASS_0(bwn_pci, bwn_pci_driver, bwn_pci_method > DRIVER_MODULE_ORDERED(bwn_pci, pci, bwn_pci_driver, bwn_pci_devclass, > NULL, > NULL, SI_ORDER_ANY); > MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bwn_siba, > - siba_devices, sizeof(siba_devices[0]), nitems(siba_devices) - 1); > + siba_devices, nitems(siba_devices) - 1); > MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bwn_bcma, > - bcma_devices, sizeof(bcma_devices[0]), nitems(bcma_devices) - 1); > + bcma_devices, nitems(bcma_devices) - 1); > DRIVER_MODULE(bhndb, bwn_pci, bhndb_pci_driver, bhndb_devclass, NULL, > NULL); > > MODULE_DEPEND(bwn_pci, bwn, 1, 1, 1); > > Modified: head/sys/dev/cas/if_cas.c > ============================================================ > ================== > --- head/sys/dev/cas/if_cas.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/cas/if_cas.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -2617,7 +2617,7 @@ static const struct cas_pci_dev { > > DRIVER_MODULE(cas, pci, cas_pci_driver, cas_devclass, 0, 0); > MODULE_PNP_INFO("W32:vendor/device", pci, cas, cas_pci_devlist, > - sizeof(cas_pci_devlist[0]), nitems(cas_pci_devlist) - 1); > + nitems(cas_pci_devlist) - 1); > DRIVER_MODULE(miibus, cas, miibus_driver, miibus_devclass, 0, 0); > MODULE_DEPEND(cas, pci, 1, 1, 1); > > > Modified: head/sys/dev/ciss/ciss.c > ============================================================ > ================== > --- head/sys/dev/ciss/ciss.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/ciss/ciss.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -365,7 +365,7 @@ static struct > static devclass_t ciss_devclass; > DRIVER_MODULE(ciss, pci, ciss_pci_driver, ciss_devclass, 0, 0); > MODULE_PNP_INFO("U16:vendor;U16:device;", pci, ciss, ciss_vendor_data, > - sizeof(ciss_vendor_data[0]), nitems(ciss_vendor_data) - 1); > + nitems(ciss_vendor_data) - 1); > MODULE_DEPEND(ciss, cam, 1, 1, 1); > MODULE_DEPEND(ciss, pci, 1, 1, 1); > > > Modified: head/sys/dev/dc/if_dc.c > ============================================================ > ================== > --- head/sys/dev/dc/if_dc.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/dc/if_dc.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -360,7 +360,7 @@ static devclass_t dc_devclass; > DRIVER_MODULE_ORDERED(dc, pci, dc_driver, dc_devclass, NULL, NULL, > SI_ORDER_ANY); > MODULE_PNP_INFO("W32:vendor/device;U8:revision;D:#", pci, dc, dc_devs, > - sizeof(dc_devs[0]), nitems(dc_devs) - 1); > + nitems(dc_devs) - 1); > DRIVER_MODULE(miibus, dc, miibus_driver, miibus_devclass, NULL, NULL); > > #define DC_SETBIT(sc, reg, x) \ > > Modified: head/sys/dev/drm2/i915/i915_drv.c > ============================================================ > ================== > --- head/sys/dev/drm2/i915/i915_drv.c Sat Aug 18 23:24:53 2018 > (r338034) > +++ head/sys/dev/drm2/i915/i915_drv.c Sun Aug 19 00:22:21 2018 > (r338035) > @@ -1237,7 +1237,7 @@ MODULE_DEPEND(i915kms, iicbus, 1, 1, 1); > MODULE_DEPEND(i915kms, iic, 1, 1, 1); > MODULE_DEPEND(i915kms, iicbb, 1, 1, 1); > MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:#", vgapci, i915, pciidlist, > - sizeof(pciidlist[0]), nitems(pciidlist) - 1); > + nitems(pciidlist) - 1); > > /* We give fast paths for the really cool registers */ > #define NEEDS_FORCE_WAKE(dev_priv, reg) \ > > Modified: head/sys/dev/drm2/radeon/radeon_drv.c > ============================================================ > ================== > --- head/sys/dev/drm2/radeon/radeon_drv.c Sat Aug 18 23:24:53 2018 > (r338034) > +++ head/sys/dev/drm2/radeon/radeon_drv.c Sun Aug 19 00:22:21 2018 > (r338035) > @@ -402,4 +402,4 @@ MODULE_DEPEND(radeonkms, iic, 1, 1, 1); > MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1); > MODULE_DEPEND(radeonkms, firmware, 1, 1, 1); > MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:#", vgapci, radeonkms, > - pciidlist, sizeof(pciidlist[0]), nitems(pciidlist) - 1); > + pciidlist, nitems(pciidlist) - 1); > > Modified: head/sys/dev/ed/if_ed_pci.c > ============================================================ > ================== > --- head/sys/dev/ed/if_ed_pci.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/ed/if_ed_pci.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -145,5 +145,5 @@ static driver_t ed_pci_driver = { > DRIVER_MODULE(ed, pci, ed_pci_driver, ed_devclass, 0, 0); > MODULE_DEPEND(ed, pci, 1, 1, 1); > MODULE_DEPEND(ed, ether, 1, 1, 1); > -MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ed, pci_ids, > sizeof(pci_ids[0]), > +MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ed, pci_ids, > nitems(pci_ids) - 1); > > Modified: head/sys/dev/ena/ena.c > ============================================================ > ================== > --- head/sys/dev/ena/ena.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/ena/ena.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -3948,7 +3948,7 @@ static driver_t ena_driver = { > devclass_t ena_devclass; > DRIVER_MODULE(ena, pci, ena_driver, ena_devclass, 0, 0); > MODULE_PNP_INFO("U16:vendor;U16:device", pci, ena, ena_vendor_info_array, > - sizeof(ena_vendor_info_array[0]), nitems(ena_vendor_info_array) - 1); > + nitems(ena_vendor_info_array) - 1); > MODULE_DEPEND(ena, pci, 1, 1, 1); > MODULE_DEPEND(ena, ether, 1, 1, 1); > > > Modified: head/sys/dev/et/if_et.c > ============================================================ > ================== > --- head/sys/dev/et/if_et.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/et/if_et.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -189,7 +189,7 @@ static devclass_t et_devclass; > > DRIVER_MODULE(et, pci, et_driver, et_devclass, 0, 0); > MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, et, et_devices, > - sizeof(et_devices[0]), nitems(et_devices) - 1); > + nitems(et_devices) - 1); > DRIVER_MODULE(miibus, et, miibus_driver, miibus_devclass, 0, 0); > > static int et_rx_intr_npkts = 32; > > Modified: head/sys/dev/fxp/if_fxp.c > ============================================================ > ================== > --- head/sys/dev/fxp/if_fxp.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/fxp/if_fxp.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -308,7 +308,7 @@ static devclass_t fxp_devclass; > DRIVER_MODULE_ORDERED(fxp, pci, fxp_driver, fxp_devclass, NULL, NULL, > SI_ORDER_ANY); > MODULE_PNP_INFO("U16:vendor;U16:device", pci, fxp, fxp_ident_table, > - sizeof(fxp_ident_table[0]), nitems(fxp_ident_table) - 1); > + nitems(fxp_ident_table) - 1); > DRIVER_MODULE(miibus, fxp, miibus_driver, miibus_devclass, NULL, NULL); > > static struct resource_spec fxp_res_spec_mem[] = { > > Modified: head/sys/dev/gem/if_gem_pci.c > ============================================================ > ================== > --- head/sys/dev/gem/if_gem_pci.c Sat Aug 18 23:24:53 2018 > (r338034) > +++ head/sys/dev/gem/if_gem_pci.c Sun Aug 19 00:22:21 2018 > (r338035) > @@ -116,7 +116,7 @@ static driver_t gem_pci_driver = { > > DRIVER_MODULE(gem, pci, gem_pci_driver, gem_devclass, 0, 0); > MODULE_PNP_INFO("W32:vendor/device", pci, gem, gem_pci_devlist, > - sizeof(gem_pci_devlist[0]), nitems(gem_pci_devlist) - 1); > + nitems(gem_pci_devlist) - 1); > MODULE_DEPEND(gem, pci, 1, 1, 1); > MODULE_DEPEND(gem, ether, 1, 1, 1); > > > Modified: head/sys/dev/intpm/intpm.c > ============================================================ > ================== > --- head/sys/dev/intpm/intpm.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/intpm/intpm.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -896,4 +896,4 @@ DRIVER_MODULE(smbus, intsmb, smbus_driver, smbus_devcl > MODULE_DEPEND(intsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); > MODULE_VERSION(intsmb, 1); > MODULE_PNP_INFO("W32:vendor/device;D:#", pci, intpm, intsmb_products, > - sizeof(intsmb_products[0]), nitems(intsmb_products)); > + nitems(intsmb_products)); > > Modified: head/sys/dev/ioat/ioat.c > ============================================================ > ================== > --- head/sys/dev/ioat/ioat.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/ioat/ioat.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -241,7 +241,7 @@ static struct _pcsid > }; > > MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ioat, pci_ids, > - sizeof(pci_ids[0]), nitems(pci_ids)); > + nitems(pci_ids)); > > /* > * OS <-> Driver linkage functions > > Modified: head/sys/dev/ipw/if_ipw.c > ============================================================ > ================== > --- head/sys/dev/ipw/if_ipw.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/ipw/if_ipw.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -203,7 +203,7 @@ static devclass_t ipw_devclass; > > DRIVER_MODULE(ipw, pci, ipw_driver, ipw_devclass, NULL, NULL); > MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ipw, ipw_ident_table, > - sizeof(ipw_ident_table[0]), nitems(ipw_ident_table) - 1); > + nitems(ipw_ident_table) - 1); > > MODULE_VERSION(ipw, 1); > > > Modified: head/sys/dev/ixgbe/if_ix.c > ============================================================ > ================== > --- head/sys/dev/ixgbe/if_ix.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/ixgbe/if_ix.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -238,7 +238,7 @@ static driver_t ix_driver = { > devclass_t ix_devclass; > DRIVER_MODULE(ix, pci, ix_driver, ix_devclass, 0, 0); > MODULE_PNP_INFO("U16:vendor;U16:device", pci, ix, > ixgbe_vendor_info_array, > - sizeof(ixgbe_vendor_info_array[0]), nitems(ixgbe_vendor_info_array) > - 1); > + nitems(ixgbe_vendor_info_array) - 1); > > MODULE_DEPEND(ix, pci, 1, 1, 1); > MODULE_DEPEND(ix, ether, 1, 1, 1); > > Modified: head/sys/dev/ixgbe/if_ixv.c > ============================================================ > ================== > --- head/sys/dev/ixgbe/if_ixv.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/ixgbe/if_ixv.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -144,7 +144,7 @@ static driver_t ixv_driver = { > devclass_t ixv_devclass; > DRIVER_MODULE(ixv, pci, ixv_driver, ixv_devclass, 0, 0); > MODULE_PNP_INFO("U16:vendor;U16:device", pci, ixv, ixv_vendor_info_array, > - sizeof(ixv_vendor_info_array[0]), nitems(ixv_vendor_info_array) - 1); > + nitems(ixv_vendor_info_array) - 1); > MODULE_DEPEND(ixv, pci, 1, 1, 1); > MODULE_DEPEND(ixv, ether, 1, 1, 1); > #ifdef DEV_NETMAP > > Modified: head/sys/dev/ncr/ncr.c > ============================================================ > ================== > --- head/sys/dev/ncr/ncr.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/ncr/ncr.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -7109,7 +7109,7 @@ static devclass_t ncr_devclass; > > DRIVER_MODULE(ncr, pci, ncr_driver, ncr_devclass, 0, 0); > MODULE_PNP_INFO("W32:vendor/device;U16:#;D:#", pci, ncr, ncr_chip_table, > - sizeof(ncr_chip_table[0]), nitems(ncr_chip_table)); > + nitems(ncr_chip_table)); > MODULE_DEPEND(ncr, cam, 1, 1, 1); > MODULE_DEPEND(ncr, pci, 1, 1, 1); > > > Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c > ============================================================ > ================== > --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Sat Aug 18 23:24:53 2018 > (r338034) > +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Sun Aug 19 00:22:21 2018 > (r338035) > @@ -3120,4 +3120,4 @@ DRIVER_MODULE(ntb_hw_intel, pci, ntb_intel_driver, > ntb > MODULE_DEPEND(ntb_hw_intel, ntb, 1, 1, 1); > MODULE_VERSION(ntb_hw_intel, 1); > MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ntb_hw_intel, pci_ids, > - sizeof(pci_ids[0]), nitems(pci_ids)); > + nitems(pci_ids)); > > Modified: head/sys/dev/ofw/ofw_bus_subr.h > ============================================================ > ================== > --- head/sys/dev/ofw/ofw_bus_subr.h Sat Aug 18 23:24:53 2018 > (r338034) > +++ head/sys/dev/ofw/ofw_bus_subr.h Sun Aug 19 00:22:21 2018 > (r338035) > @@ -67,7 +67,7 @@ struct intr_map_data_fdt { > > #define SIMPLEBUS_PNP_DESCR "Z:compat;P:#;" > #define SIMPLEBUS_PNP_INFO(t) \ > - MODULE_PNP_INFO(SIMPLEBUS_PNP_DESCR, simplebus, t, t, > sizeof(t[0]), sizeof(t) / sizeof(t[0])); > + MODULE_PNP_INFO(SIMPLEBUS_PNP_DESCR, simplebus, t, t, sizeof(t) / > sizeof(t[0])); > > /* Generic implementation of ofw_bus_if.m methods and helper routines */ > int ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *, phandle_t); > > Modified: head/sys/dev/pccard/pccardvar.h > ============================================================ > ================== > --- head/sys/dev/pccard/pccardvar.h Sat Aug 18 23:24:53 2018 > (r338034) > +++ head/sys/dev/pccard/pccardvar.h Sun Aug 19 00:22:21 2018 > (r338035) > @@ -102,7 +102,7 @@ struct pccard_product { > */ > #define PCCARD_PNP_DESCR "D:#;V32:manufacturer;V32:product;Z:cisvendor;Z: > cisproduct;" > #define PCCARD_PNP_INFO(t) \ > - MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), > nitems(t) - 1); \ > + MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, nitems(t) - 1) > > typedef int (*pccard_product_match_fn) (device_t dev, > const struct pccard_product *ent, int vpfmatch); > > Modified: head/sys/dev/pci/pcivar.h > ============================================================ > ================== > --- head/sys/dev/pci/pcivar.h Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/pci/pcivar.h Sun Aug 19 00:22:21 2018 (r338035) > @@ -311,7 +311,7 @@ struct pci_device_table { > "M16:mask;U16:vendor;U16:device;U16:subvendor;U16:subdevice;" \ > "U16:class;U16:subclass;U16:revid;" > #define PCI_PNP_INFO(table) \ > - MODULE_PNP_INFO(PCI_PNP_STR, pci, table, table, sizeof(table[0]), \ > + MODULE_PNP_INFO(PCI_PNP_STR, pci, table, table, \ > sizeof(table) / sizeof(table[0])) > > const struct pci_device_table *pci_match_device(device_t child, > > Modified: head/sys/dev/puc/puc_pci.c > ============================================================ > ================== > --- head/sys/dev/puc/puc_pci.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/puc/puc_pci.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -200,4 +200,4 @@ static driver_t puc_pci_driver = { > > DRIVER_MODULE(puc, pci, puc_pci_driver, puc_devclass, 0, 0); > MODULE_PNP_INFO("U16:vendor;U16:device;U16:#;U16:#;D:#", pci, puc, > - puc_pci_devices, sizeof(puc_pci_devices[0]), nitems(puc_pci_devices) > - 1); > + puc_pci_devices, nitems(puc_pci_devices) - 1); > > Modified: head/sys/dev/spibus/spi.h > ============================================================ > ================== > --- head/sys/dev/spibus/spi.h Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/spibus/spi.h Sun Aug 19 00:22:21 2018 (r338035) > @@ -43,4 +43,4 @@ struct spi_command { > > #define SPIBUS_PNP_DESCR "Z:compat;P:#;" > #define SPIBUS_PNP_INFO(t) \ > - MODULE_PNP_INFO(SPIBUS_PNP_DESCR, spibus, t, t, sizeof(t[0]), > sizeof(t) / sizeof(t[0])); > + MODULE_PNP_INFO(SPIBUS_PNP_DESCR, spibus, t, t, sizeof(t) / > sizeof(t[0])); > > Modified: head/sys/dev/uart/uart_bus_pccard.c > ============================================================ > ================== > --- head/sys/dev/uart/uart_bus_pccard.c Sat Aug 18 23:24:53 2018 > (r338034) > +++ head/sys/dev/uart/uart_bus_pccard.c Sun Aug 19 00:22:21 2018 > (r338035) > @@ -103,4 +103,4 @@ uart_pccard_attach(device_t dev) > > DRIVER_MODULE(uart, pccard, uart_pccard_driver, uart_devclass, 0, 0); > MODULE_PNP_INFO("U32:function_type;", pccard, uart, > &uart_pccard_function, > - sizeof(uart_pccard_function), 1); > + 1); > > Modified: head/sys/dev/usb/usbdi.h > ============================================================ > ================== > --- head/sys/dev/usb/usbdi.h Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/usb/usbdi.h Sun Aug 19 00:22:21 2018 (r338035) > @@ -342,13 +342,13 @@ struct usb_device_id { > #define USB_STD_PNP_HOST_INFO USB_STD_PNP_INFO "T:mode=host;" > #define USB_STD_PNP_DEVICE_INFO USB_STD_PNP_INFO "T:mode=device;" > #define USB_PNP_HOST_INFO(table) \ > - MODULE_PNP_INFO(USB_STD_PNP_HOST_INFO, uhub, table, table, > sizeof(table[0]), \ > + MODULE_PNP_INFO(USB_STD_PNP_HOST_INFO, uhub, table, table, \ > sizeof(table) / sizeof(table[0])) > #define USB_PNP_DEVICE_INFO(table) \ > - MODULE_PNP_INFO(USB_STD_PNP_DEVICE_INFO, uhub, table, table, > sizeof(table[0]), \ > + MODULE_PNP_INFO(USB_STD_PNP_DEVICE_INFO, uhub, table, table, \ > sizeof(table) / sizeof(table[0])) > #define USB_PNP_DUAL_INFO(table) \ > - MODULE_PNP_INFO(USB_STD_PNP_INFO, uhub, table, table, > sizeof(table[0]), \ > + MODULE_PNP_INFO(USB_STD_PNP_INFO, uhub, table, table, \ > sizeof(table) / sizeof(table[0])) > > /* check that the size of the structure above is correct */ > > Modified: head/sys/dev/xl/if_xl.c > ============================================================ > ================== > --- head/sys/dev/xl/if_xl.c Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/dev/xl/if_xl.c Sun Aug 19 00:22:21 2018 (r338035) > @@ -334,7 +334,7 @@ static devclass_t xl_devclass; > DRIVER_MODULE_ORDERED(xl, pci, xl_driver, xl_devclass, NULL, NULL, > SI_ORDER_ANY); > DRIVER_MODULE(miibus, xl, miibus_driver, miibus_devclass, NULL, NULL); > -MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, xl, xl_devs, > sizeof(xl_devs[0]), > +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, xl, xl_devs, > nitems(xl_devs) - 1); > > static void > > Modified: head/sys/isa/isavar.h > ============================================================ > ================== > --- head/sys/isa/isavar.h Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/isa/isavar.h Sun Aug 19 00:22:21 2018 (r338035) > @@ -142,7 +142,7 @@ enum isa_device_ivars { > > #define ISA_PNP_DESCR "E:pnpid;D:#" > #define ISA_PNP_INFO(t) \ > - MODULE_PNP_INFO(ISA_PNP_DESCR, isa, t, t, sizeof(t[0]), nitems(t) > - 1); \ > + MODULE_PNP_INFO(ISA_PNP_DESCR, isa, t, t, nitems(t) - 1); \ > > /* > * Simplified accessors for isa devices > > Modified: head/sys/net/iflib.h > ============================================================ > ================== > --- head/sys/net/iflib.h Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/net/iflib.h Sun Aug 19 00:22:21 2018 (r338035) > @@ -173,7 +173,7 @@ typedef struct pci_vendor_info { > #define IFLIB_PNP_DESCR "U32:vendor;U32:device;U32:subvendor;U32:subdevice;" > \ > "U32:revision;U32:class;D:#" > #define IFLIB_PNP_INFO(b, u, t) \ > - MODULE_PNP_INFO(IFLIB_PNP_DESCR, b, u, t, sizeof(t[0]), nitems(t) - > 1) > + MODULE_PNP_INFO(IFLIB_PNP_DESCR, b, u, t, nitems(t) - 1) > > typedef struct if_txrx { > int (*ift_txd_encap) (void *, if_pkt_info_t); > > Modified: head/sys/sys/module.h > ============================================================ > ================== > --- head/sys/sys/module.h Sat Aug 18 23:24:53 2018 (r338034) > +++ head/sys/sys/module.h Sun Aug 19 00:22:21 2018 (r338035) > @@ -178,12 +178,12 @@ struct mod_pnp_match_info > * to allow external tools to parse their internal device tables > * to make an informed guess about what driver(s) to load. > */ > -#define MODULE_PNP_INFO(d, b, unique, t, l, n) > \ > +#define MODULE_PNP_INFO(d, b, unique, t, n) > \ > static const struct mod_pnp_match_info _module_pnp_##b##_##unique > = { \ > .descr = d, \ > .bus = #b, \ > .table = t, \ > - .entry_len = l, \ > + .entry_len = sizeof((t)[0]), \ > .num_entry = n \ > }; \ > MODULE_METADATA(_md_##b##_pnpinfo_##unique, MDT_PNP_INFO, \ > > From owner-svn-src-all@freebsd.org Sun Aug 19 00:42:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C492107ADBB; Sun, 19 Aug 2018 00:42:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 053957E8D3; Sun, 19 Aug 2018 00:42:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBB601EF5C; Sun, 19 Aug 2018 00:42:05 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7J0g5Wv031924; Sun, 19 Aug 2018 00:42:05 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7J0g5D0031923; Sun, 19 Aug 2018 00:42:05 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201808190042.w7J0g5D0031923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 19 Aug 2018 00:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338036 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 338036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 00:42:06 -0000 Author: kp Date: Sun Aug 19 00:42:05 2018 New Revision: 338036 URL: https://svnweb.freebsd.org/changeset/base/338036 Log: MFC r337643: pf: Fix 'set skip on' for groups The pfi_skip_if() function sometimes caused skipping of groups to work, if the members of the group used the groupname as a name prefix. This is often the case, e.g. group lo usually contains lo0, lo1, ..., but not always. Rather than relying on the name explicitly check for group memberships. Obtained from: OpenBSD (pf_if.c,v 1.62, pf_if.c,v 1.63) Modified: stable/11/sys/netpfil/pf/pf_if.c Modified: stable/11/sys/netpfil/pf/pf_if.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_if.c Sun Aug 19 00:22:21 2018 (r338035) +++ stable/11/sys/netpfil/pf/pf_if.c Sun Aug 19 00:42:05 2018 (r338036) @@ -734,6 +734,7 @@ pfi_get_ifaces(const char *name, struct pfi_kif *buf, static int pfi_skip_if(const char *filter, struct pfi_kif *p) { + struct ifg_list *i; int n; if (filter == NULL || !*filter) @@ -744,10 +745,19 @@ pfi_skip_if(const char *filter, struct pfi_kif *p) if (n < 1 || n >= IFNAMSIZ) return (1); /* sanity check */ if (filter[n-1] >= '0' && filter[n-1] <= '9') - return (1); /* only do exact match in that case */ - if (strncmp(p->pfik_name, filter, n)) - return (1); /* prefix doesn't match */ - return (p->pfik_name[n] < '0' || p->pfik_name[n] > '9'); + return (1); /* group names may not end in a digit */ + if (p->pfik_ifp != NULL) { + IF_ADDR_RLOCK(p->pfik_ifp); + TAILQ_FOREACH(i, &p->pfik_ifp->if_groups, ifgl_next) { + if (!strncmp(i->ifgl_group->ifg_group, filter, + IFNAMSIZ)) { + IF_ADDR_RUNLOCK(p->pfik_ifp); + return (0); /* iface is in group "filter" */ + } + } + IF_ADDR_RUNLOCK(p->pfik_ifp); + } + return (1); } int From owner-svn-src-all@freebsd.org Sun Aug 19 00:46:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C7C8107AF15; Sun, 19 Aug 2018 00:46:33 +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 24BF07F2A5; Sun, 19 Aug 2018 00:46:33 +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 0235F1F077; Sun, 19 Aug 2018 00:46:33 +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 w7J0kWNJ032908; Sun, 19 Aug 2018 00:46:32 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7J0kNCM032860; Sun, 19 Aug 2018 00:46:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808190046.w7J0kNCM032860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 19 Aug 2018 00:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338037 - in head/sys: crypto/ccp dev/aac dev/aacraid dev/adlink dev/ae dev/age dev/ahci dev/alc dev/ale dev/amdsmn dev/amdtemp dev/amr dev/an dev/bce dev/bfe dev/bge dev/bwi dev/bwn de... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: crypto/ccp dev/aac dev/aacraid dev/adlink dev/ae dev/age dev/ahci dev/alc dev/ale dev/amdsmn dev/amdtemp dev/amr dev/an dev/bce dev/bfe dev/bge dev/bwi dev/bwn dev/cas dev/ciss dev/dc dev... X-SVN-Commit-Revision: 338037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 00:46:33 -0000 Author: cem Date: Sun Aug 19 00:46:22 2018 New Revision: 338037 URL: https://svnweb.freebsd.org/changeset/base/338037 Log: Back out r338035 until Warner is finished churning GSoC PNP patches I was not aware Warner was making or planning to make forward progress in this area and have since been informed of that. It's easy to apply/reapply when churn dies down. Modified: head/sys/crypto/ccp/ccp.c head/sys/dev/aac/aac_pci.c head/sys/dev/aacraid/aacraid_pci.c head/sys/dev/adlink/adlink.c head/sys/dev/ae/if_ae.c head/sys/dev/age/if_age.c head/sys/dev/ahci/ahci_pci.c head/sys/dev/alc/if_alc.c head/sys/dev/ale/if_ale.c head/sys/dev/amdsmn/amdsmn.c head/sys/dev/amdtemp/amdtemp.c head/sys/dev/amr/amr_pci.c head/sys/dev/an/if_an_pci.c head/sys/dev/bce/if_bce.c head/sys/dev/bfe/if_bfe.c head/sys/dev/bge/if_bge.c head/sys/dev/bwi/if_bwi_pci.c head/sys/dev/bwn/if_bwn_pci.c head/sys/dev/cas/if_cas.c head/sys/dev/ciss/ciss.c head/sys/dev/dc/if_dc.c head/sys/dev/drm2/i915/i915_drv.c head/sys/dev/drm2/radeon/radeon_drv.c head/sys/dev/ed/if_ed_pci.c head/sys/dev/ena/ena.c head/sys/dev/et/if_et.c head/sys/dev/fxp/if_fxp.c head/sys/dev/gem/if_gem_pci.c head/sys/dev/intpm/intpm.c head/sys/dev/ioat/ioat.c head/sys/dev/ipw/if_ipw.c head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ncr/ncr.c head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c head/sys/dev/ofw/ofw_bus_subr.h head/sys/dev/pccard/pccardvar.h head/sys/dev/pci/pcivar.h head/sys/dev/puc/puc_pci.c head/sys/dev/spibus/spi.h head/sys/dev/uart/uart_bus_pccard.c head/sys/dev/usb/usbdi.h head/sys/dev/xl/if_xl.c head/sys/isa/isavar.h head/sys/net/iflib.h head/sys/sys/module.h Modified: head/sys/crypto/ccp/ccp.c ============================================================================== --- head/sys/crypto/ccp/ccp.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/crypto/ccp/ccp.c Sun Aug 19 00:46:22 2018 (r338037) @@ -734,7 +734,7 @@ DRIVER_MODULE(ccp, pci, ccp_driver, ccp_devclass, NULL MODULE_VERSION(ccp, 1); MODULE_DEPEND(ccp, crypto, 1, 1, 1); MODULE_DEPEND(ccp, random_device, 1, 1, 1); -MODULE_PNP_INFO("W32:vendor/device", pci, ccp, ccp_ids, +MODULE_PNP_INFO("W32:vendor/device", pci, ccp, ccp_ids, sizeof(ccp_ids[0]), nitems(ccp_ids)); static int Modified: head/sys/dev/aac/aac_pci.c ============================================================================== --- head/sys/dev/aac/aac_pci.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/aac/aac_pci.c Sun Aug 19 00:46:22 2018 (r338037) @@ -494,7 +494,7 @@ static driver_t aacch_driver = { static devclass_t aacch_devclass; DRIVER_MODULE(aacch, pci, aacch_driver, aacch_devclass, NULL, NULL); MODULE_PNP_INFO("U16:vendor;U16:device;", pci, aac, - aac_identifiers, nitems(aac_identifiers) - 1); + aac_identifiers, sizeof(aac_identifiers[0]), nitems(aac_identifiers) - 1); static int aacch_probe(device_t dev) Modified: head/sys/dev/aacraid/aacraid_pci.c ============================================================================== --- head/sys/dev/aacraid/aacraid_pci.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/aacraid/aacraid_pci.c Sun Aug 19 00:46:22 2018 (r338037) @@ -106,7 +106,7 @@ struct aac_ident DRIVER_MODULE(aacraid, pci, aacraid_pci_driver, aacraid_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device", pci, aacraid, - aacraid_family_identifiers, + aacraid_family_identifiers, sizeof(aacraid_family_identifiers[0]), nitems(aacraid_family_identifiers) - 1); MODULE_DEPEND(aacraid, pci, 1, 1, 1); Modified: head/sys/dev/adlink/adlink.c ============================================================================== --- head/sys/dev/adlink/adlink.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/adlink/adlink.c Sun Aug 19 00:46:22 2018 (r338037) @@ -438,6 +438,6 @@ static driver_t adlink_driver = { }; DRIVER_MODULE(adlink, pci, adlink_driver, adlink_devclass, 0, 0); -MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, adlink, adlink_id, +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, adlink, adlink_id, sizeof(adlink_id[0]), nitems(adlink_id)); #endif /* _KERNEL */ Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/ae/if_ae.c Sun Aug 19 00:46:22 2018 (r338037) @@ -178,7 +178,7 @@ static devclass_t ae_devclass; DRIVER_MODULE(ae, pci, ae_driver, ae_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ae, ae_devs, - nitems(ae_devs)); + sizeof(ae_devs[0]), nitems(ae_devs)); DRIVER_MODULE(miibus, ae, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(ae, pci, 1, 1, 1); MODULE_DEPEND(ae, ether, 1, 1, 1); Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/age/if_age.c Sun Aug 19 00:46:22 2018 (r338037) @@ -184,7 +184,7 @@ static devclass_t age_devclass; DRIVER_MODULE(age, pci, age_driver, age_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, age, age_devs, - nitems(age_devs)); + sizeof(age_devs[0]), nitems(age_devs)); DRIVER_MODULE(miibus, age, miibus_driver, miibus_devclass, 0, 0); static struct resource_spec age_res_spec_mem[] = { Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/ahci/ahci_pci.c Sun Aug 19 00:46:22 2018 (r338037) @@ -667,7 +667,7 @@ static driver_t ahci_driver = { DRIVER_MODULE(ahci, pci, ahci_driver, ahci_devclass, NULL, NULL); /* Also matches class / subclass / progid XXX need to add when we have masking support */ MODULE_PNP_INFO("W32:vendor/device", pci, ahci, ahci_ids, - nitems(ahci_ids) - 1); + sizeof(ahci_ids[0]), nitems(ahci_ids) - 1); static device_method_t ahci_ata_methods[] = { DEVMETHOD(device_probe, ahci_ata_probe), DEVMETHOD(device_attach, ahci_pci_attach), Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/alc/if_alc.c Sun Aug 19 00:46:22 2018 (r338037) @@ -244,7 +244,7 @@ static devclass_t alc_devclass; DRIVER_MODULE(alc, pci, alc_driver, alc_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device", pci, alc, alc_ident_table, - nitems(alc_ident_table) - 1); + sizeof(alc_ident_table[0]), nitems(alc_ident_table) - 1); DRIVER_MODULE(miibus, alc, miibus_driver, miibus_devclass, 0, 0); static struct resource_spec alc_res_spec_mem[] = { Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/ale/if_ale.c Sun Aug 19 00:46:22 2018 (r338037) @@ -179,7 +179,7 @@ static devclass_t ale_devclass; DRIVER_MODULE(ale, pci, ale_driver, ale_devclass, NULL, NULL); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ale, ale_devs, - nitems(ale_devs)); + sizeof(ale_devs[0]), nitems(ale_devs)); DRIVER_MODULE(miibus, ale, miibus_driver, miibus_devclass, NULL, NULL); static struct resource_spec ale_res_spec_mem[] = { Modified: head/sys/dev/amdsmn/amdsmn.c ============================================================================== --- head/sys/dev/amdsmn/amdsmn.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/amdsmn/amdsmn.c Sun Aug 19 00:46:22 2018 (r338037) @@ -90,7 +90,7 @@ static devclass_t amdsmn_devclass; DRIVER_MODULE(amdsmn, hostb, amdsmn_driver, amdsmn_devclass, NULL, NULL); MODULE_VERSION(amdsmn, 1); MODULE_PNP_INFO("W32:vendor/device", pci, amdsmn, amdsmn_ids, - nitems(amdsmn_ids)); + sizeof(amdsmn_ids[0]), nitems(amdsmn_ids)); static bool amdsmn_match(device_t parent) Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/amdtemp/amdtemp.c Sun Aug 19 00:46:22 2018 (r338037) @@ -167,7 +167,7 @@ DRIVER_MODULE(amdtemp, hostb, amdtemp_driver, amdtemp_ MODULE_VERSION(amdtemp, 1); MODULE_DEPEND(amdtemp, amdsmn, 1, 1, 1); MODULE_PNP_INFO("U16:vendor;U16:device", pci, amdtemp, amdtemp_products, - nitems(amdtemp_products)); + sizeof(amdtemp_products[0]), nitems(amdtemp_products)); static int amdtemp_match(device_t dev) Modified: head/sys/dev/amr/amr_pci.c ============================================================================== --- head/sys/dev/amr/amr_pci.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/amr/amr_pci.c Sun Aug 19 00:46:22 2018 (r338037) @@ -142,7 +142,7 @@ static struct amr_ident static devclass_t amr_devclass; DRIVER_MODULE(amr, pci, amr_pci_driver, amr_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device", pci, amr, amr_device_ids, - nitems(amr_device_ids) - 1); + sizeof(amr_device_ids[0]), nitems(amr_device_ids) - 1); MODULE_DEPEND(amr, pci, 1, 1, 1); MODULE_DEPEND(amr, cam, 1, 1, 1); Modified: head/sys/dev/an/if_an_pci.c ============================================================================== --- head/sys/dev/an/if_an_pci.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/an/if_an_pci.c Sun Aug 19 00:46:22 2018 (r338037) @@ -274,6 +274,6 @@ static devclass_t an_devclass; DRIVER_MODULE(an, pci, an_pci_driver, an_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, an, - an_devs, nitems(an_devs) - 1); + an_devs, sizeof(an_devs[0]), nitems(an_devs) - 1); MODULE_DEPEND(an, pci, 1, 1, 1); MODULE_DEPEND(an, wlan, 1, 1, 1); Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/bce/if_bce.c Sun Aug 19 00:46:22 2018 (r338037) @@ -530,7 +530,7 @@ MODULE_DEPEND(bce, miibus, 1, 1, 1); DRIVER_MODULE(bce, pci, bce_driver, bce_devclass, NULL, NULL); DRIVER_MODULE(miibus, bce, miibus_driver, miibus_devclass, NULL, NULL); MODULE_PNP_INFO("U16:vendor;U16:device;U16:#;U16:#;D:#", pci, bce, - bce_devs, nitems(bce_devs) - 1); + bce_devs, sizeof(bce_devs[0]), nitems(bce_devs) - 1); /****************************************************************************/ /* Tunable device values */ Modified: head/sys/dev/bfe/if_bfe.c ============================================================================== --- head/sys/dev/bfe/if_bfe.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/bfe/if_bfe.c Sun Aug 19 00:46:22 2018 (r338037) @@ -158,7 +158,7 @@ static devclass_t bfe_devclass; DRIVER_MODULE(bfe, pci, bfe_driver, bfe_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bfe, bfe_devs, - nitems(bfe_devs) - 1); + sizeof(bfe_devs[0]), nitems(bfe_devs) - 1); DRIVER_MODULE(miibus, bfe, miibus_driver, miibus_devclass, 0, 0); /* Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/bge/if_bge.c Sun Aug 19 00:46:22 2018 (r338037) @@ -548,7 +548,7 @@ static devclass_t bge_devclass; DRIVER_MODULE(bge, pci, bge_driver, bge_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device", pci, bge, bge_devs, - nitems(bge_devs) - 1); + sizeof(bge_devs[0]), nitems(bge_devs) - 1); DRIVER_MODULE(miibus, bge, miibus_driver, miibus_devclass, 0, 0); static int bge_allow_asf = 1; Modified: head/sys/dev/bwi/if_bwi_pci.c ============================================================================== --- head/sys/dev/bwi/if_bwi_pci.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/bwi/if_bwi_pci.c Sun Aug 19 00:46:22 2018 (r338037) @@ -257,7 +257,7 @@ static driver_t bwi_driver = { static devclass_t bwi_devclass; DRIVER_MODULE(bwi, pci, bwi_driver, bwi_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bwi, bwi_devices, - nitems(bwi_devices) - 1); + sizeof(bwi_devices[0]), nitems(bwi_devices) - 1); MODULE_DEPEND(bwi, wlan, 1, 1, 1); /* 802.11 media layer */ MODULE_DEPEND(bwi, firmware, 1, 1, 1); /* firmware support */ MODULE_DEPEND(bwi, wlan_amrr, 1, 1, 1); Modified: head/sys/dev/bwn/if_bwn_pci.c ============================================================================== --- head/sys/dev/bwn/if_bwn_pci.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/bwn/if_bwn_pci.c Sun Aug 19 00:46:22 2018 (r338037) @@ -296,9 +296,9 @@ DEFINE_CLASS_0(bwn_pci, bwn_pci_driver, bwn_pci_method DRIVER_MODULE_ORDERED(bwn_pci, pci, bwn_pci_driver, bwn_pci_devclass, NULL, NULL, SI_ORDER_ANY); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bwn_siba, - siba_devices, nitems(siba_devices) - 1); + siba_devices, sizeof(siba_devices[0]), nitems(siba_devices) - 1); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bwn_bcma, - bcma_devices, nitems(bcma_devices) - 1); + bcma_devices, sizeof(bcma_devices[0]), nitems(bcma_devices) - 1); DRIVER_MODULE(bhndb, bwn_pci, bhndb_pci_driver, bhndb_devclass, NULL, NULL); MODULE_DEPEND(bwn_pci, bwn, 1, 1, 1); Modified: head/sys/dev/cas/if_cas.c ============================================================================== --- head/sys/dev/cas/if_cas.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/cas/if_cas.c Sun Aug 19 00:46:22 2018 (r338037) @@ -2617,7 +2617,7 @@ static const struct cas_pci_dev { DRIVER_MODULE(cas, pci, cas_pci_driver, cas_devclass, 0, 0); MODULE_PNP_INFO("W32:vendor/device", pci, cas, cas_pci_devlist, - nitems(cas_pci_devlist) - 1); + sizeof(cas_pci_devlist[0]), nitems(cas_pci_devlist) - 1); DRIVER_MODULE(miibus, cas, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(cas, pci, 1, 1, 1); Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/ciss/ciss.c Sun Aug 19 00:46:22 2018 (r338037) @@ -365,7 +365,7 @@ static struct static devclass_t ciss_devclass; DRIVER_MODULE(ciss, pci, ciss_pci_driver, ciss_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;", pci, ciss, ciss_vendor_data, - nitems(ciss_vendor_data) - 1); + sizeof(ciss_vendor_data[0]), nitems(ciss_vendor_data) - 1); MODULE_DEPEND(ciss, cam, 1, 1, 1); MODULE_DEPEND(ciss, pci, 1, 1, 1); Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/dc/if_dc.c Sun Aug 19 00:46:22 2018 (r338037) @@ -360,7 +360,7 @@ static devclass_t dc_devclass; DRIVER_MODULE_ORDERED(dc, pci, dc_driver, dc_devclass, NULL, NULL, SI_ORDER_ANY); MODULE_PNP_INFO("W32:vendor/device;U8:revision;D:#", pci, dc, dc_devs, - nitems(dc_devs) - 1); + sizeof(dc_devs[0]), nitems(dc_devs) - 1); DRIVER_MODULE(miibus, dc, miibus_driver, miibus_devclass, NULL, NULL); #define DC_SETBIT(sc, reg, x) \ Modified: head/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- head/sys/dev/drm2/i915/i915_drv.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/drm2/i915/i915_drv.c Sun Aug 19 00:46:22 2018 (r338037) @@ -1237,7 +1237,7 @@ MODULE_DEPEND(i915kms, iicbus, 1, 1, 1); MODULE_DEPEND(i915kms, iic, 1, 1, 1); MODULE_DEPEND(i915kms, iicbb, 1, 1, 1); MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:#", vgapci, i915, pciidlist, - nitems(pciidlist) - 1); + sizeof(pciidlist[0]), nitems(pciidlist) - 1); /* We give fast paths for the really cool registers */ #define NEEDS_FORCE_WAKE(dev_priv, reg) \ Modified: head/sys/dev/drm2/radeon/radeon_drv.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_drv.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/drm2/radeon/radeon_drv.c Sun Aug 19 00:46:22 2018 (r338037) @@ -402,4 +402,4 @@ MODULE_DEPEND(radeonkms, iic, 1, 1, 1); MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1); MODULE_DEPEND(radeonkms, firmware, 1, 1, 1); MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:#", vgapci, radeonkms, - pciidlist, nitems(pciidlist) - 1); + pciidlist, sizeof(pciidlist[0]), nitems(pciidlist) - 1); Modified: head/sys/dev/ed/if_ed_pci.c ============================================================================== --- head/sys/dev/ed/if_ed_pci.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/ed/if_ed_pci.c Sun Aug 19 00:46:22 2018 (r338037) @@ -145,5 +145,5 @@ static driver_t ed_pci_driver = { DRIVER_MODULE(ed, pci, ed_pci_driver, ed_devclass, 0, 0); MODULE_DEPEND(ed, pci, 1, 1, 1); MODULE_DEPEND(ed, ether, 1, 1, 1); -MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ed, pci_ids, +MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ed, pci_ids, sizeof(pci_ids[0]), nitems(pci_ids) - 1); Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/ena/ena.c Sun Aug 19 00:46:22 2018 (r338037) @@ -3948,7 +3948,7 @@ static driver_t ena_driver = { devclass_t ena_devclass; DRIVER_MODULE(ena, pci, ena_driver, ena_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device", pci, ena, ena_vendor_info_array, - nitems(ena_vendor_info_array) - 1); + sizeof(ena_vendor_info_array[0]), nitems(ena_vendor_info_array) - 1); MODULE_DEPEND(ena, pci, 1, 1, 1); MODULE_DEPEND(ena, ether, 1, 1, 1); Modified: head/sys/dev/et/if_et.c ============================================================================== --- head/sys/dev/et/if_et.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/et/if_et.c Sun Aug 19 00:46:22 2018 (r338037) @@ -189,7 +189,7 @@ static devclass_t et_devclass; DRIVER_MODULE(et, pci, et_driver, et_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, et, et_devices, - nitems(et_devices) - 1); + sizeof(et_devices[0]), nitems(et_devices) - 1); DRIVER_MODULE(miibus, et, miibus_driver, miibus_devclass, 0, 0); static int et_rx_intr_npkts = 32; Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/fxp/if_fxp.c Sun Aug 19 00:46:22 2018 (r338037) @@ -308,7 +308,7 @@ static devclass_t fxp_devclass; DRIVER_MODULE_ORDERED(fxp, pci, fxp_driver, fxp_devclass, NULL, NULL, SI_ORDER_ANY); MODULE_PNP_INFO("U16:vendor;U16:device", pci, fxp, fxp_ident_table, - nitems(fxp_ident_table) - 1); + sizeof(fxp_ident_table[0]), nitems(fxp_ident_table) - 1); DRIVER_MODULE(miibus, fxp, miibus_driver, miibus_devclass, NULL, NULL); static struct resource_spec fxp_res_spec_mem[] = { Modified: head/sys/dev/gem/if_gem_pci.c ============================================================================== --- head/sys/dev/gem/if_gem_pci.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/gem/if_gem_pci.c Sun Aug 19 00:46:22 2018 (r338037) @@ -116,7 +116,7 @@ static driver_t gem_pci_driver = { DRIVER_MODULE(gem, pci, gem_pci_driver, gem_devclass, 0, 0); MODULE_PNP_INFO("W32:vendor/device", pci, gem, gem_pci_devlist, - nitems(gem_pci_devlist) - 1); + sizeof(gem_pci_devlist[0]), nitems(gem_pci_devlist) - 1); MODULE_DEPEND(gem, pci, 1, 1, 1); MODULE_DEPEND(gem, ether, 1, 1, 1); Modified: head/sys/dev/intpm/intpm.c ============================================================================== --- head/sys/dev/intpm/intpm.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/intpm/intpm.c Sun Aug 19 00:46:22 2018 (r338037) @@ -896,4 +896,4 @@ DRIVER_MODULE(smbus, intsmb, smbus_driver, smbus_devcl MODULE_DEPEND(intsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); MODULE_VERSION(intsmb, 1); MODULE_PNP_INFO("W32:vendor/device;D:#", pci, intpm, intsmb_products, - nitems(intsmb_products)); + sizeof(intsmb_products[0]), nitems(intsmb_products)); Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/ioat/ioat.c Sun Aug 19 00:46:22 2018 (r338037) @@ -241,7 +241,7 @@ static struct _pcsid }; MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ioat, pci_ids, - nitems(pci_ids)); + sizeof(pci_ids[0]), nitems(pci_ids)); /* * OS <-> Driver linkage functions Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/ipw/if_ipw.c Sun Aug 19 00:46:22 2018 (r338037) @@ -203,7 +203,7 @@ static devclass_t ipw_devclass; DRIVER_MODULE(ipw, pci, ipw_driver, ipw_devclass, NULL, NULL); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ipw, ipw_ident_table, - nitems(ipw_ident_table) - 1); + sizeof(ipw_ident_table[0]), nitems(ipw_ident_table) - 1); MODULE_VERSION(ipw, 1); Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/ixgbe/if_ix.c Sun Aug 19 00:46:22 2018 (r338037) @@ -238,7 +238,7 @@ static driver_t ix_driver = { devclass_t ix_devclass; DRIVER_MODULE(ix, pci, ix_driver, ix_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device", pci, ix, ixgbe_vendor_info_array, - nitems(ixgbe_vendor_info_array) - 1); + sizeof(ixgbe_vendor_info_array[0]), nitems(ixgbe_vendor_info_array) - 1); MODULE_DEPEND(ix, pci, 1, 1, 1); MODULE_DEPEND(ix, ether, 1, 1, 1); Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/ixgbe/if_ixv.c Sun Aug 19 00:46:22 2018 (r338037) @@ -144,7 +144,7 @@ static driver_t ixv_driver = { devclass_t ixv_devclass; DRIVER_MODULE(ixv, pci, ixv_driver, ixv_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device", pci, ixv, ixv_vendor_info_array, - nitems(ixv_vendor_info_array) - 1); + sizeof(ixv_vendor_info_array[0]), nitems(ixv_vendor_info_array) - 1); MODULE_DEPEND(ixv, pci, 1, 1, 1); MODULE_DEPEND(ixv, ether, 1, 1, 1); #ifdef DEV_NETMAP Modified: head/sys/dev/ncr/ncr.c ============================================================================== --- head/sys/dev/ncr/ncr.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/ncr/ncr.c Sun Aug 19 00:46:22 2018 (r338037) @@ -7109,7 +7109,7 @@ static devclass_t ncr_devclass; DRIVER_MODULE(ncr, pci, ncr_driver, ncr_devclass, 0, 0); MODULE_PNP_INFO("W32:vendor/device;U16:#;D:#", pci, ncr, ncr_chip_table, - nitems(ncr_chip_table)); + sizeof(ncr_chip_table[0]), nitems(ncr_chip_table)); MODULE_DEPEND(ncr, cam, 1, 1, 1); MODULE_DEPEND(ncr, pci, 1, 1, 1); Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Sun Aug 19 00:46:22 2018 (r338037) @@ -3120,4 +3120,4 @@ DRIVER_MODULE(ntb_hw_intel, pci, ntb_intel_driver, ntb MODULE_DEPEND(ntb_hw_intel, ntb, 1, 1, 1); MODULE_VERSION(ntb_hw_intel, 1); MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ntb_hw_intel, pci_ids, - nitems(pci_ids)); + sizeof(pci_ids[0]), nitems(pci_ids)); Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/ofw/ofw_bus_subr.h Sun Aug 19 00:46:22 2018 (r338037) @@ -67,7 +67,7 @@ struct intr_map_data_fdt { #define SIMPLEBUS_PNP_DESCR "Z:compat;P:#;" #define SIMPLEBUS_PNP_INFO(t) \ - MODULE_PNP_INFO(SIMPLEBUS_PNP_DESCR, simplebus, t, t, sizeof(t) / sizeof(t[0])); + MODULE_PNP_INFO(SIMPLEBUS_PNP_DESCR, simplebus, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0])); /* Generic implementation of ofw_bus_if.m methods and helper routines */ int ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *, phandle_t); Modified: head/sys/dev/pccard/pccardvar.h ============================================================================== --- head/sys/dev/pccard/pccardvar.h Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/pccard/pccardvar.h Sun Aug 19 00:46:22 2018 (r338037) @@ -102,7 +102,7 @@ struct pccard_product { */ #define PCCARD_PNP_DESCR "D:#;V32:manufacturer;V32:product;Z:cisvendor;Z:cisproduct;" #define PCCARD_PNP_INFO(t) \ - MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, nitems(t) - 1) + MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), nitems(t) - 1); \ typedef int (*pccard_product_match_fn) (device_t dev, const struct pccard_product *ent, int vpfmatch); Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/pci/pcivar.h Sun Aug 19 00:46:22 2018 (r338037) @@ -311,7 +311,7 @@ struct pci_device_table { "M16:mask;U16:vendor;U16:device;U16:subvendor;U16:subdevice;" \ "U16:class;U16:subclass;U16:revid;" #define PCI_PNP_INFO(table) \ - MODULE_PNP_INFO(PCI_PNP_STR, pci, table, table, \ + MODULE_PNP_INFO(PCI_PNP_STR, pci, table, table, sizeof(table[0]), \ sizeof(table) / sizeof(table[0])) const struct pci_device_table *pci_match_device(device_t child, Modified: head/sys/dev/puc/puc_pci.c ============================================================================== --- head/sys/dev/puc/puc_pci.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/puc/puc_pci.c Sun Aug 19 00:46:22 2018 (r338037) @@ -200,4 +200,4 @@ static driver_t puc_pci_driver = { DRIVER_MODULE(puc, pci, puc_pci_driver, puc_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;U16:#;U16:#;D:#", pci, puc, - puc_pci_devices, nitems(puc_pci_devices) - 1); + puc_pci_devices, sizeof(puc_pci_devices[0]), nitems(puc_pci_devices) - 1); Modified: head/sys/dev/spibus/spi.h ============================================================================== --- head/sys/dev/spibus/spi.h Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/spibus/spi.h Sun Aug 19 00:46:22 2018 (r338037) @@ -43,4 +43,4 @@ struct spi_command { #define SPIBUS_PNP_DESCR "Z:compat;P:#;" #define SPIBUS_PNP_INFO(t) \ - MODULE_PNP_INFO(SPIBUS_PNP_DESCR, spibus, t, t, sizeof(t) / sizeof(t[0])); + MODULE_PNP_INFO(SPIBUS_PNP_DESCR, spibus, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0])); Modified: head/sys/dev/uart/uart_bus_pccard.c ============================================================================== --- head/sys/dev/uart/uart_bus_pccard.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/uart/uart_bus_pccard.c Sun Aug 19 00:46:22 2018 (r338037) @@ -103,4 +103,4 @@ uart_pccard_attach(device_t dev) DRIVER_MODULE(uart, pccard, uart_pccard_driver, uart_devclass, 0, 0); MODULE_PNP_INFO("U32:function_type;", pccard, uart, &uart_pccard_function, - 1); + sizeof(uart_pccard_function), 1); Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/usb/usbdi.h Sun Aug 19 00:46:22 2018 (r338037) @@ -342,13 +342,13 @@ struct usb_device_id { #define USB_STD_PNP_HOST_INFO USB_STD_PNP_INFO "T:mode=host;" #define USB_STD_PNP_DEVICE_INFO USB_STD_PNP_INFO "T:mode=device;" #define USB_PNP_HOST_INFO(table) \ - MODULE_PNP_INFO(USB_STD_PNP_HOST_INFO, uhub, table, table, \ + MODULE_PNP_INFO(USB_STD_PNP_HOST_INFO, uhub, table, table, sizeof(table[0]), \ sizeof(table) / sizeof(table[0])) #define USB_PNP_DEVICE_INFO(table) \ - MODULE_PNP_INFO(USB_STD_PNP_DEVICE_INFO, uhub, table, table, \ + MODULE_PNP_INFO(USB_STD_PNP_DEVICE_INFO, uhub, table, table, sizeof(table[0]), \ sizeof(table) / sizeof(table[0])) #define USB_PNP_DUAL_INFO(table) \ - MODULE_PNP_INFO(USB_STD_PNP_INFO, uhub, table, table, \ + MODULE_PNP_INFO(USB_STD_PNP_INFO, uhub, table, table, sizeof(table[0]), \ sizeof(table) / sizeof(table[0])) /* check that the size of the structure above is correct */ Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/dev/xl/if_xl.c Sun Aug 19 00:46:22 2018 (r338037) @@ -334,7 +334,7 @@ static devclass_t xl_devclass; DRIVER_MODULE_ORDERED(xl, pci, xl_driver, xl_devclass, NULL, NULL, SI_ORDER_ANY); DRIVER_MODULE(miibus, xl, miibus_driver, miibus_devclass, NULL, NULL); -MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, xl, xl_devs, +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, xl, xl_devs, sizeof(xl_devs[0]), nitems(xl_devs) - 1); static void Modified: head/sys/isa/isavar.h ============================================================================== --- head/sys/isa/isavar.h Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/isa/isavar.h Sun Aug 19 00:46:22 2018 (r338037) @@ -142,7 +142,7 @@ enum isa_device_ivars { #define ISA_PNP_DESCR "E:pnpid;D:#" #define ISA_PNP_INFO(t) \ - MODULE_PNP_INFO(ISA_PNP_DESCR, isa, t, t, nitems(t) - 1); \ + MODULE_PNP_INFO(ISA_PNP_DESCR, isa, t, t, sizeof(t[0]), nitems(t) - 1); \ /* * Simplified accessors for isa devices Modified: head/sys/net/iflib.h ============================================================================== --- head/sys/net/iflib.h Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/net/iflib.h Sun Aug 19 00:46:22 2018 (r338037) @@ -173,7 +173,7 @@ typedef struct pci_vendor_info { #define IFLIB_PNP_DESCR "U32:vendor;U32:device;U32:subvendor;U32:subdevice;" \ "U32:revision;U32:class;D:#" #define IFLIB_PNP_INFO(b, u, t) \ - MODULE_PNP_INFO(IFLIB_PNP_DESCR, b, u, t, nitems(t) - 1) + MODULE_PNP_INFO(IFLIB_PNP_DESCR, b, u, t, sizeof(t[0]), nitems(t) - 1) typedef struct if_txrx { int (*ift_txd_encap) (void *, if_pkt_info_t); Modified: head/sys/sys/module.h ============================================================================== --- head/sys/sys/module.h Sun Aug 19 00:42:05 2018 (r338036) +++ head/sys/sys/module.h Sun Aug 19 00:46:22 2018 (r338037) @@ -178,12 +178,12 @@ struct mod_pnp_match_info * to allow external tools to parse their internal device tables * to make an informed guess about what driver(s) to load. */ -#define MODULE_PNP_INFO(d, b, unique, t, n) \ +#define MODULE_PNP_INFO(d, b, unique, t, l, n) \ static const struct mod_pnp_match_info _module_pnp_##b##_##unique = { \ .descr = d, \ .bus = #b, \ .table = t, \ - .entry_len = sizeof((t)[0]), \ + .entry_len = l, \ .num_entry = n \ }; \ MODULE_METADATA(_md_##b##_pnpinfo_##unique, MDT_PNP_INFO, \ From owner-svn-src-all@freebsd.org Sun Aug 19 00:58:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3F78107B524 for ; Sun, 19 Aug 2018 00:58:15 +0000 (UTC) (envelope-from wlosh@bsdimp.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 G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65F0380196 for ; Sun, 19 Aug 2018 00:58:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22d.google.com with SMTP id g141-v6so16325162ita.4 for ; Sat, 18 Aug 2018 17:58:15 -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=ckAUNBR07nS09ZlRY/vGXAisOV+h58y5aG+NRI4XOLY=; b=Ate0oE0pCWcZy+/1r/sU4dbH+3KdFKsfgDSu+frWAJwnhQIR4pDiQn7bIKz87CeyMk BYXOFRxhwfLGWbkhLM0gWZIvoXln9gIGFEfPEIsqkLmwOgVaC1NlUlgZxi37VASwQ6Xg CSUJztLYlEdABK87vpb5n2YnOi5Hb6MX6lnmtkkr1g72DqEXFRQU1/Uxg+FDhCC7VZAE CNru0ckTNhNonBd23PqtZmBaCCdW33ClSlUnb/l8olHlIuMi9I3M6e5zC/lLu0FU3wlp oiAVhG8j2j9MDLjfYuTThyWZgTDfuBtxHWSvXEUeGShVUNpc+c1KI0H3eAaWII/Bfo9y 5A4g== 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=ckAUNBR07nS09ZlRY/vGXAisOV+h58y5aG+NRI4XOLY=; b=NwVaPOjCZWZL7e1GXxMwuX66HCPrnLCjncCg6puW3D1F3ZTZ09nKIX147OZRSzP484 Xw8NMo2oNKdj/jmF8DZGbRAZ+DMb1RDuWh+qgnZ+2pfXGDgv10NkDsa5T5cp0Mt+Auw7 NNBLeHIm59P1ANCDeVlmuPIvUWiFEV0uVBpLxJbOSFZdPag1FqhkMWWuqM9QecladcI4 Qs5Ba+ze6c7W08n76ZiN64vOvfp6seqmHPAC91mQvVfBR1Dn3Wv4KQarDuR8lyfwb/hG wqAzSSYEQfap3NrqupTJz3gNILgv5wFHHel/ygIUzbIX6IdHCCY68YtCsf7atyuKzFv3 H/9w== X-Gm-Message-State: AOUpUlEMvDU8IXlPwymn7EtOTAA4TX1yNGl4jaC1P5EjmDp80UJuztiG x5VR+YBD/w6UJtE/+vaIw9Zwb7ggPCkEIDc7URV2Ag== X-Google-Smtp-Source: AA+uWPyD1TCmC78Ttqv45k6036hy2ziv2MjR8OGc8Ch7y80K375/9ZWJdkUre9TFpeuNuhIt+sPPX1K3nC8wI4209TE= X-Received: by 2002:a24:d2:: with SMTP id 201-v6mr8938122ita.60.1534640294760; Sat, 18 Aug 2018 17:58:14 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:2806:0:0:0:0:0 with HTTP; Sat, 18 Aug 2018 17:58:14 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201808190046.w7J0kNCM032860@repo.freebsd.org> References: <201808190046.w7J0kNCM032860@repo.freebsd.org> From: Warner Losh Date: Sat, 18 Aug 2018 18:58:14 -0600 X-Google-Sender-Auth: w4IBqzohIDrzdl9MbJzx8DJ3pwg Message-ID: Subject: Re: svn commit: r338037 - in head/sys: crypto/ccp dev/aac dev/aacraid dev/adlink dev/ae dev/age dev/ahci dev/alc dev/ale dev/amdsmn dev/amdtemp dev/amr dev/an dev/bce dev/bfe dev/bge dev/bwi dev/bwn de... 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.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 00:58:16 -0000 On Sat, Aug 18, 2018 at 6:46 PM, Conrad Meyer wrote: > I was not aware Warner was making or planning to make forward progress in > this area and have since been informed of that. > > It's easy to apply/reapply when churn dies down. > Thanks for your understanding Conrad. It's an interesting idea, and I'll look at applying after I get the GSoC branch landed, assuming there's no new wrinkles in that code base. Warner From owner-svn-src-all@freebsd.org Sun Aug 19 01:14:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BAEE107C031; Sun, 19 Aug 2018 01:14:47 +0000 (UTC) (envelope-from avatar@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 F187180E38; Sun, 19 Aug 2018 01:14:46 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D41F51F582; Sun, 19 Aug 2018 01:14:46 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7J1EkS9048308; Sun, 19 Aug 2018 01:14:46 GMT (envelope-from avatar@FreeBSD.org) Received: (from avatar@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7J1EkYa048307; Sun, 19 Aug 2018 01:14:46 GMT (envelope-from avatar@FreeBSD.org) Message-Id: <201808190114.w7J1EkYa048307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avatar set sender to avatar@FreeBSD.org using -f From: Tai-hwa Liang Date: Sun, 19 Aug 2018 01:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338038 - head/sys/dev/sound/pci X-SVN-Group: head X-SVN-Commit-Author: avatar X-SVN-Commit-Paths: head/sys/dev/sound/pci X-SVN-Commit-Revision: 338038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 01:14:47 -0000 Author: avatar Date: Sun Aug 19 01:14:46 2018 New Revision: 338038 URL: https://svnweb.freebsd.org/changeset/base/338038 Log: Extending the delay cycles to give the codec more time to pump ADC data across the AC-link. Without this patch, some CS4614 cards will need users to reload the driver manually or the hardware won't be initialised properly. Something like: # kldload snd_csa # kldunload snd_csa # kldload snd_csa Tested with: Terratec SiXPack 5.1+ Modified: head/sys/dev/sound/pci/csa.c Modified: head/sys/dev/sound/pci/csa.c ============================================================================== --- head/sys/dev/sound/pci/csa.c Sun Aug 19 00:46:22 2018 (r338037) +++ head/sys/dev/sound/pci/csa.c Sun Aug 19 01:14:46 2018 (r338038) @@ -710,7 +710,7 @@ csa_initialize(sc_p scp) * the codec is pumping ADC data across the AC-link. */ acisv = 0; - for (i = 0 ; i < 1000 ; i++) { + for (i = 0 ; i < 2000 ; i++) { /* * First, lets wait a short while to let things settle out a bit, * and to prevent retrying the read too quickly. From owner-svn-src-all@freebsd.org Sun Aug 19 03:57:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE566108172B; Sun, 19 Aug 2018 03:57:22 +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 9845285BEF; Sun, 19 Aug 2018 03:57:22 +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 5F33C210BB; Sun, 19 Aug 2018 03:57:22 +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 w7J3vMsb030378; Sun, 19 Aug 2018 03:57:22 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7J3vKHj030368; Sun, 19 Aug 2018 03:57:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808190357.w7J3vKHj030368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 19 Aug 2018 03:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338039 - in head/usr.bin/diff: . tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/usr.bin/diff: . tests X-SVN-Commit-Revision: 338039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 03:57:25 -0000 Author: kevans Date: Sun Aug 19 03:57:20 2018 New Revision: 338039 URL: https://svnweb.freebsd.org/changeset/base/338039 Log: diff(1): Implement -B/--ignore-blank-lines As noted by cem in r338035, coccinelle invokes diff(1) with the -B flag. This was not previously implemented here, so one was forced to create a link for GNU diff to /usr/local/bin/diff Implement the -B flag and add some primitive tests for it. It is implemented in the same fashion that -I is implemented; each chunk's lines are scanned, and if a non-blank line is encountered then the chunk will be output. Otherwise, it's skipped. MFC after: 2 weeks Added: head/usr.bin/diff/tests/Bflag_C.out (contents, props changed) head/usr.bin/diff/tests/Bflag_D.out (contents, props changed) head/usr.bin/diff/tests/Bflag_F.out (contents, props changed) Modified: head/usr.bin/diff/TODO head/usr.bin/diff/diff.1 head/usr.bin/diff/diff.c head/usr.bin/diff/diff.h head/usr.bin/diff/diffreg.c head/usr.bin/diff/tests/Makefile head/usr.bin/diff/tests/diff_test.sh Modified: head/usr.bin/diff/TODO ============================================================================== --- head/usr.bin/diff/TODO Sun Aug 19 01:14:46 2018 (r338038) +++ head/usr.bin/diff/TODO Sun Aug 19 03:57:20 2018 (r338039) @@ -5,7 +5,6 @@ * make a libsdiff and use that directly to avoid duplicating the code to be implemented: ---ignore-blank-lines --horizon-lines --ignore-tab-expansion --line-format Modified: head/usr.bin/diff/diff.1 ============================================================================== --- head/usr.bin/diff/diff.1 Sun Aug 19 01:14:46 2018 (r338038) +++ head/usr.bin/diff/diff.1 Sun Aug 19 03:57:20 2018 (r338039) @@ -30,7 +30,7 @@ .\" @(#)diff.1 8.1 (Berkeley) 6/30/93 .\" $FreeBSD$ .\" -.Dd April 20, 2017 +.Dd August 18, 2018 .Dt DIFF 1 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd differential file and directory comparator .Sh SYNOPSIS .Nm diff -.Op Fl abdipTtw +.Op Fl aBbdipTtw .Oo .Fl c | e | f | .Fl n | q | u @@ -67,7 +67,7 @@ .Op Fl L Ar label | Fl -label Ar label .Ar file1 file2 .Nm diff -.Op Fl abdilpTtw +.Op Fl aBbdilpTtw .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern .Op Fl L Ar label | Fl -label Ar label .Op Fl -brief @@ -93,7 +93,7 @@ .Fl C Ar number | -context Ar number .Ar file1 file2 .Nm diff -.Op Fl abdiltw +.Op Fl aBbdiltw .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern .Op Fl -brief .Op Fl -changed-group-format Ar GFMT @@ -118,7 +118,7 @@ .Fl D Ar string | Fl -ifdef Ar string .Ar file1 file2 .Nm diff -.Op Fl abdilpTtw +.Op Fl aBbdilpTtw .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern .Op Fl L Ar label | Fl -label Ar label .Op Fl -brief @@ -144,7 +144,7 @@ .Fl U Ar number | Fl -unified Ar number .Ar file1 file2 .Nm diff -.Op Fl abdilNPprsTtw +.Op Fl aBbdilNPprsTtw .Oo .Fl c | e | f | .Fl n | q | u @@ -300,6 +300,8 @@ if files contain binary characters. Use of this option forces .Nm to produce a diff. +.It Fl B Fl -ignore-blank-lines +Causes chunks that include only blank lines to be ignored. .It Fl b Causes trailing blanks (spaces and tabs) to be ignored, and other strings of blanks to compare equal. Modified: head/usr.bin/diff/diff.c ============================================================================== --- head/usr.bin/diff/diff.c Sun Aug 19 01:14:46 2018 (r338038) +++ head/usr.bin/diff/diff.c Sun Aug 19 03:57:20 2018 (r338039) @@ -66,6 +66,7 @@ static struct option longopts[] = { { "ed", no_argument, 0, 'e' }, { "forward-ed", no_argument, 0, 'f' }, { "speed-large-files", no_argument, NULL, 'H' }, + { "ignore-blank-lines", no_argument, 0, 'B' }, { "ignore-matching-lines", required_argument, 0, 'I' }, { "ignore-case", no_argument, 0, 'i' }, { "paginate", no_argument, NULL, 'l' }, @@ -164,6 +165,9 @@ main(int argc, char **argv) case 'h': /* silently ignore for backwards compatibility */ break; + case 'B': + dflags |= D_SKIPBLANKLINES; + break; case 'I': push_ignore_pats(optarg); break; @@ -447,18 +451,18 @@ void usage(void) { (void)fprintf(stderr, - "usage: diff [-abdilpTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case]\n" + "usage: diff [-aBbdilpTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case]\n" " [--no-ignore-case] [--normal] [--strip-trailing-cr] [--tabsize]\n" " [-I pattern] [-L label] file1 file2\n" - " diff [-abdilpTtw] [-I pattern] [-L label] [--ignore-case]\n" + " diff [-aBbdilpTtw] [-I pattern] [-L label] [--ignore-case]\n" " [--no-ignore-case] [--normal] [--strip-trailing-cr] [--tabsize]\n" " -C number file1 file2\n" - " diff [-abdiltw] [-I pattern] [--ignore-case] [--no-ignore-case]\n" + " diff [-aBbdiltw] [-I pattern] [--ignore-case] [--no-ignore-case]\n" " [--normal] [--strip-trailing-cr] [--tabsize] -D string file1 file2\n" - " diff [-abdilpTtw] [-I pattern] [-L label] [--ignore-case]\n" + " diff [-aBbdilpTtw] [-I pattern] [-L label] [--ignore-case]\n" " [--no-ignore-case] [--normal] [--tabsize] [--strip-trailing-cr]\n" " -U number file1 file2\n" - " diff [-abdilNPprsTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case]\n" + " diff [-aBbdilNPprsTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case]\n" " [--no-ignore-case] [--normal] [--tabsize] [-I pattern] [-L label]\n" " [-S name] [-X file] [-x pattern] dir1 dir2\n"); Modified: head/usr.bin/diff/diff.h ============================================================================== --- head/usr.bin/diff/diff.h Sun Aug 19 01:14:46 2018 (r338038) +++ head/usr.bin/diff/diff.h Sun Aug 19 03:57:20 2018 (r338039) @@ -67,6 +67,7 @@ #define D_EXPANDTABS 0x100 /* Expand tabs to spaces */ #define D_IGNOREBLANKS 0x200 /* Ignore white space changes */ #define D_STRIPCR 0x400 /* Strip trailing cr */ +#define D_SKIPBLANKLINES 0x800 /* Skip blank lines */ /* * Status values for print_status() and diffreg() return values Modified: head/usr.bin/diff/diffreg.c ============================================================================== --- head/usr.bin/diff/diffreg.c Sun Aug 19 01:14:46 2018 (r338038) +++ head/usr.bin/diff/diffreg.c Sun Aug 19 03:57:20 2018 (r338039) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -999,6 +1000,31 @@ restart: } } return; + } + if (*pflags & D_SKIPBLANKLINES) { + char *line; + /* + * All lines in the change, insert, or delete must not be + * empty for the change to be ignored. + */ + if (a <= b) { /* Changes and deletes. */ + for (i = a; i <= b; i++) { + line = preadline(fileno(f1), + ixold[i] - ixold[i - 1], ixold[i - 1]); + if (*line != '\0') + goto proceed; + } + } + if (a > b || c <= d) { /* Changes and inserts. */ + for (i = c; i <= d; i++) { + line = preadline(fileno(f2), + ixnew[i] - ixnew[i - 1], ixnew[i - 1]); + if (*line != '\0') + goto proceed; + } + } + return; + } proceed: if (*pflags & D_HEADER && diff_format != D_BRIEF) { Added: head/usr.bin/diff/tests/Bflag_C.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/diff/tests/Bflag_C.out Sun Aug 19 03:57:20 2018 (r338039) @@ -0,0 +1,2 @@ +1a2 +> Added: head/usr.bin/diff/tests/Bflag_D.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/diff/tests/Bflag_D.out Sun Aug 19 03:57:20 2018 (r338039) @@ -0,0 +1,2 @@ +1a2 +> C Added: head/usr.bin/diff/tests/Bflag_F.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/diff/tests/Bflag_F.out Sun Aug 19 03:57:20 2018 (r338039) @@ -0,0 +1,4 @@ +7c8 +< G +--- +> X Modified: head/usr.bin/diff/tests/Makefile ============================================================================== --- head/usr.bin/diff/tests/Makefile Sun Aug 19 01:14:46 2018 (r338038) +++ head/usr.bin/diff/tests/Makefile Sun Aug 19 03:57:20 2018 (r338039) @@ -5,6 +5,9 @@ PACKAGE= tests ATF_TESTS_SH= diff_test ${PACKAGE}FILES+= \ + Bflag_C.out \ + Bflag_D.out \ + Bflag_F.out \ input1.in \ input2.in \ input_c1.in \ Modified: head/usr.bin/diff/tests/diff_test.sh ============================================================================== --- head/usr.bin/diff/tests/diff_test.sh Sun Aug 19 01:14:46 2018 (r338038) +++ head/usr.bin/diff/tests/diff_test.sh Sun Aug 19 03:57:20 2018 (r338039) @@ -9,6 +9,7 @@ atf_test_case group_format atf_test_case side_by_side atf_test_case brief_format atf_test_case b230049 +atf_test_case Bflag simple_body() { @@ -150,6 +151,21 @@ brief_format_body() diff -Nrq A D } +Bflag_body() +{ + atf_check -x 'printf "A\nB\n" > A' + atf_check -x 'printf "A\n\nB\n" > B' + atf_check -x 'printf "A\n \nB\n" > C' + atf_check -x 'printf "A\nC\nB\n" > D' + atf_check -x 'printf "A\nB\nC\nD\nE\nF\nG\nH" > E' + atf_check -x 'printf "A\n\nB\nC\nD\nE\nF\nX\nH" > F' + + atf_check -s exit:0 -o inline:"" diff -B A B + atf_check -s exit:1 -o file:"$(atf_get_srcdir)/Bflag_C.out" diff -B A C + atf_check -s exit:1 -o file:"$(atf_get_srcdir)/Bflag_D.out" diff -B A D + atf_check -s exit:1 -o file:"$(atf_get_srcdir)/Bflag_F.out" diff -B E F +} + atf_init_test_cases() { atf_add_test_case simple @@ -161,4 +177,5 @@ atf_init_test_cases() atf_add_test_case side_by_side atf_add_test_case brief_format atf_add_test_case b230049 + atf_add_test_case Bflag } From owner-svn-src-all@freebsd.org Sun Aug 19 04:15:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B7671081E50; Sun, 19 Aug 2018 04:15: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 2F21C863EC; Sun, 19 Aug 2018 04:15: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 0F8BB213E0; Sun, 19 Aug 2018 04:15: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 w7J4FcdA040204; Sun, 19 Aug 2018 04:15:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7J4Fc8s040203; Sun, 19 Aug 2018 04:15:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808190415.w7J4Fc8s040203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 19 Aug 2018 04:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338040 - head/usr.bin/diff X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/diff X-SVN-Commit-Revision: 338040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 04:15:39 -0000 Author: kevans Date: Sun Aug 19 04:15:38 2018 New Revision: 338040 URL: https://svnweb.freebsd.org/changeset/base/338040 Log: diff(1): Refactor -B a little bit Instead of doing a second pass to skip empty lines if we've specified -I, go ahead and check both at once. Ignore critera has been split out into its own function to try and keep the logic cleaner. Modified: head/usr.bin/diff/diffreg.c Modified: head/usr.bin/diff/diffreg.c ============================================================================== --- head/usr.bin/diff/diffreg.c Sun Aug 19 03:57:20 2018 (r338039) +++ head/usr.bin/diff/diffreg.c Sun Aug 19 04:15:38 2018 (r338040) @@ -196,7 +196,8 @@ static void unsort(struct line *, int, int *); static void change(char *, FILE *, char *, FILE *, int, int, int, int, int *); static void sort(struct line *, int); static void print_header(const char *, const char *); -static int ignoreline(char *); +static bool ignoreline_pattern(char *); +static bool ignoreline(char *, bool); static int asciifile(FILE *); static int fetch(long *, int, int, FILE *, int, int, int); static int newcand(int, int, int); @@ -946,8 +947,8 @@ preadline(int fd, size_t rlen, off_t off) return (line); } -static int -ignoreline(char *line) +static bool +ignoreline_pattern(char *line) { int ret; @@ -956,6 +957,20 @@ ignoreline(char *line) return (ret == 0); /* if it matched, it should be ignored. */ } +static bool +ignoreline(char *line, bool skip_blanks) +{ + + if (ignore_pats != NULL && skip_blanks) + return (ignoreline_pattern(line) || *line == '\0'); + if (ignore_pats != NULL) + return (ignoreline_pattern(line)); + if (skip_blanks) + return (*line == '\0'); + /* No ignore criteria specified */ + return (false); +} + /* * Indicate that there is a difference between lines a and b of the from file * to get to lines c to d of the to file. If a is greater then b then there @@ -971,12 +986,14 @@ change(char *file1, FILE *f1, char *file2, FILE *f2, i long curpos; int i, nc, f; const char *walk; + bool skip_blanks; + skip_blanks = (*pflags & D_SKIPBLANKLINES); restart: if ((diff_format != D_IFDEF || diff_format == D_GFORMAT) && a > b && c > d) return; - if (ignore_pats != NULL) { + if (ignore_pats != NULL || skip_blanks) { char *line; /* * All lines in the change, insert, or delete must @@ -987,7 +1004,7 @@ restart: for (i = a; i <= b; i++) { line = preadline(fileno(f1), ixold[i] - ixold[i - 1], ixold[i - 1]); - if (!ignoreline(line)) + if (!ignoreline(line, skip_blanks)) goto proceed; } } @@ -995,36 +1012,11 @@ restart: for (i = c; i <= d; i++) { line = preadline(fileno(f2), ixnew[i] - ixnew[i - 1], ixnew[i - 1]); - if (!ignoreline(line)) + if (!ignoreline(line, skip_blanks)) goto proceed; } } return; - } - if (*pflags & D_SKIPBLANKLINES) { - char *line; - /* - * All lines in the change, insert, or delete must not be - * empty for the change to be ignored. - */ - if (a <= b) { /* Changes and deletes. */ - for (i = a; i <= b; i++) { - line = preadline(fileno(f1), - ixold[i] - ixold[i - 1], ixold[i - 1]); - if (*line != '\0') - goto proceed; - } - } - if (a > b || c <= d) { /* Changes and inserts. */ - for (i = c; i <= d; i++) { - line = preadline(fileno(f2), - ixnew[i] - ixnew[i - 1], ixnew[i - 1]); - if (*line != '\0') - goto proceed; - } - } - return; - } proceed: if (*pflags & D_HEADER && diff_format != D_BRIEF) { From owner-svn-src-all@freebsd.org Sun Aug 19 05:12:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33AD810831D1; Sun, 19 Aug 2018 05:12:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com [209.85.214.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DAA588403; Sun, 19 Aug 2018 05:12:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f44.google.com with SMTP id d9-v6so16502422itf.2; Sat, 18 Aug 2018 22:12:17 -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:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=AsQ4mBX90M8RaxvYS3madnaCy9W2s6K3viPxQYQqJkc=; b=Z2o8LmXKFZ+vpfWpURSX2hLF1ysjLpR9i8BG6x3GKX4rYHcyUPAF8eVAietOeipgY7 q9qC6cYlCJ2AIJYRr2he8ME4aKYGhyVo8KqSdXqZxEoRpD5H4tqIB8JeuicstJs9HIA/ +9HL7vypj16bW4XoUu3BNaM9BLurBGZ05S3kc+fm7Uf5PwWhelEh5KT3bOam5nlC7Nax VjJ297SaBIk3r3+9jJsbOPQ4ZyM/wnQgIVQFnfmpswjWh46Xl/35fCIzgCDyD3DGVJFZ FjlIFM/SvTsduaAEmbQUCDGyWX/C/a33GTCvKJp2QoE0b+FF8gIMnJvB5/8kGe1nOnyJ i0og== X-Gm-Message-State: AOUpUlHYFKRcUawc/396kHIYtYyTbYy2nay4D+4jkoVv0hLhRkq2njVB 37TRZbahF7HcMN9+UzPlNngukyjB X-Google-Smtp-Source: AA+uWPwcsrMu9cmFCHNzcMkEe7Cnb+vSPgOfzrT72mJgeC0w2GjhJyjEIK9sg/Bs6ygGSejTLOaNrw== X-Received: by 2002:a24:8ec7:: with SMTP id h190-v6mr29072962ite.29.1534655530524; Sat, 18 Aug 2018 22:12:10 -0700 (PDT) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com. [209.85.214.44]) by smtp.gmail.com with ESMTPSA id d12-v6sm3278202itf.25.2018.08.18.22.12.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Aug 2018 22:12:10 -0700 (PDT) Received: by mail-it0-f44.google.com with SMTP id e14-v6so16503747itf.1; Sat, 18 Aug 2018 22:12:09 -0700 (PDT) X-Received: by 2002:a02:4009:: with SMTP id n9-v6mr37321627jaa.19.1534655529714; Sat, 18 Aug 2018 22:12:09 -0700 (PDT) MIME-Version: 1.0 References: <201808190357.w7J3vKHj030368@repo.freebsd.org> In-Reply-To: <201808190357.w7J3vKHj030368@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sat, 18 Aug 2018 22:11:57 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r338039 - in head/usr.bin/diff: . tests To: Kyle Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 05:12:18 -0000 Hey, That=E2=80=99s awesome! Thank you! Best, Conrad On Sat, Aug 18, 2018 at 8:57 PM Kyle Evans wrote: > Author: kevans > Date: Sun Aug 19 03:57:20 2018 > New Revision: 338039 > URL: https://svnweb.freebsd.org/changeset/base/338039 > > Log: > diff(1): Implement -B/--ignore-blank-lines > > As noted by cem in r338035, coccinelle invokes diff(1) with the -B flag= . > This was not previously implemented here, so one was forced to create a > link > for GNU diff to /usr/local/bin/diff > > Implement the -B flag and add some primitive tests for it. It is > implemented > in the same fashion that -I is implemented; each chunk's lines are > scanned, > and if a non-blank line is encountered then the chunk will be output. > Otherwise, it's skipped. > > MFC after: 2 weeks > > Added: > head/usr.bin/diff/tests/Bflag_C.out (contents, props changed) > head/usr.bin/diff/tests/Bflag_D.out (contents, props changed) > head/usr.bin/diff/tests/Bflag_F.out (contents, props changed) > Modified: > head/usr.bin/diff/TODO > head/usr.bin/diff/diff.1 > head/usr.bin/diff/diff.c > head/usr.bin/diff/diff.h > head/usr.bin/diff/diffreg.c > head/usr.bin/diff/tests/Makefile > head/usr.bin/diff/tests/diff_test.sh > > Modified: head/usr.bin/diff/TODO > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/usr.bin/diff/TODO Sun Aug 19 01:14:46 2018 (r338038) > +++ head/usr.bin/diff/TODO Sun Aug 19 03:57:20 2018 (r338039) > @@ -5,7 +5,6 @@ > * make a libsdiff and use that directly to avoid duplicating the code > > to be implemented: > ---ignore-blank-lines > --horizon-lines > --ignore-tab-expansion > --line-format > > Modified: head/usr.bin/diff/diff.1 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/usr.bin/diff/diff.1 Sun Aug 19 01:14:46 2018 (r338038) > +++ head/usr.bin/diff/diff.1 Sun Aug 19 03:57:20 2018 (r338039) > @@ -30,7 +30,7 @@ > .\" @(#)diff.1 8.1 (Berkeley) 6/30/93 > .\" $FreeBSD$ > .\" > -.Dd April 20, 2017 > +.Dd August 18, 2018 > .Dt DIFF 1 > .Os > .Sh NAME > @@ -38,7 +38,7 @@ > .Nd differential file and directory comparator > .Sh SYNOPSIS > .Nm diff > -.Op Fl abdipTtw > +.Op Fl aBbdipTtw > .Oo > .Fl c | e | f | > .Fl n | q | u > @@ -67,7 +67,7 @@ > .Op Fl L Ar label | Fl -label Ar label > .Ar file1 file2 > .Nm diff > -.Op Fl abdilpTtw > +.Op Fl aBbdilpTtw > .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern > .Op Fl L Ar label | Fl -label Ar label > .Op Fl -brief > @@ -93,7 +93,7 @@ > .Fl C Ar number | -context Ar number > .Ar file1 file2 > .Nm diff > -.Op Fl abdiltw > +.Op Fl aBbdiltw > .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern > .Op Fl -brief > .Op Fl -changed-group-format Ar GFMT > @@ -118,7 +118,7 @@ > .Fl D Ar string | Fl -ifdef Ar string > .Ar file1 file2 > .Nm diff > -.Op Fl abdilpTtw > +.Op Fl aBbdilpTtw > .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern > .Op Fl L Ar label | Fl -label Ar label > .Op Fl -brief > @@ -144,7 +144,7 @@ > .Fl U Ar number | Fl -unified Ar number > .Ar file1 file2 > .Nm diff > -.Op Fl abdilNPprsTtw > +.Op Fl aBbdilNPprsTtw > .Oo > .Fl c | e | f | > .Fl n | q | u > @@ -300,6 +300,8 @@ if files contain binary characters. > Use of this option forces > .Nm > to produce a diff. > +.It Fl B Fl -ignore-blank-lines > +Causes chunks that include only blank lines to be ignored. > .It Fl b > Causes trailing blanks (spaces and tabs) to be ignored, and other > strings of blanks to compare equal. > > Modified: head/usr.bin/diff/diff.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/usr.bin/diff/diff.c Sun Aug 19 01:14:46 2018 (r338038) > +++ head/usr.bin/diff/diff.c Sun Aug 19 03:57:20 2018 (r338039) > @@ -66,6 +66,7 @@ static struct option longopts[] =3D { > { "ed", no_argument, 0, > 'e' }, > { "forward-ed", no_argument, 0, > 'f' }, > { "speed-large-files", no_argument, NULL, > 'H' }, > + { "ignore-blank-lines", no_argument, 0, > 'B' }, > { "ignore-matching-lines", required_argument, 0, > 'I' }, > { "ignore-case", no_argument, 0, > 'i' }, > { "paginate", no_argument, NULL, > 'l' }, > @@ -164,6 +165,9 @@ main(int argc, char **argv) > case 'h': > /* silently ignore for backwards compatibility */ > break; > + case 'B': > + dflags |=3D D_SKIPBLANKLINES; > + break; > case 'I': > push_ignore_pats(optarg); > break; > @@ -447,18 +451,18 @@ void > usage(void) > { > (void)fprintf(stderr, > - "usage: diff [-abdilpTtw] [-c | -e | -f | -n | -q | -u] > [--ignore-case]\n" > + "usage: diff [-aBbdilpTtw] [-c | -e | -f | -n | -q | -u] > [--ignore-case]\n" > " [--no-ignore-case] [--normal] > [--strip-trailing-cr] [--tabsize]\n" > " [-I pattern] [-L label] file1 file2\n" > - " diff [-abdilpTtw] [-I pattern] [-L label] > [--ignore-case]\n" > + " diff [-aBbdilpTtw] [-I pattern] [-L label] > [--ignore-case]\n" > " [--no-ignore-case] [--normal] > [--strip-trailing-cr] [--tabsize]\n" > " -C number file1 file2\n" > - " diff [-abdiltw] [-I pattern] [--ignore-case] > [--no-ignore-case]\n" > + " diff [-aBbdiltw] [-I pattern] [--ignore-case] > [--no-ignore-case]\n" > " [--normal] [--strip-trailing-cr] [--tabsize] -D > string file1 file2\n" > - " diff [-abdilpTtw] [-I pattern] [-L label] > [--ignore-case]\n" > + " diff [-aBbdilpTtw] [-I pattern] [-L label] > [--ignore-case]\n" > " [--no-ignore-case] [--normal] [--tabsize] > [--strip-trailing-cr]\n" > " -U number file1 file2\n" > - " diff [-abdilNPprsTtw] [-c | -e | -f | -n | -q | -u] > [--ignore-case]\n" > + " diff [-aBbdilNPprsTtw] [-c | -e | -f | -n | -q | -u] > [--ignore-case]\n" > " [--no-ignore-case] [--normal] [--tabsize] [-I > pattern] [-L label]\n" > " [-S name] [-X file] [-x pattern] dir1 dir2\n"); > > > Modified: head/usr.bin/diff/diff.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/usr.bin/diff/diff.h Sun Aug 19 01:14:46 2018 (r338038) > +++ head/usr.bin/diff/diff.h Sun Aug 19 03:57:20 2018 (r338039) > @@ -67,6 +67,7 @@ > #define D_EXPANDTABS 0x100 /* Expand tabs to spaces */ > #define D_IGNOREBLANKS 0x200 /* Ignore white space changes */ > #define D_STRIPCR 0x400 /* Strip trailing cr */ > +#define D_SKIPBLANKLINES 0x800 /* Skip blank lines */ > > /* > * Status values for print_status() and diffreg() return values > > Modified: head/usr.bin/diff/diffreg.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/usr.bin/diff/diffreg.c Sun Aug 19 01:14:46 2018 (r338038) > +++ head/usr.bin/diff/diffreg.c Sun Aug 19 03:57:20 2018 (r338039) > @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -999,6 +1000,31 @@ restart: > } > } > return; > + } > + if (*pflags & D_SKIPBLANKLINES) { > + char *line; > + /* > + * All lines in the change, insert, or delete must not be > + * empty for the change to be ignored. > + */ > + if (a <=3D b) { /* Changes and deletes. */ > + for (i =3D a; i <=3D b; i++) { > + line =3D preadline(fileno(f1), > + ixold[i] - ixold[i - 1], ixold[i - 1]= ); > + if (*line !=3D '\0') > + goto proceed; > + } > + } > + if (a > b || c <=3D d) { /* Changes and inserts. */ > + for (i =3D c; i <=3D d; i++) { > + line =3D preadline(fileno(f2), > + ixnew[i] - ixnew[i - 1], ixnew[i - 1]= ); > + if (*line !=3D '\0') > + goto proceed; > + } > + } > + return; > + > } > proceed: > if (*pflags & D_HEADER && diff_format !=3D D_BRIEF) { > > Added: head/usr.bin/diff/tests/Bflag_C.out > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/diff/tests/Bflag_C.out Sun Aug 19 03:57:20 2018 > (r338039) > @@ -0,0 +1,2 @@ > +1a2 > +> > > Added: head/usr.bin/diff/tests/Bflag_D.out > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/diff/tests/Bflag_D.out Sun Aug 19 03:57:20 2018 > (r338039) > @@ -0,0 +1,2 @@ > +1a2 > +> C > > Added: head/usr.bin/diff/tests/Bflag_F.out > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/diff/tests/Bflag_F.out Sun Aug 19 03:57:20 2018 > (r338039) > @@ -0,0 +1,4 @@ > +7c8 > +< G > +--- > +> X > > Modified: head/usr.bin/diff/tests/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/diff/tests/Makefile Sun Aug 19 01:14:46 2018 > (r338038) > +++ head/usr.bin/diff/tests/Makefile Sun Aug 19 03:57:20 2018 > (r338039) > @@ -5,6 +5,9 @@ PACKAGE=3D tests > ATF_TESTS_SH=3D diff_test > > ${PACKAGE}FILES+=3D \ > + Bflag_C.out \ > + Bflag_D.out \ > + Bflag_F.out \ > input1.in \ > input2.in \ > input_c1.in \ > > Modified: head/usr.bin/diff/tests/diff_test.sh > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/usr.bin/diff/tests/diff_test.sh Sun Aug 19 01:14:46 2018 > (r338038) > +++ head/usr.bin/diff/tests/diff_test.sh Sun Aug 19 03:57:20 2018 > (r338039) > @@ -9,6 +9,7 @@ atf_test_case group_format > atf_test_case side_by_side > atf_test_case brief_format > atf_test_case b230049 > +atf_test_case Bflag > > simple_body() > { > @@ -150,6 +151,21 @@ brief_format_body() > diff -Nrq A D > } > > +Bflag_body() > +{ > + atf_check -x 'printf "A\nB\n" > A' > + atf_check -x 'printf "A\n\nB\n" > B' > + atf_check -x 'printf "A\n \nB\n" > C' > + atf_check -x 'printf "A\nC\nB\n" > D' > + atf_check -x 'printf "A\nB\nC\nD\nE\nF\nG\nH" > E' > + atf_check -x 'printf "A\n\nB\nC\nD\nE\nF\nX\nH" > F' > + > + atf_check -s exit:0 -o inline:"" diff -B A B > + atf_check -s exit:1 -o file:"$(atf_get_srcdir)/Bflag_C.out" diff > -B A C > + atf_check -s exit:1 -o file:"$(atf_get_srcdir)/Bflag_D.out" diff > -B A D > + atf_check -s exit:1 -o file:"$(atf_get_srcdir)/Bflag_F.out" diff > -B E F > +} > + > atf_init_test_cases() > { > atf_add_test_case simple > @@ -161,4 +177,5 @@ atf_init_test_cases() > atf_add_test_case side_by_side > atf_add_test_case brief_format > atf_add_test_case b230049 > + atf_add_test_case Bflag > } > > From owner-svn-src-all@freebsd.org Sun Aug 19 07:05:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B140710855B6; Sun, 19 Aug 2018 07:05:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 5828D8AEA6; Sun, 19 Aug 2018 07:05:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35D1C22F90; Sun, 19 Aug 2018 07:05:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7J75XrO026667; Sun, 19 Aug 2018 07:05:33 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7J75XCq026666; Sun, 19 Aug 2018 07:05:33 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201808190705.w7J75XCq026666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 19 Aug 2018 07:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338041 - head/targets/pseudo/userland X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/targets/pseudo/userland X-SVN-Commit-Revision: 338041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 07:05:34 -0000 Author: eadler Date: Sun Aug 19 07:05:33 2018 New Revision: 338041 URL: https://svnweb.freebsd.org/changeset/base/338041 Log: build: remove reference to some dead utilities Modified: head/targets/pseudo/userland/Makefile.depend Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Sun Aug 19 04:15:38 2018 (r338040) +++ head/targets/pseudo/userland/Makefile.depend Sun Aug 19 07:05:33 2018 (r338041) @@ -286,9 +286,6 @@ DIRDEPS+= \ usr.bin/nice \ usr.bin/nl \ usr.bin/nohup \ - usr.bin/nslookup \ - usr.bin/nsupdate \ - usr.bin/numactl \ usr.bin/opieinfo \ usr.bin/opiekey \ usr.bin/opiepasswd \ @@ -761,7 +758,6 @@ DIRDEPS+= \ usr.sbin/zic/zic \ usr.sbin/zonectl \ ${DEP_RELDIR}/cddl \ - ${DEP_RELDIR}/games \ ${DEP_RELDIR}/gnu \ ${DEP_RELDIR}/include \ ${DEP_RELDIR}/kerberos5 \ From owner-svn-src-all@freebsd.org Sun Aug 19 07:12:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF77B10857D2; Sun, 19 Aug 2018 07:12:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 91AF58B2CD; Sun, 19 Aug 2018 07:12:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72B6B23135; Sun, 19 Aug 2018 07:12:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7J7Ca5g031416; Sun, 19 Aug 2018 07:12:36 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7J7CZXA031413; Sun, 19 Aug 2018 07:12:35 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201808190712.w7J7CZXA031413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 19 Aug 2018 07:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338042 - in head: . targets/pseudo/userland usr.bin usr.bin/send-pr usr.sbin/crunch/examples X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head: . targets/pseudo/userland usr.bin usr.bin/send-pr usr.sbin/crunch/examples X-SVN-Commit-Revision: 338042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 07:12:37 -0000 Author: eadler Date: Sun Aug 19 07:12:35 2018 New Revision: 338042 URL: https://svnweb.freebsd.org/changeset/base/338042 Log: send-pr: wave goodbye Entering into the world of 12.x we no longer need even the placeholder for send-pr. It has not done anything for some time. With Hat: bugmeister Deleted: head/usr.bin/send-pr/Makefile head/usr.bin/send-pr/Makefile.depend head/usr.bin/send-pr/send-pr.sh Modified: head/ObsoleteFiles.inc head/targets/pseudo/userland/Makefile.depend head/usr.bin/Makefile head/usr.sbin/crunch/examples/really-big.conf Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Aug 19 07:05:33 2018 (r338041) +++ head/ObsoleteFiles.inc Sun Aug 19 07:12:35 2018 (r338042) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20180819: send-pr(1) placeholder removal +OLD_FILES+=usr/bin/send-pr # 20180725: Cleanup old libcasper.so.0 OLD_LIBS+=lib/libcasper.so.0 # 20180722: indent(1) option renamed, test files follow Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Sun Aug 19 07:05:33 2018 (r338041) +++ head/targets/pseudo/userland/Makefile.depend Sun Aug 19 07:12:35 2018 (r338042) @@ -320,7 +320,6 @@ DIRDEPS+= \ usr.bin/script \ usr.bin/sdiff \ usr.bin/sed \ - usr.bin/send-pr \ usr.bin/seq \ usr.bin/shar \ usr.bin/showmount \ Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sun Aug 19 07:05:33 2018 (r338041) +++ head/usr.bin/Makefile Sun Aug 19 07:12:35 2018 (r338042) @@ -135,7 +135,6 @@ SUBDIR= alias \ script \ sdiff \ sed \ - send-pr \ seq \ shar \ showmount \ Modified: head/usr.sbin/crunch/examples/really-big.conf ============================================================================== --- head/usr.sbin/crunch/examples/really-big.conf Sun Aug 19 07:05:33 2018 (r338041) +++ head/usr.sbin/crunch/examples/really-big.conf Sun Aug 19 07:12:35 2018 (r338042) @@ -110,7 +110,6 @@ progs ypbind ypwhich ypcat ypmatch ypset yppoll srcdirs /usr/src/gnu/usr.bin progs bc cpio diff diff3 gas gawk grep gzip sdiff sort tar -# shell scripts: send-pr srcdirs /usr/src/gnu/usr.bin/ld # ldd and ldconfig progs ld ldd ldconfig From owner-svn-src-all@freebsd.org Sun Aug 19 10:15:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B72641088CEB; Sun, 19 Aug 2018 10:15: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 6CF297006D; Sun, 19 Aug 2018 10:15: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 4E23C24F0D; Sun, 19 Aug 2018 10:15: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 w7JAFT0L023806; Sun, 19 Aug 2018 10:15:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JAFTJH023805; Sun, 19 Aug 2018 10:15:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808191015.w7JAFTJH023805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 19 Aug 2018 10:15:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338043 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 338043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 10:15:29 -0000 Author: imp Date: Sun Aug 19 10:15:28 2018 New Revision: 338043 URL: https://svnweb.freebsd.org/changeset/base/338043 Log: Document LOADER_DEFAULT_INTERP. This controls what interpreter the default boot loader in /boot/loader{,.efi} is, and which one we compile into userboot by default. Modified: head/share/man/man7/build.7 Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Sun Aug 19 07:12:35 2018 (r338042) +++ head/share/man/man7/build.7 Sun Aug 19 10:15:28 2018 (r338043) @@ -652,6 +652,18 @@ using the option of .Xr make 1 : .Bl -tag -width ".Va -DNO_KERNELCONFIG" +.It Va LOADER_DEFAULT_INTERP +Defines what interpreter the default loader program will have. +Valid values include +.Dq 4th , +.Dq lua , +and +.Dq simp . +This creates the default link for +.Pa /boot/loader +to the loader with that interpreter. +It also determines what interpreter is compiled into +.Pa userboot . .It Va NO_CLEANDIR If set, the build targets that clean parts of the object tree use the equivalent of From owner-svn-src-all@freebsd.org Sun Aug 19 13:23:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BE3C108C8CF; Sun, 19 Aug 2018 13:23:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 C4D0675606; Sun, 19 Aug 2018 13:23:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FB9A26D57; Sun, 19 Aug 2018 13:23:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JDNkY2022302; Sun, 19 Aug 2018 13:23:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JDNkNS022301; Sun, 19 Aug 2018 13:23:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808191323.w7JDNkNS022301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 Aug 2018 13:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338044 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 338044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 13:23:47 -0000 Author: kib Date: Sun Aug 19 13:23:46 2018 New Revision: 338044 URL: https://svnweb.freebsd.org/changeset/base/338044 Log: Fix typo. Noted by: Yuri Pankov MFC after: 12 days Modified: head/share/man/man3/pthread_set_name_np.3 Modified: head/share/man/man3/pthread_set_name_np.3 ============================================================================== --- head/share/man/man3/pthread_set_name_np.3 Sun Aug 19 10:15:28 2018 (r338043) +++ head/share/man/man3/pthread_set_name_np.3 Sun Aug 19 13:23:46 2018 (r338044) @@ -74,4 +74,4 @@ are non-standard extensions. This manual page was written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org and -An Yuri Pankov Aq Mt yuripv@yuripv.net . +.An Yuri Pankov Aq Mt yuripv@yuripv.net . From owner-svn-src-all@freebsd.org Sun Aug 19 13:44:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC3E61066206; Sun, 19 Aug 2018 13:44:56 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 9FFE77639F; Sun, 19 Aug 2018 13:44:56 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81421270C6; Sun, 19 Aug 2018 13:44:56 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JDiu11033216; Sun, 19 Aug 2018 13:44:56 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JDiuhs033215; Sun, 19 Aug 2018 13:44:56 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808191344.w7JDiuhs033215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 19 Aug 2018 13:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338045 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 338045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 13:44:57 -0000 Author: cy Date: Sun Aug 19 13:44:56 2018 New Revision: 338045 URL: https://svnweb.freebsd.org/changeset/base/338045 Log: Expose np (nat_t - an entry in the nat table structure) in the DTrace probe when nat fails (label badnat). This is useful in diagnosing failed NAT issues and was used in PR/208566. PR: 208566 MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Sun Aug 19 13:23:46 2018 (r338044) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Sun Aug 19 13:44:56 2018 (r338045) @@ -3259,7 +3259,7 @@ ipf_nat_add(fin, np, natsave, flags, direction) goto done; badnat: - DT2(ns_badnatnew, fr_info_t *, fin, nat_t *, nat); + DT3(ns_badnatnew, fr_info_t *, fin, nat_t *, nat, ipnat_t *, np); NBUMPSIDE(fin->fin_out, ns_badnatnew); if ((hm = nat->nat_hm) != NULL) ipf_nat_hostmapdel(softc, &hm); From owner-svn-src-all@freebsd.org Sun Aug 19 13:45:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5582B1066235; Sun, 19 Aug 2018 13:45:04 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 C902776489; Sun, 19 Aug 2018 13:45:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DF5F270CA; Sun, 19 Aug 2018 13:45:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JDj3qe033347; Sun, 19 Aug 2018 13:45:03 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JDj3Hs033346; Sun, 19 Aug 2018 13:45:03 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808191345.w7JDj3Hs033346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 19 Aug 2018 13:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338047 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 338047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 13:45:04 -0000 Author: cy Date: Sun Aug 19 13:45:03 2018 New Revision: 338047 URL: https://svnweb.freebsd.org/changeset/base/338047 Log: The bucket index is subtracted by one at lines 2304 and 2314. When 0 it becomes -1, except these are unsigned integers, so they become very large numbers. Thus are always larger than the maximum bucket; the hash table insertion fails causing NAT to fail. This commit ensures that if the index is already zero it is not reduced prior to insertion into the hash table. PR: 208566 Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Sun Aug 19 13:44:59 2018 (r338046) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Sun Aug 19 13:45:03 2018 (r338047) @@ -2304,14 +2304,16 @@ ipf_nat_delete(softc, nat, logtype) bkt = nat->nat_hv[0] % softn->ipf_nat_table_sz; nss = &softn->ipf_nat_stats.ns_side[0]; - nss->ns_bucketlen[bkt]--; + if (nss->ns_bucketlen[bkt] > 0) + nss->ns_bucketlen[bkt]--; if (nss->ns_bucketlen[bkt] == 0) { nss->ns_inuse--; } bkt = nat->nat_hv[1] % softn->ipf_nat_table_sz; nss = &softn->ipf_nat_stats.ns_side[1]; - nss->ns_bucketlen[bkt]--; + if (nss->ns_bucketlen[bkt] > 0) + nss->ns_bucketlen[bkt]--; if (nss->ns_bucketlen[bkt] == 0) { nss->ns_inuse--; } From owner-svn-src-all@freebsd.org Sun Aug 19 13:45:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E310106622D; Sun, 19 Aug 2018 13:45:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 0FFC076403; Sun, 19 Aug 2018 13:45:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3635B270C8; Sun, 19 Aug 2018 13:45:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JDixVW033277; Sun, 19 Aug 2018 13:44:59 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JDix4H033276; Sun, 19 Aug 2018 13:44:59 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808191344.w7JDix4H033276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 19 Aug 2018 13:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338046 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 338046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 13:45:03 -0000 Author: cy Date: Sun Aug 19 13:44:59 2018 New Revision: 338046 URL: https://svnweb.freebsd.org/changeset/base/338046 Log: Add handy DTrace probes useful in diagnosing NAT issues. DTrace probes are situated next to error counters and/or in one instance prior to the -1 return from various functions. This was useful in diagnosis of PR/208566 and will be handy in the future diagnosing NAT failures. PR: 208566 MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Sun Aug 19 13:44:56 2018 (r338045) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Sun Aug 19 13:44:59 2018 (r338046) @@ -2676,6 +2676,7 @@ ipf_nat_newmap(fin, nat, ni) if ((np->in_nsrcmsk == 0xffffffff) && (np->in_spnext == 0)) { if (l > 0) { NBUMPSIDEX(1, ns_exhausted, ns_exhausted_1); + DT4(ns_exhausted_1, fr_info_t *, fin, nat_t *, nat, natinfo_t *, ni, ipnat_t *, np); return -1; } } @@ -2693,6 +2694,7 @@ ipf_nat_newmap(fin, nat, ni) if ((l >= np->in_ppip) || ((l > 0) && !(flags & IPN_TCPUDP))) { NBUMPSIDEX(1, ns_exhausted, ns_exhausted_2); + DT4(ns_exhausted_2, fr_info_t *, fin, nat_t *, nat, natinfo_t *, ni, ipnat_t *, np); return -1; } /* @@ -2728,6 +2730,7 @@ ipf_nat_newmap(fin, nat, ni) ipf_ifpaddr(softc, 4, FRI_NORMAL, fin->fin_ifp, &in6, NULL) == -1) { NBUMPSIDEX(1, ns_new_ifpaddr, ns_new_ifpaddr_1); + DT4(ns_new_ifpaddr_1, fr_info_t *, fin, nat_t *, nat, natinfo_t *, ni, ipnat_t *, np); return -1; } in.s_addr = ntohl(in6.in4.s_addr); @@ -2738,6 +2741,7 @@ ipf_nat_newmap(fin, nat, ni) */ if (l > 0) { NBUMPSIDEX(1, ns_exhausted, ns_exhausted_3); + DT4(ns_exhausted_3, fr_info_t *, fin, nat_t *, nat, natinfo_t *, ni, ipnat_t *, np); return -1; } in.s_addr = ntohl(fin->fin_saddr); @@ -2833,6 +2837,7 @@ ipf_nat_newmap(fin, nat, ni) (np->in_spnext != 0) && (st_port == np->in_spnext) && (np->in_snip != 0) && (st_ip == np->in_snip)) { NBUMPSIDED(1, ns_wrap); + DT4(ns_wrap, fr_info_t *, fin, nat_t *, nat, natinfo_t *, ni, ipnat_t *, np); return -1; } l++; @@ -2968,6 +2973,7 @@ ipf_nat_newrdr(fin, nat, ni) if (ipf_ifpaddr(softc, 4, FRI_NORMAL, fin->fin_ifp, &in6, NULL) == -1) { NBUMPSIDEX(0, ns_new_ifpaddr, ns_new_ifpaddr_2); + DT3(ns_new_ifpaddr_2, fr_info_t *, fin, nat_t *, nat, natinfo_t, ni); return -1; } in.s_addr = ntohl(in6.in4.s_addr); @@ -3114,6 +3120,7 @@ ipf_nat_add(fin, np, natsave, flags, direction) if (nsp->ns_active >= softn->ipf_nat_table_max) { NBUMPSIDED(fin->fin_out, ns_table_max); + DT2(ns_table_max, nat_stat_t *, nsp, ipf_nat_softc_t *, softn); return NULL; } @@ -3128,6 +3135,7 @@ ipf_nat_add(fin, np, natsave, flags, direction) /* Give me a new nat */ KMALLOC(nat, nat_t *); if (nat == NULL) { + DT(ns_memfail); NBUMPSIDED(fin->fin_out, ns_memfail); /* * Try to automatically tune the max # of entries in the @@ -3223,6 +3231,7 @@ ipf_nat_add(fin, np, natsave, flags, direction) if ((np->in_apr != NULL) && ((nat->nat_flags & NAT_SLAVE) == 0)) { if (ipf_proxy_new(fin, nat) == -1) { NBUMPSIDED(fin->fin_out, ns_appr_fail); + DT3(ns_appr_fail, fr_info_t *, fin, nat_t *, nat, ipnat_t *, np); goto badnat; } } @@ -3380,6 +3389,7 @@ ipf_nat_finalise(fin, nat) } NBUMPSIDED(fin->fin_out, ns_unfinalised); + DT2(ns_unfinalised, fr_info_t *, fin, nat_t *, nat); /* * nat_insert failed, so cleanup time... */ @@ -7065,6 +7075,7 @@ ipf_nat_newrewrite(fin, nat, nai) do { changed = -1; /* TRACE (l, src_search, dst_search, np) */ + DT4(ipf_nat_rewrite_1, int, l, int, src_search, int, dst_search, ipnat_t *, np); if ((src_search == 0) && (np->in_spnext == 0) && (dst_search == 0) && (np->in_dpnext == 0)) { @@ -7129,6 +7140,7 @@ ipf_nat_newrewrite(fin, nat, nai) * Find a new destination address */ /* TRACE (fin, np, l, frnat) */ + DT4(ipf_nat_rewrite_2, frinfo_t *, fin, ipnat_t *, np, int, l, frinfo_t *, &frnat); if (ipf_nat_nextaddr(fin, &np->in_ndst, &frnat.fin_daddr, &frnat.fin_daddr) == -1) @@ -7179,6 +7191,7 @@ ipf_nat_newrewrite(fin, nat, nai) } /* TRACE (frnat) */ + DT1(ipf_nat_rewrite_3, frinfo_t *, &frnat); /* * Here we do a lookup of the connection as seen from @@ -7218,6 +7231,7 @@ ipf_nat_newrewrite(fin, nat, nai) } /* TRACE natl, in_stepnext, l */ + DT3(ipf_nat_rewrite_2, nat_t *, natl, ipnat_t *, np , int, l); if ((natl != NULL) && (l > 8)) /* XXX 8 is arbitrary */ return -1; @@ -7310,6 +7324,7 @@ ipf_nat_newdivert(fin, nat, nai) if (natl != NULL) { NBUMPSIDED(fin->fin_out, ns_divert_exist); + DT3(ns_divert_exist, fr_info_t *, fin, nat_t *, nat, natinfo_t, nai); return -1; } @@ -7562,6 +7577,7 @@ ipf_nat_nextaddr(fin, na, old, dst) case FRI_PEERADDR : case FRI_NETWORK : default : + DT4(ns_na_atype, fr_info_t *, fin, nat_addr_t *, na, u_32_t *, old, u_32_t *, new); return -1; } @@ -7573,6 +7589,7 @@ ipf_nat_nextaddr(fin, na, old, dst) NULL); } else { NBUMPSIDE(fin->fin_out, ns_badnextaddr); + DT4(ns_badnextaddr_1, fr_info_t *, fin, nat_addr_t *, na, u_32_t *, old, u_32_t *, new); } } else if (na->na_atype == IPLT_NONE) { @@ -7591,6 +7608,7 @@ ipf_nat_nextaddr(fin, na, old, dst) if (ipf_ifpaddr(softc, 4, na->na_atype, fin->fin_ifp, &newip, NULL) == -1) { NBUMPSIDED(fin->fin_out, ns_ifpaddrfail); + DT4(ns_ifpaddrfail, fr_info_t *, fin, nat_addr_t *, na, u_32_t *, old, u_32_t *, new); return -1; } new = newip.in4.s_addr; @@ -7602,6 +7620,7 @@ ipf_nat_nextaddr(fin, na, old, dst) } else { NBUMPSIDE(fin->fin_out, ns_badnextaddr); + DT4(ns_badnextaddr_2, fr_info_t *, fin, nat_addr_t *, na, u_32_t *, old, u_32_t *, new); } return error; From owner-svn-src-all@freebsd.org Sun Aug 19 14:22:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E6561069DD0; Sun, 19 Aug 2018 14:22:46 +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 5170D78347; Sun, 19 Aug 2018 14:22:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33D3827753; Sun, 19 Aug 2018 14:22:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JEMk3T053756; Sun, 19 Aug 2018 14:22:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JEMkTb053755; Sun, 19 Aug 2018 14:22:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808191422.w7JEMkTb053755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 Aug 2018 14:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338048 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 338048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 14:22:46 -0000 Author: kib Date: Sun Aug 19 14:22:45 2018 New Revision: 338048 URL: https://svnweb.freebsd.org/changeset/base/338048 Log: Use tab for indent. Submitted by: Yuri Pankov MFC after: 3 days Modified: head/lib/libc/stdlib/Makefile.inc Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Sun Aug 19 13:45:03 2018 (r338047) +++ head/lib/libc/stdlib/Makefile.inc Sun Aug 19 14:22:45 2018 (r338048) @@ -16,7 +16,7 @@ MISRCS+=C99_Exit.c a64l.c abort.c abs.c atexit.c atof. random.c reallocarray.c reallocf.c realpath.c remque.c \ set_constraint_handler_s.c strfmon.c strtoimax.c \ strtol.c strtold.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ - strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c + strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c # Work around an issue on case-insensitive file systems. # libc has both _Exit.c and _exit.s and they both yield From owner-svn-src-all@freebsd.org Sun Aug 19 14:25:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E1B2106A016; Sun, 19 Aug 2018 14:25:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 23A66785DC; Sun, 19 Aug 2018 14:25:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0018A27754; Sun, 19 Aug 2018 14:25:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JEPSF7053915; Sun, 19 Aug 2018 14:25:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JEPSBQ053914; Sun, 19 Aug 2018 14:25:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808191425.w7JEPSBQ053914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 Aug 2018 14:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338049 - head/lib/libc/string X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/string X-SVN-Commit-Revision: 338049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 14:25:29 -0000 Author: kib Date: Sun Aug 19 14:25:28 2018 New Revision: 338049 URL: https://svnweb.freebsd.org/changeset/base/338049 Log: Clarify that memset_s(3) requires __STDC_WANT_LIB_EXT1__ for visibility. Fix typos and other nits. Submitted by: Yuri Pankov MFC after: 3 days Differential revision: https://reviews.freebsd.org/D16797 Modified: head/lib/libc/string/memset.3 Modified: head/lib/libc/string/memset.3 ============================================================================== --- head/lib/libc/string/memset.3 Sun Aug 19 14:22:45 2018 (r338048) +++ head/lib/libc/string/memset.3 Sun Aug 19 14:25:28 2018 (r338049) @@ -32,7 +32,7 @@ .\" @(#)memset.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 15, 2018 +.Dd August 19, 2018 .Dt MEMSET 3 .Os .Sh NAME @@ -44,6 +44,7 @@ .In string.h .Ft void * .Fn memset "void *dest" "int c" "size_t len" +.Fd #define __STDC_WANT_LIB_EXT1__ 1 .Ft errno_t .Fn memset_s "void *dest" "rsize_t destsz" "int c" "rsize_t len" .Sh DESCRIPTION @@ -82,7 +83,6 @@ or is greater than .Dv RSIZE_MAX , or -.Sp .Fa len is greater than .Fa destsz @@ -93,10 +93,10 @@ Like .Xr explicit_bzero 3 , .Fn memset_s is not removed through Dead Store Elimination (DSE), making it useful for -clearing sensitve data. +clearing sensitive data. In contrast .Fn memset -function +function may be optimized away if the object modified by the function is not accessed again. To clear memory that will not subsequently be accessed it is advised to use @@ -126,6 +126,6 @@ function conforms to .St -isoC . .Fn memset_s -conforms to: +conforms to .St -isoC-2011 K.3.7.4.1. From owner-svn-src-all@freebsd.org Sun Aug 19 14:26:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E202106A16F; Sun, 19 Aug 2018 14:26:34 +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 D8BF8788CB; Sun, 19 Aug 2018 14:26:33 +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 B9F5A27776; Sun, 19 Aug 2018 14:26:33 +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 w7JEQXir054124; Sun, 19 Aug 2018 14:26:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JEQXXr054123; Sun, 19 Aug 2018 14:26:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808191426.w7JEQXXr054123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 19 Aug 2018 14:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338050 - in head: . stand X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: . stand X-SVN-Commit-Revision: 338050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 14:26:34 -0000 Author: kevans Date: Sun Aug 19 14:26:33 2018 New Revision: 338050 URL: https://svnweb.freebsd.org/changeset/base/338050 Log: stand: Flip the default interpreter to Lua After years in the making, lualoader is ready to make its debut. Both flavors of loader are still built by default, and may be installed as /boot/loader or /boot/loader.efi as appropriate either by manually creating hard links or using LOADER_DEFAULT_INTERP as documented in build(7). Discussed with: imp Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16795 Modified: head/UPDATING head/stand/defs.mk Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Aug 19 14:25:28 2018 (r338049) +++ head/UPDATING Sun Aug 19 14:26:33 2018 (r338050) @@ -31,6 +31,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20180818: + The default interpreter has been switched from 4th to Lua. + LOADER_DEFAULT_INTERP, documented in build(7), will override the default + interpreter. If you have custom FORTH code you will need to set + LOADER_DEFAULT_INTERP=4th (valid values are 4th, lua or simp) in + src.conf for the build. This will create default hard links between + loader and loader_4th instead of loader and loader_lua, the new default. + If you are using UEFI it will create the proper hard link to loader.efi. + 20180815: ls(1) now respects the COLORTERM environment variable used in other systems and software to indicate that a colored terminal is both Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Sun Aug 19 14:25:28 2018 (r338049) +++ head/stand/defs.mk Sun Aug 19 14:26:33 2018 (r338050) @@ -154,10 +154,10 @@ CFLAGS+= -mlittle-endian # # Have a sensible default # -.if ${MK_FORTH} == "yes" -LOADER_DEFAULT_INTERP?=4th -.elif ${MK_LOADER_LUA} == "yes" +.if ${MK_LOADER_LUA} == "yes" LOADER_DEFAULT_INTERP?=lua +.elif ${MK_FORTH} == "yes" +LOADER_DEFAULT_INTERP?=4th .else LOADER_DEFAULT_INTERP?=simp .endif From owner-svn-src-all@freebsd.org Sun Aug 19 14:39:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B627D106A920; Sun, 19 Aug 2018 14:39:58 +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 6BEA4796EF; Sun, 19 Aug 2018 14:39:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D15B27914; Sun, 19 Aug 2018 14:39:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JEdwkO059402; Sun, 19 Aug 2018 14:39:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JEdvQd059399; Sun, 19 Aug 2018 14:39:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808191439.w7JEdvQd059399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 Aug 2018 14:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338051 - in head/lib/libc: stdlib string X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/lib/libc: stdlib string X-SVN-Commit-Revision: 338051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 14:39:59 -0000 Author: kib Date: Sun Aug 19 14:39:57 2018 New Revision: 338051 URL: https://svnweb.freebsd.org/changeset/base/338051 Log: Provide set_constraint_handler_s(3) man page. Mention abort_handler_s(3) and ignore_handler_s(3), provide cross-reference from memset(3). Submitted by: Yuri Pankov MFC after: 3 days Differential revision: https://reviews.freebsd.org/D16797 Added: head/lib/libc/stdlib/set_constraint_handler_s.3 (contents, props changed) Modified: head/lib/libc/stdlib/Makefile.inc head/lib/libc/string/memset.3 Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Sun Aug 19 14:26:33 2018 (r338050) +++ head/lib/libc/stdlib/Makefile.inc Sun Aug 19 14:39:57 2018 (r338051) @@ -36,8 +36,9 @@ MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 \ hcreate.3 imaxabs.3 imaxdiv.3 insque.3 labs.3 ldiv.3 llabs.3 lldiv.3 \ lsearch.3 memory.3 ptsname.3 qsort.3 \ quick_exit.3 \ - radixsort.3 rand.3 random.3 reallocarray.3 reallocf.3 \ - realpath.3 strfmon.3 strtod.3 strtol.3 strtonum.3 strtoul.3 system.3 \ + radixsort.3 rand.3 random.3 reallocarray.3 reallocf.3 realpath.3 \ + set_constraint_handler_s.3 \ + strfmon.3 strtod.3 strtol.3 strtonum.3 strtoul.3 system.3 \ tsearch.3 MLINKS+=a64l.3 l64a.3 a64l.3 l64a_r.3 @@ -55,6 +56,8 @@ MLINKS+=rand.3 rand_r.3 rand.3 srand.3 rand.3 sranddev MLINKS+=random.3 initstate.3 random.3 setstate.3 random.3 srandom.3 \ random.3 srandomdev.3 MLINKS+=radixsort.3 sradixsort.3 +MLINKS+=set_constraint_handler_s.3 abort_handler_s.3 +MLINKS+=set_constraint_handler_s.3 ignore_handler_s.3 MLINKS+=strfmon.3 strfmon_l.3 MLINKS+=strtod.3 strtof.3 strtod.3 strtold.3 MLINKS+=strtol.3 strtoll.3 strtol.3 strtoq.3 strtol.3 strtoimax.3 Added: head/lib/libc/stdlib/set_constraint_handler_s.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdlib/set_constraint_handler_s.3 Sun Aug 19 14:39:57 2018 (r338051) @@ -0,0 +1,149 @@ +.\" Copyright 2018 Yuri Pankov +.\" +.\" 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 REGENTS 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 REGENTS 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$ +.\" +.Dd August 18, 2018 +.Dt SET_CONSTRAINT_HANDLER_S 3 +.Os +.Sh NAME +.Nm set_constraint_handler_s , +.Nm abort_handler_s , +.Nm ignore_handler_s +.Nd runtime-constraint violation handling +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.Fd #define __STDC_WANT_LIB_EXT1__ 1 +.In stdlib.h +.Ft constraint_handler_t +.Fo set_constraint_handler_s +.Fa "constraint_handler_t handler" +.Fc +.Ss Handler Prototype +.Ft typedef void +.Fo (*constraint_handler_t) +.Fa "const char * restrict msg" +.Fa "void * restrict ptr" +.Fa "errno_t error" +.Fc +.Ss Predefined Handlers +.Ft void +.Fo abort_handler_s +.Fa "const char * restrict msg" +.Fa "void * restrict ptr" +.Fa "errno_t error" +.Fc +.Ft void +.Fo ignore_handler_s +.Fa "const char * restrict msg" +.Fa "void * restrict ptr" +.Fa "errno_t error" +.Fc +.Sh DESCRIPTION +The +.Fn set_constraint_handler_s +function sets the runtime-constraint violation handler to be +.Fa handler . +.Pp +The runtime-constraint handler is the callback function invoked when a library +function detects a runtime-constraint violation. +.Pp +The arguments are as follows: +.Bl -tag -width "error" +.It Fa msg +A pointer to a character string describing the runtime-constraint violation. +.It Fa ptr +A +.Dv NULL +pointer. +.It Fa error +If the function calling the handler has a return type declared as +.Vt errno_t , +the return value of the function is passed. +Otherwise, a positive value of type +.Vt errno_t +is passed. +.El +.Pp +Only the most recent handler registered with +.Fn set_constraint_handler_s +is called when a runtime-constraint violation occurs. +.Pp +The implementation has a default constraint handler that is used if no calls to +the +.Fn set_constraint_handler_s +function have been made. +If the +.Fa handler +argument to +.Fn set_constraint_handler_s +is a +.Dv NULL +pointer, the default handler becomes the current constraint handler. +.Pp +The +.Fn abort_handler_s +and +.Fn ignore_handler_s +are the standard-defined runtime-constraint handlers provided by the C library. +.Pp +The +.Fn abort_handler_s +function writes the error message including the +.Fa msg +to +.Dv stderr +and calls the +.Xr abort 3 +function. +The +.Fn abort_handler_s +is currently the default runtime-constraint handler. +.Pp +The +.Fn ignore_handler_s +simply returns to its caller. +.Sh RETURN VALUES +The +.Fn set_constraint_handler_s +function returns a pointer to the previously registered handler, or +.Dv NULL +if none was previously registered. +.Pp +The +.Fn abort_handler_s +function does not return to its caller. +.Pp +The +.Fn ignore_handler_s +function returns no value. +.Sh STANDARDS +The +.Fn set_constraint_handler_s +function conforms to +.St -isoC-2011 +K.3.6.1.1. +.Sh AUTHORS +This manual page was written by +.An Yuri Pankov Aq Mt yuripv@yuripv.net . Modified: head/lib/libc/string/memset.3 ============================================================================== --- head/lib/libc/string/memset.3 Sun Aug 19 14:26:33 2018 (r338050) +++ head/lib/libc/string/memset.3 Sun Aug 19 14:39:57 2018 (r338051) @@ -117,6 +117,7 @@ function returns zero on success, non-zero on error. .Sh SEE ALSO .Xr bzero 3 , .Xr explicit_bzero 3 , +.Xr set_constraint_handler_s 3 , .Xr swab 3 , .Xr wmemset 3 .Sh STANDARDS From owner-svn-src-all@freebsd.org Sun Aug 19 14:48:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88D4E106B3CA; Sun, 19 Aug 2018 14:48:33 +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 598D579F9F; Sun, 19 Aug 2018 14:48:33 +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 36D1227AD3; Sun, 19 Aug 2018 14:48:33 +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 w7JEmXcr064462; Sun, 19 Aug 2018 14:48:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JEmXnH064461; Sun, 19 Aug 2018 14:48:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808191448.w7JEmXnH064461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 19 Aug 2018 14:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338052 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 338052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 14:48:33 -0000 Author: kevans Date: Sun Aug 19 14:48:32 2018 New Revision: 338052 URL: https://svnweb.freebsd.org/changeset/base/338052 Log: libsa: Add lshrdi3.c for powerpc* and mips Modified: head/stand/libsa/Makefile Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Sun Aug 19 14:39:57 2018 (r338051) +++ head/stand/libsa/Makefile Sun Aug 19 14:48:32 2018 (r338052) @@ -73,13 +73,13 @@ SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S a .if ${MACHINE_CPUARCH} == "powerpc" .PATH: ${LIBC_SRC}/quad -SRCS+= ashldi3.c ashrdi3.c +SRCS+= ashldi3.c ashrdi3.c lshrdi3.c SRCS+= syncicache.c .endif .if ${MACHINE_CPUARCH} == "mips" .PATH: ${LIBC_SRC}/quad -SRCS+= ashldi3.c ashrdi3.c +SRCS+= ashldi3.c ashrdi3.c lshrdi3.c .endif # uuid functions from libc From owner-svn-src-all@freebsd.org Sun Aug 19 14:56:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9484106B835; Sun, 19 Aug 2018 14:56:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 82EEB7A440; Sun, 19 Aug 2018 14:56:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FED327C63; Sun, 19 Aug 2018 14:56:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JEuBil069783; Sun, 19 Aug 2018 14:56:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JEuAZE069780; Sun, 19 Aug 2018 14:56:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201808191456.w7JEuAZE069780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 19 Aug 2018 14:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338053 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 338053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 14:56:12 -0000 Author: tuexen Date: Sun Aug 19 14:56:10 2018 New Revision: 338053 URL: https://svnweb.freebsd.org/changeset/base/338053 Log: Don't expose the uptime via the TCP timestamps. The TCP client side or the TCP server side when not using SYN-cookies used the uptime as the TCP timestamp value. This patch uses in all cases an offset, which is the result of a keyed hash function taking the source and destination addresses and port numbers into account. The keyed hash function is the same a used for the initial TSN. Reviewed by: rrs@ MFC after: 1 month Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16636 Modified: head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sun Aug 19 14:48:32 2018 (r338052) +++ head/sys/netinet/tcp_subr.c Sun Aug 19 14:56:10 2018 (r338053) @@ -233,6 +233,9 @@ VNET_DEFINE(uma_zone_t, sack_hole_zone); VNET_DEFINE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST+1]); #endif +VNET_DEFINE_STATIC(u_char, ts_offset_secret[32]); +#define V_ts_offset_secret VNET(ts_offset_secret) + static int tcp_default_fb_init(struct tcpcb *tp); static void tcp_default_fb_fini(struct tcpcb *tp, int tcb_is_purged); static int tcp_default_handoff_ok(struct tcpcb *tp); @@ -1092,6 +1095,7 @@ tcp_init(void) /* Initialize the TCP logging data. */ tcp_log_init(); #endif + read_random(&V_ts_offset_secret, sizeof(V_ts_offset_secret)); if (tcp_soreceive_stream) { #ifdef INET @@ -2603,7 +2607,41 @@ out: } #endif /* INET6 */ +static uint32_t +tcp_keyed_hash(struct in_conninfo *inc, u_char *key) +{ + MD5_CTX ctx; + uint32_t hash[4]; + MD5Init(&ctx); + MD5Update(&ctx, &inc->inc_fport, sizeof(uint16_t)); + MD5Update(&ctx, &inc->inc_lport, sizeof(uint16_t)); + switch (inc->inc_flags & INC_ISIPV6) { +#ifdef INET + case 0: + MD5Update(&ctx, &inc->inc_faddr, sizeof(struct in_addr)); + MD5Update(&ctx, &inc->inc_laddr, sizeof(struct in_addr)); + break; +#endif +#ifdef INET6 + case INC_ISIPV6: + MD5Update(&ctx, &inc->inc6_faddr, sizeof(struct in6_addr)); + MD5Update(&ctx, &inc->inc6_laddr, sizeof(struct in6_addr)); + break; +#endif + } + MD5Update(&ctx, key, 32); + MD5Final((unsigned char *)hash, &ctx); + + return (hash[0]); +} + +uint32_t +tcp_new_ts_offset(struct in_conninfo *inc) +{ + return (tcp_keyed_hash(inc, V_ts_offset_secret)); +} + /* * Following is where TCP initial sequence number generation occurs. * @@ -2644,7 +2682,7 @@ out: * as reseeding should not be necessary. * * Locking of the global variables isn_secret, isn_last_reseed, isn_offset, - * isn_offset_old, and isn_ctx is performed using the TCP pcbinfo lock. In + * isn_offset_old, and isn_ctx is performed using the ISN lock. In * general, this means holding an exclusive (write) lock. */ @@ -2665,15 +2703,11 @@ VNET_DEFINE_STATIC(u_int32_t, isn_offset_old); #define V_isn_offset_old VNET(isn_offset_old) tcp_seq -tcp_new_isn(struct tcpcb *tp) +tcp_new_isn(struct in_conninfo *inc) { - MD5_CTX isn_ctx; - u_int32_t md5_buffer[4]; tcp_seq new_isn; u_int32_t projected_offset; - INP_WLOCK_ASSERT(tp->t_inpcb); - ISN_LOCK(); /* Seed if this is the first use, reseed if requested. */ if ((V_isn_last_reseed == 0) || ((V_tcp_isn_reseed_interval > 0) && @@ -2684,26 +2718,7 @@ tcp_new_isn(struct tcpcb *tp) } /* Compute the md5 hash and return the ISN. */ - MD5Init(&isn_ctx); - MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_fport, sizeof(u_short)); - MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_lport, sizeof(u_short)); -#ifdef INET6 - if ((tp->t_inpcb->inp_vflag & INP_IPV6) != 0) { - MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->in6p_faddr, - sizeof(struct in6_addr)); - MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->in6p_laddr, - sizeof(struct in6_addr)); - } else -#endif - { - MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_faddr, - sizeof(struct in_addr)); - MD5Update(&isn_ctx, (u_char *) &tp->t_inpcb->inp_laddr, - sizeof(struct in_addr)); - } - MD5Update(&isn_ctx, (u_char *) &V_isn_secret, sizeof(V_isn_secret)); - MD5Final((u_char *) &md5_buffer, &isn_ctx); - new_isn = (tcp_seq) md5_buffer[0]; + new_isn = (tcp_seq)tcp_keyed_hash(inc, V_isn_secret); V_isn_offset += ISN_STATIC_INCREMENT + (arc4random() & ISN_RANDOM_INCREMENT); if (ticks != V_isn_last) { Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sun Aug 19 14:48:32 2018 (r338052) +++ head/sys/netinet/tcp_syncache.c Sun Aug 19 14:56:10 2018 (r338053) @@ -1497,6 +1497,7 @@ skip_alloc: if (to->to_flags & TOF_TS) { sc->sc_tsreflect = to->to_tsval; sc->sc_flags |= SCF_TIMESTAMP; + sc->sc_tsoff = tcp_new_ts_offset(inc); } if (to->to_flags & TOF_SCALE) { int wscale = 0; @@ -2035,11 +2036,6 @@ syncookie_generate(struct syncache_head *sch, struct s iss = hash & ~0xff; iss |= cookie.cookie ^ (hash >> 24); - /* Randomize the timestamp. */ - if (sc->sc_flags & SCF_TIMESTAMP) { - sc->sc_tsoff = arc4random() - tcp_ts_getticks(); - } - TCPSTAT_INC(tcps_sc_sendcookie); return (iss); } @@ -2126,7 +2122,7 @@ syncookie_lookup(struct in_conninfo *inc, struct synca if (to->to_flags & TOF_TS) { sc->sc_flags |= SCF_TIMESTAMP; sc->sc_tsreflect = to->to_tsval; - sc->sc_tsoff = to->to_tsecr - tcp_ts_getticks(); + sc->sc_tsoff = tcp_new_ts_offset(inc); } if (to->to_flags & TOF_SIGNATURE) Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Sun Aug 19 14:48:32 2018 (r338052) +++ head/sys/netinet/tcp_usrreq.c Sun Aug 19 14:56:10 2018 (r338053) @@ -1439,7 +1439,9 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, st soisconnecting(so); TCPSTAT_INC(tcps_connattempt); tcp_state_change(tp, TCPS_SYN_SENT); - tp->iss = tcp_new_isn(tp); + tp->iss = tcp_new_isn(&inp->inp_inc); + if (tp->t_flags & TF_REQ_TSTMP) + tp->ts_offset = tcp_new_ts_offset(&inp->inp_inc); tcp_sendseqinit(tp); return 0; @@ -1478,7 +1480,9 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr *nam, s soisconnecting(inp->inp_socket); TCPSTAT_INC(tcps_connattempt); tcp_state_change(tp, TCPS_SYN_SENT); - tp->iss = tcp_new_isn(tp); + tp->iss = tcp_new_isn(&inp->inp_inc); + if (tp->t_flags & TF_REQ_TSTMP) + tp->ts_offset = tcp_new_ts_offset(&inp->inp_inc); tcp_sendseqinit(tp); return 0; Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sun Aug 19 14:48:32 2018 (r338052) +++ head/sys/netinet/tcp_var.h Sun Aug 19 14:56:10 2018 (r338053) @@ -923,7 +923,9 @@ void tcp_hc_updatemtu(struct in_conninfo *, uint32_t) void tcp_hc_update(struct in_conninfo *, struct hc_metrics_lite *); extern struct pr_usrreqs tcp_usrreqs; -tcp_seq tcp_new_isn(struct tcpcb *); + +uint32_t tcp_new_ts_offset(struct in_conninfo *); +tcp_seq tcp_new_isn(struct in_conninfo *); int tcp_sack_doack(struct tcpcb *, struct tcpopt *, tcp_seq); void tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_laststart, tcp_seq rcv_lastend); From owner-svn-src-all@freebsd.org Sun Aug 19 15:07:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58037106BE1C; Sun, 19 Aug 2018 15:07:40 +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 0E2837ABF7; Sun, 19 Aug 2018 15:07:40 +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 E353E27E32; Sun, 19 Aug 2018 15:07: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 w7JF7dFd074771; Sun, 19 Aug 2018 15:07:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JF7dIm074770; Sun, 19 Aug 2018 15:07:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808191507.w7JF7dIm074770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 19 Aug 2018 15:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338054 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 338054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 15:07:40 -0000 Author: kevans Date: Sun Aug 19 15:07:39 2018 New Revision: 338054 URL: https://svnweb.freebsd.org/changeset/base/338054 Log: Add config.lua(8) to the tree Reviewed by: 0mp, rpokala (earlier version) Differential Revision: https://reviews.freebsd.org/D14819 Added: head/stand/lua/config.lua.8 (contents, props changed) Added: head/stand/lua/config.lua.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/config.lua.8 Sun Aug 19 15:07:39 2018 (r338054) @@ -0,0 +1,188 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Kyle Evans +.\" +.\" 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$ +.\" +.Dd June 9, 2018 +.Dt CONFIG.LUA 8 +.Os +.Sh NAME +.Nm config.lua +.Nd FreeBSD config module +.Sh DESCRIPTION +.Nm +contains configuration and module loading functionality. +.Pp +Before hooking into or using the functionality provided by +.Nm , +it must be included with a statement such as the following: +.Pp +.Dl local config = require("config") +.Ss Exported functions +The following functions are exported from +.Nm : +.Bl -tag -width "config.setCarouselIndex(id, idx)" -offset indent +.It Fn config.getCarouselIndex id +Returns the currently chosen index in the carousel menu entry described by +.Ev id . +See the definition of +.Xr menu.lua 8 +for a more in-depth explanation of carousels. +.It Fn config.setCarouselIndex id idx +Set the chosen index for the carousel menu entry described by +.Ev id +to +.Ev idx . +A lookup will be done as needed to determine what value +.Ev idx +actually corresponds to. +.It Fn config.processFile name silent +Process and parse +.Ev name +as a configuration file. +Returns true if +.Ev name +exists and parses without error, false otherwise. +If +.Ev silent +is true, +.Fn config.processFile +will not consider a failure to read the file as a failure. +.It Fn config.parse text +Parse +.Ev text +as a configuration file. +This is used internally by +.Fn config.processFile +to parse the contents of a configuration file. +Returns true if parsing succeeds without error, false if an error occurred. +A message is also printed to the console if an error is encountered. +.It Fn config.loadKernel other_kernel +Attempts to load +.Ev other_kernel +as a kernel. +If +.Ev other_kernel +is unset +.Fn config.loadKernel +will attempt to load +.Dq kernel . +Otherwise, it will try to load +.Dq kernel +first from +.Pa /boot/{other_kernel} , +then from +.Pa {other_kernel} . +.Pp +The latter is tried in case an absolute path has been specified to the kernel +to use. +.Ev module_path +is amended to include the directory the kernel was found in if either of these +paths result in a loaded kernel. +.Pp +If no kernel was loaded from either of these paths, +.Fn config.loadKernel +will attempt to load a kernel named +.Dq {other_kernel} +from +.Ev module_path +instead of attempting to load a kernel named +.Dq kernel . +.Pp +Returns true if a kernel was loaded, false if no kernel was loaded. +.It Fn config.selectKernel kernel +Set +.Ev kernel +to the kernel that will be loaded when either +.Ic autoboot +or +.Ic boot +are invoked. +This is usually called by the menu system as the kernel selector carousel is +toggled through. +.It Fn config.load file reload +Loads +.Ev file +as a configuration file. +If +.Ev file +is not specified, +.Pa /boot/defaults/loader.conf +is used. +.Fn config.load +will then silently attempt to process any files specified in +.Ev loader_conf_files +after +.Ev file +has been processed. +.Xr nextboot 8 +configuration will also be checked as part of +.Fn config.load . +Before returning, all +.Dq config.loaded +hooks will be run if +.Ev reload +is not set to true. +.It Fn config.reload file +Reloads +.Ev file +as a configuration file. +.Fn config.reload +will restore the environment to how it existed before the last config was +loaded, then it will invoke +.Fn config.load file . +Before returning, all +.Dq config.reloaded +hooks will be run. +.It Fn config.loadelf +Loads all ELF objects, the selected kernel as well as any modules configured to +be preloaded in +.Xr loader.conf 5 . +This will be called by the Lua intercepted +.Ic autoboot +and +.Ic boot +commands. +.El +.Ss Defined Hooks +The following hooks are defined in +.Nm : +.Bl -tag -width "config.reloaded" -offset indent +.It config.loaded +.It config.reloaded +.El +.Sh SEE ALSO +.Xr loader.conf 5 , +.Xr loader 8 , +.Xr menu.lua 8 , +.Xr nextboot 8 +.Sh AUTHORS +The +.Nm +file was originally written by +.An Pedro Souza Aq Mt pedrosouza@FreeBSD.org . +Later work and this manual page was done by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . From owner-svn-src-all@freebsd.org Sun Aug 19 15:31:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1B8E106CAD2; Sun, 19 Aug 2018 15:31:45 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 064CB7B96F; Sun, 19 Aug 2018 15:31:44 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w7JFVZ5I070234; Sun, 19 Aug 2018 08:31:35 -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 w7JFVYoT070233; Sun, 19 Aug 2018 08:31:34 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808191531.w7JFVYoT070233@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r338050 - in head: . stand In-Reply-To: <201808191426.w7JEQXXr054123@repo.freebsd.org> To: Kyle Evans Date: Sun, 19 Aug 2018 08:31:34 -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-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 15:31:45 -0000 > Author: kevans > Date: Sun Aug 19 14:26:33 2018 > New Revision: 338050 > URL: https://svnweb.freebsd.org/changeset/base/338050 > > Log: > stand: Flip the default interpreter to Lua > > After years in the making, lualoader is ready to make its debut. Both > flavors of loader are still built by default, and may be installed as > /boot/loader or /boot/loader.efi as appropriate either by manually creating > hard links or using LOADER_DEFAULT_INTERP as documented in build(7). > > Discussed with: imp > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D16795 Kyle, Warner, Did we have a 12.0 release action item for this, I thought there was one but I cant seem to locate it. If not no worries, just wanted to mark off the PR: as done. Thanks, Rod > Modified: > head/UPDATING > head/stand/defs.mk > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Sun Aug 19 14:25:28 2018 (r338049) > +++ head/UPDATING Sun Aug 19 14:26:33 2018 (r338050) > @@ -31,6 +31,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > +20180818: > + The default interpreter has been switched from 4th to Lua. > + LOADER_DEFAULT_INTERP, documented in build(7), will override the default > + interpreter. If you have custom FORTH code you will need to set > + LOADER_DEFAULT_INTERP=4th (valid values are 4th, lua or simp) in > + src.conf for the build. This will create default hard links between > + loader and loader_4th instead of loader and loader_lua, the new default. > + If you are using UEFI it will create the proper hard link to loader.efi. > + > 20180815: > ls(1) now respects the COLORTERM environment variable used in other > systems and software to indicate that a colored terminal is both > > Modified: head/stand/defs.mk > ============================================================================== > --- head/stand/defs.mk Sun Aug 19 14:25:28 2018 (r338049) > +++ head/stand/defs.mk Sun Aug 19 14:26:33 2018 (r338050) > @@ -154,10 +154,10 @@ CFLAGS+= -mlittle-endian > # > # Have a sensible default > # > -.if ${MK_FORTH} == "yes" > -LOADER_DEFAULT_INTERP?=4th > -.elif ${MK_LOADER_LUA} == "yes" > +.if ${MK_LOADER_LUA} == "yes" > LOADER_DEFAULT_INTERP?=lua > +.elif ${MK_FORTH} == "yes" > +LOADER_DEFAULT_INTERP?=4th > .else > LOADER_DEFAULT_INTERP?=simp > .endif > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Aug 19 15:34:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7221B106CC33; Sun, 19 Aug 2018 15:34:00 +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 F19AC7BC04; Sun, 19 Aug 2018 15:33:59 +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 w7JFXwmE070264; Sun, 19 Aug 2018 08:33:58 -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 w7JFXwSP070263; Sun, 19 Aug 2018 08:33:58 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808191533.w7JFXwSP070263@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r338054 - head/stand/lua In-Reply-To: <201808191507.w7JF7dIm074770@repo.freebsd.org> To: Kyle Evans Date: Sun, 19 Aug 2018 08:33:58 -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-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 15:34:00 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: kevans > Date: Sun Aug 19 15:07:39 2018 > New Revision: 338054 > URL: https://svnweb.freebsd.org/changeset/base/338054 > > Log: > Add config.lua(8) to the tree > > Reviewed by: 0mp, rpokala (earlier version) > Differential Revision: https://reviews.freebsd.org/D14819 > > Added: > head/stand/lua/config.lua.8 (contents, props changed) > > Added: head/stand/lua/config.lua.8 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/stand/lua/config.lua.8 Sun Aug 19 15:07:39 2018 (r338054) > @@ -0,0 +1,188 @@ > +.\" > +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD > +.\" > +.\" Copyright (c) 2018 Kyle Evans ^^^ As an FYI you do not need to put that attempt at a Copyright Mark when you spell out the word Copyright. Thanks, Rod ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Aug 19 16:00:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C69C106DD7A; Sun, 19 Aug 2018 16:00:12 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF7D57CBE9; Sun, 19 Aug 2018 16:00:11 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 5AE041A042; Sun, 19 Aug 2018 16:00:11 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f176.google.com with SMTP id u7-v6so9765191lji.3; Sun, 19 Aug 2018 09:00:11 -0700 (PDT) X-Gm-Message-State: AOUpUlHmAUqMOdGtimb0cqcSg4WtPzVCoTGkm5UIUdijwkL6DbMFmPiF 0Ft6sL5+mWHXOYrZBAihuP4sFOVgCpywfwdPVf4= X-Google-Smtp-Source: AA+uWPwU32P9o65NPWTkrZyKuymkvv4/+BGucwHt3V1s+gv8VuxYnU7F/obWE7y/Z6cux4fVHQx8RZ/iRXa+YBkR0o8= X-Received: by 2002:a2e:2e02:: with SMTP id u2-v6mr30452626lju.77.1534694409735; Sun, 19 Aug 2018 09:00:09 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Sun, 19 Aug 2018 08:59:49 -0700 (PDT) In-Reply-To: <201808191533.w7JFXwSP070263@pdx.rh.CN85.dnsmgr.net> References: <201808191507.w7JF7dIm074770@repo.freebsd.org> <201808191533.w7JFXwSP070263@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Sun, 19 Aug 2018 10:59:49 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r338054 - head/stand/lua To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 16:00:12 -0000 On Sun, Aug 19, 2018 at 10:33 AM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: kevans >> Date: Sun Aug 19 15:07:39 2018 >> New Revision: 338054 >> URL: https://svnweb.freebsd.org/changeset/base/338054 >> >> Log: >> Add config.lua(8) to the tree >> >> Reviewed by: 0mp, rpokala (earlier version) >> Differential Revision: https://reviews.freebsd.org/D14819 >> >> Added: >> head/stand/lua/config.lua.8 (contents, props changed) >> >> Added: head/stand/lua/config.lua.8 >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/stand/lua/config.lua.8 Sun Aug 19 15:07:39 2018 (r338054) >> @@ -0,0 +1,188 @@ >> +.\" >> +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD >> +.\" >> +.\" Copyright (c) 2018 Kyle Evans > ^^^ > As an FYI you do not need to put that attempt at a Copyright Mark > when you spell out the word Copyright. > Alright... I might make a pass later when I'm done adding these to remove the redundant (c), but for now I aim to be consistent with the header used. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Sun Aug 19 16:01:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B1FB106DFC8; Sun, 19 Aug 2018 16:01:41 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B30B17CF4B; Sun, 19 Aug 2018 16:01:40 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 61F191A12F; Sun, 19 Aug 2018 16:01:40 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f54.google.com with SMTP id b22-v6so9134841lfa.3; Sun, 19 Aug 2018 09:01:40 -0700 (PDT) X-Gm-Message-State: AOUpUlHif0X33PpjxBW8rBCziMFspD2PEG/5xpSKxt04UmmBBheKLyKt QijyRHg99T/W5G7UWVgjvZhB+bJcPqOXTa4Ho88= X-Google-Smtp-Source: AA+uWPyeAHRGMVtym+tO/vC1vxCWpnq+c+RmIlgwFGS0vLmRuWirJmu8o7rtlqYuh9KPrfEujISUxYqVw126f4fMODo= X-Received: by 2002:a19:ea52:: with SMTP id i79-v6mr2401206lfh.75.1534694499072; Sun, 19 Aug 2018 09:01:39 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Sun, 19 Aug 2018 09:01:18 -0700 (PDT) In-Reply-To: <201808191531.w7JFVYoT070233@pdx.rh.CN85.dnsmgr.net> References: <201808191426.w7JEQXXr054123@repo.freebsd.org> <201808191531.w7JFVYoT070233@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Sun, 19 Aug 2018 11:01:18 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r338050 - in head: . stand To: "Rodney W. Grimes" Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 16:01:41 -0000 On Sun, Aug 19, 2018 at 10:31 AM, Rodney W. Grimes wrote: >> Author: kevans >> Date: Sun Aug 19 14:26:33 2018 >> New Revision: 338050 >> URL: https://svnweb.freebsd.org/changeset/base/338050 >> >> Log: >> stand: Flip the default interpreter to Lua >> >> After years in the making, lualoader is ready to make its debut. Both >> flavors of loader are still built by default, and may be installed as >> /boot/loader or /boot/loader.efi as appropriate either by manually creating >> hard links or using LOADER_DEFAULT_INTERP as documented in build(7). >> >> Discussed with: imp >> Relnotes: yes >> Differential Revision: https://reviews.freebsd.org/D16795 > > Kyle, Warner, > Did we have a 12.0 release action item for this, > I thought there was one but I cant seem to locate it. > If not no worries, just wanted to mark off the PR: as done. > > Thanks, > Rod > I had forgotten about this, but we seem to have https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228924 Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Sun Aug 19 16:15:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9208A106E72F; Sun, 19 Aug 2018 16:15:00 +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 46FE47D8DD; Sun, 19 Aug 2018 16:15:00 +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 27896A17; Sun, 19 Aug 2018 16:15:00 +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 w7JGF0X0010213; Sun, 19 Aug 2018 16:15:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JGExkX010206; Sun, 19 Aug 2018 16:14:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201808191614.w7JGExkX010206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 19 Aug 2018 16:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338055 - in head/sys: i386/include x86/include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: i386/include x86/include X-SVN-Commit-Revision: 338055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 16:15:00 -0000 Author: jhb Date: Sun Aug 19 16:14:59 2018 New Revision: 338055 URL: https://svnweb.freebsd.org/changeset/base/338055 Log: Remove some vestiges of IPI_LAZYPMAP on i386. The support for lazy pmap invalidations on i386 was removed in r281707. This removes the constant for the IPI and stops accounting for it when sizing the interrupt count arrays. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16801 Modified: head/sys/i386/include/intr_machdep.h head/sys/x86/include/apicvar.h Modified: head/sys/i386/include/intr_machdep.h ============================================================================== --- head/sys/i386/include/intr_machdep.h Sun Aug 19 15:07:39 2018 (r338054) +++ head/sys/i386/include/intr_machdep.h Sun Aug 19 16:14:59 2018 (r338055) @@ -75,10 +75,10 @@ * - 1 ??? dummy counter. * - 2 counters for each I/O interrupt. * - 1 counter for each CPU for lapic timer. - * - 9 counters for each CPU for IPI counters for SMP. + * - 8 counters for each CPU for IPI counters for SMP. */ #ifdef SMP -#define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + (1 + 9) * MAXCPU) +#define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + (1 + 8) * MAXCPU) #else #define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + 1) #endif Modified: head/sys/x86/include/apicvar.h ============================================================================== --- head/sys/x86/include/apicvar.h Sun Aug 19 15:07:39 2018 (r338054) +++ head/sys/x86/include/apicvar.h Sun Aug 19 16:14:59 2018 (r338055) @@ -129,12 +129,7 @@ #define IPI_STOP (APIC_IPI_INTS + 6) /* Stop CPU until restarted. */ #define IPI_SUSPEND (APIC_IPI_INTS + 7) /* Suspend CPU until restarted. */ -#ifdef __i386__ -#define IPI_LAZYPMAP (APIC_IPI_INTS + 8) /* Lazy pmap release. */ -#define IPI_DYN_FIRST (APIC_IPI_INTS + 9) -#else #define IPI_DYN_FIRST (APIC_IPI_INTS + 8) -#endif #define IPI_DYN_LAST (253) /* IPIs allocated at runtime */ /* From owner-svn-src-all@freebsd.org Sun Aug 19 16:35:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7D07106F239; Sun, 19 Aug 2018 16:35:58 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com [209.85.214.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 846647E722; Sun, 19 Aug 2018 16:35:58 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f44.google.com with SMTP id h20-v6so17590688itf.2; Sun, 19 Aug 2018 09:35:58 -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:content-transfer-encoding; bh=GDqXvpkDlROCF/MH0K8NVH7U02FZKuvmsWhNsXxPXaM=; b=kvlJJKXMR2IGkGStzLM7TQ2MzgUXsePftBRPQO2CsxKU0aXKnZNvq9Uy5D0xSPnYdN 0tnZxuoeE1VBWyB4tZDCAluBvlgBD9uoyjH6Zx02oEMvukJJANtuFMfSiGdF/F12spEc n+mGqvEHUWxvTh3NUwTcvJ7RERyn7KvzOwc2UdshYGMDOUKS7Pi7AscUkg5A0khI9pDM u9BypbqCWUGy4ueF/rsZ2kxP0mUdQJx4yoEPStCBXkiXgMFDFrfl7jrURygp1YkS85vv hwNegSD44YLqJBeUDWdb29cCaqBjcd1rqkf/moZVqlse0HmeTg4YPGF3SLVWEl3iNUo8 xrDA== X-Gm-Message-State: AOUpUlELOxQSAqgQYf67gIhjRtxHL3bsg/EF+keJH9mpYT0kZKUQDlFL NF73VnJxc7mauSFCKsKQCXIr0Hrt X-Google-Smtp-Source: AA+uWPxkjMFG8LXN+Q62DJSzLRjxOQThH+nF/1wYkJniZ20SnPsO0faUjxW1MBntkRCBJPxg0J26zQ== X-Received: by 2002:a02:7808:: with SMTP id p8-v6mr1736818jac.103.1534696557438; Sun, 19 Aug 2018 09:35:57 -0700 (PDT) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com. [209.85.223.175]) by smtp.gmail.com with ESMTPSA id e135-v6sm4259047ita.28.2018.08.19.09.35.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Aug 2018 09:35:57 -0700 (PDT) Received: by mail-io0-f175.google.com with SMTP id y10-v6so10698485ioa.10; Sun, 19 Aug 2018 09:35:57 -0700 (PDT) X-Received: by 2002:a6b:be46:: with SMTP id o67-v6mr34975471iof.143.1534696557013; Sun, 19 Aug 2018 09:35:57 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:b472:0:0:0:0:0 with HTTP; Sun, 19 Aug 2018 09:35:56 -0700 (PDT) In-Reply-To: <201808191456.w7JEuAZE069780@repo.freebsd.org> References: <201808191456.w7JEuAZE069780@repo.freebsd.org> From: Conrad Meyer Date: Sun, 19 Aug 2018 09:35:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r338053 - head/sys/netinet To: Michael Tuexen Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 16:35:59 -0000 On Sun, Aug 19, 2018 at 7:56 AM, Michael Tuexen wrote: > Author: tuexen > Date: Sun Aug 19 14:56:10 2018 > New Revision: 338053 > URL: https://svnweb.freebsd.org/changeset/base/338053 > > Log: > =E2=80=A6 a keyed hash function taking > the source and destination addresses and port numbers into account. > The keyed hash function is the same a used for the initial TSN. > ... > Modified: head/sys/netinet/tcp_subr.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/netinet/tcp_subr.c Sun Aug 19 14:48:32 2018 (r338052) > +++ head/sys/netinet/tcp_subr.c Sun Aug 19 14:56:10 2018 (r338053) > @@ -233,6 +233,9 @@ VNET_DEFINE(uma_zone_t, sack_hole_zone); > ... > > +static uint32_t > +tcp_keyed_hash(struct in_conninfo *inc, u_char *key) > +{ > + MD5_CTX ctx; > + uint32_t hash[4]; > > + MD5Init(&ctx); > + MD5Update(&ctx, &inc->inc_fport, sizeof(uint16_t)); > + MD5Update(&ctx, &inc->inc_lport, sizeof(uint16_t)); > + switch (inc->inc_flags & INC_ISIPV6) { > +#ifdef INET > + case 0: > + MD5Update(&ctx, &inc->inc_faddr, sizeof(struct in_addr)); > + MD5Update(&ctx, &inc->inc_laddr, sizeof(struct in_addr)); > + break; > +#endif > +#ifdef INET6 > + case INC_ISIPV6: > + MD5Update(&ctx, &inc->inc6_faddr, sizeof(struct in6_addr)= ); > + MD5Update(&ctx, &inc->inc6_laddr, sizeof(struct in6_addr)= ); > + break; > +#endif > + } > + MD5Update(&ctx, key, 32); > + MD5Final((unsigned char *)hash, &ctx); > + > + return (hash[0]); Hi Michael, How was this particular keyed hash function construction chosen? (Yes, I see it is the same initial TSN, but how was that selected?) Thanks, Conrad From owner-svn-src-all@freebsd.org Sun Aug 19 16:56:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1856106FDC0; Sun, 19 Aug 2018 16:56:43 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 8C5E57FA99; Sun, 19 Aug 2018 16:56:43 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A5D910A6; Sun, 19 Aug 2018 16:56:43 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JGuhFX031147; Sun, 19 Aug 2018 16:56:43 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JGuhCQ031146; Sun, 19 Aug 2018 16:56:43 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201808191656.w7JGuhCQ031146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 19 Aug 2018 16:56:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338056 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 338056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 16:56:44 -0000 Author: mckusick Date: Sun Aug 19 16:56:42 2018 New Revision: 338056 URL: https://svnweb.freebsd.org/changeset/base/338056 Log: Add consolodation of TRIM / BIO_DELETE commands to the UFS/FFS filesystem. When deleting files on filesystems that are stored on flash-memory (solid-state) disk drives, the filesystem notifies the underlying disk of the blocks that it is no longer using. The notification allows the drive to avoid saving these blocks when it needs to flash (zero out) one of its flash pages. These notifications of no-longer-being-used blocks are referred to as TRIM notifications. In FreeBSD these TRIM notifications are sent from the filesystem to the drive using the BIO_DELETE command. Until now, the filesystem would send a separate message to the drive for each block of the file that was deleted. Each Gigabyte of file size resulted in over 3000 TRIM messages being sent to the drive. This burst of messages can overwhelm the drive's task queue causing multiple second delays for read and write requests. This implementation collects runs of contiguous blocks in the file and then consolodates them into a single BIO_DELETE command to the drive. The BIO_DELETE command describes the run of blocks as a single large block being deleted. Each Gigabyte of file size can result in as few as two BIO_DELETE commands and is typically less than ten. Though these larger BIO_DELETE commands take longer to run, they do not clog the drive task queue, so read and write commands can intersperse effectively with them. Though this new feature has been throughly reviewed and tested, it is being added disabled by default so as to minimize the possibility of disrupting the upcoming 12.0 release. It can be enabled by running ``sysctl vfs.ffs.dotrimcons=1''. Users are encouraged to test it. If no problems arise, we will consider requesting that it be enabled by default for 12.0. Reviewed by: kib Tested by: Peter Holm Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sun Aug 19 16:14:59 2018 (r338055) +++ head/sys/ufs/ffs/ffs_alloc.c Sun Aug 19 16:56:42 2018 (r338056) @@ -484,6 +484,10 @@ static int doreallocblks = 1; SYSCTL_INT(_vfs_ffs, OID_AUTO, doreallocblks, CTLFLAG_RW, &doreallocblks, 0, "enable block reallocation"); +static int dotrimcons = 1; +SYSCTL_INT(_vfs_ffs, OID_AUTO, dotrimcons, CTLFLAG_RW, &dotrimcons, 0, +"enable BIO_DELETE / TRIM consolodation"); + static int maxclustersearch = 10; SYSCTL_INT(_vfs_ffs, OID_AUTO, maxclustersearch, CTLFLAG_RW, &maxclustersearch, 0, "max number of cylinder group to search for contigous blocks"); @@ -2301,51 +2305,193 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd) /* * Structures and routines associated with trim management. + * + * The following requests are passed to trim_lookup to indicate + * the actions that should be taken. */ +#define NEW 1 /* if found, error else allocate and hash it */ +#define OLD 2 /* if not found, error, else return it */ +#define REPLACE 3 /* if not found, error else unhash and reallocate it */ +#define DONE 4 /* if not found, error else unhash and return it */ +#define SINGLE 5 /* don't look up, just allocate it and don't hash it */ + MALLOC_DEFINE(M_TRIM, "ufs_trim", "UFS trim structures"); #define TRIMLIST_HASH(ump, key) \ (&(ump)->um_trimhash[(key) & (ump)->um_trimlisthashsize]) -static void ffs_blkfree_trim_completed(struct buf *); -static void ffs_blkfree_trim_task(void *ctx, int pending __unused); +/* + * These structures describe each of the block free requests aggregated + * together to make up a trim request. + */ +struct trim_blkreq { + TAILQ_ENTRY(trim_blkreq) blkreqlist; + ufs2_daddr_t bno; + long size; + struct workhead *pdephd; + struct workhead dephd; +}; +/* + * Description of a trim request. + */ struct ffs_blkfree_trim_params { + TAILQ_HEAD(, trim_blkreq) blklist; + LIST_ENTRY(ffs_blkfree_trim_params) hashlist; struct task task; struct ufsmount *ump; struct vnode *devvp; + ino_t inum; ufs2_daddr_t bno; long size; - ino_t inum; - struct workhead *pdephd; - struct workhead dephd; + long key; }; +static void ffs_blkfree_trim_completed(struct buf *); +static void ffs_blkfree_trim_task(void *ctx, int pending __unused); +static struct ffs_blkfree_trim_params *trim_lookup(struct ufsmount *, + struct vnode *, ufs2_daddr_t, long, ino_t, u_long, int); +static void ffs_blkfree_sendtrim(struct ffs_blkfree_trim_params *); + +/* + * Called on trim completion to start a task to free the associated block(s). + */ static void +ffs_blkfree_trim_completed(bp) + struct buf *bp; +{ + struct ffs_blkfree_trim_params *tp; + + tp = bp->b_fsprivate1; + free(bp, M_TRIM); + TASK_INIT(&tp->task, 0, ffs_blkfree_trim_task, tp); + taskqueue_enqueue(tp->ump->um_trim_tq, &tp->task); +} + +/* + * Trim completion task that free associated block(s). + */ +static void ffs_blkfree_trim_task(ctx, pending) void *ctx; int pending; { struct ffs_blkfree_trim_params *tp; + struct trim_blkreq *blkelm; + struct ufsmount *ump; tp = ctx; - ffs_blkfree_cg(tp->ump, tp->ump->um_fs, tp->devvp, tp->bno, tp->size, - tp->inum, tp->pdephd); - vn_finished_secondary_write(UFSTOVFS(tp->ump)); - atomic_add_int(&tp->ump->um_trim_inflight, -1); + ump = tp->ump; + while ((blkelm = TAILQ_FIRST(&tp->blklist)) != NULL) { + ffs_blkfree_cg(ump, ump->um_fs, tp->devvp, blkelm->bno, + blkelm->size, tp->inum, blkelm->pdephd); + TAILQ_REMOVE(&tp->blklist, blkelm, blkreqlist); + free(blkelm, M_TRIM); + } + vn_finished_secondary_write(UFSTOVFS(ump)); + UFS_LOCK(ump); + ump->um_trim_inflight -= 1; + ump->um_trim_inflight_blks -= numfrags(ump->um_fs, tp->size); + UFS_UNLOCK(ump); free(tp, M_TRIM); } -static void -ffs_blkfree_trim_completed(bp) - struct buf *bp; +/* + * Lookup a trim request by inode number. + * Allocate if requested (NEW, REPLACE, SINGLE). + */ +static struct ffs_blkfree_trim_params * +trim_lookup(ump, devvp, bno, size, inum, key, alloctype) + struct ufsmount *ump; + struct vnode *devvp; + ufs2_daddr_t bno; + long size; + ino_t inum; + u_long key; + int alloctype; { + struct trimlist_hashhead *tphashhead; + struct ffs_blkfree_trim_params *tp, *ntp; + + ntp = malloc(sizeof(struct ffs_blkfree_trim_params), M_TRIM, M_WAITOK); + if (alloctype != SINGLE) { + KASSERT(key >= FIRST_VALID_KEY, ("trim_lookup: invalid key")); + UFS_LOCK(ump); + tphashhead = TRIMLIST_HASH(ump, key); + LIST_FOREACH(tp, tphashhead, hashlist) + if (key == tp->key) + break; + } + switch (alloctype) { + case NEW: + KASSERT(tp == NULL, ("trim_lookup: found trim")); + break; + case OLD: + KASSERT(tp != NULL, + ("trim_lookup: missing call to ffs_blkrelease_start()")); + UFS_UNLOCK(ump); + free(ntp, M_TRIM); + return (tp); + case REPLACE: + KASSERT(tp != NULL, ("trim_lookup: missing REPLACE trim")); + LIST_REMOVE(tp, hashlist); + /* tp will be freed by caller */ + break; + case DONE: + KASSERT(tp != NULL, ("trim_lookup: missing DONE trim")); + LIST_REMOVE(tp, hashlist); + UFS_UNLOCK(ump); + free(ntp, M_TRIM); + return (tp); + } + TAILQ_INIT(&ntp->blklist); + ntp->ump = ump; + ntp->devvp = devvp; + ntp->bno = bno; + ntp->size = size; + ntp->inum = inum; + ntp->key = key; + if (alloctype != SINGLE) { + LIST_INSERT_HEAD(tphashhead, ntp, hashlist); + UFS_UNLOCK(ump); + } + return (ntp); +} + +/* + * Dispatch a trim request. + */ +static void +ffs_blkfree_sendtrim(tp) struct ffs_blkfree_trim_params *tp; +{ + struct ufsmount *ump; + struct mount *mp; + struct buf *bp; - tp = bp->b_fsprivate1; - free(bp, M_TRIM); - TASK_INIT(&tp->task, 0, ffs_blkfree_trim_task, tp); - taskqueue_enqueue(tp->ump->um_trim_tq, &tp->task); + /* + * Postpone the set of the free bit in the cg bitmap until the + * BIO_DELETE is completed. Otherwise, due to disk queue + * reordering, TRIM might be issued after we reuse the block + * and write some new data into it. + */ + ump = tp->ump; + bp = malloc(sizeof(*bp), M_TRIM, M_WAITOK | M_ZERO); + bp->b_iocmd = BIO_DELETE; + bp->b_iooffset = dbtob(fsbtodb(ump->um_fs, tp->bno)); + bp->b_iodone = ffs_blkfree_trim_completed; + bp->b_bcount = tp->size; + bp->b_fsprivate1 = tp; + UFS_LOCK(ump); + ump->um_trim_total += 1; + ump->um_trim_inflight += 1; + ump->um_trim_inflight_blks += numfrags(ump->um_fs, tp->size); + ump->um_trim_total_blks += numfrags(ump->um_fs, tp->size); + UFS_UNLOCK(ump); + + mp = UFSTOVFS(ump); + vn_start_secondary_write(NULL, &mp, 0); + g_vfs_strategy(ump->um_bo, bp); } /* @@ -2360,11 +2506,12 @@ ffs_blkrelease_start(ump, devvp, inum) static u_long masterkey; u_long key; - if ((ump->um_flags & UM_CANDELETE) == 0) + if (((ump->um_flags & UM_CANDELETE) == 0) || dotrimcons == 0) return (SINGLETON_KEY); do { key = atomic_fetchadd_long(&masterkey, 1); } while (key < FIRST_VALID_KEY); + (void) trim_lookup(ump, devvp, 0, 0, inum, key, NEW); return (key); } @@ -2376,10 +2523,32 @@ ffs_blkrelease_finish(ump, key) struct ufsmount *ump; u_long key; { + struct ffs_blkfree_trim_params *tp; - return; + if (((ump->um_flags & UM_CANDELETE) == 0) || dotrimcons == 0) + return; + /* + * We are done with sending blocks using this key. Look up the key + * using the DONE alloctype (in tp) to request that it be unhashed + * as we will not be adding to it. If the key has never been used, + * tp->size will be zero, so we can just free tp. Otherwise the call + * to ffs_blkfree_sendtrim(tp) causes the block range described by + * tp to be issued (and then tp to be freed). + */ + tp = trim_lookup(ump, NULL, 0, 0, 0, key, DONE); + if (tp->size == 0) + free(tp, M_TRIM); + else + ffs_blkfree_sendtrim(tp); } +/* + * Setup to free a block or fragment. + * + * Check for snapshots that might want to claim the block. + * If trims are requested, prepare a trim request. Attempt to + * aggregate consecutive blocks into a single trim request. + */ void ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, dephd, key) struct ufsmount *ump; @@ -2392,9 +2561,8 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de struct workhead *dephd; u_long key; { - struct mount *mp; - struct buf *bp; - struct ffs_blkfree_trim_params *tp; + struct ffs_blkfree_trim_params *tp, *ntp; + struct trim_blkreq *blkelm; /* * Check to see if a snapshot wants to claim the block. @@ -2416,37 +2584,72 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd); return; } - + blkelm = malloc(sizeof(struct trim_blkreq), M_TRIM, M_WAITOK); + blkelm->bno = bno; + blkelm->size = size; + if (dephd == NULL) { + blkelm->pdephd = NULL; + } else { + LIST_INIT(&blkelm->dephd); + LIST_SWAP(dephd, &blkelm->dephd, worklist, wk_list); + blkelm->pdephd = &blkelm->dephd; + } + if (key == SINGLETON_KEY) { + /* + * Just a single non-contiguous piece. Use the SINGLE + * alloctype to return a trim request that will not be + * hashed for future lookup. + */ + tp = trim_lookup(ump, devvp, bno, size, inum, key, SINGLE); + TAILQ_INSERT_HEAD(&tp->blklist, blkelm, blkreqlist); + ffs_blkfree_sendtrim(tp); + return; + } /* - * Postpone the set of the free bit in the cg bitmap until the - * BIO_DELETE is completed. Otherwise, due to disk queue - * reordering, TRIM might be issued after we reuse the block - * and write some new data into it. + * The callers of this function are not tracking whether or not + * the blocks are contiguous. They are just saying that they + * are freeing a set of blocks. It is this code that determines + * the pieces of that range that are actually contiguous. + * + * Calling ffs_blkrelease_start() will have created an entry + * that we will use. */ - atomic_add_int(&ump->um_trim_inflight, 1); - tp = malloc(sizeof(struct ffs_blkfree_trim_params), M_TRIM, M_WAITOK); - tp->ump = ump; - tp->devvp = devvp; - tp->bno = bno; - tp->size = size; - tp->inum = inum; - if (dephd != NULL) { - LIST_INIT(&tp->dephd); - LIST_SWAP(dephd, &tp->dephd, worklist, wk_list); - tp->pdephd = &tp->dephd; - } else - tp->pdephd = NULL; - - bp = malloc(sizeof(*bp), M_TRIM, M_WAITOK | M_ZERO); - bp->b_iocmd = BIO_DELETE; - bp->b_iooffset = dbtob(fsbtodb(fs, bno)); - bp->b_iodone = ffs_blkfree_trim_completed; - bp->b_bcount = size; - bp->b_fsprivate1 = tp; - - mp = UFSTOVFS(ump); - vn_start_secondary_write(NULL, &mp, 0); - g_vfs_strategy(ump->um_bo, bp); + tp = trim_lookup(ump, devvp, bno, size, inum, key, OLD); + if (tp->size == 0) { + /* + * First block of a potential range, set block and size + * for the trim block. + */ + tp->bno = bno; + tp->size = size; + TAILQ_INSERT_HEAD(&tp->blklist, blkelm, blkreqlist); + return; + } + /* + * If this block is a continuation of the range (either + * follows at the end or preceeds in the front) then we + * add it to the front or back of the list and return. + * + * If it is not a continuation of the trim that we were + * building, using the REPLACE alloctype, we request that + * the old trim request (still in tp) be unhashed and a + * new range started (in ntp). The ffs_blkfree_sendtrim(tp) + * call causes the block range described by tp to be issued + * (and then tp to be freed). + */ + if (bno + numfrags(fs, size) == tp->bno) { + TAILQ_INSERT_HEAD(&tp->blklist, blkelm, blkreqlist); + tp->bno = bno; + tp->size += size; + return; + } else if (bno == tp->bno + numfrags(fs, tp->size)) { + TAILQ_INSERT_TAIL(&tp->blklist, blkelm, blkreqlist); + tp->size += size; + return; + } + ntp = trim_lookup(ump, devvp, bno, size, inum, key, REPLACE); + TAILQ_INSERT_HEAD(&ntp->blklist, blkelm, blkreqlist); + ffs_blkfree_sendtrim(tp); } #ifdef INVARIANTS From owner-svn-src-all@freebsd.org Sun Aug 19 17:08:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FD061070B57; Sun, 19 Aug 2018 17:08:30 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67CAD807BC; Sun, 19 Aug 2018 17:08:29 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [192.168.1.6] (p57BB437A.dip0.t-ipconnect.de [87.187.67.122]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 180D0721E281A; Sun, 19 Aug 2018 19:08:25 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r338053 - head/sys/netinet From: Michael Tuexen In-Reply-To: Date: Sun, 19 Aug 2018 19:08:23 +0200 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <97661C9D-9C25-4DE0-89A8-FE1C40DAFB81@freebsd.org> References: <201808191456.w7JEuAZE069780@repo.freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3445.9.1) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 17:08:30 -0000 > On 19. Aug 2018, at 18:35, Conrad Meyer wrote: >=20 > On Sun, Aug 19, 2018 at 7:56 AM, Michael Tuexen = wrote: >> Author: tuexen >> Date: Sun Aug 19 14:56:10 2018 >> New Revision: 338053 >> URL: https://svnweb.freebsd.org/changeset/base/338053 >>=20 >> Log: >> =E2=80=A6 a keyed hash function taking >> the source and destination addresses and port numbers into account. >> The keyed hash function is the same a used for the initial TSN. >> ... >> Modified: head/sys/netinet/tcp_subr.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/netinet/tcp_subr.c Sun Aug 19 14:48:32 2018 = (r338052) >> +++ head/sys/netinet/tcp_subr.c Sun Aug 19 14:56:10 2018 = (r338053) >> @@ -233,6 +233,9 @@ VNET_DEFINE(uma_zone_t, sack_hole_zone); >> ... >>=20 >> +static uint32_t >> +tcp_keyed_hash(struct in_conninfo *inc, u_char *key) >> +{ >> + MD5_CTX ctx; >> + uint32_t hash[4]; >>=20 >> + MD5Init(&ctx); >> + MD5Update(&ctx, &inc->inc_fport, sizeof(uint16_t)); >> + MD5Update(&ctx, &inc->inc_lport, sizeof(uint16_t)); >> + switch (inc->inc_flags & INC_ISIPV6) { >> +#ifdef INET >> + case 0: >> + MD5Update(&ctx, &inc->inc_faddr, sizeof(struct = in_addr)); >> + MD5Update(&ctx, &inc->inc_laddr, sizeof(struct = in_addr)); >> + break; >> +#endif >> +#ifdef INET6 >> + case INC_ISIPV6: >> + MD5Update(&ctx, &inc->inc6_faddr, sizeof(struct = in6_addr)); >> + MD5Update(&ctx, &inc->inc6_laddr, sizeof(struct = in6_addr)); >> + break; >> +#endif >> + } >> + MD5Update(&ctx, key, 32); >> + MD5Final((unsigned char *)hash, &ctx); >> + >> + return (hash[0]); >=20 > Hi Michael, >=20 > How was this particular keyed hash function construction chosen? > (Yes, I see it is the same initial TSN, but how was that selected?) You mean: Why is FreeBSD using the MD5 with secret suffix as the keyed hash = function? I don't know, I have not implemented that. However, https://tools.ietf.org/html/rfc6528#section-3 suggests this, OpenBSD uses a similar computation, but uses SHA512 instead of MD5, = NetBSD seem to use the same computation as FreeBSD. I guess using MD5 was an acceptable choice at the time the choice was = made. When preparing this patch I was about to choose a different keyed hash = function, but decided to separate * Using a keyed has functions as the offset for the TCP time stamp. * Choose a good keyed hash function. That is why I isolated the keyed hash function. So it is simple to = replace it with a different one. I think it would be good to change this keyed hash function to SIP-HASH = (both for the initial sequence number and the time stamp). Opinions? Best regards Michael >=20 > Thanks, > Conrad From owner-svn-src-all@freebsd.org Sun Aug 19 17:19:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A4E0107127D; Sun, 19 Aug 2018 17:19:21 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 B267081048; Sun, 19 Aug 2018 17:19:20 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72BE51442; Sun, 19 Aug 2018 17:19:20 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JHJKRI041994; Sun, 19 Aug 2018 17:19:20 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JHJKaN041993; Sun, 19 Aug 2018 17:19:20 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201808191719.w7JHJKaN041993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 19 Aug 2018 17:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338057 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 338057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 17:19:21 -0000 Author: mckusick Date: Sun Aug 19 17:19:20 2018 New Revision: 338057 URL: https://svnweb.freebsd.org/changeset/base/338057 Log: For traditional disks, the filesystem attempts to allocate the blocks of a file as contiguously as possible. Since the filesystem does not know how large a file will grow when it is first being written, it initially places the file in a set of blocks in which it currently fits. As it grows, it is relocated to areas with larger contiguous blocks. In this way it saves its large contiguous sets of blocks for the files that need them and thus avoids unnecessaily fragmenting its disk space. We used to skip reallocating the blocks of a file into a contiguous sequence if the underlying flash device requested BIO_DELETE notifications, because devices that benefit from BIO_DELETE also benefit from not moving the data. However, in the algorithm described above that reallocates the blocks, the destination for the data is usually moved before the data is written to the initially allocated location. So we rarely suffer the penalty of extra writes. With the addition of the consolodation of contiguous blocks into single BIO_DELETE operations, having fewer but larger contiguous blocks reduces the number of (slow and expensive) BIO_DELETE operations. So when doing BIO_DELETE consolodation, we do block reallocation. Reviewed by: kib Tested by: Peter Holm Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sun Aug 19 16:56:42 2018 (r338056) +++ head/sys/ufs/ffs/ffs_alloc.c Sun Aug 19 17:19:20 2018 (r338057) @@ -506,14 +506,23 @@ ffs_reallocblks(ap) struct ufsmount *ump; /* - * If the underlying device can do deletes, then skip reallocating - * the blocks of this file into contiguous sequences. Devices that - * benefit from BIO_DELETE also benefit from not moving the data. - * These devices are flash and therefore work less well with this - * optimization. Also skip if reallocblks has been disabled globally. + * We used to skip reallocating the blocks of a file into a + * contiguous sequence if the underlying flash device requested + * BIO_DELETE notifications, because devices that benefit from + * BIO_DELETE also benefit from not moving the data. However, + * the destination for the data is usually moved before the data + * is written to the initially allocated location, so we rarely + * suffer the penalty of extra writes. With the addition of the + * consolodation of contiguous blocks into single BIO_DELETE + * operations, having fewer but larger contiguous blocks reduces + * the number of (slow and expensive) BIO_DELETE operations. So + * when doing BIO_DELETE consolodation, we do block reallocation. + * + * Skip if reallocblks has been disabled globally. */ ump = ap->a_vp->v_mount->mnt_data; - if (((ump->um_flags) & UM_CANDELETE) != 0 || doreallocblks == 0) + if ((((ump->um_flags) & UM_CANDELETE) != 0 && dotrimcons == 0) || + doreallocblks == 0) return (ENOSPC); /* From owner-svn-src-all@freebsd.org Sun Aug 19 17:36:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71EB71071904; Sun, 19 Aug 2018 17:36:51 +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 28AE681A2F; Sun, 19 Aug 2018 17:36:51 +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 E5B3D178B; Sun, 19 Aug 2018 17:36:50 +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 w7JHaomv052023; Sun, 19 Aug 2018 17:36:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JHaoKf052022; Sun, 19 Aug 2018 17:36:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201808191736.w7JHaoKf052022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 19 Aug 2018 17:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338058 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 338058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 17:36:51 -0000 Author: jhb Date: Sun Aug 19 17:36:50 2018 New Revision: 338058 URL: https://svnweb.freebsd.org/changeset/base/338058 Log: Fix the MPTable probe code after the 4:4 changes on i386. The MPTable probe code was using PMAP_MAP_LOW as the PA -> VA offset when searching for the table signature but still using KERNBASE once it had found the table. As a result, the mpfps table pointed into a random part of the kernel text instead of the actual MP Table. Rather than adding more #ifdef's, use BIOS_PADDRTOVADDR from which already uses PMAP_MAP_LOW on i386 and KERNBASE on amd64. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D16802 Modified: head/sys/x86/x86/mptable.c Modified: head/sys/x86/x86/mptable.c ============================================================================== --- head/sys/x86/x86/mptable.c Sun Aug 19 17:19:20 2018 (r338057) +++ head/sys/x86/x86/mptable.c Sun Aug 19 17:36:50 2018 (r338058) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef NEW_PCIB #include #endif @@ -223,11 +224,7 @@ search_for_sig(u_int32_t target, int count) int x; u_int32_t *addr; -#ifdef __amd64__ - addr = (u_int32_t *) (KERNBASE + target); -#else /* __i386__ */ - addr = (u_int32_t *) (PMAP_MAP_LOW + target); -#endif + addr = (u_int32_t *)BIOS_PADDRTOVADDR(target); for (x = 0; x < count; x += 4) if (addr[x] == MP_SIG) /* make array index a byte index */ @@ -258,13 +255,7 @@ mptable_probe(void) u_int32_t target; /* see if EBDA exists */ - if ((segment = (u_long) * (u_short *) ( -#ifdef __amd64__ - KERNBASE -#else /* __i386__ */ - PMAP_MAP_LOW -#endif - + 0x40e)) != 0) { + if ((segment = *(u_short *)BIOS_PADDRTOVADDR(0x40e)) != 0) { /* search first 1K of EBDA */ target = (u_int32_t) (segment << 4); if ((x = search_for_sig(target, 1024 / 4)) >= 0) @@ -285,7 +276,7 @@ mptable_probe(void) return (ENXIO); found: - mpfps = (mpfps_t)(KERNBASE + x); + mpfps = (mpfps_t)BIOS_PADDRTOVADDR(x); /* Map in the configuration table if it exists. */ if (mpfps->config_type != 0) { @@ -306,7 +297,7 @@ found: __func__); return (ENXIO); } - mpct = (mpcth_t)(KERNBASE + (uintptr_t)mpfps->pap); + mpct = (mpcth_t)BIOS_PADDRTOVADDR((uintptr_t)mpfps->pap); if (mpct->base_table_length + (uintptr_t)mpfps->pap >= 1024 * 1024) { printf("%s: Unable to map end of MP Config Table\n", From owner-svn-src-all@freebsd.org Sun Aug 19 17:40:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 499F51071CAF; Sun, 19 Aug 2018 17:40:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 EF09781CD6; Sun, 19 Aug 2018 17:40:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFFA017A8; Sun, 19 Aug 2018 17:40:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JHerck052275; Sun, 19 Aug 2018 17:40:53 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JHeoSj052259; Sun, 19 Aug 2018 17:40:50 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808191740.w7JHeoSj052259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 19 Aug 2018 17:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338059 - in head: . contrib/ntp/lib/isc contrib/ntp/sntp/libevent crypto/heimdal/lib/roken crypto/openssh include lib/libc/gen lib/libc/include sys/crypto/chacha20 X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: . contrib/ntp/lib/isc contrib/ntp/sntp/libevent crypto/heimdal/lib/roken crypto/openssh include lib/libc/gen lib/libc/include sys/crypto/chacha20 X-SVN-Commit-Revision: 338059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 17:40:54 -0000 Author: delphij Date: Sun Aug 19 17:40:50 2018 New Revision: 338059 URL: https://svnweb.freebsd.org/changeset/base/338059 Log: Update userland arc4random() with OpenBSD's Chacha20 based arc4random(). ObsoleteFiles.inc: Remove manual pages for arc4random_addrandom(3) and arc4random_stir(3). contrib/ntp/lib/isc/random.c: contrib/ntp/sntp/libevent/evutil_rand.c: Eliminate in-tree usage of arc4random_addrandom(). crypto/heimdal/lib/roken/rand.c: crypto/openssh/config.h: Eliminate in-tree usage of arc4random_stir(). include/stdlib.h: Remove arc4random_stir() and arc4random_addrandom() prototypes, provide temporary shims for transistion period. lib/libc/gen/Makefile.inc: Hook arc4random-compat.c to build, add hint for Chacha20 source for kernel, and remove arc4random_addrandom(3) and arc4random_stir(3) links. lib/libc/gen/arc4random.c: Adopt OpenBSD arc4random.c,v 1.54 with bare minimum changes, use the sys/crypto/chacha20 implementation of keystream. lib/libc/gen/Symbol.map: Remove arc4random_stir and arc4random_addrandom interfaces. lib/libc/gen/arc4random.h: Adopt OpenBSD arc4random.h,v 1.4 but provide _ARC4_LOCK of our own. lib/libc/gen/arc4random.3: Adopt OpenBSD arc4random.3,v 1.35 but keep FreeBSD r114444 and r118247. lib/libc/gen/arc4random-compat.c: Compatibility shims for arc4random_stir and arc4random_addrandom functions to preserve ABI. Log once when called but do nothing otherwise. lib/libc/gen/getentropy.c: lib/libc/include/libc_private.h: Fold __arc4_sysctl into getentropy.c (renamed to arnd_sysctl). Remove from libc_private.h as a result. sys/crypto/chacha20/chacha.c: sys/crypto/chacha20/chacha.h: Make it possible to use the kernel implementation in libc. PR: 182610 Reviewed by: cem, markm Obtained from: OpenBSD Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16760 Added: head/lib/libc/gen/arc4random-compat.c (contents, props changed) head/lib/libc/gen/arc4random.h (contents, props changed) Modified: head/ObsoleteFiles.inc head/contrib/ntp/lib/isc/random.c head/contrib/ntp/sntp/libevent/evutil_rand.c head/crypto/heimdal/lib/roken/rand.c head/crypto/openssh/config.h head/include/stdlib.h head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libc/gen/arc4random.3 head/lib/libc/gen/arc4random.c (contents, props changed) head/lib/libc/gen/getentropy.c head/lib/libc/include/libc_private.h head/sys/crypto/chacha20/chacha.c head/sys/crypto/chacha20/chacha.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Aug 19 17:36:50 2018 (r338058) +++ head/ObsoleteFiles.inc Sun Aug 19 17:40:50 2018 (r338059) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20180819: Remove deprecated arc4random(3) stir/addrandom interfaces +OLD_FILES+=usr/share/man/man3/arc4random_addrandom.3.gz +OLD_FILES+=usr/share/man/man3/arc4random_stir.3.gz # 20180819: send-pr(1) placeholder removal OLD_FILES+=usr/bin/send-pr # 20180725: Cleanup old libcasper.so.0 Modified: head/contrib/ntp/lib/isc/random.c ============================================================================== --- head/contrib/ntp/lib/isc/random.c Sun Aug 19 17:36:50 2018 (r338058) +++ head/contrib/ntp/lib/isc/random.c Sun Aug 19 17:40:50 2018 (r338059) @@ -67,8 +67,6 @@ isc_random_seed(isc_uint32_t seed) #ifndef HAVE_ARC4RANDOM srand(seed); -#else - arc4random_addrandom((u_char *) &seed, sizeof(isc_uint32_t)); #endif } Modified: head/contrib/ntp/sntp/libevent/evutil_rand.c ============================================================================== --- head/contrib/ntp/sntp/libevent/evutil_rand.c Sun Aug 19 17:36:50 2018 (r338058) +++ head/contrib/ntp/sntp/libevent/evutil_rand.c Sun Aug 19 17:40:50 2018 (r338059) @@ -195,8 +195,6 @@ evutil_secure_rng_get_bytes(void *buf, size_t n) void evutil_secure_rng_add_bytes(const char *buf, size_t n) { - arc4random_addrandom((unsigned char*)buf, - n>(size_t)INT_MAX ? INT_MAX : (int)n); } void Modified: head/crypto/heimdal/lib/roken/rand.c ============================================================================== --- head/crypto/heimdal/lib/roken/rand.c Sun Aug 19 17:36:50 2018 (r338058) +++ head/crypto/heimdal/lib/roken/rand.c Sun Aug 19 17:40:50 2018 (r338059) @@ -37,7 +37,6 @@ void ROKEN_LIB_FUNCTION rk_random_init(void) { #if defined(HAVE_ARC4RANDOM) - arc4random_stir(); #elif defined(HAVE_SRANDOMDEV) srandomdev(); #elif defined(HAVE_RANDOM) Modified: head/crypto/openssh/config.h ============================================================================== --- head/crypto/openssh/config.h Sun Aug 19 17:36:50 2018 (r338058) +++ head/crypto/openssh/config.h Sun Aug 19 17:40:50 2018 (r338059) @@ -191,7 +191,7 @@ #define HAVE_ARC4RANDOM_BUF 1 /* Define to 1 if you have the `arc4random_stir' function. */ -#define HAVE_ARC4RANDOM_STIR 1 +/* #undef HAVE_ARC4RANDOM_STIR */ /* Define to 1 if you have the `arc4random_uniform' function. */ #define HAVE_ARC4RANDOM_UNIFORM 1 Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Sun Aug 19 17:36:50 2018 (r338058) +++ head/include/stdlib.h Sun Aug 19 17:40:50 2018 (r338059) @@ -250,11 +250,16 @@ extern void (*malloc_message)(void *, const char *); void abort2(const char *, int, void **) __dead2; __uint32_t arc4random(void); -void arc4random_addrandom(unsigned char *, int); void arc4random_buf(void *, size_t); -void arc4random_stir(void); __uint32_t arc4random_uniform(__uint32_t); + +#if !defined(BURN_BRIDGES) +/* Deprecated arc4random() functions */ +#define arc4random_stir() +#define arc4random_addrandom(a,b) +#endif + #ifdef __BLOCKS__ int atexit_b(void (^ _Nonnull)(void)); void *bsearch_b(const void *, const void *, size_t, Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Sun Aug 19 17:36:50 2018 (r338058) +++ head/lib/libc/gen/Makefile.inc Sun Aug 19 17:40:50 2018 (r338059) @@ -16,6 +16,7 @@ SRCS+= __getosreldate.c \ _thread_init.c \ alarm.c \ arc4random.c \ + arc4random-compat.c \ arc4random_uniform.c \ assert.c \ auxv.c \ @@ -166,6 +167,8 @@ SRCS+= devname-compat11.c \ unvis-compat.c .endif +CFLAGS.arc4random.c= -I${SRCTOP}/sys -I${SRCTOP}/sys/crypto/chacha20 + .PATH: ${SRCTOP}/contrib/libc-pwcache SRCS+= pwcache.c pwcache.h @@ -316,9 +319,7 @@ MAN+= alarm.3 \ vis.3 \ wordexp.3 -MLINKS+=arc4random.3 arc4random_addrandom.3 \ - arc4random.3 arc4random_stir.3 \ - arc4random.3 arc4random_buf.3 \ +MLINKS+=arc4random.3 arc4random_buf.3 \ arc4random.3 arc4random_uniform.3 MLINKS+=ctermid.3 ctermid_r.3 MLINKS+=devname.3 devname_r.3 Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Sun Aug 19 17:36:50 2018 (r338058) +++ head/lib/libc/gen/Symbol.map Sun Aug 19 17:40:50 2018 (r338059) @@ -65,8 +65,6 @@ FBSD_1.0 { pthread_testcancel; alarm; arc4random; - arc4random_addrandom; - arc4random_stir; __assert; check_utility_compat; clock; Added: head/lib/libc/gen/arc4random-compat.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/arc4random-compat.c Sun Aug 19 17:40:50 2018 (r338059) @@ -0,0 +1,72 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Google LLC + * 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +/* + * The following functions were removed from OpenBSD for good reasons: + * + * - arc4random_stir() + * - arc4random_addrandom() + * + * On FreeBSD, for backward ABI compatibility, we provide two wrapper which + * logs this event and returns. + */ + +void __arc4random_stir_fbsd11(void); +void __arc4random_addrandom_fbsd11(u_char *, int); + +void +__arc4random_stir_fbsd11(void) +{ + static bool warned = false; + + if (!warned) + syslog(LOG_DEBUG, "Deprecated function arc4random_stir() called"); + warned = true; +} + +void +__arc4random_addrandom_fbsd11(u_char * dummy1 __unused, int dummy2 __unused) +{ + static bool warned = false; + + if (!warned) + syslog(LOG_DEBUG, "Deprecated function arc4random_addrandom() called"); + warned = true; +} + +__sym_compat(arc4random_stir, __arc4random_stir_fbsd11, FBSD_1.0); +__sym_compat(arc4random_addrandom, __arc4random_addrandom_fbsd11, FBSD_1.0); Modified: head/lib/libc/gen/arc4random.3 ============================================================================== --- head/lib/libc/gen/arc4random.3 Sun Aug 19 17:36:50 2018 (r338058) +++ head/lib/libc/gen/arc4random.3 Sun Aug 19 17:40:50 2018 (r338059) @@ -1,4 +1,5 @@ -.\" $OpenBSD: arc4random.3,v 1.2 1997/04/27 22:40:25 angelos Exp $ +.\" $OpenBSD: arc4random.3,v 1.35 2014/11/25 16:45:24 millert Exp $ +.\" .\" Copyright 1997 Niels Provos .\" All rights reserved. .\" @@ -30,16 +31,14 @@ .\" Manual page, using -mandoc macros .\" $FreeBSD$ .\" -.Dd April 15, 1997 +.Dd July 19, 2014 .Dt ARC4RANDOM 3 .Os .Sh NAME .Nm arc4random , .Nm arc4random_buf , -.Nm arc4random_uniform , -.Nm arc4random_stir , -.Nm arc4random_addrandom -.Nd arc4 random number generator +.Nm arc4random_uniform +.Nd random number generator .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -50,20 +49,36 @@ .Fn arc4random_buf "void *buf" "size_t nbytes" .Ft uint32_t .Fn arc4random_uniform "uint32_t upper_bound" -.Ft void -.Fn arc4random_stir "void" -.Ft void -.Fn arc4random_addrandom "unsigned char *dat" "int datlen" .Sh DESCRIPTION +This family of functions provides higher quality data than those +described in +.Xr rand 3 , +.Xr random 3 , +and +.Xr rand48 3 . +.Pp +Use of these functions is encouraged for almost all random number +consumption because the other interfaces are deficient in either +quality, portability, standardization, or availability. +These functions can be called in almost all coding environments, +including +.Xr pthreads 3 +and +.Xr chroot 2 . +.Pp +High quality 32-bit pseudo-random numbers are generated very quickly. +On each call, a cryptographic pseudo-random number generator is used +to generate a new result. +One data pool is used for all consumers in a process, so that consumption +under program flow can act as additional stirring. +The subsystem is re-seeded from the kernel random number subsystem using +.Xr getentropy 2 +on a regular basis, and also upon +.Xr fork 2 . +.Pp The .Fn arc4random -function uses the key stream generator employed by the -arc4 cipher, which uses 8*8 8 bit S-Boxes. -The S-Boxes -can be in about -.if t 2\u\s71700\s10\d -.if n (2**1700) -states. +function returns a single 32-bit value. The .Fn arc4random function returns pseudo-random numbers in the range of 0 to @@ -75,33 +90,24 @@ and .Xr random 3 . .Pp .Fn arc4random_buf -function fills the region +fills the region .Fa buf of length .Fa nbytes -with ARC4-derived random data. +with random data. .Pp .Fn arc4random_uniform -will return a uniformly distributed random number less than +will return a single 32-bit value, uniformly distributed but less than .Fa upper_bound . -.Fn arc4random_uniform -is recommended over constructions like +This is recommended over constructions like .Dq Li arc4random() % upper_bound as it avoids "modulo bias" when the upper bound is not a power of two. -.Pp -The -.Fn arc4random_stir -function reads data from -.Pa /dev/urandom -and uses it to permute the S-Boxes via -.Fn arc4random_addrandom . -.Pp -There is no need to call -.Fn arc4random_stir -before using -.Fn arc4random -functions family, since -they automatically initialize themselves. +In the worst case, this function may consume multiple iterations +to ensure uniformity; see the source code to understand the problem +and solution. +.Sh RETURN VALUES +These functions are always successful, and no return value is +reserved to indicate an error. .Sh EXAMPLES The following produces a drop-in replacement for the traditional .Fn rand @@ -113,15 +119,25 @@ functions using .Dl "#define foo4random() (arc4random() % ((unsigned)RAND_MAX + 1))" .Sh SEE ALSO .Xr rand 3 , -.Xr random 3 , -.Xr srandomdev 3 +.Xr rand48 3 , +.Xr random 3 .Sh HISTORY -.Pa RC4 -has been designed by RSA Data Security, Inc. -It was posted anonymously -to the USENET and was confirmed to be equivalent by several sources who -had access to the original cipher. -Since -.Pa RC4 -used to be a trade secret, the cipher is now referred to as -.Pa ARC4 . +These functions first appeared in +.Ox 2.1 . +.Pp +The original version of this random number generator used the +RC4 (also known as ARC4) algorithm. +In +.Ox 5.5 +it was replaced with the ChaCha20 cipher, and it may be replaced +again in the future as cryptographic techniques advance. +A good mnemonic is +.Dq A Replacement Call for Random . +.Pp +The +.Fn arc4random +random number generator was first introduced in +.Fx 2.2.6 . +The ChaCha20 based implementation was introduced in +.Fx 12.0 , +with obsolete stir and addrandom interfaces removed at the same time. Modified: head/lib/libc/gen/arc4random.c ============================================================================== --- head/lib/libc/gen/arc4random.c Sun Aug 19 17:36:50 2018 (r338058) +++ head/lib/libc/gen/arc4random.c Sun Aug 19 17:40:50 2018 (r338059) @@ -1,8 +1,10 @@ -/* $OpenBSD: arc4random.c,v 1.24 2013/06/11 16:59:50 deraadt Exp $ */ +/* $OpenBSD: arc4random.c,v 1.54 2015/09/13 08:31:47 guenther Exp $ */ /* * Copyright (c) 1996, David Mazieres * Copyright (c) 2008, Damien Miller + * Copyright (c) 2013, Markus Friedl + * Copyright (c) 2014, Theo de Raadt * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -18,15 +20,7 @@ */ /* - * Arc4 random number generator for OpenBSD. - * - * This code is derived from section 17.1 of Applied Cryptography, - * second edition, which describes a stream cipher allegedly - * compatible with RSA Labs "RC4" cipher (the actual description of - * which is a trade secret). The same algorithm is used as a stream - * cipher called "arcfour" in Tatu Ylonen's ssh package. - * - * RC4 is a registered trademark of RSA Laboratories. + * ChaCha based random number generator for OpenBSD. */ #include @@ -35,232 +29,176 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include +#include +#include #include +#include #include -#include -#include +#include #include -#include - + #include "libc_private.h" #include "un-namespace.h" -#ifdef __GNUC__ +#define KEYSTREAM_ONLY +#include "chacha.c" + +#define minimum(a, b) ((a) < (b) ? (a) : (b)) + +#if defined(__GNUC__) || defined(_MSC_VER) #define inline __inline -#else /* !__GNUC__ */ +#else /* __GNUC__ || _MSC_VER */ #define inline -#endif /* !__GNUC__ */ +#endif /* !__GNUC__ && !_MSC_VER */ -struct arc4_stream { - u_int8_t i; - u_int8_t j; - u_int8_t s[256]; -}; +#define KEYSZ 32 +#define IVSZ 8 +#define BLOCKSZ 64 +#define RSBUFSZ (16*BLOCKSZ) -static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; +/* Marked INHERIT_ZERO, so zero'd out in fork children. */ +static struct _rs { + size_t rs_have; /* valid bytes at end of rs_buf */ + size_t rs_count; /* bytes till reseed */ +} *rs; -#define KEYSIZE 128 -#define _ARC4_LOCK() \ - do { \ - if (__isthreaded) \ - _pthread_mutex_lock(&arc4random_mtx); \ - } while (0) +/* Maybe be preserved in fork children, if _rs_allocate() decides. */ +static struct _rsx { + chacha_ctx rs_chacha; /* chacha context for random keystream */ + u_char rs_buf[RSBUFSZ]; /* keystream blocks */ +} *rsx; -#define _ARC4_UNLOCK() \ - do { \ - if (__isthreaded) \ - _pthread_mutex_unlock(&arc4random_mtx); \ - } while (0) +static inline int _rs_allocate(struct _rs **, struct _rsx **); +static inline void _rs_forkdetect(void); +#include "arc4random.h" -static int rs_initialized; -static struct arc4_stream rs; -static pid_t arc4_stir_pid; -static int arc4_count; +static inline void _rs_rekey(u_char *dat, size_t datlen); -extern int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen); - -static inline u_int8_t arc4_getbyte(void); -static void arc4_stir(void); - static inline void -arc4_init(void) +_rs_init(u_char *buf, size_t n) { - int n; + if (n < KEYSZ + IVSZ) + return; - for (n = 0; n < 256; n++) - rs.s[n] = n; - rs.i = 0; - rs.j = 0; -} - -static inline void -arc4_addrandom(u_char *dat, int datlen) -{ - int n; - u_int8_t si; - - rs.i--; - for (n = 0; n < 256; n++) { - rs.i = (rs.i + 1); - si = rs.s[rs.i]; - rs.j = (rs.j + si + dat[n % datlen]); - rs.s[rs.i] = rs.s[rs.j]; - rs.s[rs.j] = si; + if (rs == NULL) { + if (_rs_allocate(&rs, &rsx) == -1) + abort(); } - rs.j = rs.i; + + chacha_keysetup(&rsx->rs_chacha, buf, KEYSZ * 8); + chacha_ivsetup(&rsx->rs_chacha, buf + KEYSZ, NULL); } -size_t -__arc4_sysctl(u_char *buf, size_t size) +static void +_rs_stir(void) { - int mib[2]; - size_t len, done; + u_char rnd[KEYSZ + IVSZ]; - mib[0] = CTL_KERN; - mib[1] = KERN_ARND; - done = 0; + if (getentropy(rnd, sizeof rnd) == -1) + _getentropy_fail(); - do { - len = size; - if (__sysctl(mib, 2, buf, &len, NULL, 0) == -1) - return (done); - done += len; - buf += len; - size -= len; - } while (size > 0); + if (!rs) + _rs_init(rnd, sizeof(rnd)); + else + _rs_rekey(rnd, sizeof(rnd)); + explicit_bzero(rnd, sizeof(rnd)); /* discard source seed */ - return (done); + /* invalidate rs_buf */ + rs->rs_have = 0; + memset(rsx->rs_buf, 0, sizeof(rsx->rs_buf)); + + rs->rs_count = 1600000; } -static void -arc4_stir(void) +static inline void +_rs_stir_if_needed(size_t len) { - u_char rdat[KEYSIZE]; - int i; - - if (!rs_initialized) { - arc4_init(); - rs_initialized = 1; - } - if (__arc4_sysctl(rdat, KEYSIZE) != KEYSIZE) { - /* - * The sysctl cannot fail. If it does fail on some FreeBSD - * derivative or after some future change, just abort so that - * the problem will be found and fixed. abort is not normally - * suitable for a library but makes sense here. - */ - abort(); - } - - arc4_addrandom(rdat, KEYSIZE); - - /* - * Discard early keystream, as per recommendations in: - * "(Not So) Random Shuffles of RC4" by Ilya Mironov. - */ - for (i = 0; i < 3072; i++) - (void)arc4_getbyte(); - arc4_count = 1600000; + _rs_forkdetect(); + if (!rs || rs->rs_count <= len) + _rs_stir(); + if (rs->rs_count <= len) + rs->rs_count = 0; + else + rs->rs_count -= len; } -static void -arc4_stir_if_needed(void) +static inline void +_rs_rekey(u_char *dat, size_t datlen) { - pid_t pid = getpid(); +#ifndef KEYSTREAM_ONLY + memset(rsx->rs_buf, 0, sizeof(rsx->rs_buf)); +#endif + /* fill rs_buf with the keystream */ + chacha_encrypt_bytes(&rsx->rs_chacha, rsx->rs_buf, + rsx->rs_buf, sizeof(rsx->rs_buf)); + /* mix in optional user provided data */ + if (dat) { + size_t i, m; - if (arc4_count <= 0 || !rs_initialized || arc4_stir_pid != pid) { - arc4_stir_pid = pid; - arc4_stir(); + m = minimum(datlen, KEYSZ + IVSZ); + for (i = 0; i < m; i++) + rsx->rs_buf[i] ^= dat[i]; } + /* immediately reinit for backtracking resistance */ + _rs_init(rsx->rs_buf, KEYSZ + IVSZ); + memset(rsx->rs_buf, 0, KEYSZ + IVSZ); + rs->rs_have = sizeof(rsx->rs_buf) - KEYSZ - IVSZ; } -static inline u_int8_t -arc4_getbyte(void) +static inline void +_rs_random_buf(void *_buf, size_t n) { - u_int8_t si, sj; + u_char *buf = (u_char *)_buf; + u_char *keystream; + size_t m; - rs.i = (rs.i + 1); - si = rs.s[rs.i]; - rs.j = (rs.j + si); - sj = rs.s[rs.j]; - rs.s[rs.i] = sj; - rs.s[rs.j] = si; - return (rs.s[(si + sj) & 0xff]); + _rs_stir_if_needed(n); + while (n > 0) { + if (rs->rs_have > 0) { + m = minimum(n, rs->rs_have); + keystream = rsx->rs_buf + sizeof(rsx->rs_buf) + - rs->rs_have; + memcpy(buf, keystream, m); + memset(keystream, 0, m); + buf += m; + n -= m; + rs->rs_have -= m; + } + if (rs->rs_have == 0) + _rs_rekey(NULL, 0); + } } -static inline u_int32_t -arc4_getword(void) +static inline void +_rs_random_u32(uint32_t *val) { - u_int32_t val; - val = arc4_getbyte() << 24; - val |= arc4_getbyte() << 16; - val |= arc4_getbyte() << 8; - val |= arc4_getbyte(); - return val; -} + u_char *keystream; -void -arc4random_stir(void) -{ - _ARC4_LOCK(); - arc4_stir(); - _ARC4_UNLOCK(); + _rs_stir_if_needed(sizeof(*val)); + if (rs->rs_have < sizeof(*val)) + _rs_rekey(NULL, 0); + keystream = rsx->rs_buf + sizeof(rsx->rs_buf) - rs->rs_have; + memcpy(val, keystream, sizeof(*val)); + memset(keystream, 0, sizeof(*val)); + rs->rs_have -= sizeof(*val); } -void -arc4random_addrandom(u_char *dat, int datlen) -{ - _ARC4_LOCK(); - if (!rs_initialized) - arc4_stir(); - arc4_addrandom(dat, datlen); - _ARC4_UNLOCK(); -} - -u_int32_t +uint32_t arc4random(void) { - u_int32_t val; + uint32_t val; + _ARC4_LOCK(); - arc4_count -= 4; - arc4_stir_if_needed(); - val = arc4_getword(); + _rs_random_u32(&val); _ARC4_UNLOCK(); return val; } void -arc4random_buf(void *_buf, size_t n) +arc4random_buf(void *buf, size_t n) { - u_char *buf = (u_char *)_buf; _ARC4_LOCK(); - arc4_stir_if_needed(); - while (n--) { - if (--arc4_count <= 0) - arc4_stir(); - buf[n] = arc4_getbyte(); - } + _rs_random_buf(buf, n); _ARC4_UNLOCK(); } - -#if 0 -/*-------- Test code for i386 --------*/ -#include -#include -int -main(int argc, char **argv) -{ - const int iter = 1000000; - int i; - pctrval v; - - v = rdtsc(); - for (i = 0; i < iter; i++) - arc4random(); - v = rdtsc() - v; - v /= iter; - - printf("%qd cycles\n", v); -} -#endif Added: head/lib/libc/gen/arc4random.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/arc4random.h Sun Aug 19 17:40:50 2018 (r338059) @@ -0,0 +1,74 @@ +/* $OpenBSD: arc4random.h,v 1.4 2015/01/15 06:57:18 deraadt Exp $ */ + +/* + * Copyright (c) 1996, David Mazieres + * Copyright (c) 2008, Damien Miller + * Copyright (c) 2013, Markus Friedl + * Copyright (c) 2014, Theo de Raadt + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +/* + * Stub functions for portability. + */ +#include + +#include + +static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; +#define _ARC4_LOCK() \ + do { \ + if (__isthreaded) \ + _pthread_mutex_lock(&arc4random_mtx); \ + } while (0) + +#define _ARC4_UNLOCK() \ + do { \ + if (__isthreaded) \ + _pthread_mutex_unlock(&arc4random_mtx); \ + } while (0) + +static inline void +_getentropy_fail(void) +{ + raise(SIGKILL); +} + +static inline int +_rs_allocate(struct _rs **rsp, struct _rsx **rsxp) +{ + struct { + struct _rs rs; + struct _rsx rsx; + } *p; + + if ((p = mmap(NULL, sizeof(*p), PROT_READ|PROT_WRITE, + MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) + return (-1); + if (minherit(p, sizeof(*p), INHERIT_ZERO) == -1) { + munmap(p, sizeof(*p)); + return (-1); + } + + *rsp = &p->rs; + *rsxp = &p->rsx; + return (0); +} + +static inline void +_rs_forkdetect(void) +{ +} Modified: head/lib/libc/gen/getentropy.c ============================================================================== --- head/lib/libc/gen/getentropy.c Sun Aug 19 17:36:50 2018 (r338058) +++ head/lib/libc/gen/getentropy.c Sun Aug 19 17:40:50 2018 (r338059) @@ -31,12 +31,37 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include "libc_private.h" +extern int __sysctl(int *, u_int, void *, size_t *, void *, size_t); + +static size_t +arnd_sysctl(u_char *buf, size_t size) +{ + int mib[2]; + size_t len, done; + + mib[0] = CTL_KERN; + mib[1] = KERN_ARND; + done = 0; + + do { + len = size; + if (__sysctl(mib, 2, buf, &len, NULL, 0) == -1) + return (done); + done += len; + buf += len; + size -= len; + } while (size > 0); + + return (done); +} + /* * If a newer libc is accidentally installed on an older kernel, provide high * quality random data anyway. The sysctl interface is not as fast and does @@ -54,7 +79,7 @@ getentropy_fallback(void *buf, size_t buflen) errno = EFAULT; return (-1); } - if (__arc4_sysctl(buf, buflen) != buflen) { + if (arnd_sysctl(buf, buflen) != buflen) { if (errno == EFAULT) return (-1); /* Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Sun Aug 19 17:36:50 2018 (r338058) +++ head/lib/libc/include/libc_private.h Sun Aug 19 17:40:50 2018 (r338059) @@ -405,8 +405,6 @@ int __sys_futimens(int fd, const struct timespec *tim int __sys_utimensat(int fd, const char *path, const struct timespec *times, int flag) __hidden; -__size_t __arc4_sysctl(unsigned char *, __size_t); - /* execve() with PATH processing to implement posix_spawnp() */ int _execvpe(const char *, char * const *, char * const *); Modified: head/sys/crypto/chacha20/chacha.c ============================================================================== --- head/sys/crypto/chacha20/chacha.c Sun Aug 19 17:36:50 2018 (r338058) +++ head/sys/crypto/chacha20/chacha.c Sun Aug 19 17:40:50 2018 (r338059) @@ -14,7 +14,6 @@ __FBSDID("$FreeBSD$"); #include - typedef uint8_t u8; typedef uint32_t u32; @@ -57,7 +56,7 @@ typedef struct chacha_ctx chacha_ctx; static const char sigma[16] = "expand 32-byte k"; static const char tau[16] = "expand 16-byte k"; -void +LOCAL void chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits) { const char *constants; @@ -82,7 +81,7 @@ chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits) x->input[3] = U8TO32_LITTLE(constants + 12); } -void +LOCAL void chacha_ivsetup(chacha_ctx *x, const u8 *iv, const u8 *counter) { x->input[12] = counter == NULL ? 0 : U8TO32_LITTLE(counter + 0); @@ -91,7 +90,7 @@ chacha_ivsetup(chacha_ctx *x, const u8 *iv, const u8 * x->input[15] = U8TO32_LITTLE(iv + 4); } -void +LOCAL void chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u32 bytes) { u32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; @@ -169,6 +168,7 @@ chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u x14 = PLUS(x14,j14); x15 = PLUS(x15,j15); +#ifndef KEYSTREAM_ONLY x0 = XOR(x0,U8TO32_LITTLE(m + 0)); x1 = XOR(x1,U8TO32_LITTLE(m + 4)); x2 = XOR(x2,U8TO32_LITTLE(m + 8)); @@ -185,6 +185,7 @@ chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u x13 = XOR(x13,U8TO32_LITTLE(m + 52)); x14 = XOR(x14,U8TO32_LITTLE(m + 56)); x15 = XOR(x15,U8TO32_LITTLE(m + 60)); +#endif j12 = PLUSONE(j12); if (!j12) { @@ -219,6 +220,8 @@ chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u } bytes -= 64; c += 64; +#ifndef KEYSTREAM_ONLY m += 64; +#endif } } Modified: head/sys/crypto/chacha20/chacha.h ============================================================================== --- head/sys/crypto/chacha20/chacha.h Sun Aug 19 17:36:50 2018 (r338058) +++ head/sys/crypto/chacha20/chacha.h Sun Aug 19 17:40:50 2018 (r338059) @@ -23,9 +23,15 @@ struct chacha_ctx { #define CHACHA_STATELEN (CHACHA_NONCELEN+CHACHA_CTRLEN) #define CHACHA_BLOCKLEN 64 -void chacha_keysetup(struct chacha_ctx *x, const u_char *k, u_int kbits); -void chacha_ivsetup(struct chacha_ctx *x, const u_char *iv, const u_char *ctr); -void chacha_encrypt_bytes(struct chacha_ctx *x, const u_char *m, +#ifdef _KERNEL +#define LOCAL +#else +#define LOCAL static +#endif + +LOCAL void chacha_keysetup(struct chacha_ctx *x, const u_char *k, u_int kbits); +LOCAL void chacha_ivsetup(struct chacha_ctx *x, const u_char *iv, const u_char *ctr); +LOCAL void chacha_encrypt_bytes(struct chacha_ctx *x, const u_char *m, u_char *c, u_int bytes); #endif /* CHACHA_H */ From owner-svn-src-all@freebsd.org Sun Aug 19 17:42:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 502551071D62; Sun, 19 Aug 2018 17:42:52 +0000 (UTC) (envelope-from 0mp@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 0353B820BA; Sun, 19 Aug 2018 17:42:52 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8EE41939; Sun, 19 Aug 2018 17:42:51 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JHgpAR057168; Sun, 19 Aug 2018 17:42:51 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JHgoDv057160; Sun, 19 Aug 2018 17:42:50 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201808191742.w7JHgoDv057160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sun, 19 Aug 2018 17:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338060 - in head: lib/libc/sys share/man/man3 share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: in head: lib/libc/sys share/man/man3 share/man/man4 X-SVN-Commit-Revision: 338060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 17:42:52 -0000 Author: 0mp (ports committer) Date: Sun Aug 19 17:42:49 2018 New Revision: 338060 URL: https://svnweb.freebsd.org/changeset/base/338060 Log: Document socket control message routines for ancillary data access (CMSG_DATA). PR: 227777 Reviewed by: bcr, eadler Approved by: mat (mentor), manpages (bcr) Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D15215 Added: head/share/man/man3/CMSG_DATA.3 (contents, props changed) Modified: head/lib/libc/sys/recv.2 head/lib/libc/sys/send.2 head/lib/libc/sys/socket.2 head/share/man/man3/Makefile head/share/man/man4/ip.4 head/share/man/man4/ip6.4 head/share/man/man4/unix.4 Modified: head/lib/libc/sys/recv.2 ============================================================================== --- head/lib/libc/sys/recv.2 Sun Aug 19 17:40:50 2018 (r338059) +++ head/lib/libc/sys/recv.2 Sun Aug 19 17:42:49 2018 (r338060) @@ -28,7 +28,7 @@ .\" @(#)recv.2 8.3 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd May 20, 2018 +.Dd August 19, 2018 .Dt RECV 2 .Os .Sh NAME @@ -366,6 +366,7 @@ address space. .Xr read 2 , .Xr select 2 , .Xr socket 2 , +.Xr CMSG_DATA 3 , .Xr unix 4 .Sh HISTORY The Modified: head/lib/libc/sys/send.2 ============================================================================== --- head/lib/libc/sys/send.2 Sun Aug 19 17:40:50 2018 (r338059) +++ head/lib/libc/sys/send.2 Sun Aug 19 17:42:49 2018 (r338060) @@ -28,7 +28,7 @@ .\" From: @(#)send.2 8.2 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd August 18, 2016 +.Dd August 19, 2018 .Dt SEND 2 .Os .Sh NAME @@ -242,7 +242,8 @@ is not connected. .Xr recv 2 , .Xr select 2 , .Xr socket 2 , -.Xr write 2 +.Xr write 2 , +.Xr CMSG_DATA 3 .Sh HISTORY The .Fn send Modified: head/lib/libc/sys/socket.2 ============================================================================== --- head/lib/libc/sys/socket.2 Sun Aug 19 17:40:50 2018 (r338059) +++ head/lib/libc/sys/socket.2 Sun Aug 19 17:42:49 2018 (r338060) @@ -28,7 +28,7 @@ .\" From: @(#)socket.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 10, 2017 +.Dd August 19, 2018 .Dt SOCKET 2 .Os .Sh NAME @@ -299,6 +299,7 @@ The socket type is not supported by the protocol. .Xr shutdown 2 , .Xr socketpair 2 , .Xr write 2 , +.Xr CMSG_DATA 3 , .Xr getprotoent 3 , .Xr netgraph 4 , .Xr protocols 5 Added: head/share/man/man3/CMSG_DATA.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3/CMSG_DATA.3 Sun Aug 19 17:42:49 2018 (r338060) @@ -0,0 +1,214 @@ +.\" Written by Jared Yanovich +.\" Public domain, July 3, 2005 +.\" +.\" $FreeBSD$ +.Dd August 19, 2018 +.Dt CMSG_DATA 3 +.Os +.Sh NAME +.Nm CMSG_DATA , +.Nm CMSG_FIRSTHDR , +.Nm CMSG_LEN , +.Nm CMSG_NXTHDR , +.Nm CMSG_SPACE +.Nd socket control message routines for ancillary data access +.Sh SYNOPSIS +.In sys/socket.h +.Ft unsigned char * +.Fn CMSG_DATA "struct cmsghdr *" +.Ft struct cmsghdr * +.Fn CMSG_FIRSTHDR "struct msghdr *" +.Ft size_t +.Fn CMSG_LEN "size_t" +.Ft struct cmsghdr * +.Fn CMSG_NXTHDR "struct msghdr *" "struct cmsghdr *" +.Ft size_t +.Fn CMSG_SPACE "size_t" +.Sh DESCRIPTION +The control message API is used to construct ancillary data objects for +use in control messages sent and received across sockets. +.Pp +Control messages are passed around by the +.Xr recvmsg 2 +and +.Xr sendmsg 2 +system calls. +The +.Vt cmsghdr +structure, described in +.Xr recvmsg 2 , +is used to specify a chain of control messages. +.Pp +These routines should be used instead of directly accessing the control +message header members and data buffers as they ensure that necessary +alignment constraints are met. +.Pp +The following routines are provided: +.Bl -tag -width Ds +.It Fn CMSG_DATA cmsg +This routine accesses the data portion of the control message header +.Fa cmsg . +It ensures proper alignment constraints on the beginning of ancillary +data are met. +.It Fn CMSG_FIRSTHDR mhdr +This routine accesses the first control message attached to the +message +.Fa msg . +If no control messages are attached to the message, this routine +returns +.Dv NULL . +.It Fn CMSG_LEN len +This routine determines the size in bytes of a control message, +which includes the control message header. +.Fa len +specifies the length of the data held by the control message. +This value is what is normally stored in the +.Fa cmsg_len +of each control message. +This routine accounts for any alignment constraints on the beginning of +ancillary data. +.It Fn CMSG_NXTHDR mhdr cmsg +This routine returns the location of the control message following +.Fa cmsg +in the message +.Fa mhdr . +If +.Fa cmsg +is the last control message in the chain, this routine returns +.Dv NULL . +.It Fn CMSG_SPACE len +This routine determines the size in bytes needed to hold a control +message and its contents of length +.Fa len , +which includes the control message header. +This value is what is normally stored in +.Fa msg_msgcontrollen . +This routine accounts for any alignment constraints on the beginning of +ancillary data as well as any needed to pad the next control message. +.El +.Sh EXAMPLES +The following example constructs a control message containing a file descriptor +in the parent process and passes it over a pre-shared socket over the child +process. +Then the child process sends a "hello" string to the parent process using the +received file descriptor. +.Bd -literal +#include + +#include +#include +#include +#include +#include + +#define HELLOLEN sizeof("hello") + +int +main() +{ + struct msghdr msg; + union { + struct cmsghdr hdr; + unsigned char buf[CMSG_SPACE(sizeof(int))]; + } cmsgbuf; + char buf[HELLOLEN]; + int hellofd[2]; + int presharedfd[2]; + struct cmsghdr *cmsg; + + if (socketpair(PF_LOCAL, SOCK_STREAM, 0, presharedfd) == -1) + err(EX_OSERR, "failed to create a pre-shared socket pair"); + + memset(&msg, 0, sizeof(msg)); + msg.msg_control = &cmsgbuf.buf; + msg.msg_controllen = sizeof(cmsgbuf.buf); + msg.msg_iov = NULL; + msg.msg_iovlen = 0; + + switch (fork()) { + case -1: + err(EX_OSERR, "fork"); + case 0: + close(presharedfd[0]); + strlcpy(buf, "hello", HELLOLEN); + + if (recvmsg(presharedfd[1], &msg, 0) == -1) + err(EX_IOERR, "failed to receive a message"); + if (msg.msg_flags & (MSG_CTRUNC | MSG_TRUNC)) + errx(EX_IOERR, "control message truncated"); + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_len == CMSG_LEN(sizeof(int)) && + cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_RIGHTS) { + hellofd[1] = *(int *)CMSG_DATA(cmsg); + printf("child: sending '%s'\n", buf); + if (write(hellofd[1], buf, HELLOLEN) == -1) + err(EX_IOERR, "failed to send 'hello'"); + } + } + break; + default: + close(presharedfd[1]); + + if (socketpair(PF_LOCAL, SOCK_STREAM, 0, hellofd) == -1) + err(EX_OSERR, "failed to create a 'hello' socket pair"); + + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + *(int *)CMSG_DATA(cmsg) = hellofd[1]; + + if (sendmsg(presharedfd[0], &msg, 0) == -1) + err(EX_IOERR, "sendmsg"); + close(hellofd[1]); + + if (read(hellofd[0], buf, HELLOLEN) == -1) + err(EX_IOERR, "faild to receive 'hello'"); + printf("parent: received '%s'\n", buf); + break; + } + + return (0); +} +.Ed +.Sh SEE ALSO +.Xr recvmsg 2 , +.Xr sendmsg 2 , +.Xr socket 2 , +.Xr ip 4 , +.Xr ip6 4 , +.Xr unix 4 +.Sh STANDARDS +.Bl -item +.It +.Rs +.%A W. Stevens +.%A M. Thomas +.%T "Advanced Sockets API for IPv6" +.%R RFC 2292 +.%D February 1998 +.Re +.It +.Rs +.%A W. Stevens +.%A M. Thomas +.%A E. Nordmark +.%A T. Jinmei +.%T "Advanced Sockets Application Program Interface (API) for IPv6" +.%R RFC 3542 +.%D May 2003 +.Re +.El +.Sh HISTORY +The control message API first appeared in +.Bx 4.2 . +This manual page was originally written by +.An Jared Yanovich Aq Mt jaredy@OpenBSD.org +for +.Ox 3.8 +and eventually brought to +.Fx 12.0 +by +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Sun Aug 19 17:40:50 2018 (r338059) +++ head/share/man/man3/Makefile Sun Aug 19 17:42:49 2018 (r338060) @@ -8,6 +8,7 @@ PACKAGE=runtime-manuals MAN= assert.3 \ ATOMIC_VAR_INIT.3 \ bitstring.3 \ + CMSG_DATA.3 \ end.3 \ fpgetround.3 \ intro.3 \ @@ -57,6 +58,10 @@ MLINKS+= bitstring.3 bit_alloc.3 \ bitstring.3 bit_set.3 \ bitstring.3 bitstr_size.3 \ bitstring.3 bit_test.3 +MLINKS+= CMSG_DATA.3 CMSG_FIRSTHDR.3 \ + CMSG_DATA.3 CMSG_LEN.3 \ + CMSG_DATA.3 CMSG_NEXTHDR.3 \ + CMSG_DATA.3 CMSG_SPACE.3 MLINKS+= end.3 edata.3 \ end.3 etext.3 MLINKS+= fpgetround.3 fpgetmask.3 \ Modified: head/share/man/man4/ip.4 ============================================================================== --- head/share/man/man4/ip.4 Sun Aug 19 17:40:50 2018 (r338059) +++ head/share/man/man4/ip.4 Sun Aug 19 17:42:49 2018 (r338060) @@ -28,7 +28,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd September 1, 2014 +.Dd August 19, 2018 .Dt IP 4 .Os .Sh NAME @@ -888,6 +888,7 @@ field was not equal to the length of the datagram writ .Xr recv 2 , .Xr send 2 , .Xr byteorder 3 , +.Xr CMSG_DATA 3 , .Xr sourcefilter 3 , .Xr icmp 4 , .Xr igmp 4 , Modified: head/share/man/man4/ip6.4 ============================================================================== --- head/share/man/man4/ip6.4 Sun Aug 19 17:40:50 2018 (r338059) +++ head/share/man/man4/ip6.4 Sun Aug 19 17:42:49 2018 (r338060) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 2011 +.Dd August 19, 2018 .Dt IP6 4 .Os .Sh NAME @@ -651,6 +651,7 @@ An ancillary data object was improperly formed. .Xr send 2 , .Xr setsockopt 2 , .Xr socket 2 , +.Xr CMSG_DATA 3 , .\" .Xr inet6_option_space 3 , .\" .Xr inet6_rthdr_space 3 , .Xr if_nametoindex 3 , Modified: head/share/man/man4/unix.4 ============================================================================== --- head/share/man/man4/unix.4 Sun Aug 19 17:40:50 2018 (r338059) +++ head/share/man/man4/unix.4 Sun Aug 19 17:42:49 2018 (r338060) @@ -28,7 +28,7 @@ .\" @(#)unix.4 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd February 3, 2017 +.Dd August 19, 2018 .Dt UNIX 4 .Os .Sh NAME @@ -350,6 +350,7 @@ socket option. .Xr sendto 2 , .Xr setsockopt 2 , .Xr socket 2 , +.Xr CMSG_DATA 3 , .Xr intro 4 .Rs .%T "An Introductory 4.3 BSD Interprocess Communication Tutorial" From owner-svn-src-all@freebsd.org Sun Aug 19 17:47:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 019B91071FA1; Sun, 19 Aug 2018 17:47:32 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 9CA0C823F0; Sun, 19 Aug 2018 17:47:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78057198F; Sun, 19 Aug 2018 17:47:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JHlV3l057528; Sun, 19 Aug 2018 17:47:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JHlVBM057527; Sun, 19 Aug 2018 17:47:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808191747.w7JHlVBM057527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 19 Aug 2018 17:47:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338061 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 338061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 17:47:32 -0000 Author: delphij Date: Sun Aug 19 17:47:30 2018 New Revision: 338061 URL: https://svnweb.freebsd.org/changeset/base/338061 Log: Bump __FreeBSD_version after r338059 (Chacha20 based arc4random(3) and deprecation of arc4random_stir and arc4random_addrandom). Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Aug 19 17:42:49 2018 (r338060) +++ head/sys/sys/param.h Sun Aug 19 17:47:30 2018 (r338061) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200078 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200079 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Sun Aug 19 17:57:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0A581072470; Sun, 19 Aug 2018 17:57:51 +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 910DF829F3; Sun, 19 Aug 2018 17:57:51 +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 6EF091B38; Sun, 19 Aug 2018 17:57:51 +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 w7JHvpx8062648; Sun, 19 Aug 2018 17:57:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JHvp8J062647; Sun, 19 Aug 2018 17:57:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201808191757.w7JHvp8J062647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 19 Aug 2018 17:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338062 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 338062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 17:57:52 -0000 Author: jhb Date: Sun Aug 19 17:57:51 2018 New Revision: 338062 URL: https://svnweb.freebsd.org/changeset/base/338062 Log: Fix a couple of comment nits. Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Sun Aug 19 17:47:30 2018 (r338061) +++ head/sys/x86/x86/local_apic.c Sun Aug 19 17:57:51 2018 (r338062) @@ -1925,8 +1925,8 @@ apic_setup_io(void *dummy __unused) /* * Finish setting up the local APIC on the BSP once we know * how to properly program the LINT pins. In particular, this - * enables the EOI suppression mode, if LAPIC support it and - * user did not disabled the mode. + * enables the EOI suppression mode, if LAPIC supports it and + * user did not disable the mode. */ lapic_setup(1); if (bootverbose) From owner-svn-src-all@freebsd.org Sun Aug 19 18:12:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C6721072D64; Sun, 19 Aug 2018 18:12:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 B745D83442; Sun, 19 Aug 2018 18:12:11 +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 997151E4B; Sun, 19 Aug 2018 18:12:11 +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 w7JICBWl071062; Sun, 19 Aug 2018 18:12:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JICBDd071061; Sun, 19 Aug 2018 18:12:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808191812.w7JICBDd071061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 19 Aug 2018 18:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338063 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 338063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 18:12:12 -0000 Author: kevans Date: Sun Aug 19 18:12:11 2018 New Revision: 338063 URL: https://svnweb.freebsd.org/changeset/base/338063 Log: lualoader: Stop exporting drawer.draw drawer.draw is the back-end for drawlogo and drawbrand and should not be used directly. Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sun Aug 19 17:57:51 2018 (r338062) +++ head/stand/lua/drawer.lua Sun Aug 19 18:12:11 2018 (r338063) @@ -83,6 +83,13 @@ local function getLogodef(logo) return logodef end +local function draw(x, y, logo) + for i = 1, #logo do + screen.setcursor(x, y + i - 1) + printc(logo[i]) + end +end + fbsd_brand = { " ______ ____ _____ _____ ", " | ____| | _ \\ / ____| __ \\ ", @@ -320,13 +327,6 @@ function drawer.drawbox() printc(menu_header) end -function drawer.draw(x, y, logo) - for i = 1, #logo do - screen.setcursor(x, y + i - 1) - printc(logo[i]) - end -end - function drawer.drawbrand() local x = tonumber(loader.getenv("loader_brand_x")) or drawer.brand_position.x @@ -343,7 +343,7 @@ function drawer.drawbrand() x = x + drawer.shift.x y = y + drawer.shift.y - drawer.draw(x, y, graphic) + draw(x, y, graphic) end function drawer.drawlogo() @@ -381,7 +381,7 @@ function drawer.drawlogo() y = y + logodef.shift.y end - drawer.draw(x, y, logodef.graphic) + draw(x, y, logodef.graphic) end return drawer From owner-svn-src-all@freebsd.org Sun Aug 19 18:18:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1265A107322C; Sun, 19 Aug 2018 18:18: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 AFA09837A0; Sun, 19 Aug 2018 18:18:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CA021E72; Sun, 19 Aug 2018 18:18:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JIIKCK073171; Sun, 19 Aug 2018 18:18:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JIIKUN073169; Sun, 19 Aug 2018 18:18:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808191818.w7JIIKUN073169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 19 Aug 2018 18:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338064 - in head: . stand/userboot/userboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . stand/userboot/userboot X-SVN-Commit-Revision: 338064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 18:18:21 -0000 Author: imp Date: Sun Aug 19 18:18:19 2018 New Revision: 338064 URL: https://svnweb.freebsd.org/changeset/base/338064 Log: Turn back the clock just a little: make userboot.so always be 4th Turns out there was a hidden dependency we hasn't counted upon. The host load /boot/userboot.so to boot the VMs it runs. This means that the change to lua meant suddently that nobody could run their older VMs because LUA wasn't in 10.0, last month's HardenedBSD, 11.2 or whatever. Even more than for the /boot/loader* binaries, we need a good coexistance strategy for this. While that's being designed and implemented, drop back to always 4th for userboot.so. This will fail safe in all but the most extreme environments (but lua-only hacks to .lua files won't be processes in VMs until we fix it). Differential Review: https://reviews.freebsd.org/D16805 Modified: head/UPDATING head/stand/userboot/userboot/Makefile Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Aug 19 18:12:11 2018 (r338063) +++ head/UPDATING Sun Aug 19 18:18:19 2018 (r338064) @@ -40,6 +40,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: loader and loader_4th instead of loader and loader_lua, the new default. If you are using UEFI it will create the proper hard link to loader.efi. + bhyve uses userboot.so. It remains 4th-only until some issues are solved + regarding coexisting with multiple versions of FreeBSD are resolved. + 20180815: ls(1) now respects the COLORTERM environment variable used in other systems and software to indicate that a colored terminal is both Modified: head/stand/userboot/userboot/Makefile ============================================================================== --- head/stand/userboot/userboot/Makefile Sun Aug 19 18:12:11 2018 (r338063) +++ head/stand/userboot/userboot/Makefile Sun Aug 19 18:18:19 2018 (r338064) @@ -5,6 +5,7 @@ LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no PIC=yes +LOADER_INTERP=4th .include From owner-svn-src-all@freebsd.org Sun Aug 19 18:22:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F49E10735AD; Sun, 19 Aug 2018 18:22:02 +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 B96E283D17; Sun, 19 Aug 2018 18:22:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 823D91FDB; Sun, 19 Aug 2018 18:22:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JIM1rc077281; Sun, 19 Aug 2018 18:22:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JIM1xi077280; Sun, 19 Aug 2018 18:22:01 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808191822.w7JIM1xi077280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 19 Aug 2018 18:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338065 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 338065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 18:22:02 -0000 Author: kevans Date: Sun Aug 19 18:22:01 2018 New Revision: 338065 URL: https://svnweb.freebsd.org/changeset/base/338065 Log: lualoader: Hide most of the internal drawing functions Ideally, all of the functionality to revamp the loader screen has associated APIs that are flexible enough that third-party scripts wouldn't need to override these. Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sun Aug 19 18:18:19 2018 (r338064) +++ head/stand/lua/drawer.lua Sun Aug 19 18:22:01 2018 (r338065) @@ -90,131 +90,7 @@ local function draw(x, y, logo) end end -fbsd_brand = { -" ______ ____ _____ _____ ", -" | ____| | _ \\ / ____| __ \\ ", -" | |___ _ __ ___ ___ | |_) | (___ | | | |", -" | ___| '__/ _ \\/ _ \\| _ < \\___ \\| | | |", -" | | | | | __/ __/| |_) |____) | |__| |", -" | | | | | | || | | |", -" |_| |_| \\___|\\___||____/|_____/|_____/ " -} -none = {""} - --- Module exports -drawer.default_brand = 'fbsd' - -drawer.menu_name_handlers = { - -- Menu name handlers should take the menu being drawn and entry being - -- drawn as parameters, and return the name of the item. - -- This is designed so that everything, including menu separators, may - -- have their names derived differently. The default action for entry - -- types not specified here is to use entry.name directly. - [core.MENU_SEPARATOR] = function(_, entry) - if entry.name ~= nil then - if type(entry.name) == "function" then - return entry.name() - end - return entry.name - end - return "" - end, - [core.MENU_CAROUSEL_ENTRY] = function(_, entry) - local carid = entry.carousel_id - local caridx = config.getCarouselIndex(carid) - local choices = entry.items - if type(choices) == "function" then - choices = choices() - end - if #choices < caridx then - caridx = 1 - end - return entry.name(caridx, choices[caridx], choices) - end, -} - -drawer.brand_position = {x = 2, y = 1} -drawer.logo_position = {x = 46, y = 4} -drawer.menu_position = {x = 5, y = 10} -drawer.frame_size = {w = 42, h = 13} -drawer.default_shift = {x = 0, y = 0} -drawer.shift = drawer.default_shift - -drawer.branddefs = { - -- Indexed by valid values for loader_brand in loader.conf(5). Valid - -- keys are: graphic (table depicting graphic) - ["fbsd"] = { - graphic = fbsd_brand, - }, - ["none"] = { - graphic = none, - }, -} - -function drawer.addBrand(name, def) - drawer.branddefs[name] = def -end - -function drawer.addLogo(name, def) - drawer.logodefs[name] = def -end - -drawer.logodefs = { - -- Indexed by valid values for loader_logo in loader.conf(5). Valid keys - -- are: requires_color (boolean), graphic (table depicting graphic), and - -- shift (table containing x and y). - ["tribute"] = { - graphic = fbsd_brand, - }, - ["tributebw"] = { - graphic = fbsd_brand, - }, - ["none"] = { - graphic = none, - shift = {x = 17, y = 0}, - }, -} - -drawer.frame_styles = { - -- Indexed by valid values for loader_menu_frame in loader.conf(5). - -- All of the keys appearing below must be set for any menu frame style - -- added to drawer.frame_styles. - ["ascii"] = { - horizontal = "-", - vertical = "|", - top_left = "+", - bottom_left = "+", - top_right = "+", - bottom_right = "+", - }, - ["single"] = { - horizontal = "\xC4", - vertical = "\xB3", - top_left = "\xDA", - bottom_left = "\xC0", - top_right = "\xBF", - bottom_right = "\xD9", - }, - ["double"] = { - horizontal = "\xCD", - vertical = "\xBA", - top_left = "\xC9", - bottom_left = "\xC8", - top_right = "\xBB", - bottom_right = "\xBC", - }, -} - -function drawer.drawscreen(menu_opts) - -- drawlogo() must go first. - -- it determines the positions of other elements - drawer.drawlogo() - drawer.drawbrand() - drawer.drawbox() - return drawer.drawmenu(menu_opts) -end - -function drawer.drawmenu(menudef) +local function drawmenu(menudef) local x = drawer.menu_position.x local y = drawer.menu_position.y @@ -258,7 +134,7 @@ function drawer.drawmenu(menudef) return alias_table end -function drawer.drawbox() +local function drawbox() local x = drawer.menu_position.x - 3 local y = drawer.menu_position.y - 1 local w = drawer.frame_size.w @@ -327,7 +203,7 @@ function drawer.drawbox() printc(menu_header) end -function drawer.drawbrand() +local function drawbrand() local x = tonumber(loader.getenv("loader_brand_x")) or drawer.brand_position.x local y = tonumber(loader.getenv("loader_brand_y")) or @@ -346,7 +222,7 @@ function drawer.drawbrand() draw(x, y, graphic) end -function drawer.drawlogo() +local function drawlogo() local x = tonumber(loader.getenv("loader_logo_x")) or drawer.logo_position.x local y = tonumber(loader.getenv("loader_logo_y")) or @@ -382,6 +258,130 @@ function drawer.drawlogo() end draw(x, y, logodef.graphic) +end + +fbsd_brand = { +" ______ ____ _____ _____ ", +" | ____| | _ \\ / ____| __ \\ ", +" | |___ _ __ ___ ___ | |_) | (___ | | | |", +" | ___| '__/ _ \\/ _ \\| _ < \\___ \\| | | |", +" | | | | | __/ __/| |_) |____) | |__| |", +" | | | | | | || | | |", +" |_| |_| \\___|\\___||____/|_____/|_____/ " +} +none = {""} + +-- Module exports +drawer.default_brand = 'fbsd' + +drawer.menu_name_handlers = { + -- Menu name handlers should take the menu being drawn and entry being + -- drawn as parameters, and return the name of the item. + -- This is designed so that everything, including menu separators, may + -- have their names derived differently. The default action for entry + -- types not specified here is to use entry.name directly. + [core.MENU_SEPARATOR] = function(_, entry) + if entry.name ~= nil then + if type(entry.name) == "function" then + return entry.name() + end + return entry.name + end + return "" + end, + [core.MENU_CAROUSEL_ENTRY] = function(_, entry) + local carid = entry.carousel_id + local caridx = config.getCarouselIndex(carid) + local choices = entry.items + if type(choices) == "function" then + choices = choices() + end + if #choices < caridx then + caridx = 1 + end + return entry.name(caridx, choices[caridx], choices) + end, +} + +drawer.brand_position = {x = 2, y = 1} +drawer.logo_position = {x = 46, y = 4} +drawer.menu_position = {x = 5, y = 10} +drawer.frame_size = {w = 42, h = 13} +drawer.default_shift = {x = 0, y = 0} +drawer.shift = drawer.default_shift + +drawer.branddefs = { + -- Indexed by valid values for loader_brand in loader.conf(5). Valid + -- keys are: graphic (table depicting graphic) + ["fbsd"] = { + graphic = fbsd_brand, + }, + ["none"] = { + graphic = none, + }, +} + +function drawer.addBrand(name, def) + drawer.branddefs[name] = def +end + +function drawer.addLogo(name, def) + drawer.logodefs[name] = def +end + +drawer.logodefs = { + -- Indexed by valid values for loader_logo in loader.conf(5). Valid keys + -- are: requires_color (boolean), graphic (table depicting graphic), and + -- shift (table containing x and y). + ["tribute"] = { + graphic = fbsd_brand, + }, + ["tributebw"] = { + graphic = fbsd_brand, + }, + ["none"] = { + graphic = none, + shift = {x = 17, y = 0}, + }, +} + +drawer.frame_styles = { + -- Indexed by valid values for loader_menu_frame in loader.conf(5). + -- All of the keys appearing below must be set for any menu frame style + -- added to drawer.frame_styles. + ["ascii"] = { + horizontal = "-", + vertical = "|", + top_left = "+", + bottom_left = "+", + top_right = "+", + bottom_right = "+", + }, + ["single"] = { + horizontal = "\xC4", + vertical = "\xB3", + top_left = "\xDA", + bottom_left = "\xC0", + top_right = "\xBF", + bottom_right = "\xD9", + }, + ["double"] = { + horizontal = "\xCD", + vertical = "\xBA", + top_left = "\xC9", + bottom_left = "\xC8", + top_right = "\xBB", + bottom_right = "\xBC", + }, +} + +function drawer.drawscreen(menudef) + -- drawlogo() must go first. + -- it determines the positions of other elements + drawlogo() + drawbrand() + drawbox() + return drawmenu(menudef) end return drawer From owner-svn-src-all@freebsd.org Sun Aug 19 18:27:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 347FB1073831 for ; Sun, 19 Aug 2018 18:27:07 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb0-x243.google.com (mail-yb0-x243.google.com [IPv6:2607:f8b0:4002:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA763840C0 for ; Sun, 19 Aug 2018 18:27:06 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb0-x243.google.com with SMTP id f145-v6so1610239ybg.4 for ; Sun, 19 Aug 2018 11:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=srM/BoGj29gQc5Cl48ZZGmy1T7udiJZJlpZtphsssQQ=; b=Bsu3A6uQMcX1slTef0+0CDSkuZf8FEZif/yw9+Q03oTgf4lPrijfnrL0bgXJ2hOriE iwWszeLmYZ0vidovwo1zdjI0whAuifag30WAY2hOjOSicMiiYH5tzTIdVbogz2lIQmvd hVWZ8zu8xGQgNHToD0TJGyqA8qDqE3p176j5F9TP2JEFfDMHMGUMZoXhL2uM5avCAzda Us+FPE5VfZJqlHYoJ4jMt0Px/msdXmyiJeX81bs0eN94P/K13Xk/BOXdFMlH5/AwWYsP OtTYfFGpJDuLJZeDBmzkjt3UQbaXaKBh/9l8sT4zFGYe4I59AX7TUnQUmg7geML6GGwC DrPw== 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=srM/BoGj29gQc5Cl48ZZGmy1T7udiJZJlpZtphsssQQ=; b=WayJ1E38fnrY12h0j3KjpQtEEAXf44qnCLAba9pAWoQKYTobaSqovyU4jla86hU3v1 YsFBIASs7CFkb7HOCwdDr6BWPS6mA7CwIbeYVHl7GtgOouV/ZFpKA1pP3c/GTolylcAS +ed0ssNtSgl+Flv0Lx/4y9CyMVgRiaprzs9C7QSonUQw+a5ZCSlCwDL2foqrIvSEaF09 mAp+OchHZvDZg7Uah0dBsqfQQwKWiPEZZ/q1BN/V8yXzyk6DysBr8C62xQ1JQeBl3Lba t8gtLv3porSeUfcobImxyVG4yXbg59u0I95ZJkUDWAKgLufUBC4iB4BUe7c7VsbA8Ko4 Hh+A== X-Gm-Message-State: AOUpUlEsUjfk1Yk8GWBdsYGEfnUKbrgwCu87Aimea3694CiRYiAx7Qx4 nF7IH+DpRZCiAjCkGWfw3ajcQ7gKVlbvzkQUuMoq6g== X-Google-Smtp-Source: AA+uWPxoj9SWaKjVQ6xGPQyG1LhPdZP44OILt4U6JgYLKAauWAOP5NzDu5vPcQl4pfvEPm8I1haIXYT4bJx5pL0QsQY= X-Received: by 2002:a5b:9ca:: with SMTP id y10-v6mr2959222ybq.389.1534703226039; Sun, 19 Aug 2018 11:27:06 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:f205:0:0:0:0:0 with HTTP; Sun, 19 Aug 2018 11:27:05 -0700 (PDT) In-Reply-To: <201808191740.w7JHeoSj052259@repo.freebsd.org> References: <201808191740.w7JHeoSj052259@repo.freebsd.org> From: Oliver Pinter Date: Sun, 19 Aug 2018 20:27:05 +0200 Message-ID: Subject: Re: svn commit: r338059 - in head: . contrib/ntp/lib/isc contrib/ntp/sntp/libevent crypto/heimdal/lib/roken crypto/openssh include lib/libc/gen lib/libc/include sys/crypto/chacha20 To: Xin LI Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 18:27:07 -0000 On 8/19/18, Xin LI wrote: > Author: delphij > Date: Sun Aug 19 17:40:50 2018 > New Revision: 338059 > URL: https://svnweb.freebsd.org/changeset/base/338059 > > Log: > Update userland arc4random() with OpenBSD's Chacha20 based arc4random(). > > ObsoleteFiles.inc: > > Remove manual pages for arc4random_addrandom(3) and > arc4random_stir(3). > > contrib/ntp/lib/isc/random.c: > contrib/ntp/sntp/libevent/evutil_rand.c: > > Eliminate in-tree usage of arc4random_addrandom(). > > crypto/heimdal/lib/roken/rand.c: > crypto/openssh/config.h: > > Eliminate in-tree usage of arc4random_stir(). > > include/stdlib.h: > > Remove arc4random_stir() and arc4random_addrandom() prototypes, > provide temporary shims for transistion period. > > lib/libc/gen/Makefile.inc: > > Hook arc4random-compat.c to build, add hint for Chacha20 source for > kernel, and remove arc4random_addrandom(3) and arc4random_stir(3) > links. > > lib/libc/gen/arc4random.c: > > Adopt OpenBSD arc4random.c,v 1.54 with bare minimum changes, use the > sys/crypto/chacha20 implementation of keystream. > > lib/libc/gen/Symbol.map: > > Remove arc4random_stir and arc4random_addrandom interfaces. > > lib/libc/gen/arc4random.h: > > Adopt OpenBSD arc4random.h,v 1.4 but provide _ARC4_LOCK of our own. > > lib/libc/gen/arc4random.3: > > Adopt OpenBSD arc4random.3,v 1.35 but keep FreeBSD r114444 and > r118247. > > lib/libc/gen/arc4random-compat.c: > > Compatibility shims for arc4random_stir and arc4random_addrandom > functions to preserve ABI. Log once when called but do nothing > otherwise. > > lib/libc/gen/getentropy.c: > lib/libc/include/libc_private.h: > > Fold __arc4_sysctl into getentropy.c (renamed to arnd_sysctl). > Remove from libc_private.h as a result. > > sys/crypto/chacha20/chacha.c: > sys/crypto/chacha20/chacha.h: > > Make it possible to use the kernel implementation in libc. > > PR: 182610 > Reviewed by: cem, markm > Obtained from: OpenBSD > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D16760 > > Added: > head/lib/libc/gen/arc4random-compat.c (contents, props changed) > head/lib/libc/gen/arc4random.h (contents, props changed) > Modified: > head/ObsoleteFiles.inc > head/contrib/ntp/lib/isc/random.c > head/contrib/ntp/sntp/libevent/evutil_rand.c > head/crypto/heimdal/lib/roken/rand.c > head/crypto/openssh/config.h > head/include/stdlib.h > head/lib/libc/gen/Makefile.inc > head/lib/libc/gen/Symbol.map > head/lib/libc/gen/arc4random.3 > head/lib/libc/gen/arc4random.c (contents, props changed) > head/lib/libc/gen/getentropy.c > head/lib/libc/include/libc_private.h > head/sys/crypto/chacha20/chacha.c > head/sys/crypto/chacha20/chacha.h > > Modified: head/ObsoleteFiles.inc > ============================================================================== > --- head/ObsoleteFiles.inc Sun Aug 19 17:36:50 2018 (r338058) > +++ head/ObsoleteFiles.inc Sun Aug 19 17:40:50 2018 (r338059) > @@ -38,6 +38,9 @@ > # xargs -n1 | sort | uniq -d; > # done > > +# 20180819: Remove deprecated arc4random(3) stir/addrandom interfaces > +OLD_FILES+=usr/share/man/man3/arc4random_addrandom.3.gz > +OLD_FILES+=usr/share/man/man3/arc4random_stir.3.gz > # 20180819: send-pr(1) placeholder removal > OLD_FILES+=usr/bin/send-pr > # 20180725: Cleanup old libcasper.so.0 > > Modified: head/contrib/ntp/lib/isc/random.c > ============================================================================== > --- head/contrib/ntp/lib/isc/random.c Sun Aug 19 17:36:50 2018 (r338058) > +++ head/contrib/ntp/lib/isc/random.c Sun Aug 19 17:40:50 2018 (r338059) > @@ -67,8 +67,6 @@ isc_random_seed(isc_uint32_t seed) > > #ifndef HAVE_ARC4RANDOM > srand(seed); > -#else > - arc4random_addrandom((u_char *) &seed, sizeof(isc_uint32_t)); > #endif > } > > > Modified: head/contrib/ntp/sntp/libevent/evutil_rand.c > ============================================================================== > --- head/contrib/ntp/sntp/libevent/evutil_rand.c Sun Aug 19 17:36:50 > 2018 (r338058) > +++ head/contrib/ntp/sntp/libevent/evutil_rand.c Sun Aug 19 17:40:50 > 2018 (r338059) > @@ -195,8 +195,6 @@ evutil_secure_rng_get_bytes(void *buf, size_t n) > void > evutil_secure_rng_add_bytes(const char *buf, size_t n) > { > - arc4random_addrandom((unsigned char*)buf, > - n>(size_t)INT_MAX ? INT_MAX : (int)n); > } > > void > > Modified: head/crypto/heimdal/lib/roken/rand.c > ============================================================================== > --- head/crypto/heimdal/lib/roken/rand.c Sun Aug 19 17:36:50 2018 (r338058) > +++ head/crypto/heimdal/lib/roken/rand.c Sun Aug 19 17:40:50 2018 (r338059) > @@ -37,7 +37,6 @@ void ROKEN_LIB_FUNCTION > rk_random_init(void) > { > #if defined(HAVE_ARC4RANDOM) > - arc4random_stir(); > #elif defined(HAVE_SRANDOMDEV) > srandomdev(); > #elif defined(HAVE_RANDOM) This hunk of the patch looks weird. Isn't it would better to undef HAVE_ARC4RANDOM without deleting the arc4random_stir()? Or delete the macro part of detection like #if defined(HAVE_SRANDOM... From owner-svn-src-all@freebsd.org Sun Aug 19 18:27:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A5F410738F4 for ; Sun, 19 Aug 2018 18:27:47 +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 0906C841F9 for ; Sun, 19 Aug 2018 18:27:46 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 8ab81442-a3dd-11e8-aff6-0b9b8210da61 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 8ab81442-a3dd-11e8-aff6-0b9b8210da61; Sun, 19 Aug 2018 18:27:35 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7JIRYoD086063; Sun, 19 Aug 2018 12:27:34 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1534703254.27158.41.camel@freebsd.org> Subject: Re: svn commit: r338059 - in head: . contrib/ntp/lib/isc contrib/ntp/sntp/libevent crypto/heimdal/lib/roken crypto/openssh include lib/libc/gen lib/libc/include sys/crypto/chacha20 From: Ian Lepore To: Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 19 Aug 2018 12:27:34 -0600 In-Reply-To: <201808191740.w7JHeoSj052259@repo.freebsd.org> References: <201808191740.w7JHeoSj052259@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-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 18:27:47 -0000 On Sun, 2018-08-19 at 17:40 +0000, Xin LI wrote: > Author: delphij > Date: Sun Aug 19 17:40:50 2018 > New Revision: 338059 > URL: https://svnweb.freebsd.org/changeset/base/338059 > > Log: >   Update userland arc4random() with OpenBSD's Chacha20 based > arc4random(). >    >     ObsoleteFiles.inc: >    >       Remove manual pages for arc4random_addrandom(3) and >       arc4random_stir(3). >    >     contrib/ntp/lib/isc/random.c: >     contrib/ntp/sntp/libevent/evutil_rand.c: >    >       Eliminate in-tree usage of arc4random_addrandom(). >    If we don't feed changes for this back upstream, we're going to have to carry diffs from mainline ntpd forever now. The upstream project is receptive to taking diffs from us, but I guess we'd have to figure out how to write some autotools detection to create some new HAVE_xxxx variables for wrapping these calls. Also, does this imply that the ntpd port will fail to build now? I would imagine removing such fundamental routines would affect many ports. All in all, if it's just a matter of our implementation not needing these functions, wouldn't it be better to implement them as no-ops and document them as such existing only to aid porting existing code? -- Ian From owner-svn-src-all@freebsd.org Sun Aug 19 18:37:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72D381073CDA; Sun, 19 Aug 2018 18:37:34 +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 17034848C1; Sun, 19 Aug 2018 18:37:34 +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 DD9B321B7; Sun, 19 Aug 2018 18:37:33 +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 w7JIbXFh083256; Sun, 19 Aug 2018 18:37:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JIbXPB083255; Sun, 19 Aug 2018 18:37:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808191837.w7JIbXPB083255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 19 Aug 2018 18:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338066 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 338066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 18:37:34 -0000 Author: kevans Date: Sun Aug 19 18:37:33 2018 New Revision: 338066 URL: https://svnweb.freebsd.org/changeset/base/338066 Log: lualoader: Hide the rest of the private interfaces These are less controversial than the others, thus done in a separate commit. These are all used internally and ways to override are provided via soon-to-be-documented API or loader.conf(5) variables. Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sun Aug 19 18:22:01 2018 (r338065) +++ head/stand/lua/drawer.lua Sun Aug 19 18:37:33 2018 (r338066) @@ -39,8 +39,18 @@ local drawer = {} local fbsd_brand local none +local menu_name_handlers +local branddefs +local logodefs +local brand_position +local logo_position +local menu_position +local frame_size +local default_shift +local shift + local function menuEntryName(drawing_menu, entry) - local name_handler = drawer.menu_name_handlers[entry.entry_type] + local name_handler = menu_name_handlers[entry.entry_type] if name_handler ~= nil then return name_handler(drawing_menu, entry) @@ -56,12 +66,12 @@ local function getBranddef(brand) return nil end -- Look it up - local branddef = drawer.branddefs[brand] + local branddef = branddefs[brand] -- Try to pull it in if branddef == nil then try_include('brand-' .. brand) - branddef = drawer.branddefs[brand] + branddef = branddefs[brand] end return branddef @@ -72,12 +82,12 @@ local function getLogodef(logo) return nil end -- Look it up - local logodef = drawer.logodefs[logo] + local logodef = logodefs[logo] -- Try to pull it in if logodef == nil then try_include('logo-' .. logo) - logodef = drawer.logodefs[logo] + logodef = logodefs[logo] end return logodef @@ -91,11 +101,11 @@ local function draw(x, y, logo) end local function drawmenu(menudef) - local x = drawer.menu_position.x - local y = drawer.menu_position.y + local x = menu_position.x + local y = menu_position.y - x = x + drawer.shift.x - y = y + drawer.shift.y + x = x + shift.x + y = y + shift.y -- print the menu and build the alias table local alias_table = {} @@ -135,10 +145,10 @@ local function drawmenu(menudef) end local function drawbox() - local x = drawer.menu_position.x - 3 - local y = drawer.menu_position.y - 1 - local w = drawer.frame_size.w - local h = drawer.frame_size.h + local x = menu_position.x - 3 + local y = menu_position.y - 1 + local w = frame_size.w + local h = frame_size.h local framestyle = loader.getenv("loader_menu_frame") or "double" local framespec = drawer.frame_styles[framestyle] @@ -156,8 +166,8 @@ local function drawbox() local tr = framespec.top_right local br = framespec.bottom_right - x = x + drawer.shift.x - y = y + drawer.shift.y + x = x + shift.x + y = y + shift.y screen.setcursor(x, y); printc(tl) screen.setcursor(x, y + h); printc(bl) @@ -205,9 +215,9 @@ end local function drawbrand() local x = tonumber(loader.getenv("loader_brand_x")) or - drawer.brand_position.x + brand_position.x local y = tonumber(loader.getenv("loader_brand_y")) or - drawer.brand_position.y + brand_position.y local branddef = getBranddef(loader.getenv("loader_brand")) @@ -217,16 +227,16 @@ local function drawbrand() local graphic = branddef.graphic - x = x + drawer.shift.x - y = y + drawer.shift.y + x = x + shift.x + y = y + shift.y draw(x, y, graphic) end local function drawlogo() local x = tonumber(loader.getenv("loader_logo_x")) or - drawer.logo_position.x + logo_position.x local y = tonumber(loader.getenv("loader_logo_y")) or - drawer.logo_position.y + logo_position.y local logo = loader.getenv("loader_logo") local colored = color.isEnabled() @@ -244,13 +254,13 @@ local function drawlogo() end if logodef ~= nil and logodef.graphic == none then - drawer.shift = logodef.shift + shift = logodef.shift else - drawer.shift = drawer.default_shift + shift = default_shift end - x = x + drawer.shift.x - y = y + drawer.shift.y + x = x + shift.x + y = y + shift.y if logodef ~= nil and logodef.shift ~= nil then x = x + logodef.shift.x @@ -271,10 +281,7 @@ fbsd_brand = { } none = {""} --- Module exports -drawer.default_brand = 'fbsd' - -drawer.menu_name_handlers = { +menu_name_handlers = { -- Menu name handlers should take the menu being drawn and entry being -- drawn as parameters, and return the name of the item. -- This is designed so that everything, including menu separators, may @@ -303,14 +310,7 @@ drawer.menu_name_handlers = { end, } -drawer.brand_position = {x = 2, y = 1} -drawer.logo_position = {x = 46, y = 4} -drawer.menu_position = {x = 5, y = 10} -drawer.frame_size = {w = 42, h = 13} -drawer.default_shift = {x = 0, y = 0} -drawer.shift = drawer.default_shift - -drawer.branddefs = { +branddefs = { -- Indexed by valid values for loader_brand in loader.conf(5). Valid -- keys are: graphic (table depicting graphic) ["fbsd"] = { @@ -321,15 +321,7 @@ drawer.branddefs = { }, } -function drawer.addBrand(name, def) - drawer.branddefs[name] = def -end - -function drawer.addLogo(name, def) - drawer.logodefs[name] = def -end - -drawer.logodefs = { +logodefs = { -- Indexed by valid values for loader_logo in loader.conf(5). Valid keys -- are: requires_color (boolean), graphic (table depicting graphic), and -- shift (table containing x and y). @@ -344,6 +336,24 @@ drawer.logodefs = { shift = {x = 17, y = 0}, }, } + +brand_position = {x = 2, y = 1} +logo_position = {x = 46, y = 4} +menu_position = {x = 5, y = 10} +frame_size = {w = 42, h = 13} +default_shift = {x = 0, y = 0} +shift = default_shift + +-- Module exports +drawer.default_brand = 'fbsd' + +function drawer.addBrand(name, def) + branddefs[name] = def +end + +function drawer.addLogo(name, def) + logodefs[name] = def +end drawer.frame_styles = { -- Indexed by valid values for loader_menu_frame in loader.conf(5). From owner-svn-src-all@freebsd.org Sun Aug 19 18:40:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 328101073DD1; Sun, 19 Aug 2018 18:40:22 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C08F184A70; Sun, 19 Aug 2018 18:40:21 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 8C80425D3860; Sun, 19 Aug 2018 18:40:13 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id A2B34D1F83A; Sun, 19 Aug 2018 18:40:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id FJcCpecpvRdu; Sun, 19 Aug 2018 18:40:11 +0000 (UTC) Received: from [192.168.124.1] (fresh-ayiya.sbone.de [IPv6:fde9:577b:c1a9:f001::2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id DBF66D1F833; Sun, 19 Aug 2018 18:40:10 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Michael Tuexen" Cc: cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r338053 - head/sys/netinet Date: Sun, 19 Aug 2018 18:40:09 +0000 X-Mailer: MailMate (2.0BETAr6116) Message-ID: In-Reply-To: <97661C9D-9C25-4DE0-89A8-FE1C40DAFB81@freebsd.org> References: <201808191456.w7JEuAZE069780@repo.freebsd.org> <97661C9D-9C25-4DE0-89A8-FE1C40DAFB81@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 18:40:22 -0000 On 19 Aug 2018, at 17:08, Michael Tuexen wrote: >> On 19. Aug 2018, at 18:35, Conrad Meyer wrote: >> >> On Sun, Aug 19, 2018 at 7:56 AM, Michael Tuexen >> wrote: >>> Author: tuexen >>> Date: Sun Aug 19 14:56:10 2018 >>> New Revision: 338053 >>> URL: https://svnweb.freebsd.org/changeset/base/338053 >>> >> How was this particular keyed hash function construction chosen? >> (Yes, I see it is the same initial TSN, but how was that selected?) > You mean: > > Why is FreeBSD using the MD5 with secret suffix as the keyed hash > function? > > I don't know, I have not implemented that. > > However, https://tools.ietf.org/html/rfc6528#section-3 suggests this, > OpenBSD uses a similar computation, but uses SHA512 instead of MD5, > NetBSD > seem to use the same computation as FreeBSD. > I guess using MD5 was an acceptable choice at the time the choice was > made. I am so happy we have a version control system where you could hopefully find out if the original committer left a decent commit message.. takes less than 60 seconds .. https://svnweb.freebsd.org/base?view=revision&revision=82122 /bz From owner-svn-src-all@freebsd.org Sun Aug 19 18:43:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA159107408E; Sun, 19 Aug 2018 18:43:11 +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 60D0F84EAB; Sun, 19 Aug 2018 18:43:11 +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 438B92346; Sun, 19 Aug 2018 18:43:11 +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 w7JIhBd8088195; Sun, 19 Aug 2018 18:43:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JIhBJh088194; Sun, 19 Aug 2018 18:43:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808191843.w7JIhBJh088194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 19 Aug 2018 18:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338067 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 338067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 18:43:11 -0000 Author: kevans Date: Sun Aug 19 18:43:10 2018 New Revision: 338067 URL: https://svnweb.freebsd.org/changeset/base/338067 Log: lualoader: Add drawer-exported variables for default logodefs Uncovered while writing the documentation from this, we previously explicitly fell back to orb or orbbw if an invalid or incompatible logodef was selected -- in contrast to branddefs, which have an exported variable that one can whip up a quick local.lua to override in a safe manner that works regardless of whether or not loader.conf(5) successfully loads. Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sun Aug 19 18:37:33 2018 (r338066) +++ head/stand/lua/drawer.lua Sun Aug 19 18:43:10 2018 (r338067) @@ -247,9 +247,9 @@ local function drawlogo() (not colored and logodef.requires_color) then -- Choose a sensible default if colored then - logodef = getLogodef("orb") + logodef = getLogodef(drawer.default_color_logodef) else - logodef = getLogodef("orbbw") + logodef = getLogodef(drawer.default_bw_logodef) end end @@ -346,6 +346,8 @@ shift = default_shift -- Module exports drawer.default_brand = 'fbsd' +drawer.default_color_logodef = 'orb' +drawer.default_bw_logodef = 'orbbw' function drawer.addBrand(name, def) branddefs[name] = def From owner-svn-src-all@freebsd.org Sun Aug 19 18:47:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCCFD10742CA; Sun, 19 Aug 2018 18:47:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 92C4285190; Sun, 19 Aug 2018 18:47:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73F4C2352; Sun, 19 Aug 2018 18:47:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JIlIJA088429; Sun, 19 Aug 2018 18:47:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JIlHof088422; Sun, 19 Aug 2018 18:47:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808191847.w7JIlHof088422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 Aug 2018 18:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338068 - in head/sys/amd64: amd64 include vmm/intel X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: amd64 include vmm/intel X-SVN-Commit-Revision: 338068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 18:47:19 -0000 Author: kib Date: Sun Aug 19 18:47:16 2018 New Revision: 338068 URL: https://svnweb.freebsd.org/changeset/base/338068 Log: Update L1TF workaround to sustain L1D pollution from NMI. Current mitigation for L1TF in bhyve flushes L1D either by an explicit WRMSR command, or by software reading enough uninteresting data to fully populate all lines of L1D. If NMI occurs after either of methods is completed, but before VM entry, L1D becomes polluted with the cache lines touched by NMI handlers. There is no interesting data which NMI accesses, but something sensitive might be co-located on the same cache line, and then L1TF exposes that to a rogue guest. Use VM entry MSR load list to ensure atomicity of L1D cache and VM entry if updated microcode was loaded. If only software flush method is available, try to help the bhyve sw flusher by also flushing L1D on NMI exit to kernel mode. Suggested by and discussed with: Andrew Cooper Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D16790 Modified: head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/support.S head/sys/amd64/amd64/trap.c head/sys/amd64/include/md_var.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/intel/vmx_support.S Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Sun Aug 19 18:43:10 2018 (r338067) +++ head/sys/amd64/amd64/exception.S Sun Aug 19 18:47:16 2018 (r338068) @@ -864,7 +864,10 @@ nocallchain: movl %edx,%eax shrq $32,%rdx wrmsr - movq %r13,%cr3 + cmpb $0, nmi_flush_l1d_sw(%rip) + je 2f + call flush_l1d_sw /* bhyve L1TF assist */ +2: movq %r13,%cr3 RESTORE_REGS addq $TF_RIP,%rsp jmp doreti_iret Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Sun Aug 19 18:43:10 2018 (r338067) +++ head/sys/amd64/amd64/support.S Sun Aug 19 18:47:16 2018 (r338068) @@ -1225,3 +1225,36 @@ ENTRY(handle_ibrs_exit_rs) END(handle_ibrs_exit_rs) .noaltmacro + +/* + * Flush L1D cache. Load enough of the data from the kernel text + * to flush existing L1D content. + * + * N.B. The function follows ABI calling conventions, but the vmm.ko + * caller expects that only %rax, %rcx, %r9, and %rflags registers + * are clobbered. + */ +ENTRY(flush_l1d_sw) +#define L1D_FLUSH_SIZE (64 * 1024) + movq $KERNBASE, %r9 + movq $-L1D_FLUSH_SIZE, %rcx + /* + * pass 1: Preload TLB. + * Kernel text is mapped using superpages. TLB preload is + * done for the benefit of older CPUs which split 2M page + * into 4k TLB entries. + */ +1: movb L1D_FLUSH_SIZE(%r9, %rcx), %al + addq $PAGE_SIZE, %rcx + jne 1b + xorl %eax, %eax + cpuid + movq $-L1D_FLUSH_SIZE, %rcx + /* pass 2: Read each cache line. */ +2: movb L1D_FLUSH_SIZE(%r9, %rcx), %al + addq $64, %rcx + jne 2b + lfence + ret +#undef L1D_FLUSH_SIZE +END(flush_l1d_sw) Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sun Aug 19 18:43:10 2018 (r338067) +++ head/sys/amd64/amd64/trap.c Sun Aug 19 18:47:16 2018 (r338068) @@ -161,6 +161,20 @@ SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG "Print debugging information on trap signal to ctty"); /* + * Control L1D flush on return from NMI. + * + * Tunable can be set to the following values: + * 0 - only enable flush on return from NMI if required by vmm.ko (default) + * >1 - always flush on return from NMI. + * + * Post-boot, the sysctl indicates if flushing is currently enabled. + */ +int nmi_flush_l1d_sw; +SYSCTL_INT(_machdep, OID_AUTO, nmi_flush_l1d_sw, CTLFLAG_RWTUN, + &nmi_flush_l1d_sw, 0, + "Flush L1 Data Cache on NMI exit, software bhyve L1TF mitigation assist"); + +/* * Exception, fault, and trap interface to the FreeBSD kernel. * This common code is called from assembly language IDT gate entry * routines that prepare a suitable stack frame, and restore this Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Sun Aug 19 18:43:10 2018 (r338067) +++ head/sys/amd64/include/md_var.h Sun Aug 19 18:47:16 2018 (r338068) @@ -40,6 +40,7 @@ extern uint64_t *vm_page_dump; extern int hw_lower_amd64_sharedpage; extern int hw_ibrs_disable; extern int hw_ssb_disable; +extern int nmi_flush_l1d_sw; /* * The file "conf/ldscript.amd64" defines the symbol "kernphys". Its Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sun Aug 19 18:43:10 2018 (r338067) +++ head/sys/amd64/vmm/intel/vmx.c Sun Aug 19 18:47:16 2018 (r338068) @@ -191,8 +191,11 @@ SYSCTL_UINT(_hw_vmm_vmx, OID_AUTO, vpid_alloc_failed, static int guest_l1d_flush; SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, l1d_flush, CTLFLAG_RD, &guest_l1d_flush, 0, NULL); +static int guest_l1d_flush_sw; +SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, l1d_flush_sw, CTLFLAG_RD, + &guest_l1d_flush_sw, 0, NULL); -uint64_t vmx_msr_flush_cmd; +static struct msr_entry msr_load_list[1] __aligned(16); /* * The definitions of SDT probes for VMX. @@ -579,6 +582,9 @@ vmx_cleanup(void) vpid_unr = NULL; } + if (nmi_flush_l1d_sw == 1) + nmi_flush_l1d_sw = 0; + smp_rendezvous(NULL, vmx_disable, NULL, NULL); return (0); @@ -807,11 +813,30 @@ vmx_init(int ipinum) guest_l1d_flush = (cpu_ia32_arch_caps & IA32_ARCH_CAP_RDCL_NO) == 0; TUNABLE_INT_FETCH("hw.vmm.l1d_flush", &guest_l1d_flush); - if (guest_l1d_flush && - (cpu_stdext_feature3 & CPUID_STDEXT3_L1D_FLUSH) != 0) - vmx_msr_flush_cmd = IA32_FLUSH_CMD_L1D; /* + * L1D cache flush is enabled. Use IA32_FLUSH_CMD MSR when + * available. Otherwise fall back to the software flush + * method which loads enough data from the kernel text to + * flush existing L1D content, both on VMX entry and on NMI + * return. + */ + if (guest_l1d_flush) { + if ((cpu_stdext_feature3 & CPUID_STDEXT3_L1D_FLUSH) == 0) { + guest_l1d_flush_sw = 1; + TUNABLE_INT_FETCH("hw.vmm.l1d_flush_sw", + &guest_l1d_flush_sw); + } + if (guest_l1d_flush_sw) { + if (nmi_flush_l1d_sw <= 1) + nmi_flush_l1d_sw = 1; + } else { + msr_load_list[0].index = MSR_IA32_FLUSH_CMD; + msr_load_list[0].val = IA32_FLUSH_CMD_L1D; + } + } + + /* * Stash the cr0 and cr4 bits that must be fixed to 0 or 1 */ fixed0 = rdmsr(MSR_VMX_CR0_FIXED0); @@ -999,6 +1024,15 @@ vmx_vminit(struct vm *vm, pmap_t pmap) error += vmwrite(VMCS_ENTRY_CTLS, entry_ctls); error += vmwrite(VMCS_MSR_BITMAP, vtophys(vmx->msr_bitmap)); error += vmwrite(VMCS_VPID, vpid[i]); + + if (guest_l1d_flush && !guest_l1d_flush_sw) { + vmcs_write(VMCS_ENTRY_MSR_LOAD, pmap_kextract( + (vm_offset_t)&msr_load_list[0])); + vmcs_write(VMCS_ENTRY_MSR_LOAD_COUNT, + nitems(msr_load_list)); + vmcs_write(VMCS_EXIT_MSR_STORE, 0); + vmcs_write(VMCS_EXIT_MSR_STORE_COUNT, 0); + } /* exception bitmap */ if (vcpu_trace_exceptions(vm, i)) Modified: head/sys/amd64/vmm/intel/vmx_support.S ============================================================================== --- head/sys/amd64/vmm/intel/vmx_support.S Sun Aug 19 18:43:10 2018 (r338067) +++ head/sys/amd64/vmm/intel/vmx_support.S Sun Aug 19 18:47:16 2018 (r338068) @@ -176,44 +176,10 @@ ENTRY(vmx_enter_guest) jbe invept_error /* Check invept instruction error */ guest_restore: - - /* - * Flush L1D cache if requested. Use IA32_FLUSH_CMD MSR if available, - * otherwise load enough of the data from the zero_region to flush - * existing L1D content. - */ -#define L1D_FLUSH_SIZE (64 * 1024) movl %edx, %r8d - cmpb $0, guest_l1d_flush(%rip) + cmpb $0, guest_l1d_flush_sw(%rip) je after_l1d - movq vmx_msr_flush_cmd(%rip), %rax - testq %rax, %rax - jz 1f - movq %rax, %rdx - shrq $32, %rdx - movl $MSR_IA32_FLUSH_CMD, %ecx - wrmsr - jmp after_l1d -1: movq $KERNBASE, %r9 - movq $-L1D_FLUSH_SIZE, %rcx - /* - * pass 1: Preload TLB. - * Kernel text is mapped using superpages. TLB preload is - * done for the benefit of older CPUs which split 2M page - * into 4k TLB entries. - */ -2: movb L1D_FLUSH_SIZE(%r9, %rcx), %al - addq $PAGE_SIZE, %rcx - jne 2b - xorl %eax, %eax - cpuid - movq $-L1D_FLUSH_SIZE, %rcx - /* pass 2: Read each cache line */ -3: movb L1D_FLUSH_SIZE(%r9, %rcx), %al - addq $64, %rcx - jne 3b - lfence -#undef L1D_FLUSH_SIZE + call flush_l1d_sw after_l1d: cmpl $0, %r8d je do_launch From owner-svn-src-all@freebsd.org Sun Aug 19 18:54:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AD141074695; Sun, 19 Aug 2018 18:54:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 C577C8584A; Sun, 19 Aug 2018 18:54:43 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A275924F4; Sun, 19 Aug 2018 18:54:43 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JIsheY093508; Sun, 19 Aug 2018 18:54:43 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JIshSU093507; Sun, 19 Aug 2018 18:54:43 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201808191854.w7JIshSU093507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 19 Aug 2018 18:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338069 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 338069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 18:54:44 -0000 Author: jhibbits Date: Sun Aug 19 18:54:43 2018 New Revision: 338069 URL: https://svnweb.freebsd.org/changeset/base/338069 Log: booke pmap: hide debug-ish printf behind bootverbose It's not necessary during normal operation to know the mapped region size and wasted space. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sun Aug 19 18:47:16 2018 (r338068) +++ head/sys/powerpc/booke/pmap.c Sun Aug 19 18:54:43 2018 (r338069) @@ -4177,8 +4177,9 @@ tlb1_mapin_region(vm_offset_t va, vm_paddr_t pa, vm_si } mapped = (va - base); - printf("mapped size 0x%"PRI0ptrX" (wasted space 0x%"PRIxPTR")\n", - mapped, mapped - size); + if (bootverbose) + printf("mapped size 0x%"PRIxPTR" (wasted space 0x%"PRIxPTR")\n", + mapped, mapped - size); return (mapped); } From owner-svn-src-all@freebsd.org Sun Aug 19 18:55:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 424AE107474A; Sun, 19 Aug 2018 18:55:35 +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 E7309859DB; Sun, 19 Aug 2018 18:55:34 +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 C842524F6; Sun, 19 Aug 2018 18:55:34 +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 w7JItYdi093617; Sun, 19 Aug 2018 18:55:34 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JItYqF093614; Sun, 19 Aug 2018 18:55:34 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808191855.w7JItYqF093614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 19 Aug 2018 18:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338070 - in head/sys: arm/allwinner arm64/conf conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner arm64/conf conf X-SVN-Commit-Revision: 338070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 18:55:35 -0000 Author: manu Date: Sun Aug 19 18:55:33 2018 New Revision: 338070 URL: https://svnweb.freebsd.org/changeset/base/338070 Log: arm64: allwinner: Add aw_syscon driver to GENERIC Recent DTS use the syscon for the emac controller. We support this but since U-Boot is still using old DTS it was never needed for us to add this support, but this is a problem when using upstream recent DTS and will be when U-Boot will catch up. While here add a new compatible to the aw_syscon driver as Linux changed it ... Modified: head/sys/arm/allwinner/aw_syscon.c head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm/allwinner/aw_syscon.c ============================================================================== --- head/sys/arm/allwinner/aw_syscon.c Sun Aug 19 18:54:43 2018 (r338069) +++ head/sys/arm/allwinner/aw_syscon.c Sun Aug 19 18:55:33 2018 (r338070) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); static struct ofw_compat_data compat_data[] = { {"allwinner,sun50i-a64-system-controller", 1}, + {"allwinner,sun50i-a64-system-control", 1}, {"allwinner,sun8i-a83t-system-controller", 1}, {"allwinner,sun8i-h3-system-controller", 1}, {NULL, 0} Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sun Aug 19 18:54:43 2018 (r338069) +++ head/sys/arm64/conf/GENERIC Sun Aug 19 18:55:33 2018 (r338070) @@ -256,6 +256,7 @@ device hwreset device nvmem device regulator device syscon +device aw_syscon # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sun Aug 19 18:54:43 2018 (r338069) +++ head/sys/conf/files.arm64 Sun Aug 19 18:55:33 2018 (r338070) @@ -34,6 +34,7 @@ arm/allwinner/aw_rsb.c optional aw_rsb fdt arm/allwinner/aw_rtc.c optional aw_rtc fdt arm/allwinner/aw_sid.c optional aw_sid fdt arm/allwinner/aw_spi.c optional aw_spi fdt +arm/allwinner/aw_syscon.c optional aw_syscon ext_resources syscon fdt arm/allwinner/aw_thermal.c optional aw_thermal fdt arm/allwinner/aw_usbphy.c optional ehci aw_usbphy fdt arm/allwinner/aw_wdog.c optional aw_wdog fdt From owner-svn-src-all@freebsd.org Sun Aug 19 19:00:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6BE410749D7; Sun, 19 Aug 2018 19:00:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 9CF0D85CD4; Sun, 19 Aug 2018 19:00:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E2A82519; Sun, 19 Aug 2018 19:00:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JJ0iYp093910; Sun, 19 Aug 2018 19:00:44 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JJ0iqv093909; Sun, 19 Aug 2018 19:00:44 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201808191900.w7JJ0iqv093909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 19 Aug 2018 19:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338071 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 338071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 19:00:45 -0000 Author: jhibbits Date: Sun Aug 19 19:00:44 2018 New Revision: 338071 URL: https://svnweb.freebsd.org/changeset/base/338071 Log: powerpc64: Align frequently used/exclusive data on cacheline boundaries This is effectively a merge from amd64 of r312888, r323235, and r333486. I've been running this on my POWER9 Talos for some time now with no ill effects. Suggested by: mjg Modified: head/sys/conf/ldscript.powerpc64 Modified: head/sys/conf/ldscript.powerpc64 ============================================================================== --- head/sys/conf/ldscript.powerpc64 Sun Aug 19 18:55:33 2018 (r338070) +++ head/sys/conf/ldscript.powerpc64 Sun Aug 19 19:00:44 2018 (r338071) @@ -69,6 +69,20 @@ SECTIONS .sbss2 : { *(.sbss2) } /* Adjust the address for the data segment to the next page up. */ . = ALIGN(4096); + .data.read_frequently : + { + *(SORT_BY_ALIGNMENT(.data.read_frequently)) + } + .data.read_mostly : + { + *(.data.read_mostly) + } + . = ALIGN(128); + .data.exclusive_cache_line : + { + *(.data.exclusive_cache_line) + } + . = ALIGN(128); .data : { *(.data) From owner-svn-src-all@freebsd.org Sun Aug 19 19:03:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 637541074D71; Sun, 19 Aug 2018 19:03:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 1322A861EE; Sun, 19 Aug 2018 19:03:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E790C26BA; Sun, 19 Aug 2018 19:03:43 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JJ3hpR098662; Sun, 19 Aug 2018 19:03:43 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JJ3hGg098661; Sun, 19 Aug 2018 19:03:43 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201808191903.w7JJ3hGg098661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 19 Aug 2018 19:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338072 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 338072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 19:03:44 -0000 Author: jhibbits Date: Sun Aug 19 19:03:43 2018 New Revision: 338072 URL: https://svnweb.freebsd.org/changeset/base/338072 Log: Sort SPR_SPEFSCR in the SPR list Also remove duplicate definition of SPR_IBAT0U. Modified: head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sun Aug 19 19:00:44 2018 (r338071) +++ head/sys/powerpc/include/spr.h Sun Aug 19 19:03:43 2018 (r338072) @@ -229,7 +229,6 @@ #define EPCR_DGTMI 0x00800000 #define EPCR_DMIUH 0x00400000 #define EPCR_PMGS 0x00200000 -#define SPR_SPEFSCR 0x200 /* ..8 Signal Processing Engine FSCR. */ #define SPR_HSRR0 0x13a #define SPR_HSRR1 0x13b @@ -245,7 +244,7 @@ #define SPR_LPID 0x13f /* Logical Partitioning Control */ #define SPR_PTCR 0x1d0 /* Partition Table Control Register */ -#define SPR_IBAT0U 0x210 /* .68 Instruction BAT Reg 0 Upper */ +#define SPR_SPEFSCR 0x200 /* ..8 Signal Processing Engine FSCR. */ #define SPR_IBAT0U 0x210 /* .6. Instruction BAT Reg 0 Upper */ #define SPR_IBAT0L 0x211 /* .6. Instruction BAT Reg 0 Lower */ #define SPR_IBAT1U 0x212 /* .6. Instruction BAT Reg 1 Upper */ From owner-svn-src-all@freebsd.org Sun Aug 19 19:04:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86A3C1074DFC; Sun, 19 Aug 2018 19:04:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2439486346; Sun, 19 Aug 2018 19:04:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from odin.corp.delphij.net (unknown [IPv6:2601:646:8882:37a:d463:7d7:dec2:3842]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: delphij/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 3F3F71B371; Sun, 19 Aug 2018 19:04:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Subject: Re: svn commit: r338059 - in head: . contrib/ntp/lib/isc contrib/ntp/sntp/libevent crypto/heimdal/lib/roken crypto/openssh include lib/libc/gen lib/libc/include sys/crypto/chacha20 To: Oliver Pinter Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808191740.w7JHeoSj052259@repo.freebsd.org> From: Xin Li Openpgp: preference=signencrypt Autocrypt: addr=delphij@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFJNzwQBEACuPNSJjL/AD8oHFuG72vtx5P7Q6dpiEbFABgw/IohS65yDZDd3qFH9ssQv AsFafwB/ofsk6t7dx6zIC05dv5qjhGIOKSJxFC4U1HAot9+QpeUG+8boTKZiiycrMruItj2U JANlv+gN5h0mAsL5f9eNzhRM43kdjN8cQnBIujhO54Derjnrnqz6cQtoonV6SvvVJZUQGxHK 5R1XYJ6wiTuvoEuRYnNObJmPFWZyYOaGZz0qqD6Qe1BhkZuRzv2bZxwJc3Raap/GF6Pm9J/c hlYHUmm2QLaXvmoP8WNosNjla1fup0tgYQE+7MTtHFVxmVj9ZTihN3rEL5IkeEKjQAqcpe1n Db8X2o4K262LRpFl8WtVMW2TfN5Avpj+knZMl3tkYGvYK/nfadCr6Af4co9mkhX6QYgkerg2 mXEGaQzSD/omnsxHCfqMgdphaX3B3eoY2Fv36BMpjSdHmm0rmwqjqZaqlZn89vQ/I6ATvLyx JsdHwTbrj57audl/RKC+OpREOJPaVULp1L+9zdBXslILO8MJaT6YEw1T29bEj5jvLm03Y4rF u/YTruHcMPpsGbpJckDKiy6ISAbMtPvz7/KR91xPHS6KExGiIakIX9xpIXIDKgq+ecEWwkFK PogoKqO6K0/GYkTRoKdXGzsILvIurtbPqSFqWzbRIyNOa82jowARAQABzRZYaW4gTGkgPGRA ZGVscGhpai5uZXQ+wsF9BBMBCgAnBQJTQvBFAhsjBQkJZgGABQsJCAcDBRUKCQgLBRYCAwEA Ah4BAheAAAoJEJW2GBstM+nsha4P/2Roa/REjZLZlIG1TKOxEDqmwc3fynX4w2g7/FXA7f7Z YO5N4vnnnQdJbDZDt4TJtiP1NHHdheQ5+loJrrCXVlU31LuJv1ebM2Ajsuo/0l3tfulEf6Ki GoozmaNZAhwiGJkQVg9DSKsea5xIA31lPnFH4T0SKn8Q6F4HYienmJJtlKVTADvYXA+DRmv0 rNOyVe+V/AuTFuelKg3Ua5a+dY3oqtrQQvFS4n7iIrNjEMUBVx0XTrYLddnF+YjXDg5Phf0D pV/2yJOXiTGiZMK6i7vwHZkJvarACoTSrUrr6OBuZv5Gf87VgifZKLr2Fuf+FePiVCoZTQiL 0hPQyABMzeWa32P6BY2LBMMMFvFiyL5pN5k6nJ0nx4skl8UxZ5ay4yyVg2u3f4aI3+m0XlZ+ iixrjmCTGi1s+d/n6E3eFXdJUUbSOXLZaU4qrbXRzTYCZmZViryv7ibtOHXnG6oWy7BFEHuT rUW6OBvsQDTp5iQ6opENJ5/ZzSA3c5p1WS9Ezv4Bpdqcm7LTQX2j6kXikj8YqICtDF2rkKZ2 Ynjm9se9B0h/T1SOaSpbtRg05UKjsinDq2x8EeX21yFs3UyvwePLrGoNKL45EJM0xwxrnlfr M0ayKJNLoYysY78d54hg7XMmkQD/oZz9I+k4fN6CmZ2i5WGH2BgYs0313JMHxSg7zsFNBFJN zwQBEADPtS+nfTKM6PwgSWLDGVgUYQ/RLaKzCcpQAf4ryLBugXpx3s2BBT1bixX7CpsLXKQi +RRETgSFzDaBL9SEs2ZDV2YT+zGp08aijK/Yl9+RIeezAukI3c+XMHuo8ktUWJmo5/1DX07q G30ckG7uFuTnt31sFzwhh/ZeSuLFyel/fWF48KExLDIVa8DyEUJaYvE9Vfph4T/3LkKuzVTy +iwUBLiSLj5G5N70A+4usbL3eKyYrJqCSaLfrP99/nlgBhMAHVcKcv0uqSuiaH9OMqg1VjQs N8j6NDQug9QrbBTM6U7oZWF/AK+CdFoe+leq5MZfzwCevs0BQgxWm4SHMpXL2vtly67QSPMY dl96fOzw8YbKHv1o0ixhCvc37cI9oUVuSJLXKhEEAvWvLuusiuNeoz+6aPlELvD8h5txJqui tVOzctvJ7ktGZTNiz73tKYVdkKaQVyo8QJFLCNLnUulrQ5wXwteYPg6mrpBxu9VqgDrMp7eB T2kaZ4GRBoMWXXPYSIEe5PM5hhNCsSUfqrKj34UZPijPe+HiWoFJ4S5vIpzutiae11Ctki7u XzeLAhOJQB2raraIqDlFP9I9Zj9JOAZhmiKSEWKfOooCNxQYGiUdPrdYnAe+m7FXRomjF0OO gSepNIESt2gOEIbE5cMxQ0gAueNJc58eHCjWhsNJIwARAQABwsFlBBgBCgAPBQJSTc8EAhsM BQkJZgGAAAoJEJW2GBstM+nsh8EP/1sxZpkJelu+smmqaqdrGHlNrFVLOmeN5yr2IGHBUbmF htjr7fVoU8T0mUnlUU724aKPla4nWhMb4NMu+VxRRFGaT2TYpyR6VIxaStycyUdMGjdXV0Pz TGmxFXhNZXKEITXH9sIxuONBp1czl4AgwN7AAl1MKyV13AaLIyajs58mYmuXtyFn/O+4lxh5 nl2Fa3L9YkL9O7QU2p6WAnDky+L3PgUWp1AzJGfYlLZ8XXCi+KK+pnta+f9yKHt/Oqd/s7OC W4mXgFkBrfuSZZofa4eZckh5u0yBYW3OnEJhClgxRbuOhyYwqQr5oxPrQtjtbMiBzbrOkHhy NnrVCFd9EqlojREGDefHo3V+ZlUOc6OoN3CAYnNa2uLEOm5DCuqOE4z5atBCih5EyITPp7JP J2disEP6ddipcilqbnJdP+TyRQwSv5qRNy8cHahD1Cg9XJJHiC3qr+W3eOtqPkJxhU5biPEr 7dljaLS1Ij771brzqO/x5zW1L9py7muXzYBsW8+keKj8LOYs2242KgjI5Og9YhIJGBFBNddQ wxKBKQpytKQOiXwjhk4Nj77U796bsCd/jIS0r0ZUKBEptPyKso7ncfrm163aEmSaDUkiIjyp 9CEOVT87D+VAVh9PyLGP1niQzWEWFSK36tRGZlF0odP1ZB6wub9zq2DxFouSjHgH Organization: The FreeBSD Project Message-ID: Date: Sun, 19 Aug 2018 12:04:22 -0700 User-Agent: Thunderbird MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eeiQhzNJ1EI3a3mnEDtJirIMMYRKnOj1m" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 19:04:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --eeiQhzNJ1EI3a3mnEDtJirIMMYRKnOj1m Content-Type: multipart/mixed; boundary="F5ncgHEcc1s6LUxBlaulLdj6aIhmBfVjD"; protected-headers="v1" From: Xin Li To: Oliver Pinter Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r338059 - in head: . contrib/ntp/lib/isc contrib/ntp/sntp/libevent crypto/heimdal/lib/roken crypto/openssh include lib/libc/gen lib/libc/include sys/crypto/chacha20 References: <201808191740.w7JHeoSj052259@repo.freebsd.org> In-Reply-To: --F5ncgHEcc1s6LUxBlaulLdj6aIhmBfVjD Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 8/19/18 11:27, Oliver Pinter wrote: >> Modified: head/crypto/heimdal/lib/roken/rand.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/crypto/heimdal/lib/roken/rand.c Sun Aug 19 17:36:50 2018 (r33= 8058) >> +++ head/crypto/heimdal/lib/roken/rand.c Sun Aug 19 17:40:50 2018 (r33= 8059) >> @@ -37,7 +37,6 @@ void ROKEN_LIB_FUNCTION >> rk_random_init(void) >> { >> #if defined(HAVE_ARC4RANDOM) >> - arc4random_stir(); >> #elif defined(HAVE_SRANDOMDEV) >> srandomdev(); >> #elif defined(HAVE_RANDOM) >=20 > This hunk of the patch looks weird. >=20 > Isn't it would better to undef HAVE_ARC4RANDOM without deleting the > arc4random_stir()? > Or delete the macro part of detection like No that would be wrong. The intention is to explicitly say "If HAVE_ARC4RANDOM, do nothing for rk_random_init()". undef HAVE_ARC4RANDOM is not an option because that means the code would no longer use arc4random(). Cheers, --F5ncgHEcc1s6LUxBlaulLdj6aIhmBfVjD-- --eeiQhzNJ1EI3a3mnEDtJirIMMYRKnOj1m Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJbeb85AAoJEJW2GBstM+nsRcUP/1rTvZSzkN9N0gEpgcUse77l qgVvkQV9cTnmEBLCPEzLQMbpfkSn9YqWmphmwQNNP8E34EM/ywxrr0bqZF0P4ceU ZFZC1aURr6WW08YyyoTEfHrYfl5Ku/yA/qN82BNnpuV5mcCMLL7sVTcV4uqZBMUu U3cKFDPbxjzwU28whnejLh/HkZmDa6Gq7KmyqS3fKvjdBga8dylPcTxmb98UdHwZ 8A5EUpQY/ezEKKBcvsPl/oTxxrVfL2ICOjNvKSvhzOu6kmmVrDjdwxjTKyD8JGoE 3w0Yt26ctwJ58buKVB+mZdmenLPCS4S0InfzfqBzQWeimYTBKXdiyU3dP9rFolx2 GA/Yp7q86khhucBRnvkNtjCj/VCUYzNcPUOpI7v5tk/DJ6jSR06xSG1COBFJPDrF 8N06oRGbFYvTL4xGdrLcKC/4tUlGGLdfT0UdF6ZSMG7tct6iPWO/lca0zw5ZZWZv GRcB8RDDQ0giEy0Ao+773SnJW0uYn4ZxBN3y5Wzjwf4jjoYOFTl1wjE4WHhpY53J 3eywgfKPSeCsp4uvI0+vgZjptZcSMXNJB0rKci5vs+YPZRscdXq2LW4flRcbZJrh xsB8/W97Zv7cnEY3sSfyPSGwWaP8DEu7HsV0KVQEt4+2zl40zi4AOUxpAGYCQr+I F41fWcT2ltnLSG9raqhZ =uAhd -----END PGP SIGNATURE----- --eeiQhzNJ1EI3a3mnEDtJirIMMYRKnOj1m-- From owner-svn-src-all@freebsd.org Sun Aug 19 19:08:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CE041074F88; Sun, 19 Aug 2018 19:08:00 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 D431B865A1; Sun, 19 Aug 2018 19:07:59 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFDA326E2; Sun, 19 Aug 2018 19:07:59 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JJ7xm1098888; Sun, 19 Aug 2018 19:07:59 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JJ7xEZ098886; Sun, 19 Aug 2018 19:07:59 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201808191907.w7JJ7xEZ098886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 19 Aug 2018 19:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338073 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 338073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 19:08:00 -0000 Author: jhibbits Date: Sun Aug 19 19:07:59 2018 New Revision: 338073 URL: https://svnweb.freebsd.org/changeset/base/338073 Log: powerpc conf: Add PRINTF_BUFR_SIZE option to Book-E configs Without this, printf is very hard to follow at times on multicore systems. Modified: head/sys/powerpc/conf/MPC85XX head/sys/powerpc/conf/MPC85XXSPE Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Sun Aug 19 19:03:43 2018 (r338072) +++ head/sys/powerpc/conf/MPC85XX Sun Aug 19 19:07:59 2018 (r338073) @@ -47,6 +47,7 @@ options MSDOSFS options NFS_ROOT options NFSCL options NFSLOCKD +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options PROCFS options PSEUDOFS options SCHED_ULE Modified: head/sys/powerpc/conf/MPC85XXSPE ============================================================================== --- head/sys/powerpc/conf/MPC85XXSPE Sun Aug 19 19:03:43 2018 (r338072) +++ head/sys/powerpc/conf/MPC85XXSPE Sun Aug 19 19:07:59 2018 (r338073) @@ -47,6 +47,7 @@ options MSDOSFS options NFS_ROOT options NFSCL options NFSLOCKD +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options PROCFS options PSEUDOFS options SCHED_ULE From owner-svn-src-all@freebsd.org Sun Aug 19 19:12:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4648010751DA; Sun, 19 Aug 2018 19:12:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9364869B4; Sun, 19 Aug 2018 19:12:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from odin.corp.delphij.net (unknown [IPv6:2601:646:8882:37a:d463:7d7:dec2:3842]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: delphij/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 3AECB1B470; Sun, 19 Aug 2018 19:12:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808191740.w7JHeoSj052259@repo.freebsd.org> <1534703254.27158.41.camel@freebsd.org> From: Xin Li Openpgp: preference=signencrypt Autocrypt: addr=delphij@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFJNzwQBEACuPNSJjL/AD8oHFuG72vtx5P7Q6dpiEbFABgw/IohS65yDZDd3qFH9ssQv AsFafwB/ofsk6t7dx6zIC05dv5qjhGIOKSJxFC4U1HAot9+QpeUG+8boTKZiiycrMruItj2U JANlv+gN5h0mAsL5f9eNzhRM43kdjN8cQnBIujhO54Derjnrnqz6cQtoonV6SvvVJZUQGxHK 5R1XYJ6wiTuvoEuRYnNObJmPFWZyYOaGZz0qqD6Qe1BhkZuRzv2bZxwJc3Raap/GF6Pm9J/c hlYHUmm2QLaXvmoP8WNosNjla1fup0tgYQE+7MTtHFVxmVj9ZTihN3rEL5IkeEKjQAqcpe1n Db8X2o4K262LRpFl8WtVMW2TfN5Avpj+knZMl3tkYGvYK/nfadCr6Af4co9mkhX6QYgkerg2 mXEGaQzSD/omnsxHCfqMgdphaX3B3eoY2Fv36BMpjSdHmm0rmwqjqZaqlZn89vQ/I6ATvLyx JsdHwTbrj57audl/RKC+OpREOJPaVULp1L+9zdBXslILO8MJaT6YEw1T29bEj5jvLm03Y4rF u/YTruHcMPpsGbpJckDKiy6ISAbMtPvz7/KR91xPHS6KExGiIakIX9xpIXIDKgq+ecEWwkFK PogoKqO6K0/GYkTRoKdXGzsILvIurtbPqSFqWzbRIyNOa82jowARAQABzRZYaW4gTGkgPGRA ZGVscGhpai5uZXQ+wsF9BBMBCgAnBQJTQvBFAhsjBQkJZgGABQsJCAcDBRUKCQgLBRYCAwEA Ah4BAheAAAoJEJW2GBstM+nsha4P/2Roa/REjZLZlIG1TKOxEDqmwc3fynX4w2g7/FXA7f7Z YO5N4vnnnQdJbDZDt4TJtiP1NHHdheQ5+loJrrCXVlU31LuJv1ebM2Ajsuo/0l3tfulEf6Ki GoozmaNZAhwiGJkQVg9DSKsea5xIA31lPnFH4T0SKn8Q6F4HYienmJJtlKVTADvYXA+DRmv0 rNOyVe+V/AuTFuelKg3Ua5a+dY3oqtrQQvFS4n7iIrNjEMUBVx0XTrYLddnF+YjXDg5Phf0D pV/2yJOXiTGiZMK6i7vwHZkJvarACoTSrUrr6OBuZv5Gf87VgifZKLr2Fuf+FePiVCoZTQiL 0hPQyABMzeWa32P6BY2LBMMMFvFiyL5pN5k6nJ0nx4skl8UxZ5ay4yyVg2u3f4aI3+m0XlZ+ iixrjmCTGi1s+d/n6E3eFXdJUUbSOXLZaU4qrbXRzTYCZmZViryv7ibtOHXnG6oWy7BFEHuT rUW6OBvsQDTp5iQ6opENJ5/ZzSA3c5p1WS9Ezv4Bpdqcm7LTQX2j6kXikj8YqICtDF2rkKZ2 Ynjm9se9B0h/T1SOaSpbtRg05UKjsinDq2x8EeX21yFs3UyvwePLrGoNKL45EJM0xwxrnlfr M0ayKJNLoYysY78d54hg7XMmkQD/oZz9I+k4fN6CmZ2i5WGH2BgYs0313JMHxSg7zsFNBFJN zwQBEADPtS+nfTKM6PwgSWLDGVgUYQ/RLaKzCcpQAf4ryLBugXpx3s2BBT1bixX7CpsLXKQi +RRETgSFzDaBL9SEs2ZDV2YT+zGp08aijK/Yl9+RIeezAukI3c+XMHuo8ktUWJmo5/1DX07q G30ckG7uFuTnt31sFzwhh/ZeSuLFyel/fWF48KExLDIVa8DyEUJaYvE9Vfph4T/3LkKuzVTy +iwUBLiSLj5G5N70A+4usbL3eKyYrJqCSaLfrP99/nlgBhMAHVcKcv0uqSuiaH9OMqg1VjQs N8j6NDQug9QrbBTM6U7oZWF/AK+CdFoe+leq5MZfzwCevs0BQgxWm4SHMpXL2vtly67QSPMY dl96fOzw8YbKHv1o0ixhCvc37cI9oUVuSJLXKhEEAvWvLuusiuNeoz+6aPlELvD8h5txJqui tVOzctvJ7ktGZTNiz73tKYVdkKaQVyo8QJFLCNLnUulrQ5wXwteYPg6mrpBxu9VqgDrMp7eB T2kaZ4GRBoMWXXPYSIEe5PM5hhNCsSUfqrKj34UZPijPe+HiWoFJ4S5vIpzutiae11Ctki7u XzeLAhOJQB2raraIqDlFP9I9Zj9JOAZhmiKSEWKfOooCNxQYGiUdPrdYnAe+m7FXRomjF0OO gSepNIESt2gOEIbE5cMxQ0gAueNJc58eHCjWhsNJIwARAQABwsFlBBgBCgAPBQJSTc8EAhsM BQkJZgGAAAoJEJW2GBstM+nsh8EP/1sxZpkJelu+smmqaqdrGHlNrFVLOmeN5yr2IGHBUbmF htjr7fVoU8T0mUnlUU724aKPla4nWhMb4NMu+VxRRFGaT2TYpyR6VIxaStycyUdMGjdXV0Pz TGmxFXhNZXKEITXH9sIxuONBp1czl4AgwN7AAl1MKyV13AaLIyajs58mYmuXtyFn/O+4lxh5 nl2Fa3L9YkL9O7QU2p6WAnDky+L3PgUWp1AzJGfYlLZ8XXCi+KK+pnta+f9yKHt/Oqd/s7OC W4mXgFkBrfuSZZofa4eZckh5u0yBYW3OnEJhClgxRbuOhyYwqQr5oxPrQtjtbMiBzbrOkHhy NnrVCFd9EqlojREGDefHo3V+ZlUOc6OoN3CAYnNa2uLEOm5DCuqOE4z5atBCih5EyITPp7JP J2disEP6ddipcilqbnJdP+TyRQwSv5qRNy8cHahD1Cg9XJJHiC3qr+W3eOtqPkJxhU5biPEr 7dljaLS1Ij771brzqO/x5zW1L9py7muXzYBsW8+keKj8LOYs2242KgjI5Og9YhIJGBFBNddQ wxKBKQpytKQOiXwjhk4Nj77U796bsCd/jIS0r0ZUKBEptPyKso7ncfrm163aEmSaDUkiIjyp 9CEOVT87D+VAVh9PyLGP1niQzWEWFSK36tRGZlF0odP1ZB6wub9zq2DxFouSjHgH Organization: The FreeBSD Project Subject: Re: svn commit: r338059 - in head: . contrib/ntp/lib/isc contrib/ntp/sntp/libevent crypto/heimdal/lib/roken crypto/openssh include lib/libc/gen lib/libc/include sys/crypto/chacha20 Message-ID: <2012d319-ef2b-d734-5f1a-7b11d9511024@FreeBSD.org> Date: Sun, 19 Aug 2018 12:12:25 -0700 User-Agent: Thunderbird MIME-Version: 1.0 In-Reply-To: <1534703254.27158.41.camel@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HpnDT9IALga4s6AAzS10JJ8WFF6frutrF" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 19:12:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HpnDT9IALga4s6AAzS10JJ8WFF6frutrF Content-Type: multipart/mixed; boundary="jScKxObTQ7OxANfKZokTRg4DqRAxvR03P"; protected-headers="v1" From: Xin Li To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <2012d319-ef2b-d734-5f1a-7b11d9511024@FreeBSD.org> Subject: Re: svn commit: r338059 - in head: . contrib/ntp/lib/isc contrib/ntp/sntp/libevent crypto/heimdal/lib/roken crypto/openssh include lib/libc/gen lib/libc/include sys/crypto/chacha20 References: <201808191740.w7JHeoSj052259@repo.freebsd.org> <1534703254.27158.41.camel@freebsd.org> In-Reply-To: <1534703254.27158.41.camel@freebsd.org> --jScKxObTQ7OxANfKZokTRg4DqRAxvR03P Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 8/19/18 11:27, Ian Lepore wrote: > On Sun, 2018-08-19 at 17:40 +0000, Xin LI wrote: >> Author: delphij >> Date: Sun Aug 19 17:40:50 2018 >> New Revision: 338059 >> URL: https://svnweb.freebsd.org/changeset/base/338059 >> >> Log: >> =C2=A0 Update userland arc4random() with OpenBSD's Chacha20 based >> arc4random(). >> =C2=A0=C2=A0 >> =C2=A0=C2=A0=C2=A0=C2=A0ObsoleteFiles.inc: >> =C2=A0=C2=A0 >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Remove manual pages for arc4random= _addrandom(3) and >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0arc4random_stir(3). >> =C2=A0=C2=A0 >> =C2=A0=C2=A0=C2=A0=C2=A0contrib/ntp/lib/isc/random.c: >> =C2=A0=C2=A0=C2=A0=C2=A0contrib/ntp/sntp/libevent/evutil_rand.c: >> =C2=A0=C2=A0 >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Eliminate in-tree usage of arc4ran= dom_addrandom(). >> =C2=A0=C2=A0 >=20 > If we don't feed changes for this back upstream, we're going to have to= I'll send these to upstream. > carry diffs from mainline ntpd forever now. The upstream project is > receptive to taking diffs from us, but I guess we'd have to figure out > how to write some autotools detection to create some new HAVE_xxxx > variables for wrapping these calls. Calling arc4random_stir() is not required since ~2000. > Also, does this imply that the ntpd port will fail to build now? I > would imagine removing such fundamental routines would affect many > ports. Not right now (due to the existence of stdlib.h shims). > All in all, if it's just a matter of our implementation not needing > these functions, wouldn't it be better to implement them as no-ops and > document them as such existing only to aid porting existing code? They are implemented as ABI shims but my intention (bug 230756) is to remove the obsolete APIs (after a full exprun and have the callers fixed, of course). It's reasonable to provide ABI compatibility (they will remain) but we should fix ports if they are still doing something that is not needed ~18 years ago :) Cheers, --jScKxObTQ7OxANfKZokTRg4DqRAxvR03P-- --HpnDT9IALga4s6AAzS10JJ8WFF6frutrF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJbecEZAAoJEJW2GBstM+nsyIUP/1rIc+sHC3pKpqFzIPi1mVK9 QYCfhY/jZ+TSxFP5DyHCS6D2/3ixowrCN6Qw/lssriV3asmPcmuLnY+n+OKUENF/ gxdI/77gOWw0olVx+5kWOHn5KMfIXt6s39oWRU6X771iVOpaFrhdXIjnTXna3GVv exS8F29l4DwJyfgb8xDq1HEV19g1ZD38SgCQ/iBXHdAj23NEEKL+f/By2WDagi+R DSH/Y95SDVrQz9znzB4XKeJ+zMy5uyzP3h560tan2ybVuqJrNxHTUyQxCgw8Ga6b P5s7ztgjlweXf3cdzNSUnHcYUAUyeqLfU9PNVNSRabIc21aBoWZo4Fkum83sQ2bh okHupDpXm309vAPPcISv7y34gV4s70++BJ9e9MVLBXxW3pk0/0cXmHkVJxo+xrsY 9toR6uHjAXjA+MH0Sw097diKgAefIK2vXZJQ1+zyMsTtmGxVPUv7D7u86quUe03Z f6q1zTeb4D3aejgF1auPPLdwjJX257fSr8J3sTCbis2f/ktvFDPdvV+gD3YNhJmW BPJLgGKjeykjWdlmj1fZarxgtYQPDGyGSjV8JJSb8ykj/711/JvVSa7JQifoRaRe 7MAhT0GIb40EHBfZc63frB5b9Iv2VqUddKjTRYNORkrk/pwkKUPFvKh1/KgP8ij/ VTb56rUXVEQy7jDvwJ27 =uP73 -----END PGP SIGNATURE----- --HpnDT9IALga4s6AAzS10JJ8WFF6frutrF-- From owner-svn-src-all@freebsd.org Sun Aug 19 21:10:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F5FB1078A0E; Sun, 19 Aug 2018 21:10:28 +0000 (UTC) (envelope-from mmacy@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 B7E268B798; Sun, 19 Aug 2018 21:10:27 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94F533E77; Sun, 19 Aug 2018 21:10:27 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JLAR7q062178; Sun, 19 Aug 2018 21:10:27 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JLALjH062150; Sun, 19 Aug 2018 21:10:21 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808192110.w7JLALjH062150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 19 Aug 2018 21:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338074 - in head/sys: arm/nvidia dev/acpica dev/uart mips/atheros mips/atheros/ar531x mips/broadcom mips/cavium mips/ingenic mips/malta modules/uart powerpc/psim sparc64/pci X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: arm/nvidia dev/acpica dev/uart mips/atheros mips/atheros/ar531x mips/broadcom mips/cavium mips/ingenic mips/malta modules/uart powerpc/psim sparc64/pci X-SVN-Commit-Revision: 338074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 21:10:28 -0000 Author: mmacy Date: Sun Aug 19 21:10:21 2018 New Revision: 338074 URL: https://svnweb.freebsd.org/changeset/base/338074 Log: add snps IP uart support / genaralize UART This is an amalgam of a patch by Doug Ambrisko to generalize uart_acpi_find_device, imp moving the ACPI table to uart_dev_ns8250.c and advice by jhb to work around a bug in the EPYC 3151 BIOS (the BIOS incorrectly marks the serial ports as disabled) Reviewed by: imp MFC after: 8 weeks Differential Revision: https://reviews.freebsd.org/D16432 Modified: head/sys/arm/nvidia/tegra_uart.c head/sys/dev/acpica/acpi.c head/sys/dev/uart/uart_bus.h head/sys/dev/uart/uart_bus_acpi.c head/sys/dev/uart/uart_bus_ebus.c head/sys/dev/uart/uart_bus_fdt.c head/sys/dev/uart/uart_bus_isa.c head/sys/dev/uart/uart_bus_pccard.c head/sys/dev/uart/uart_bus_pci.c head/sys/dev/uart/uart_bus_puc.c head/sys/dev/uart/uart_bus_scc.c head/sys/dev/uart/uart_core.c head/sys/dev/uart/uart_cpu_acpi.h head/sys/dev/uart/uart_cpu_arm64.c head/sys/dev/uart/uart_dev_ns8250.c head/sys/dev/uart/uart_dev_pl011.c head/sys/dev/uart/uart_dev_snps.c head/sys/mips/atheros/ar531x/uart_bus_ar5315.c head/sys/mips/atheros/uart_bus_ar71xx.c head/sys/mips/atheros/uart_bus_ar933x.c head/sys/mips/broadcom/uart_bus_chipc.c head/sys/mips/cavium/uart_bus_octeonusart.c head/sys/mips/ingenic/jz4780_uart.c head/sys/mips/malta/uart_bus_maltausart.c head/sys/modules/uart/Makefile head/sys/powerpc/psim/uart_iobus.c head/sys/sparc64/pci/sbbc.c Modified: head/sys/arm/nvidia/tegra_uart.c ============================================================================== --- head/sys/arm/nvidia/tegra_uart.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/arm/nvidia/tegra_uart.c Sun Aug 19 21:10:21 2018 (r338074) @@ -216,7 +216,7 @@ tegra_uart_probe(device_t dev) device_printf(dev, "Cannot enable UART clock: %d\n", rv); return (ENXIO); } - return (uart_bus_probe(dev, shift, 0, (int)freq, 0, 0)); + return (uart_bus_probe(dev, shift, 0, (int)freq, 0, 0, 0)); } static int Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/acpica/acpi.c Sun Aug 19 21:10:21 2018 (r338074) @@ -2221,6 +2221,15 @@ acpi_DeviceIsPresent(device_t dev) return (FALSE); status = acpi_GetInteger(h, "_STA", &s); + /* + * Onboard serial ports on certain AMD motherboards have an invalid _STA + * method that always returns 0. Force them to always be treated as present. + * + * This may solely be a quirk of a preproduction BIOS. + */ + if (acpi_MatchHid(h, "AMDI0020") || acpi_MatchHid(h, "AMDI0010")) + return (TRUE); + /* If no _STA method, must be present */ if (ACPI_FAILURE(status)) return (status == AE_NOT_FOUND ? TRUE : FALSE); Modified: head/sys/dev/uart/uart_bus.h ============================================================================== --- head/sys/dev/uart/uart_bus.h Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/uart/uart_bus.h Sun Aug 19 21:10:21 2018 (r338074) @@ -56,6 +56,9 @@ #define UART_IOCTL_OFLOW 3 #define UART_IOCTL_BAUD 4 +/* UART quirk flags */ +#define UART_F_BUSY_DETECT 0x1 + /* * UART class & instance (=softc) */ @@ -140,7 +143,7 @@ int uart_bus_detach(device_t dev); int uart_bus_resume(device_t dev); serdev_intr_t *uart_bus_ihand(device_t dev, int ipend); int uart_bus_ipend(device_t dev); -int uart_bus_probe(device_t dev, int regshft, int regiowidth, int rclk, int rid, int chan); +int uart_bus_probe(device_t dev, int regshft, int regiowidth, int rclk, int rid, int chan, int quirks); int uart_bus_sysdev(device_t dev); void uart_sched_softih(struct uart_softc *, uint32_t); Modified: head/sys/dev/uart/uart_bus_acpi.c ============================================================================== --- head/sys/dev/uart/uart_bus_acpi.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/uart/uart_bus_acpi.c Sun Aug 19 21:10:21 2018 (r338074) @@ -37,18 +37,14 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include - -#ifdef __aarch64__ #include #include #include -#endif + static int uart_acpi_probe(device_t dev); static device_method_t uart_acpi_methods[] = { @@ -66,59 +62,40 @@ static driver_t uart_acpi_driver = { sizeof(struct uart_softc), }; -#if defined(__i386__) || defined(__amd64__) -static struct isa_pnp_id acpi_ns8250_ids[] = { - {0x0005d041, "Standard PC COM port"}, /* PNP0500 */ - {0x0105d041, "16550A-compatible COM port"}, /* PNP0501 */ - {0x0205d041, "Multiport serial device (non-intelligent 16550)"}, /* PNP0502 */ - {0x1005d041, "Generic IRDA-compatible device"}, /* PNP0510 */ - {0x1105d041, "Generic IRDA-compatible device"}, /* PNP0511 */ - {0x04f0235c, "Wacom Tablet PC Screen"}, /* WACF004 */ - {0x0ef0235c, "Wacom Tablet PC Screen 00e"}, /* WACF00e */ - {0xe502aa1a, "Wacom Tablet at FuS Lifebook T"}, /* FUJ02E5 */ - {0} -}; -#endif - -#ifdef __aarch64__ -static struct uart_class * +static struct acpi_uart_compat_data * uart_acpi_find_device(device_t dev) { - struct acpi_uart_compat_data **cd; + struct acpi_uart_compat_data **cd, *cd_it; ACPI_HANDLE h; if ((h = acpi_get_handle(dev)) == NULL) return (NULL); SET_FOREACH(cd, uart_acpi_class_and_device_set) { - if (acpi_MatchHid(h, (*cd)->hid)) { - return ((*cd)->clas); + for (cd_it = *cd; cd_it->cd_hid != NULL; cd_it++) { + if (acpi_MatchHid(h, cd_it->cd_hid)) + return (cd_it); } } return (NULL); } -#endif static int uart_acpi_probe(device_t dev) { struct uart_softc *sc; + struct acpi_uart_compat_data *cd; sc = device_get_softc(dev); -#if defined(__i386__) || defined(__amd64__) - if (!ISA_PNP_PROBE(device_get_parent(dev), dev, acpi_ns8250_ids)) { - sc->sc_class = &uart_ns8250_class; - return (uart_bus_probe(dev, 0, 0, 0, 0, 0)); + if ((cd = uart_acpi_find_device(dev)) != NULL) { + sc->sc_class = cd->cd_class; + if (cd->cd_desc != NULL) + device_set_desc(dev, cd->cd_desc); + return (uart_bus_probe(dev, cd->cd_regshft, cd->cd_regiowidth, + cd->cd_rclk, 0, 0, cd->cd_quirks)); } - - /* Add checks for non-ns8250 IDs here. */ -#elif defined(__aarch64__) - if ((sc->sc_class = uart_acpi_find_device(dev)) != NULL) - return (uart_bus_probe(dev, 2, 0, 0, 0, 0)); -#endif - return (ENXIO); } Modified: head/sys/dev/uart/uart_bus_ebus.c ============================================================================== --- head/sys/dev/uart/uart_bus_ebus.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/uart/uart_bus_ebus.c Sun Aug 19 21:10:21 2018 (r338074) @@ -99,7 +99,7 @@ uart_ebus_probe(device_t dev) return (ENXIO); } sc->sc_class = &uart_ns8250_class; - return (uart_bus_probe(dev, 0, 0, 0, 0, 0)); + return (uart_bus_probe(dev, 0, 0, 0, 0, 0, 0)); } return (ENXIO); Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/uart/uart_bus_fdt.c Sun Aug 19 21:10:21 2018 (r338074) @@ -278,7 +278,7 @@ uart_fdt_probe(device_t dev) if (uart_fdt_get_io_width(node, &iowidth) != 0) iowidth = uart_getregiowidth(sc->sc_class); - return (uart_bus_probe(dev, (int)shift, (int)iowidth, (int)clock, 0, 0)); + return (uart_bus_probe(dev, (int)shift, (int)iowidth, (int)clock, 0, 0, 0)); } DRIVER_MODULE(uart, simplebus, uart_fdt_driver, uart_devclass, 0, 0); Modified: head/sys/dev/uart/uart_bus_isa.c ============================================================================== --- head/sys/dev/uart/uart_bus_isa.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/uart/uart_bus_isa.c Sun Aug 19 21:10:21 2018 (r338074) @@ -168,7 +168,7 @@ uart_isa_probe(device_t dev) /* Probe PnP _and_ non-PnP ns8250 here. */ sc->sc_class = &uart_ns8250_class; - return (uart_bus_probe(dev, 0, 0, 0, 0, 0)); + return (uart_bus_probe(dev, 0, 0, 0, 0, 0, 0)); } DRIVER_MODULE(uart, isa, uart_isa_driver, uart_devclass, 0, 0); Modified: head/sys/dev/uart/uart_bus_pccard.c ============================================================================== --- head/sys/dev/uart/uart_bus_pccard.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/uart/uart_bus_pccard.c Sun Aug 19 21:10:21 2018 (r338074) @@ -95,7 +95,7 @@ uart_pccard_attach(device_t dev) sc = device_get_softc(dev); sc->sc_class = &uart_ns8250_class; - error = uart_bus_probe(dev, 0, 0, 0, 0, 0); + error = uart_bus_probe(dev, 0, 0, 0, 0, 0, 0); if (error > 0) return (error); return (uart_bus_attach(dev)); Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/uart/uart_bus_pci.c Sun Aug 19 21:10:21 2018 (r338074) @@ -206,7 +206,7 @@ uart_pci_probe(device_t dev) return (ENXIO); match: - result = uart_bus_probe(dev, id->regshft, 0, id->rclk, id->rid, 0); + result = uart_bus_probe(dev, id->regshft, 0, id->rclk, id->rid, 0, 0); /* Bail out on error. */ if (result > 0) return (result); Modified: head/sys/dev/uart/uart_bus_puc.c ============================================================================== --- head/sys/dev/uart/uart_bus_puc.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/uart/uart_bus_puc.c Sun Aug 19 21:10:21 2018 (r338074) @@ -83,7 +83,7 @@ uart_puc_probe(device_t dev) if (BUS_READ_IVAR(parent, dev, PUC_IVAR_CLOCK, &rclk)) rclk = 0; - return (uart_bus_probe(dev, 0, 0, rclk, 0, 0)); + return (uart_bus_probe(dev, 0, 0, rclk, 0, 0, 0)); } DRIVER_MODULE(uart, puc, uart_puc_driver, uart_devclass, 0, 0); Modified: head/sys/dev/uart/uart_bus_scc.c ============================================================================== --- head/sys/dev/uart/uart_bus_scc.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/uart/uart_bus_scc.c Sun Aug 19 21:10:21 2018 (r338074) @@ -114,7 +114,7 @@ uart_scc_probe(device_t dev) BUS_READ_IVAR(parent, dev, SCC_IVAR_REGSHFT, &rs)) return (ENXIO); - return (uart_bus_probe(dev, rs, 0, cl, 0, ch)); + return (uart_bus_probe(dev, rs, 0, cl, 0, ch, 0)); } DRIVER_MODULE(uart, scc, uart_scc_driver, uart_devclass, 0, 0); Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/uart/uart_core.c Sun Aug 19 21:10:21 2018 (r338074) @@ -493,7 +493,7 @@ uart_bus_sysdev(device_t dev) } int -uart_bus_probe(device_t dev, int regshft, int regiowidth, int rclk, int rid, int chan) +uart_bus_probe(device_t dev, int regshft, int regiowidth, int rclk, int rid, int chan, int quirks) { struct uart_softc *sc; struct uart_devinfo *sysdev; @@ -553,6 +553,7 @@ uart_bus_probe(device_t dev, int regshft, int regiowid sc->sc_bas.regshft = regshft; sc->sc_bas.regiowidth = regiowidth; sc->sc_bas.rclk = (rclk == 0) ? sc->sc_class->uc_rclk : rclk; + sc->sc_bas.busy_detect = !!(quirks & UART_F_BUSY_DETECT); SLIST_FOREACH(sysdev, &uart_sysdevs, next) { if (chan == sysdev->bas.chan && Modified: head/sys/dev/uart/uart_cpu_acpi.h ============================================================================== --- head/sys/dev/uart/uart_cpu_acpi.h Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/uart/uart_cpu_acpi.h Sun Aug 19 21:10:21 2018 (r338074) @@ -38,9 +38,15 @@ struct uart_class; struct acpi_uart_compat_data { - const char *hid; - struct uart_class *clas; - uint16_t port_subtype; + const char *cd_hid; + struct uart_class *cd_class; + + uint16_t cd_port_subtype; + int cd_regshft; + int cd_regiowidth; + int cd_rclk; + int cd_quirks; + const char *cd_desc; }; /* Modified: head/sys/dev/uart/uart_cpu_arm64.c ============================================================================== --- head/sys/dev/uart/uart_cpu_arm64.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/uart/uart_cpu_arm64.c Sun Aug 19 21:10:21 2018 (r338074) @@ -88,16 +88,16 @@ uart_cpu_acpi_scan(uint8_t interface_type) SET_FOREACH(cd, uart_acpi_class_and_device_set) { curcd = *cd; - for (i = 0; curcd[i].hid != NULL; i++) { - if (curcd[i].port_subtype == interface_type) + for (i = 0; curcd[i].cd_hid != NULL; i++) { + if (curcd[i].cd_port_subtype == interface_type) return (&curcd[i]); } } SET_FOREACH(cd, uart_acpi_class_set) { curcd = *cd; - for (i = 0; curcd[i].hid != NULL; i++) { - if (curcd[i].port_subtype == interface_type) + for (i = 0; curcd[i].cd_hid != NULL; i++) { + if (curcd[i].cd_port_subtype == interface_type) return (&curcd[i]); } } @@ -147,7 +147,7 @@ uart_cpu_acpi_probe(struct uart_class **classp, bus_sp if (err != 0) goto out; - *classp = cd->clas; + *classp = cd->cd_class; *rclk = 0; *shiftp = 2; *iowidthp = spcr->SerialPort.BitWidth / 8; Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/uart/uart_dev_ns8250.c Sun Aug 19 21:10:21 2018 (r338074) @@ -26,6 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "opt_acpi.h" #include "opt_platform.h" #include "opt_uart.h" @@ -54,6 +55,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef DEV_ACPI +#include +#endif #include @@ -403,6 +407,26 @@ struct uart_class uart_ns8250_class = { .uc_rclk = DEFAULT_RCLK, .uc_rshift = 0 }; + +/* + * XXX -- refactor out ACPI and FDT ifdefs + */ +#ifdef DEV_ACPI +static struct acpi_uart_compat_data acpi_compat_data[] = { + {"AMD0020", &uart_ns8250_class, 0, 2, 0, 48000000, UART_F_BUSY_DETECT, "AMD / Synopsys Designware UART"}, + {"AMDI0020", &uart_ns8250_class, 0, 2, 0, 48000000, UART_F_BUSY_DETECT, "AMD / Synopsys Designware UART"}, + {"PNP0500", &uart_ns8250_class, 0, 0, 0, 0, 0, "Standard PC COM port"}, + {"PNP0501", &uart_ns8250_class, 0, 0, 0, 0, 0, "16550A-compatible COM port"}, + {"PNP0502", &uart_ns8250_class, 0, 0, 0, 0, 0, "Multiport serial device (non-intelligent 16550)"}, + {"PNP0510", &uart_ns8250_class, 0, 0, 0, 0, 0, "Generic IRDA-compatible device"}, + {"PNP0511", &uart_ns8250_class, 0, 0, 0, 0, 0, "Generic IRDA-compatible device"}, + {"WACF004", &uart_ns8250_class, 0, 0, 0, 0, 0, "Wacom Tablet PC Screen"}, + {"WACF00E", &uart_ns8250_class, 0, 0, 0, 0, 0, "Wacom Tablet PC Screen 00e"}, + {"FUJ02E5", &uart_ns8250_class, 0, 0, 0, 0, 0, "Wacom Tablet at FuS Lifebook T"}, + {NULL, NULL, 0, 0 , 0, 0, 0, NULL}, +}; +UART_ACPI_CLASS_AND_DEVICE(acpi_compat_data); +#endif #ifdef FDT static struct ofw_compat_data compat_data[] = { Modified: head/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- head/sys/dev/uart/uart_dev_pl011.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/uart/uart_dev_pl011.c Sun Aug 19 21:10:21 2018 (r338074) @@ -342,9 +342,9 @@ UART_FDT_CLASS_AND_DEVICE(fdt_compat_data); #ifdef DEV_ACPI static struct acpi_uart_compat_data acpi_compat_data[] = { - {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_PL011}, - {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_SBSA_GENERIC}, - {NULL, NULL, 0}, + {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_PL011, 2, 0, 0, 0, "uart plo11"}, + {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_SBSA_GENERIC, 2, 0, 0, 0, "uart plo11"}, + {NULL, NULL, 0, 0, 0, 0, 0, NULL}, }; UART_ACPI_CLASS_AND_DEVICE(acpi_compat_data); #endif Modified: head/sys/dev/uart/uart_dev_snps.c ============================================================================== --- head/sys/dev/uart/uart_dev_snps.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/dev/uart/uart_dev_snps.c Sun Aug 19 21:10:21 2018 (r338074) @@ -99,22 +99,9 @@ early_putc_t *early_putc = uart_snps_early_putc; #endif /* EARLY_PRINTF */ #endif -static int -snps_uart_attach(struct uart_softc *uart_sc) -{ - struct snps_softc *sc; - - sc = (struct snps_softc *)uart_sc; - - /* UART requires to read USR reg when IIR_BUSY */ - uart_sc->sc_bas.busy_detect = 1; - - return (ns8250_bus_attach(uart_sc)); -} - static kobj_method_t snps_methods[] = { KOBJMETHOD(uart_probe, ns8250_bus_probe), - KOBJMETHOD(uart_attach, snps_uart_attach), + KOBJMETHOD(uart_attach, ns8250_bus_attach), KOBJMETHOD(uart_detach, ns8250_bus_detach), KOBJMETHOD(uart_flush, ns8250_bus_flush), KOBJMETHOD(uart_getsig, ns8250_bus_getsig), @@ -238,7 +225,7 @@ snps_probe(device_t dev) if (bootverbose && clock == 0) device_printf(dev, "could not determine frequency\n"); - error = uart_bus_probe(dev, (int)shift, (int)iowidth, (int)clock, 0, 0); + error = uart_bus_probe(dev, (int)shift, (int)iowidth, (int)clock, 0, 0, UART_F_BUSY_DETECT); if (error != 0) return (error); Modified: head/sys/mips/atheros/ar531x/uart_bus_ar5315.c ============================================================================== --- head/sys/mips/atheros/ar531x/uart_bus_ar5315.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/mips/atheros/ar531x/uart_bus_ar5315.c Sun Aug 19 21:10:21 2018 (r338074) @@ -83,7 +83,7 @@ uart_ar5315_probe(device_t dev) sc->sc_bas.bst = mips_bus_space_generic; sc->sc_bas.bsh = ar531x_uart_addr() + 3; - return (uart_bus_probe(dev, 2, 0, freq, 0, 0)); + return (uart_bus_probe(dev, 2, 0, freq, 0, 0, 0)); } DRIVER_MODULE(uart, apb, uart_ar5315_driver, uart_devclass, 0, 0); Modified: head/sys/mips/atheros/uart_bus_ar71xx.c ============================================================================== --- head/sys/mips/atheros/uart_bus_ar71xx.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/mips/atheros/uart_bus_ar71xx.c Sun Aug 19 21:10:21 2018 (r338074) @@ -85,7 +85,7 @@ uart_ar71xx_probe(device_t dev) sc->sc_bas.bst = mips_bus_space_generic; sc->sc_bas.bsh = MIPS_PHYS_TO_KSEG1(AR71XX_UART_ADDR) + 3; - return (uart_bus_probe(dev, 2, 0, freq, 0, 0)); + return (uart_bus_probe(dev, 2, 0, freq, 0, 0, 0)); } #ifdef EARLY_PRINTF Modified: head/sys/mips/atheros/uart_bus_ar933x.c ============================================================================== --- head/sys/mips/atheros/uart_bus_ar933x.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/mips/atheros/uart_bus_ar933x.c Sun Aug 19 21:10:21 2018 (r338074) @@ -90,7 +90,7 @@ uart_ar933x_probe(device_t dev) sc->sc_bas.bst = mips_bus_space_generic; sc->sc_bas.bsh = MIPS_PHYS_TO_KSEG1(AR71XX_UART_ADDR); - return (uart_bus_probe(dev, 2, 0, freq, 0, 0)); + return (uart_bus_probe(dev, 2, 0, freq, 0, 0, 0)); } /* Modified: head/sys/mips/broadcom/uart_bus_chipc.c ============================================================================== --- head/sys/mips/broadcom/uart_bus_chipc.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/mips/broadcom/uart_bus_chipc.c Sun Aug 19 21:10:21 2018 (r338074) @@ -61,7 +61,7 @@ uart_chipc_probe(device_t dev) sc->sc_class = &uart_ns8250_class; rclk = bcm_get_uart_rclk(bcm_get_platform()); - return (uart_bus_probe(dev, 0, 0, rclk, 0, 0)); + return (uart_bus_probe(dev, 0, 0, rclk, 0, 0, 0)); } static device_method_t uart_chipc_methods[] = { Modified: head/sys/mips/cavium/uart_bus_octeonusart.c ============================================================================== --- head/sys/mips/cavium/uart_bus_octeonusart.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/mips/cavium/uart_bus_octeonusart.c Sun Aug 19 21:10:21 2018 (r338074) @@ -107,7 +107,7 @@ uart_octeon_probe(device_t dev) if (bus_space_map(sc->sc_bas.bst, CVMX_MIO_UARTX_RBR(0), uart_getrange(sc->sc_class), 0, &sc->sc_bas.bsh) != 0) return (ENXIO); - return (uart_bus_probe(dev, sc->sc_bas.regshft, 0, 0, 0, unit)); + return (uart_bus_probe(dev, sc->sc_bas.regshft, 0, 0, 0, unit, 0)); } DRIVER_MODULE(uart, obio, uart_octeon_driver, uart_devclass, 0, 0); Modified: head/sys/mips/ingenic/jz4780_uart.c ============================================================================== --- head/sys/mips/ingenic/jz4780_uart.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/mips/ingenic/jz4780_uart.c Sun Aug 19 21:10:21 2018 (r338074) @@ -179,7 +179,7 @@ jz4780_uart_probe(device_t dev) device_printf(dev, "got UART clock: %lld\n", freq); sc->ns8250_base.base.sc_class = (struct uart_class *)cd->ocd_data; shift = jz4780_uart_get_shift(dev); - return (uart_bus_probe(dev, shift, 0, (int)freq, 0, 0)); + return (uart_bus_probe(dev, shift, 0, (int)freq, 0, 0, 0)); } static int Modified: head/sys/mips/malta/uart_bus_maltausart.c ============================================================================== --- head/sys/mips/malta/uart_bus_maltausart.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/mips/malta/uart_bus_maltausart.c Sun Aug 19 21:10:21 2018 (r338074) @@ -87,7 +87,7 @@ uart_malta_probe(device_t dev) sc->sc_sysdev->bas.bsh = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); sc->sc_bas.bst = mips_bus_space_generic; sc->sc_bas.bsh = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); - return(uart_bus_probe(dev, 0, 0, 0, 0, 0)); + return(uart_bus_probe(dev, 0, 0, 0, 0, 0, 0)); } DRIVER_MODULE(uart, obio, uart_malta_driver, uart_devclass, 0, 0); Modified: head/sys/modules/uart/Makefile ============================================================================== --- head/sys/modules/uart/Makefile Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/modules/uart/Makefile Sun Aug 19 21:10:21 2018 (r338074) @@ -2,6 +2,11 @@ .PATH: ${SRCTOP}/sys/dev/uart +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" +uart_bus_acpi=uart_bus_acpi.c +.endif + .if ${MACHINE_CPUARCH} == "sparc64" uart_bus_ebus= uart_bus_ebus.c .endif @@ -27,7 +32,7 @@ uart_dev_mu=uart_dev_mu.c .endif KMOD= uart -SRCS= uart_bus_acpi.c ${uart_bus_ebus} uart_bus_isa.c uart_bus_pccard.c \ +SRCS= ${uart_bus_acpi} ${uart_bus_ebus} uart_bus_isa.c uart_bus_pccard.c \ uart_bus_pci.c uart_bus_puc.c uart_bus_scc.c \ uart_core.c ${uart_cpu_machine} uart_dbg.c \ ${uart_dev_mvebu} uart_dev_ns8250.c ${uart_dev_mu} \ @@ -37,6 +42,6 @@ SRCS= uart_bus_acpi.c ${uart_bus_ebus} uart_bus_isa.c SRCS+= acpi_if.h bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} \ pci_if.h \ power_if.h pccarddevs.h serdev_if.h -SRCS+= opt_platform.h opt_uart.h +SRCS+= opt_acpi.h opt_platform.h opt_uart.h .include Modified: head/sys/powerpc/psim/uart_iobus.c ============================================================================== --- head/sys/powerpc/psim/uart_iobus.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/powerpc/psim/uart_iobus.c Sun Aug 19 21:10:21 2018 (r338074) @@ -83,7 +83,7 @@ uart_iobus_probe(device_t dev) sc->sc_class = &uart_ns8250_class; device_set_desc(dev, "PSIM serial port"); - return (uart_bus_probe(dev, 0, 0, 0, 0, 0)); + return (uart_bus_probe(dev, 0, 0, 0, 0, 0, 0)); } DRIVER_MODULE(uart, iobus, uart_iobus_driver, uart_devclass, 0, 0); Modified: head/sys/sparc64/pci/sbbc.c ============================================================================== --- head/sys/sparc64/pci/sbbc.c Sun Aug 19 19:07:59 2018 (r338073) +++ head/sys/sparc64/pci/sbbc.c Sun Aug 19 21:10:21 2018 (r338074) @@ -620,7 +620,7 @@ sbbc_uart_sbbc_probe(device_t dev) sc = device_get_softc(dev); sc->sc_class = &uart_sbbc_class; device_set_desc(dev, "Serengeti console"); - return (uart_bus_probe(dev, 0, 0, 0, SBBC_PCI_BAR, 0)); + return (uart_bus_probe(dev, 0, 0, 0, SBBC_PCI_BAR, 0, 0)); } /* From owner-svn-src-all@freebsd.org Sun Aug 19 21:37:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B17C107915F; Sun, 19 Aug 2018 21:37:52 +0000 (UTC) (envelope-from jmg@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 A377E8C44F; Sun, 19 Aug 2018 21:37:51 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E5EE439A; Sun, 19 Aug 2018 21:37:51 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JLbpYA077329; Sun, 19 Aug 2018 21:37:51 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JLbpt2077328; Sun, 19 Aug 2018 21:37:51 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201808192137.w7JLbpt2077328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sun, 19 Aug 2018 21:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338075 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 338075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2018 21:37:52 -0000 Author: jmg Date: Sun Aug 19 21:37:51 2018 New Revision: 338075 URL: https://svnweb.freebsd.org/changeset/base/338075 Log: use sbuf so that lines are printed together... As aarch64 often has SMP enabled, lines can get intermixed with other console output making these lines hard to read... Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D16689 Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Sun Aug 19 21:10:21 2018 (r338074) +++ head/sys/arm64/arm64/identcpu.c Sun Aug 19 21:37:51 2018 (r338075) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -175,30 +176,34 @@ SYSINIT(idenrity_cpu, SI_SUB_SMP, SI_ORDER_ANY, identi void print_cpu_features(u_int cpu) { + struct sbuf *sb; int printed; - printf("CPU%3d: %s %s r%dp%d", cpu, cpu_desc[cpu].cpu_impl_name, - cpu_desc[cpu].cpu_part_name, cpu_desc[cpu].cpu_variant, - cpu_desc[cpu].cpu_revision); + sb = sbuf_new_auto(); + sbuf_printf(sb, "CPU%3d: %s %s r%dp%d", cpu, + cpu_desc[cpu].cpu_impl_name, cpu_desc[cpu].cpu_part_name, + cpu_desc[cpu].cpu_variant, cpu_desc[cpu].cpu_revision); - printf(" affinity:"); + sbuf_cat(sb, " affinity:"); switch(cpu_aff_levels) { default: case 4: - printf(" %2d", CPU_AFF3(cpu_desc[cpu].mpidr)); + sbuf_printf(sb, " %2d", CPU_AFF3(cpu_desc[cpu].mpidr)); /* FALLTHROUGH */ case 3: - printf(" %2d", CPU_AFF2(cpu_desc[cpu].mpidr)); + sbuf_printf(sb, " %2d", CPU_AFF2(cpu_desc[cpu].mpidr)); /* FALLTHROUGH */ case 2: - printf(" %2d", CPU_AFF1(cpu_desc[cpu].mpidr)); + sbuf_printf(sb, " %2d", CPU_AFF1(cpu_desc[cpu].mpidr)); /* FALLTHROUGH */ case 1: case 0: /* On UP this will be zero */ - printf(" %2d", CPU_AFF0(cpu_desc[cpu].mpidr)); + sbuf_printf(sb, " %2d", CPU_AFF0(cpu_desc[cpu].mpidr)); break; } - printf("\n"); + sbuf_finish(sb); + printf("%s\n", sbuf_data(sb)); + sbuf_clear(sb); /* * There is a hardware errata where, if one CPU is performing a TLB @@ -230,39 +235,39 @@ print_cpu_features(u_int cpu) /* AArch64 Instruction Set Attribute Register 0 */ if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_ISAR0) != 0) { printed = 0; - printf(" Instruction Set Attributes 0 = <"); + sbuf_printf(sb, " Instruction Set Attributes 0 = <"); switch (ID_AA64ISAR0_RDM(cpu_desc[cpu].id_aa64isar0)) { case ID_AA64ISAR0_RDM_NONE: break; case ID_AA64ISAR0_RDM_IMPL: - printf("%sRDM", SEP_STR); + sbuf_printf(sb, "%sRDM", SEP_STR); break; default: - printf("%sUnknown RDM", SEP_STR); + sbuf_printf(sb, "%sUnknown RDM", SEP_STR); } switch (ID_AA64ISAR0_ATOMIC(cpu_desc[cpu].id_aa64isar0)) { case ID_AA64ISAR0_ATOMIC_NONE: break; case ID_AA64ISAR0_ATOMIC_IMPL: - printf("%sAtomic", SEP_STR); + sbuf_printf(sb, "%sAtomic", SEP_STR); break; default: - printf("%sUnknown Atomic", SEP_STR); + sbuf_printf(sb, "%sUnknown Atomic", SEP_STR); } switch (ID_AA64ISAR0_AES(cpu_desc[cpu].id_aa64isar0)) { case ID_AA64ISAR0_AES_NONE: break; case ID_AA64ISAR0_AES_BASE: - printf("%sAES", SEP_STR); + sbuf_printf(sb, "%sAES", SEP_STR); break; case ID_AA64ISAR0_AES_PMULL: - printf("%sAES+PMULL", SEP_STR); + sbuf_printf(sb, "%sAES+PMULL", SEP_STR); break; default: - printf("%sUnknown AES", SEP_STR); + sbuf_printf(sb, "%sUnknown AES", SEP_STR); break; } @@ -270,10 +275,10 @@ print_cpu_features(u_int cpu) case ID_AA64ISAR0_SHA1_NONE: break; case ID_AA64ISAR0_SHA1_BASE: - printf("%sSHA1", SEP_STR); + sbuf_printf(sb, "%sSHA1", SEP_STR); break; default: - printf("%sUnknown SHA1", SEP_STR); + sbuf_printf(sb, "%sUnknown SHA1", SEP_STR); break; } @@ -281,13 +286,13 @@ print_cpu_features(u_int cpu) case ID_AA64ISAR0_SHA2_NONE: break; case ID_AA64ISAR0_SHA2_BASE: - printf("%sSHA2", SEP_STR); + sbuf_printf(sb, "%sSHA2", SEP_STR); break; case ID_AA64ISAR0_SHA2_512: - printf("%sSHA2+SHA512", SEP_STR); + sbuf_printf(sb, "%sSHA2+SHA512", SEP_STR); break; default: - printf("%sUnknown SHA2", SEP_STR); + sbuf_printf(sb, "%sUnknown SHA2", SEP_STR); break; } @@ -295,10 +300,10 @@ print_cpu_features(u_int cpu) case ID_AA64ISAR0_CRC32_NONE: break; case ID_AA64ISAR0_CRC32_BASE: - printf("%sCRC32", SEP_STR); + sbuf_printf(sb, "%sCRC32", SEP_STR); break; default: - printf("%sUnknown CRC32", SEP_STR); + sbuf_printf(sb, "%sUnknown CRC32", SEP_STR); break; } @@ -306,10 +311,10 @@ print_cpu_features(u_int cpu) case ID_AA64ISAR0_SHA3_NONE: break; case ID_AA64ISAR0_SHA3_IMPL: - printf("%sSHA3", SEP_STR); + sbuf_printf(sb, "%sSHA3", SEP_STR); break; default: - printf("%sUnknown SHA3", SEP_STR); + sbuf_printf(sb, "%sUnknown SHA3", SEP_STR); break; } @@ -317,10 +322,10 @@ print_cpu_features(u_int cpu) case ID_AA64ISAR0_SM3_NONE: break; case ID_AA64ISAR0_SM3_IMPL: - printf("%sSM3", SEP_STR); + sbuf_printf(sb, "%sSM3", SEP_STR); break; default: - printf("%sUnknown SM3", SEP_STR); + sbuf_printf(sb, "%sUnknown SM3", SEP_STR); break; } @@ -328,10 +333,10 @@ print_cpu_features(u_int cpu) case ID_AA64ISAR0_SM4_NONE: break; case ID_AA64ISAR0_SM4_IMPL: - printf("%sSM4", SEP_STR); + sbuf_printf(sb, "%sSM4", SEP_STR); break; default: - printf("%sUnknown SM4", SEP_STR); + sbuf_printf(sb, "%sUnknown SM4", SEP_STR); break; } @@ -339,33 +344,35 @@ print_cpu_features(u_int cpu) case ID_AA64ISAR0_DP_NONE: break; case ID_AA64ISAR0_DP_IMPL: - printf("%sDotProd", SEP_STR); + sbuf_printf(sb, "%sDotProd", SEP_STR); break; default: - printf("%sUnknown DP", SEP_STR); + sbuf_printf(sb, "%sUnknown DP", SEP_STR); break; } if ((cpu_desc[cpu].id_aa64isar0 & ~ID_AA64ISAR0_MASK) != 0) - printf("%s%#lx", SEP_STR, + sbuf_printf(sb, "%s%#lx", SEP_STR, cpu_desc[cpu].id_aa64isar0 & ~ID_AA64ISAR0_MASK); - printf(">\n"); + sbuf_finish(sb); + printf("%s>\n", sbuf_data(sb)); + sbuf_clear(sb); } /* AArch64 Instruction Set Attribute Register 1 */ if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_ISAR1) != 0) { printed = 0; - printf(" Instruction Set Attributes 1 = <"); + sbuf_printf(sb, " Instruction Set Attributes 1 = <"); switch (ID_AA64ISAR1_GPI(cpu_desc[cpu].id_aa64isar1)) { case ID_AA64ISAR1_GPI_NONE: break; case ID_AA64ISAR1_GPI_IMPL: - printf("%sImpl GenericAuth", SEP_STR); + sbuf_printf(sb, "%sImpl GenericAuth", SEP_STR); break; default: - printf("%sUnknown GenericAuth", SEP_STR); + sbuf_printf(sb, "%sUnknown GenericAuth", SEP_STR); break; } @@ -373,10 +380,10 @@ print_cpu_features(u_int cpu) case ID_AA64ISAR1_GPA_NONE: break; case ID_AA64ISAR1_GPA_IMPL: - printf("%sPrince GenericAuth", SEP_STR); + sbuf_printf(sb, "%sPrince GenericAuth", SEP_STR); break; default: - printf("%sUnknown GenericAuth", SEP_STR); + sbuf_printf(sb, "%sUnknown GenericAuth", SEP_STR); break; } @@ -384,10 +391,10 @@ print_cpu_features(u_int cpu) case ID_AA64ISAR1_LRCPC_NONE: break; case ID_AA64ISAR1_LRCPC_IMPL: - printf("%sRCpc", SEP_STR); + sbuf_printf(sb, "%sRCpc", SEP_STR); break; default: - printf("%sUnknown RCpc", SEP_STR); + sbuf_printf(sb, "%sUnknown RCpc", SEP_STR); break; } @@ -395,10 +402,10 @@ print_cpu_features(u_int cpu) case ID_AA64ISAR1_FCMA_NONE: break; case ID_AA64ISAR1_FCMA_IMPL: - printf("%sFCMA", SEP_STR); + sbuf_printf(sb, "%sFCMA", SEP_STR); break; default: - printf("%sUnknown FCMA", SEP_STR); + sbuf_printf(sb, "%sUnknown FCMA", SEP_STR); break; } @@ -406,10 +413,10 @@ print_cpu_features(u_int cpu) case ID_AA64ISAR1_JSCVT_NONE: break; case ID_AA64ISAR1_JSCVT_IMPL: - printf("%sJS Conv", SEP_STR); + sbuf_printf(sb, "%sJS Conv", SEP_STR); break; default: - printf("%sUnknown JS Conv", SEP_STR); + sbuf_printf(sb, "%sUnknown JS Conv", SEP_STR); break; } @@ -417,10 +424,10 @@ print_cpu_features(u_int cpu) case ID_AA64ISAR1_API_NONE: break; case ID_AA64ISAR1_API_IMPL: - printf("%sImpl AddrAuth", SEP_STR); + sbuf_printf(sb, "%sImpl AddrAuth", SEP_STR); break; default: - printf("%sUnknown Impl AddrAuth", SEP_STR); + sbuf_printf(sb, "%sUnknown Impl AddrAuth", SEP_STR); break; } @@ -428,10 +435,10 @@ print_cpu_features(u_int cpu) case ID_AA64ISAR1_APA_NONE: break; case ID_AA64ISAR1_APA_IMPL: - printf("%sPrince AddrAuth", SEP_STR); + sbuf_printf(sb, "%sPrince AddrAuth", SEP_STR); break; default: - printf("%sUnknown Prince AddrAuth", SEP_STR); + sbuf_printf(sb, "%sUnknown Prince AddrAuth", SEP_STR); break; } @@ -439,32 +446,34 @@ print_cpu_features(u_int cpu) case ID_AA64ISAR1_DPB_NONE: break; case ID_AA64ISAR1_DPB_IMPL: - printf("%sDC CVAP", SEP_STR); + sbuf_printf(sb, "%sDC CVAP", SEP_STR); break; default: - printf("%sUnknown DC CVAP", SEP_STR); + sbuf_printf(sb, "%sUnknown DC CVAP", SEP_STR); break; } if ((cpu_desc[cpu].id_aa64isar1 & ~ID_AA64ISAR1_MASK) != 0) - printf("%s%#lx", SEP_STR, + sbuf_printf(sb, "%s%#lx", SEP_STR, cpu_desc[cpu].id_aa64isar1 & ~ID_AA64ISAR1_MASK); - printf(">\n"); + sbuf_finish(sb); + printf("%s>\n", sbuf_data(sb)); + sbuf_clear(sb); } /* AArch64 Processor Feature Register 0 */ if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_PFR0) != 0) { printed = 0; - printf(" Processor Features 0 = <"); + sbuf_printf(sb, " Processor Features 0 = <"); switch (ID_AA64PFR0_SVE(cpu_desc[cpu].id_aa64pfr0)) { case ID_AA64PFR0_SVE_NONE: break; case ID_AA64PFR0_SVE_IMPL: - printf("%sSVE", SEP_STR); + sbuf_printf(sb, "%sSVE", SEP_STR); break; default: - printf("%sUnknown SVE", SEP_STR); + sbuf_printf(sb, "%sUnknown SVE", SEP_STR); break; } @@ -472,10 +481,10 @@ print_cpu_features(u_int cpu) case ID_AA64PFR0_RAS_NONE: break; case ID_AA64PFR0_RAS_V1: - printf("%sRASv1", SEP_STR); + sbuf_printf(sb, "%sRASv1", SEP_STR); break; default: - printf("%sUnknown RAS", SEP_STR); + sbuf_printf(sb, "%sUnknown RAS", SEP_STR); break; } @@ -483,10 +492,10 @@ print_cpu_features(u_int cpu) case ID_AA64PFR0_GIC_CPUIF_NONE: break; case ID_AA64PFR0_GIC_CPUIF_EN: - printf("%sGIC", SEP_STR); + sbuf_printf(sb, "%sGIC", SEP_STR); break; default: - printf("%sUnknown GIC interface", SEP_STR); + sbuf_printf(sb, "%sUnknown GIC interface", SEP_STR); break; } @@ -494,13 +503,13 @@ print_cpu_features(u_int cpu) case ID_AA64PFR0_ADV_SIMD_NONE: break; case ID_AA64PFR0_ADV_SIMD_IMPL: - printf("%sAdvSIMD", SEP_STR); + sbuf_printf(sb, "%sAdvSIMD", SEP_STR); break; case ID_AA64PFR0_ADV_SIMD_HP: - printf("%sAdvSIMD+HP", SEP_STR); + sbuf_printf(sb, "%sAdvSIMD+HP", SEP_STR); break; default: - printf("%sUnknown AdvSIMD", SEP_STR); + sbuf_printf(sb, "%sUnknown AdvSIMD", SEP_STR); break; } @@ -508,75 +517,77 @@ print_cpu_features(u_int cpu) case ID_AA64PFR0_FP_NONE: break; case ID_AA64PFR0_FP_IMPL: - printf("%sFloat", SEP_STR); + sbuf_printf(sb, "%sFloat", SEP_STR); break; case ID_AA64PFR0_FP_HP: - printf("%sFloat+HP", SEP_STR); + sbuf_printf(sb, "%sFloat+HP", SEP_STR); break; default: - printf("%sUnknown Float", SEP_STR); + sbuf_printf(sb, "%sUnknown Float", SEP_STR); break; } switch (ID_AA64PFR0_EL3(cpu_desc[cpu].id_aa64pfr0)) { case ID_AA64PFR0_EL3_NONE: - printf("%sNo EL3", SEP_STR); + sbuf_printf(sb, "%sNo EL3", SEP_STR); break; case ID_AA64PFR0_EL3_64: - printf("%sEL3", SEP_STR); + sbuf_printf(sb, "%sEL3", SEP_STR); break; case ID_AA64PFR0_EL3_64_32: - printf("%sEL3 32", SEP_STR); + sbuf_printf(sb, "%sEL3 32", SEP_STR); break; default: - printf("%sUnknown EL3", SEP_STR); + sbuf_printf(sb, "%sUnknown EL3", SEP_STR); break; } switch (ID_AA64PFR0_EL2(cpu_desc[cpu].id_aa64pfr0)) { case ID_AA64PFR0_EL2_NONE: - printf("%sNo EL2", SEP_STR); + sbuf_printf(sb, "%sNo EL2", SEP_STR); break; case ID_AA64PFR0_EL2_64: - printf("%sEL2", SEP_STR); + sbuf_printf(sb, "%sEL2", SEP_STR); break; case ID_AA64PFR0_EL2_64_32: - printf("%sEL2 32", SEP_STR); + sbuf_printf(sb, "%sEL2 32", SEP_STR); break; default: - printf("%sUnknown EL2", SEP_STR); + sbuf_printf(sb, "%sUnknown EL2", SEP_STR); break; } switch (ID_AA64PFR0_EL1(cpu_desc[cpu].id_aa64pfr0)) { case ID_AA64PFR0_EL1_64: - printf("%sEL1", SEP_STR); + sbuf_printf(sb, "%sEL1", SEP_STR); break; case ID_AA64PFR0_EL1_64_32: - printf("%sEL1 32", SEP_STR); + sbuf_printf(sb, "%sEL1 32", SEP_STR); break; default: - printf("%sUnknown EL1", SEP_STR); + sbuf_printf(sb, "%sUnknown EL1", SEP_STR); break; } switch (ID_AA64PFR0_EL0(cpu_desc[cpu].id_aa64pfr0)) { case ID_AA64PFR0_EL0_64: - printf("%sEL0", SEP_STR); + sbuf_printf(sb, "%sEL0", SEP_STR); break; case ID_AA64PFR0_EL0_64_32: - printf("%sEL0 32", SEP_STR); + sbuf_printf(sb, "%sEL0 32", SEP_STR); break; default: - printf("%sUnknown EL0", SEP_STR); + sbuf_printf(sb, "%sUnknown EL0", SEP_STR); break; } if ((cpu_desc[cpu].id_aa64pfr0 & ~ID_AA64PFR0_MASK) != 0) - printf("%s%#lx", SEP_STR, + sbuf_printf(sb, "%s%#lx", SEP_STR, cpu_desc[cpu].id_aa64pfr0 & ~ID_AA64PFR0_MASK); - printf(">\n"); + sbuf_finish(sb); + printf("%s>\n", sbuf_data(sb)); + sbuf_clear(sb); } /* AArch64 Processor Feature Register 1 */ @@ -588,15 +599,15 @@ print_cpu_features(u_int cpu) /* AArch64 Memory Model Feature Register 0 */ if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_MMFR0) != 0) { printed = 0; - printf(" Memory Model Features 0 = <"); + sbuf_printf(sb, " Memory Model Features 0 = <"); switch (ID_AA64MMFR0_TGRAN4(cpu_desc[cpu].id_aa64mmfr0)) { case ID_AA64MMFR0_TGRAN4_NONE: break; case ID_AA64MMFR0_TGRAN4_IMPL: - printf("%s4k Granule", SEP_STR); + sbuf_printf(sb, "%s4k Granule", SEP_STR); break; default: - printf("%sUnknown 4k Granule", SEP_STR); + sbuf_printf(sb, "%sUnknown 4k Granule", SEP_STR); break; } @@ -604,10 +615,10 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR0_TGRAN16_NONE: break; case ID_AA64MMFR0_TGRAN16_IMPL: - printf("%s16k Granule", SEP_STR); + sbuf_printf(sb, "%s16k Granule", SEP_STR); break; default: - printf("%sUnknown 16k Granule", SEP_STR); + sbuf_printf(sb, "%sUnknown 16k Granule", SEP_STR); break; } @@ -615,10 +626,10 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR0_TGRAN64_NONE: break; case ID_AA64MMFR0_TGRAN64_IMPL: - printf("%s64k Granule", SEP_STR); + sbuf_printf(sb, "%s64k Granule", SEP_STR); break; default: - printf("%sUnknown 64k Granule", SEP_STR); + sbuf_printf(sb, "%sUnknown 64k Granule", SEP_STR); break; } @@ -626,10 +637,10 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR0_BIGEND_FIXED: break; case ID_AA64MMFR0_BIGEND_MIXED: - printf("%sMixedEndian", SEP_STR); + sbuf_printf(sb, "%sMixedEndian", SEP_STR); break; default: - printf("%sUnknown Endian switching", SEP_STR); + sbuf_printf(sb, "%sUnknown Endian switching", SEP_STR); break; } @@ -637,10 +648,10 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR0_BIGEND_EL0_FIXED: break; case ID_AA64MMFR0_BIGEND_EL0_MIXED: - printf("%sEL0 MixEndian", SEP_STR); + sbuf_printf(sb, "%sEL0 MixEndian", SEP_STR); break; default: - printf("%sUnknown EL0 Endian switching", SEP_STR); + sbuf_printf(sb, "%sUnknown EL0 Endian switching", SEP_STR); break; } @@ -648,71 +659,73 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR0_S_NS_MEM_NONE: break; case ID_AA64MMFR0_S_NS_MEM_DISTINCT: - printf("%sS/NS Mem", SEP_STR); + sbuf_printf(sb, "%sS/NS Mem", SEP_STR); break; default: - printf("%sUnknown S/NS Mem", SEP_STR); + sbuf_printf(sb, "%sUnknown S/NS Mem", SEP_STR); break; } switch (ID_AA64MMFR0_ASID_BITS(cpu_desc[cpu].id_aa64mmfr0)) { case ID_AA64MMFR0_ASID_BITS_8: - printf("%s8bit ASID", SEP_STR); + sbuf_printf(sb, "%s8bit ASID", SEP_STR); break; case ID_AA64MMFR0_ASID_BITS_16: - printf("%s16bit ASID", SEP_STR); + sbuf_printf(sb, "%s16bit ASID", SEP_STR); break; default: - printf("%sUnknown ASID", SEP_STR); + sbuf_printf(sb, "%sUnknown ASID", SEP_STR); break; } switch (ID_AA64MMFR0_PA_RANGE(cpu_desc[cpu].id_aa64mmfr0)) { case ID_AA64MMFR0_PA_RANGE_4G: - printf("%s4GB PA", SEP_STR); + sbuf_printf(sb, "%s4GB PA", SEP_STR); break; case ID_AA64MMFR0_PA_RANGE_64G: - printf("%s64GB PA", SEP_STR); + sbuf_printf(sb, "%s64GB PA", SEP_STR); break; case ID_AA64MMFR0_PA_RANGE_1T: - printf("%s1TB PA", SEP_STR); + sbuf_printf(sb, "%s1TB PA", SEP_STR); break; case ID_AA64MMFR0_PA_RANGE_4T: - printf("%s4TB PA", SEP_STR); + sbuf_printf(sb, "%s4TB PA", SEP_STR); break; case ID_AA64MMFR0_PA_RANGE_16T: - printf("%s16TB PA", SEP_STR); + sbuf_printf(sb, "%s16TB PA", SEP_STR); break; case ID_AA64MMFR0_PA_RANGE_256T: - printf("%s256TB PA", SEP_STR); + sbuf_printf(sb, "%s256TB PA", SEP_STR); break; case ID_AA64MMFR0_PA_RANGE_4P: - printf("%s4PB PA", SEP_STR); + sbuf_printf(sb, "%s4PB PA", SEP_STR); break; default: - printf("%sUnknown PA Range", SEP_STR); + sbuf_printf(sb, "%sUnknown PA Range", SEP_STR); break; } if ((cpu_desc[cpu].id_aa64mmfr0 & ~ID_AA64MMFR0_MASK) != 0) - printf("%s%#lx", SEP_STR, + sbuf_printf(sb, "%s%#lx", SEP_STR, cpu_desc[cpu].id_aa64mmfr0 & ~ID_AA64MMFR0_MASK); - printf(">\n"); + sbuf_finish(sb); + printf("%s>\n", sbuf_data(sb)); + sbuf_clear(sb); } /* AArch64 Memory Model Feature Register 1 */ if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_MMFR1) != 0) { printed = 0; - printf(" Memory Model Features 1 = <"); + sbuf_printf(sb, " Memory Model Features 1 = <"); switch (ID_AA64MMFR1_XNX(cpu_desc[cpu].id_aa64mmfr1)) { case ID_AA64MMFR1_XNX_NONE: break; case ID_AA64MMFR1_XNX_IMPL: - printf("%sEL2 XN", SEP_STR); + sbuf_printf(sb, "%sEL2 XN", SEP_STR); break; default: - printf("%sUnknown XNX", SEP_STR); + sbuf_printf(sb, "%sUnknown XNX", SEP_STR); break; } @@ -720,10 +733,10 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR1_SPEC_SEI_NONE: break; case ID_AA64MMFR1_SPEC_SEI_IMPL: - printf("%sSpecSEI", SEP_STR); + sbuf_printf(sb, "%sSpecSEI", SEP_STR); break; default: - printf("%sUnknown SpecSEI", SEP_STR); + sbuf_printf(sb, "%sUnknown SpecSEI", SEP_STR); break; } @@ -731,13 +744,13 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR1_PAN_NONE: break; case ID_AA64MMFR1_PAN_IMPL: - printf("%sPAN", SEP_STR); + sbuf_printf(sb, "%sPAN", SEP_STR); break; case ID_AA64MMFR1_PAN_ATS1E1: - printf("%sPAN+AT", SEP_STR); + sbuf_printf(sb, "%sPAN+AT", SEP_STR); break; default: - printf("%sUnknown PAN", SEP_STR); + sbuf_printf(sb, "%sUnknown PAN", SEP_STR); break; } @@ -745,10 +758,10 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR1_LO_NONE: break; case ID_AA64MMFR1_LO_IMPL: - printf("%sLO", SEP_STR); + sbuf_printf(sb, "%sLO", SEP_STR); break; default: - printf("%sUnknown LO", SEP_STR); + sbuf_printf(sb, "%sUnknown LO", SEP_STR); break; } @@ -756,13 +769,13 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR1_HPDS_NONE: break; case ID_AA64MMFR1_HPDS_HPD: - printf("%sHPDS", SEP_STR); + sbuf_printf(sb, "%sHPDS", SEP_STR); break; case ID_AA64MMFR1_HPDS_TTPBHA: - printf("%sTTPBHA", SEP_STR); + sbuf_printf(sb, "%sTTPBHA", SEP_STR); break; default: - printf("%sUnknown HPDS", SEP_STR); + sbuf_printf(sb, "%sUnknown HPDS", SEP_STR); break; } @@ -770,10 +783,10 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR1_VH_NONE: break; case ID_AA64MMFR1_VH_IMPL: - printf("%sVHE", SEP_STR); + sbuf_printf(sb, "%sVHE", SEP_STR); break; default: - printf("%sUnknown VHE", SEP_STR); + sbuf_printf(sb, "%sUnknown VHE", SEP_STR); break; } @@ -781,10 +794,10 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR1_VMIDBITS_8: break; case ID_AA64MMFR1_VMIDBITS_16: - printf("%s16 VMID bits", SEP_STR); + sbuf_printf(sb, "%s16 VMID bits", SEP_STR); break; default: - printf("%sUnknown VMID bits", SEP_STR); + sbuf_printf(sb, "%sUnknown VMID bits", SEP_STR); break; } @@ -792,59 +805,61 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR1_HAFDBS_NONE: break; case ID_AA64MMFR1_HAFDBS_AF: - printf("%sAF", SEP_STR); + sbuf_printf(sb, "%sAF", SEP_STR); break; case ID_AA64MMFR1_HAFDBS_AF_DBS: - printf("%sAF+DBS", SEP_STR); + sbuf_printf(sb, "%sAF+DBS", SEP_STR); break; default: - printf("%sUnknown Hardware update AF/DBS", SEP_STR); + sbuf_printf(sb, "%sUnknown Hardware update AF/DBS", SEP_STR); break; } if ((cpu_desc[cpu].id_aa64mmfr1 & ~ID_AA64MMFR1_MASK) != 0) - printf("%s%#lx", SEP_STR, + sbuf_printf(sb, "%s%#lx", SEP_STR, cpu_desc[cpu].id_aa64mmfr1 & ~ID_AA64MMFR1_MASK); - printf(">\n"); + sbuf_finish(sb); + printf("%s>\n", sbuf_data(sb)); + sbuf_clear(sb); } /* AArch64 Memory Model Feature Register 2 */ if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_MMFR2) != 0) { printed = 0; - printf(" Memory Model Features 2 = <"); + sbuf_printf(sb, " Memory Model Features 2 = <"); switch (ID_AA64MMFR2_NV(cpu_desc[cpu].id_aa64mmfr2)) { case ID_AA64MMFR2_NV_NONE: break; case ID_AA64MMFR2_NV_IMPL: - printf("%sNestedVirt", SEP_STR); + sbuf_printf(sb, "%sNestedVirt", SEP_STR); break; default: - printf("%sUnknown NestedVirt", SEP_STR); + sbuf_printf(sb, "%sUnknown NestedVirt", SEP_STR); break; } switch (ID_AA64MMFR2_CCIDX(cpu_desc[cpu].id_aa64mmfr2)) { case ID_AA64MMFR2_CCIDX_32: - printf("%s32b CCIDX", SEP_STR); + sbuf_printf(sb, "%s32b CCIDX", SEP_STR); break; case ID_AA64MMFR2_CCIDX_64: - printf("%s64b CCIDX", SEP_STR); + sbuf_printf(sb, "%s64b CCIDX", SEP_STR); break; default: - printf("%sUnknown CCIDX", SEP_STR); + sbuf_printf(sb, "%sUnknown CCIDX", SEP_STR); break; } switch (ID_AA64MMFR2_VA_RANGE(cpu_desc[cpu].id_aa64mmfr2)) { case ID_AA64MMFR2_VA_RANGE_48: - printf("%s48b VA", SEP_STR); + sbuf_printf(sb, "%s48b VA", SEP_STR); break; case ID_AA64MMFR2_VA_RANGE_52: - printf("%s52b VA", SEP_STR); + sbuf_printf(sb, "%s52b VA", SEP_STR); break; default: - printf("%sUnknown VA Range", SEP_STR); + sbuf_printf(sb, "%sUnknown VA Range", SEP_STR); break; } @@ -852,10 +867,10 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR2_IESB_NONE: break; case ID_AA64MMFR2_IESB_IMPL: - printf("%sIESB", SEP_STR); + sbuf_printf(sb, "%sIESB", SEP_STR); break; default: - printf("%sUnknown IESB", SEP_STR); + sbuf_printf(sb, "%sUnknown IESB", SEP_STR); break; } @@ -863,10 +878,10 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR2_LSM_NONE: break; case ID_AA64MMFR2_LSM_IMPL: - printf("%sLSM", SEP_STR); + sbuf_printf(sb, "%sLSM", SEP_STR); break; default: - printf("%sUnknown LSM", SEP_STR); + sbuf_printf(sb, "%sUnknown LSM", SEP_STR); break; } @@ -874,10 +889,10 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR2_UAO_NONE: break; case ID_AA64MMFR2_UAO_IMPL: - printf("%sUAO", SEP_STR); + sbuf_printf(sb, "%sUAO", SEP_STR); break; default: - printf("%sUnknown UAO", SEP_STR); + sbuf_printf(sb, "%sUnknown UAO", SEP_STR); break; } @@ -885,57 +900,59 @@ print_cpu_features(u_int cpu) case ID_AA64MMFR2_CNP_NONE: break; case ID_AA64MMFR2_CNP_IMPL: - printf("%sCnP", SEP_STR); + sbuf_printf(sb, "%sCnP", SEP_STR); break; default: - printf("%sUnknown CnP", SEP_STR); + sbuf_printf(sb, "%sUnknown CnP", SEP_STR); break; } if ((cpu_desc[cpu].id_aa64mmfr2 & ~ID_AA64MMFR2_MASK) != 0) - printf("%s%#lx", SEP_STR, + sbuf_printf(sb, "%s%#lx", SEP_STR, cpu_desc[cpu].id_aa64mmfr2 & ~ID_AA64MMFR2_MASK); - printf(">\n"); + sbuf_finish(sb); + printf("%s>\n", sbuf_data(sb)); + sbuf_clear(sb); } /* AArch64 Debug Feature Register 0 */ if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_DFR0) != 0) { printed = 0; - printf(" Debug Features 0 = <"); + sbuf_printf(sb, " Debug Features 0 = <"); switch(ID_AA64DFR0_PMS_VER(cpu_desc[cpu].id_aa64dfr0)) { case ID_AA64DFR0_PMS_VER_NONE: break; case ID_AA64DFR0_PMS_VER_V1: - printf("%sSPE v1", SEP_STR); + sbuf_printf(sb, "%sSPE v1", SEP_STR); break; default: - printf("%sUnknown SPE", SEP_STR); + sbuf_printf(sb, "%sUnknown SPE", SEP_STR); break; } - printf("%s%lu CTX Breakpoints", SEP_STR, + sbuf_printf(sb, "%s%lu CTX Breakpoints", SEP_STR, ID_AA64DFR0_CTX_CMPS(cpu_desc[cpu].id_aa64dfr0)); - printf("%s%lu Watchpoints", SEP_STR, + sbuf_printf(sb, "%s%lu Watchpoints", SEP_STR, ID_AA64DFR0_WRPS(cpu_desc[cpu].id_aa64dfr0)); - printf("%s%lu Breakpoints", SEP_STR, + sbuf_printf(sb, "%s%lu Breakpoints", SEP_STR, ID_AA64DFR0_BRPS(cpu_desc[cpu].id_aa64dfr0)); switch (ID_AA64DFR0_PMU_VER(cpu_desc[cpu].id_aa64dfr0)) { case ID_AA64DFR0_PMU_VER_NONE: break; case ID_AA64DFR0_PMU_VER_3: - printf("%sPMUv3", SEP_STR); + sbuf_printf(sb, "%sPMUv3", SEP_STR); break; case ID_AA64DFR0_PMU_VER_3_1: - printf("%sPMUv3+16 bit evtCount", SEP_STR); + sbuf_printf(sb, "%sPMUv3+16 bit evtCount", SEP_STR); break; case ID_AA64DFR0_PMU_VER_IMPL: - printf("%sImplementation defined PMU", SEP_STR); + sbuf_printf(sb, "%sImplementation defined PMU", SEP_STR); break; default: - printf("%sUnknown PMU", SEP_STR); + sbuf_printf(sb, "%sUnknown PMU", SEP_STR); break; } @@ -943,32 +960,34 @@ print_cpu_features(u_int cpu) case ID_AA64DFR0_TRACE_VER_NONE: break; case ID_AA64DFR0_TRACE_VER_IMPL: - printf("%sTrace", SEP_STR); + sbuf_printf(sb, "%sTrace", SEP_STR); break; default: - printf("%sUnknown Trace", SEP_STR); + sbuf_printf(sb, "%sUnknown Trace", SEP_STR); break; } switch (ID_AA64DFR0_DEBUG_VER(cpu_desc[cpu].id_aa64dfr0)) { case ID_AA64DFR0_DEBUG_VER_8: - printf("%sDebug v8", SEP_STR); + sbuf_printf(sb, "%sDebug v8", SEP_STR); break; case ID_AA64DFR0_DEBUG_VER_8_VHE: - printf("%sDebug v8+VHE", SEP_STR); + sbuf_printf(sb, "%sDebug v8+VHE", SEP_STR); break; case ID_AA64DFR0_DEBUG_VER_8_2: - printf("%sDebug v8.2", SEP_STR); + sbuf_printf(sb, "%sDebug v8.2", SEP_STR); break; default: - printf("%sUnknown Debug", SEP_STR); + sbuf_printf(sb, "%sUnknown Debug", SEP_STR); break; } if (cpu_desc[cpu].id_aa64dfr0 & ~ID_AA64DFR0_MASK) - printf("%s%#lx", SEP_STR, + sbuf_printf(sb, "%s%#lx", SEP_STR, cpu_desc[cpu].id_aa64dfr0 & ~ID_AA64DFR0_MASK); - printf(">\n"); + sbuf_finish(sb); + printf("%s>\n", sbuf_data(sb)); + sbuf_clear(sb); } /* AArch64 Memory Model Feature Register 1 */ @@ -989,6 +1008,8 @@ print_cpu_features(u_int cpu) cpu_desc[cpu].id_aa64afr1); } + sbuf_delete(sb); + sb = NULL; #undef SEP_STR } From owner-svn-src-all@freebsd.org Mon Aug 20 00:47:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8AA2107DB7B; Mon, 20 Aug 2018 00:47:52 +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 4C226726F6; Mon, 20 Aug 2018 00:47: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 279D96249; Mon, 20 Aug 2018 00:47: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 w7K0lqRB075247; Mon, 20 Aug 2018 00:47:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K0lqHV075246; Mon, 20 Aug 2018 00:47:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808200047.w7K0lqHV075246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 20 Aug 2018 00:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338076 - stable/11/kerberos5/usr.bin/krb5-config X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/kerberos5/usr.bin/krb5-config X-SVN-Commit-Revision: 338076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 00:47:52 -0000 Author: kevans Date: Mon Aug 20 00:47:51 2018 New Revision: 338076 URL: https://svnweb.freebsd.org/changeset/base/338076 Log: MFC r337665: krb5-config build: Remove gratuitous escaping Modified: stable/11/kerberos5/usr.bin/krb5-config/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/kerberos5/usr.bin/krb5-config/Makefile ============================================================================== --- stable/11/kerberos5/usr.bin/krb5-config/Makefile Sun Aug 19 21:37:51 2018 (r338075) +++ stable/11/kerberos5/usr.bin/krb5-config/Makefile Mon Aug 20 00:47:51 2018 (r338076) @@ -6,20 +6,20 @@ MAN= krb5-config.1 CLEANFILES= krb5-config krb5-config: krb5-config.in - sed -e "s,@PACKAGE\@,FreeBSD heimdal,g" \ - -e "s,@VERSION\@,1.1.0,g" \ - -e "s,@prefix\@,/usr,g" \ - -e "s,@exec_prefix\@,/usr,g" \ - -e "s,@libdir\@,${LIBDIR},g" \ - -e "s,@includedir\@,${INCLUDEDIR},g" \ - -e "s,@LIB_crypt\@,-lcrypt,g" \ - -e "s,@LIB_dbopen\@,,g" \ - -e "s,@LIB_hcrypto_appl\@,-lcrypto,g" \ - -e "s,@LIB_pkinit\@,-lhx509,g" \ - -e "s,@LIB_dlopen\@,,g" \ - -e "s,@LIB_door_create\@,,g" \ - -e "s,@PTHREAD_LIBADD\@,-pthread,g" \ - -e "s,@LIBS\@,,g" \ + sed -e "s,@PACKAGE@,FreeBSD heimdal,g" \ + -e "s,@VERSION@,1.1.0,g" \ + -e "s,@prefix@,/usr,g" \ + -e "s,@exec_prefix@,/usr,g" \ + -e "s,@libdir@,${LIBDIR},g" \ + -e "s,@includedir@,${INCLUDEDIR},g" \ + -e "s,@LIB_crypt@,-lcrypt,g" \ + -e "s,@LIB_dbopen@,,g" \ + -e "s,@LIB_hcrypto_appl@,-lcrypto,g" \ + -e "s,@LIB_pkinit@,-lhx509,g" \ + -e "s,@LIB_dlopen@,,g" \ + -e "s,@LIB_door_create@,,g" \ + -e "s,@PTHREAD_LIBADD@,-pthread,g" \ + -e "s,@LIBS@,,g" \ -e "s,@INCLUDE_hcrypto@,,g" \ ${.ALLSRC} > ${.TARGET} From owner-svn-src-all@freebsd.org Mon Aug 20 00:49:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FB36107DC19; Mon, 20 Aug 2018 00:49:07 +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 C7D8E7283D; Mon, 20 Aug 2018 00:49:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9087624A; Mon, 20 Aug 2018 00:49:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7K0n6Kk075359; Mon, 20 Aug 2018 00:49:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K0n6ea075358; Mon, 20 Aug 2018 00:49:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808200049.w7K0n6ea075358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 20 Aug 2018 00:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338077 - stable/11/stand/libsa X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/libsa X-SVN-Commit-Revision: 338077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 00:49:07 -0000 Author: kevans Date: Mon Aug 20 00:49:06 2018 New Revision: 338077 URL: https://svnweb.freebsd.org/changeset/base/338077 Log: MFC r337523: libsa: exit on EOF in ngets It was possible in some rare circumstances for ngets to behave terribly with bhyveload and some form of redirecting user input over a pipe. PR: 198706 Modified: stable/11/stand/libsa/gets.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/libsa/gets.c ============================================================================== --- stable/11/stand/libsa/gets.c Mon Aug 20 00:47:51 2018 (r338076) +++ stable/11/stand/libsa/gets.c Mon Aug 20 00:49:06 2018 (r338077) @@ -44,8 +44,11 @@ ngets(char *buf, int n) int c; char *lp; - for (lp = buf;;) - switch (c = getchar() & 0177) { + for (lp = buf;;) { + c = getchar(); + if (c == -1) + break; + switch (c & 0177) { case '\n': case '\r': *lp = '\0'; @@ -79,6 +82,7 @@ ngets(char *buf, int n) putchar(c); } } + } /*NOTREACHED*/ } From owner-svn-src-all@freebsd.org Mon Aug 20 00:50:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B5C3107DCE7; Mon, 20 Aug 2018 00:50:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 219FF729DC; Mon, 20 Aug 2018 00:50:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03A5F624F; Mon, 20 Aug 2018 00:50:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7K0oBCT075498; Mon, 20 Aug 2018 00:50:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K0oBSC075497; Mon, 20 Aug 2018 00:50:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808200050.w7K0oBSC075497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 20 Aug 2018 00:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338078 - stable/11/stand/i386/libi386 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/i386/libi386 X-SVN-Commit-Revision: 338078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 00:50:12 -0000 Author: kevans Date: Mon Aug 20 00:50:11 2018 New Revision: 338078 URL: https://svnweb.freebsd.org/changeset/base/338078 Log: MFC r337524: libi386: Fix typo in pxe.h PR: 207337 Modified: stable/11/stand/i386/libi386/pxe.h Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/i386/libi386/pxe.h ============================================================================== --- stable/11/stand/i386/libi386/pxe.h Mon Aug 20 00:49:06 2018 (r338077) +++ stable/11/stand/i386/libi386/pxe.h Mon Aug 20 00:50:11 2018 (r338078) @@ -147,7 +147,7 @@ typedef struct { PXENV_STATUS_t Status; ADDR32_t ProtocolIni; /* Phys addr of a copy of the driver module */ uint8_t reserved[8]; -} PACKED t_PXENV_UNDI_INITALIZE; +} PACKED t_PXENV_UNDI_INITIALIZE; #define MAXNUM_MCADDR 8 From owner-svn-src-all@freebsd.org Mon Aug 20 00:51:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1F78107DF09; Mon, 20 Aug 2018 00:51:20 +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 8795272D05; Mon, 20 Aug 2018 00:51:20 +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 4ECBC6383; Mon, 20 Aug 2018 00:51:20 +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 w7K0pKAp077088; Mon, 20 Aug 2018 00:51:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K0pKtH077087; Mon, 20 Aug 2018 00:51:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808200051.w7K0pKtH077087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 20 Aug 2018 00:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338079 - stable/11/lib/libc/stdlib X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/lib/libc/stdlib X-SVN-Commit-Revision: 338079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 00:51:21 -0000 Author: kevans Date: Mon Aug 20 00:51:19 2018 New Revision: 338079 URL: https://svnweb.freebsd.org/changeset/base/338079 Log: MFC r337666: getopt_long(3): Document behavior, optstring leading characters Leading '+', '-', and ':' in optstring have special meaning. We briefly mention that the first two have special meaning in that we say POSIXLY_CORRECT turns them off, but we don't actually document their meaning. Add a paragraph to RETURN VALUES explaining how they control the treatment of non-option arguments. A leading ':' has no mention; add a note that it suppresses warnings about missing arguments. Modified: stable/11/lib/libc/stdlib/getopt_long.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/stdlib/getopt_long.3 ============================================================================== --- stable/11/lib/libc/stdlib/getopt_long.3 Mon Aug 20 00:50:11 2018 (r338078) +++ stable/11/lib/libc/stdlib/getopt_long.3 Mon Aug 20 00:51:19 2018 (r338079) @@ -31,7 +31,7 @@ .\" @(#)getopt.3 8.5 (Berkeley) 4/27/95 .\" $FreeBSD$ .\" -.Dd December 25, 2011 +.Dd May 2, 2018 .Dt GETOPT_LONG 3 .Os .Sh NAME @@ -207,12 +207,53 @@ these functions return 0 and store .Fa val in the location pointed to by .Fa flag . +.Pp These functions return .Ql \&: -if there was a missing option argument, +if there was a missing option argument and error messages are suppressed, .Ql \&? if the user specified an unknown or ambiguous option, and \-1 when the argument list has been exhausted. +The default behavior when a missing option argument is encountered is to write +an error and return +.Ql \&? . +Specifying +.Ql \&: +in +.Fa optstr +will cause the error message to be suppressed and +.Ql \&: +to be returned instead. +.Pp +In addition to +.Ql \&: , +a leading +.Ql \&+ +or +.Ql \&- +in +.Fa optstr +also has special meaning. +If either of these are specified, they must appear before +.Ql \&: . +.Pp +A leading +.Ql \&+ +indicates that processing should be halted at the first non-option argument, +matching the default behavior of +.Xr getopt 3 . +The default behavior without +.Ql \&+ +is to permute non-option argments to the end of +.Fa argv . +.Pp +A leading +.Ql \&- +indicates that all non-option arguments should be treated as if they are +arguments to a literal +.Ql \&1 +flag (i.e., the function call will return the value 1, rather than the char +literal '1'). .Sh ENVIRONMENT .Bl -tag -width ".Ev POSIXLY_CORRECT" .It Ev POSIXLY_CORRECT From owner-svn-src-all@freebsd.org Mon Aug 20 00:53:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FFC8107DFEC; Mon, 20 Aug 2018 00:53:40 +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 1105B72F2A; Mon, 20 Aug 2018 00:53:40 +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 CA58D63DF; Mon, 20 Aug 2018 00:53: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 w7K0rdqA080374; Mon, 20 Aug 2018 00:53:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K0rdPl080372; Mon, 20 Aug 2018 00:53:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808200053.w7K0rdPl080372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 20 Aug 2018 00:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338080 - in stable/11: cddl/lib/libnvpair cddl/lib/libzfs_core include X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: cddl/lib/libnvpair cddl/lib/libzfs_core include X-SVN-Commit-Revision: 338080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 00:53:40 -0000 Author: kevans Date: Mon Aug 20 00:53:38 2018 New Revision: 338080 URL: https://svnweb.freebsd.org/changeset/base/338080 Log: MFC r337696: Use INCS for non-sys/ libnvpair and libzfs_core includes While nothing was wrong with libnvpair.h, libzfs_core.h was only guarded by MK_CDDL rather than MK_CDDL && MK_ZFS. Rather than ugl'if'ying include/Makefile to impose the extra restriction, just move the non-sys/ includes into INCS with the respect lib builds. This has the added bonus of allowing third party packagers to try and split these libs out of the FreeBSD-runtime package, if they are so inclined. The sys/ include was left alone- generally userland libraries shouldn't install kernel headers. Modified: stable/11/cddl/lib/libnvpair/Makefile stable/11/cddl/lib/libzfs_core/Makefile stable/11/include/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/lib/libnvpair/Makefile ============================================================================== --- stable/11/cddl/lib/libnvpair/Makefile Mon Aug 20 00:51:19 2018 (r338079) +++ stable/11/cddl/lib/libnvpair/Makefile Mon Aug 20 00:53:38 2018 (r338080) @@ -5,6 +5,7 @@ LIB= nvpair +INCS= libnvpair.h SRCS= libnvpair.c \ nvpair_alloc_system.c \ nvpair_json.c \ Modified: stable/11/cddl/lib/libzfs_core/Makefile ============================================================================== --- stable/11/cddl/lib/libzfs_core/Makefile Mon Aug 20 00:51:19 2018 (r338079) +++ stable/11/cddl/lib/libzfs_core/Makefile Mon Aug 20 00:53:38 2018 (r338080) @@ -9,6 +9,7 @@ LIB= zfs_core LIBADD= nvpair +INCS= libzfs_core.h SRCS= libzfs_core.c \ libzfs_core_compat.c \ zfs_ioctl_compat.c Modified: stable/11/include/Makefile ============================================================================== --- stable/11/include/Makefile Mon Aug 20 00:51:19 2018 (r338079) +++ stable/11/include/Makefile Mon Aug 20 00:53:38 2018 (r338080) @@ -243,12 +243,6 @@ copies: .PHONY .META ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 teken.h \ ${DESTDIR}${INCLUDEDIR}/teken .if ${MK_CDDL} != "no" - cd ${.CURDIR}/../cddl/contrib/opensolaris/lib/libzfs_core/common; \ - ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 libzfs_core.h \ - ${DESTDIR}${INCLUDEDIR} - cd ${.CURDIR}/../cddl/contrib/opensolaris/lib/libnvpair; \ - ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 libnvpair.h \ - ${DESTDIR}${INCLUDEDIR} cd ${.CURDIR}/../sys/cddl/contrib/opensolaris/uts/common/sys; \ ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nvpair.h \ ${DESTDIR}${INCLUDEDIR}/sys From owner-svn-src-all@freebsd.org Mon Aug 20 01:01:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45C9A107E4FF; Mon, 20 Aug 2018 01:01:35 +0000 (UTC) (envelope-from loos@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 ED1C0732FB; Mon, 20 Aug 2018 01:01:34 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE0816448; Mon, 20 Aug 2018 01:01:34 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7K11YcC083019; Mon, 20 Aug 2018 01:01:34 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K11Xbu083014; Mon, 20 Aug 2018 01:01:33 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201808200101.w7K11Xbu083014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 20 Aug 2018 01:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338081 - in stable/11/sys: net netinet netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: loos X-SVN-Commit-Paths: in stable/11/sys: net netinet netinet6 X-SVN-Commit-Revision: 338081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 01:01:35 -0000 Author: loos Date: Mon Aug 20 01:01:33 2018 New Revision: 338081 URL: https://svnweb.freebsd.org/changeset/base/338081 Log: MFC r312770 and r337854: After the in_control() changes in r257692, an existing address is (intentionally) deleted first and then completely added again (so all the events, announces and hooks are given a chance to run). This cause an issue with CARP where the existing CARP data structure is removed together with the last address for a given VHID, which will cause a subsequent fail when the address is later re-added. This change fixes this issue by adding a new flag to keep the CARP data structure when an address is not being removed. There was an additional issue with IPv6 CARP addresses, where the CARP data structure would never be removed after a change and lead to VHIDs which cannot be destroyed. PR: 229384 Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/net/if.c stable/11/sys/netinet/in.c stable/11/sys/netinet/ip_carp.c stable/11/sys/netinet/ip_carp.h stable/11/sys/netinet6/in6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Mon Aug 20 00:53:38 2018 (r338080) +++ stable/11/sys/net/if.c Mon Aug 20 01:01:33 2018 (r338081) @@ -224,7 +224,7 @@ int (*carp_output_p)(struct ifnet *ifp, struct mbuf *m const struct sockaddr *sa); int (*carp_ioctl_p)(struct ifreq *, u_long, struct thread *); int (*carp_attach_p)(struct ifaddr *, int); -void (*carp_detach_p)(struct ifaddr *); +void (*carp_detach_p)(struct ifaddr *, bool); #endif #ifdef INET int (*carp_iamatch_p)(struct ifaddr *, uint8_t **); Modified: stable/11/sys/netinet/in.c ============================================================================== --- stable/11/sys/netinet/in.c Mon Aug 20 00:53:38 2018 (r338080) +++ stable/11/sys/netinet/in.c Mon Aug 20 01:01:33 2018 (r338081) @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); #include static int in_aifaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *); -static int in_difaddr_ioctl(caddr_t, struct ifnet *, struct thread *); +static int in_difaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *); static void in_socktrim(struct sockaddr_in *); static void in_purgemaddrs(struct ifnet *); @@ -245,7 +245,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data break; case SIOCDIFADDR: sx_xlock(&in_control_sx); - error = in_difaddr_ioctl(data, ifp, td); + error = in_difaddr_ioctl(cmd, data, ifp, td); sx_xunlock(&in_control_sx); return (error); case OSIOCAIFADDR: /* 9.x compat */ @@ -390,7 +390,7 @@ in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifne IF_ADDR_RUNLOCK(ifp); if (ia != NULL) - (void )in_difaddr_ioctl(data, ifp, td); + (void )in_difaddr_ioctl(cmd, data, ifp, td); ifa = ifa_alloc(sizeof(struct in_ifaddr), M_WAITOK); ia = (struct in_ifaddr *)ifa; @@ -528,7 +528,7 @@ fail2: fail1: if (ia->ia_ifa.ifa_carp) - (*carp_detach_p)(&ia->ia_ifa); + (*carp_detach_p)(&ia->ia_ifa, false); IF_ADDR_WLOCK(ifp); TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link); @@ -545,7 +545,7 @@ fail1: } static int -in_difaddr_ioctl(caddr_t data, struct ifnet *ifp, struct thread *td) +in_difaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td) { const struct ifreq *ifr = (struct ifreq *)data; const struct sockaddr_in *addr = (const struct sockaddr_in *) @@ -618,7 +618,7 @@ in_difaddr_ioctl(caddr_t data, struct ifnet *ifp, stru in_ifadown(&ia->ia_ifa, 1); if (ia->ia_ifa.ifa_carp) - (*carp_detach_p)(&ia->ia_ifa); + (*carp_detach_p)(&ia->ia_ifa, cmd == SIOCAIFADDR); /* * If this is the last IPv4 address configured on this Modified: stable/11/sys/netinet/ip_carp.c ============================================================================== --- stable/11/sys/netinet/ip_carp.c Mon Aug 20 00:53:38 2018 (r338080) +++ stable/11/sys/netinet/ip_carp.c Mon Aug 20 01:01:33 2018 (r338081) @@ -1872,7 +1872,7 @@ carp_attach(struct ifaddr *ifa, int vhid) } void -carp_detach(struct ifaddr *ifa) +carp_detach(struct ifaddr *ifa, bool keep_cif) { struct ifnet *ifp = ifa->ifa_ifp; struct carp_if *cif = ifp->if_carp; @@ -1918,12 +1918,13 @@ carp_detach(struct ifaddr *ifa) carp_hmac_prepare(sc); carp_sc_state(sc); - if (sc->sc_naddrs == 0 && sc->sc_naddrs6 == 0) + if (!keep_cif && sc->sc_naddrs == 0 && sc->sc_naddrs6 == 0) carp_destroy(sc); else CARP_UNLOCK(sc); - CIF_FREE(cif); + if (!keep_cif) + CIF_FREE(cif); sx_xunlock(&carp_sx); } Modified: stable/11/sys/netinet/ip_carp.h ============================================================================== --- stable/11/sys/netinet/ip_carp.h Mon Aug 20 00:53:38 2018 (r338080) +++ stable/11/sys/netinet/ip_carp.h Mon Aug 20 01:01:33 2018 (r338081) @@ -138,7 +138,7 @@ struct carpreq { #ifdef _KERNEL int carp_ioctl(struct ifreq *, u_long, struct thread *); int carp_attach(struct ifaddr *, int); -void carp_detach(struct ifaddr *); +void carp_detach(struct ifaddr *, bool); void carp_carpdev_state(struct ifnet *); int carp_input(struct mbuf **, int *, int); int carp6_input (struct mbuf **, int *, int); @@ -154,7 +154,7 @@ int carp_forus(struct ifnet *, u_char *); /* net/if.c */ extern int (*carp_ioctl_p)(struct ifreq *, u_long, struct thread *); extern int (*carp_attach_p)(struct ifaddr *, int); -extern void (*carp_detach_p)(struct ifaddr *); +extern void (*carp_detach_p)(struct ifaddr *, bool); extern void (*carp_linkstate_p)(struct ifnet *); extern void (*carp_demote_adj_p)(int, char *); extern int (*carp_master_p)(struct ifaddr *); Modified: stable/11/sys/netinet6/in6.c ============================================================================== --- stable/11/sys/netinet6/in6.c Mon Aug 20 00:53:38 2018 (r338080) +++ stable/11/sys/netinet6/in6.c Mon Aug 20 01:01:33 2018 (r338081) @@ -556,8 +556,11 @@ in6_control(struct socket *so, u_long cmd, caddr_t dat */ if ((error = in6_update_ifa(ifp, ifra, ia, 0)) != 0) goto out; - if (ia != NULL) + if (ia != NULL) { + if (ia->ia_ifa.ifa_carp) + (*carp_detach_p)(&ia->ia_ifa, true); ifa_free(&ia->ia_ifa); + } if ((ia = in6ifa_ifpwithaddr(ifp, &ifra->ifra_addr.sin6_addr)) == NULL) { /* @@ -624,7 +627,7 @@ in6_control(struct socket *so, u_long cmd, caddr_t dat */ if ((error = nd6_prelist_add(&pr0, NULL, &pr)) != 0) { if (carp_attached) - (*carp_detach_p)(&ia->ia_ifa); + (*carp_detach_p)(&ia->ia_ifa, false); goto out; } } @@ -1244,7 +1247,7 @@ in6_purgeaddr(struct ifaddr *ifa) int plen, error; if (ifa->ifa_carp) - (*carp_detach_p)(ifa); + (*carp_detach_p)(ifa, false); /* * Remove the loopback route to the interface address. From owner-svn-src-all@freebsd.org Mon Aug 20 01:13:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 100A2107EAAD; Mon, 20 Aug 2018 01:13:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A344573ABE; Mon, 20 Aug 2018 01:13:51 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f175.google.com with SMTP id v14-v6so2203543iob.4; Sun, 19 Aug 2018 18:13:51 -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=TytFPO0uEiBocEImIJ+gY/kQlw9whAP405s+P+GNNa8=; b=Ecp4nsv9adumvvCAwras/KFr1ZR98hcl7fWwc7NP8GnGvW2OM7N0ptF0cC/AEN9oW9 aW+mE5qTpdjJOxtWfxQ42norXNuMAS6uhfTCA/VJexkMy/BOoDnQTjBEMOZAtlJGd5Gs HQLCj43qB/E4tj4lyElkesrt7pbxKVqkm5m5Up86EPAKD68seNeNV81j6AqGtEp1YA9C AbSXKnz7lSDMaFMP4ga4EV1af2KYmGW5x5KbCsRwjWnM4rQ86hg+hvTvo+8kLuyJLJVt FHWgBSyEUg92aF8+LPOa5YA9SO50jlY+zJKF2DVU8GjWvgIt7mZ2j8iW1VcBDSBGcb9K g0EQ== X-Gm-Message-State: APzg51ChCKQQCdJ85ufupYj53hubHs0J+Hpui0vf9o/fvw5ZRl5HO/dF dlxWmwwrKYTZtoqer2tKNyZHSJC6 X-Google-Smtp-Source: ANB0Vdbdj6oqggzyJ6x+hUp3GL1/7/WRxzCQmsMPmdMJrbiYba8g1WnRvDXbYfbeiYLtGR/6ncDFog== X-Received: by 2002:a6b:554:: with SMTP id 81-v6mr2395736iof.202.1534727625431; Sun, 19 Aug 2018 18:13:45 -0700 (PDT) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com. [209.85.223.173]) by smtp.gmail.com with ESMTPSA id y189-v6sm2950986itd.26.2018.08.19.18.13.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Aug 2018 18:13:45 -0700 (PDT) Received: by mail-io0-f173.google.com with SMTP id l14-v6so11271141iob.7; Sun, 19 Aug 2018 18:13:45 -0700 (PDT) X-Received: by 2002:a6b:be46:: with SMTP id o67-v6mr35817973iof.143.1534727625019; Sun, 19 Aug 2018 18:13:45 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:b472:0:0:0:0:0 with HTTP; Sun, 19 Aug 2018 18:13:44 -0700 (PDT) In-Reply-To: References: <201808191456.w7JEuAZE069780@repo.freebsd.org> <97661C9D-9C25-4DE0-89A8-FE1C40DAFB81@freebsd.org> From: Conrad Meyer Date: Sun, 19 Aug 2018 18:13:44 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r338053 - head/sys/netinet To: "Bjoern A. Zeeb" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 01:13:52 -0000 On Sun, Aug 19, 2018 at 11:40 AM, Bjoern A. Zeeb wrote: > I am so happy we have a version control system where you could hopefully > find out if the original committer left a decent commit message.. takes less > than 60 seconds .. > https://svnweb.freebsd.org/base?view=revision&revision=82122 It is great we have such a system, but unfortunately the message doesn't really answer my question(s). I don't know that that means it isn't "decent," but it isn't really helpful. :-) Take care, Conrad From owner-svn-src-all@freebsd.org Mon Aug 20 01:38:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF1F1107F2CB; Mon, 20 Aug 2018 01:38:49 +0000 (UTC) (envelope-from loos@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 6B83A7444C; Mon, 20 Aug 2018 01:38:49 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4157E6A5A; Mon, 20 Aug 2018 01:38:49 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7K1cnnj000945; Mon, 20 Aug 2018 01:38:49 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K1cmOw000943; Mon, 20 Aug 2018 01:38:48 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201808200138.w7K1cmOw000943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 20 Aug 2018 01:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338082 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: loos X-SVN-Commit-Paths: stable/11/sys/netpfil/ipfw X-SVN-Commit-Revision: 338082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 01:38:49 -0000 Author: loos Date: Mon Aug 20 01:38:48 2018 New Revision: 338082 URL: https://svnweb.freebsd.org/changeset/base/338082 Log: MFC r321316, r337860: Fix a few typos in comments. Modified: stable/11/sys/netpfil/ipfw/ip_dn_io.c stable/11/sys/netpfil/ipfw/ip_fw_table.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/ip_dn_io.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_dn_io.c Mon Aug 20 01:01:33 2018 (r338081) +++ stable/11/sys/netpfil/ipfw/ip_dn_io.c Mon Aug 20 01:38:48 2018 (r338082) @@ -807,7 +807,7 @@ dummynet_send(struct mbuf *m) ether_demux(m->m_pkthdr.rcvif, m); break; - case DIR_OUT | PROTO_LAYER2: /* N_TO_ETH_OUT: */ + case DIR_OUT | PROTO_LAYER2: /* DN_TO_ETH_OUT: */ ether_output_frame(ifp, m); break; Modified: stable/11/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_table.c Mon Aug 20 01:01:33 2018 (r338081) +++ stable/11/sys/netpfil/ipfw/ip_fw_table.c Mon Aug 20 01:38:48 2018 (r338082) @@ -1658,7 +1658,7 @@ ipfw_unref_table(struct ip_fw_chain *ch, uint16_t kidx } /* - * Lookup an arbtrary key @paddr of legth @plen in table @tbl. + * Lookup an arbitrary key @paddr of length @plen in table @tbl. * Stores found value in @val. * * Returns 1 if key was found. From owner-svn-src-all@freebsd.org Mon Aug 20 01:41:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6E02107F4EB; Mon, 20 Aug 2018 01:41:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f178.google.com (mail-io0-f178.google.com [209.85.223.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C8BC747AD; Mon, 20 Aug 2018 01:41:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f178.google.com with SMTP id l7-v6so11299276iok.6; Sun, 19 Aug 2018 18:41:32 -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=T/aw6vjC1ZUF8uE4bGrgu9IxAfQPLENRpabNglN64zA=; b=iWAHXSc4BtePyYRu2GtoSw1NFrXIDHprIZf2EE9kWWXpLXiIzH4fD+8PAEgV0BlrHV YUAyum7HoGiNmUxfXNQWm+ODC5SY60DFhLlTn4dw7GFVLGas44jV0vinHhbxQKyjsV/o gj121hae+UpFD+ykU6r7CX/+CLx3o9vCRazWxJo7NfWc3qqUScpPW2KLDmMlAersjotJ jVZnyQQEBCQnvzHIK0FwJoeXl3bvRgoh3t6oRsRnaylLhw2ChkE2kpv37/S3iBOLLn9A nzOkajC4H3ftz6n/u5FX3LADWkN8M2TT7jcxZtyFuPT7bwH6Ojc92w6kjl5WmFzM3bQv MFtw== X-Gm-Message-State: APzg51C4E0IpOhcf0INPSHMqSO/DOq6LUCVDSCryekZRUEjhG4Fhvwdb aImd62Ufl7pvTR+TEp864Q9L1MB6 X-Google-Smtp-Source: ANB0VdZr032RjghB7/3R8F0QJV1VmQtoeuis9MUd3D3SnpgdPg0zu2ZQ7P/I6i8cpR8A2oyCC3dYdw== X-Received: by 2002:a6b:b7c7:: with SMTP id h190-v6mr253865iof.164.1534727553311; Sun, 19 Aug 2018 18:12:33 -0700 (PDT) Received: from mail-it0-f50.google.com (mail-it0-f50.google.com. [209.85.214.50]) by smtp.gmail.com with ESMTPSA id u4-v6sm3054300iob.0.2018.08.19.18.12.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Aug 2018 18:12:33 -0700 (PDT) Received: by mail-it0-f50.google.com with SMTP id h20-v6so18480657itf.2; Sun, 19 Aug 2018 18:12:33 -0700 (PDT) X-Received: by 2002:a24:f945:: with SMTP id l66-v6mr8219653ith.6.1534727553008; Sun, 19 Aug 2018 18:12:33 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:b472:0:0:0:0:0 with HTTP; Sun, 19 Aug 2018 18:12:32 -0700 (PDT) In-Reply-To: <97661C9D-9C25-4DE0-89A8-FE1C40DAFB81@freebsd.org> References: <201808191456.w7JEuAZE069780@repo.freebsd.org> <97661C9D-9C25-4DE0-89A8-FE1C40DAFB81@freebsd.org> From: Conrad Meyer Date: Sun, 19 Aug 2018 18:12:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r338053 - head/sys/netinet To: Michael Tuexen Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 01:41:33 -0000 On Sun, Aug 19, 2018 at 10:08 AM, Michael Tuexen wrote: >> On 19. Aug 2018, at 18:35, Conrad Meyer wrote: >> Hi Michael, >> >> How was this particular keyed hash function construction chosen? >> (Yes, I see it is the same initial TSN, but how was that selected?) > You mean: > > Why is FreeBSD using the MD5 with secret suffix as the keyed hash function? Yes :-). > I don't know, I have not implemented that. > > However, https://tools.ietf.org/html/rfc6528#section-3 suggests this, > OpenBSD uses a similar computation, but uses SHA512 instead of MD5, NetBSD > seem to use the same computation as FreeBSD. > I guess using MD5 was an acceptable choice at the time the choice was made. I see. I don't know that MD5 is a poor fit, but the actual HMAC construction has somewhat nicer properties than this digest with a plain secret suffix construction. I don't know that those properties matter for this use, especially when the hash is then truncated to a 32-bit value anyway. > When preparing this patch I was about to choose a different keyed hash function, > but decided to separate > * Using a keyed has functions as the offset for the TCP time stamp. > * Choose a good keyed hash function. > > That is why I isolated the keyed hash function. So it is simple to replace > it with a different one. That seems very reasonable to me, thanks. > I think it would be good to change this keyed hash function to SIP-HASH (both > for the initial sequence number and the time stamp). Opinions? Well, sip-hash is no cryptographic hash, but it is unclear to me if that is needed or meaningful for this use. There may be good modern keyed cryptographic hashes with comparable performance to MD5 (i.e., according to https://www.cryptopp.com/benchmarks.html Blake2 may have comparable performance to MD5, although it is unclear how performance compares for very small "messages" like this use). But I admit I am unfamiliar with the requirements here and therefore am hesitant to make any recommendation. All the best, Conrad From owner-svn-src-all@freebsd.org Mon Aug 20 02:08:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CB6B107FE69; Mon, 20 Aug 2018 02:08:40 +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 1F7BC7532A; Mon, 20 Aug 2018 02:08:40 +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 004756F38; Mon, 20 Aug 2018 02:08:40 +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 w7K28dLm016281; Mon, 20 Aug 2018 02:08:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K28d4p016280; Mon, 20 Aug 2018 02:08:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808200208.w7K28d4p016280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 20 Aug 2018 02:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338083 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 338083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 02:08:40 -0000 Author: kevans Date: Mon Aug 20 02:08:39 2018 New Revision: 338083 URL: https://svnweb.freebsd.org/changeset/base/338083 Log: Add drawer.lua(8) Added: head/stand/lua/drawer.lua.8 (contents, props changed) Added: head/stand/lua/drawer.lua.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/drawer.lua.8 Mon Aug 20 02:08:39 2018 (r338083) @@ -0,0 +1,179 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Kyle Evans +.\" +.\" 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$ +.\" +.Dd August 19, 2018 +.Dt DRAWER.LUA 8 +.Os +.Sh NAME +.Nm drawer.lua +.Nd FreeBSD menu/screen drawer module +.Sh DESCRIPTION +.Nm +contains functionality for drawing and manipulating the menu, logo, and brand +to the screen. +.Pp +Before using the functionality provided by +.Nm , +it must be included with a statement such as the following: +.Pp +.Dl local drawer = require("drawer") +.Ss BRAND DEFINITIONS +Brand definitions describe a +.Dq brand , +traditionally drawn above the menu. +The exact position may be controlled by using the +.Xr loader.conf 5 +variables +.Va loader_brand_x +and +.Va loader_brand_y . +The following keys may be defined for a brand definition: +.Bl -tag -width ".Ic Graphic" -offset indent +.It Ic graphic +A table of strings containing rows of text to be drawn to the screen. +.El +.Ss LOGO DEFINITIONS +Logo definitions describe a +.Dq logo , +traditionally to the right of the menu. +The exact position may be controlled by using the +.Xr loader.conf 5 +variables +.Va loader_logo_x +and +.Va loader_logo_y . +The following keys may be defined for a logo definition: +.Bl -tag -width ".Ic requires_color" -offset indent +.It Ic requires_color +A boolean describing whether or not this logo definition requires color. +If it is chosen to be drawn and it requires color on a color-disabled boot, +.Nm +will elect to use the default +.Dq orbbw +logo rather than the chosen logo. +.It Ic graphic +A table of strings containing rows of text to be drawn to the screen. +.It Ic shift +A table describing the +.Va x +and +.Va y +shift that should be applied to all elements should this logo be selected. +This is typically used for shifting the menu and brand if an empty or minimal +logo are selected. +.El +.Ss CUSTOM BRANDS AND LOGOS +The brand and logo system is designed to allow brands and logos to be easily +plugged in. +When an unrecognized +.Ev loader_brand +or +.Ev loader_logo +are encountered, +.Nm +will attempt to include +.Pa brand-${loader_brand}.lua +or +.Pa logo-${loader_logo}.lua +respectively. +These files are expected to call either +.Fn drawer.addBrand +or +.Fn drawer.addLogo +to add the requested branddef or logodef. +.Nm +will attempt to do another lookup for the requested brand or logo before falling +back to one of the following: +.Bl -tag -width ".Ic drawer.default_color_logodef" -offset indent +.It Ic drawer.default_brand +The default brand to be used if the requested brand cannot be located. +.It Ic drawer.default_color_logodef +The default logodef to be used if an invalid logodef is requested and +.Xr loader 8 +has been configured to allow output of color. +.It Ic drawer.default_bw_logodef +The default logodef to be used if either an invalid logodef has been requested, +or a logodef has been requested that requires color and +.Xr loader 8 +has been configured to not output color. +.El +.Ss FRAME STYLES +.Nm +contains the definitions for the different frame styles that may be drawn around +the menu. +Frame styles define the characters drawn for horizontal lines, vertical aligns, +and each of the four corner styles. +The following keys may be defined for a frame style: +.Bl -bullet -width "" +.It +horizontal +.It +vertical +.It +top_left +.It +bottom_left +.It +top_right +.It +bottom_right +.El +Frame styles are currently defined in the table +.Ic drawer.frame_styles +indexed by the name used for +.Ev loader_menu_frame . +No API currently exists for manipulating this table indirectly. +.Ss Exported functions +The following functions are exported from +.Nm : +.Bl -tag -width hook.registerType -offset indent +.It Fn drawer.addBrand name def +Add the brand definition described by +.Fa def +to the table of known brand definitions, indexed by +.Fa name . +.It Fn drawer.addLogo name def +Add the logo definition described by +.Fa def +to the table of known logo definitions, indexed by +.Fa name . +.It Fn drawer.drawscreen menudef +Draws the logo, brand, menu frame, and the current menu as described in +.Fa menudef , +formatted as defined by +.Xr menu.lua 8 . +.El +.Sh SEE ALSO +.Xr menu.lua 8 +.Sh AUTHORS +The +.Nm +file was originally written by +.An Pedro Souza Aq Mt pedrosouza@FreeBSD.org . +Later work and this manual page was done by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . From owner-svn-src-all@freebsd.org Mon Aug 20 02:17:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5F89108015C; Mon, 20 Aug 2018 02:17:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4CD40757B9; Mon, 20 Aug 2018 02:17:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29BF170CC; Mon, 20 Aug 2018 02:17:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7K2Huha021339; Mon, 20 Aug 2018 02:17:56 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K2Huem021338; Mon, 20 Aug 2018 02:17:56 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808200217.w7K2Huem021338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 20 Aug 2018 02:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338084 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 338084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 02:17:57 -0000 Author: delphij Date: Mon Aug 20 02:17:55 2018 New Revision: 338084 URL: https://svnweb.freebsd.org/changeset/base/338084 Log: In r331279 the code used ENOSYS to check the existence of getrandom(2). This will only work if the caller already handles SIGSYS, which is not always the case. Address this by checking osreldate instead. Note that because there was not __FreeBSD_version bump when the system call was added, use 1200061 (r332100) which is the first bump after the introduction of the system call. PR: 230762 Reported by: Jenkins via Mark Millard Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D16807 Modified: head/lib/libc/gen/getentropy.c Modified: head/lib/libc/gen/getentropy.c ============================================================================== --- head/lib/libc/gen/getentropy.c Mon Aug 20 02:08:39 2018 (r338083) +++ head/lib/libc/gen/getentropy.c Mon Aug 20 02:17:55 2018 (r338084) @@ -34,10 +34,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "libc_private.h" +/* First __FreeBSD_version bump after introduction of getrandom(2) (r331279) */ +#define GETRANDOM_FIRST 1200061 + extern int __sysctl(int *, u_int, void *, size_t *, void *, size_t); static size_t @@ -99,21 +103,38 @@ int getentropy(void *buf, size_t buflen) { ssize_t rd; + bool have_getrandom; if (buflen > 256) { errno = EIO; return (-1); } + have_getrandom = (__getosreldate() >= GETRANDOM_FIRST); + while (buflen > 0) { - rd = getrandom(buf, buflen, 0); - if (rd == -1) { - if (errno == EINTR) - continue; - else if (errno == ENOSYS || errno == ECAPMODE) - return (getentropy_fallback(buf, buflen)); - else - return (-1); + if (have_getrandom) { + rd = getrandom(buf, buflen, 0); + if (rd == -1) { + switch (errno) { + case ECAPMODE: + /* + * Kernel >= r331280 and < r337999 + * will return ECAPMODE when the + * caller is already in capability + * mode, fallback to traditional + * method in this case. + */ + have_getrandom = false; + continue; + case EINTR: + continue; + default: + return (-1); + } + } + } else { + return (getentropy_fallback(buf, buflen)); } /* This cannot happen. */ From owner-svn-src-all@freebsd.org Mon Aug 20 02:37:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC1BF10808D0; Mon, 20 Aug 2018 02:37:25 +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 790907604D; Mon, 20 Aug 2018 02:37:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51A537409; Mon, 20 Aug 2018 02:37:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7K2bPLt031363; Mon, 20 Aug 2018 02:37:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K2bO5U031360; Mon, 20 Aug 2018 02:37:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808200237.w7K2bO5U031360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 20 Aug 2018 02:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338085 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 338085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 02:37:26 -0000 Author: kevans Date: Mon Aug 20 02:37:24 2018 New Revision: 338085 URL: https://svnweb.freebsd.org/changeset/base/338085 Log: Add color.lua(8), password.lua(8), and screen.lua(8) Added: head/stand/lua/color.lua.8 (contents, props changed) head/stand/lua/password.lua.8 (contents, props changed) head/stand/lua/screen.lua.8 (contents, props changed) Added: head/stand/lua/color.lua.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/color.lua.8 Mon Aug 20 02:37:24 2018 (r338085) @@ -0,0 +1,132 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Kyle Evans +.\" +.\" 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$ +.\" +.Dd August 19, 2018 +.Dt COLOR.LUA 8 +.Os +.Sh NAME +.Nm color.lua +.Nd FreeBSD color module +.Sh DESCRIPTION +.Nm +contains functionality for working with colors. +.Pp +Before using the functionality provided by +.Nm , +it must be included with a statement such as the following: +.Pp +.Dl local color = require("color") +.Pp +The following color constants are exported from +.Nm : +.Bl -tag -width "Ic color.MAGENTA" -offset indent +.It Ic color.BLACK +.It Ic color.RED +.It Ic color.GREEN +.It Ic color.YELLOW +.It Ic color.BLUE +.It Ic color.MAGENTA +.It Ic color.CYAN +.It Ic color.WHITE +.El +.Pp +The following attribute constants are exported from +.Nm : +.Bl -tag -width "Ic color.DEFAULT" -offset indent +.It Ic color.DEFAULT +.It Ic color.BRIGHT +.It Ic color.DIM +.El +.Pp +The following functions are exported from +.Nm : +.Bl -tag -width "Fn color.isEnabled" -offset indent +.It Fn color.isEnabled +Returns True if +.Xr loader 8 +has been configured to not allow color, False otherwise. +This checks the +.Ev loader_color +.Xr loader.conf 5 +variable, along with +.Fn core.isSerialBoot . +.It Fn color.escapefg color_value +Returns the escape sequence that encodes +.Fa color_value +as a foreground color. +.Fn color.escapefg +returns an empty string if color is disabled. +.It Fn color.resetfg +Returns the escape sequence for the default foreground color. +.Fn color.resetfg +returns an empty string if color is disabled. +.It Fn color.escapebg color_value +Returns the escape sequence that encodes +.Fa color_value +as a background color. +.Fn color.escapebg +returns an empty string if color is disabled. +.It Fn color.resetbg +Returns the escape sequence for the default background color. +.Fn color.resetbg +returns an empty string if color is disabled. +.It Fn color.escape fg_color bg_color attribute +Returns an escape sequence that encodes +.Fa fg_color +as the foreground color, +.Fa bg_color +as the background color, and +.Fa attribute +applied. +.Fn color.escape +returns an empty string if color is disabled. +.It Fn color.default +Returns the escape sequence for the default color scheme, white on black with +no attributes applied. +.Fn color.default +returns an empty string if color is disabled. +.It Fn color.highlight str +Returns +.Fa str +with the +.Ic color.BRIGHT +attribute applied before it and reset after it. +.Fn color.highlight +returns +.Fa str +if color is disabled. +.El +.Sh SEE ALSO +.Xr screen.lua 8 +.Sh AUTHORS +The +.Nm +file was originally written by +.An Pedro Souza Aq Mt pedrosouza@FreeBSD.org . +Later work and this manual page was done by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . Added: head/stand/lua/password.lua.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/password.lua.8 Mon Aug 20 02:37:24 2018 (r338085) @@ -0,0 +1,74 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Kyle Evans +.\" +.\" 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$ +.\" +.Dd August 19, 2018 +.Dt PASSWORD.LUA 8 +.Os +.Sh NAME +.Nm password.lua +.Nd FreeBSD password module +.Sh DESCRIPTION +.Nm +contains functionality for prompting for and checking passwords. +.Pp +Before using the functionality provided by +.Nm , +it must be included with a statement such as the following: +.Pp +.Dl local password = require("password") +.Pp +The following functions are exported from +.Nm : +.Bl -tag -width "Fn password.read prompt_length" -offset indent +.It Fn password.read prompt_length +Read a password following a prompt. +.Fa prompt_length +is required so that the twiddle may be properly drawn as the user is typing. +.It Fn password.check +Drives the primary password checks done by the loader. +The +.Fn password.check +function will check +.Ev bootlock_password , +.Ev geom_eli_passphrase_prompt , +and +.Ev password +and prompt the user for passwords as-needed. +If +.Ev password +is set, the autoboot sequence will begin as the user is prompted for a password. +.El +.Sh SEE ALSO +.Xr screen.lua 8 +.Sh AUTHORS +The +.Nm +file was originally written by +.An Pedro Souza Aq Mt pedrosouza@FreeBSD.org . +Later work and this manual page was done by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . Added: head/stand/lua/screen.lua.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/screen.lua.8 Mon Aug 20 02:37:24 2018 (r338085) @@ -0,0 +1,102 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Kyle Evans +.\" +.\" 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$ +.\" +.Dd August 19, 2018 +.Dt SCREEN.LUA 8 +.Os +.Sh NAME +.Nm screen.lua +.Nd FreeBSD screen manipulation module +.Sh DESCRIPTION +.Nm +contains functionality for manipulating the screen. +This includes functionality such as clearing the screen, moving the cursor, and +setting foreground/background colors using sequences provided by +.Xr color.lua 8 . +.Pp +Before using the functionality provided by +.Nm , +it must be included with a statement such as the following: +.Pp +.Dl local screen = require("screen") +.Pp +The following variables are exported from +.Nm : +.Bl -tag -width "Ic screen.default_x" -offset indent +.It Ic screen.default_x +The x component of the default cursor position. +.It Ic screen.default_y +The y component of the default cursor position. +.El +.Pp +The following functions are exported from +.Nm : +.Bl -tag -width "Fn screen.clear" -offset indent +.It Fn screen.clear +Clears the screen. +.Fn screen.clear +will do nothing if a serial boot is detected. +.It Fn screen.setcursor x y +Sets the cursor position to +.Fa x , +.Fa y . +.Fn screen.setcursor +will do nothing if a serial boot is detected. +.It Fn screen.setforeground color_value +Sets the foreground color to +.Fa color_value , +which should be a constant defined in +.Xr color.lua 8 . +.Fn screen.setforeground +will do nothing if color is disabled. +.It Fn screen.setbackground color_value +Sets the background color to +.Fa color_value , +which should be a constant defined in +.Xr color.lua 8 . +.Fn screen.setbackground +will do nothing if color is disabled. +.It Fn screen.defcolor +Sets the default color scheme, as defined by +.Fn color.default . +.Fn screen.defcolor +will do nothing if color is disabled. +.It Fn screen.defcursor +Sets the default cursor position to that defined by +.Ic screen.default_x , +.Ic screen.default_y . +.El +.Sh SEE ALSO +.Xr color.lua 8 +.Sh AUTHORS +The +.Nm +file was originally written by +.An Pedro Souza Aq Mt pedrosouza@FreeBSD.org . +Later work and this manual page was done by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . From owner-svn-src-all@freebsd.org Mon Aug 20 02:40:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EDB11080A01; Mon, 20 Aug 2018 02:40:11 +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 ADFD576228; Mon, 20 Aug 2018 02:40:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C8B47410; Mon, 20 Aug 2018 02:40:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7K2eAA9031543; Mon, 20 Aug 2018 02:40:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K2eAoR031542; Mon, 20 Aug 2018 02:40:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808200240.w7K2eAoR031542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 20 Aug 2018 02:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338086 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 338086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 02:40:11 -0000 Author: kevans Date: Mon Aug 20 02:40:10 2018 New Revision: 338086 URL: https://svnweb.freebsd.org/changeset/base/338086 Log: lualoader: Install all manpages Now that a complete set is written, save for one describing loader.lua, install all of them. This was not previously done as they were written to hopefully avoid confusion as bits and pieces of the overall system were undocumented. Modified: head/stand/lua/Makefile Modified: head/stand/lua/Makefile ============================================================================== --- head/stand/lua/Makefile Mon Aug 20 02:37:24 2018 (r338085) +++ head/stand/lua/Makefile Mon Aug 20 02:40:10 2018 (r338086) @@ -2,6 +2,16 @@ .include +MAN= cli.lua.8 \ + color.lua.8 \ + config.lua.8 \ + core.lua.8 \ + drawer.lua.8 \ + hook.lua.8 \ + menu.lua.8 \ + password.lua.8 \ + screen.lua.8 + FILESDIR= /boot/lua FILES= cli.lua \ color.lua \ From owner-svn-src-all@freebsd.org Mon Aug 20 04:44:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F32861082F20; Mon, 20 Aug 2018 04:44:30 +0000 (UTC) (envelope-from araujo@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 A4DA979E67; Mon, 20 Aug 2018 04:44:30 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7ABD71096B; Mon, 20 Aug 2018 04:44:30 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7K4iUru098911; Mon, 20 Aug 2018 04:44:30 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K4iUhf098910; Mon, 20 Aug 2018 04:44:30 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201808200444.w7K4iUhf098910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 20 Aug 2018 04:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338087 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 338087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 04:44:31 -0000 Author: araujo Date: Mon Aug 20 04:44:29 2018 New Revision: 338087 URL: https://svnweb.freebsd.org/changeset/base/338087 Log: Fix double mutex lock. Reported by: Coverity CID: 1394833 Discussed with: Leon Dang Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/pci_nvme.c Modified: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- head/usr.sbin/bhyve/pci_nvme.c Mon Aug 20 02:40:10 2018 (r338086) +++ head/usr.sbin/bhyve/pci_nvme.c Mon Aug 20 04:44:29 2018 (r338087) @@ -358,7 +358,7 @@ pci_nvme_init_nsdata(struct pci_nvme_softc *sc) } static void -pci_nvme_reset(struct pci_nvme_softc *sc) +pci_nvme_reset_locked(struct pci_nvme_softc *sc) { DPRINTF(("%s\r\n", __func__)); @@ -374,7 +374,6 @@ pci_nvme_reset(struct pci_nvme_softc *sc) sc->regs.csts = 0; if (sc->submit_queues != NULL) { - pthread_mutex_lock(&sc->mtx); sc->num_cqueues = sc->num_squeues = sc->max_queues; for (int i = 0; i <= sc->max_queues; i++) { @@ -398,8 +397,6 @@ pci_nvme_reset(struct pci_nvme_softc *sc) sc->compl_queues[i].tail = 0; sc->compl_queues[i].head = 0; } - - pthread_mutex_unlock(&sc->mtx); } else sc->submit_queues = calloc(sc->max_queues + 1, sizeof(struct nvme_submission_queue)); @@ -414,6 +411,14 @@ pci_nvme_reset(struct pci_nvme_softc *sc) } static void +pci_nvme_reset(struct pci_nvme_softc *sc) +{ + pthread_mutex_lock(&sc->mtx); + pci_nvme_reset_locked(sc); + pthread_mutex_unlock(&sc->mtx); +} + +static void pci_nvme_init_controller(struct vmctx *ctx, struct pci_nvme_softc *sc) { uint16_t acqs, asqs; @@ -1537,7 +1542,7 @@ pci_nvme_write_bar_0(struct vmctx *ctx, struct pci_nvm if (NVME_CC_GET_EN(ccreg) != NVME_CC_GET_EN(sc->regs.cc)) { if (NVME_CC_GET_EN(ccreg) == 0) /* transition 1-> causes controller reset */ - pci_nvme_reset(sc); + pci_nvme_reset_locked(sc); else pci_nvme_init_controller(ctx, sc); } From owner-svn-src-all@freebsd.org Mon Aug 20 04:50:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6126B1083013; Mon, 20 Aug 2018 04:50:12 +0000 (UTC) (envelope-from araujo@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 16C187A00D; Mon, 20 Aug 2018 04:50:12 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E769410971; Mon, 20 Aug 2018 04:50:11 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7K4oBpT099208; Mon, 20 Aug 2018 04:50:11 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K4oBbN099207; Mon, 20 Aug 2018 04:50:11 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201808200450.w7K4oBbN099207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 20 Aug 2018 04:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338088 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 338088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 04:50:12 -0000 Author: araujo Date: Mon Aug 20 04:50:11 2018 New Revision: 338088 URL: https://svnweb.freebsd.org/changeset/base/338088 Log: Users must set the number of queues from 1 to maximum 16 queues. Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/pci_nvme.c Modified: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- head/usr.sbin/bhyve/pci_nvme.c Mon Aug 20 04:44:29 2018 (r338087) +++ head/usr.sbin/bhyve/pci_nvme.c Mon Aug 20 04:50:11 2018 (r338088) @@ -373,9 +373,8 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc) sc->regs.cc = 0; sc->regs.csts = 0; + sc->num_cqueues = sc->num_squeues = sc->max_queues; if (sc->submit_queues != NULL) { - sc->num_cqueues = sc->num_squeues = sc->max_queues; - for (int i = 0; i <= sc->max_queues; i++) { /* * The Admin Submission Queue is at index 0. @@ -1765,10 +1764,9 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, char *o (1 << sc->nvstore.sectsz_bits) < sc->nvstore.sectsz; sc->nvstore.sectsz_bits++); - if (sc->max_queues == 0) { - fprintf(stderr, "Invalid maxq option\n"); - return (-1); - } + if (sc->max_queues <= 0 || sc->max_queues > NVME_QUEUES) + sc->max_queues = NVME_QUEUES; + if (sc->max_qentries <= 0) { fprintf(stderr, "Invalid qsz option\n"); return (-1); From owner-svn-src-all@freebsd.org Mon Aug 20 04:56:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 754F610832EA; Mon, 20 Aug 2018 04:56:38 +0000 (UTC) (envelope-from araujo@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 207517A4B2; Mon, 20 Aug 2018 04:56:38 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E86AC10AFB; Mon, 20 Aug 2018 04:56:37 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7K4ub1a004361; Mon, 20 Aug 2018 04:56:37 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K4ubkR004360; Mon, 20 Aug 2018 04:56:37 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201808200456.w7K4ubkR004360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 20 Aug 2018 04:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338089 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 338089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 04:56:38 -0000 Author: araujo Date: Mon Aug 20 04:56:37 2018 New Revision: 338089 URL: https://svnweb.freebsd.org/changeset/base/338089 Log: NVMe spec version 1.3c says that "serial number" field must be 7-bit ASCII, with unused bytes padded by space characters. Same for firmware number and namespace number. Discussed with: imp@ Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/pci_nvme.c Modified: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- head/usr.sbin/bhyve/pci_nvme.c Mon Aug 20 04:50:11 2018 (r338088) +++ head/usr.sbin/bhyve/pci_nvme.c Mon Aug 20 04:56:37 2018 (r338089) @@ -254,6 +254,14 @@ static void pci_nvme_io_partial(struct blockif_req *br (NVME_STATUS_SC_MASK << NVME_STATUS_SC_SHIFT)) static __inline void +cpywithpad(char *dst, int dst_size, const char *src, char pad) +{ + int len = strnlen(src, dst_size); + memcpy(dst, src, len); + memset(dst + len, pad, dst_size - len); +} + +static __inline void pci_nvme_status_tc(uint16_t *status, uint16_t type, uint16_t code) { @@ -287,21 +295,9 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) cd->vid = 0xFB5D; cd->ssvid = 0x0000; - cd->mn[0] = 'b'; - cd->mn[1] = 'h'; - cd->mn[2] = 'y'; - cd->mn[3] = 'v'; - cd->mn[4] = 'e'; - cd->mn[5] = '-'; - cd->mn[6] = 'N'; - cd->mn[7] = 'V'; - cd->mn[8] = 'M'; - cd->mn[9] = 'e'; + cpywithpad((char *)cd->mn, sizeof(cd->mn), "bhyve-NVMe", ' '); + cpywithpad((char *)cd->fr, sizeof(cd->fr), "1.0", ' '); - cd->fr[0] = '1'; - cd->fr[1] = '.'; - cd->fr[2] = '0'; - /* Num of submission commands that we can handle at a time (2^rab) */ cd->rab = 4; @@ -1715,12 +1711,11 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, char *o } else if (!strcmp("ser", xopts)) { /* * This field indicates the Product Serial Number in - * 8-bit ASCII, unused bytes should be NULL characters. - * Ref: NVM Express Management Interface 1.0a. + * 7-bit ASCII, unused bytes should be space characters. + * Ref: NVMe v1.3c. */ - memset(sc->ctrldata.sn, 0, sizeof(sc->ctrldata.sn)); - strncpy(sc->ctrldata.sn, config, - sizeof(sc->ctrldata.sn)); + cpywithpad((char *)sc->ctrldata.sn, + sizeof(sc->ctrldata.sn), config, ' '); } else if (!strcmp("ram", xopts)) { uint64_t sz = strtoull(&xopts[4], NULL, 10); From owner-svn-src-all@freebsd.org Mon Aug 20 05:32:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C15F41084104; Mon, 20 Aug 2018 05:32:41 +0000 (UTC) (envelope-from jamie@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 6BC317BF46; Mon, 20 Aug 2018 05:32:41 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49E4611182; Mon, 20 Aug 2018 05:32:41 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7K5Wf3F025068; Mon, 20 Aug 2018 05:32:41 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K5WfEf025067; Mon, 20 Aug 2018 05:32:41 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201808200532.w7K5WfEf025067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 20 Aug 2018 05:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338090 - stable/11/usr.sbin/jail X-SVN-Group: stable-11 X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: stable/11/usr.sbin/jail X-SVN-Commit-Revision: 338090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 05:32:41 -0000 Author: jamie Date: Mon Aug 20 05:32:40 2018 New Revision: 338090 URL: https://svnweb.freebsd.org/changeset/base/338090 Log: MFC r337867: Don't let clobber jailparam values when checking for modification of init-only parameters. PR: 230487 Submitted by: Jason Mader Modified: stable/11/usr.sbin/jail/jail.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/jail/jail.c ============================================================================== --- stable/11/usr.sbin/jail/jail.c Mon Aug 20 04:56:37 2018 (r338089) +++ stable/11/usr.sbin/jail/jail.c Mon Aug 20 05:32:40 2018 (r338090) @@ -802,8 +802,10 @@ rdtun_params(struct cfjail *j, int dofail) exit(1); } for (jp = j->jp; jp < j->jp + j->njp; jp++) - if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) + if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) { *++rtjp = *jp; + rtjp->jp_value = NULL; + } rval = 0; if (jailparam_get(rtparams, nrt, bool_param(j->intparams[IP_ALLOW_DYING]) ? JAIL_DYING : 0) > 0) { @@ -814,8 +816,11 @@ rdtun_params(struct cfjail *j, int dofail) jp->jp_valuelen == 0 && *(int *)jp->jp_value) && !(rtjp->jp_valuelen == jp->jp_valuelen && - !memcmp(rtjp->jp_value, jp->jp_value, - jp->jp_valuelen))) { + !((jp->jp_ctltype & CTLTYPE) == + CTLTYPE_STRING ? strncmp(rtjp->jp_value, + jp->jp_value, jp->jp_valuelen) : + memcmp(rtjp->jp_value, jp->jp_value, + jp->jp_valuelen)))) { if (dofail) { jail_warnx(j, "%s cannot be " "changed after creation", From owner-svn-src-all@freebsd.org Mon Aug 20 05:32:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F2D81084110; Mon, 20 Aug 2018 05:32:43 +0000 (UTC) (envelope-from jamie@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 C9B947BF49; Mon, 20 Aug 2018 05:32:42 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AABC811184; Mon, 20 Aug 2018 05:32:42 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7K5Wg32025127; Mon, 20 Aug 2018 05:32:42 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K5WgYj025126; Mon, 20 Aug 2018 05:32:42 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201808200532.w7K5WgYj025126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 20 Aug 2018 05:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r338091 - stable/10/usr.sbin/jail X-SVN-Group: stable-10 X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: stable/10/usr.sbin/jail X-SVN-Commit-Revision: 338091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 05:32:43 -0000 Author: jamie Date: Mon Aug 20 05:32:42 2018 New Revision: 338091 URL: https://svnweb.freebsd.org/changeset/base/338091 Log: MFC r337867: Don't let clobber jailparam values when checking for modification of init-only parameters. PR: 230487 Submitted by: Jason Mader Modified: stable/10/usr.sbin/jail/jail.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/jail/jail.c ============================================================================== --- stable/10/usr.sbin/jail/jail.c Mon Aug 20 05:32:40 2018 (r338090) +++ stable/10/usr.sbin/jail/jail.c Mon Aug 20 05:32:42 2018 (r338091) @@ -800,8 +800,10 @@ rdtun_params(struct cfjail *j, int dofail) exit(1); } for (jp = j->jp; jp < j->jp + j->njp; jp++) - if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) + if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) { *++rtjp = *jp; + rtjp->jp_value = NULL; + } rval = 0; if (jailparam_get(rtparams, nrt, bool_param(j->intparams[IP_ALLOW_DYING]) ? JAIL_DYING : 0) > 0) { @@ -812,8 +814,11 @@ rdtun_params(struct cfjail *j, int dofail) jp->jp_valuelen == 0 && *(int *)jp->jp_value) && !(rtjp->jp_valuelen == jp->jp_valuelen && - !memcmp(rtjp->jp_value, jp->jp_value, - jp->jp_valuelen))) { + !((jp->jp_ctltype & CTLTYPE) == + CTLTYPE_STRING ? strncmp(rtjp->jp_value, + jp->jp_value, jp->jp_valuelen) : + memcmp(rtjp->jp_value, jp->jp_value, + jp->jp_valuelen)))) { if (dofail) { jail_warnx(j, "%s cannot be " "changed after creation", From owner-svn-src-all@freebsd.org Mon Aug 20 06:07:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 521811084838; Mon, 20 Aug 2018 06:07:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 E5B867CB5F; Mon, 20 Aug 2018 06:07:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C10E211650; Mon, 20 Aug 2018 06:07:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7K67bND040528; Mon, 20 Aug 2018 06:07:37 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K67YuP040515; Mon, 20 Aug 2018 06:07:34 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808200607.w7K67YuP040515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 20 Aug 2018 06:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r338092 - in vendor/ntp/dist: . html include libntp ntpd ntpdate ntpdc ntpq ntpsnmpd ports/winnt/include ports/winnt/ntpd scripts scripts/calc_tickadj scripts/ntp-wait scripts/ntpsweep ... X-SVN-Group: vendor X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in vendor/ntp/dist: . html include libntp ntpd ntpdate ntpdc ntpq ntpsnmpd ports/winnt/include ports/winnt/ntpd scripts scripts/calc_tickadj scripts/ntp-wait scripts/ntpsweep scripts/ntptrace scripts/... X-SVN-Commit-Revision: 338092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 06:07:38 -0000 Author: delphij Date: Mon Aug 20 06:07:33 2018 New Revision: 338092 URL: https://svnweb.freebsd.org/changeset/base/338092 Log: Vendor import of ntp-4.2.8p12. Modified: vendor/ntp/dist/ChangeLog vendor/ntp/dist/NEWS vendor/ntp/dist/config.h.in vendor/ntp/dist/configure vendor/ntp/dist/configure.ac vendor/ntp/dist/html/authentic.html vendor/ntp/dist/html/authopt.html vendor/ntp/dist/html/confopt.html vendor/ntp/dist/html/keygen.html vendor/ntp/dist/html/ntpdate.html vendor/ntp/dist/include/ntp.h vendor/ntp/dist/include/ntp_md5.h vendor/ntp/dist/libntp/a_md5encrypt.c vendor/ntp/dist/libntp/ntp_calendar.c vendor/ntp/dist/libntp/prettydate.c vendor/ntp/dist/libntp/ssl_init.c vendor/ntp/dist/libntp/syssignal.c vendor/ntp/dist/libntp/work_fork.c vendor/ntp/dist/libntp/work_thread.c vendor/ntp/dist/ntpd/complete.conf.in vendor/ntp/dist/ntpd/invoke-ntp.conf.texi vendor/ntp/dist/ntpd/invoke-ntp.keys.texi vendor/ntp/dist/ntpd/invoke-ntpd.texi vendor/ntp/dist/ntpd/ntp.conf.5man vendor/ntp/dist/ntpd/ntp.conf.5mdoc vendor/ntp/dist/ntpd/ntp.conf.def vendor/ntp/dist/ntpd/ntp.conf.html vendor/ntp/dist/ntpd/ntp.conf.man.in vendor/ntp/dist/ntpd/ntp.conf.mdoc.in vendor/ntp/dist/ntpd/ntp.keys.5man vendor/ntp/dist/ntpd/ntp.keys.5mdoc vendor/ntp/dist/ntpd/ntp.keys.def vendor/ntp/dist/ntpd/ntp.keys.html vendor/ntp/dist/ntpd/ntp.keys.man.in vendor/ntp/dist/ntpd/ntp.keys.mdoc.in vendor/ntp/dist/ntpd/ntp_config.c vendor/ntp/dist/ntpd/ntp_control.c vendor/ntp/dist/ntpd/ntp_io.c vendor/ntp/dist/ntpd/ntp_loopfilter.c vendor/ntp/dist/ntpd/ntp_parser.c vendor/ntp/dist/ntpd/ntp_parser.h vendor/ntp/dist/ntpd/ntp_parser.y vendor/ntp/dist/ntpd/ntp_proto.c vendor/ntp/dist/ntpd/ntp_refclock.c vendor/ntp/dist/ntpd/ntp_request.c vendor/ntp/dist/ntpd/ntpd-opts.c vendor/ntp/dist/ntpd/ntpd-opts.h vendor/ntp/dist/ntpd/ntpd.1ntpdman vendor/ntp/dist/ntpd/ntpd.1ntpdmdoc vendor/ntp/dist/ntpd/ntpd.c vendor/ntp/dist/ntpd/ntpd.html vendor/ntp/dist/ntpd/ntpd.man.in vendor/ntp/dist/ntpd/ntpd.mdoc.in vendor/ntp/dist/ntpd/rc_cmdlength.c vendor/ntp/dist/ntpd/refclock_datum.c vendor/ntp/dist/ntpd/refclock_gpsdjson.c vendor/ntp/dist/ntpd/refclock_jupiter.c vendor/ntp/dist/ntpd/refclock_shm.c vendor/ntp/dist/ntpd/refclock_true.c vendor/ntp/dist/ntpdate/ntpdate.c vendor/ntp/dist/ntpdc/invoke-ntpdc.texi vendor/ntp/dist/ntpdc/ntpdc-opts.c vendor/ntp/dist/ntpdc/ntpdc-opts.h vendor/ntp/dist/ntpdc/ntpdc.1ntpdcman vendor/ntp/dist/ntpdc/ntpdc.1ntpdcmdoc vendor/ntp/dist/ntpdc/ntpdc.c vendor/ntp/dist/ntpdc/ntpdc.html vendor/ntp/dist/ntpdc/ntpdc.man.in vendor/ntp/dist/ntpdc/ntpdc.mdoc.in vendor/ntp/dist/ntpq/invoke-ntpq.texi vendor/ntp/dist/ntpq/ntpq-opts.c vendor/ntp/dist/ntpq/ntpq-opts.h vendor/ntp/dist/ntpq/ntpq-subs.c vendor/ntp/dist/ntpq/ntpq.1ntpqman vendor/ntp/dist/ntpq/ntpq.1ntpqmdoc vendor/ntp/dist/ntpq/ntpq.c vendor/ntp/dist/ntpq/ntpq.html vendor/ntp/dist/ntpq/ntpq.man.in vendor/ntp/dist/ntpq/ntpq.mdoc.in vendor/ntp/dist/ntpq/ntpq.texi vendor/ntp/dist/ntpsnmpd/invoke-ntpsnmpd.texi vendor/ntp/dist/ntpsnmpd/ntpsnmpd-opts.c vendor/ntp/dist/ntpsnmpd/ntpsnmpd-opts.h vendor/ntp/dist/ntpsnmpd/ntpsnmpd.1ntpsnmpdman vendor/ntp/dist/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc vendor/ntp/dist/ntpsnmpd/ntpsnmpd.html vendor/ntp/dist/ntpsnmpd/ntpsnmpd.man.in vendor/ntp/dist/ntpsnmpd/ntpsnmpd.mdoc.in vendor/ntp/dist/packageinfo.sh vendor/ntp/dist/ports/winnt/include/ntservice.h vendor/ntp/dist/ports/winnt/ntpd/nt_clockstuff.c vendor/ntp/dist/ports/winnt/ntpd/ntservice.c vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.html vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.man.in vendor/ntp/dist/scripts/calc_tickadj/calc_tickadj.mdoc.in vendor/ntp/dist/scripts/calc_tickadj/invoke-calc_tickadj.texi vendor/ntp/dist/scripts/invoke-plot_summary.texi vendor/ntp/dist/scripts/invoke-summary.texi vendor/ntp/dist/scripts/ntp-wait/invoke-ntp-wait.texi vendor/ntp/dist/scripts/ntp-wait/ntp-wait-opts vendor/ntp/dist/scripts/ntp-wait/ntp-wait.1ntp-waitman vendor/ntp/dist/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc vendor/ntp/dist/scripts/ntp-wait/ntp-wait.html vendor/ntp/dist/scripts/ntp-wait/ntp-wait.man.in vendor/ntp/dist/scripts/ntp-wait/ntp-wait.mdoc.in vendor/ntp/dist/scripts/ntpsweep/invoke-ntpsweep.texi vendor/ntp/dist/scripts/ntpsweep/ntpsweep-opts vendor/ntp/dist/scripts/ntpsweep/ntpsweep.1ntpsweepman vendor/ntp/dist/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc vendor/ntp/dist/scripts/ntpsweep/ntpsweep.html vendor/ntp/dist/scripts/ntpsweep/ntpsweep.man.in vendor/ntp/dist/scripts/ntpsweep/ntpsweep.mdoc.in vendor/ntp/dist/scripts/ntptrace/invoke-ntptrace.texi vendor/ntp/dist/scripts/ntptrace/ntptrace-opts vendor/ntp/dist/scripts/ntptrace/ntptrace.1ntptraceman vendor/ntp/dist/scripts/ntptrace/ntptrace.1ntptracemdoc vendor/ntp/dist/scripts/ntptrace/ntptrace.html vendor/ntp/dist/scripts/ntptrace/ntptrace.man.in vendor/ntp/dist/scripts/ntptrace/ntptrace.mdoc.in vendor/ntp/dist/scripts/plot_summary-opts vendor/ntp/dist/scripts/plot_summary.1plot_summaryman vendor/ntp/dist/scripts/plot_summary.1plot_summarymdoc vendor/ntp/dist/scripts/plot_summary.html vendor/ntp/dist/scripts/plot_summary.man.in vendor/ntp/dist/scripts/plot_summary.mdoc.in vendor/ntp/dist/scripts/summary-opts vendor/ntp/dist/scripts/summary.1summaryman vendor/ntp/dist/scripts/summary.1summarymdoc vendor/ntp/dist/scripts/summary.html vendor/ntp/dist/scripts/summary.man.in vendor/ntp/dist/scripts/summary.mdoc.in vendor/ntp/dist/scripts/update-leap/invoke-update-leap.texi vendor/ntp/dist/scripts/update-leap/update-leap-opts vendor/ntp/dist/scripts/update-leap/update-leap.1update-leapman vendor/ntp/dist/scripts/update-leap/update-leap.1update-leapmdoc vendor/ntp/dist/scripts/update-leap/update-leap.html vendor/ntp/dist/scripts/update-leap/update-leap.man.in vendor/ntp/dist/scripts/update-leap/update-leap.mdoc.in vendor/ntp/dist/sntp/config.h.in vendor/ntp/dist/sntp/configure vendor/ntp/dist/sntp/crypto.c vendor/ntp/dist/sntp/include/version.def vendor/ntp/dist/sntp/include/version.texi vendor/ntp/dist/sntp/invoke-sntp.texi vendor/ntp/dist/sntp/m4/ntp_libntp.m4 vendor/ntp/dist/sntp/m4/ntp_openssl.m4 vendor/ntp/dist/sntp/m4/version.m4 vendor/ntp/dist/sntp/main.c vendor/ntp/dist/sntp/sntp-opts.c vendor/ntp/dist/sntp/sntp-opts.h vendor/ntp/dist/sntp/sntp.1sntpman vendor/ntp/dist/sntp/sntp.1sntpmdoc vendor/ntp/dist/sntp/sntp.html vendor/ntp/dist/sntp/sntp.man.in vendor/ntp/dist/sntp/sntp.mdoc.in vendor/ntp/dist/sntp/tests/crypto.c vendor/ntp/dist/sntp/tests/packetProcessing.c vendor/ntp/dist/sntp/version.c vendor/ntp/dist/tests/libntp/ssl_init.c vendor/ntp/dist/util/invoke-ntp-keygen.texi vendor/ntp/dist/util/ntp-keygen-opts.c vendor/ntp/dist/util/ntp-keygen-opts.def vendor/ntp/dist/util/ntp-keygen-opts.h vendor/ntp/dist/util/ntp-keygen.1ntp-keygenman vendor/ntp/dist/util/ntp-keygen.1ntp-keygenmdoc vendor/ntp/dist/util/ntp-keygen.html vendor/ntp/dist/util/ntp-keygen.man.in vendor/ntp/dist/util/ntp-keygen.mdoc.in vendor/ntp/dist/util/ntp-keygen.texi vendor/ntp/dist/util/sht.c Modified: vendor/ntp/dist/ChangeLog ============================================================================== --- vendor/ntp/dist/ChangeLog Mon Aug 20 05:32:42 2018 (r338091) +++ vendor/ntp/dist/ChangeLog Mon Aug 20 06:07:33 2018 (r338092) @@ -1,5 +1,69 @@ --- +(4.2.8p12) 2018/08/14 Released by Harlan Stenn +* [Sec 3505] CVE-2018-12327 - Arbitrary Code Execution Vulnerability + - fixed stack buffer overflow in the openhost() command-line call + of NTPQ/NTPDC +* [Sec 3012] noepeer tweaks. +* [Bug 3521] Fix a logic bug in the INVALIDNAK checks. +* [Bug 3509] Add support for running as non-root on FreeBSD, Darwin, + other TrustedBSD platforms + - applied patch by Ian Lepore +* [Bug 3506] Service Control Manager interacts poorly with NTPD + - changed interaction with SCM to signal pending startup +* [Bug 3486] Buffer overflow in ntpq/ntpq.c:tstflags() + - applied patch by Gerry Garvey +* [Bug 3485] Undefined sockaddr used in error messages in ntp_config.c + - applied patch by Gerry Garvey +* [Bug 3484] ntpq response from ntpd is incorrect when REFID is null + - rework of ntpq 'nextvar()' key/value parsing +* [Bug 3482] Fixes for compilation warnings (ntp_io.c & ntpq-subs.c) + - applied patch by Gerry Garvey (with mods) +* [Bug 3480] Refclock sample filter not cleared on clock STEP + - applied patch by Gerry Garvey +* [Bug 3479] ctl_putrefid() allows unsafe characters through to ntpq + - applied patch by Gerry Garvey (with mods) +* [Bug 3476]ctl_putstr() sends empty unquoted string [...] + - applied patch by Gerry Garvey (with mods); not sure if that's bug or feature, though +* [Bug 3475] modify prettydate() to suppress output of zero time + - applied patch by Gerry Garvey +* [Bug 3474] Missing pmode in mode7 peer info response + - applied patch by Gerry Garvey +* [Bug 3471] Check for openssl/[ch]mac.h. HStenn. + - add #define ENABLE_CMAC support in configure. HStenn. +* [Bug 3470] ntpd4.2.8p11 fails to compile without OpenSSL +* [Bug 3469] Incomplete string compare [...] in is_refclk_addr + - patch by Stephen Friedl +* [Bug 3467] Potential memory fault in ntpq [...] + - fixed IO redirection and CTRL-C handling in ntq and ntpdc +* [Bug 3465] Default TTL values cannot be used +* [Bug 3461] refclock_shm.c: clear error status on clock recovery + - initial patch by Hal Murray; also fixed refclock_report() trouble +* [Bug 3460] Fix typo in ntpq.texi, reported by Kenyon Ralph. +* [Bug 3456] Use uintptr_t rather than size_t to store an integer in a pointer + - According to Brooks Davis, there was only one location +* [Bug 3449] ntpq - display "loop" instead of refid [...] + - applied patch by Gerry Garvey +* [Bug 3445] Symmetric peer won't sync on startup + - applied patch by Gerry Garvey +* [Bug 3442] Fixes for ntpdate as suggested by Gerry Garvey, + with modifications + New macro REFID_ISTEXT() which is also used in ntpd/ntp_control.c. +* [Bug 3434] ntpd clears STA_UNSYNC on start + - applied patch by Miroslav Lichvar +* [Bug 3426] ntpdate.html -t default is 2 seconds. Leonid Evdokimov. +* [Bug 3121] Drop root privileges for the forked DNS worker + - integrated patch by Reinhard Max +* [Bug 2821] minor build issues + - applied patches by Christos Zoulas, including real bug fixes +* html/authopt.html: cleanup, from +* ntpd/ntpd.c: DROPROOT cleanup. +* Symmetric key range is 1-65535. Update docs. +* html/authentic.html: cleanup, from + +--- +(4.2.8p11) 2018/02/27 Released by Harlan Stenn + * [Sec 3454] Unauthenticated packet can reset authenticated interleave associations. HStenn. * [Sec 3453] Interleaved symmetric mode cannot recover from bad state. HStenn. @@ -14,16 +78,16 @@ - applied patch by Sean Haugh * [Bug 3452] PARSE driver prints uninitialized memory. * [Bug 3450] Dubious error messages from plausibility checks in get_systime() - - removed error log caused by rounding/slew, ensured postcondition + - removed error log caused by rounding/slew, ensured postcondition * [Bug 3447] AES-128-CMAC (fixes) - refactoring the MAC code, too * [Bug 3441] Validate the assumption that AF_UNSPEC is 0. stenn@ntp.org * [Bug 3439] When running multiple commands / hosts in ntpq... - - applied patch by ggarvey + - applied patch by ggarvey * [Bug 3438] Negative values and values > 999 days in... - - applied patch by ggarvey (with minor mods) + - applied patch by ggarvey (with minor mods) * [Bug 3437] ntpd tries to open socket with AF_UNSPEC domain - - applied patch (with mods) by Miroslav Lichvar + - applied patch (with mods) by Miroslav Lichvar * [Bug 3435] anchor NTP era alignment * [Bug 3433] sntp crashes when run with -a. * [Bug 3430] ntpq dumps core (SIGSEGV) for "keytype md2" Modified: vendor/ntp/dist/NEWS ============================================================================== --- vendor/ntp/dist/NEWS Mon Aug 20 05:32:42 2018 (r338091) +++ vendor/ntp/dist/NEWS Mon Aug 20 06:07:33 2018 (r338092) @@ -1,7 +1,78 @@ -- -NTP 4.2.8p11 (Harlan Stenn , 2018/02/27) +NTP 4.2.8p12 (Harlan Stenn , 2018/14/09) NOTE: this NEWS file will be undergoing more revisions. + +Focus: Security, Bug fixes, enhancements. + +Severity: MEDIUM + +This release fixes a "hole" in the noepeer capability introduced to ntpd +in ntp-4.2.8p11, and a buffer overflow in the openhost() function used by +ntpq and ntpdc. It also provides 26 other bugfixes, and 4 other improvements: + +* [Sec 3505] Buffer overflow in the openhost() call of ntpq and ntpdc. + +* [Sec 3012] Fix a hole in the new "noepeer" processing. + +* Bug Fixes: + [Bug 3521] Fix a logic bug in the INVALIDNAK checks. + [Bug 3509] Add support for running as non-root on FreeBSD, Darwin, + other TrustedBSD platforms + - applied patch by Ian Lepore + [Bug 3506] Service Control Manager interacts poorly with NTPD + - changed interaction with SCM to signal pending startup + [Bug 3486] Buffer overflow in ntpq/ntpq.c:tstflags() + - applied patch by Gerry Garvey + [Bug 3485] Undefined sockaddr used in error messages in ntp_config.c + - applied patch by Gerry Garvey + [Bug 3484] ntpq response from ntpd is incorrect when REFID is null + - rework of ntpq 'nextvar()' key/value parsing + [Bug 3482] Fixes for compilation warnings (ntp_io.c & ntpq-subs.c) + - applied patch by Gerry Garvey (with mods) + [Bug 3480] Refclock sample filter not cleared on clock STEP + - applied patch by Gerry Garvey + [Bug 3479] ctl_putrefid() allows unsafe characters through to ntpq + - applied patch by Gerry Garvey (with mods) + [Bug 3476]ctl_putstr() sends empty unquoted string [...] + - applied patch by Gerry Garvey (with mods); not sure if that's bug or feature, though + [Bug 3475] modify prettydate() to suppress output of zero time + - applied patch by Gerry Garvey + [Bug 3474] Missing pmode in mode7 peer info response + - applied patch by Gerry Garvey + [Bug 3471] Check for openssl/[ch]mac.h. HStenn. + - add #define ENABLE_CMAC support in configure. HStenn. + [Bug 3470] ntpd4.2.8p11 fails to compile without OpenSSL + [Bug 3469] Incomplete string compare [...] in is_refclk_addr + - patch by Stephen Friedl + [Bug 3467] Potential memory fault in ntpq [...] + - fixed IO redirection and CTRL-C handling in ntq and ntpdc + [Bug 3465] Default TTL values cannot be used + [Bug 3461] refclock_shm.c: clear error status on clock recovery + - initial patch by Hal Murray; also fixed refclock_report() trouble + [Bug 3460] Fix typo in ntpq.texi, reported by Kenyon Ralph. + [Bug 3456] Use uintptr_t rather than size_t to store an integer in a pointer + - According to Brooks Davis, there was only one location + [Bug 3449] ntpq - display "loop" instead of refid [...] + - applied patch by Gerry Garvey + [Bug 3445] Symmetric peer won't sync on startup + - applied patch by Gerry Garvey + [Bug 3442] Fixes for ntpdate as suggested by Gerry Garvey, + with modifications + New macro REFID_ISTEXT() which is also used in ntpd/ntp_control.c. + [Bug 3434] ntpd clears STA_UNSYNC on start + - applied patch by Miroslav Lichvar + [Bug 3426] ntpdate.html -t default is 2 seconds. Leonid Evdokimov. + [Bug 3121] Drop root privileges for the forked DNS worker + - integrated patch by Reinhard Max + [Bug 2821] minor build issues + - applied patches by Christos Zoulas, including real bug fixes + html/authopt.html: cleanup, from + ntpd/ntpd.c: DROPROOT cleanup. + Symmetric key range is 1-65535. Update docs. + +-- +NTP 4.2.8p11 (Harlan Stenn , 2018/02/27) Focus: Security, Bug fixes, enhancements. Modified: vendor/ntp/dist/config.h.in ============================================================================== --- vendor/ntp/dist/config.h.in Mon Aug 20 05:32:42 2018 (r338091) +++ vendor/ntp/dist/config.h.in Mon Aug 20 06:07:33 2018 (r338092) @@ -311,6 +311,9 @@ /* Provide the explicit 127.0.0.0/8 martian filter? */ #undef ENABLE_BUG3020_FIX +/* Enable CMAC support? */ +#undef ENABLE_CMAC + /* nls support in libopts */ #undef ENABLE_NLS @@ -372,6 +375,14 @@ /* Define to 1 if you have the `daemon' function. */ #undef HAVE_DAEMON +/* Define to 1 if you have the declaration of `siglongjmp', and to 0 if you + don't. */ +#undef HAVE_DECL_SIGLONGJMP + +/* Define to 1 if you have the declaration of `sigsetjmp', and to 0 if you + don't. */ +#undef HAVE_DECL_SIGSETJMP + /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R @@ -653,6 +664,12 @@ /* if you have NT Threads */ #undef HAVE_NT_THREADS +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENSSL_CMAC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENSSL_HMAC_H + /* Define to 1 if the system has the type `pid_t'. */ #undef HAVE_PID_T @@ -957,6 +974,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_LOCK_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MAC_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MMAN_H @@ -1116,6 +1136,9 @@ /* Do we have the TIO serial stuff? */ #undef HAVE_TIO_SERIAL_STUFF + +/* Are TrustedBSD MAC policy privileges available? */ +#undef HAVE_TRUSTEDBSD_MAC /* Define to 1 if the system has the type `uint16_t'. */ #undef HAVE_UINT16_T Modified: vendor/ntp/dist/configure ============================================================================== --- vendor/ntp/dist/configure Mon Aug 20 05:32:42 2018 (r338091) +++ vendor/ntp/dist/configure Mon Aug 20 06:07:33 2018 (r338092) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ntp 4.2.8p11. +# Generated by GNU Autoconf 2.69 for ntp 4.2.8p12. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ntp' PACKAGE_TARNAME='ntp' -PACKAGE_VERSION='4.2.8p11' -PACKAGE_STRING='ntp 4.2.8p11' +PACKAGE_VERSION='4.2.8p12' +PACKAGE_STRING='ntp 4.2.8p12' PACKAGE_BUGREPORT='http://bugs.ntp.org./' PACKAGE_URL='http://www.ntp.org./' @@ -968,6 +968,7 @@ enable_c99_snprintf enable_clockctl enable_linuxcaps enable_solarisprivs +enable_trustedbsd_mac with_arlib with_net_snmp_config enable_libseccomp @@ -1614,7 +1615,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ntp 4.2.8p11 to adapt to many kinds of systems. +\`configure' configures ntp 4.2.8p12 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1684,7 +1685,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ntp 4.2.8p11:";; + short | recursive ) echo "Configuration of ntp 4.2.8p12:";; esac cat <<\_ACEOF @@ -1731,6 +1732,8 @@ Optional Features and Packages: --enable-clockctl s Use /dev/clockctl for non-root clock control --enable-linuxcaps + Use Linux capabilities for non-root clock control --enable-solarisprivs + Use Solaris privileges for non-root clock control + --enable-trustedbsd-mac s Use TrustedBSD MAC policy for non-root clock + control --with-arlib - deprecated, arlib not distributed --with-net-snmp-config + =net-snmp-config --enable-libseccomp EXPERIMENTAL: enable support for libseccomp @@ -1923,7 +1926,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ntp configure 4.2.8p11 +ntp configure 4.2.8p12 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2632,7 +2635,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ntp $as_me 4.2.8p11, which was +It was created by ntp $as_me 4.2.8p12, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3633,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='ntp' - VERSION='4.2.8p11' + VERSION='4.2.8p12' cat >>confdefs.h <<_ACEOF @@ -24026,7 +24029,40 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_have_solarisprivs" >&5 $as_echo "$ntp_have_solarisprivs" >&6; } -case "$ntp_use_dev_clockctl$ntp_have_linuxcaps$ntp_have_solarisprivs" in +for ac_header in sys/mac.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/mac.h" "ac_cv_header_sys_mac_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mac_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_MAC_H 1 +_ACEOF + +fi + +done + + +# Check whether --enable-trustedbsd_mac was given. +if test "${enable_trustedbsd_mac+set}" = set; then : + enableval=$enable_trustedbsd_mac; ntp_use_trustedbsd_mac=$enableval + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use TrustedBSD MAC privileges" >&5 +$as_echo_n "checking if we should use TrustedBSD MAC privileges... " >&6; } + +case "$ntp_use_trustedbsd_mac$ac_cv_header_sys_mac_h" in + yesyes) + +$as_echo "#define HAVE_TRUSTEDBSD_MAC 1" >>confdefs.h + +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_use_trustedbsd_mac" >&5 +$as_echo "$ntp_use_trustedbsd_mac" >&6; } + +case "$ntp_use_dev_clockctl$ntp_have_linuxcaps$ntp_have_solarisprivs$ntp_use_trustedbsd_mac" in *yes*) $as_echo "#define HAVE_DROPROOT 1" >>confdefs.h @@ -30311,7 +30347,20 @@ $as_echo "$ntp_openssl" >&6; } case "$ntp_openssl" in yes) + for ac_header in openssl/cmac.h openssl/hmac.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF +fi + +done + + $as_echo "#define OPENSSL /**/" >>confdefs.h case "$VER_SUFFIX" in @@ -30534,9 +30583,24 @@ LIBS="$NTPO_SAVED_LIBS" { ntp_openssl_from_pkg_config=; unset ntp_openssl_from_pkg_config;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to enable CMAC support" >&5 +$as_echo_n "checking if we want to enable CMAC support... " >&6; } +case "$ac_cv_header_openssl_cmac_h" in + yes) +$as_echo "#define ENABLE_CMAC 1" >>confdefs.h + ans="yes" + ;; + *) ans="no" + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 +$as_echo "$ans" >&6; } + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to use OpenSSL's crypto random (if available)" >&5 $as_echo_n "checking if we want to use OpenSSL's crypto random (if available)... " >&6; } # Check whether --enable-openssl-random was given. @@ -33223,7 +33287,33 @@ fi ### +ac_fn_c_check_decl "$LINENO" "sigsetjmp" "ac_cv_have_decl_sigsetjmp" "#include +" +if test "x$ac_cv_have_decl_sigsetjmp" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SIGSETJMP $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "siglongjmp" "ac_cv_have_decl_siglongjmp" "#include +" +if test "x$ac_cv_have_decl_siglongjmp" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SIGLONGJMP $ac_have_decl +_ACEOF + + +### + + prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix @@ -33964,7 +34054,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ntp $as_me 4.2.8p11, which was +This file was extended by ntp $as_me 4.2.8p12, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -34031,7 +34121,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ntp config.status 4.2.8p11 +ntp config.status 4.2.8p12 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/ntp/dist/configure.ac ============================================================================== --- vendor/ntp/dist/configure.ac Mon Aug 20 05:32:42 2018 (r338091) +++ vendor/ntp/dist/configure.ac Mon Aug 20 06:07:33 2018 (r338092) @@ -3014,6 +3014,17 @@ AC_MSG_RESULT([$ans]) NTP_OPENSSL +AC_MSG_CHECKING([if we want to enable CMAC support]) +case "$ac_cv_header_openssl_cmac_h" in + yes) + AC_DEFINE([ENABLE_CMAC], [1], [Enable CMAC support?]) + ans="yes" + ;; + *) ans="no" + ;; +esac +AC_MSG_RESULT([$ans]) + NTP_CRYPTO_RAND # if we are using OpenSSL (--with-crypto), by default Autokey is enabled @@ -4377,6 +4388,10 @@ dnl can't be conditionalized. NTP_GOOGLETEST NTP_PROBLEM_TESTS + +### + +AC_CHECK_DECLS([sigsetjmp,siglongjmp], [], [], [[#include ]]) ### Modified: vendor/ntp/dist/html/authentic.html ============================================================================== --- vendor/ntp/dist/html/authentic.html Mon Aug 20 05:32:42 2018 (r338091) +++ vendor/ntp/dist/html/authentic.html Mon Aug 20 06:07:33 2018 (r338092) @@ -1,91 +1,223 @@ - - - -Authentication Support - - - - -

Authentication Support

-giffrom Alice's Adventures in Wonderland, Lewis Carroll -

Our resident cryptographer; now you see him, now you don't.

-

Last update: - 5-Feb-2016 09:13 - UTC

-
-

Related Links

- - -

Table of Contents

- -
-

Introduction

-

This page describes the various cryptographic authentication provisions in NTPv4. Authentication support allows the NTP client to verify that servers are in fact known and trusted and not intruders intending accidentally or intentionally to masquerade as a legitimate server. A detailed discussion of the NTP multi-layer security model and vulnerability analysis is in the white paper NTP Security Analysis.

-

The NTPv3 specification (RFC-1305) defined an authentication scheme properly described as symmetric key cryptography. It used the Data Encryption Standard (DES) algorithm operating in cipher-block chaining (CBC) mode. Subsequently, this algorithm was replaced by the RSA Message Digest 5 (MD5) algorithm commonly called keyed-MD5. Either algorithm computes a message digest or one-way hash which can be used to verify the client has the same message digest as the server. The MD5 message digest algorithm is included in the distribution, so without further cryptographic support, the distribution can be freely exported.

-

If the OpenSSL cryptographic library is installed prior to building the distribution, all message digest algorithms included in the library may be used, including SHA and SHA1. However, if conformance to FIPS 140-2 is required, only a limited subset of these algorithms can be used. This library is available from http://www.openssl.org and can be installed using the procedures outlined in the Building and Installing the Distribution page. Once installed, the configure and build process automatically detects the library and links the library routines -required.

-

In addition to the symmetric key algorithms, this distribution includes support for the Autokey public key algorithms and protocol specified in RFC-5906 "Network Time Protocol Version 4: Autokey Specification". This support is available only if the OpenSSL library has been installed and the --enable-autokey option is used when the distribution is built.

-

Public key cryptography is generally considered more secure than symmetric key cryptography, since the security is based on private and public values which are generated by each participant and where the private value is never revealed. Autokey uses X.509 public certificates, which can be produced by commercial services, the OpenSSL application program, or the ntp-keygen utility program in the NTP software distribution.

-

Note that according to US law, NTP binaries including OpenSSL library components, including the OpenSSL library itself, cannot be exported outside the US without license from the US Department of Commerce. Builders outside the US are advised to obtain the OpenSSL library directly from OpenSSL, which is outside the US, and build outside the US.

-

Authentication is configured separately for each association using the key or autokey option of the server configuration command, as described in the Server Options page. The ntp-keygen page describes the files required for the various authentication schemes. Further details are in the briefings, papers and reports at the NTP project page linked from www.ntp.org.

-

By default, the client sends non-authenticated packets and the server responds with non-authenticated packets. If the client sends authenticated packets, the server responds with authenticated packets if correct, or a crypto-NAK packet if not. In the case of unsolicited packets which might consume significant resources, such as broadcast or symmetric mode packets, authentication is required, unless overridden by a disable auth command. In the current climate of targeted broadcast or "letterbomb" attacks, defeating this requirement would be decidedly dangerous. In any case, the notrust flag, described on the Access Control Options page, can be used to disable access to all but correctly authenticated clients.

-

Symmetric Key Cryptography

-

The original NTPv3 specification (RFC-1305), as well as the current NTPv4 specification (RFC-5905), allows any one of possibly 65,534 message digest keys (excluding zero), each distinguished by a 32-bit key ID, to authenticate an association. The servers and clients involved must agree on the key ID, key type and key to authenticate NTP packets.

-

The message digest is a cryptographic hash computed by an algorithm such as MD5, SHA, or AES-128 CMAC. When authentication is specified, a message authentication code (MAC) is appended to the NTP packet header. The MAC consists of a 32-bit key identifier (key ID) followed by a 128- or 160-bit message digest. The algorithm computes the digest as the hash of a 128- or 160- bit message digest key concatenated with the NTP packet header fields with the exception of the MAC. On transmit, the message digest is computed and inserted in the MAC. On receive, the message digest is computed and compared with the MAC. The packet is accepted only if the two MACs are identical. If a discrepancy is found by the client, the client ignores the packet, but raises an alarm. If this happens at the server, the server returns a special message called a crypto-NAK. Since the crypto-NAK is protected by the loopback test, an intruder cannot disrupt the protocol by sending a bogus crypto -NAK.

-

Keys and related information are specified in a keys file, which must be distributed and stored using secure means beyond the scope of the NTP protocol itself. Besides the keys used for ordinary NTP associations, additional keys can be used as passwords for the ntpq and ntpdc utility programs. Ordinarily, the ntp.keys file is generated by the ntp-keygen program, but it can be constructed and edited using an ordinary text editor.

-

Each line of the keys file consists of three or four fields: a key ID in the range 1 to 65,534, inclusive, a key type, a message digest key consisting of a printable ASCII string less than 40 characters or a 40-character hex digit string, and an optional comma-separated list of IPs that are allowed to serve time. If the OpenSSL library is installed, the key type can be any message digest algorithm supported by the library. If the OpenSSL library is not installed, the only permitted key type is MD5.

- - -
- Figure 1. Typical Symmetric Key File -
-
-# ntpkey_MD5key_bk.ntp.org.3595864945
-# Thu Dec 12 19:22:25 2013
+  
+    
+    
+    Authentication Support
+    
+    
+    
+  
+  
+    

Authentication Support

+ giffrom Alice's Adventures in Wonderland, Lewis Carroll +

Our resident cryptographer; now you see him, now you don't.

+

Last update: + 24-Jul-2018 09:12 + UTC

+
+

Related Links

+ + +

Table of Contents

+ +
+

Introduction

+

This page describes the various cryptographic authentication + provisions in NTPv4. Authentication support allows the NTP client to + verify that servers are in fact known and trusted and not intruders + intending accidentally or intentionally to masquerade as a legitimate + server. A detailed discussion of the NTP multi-layer security model + and vulnerability analysis is in the white + paper NTP + Security Analysis.

+

The NTPv3 specification (RFC-1305) defined an authentication scheme + properly described as symmetric key cryptography. It used + the Data Encryption Standard (DES) algorithm operating in cipher-block + chaining (CBC) mode. Subsequently, this algorithm was replaced by the + RSA Message Digest 5 (MD5) algorithm commonly called keyed-MD5. + Either algorithm computes a message digest or one-way hash which can + be used to verify the client has the same message digest as the + server. The MD5 message digest algorithm is included in the + distribution, so without further cryptographic support, the + distribution can be freely exported.

+

If the OpenSSL cryptographic library is installed prior to building + the distribution, all message digest algorithms included in the + library may be used, including SHA and SHA1. However, if conformance + to FIPS 140-2 is required, only a limited subset of these algorithms + can be used. This library is available + from http://www.openssl.org and + can be installed using the procedures outlined in + the Building and Installing the Distribution + page. Once installed, the configure and build process automatically + detects the library and links the library routines required.

+

In addition to the symmetric key algorithms, this distribution + includes support for the Autokey public key algorithms and protocol + specified in RFC-5906 "Network Time Protocol Version 4: Autokey + Specification". This support is available only if the OpenSSL + library has been installed and the --enable-autokey option is + used when the distribution is built.

+

Public key cryptography is generally considered more secure than + symmetric key cryptography, since the security is based on private and + public values which are generated by each participant and where the + private value is never revealed. Autokey uses X.509 public + certificates, which can be produced by commercial services, the + OpenSSL application program, or + the ntp-keygen utility program in + the NTP software distribution.

+

Note that according to US law, NTP binaries including OpenSSL library + components, including the OpenSSL library itself, cannot be exported + outside the US without license from the US Department of Commerce. + Builders outside the US are advised to obtain the OpenSSL library + directly from OpenSSL, which is outside the US, and build outside the + US.

+

Authentication is configured separately for each association using + the key or autokey option of the server + configuration command, as described in + the Server Options page. + The ntp-keygen page describes the files + required for the various authentication schemes. Further details are + in the briefings, papers and reports at the NTP project page linked + from www.ntp.org.

+

By default, the client sends non-authenticated packets and the server + responds with non-authenticated packets. If the client sends + authenticated packets, the server responds with authenticated packets + if correct, or a crypto-NAK packet if not. In the case of unsolicited + packets which might consume significant resources, such as broadcast + or symmetric mode packets, authentication is required, unless + overridden by a disable auth command. In the current climate + of targeted broadcast or "letterbomb" attacks, defeating + this requirement would be decidedly dangerous. In any case, + the notrust flag, described on + the Access Control Options page, can be + used to disable access to all but correctly authenticated clients.

+

Symmetric Key Cryptography

+

The original NTPv3 specification (RFC-1305), as well as the current + NTPv4 specification (RFC-5905), allows any one of possibly 65,535 + message digest keys (excluding zero), each distinguished by a 32-bit + key ID, to authenticate an association. The servers and clients + involved must agree on the key ID, key type and key to authenticate + NTP packets.

+

The message digest is a cryptographic hash computed by an algorithm + such as MD5, SHA, or AES-128 CMAC. When authentication is specified, + a message authentication code (MAC) is appended to the NTP packet + header. The MAC consists of a 32-bit key identifier (key ID) followed + by a 128- or 160-bit message digest. The algorithm computes the + digest as the hash of a 128- or 160- bit message digest key + concatenated with the NTP packet header fields with the exception of + the MAC. On transmit, the message digest is computed and inserted in + the MAC. On receive, the message digest is computed and compared with + the MAC. The packet is accepted only if the two MACs are identical. + If a discrepancy is found by the client, the client ignores the + packet, but raises an alarm. If this happens at the server, the + server returns a special message called a crypto-NAK. Since + the crypto-NAK is protected by the loopback test, an intruder cannot + disrupt the protocol by sending a bogus crypto-NAK.

+

Keys and related information are specified in a keys file, which must + be distributed and stored using secure means beyond the scope of the + NTP protocol itself. Besides the keys used for ordinary NTP + associations, additional keys can be used as passwords for + the ntpq + and ntpdc utility programs. + Ordinarily, the ntp.keys file is generated by + the ntp-keygen program, but it can + be constructed and edited using an ordinary text editor.

+

Each line of the keys file consists of three or four fields: a key + ID in the range 1 to 65,535, inclusive, a key type, a message digest + key consisting of a printable ASCII string less than 40 characters or + a 40-character hex digit string, and an optional comma-separated list + of IPs that are allowed to serve time. If the OpenSSL library is + installed, the key type can be any message digest algorithm supported + by the library. If the OpenSSL library is not installed, the only + permitted key type is MD5.

+ + +
+ Figure 1. Typical Symmetric Key File +
+
+	    # ntpkey_MD5key_bk.ntp.org.3595864945
+	    # Thu Dec 12 19:22:25 2013
 
-1  MD5 L";Nw<`.I<f4U0)247"i  # MD5 key
-2  MD5 &>l0%XXK9O'51VwV<xq~  # MD5 key
-3  MD5 lb4zLW~d^!K:]RsD'qb6  # MD5 key
-4  MD5 Yue:tL[+vR)M`n~bY,'?  # MD5 key
-5  MD5 B;fxlKgr/&4ZTbL6=RxA  # MD5 key
-6  MD5 4eYwa`o}3i@@V@..R9!l  # MD5 key
-7  MD5 `A.([h+;wTQ|xfi%Sn_!  # MD5 key
-8  MD5 45:V,r4]l6y^JH6"Sh?F  # MD5 key
-9  MD5 3-5vcn*6l29DS?Xdsg)*  # MD5 key
-10 MD5 2late4Me              # MD5 key
-11 SHA1 a27872d3030a9025b8446c751b4551a7629af65c  # SHA1 key
-12 SHA1 21bc3b4865dbb9e920902abdccb3e04ff97a5e74  # SHA1 key
-13 SHA1 2b7736fe24fef5ba85ae11594132ab5d6f6daba9  # SHA1 key
-14 SHA  a5332809c8878dd3a5b918819108a111509aeceb  # SHA  key
-15 MD2  2fe16c88c760ff2f16d4267e36c1aa6c926e6964  # MD2  key
-16 MD4  b2691811dc19cfc0e2f9bcacd74213f29812183d  # MD4  key
-17 MD5  e4d6735b8bdad58ec5ffcb087300a17f7fef1f7c  # MD5  key
-18 MDC2 a8d5e2315c025bf3a79174c87fbd10477de2eabc  # MDC2 key
-19 RIPEMD160 77ca332cafb30e3cafb174dcd5b80ded7ba9b3d2  # RIPEMD160 key
-20 AES128CMAC f92ff73eee86c1e7dc638d6489a04e4e555af878  # AES128CMAC key
-  
-

Figure 1 shows a typical keys file used by the reference implementation when the OpenSSL library is installed. In this figure, for key IDs in he range 1-10, the key is interpreted as a printable ASCII string. For key IDs in the range 11-20, the key is a 40-character hex digit string. The key is truncated or zero-filled internally to either 128 or 160 bits, depending on the key type. The line can be edited later or new lines can be added to change any field. The key can be changed to a password, such as 2late4Me for key ID 10. Note that two or more keys files can be combined in any order as long as the key IDs are distinct.

-

When ntpd is started, it reads the keys file specified by the keys command and installs the keys in the key cache. However, individual keys must be activated with the trustedkey configuration command before use. This allows, for instance, the installation of possibly several batches of keys and then activating a key remotely using ntpq or ntpdc. The requestkey command selects the key ID used as the password for the ntpdc utility, while the controlkey command selects the key ID used as the password for the ntpq utility.

-

Microsoft Windows Authentication

-

In addition to the above means, ntpd now supports Microsoft Windows MS-SNTP authentication using Active Directory services. This support was contributed by the Samba Team and is still in development. It is enabled using the mssntp flag of the restrict command described on the Access Control Options page. Note: Potential users should be aware that these services involve a TCP connection to another process that could potentially block, denying services to other users. Therefore, this flag should be used only for a dedicated server with no clients other than MS-SNTP.

-

Public Key Cryptography

-

See the Autokey Public-Key Authentication page.

-
- - + 1 MD5 L";Nw<`.I<f4U0)247"i # MD5 key + 2 MD5 &>l0%XXK9O'51VwV<xq~ # MD5 key + 3 MD5 lb4zLW~d^!K:]RsD'qb6 # MD5 key + 4 MD5 Yue:tL[+vR)M`n~bY,'? # MD5 key + 5 MD5 B;fxlKgr/&4ZTbL6=RxA # MD5 key + 6 MD5 4eYwa`o}3i@@V@..R9!l # MD5 key + 7 MD5 `A.([h+;wTQ|xfi%Sn_! # MD5 key + 8 MD5 45:V,r4]l6y^JH6"Sh?F # MD5 key + 9 MD5 3-5vcn*6l29DS?Xdsg)* # MD5 key + 10 MD5 2late4Me # MD5 key + 11 SHA1 a27872d3030a9025b8446c751b4551a7629af65c # SHA1 key + 12 SHA1 21bc3b4865dbb9e920902abdccb3e04ff97a5e74 # SHA1 key + 13 SHA1 2b7736fe24fef5ba85ae11594132ab5d6f6daba9 # SHA1 key + 14 SHA a5332809c8878dd3a5b918819108a111509aeceb # SHA key + 15 MD2 2fe16c88c760ff2f16d4267e36c1aa6c926e6964 # MD2 key + 16 MD4 b2691811dc19cfc0e2f9bcacd74213f29812183d # MD4 key + 17 MD5 e4d6735b8bdad58ec5ffcb087300a17f7fef1f7c # MD5 key + 18 MDC2 a8d5e2315c025bf3a79174c87fbd10477de2eabc # MDC2 key + 19 RIPEMD160 77ca332cafb30e3cafb174dcd5b80ded7ba9b3d2 # RIPEMD160 key + 20 AES128CMAC f92ff73eee86c1e7dc638d6489a04e4e555af878 # AES128CMAC key + 21 MD5 sampo 10.1.2.3/24 +
+

Figure 1 shows a typical symmetric keys file used by the reference + implementation when the OpenSSL library is installed. Each line of + the file contains three or four fields. The first field is an integer + between 1 and 65535, inclusive, representing the key identifier. The + second field is the digest algorithm, which in the absence of the + OpenSSL library must be MD5, which designates the MD5 message + digest algorithm. The third field is the key. The optional fourth + field is one or more comma-separated IPs. An IP may end with an + optional /subnetbits suffix, which limits the acceptance of + the key identifier to packets claiming to be from the described IP + space. In this example, for the key IDs in the range 1-10 the key is + interpreted as a printable ASCII string. For the key IDs in the range + 11-20, the key is a 40-character hex digit string. In either case, + the key is truncated or zero-filled internally to either 128 or 160 + bits, depending on the key type. The line can be edited later or new + lines can be added to change any field. The key can be changed to a + password, such as 2late4Me for key ID 10. Note that two or + more keys files can be combined in any order as long as the key IDs + are distinct.

+

When ntpd is started, it reads the keys file specified by + the keys command and installs the keys in the key cache. + However, individual keys must be activated with + the trustedkey configuration command before use. This + allows, for instance, the installation of possibly several batches of + keys and then activating a key remotely using ntpq + or ntpdc. The requestkey command selects the key ID + used as the password for the ntpdc utility, while + the controlkey command selects the key ID used as the + password for the ntpq utility.

+

Microsoft Windows Authentication

+

In addition to the above means, ntpd now supports Microsoft + Windows MS-SNTP authentication using Active Directory services. This + support was contributed by the Samba Team and is still in development. + It is enabled using the mssntp flag of the restrict + command described on the Access Control + Options page. Note: Potential users should + be aware that these services involve a TCP connection to another + process that could potentially block, denying services to other users. + Therefore, this flag should be used only for a dedicated server with + no clients other than MS-SNTP.

+

Public Key Cryptography

+

See the Autokey Public-Key Authentication + page.

+
+ + Modified: vendor/ntp/dist/html/authopt.html ============================================================================== --- vendor/ntp/dist/html/authopt.html Mon Aug 20 05:32:42 2018 (r338091) +++ vendor/ntp/dist/html/authopt.html Mon Aug 20 06:07:33 2018 (r338092) @@ -4,6 +4,7 @@ Authentication Commands and Options + - - -

Authentication Support

-giffrom Alice's Adventures in Wonderland, Lewis Carroll -

Our resident cryptographer; now you see him, now you don't.

-

Last update: - 5-Feb-2016 09:13 - UTC

-
-

Related Links

- - -

Table of Contents

- -
-

Introduction

-

This page describes the various cryptographic authentication provisions in NTPv4. Authentication support allows the NTP client to verify that servers are in fact known and trusted and not intruders intending accidentally or intentionally to masquerade as a legitimate server. A detailed discussion of the NTP multi-layer security model and vulnerability analysis is in the white paper NTP Security Analysis.

-

The NTPv3 specification (RFC-1305) defined an authentication scheme properly described as symmetric key cryptography. It used the Data Encryption Standard (DES) algorithm operating in cipher-block chaining (CBC) mode. Subsequently, this algorithm was replaced by the RSA Message Digest 5 (MD5) algorithm commonly called keyed-MD5. Either algorithm computes a message digest or one-way hash which can be used to verify the client has the same message digest as the server. The MD5 message digest algorithm is included in the distribution, so without further cryptographic support, the distribution can be freely exported.

-

If the OpenSSL cryptographic library is installed prior to building the distribution, all message digest algorithms included in the library may be used, including SHA and SHA1. However, if conformance to FIPS 140-2 is required, only a limited subset of these algorithms can be used. This library is available from http://www.openssl.org and can be installed using the procedures outlined in the Building and Installing the Distribution page. Once installed, the configure and build process automatically detects the library and links the library routines -required.

-

In addition to the symmetric key algorithms, this distribution includes support for the Autokey public key algorithms and protocol specified in RFC-5906 "Network Time Protocol Version 4: Autokey Specification". This support is available only if the OpenSSL library has been installed and the --enable-autokey option is used when the distribution is built.

-

Public key cryptography is generally considered more secure than symmetric key cryptography, since the security is based on private and public values which are generated by each participant and where the private value is never revealed. Autokey uses X.509 public certificates, which can be produced by commercial services, the OpenSSL application program, or the ntp-keygen utility program in the NTP software distribution.

-

Note that according to US law, NTP binaries including OpenSSL library components, including the OpenSSL library itself, cannot be exported outside the US without license from the US Department of Commerce. Builders outside the US are advised to obtain the OpenSSL library directly from OpenSSL, which is outside the US, and build outside the US.

-

Authentication is configured separately for each association using the key or autokey option of the server configuration command, as described in the Server Options page. The ntp-keygen page describes the files required for the various authentication schemes. Further details are in the briefings, papers and reports at the NTP project page linked from www.ntp.org.

-

By default, the client sends non-authenticated packets and the server responds with non-authenticated packets. If the client sends authenticated packets, the server responds with authenticated packets if correct, or a crypto-NAK packet if not. In the case of unsolicited packets which might consume significant resources, such as broadcast or symmetric mode packets, authentication is required, unless overridden by a disable auth command. In the current climate of targeted broadcast or "letterbomb" attacks, defeating this requirement would be decidedly dangerous. In any case, the notrust flag, described on the Access Control Options page, can be used to disable access to all but correctly authenticated clients.

-

Symmetric Key Cryptography

-

The original NTPv3 specification (RFC-1305), as well as the current NTPv4 specification (RFC-5905), allows any one of possibly 65,534 message digest keys (excluding zero), each distinguished by a 32-bit key ID, to authenticate an association. The servers and clients involved must agree on the key ID, key type and key to authenticate NTP packets.

-

The message digest is a cryptographic hash computed by an algorithm such as MD5, SHA, or AES-128 CMAC. When authentication is specified, a message authentication code (MAC) is appended to the NTP packet header. The MAC consists of a 32-bit key identifier (key ID) followed by a 128- or 160-bit message digest. The algorithm computes the digest as the hash of a 128- or 160- bit message digest key concatenated with the NTP packet header fields with the exception of the MAC. On transmit, the message digest is computed and inserted in the MAC. On receive, the message digest is computed and compared with the MAC. The packet is accepted only if the two MACs are identical. If a discrepancy is found by the client, the client ignores the packet, but raises an alarm. If this happens at the server, the server returns a special message called a crypto-NAK. Since the crypto-NAK is protected by the loopback test, an intruder cannot disrupt the protocol by sending a bogus crypto -NAK.

-

Keys and related information are specified in a keys file, which must be distributed and stored using secure means beyond the scope of the NTP protocol itself. Besides the keys used for ordinary NTP associations, additional keys can be used as passwords for the ntpq and ntpdc utility programs. Ordinarily, the ntp.keys file is generated by the ntp-keygen program, but it can be constructed and edited using an ordinary text editor.

-

Each line of the keys file consists of three or four fields: a key ID in the range 1 to 65,534, inclusive, a key type, a message digest key consisting of a printable ASCII string less than 40 characters or a 40-character hex digit string, and an optional comma-separated list of IPs that are allowed to serve time. If the OpenSSL library is installed, the key type can be any message digest algorithm supported by the library. If the OpenSSL library is not installed, the only permitted key type is MD5.

- - -
- Figure 1. Typical Symmetric Key File -
-
-# ntpkey_MD5key_bk.ntp.org.3595864945
-# Thu Dec 12 19:22:25 2013
+  
+    
+    
+    Authentication Support
+    
+    
+    
+  
+  
+    

Authentication Support

+ giffrom Alice's Adventures in Wonderland, Lewis Carroll +

Our resident cryptographer; now you see him, now you don't.

+

Last update: + 24-Jul-2018 09:12 + UTC

+
+

Related Links

+ + +

Table of Contents

+ +
+

Introduction

+

This page describes the various cryptographic authentication + provisions in NTPv4. Authentication support allows the NTP client to + verify that servers are in fact known and trusted and not intruders + intending accidentally or intentionally to masquerade as a legitimate + server. A detailed discussion of the NTP multi-layer security model + and vulnerability analysis is in the white + paper NTP + Security Analysis.

+

The NTPv3 specification (RFC-1305) defined an authentication scheme + properly described as symmetric key cryptography. It used + the Data Encryption Standard (DES) algorithm operating in cipher-block + chaining (CBC) mode. Subsequently, this algorithm was replaced by the + RSA Message Digest 5 (MD5) algorithm commonly called keyed-MD5. + Either algorithm computes a message digest or one-way hash which can + be used to verify the client has the same message digest as the + server. The MD5 message digest algorithm is included in the + distribution, so without further cryptographic support, the + distribution can be freely exported.

+

If the OpenSSL cryptographic library is installed prior to building + the distribution, all message digest algorithms included in the + library may be used, including SHA and SHA1. However, if conformance + to FIPS 140-2 is required, only a limited subset of these algorithms + can be used. This library is available + from http://www.openssl.org and + can be installed using the procedures outlined in + the Building and Installing the Distribution + page. Once installed, the configure and build process automatically + detects the library and links the library routines required.

+

In addition to the symmetric key algorithms, this distribution + includes support for the Autokey public key algorithms and protocol + specified in RFC-5906 "Network Time Protocol Version 4: Autokey + Specification". This support is available only if the OpenSSL + library has been installed and the --enable-autokey option is + used when the distribution is built.

+

Public key cryptography is generally considered more secure than + symmetric key cryptography, since the security is based on private and + public values which are generated by each participant and where the + private value is never revealed. Autokey uses X.509 public + certificates, which can be produced by commercial services, the + OpenSSL application program, or + the ntp-keygen utility program in + the NTP software distribution.

+

Note that according to US law, NTP binaries including OpenSSL library + components, including the OpenSSL library itself, cannot be exported + outside the US without license from the US Department of Commerce. + Builders outside the US are advised to obtain the OpenSSL library + directly from OpenSSL, which is outside the US, and build outside the + US.

+

Authentication is configured separately for each association using + the key or autokey option of the server + configuration command, as described in + the Server Options page. + The ntp-keygen page describes the files + required for the various authentication schemes. Further details are + in the briefings, papers and reports at the NTP project page linked + from www.ntp.org.

+

By default, the client sends non-authenticated packets and the server + responds with non-authenticated packets. If the client sends + authenticated packets, the server responds with authenticated packets + if correct, or a crypto-NAK packet if not. In the case of unsolicited + packets which might consume significant resources, such as broadcast + or symmetric mode packets, authentication is required, unless + overridden by a disable auth command. In the current climate + of targeted broadcast or "letterbomb" attacks, defeating + this requirement would be decidedly dangerous. In any case, + the notrust flag, described on + the Access Control Options page, can be + used to disable access to all but correctly authenticated clients.

+

Symmetric Key Cryptography

+

The original NTPv3 specification (RFC-1305), as well as the current + NTPv4 specification (RFC-5905), allows any one of possibly 65,535 + message digest keys (excluding zero), each distinguished by a 32-bit + key ID, to authenticate an association. The servers and clients + involved must agree on the key ID, key type and key to authenticate + NTP packets.

+

The message digest is a cryptographic hash computed by an algorithm + such as MD5, SHA, or AES-128 CMAC. When authentication is specified, + a message authentication code (MAC) is appended to the NTP packet + header. The MAC consists of a 32-bit key identifier (key ID) followed + by a 128- or 160-bit message digest. The algorithm computes the + digest as the hash of a 128- or 160- bit message digest key + concatenated with the NTP packet header fields with the exception of + the MAC. On transmit, the message digest is computed and inserted in + the MAC. On receive, the message digest is computed and compared with + the MAC. The packet is accepted only if the two MACs are identical. + If a discrepancy is found by the client, the client ignores the + packet, but raises an alarm. If this happens at the server, the + server returns a special message called a crypto-NAK. Since + the crypto-NAK is protected by the loopback test, an intruder cannot + disrupt the protocol by sending a bogus crypto-NAK.

+

Keys and related information are specified in a keys file, which must + be distributed and stored using secure means beyond the scope of the + NTP protocol itself. Besides the keys used for ordinary NTP + associations, additional keys can be used as passwords for + the ntpq + and ntpdc utility programs. + Ordinarily, the ntp.keys file is generated by + the ntp-keygen program, but it can + be constructed and edited using an ordinary text editor.

+

Each line of the keys file consists of three or four fields: a key + ID in the range 1 to 65,535, inclusive, a key type, a message digest + key consisting of a printable ASCII string less than 40 characters or + a 40-character hex digit string, and an optional comma-separated list + of IPs that are allowed to serve time. If the OpenSSL library is + installed, the key type can be any message digest algorithm supported + by the library. If the OpenSSL library is not installed, the only + permitted key type is MD5.

+ + +
+ Figure 1. Typical Symmetric Key File +
+
+	    # ntpkey_MD5key_bk.ntp.org.3595864945
+	    # Thu Dec 12 19:22:25 2013
 
-1  MD5 L";Nw<`.I<f4U0)247"i  # MD5 key
-2  MD5 &>l0%XXK9O'51VwV<xq~  # MD5 key
-3  MD5 lb4zLW~d^!K:]RsD'qb6  # MD5 key
-4  MD5 Yue:tL[+vR)M`n~bY,'?  # MD5 key
-5  MD5 B;fxlKgr/&4ZTbL6=RxA  # MD5 key
-6  MD5 4eYwa`o}3i@@V@..R9!l  # MD5 key
-7  MD5 `A.([h+;wTQ|xfi%Sn_!  # MD5 key
-8  MD5 45:V,r4]l6y^JH6"Sh?F  # MD5 key
-9  MD5 3-5vcn*6l29DS?Xdsg)*  # MD5 key
-10 MD5 2late4Me              # MD5 key
-11 SHA1 a27872d3030a9025b8446c751b4551a7629af65c  # SHA1 key
-12 SHA1 21bc3b4865dbb9e920902abdccb3e04ff97a5e74  # SHA1 key
-13 SHA1 2b7736fe24fef5ba85ae11594132ab5d6f6daba9  # SHA1 key
-14 SHA  a5332809c8878dd3a5b918819108a111509aeceb  # SHA  key
-15 MD2  2fe16c88c760ff2f16d4267e36c1aa6c926e6964  # MD2  key
-16 MD4  b2691811dc19cfc0e2f9bcacd74213f29812183d  # MD4  key
-17 MD5  e4d6735b8bdad58ec5ffcb087300a17f7fef1f7c  # MD5  key
-18 MDC2 a8d5e2315c025bf3a79174c87fbd10477de2eabc  # MDC2 key
-19 RIPEMD160 77ca332cafb30e3cafb174dcd5b80ded7ba9b3d2  # RIPEMD160 key
-20 AES128CMAC f92ff73eee86c1e7dc638d6489a04e4e555af878  # AES128CMAC key
-  
-

Figure 1 shows a typical keys file used by the reference implementation when the OpenSSL library is installed. In this figure, for key IDs in he range 1-10, the key is interpreted as a printable ASCII string. For key IDs in the range 11-20, the key is a 40-character hex digit string. The key is truncated or zero-filled internally to either 128 or 160 bits, depending on the key type. The line can be edited later or new lines can be added to change any field. The key can be changed to a password, such as 2late4Me for key ID 10. Note that two or more keys files can be combined in any order as long as the key IDs are distinct.

-

When ntpd is started, it reads the keys file specified by the keys command and installs the keys in the key cache. However, individual keys must be activated with the trustedkey configuration command before use. This allows, for instance, the installation of possibly several batches of keys and then activating a key remotely using ntpq or ntpdc. The requestkey command selects the key ID used as the password for the ntpdc utility, while the controlkey command selects the key ID used as the password for the ntpq utility.

-

Microsoft Windows Authentication

-

In addition to the above means, ntpd now supports Microsoft Windows MS-SNTP authentication using Active Directory services. This support was contributed by the Samba Team and is still in development. It is enabled using the mssntp flag of the restrict command described on the Access Control Options page. Note: Potential users should be aware that these services involve a TCP connection to another process that could potentially block, denying services to other users. Therefore, this flag should be used only for a dedicated server with no clients other than MS-SNTP.

-

Public Key Cryptography

-

See the Autokey Public-Key Authentication page.

-
- - + 1 MD5 L";Nw<`.I<f4U0)247"i # MD5 key + 2 MD5 &>l0%XXK9O'51VwV<xq~ # MD5 key + 3 MD5 lb4zLW~d^!K:]RsD'qb6 # MD5 key + 4 MD5 Yue:tL[+vR)M`n~bY,'? # MD5 key + 5 MD5 B;fxlKgr/&4ZTbL6=RxA # MD5 key + 6 MD5 4eYwa`o}3i@@V@..R9!l # MD5 key + 7 MD5 `A.([h+;wTQ|xfi%Sn_! # MD5 key + 8 MD5 45:V,r4]l6y^JH6"Sh?F # MD5 key + 9 MD5 3-5vcn*6l29DS?Xdsg)* # MD5 key + 10 MD5 2late4Me # MD5 key + 11 SHA1 a27872d3030a9025b8446c751b4551a7629af65c # SHA1 key + 12 SHA1 21bc3b4865dbb9e920902abdccb3e04ff97a5e74 # SHA1 key + 13 SHA1 2b7736fe24fef5ba85ae11594132ab5d6f6daba9 # SHA1 key + 14 SHA a5332809c8878dd3a5b918819108a111509aeceb # SHA key + 15 MD2 2fe16c88c760ff2f16d4267e36c1aa6c926e6964 # MD2 key + 16 MD4 b2691811dc19cfc0e2f9bcacd74213f29812183d # MD4 key + 17 MD5 e4d6735b8bdad58ec5ffcb087300a17f7fef1f7c # MD5 key + 18 MDC2 a8d5e2315c025bf3a79174c87fbd10477de2eabc # MDC2 key + 19 RIPEMD160 77ca332cafb30e3cafb174dcd5b80ded7ba9b3d2 # RIPEMD160 key + 20 AES128CMAC f92ff73eee86c1e7dc638d6489a04e4e555af878 # AES128CMAC key + 21 MD5 sampo 10.1.2.3/24 +
+

Figure 1 shows a typical symmetric keys file used by the reference + implementation when the OpenSSL library is installed. Each line of + the file contains three or four fields. The first field is an integer + between 1 and 65535, inclusive, representing the key identifier. The + second field is the digest algorithm, which in the absence of the + OpenSSL library must be MD5, which designates the MD5 message + digest algorithm. The third field is the key. The optional fourth + field is one or more comma-separated IPs. An IP may end with an + optional /subnetbits suffix, which limits the acceptance of + the key identifier to packets claiming to be from the described IP + space. In this example, for the key IDs in the range 1-10 the key is + interpreted as a printable ASCII string. For the key IDs in the range + 11-20, the key is a 40-character hex digit string. In either case, + the key is truncated or zero-filled internally to either 128 or 160 + bits, depending on the key type. The line can be edited later or new + lines can be added to change any field. The key can be changed to a + password, such as 2late4Me for key ID 10. Note that two or + more keys files can be combined in any order as long as the key IDs + are distinct.

+

When ntpd is started, it reads the keys file specified by + the keys command and installs the keys in the key cache. + However, individual keys must be activated with + the trustedkey configuration command before use. This + allows, for instance, the installation of possibly several batches of + keys and then activating a key remotely using ntpq + or ntpdc. The requestkey command selects the key ID + used as the password for the ntpdc utility, while + the controlkey command selects the key ID used as the + password for the ntpq utility.

+

Microsoft Windows Authentication

+

In addition to the above means, ntpd now supports Microsoft + Windows MS-SNTP authentication using Active Directory services. This + support was contributed by the Samba Team and is still in development. + It is enabled using the mssntp flag of the restrict + command described on the Access Control + Options page. Note: Potential users should + be aware that these services involve a TCP connection to another + process that could potentially block, denying services to other users. + Therefore, this flag should be used only for a dedicated server with + no clients other than MS-SNTP.

+

Public Key Cryptography

+

See the Autokey Public-Key Authentication + page.

+
+ + Modified: head/contrib/ntp/html/authopt.html ============================================================================== --- head/contrib/ntp/html/authopt.html Tue Aug 21 01:33:25 2018 (r338125) +++ head/contrib/ntp/html/authopt.html Tue Aug 21 02:38:07 2018 (r338126) @@ -4,6 +4,7 @@ Authentication Commands and Options +