From owner-svn-src-all@freebsd.org Sun Nov 22 02:51:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E773747A8BF; Sun, 22 Nov 2020 02:51:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cdvtq6GwPz4S7C; Sun, 22 Nov 2020 02:51:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAE051343E; Sun, 22 Nov 2020 02:51:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AM2pVQg066922; Sun, 22 Nov 2020 02:51:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AM2pUat066918; Sun, 22 Nov 2020 02:51:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011220251.0AM2pUat066918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 22 Nov 2020 02:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367924 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 367924 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 02:51:32 -0000 Author: mav Date: Sun Nov 22 02:51:30 2020 New Revision: 367924 URL: https://svnweb.freebsd.org/changeset/base/367924 Log: Remove remnants of execthrottle and maxalloc parameters. The first was obsolete since 26xx, not used on 25xx and not needed on 24xx. The second seems never worked on 24xx and up. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/ispmbox.h head/sys/dev/isp/ispreg.h head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sat Nov 21 21:43:36 2020 (r367923) +++ head/sys/dev/isp/isp.c Sun Nov 22 02:51:30 2020 (r367924) @@ -737,11 +737,8 @@ isp_init(ispsoftc_t *isp) icbp->icb_maxfrmlen = ICB_DFLT_FRMLEN; } - icbp->icb_execthrottle = DEFAULT_EXEC_THROTTLE(isp); - if (icbp->icb_execthrottle < 1 && !IS_26XX(isp)) { - isp_prt(isp, ISP_LOGERR, "bad execution throttle of %d- using %d", DEFAULT_EXEC_THROTTLE(isp), ICB_DFLT_THROTTLE); - icbp->icb_execthrottle = ICB_DFLT_THROTTLE; - } + if (!IS_26XX(isp)) + icbp->icb_execthrottle = 0xffff; /* * Set target exchange count. Take half if we are supporting both roles. @@ -4425,7 +4422,6 @@ isp_setdfltfcparm(ispsoftc_t *isp, int chan) * Establish some default parameters. */ fcp->role = DEFAULT_ROLE(isp, chan); - fcp->isp_maxalloc = ICB_DFLT_ALLOC; fcp->isp_retry_delay = ICB_DFLT_RDELAY; fcp->isp_retry_count = ICB_DFLT_RCOUNT; fcp->isp_loopid = DEFAULT_LOOPID(isp, chan); @@ -4594,16 +4590,14 @@ isp_parse_nvram_2400(ispsoftc_t *isp, uint8_t *nvram_d uint64_t wwn; isp_prt(isp, ISP_LOGDEBUG0, - "NVRAM 0x%08x%08x 0x%08x%08x exchg_cnt %d maxframelen %d", + "NVRAM 0x%08x%08x 0x%08x%08x maxframelen %d", (uint32_t) (ISP2400_NVRAM_NODE_NAME(nvram_data) >> 32), (uint32_t) (ISP2400_NVRAM_NODE_NAME(nvram_data)), (uint32_t) (ISP2400_NVRAM_PORT_NAME(nvram_data) >> 32), (uint32_t) (ISP2400_NVRAM_PORT_NAME(nvram_data)), - ISP2400_NVRAM_EXCHANGE_COUNT(nvram_data), ISP2400_NVRAM_MAXFRAMELENGTH(nvram_data)); isp_prt(isp, ISP_LOGDEBUG0, - "NVRAM execthr %d loopid %d fwopt1 0x%x fwopt2 0x%x fwopt3 0x%x", - ISP2400_NVRAM_EXECUTION_THROTTLE(nvram_data), + "NVRAM loopid %d fwopt1 0x%x fwopt2 0x%x fwopt3 0x%x", ISP2400_NVRAM_HARDLOOPID(nvram_data), ISP2400_NVRAM_FIRMWARE_OPTIONS1(nvram_data), ISP2400_NVRAM_FIRMWARE_OPTIONS2(nvram_data), @@ -4624,19 +4618,12 @@ isp_parse_nvram_2400(ispsoftc_t *isp, uint8_t *nvram_d } fcp->isp_wwnn_nvram = wwn; - if (ISP2400_NVRAM_EXCHANGE_COUNT(nvram_data)) { - fcp->isp_maxalloc = ISP2400_NVRAM_EXCHANGE_COUNT(nvram_data); - } if ((isp->isp_confopts & ISP_CFG_OWNFSZ) == 0) { DEFAULT_FRAMESIZE(isp) = ISP2400_NVRAM_MAXFRAMELENGTH(nvram_data); } if ((isp->isp_confopts & ISP_CFG_OWNLOOPID) == 0) { fcp->isp_loopid = ISP2400_NVRAM_HARDLOOPID(nvram_data); - } - if ((isp->isp_confopts & ISP_CFG_OWNEXCTHROTTLE) == 0) { - DEFAULT_EXEC_THROTTLE(isp) = - ISP2400_NVRAM_EXECUTION_THROTTLE(nvram_data); } fcp->isp_fwoptions = ISP2400_NVRAM_FIRMWARE_OPTIONS1(nvram_data); fcp->isp_xfwoptions = ISP2400_NVRAM_FIRMWARE_OPTIONS2(nvram_data); Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Sat Nov 21 21:43:36 2020 (r367923) +++ head/sys/dev/isp/isp_freebsd.h Sun Nov 22 02:51:30 2020 (r367924) @@ -280,7 +280,6 @@ struct isposinfo { * misc- needs to be sorted better XXXXXX */ int framesize; - int exec_throttle; int cont_max; #ifdef ISP_TARGET_MODE @@ -545,7 +544,6 @@ default: \ #define XS_SENSE_VALID(xs) (((xs)->ccb_h.status & CAM_AUTOSNS_VALID) != 0) #define DEFAULT_FRAMESIZE(isp) isp->isp_osinfo.framesize -#define DEFAULT_EXEC_THROTTLE(isp) isp->isp_osinfo.exec_throttle #define DEFAULT_ROLE(isp, chan) ISP_FC_PC(isp, chan)->def_role Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Sat Nov 21 21:43:36 2020 (r367923) +++ head/sys/dev/isp/ispmbox.h Sun Nov 22 02:51:30 2020 (r367924) @@ -653,13 +653,6 @@ typedef struct { #define RQSTF_LOGOUT 0x2000 /* - * Miscellaneous - */ -#ifndef ISP_EXEC_THROTTLE -#define ISP_EXEC_THROTTLE 16 -#endif - -/* * About Firmware returns an 'attribute' word. */ #define ISP2400_FW_ATTR_CLASS2 0x0001 @@ -769,8 +762,6 @@ typedef struct { #define ICB_MIN_FRMLEN 256 #define ICB_MAX_FRMLEN 2112 #define ICB_DFLT_FRMLEN 1024 -#define ICB_DFLT_ALLOC 256 -#define ICB_DFLT_THROTTLE 16 #define ICB_DFLT_RDELAY 5 #define ICB_DFLT_RCOUNT 3 Modified: head/sys/dev/isp/ispreg.h ============================================================================== --- head/sys/dev/isp/ispreg.h Sat Nov 21 21:43:36 2020 (r367923) +++ head/sys/dev/isp/ispreg.h Sun Nov 22 02:51:30 2020 (r367924) @@ -219,8 +219,6 @@ typedef struct { #define ISP2400_NVRAM_VERSION(c) ((c)[4] | ((c)[5] << 8)) #define ISP2400_NVRAM_MAXFRAMELENGTH(c) (((c)[12]) | ((c)[13] << 8)) -#define ISP2400_NVRAM_EXECUTION_THROTTLE(c) (((c)[14]) | ((c)[15] << 8)) -#define ISP2400_NVRAM_EXCHANGE_COUNT(c) (((c)[16]) | ((c)[17] << 8)) #define ISP2400_NVRAM_HARDLOOPID(c) ((c)[18] | ((c)[19] << 8)) #define ISP2400_NVRAM_PORT_NAME(c) (\ Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Sat Nov 21 21:43:36 2020 (r367923) +++ head/sys/dev/isp/ispvar.h Sun Nov 22 02:51:30 2020 (r367924) @@ -359,7 +359,6 @@ typedef struct { uint16_t isp_loopid; /* hard loop id */ uint16_t isp_sns_hdl; /* N-port handle for SNS */ uint16_t isp_lasthdl; /* only valid for channel 0 */ - uint16_t isp_maxalloc; uint16_t isp_fabric_params; uint16_t isp_login_hdl; /* Logging in handle */ uint8_t isp_retry_delay; @@ -541,7 +540,6 @@ struct ispsoftc { #define ISP_CFG_FCTAPE 0x200 /* enable FC-Tape */ #define ISP_CFG_OWNFSZ 0x400 /* override NVRAM frame size */ #define ISP_CFG_OWNLOOPID 0x800 /* override NVRAM loopid */ -#define ISP_CFG_OWNEXCTHROTTLE 0x1000 /* override NVRAM execution throttle */ #define ISP_CFG_4GB 0x2000 /* force 4Gb connection (24XX only) */ #define ISP_CFG_8GB 0x4000 /* force 8Gb connection (25XX only) */ #define ISP_CFG_16GB 0x8000 /* force 16Gb connection (26XX only) */ @@ -893,7 +891,6 @@ void isp_async(ispsoftc_t *, ispasync_t, ...); * XS_SENSE_VALID(xs) indicates whether sense is valid * * DEFAULT_FRAMESIZE(ispsoftc_t *) Default Frame Size - * DEFAULT_EXEC_THROTTLE(ispsoftc_t *) Default Execution Throttle * * DEFAULT_ROLE(ispsoftc_t *, int) Get Default Role for a channel * DEFAULT_LOOPID(ispsoftc_t *, int) Default FC Loop ID From owner-svn-src-all@freebsd.org Sun Nov 22 04:10:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 074C247C010; Sun, 22 Nov 2020 04:10:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cdxdd6Vhgz4Wk9; Sun, 22 Nov 2020 04:10:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C76C6142DA; Sun, 22 Nov 2020 04:10:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AM4AD1D016402; Sun, 22 Nov 2020 04:10:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AM4ADaT016401; Sun, 22 Nov 2020 04:10:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011220410.0AM4ADaT016401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 22 Nov 2020 04:10:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367925 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 367925 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 04:10:14 -0000 Author: mav Date: Sun Nov 22 04:10:13 2020 New Revision: 367925 URL: https://svnweb.freebsd.org/changeset/base/367925 Log: Do not parent all busdma tags to the payload tag. There is not much to inherit any more, may create more problems than solve. Instead parent them all directly to upstream. While there, add missed payload tag and tune scratch tag destructions. Modified: head/sys/dev/isp/isp_pci.c Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Sun Nov 22 02:51:30 2020 (r367924) +++ head/sys/dev/isp/isp_pci.c Sun Nov 22 04:10:13 2020 (r367925) @@ -173,10 +173,8 @@ static int isp_pci_attach (device_t); static int isp_pci_detach (device_t); -#define ISP_PCD(isp) ((struct isp_pcisoftc *)isp)->pci_dev struct isp_pcisoftc { ispsoftc_t pci_isp; - device_t pci_dev; struct resource * regs; struct resource * regs1; struct resource * regs2; @@ -449,7 +447,6 @@ isp_pci_attach(device_t dev) size_t psize, xsize; char fwname[32]; - pcs->pci_dev = dev; isp->isp_dev = dev; isp->isp_nchan = 1; mtx_init(&isp->isp_lock, "isp", NULL, MTX_DEF); @@ -464,7 +461,6 @@ isp_pci_attach(device_t dev) pcs->regs = pcs->regs2 = NULL; pcs->rgd = pcs->rtp = 0; - pcs->pci_dev = dev; isp->isp_nchan += isp_nvports; switch (pci_get_devid(dev)) { case PCI_QLOGIC_ISP2422: @@ -883,9 +879,10 @@ imc(void *arg, bus_dma_segment_t *segs, int nseg, int static int isp_pci_mbxdma(ispsoftc_t *isp) { + bus_dma_tag_t ptag; caddr_t base; uint32_t len; - int i, error, cmap = 0; + int i, error, cmap; bus_size_t slim; /* segment size */ struct imush im; #ifdef ISP_TARGET_MODE @@ -898,28 +895,21 @@ isp_pci_mbxdma(ispsoftc_t *isp) if (isp->isp_rquest != NULL && isp->isp_maxcmds == 0) return (0); ISP_UNLOCK(isp); - if (isp->isp_rquest != NULL) - goto gotmaxcmds; + ptag = bus_get_dma_tag(isp->isp_osinfo.dev); if (sizeof (bus_size_t) > 4) slim = (bus_size_t) (1ULL << 32); else slim = (bus_size_t) (1UL << 31); - if (bus_dma_tag_create(bus_get_dma_tag(ISP_PCD(isp)), 1, slim, - BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, - (ISP_NSEG64_MAX - 1) * PAGE_SIZE, ISP_NSEG64_MAX, - (ISP_NSEG64_MAX - 1) * PAGE_SIZE, 0, - busdma_lock_mutex, &isp->isp_lock, &isp->isp_osinfo.dmat)) { - ISP_LOCK(isp); - isp_prt(isp, ISP_LOGERR, "could not create master dma tag"); - return (1); - } + if (isp->isp_rquest != NULL) + goto gotmaxcmds; + /* * Allocate and map the request queue. */ len = ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)); - if (bus_dma_tag_create(isp->isp_osinfo.dmat, QENTRY_LEN, slim, + if (bus_dma_tag_create(ptag, QENTRY_LEN, slim, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, NULL, NULL, &isp->isp_osinfo.reqdmat)) { isp_prt(isp, ISP_LOGERR, "cannot create request DMA tag"); @@ -947,7 +937,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) * Allocate region for external DMA addressable command/status structures. */ len = N_XCMDS * XCMD_SIZE; - if (bus_dma_tag_create(isp->isp_osinfo.dmat, XCMD_SIZE, slim, + if (bus_dma_tag_create(ptag, XCMD_SIZE, slim, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, NULL, NULL, &isp->isp_osinfo.ecmd_dmat)) { isp_prt(isp, ISP_LOGERR, "cannot create ECMD DMA tag"); @@ -956,7 +946,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) if (bus_dmamem_alloc(isp->isp_osinfo.ecmd_dmat, (void **)&base, BUS_DMA_COHERENT, &isp->isp_osinfo.ecmd_map) != 0) { isp_prt(isp, ISP_LOGERR, "cannot allocate ECMD DMA memory"); - bus_dma_tag_destroy(isp->isp_osinfo.reqdmat); + bus_dma_tag_destroy(isp->isp_osinfo.ecmd_dmat); goto bad; } isp->isp_osinfo.ecmd_base = (isp_ecmd_t *)base; @@ -984,7 +974,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) * Allocate and map the result queue. */ len = ISP_QUEUE_SIZE(RESULT_QUEUE_LEN(isp)); - if (bus_dma_tag_create(isp->isp_osinfo.dmat, QENTRY_LEN, slim, + if (bus_dma_tag_create(ptag, QENTRY_LEN, slim, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, NULL, NULL, &isp->isp_osinfo.respdmat)) { isp_prt(isp, ISP_LOGERR, "cannot create response DMA tag"); @@ -1012,7 +1002,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) * Allocate and map ATIO queue. */ len = ISP_QUEUE_SIZE(ATIO_QUEUE_LEN(isp)); - if (bus_dma_tag_create(isp->isp_osinfo.dmat, QENTRY_LEN, slim, + if (bus_dma_tag_create(ptag, QENTRY_LEN, slim, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, NULL, NULL, &isp->isp_osinfo.atiodmat)) { isp_prt(isp, ISP_LOGERR, "cannot create ATIO DMA tag"); @@ -1036,7 +1026,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) isp->isp_atioq_dma = im.maddr; #endif - if (bus_dma_tag_create(isp->isp_osinfo.dmat, 64, slim, + if (bus_dma_tag_create(ptag, 64, slim, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, 2*QENTRY_LEN, 1, 2*QENTRY_LEN, 0, NULL, NULL, &isp->isp_osinfo.iocbdmat)) { @@ -1052,7 +1042,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) goto bad; isp->isp_iocb_dma = im.maddr; - if (bus_dma_tag_create(isp->isp_osinfo.dmat, 64, slim, + if (bus_dma_tag_create(ptag, 64, slim, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, ISP_FC_SCRLEN, 1, ISP_FC_SCRLEN, 0, NULL, NULL, &isp->isp_osinfo.scdmat)) @@ -1094,6 +1084,12 @@ isp_pci_mbxdma(ispsoftc_t *isp) } gotmaxcmds: + if (bus_dma_tag_create(ptag, 1, slim, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + (ISP_NSEG64_MAX - 1) * PAGE_SIZE, ISP_NSEG64_MAX, + (ISP_NSEG64_MAX - 1) * PAGE_SIZE, 0, + busdma_lock_mutex, &isp->isp_lock, &isp->isp_osinfo.dmat)) + goto bad; len = isp->isp_maxcmds * sizeof (struct isp_pcmd); isp->isp_osinfo.pcmd_pool = (struct isp_pcmd *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); @@ -1148,6 +1144,10 @@ isp_pci_mbxdmafree(ispsoftc_t *isp) free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); isp->isp_osinfo.pcmd_pool = NULL; } + if (isp->isp_osinfo.dmat) { + bus_dma_tag_destroy(isp->isp_osinfo.dmat); + isp->isp_osinfo.dmat = NULL; + } for (i = 0; i < isp->isp_nchan; i++) { struct isp_fc *fc = ISP_FC_PC(isp, i); if (FCPARAM(isp, i)->isp_scdma != 0) { @@ -1166,8 +1166,11 @@ isp_pci_mbxdmafree(ispsoftc_t *isp) free(n, M_DEVBUF); } } - if (isp->isp_iocb_dma != 0) { + if (isp->isp_osinfo.scdmat) { bus_dma_tag_destroy(isp->isp_osinfo.scdmat); + isp->isp_osinfo.scdmat = NULL; + } + if (isp->isp_iocb_dma != 0) { bus_dmamap_unload(isp->isp_osinfo.iocbdmat, isp->isp_osinfo.iocbmap); isp->isp_iocb_dma = 0; From owner-svn-src-all@freebsd.org Sun Nov 22 04:29:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B1F947C0DC; Sun, 22 Nov 2020 04:29:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cdy4P1jV9z4XWV; Sun, 22 Nov 2020 04:29:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D91214519; Sun, 22 Nov 2020 04:29:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AM4TvHO029019; Sun, 22 Nov 2020 04:29:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AM4TupH029015; Sun, 22 Nov 2020 04:29:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011220429.0AM4TupH029015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 22 Nov 2020 04:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367926 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 367926 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 04:29:57 -0000 Author: mav Date: Sun Nov 22 04:29:55 2020 New Revision: 367926 URL: https://svnweb.freebsd.org/changeset/base/367926 Log: Make handlers and atpds overflows unlikely. - Allocate 256 handlers more than payload commands for management purposes. - Increase maximum number of handlers from 8K to 16K by tuning the format. - Just to be safe limit the number of payload commands to 16K - 256. - Limit number of target exchanges in mixed mode to the number of atpds. - If we still somehow get out of atpds -- return BUSY, since we really are. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_library.c head/sys/dev/isp/isp_pci.c head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sun Nov 22 04:10:13 2020 (r367925) +++ head/sys/dev/isp/isp.c Sun Nov 22 04:29:55 2020 (r367926) @@ -579,6 +579,8 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) return; } isp->isp_maxcmds = mbs.param[3]; + /* Limit to the maximum of our hardcoded handle format (16K now). */ + isp->isp_maxcmds = MIN(isp->isp_maxcmds, ISP_HANDLE_MAX - ISP_HANDLE_RESERVE); isp_prt(isp, ISP_LOGCONFIG, "%d max I/O command limit set", isp->isp_maxcmds); /* @@ -744,9 +746,10 @@ isp_init(ispsoftc_t *isp) * Set target exchange count. Take half if we are supporting both roles. */ if (icbp->icb_fwoptions1 & ICB2400_OPT1_TGT_ENABLE) { - icbp->icb_xchgcnt = isp->isp_maxcmds; if ((icbp->icb_fwoptions1 & ICB2400_OPT1_INI_DISABLE) == 0) - icbp->icb_xchgcnt >>= 1; + icbp->icb_xchgcnt = MIN(isp->isp_maxcmds / 2, ATPDPSIZE); + else + icbp->icb_xchgcnt = isp->isp_maxcmds; } @@ -3535,7 +3538,7 @@ isp_intr_async(ispsoftc_t *isp, uint16_t mbox) */ if (topo == TOPO_NL_PORT || topo == TOPO_FL_PORT) { int i, j; - for (i = j = 0; i < isp->isp_maxcmds; i++) { + for (i = j = 0; i < ISP_HANDLE_NUM(isp); i++) { XS_T *xs; isp_hdl_t *hdp; Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Sun Nov 22 04:10:13 2020 (r367925) +++ head/sys/dev/isp/isp_freebsd.c Sun Nov 22 04:29:55 2020 (r367926) @@ -1408,7 +1408,9 @@ isp_handle_platform_atio7(ispsoftc_t *isp, at7_entry_t oatp = isp_find_atpd(isp, chan, aep->at_rxid); if (oatp) { - isp_prt(isp, ISP_LOGTDEBUG0, "[0x%x] tag wraparound in isp_handle_platforms_atio7 (N-Port Handle 0x%04x S_ID 0x%04x OX_ID 0x%04x) oatp state %d", + isp_prt(isp, oatp->state == ATPD_STATE_LAST_CTIO ? ISP_LOGTDEBUG0 : + ISP_LOGWARN, "[0x%x] tag wraparound (N-Port Handle " + "0x%04x S_ID 0x%04x OX_ID 0x%04x) oatp state %d", aep->at_rxid, nphdl, sid, aep->at_hdr.ox_id, oatp->state); /* * It's not a "no resource" condition- but we can treat it like one @@ -1418,7 +1420,8 @@ isp_handle_platform_atio7(ispsoftc_t *isp, at7_entry_t atp = isp_get_atpd(isp, chan, aep->at_rxid); if (atp == NULL) { isp_prt(isp, ISP_LOGTDEBUG0, "[0x%x] out of atps", aep->at_rxid); - goto noresrc; + isp_endcmd(isp, aep, nphdl, chan, SCSI_BUSY, 0); + return; } atp->word3 = lp->prli_word3; atp->state = ATPD_STATE_ATIO; @@ -1477,8 +1480,7 @@ isp_handle_platform_atio7(ispsoftc_t *isp, at7_entry_t xpt_done((union ccb *)atiop); return; noresrc: - if (atp) - isp_put_atpd(isp, chan, atp); + KASSERT(atp == NULL, ("%s: atp is not NULL on noresrc!\n")); ntp = isp_get_ntpd(isp, chan); if (ntp == NULL) { isp_endcmd(isp, aep, nphdl, chan, SCSI_STATUS_BUSY, 0); @@ -2207,7 +2209,7 @@ isp_loop_dead(ispsoftc_t *isp, int chan) if (lp->state == FC_PORTDB_STATE_NIL) continue; - for (i = 0; i < isp->isp_maxcmds; i++) { + for (i = 0; i < ISP_HANDLE_NUM(isp); i++) { struct ccb_scsiio *xs; if (ISP_H2HT(isp->isp_xflist[i].handle) != ISP_HANDLE_INITIATOR) { Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Sun Nov 22 04:10:13 2020 (r367925) +++ head/sys/dev/isp/isp_library.c Sun Nov 22 04:29:55 2020 (r367926) @@ -195,7 +195,7 @@ isp_find_handle(ispsoftc_t *isp, void *xs) uint32_t i, foundhdl = ISP_HANDLE_FREE; if (xs != NULL) { - for (i = 0; i < isp->isp_maxcmds; i++) { + for (i = 0; i < ISP_HANDLE_NUM(isp); i++) { if (isp->isp_xflist[i].cmd != xs) { continue; } @@ -486,7 +486,7 @@ isp_clear_commands(ispsoftc_t *isp) isp_notify_t notify; #endif - for (tmp = 0; isp->isp_xflist && tmp < isp->isp_maxcmds; tmp++) { + for (tmp = 0; isp->isp_xflist && tmp < ISP_HANDLE_NUM(isp); tmp++) { hdp = &isp->isp_xflist[tmp]; switch (ISP_H2HT(hdp->handle)) { Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Sun Nov 22 04:10:13 2020 (r367925) +++ head/sys/dev/isp/isp_pci.c Sun Nov 22 04:29:55 2020 (r367926) @@ -1112,9 +1112,9 @@ gotmaxcmds: } isp->isp_osinfo.pcmd_free = &isp->isp_osinfo.pcmd_pool[0]; - len = sizeof (isp_hdl_t) * isp->isp_maxcmds; + len = sizeof(isp_hdl_t) * ISP_HANDLE_NUM(isp); isp->isp_xflist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - for (len = 0; len < isp->isp_maxcmds - 1; len++) + for (len = 0; len < ISP_HANDLE_NUM(isp) - 1; len++) isp->isp_xflist[len].cmd = &isp->isp_xflist[len+1]; isp->isp_xffree = isp->isp_xflist; Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Sun Nov 22 04:10:13 2020 (r367925) +++ head/sys/dev/isp/ispvar.h Sun Nov 22 04:29:55 2020 (r367926) @@ -221,9 +221,9 @@ typedef struct { uint32_t handle; /* handle associated with this command */ } isp_hdl_t; #define ISP_HANDLE_FREE 0x00000000 -#define ISP_HANDLE_CMD_MASK 0x00001fff -#define ISP_HANDLE_USAGE_MASK 0x0000e000 -#define ISP_HANDLE_USAGE_SHIFT 13 +#define ISP_HANDLE_CMD_MASK 0x00003fff +#define ISP_HANDLE_USAGE_MASK 0x0000c000 +#define ISP_HANDLE_USAGE_SHIFT 14 #define ISP_H2HT(hdl) ((hdl & ISP_HANDLE_USAGE_MASK) >> ISP_HANDLE_USAGE_SHIFT) # define ISP_HANDLE_NONE 0 # define ISP_HANDLE_INITIATOR 1 @@ -232,13 +232,15 @@ typedef struct { #define ISP_HANDLE_SEQ_MASK 0xffff0000 #define ISP_HANDLE_SEQ_SHIFT 16 #define ISP_H2SEQ(hdl) ((hdl & ISP_HANDLE_SEQ_MASK) >> ISP_HANDLE_SEQ_SHIFT) -#define ISP_VALID_HANDLE(c, hdl) \ +#define ISP_HANDLE_MAX (ISP_HANDLE_CMD_MASK + 1) +#define ISP_HANDLE_RESERVE 256 +#define ISP_HANDLE_NUM(isp) ((isp)->isp_maxcmds + ISP_HANDLE_RESERVE) +#define ISP_VALID_HANDLE(isp, hdl) \ ((ISP_H2HT(hdl) == ISP_HANDLE_INITIATOR || \ ISP_H2HT(hdl) == ISP_HANDLE_TARGET || \ ISP_H2HT(hdl) == ISP_HANDLE_CTRL) && \ - ((hdl) & ISP_HANDLE_CMD_MASK) < (c)->isp_maxcmds && \ - (hdl) == ((c)->isp_xflist[(hdl) & ISP_HANDLE_CMD_MASK].handle)) -#define ISP_BAD_HANDLE_INDEX 0xffffffff + ((hdl) & ISP_HANDLE_CMD_MASK) < ISP_HANDLE_NUM(isp) && \ + (hdl) == ((isp)->isp_xflist[(hdl) & ISP_HANDLE_CMD_MASK].handle)) /* From owner-svn-src-all@freebsd.org Sun Nov 22 05:00:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA85147CBC3; Sun, 22 Nov 2020 05:00:29 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cdyld4bDQz4Ybr; Sun, 22 Nov 2020 05:00:29 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 904DB149A4; Sun, 22 Nov 2020 05:00:29 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AM50TuU047662; Sun, 22 Nov 2020 05:00:29 GMT (envelope-from rew@FreeBSD.org) Received: (from rew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AM50Tml047660; Sun, 22 Nov 2020 05:00:29 GMT (envelope-from rew@FreeBSD.org) Message-Id: <202011220500.0AM50Tml047660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rew set sender to rew@FreeBSD.org using -f From: Robert Wing Date: Sun, 22 Nov 2020 05:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367927 - in head: sys/kern tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: rew X-SVN-Commit-Paths: in head: sys/kern tests/sys/kern X-SVN-Commit-Revision: 367927 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 05:00:29 -0000 Author: rew Date: Sun Nov 22 05:00:28 2020 New Revision: 367927 URL: https://svnweb.freebsd.org/changeset/base/367927 Log: fd: free old file descriptor tables when not shared During the life of a process, new file descriptor tables may be allocated. When a new table is allocated, the old table is placed in a free list and held onto until all processes referencing them exit. When a new file descriptor table is allocated, the old file descriptor table can be freed when the current process has a single-thread and the file descriptor table is not being shared with any other processes. Reviewed by: kevans Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D18617 Added: head/tests/sys/kern/fdgrowtable_test.c (contents, props changed) Modified: head/sys/kern/kern_descrip.c head/tests/sys/kern/Makefile Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Nov 22 04:29:55 2020 (r367926) +++ head/sys/kern/kern_descrip.c Sun Nov 22 05:00:28 2020 (r367927) @@ -1801,8 +1801,12 @@ fdgrowtable(struct filedesc *fdp, int nfd) atomic_store_rel_ptr((volatile void *)&fdp->fd_files, (uintptr_t)ntable); /* - * Do not free the old file table, as some threads may still - * reference entries within it. Instead, place it on a freelist + * Free the old file table when not shared by other threads or processes. + * The old file table is considered to be shared when either are true: + * - The process has more than one thread. + * - The file descriptor table has been shared via fdshare(). + * + * When shared, the old file table will be placed on a freelist * which will be processed when the struct filedesc is released. * * Note that if onfiles == NDFILE, we're dealing with the original @@ -1810,10 +1814,14 @@ fdgrowtable(struct filedesc *fdp, int nfd) * which must not be freed. */ if (onfiles > NDFILE) { - ft = (struct freetable *)&otable->fdt_ofiles[onfiles]; - fdp0 = (struct filedesc0 *)fdp; - ft->ft_table = otable; - SLIST_INSERT_HEAD(&fdp0->fd_free, ft, ft_next); + if (curproc->p_numthreads == 1 && fdp->fd_refcnt == 1) + free(otable, M_FILEDESC); + else { + ft = (struct freetable *)&otable->fdt_ofiles[onfiles]; + fdp0 = (struct filedesc0 *)fdp; + ft->ft_table = otable; + SLIST_INSERT_HEAD(&fdp0->fd_free, ft, ft_next); + } } /* * The map does not have the same possibility of threads still Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Sun Nov 22 04:29:55 2020 (r367926) +++ head/tests/sys/kern/Makefile Sun Nov 22 05:00:28 2020 (r367927) @@ -10,6 +10,7 @@ TESTSDIR= ${TESTSBASE}/sys/kern #ATF_TESTS_C+= kcov ATF_TESTS_C+= kern_copyin ATF_TESTS_C+= kern_descrip_test +ATF_TESTS_C+= fdgrowtable_test ATF_TESTS_C+= kill_zombie ATF_TESTS_C+= ptrace_test TEST_METADATA.ptrace_test+= timeout="15" @@ -46,6 +47,7 @@ LIBADD.ptrace_test+= pthread LIBADD.unix_seqpacket_test+= pthread LIBADD.kcov+= pthread LIBADD.sendfile_helper+= pthread +LIBADD.fdgrowtable_test+= util pthread kvm procstat NETBSD_ATF_TESTS_C+= lockf_test NETBSD_ATF_TESTS_C+= mqueue_test Added: head/tests/sys/kern/fdgrowtable_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/kern/fdgrowtable_test.c Sun Nov 22 05:00:28 2020 (r367927) @@ -0,0 +1,267 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Rob Wing + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/* linked libraries */ +#include +#include +#include +#include + +/* test-case macro */ +#define AFILE "afile" + +/* + * The following macros, struct freetable, struct fdescenttbl0 + * and struct filedesc0 are copied from sys/kern/kern_descrip.c + */ +#define NDFILE 20 +#define NDSLOTSIZE sizeof(NDSLOTTYPE) +#define NDENTRIES (NDSLOTSIZE * __CHAR_BIT) +#define NDSLOT(x) ((x) / NDENTRIES) +#define NDBIT(x) ((NDSLOTTYPE)1 << ((x) % NDENTRIES)) +#define NDSLOTS(x) (((x) + NDENTRIES - 1) / NDENTRIES) + +struct freetable { + struct fdescenttbl *ft_table; + SLIST_ENTRY(freetable) ft_next; +}; + +struct fdescenttbl0 { + int fdt_nfiles; + struct filedescent fdt_ofiles[NDFILE]; +}; + +struct filedesc0 { + struct filedesc fd_fd; + SLIST_HEAD(, freetable) fd_free; + struct fdescenttbl0 fd_dfiles; + NDSLOTTYPE fd_dmap[NDSLOTS(NDFILE)]; +}; + +static void +openfiles(int n) +{ + int i, fd; + + ATF_REQUIRE((fd = open(AFILE, O_CREAT, 0644)) != -1); + close(fd); + for (i = 0; i < n; i++) + ATF_REQUIRE((fd = open(AFILE, O_RDONLY, 0644)) != -1); +} + +/* + * Get a count of the old file descriptor tables on the freelist. + */ +static int +old_tables(kvm_t *kd, struct kinfo_proc *kp) +{ + struct filedesc0 fdp0; + struct freetable *ft, tft; + int counter; + + counter = 0; + + ATF_REQUIRE(kvm_read(kd, (unsigned long) kp->ki_fd, &fdp0, sizeof(fdp0)) > 0); + + SLIST_FOREACH(ft, &fdp0.fd_free, ft_next) { + ATF_REQUIRE(kvm_read(kd, (unsigned long) ft, &tft, sizeof(tft)) > 0 ); + ft = &tft; + counter++; + } + + return (counter); +} + +/* + * The returning struct kinfo_proc stores kernel addresses that will be + * used by kvm_read to retrieve information for the current process. + */ +static struct kinfo_proc * +read_kinfo(kvm_t *kd) +{ + struct kinfo_proc *kp; + int procs_found; + + ATF_REQUIRE((kp = kvm_getprocs(kd, KERN_PROC_PID, (int) getpid(), &procs_found)) != NULL); + ATF_REQUIRE(procs_found == 1); + + return (kp); +} + +/* + * Test a single threaded process that doesn't have a shared + * file descriptor table. The old tables should be freed. + */ +ATF_TC(free_oldtables); +ATF_TC_HEAD(free_oldtables, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} + +ATF_TC_BODY(free_oldtables, tc) +{ + kvm_t *kd; + struct kinfo_proc *kp; + + ATF_REQUIRE((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL)) != NULL); + openfiles(128); + kp = read_kinfo(kd); + ATF_CHECK(old_tables(kd,kp) == 0); +} + +static void * +exec_thread(void *args) +{ + for (;;) + sleep(1); +} + +/* + * Test a process with two threads that doesn't have a shared file + * descriptor table. The old tables should not be freed. + */ +ATF_TC(oldtables_shared_via_threads); +ATF_TC_HEAD(oldtables_shared_via_threads, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} + +ATF_TC_BODY(oldtables_shared_via_threads, tc) +{ + kvm_t *kd; + struct kinfo_proc *kp; + pthread_t thread; + + ATF_REQUIRE((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL)) != NULL); + ATF_REQUIRE(pthread_create(&thread, NULL, exec_thread, NULL) == 0); + + openfiles(128); + + kp = read_kinfo(kd); + ATF_CHECK(kp->ki_numthreads > 1); + ATF_CHECK(old_tables(kd,kp) > 1); + + ATF_REQUIRE(pthread_cancel(thread) == 0); + ATF_REQUIRE(pthread_join(thread, NULL) == 0); +} + +/* + * Get the reference count of a file descriptor table. + */ +static int +filedesc_refcnt(kvm_t *kd, struct kinfo_proc *kp) +{ + struct filedesc fdp; + + ATF_REQUIRE(kvm_read(kd, (unsigned long) kp->ki_fd, &fdp, sizeof(fdp)) > 0); + + return (fdp.fd_refcnt); +} + +/* + * Test a single threaded process that shares a file descriptor + * table with another process. The old tables should not be freed. + */ +ATF_TC(oldtables_shared_via_process); +ATF_TC_HEAD(oldtables_shared_via_process, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} + +ATF_TC_BODY(oldtables_shared_via_process, tc) +{ + kvm_t *kd; + struct kinfo_proc *kp; + int status; + pid_t child, wpid; + + ATF_REQUIRE((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL)) != NULL); + + /* share the file descriptor table */ + ATF_REQUIRE((child = rfork(RFPROC)) != -1); + + if (child == 0) { + openfiles(128); + raise(SIGSTOP); + exit(127); + } + + /* let parent process open some files too */ + openfiles(128); + + /* get current status of child */ + wpid = waitpid(child, &status, WUNTRACED); + + /* child should be stopped */ + ATF_REQUIRE(WIFSTOPPED(status)); + + /* + * We want to read kernel data + * before the child exits + * otherwise we'll lose a reference count + * to the file descriptor table + */ + if (child != 0) { + kp = read_kinfo(kd); + + ATF_CHECK(filedesc_refcnt(kd,kp) > 1); + ATF_CHECK(old_tables(kd,kp) > 1); + + kill(child, SIGCONT); + } + + /* child should have exited */ + wpid = waitpid(child, &status, 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 127); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, free_oldtables); + ATF_TP_ADD_TC(tp, oldtables_shared_via_threads); + ATF_TP_ADD_TC(tp, oldtables_shared_via_process); + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Sun Nov 22 05:34:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBEBC47D587; Sun, 22 Nov 2020 05:34: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CdzWJ5J6Vz4ZMb; Sun, 22 Nov 2020 05:34: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 A8B8515141; Sun, 22 Nov 2020 05:34: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 0AM5Yqsq071738; Sun, 22 Nov 2020 05:34:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AM5Yp4u071733; Sun, 22 Nov 2020 05:34:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011220534.0AM5Yp4u071733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 22 Nov 2020 05:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367928 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern sys X-SVN-Commit-Revision: 367928 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 05:34:52 -0000 Author: kevans Date: Sun Nov 22 05:34:51 2020 New Revision: 367928 URL: https://svnweb.freebsd.org/changeset/base/367928 Log: _umtx_op: move compat32 definitions back in These are reasonably compact, and a future commit will blur the compat32 lines by supporting 32-bit operations with the native _umtx_op. Modified: head/sys/compat/freebsd32/freebsd32.h head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/kern_umtx.c head/sys/sys/syscallsubr.h head/sys/sys/umtx.h Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Sun Nov 22 05:00:28 2020 (r367927) +++ head/sys/compat/freebsd32/freebsd32.h Sun Nov 22 05:34:51 2020 (r367928) @@ -94,27 +94,6 @@ struct itimerval32 { struct timeval32 it_value; }; -struct umtx_time32 { - struct timespec32 _timeout; - uint32_t _flags; - uint32_t _clockid; -}; - -struct umtx_robust_lists_params_compat32 { - uint32_t robust_list_offset; - uint32_t robust_priv_list_offset; - uint32_t robust_inact_offset; -}; - -struct umutex32 { - volatile __lwpid_t m_owner; /* Owner of the mutex */ - __uint32_t m_flags; /* Flags of the mutex */ - __uint32_t m_ceilings[2]; /* Priority protect ceiling */ - __uint32_t m_rb_lnk; /* Robust linkage */ - __uint32_t m_pad; - __uint32_t m_spare[2]; -}; - #define FREEBSD4_MFSNAMELEN 16 #define FREEBSD4_MNAMELEN (88 - 2 * sizeof(int32_t)) Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Nov 22 05:00:28 2020 (r367927) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Nov 22 05:34:51 2020 (r367928) @@ -3766,11 +3766,3 @@ freebsd32_sched_rr_get_interval(struct thread *td, } return (error); } - -int -freebsd32__umtx_op(struct thread *td, struct freebsd32__umtx_op_args *uap) -{ - - return (kern__umtx_op(td, uap->obj, uap->op, uap->val, uap->uaddr, - uap->uaddr2, &umtx_native_ops32)); -} Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Sun Nov 22 05:00:28 2020 (r367927) +++ head/sys/kern/kern_umtx.c Sun Nov 22 05:34:51 2020 (r367928) @@ -219,7 +219,41 @@ struct abs_timeout { struct timespec end; }; +struct umtx_copyops { + int (*copyin_timeout)(const void *uaddr, struct timespec *tsp); + int (*copyin_umtx_time)(const void *uaddr, size_t size, + struct _umtx_time *tp); + int (*copyin_robust_lists)(const void *uaddr, size_t size, + struct umtx_robust_lists_params *rbp); + int (*copyout_timeout)(void *uaddr, size_t size, + struct timespec *tsp); + const size_t timespec_sz; + const size_t umtx_time_sz; + const bool compat32; +}; + #ifdef COMPAT_FREEBSD32 +struct umtx_time32 { + struct timespec32 _timeout; + uint32_t _flags; + uint32_t _clockid; +}; + +struct umtx_robust_lists_params_compat32 { + uint32_t robust_list_offset; + uint32_t robust_priv_list_offset; + uint32_t robust_inact_offset; +}; + +struct umutex32 { + volatile __lwpid_t m_owner; /* Owner of the mutex */ + __uint32_t m_flags; /* Flags of the mutex */ + __uint32_t m_ceilings[2]; /* Priority protect ceiling */ + __uint32_t m_rb_lnk; /* Robust linkage */ + __uint32_t m_pad; + __uint32_t m_spare[2]; +}; + _Static_assert(sizeof(struct umutex) == sizeof(struct umutex32), "umutex32"); _Static_assert(__offsetof(struct umutex, m_spare[0]) == __offsetof(struct umutex32, m_spare[0]), "m_spare32"); @@ -4291,7 +4325,7 @@ const struct umtx_copyops umtx_native_ops32 = { }; #endif -int +static int kern__umtx_op(struct thread *td, void *obj, int op, unsigned long val, void *uaddr1, void *uaddr2, const struct umtx_copyops *ops) { @@ -4315,6 +4349,16 @@ sys__umtx_op(struct thread *td, struct _umtx_op_args * return (kern__umtx_op(td, uap->obj, uap->op, uap->val, uap->uaddr1, uap->uaddr2, &umtx_native_ops)); } + +#ifdef COMPAT_FREEBSD32 +int +freebsd32__umtx_op(struct thread *td, struct freebsd32__umtx_op_args *uap) +{ + + return (kern__umtx_op(td, uap->obj, uap->op, uap->val, uap->uaddr, + uap->uaddr2, &umtx_native_ops32)); +} +#endif void umtx_thread_init(struct thread *td) Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Sun Nov 22 05:00:28 2020 (r367927) +++ head/sys/sys/syscallsubr.h Sun Nov 22 05:34:51 2020 (r367928) @@ -62,7 +62,6 @@ struct sockaddr; struct stat; struct thr_param; struct uio; -struct umtx_copyops; struct vm_map; struct vmspace; @@ -80,8 +79,6 @@ struct mmap_req { int kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg, size_t buflen, size_t path_max); -int kern__umtx_op(struct thread *td, void *obj, int op, unsigned long val, - void *uaddr1, void *uaddr2, const struct umtx_copyops *ops); int kern_accept(struct thread *td, int s, struct sockaddr **name, socklen_t *namelen, struct file **fp); int kern_accept4(struct thread *td, int s, struct sockaddr **name, Modified: head/sys/sys/umtx.h ============================================================================== --- head/sys/sys/umtx.h Sun Nov 22 05:00:28 2020 (r367927) +++ head/sys/sys/umtx.h Sun Nov 22 05:34:51 2020 (r367928) @@ -200,21 +200,5 @@ void umtx_thread_fini(struct thread *); void umtx_thread_alloc(struct thread *); void umtx_thread_exit(struct thread *); -struct umtx_copyops { - int (*copyin_timeout)(const void *uaddr, struct timespec *tsp); - int (*copyin_umtx_time)(const void *uaddr, size_t size, - struct _umtx_time *tp); - int (*copyin_robust_lists)(const void *uaddr, size_t size, - struct umtx_robust_lists_params *rbp); - int (*copyout_timeout)(void *uaddr, size_t size, - struct timespec *tsp); - const size_t timespec_sz; - const size_t umtx_time_sz; - const bool compat32; -}; - -#ifdef COMPAT_FREEBSD32 -extern const struct umtx_copyops umtx_native_ops32; -#endif #endif /* !_KERNEL */ #endif /* !_SYS_UMTX_H_ */ From owner-svn-src-all@freebsd.org Sun Nov 22 05:42:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8173C47D9B9; Sun, 22 Nov 2020 05:42:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CdzhY3DYdz4bPW; Sun, 22 Nov 2020 05:42:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61BCA14EE6; Sun, 22 Nov 2020 05:42:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AM5gr2K077735; Sun, 22 Nov 2020 05:42:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AM5groZ077734; Sun, 22 Nov 2020 05:42:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011220542.0AM5groZ077734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 22 Nov 2020 05:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367929 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 367929 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 05:42:53 -0000 Author: mav Date: Sun Nov 22 05:42:52 2020 New Revision: 367929 URL: https://svnweb.freebsd.org/changeset/base/367929 Log: Fix build after 367926. Option ISP_TARGET_MODE is evil. Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sun Nov 22 05:34:51 2020 (r367928) +++ head/sys/dev/isp/isp.c Sun Nov 22 05:42:52 2020 (r367929) @@ -742,6 +742,7 @@ isp_init(ispsoftc_t *isp) if (!IS_26XX(isp)) icbp->icb_execthrottle = 0xffff; +#ifdef ISP_TARGET_MODE /* * Set target exchange count. Take half if we are supporting both roles. */ @@ -751,7 +752,7 @@ isp_init(ispsoftc_t *isp) else icbp->icb_xchgcnt = isp->isp_maxcmds; } - +#endif ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0; icbp->icb_hardaddr = fcp->isp_loopid; From owner-svn-src-all@freebsd.org Sun Nov 22 05:47:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D404547DC98; Sun, 22 Nov 2020 05:47:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CdzpB5dVDz4bcJ; Sun, 22 Nov 2020 05:47:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9BA815432; Sun, 22 Nov 2020 05:47:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AM5lkDs078013; Sun, 22 Nov 2020 05:47:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AM5lkOG078011; Sun, 22 Nov 2020 05:47:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011220547.0AM5lkOG078011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 22 Nov 2020 05:47:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367930 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367930 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 05:47:46 -0000 Author: kevans Date: Sun Nov 22 05:47:45 2020 New Revision: 367930 URL: https://svnweb.freebsd.org/changeset/base/367930 Log: [2/2] _umtx_op: introduce 32-bit/i386 flags for operations This patch takes advantage of the consolidation that happened to provide two flags that can be used with the native _umtx_op(2): UMTX_OP___32BIT and UMTX_OP__I386. UMTX_OP__32BIT iindicates that we are being provided with 32-bit structures. Note that this flag alone indicates a 64bit time_t, since this is the majority case. UMTX_OP__I386 has been provided so that we can emulate i386 as well, regardless of whether the host is amd64 or not. Both imply a different set of copyops in sysumtx_op. freebsd32__umtx_op simply ignores the flags, since it's already doing a 32-bit operation and it's unlikely we'll be running an emulator under compat32. Future work could consider it, but the author sees little benefit. This will be used by qemu-bsd-user to pass on all _umtx_op calls to the native interface as long as the host/target endianness matches, effectively eliminating most if not all of the remaining unresolved deadlocks for most. This version changed a fair amount from what was under review, mostly in response to refactoring of the prereq reorganization and battle-testing it with qemu-bsd-user. The main changes are as follows: 1.) The i386 flag got renamed to omit '32BIT' since this is redundant. 2.) The flags are now properly handled on 32-bit platforms to emulate other 32-bit platforms. 3.) Robust list handling was fixed, and the 32-bit functionality that was previously gated by COMPAT_FREEBSD32 is now unconditional. 4.) Robust list handling was also improved, including the error reported when a process has already registered 32-bit ABI lists and also detecting if native robust lists have already been registered. Both scenarios now return EBUSY rather than EINVAL, because the input is technically valid but we're too busy with another ABI's lists. libsysdecode/kdump/truss support will go into review soon-ish, along with the associated manpage update. Reviewed by: kib (earlier version) MFC after: 3 weeks Modified: head/sys/kern/kern_umtx.c head/sys/sys/umtx.h Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Sun Nov 22 05:42:52 2020 (r367929) +++ head/sys/kern/kern_umtx.c Sun Nov 22 05:47:45 2020 (r367930) @@ -75,8 +75,8 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef COMPAT_FREEBSD32 #include +#ifdef COMPAT_FREEBSD32 #include #endif @@ -232,7 +232,6 @@ struct umtx_copyops { const bool compat32; }; -#ifdef COMPAT_FREEBSD32 struct umtx_time32 { struct timespec32 _timeout; uint32_t _flags; @@ -257,7 +256,6 @@ struct umutex32 { _Static_assert(sizeof(struct umutex) == sizeof(struct umutex32), "umutex32"); _Static_assert(__offsetof(struct umutex, m_spare[0]) == __offsetof(struct umutex32, m_spare[0]), "m_spare32"); -#endif int umtx_shm_vnobj_persistent = 0; SYSCTL_INT(_kern_ipc, OID_AUTO, umtx_vnode_persistent, CTLFLAG_RWTUN, @@ -4167,6 +4165,15 @@ __umtx_op_robust_lists(struct thread *td, struct _umtx struct umtx_robust_lists_params rb; int error; + if (ops->compat32) { + if ((td->td_pflags2 & TDP2_COMPAT32RB) == 0 && + (td->td_rb_list != 0 || td->td_rbp_list != 0 || + td->td_rb_inact != 0)) + return (EBUSY); + } else if ((td->td_pflags2 & TDP2_COMPAT32RB) != 0) { + return (EBUSY); + } + bzero(&rb, sizeof(rb)); error = ops->copyin_robust_lists(uap->uaddr1, uap->val, &rb); if (error != 0) @@ -4174,8 +4181,6 @@ __umtx_op_robust_lists(struct thread *td, struct _umtx if (ops->compat32) td->td_pflags2 |= TDP2_COMPAT32RB; - else if ((td->td_pflags2 & TDP2_COMPAT32RB) != 0) - return (EINVAL); td->td_rb_list = rb.robust_list_offset; td->td_rbp_list = rb.robust_priv_list_offset; @@ -4183,11 +4188,70 @@ __umtx_op_robust_lists(struct thread *td, struct _umtx return (0); } -#ifdef COMPAT_FREEBSD32 +#if defined(__i386__) || defined(__amd64__) +/* + * Provide the standard 32-bit definitions for x86, since native/compat32 use a + * 32-bit time_t there. Other architectures just need the i386 definitions + * along with their standard compat32. + */ +struct timespecx32 { + int64_t tv_sec; + int32_t tv_nsec; +}; + +struct umtx_timex32 { + struct timespecx32 _timeout; + uint32_t _flags; + uint32_t _clockid; +}; + +#ifndef __i386__ +#define timespeci386 timespec32 +#define umtx_timei386 umtx_time32 +#endif +#else /* !__i386__ && !__amd64__ */ +/* 32-bit architectures can emulate i386, so define these almost everywhere. */ +struct timespeci386 { + int32_t tv_sec; + int32_t tv_nsec; +}; + +struct umtx_timei386 { + struct timespeci386 _timeout; + uint32_t _flags; + uint32_t _clockid; +}; + +#if defined(__LP64__) +#define timespecx32 timespec32 +#define umtx_timex32 umtx_time32 +#endif +#endif + +static int +umtx_copyin_robust_lists32(const void *uaddr, size_t size, + struct umtx_robust_lists_params *rbp) +{ + struct umtx_robust_lists_params_compat32 rb32; + int error; + + if (size > sizeof(rb32)) + return (EINVAL); + bzero(&rb32, sizeof(rb32)); + error = copyin(uaddr, &rb32, size); + if (error != 0) + return (error); + CP(rb32, *rbp, robust_list_offset); + CP(rb32, *rbp, robust_priv_list_offset); + CP(rb32, *rbp, robust_inact_offset); + return (0); +} + +#ifndef __i386__ static inline int -umtx_copyin_timeout32(const void *uaddr, struct timespec *tsp) +umtx_copyin_timeouti386(const void *uaddr, struct timespec *tsp) { - struct timespec32 ts32; + struct timespeci386 ts32; int error; error = copyin(uaddr, &ts32, sizeof(ts32)); @@ -4205,9 +4269,9 @@ umtx_copyin_timeout32(const void *uaddr, struct timesp } static inline int -umtx_copyin_umtx_time32(const void *uaddr, size_t size, struct _umtx_time *tp) +umtx_copyin_umtx_timei386(const void *uaddr, size_t size, struct _umtx_time *tp) { - struct umtx_time32 t32; + struct umtx_timei386 t32; int error; t32._clockid = CLOCK_REALTIME; @@ -4228,28 +4292,73 @@ umtx_copyin_umtx_time32(const void *uaddr, size_t size } static int -umtx_copyin_robust_lists32(const void *uaddr, size_t size, - struct umtx_robust_lists_params *rbp) +umtx_copyout_timeouti386(void *uaddr, size_t sz, struct timespec *tsp) { - struct umtx_robust_lists_params_compat32 rb32; + struct timespeci386 remain32 = { + .tv_sec = tsp->tv_sec, + .tv_nsec = tsp->tv_nsec, + }; + + /* + * Should be guaranteed by the caller, sz == uaddr1 - sizeof(_umtx_time) + * and we're only called if sz >= sizeof(timespec) as supplied in the + * copyops. + */ + KASSERT(sz >= sizeof(remain32), + ("umtx_copyops specifies incorrect sizes")); + + return (copyout(&remain32, uaddr, sizeof(remain32))); +} +#endif /* !__i386__ */ + +#if defined(__i386__) || defined(__LP64__) +static inline int +umtx_copyin_timeoutx32(const void *uaddr, struct timespec *tsp) +{ + struct timespecx32 ts32; int error; - if (size > sizeof(rb32)) - return (EINVAL); - bzero(&rb32, sizeof(rb32)); - error = copyin(uaddr, &rb32, size); + error = copyin(uaddr, &ts32, sizeof(ts32)); + if (error == 0) { + if (ts32.tv_sec < 0 || + ts32.tv_nsec >= 1000000000 || + ts32.tv_nsec < 0) + error = EINVAL; + else { + CP(ts32, *tsp, tv_sec); + CP(ts32, *tsp, tv_nsec); + } + } + return (error); +} + +static inline int +umtx_copyin_umtx_timex32(const void *uaddr, size_t size, struct _umtx_time *tp) +{ + struct umtx_timex32 t32; + int error; + + t32._clockid = CLOCK_REALTIME; + t32._flags = 0; + if (size <= sizeof(t32._timeout)) + error = copyin(uaddr, &t32._timeout, sizeof(t32._timeout)); + else + error = copyin(uaddr, &t32, sizeof(t32)); if (error != 0) return (error); - CP(rb32, *rbp, robust_list_offset); - CP(rb32, *rbp, robust_priv_list_offset); - CP(rb32, *rbp, robust_inact_offset); + if (t32._timeout.tv_sec < 0 || + t32._timeout.tv_nsec >= 1000000000 || t32._timeout.tv_nsec < 0) + return (EINVAL); + TS_CP(t32, *tp, _timeout); + CP(t32, *tp, _flags); + CP(t32, *tp, _clockid); return (0); } static int -umtx_copyout_timeout32(void *uaddr, size_t sz, struct timespec *tsp) +umtx_copyout_timeoutx32(void *uaddr, size_t sz, struct timespec *tsp) { - struct timespec32 remain32 = { + struct timespecx32 remain32 = { .tv_sec = tsp->tv_sec, .tv_nsec = tsp->tv_nsec, }; @@ -4264,7 +4373,7 @@ umtx_copyout_timeout32(void *uaddr, size_t sz, struct return (copyout(&remain32, uaddr, sizeof(remain32))); } -#endif /* COMPAT_FREEBSD32 */ +#endif /* __i386__ || __LP64__ */ typedef int (*_umtx_op_func)(struct thread *td, struct _umtx_op_args *uap, const struct umtx_copyops *umtx_ops); @@ -4313,25 +4422,48 @@ static const struct umtx_copyops umtx_native_ops = { .umtx_time_sz = sizeof(struct _umtx_time), }; -#ifdef COMPAT_FREEBSD32 -const struct umtx_copyops umtx_native_ops32 = { - .copyin_timeout = umtx_copyin_timeout32, - .copyin_umtx_time = umtx_copyin_umtx_time32, +#ifndef __i386__ +static const struct umtx_copyops umtx_native_opsi386 = { + .copyin_timeout = umtx_copyin_timeouti386, + .copyin_umtx_time = umtx_copyin_umtx_timei386, .copyin_robust_lists = umtx_copyin_robust_lists32, - .copyout_timeout = umtx_copyout_timeout32, - .timespec_sz = sizeof(struct timespec32), - .umtx_time_sz = sizeof(struct umtx_time32), + .copyout_timeout = umtx_copyout_timeouti386, + .timespec_sz = sizeof(struct timespeci386), + .umtx_time_sz = sizeof(struct umtx_timei386), .compat32 = true, }; #endif +#if defined(__i386__) || defined(__LP64__) +/* i386 can emulate other 32-bit archs, too! */ +static const struct umtx_copyops umtx_native_opsx32 = { + .copyin_timeout = umtx_copyin_timeoutx32, + .copyin_umtx_time = umtx_copyin_umtx_timex32, + .copyin_robust_lists = umtx_copyin_robust_lists32, + .copyout_timeout = umtx_copyout_timeoutx32, + .timespec_sz = sizeof(struct timespecx32), + .umtx_time_sz = sizeof(struct umtx_timex32), + .compat32 = true, +}; + +#ifdef COMPAT_FREEBSD32 +#ifdef __amd64__ +#define umtx_native_ops32 umtx_native_opsi386 +#else +#define umtx_native_ops32 umtx_native_opsx32 +#endif +#endif /* COMPAT_FREEBSD32 */ +#endif /* __i386__ || __LP64__ */ + +#define UMTX_OP__FLAGS (UMTX_OP__32BIT | UMTX_OP__I386) + static int kern__umtx_op(struct thread *td, void *obj, int op, unsigned long val, void *uaddr1, void *uaddr2, const struct umtx_copyops *ops) { struct _umtx_op_args uap = { .obj = obj, - .op = op, + .op = op & ~UMTX_OP__FLAGS, .val = val, .uaddr1 = uaddr1, .uaddr2 = uaddr2 @@ -4345,9 +4477,27 @@ kern__umtx_op(struct thread *td, void *obj, int op, un int sys__umtx_op(struct thread *td, struct _umtx_op_args *uap) { + static const struct umtx_copyops *umtx_ops; + umtx_ops = &umtx_native_ops; +#ifdef __LP64__ + if ((uap->op & (UMTX_OP__32BIT | UMTX_OP__I386)) != 0) { + if ((uap->op & UMTX_OP__I386) != 0) + umtx_ops = &umtx_native_opsi386; + else + umtx_ops = &umtx_native_opsx32; + } +#elif !defined(__i386__) + /* We consider UMTX_OP__32BIT a nop on !i386 ILP32. */ + if ((uap->op & UMTX_OP__I386) != 0) + umtx_ops = &umtx_native_opsi386; +#else + /* Likewise, UMTX_OP__I386 is a nop on i386. */ + if ((uap->op & UMTX_OP__32BIT) != 0) + umtx_ops = &umtx_native_opsx32; +#endif return (kern__umtx_op(td, uap->obj, uap->op, uap->val, uap->uaddr1, - uap->uaddr2, &umtx_native_ops)); + uap->uaddr2, umtx_ops)); } #ifdef COMPAT_FREEBSD32 @@ -4435,19 +4585,14 @@ static int umtx_read_uptr(struct thread *td, uintptr_t ptr, uintptr_t *res, bool compat32) { u_long res1; -#ifdef COMPAT_FREEBSD32 uint32_t res32; -#endif int error; -#ifdef COMPAT_FREEBSD32 if (compat32) { error = fueword32((void *)ptr, &res32); if (error == 0) res1 = res32; - } else -#endif - { + } else { error = fueword((void *)ptr, &res1); } if (error == 0) @@ -4461,15 +4606,14 @@ static void umtx_read_rb_list(struct thread *td, struct umutex *m, uintptr_t *rb_list, bool compat32) { -#ifdef COMPAT_FREEBSD32 struct umutex32 m32; if (compat32) { memcpy(&m32, m, sizeof(m32)); *rb_list = m32.m_rb_lnk; - } else -#endif + } else { *rb_list = m->m_rb_lnk; + } } static int Modified: head/sys/sys/umtx.h ============================================================================== --- head/sys/sys/umtx.h Sun Nov 22 05:42:52 2020 (r367929) +++ head/sys/sys/umtx.h Sun Nov 22 05:47:45 2020 (r367930) @@ -101,6 +101,13 @@ #define UMTX_OP_SHM 25 #define UMTX_OP_ROBUST_LISTS 26 +/* + * Flags for ops; the double-underbar convention must be maintained for future + * additions for the sake of libsysdecode. + */ +#define UMTX_OP__I386 0x40000000 +#define UMTX_OP__32BIT 0x80000000 + /* Flags for UMTX_OP_CV_WAIT */ #define CVWAIT_CHECK_UNPARKING 0x01 #define CVWAIT_ABSTIME 0x02 From owner-svn-src-all@freebsd.org Sun Nov 22 05:50:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A32647D857 for ; Sun, 22 Nov 2020 05:50:00 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cdzrm3tfdz4bgX for ; Sun, 22 Nov 2020 05:50:00 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 6ED401975 for ; Sun, 22 Nov 2020 05:50:00 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f169.google.com with SMTP id u4so13263167qkk.10 for ; Sat, 21 Nov 2020 21:50:00 -0800 (PST) X-Gm-Message-State: AOAM531r2CdX33AbzxI1atwpDWKCpzsM2g5oFL0qtx4aDZaW3Las+AjC lEcnULM002MTt+Pj6do0Mv8Qienemq3BPIIqjrE= X-Received: by 2002:a05:620a:12ea:: with SMTP id f10mt9551263qkl.430.1606024200055; Sat, 21 Nov 2020 21:50:00 -0800 (PST) MIME-Version: 1.0 References: <202011220547.0AM5lkOG078011@repo.freebsd.org> In-Reply-To: <202011220547.0AM5lkOG078011@repo.freebsd.org> From: Kyle Evans Date: Sat, 21 Nov 2020 23:49:49 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r367930 - in head/sys: kern sys Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 05:50:00 -0000 On Sat, Nov 21, 2020 at 11:47 PM Kyle Evans wrote: > > Author: kevans > Date: Sun Nov 22 05:47:45 2020 > New Revision: 367930 > URL: https://svnweb.freebsd.org/changeset/base/367930 > > Log: > [2/2] _umtx_op: introduce 32-bit/i386 flags for operations > > This patch takes advantage of the consolidation that happened to provide two > flags that can be used with the native _umtx_op(2): UMTX_OP___32BIT and > UMTX_OP__I386. > > UMTX_OP__32BIT iindicates that we are being provided with 32-bit structures. > Note that this flag alone indicates a 64bit time_t, since this is the > majority case. > > UMTX_OP__I386 has been provided so that we can emulate i386 as well, > regardless of whether the host is amd64 or not. > > Both imply a different set of copyops in sysumtx_op. freebsd32__umtx_op > simply ignores the flags, since it's already doing a 32-bit operation and > it's unlikely we'll be running an emulator under compat32. Future work > could consider it, but the author sees little benefit. > > This will be used by qemu-bsd-user to pass on all _umtx_op calls to the > native interface as long as the host/target endianness matches, effectively > eliminating most if not all of the remaining unresolved deadlocks for most. > > This version changed a fair amount from what was under review, mostly in > response to refactoring of the prereq reorganization and battle-testing > it with qemu-bsd-user. The main changes are as follows: > > 1.) The i386 flag got renamed to omit '32BIT' since this is redundant. > 2.) The flags are now properly handled on 32-bit platforms to emulate other > 32-bit platforms. > 3.) Robust list handling was fixed, and the 32-bit functionality that was > previously gated by COMPAT_FREEBSD32 is now unconditional. > 4.) Robust list handling was also improved, including the error reported > when a process has already registered 32-bit ABI lists and also > detecting if native robust lists have already been registered. Both > scenarios now return EBUSY rather than EINVAL, because the input is > technically valid but we're too busy with another ABI's lists. > > libsysdecode/kdump/truss support will go into review soon-ish, along with > the associated manpage update. > > Reviewed by: kib (earlier version) > MFC after: 3 weeks > Differential Revision: https://reviews.freebsd.org/D27223 From owner-svn-src-all@freebsd.org Sun Nov 22 07:55:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C32362E82A3; Sun, 22 Nov 2020 07:55:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cf2dr2xFHz4hMH; Sun, 22 Nov 2020 07:55:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 0AM7tSTi049974 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 22 Nov 2020 09:55:31 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 0AM7tSTi049974 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 0AM7tS0L049973; Sun, 22 Nov 2020 09:55:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 22 Nov 2020 09:55:28 +0200 From: Konstantin Belousov To: Kyle Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r367928 - in head/sys: compat/freebsd32 kern sys Message-ID: References: <202011220534.0AM5Yp4u071733@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202011220534.0AM5Yp4u071733@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4Cf2dr2xFHz4hMH X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 07:55:44 -0000 On Sun, Nov 22, 2020 at 05:34:51AM +0000, Kyle Evans wrote: > Author: kevans > Date: Sun Nov 22 05:34:51 2020 > New Revision: 367928 > URL: https://svnweb.freebsd.org/changeset/base/367928 > > Log: > _umtx_op: move compat32 definitions back in > > These are reasonably compact, and a future commit will blur the compat32 > lines by supporting 32-bit operations with the native _umtx_op. I do not mind much about placement of the compat32 syscall stubs, but I did suggested and liked move of the compat32 structures definitions into freebsd32.h. They are actually useful that way, at least allowing me to write some (private) tests in the past. From owner-svn-src-all@freebsd.org Sun Nov 22 09:10:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37E3C2EA08D; Sun, 22 Nov 2020 09:10:13 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cf4Hn0gddz4ld9; Sun, 22 Nov 2020 09:10:13 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0507B17D81; Sun, 22 Nov 2020 09:10:13 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AM9ACLO001536; Sun, 22 Nov 2020 09:10:12 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AM9ACxU001534; Sun, 22 Nov 2020 09:10:12 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202011220910.0AM9ACxU001534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 22 Nov 2020 09:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367931 - head/tools/tools/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/tools/tools/netmap X-SVN-Commit-Revision: 367931 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 09:10:13 -0000 Author: vmaffione Date: Sun Nov 22 09:10:12 2020 New Revision: 367931 URL: https://svnweb.freebsd.org/changeset/base/367931 Log: netmap: bridge: switch to libnetmap Use the newer libnetmap (included in base) rather than the older nm_open()/nm_close() defined in netmap_user.h Modified: head/tools/tools/netmap/Makefile head/tools/tools/netmap/bridge.c Modified: head/tools/tools/netmap/Makefile ============================================================================== --- head/tools/tools/netmap/Makefile Sun Nov 22 05:47:45 2020 (r367930) +++ head/tools/tools/netmap/Makefile Sun Nov 22 09:10:12 2020 (r367931) @@ -11,7 +11,7 @@ MAN= .include .include -LDFLAGS += -lpthread +LDFLAGS += -lpthread -lnetmap .ifdef WITHOUT_PCAP CFLAGS += -DNO_PCAP .else @@ -27,7 +27,7 @@ pkt-gen: pkt-gen.o $(CC) $(CFLAGS) -o pkt-gen pkt-gen.o $(LDFLAGS) bridge: bridge.o - $(CC) $(CFLAGS) -o bridge bridge.o + $(CC) $(CFLAGS) -o bridge bridge.o $(LDFLAGS) nmreplay: nmreplay.o $(CC) $(CFLAGS) -o nmreplay nmreplay.o $(LDFLAGS) Modified: head/tools/tools/netmap/bridge.c ============================================================================== --- head/tools/tools/netmap/bridge.c Sun Nov 22 05:47:45 2020 (r367930) +++ head/tools/tools/netmap/bridge.c Sun Nov 22 09:10:12 2020 (r367931) @@ -10,9 +10,12 @@ */ #include -#define NETMAP_WITH_LIBS -#include #include +#include +#include +#include +#include +#include static int verbose = 0; @@ -32,7 +35,7 @@ sigint_h(int sig) * how many packets on this set of queues ? */ static int -pkt_queued(struct nm_desc *d, int tx) +pkt_queued(struct nmport_d *d, int tx) { u_int i, tot = 0; @@ -61,8 +64,8 @@ process_rings(struct netmap_ring *rxring, struct netma if (rxring->flags || txring->flags) D("%s rxflags %x txflags %x", msg, rxring->flags, txring->flags); - j = rxring->cur; /* RX */ - k = txring->cur; /* TX */ + j = rxring->head; /* RX */ + k = txring->head; /* TX */ m = nm_ring_space(rxring); if (m < limit) limit = m; @@ -115,11 +118,11 @@ process_rings(struct netmap_ring *rxring, struct netma /* move packts from src to destination */ static int -move(struct nm_desc *src, struct nm_desc *dst, u_int limit) +move(struct nmport_d *src, struct nmport_d *dst, u_int limit) { struct netmap_ring *txring, *rxring; u_int m = 0, si = src->first_rx_ring, di = dst->first_tx_ring; - const char *msg = (src->req.nr_flags == NR_REG_SW) ? + const char *msg = (src->reg.nr_flags == NR_REG_SW) ? "host->net" : "net->host"; while (si <= src->last_rx_ring && di <= dst->last_tx_ring) { @@ -175,7 +178,7 @@ main(int argc, char **argv) struct pollfd pollfd[2]; int ch; u_int burst = 1024, wait_link = 4; - struct nm_desc *pa = NULL, *pb = NULL; + struct nmport_d *pa = NULL, *pb = NULL; char *ifa = NULL, *ifb = NULL; char ifabuf[64] = { 0 }; int loopback = 0; @@ -252,16 +255,16 @@ main(int argc, char **argv) } else { /* two different interfaces. Take all rings on if1 */ } - pa = nm_open(ifa, NULL, 0, NULL); + pa = nmport_open(ifa); if (pa == NULL) { D("cannot open %s", ifa); return (1); } /* try to reuse the mmap() of the first interface, if possible */ - pb = nm_open(ifb, NULL, NM_OPEN_NO_MMAP, pa); + pb = nmport_open(ifb); if (pb == NULL) { D("cannot open %s", ifb); - nm_close(pa); + nmport_close(pa); return (1); } zerocopy = zerocopy && (pa->mem == pb->mem); @@ -275,8 +278,8 @@ main(int argc, char **argv) D("Wait %d secs for link to come up...", wait_link); sleep(wait_link); D("Ready to go, %s 0x%x/%d <-> %s 0x%x/%d.", - pa->req.nr_name, pa->first_rx_ring, pa->req.nr_rx_rings, - pb->req.nr_name, pb->first_rx_ring, pb->req.nr_rx_rings); + pa->hdr.nr_name, pa->first_rx_ring, pa->reg.nr_rx_rings, + pb->hdr.nr_name, pb->first_rx_ring, pb->reg.nr_rx_rings); /* main loop */ signal(SIGINT, sigint_h); @@ -320,12 +323,12 @@ main(int argc, char **argv) pollfd[0].events, pollfd[0].revents, pkt_queued(pa, 0), - NETMAP_RXRING(pa->nifp, pa->cur_rx_ring)->cur, + NETMAP_RXRING(pa->nifp, pa->cur_rx_ring)->head, pkt_queued(pa, 1), pollfd[1].events, pollfd[1].revents, pkt_queued(pb, 0), - NETMAP_RXRING(pb->nifp, pb->cur_rx_ring)->cur, + NETMAP_RXRING(pb->nifp, pb->cur_rx_ring)->head, pkt_queued(pb, 1) ); if (ret < 0) @@ -349,8 +352,8 @@ main(int argc, char **argv) /* We don't need ioctl(NIOCTXSYNC) on the two file descriptors here, * kernel will txsync on next poll(). */ } - nm_close(pb); - nm_close(pa); + nmport_close(pb); + nmport_close(pa); return (0); } From owner-svn-src-all@freebsd.org Sun Nov 22 09:20:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 517A22EA911; Sun, 22 Nov 2020 09:20:09 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cf4WF1qkQz4mNF; Sun, 22 Nov 2020 09:20:09 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 319A7179EB; Sun, 22 Nov 2020 09:20:09 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AM9K9PL008141; Sun, 22 Nov 2020 09:20:09 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AM9K9E5008140; Sun, 22 Nov 2020 09:20:09 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202011220920.0AM9K9E5008140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 22 Nov 2020 09:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367932 - head/tools/tools/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/tools/tools/netmap X-SVN-Commit-Revision: 367932 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 09:20:09 -0000 Author: vmaffione Date: Sun Nov 22 09:20:08 2020 New Revision: 367932 URL: https://svnweb.freebsd.org/changeset/base/367932 Log: netmap: pkt-gen: switch to libnetmap Use the newer libnetmap (included in base) rather than the older nm_open()/nm_close() defined in netmap_user.h Modified: head/tools/tools/netmap/pkt-gen.c Modified: head/tools/tools/netmap/pkt-gen.c ============================================================================== --- head/tools/tools/netmap/pkt-gen.c Sun Nov 22 09:10:12 2020 (r367931) +++ head/tools/tools/netmap/pkt-gen.c Sun Nov 22 09:20:08 2020 (r367932) @@ -38,36 +38,40 @@ */ #define _GNU_SOURCE /* for CPU_SET() */ -#include -#define NETMAP_WITH_LIBS -#include - -#include // isprint() -#include // sysconf() -#include #include /* ntohs */ -#ifndef _WIN32 -#include /* sysctl */ -#endif +#include +#include // isprint() +#include +#include #include /* getifaddrs */ +#include +#include #include #include #include -#include #include +#include +#ifndef NO_PCAP +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#if !defined(_WIN32) && !defined(linux) +#include /* sysctl */ +#endif +#include +#include // sysconf() #ifdef linux #define IPV6_VERSION 0x60 #define IPV6_DEFHLIM 64 #endif -#include -#include -#include - -#ifndef NO_PCAP -#include -#endif - #include "ctrs.h" static void usage(int); @@ -236,7 +240,8 @@ struct mac_range { }; /* ifname can be netmap:foo-xxxx */ -#define MAX_IFNAMELEN 64 /* our buffer for ifname */ +#define MAX_IFNAMELEN 512 /* our buffer for ifname */ +//#define MAX_PKTSIZE 1536 #define MAX_PKTSIZE MAX_BODYSIZE /* XXX: + IP_HDR + ETH_HDR */ /* compact timestamp to fit into 60 byte packet. (enough to obtain RTT) */ @@ -288,7 +293,8 @@ struct glob_arg { int affinity; int main_fd; - struct nm_desc *nmd; + struct nmport_d *nmd; + uint32_t orig_mode; int report_interval; /* milliseconds between prints */ void *(*td_body)(void *); int td_type; @@ -322,7 +328,7 @@ struct targ { int completed; int cancel; int fd; - struct nm_desc *nmd; + struct nmport_d *nmd; /* these ought to be volatile, but they are * only sampled and errors should not accumulate */ @@ -515,17 +521,21 @@ extract_mac_range(struct mac_range *r) static int get_if_mtu(const struct glob_arg *g) { - char ifname[IFNAMSIZ]; struct ifreq ifreq; int s, ret; + const char *ifname = g->nmd->hdr.nr_name; + size_t len; - if (!strncmp(g->ifname, "netmap:", 7) && !strchr(g->ifname, '{') - && !strchr(g->ifname, '}')) { - /* Parse the interface name and ask the kernel for the - * MTU value. */ - strncpy(ifname, g->ifname+7, IFNAMSIZ-1); - ifname[strcspn(ifname, "-*^{}/@")] = '\0'; + if (!strncmp(g->ifname, "netmap:", 7) && !strchr(ifname, '{') + && !strchr(ifname, '}')) { + len = strlen(ifname); + + if (len > IFNAMSIZ) { + D("'%s' too long, cannot ask for MTU", ifname); + return -1; + } + s = socket(AF_INET, SOCK_DGRAM, 0); if (s < 0) { D("socket() failed: %s", strerror(errno)); @@ -533,13 +543,15 @@ get_if_mtu(const struct glob_arg *g) } memset(&ifreq, 0, sizeof(ifreq)); - strncpy(ifreq.ifr_name, ifname, IFNAMSIZ); + memcpy(ifreq.ifr_name, ifname, len); ret = ioctl(s, SIOCGIFMTU, &ifreq); if (ret) { D("ioctl(SIOCGIFMTU) failed: %s", strerror(errno)); } + close(s); + return ifreq.ifr_mtu; } @@ -620,7 +632,7 @@ system_ncpus(void) * and #rx-rings. */ static int -parse_nmr_config(const char* conf, struct nmreq *nmr) +parse_nmr_config(const char* conf, struct nmreq_register *nmr) { char *w, *tok; int i, v; @@ -654,9 +666,7 @@ parse_nmr_config(const char* conf, struct nmreq *nmr) nmr->nr_tx_rings, nmr->nr_tx_slots, nmr->nr_rx_rings, nmr->nr_rx_slots); free(w); - return (nmr->nr_tx_rings || nmr->nr_tx_slots || - nmr->nr_rx_rings || nmr->nr_rx_slots) ? - NM_OPEN_RING_CFG : 0; + return 0; } @@ -1108,20 +1118,22 @@ initialize_packet(struct targ *targ) static void get_vnet_hdr_len(struct glob_arg *g) { - struct nmreq req; + struct nmreq_header hdr; + struct nmreq_port_hdr ph; int err; - memset(&req, 0, sizeof(req)); - bcopy(g->nmd->req.nr_name, req.nr_name, sizeof(req.nr_name)); - req.nr_version = NETMAP_API; - req.nr_cmd = NETMAP_VNET_HDR_GET; - err = ioctl(g->main_fd, NIOCREGIF, &req); + hdr = g->nmd->hdr; /* copy name and version */ + hdr.nr_reqtype = NETMAP_REQ_PORT_HDR_GET; + hdr.nr_options = 0; + memset(&ph, 0, sizeof(ph)); + hdr.nr_body = (uintptr_t)&ph; + err = ioctl(g->main_fd, NIOCCTRL, &hdr); if (err) { D("Unable to get virtio-net header length"); return; } - g->virt_header = req.nr_arg1; + g->virt_header = ph.nr_hdr_len; if (g->virt_header) { D("Port requires virtio-net header, length = %d", g->virt_header); @@ -1132,17 +1144,18 @@ static void set_vnet_hdr_len(struct glob_arg *g) { int err, l = g->virt_header; - struct nmreq req; + struct nmreq_header hdr; + struct nmreq_port_hdr ph; if (l == 0) return; - memset(&req, 0, sizeof(req)); - bcopy(g->nmd->req.nr_name, req.nr_name, sizeof(req.nr_name)); - req.nr_version = NETMAP_API; - req.nr_cmd = NETMAP_BDG_VNET_HDR; - req.nr_arg1 = l; - err = ioctl(g->main_fd, NIOCREGIF, &req); + hdr = g->nmd->hdr; /* copy name and version */ + hdr.nr_reqtype = NETMAP_REQ_PORT_HDR_SET; + hdr.nr_options = 0; + memset(&ph, 0, sizeof(ph)); + hdr.nr_body = (uintptr_t)&ph; + err = ioctl(g->main_fd, NIOCCTRL, &hdr); if (err) { D("Unable to set virtio-net header length %d", l); } @@ -2480,7 +2493,7 @@ usage(int errcode) exit(errcode); } -static void +static int start_threads(struct glob_arg *g) { int i; @@ -2500,31 +2513,43 @@ start_threads(struct glob_arg *g) { memcpy(t->seed, &seed, sizeof(t->seed)); if (g->dev_type == DEV_NETMAP) { - struct nm_desc nmd = *g->nmd; /* copy, we overwrite ringid */ - uint64_t nmd_flags = 0; - nmd.self = &nmd; + int m = -1; + /* + * if the user wants both HW and SW rings, we need to + * know when to switch from NR_REG_ONE_NIC to NR_REG_ONE_SW + */ + if (g->orig_mode == NR_REG_NIC_SW) { + m = (g->td_type == TD_TYPE_RECEIVER ? + g->nmd->reg.nr_rx_rings : + g->nmd->reg.nr_tx_rings); + } + if (i > 0) { + int j; /* the first thread uses the fd opened by the main * thread, the other threads re-open /dev/netmap */ - if (g->nthreads > 1) { - nmd.req.nr_flags = - g->nmd->req.nr_flags & ~NR_REG_MASK; - nmd.req.nr_flags |= NR_REG_ONE_NIC; - nmd.req.nr_ringid = i; + t->nmd = nmport_clone(g->nmd); + if (t->nmd == NULL) + return -1; + + j = i; + if (m > 0 && j >= m) { + /* switch to the software rings */ + t->nmd->reg.nr_mode = NR_REG_ONE_SW; + j -= m; } + t->nmd->reg.nr_ringid = j & NETMAP_RING_MASK; /* Only touch one of the rings (rx is already ok) */ if (g->td_type == TD_TYPE_RECEIVER) - nmd_flags |= NETMAP_NO_TX_POLL; + t->nmd->reg.nr_flags |= NETMAP_NO_TX_POLL; /* register interface. Override ifname and ringid etc. */ - t->nmd = nm_open(t->g->ifname, NULL, nmd_flags | - NM_OPEN_IFNAME | NM_OPEN_NO_MMAP, &nmd); - if (t->nmd == NULL) { - D("Unable to open %s: %s", - t->g->ifname, strerror(errno)); - continue; + if (nmport_open_desc(t->nmd) < 0) { + nmport_undo_prepare(t->nmd); + t->nmd = NULL; + return -1; } } else { t->nmd = g->nmd; @@ -2556,6 +2581,7 @@ start_threads(struct glob_arg *g) { t->used = 0; } } + return 0; } static void @@ -2655,7 +2681,7 @@ main_thread(struct glob_arg *g) if (targs[i].used) pthread_join(targs[i].thread, NULL); /* blocking */ if (g->dev_type == DEV_NETMAP) { - nm_close(targs[i].nmd); + nmport_close(targs[i].nmd); targs[i].nmd = NULL; } else { close(targs[i].fd); @@ -3078,21 +3104,14 @@ main(int arc, char **argv) } else if (g.dummy_send) { /* but DEV_NETMAP */ D("using a dummy send routine"); } else { - struct nm_desc base_nmd; - char errmsg[MAXERRMSG]; - u_int flags; + g.nmd = nmport_prepare(g.ifname); + if (g.nmd == NULL) + goto out; - bzero(&base_nmd, sizeof(base_nmd)); + parse_nmr_config(g.nmr_config, &g.nmd->reg); - parse_nmr_config(g.nmr_config, &base_nmd.req); + g.nmd->reg.nr_flags |= NR_ACCEPT_VNET_HDR; - base_nmd.req.nr_flags |= NR_ACCEPT_VNET_HDR; - - if (nm_parse(g.ifname, &base_nmd, errmsg) < 0) { - D("Invalid name '%s': %s", g.ifname, errmsg); - goto out; - } - /* * Open the netmap device using nm_open(). * @@ -3100,20 +3119,25 @@ main(int arc, char **argv) * which in turn may take some time for the PHY to * reconfigure. We do the open here to have time to reset. */ - flags = NM_OPEN_IFNAME | NM_OPEN_ARG1 | NM_OPEN_ARG2 | - NM_OPEN_ARG3 | NM_OPEN_RING_CFG; + g.orig_mode = g.nmd->reg.nr_mode; if (g.nthreads > 1) { - base_nmd.req.nr_flags &= ~NR_REG_MASK; - base_nmd.req.nr_flags |= NR_REG_ONE_NIC; - base_nmd.req.nr_ringid = 0; + switch (g.orig_mode) { + case NR_REG_ALL_NIC: + case NR_REG_NIC_SW: + g.nmd->reg.nr_mode = NR_REG_ONE_NIC; + break; + case NR_REG_SW: + g.nmd->reg.nr_mode = NR_REG_ONE_SW; + break; + default: + break; + } + g.nmd->reg.nr_ringid = 0; } - g.nmd = nm_open(g.ifname, NULL, flags, &base_nmd); - if (g.nmd == NULL) { - D("Unable to open %s: %s", g.ifname, strerror(errno)); + if (nmport_open_desc(g.nmd) < 0) goto out; - } g.main_fd = g.nmd->fd; - D("mapped %luKB at %p", (unsigned long)(g.nmd->req.nr_memsize>>10), + ND("mapped %luKB at %p", (unsigned long)(g.nmd->req.nr_memsize>>10), g.nmd->mem); if (g.virt_header) { @@ -3128,9 +3152,9 @@ main(int arc, char **argv) /* get num of queues in tx or rx */ if (g.td_type == TD_TYPE_SENDER) - devqueues = g.nmd->req.nr_tx_rings; + devqueues = g.nmd->reg.nr_tx_rings + g.nmd->reg.nr_host_tx_rings; else - devqueues = g.nmd->req.nr_rx_rings; + devqueues = g.nmd->reg.nr_rx_rings + g.nmd->reg.nr_host_rx_rings; /* validate provided nthreads. */ if (g.nthreads < 1 || g.nthreads > devqueues) { @@ -3150,17 +3174,17 @@ main(int arc, char **argv) if (verbose) { struct netmap_if *nifp = g.nmd->nifp; - struct nmreq *req = &g.nmd->req; + struct nmreq_register *req = &g.nmd->reg; - D("nifp at offset %d, %d tx %d rx region %d", + D("nifp at offset %"PRIu64", %d tx %d rx region %d", req->nr_offset, req->nr_tx_rings, req->nr_rx_rings, - req->nr_arg2); - for (i = 0; i <= req->nr_tx_rings; i++) { + req->nr_mem_id); + for (i = 0; i < req->nr_tx_rings + req->nr_host_tx_rings; i++) { struct netmap_ring *ring = NETMAP_TXRING(nifp, i); D(" TX%d at 0x%p slots %d", i, (void *)((char *)ring - (char *)nifp), ring->num_slots); } - for (i = 0; i <= req->nr_rx_rings; i++) { + for (i = 0; i < req->nr_rx_rings + req->nr_host_rx_rings; i++) { struct netmap_ring *ring = NETMAP_RXRING(nifp, i); D(" RX%d at 0x%p slots %d", i, (void *)((char *)ring - (char *)nifp), ring->num_slots); @@ -3230,7 +3254,8 @@ out: if (pthread_sigmask(SIG_BLOCK, &ss, NULL) < 0) { D("failed to block SIGINT: %s", strerror(errno)); } - start_threads(&g); + if (start_threads(&g) < 0) + return 1; /* Install the handler and re-enable SIGINT for the main thread */ memset(&sa, 0, sizeof(sa)); sa.sa_handler = sigint_h; From owner-svn-src-all@freebsd.org Sun Nov 22 09:28:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 397DF2EABCD; Sun, 22 Nov 2020 09:28:51 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cf4jH0x3Sz4mjt; Sun, 22 Nov 2020 09:28:51 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EB1F180A6; Sun, 22 Nov 2020 09:28:51 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AM9SoYd014003; Sun, 22 Nov 2020 09:28:50 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AM9SorH014001; Sun, 22 Nov 2020 09:28:50 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202011220928.0AM9SorH014001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 22 Nov 2020 09:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367933 - head/tools/tools/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/tools/tools/netmap X-SVN-Commit-Revision: 367933 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 09:28:51 -0000 Author: vmaffione Date: Sun Nov 22 09:28:50 2020 New Revision: 367933 URL: https://svnweb.freebsd.org/changeset/base/367933 Log: netmap: lb: switch to libnetmap Use the newer libnetmap (included in base) rather than the older nm_open()/nm_close() defined in netmap_user.h MFC after: 3 days Modified: head/tools/tools/netmap/lb.c head/tools/tools/netmap/pkt_hash.c Modified: head/tools/tools/netmap/lb.c ============================================================================== --- head/tools/tools/netmap/lb.c Sun Nov 22 09:20:08 2020 (r367932) +++ head/tools/tools/netmap/lb.c Sun Nov 22 09:28:50 2020 (r367933) @@ -23,21 +23,22 @@ * SUCH DAMAGE. */ /* $FreeBSD$ */ -#include -#include #include -#include +#include #include +#include +#include /* htonl */ +#include +#include +#include +#include +#include +#include #include - -#define NETMAP_WITH_LIBS -#include +#include #include +#include -#include /* htonl */ - -#include - #include "pkt_hash.h" #include "ctrs.h" @@ -86,12 +87,12 @@ struct compact_ipv6_hdr { #define DEF_BATCH 2048 #define DEF_WAIT_LINK 2 #define DEF_STATS_INT 600 -#define BUF_REVOKE 100 +#define BUF_REVOKE 150 #define STAT_MSG_MAXSIZE 1024 static struct { - char ifname[MAX_IFNAMELEN]; - char base_name[MAX_IFNAMELEN]; + char ifname[MAX_IFNAMELEN + 1]; + char base_name[MAX_IFNAMELEN + 1]; int netmap_fd; uint16_t output_rings; uint16_t num_groups; @@ -173,7 +174,7 @@ struct port_des { unsigned int last_sync; uint32_t last_tail; struct overflow_queue *oq; - struct nm_desc *nmd; + struct nmport_d *nmd; struct netmap_ring *ring; struct group_des *group; }; @@ -375,7 +376,7 @@ free_buffers(void) D("added %d buffers to netmap free list", tot); for (i = 0; i < glob_arg.output_rings + 1; ++i) { - nm_close(ports[i].nmd); + nmport_close(ports[i].nmd); } } @@ -480,6 +481,28 @@ init_groups(void) g->last = 1; } + +/* To support packets that span multiple slots (NS_MOREFRAG) we + * need to make sure of the following: + * + * - all fragments of the same packet must go to the same output pipe + * - when dropping, all fragments of the same packet must be dropped + * + * For the former point we remember and reuse the last hash computed + * in each input ring, and only update it when NS_MOREFRAG was not + * set in the last received slot (this marks the start of a new packet). + * + * For the latter point, we only update the output ring head pointer + * when an entire packet has been forwarded. We keep a shadow_head + * pointer to know where to put the next partial fragment and, + * when the need to drop arises, we roll it back to head. + */ +struct morefrag { + uint16_t last_flag; /* for intput rings */ + uint32_t last_hash; /* for input rings */ + uint32_t shadow_head; /* for output rings */ +}; + /* push the packet described by slot rs to the group g. * This may cause other buffers to be pushed down the * chain headed by g. @@ -493,21 +516,28 @@ forward_packet(struct group_des *g, struct netmap_slot struct port_des *port = &g->ports[output_port]; struct netmap_ring *ring = port->ring; struct overflow_queue *q = port->oq; + struct morefrag *mf = (struct morefrag *)ring->sem; + uint16_t curmf = rs->flags & NS_MOREFRAG; /* Move the packet to the output pipe, unless there is * either no space left on the ring, or there is some * packet still in the overflow queue (since those must * take precedence over the new one) */ - if (ring->head != ring->tail && (q == NULL || oq_empty(q))) { - struct netmap_slot *ts = &ring->slot[ring->head]; + if (mf->shadow_head != ring->tail && (q == NULL || oq_empty(q))) { + struct netmap_slot *ts = &ring->slot[mf->shadow_head]; struct netmap_slot old_slot = *ts; ts->buf_idx = rs->buf_idx; ts->len = rs->len; - ts->flags |= NS_BUF_CHANGED; + ts->flags = rs->flags | NS_BUF_CHANGED; ts->ptr = rs->ptr; - ring->head = nm_ring_next(ring, ring->head); + mf->shadow_head = nm_ring_next(ring, mf->shadow_head); + if (!curmf) { + ring->head = mf->shadow_head; + } + ND("curmf %2x ts->flags %2x shadow_head %3u head %3u tail %3u", + curmf, ts->flags, mf->shadow_head, ring->head, ring->tail); port->ctr.bytes += rs->len; port->ctr.pkts++; forwarded++; @@ -516,9 +546,20 @@ forward_packet(struct group_des *g, struct netmap_slot /* use the overflow queue, if available */ if (q == NULL || oq_full(q)) { + uint32_t scan; /* no space left on the ring and no overflow queue * available: we are forced to drop the packet */ + + /* drop previous fragments, if any */ + for (scan = ring->head; scan != mf->shadow_head; + scan = nm_ring_next(ring, scan)) { + struct netmap_slot *ts = &ring->slot[scan]; + dropped++; + port->ctr.drop_bytes += ts->len; + } + mf->shadow_head = ring->head; + dropped++; port->ctr.drop++; port->ctr.drop_bytes += rs->len; @@ -550,9 +591,12 @@ forward_packet(struct group_des *g, struct netmap_slot /* move the oldest BUF_REVOKE buffers from the * lp queue to the free queue + * + * We cannot revoke a partially received packet. + * To make thinks simple we make sure to leave + * at least NETMAP_MAX_FRAGS slots in the queue. */ - // XXX optimize this cycle - for (j = 0; lp->oq->n && j < BUF_REVOKE; j++) { + for (j = 0; lp->oq->n > NETMAP_MAX_FRAGS && j < BUF_REVOKE; j++) { struct netmap_slot tmp = oq_deq(lp->oq); dropped++; @@ -651,14 +695,6 @@ int main(int argc, char **argv) return 1; } - /* extract the base name */ - char *nscan = strncmp(glob_arg.ifname, "netmap:", 7) ? - glob_arg.ifname : glob_arg.ifname + 7; - strncpy(glob_arg.base_name, nscan, MAX_IFNAMELEN - 1); - for (nscan = glob_arg.base_name; *nscan && !index("-*^{}/@", *nscan); nscan++) - ; - *nscan = '\0'; - if (glob_arg.num_groups == 0) parse_pipes(""); @@ -678,6 +714,15 @@ int main(int argc, char **argv) return 1; } struct port_des *rxport = &ports[npipes]; + + rxport->nmd = nmport_prepare(glob_arg.ifname); + if (rxport->nmd == NULL) { + D("cannot parse %s", glob_arg.ifname); + return (1); + } + /* extract the base name */ + strncpy(glob_arg.base_name, rxport->nmd->hdr.nr_name, MAX_IFNAMELEN); + init_groups(); memset(&counters_buf, 0, sizeof(counters_buf)); @@ -687,24 +732,15 @@ int main(int argc, char **argv) return 1; } - /* we need base_req to specify pipes and extra bufs */ - struct nmreq base_req; - memset(&base_req, 0, sizeof(base_req)); + rxport->nmd->reg.nr_extra_bufs = glob_arg.extra_bufs; - base_req.nr_arg1 = npipes; - base_req.nr_arg3 = glob_arg.extra_bufs; - - rxport->nmd = nm_open(glob_arg.ifname, &base_req, 0, NULL); - - if (rxport->nmd == NULL) { + if (nmport_open_desc(rxport->nmd) < 0) { D("cannot open %s", glob_arg.ifname); return (1); - } else { - D("successfully opened %s (tx rings: %u)", glob_arg.ifname, - rxport->nmd->req.nr_tx_slots); } + D("successfully opened %s", glob_arg.ifname); - uint32_t extra_bufs = rxport->nmd->req.nr_arg3; + uint32_t extra_bufs = rxport->nmd->reg.nr_extra_bufs; struct overflow_queue *oq = NULL; /* reference ring to access the buffers */ rxport->ring = NETMAP_RXRING(rxport->nmd->nifp, 0); @@ -772,25 +808,31 @@ run: snprintf(p->interface, MAX_PORTNAMELEN, "%s%s{%d/xT@%d", (strncmp(g->pipename, "vale", 4) ? "netmap:" : ""), g->pipename, g->first_id + k, - rxport->nmd->req.nr_arg2); + rxport->nmd->reg.nr_mem_id); D("opening pipe named %s", p->interface); - p->nmd = nm_open(p->interface, NULL, 0, rxport->nmd); + p->nmd = nmport_open(p->interface); if (p->nmd == NULL) { D("cannot open %s", p->interface); return (1); - } else if (p->nmd->req.nr_arg2 != rxport->nmd->req.nr_arg2) { + } else if (p->nmd->mem != rxport->nmd->mem) { D("failed to open pipe #%d in zero-copy mode, " "please close any application that uses either pipe %s}%d, " "or %s{%d, and retry", k + 1, g->pipename, g->first_id + k, g->pipename, g->first_id + k); return (1); } else { + struct morefrag *mf; + D("successfully opened pipe #%d %s (tx slots: %d)", - k + 1, p->interface, p->nmd->req.nr_tx_slots); + k + 1, p->interface, p->nmd->reg.nr_tx_slots); p->ring = NETMAP_TXRING(p->nmd->nifp, 0); p->last_tail = nm_ring_next(p->ring, p->ring->tail); + mf = (struct morefrag *)p->ring->sem; + mf->last_flag = 0; /* unused */ + mf->last_hash = 0; /* unused */ + mf->shadow_head = p->ring->head; } D("zerocopy %s", (rxport->nmd->mem == p->nmd->mem) ? "enabled" : "disabled"); @@ -843,6 +885,16 @@ run: if (glob_arg.stdout_interval > 0 && glob_arg.stdout_interval < poll_timeout) poll_timeout = glob_arg.stdout_interval; + /* initialize the morefrag structures for the input rings */ + for (i = rxport->nmd->first_rx_ring; i <= rxport->nmd->last_rx_ring; i++) { + struct netmap_ring *rxring = NETMAP_RXRING(rxport->nmd->nifp, i); + struct morefrag *mf = (struct morefrag *)rxring->sem; + + mf->last_flag = 0; + mf->last_hash = 0; + mf->shadow_head = 0; /* unused */ + } + while (!do_abort) { u_int polli = 0; iter++; @@ -871,7 +923,7 @@ run: pollfd[polli].revents = 0; ++polli; - //RD(5, "polling %d file descriptors", polli+1); + ND(5, "polling %d file descriptors", polli); rv = poll(pollfd, polli, poll_timeout); if (rv <= 0) { if (rv < 0 && errno != EAGAIN && errno != EINTR) @@ -902,7 +954,7 @@ run: struct netmap_slot *rs = &ring->slot[last]; // XXX less aggressive? rs->buf_idx = forward_packet(g + 1, rs); - rs->flags |= NS_BUF_CHANGED; + rs->flags = NS_BUF_CHANGED; rs->ptr = 0; } p->last_tail = last; @@ -918,27 +970,34 @@ run: for (i = 0; i < npipes; i++) { struct port_des *p = &ports[i]; struct overflow_queue *q = p->oq; - uint32_t k, lim; + uint32_t k; + int64_t lim; struct netmap_ring *ring; struct netmap_slot *slot; + struct morefrag *mf; if (oq_empty(q)) continue; ring = p->ring; - lim = nm_ring_space(ring); + mf = (struct morefrag *)ring->sem; + lim = ring->tail - mf->shadow_head; if (!lim) continue; + if (lim < 0) + lim += ring->num_slots; if (q->n < lim) lim = q->n; for (k = 0; k < lim; k++) { struct netmap_slot s = oq_deq(q), tmp; tmp.ptr = 0; - slot = &ring->slot[ring->head]; + slot = &ring->slot[mf->shadow_head]; tmp.buf_idx = slot->buf_idx; oq_enq(freeq, &tmp); *slot = s; slot->flags |= NS_BUF_CHANGED; - ring->head = nm_ring_next(ring, ring->head); + mf->shadow_head = nm_ring_next(ring, mf->shadow_head); + if (!(slot->flags & NS_MOREFRAG)) + ring->head = mf->shadow_head; } } } @@ -947,6 +1006,7 @@ run: int batch = 0; for (i = rxport->nmd->first_rx_ring; i <= rxport->nmd->last_rx_ring; i++) { struct netmap_ring *rxring = NETMAP_RXRING(rxport->nmd->nifp, i); + struct morefrag *mf = (struct morefrag *)rxring->sem; //D("prepare to scan rings"); int next_head = rxring->head; @@ -959,7 +1019,15 @@ run: received_bytes += rs->len; // CHOOSE THE CORRECT OUTPUT PIPE - rs->ptr = pkt_hdr_hash((const unsigned char *)next_buf, 4, 'B'); + // If the previous slot had NS_MOREFRAG set, this is another + // fragment of the last packet and it should go to the same + // output pipe as before. + if (!mf->last_flag) { + // 'B' is just a hashing seed + mf->last_hash = pkt_hdr_hash((const unsigned char *)next_buf, 4, 'B'); + } + mf->last_flag = rs->flags & NS_MOREFRAG; + rs->ptr = mf->last_hash; if (rs->ptr == 0) { non_ip++; // XXX ?? } @@ -968,9 +1036,8 @@ run: next_slot = &rxring->slot[next_head]; next_buf = NETMAP_BUF(rxring, next_slot->buf_idx); __builtin_prefetch(next_buf); - // 'B' is just a hashing seed rs->buf_idx = forward_packet(g, rs); - rs->flags |= NS_BUF_CHANGED; + rs->flags = NS_BUF_CHANGED; rxring->head = rxring->cur = next_head; batch++; Modified: head/tools/tools/netmap/pkt_hash.c ============================================================================== --- head/tools/tools/netmap/pkt_hash.c Sun Nov 22 09:20:08 2020 (r367932) +++ head/tools/tools/netmap/pkt_hash.c Sun Nov 22 09:28:50 2020 (r367933) @@ -26,6 +26,7 @@ ** POSSIBILITY OF SUCH DAMAGE. **/ /* $FreeBSD$ */ + /* for func prototypes */ #include "pkt_hash.h" From owner-svn-src-all@freebsd.org Sun Nov 22 09:38:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF7A62EAE16; Sun, 22 Nov 2020 09:38:01 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cf4vs5z3dz4nD1; Sun, 22 Nov 2020 09:38:01 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFD5C17F63; Sun, 22 Nov 2020 09:38:01 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AM9c1D0020327; Sun, 22 Nov 2020 09:38:01 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AM9c1Nv020326; Sun, 22 Nov 2020 09:38:01 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202011220938.0AM9c1Nv020326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 22 Nov 2020 09:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367934 - head/tools/tools/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/tools/tools/netmap X-SVN-Commit-Revision: 367934 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 09:38:01 -0000 Author: vmaffione Date: Sun Nov 22 09:38:01 2020 New Revision: 367934 URL: https://svnweb.freebsd.org/changeset/base/367934 Log: netmap: nmreplay: switch to libnetmap Use the newer libnetmap (included in base) rather than the older nm_open()/nm_close() defined in netmap_user.h MFC after: 3 days Modified: head/tools/tools/netmap/nmreplay.c Modified: head/tools/tools/netmap/nmreplay.c ============================================================================== --- head/tools/tools/netmap/nmreplay.c Sun Nov 22 09:28:50 2020 (r367933) +++ head/tools/tools/netmap/nmreplay.c Sun Nov 22 09:38:01 2020 (r367934) @@ -106,12 +106,27 @@ #define DDD(_fmt, ...) ED("--DDD-- " _fmt, ##__VA_ARGS__) #define _GNU_SOURCE // for CPU_SET() etc +#include +#include +#include +#include /* log, exp etc. */ +#include +#ifdef __FreeBSD__ +#include /* pthread w/ affinity */ +#include /* cpu_set */ +#endif /* __FreeBSD__ */ +#include #include -#define NETMAP_WITH_LIBS -#include +#include +#include /* memcpy */ +#include +#include +#include #include +#include // setpriority +#include +#include - /* * * A packet in the queue is q_pkt plus the payload. @@ -242,15 +257,6 @@ static struct nm_pcap_file *readpcap(const char *fn); static void destroy_pcap(struct nm_pcap_file *file); -#include -#include -#include -#include -#include -#include /* memcpy */ - -#include - #define NS_SCALE 1000000000UL /* nanoseconds in 1s */ static void destroy_pcap(struct nm_pcap_file *pf) @@ -435,18 +441,6 @@ static int verbose = 0; static int do_abort = 0; -#include -#include -#include -#include - -#include // setpriority - -#ifdef __FreeBSD__ -#include /* pthread w/ affinity */ -#include /* cpu_set */ -#endif /* __FreeBSD__ */ - #ifdef linux #define cpuset_t cpu_set_t #endif @@ -566,7 +560,7 @@ struct _qs { /* shared queue */ struct nm_pcap_file *pcap; /* the pcap struct */ /* parameters for reading from the netmap port */ - struct nm_desc *src_port; /* netmap descriptor */ + struct nmport_d *src_port; /* netmap descriptor */ const char * prod_ifname; /* interface name or pcap file */ struct netmap_ring *rxring; /* current ring being handled */ uint32_t si; /* ring index */ @@ -640,8 +634,8 @@ struct pipe_args { int cons_core; /* core for cons() */ int prod_core; /* core for prod() */ - struct nm_desc *pa; /* netmap descriptor */ - struct nm_desc *pb; + struct nmport_d *pa; /* netmap descriptor */ + struct nmport_d *pb; struct _qs q; }; @@ -843,7 +837,7 @@ fail: if (q->buf != NULL) { free(q->buf); } - nm_close(pa->pb); + nmport_close(pa->pb); return (NULL); } @@ -893,7 +887,7 @@ cons(void *_pa) continue; } /* XXX copy is inefficient but simple */ - if (nm_inject(pa->pb, (char *)(p + 1), p->pktlen) == 0) { + if (nmport_inject(pa->pb, (char *)(p + 1), p->pktlen) == 0) { RD(1, "inject failed len %d now %ld tx %ld h %ld t %ld next %ld", (int)p->pktlen, (u_long)q->cons_now, (u_long)p->pt_tx, (u_long)q->_head, (u_long)q->_tail, (u_long)p->next); @@ -939,7 +933,7 @@ nmreplay_main(void *_a) pcap_prod((void*)a); destroy_pcap(q->pcap); q->pcap = NULL; - a->pb = nm_open(q->cons_ifname, NULL, 0, NULL); + a->pb = nmport_open(q->cons_ifname); if (a->pb == NULL) { EEE("cannot open netmap on %s", q->cons_ifname); do_abort = 1; // XXX any better way ? @@ -1372,7 +1366,6 @@ parse_bw(const char *arg) * 24 useful random bits. */ -#include /* log, exp etc. */ static inline uint64_t my_random24(void) /* 24 useful bits */ { From owner-svn-src-all@freebsd.org Sun Nov 22 10:02:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5CEC2EB6BF; Sun, 22 Nov 2020 10:02:57 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cf5Sd4Hf6z4pRp; Sun, 22 Nov 2020 10:02:57 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85F8C180FB; Sun, 22 Nov 2020 10:02:57 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AMA2vjI038298; Sun, 22 Nov 2020 10:02:57 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AMA2vsV038297; Sun, 22 Nov 2020 10:02:57 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202011221002.0AMA2vsV038297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 22 Nov 2020 10:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367935 - head/usr.sbin/valectl X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/usr.sbin/valectl X-SVN-Commit-Revision: 367935 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 10:02:57 -0000 Author: vmaffione Date: Sun Nov 22 10:02:56 2020 New Revision: 367935 URL: https://svnweb.freebsd.org/changeset/base/367935 Log: netmap: valectl: switch to libnetmap Use the newer libnetmap (included in base) rather than the older nm_open()/nm_close() defined in netmap_user.h MFC after: 3 days Modified: head/usr.sbin/valectl/Makefile head/usr.sbin/valectl/valectl.c Modified: head/usr.sbin/valectl/Makefile ============================================================================== --- head/usr.sbin/valectl/Makefile Sun Nov 22 09:38:01 2020 (r367934) +++ head/usr.sbin/valectl/Makefile Sun Nov 22 10:02:56 2020 (r367935) @@ -5,4 +5,6 @@ MAN= valectl.8 WARNS?= 3 +LIBADD= netmap + .include Modified: head/usr.sbin/valectl/valectl.c ============================================================================== --- head/usr.sbin/valectl/valectl.c Sun Nov 22 09:38:01 2020 (r367934) +++ head/usr.sbin/valectl/valectl.c Sun Nov 22 10:02:56 2020 (r367935) @@ -25,9 +25,8 @@ /* $FreeBSD$ */ -#define NETMAP_WITH_LIBS -#include -#include +#define LIBNETMAP_NOTHREADSAFE +#include #include #include @@ -42,14 +41,58 @@ #include /* basename */ #include /* atoi, free */ +int verbose; + +struct args { + const char *name; + const char *config; + const char *mem_id; + + uint16_t nr_reqtype; + uint32_t nr_mode; +}; + static void -parse_nmr_config(const char* conf, struct nmreq *nmr) +dump_port_info(struct nmreq_port_info_get *v) { + printf("memsize: %"PRIu64"\n", v->nr_memsize); + printf("tx_slots: %"PRIu32"\n", v->nr_tx_slots); + printf("rx_slots: %"PRIu32"\n", v->nr_rx_slots); + printf("tx_rings: %"PRIu16"\n", v->nr_tx_rings); + printf("rx_rings %"PRIu16"\n", v->nr_rx_rings); + printf("mem_id: %"PRIu16"\n", v->nr_mem_id); +} + +static void +dump_newif(struct nmreq_vale_newif *v) +{ + printf("tx_slots: %"PRIu32"\n", v->nr_tx_slots); + printf("rx_slots: %"PRIu32"\n", v->nr_rx_slots); + printf("tx_rings: %"PRIu16"\n", v->nr_tx_rings); + printf("rx_ring: %"PRIu16"\n", v->nr_rx_rings); + printf("mem_id: %"PRIu16"\n", v->nr_mem_id); +} + +static void +dump_vale_list(struct nmreq_vale_list *v) +{ + printf("bridge_idx: %"PRIu16"\n", v->nr_bridge_idx); + printf("port_idx: %"PRIu16"\n", v->nr_port_idx); +} + + +static void +parse_ring_config(const char* conf, + uint32_t *nr_tx_slots, + uint32_t *nr_rx_slots, + uint16_t *nr_tx_rings, + uint16_t *nr_rx_rings) +{ char *w, *tok; int i, v; - nmr->nr_tx_rings = nmr->nr_rx_rings = 0; - nmr->nr_tx_slots = nmr->nr_rx_slots = 0; + *nr_tx_rings = *nr_rx_rings = 0; + *nr_tx_slots = *nr_rx_slots = 0; if (conf == NULL || ! *conf) return; w = strdup(conf); @@ -57,137 +100,235 @@ parse_nmr_config(const char* conf, struct nmreq *nmr) v = atoi(tok); switch (i) { case 0: - nmr->nr_tx_slots = nmr->nr_rx_slots = v; + *nr_tx_slots = *nr_rx_slots = v; break; case 1: - nmr->nr_rx_slots = v; + *nr_rx_slots = v; break; case 2: - nmr->nr_tx_rings = nmr->nr_rx_rings = v; + *nr_tx_rings = *nr_rx_rings = v; break; case 3: - nmr->nr_rx_rings = v; + *nr_rx_rings = v; break; default: - D("ignored config: %s", tok); + fprintf(stderr, "ignored config: %s", tok); break; } } - D("txr %d txd %d rxr %d rxd %d", - nmr->nr_tx_rings, nmr->nr_tx_slots, - nmr->nr_rx_rings, nmr->nr_rx_slots); + ND("txr %d txd %d rxr %d rxd %d", + *nr_tx_rings, *nr_tx_slots, + *nr_rx_rings, *nr_rx_slots); free(w); } static int -bdg_ctl(const char *name, int nr_cmd, int nr_arg, char *nmr_config, int nr_arg2) +parse_poll_config(const char *conf, struct nmreq_vale_polling *v) { - struct nmreq nmr; - int error = 0; - int fd = open("/dev/netmap", O_RDWR); + char *w, *tok; + int i, p; - if (fd == -1) { - D("Unable to open /dev/netmap"); + if (conf == NULL || ! *conf) { + fprintf(stderr, "invalid null/empty config\n"); return -1; } + w = strdup(conf); + for (i = 0, tok = strtok(w, ","); tok; i++, tok = strtok(NULL, ",")) { + p = atoi(tok); + switch (i) { + case 0: + v->nr_mode = p ? NETMAP_POLLING_MODE_MULTI_CPU : + NETMAP_POLLING_MODE_SINGLE_CPU; + break; + case 1: + v->nr_first_cpu_id = p; + break; + case 2: + if (v->nr_mode != NETMAP_POLLING_MODE_MULTI_CPU) { + fprintf(stderr, "too many numbers in '%s'\n", conf); + return -1; + } + v->nr_num_polling_cpus = p; + break; + case 3: + fprintf(stderr, "too many numbers in '%s'\n", conf); + return -1; + } + } + free(w); + return 0; +} - bzero(&nmr, sizeof(nmr)); - nmr.nr_version = NETMAP_API; - if (name != NULL) /* might be NULL */ - strncpy(nmr.nr_name, name, sizeof(nmr.nr_name)-1); - nmr.nr_cmd = nr_cmd; - parse_nmr_config(nmr_config, &nmr); - nmr.nr_arg2 = nr_arg2; +static int32_t +parse_mem_id(const char *mem_id) +{ + int32_t id; - switch (nr_cmd) { - case NETMAP_BDG_DELIF: - case NETMAP_BDG_NEWIF: - error = ioctl(fd, NIOCREGIF, &nmr); - if (error == -1) { - ND("Unable to %s %s", nr_cmd == NETMAP_BDG_DELIF ? "delete":"create", name); - perror(name); - } else { - ND("Success to %s %s", nr_cmd == NETMAP_BDG_DELIF ? "delete":"create", name); + if (mem_id == NULL) + return 0; + if (isdigit(*mem_id)) + return atoi(mem_id); + id = nmreq_get_mem_id(&mem_id, nmctx_get()); + if (id == 0) { + fprintf(stderr, "invalid format in '-m %s' (missing 'netmap:'?)\n", mem_id); + return -1; + } + return id; +} + +static int +list_all(int fd, struct nmreq_header *hdr) +{ + int error; + struct nmreq_vale_list *vale_list = + (struct nmreq_vale_list *)hdr->nr_body; + + for (;;) { + hdr->nr_name[0] = '\0'; + error = ioctl(fd, NIOCCTRL, hdr); + if (error < 0) { + if (errno == ENOENT) + break; + + fprintf(stderr, "failed to list all: %s\n", strerror(errno)); + return 1; } + printf("%s bridge_idx %"PRIu16" port_idx %"PRIu32"\n", hdr->nr_name, + vale_list->nr_bridge_idx, vale_list->nr_port_idx); + vale_list->nr_port_idx++; + } + return 1; +} + +static int +bdg_ctl(struct args *a) +{ + struct nmreq_header hdr; + struct nmreq_vale_attach vale_attach; + struct nmreq_vale_detach vale_detach; + struct nmreq_vale_newif vale_newif; + struct nmreq_vale_list vale_list; + struct nmreq_vale_polling vale_polling; + struct nmreq_port_info_get port_info_get; + int error = 0; + int fd; + int32_t mem_id; + const char *action = NULL; + + fd = open("/dev/netmap", O_RDWR); + if (fd == -1) { + perror("/dev/netmap"); + return 1; + } + + bzero(&hdr, sizeof(hdr)); + hdr.nr_version = NETMAP_API; + if (a->name != NULL) { /* might be NULL */ + strncpy(hdr.nr_name, a->name, NETMAP_REQ_IFNAMSIZ - 1); + hdr.nr_name[NETMAP_REQ_IFNAMSIZ - 1] = '\0'; + } + hdr.nr_reqtype = a->nr_reqtype; + + switch (a->nr_reqtype) { + case NETMAP_REQ_VALE_DELIF: + /* no body */ + action = "remove"; break; - case NETMAP_BDG_ATTACH: - case NETMAP_BDG_DETACH: - nmr.nr_flags = NR_REG_ALL_NIC; - if (nr_arg && nr_arg != NETMAP_BDG_HOST) { - nmr.nr_flags = NR_REG_NIC_SW; - nr_arg = 0; + + case NETMAP_REQ_VALE_NEWIF: + memset(&vale_newif, 0, sizeof(vale_newif)); + hdr.nr_body = (uintptr_t)&vale_newif; + parse_ring_config(a->config, + &vale_newif.nr_tx_slots, + &vale_newif.nr_rx_slots, + &vale_newif.nr_tx_rings, + &vale_newif.nr_rx_rings); + mem_id = parse_mem_id(a->mem_id); + if (mem_id < 0) + return 1; + vale_newif.nr_mem_id = mem_id; + action = "create"; + break; + + case NETMAP_REQ_VALE_ATTACH: + memset(&vale_attach, 0, sizeof(vale_attach)); + hdr.nr_body = (uintptr_t)&vale_attach; + vale_attach.reg.nr_mode = a->nr_mode; + parse_ring_config(a->config, + &vale_attach.reg.nr_tx_slots, + &vale_attach.reg.nr_rx_slots, + &vale_attach.reg.nr_tx_rings, + &vale_attach.reg.nr_rx_rings); + mem_id = parse_mem_id(a->mem_id); + if (mem_id < 0) + return 1; + vale_attach.reg.nr_mem_id = mem_id; + action = "attach"; + break; + + case NETMAP_REQ_VALE_DETACH: + memset(&vale_detach, 0, sizeof(vale_detach)); + hdr.nr_body = (uintptr_t)&vale_detach; + action = "detach"; + break; + + case NETMAP_REQ_VALE_LIST: + memset(&vale_list, 0, sizeof(vale_list)); + hdr.nr_body = (uintptr_t)&vale_list; + if (a->name == NULL) { + return list_all(fd, &hdr); } - nmr.nr_arg1 = nr_arg; - error = ioctl(fd, NIOCREGIF, &nmr); - if (error == -1) { - ND("Unable to %s %s to the bridge", nr_cmd == - NETMAP_BDG_DETACH?"detach":"attach", name); - perror(name); - } else - ND("Success to %s %s to the bridge", nr_cmd == - NETMAP_BDG_DETACH?"detach":"attach", name); + action = "list"; break; - case NETMAP_BDG_LIST: - if (strlen(nmr.nr_name)) { /* name to bridge/port info */ - error = ioctl(fd, NIOCGINFO, &nmr); - if (error) { - ND("Unable to obtain info for %s", name); - perror(name); - } else - D("%s at bridge:%d port:%d", name, nmr.nr_arg1, - nmr.nr_arg2); - break; + case NETMAP_REQ_VALE_POLLING_ENABLE: + action = "enable polling on"; + /* fall through */ + case NETMAP_REQ_VALE_POLLING_DISABLE: + memset(&vale_polling, 0, sizeof(vale_polling)); + hdr.nr_body = (uintptr_t)&vale_polling; + parse_poll_config(a->config, &vale_polling); + if (action == NULL) + action ="disable polling on"; + break; + + case NETMAP_REQ_PORT_INFO_GET: + memset(&port_info_get, 0, sizeof(port_info_get)); + hdr.nr_body = (uintptr_t)&port_info_get; + action = "obtain info for"; + break; + } + error = ioctl(fd, NIOCCTRL, &hdr); + if (error < 0) { + fprintf(stderr, "failed to %s %s: %s\n", + action, a->name, strerror(errno)); + return 1; + } + switch (hdr.nr_reqtype) { + case NETMAP_REQ_VALE_NEWIF: + if (verbose) { + dump_newif(&vale_newif); } + break; - /* scan all the bridges and ports */ - nmr.nr_arg1 = nmr.nr_arg2 = 0; - for (; !ioctl(fd, NIOCGINFO, &nmr); nmr.nr_arg2++) { - D("bridge:%d port:%d %s", nmr.nr_arg1, nmr.nr_arg2, - nmr.nr_name); - nmr.nr_name[0] = '\0'; + case NETMAP_REQ_VALE_ATTACH: + if (verbose) { + printf("port_index: %"PRIu32"\n", vale_attach.port_index); } + break; + case NETMAP_REQ_VALE_DETACH: + if (verbose) { + printf("port_index: %"PRIu32"\n", vale_detach.port_index); + } break; - case NETMAP_BDG_POLLING_ON: - case NETMAP_BDG_POLLING_OFF: - /* We reuse nmreq fields as follows: - * nr_tx_slots: 0 and non-zero indicate REG_ALL_NIC - * REG_ONE_NIC, respectively. - * nr_rx_slots: CPU core index. This also indicates the - * first queue in the case of REG_ONE_NIC - * nr_tx_rings: (REG_ONE_NIC only) indicates the - * number of CPU cores or the last queue - */ - nmr.nr_flags |= nmr.nr_tx_slots ? - NR_REG_ONE_NIC : NR_REG_ALL_NIC; - nmr.nr_ringid = nmr.nr_rx_slots; - /* number of cores/rings */ - if (nmr.nr_flags == NR_REG_ALL_NIC) - nmr.nr_arg1 = 1; - else - nmr.nr_arg1 = nmr.nr_tx_rings; - - error = ioctl(fd, NIOCREGIF, &nmr); - if (!error) - D("polling on %s %s", nmr.nr_name, - nr_cmd == NETMAP_BDG_POLLING_ON ? - "started" : "stopped"); - else - D("polling on %s %s (err %d)", nmr.nr_name, - nr_cmd == NETMAP_BDG_POLLING_ON ? - "couldn't start" : "couldn't stop", error); + case NETMAP_REQ_VALE_LIST: + dump_vale_list(&vale_list); break; - default: /* GINFO */ - nmr.nr_cmd = nmr.nr_arg1 = nmr.nr_arg2 = 0; - error = ioctl(fd, NIOCGINFO, &nmr); - if (error) { - ND("Unable to get if info for %s", name); - perror(name); - } else - D("%s: %d queues.", name, nmr.nr_rx_rings); + case NETMAP_REQ_PORT_INFO_GET: + dump_port_info(&port_info_get); break; } close(fd); @@ -199,82 +340,106 @@ usage(int errcode) { fprintf(stderr, "Usage:\n" - "valectl arguments\n" + "vale-ctl [arguments]\n" "\t-g interface interface name to get info\n" "\t-d interface interface name to be detached\n" "\t-a interface interface name to be attached\n" "\t-h interface interface name to be attached with the host stack\n" "\t-n interface interface name to be created\n" "\t-r interface interface name to be deleted\n" - "\t-l list all or specified bridge's interfaces (default)\n" + "\t-l vale-port show bridge and port indices\n" "\t-C string ring/slot setting of an interface creating by -n\n" "\t-p interface start polling. Additional -C x,y,z configures\n" "\t\t x: 0 (REG_ALL_NIC) or 1 (REG_ONE_NIC),\n" "\t\t y: CPU core id for ALL_NIC and core/ring for ONE_NIC\n" "\t\t z: (ONE_NIC only) num of total cores/rings\n" "\t-P interface stop polling\n" - "\t-m memid to use when creating a new interface\n"); + "\t-m memid to use when creating a new interface\n" + "\t-v increase verbosity\n" + "with no arguments: list all existing vale ports\n"); exit(errcode); } int main(int argc, char *argv[]) { - int ch, nr_cmd = 0, nr_arg = 0; - char *name = NULL, *nmr_config = NULL; - int nr_arg2 = 0; + int ch; + struct args a = { + .name = NULL, + .config = NULL, + .mem_id = NULL, + .nr_reqtype = 0, + .nr_mode = NR_REG_ALL_NIC, + }; - while ((ch = getopt(argc, argv, "d:a:h:g:l:n:r:C:p:P:m:")) != -1) { - if (ch != 'C' && ch != 'm') - name = optarg; /* default */ + while ((ch = getopt(argc, argv, "d:a:h:g:l:n:r:C:p:P:m:v")) != -1) { switch (ch) { default: fprintf(stderr, "bad option %c %s", ch, optarg); - usage(-1); + usage(1); break; case 'd': - nr_cmd = NETMAP_BDG_DETACH; + a.nr_reqtype = NETMAP_REQ_VALE_DETACH; + a.name = optarg; break; case 'a': - nr_cmd = NETMAP_BDG_ATTACH; + a.nr_reqtype = NETMAP_REQ_VALE_ATTACH; + a.nr_mode = NR_REG_ALL_NIC; + a.name = optarg; break; case 'h': - nr_cmd = NETMAP_BDG_ATTACH; - nr_arg = NETMAP_BDG_HOST; + a.nr_reqtype = NETMAP_REQ_VALE_ATTACH; + a.nr_mode = NR_REG_NIC_SW; + a.name = optarg; break; case 'n': - nr_cmd = NETMAP_BDG_NEWIF; + a.nr_reqtype = NETMAP_REQ_VALE_NEWIF; + a.name = optarg; break; case 'r': - nr_cmd = NETMAP_BDG_DELIF; + a.nr_reqtype = NETMAP_REQ_VALE_DELIF; + a.name = optarg; break; case 'g': - nr_cmd = 0; + a.nr_reqtype = NETMAP_REQ_PORT_INFO_GET; + a.name = optarg; break; case 'l': - nr_cmd = NETMAP_BDG_LIST; + a.nr_reqtype = NETMAP_REQ_VALE_LIST; + a.name = optarg; + if (strncmp(a.name, NM_BDG_NAME, strlen(NM_BDG_NAME))) { + fprintf(stderr, "invalid vale port name: '%s'\n", a.name); + usage(1); + } break; case 'C': - nmr_config = strdup(optarg); + a.config = optarg; break; case 'p': - nr_cmd = NETMAP_BDG_POLLING_ON; + a.nr_reqtype = NETMAP_REQ_VALE_POLLING_ENABLE; + a.name = optarg; break; case 'P': - nr_cmd = NETMAP_BDG_POLLING_OFF; + a.nr_reqtype = NETMAP_REQ_VALE_POLLING_DISABLE; + a.name = optarg; break; case 'm': - nr_arg2 = atoi(optarg); + a.mem_id = optarg; break; + case 'v': + verbose++; + break; } } if (optind != argc) { - // fprintf(stderr, "optind %d argc %d\n", optind, argc); - usage(-1); + usage(1); } if (argc == 1) { - nr_cmd = NETMAP_BDG_LIST; - name = NULL; + a.nr_reqtype = NETMAP_REQ_VALE_LIST; + a.name = NULL; } - return bdg_ctl(name, nr_cmd, nr_arg, nmr_config, nr_arg2) ? 1 : 0; + if (!a.nr_reqtype) { + usage(1); + } + return bdg_ctl(&a); } From owner-svn-src-all@freebsd.org Sun Nov 22 13:39:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 239A1468F81; Sun, 22 Nov 2020 13:39:22 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfBGL0SSKz3GP1; Sun, 22 Nov 2020 13:39:22 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01E3C1B033; Sun, 22 Nov 2020 13:39:22 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AMDdLW6069060; Sun, 22 Nov 2020 13:39:21 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AMDdL7p069059; Sun, 22 Nov 2020 13:39:21 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202011221339.0AMDdL7p069059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 22 Nov 2020 13:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367936 - head/tools/tools/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/tools/tools/netmap X-SVN-Commit-Revision: 367936 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 13:39:22 -0000 Author: vmaffione Date: Sun Nov 22 13:39:21 2020 New Revision: 367936 URL: https://svnweb.freebsd.org/changeset/base/367936 Log: netmap: bridge: improve readability Multiple cosmetic changes, plus a fix to a verbose print (indicating wrong net->host/host->net direction). MFC after: 3 days Modified: head/tools/tools/netmap/bridge.c Modified: head/tools/tools/netmap/bridge.c ============================================================================== --- head/tools/tools/netmap/bridge.c Sun Nov 22 10:02:56 2020 (r367935) +++ head/tools/tools/netmap/bridge.c Sun Nov 22 13:39:21 2020 (r367936) @@ -3,19 +3,19 @@ * * BSD license * - * A netmap client to bridge two network interfaces - * (or one interface and the host stack). + * A netmap application to bridge two network interfaces, + * or one interface and the host stack. * * $FreeBSD$ */ +#include +#include #include #include #include -#include #include #include -#include static int verbose = 0; @@ -32,30 +32,39 @@ sigint_h(int sig) /* - * how many packets on this set of queues ? + * How many slots do we (user application) have on this + * set of queues ? */ static int -pkt_queued(struct nmport_d *d, int tx) +rx_slots_avail(struct nmport_d *d) { u_int i, tot = 0; - if (tx) { - for (i = d->first_tx_ring; i <= d->last_tx_ring; i++) { - tot += nm_ring_space(NETMAP_TXRING(d->nifp, i)); - } - } else { - for (i = d->first_rx_ring; i <= d->last_rx_ring; i++) { - tot += nm_ring_space(NETMAP_RXRING(d->nifp, i)); - } + for (i = d->first_rx_ring; i <= d->last_rx_ring; i++) { + tot += nm_ring_space(NETMAP_RXRING(d->nifp, i)); } + return tot; } +static int +tx_slots_avail(struct nmport_d *d) +{ + u_int i, tot = 0; + + for (i = d->first_tx_ring; i <= d->last_tx_ring; i++) { + tot += nm_ring_space(NETMAP_TXRING(d->nifp, i)); + } + + return tot; +} + /* - * move up to 'limit' pkts from rxring to txring swapping buffers. + * Move up to 'limit' pkts from rxring to txring, swapping buffers + * if zerocopy is possible. Otherwise fall back on packet copying. */ static int -process_rings(struct netmap_ring *rxring, struct netmap_ring *txring, +rings_move(struct netmap_ring *rxring, struct netmap_ring *txring, u_int limit, const char *msg) { u_int j, k, m = 0; @@ -63,7 +72,7 @@ process_rings(struct netmap_ring *rxring, struct netma /* print a warning if any of the ring flags is set (e.g. NM_REINIT) */ if (rxring->flags || txring->flags) D("%s rxflags %x txflags %x", - msg, rxring->flags, txring->flags); + msg, rxring->flags, txring->flags); j = rxring->head; /* RX */ k = txring->head; /* TX */ m = nm_ring_space(rxring); @@ -79,16 +88,18 @@ process_rings(struct netmap_ring *rxring, struct netma /* swap packets */ if (ts->buf_idx < 2 || rs->buf_idx < 2) { - RD(5, "wrong index rx[%d] = %d -> tx[%d] = %d", - j, rs->buf_idx, k, ts->buf_idx); + RD(2, "wrong index rxr[%d] = %d -> txr[%d] = %d", + j, rs->buf_idx, k, ts->buf_idx); sleep(2); } /* copy the packet length. */ if (rs->len > rxring->nr_buf_size) { - RD(5, "wrong len %d rx[%d] -> tx[%d]", rs->len, j, k); + RD(2, "%s: invalid len %u, rxr[%d] -> txr[%d]", + msg, rs->len, j, k); rs->len = 0; } else if (verbose > 1) { - D("%s send len %d rx[%d] -> tx[%d]", msg, rs->len, j, k); + D("%s: fwd len %u, rx[%d] -> tx[%d]", + msg, rs->len, j, k); } ts->len = rs->len; if (zerocopy) { @@ -111,24 +122,23 @@ process_rings(struct netmap_ring *rxring, struct netma rxring->head = rxring->cur = j; txring->head = txring->cur = k; if (verbose && m > 0) - D("%s sent %d packets to %p", msg, m, txring); + D("%s fwd %d packets: rxring %u --> txring %u", + msg, m, rxring->ringid, txring->ringid); return (m); } -/* move packts from src to destination */ +/* Move packets from source port to destination port. */ static int -move(struct nmport_d *src, struct nmport_d *dst, u_int limit) +ports_move(struct nmport_d *src, struct nmport_d *dst, u_int limit, + const char *msg) { struct netmap_ring *txring, *rxring; u_int m = 0, si = src->first_rx_ring, di = dst->first_tx_ring; - const char *msg = (src->reg.nr_flags == NR_REG_SW) ? - "host->net" : "net->host"; while (si <= src->last_rx_ring && di <= dst->last_tx_ring) { rxring = NETMAP_RXRING(src->nifp, si); txring = NETMAP_TXRING(dst->nifp, di); - ND("txring %p rxring %p", txring, rxring); if (nm_ring_empty(rxring)) { si++; continue; @@ -137,7 +147,7 @@ move(struct nmport_d *src, struct nmport_d *dst, u_int di++; continue; } - m += process_rings(rxring, txring, limit, msg); + m += rings_move(rxring, txring, limit, msg); } return (m); @@ -149,7 +159,7 @@ usage(void) { fprintf(stderr, "netmap bridge program: forward packets between two " - "network interfaces\n" + "netmap ports\n" " usage(1): bridge [-v] [-i ifa] [-i ifb] [-b burst] " "[-w wait_time] [-L]\n" " usage(2): bridge [-v] [-w wait_time] [-L] " @@ -161,6 +171,11 @@ usage(void) " is not specified, otherwise loopback traffic on ifa.\n" "\n" " example: bridge -w 10 -i netmap:eth3 -i netmap:eth1\n" + "\n" + " If ifa and ifb are two interfaces, they must be in\n" + " promiscuous mode. Otherwise, if bridging with the \n" + " host stack, the interface must have the offloads \n" + " disabled.\n" ); exit(1); } @@ -175,13 +190,15 @@ usage(void) int main(int argc, char **argv) { + char msg_a2b[128], msg_b2a[128]; struct pollfd pollfd[2]; - int ch; u_int burst = 1024, wait_link = 4; struct nmport_d *pa = NULL, *pb = NULL; char *ifa = NULL, *ifb = NULL; char ifabuf[64] = { 0 }; + int pa_sw_rings, pb_sw_rings; int loopback = 0; + int ch; fprintf(stderr, "%s built %s %s\n\n", argv[0], __DATE__, __TIME__); @@ -281,14 +298,27 @@ main(int argc, char **argv) pa->hdr.nr_name, pa->first_rx_ring, pa->reg.nr_rx_rings, pb->hdr.nr_name, pb->first_rx_ring, pb->reg.nr_rx_rings); + pa_sw_rings = (pa->reg.nr_mode == NR_REG_SW || + pa->reg.nr_mode == NR_REG_ONE_SW); + pb_sw_rings = (pb->reg.nr_mode == NR_REG_SW || + pb->reg.nr_mode == NR_REG_ONE_SW); + + snprintf(msg_a2b, sizeof(msg_a2b), "%s:%s --> %s:%s", + pa->hdr.nr_name, pa_sw_rings ? "host" : "nic", + pb->hdr.nr_name, pb_sw_rings ? "host" : "nic"); + + snprintf(msg_b2a, sizeof(msg_b2a), "%s:%s --> %s:%s", + pb->hdr.nr_name, pb_sw_rings ? "host" : "nic", + pa->hdr.nr_name, pa_sw_rings ? "host" : "nic"); + /* main loop */ signal(SIGINT, sigint_h); while (!do_abort) { int n0, n1, ret; pollfd[0].events = pollfd[1].events = 0; pollfd[0].revents = pollfd[1].revents = 0; - n0 = pkt_queued(pa, 0); - n1 = pkt_queued(pb, 0); + n0 = rx_slots_avail(pa); + n1 = rx_slots_avail(pb); #if defined(_WIN32) || defined(BUSYWAIT) if (n0) { ioctl(pollfd[1].fd, NIOCTXSYNC, NULL); @@ -322,35 +352,37 @@ main(int argc, char **argv) ret <= 0 ? "timeout" : "ok", pollfd[0].events, pollfd[0].revents, - pkt_queued(pa, 0), + rx_slots_avail(pa), NETMAP_RXRING(pa->nifp, pa->cur_rx_ring)->head, - pkt_queued(pa, 1), + tx_slots_avail(pa), pollfd[1].events, pollfd[1].revents, - pkt_queued(pb, 0), + rx_slots_avail(pb), NETMAP_RXRING(pb->nifp, pb->cur_rx_ring)->head, - pkt_queued(pb, 1) + tx_slots_avail(pb) ); if (ret < 0) continue; if (pollfd[0].revents & POLLERR) { struct netmap_ring *rx = NETMAP_RXRING(pa->nifp, pa->cur_rx_ring); D("error on fd0, rx [%d,%d,%d)", - rx->head, rx->cur, rx->tail); + rx->head, rx->cur, rx->tail); } if (pollfd[1].revents & POLLERR) { struct netmap_ring *rx = NETMAP_RXRING(pb->nifp, pb->cur_rx_ring); D("error on fd1, rx [%d,%d,%d)", - rx->head, rx->cur, rx->tail); + rx->head, rx->cur, rx->tail); } if (pollfd[0].revents & POLLOUT) - move(pb, pa, burst); + ports_move(pb, pa, burst, msg_b2a); if (pollfd[1].revents & POLLOUT) - move(pa, pb, burst); + ports_move(pa, pb, burst, msg_a2b); - /* We don't need ioctl(NIOCTXSYNC) on the two file descriptors here, - * kernel will txsync on next poll(). */ + /* + * We don't need ioctl(NIOCTXSYNC) on the two file descriptors. + * here. The kernel will txsync on next poll(). + */ } nmport_close(pb); nmport_close(pa); From owner-svn-src-all@freebsd.org Sun Nov 22 15:05:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8320146B2A3 for ; Sun, 22 Nov 2020 15:05:02 +0000 (UTC) (envelope-from 3HH66Xw8JCwcpumv.msh3yylujlnthps.jvtz2u-zyj-hssmyllizk.vyn@trix.bounces.google.com) Received: from mail-yb1-xb45.google.com (mail-yb1-xb45.google.com [IPv6:2607:f8b0:4864:20::b45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfD994fy9z3Lps for ; Sun, 22 Nov 2020 15:05:01 +0000 (UTC) (envelope-from 3HH66Xw8JCwcpumv.msh3yylujlnthps.jvtz2u-zyj-hssmyllizk.vyn@trix.bounces.google.com) Received: by mail-yb1-xb45.google.com with SMTP id e19so19325167ybc.5 for ; Sun, 22 Nov 2020 07:05:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:message-id:date:subject:from:to; bh=9kaBt1dRbOtQO+vqbulpB7cP455BaerS3a/fvVYTVFg=; b=R7CcgDRoeO5C7bw5MB1p5PHOqKaClWS+/Z4n/kQJ6FoE7h/0h2HT5RJ2fZMsgRbyu7 sxH/VuHISxqKXvcJaqPS+YPz0KteUZRtqhimXp3kjafNMjQ7pZmwNPgFh1MWZ1EfnleT 6DmaYqGYPtCmHVUBqOBBwjhZ4pSBN84qf0a+2WxzVl1BxB7bB3QvLXuKDdszdTMGCWP0 dTpyVUdOF/x9lr4oAx2HXUMNxugLI+6H0ZNgJ6+h4+ViAo1dyKskcLiv3AdReUcyuwum CMswHu3HFbWoxi6PVj15h4mq17Cx4RJJ7nscstivdk/RpG34k0I3BD2F9KBKL0xY3soR tN4Q== 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:message-id:date:subject :from:to; bh=9kaBt1dRbOtQO+vqbulpB7cP455BaerS3a/fvVYTVFg=; b=CFuU6/2lsz56i/gxKDJvL4eeyR5/aZNUQVpcBSj48KzD/PJmGijKGpsFpklG+Q2Phn 73u2OX+2xIPxb9RqUzS7rK5DMwYtUxPCms9EB2DBWjVYP2nVMnK54XrnAGCMaXELBhTk 2ku9qYI1jzN8ThLtMAhSBpBb9DCgPut5YY8nrOkGMB9/pD0PIMWg/b3TIMEFYn2IiGh+ JLB/Aoz5d5GvAJwUW96SIoa5u1v4+i2AxIe5rHneBmCDz8Ktli1dxwEconQRwQv5mIJD ekXg4hWfz+dUaFtJfQ36gU88ys5nIrueas/GG3c9b8+vMiGIxC821mACQ/q3S1yMstyx Ct0w== X-Gm-Message-State: AOAM533i3j+LpScHoHUbI9yo1vZ1yDjsIEUM+ZwLneOGgiUL0IFUAj1o deN9PWejaUlgFHsmLglCFvWoOSWbqvg+DC+tHFA= MIME-Version: 1.0 X-Received: by 2002:a25:a525:: with SMTP id h34mt27231793ybi.284.1606057500531; Sun, 22 Nov 2020 07:05:00 -0800 (PST) Reply-To: info.flawrrence@gmail.com X-No-Auto-Attachment: 1 Message-ID: <000000000000ceebbf05b4b366e3@google.com> Date: Sun, 22 Nov 2020 15:05:00 +0000 Subject: Please reply me. From: info.flawrrence@gmail.com To: svn-src-all@freebsd.org X-Rspamd-Queue-Id: 4CfD994fy9z3Lps X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=R7CcgDRo; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of 3HH66Xw8JCwcpumv.msh3yylujlnthps.jvtz2u-zyj-hssmyllizk.vyn@trix.bounces.google.com designates 2607:f8b0:4864:20::b45 as permitted sender) smtp.mailfrom=3HH66Xw8JCwcpumv.msh3yylujlnthps.jvtz2u-zyj-hssmyllizk.vyn@trix.bounces.google.com X-Spamd-Result: default: False [0.30 / 15.00]; HAS_REPLYTO(0.00)[info.flawrrence@gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FORGED_SENDER(0.30)[infoflawrrence@gmail.com,3HH66Xw8JCwcpumv.msh3yylujlnthps.jvtz2u-zyj-hssmyllizk.vyn@trix.bounces.google.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; INTRODUCTION(2.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[infoflawrrence@gmail.com,3HH66Xw8JCwcpumv.msh3yylujlnthps.jvtz2u-zyj-hssmyllizk.vyn@trix.bounces.google.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::b45:from]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::b45:from:127.0.2.255]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_SPAM_SHORT(1.00)[1.000]; FROM_NO_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b45:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all] Content-Type: text/plain; charset="UTF-8"; format=flowed; delsp=yes X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 15:05:02 -0000 I've invited you to fill out the following form: Untitled form To fill it out, visit: https://docs.google.com/forms/d/e/1FAIpQLSc2u0UVcYiA4d9YEqoR_keG8JMefthbl8VsaY-VPmFzah0EGA/viewform?vc=0&c=0&w=1&flr=0&usp=mail_form_link Hello, My name is Mrs. Irene Dakuku, I am writing to invite you to my Charity project, I will be ready to donate some money for you to carry on the project in your country. I will give you further details upon your reply. PLEASE REPLY ME ONLY ON MY THIS PRIVATE EMAIL ADDRESS: mrs.dakuku@gmail.com Yours Sincerely, Mrs Irene. mrs.dakuku@gmail.com Google Forms: Create and analyze surveys. From owner-svn-src-all@freebsd.org Sun Nov 22 15:23:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0ADB946B973; Sun, 22 Nov 2020 15:23:38 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfDZd6m7Vz3NB8; Sun, 22 Nov 2020 15:23:37 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-qt1-f180.google.com with SMTP id f27so1506617qtv.6; Sun, 22 Nov 2020 07:23:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=osKpDiHL4TbAbQq/3GRFDalYtB+vuFQHhZy94NK93ws=; b=c4Q7QmBJ4lwDvo8GojwfHKXl1zCUcHvIbdNSeQjXmoDY9H1fS3pomgHJHrfCExRMlJ 9ATAq+I8KZGR0VAJxes6I7Jr9bkyRGFHm6G/GTHQzeuM3QIZU7LNVmQIlOwWVhcLcuF9 TPihO3ydwdjU14rw02CPZ67czF8n203Sti++h/gaoShH9IC0/skxsX4z9iVc84k71Jiv PDD6N7XjoZFY49UUJsnNhIEkTf8NOVxkeWj9YxeUudeiIrL8l8+EbIygiXhj7F2Wk5+1 4jUDvAoNDLXW8M6rgPUPm4l4Vx+SY2Fasd+d5y0bHUyEoJf8iMSXD6nz7YMCE9F9Nl+Y 6w6A== X-Gm-Message-State: AOAM531uNOsL0DsibUmsz4W3TED8kAh/52/ElDLg5DrK4IE1A3KA6F82 Jk7/DOliy7fQn8bDSajftbSPZUUFZB0= X-Google-Smtp-Source: ABdhPJwNnzqX7LOSzYANxPQGoR4dYmAU5CGaxYz1w9EGYSwtbrkiPS2sCb0wPH/KQZ6ABhiW9sZGjw== X-Received: by 2002:ac8:641:: with SMTP id e1mr24973120qth.226.1606058616238; Sun, 22 Nov 2020 07:23:36 -0800 (PST) Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com. [209.85.219.54]) by smtp.gmail.com with ESMTPSA id l8sm6524411qtj.93.2020.11.22.07.23.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Nov 2020 07:23:35 -0800 (PST) Received: by mail-qv1-f54.google.com with SMTP id p12so5110278qvj.13; Sun, 22 Nov 2020 07:23:35 -0800 (PST) X-Received: by 2002:a05:6214:40d:: with SMTP id z13mr7764qvx.60.1606058615886; Sun, 22 Nov 2020 07:23:35 -0800 (PST) MIME-Version: 1.0 References: <202011220542.0AM5groZ077734@repo.freebsd.org> In-Reply-To: <202011220542.0AM5groZ077734@repo.freebsd.org> From: Kyle Evans Date: Sun, 22 Nov 2020 09:23:24 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r367929 - head/sys/dev/isp To: Alexander Motin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4CfDZd6m7Vz3NB8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 15:23:38 -0000 On Sat, Nov 21, 2020 at 11:43 PM Alexander Motin wrote: > > Author: mav > Date: Sun Nov 22 05:42:52 2020 > New Revision: 367929 > URL: https://svnweb.freebsd.org/changeset/base/367929 > > Log: > Fix build after 367926. > > Option ISP_TARGET_MODE is evil. > The LINT build appears to be broken following these, see: https://ci.freebsd.org/job/FreeBSD-head-amd64-LINT/18514/console 09:02:49 --- isp_freebsd.o --- 09:02:49 /workspace/src/sys/dev/isp/isp_freebsd.c:1483:26: error: more '%' conversions than data arguments [-Werror,-Wformat] 09:02:49 KASSERT(atp == NULL, ("%s: atp is not NULL on noresrc!\n")); 09:02:49 ~^ From owner-svn-src-all@freebsd.org Sun Nov 22 15:53:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F078C46C597; Sun, 22 Nov 2020 15:53:51 +0000 (UTC) (envelope-from guyyur@gmail.com) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfFFW6GpFz3PkR; Sun, 22 Nov 2020 15:53:51 +0000 (UTC) (envelope-from guyyur@gmail.com) Received: by mail-wm1-x332.google.com with SMTP id c9so15568339wml.5; Sun, 22 Nov 2020 07:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=JF+dcUSrNzWxGW/+RjCz2YghkSyoLJx9qtHZauTB5rw=; b=XY9EBWN81IyG6bXiJQKbglETBSDsFL8edWKJmy1xwAUE5FPvpI2L/E07Y+lctxIBIW 8yWvfVHjWyO07iVwgNMgd/ejVJjsYkxYZENzCpWCR5zx9A8YoV6H3E5Smtl2QN5CHvr+ 9Px1jsDjsxrRFxftz026J8EsINV7hPPoaMZPN9k2OFpn2/22CBhhRpQbb/L4qWjFciUn SEeifaPaOhS0WH4Ig5H61Py9Bbc0BvZuOleauP8Hwm8Bv+bIhEmRLpDiWUjFlmlANBCu DX8lvFZZm+4jJZfJd/AUR56BILjgcY+eJn7YyS9/XHSvNMy78h3hmXaoDdQMNWR0Po7e TDOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=JF+dcUSrNzWxGW/+RjCz2YghkSyoLJx9qtHZauTB5rw=; b=JsKIJUD3vwnO+j327xPCWW6dOnXrBrCZMUOQOkXK9J75yUeazzy+I4MlhhZjwo3GHh EjYw0QwdLfyAk65Tk1ifKsTJ/c1kP7b2HfB/gM46DxTm98z/YMXekDxE/OSMe8XdfpWZ JfqCIknchV3VOEHqwWx6E8YZiOwtHvaeFm0ZOgWOS3N6ZPqZrzbE3iW4115xS4gmTQvG 6R8G4BGqfnwsiVtKlJm9XnM8bElWBXvKD+S4L2TR7ZfmOzpeyyeKIib4SxXH4gzG15Jc KEvRNoOWp5TLOYKLixj+QWESjFdKKOlagFhVz5QS++ISLOM2mZS7TR5WF133MwFjRJvm iUbg== X-Gm-Message-State: AOAM532Wc47WI+SRMcmaCQckenrgGMsbGz7fdT2lfHYdBguK62XFL+2w dHsFJjbgnem9XRSsLL2yDsDiRBi3n0bdTz3c X-Google-Smtp-Source: ABdhPJwMTGU1oOL6J93Q3WQDH0lwSgArxSP1y0qUulNcFZZITM26D9aSM9qV/OPLxDZlNHaNz4LlyQ== X-Received: by 2002:a1c:5f83:: with SMTP id t125mr19322022wmb.82.1606060429725; Sun, 22 Nov 2020 07:53:49 -0800 (PST) Received: from ?IPv6:2a02:ed0:33ff:5501:33e8:8c9b:8d89:594d? ([2a02:ed0:33ff:5501:33e8:8c9b:8d89:594d]) by smtp.gmail.com with ESMTPSA id z17sm2963429wmf.15.2020.11.22.07.53.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Nov 2020 07:53:49 -0800 (PST) Subject: Re: svn commit: r367927 - in head: sys/kern tests/sys/kern To: Robert Wing References: <202011220500.0AM50Tml047660@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Guy Yur Message-ID: <75a09790-79d8-f539-e118-acf32b6bc65e@gmail.com> Date: Sun, 22 Nov 2020 17:53:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 MIME-Version: 1.0 In-Reply-To: <202011220500.0AM50Tml047660@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 4CfFFW6GpFz3PkR X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 15:53:52 -0000 On 22/11/20 7:00 am, Robert Wing wrote: > Author: rew > Date: Sun Nov 22 05:00:28 2020 > New Revision: 367927 > URL: https://svnweb.freebsd.org/changeset/base/367927 > > Log: > fd: free old file descriptor tables when not shared > > During the life of a process, new file descriptor tables may be allocated. When > a new table is allocated, the old table is placed in a free list and held onto > until all processes referencing them exit. > > When a new file descriptor table is allocated, the old file descriptor table > can be freed when the current process has a single-thread and the file > descriptor table is not being shared with any other processes. > > Reviewed by: kevans > Approved by: kevans (mentor) > Differential Revision: https://reviews.freebsd.org/D18617 > > Added: > head/tests/sys/kern/fdgrowtable_test.c (contents, props changed) > Modified: > head/sys/kern/kern_descrip.c > head/tests/sys/kern/Makefile Hi, I am getting a kernel panic with this commit when building devel/gmake port and it runs dup2 test in configure script. panic: fc_ioctls != NULL, but fc_nioctls=-16162 ... #10 0xffffffff80655c72 in vpanic (fmt=, ap=)     at /usr/src/sys/kern/kern_shutdown.c:907 #11 0xffffffff80655a03 in panic (     fmt=0xffffffff80eb2b78 "헝\200\377\377\377\377")     at /usr/src/sys/kern/kern_shutdown.c:843 #12 0xffffffff805fff9a in filecaps_copy_prep (src=)     at /usr/src/sys/kern/kern_descrip.c:1629 #13 kern_dup (td=, mode=, flags=0,     old=, new=256) at /usr/src/sys/kern/kern_descrip.c:970 #14 0xffffffff8094a5de in syscallenter (td=)     at /usr/src/sys/amd64/amd64/../../kern/subr_syscall.c:189 #15 amd64_syscall (td=0xfffffe00513f8500, traced=0)     at /usr/src/sys/amd64/amd64/trap.c:1156 Simplified test program that causes panic: #include #include int main () {   int bad_fd = INT_MAX;   dup2 (1, 1);   close (0);   dup2 (0, 0);   dup2 (2, bad_fd);   dup2 (2, -1);   dup2 (2, 255);   dup2 (2, 256);   return 0; } Thanks, Guy Yur From owner-svn-src-all@freebsd.org Sun Nov 22 16:13:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0898746CCF6; Sun, 22 Nov 2020 16:13:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfFgn5rMFz3QkG; Sun, 22 Nov 2020 16:13:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBC121CF2C; Sun, 22 Nov 2020 16:13:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AMGD9pY068912; Sun, 22 Nov 2020 16:13:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AMGD9CU068911; Sun, 22 Nov 2020 16:13:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011221613.0AMGD9CU068911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 22 Nov 2020 16:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367937 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 367937 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 16:13:10 -0000 Author: mav Date: Sun Nov 22 16:13:09 2020 New Revision: 367937 URL: https://svnweb.freebsd.org/changeset/base/367937 Log: Fix debug build after 367926. Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Sun Nov 22 13:39:21 2020 (r367936) +++ head/sys/dev/isp/isp_freebsd.c Sun Nov 22 16:13:09 2020 (r367937) @@ -1480,7 +1480,7 @@ isp_handle_platform_atio7(ispsoftc_t *isp, at7_entry_t xpt_done((union ccb *)atiop); return; noresrc: - KASSERT(atp == NULL, ("%s: atp is not NULL on noresrc!\n")); + KASSERT(atp == NULL, ("%s: atp is not NULL on noresrc!\n", __func__)); ntp = isp_get_ntpd(isp, chan); if (ntp == NULL) { isp_endcmd(isp, aep, nphdl, chan, SCSI_STATUS_BUSY, 0); From owner-svn-src-all@freebsd.org Sun Nov 22 16:13:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F070746CC71; Sun, 22 Nov 2020 16:13:47 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfFhW5s5Nz3Qnq; Sun, 22 Nov 2020 16:13:47 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-qt1-x82a.google.com with SMTP id l7so4881980qtp.8; Sun, 22 Nov 2020 08:13:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sKkPHvDD6ZXGx6+eSjEuG297hmzwC/nVFsrGYCjLWck=; b=tOBLeIbOfeTMNq5lZ3K/vxDVbG3x8FERYJevRAsZI5N1DOMs0OwqTpea+wFy2S2TK4 mnoC3MRUxMrqt7ulLTgrmEElc7THJKj5MoORd6dLl68FhpfJr109GhpZEEV8IIf8asU2 BLaGz30P+14f76pKeN5dnUiB4SFA/F1Qwl+pu+PKeI2dq5FT77prT0Lc8WfqRV6OI06J W4O6TjsZZ0u1UQDwMANyQxFUwk8GDjfHNCPt4A/tiuEX+wQAEEOd50c1m7z7wLk503PZ YAP6JxWKEj5F8XDMTE2g0ueox0MXjxFw6Rva/nIFYycoLfi1HbUbw5NYZzz7khR9TRij JN4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=sKkPHvDD6ZXGx6+eSjEuG297hmzwC/nVFsrGYCjLWck=; b=e3LweR+fRAqot5rMNfuD8kDsYtsdQ+DvErnqufZzHBviZ4hDZRhWLqBAMD05Cy0B+M +DYPjaphSyN5B/xoCy18xIuCfa5Q4X5JOhf9Iqe1b4qEQmFUks5qKFhv1vkfrFq6fBnN +0SQZoPGDKbx+K4J9I3xfEL2dT2KGhszQGsV9h+9qiimtBAm1bjw/x/vbHZpRNYWNG39 jy3JGmG4b78VHOf4gEXVcqzMB1J8D2Fg6bW2bTz9KpM9gBa7wfOQX9mwdGRIFllKYWyl Q6nksz3GC+/Awk+dNMBLs28k/1vktgk1Zw8gHCNksi+ICnU4WXzS5U9uo46qfzjdANxn N2iA== X-Gm-Message-State: AOAM530jKv73Mwi32k82frXATxPBjJv8a8j0+V+04XZYnZWQnuBxazs5 hSMAKJaGpcBt6/IsxkXq36uY2obhv0Krlw== X-Google-Smtp-Source: ABdhPJy4XkxRBPFBC1y5ovOcgc2D2UDpTXkAJalCdHf+kNcIOnAokCf/slrQ69kVUe8RF8zByLlryQ== X-Received: by 2002:ac8:a04:: with SMTP id b4mr11349778qti.42.1606061626546; Sun, 22 Nov 2020 08:13:46 -0800 (PST) Received: from spectre.mavhome.dp.ua ([2600:1700:3580:3560:228:f8ff:fe04:d12]) by smtp.gmail.com with ESMTPSA id d188sm7071727qkb.10.2020.11.22.08.13.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Nov 2020 08:13:45 -0800 (PST) Sender: Alexander Motin Subject: Re: svn commit: r367929 - head/sys/dev/isp To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head References: <202011220542.0AM5groZ077734@repo.freebsd.org> From: Alexander Motin Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAG0IUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raS5AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczM AAoJEIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLq A6xe6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHu uC5vgPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15Gc sS9YcQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9 TevwGsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCg lz65AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6ZAXgD tmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8FlvmI/c 40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt3ytU 8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZR1Ed EIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm59R8A EQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczMAAoJ EIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLqA6xe 6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHuuC5v gPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15GcsS9Y cQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9Tevw Gsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCglz4= Message-ID: <9b72eb1f-765d-410f-10d6-ec39649ebc89@FreeBSD.org> Date: Sun, 22 Nov 2020 11:13:44 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CfFhW5s5Nz3Qnq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 16:13:48 -0000 On 22.11.2020 10:23, Kyle Evans wrote: > On Sat, Nov 21, 2020 at 11:43 PM Alexander Motin wrote: >> Author: mav >> Date: Sun Nov 22 05:42:52 2020 >> New Revision: 367929 >> URL: https://svnweb.freebsd.org/changeset/base/367929 >> >> Log: >> Fix build after 367926. >> >> Option ISP_TARGET_MODE is evil. >> > > The LINT build appears to be broken following these, see: > https://ci.freebsd.org/job/FreeBSD-head-amd64-LINT/18514/console > > 09:02:49 --- isp_freebsd.o --- > 09:02:49 /workspace/src/sys/dev/isp/isp_freebsd.c:1483:26: error: more > '%' conversions than data arguments [-Werror,-Wformat] > 09:02:49 KASSERT(atp == NULL, ("%s: atp is not NULL on noresrc!\n")); > 09:02:49 ~^ Fixed in r367937. Thanks. -- Alexander Motin From owner-svn-src-all@freebsd.org Sun Nov 22 16:36:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E1B546D456; Sun, 22 Nov 2020 16:36:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfGBP1kKMz3hRH; Sun, 22 Nov 2020 16:36:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 29757634B; Sun, 22 Nov 2020 16:36:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f178.google.com with SMTP id d28so14193775qka.11; Sun, 22 Nov 2020 08:36:13 -0800 (PST) X-Gm-Message-State: AOAM531/ICnUoX7RL78mXRXfh7Y72bJ7ANTf84RLGDOuDj27REXlBXw8 hHCuC6pyauRqI3TmtKPiIMBbWXwdpmANsmH+Lj0= X-Google-Smtp-Source: ABdhPJyU7J4nWpqYohbNgZotIY3wNFoc36MI6ju7Ah7f/aMC8n3Sqwtf2juUiEN3Lq4Ze5jpCnFtRLpvU05CgUXLi80= X-Received: by 2002:a37:9f82:: with SMTP id i124mr26297433qke.493.1606062972827; Sun, 22 Nov 2020 08:36:12 -0800 (PST) MIME-Version: 1.0 References: <202011220500.0AM50Tml047660@repo.freebsd.org> <75a09790-79d8-f539-e118-acf32b6bc65e@gmail.com> In-Reply-To: <75a09790-79d8-f539-e118-acf32b6bc65e@gmail.com> From: Kyle Evans Date: Sun, 22 Nov 2020 10:36:01 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r367927 - in head: sys/kern tests/sys/kern To: Guy Yur Cc: Robert Wing , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 16:36:13 -0000 On Sun, Nov 22, 2020 at 9:54 AM Guy Yur wrote: > > On 22/11/20 7:00 am, Robert Wing wrote: > > Author: rew > > Date: Sun Nov 22 05:00:28 2020 > > New Revision: 367927 > > URL: https://svnweb.freebsd.org/changeset/base/367927 > > > > Log: > > fd: free old file descriptor tables when not shared > > > > During the life of a process, new file descriptor tables may be allo= cated. When > > a new table is allocated, the old table is placed in a free list and= held onto > > until all processes referencing them exit. > > > > When a new file descriptor table is allocated, the old file descript= or table > > can be freed when the current process has a single-thread and the fi= le > > descriptor table is not being shared with any other processes. > > > > Reviewed by: kevans > > Approved by: kevans (mentor) > > Differential Revision: https://reviews.freebsd.org/D18617 > > > > Added: > > head/tests/sys/kern/fdgrowtable_test.c (contents, props changed) > > Modified: > > head/sys/kern/kern_descrip.c > > head/tests/sys/kern/Makefile > > Hi, > > I am getting a kernel panic with this commit when building > devel/gmake port and it runs dup2 test in configure script. > > panic: fc_ioctls !=3D NULL, but fc_nioctls=3D-16162 > ... > #10 0xffffffff80655c72 in vpanic (fmt=3D, ap=3D) > at /usr/src/sys/kern/kern_shutdown.c:907 > #11 0xffffffff80655a03 in panic ( > fmt=3D0xffffffff80eb2b78 "=ED=97=9D\200\377\377\377\377= ") > at /usr/src/sys/kern/kern_shutdown.c:843 > #12 0xffffffff805fff9a in filecaps_copy_prep (src=3D) > at /usr/src/sys/kern/kern_descrip.c:1629 > #13 kern_dup (td=3D, mode=3D, flags=3D0, > old=3D, new=3D256) at /usr/src/sys/kern/kern_descrip.= c:970 > #14 0xffffffff8094a5de in syscallenter (td=3D) > at /usr/src/sys/amd64/amd64/../../kern/subr_syscall.c:189 > #15 amd64_syscall (td=3D0xfffffe00513f8500, traced=3D0) > at /usr/src/sys/amd64/amd64/trap.c:1156 > > > Simplified test program that causes panic: > #include > #include > > int main () > { > int bad_fd =3D INT_MAX; > dup2 (1, 1); > close (0); > dup2 (0, 0); > dup2 (2, bad_fd); > dup2 (2, -1); > dup2 (2, 255); > dup2 (2, 256); > return 0; > } > Whoops. =3D\ It looks like kern_dup grows the file table but assumes that it can continue using oldfe that it fetched from the now-freed table. I suspect we just need to refetch oldfde after the grow operation, and it might be a good idea (under INVARIANTS) to grab the fp from oldfde before we grow the table and assert that the new entry we fetch is the same underlying file. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Sun Nov 22 17:25:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1280046E734; Sun, 22 Nov 2020 17:25:14 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfHGx6GjMz3kZX; Sun, 22 Nov 2020 17:25:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id BD4587030; Sun, 22 Nov 2020 17:25:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f173.google.com with SMTP id u4so14279247qkk.10; Sun, 22 Nov 2020 09:25:13 -0800 (PST) X-Gm-Message-State: AOAM531MomXISRBMA59PW5HHXT30578LqYu0uo4g+3vnPQ2O9eKXcv0b A6DDq5qv7sAQTNahLSo4lDR9LEk9+pgVmMeWnxE= X-Google-Smtp-Source: ABdhPJzCLoJCxRtgaOBO+9xMX37EUZS9pv/9jduxZbRaNe52wbi7Ll6vVfYuJlsOAatDVXVfnBBZOGmgu+HVZ6ZvzS8= X-Received: by 2002:a37:9f82:: with SMTP id i124mr26486629qke.493.1606065913252; Sun, 22 Nov 2020 09:25:13 -0800 (PST) MIME-Version: 1.0 References: <202011220500.0AM50Tml047660@repo.freebsd.org> <75a09790-79d8-f539-e118-acf32b6bc65e@gmail.com> In-Reply-To: From: Kyle Evans Date: Sun, 22 Nov 2020 11:25:02 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r367927 - in head: sys/kern tests/sys/kern To: Guy Yur Cc: Robert Wing , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 17:25:14 -0000 On Sun, Nov 22, 2020 at 10:36 AM Kyle Evans wrote: > > On Sun, Nov 22, 2020 at 9:54 AM Guy Yur wrote: > > > > On 22/11/20 7:00 am, Robert Wing wrote: > > > Author: rew > > > Date: Sun Nov 22 05:00:28 2020 > > > New Revision: 367927 > > > URL: https://svnweb.freebsd.org/changeset/base/367927 > > > > > > Log: > > > fd: free old file descriptor tables when not shared > > > > > > During the life of a process, new file descriptor tables may be al= located. When > > > a new table is allocated, the old table is placed in a free list a= nd held onto > > > until all processes referencing them exit. > > > > > > When a new file descriptor table is allocated, the old file descri= ptor table > > > can be freed when the current process has a single-thread and the = file > > > descriptor table is not being shared with any other processes. > > > > > > Reviewed by: kevans > > > Approved by: kevans (mentor) > > > Differential Revision: https://reviews.freebsd.org/D18617 > > > > > > Added: > > > head/tests/sys/kern/fdgrowtable_test.c (contents, props changed) > > > Modified: > > > head/sys/kern/kern_descrip.c > > > head/tests/sys/kern/Makefile > > > > Hi, > > > > I am getting a kernel panic with this commit when building > > devel/gmake port and it runs dup2 test in configure script. > > > > panic: fc_ioctls !=3D NULL, but fc_nioctls=3D-16162 > > ... > > #10 0xffffffff80655c72 in vpanic (fmt=3D, ap=3D) > > at /usr/src/sys/kern/kern_shutdown.c:907 > > #11 0xffffffff80655a03 in panic ( > > fmt=3D0xffffffff80eb2b78 "=ED=97=9D\200\377\377\377\3= 77") > > at /usr/src/sys/kern/kern_shutdown.c:843 > > #12 0xffffffff805fff9a in filecaps_copy_prep (src=3D) > > at /usr/src/sys/kern/kern_descrip.c:1629 > > #13 kern_dup (td=3D, mode=3D, flags=3D0, > > old=3D, new=3D256) at /usr/src/sys/kern/kern_descri= p.c:970 > > #14 0xffffffff8094a5de in syscallenter (td=3D) > > at /usr/src/sys/amd64/amd64/../../kern/subr_syscall.c:189 > > #15 amd64_syscall (td=3D0xfffffe00513f8500, traced=3D0) > > at /usr/src/sys/amd64/amd64/trap.c:1156 > > > > > > Simplified test program that causes panic: > > #include > > #include > > > > int main () > > { > > int bad_fd =3D INT_MAX; > > dup2 (1, 1); > > close (0); > > dup2 (0, 0); > > dup2 (2, bad_fd); > > dup2 (2, -1); > > dup2 (2, 255); > > dup2 (2, 256); > > return 0; > > } > > > > Whoops. =3D\ > > It looks like kern_dup grows the file table but assumes that it can > continue using oldfe that it fetched from the now-freed table. I > suspect we just need to refetch oldfde after the grow operation, and > it might be a good idea (under INVARIANTS) to grab the fp from oldfde > before we grow the table and assert that the new entry we fetch is the > same underlying file. > I can confirm that the below fixes it and no other growth spots keep pointers into the old table around, I'll give it a little bit for any objections to be raised then commit. diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index b5680bd79e1..1a3a5cafbea 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -936,6 +936,12 @@ kern_dup(struct thread *td, u_int mode, int flags, int old, int new) break; case FDDUP_FIXED: if (new >=3D fdp->fd_nfiles) { +#ifdef INVARIANTS + struct file *ofp; + + ofp =3D oldfde->fde_file; +#endif + /* * The resource limits are here instead of e.g. * fdalloc(), because the file descriptor table may= be @@ -955,6 +961,11 @@ kern_dup(struct thread *td, u_int mode, int flags, int old, int new) } #endif fdgrowtable_exp(fdp, new + 1); + /* Refetch; old entry may be invalid. */ + oldfde =3D &fdp->fd_ofiles[old]; + KASSERT(ofp =3D=3D oldfde->fde_file, + ("fdt_ofiles shift from growth observed at fd %= d", + old)); } if (!fdisused(fdp, new)) fdused(fdp, new); From owner-svn-src-all@freebsd.org Sun Nov 22 17:26:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D428F46E9CA for ; Sun, 22 Nov 2020 17:26:22 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfHJG3lP1z3kc4 for ; Sun, 22 Nov 2020 17:26:22 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 6BB9A75D5 for ; Sun, 22 Nov 2020 17:26:22 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f178.google.com with SMTP id d9so14286648qke.8 for ; Sun, 22 Nov 2020 09:26:22 -0800 (PST) X-Gm-Message-State: AOAM533pPIGkMJ7WsKBm+RPIwgZ5x4C98i5N78tZUa/+K84PdfkgaDZ4 O/oVn+xrWLU8wYYGRNGqNG7ylozHkRsjc2EvNjo= X-Received: by 2002:a37:9ecc:: with SMTP id h195mt27818120qke.103.1606065982051; Sun, 22 Nov 2020 09:26:22 -0800 (PST) MIME-Version: 1.0 References: <202011220500.0AM50Tml047660@repo.freebsd.org> <75a09790-79d8-f539-e118-acf32b6bc65e@gmail.com> In-Reply-To: From: Kyle Evans Date: Sun, 22 Nov 2020 11:26:11 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r367927 - in head: sys/kern tests/sys/kern Cc: Guy Yur , Robert Wing , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 17:26:22 -0000 On Sun, Nov 22, 2020 at 11:25 AM Kyle Evans wrote: > > On Sun, Nov 22, 2020 at 10:36 AM Kyle Evans wrote: > > > > On Sun, Nov 22, 2020 at 9:54 AM Guy Yur wrote: > > > > > > On 22/11/20 7:00 am, Robert Wing wrote: > > > > Author: rew > > > > Date: Sun Nov 22 05:00:28 2020 > > > > New Revision: 367927 > > > > URL: https://svnweb.freebsd.org/changeset/base/367927 > > > > > > > > Log: > > > > fd: free old file descriptor tables when not shared > > > > > > > > During the life of a process, new file descriptor tables may be = allocated. When > > > > a new table is allocated, the old table is placed in a free list= and held onto > > > > until all processes referencing them exit. > > > > > > > > When a new file descriptor table is allocated, the old file desc= riptor table > > > > can be freed when the current process has a single-thread and th= e file > > > > descriptor table is not being shared with any other processes. > > > > > > > > Reviewed by: kevans > > > > Approved by: kevans (mentor) > > > > Differential Revision: https://reviews.freebsd.org/D18617 > > > > > > > > Added: > > > > head/tests/sys/kern/fdgrowtable_test.c (contents, props change= d) > > > > Modified: > > > > head/sys/kern/kern_descrip.c > > > > head/tests/sys/kern/Makefile > > > > > > Hi, > > > > > > I am getting a kernel panic with this commit when building > > > devel/gmake port and it runs dup2 test in configure script. > > > > > > panic: fc_ioctls !=3D NULL, but fc_nioctls=3D-16162 > > > ... > > > #10 0xffffffff80655c72 in vpanic (fmt=3D, ap=3D) > > > at /usr/src/sys/kern/kern_shutdown.c:907 > > > #11 0xffffffff80655a03 in panic ( > > > fmt=3D0xffffffff80eb2b78 "=ED=97=9D\200\377\377\377= \377") > > > at /usr/src/sys/kern/kern_shutdown.c:843 > > > #12 0xffffffff805fff9a in filecaps_copy_prep (src=3D) > > > at /usr/src/sys/kern/kern_descrip.c:1629 > > > #13 kern_dup (td=3D, mode=3D, flags=3D0= , > > > old=3D, new=3D256) at /usr/src/sys/kern/kern_desc= rip.c:970 > > > #14 0xffffffff8094a5de in syscallenter (td=3D) > > > at /usr/src/sys/amd64/amd64/../../kern/subr_syscall.c:189 > > > #15 amd64_syscall (td=3D0xfffffe00513f8500, traced=3D0) > > > at /usr/src/sys/amd64/amd64/trap.c:1156 > > > > > > > > > Simplified test program that causes panic: > > > #include > > > #include > > > > > > int main () > > > { > > > int bad_fd =3D INT_MAX; > > > dup2 (1, 1); > > > close (0); > > > dup2 (0, 0); > > > dup2 (2, bad_fd); > > > dup2 (2, -1); > > > dup2 (2, 255); > > > dup2 (2, 256); > > > return 0; > > > } > > > > > > > Whoops. =3D\ > > > > It looks like kern_dup grows the file table but assumes that it can > > continue using oldfe that it fetched from the now-freed table. I > > suspect we just need to refetch oldfde after the grow operation, and > > it might be a good idea (under INVARIANTS) to grab the fp from oldfde > > before we grow the table and assert that the new entry we fetch is the > > same underlying file. > > > > I can confirm that the below fixes it and no other growth spots keep > pointers into the old table around, I'll give it a little bit for any > objections to be raised then commit. > Bah, sorry, this still isn't right. The other paths may grow the table via fdalloc(). I'll throw up a review for this shortly. From owner-svn-src-all@freebsd.org Sun Nov 22 18:42:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73B5B470DD7; Sun, 22 Nov 2020 18:42:09 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfJzj2shBz3pgW; Sun, 22 Nov 2020 18:42:09 +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 54D6B1ED99; Sun, 22 Nov 2020 18:42:09 +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 0AMIg9Hj062338; Sun, 22 Nov 2020 18:42:09 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AMIg98j062337; Sun, 22 Nov 2020 18:42:09 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011221842.0AMIg98j062337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 22 Nov 2020 18:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367938 - head/release/arm64 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/release/arm64 X-SVN-Commit-Revision: 367938 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 18:42:09 -0000 Author: manu Date: Sun Nov 22 18:42:08 2020 New Revision: 367938 URL: https://svnweb.freebsd.org/changeset/base/367938 Log: release: rpi3: Copy the bcm2710 variant of the rpi2 This is the dtb intented to be used for booting RPI2 v1.2 in aarch64. Modified: head/release/arm64/RPI3.conf Modified: head/release/arm64/RPI3.conf ============================================================================== --- head/release/arm64/RPI3.conf Sun Nov 22 16:13:09 2020 (r367937) +++ head/release/arm64/RPI3.conf Sun Nov 22 18:42:08 2020 (r367938) @@ -4,7 +4,7 @@ # DTB_DIR="/usr/local/share/rpi-firmware" -DTB="bcm2709-rpi-2-b.dtb bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb bcm2711-rpi-4-b.dtb" +DTB="bcm2710-rpi-2-b.dtb bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb bcm2711-rpi-4-b.dtb" EMBEDDED_TARGET_ARCH="aarch64" EMBEDDED_TARGET="arm64" EMBEDDEDBUILD=1 From owner-svn-src-all@freebsd.org Sun Nov 22 18:54:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB0B1471248; Sun, 22 Nov 2020 18:54:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfKFf6JBCz3r2q; Sun, 22 Nov 2020 18:54:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAF7B1F1FB; Sun, 22 Nov 2020 18:54:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AMIsEJM068734; Sun, 22 Nov 2020 18:54:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AMIsEdR068731; Sun, 22 Nov 2020 18:54:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011221854.0AMIsEdR068731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 22 Nov 2020 18:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367939 - in stable/12: share/man/man4 sys/dev/ntb/ntb_hw X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/ntb/ntb_hw X-SVN-Commit-Revision: 367939 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 18:54:15 -0000 Author: markj Date: Sun Nov 22 18:54:14 2020 New Revision: 367939 URL: https://svnweb.freebsd.org/changeset/base/367939 Log: MFC r366969, r366973: ntb: Add Intel Xeon Gen3 support Modified: stable/12/share/man/man4/ntb_hw_intel.4 stable/12/sys/dev/ntb/ntb_hw/ntb_hw_intel.c stable/12/sys/dev/ntb/ntb_hw/ntb_hw_intel.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/ntb_hw_intel.4 ============================================================================== --- stable/12/share/man/man4/ntb_hw_intel.4 Sun Nov 22 18:42:08 2020 (r367938) +++ stable/12/share/man/man4/ntb_hw_intel.4 Sun Nov 22 18:54:14 2020 (r367939) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 30, 2017 +.Dd October 11, 2020 .Dt NTB_HW_INTEL 4 .Os .Sh NAME @@ -50,16 +50,18 @@ The driver provides support for the Non-Transparent Bridge (NTB) hardware in Intel Xeon E3/E5 and S1200 processor families, which allow one of their PCIe ports to be switched from transparent to non-transparent bridge mode. -In this mode bridge looks not as a PCI bridge, but as PCI endpoint device. +In this mode the bridge looks not like a PCI bridge, but like a PCI endpoint +device. The driver hides hardware details, exposing memory windows, scratchpads -and doorbells of the other side via hardware independent KPI to +and doorbells of the other side via a hardware independent KPI to the .Xr ntb 4 subsystem. .Pp The hardware provides 2 or 3 memory windows to the other system's memory, -16 scratchpad registers and 14 or 34 doorbells to interrupt the other system. -On Xeon processors one of memory windows is typically consumed by the driver -itself to workaround multiple hardware erratas. +16 scratchpad registers and 14, 31 or 34 doorbells to interrupt the other +system, depending on the platform. +On Xeon processors one of the memory windows is typically consumed by the driver +itself to work around multiple hardware errata. .Sh CONFIGURATION The NTB configuration should be set by BIOS. It includes enabling NTB, choosing between NTB-to-NTB (back-to-back) or @@ -67,9 +69,10 @@ NTB-to-Root Port mode, enabling split BAR mode (one of two 64-bit BARs can be split into two 32-bit ones) and configuring BAR sizes in bits (from 12 to 29/39) for both NTB sides. .Pp -The recommended configuration is NTB-to-NTB mode, split bar is enabled and -all BAR sizes are set to 20 (1 MiB). +The recommended configuration is NTB-to-NTB mode, split bar enabled and +all BAR sizes set to 20 (1 MiB). This needs to be done on both systems. +Note, on Xeon SkyLake and newer platforms, split bar mode is not available. .Sh SEE ALSO .Xr if_ntb 4 , .Xr ntb_transport 4 , Modified: stable/12/sys/dev/ntb/ntb_hw/ntb_hw_intel.c ============================================================================== --- stable/12/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Sun Nov 22 18:42:08 2020 (r367938) +++ stable/12/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Sun Nov 22 18:54:14 2020 (r367939) @@ -64,7 +64,8 @@ __FBSDID("$FreeBSD$"); #include "ntb_hw_intel.h" #include "../ntb.h" -#define MAX_MSIX_INTERRUPTS MAX(XEON_DB_COUNT, ATOM_DB_COUNT) +#define MAX_MSIX_INTERRUPTS \ + MAX(MAX(XEON_DB_COUNT, ATOM_DB_COUNT), XEON_GEN3_DB_COUNT) #define NTB_HB_TIMEOUT 1 /* second */ #define ATOM_LINK_RECOVERY_TIME 500 /* ms */ @@ -83,7 +84,8 @@ __FBSDID("$FreeBSD$"); #define PCI_MSIX_ENTRY_DATA 8 enum ntb_device_type { - NTB_XEON, + NTB_XEON_GEN1, + NTB_XEON_GEN3, NTB_ATOM }; @@ -334,6 +336,7 @@ static int map_memory_window_bar(struct ntb_softc *ntb static void intel_ntb_unmap_pci_bar(struct ntb_softc *ntb); static int intel_ntb_remap_msix(device_t, uint32_t desired, uint32_t avail); static int intel_ntb_init_isr(struct ntb_softc *ntb); +static int intel_ntb_xeon_gen3_init_isr(struct ntb_softc *ntb); static int intel_ntb_setup_legacy_interrupt(struct ntb_softc *ntb); static int intel_ntb_setup_msix(struct ntb_softc *ntb, uint32_t num_vectors); static void intel_ntb_teardown_interrupts(struct ntb_softc *ntb); @@ -351,8 +354,10 @@ static void intel_ntb_exchange_msix(void *); static struct ntb_hw_info *intel_ntb_get_device_info(uint32_t device_id); static void intel_ntb_detect_max_mw(struct ntb_softc *ntb); static int intel_ntb_detect_xeon(struct ntb_softc *ntb); +static int intel_ntb_detect_xeon_gen3(struct ntb_softc *ntb); static int intel_ntb_detect_atom(struct ntb_softc *ntb); static int intel_ntb_xeon_init_dev(struct ntb_softc *ntb); +static int intel_ntb_xeon_gen3_init_dev(struct ntb_softc *ntb); static int intel_ntb_atom_init_dev(struct ntb_softc *ntb); static void intel_ntb_teardown_xeon(struct ntb_softc *ntb); static void configure_atom_secondary_side_bars(struct ntb_softc *ntb); @@ -364,6 +369,9 @@ static void xeon_set_pbar_xlat(struct ntb_softc *, uin enum ntb_bar idx); static int xeon_setup_b2b_mw(struct ntb_softc *, const struct ntb_b2b_addr *addr, const struct ntb_b2b_addr *peer_addr); +static int xeon_gen3_setup_b2b_mw(struct ntb_softc *); +static int intel_ntb_mw_set_trans(device_t dev, unsigned idx, bus_addr_t addr, + size_t size); static inline bool link_is_up(struct ntb_softc *ntb); static inline bool _xeon_link_is_up(struct ntb_softc *ntb); static inline bool atom_link_is_err(struct ntb_softc *ntb); @@ -475,6 +483,7 @@ SYSCTL_INT(_hw_ntb, OID_AUTO, b2b_mw_idx, CTLFLAG_RDTU #define NTB_B2BDOORBELL_BIT14 (1 << 3) /* Software/configuration owns the top 16 bits. */ #define NTB_SPLIT_BAR (1ull << 16) +#define NTB_ONE_MSIX (1ull << 17) #define NTB_FEATURES_STR \ "\20\21SPLIT_BAR4\04B2B_DOORBELL_BIT14\03SB01BASE_LOCKUP" \ @@ -486,18 +495,21 @@ static struct ntb_hw_info pci_ids[] = { NTB_ATOM, 0 }, { 0x37258086, "JSF Xeon C35xx/C55xx Non-Transparent Bridge B2B", - NTB_XEON, NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 }, + NTB_XEON_GEN1, NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 }, { 0x3C0D8086, "SNB Xeon E5/Core i7 Non-Transparent Bridge B2B", - NTB_XEON, NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 }, - { 0x0E0D8086, "IVT Xeon E5 V2 Non-Transparent Bridge B2B", NTB_XEON, - NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 | + NTB_XEON_GEN1, NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 }, + { 0x0E0D8086, "IVT Xeon E5 V2 Non-Transparent Bridge B2B", + NTB_XEON_GEN1, NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 | NTB_SB01BASE_LOCKUP | NTB_BAR_SIZE_4K }, - { 0x2F0D8086, "HSX Xeon E5 V3 Non-Transparent Bridge B2B", NTB_XEON, - NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 | + { 0x2F0D8086, "HSX Xeon E5 V3 Non-Transparent Bridge B2B", + NTB_XEON_GEN1, NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 | NTB_SB01BASE_LOCKUP }, - { 0x6F0D8086, "BDX Xeon E5 V4 Non-Transparent Bridge B2B", NTB_XEON, - NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 | + { 0x6F0D8086, "BDX Xeon E5 V4 Non-Transparent Bridge B2B", + NTB_XEON_GEN1, NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 | NTB_SB01BASE_LOCKUP }, + + { 0x201C8086, "SKL Xeon E5 V5 Non-Transparent Bridge B2B", + NTB_XEON_GEN3, 0 }, }; static const struct ntb_reg atom_reg = { @@ -582,7 +594,38 @@ static struct ntb_b2b_addr xeon_b2b_dsd_addr = { .bar5_addr32 = XEON_B2B_BAR5_ADDR32, }; -SYSCTL_NODE(_hw_ntb, OID_AUTO, xeon_b2b, CTLFLAG_RW, 0, +static const struct ntb_reg xeon_gen3_reg = { + .ntb_ctl = XEON_GEN3_REG_IMNTB_CTRL, + .lnk_sta = XEON_GEN3_INT_LNK_STS_OFFSET, + .db_size = sizeof(uint32_t), + .mw_bar = { NTB_B2B_BAR_1, NTB_B2B_BAR_2 }, +}; + +static const struct ntb_alt_reg xeon_gen3_pri_reg = { + .db_bell = XEON_GEN3_REG_EMDOORBELL, + .db_mask = XEON_GEN3_REG_IMINT_DISABLE, + .spad = XEON_GEN3_REG_IMSPAD, +}; + +static const struct ntb_alt_reg xeon_gen3_b2b_reg = { + .db_bell = XEON_GEN3_REG_IMDOORBELL, + .db_mask = XEON_GEN3_REG_EMINT_DISABLE, + .spad = XEON_GEN3_REG_IMB2B_SSPAD, +}; + +static const struct ntb_xlat_reg xeon_gen3_sec_xlat = { + .bar0_base = XEON_GEN3_EXT_REG_BAR0BASE, + .bar2_base = XEON_GEN3_EXT_REG_BAR1BASE, + .bar4_base = XEON_GEN3_EXT_REG_BAR2BASE, + + .bar2_limit = XEON_GEN3_REG_IMBAR1XLIMIT, + .bar4_limit = XEON_GEN3_REG_IMBAR2XLIMIT, + + .bar2_xlat = XEON_GEN3_REG_IMBAR1XBASE, + .bar4_xlat = XEON_GEN3_REG_IMBAR2XBASE, +}; + +SYSCTL_NODE(_hw_ntb, OID_AUTO, xeon_b2b, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "B2B MW segment overrides -- MUST be the same on both sides"); SYSCTL_UQUAD(_hw_ntb_xeon_b2b, OID_AUTO, usd_bar2_addr64, CTLFLAG_RDTUN, @@ -658,6 +701,8 @@ intel_ntb_attach(device_t device) if (ntb->type == NTB_ATOM) error = intel_ntb_detect_atom(ntb); + else if (ntb->type == NTB_XEON_GEN3) + error = intel_ntb_detect_xeon_gen3(ntb); else error = intel_ntb_detect_xeon(ntb); if (error != 0) @@ -672,6 +717,8 @@ intel_ntb_attach(device_t device) goto out; if (ntb->type == NTB_ATOM) error = intel_ntb_atom_init_dev(ntb); + else if (ntb->type == NTB_XEON_GEN3) + error = intel_ntb_xeon_gen3_init_dev(ntb); else error = intel_ntb_xeon_init_dev(ntb); if (error != 0) @@ -711,7 +758,7 @@ intel_ntb_detach(device_t device) callout_drain(&ntb->lr_timer); callout_drain(&ntb->peer_msix_work); pci_disable_busmaster(ntb->device); - if (ntb->type == NTB_XEON) + if (ntb->type == NTB_XEON_GEN1) intel_ntb_teardown_xeon(ntb); intel_ntb_teardown_interrupts(ntb); @@ -821,22 +868,39 @@ intel_ntb_map_pci_bars(struct ntb_softc *ntb) rc = map_memory_window_bar(ntb, bar); if (rc != 0) goto out; - bar->psz_off = XEON_PBAR23SZ_OFFSET; - bar->ssz_off = XEON_SBAR23SZ_OFFSET; - bar->pbarxlat_off = XEON_PBAR2XLAT_OFFSET; + if (ntb->type == NTB_XEON_GEN3) { + bar->psz_off = XEON_GEN3_INT_REG_IMBAR1SZ; + bar->ssz_off = XEON_GEN3_INT_REG_EMBAR1SZ; + bar->pbarxlat_off = XEON_GEN3_REG_EMBAR1XBASE; + } else { + bar->psz_off = XEON_PBAR23SZ_OFFSET; + bar->ssz_off = XEON_SBAR23SZ_OFFSET; + bar->pbarxlat_off = XEON_PBAR2XLAT_OFFSET; + } bar = &ntb->bar_info[NTB_B2B_BAR_2]; bar->pci_resource_id = PCIR_BAR(4); rc = map_memory_window_bar(ntb, bar); if (rc != 0) goto out; - bar->psz_off = XEON_PBAR4SZ_OFFSET; - bar->ssz_off = XEON_SBAR4SZ_OFFSET; - bar->pbarxlat_off = XEON_PBAR4XLAT_OFFSET; + if (ntb->type == NTB_XEON_GEN3) { + bar->psz_off = XEON_GEN3_INT_REG_IMBAR2SZ; + bar->ssz_off = XEON_GEN3_INT_REG_EMBAR2SZ; + bar->pbarxlat_off = XEON_GEN3_REG_EMBAR2XBASE; + } else { + bar->psz_off = XEON_PBAR4SZ_OFFSET; + bar->ssz_off = XEON_SBAR4SZ_OFFSET; + bar->pbarxlat_off = XEON_PBAR4XLAT_OFFSET; + } if (!HAS_FEATURE(ntb, NTB_SPLIT_BAR)) goto out; + if (ntb->type == NTB_XEON_GEN3) { + device_printf(ntb->device, "no split bar support\n"); + return (ENXIO); + } + bar = &ntb->bar_info[NTB_B2B_BAR_3]; bar->pci_resource_id = PCIR_BAR(5); rc = map_memory_window_bar(ntb, bar); @@ -1056,6 +1120,63 @@ intel_ntb_remap_msix(device_t dev, uint32_t desired, u } static int +intel_ntb_xeon_gen3_init_isr(struct ntb_softc *ntb) +{ + uint64_t i, reg; + uint32_t desired_vectors, num_vectors; + int rc; + + ntb->allocated_interrupts = 0; + ntb->last_ts = ticks; + + /* Mask all the interrupts, including hardware interrupt */ + intel_ntb_reg_write(8, XEON_GEN3_REG_IMINT_DISABLE, ~0ULL); + + /* Clear Interrupt Status */ + reg = intel_ntb_reg_read(8, XEON_GEN3_REG_IMINT_STATUS); + intel_ntb_reg_write(8, XEON_GEN3_REG_IMINT_STATUS, reg); + + num_vectors = desired_vectors = MIN(pci_msix_count(ntb->device), + XEON_GEN3_DB_MSIX_VECTOR_COUNT); + + rc = pci_alloc_msix(ntb->device, &num_vectors); + if (rc != 0) { + device_printf(ntb->device, + "Interrupt allocation failed %d\n", rc); + return (rc); + } + if (desired_vectors != num_vectors) { + device_printf(ntb->device, "Couldn't get %d vectors\n", + XEON_GEN3_DB_MSIX_VECTOR_COUNT); + return (ENXIO); + } + /* 32 db + 1 hardware */ + if (num_vectors == XEON_GEN3_DB_MSIX_VECTOR_COUNT) { + /* Program INTVECXX source register */ + for (i = 0; i < XEON_GEN3_DB_MSIX_VECTOR_COUNT; i++) { + /* interrupt source i for vector i */ + intel_ntb_reg_write(1, XEON_GEN3_REG_IMINTVEC00 + i, i); + if (i == (XEON_GEN3_DB_MSIX_VECTOR_COUNT - 1)) { + intel_ntb_reg_write(1, + XEON_GEN3_REG_IMINTVEC00 + i, + XEON_GEN3_LINK_VECTOR_INDEX); + } + } + + intel_ntb_create_msix_vec(ntb, num_vectors); + rc = intel_ntb_setup_msix(ntb, num_vectors); + + /* enable all interrupts */ + intel_ntb_reg_write(8, XEON_GEN3_REG_IMINT_DISABLE, 0ULL); + } else { + device_printf(ntb->device, "need to remap interrupts, giving up.\n"); + return (ENXIO); + } + + return (0); +} + +static int intel_ntb_init_isr(struct ntb_softc *ntb) { uint32_t desired_vectors, num_vectors; @@ -1094,7 +1215,7 @@ intel_ntb_init_isr(struct ntb_softc *ntb) } else num_vectors = 1; - if (ntb->type == NTB_XEON && num_vectors < ntb->db_vec_count) { + if (ntb->type == NTB_XEON_GEN1 && num_vectors < ntb->db_vec_count) { if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { device_printf(ntb->device, "Errata workaround does not support MSI or INTX\n"); @@ -1173,20 +1294,17 @@ intel_ntb_teardown_interrupts(struct ntb_softc *ntb) pci_release_msi(ntb->device); } -/* - * Doorbell register and mask are 64-bit on Atom, 16-bit on Xeon. Abstract it - * out to make code clearer. - */ static inline uint64_t db_ioread(struct ntb_softc *ntb, uint64_t regoff) { - if (ntb->type == NTB_ATOM) + switch (ntb->type) { + case NTB_ATOM: + case NTB_XEON_GEN3: return (intel_ntb_reg_read(8, regoff)); - - KASSERT(ntb->type == NTB_XEON, ("bad ntb type")); - - return (intel_ntb_reg_read(2, regoff)); + case NTB_XEON_GEN1: + return (intel_ntb_reg_read(2, regoff)); + } } static inline void @@ -1207,13 +1325,15 @@ static inline void db_iowrite_raw(struct ntb_softc *ntb, uint64_t regoff, uint64_t val) { - if (ntb->type == NTB_ATOM) { + switch (ntb->type) { + case NTB_ATOM: + case NTB_XEON_GEN3: intel_ntb_reg_write(8, regoff, val); - return; + break; + case NTB_XEON_GEN1: + intel_ntb_reg_write(2, regoff, (uint16_t)val); + break; } - - KASSERT(ntb->type == NTB_XEON, ("bad ntb type")); - intel_ntb_reg_write(2, regoff, (uint16_t)val); } static void @@ -1263,8 +1383,10 @@ intel_ntb_db_read(device_t dev) if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) return (ntb->fake_db); - - return (db_ioread(ntb, ntb->self_reg->db_bell)); + if (ntb->type == NTB_XEON_GEN3) + return (intel_ntb_reg_read(8, XEON_GEN3_REG_IMINT_STATUS)); + else + return (db_ioread(ntb, ntb->self_reg->db_bell)); } static void @@ -1284,7 +1406,11 @@ intel_ntb_db_clear(device_t dev, uint64_t bits) return; } - db_iowrite(ntb, ntb->self_reg->db_bell, bits); + if (ntb->type == NTB_XEON_GEN3) + intel_ntb_reg_write(4, XEON_GEN3_REG_IMINT_STATUS, + (uint32_t)bits); + else + db_iowrite(ntb, ntb->self_reg->db_bell, bits); } static inline uint64_t @@ -1318,9 +1444,14 @@ intel_ntb_interrupt(struct ntb_softc *ntb, uint32_t ve ntb->last_ts = ticks; vec_mask = intel_ntb_vec_mask(ntb, vec); + if (ntb->type == NTB_XEON_GEN3 && vec == XEON_GEN3_LINK_VECTOR_INDEX) + vec_mask |= ntb->db_link_mask; if ((vec_mask & ntb->db_link_mask) != 0) { if (intel_ntb_poll_link(ntb)) ntb_link_event(ntb->device); + if (ntb->type == NTB_XEON_GEN3) + intel_ntb_reg_write(8, XEON_GEN3_REG_IMINT_STATUS, + intel_ntb_reg_read(8, XEON_GEN3_REG_IMINT_STATUS)); } if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP) && @@ -1445,15 +1576,23 @@ static void intel_ntb_detect_max_mw(struct ntb_softc *ntb) { - if (ntb->type == NTB_ATOM) { + switch (ntb->type) { + case NTB_ATOM: ntb->mw_count = ATOM_MW_COUNT; - return; + break; + case NTB_XEON_GEN1: + if (HAS_FEATURE(ntb, NTB_SPLIT_BAR)) + ntb->mw_count = XEON_HSX_SPLIT_MW_COUNT; + else + ntb->mw_count = XEON_SNB_MW_COUNT; + break; + case NTB_XEON_GEN3: + if (HAS_FEATURE(ntb, NTB_SPLIT_BAR)) + ntb->mw_count = XEON_GEN3_SPLIT_MW_COUNT; + else + ntb->mw_count = XEON_GEN3_MW_COUNT; + break; } - - if (HAS_FEATURE(ntb, NTB_SPLIT_BAR)) - ntb->mw_count = XEON_HSX_SPLIT_MW_COUNT; - else - ntb->mw_count = XEON_SNB_MW_COUNT; } static int @@ -1530,6 +1669,54 @@ intel_ntb_detect_atom(struct ntb_softc *ntb) } static int +intel_ntb_detect_xeon_gen3(struct ntb_softc *ntb) +{ + uint8_t ppd, conn_type; + + ppd = pci_read_config(ntb->device, XEON_GEN3_INT_REG_PPD, 1); + ntb->ppd = ppd; + + /* check port definition */ + conn_type = XEON_GEN3_REG_PPD_PORT_DEF_F(ppd); + switch (conn_type) { + case NTB_CONN_B2B: + ntb->conn_type = conn_type; + break; + default: + device_printf(ntb->device, "Unsupported connection type: %u\n", + conn_type); + return (ENXIO); + } + + /* check cross link configuration status */ + if (XEON_GEN3_REG_PPD_CONF_STS_F(ppd)) { + /* NTB Port is configured as DSD/USP */ + ntb->dev_type = NTB_DEV_DSD; + } else { + /* NTB Port is configured as USD/DSP */ + ntb->dev_type = NTB_DEV_USD; + } + + if (XEON_GEN3_REG_PPD_ONE_MSIX_F(ppd)) { + /* + * This bit when set, causes only a single MSI-X message to be + * generated if MSI-X is enabled. + */ + ntb->features |= NTB_ONE_MSIX; + } + + if (XEON_GEN3_REG_PPD_BAR45_SPL_F(ppd)) { + /* BARs 4 and 5 are presented as two 32b non-prefetchable BARs */ + ntb->features |= NTB_SPLIT_BAR; + } + + device_printf(ntb->device, "conn type 0x%02x, dev type 0x%02x," + "features 0x%02x\n", ntb->conn_type, ntb->dev_type, ntb->features); + + return (0); +} + +static int intel_ntb_xeon_init_dev(struct ntb_softc *ntb) { int rc; @@ -1614,6 +1801,42 @@ intel_ntb_xeon_init_dev(struct ntb_softc *ntb) } static int +intel_ntb_xeon_gen3_init_dev(struct ntb_softc *ntb) +{ + int rc; + + ntb->spad_count = XEON_GEN3_SPAD_COUNT; + ntb->db_count = XEON_GEN3_DB_COUNT; + ntb->db_link_mask = XEON_GEN3_DB_LINK_BIT; + ntb->db_vec_count = XEON_GEN3_DB_MSIX_VECTOR_COUNT; + ntb->db_vec_shift = XEON_GEN3_DB_MSIX_VECTOR_SHIFT; + + if (ntb->conn_type != NTB_CONN_B2B) { + device_printf(ntb->device, "Connection type %d not supported\n", + ntb->conn_type); + return (ENXIO); + } + + ntb->reg = &xeon_gen3_reg; + ntb->self_reg = &xeon_gen3_pri_reg; + ntb->peer_reg = &xeon_gen3_b2b_reg; + ntb->xlat_reg = &xeon_gen3_sec_xlat; + + ntb->db_valid_mask = (1ULL << ntb->db_count) - 1; + + xeon_gen3_setup_b2b_mw(ntb); + + /* Enable Bus Master and Memory Space on the External Side */ + intel_ntb_reg_write(2, XEON_GEN3_EXT_REG_PCI_CMD, + PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN); + + /* Setup Interrupt */ + rc = intel_ntb_xeon_gen3_init_isr(ntb); + + return (rc); +} + +static int intel_ntb_atom_init_dev(struct ntb_softc *ntb) { int error; @@ -1905,6 +2128,50 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, const struct return (0); } +static int +xeon_gen3_setup_b2b_mw(struct ntb_softc *ntb) +{ + uint64_t reg; + uint32_t embarsz, imbarsz; + + /* IMBAR1SZ should be equal to EMBAR1SZ */ + embarsz = pci_read_config(ntb->device, XEON_GEN3_INT_REG_EMBAR1SZ, 1); + imbarsz = pci_read_config(ntb->device, XEON_GEN3_INT_REG_IMBAR1SZ, 1); + if (embarsz != imbarsz) { + device_printf(ntb->device, + "IMBAR1SZ (%u) should be equal to EMBAR1SZ (%u)\n", + imbarsz, embarsz); + return (EIO); + } + + /* IMBAR2SZ should be equal to EMBAR2SZ */ + embarsz = pci_read_config(ntb->device, XEON_GEN3_INT_REG_EMBAR2SZ, 1); + imbarsz = pci_read_config(ntb->device, XEON_GEN3_INT_REG_IMBAR2SZ, 1); + if (embarsz != imbarsz) { + device_printf(ntb->device, + "IMBAR2SZ (%u) should be equal to EMBAR2SZ (%u)\n", + imbarsz, embarsz); + return (EIO); + } + + /* Client will provide the incoming IMBAR1/2XBASE, zero it for now */ + intel_ntb_reg_write(8, XEON_GEN3_REG_IMBAR1XBASE, 0); + intel_ntb_reg_write(8, XEON_GEN3_REG_IMBAR2XBASE, 0); + + /* + * If the value in EMBAR1LIMIT is set equal to the value in EMBAR1, + * the memory window for EMBAR1 is disabled. + * Note: It is needed to avoid malacious access. + */ + reg = pci_read_config(ntb->device, XEON_GEN3_EXT_REG_BAR1BASE, 8); + intel_ntb_reg_write(8, XEON_GEN3_REG_IMBAR1XLIMIT, reg); + + reg = pci_read_config(ntb->device, XEON_GEN3_EXT_REG_BAR2BASE, 8); + intel_ntb_reg_write(8, XEON_GEN3_REG_IMBAR2XLIMIT, reg); + + return (0); +} + static inline bool _xeon_link_is_up(struct ntb_softc *ntb) { @@ -1918,7 +2185,7 @@ static inline bool link_is_up(struct ntb_softc *ntb) { - if (ntb->type == NTB_XEON) + if (ntb->type == NTB_XEON_GEN1 || ntb->type == NTB_XEON_GEN3) return (_xeon_link_is_up(ntb) && (ntb->peer_msix_good || !HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP))); @@ -2182,7 +2449,9 @@ intel_ntb_poll_link(struct ntb_softc *ntb) ntb->ntb_ctl = ntb_cntl; ntb->lnk_sta = intel_ntb_reg_read(4, ntb->reg->lnk_sta); } else { - db_iowrite_raw(ntb, ntb->self_reg->db_bell, ntb->db_link_mask); + if (ntb->type == NTB_XEON_GEN1) + db_iowrite_raw(ntb, ntb->self_reg->db_bell, + ntb->db_link_mask); reg_val = pci_read_config(ntb->device, ntb->reg->lnk_sta, 2); if (reg_val == ntb->lnk_sta) @@ -2953,6 +3222,8 @@ intel_ntb_mw_set_trans(device_t dev, unsigned idx, bus if (limit_reg != 0 && size != mw_size) limit = base + size; + else + limit = base + mw_size; /* Set and verify translation address */ intel_ntb_reg_write(8, xlat_reg, addr); @@ -2970,8 +3241,22 @@ intel_ntb_mw_set_trans(device_t dev, unsigned idx, bus intel_ntb_reg_write(8, xlat_reg, 0); return (EIO); } + + if (ntb->type == NTB_XEON_GEN3) { + limit = base + size; + + /* set EMBAR1/2XLIMIT */ + if (!idx) + intel_ntb_reg_write(8, + XEON_GEN3_REG_EMBAR1XLIMIT, limit); + else + intel_ntb_reg_write(8, + XEON_GEN3_REG_EMBAR2XLIMIT, limit); + } } else { /* Configure 32-bit (split) BAR MW */ + if (ntb->type == NTB_XEON_GEN3) + return (EIO); if ((addr & UINT32_MAX) != addr) return (ERANGE); @@ -3055,10 +3340,17 @@ intel_ntb_mw_set_wc_internal(struct ntb_softc *ntb, un } static void -intel_ntb_peer_db_set(device_t dev, uint64_t bit) +intel_ntb_peer_db_set(device_t dev, uint64_t bits) { struct ntb_softc *ntb = device_get_softc(dev); + uint64_t db; + if ((bits & ~ntb->db_valid_mask) != 0) { + device_printf(ntb->device, "Invalid doorbell bits %#jx\n", + (uintmax_t)bits); + return; + } + if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { struct ntb_pci_bar_info *lapic; unsigned i; @@ -3066,7 +3358,7 @@ intel_ntb_peer_db_set(device_t dev, uint64_t bit) lapic = ntb->peer_lapic_bar; for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { - if ((bit & intel_ntb_db_vector_mask(dev, i)) != 0) + if ((bits & intel_ntb_db_vector_mask(dev, i)) != 0) bus_space_write_4(lapic->pci_bus_tag, lapic->pci_bus_handle, ntb->peer_msix_data[i].nmd_ofs, @@ -3076,11 +3368,22 @@ intel_ntb_peer_db_set(device_t dev, uint64_t bit) } if (HAS_FEATURE(ntb, NTB_SDOORBELL_LOCKUP)) { - intel_ntb_mw_write(2, XEON_PDOORBELL_OFFSET, bit); + intel_ntb_mw_write(2, XEON_PDOORBELL_OFFSET, bits); return; } - db_iowrite(ntb, ntb->peer_reg->db_bell, bit); + if (ntb->type == NTB_XEON_GEN3) { + while (bits != 0) { + db = ffsll(bits); + + intel_ntb_reg_write(1, + ntb->peer_reg->db_bell + (db - 1) * 4, 0x1); + + bits = bits & (bits - 1); + } + } else { + db_iowrite(ntb, ntb->peer_reg->db_bell, bits); + } } static int Modified: stable/12/sys/dev/ntb/ntb_hw/ntb_hw_intel.h ============================================================================== --- stable/12/sys/dev/ntb/ntb_hw/ntb_hw_intel.h Sun Nov 22 18:42:08 2020 (r367938) +++ stable/12/sys/dev/ntb/ntb_hw/ntb_hw_intel.h Sun Nov 22 18:54:14 2020 (r367939) @@ -30,7 +30,26 @@ #ifndef _NTB_REGS_H_ #define _NTB_REGS_H_ +#include +#include +/*--------------------------------------------------------------------------- + * Macro: M*_M : Create a mask to isolate a bit field of a data word. + * M*_F : Extract value from a bit field of a data word. + * M*_I : Insert value into a bit field of a data word. + * + * Purpose: Bit field manipulation macros for mask, insert and extract for + * 8-bit, 16-bit, 32-bit and 64-bit data words. + * + * Params: [in] P = Bit position of start of the bit field (lsb is 0). + * [in] N = Size of the bit field in bits. + * [in] X = Value to insert or remove from the bit field. + *--------------------------------------------------------------------------- + */ +#define M8_M(P, N) ((UINT8_MAX >> (8 - (N))) << (P)) +#define M8_F(X, P, N) (((uint8_t)(X) & M8_M(P, N)) >> (P)) +#define M8_I(X, P, N) (((uint8_t)(X) << (P)) & M8_M(P, N)) + #define NTB_LINK_STATUS_ACTIVE 0x2000 #define NTB_LINK_SPEED_MASK 0x000f #define NTB_LINK_WIDTH_MASK 0x03f0 @@ -164,5 +183,73 @@ /* The peer ntb secondary config space is 32KB fixed size */ #define XEON_B2B_MIN_SIZE 0x8000 +#define XEON_GEN3_MW_COUNT 2 +#define XEON_GEN3_SPLIT_MW_COUNT 3 +#define XEON_GEN3_SPAD_COUNT 16 +#define XEON_GEN3_DB_COUNT 32 +#define XEON_GEN3_DB_LINK 32 +#define XEON_GEN3_DB_LINK_BIT (1ULL << XEON_GEN3_DB_LINK) +#define XEON_GEN3_DB_MSIX_VECTOR_COUNT 33 +#define XEON_GEN3_DB_MSIX_VECTOR_SHIFT 1 + +#define XEON_GEN3_LINK_VECTOR_INDEX 31 + +/* Xeon Skylake NTB register definitions */ + +/* + * Internal EndPoint Configuration Registers + */ +#define XEON_GEN3_INT_REG_BAR0BASE 0x10 +#define XEON_GEN3_INT_REG_BAR1BASE 0x18 +#define XEON_GEN3_INT_REG_BAR2BASE 0x20 +#define XEON_GEN3_INT_REG_IMBAR1SZ 0xd0 +#define XEON_GEN3_INT_REG_IMBAR2SZ 0xd1 +#define XEON_GEN3_INT_REG_EMBAR1SZ 0xd2 +#define XEON_GEN3_INT_REG_EMBAR2SZ 0xd3 +#define XEON_GEN3_INT_REG_PPD 0xd4 +#define XEON_GEN3_INT_LNK_STS_OFFSET 0x01a2 + +/* + * External EndPoint Configuration Registers + * These are located within BAR0 of the internal endpoint. + */ +#define XEON_GEN3_EXT_REG_PCI_CMD 0x4504 +#define XEON_GEN3_EXT_REG_BAR0BASE 0x4510 +#define XEON_GEN3_EXT_REG_BAR1BASE 0x4518 +#define XEON_GEN3_EXT_REG_BAR2BASE 0x4520 + +/* + * Internal Endpoint Memory Mapped Registers + */ +#define XEON_GEN3_REG_IMNTB_CTRL 0x0000 +#define XEON_GEN3_REG_IMBAR1XBASE 0x0010 +#define XEON_GEN3_REG_IMBAR1XLIMIT 0x0018 +#define XEON_GEN3_REG_IMBAR2XBASE 0x0020 +#define XEON_GEN3_REG_IMBAR2XLIMIT 0x0028 +#define XEON_GEN3_REG_IMINT_STATUS 0x0040 +#define XEON_GEN3_REG_IMINT_DISABLE 0x0048 +#define XEON_GEN3_REG_IMSPAD 0x0080 +#define XEON_GEN3_REG_IMINTVEC00 0x00d0 +#define XEON_GEN3_REG_IMDOORBELL 0x0100 +#define XEON_GEN3_REG_IMB2B_SSPAD 0x0180 /* Pseudo SP registers */ + +/* + * External Endpoint Memory Mapped Registers + */ +#define XEON_GEN3_REG_EMBAR0XBASE 0x4008 +#define XEON_GEN3_REG_EMBAR1XBASE 0x4010 +#define XEON_GEN3_REG_EMBAR1XLIMIT 0x4018 +#define XEON_GEN3_REG_EMBAR2XBASE 0x4020 +#define XEON_GEN3_REG_EMBAR2XLIMIT 0x4028 +#define XEON_GEN3_REG_EMINT_STATUS 0x4040 +#define XEON_GEN3_REG_EMINT_DISABLE 0x4048 +#define XEON_GEN3_REG_EMSPAD 0x4080 +#define XEON_GEN3_REG_EMDOORBELL 0x4100 + +/* XEON_GEN3_INT_REG_PPD: PPD register */ +#define XEON_GEN3_REG_PPD_PORT_DEF_F(X) M8_F(X, 0, 2) +#define XEON_GEN3_REG_PPD_CONF_STS_F(X) M8_F(X, 4, 1) +#define XEON_GEN3_REG_PPD_ONE_MSIX_F(X) M8_F(X, 5, 1) +#define XEON_GEN3_REG_PPD_BAR45_SPL_F(X) M8_F(X, 6, 1) #endif /* _NTB_REGS_H_ */ From owner-svn-src-all@freebsd.org Sun Nov 22 20:16:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5C4C473292; Sun, 22 Nov 2020 20:16:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfM4v5jN7z3vny; Sun, 22 Nov 2020 20:16:47 +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 B271420288; Sun, 22 Nov 2020 20:16:47 +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 0AMKGl0f018183; Sun, 22 Nov 2020 20:16:47 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AMKGlj3018182; Sun, 22 Nov 2020 20:16:47 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011222016.0AMKGlj3018182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 22 Nov 2020 20:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367940 - head/sys/dev/dwc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/dwc X-SVN-Commit-Revision: 367940 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 20:16:47 -0000 Author: manu Date: Sun Nov 22 20:16:46 2020 New Revision: 367940 URL: https://svnweb.freebsd.org/changeset/base/367940 Log: if_dwc: Correctly configure the DMA engine based on the fdt properties Do not hardcode what we setup for the DMA engine configuration but lookup the fdt properties and configuring accordingly. Use a default value of 8 for the burst dma length for both TX and RX, this is what we used for TX before. Modified: head/sys/dev/dwc/if_dwc.c head/sys/dev/dwc/if_dwc.h Modified: head/sys/dev/dwc/if_dwc.c ============================================================================== --- head/sys/dev/dwc/if_dwc.c Sun Nov 22 18:54:14 2020 (r367939) +++ head/sys/dev/dwc/if_dwc.c Sun Nov 22 20:16:46 2020 (r367940) @@ -1496,6 +1496,9 @@ dwc_attach(device_t dev) uint32_t reg; char *phy_mode; phandle_t node; + uint32_t txpbl, rxpbl; + bool nopblx8 = false; + bool fixed_burst = false; sc = device_get_softc(dev); sc->dev = dev; @@ -1513,6 +1516,15 @@ dwc_attach(device_t dev) OF_prop_free(phy_mode); } + if (OF_getencprop(node, "snps,txpbl", &txpbl, sizeof(uint32_t)) <= 0) + txpbl = 8; + if (OF_getencprop(node, "snps,rxpbl", &rxpbl, sizeof(uint32_t)) <= 0) + rxpbl = 8; + if (OF_hasprop(node, "snps,no-pbl-x8") == 1) + nopblx8 = true; + if (OF_hasprop(node, "snps,fixed-burst") == 1) + fixed_burst = true; + if (IF_DWC_INIT(dev) != 0) return (ENXIO); @@ -1550,12 +1562,13 @@ dwc_attach(device_t dev) return (ENXIO); } - if (sc->mactype != DWC_GMAC_EXT_DESC) { - reg = BUS_MODE_FIXEDBURST; - reg |= (BUS_MODE_PRIORXTX_41 << BUS_MODE_PRIORXTX_SHIFT); - } else - reg = (BUS_MODE_EIGHTXPBL); - reg |= (BUS_MODE_PBL_BEATS_8 << BUS_MODE_PBL_SHIFT); + reg = BUS_MODE_USP; + if (!nopblx8) + reg |= BUS_MODE_EIGHTXPBL; + reg |= (txpbl << BUS_MODE_PBL_SHIFT); + reg |= (rxpbl << BUS_MODE_RPBL_SHIFT); + if (fixed_burst) + reg |= BUS_MODE_FIXEDBURST; WRITE4(sc, BUS_MODE, reg); /* Modified: head/sys/dev/dwc/if_dwc.h ============================================================================== --- head/sys/dev/dwc/if_dwc.h Sun Nov 22 18:54:14 2020 (r367939) +++ head/sys/dev/dwc/if_dwc.h Sun Nov 22 20:16:46 2020 (r367940) @@ -220,6 +220,8 @@ /* DMA */ #define BUS_MODE 0x1000 #define BUS_MODE_EIGHTXPBL (1 << 24) /* Multiplies PBL by 8 */ +#define BUS_MODE_USP (1 << 23) +#define BUS_MODE_RPBL_SHIFT 17 /* Single block transfer size */ #define BUS_MODE_FIXEDBURST (1 << 16) #define BUS_MODE_PRIORXTX_SHIFT 14 #define BUS_MODE_PRIORXTX_41 3 From owner-svn-src-all@freebsd.org Sun Nov 22 20:21:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2AE5347363F; Sun, 22 Nov 2020 20:21:12 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfMB00mrxz3w9t; Sun, 22 Nov 2020 20:21:12 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D17A20298; Sun, 22 Nov 2020 20:21:12 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AMKLBqe018500; Sun, 22 Nov 2020 20:21:11 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AMKLAqq018492; Sun, 22 Nov 2020 20:21:10 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202011222021.0AMKLAqq018492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 22 Nov 2020 20:21:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367941 - in head/sys: net net/route netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: net net/route netinet netinet6 X-SVN-Commit-Revision: 367941 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.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 20:21:12 -0000 Author: melifaro Date: Sun Nov 22 20:21:10 2020 New Revision: 367941 URL: https://svnweb.freebsd.org/changeset/base/367941 Log: Refactor rib iterator functions. * Make rib_walk() order of arguments consistent with the rest of RIB api * Add rib_walk_ext() allowing to exec callback before/after iteration. * Rename rt_foreach_fib_walk_del -> rib_foreach_table_walk_del * Rename rt_forach_fib_walk -> rib_foreach_table_walk * Move rib_foreach_table_walk{_del} to route/route_helpers.c * Slightly refactor rib_foreach_table_walk{_del} to make the implementation consistent and prepare for upcoming iterator optimizations. Differential Revision: https://reviews.freebsd.org/D27219 Modified: head/sys/net/route.c head/sys/net/route.h head/sys/net/route/route_ctl.c head/sys/net/route/route_ctl.h head/sys/net/route/route_helpers.c head/sys/netinet/in_rmx.c head/sys/netinet6/nd6_rtr.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sun Nov 22 20:16:46 2020 (r367940) +++ head/sys/net/route.c Sun Nov 22 20:21:10 2020 (r367941) @@ -458,81 +458,6 @@ rib_free_info(struct rt_addrinfo *info) } /* - * Iterates over all existing fibs in system calling - * @setwa_f function prior to traversing each fib. - * Calls @wa_f function for each element in current fib. - * If af is not AF_UNSPEC, iterates over fibs in particular - * address family. - */ -void -rt_foreach_fib_walk(int af, rt_setwarg_t *setwa_f, rt_walktree_f_t *wa_f, - void *arg) -{ - struct rib_head *rnh; - uint32_t fibnum; - int i; - - for (fibnum = 0; fibnum < rt_numfibs; fibnum++) { - /* Do we want some specific family? */ - if (af != AF_UNSPEC) { - rnh = rt_tables_get_rnh(fibnum, af); - if (rnh == NULL) - continue; - if (setwa_f != NULL) - setwa_f(rnh, fibnum, af, arg); - - RIB_WLOCK(rnh); - rnh->rnh_walktree(&rnh->head, (walktree_f_t *)wa_f,arg); - RIB_WUNLOCK(rnh); - continue; - } - - for (i = 1; i <= AF_MAX; i++) { - rnh = rt_tables_get_rnh(fibnum, i); - if (rnh == NULL) - continue; - if (setwa_f != NULL) - setwa_f(rnh, fibnum, i, arg); - - RIB_WLOCK(rnh); - rnh->rnh_walktree(&rnh->head, (walktree_f_t *)wa_f,arg); - RIB_WUNLOCK(rnh); - } - } -} - -/* - * Iterates over all existing fibs in system and deletes each element - * for which @filter_f function returns non-zero value. - * If @family is not AF_UNSPEC, iterates over fibs in particular - * address family. - */ -void -rt_foreach_fib_walk_del(int family, rt_filter_f_t *filter_f, void *arg) -{ - u_int fibnum; - int i, start, end; - - for (fibnum = 0; fibnum < rt_numfibs; fibnum++) { - /* Do we want some specific family? */ - if (family != AF_UNSPEC) { - start = family; - end = family; - } else { - start = 1; - end = AF_MAX; - } - - for (i = start; i <= end; i++) { - if (rt_tables_get_rnh(fibnum, i) == NULL) - continue; - - rib_walk_del(fibnum, i, filter_f, arg, 0); - } - } -} - -/* * Delete Routes for a Network Interface * * Called for each routing entry via the rnh->rnh_walktree() call above @@ -577,14 +502,14 @@ rt_flushifroutes_af(struct ifnet *ifp, int af) KASSERT((af >= 1 && af <= AF_MAX), ("%s: af %d not >= 1 and <= %d", __func__, af, AF_MAX)); - rt_foreach_fib_walk_del(af, rt_ifdelroute, ifp); + rib_foreach_table_walk_del(af, rt_ifdelroute, ifp); } void rt_flushifroutes(struct ifnet *ifp) { - rt_foreach_fib_walk_del(AF_UNSPEC, rt_ifdelroute, ifp); + rib_foreach_table_walk_del(AF_UNSPEC, rt_ifdelroute, ifp); } /* Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sun Nov 22 20:16:46 2020 (r367940) +++ head/sys/net/route.h Sun Nov 22 20:21:10 2020 (r367941) @@ -342,7 +342,7 @@ struct rt_msghdr { struct rtentry; struct nhop_object; -typedef int rt_filter_f_t(const struct rtentry *, const struct nhop_object *, +typedef int rib_filter_f_t(const struct rtentry *, const struct nhop_object *, void *); struct rt_addrinfo { @@ -351,7 +351,7 @@ struct rt_addrinfo { struct sockaddr *rti_info[RTAX_MAX]; /* Sockaddr data */ struct ifaddr *rti_ifa; /* value of rt_ifa addr */ struct ifnet *rti_ifp; /* route interface */ - rt_filter_f_t *rti_filter; /* filter function */ + rib_filter_f_t *rti_filter; /* filter function */ void *rti_filterdata; /* filter paramenters */ u_long rti_mflags; /* metrics RTV_ flags */ u_long rti_spare; /* Will be used for fib */ Modified: head/sys/net/route/route_ctl.c ============================================================================== --- head/sys/net/route/route_ctl.c Sun Nov 22 20:16:46 2020 (r367940) +++ head/sys/net/route/route_ctl.c Sun Nov 22 20:21:10 2020 (r367941) @@ -1143,7 +1143,7 @@ rt_checkdelroute(struct radix_node *rn, void *arg) * @report: true if rtsock notification is needed. */ void -rib_walk_del(u_int fibnum, int family, rt_filter_f_t *filter_f, void *arg, bool report) +rib_walk_del(u_int fibnum, int family, rib_filter_f_t *filter_f, void *arg, bool report) { struct rib_head *rnh; struct rt_delinfo di; Modified: head/sys/net/route/route_ctl.h ============================================================================== --- head/sys/net/route/route_ctl.h Sun Nov 22 20:16:46 2020 (r367940) +++ head/sys/net/route/route_ctl.h Sun Nov 22 20:21:10 2020 (r367941) @@ -61,14 +61,24 @@ int rib_add_redirect(u_int fibnum, struct sockaddr *ds struct sockaddr *gateway, struct sockaddr *author, struct ifnet *ifp, int flags, int expire_sec); -typedef int rt_walktree_f_t(struct rtentry *, void *); -void rib_walk(int af, u_int fibnum, rt_walktree_f_t *wa_f, void *arg); -void rib_walk_del(u_int fibnum, int family, rt_filter_f_t *filter_f, +enum rib_walk_hook { + RIB_WALK_HOOK_PRE, /* Hook is called before iteration */ + RIB_WALK_HOOK_POST, /* Hook is called after iteration */ +}; +typedef int rib_walktree_f_t(struct rtentry *, void *); +typedef void rib_walk_hook_f_t(struct rib_head *rnh, enum rib_walk_hook stage, + void *arg); +void rib_walk(uint32_t fibnum, int af, bool wlock, rib_walktree_f_t *wa_f, + void *arg); +void rib_walk_ext(uint32_t fibnum, int af, bool wlock, rib_walktree_f_t *wa_f, + rib_walk_hook_f_t *hook_f, void *arg); + +void rib_walk_del(u_int fibnum, int family, rib_filter_f_t *filter_f, void *arg, bool report); -typedef void rt_setwarg_t(struct rib_head *, uint32_t, int, void *); -void rt_foreach_fib_walk(int af, rt_setwarg_t *, rt_walktree_f_t *, void *); -void rt_foreach_fib_walk_del(int af, rt_filter_f_t *filter_f, void *arg); +void rib_foreach_table_walk(int family, bool wlock, rib_walktree_f_t *wa_f, + rib_walk_hook_f_t *hook_f, void *arg); +void rib_foreach_table_walk_del(int family, rib_filter_f_t *filter_f, void *arg); struct route_nhop_data; const struct rtentry *rib_lookup_prefix(uint32_t fibnum, int family, Modified: head/sys/net/route/route_helpers.c ============================================================================== --- head/sys/net/route/route_helpers.c Sun Nov 22 20:16:46 2020 (r367940) +++ head/sys/net/route/route_helpers.c Sun Nov 22 20:21:10 2020 (r367941) @@ -71,21 +71,96 @@ __FBSDID("$FreeBSD$"); * Calls @wa_f with @arg for each entry in the table specified by * @af and @fibnum. * - * Table is traversed under read lock. + * @ss_t callback is called before and after the tree traversal + * while holding table lock. + * + * Table is traversed under read lock unless @wlock is set. */ void -rib_walk(int af, u_int fibnum, rt_walktree_f_t *wa_f, void *arg) +rib_walk_ext(uint32_t fibnum, int family, bool wlock, rib_walktree_f_t *wa_f, + rib_walk_hook_f_t *hook_f, void *arg) { RIB_RLOCK_TRACKER; struct rib_head *rnh; - if ((rnh = rt_tables_get_rnh(fibnum, af)) == NULL) + if ((rnh = rt_tables_get_rnh(fibnum, family)) == NULL) return; - RIB_RLOCK(rnh); + if (wlock) + RIB_WLOCK(rnh); + else + RIB_RLOCK(rnh); + if (hook_f != NULL) + hook_f(rnh, RIB_WALK_HOOK_PRE, arg); rnh->rnh_walktree(&rnh->head, (walktree_f_t *)wa_f, arg); - RIB_RUNLOCK(rnh); + if (hook_f != NULL) + hook_f(rnh, RIB_WALK_HOOK_POST, arg); + if (wlock) + RIB_WUNLOCK(rnh); + else + RIB_RUNLOCK(rnh); } + +/* + * Calls @wa_f with @arg for each entry in the table specified by + * @af and @fibnum. + * + * Table is traversed under read lock unless @wlock is set. + */ +void +rib_walk(uint32_t fibnum, int family, bool wlock, rib_walktree_f_t *wa_f, + void *arg) +{ + + rib_walk_ext(fibnum, family, wlock, wa_f, NULL, arg); +} + +/* + * Iterates over all existing fibs in system calling + * @hook_f function before/after traversing each fib. + * Calls @wa_f function for each element in current fib. + * If af is not AF_UNSPEC, iterates over fibs in particular + * address family. + */ +void +rib_foreach_table_walk(int family, bool wlock, rib_walktree_f_t *wa_f, + rib_walk_hook_f_t *hook_f, void *arg) +{ + + for (uint32_t fibnum = 0; fibnum < rt_numfibs; fibnum++) { + /* Do we want some specific family? */ + if (family != AF_UNSPEC) { + rib_walk_ext(fibnum, family, wlock, wa_f, hook_f, arg); + continue; + } + + for (int i = 1; i <= AF_MAX; i++) + rib_walk_ext(fibnum, i, wlock, wa_f, hook_f, arg); + } +} + +/* + * Iterates over all existing fibs in system and deletes each element + * for which @filter_f function returns non-zero value. + * If @family is not AF_UNSPEC, iterates over fibs in particular + * address family. + */ +void +rib_foreach_table_walk_del(int family, rib_filter_f_t *filter_f, void *arg) +{ + + for (uint32_t fibnum = 0; fibnum < rt_numfibs; fibnum++) { + /* Do we want some specific family? */ + if (family != AF_UNSPEC) { + rib_walk_del(fibnum, family, filter_f, arg, 0); + continue; + } + + for (int i = 1; i <= AF_MAX; i++) + rib_walk_del(fibnum, i, filter_f, arg, 0); + } +} + /* * Wrapper for the control plane functions for performing af-agnostic Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Sun Nov 22 20:16:46 2020 (r367940) +++ head/sys/netinet/in_rmx.c Sun Nov 22 20:21:10 2020 (r367941) @@ -178,6 +178,6 @@ in_ifadown(struct ifaddr *ifa, int delete) arg.ifa = ifa; arg.del = delete; - rt_foreach_fib_walk_del(AF_INET, in_ifadownkill, &arg); + rib_foreach_table_walk_del(AF_INET, in_ifadownkill, &arg); ifa->ifa_flags &= ~IFA_ROUTE; /* XXXlocking? */ } Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Sun Nov 22 20:16:46 2020 (r367940) +++ head/sys/netinet6/nd6_rtr.c Sun Nov 22 20:21:10 2020 (r367941) @@ -2460,7 +2460,7 @@ rt6_flush(struct in6_addr *gateway, struct ifnet *ifp) return; /* XXX Do we really need to walk any but the default FIB? */ - rt_foreach_fib_walk_del(AF_INET6, rt6_deleteroute, (void *)gateway); + rib_foreach_table_walk_del(AF_INET6, rt6_deleteroute, (void *)gateway); } int From owner-svn-src-all@freebsd.org Sun Nov 22 22:02:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F20EA47687E; Sun, 22 Nov 2020 22:02:33 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfPQx6YNFz4X4q; Sun, 22 Nov 2020 22:02:33 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id D36048EDA; Sun, 22 Nov 2020 22:02:33 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f174.google.com with SMTP id d28so14874984qka.11; Sun, 22 Nov 2020 14:02:33 -0800 (PST) X-Gm-Message-State: AOAM532Rj4bASDCse/TwB990eA9Y6g5qnWIhGFblte12+RU7tY3W1FmK rUfftKyVXssho9Y/u/7AKiuv6Frn78cuPVtLC2w= X-Google-Smtp-Source: ABdhPJy3TLNMtMnQM4IwHu9qwxRG6PZlWYHK7o3jsQTsrsJfvKfD3Iwm54uGVSc6Tn0poiB4k/8On6yaLjRG+3eTcrg= X-Received: by 2002:a05:620a:12ea:: with SMTP id f10mr11929904qkl.430.1606082553551; Sun, 22 Nov 2020 14:02:33 -0800 (PST) MIME-Version: 1.0 References: <202011220534.0AM5Yp4u071733@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Sun, 22 Nov 2020 16:02:22 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r367928 - in head/sys: compat/freebsd32 kern sys To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2020 22:02:34 -0000 On Sun, Nov 22, 2020 at 1:55 AM Konstantin Belousov wrote: > > On Sun, Nov 22, 2020 at 05:34:51AM +0000, Kyle Evans wrote: > > Author: kevans > > Date: Sun Nov 22 05:34:51 2020 > > New Revision: 367928 > > URL: https://svnweb.freebsd.org/changeset/base/367928 > > > > Log: > > _umtx_op: move compat32 definitions back in > > > > These are reasonably compact, and a future commit will blur the compat32 > > lines by supporting 32-bit operations with the native _umtx_op. > > I do not mind much about placement of the compat32 syscall stubs, but I > did suggested and liked move of the compat32 structures definitions into > freebsd32.h. > > They are actually useful that way, at least allowing me to write some (private) > tests in the past. Ah, sure, sorry- this doesn't force us to re-add implementation details to other headers, so I don't see any problem. I will move just the struct definitions back shortly. From owner-svn-src-all@freebsd.org Mon Nov 23 00:33:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2689D47AA84; Mon, 23 Nov 2020 00:33: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfSmg0byNz4fST; Mon, 23 Nov 2020 00:33:07 +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 0788522FF1; Mon, 23 Nov 2020 00:33:07 +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 0AN0X6Ks079026; Mon, 23 Nov 2020 00:33:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AN0X6gS079025; Mon, 23 Nov 2020 00:33:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011230033.0AN0X6gS079025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 23 Nov 2020 00:33:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367942 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367942 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 00:33:07 -0000 Author: kevans Date: Mon Nov 23 00:33:06 2020 New Revision: 367942 URL: https://svnweb.freebsd.org/changeset/base/367942 Log: kern: dup: do not assume oldfde is valid oldfde may be invalidated if the table has grown due to the operation that we're performing, either via fdalloc() or a direct fdgrowtable_exp(). This was technically OK before rS367927 because the old table remained valid until the filedesc became unused, but now it may be freed immediately if it's an unshared table in a single-threaded process, so it is no longer a good assumption to make. This fixes dup/dup2 invocations that grow the file table; in the initial report, it manifested as a kernel panic in devel/gmake's configure script. Reported by: Guy Yur Reviewed by: rew Differential Revision: https://reviews.freebsd.org/D27319 Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Nov 22 20:21:10 2020 (r367941) +++ head/sys/kern/kern_descrip.c Mon Nov 23 00:33:06 2020 (r367942) @@ -870,7 +870,7 @@ kern_dup(struct thread *td, u_int mode, int flags, int struct filedesc *fdp; struct filedescent *oldfde, *newfde; struct proc *p; - struct file *delfp; + struct file *delfp, *oldfp; u_long *oioctls, *nioctls; int error, maxfd; @@ -910,7 +910,8 @@ kern_dup(struct thread *td, u_int mode, int flags, int } oldfde = &fdp->fd_ofiles[old]; - if (!fhold(oldfde->fde_file)) + oldfp = oldfde->fde_file; + if (!fhold(oldfp)) goto unlock; /* @@ -922,14 +923,14 @@ kern_dup(struct thread *td, u_int mode, int flags, int case FDDUP_NORMAL: case FDDUP_FCNTL: if ((error = fdalloc(td, new, &new)) != 0) { - fdrop(oldfde->fde_file, td); + fdrop(oldfp, td); goto unlock; } break; case FDDUP_MUSTREPLACE: /* Target file descriptor must exist. */ if (fget_locked(fdp, new) == NULL) { - fdrop(oldfde->fde_file, td); + fdrop(oldfp, td); goto unlock; } break; @@ -948,7 +949,7 @@ kern_dup(struct thread *td, u_int mode, int flags, int error = racct_set_unlocked(p, RACCT_NOFILE, new + 1); if (error != 0) { error = EMFILE; - fdrop(oldfde->fde_file, td); + fdrop(oldfp, td); goto unlock; } } @@ -963,6 +964,12 @@ kern_dup(struct thread *td, u_int mode, int flags, int } KASSERT(old != new, ("new fd is same as old")); + + /* Refetch oldfde because the table may have grown and old one freed. */ + oldfde = &fdp->fd_ofiles[old]; + KASSERT(oldfp == oldfde->fde_file, + ("fdt_ofiles shift from growth observed at fd %d", + old)); newfde = &fdp->fd_ofiles[new]; delfp = newfde->fde_file; From owner-svn-src-all@freebsd.org Mon Nov 23 00:58:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8BD6F47AFB0; Mon, 23 Nov 2020 00:58:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfTKg3VGWz4gsG; Mon, 23 Nov 2020 00:58:15 +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 6A9212383F; Mon, 23 Nov 2020 00:58:15 +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 0AN0wF1h092035; Mon, 23 Nov 2020 00:58:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AN0wFU8092034; Mon, 23 Nov 2020 00:58:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011230058.0AN0wFU8092034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 23 Nov 2020 00:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367943 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 367943 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 00:58:15 -0000 Author: kevans Date: Mon Nov 23 00:58:14 2020 New Revision: 367943 URL: https://svnweb.freebsd.org/changeset/base/367943 Log: freebsd32: take the _umtx_op struct definitions back Providing these in freebsd32.h facilitates local testing/measuring of the structs rather than forcing one to locally recreate them. Sanity checking offsets/sizes remains in kern_umtx.c where these are typically used. Modified: head/sys/compat/freebsd32/freebsd32.h head/sys/kern/kern_umtx.c Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Mon Nov 23 00:33:06 2020 (r367942) +++ head/sys/compat/freebsd32/freebsd32.h Mon Nov 23 00:58:14 2020 (r367943) @@ -94,6 +94,27 @@ struct itimerval32 { struct timeval32 it_value; }; +struct umtx_time32 { + struct timespec32 _timeout; + uint32_t _flags; + uint32_t _clockid; +}; + +struct umtx_robust_lists_params_compat32 { + uint32_t robust_list_offset; + uint32_t robust_priv_list_offset; + uint32_t robust_inact_offset; +}; + +struct umutex32 { + volatile __lwpid_t m_owner; /* Owner of the mutex */ + __uint32_t m_flags; /* Flags of the mutex */ + __uint32_t m_ceilings[2]; /* Priority protect ceiling */ + __uint32_t m_rb_lnk; /* Robust linkage */ + __uint32_t m_pad; + __uint32_t m_spare[2]; +}; + #define FREEBSD4_MFSNAMELEN 16 #define FREEBSD4_MNAMELEN (88 - 2 * sizeof(int32_t)) Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Mon Nov 23 00:33:06 2020 (r367942) +++ head/sys/kern/kern_umtx.c Mon Nov 23 00:58:14 2020 (r367943) @@ -232,27 +232,6 @@ struct umtx_copyops { const bool compat32; }; -struct umtx_time32 { - struct timespec32 _timeout; - uint32_t _flags; - uint32_t _clockid; -}; - -struct umtx_robust_lists_params_compat32 { - uint32_t robust_list_offset; - uint32_t robust_priv_list_offset; - uint32_t robust_inact_offset; -}; - -struct umutex32 { - volatile __lwpid_t m_owner; /* Owner of the mutex */ - __uint32_t m_flags; /* Flags of the mutex */ - __uint32_t m_ceilings[2]; /* Priority protect ceiling */ - __uint32_t m_rb_lnk; /* Robust linkage */ - __uint32_t m_pad; - __uint32_t m_spare[2]; -}; - _Static_assert(sizeof(struct umutex) == sizeof(struct umutex32), "umutex32"); _Static_assert(__offsetof(struct umutex, m_spare[0]) == __offsetof(struct umutex32, m_spare[0]), "m_spare32"); From owner-svn-src-all@freebsd.org Mon Nov 23 02:49:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8E9E47D07E; Mon, 23 Nov 2020 02:49:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfWpV3mfsz4m5L; Mon, 23 Nov 2020 02:49:54 +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 6FE832529D; Mon, 23 Nov 2020 02:49:54 +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 0AN2nsRa059305; Mon, 23 Nov 2020 02:49:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AN2nsOh059304; Mon, 23 Nov 2020 02:49:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011230249.0AN2nsOh059304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 23 Nov 2020 02:49:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367944 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367944 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 02:49:54 -0000 Author: kevans Date: Mon Nov 23 02:49:53 2020 New Revision: 367944 URL: https://svnweb.freebsd.org/changeset/base/367944 Log: cpuset_setproc: use the appropriate parent for new anonymous sets As far as I can tell, this has been the case since initially committed in 2008. cpuset_setproc is the executor of cpuset reassignment; note this excerpt from the description: * 1) Set is non-null. This reparents all anonymous sets to the provided * set and replaces all non-anonymous td_cpusets with the provided set. However, reviewing cpuset_setproc_setthread() for some jail related work unearthed the error: if tdset was not anonymous, we were replacing it with `set`. If it was anonymous, then we'd rebase it onto `set` (i.e. copy the thread's mask over and AND it with `set`) but give the new anonymous set the original tdset as the parent (i.e. the base of the set we're supposed to be leaving behind). The primary visible consequences were that: 1.) cpuset_getid() following such assignment returns the wrong result, the setid that we left behind rather than the one we joined. 2.) When a process attached to the jail, the base set of any anonymous threads was a set outside of the jail. This was initially bundled in D27298, but it's a minor fix that's fairly easy to verify the correctness of. A test is included in D27307 ("badparent"), which demonstrates the issue with, effectively: osetid = cpuset_getid() newsetid = cpuset() cpuset_setaffinity(thread) cpuset_setid(osetid) cpuset_getid(thread) -> observe that it matches newsetid instead of osetid. MFC after: 1 week Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Mon Nov 23 00:58:14 2020 (r367943) +++ head/sys/kern/kern_cpuset.c Mon Nov 23 02:49:53 2020 (r367944) @@ -1090,7 +1090,7 @@ cpuset_setproc_setthread(struct cpuset *tdset, struct if (error) return (error); - return cpuset_shadow(tdset, nsetp, &mask, &domain, freelist, + return cpuset_shadow(set, nsetp, &mask, &domain, freelist, domainlist); } From owner-svn-src-all@freebsd.org Mon Nov 23 04:39:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D24047F267; Mon, 23 Nov 2020 04:39:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfZDy2fh7z4rky; Mon, 23 Nov 2020 04:39:30 +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 4E2D12699D; Mon, 23 Nov 2020 04:39:30 +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 0AN4dUQa028566; Mon, 23 Nov 2020 04:39:30 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AN4dUcB028565; Mon, 23 Nov 2020 04:39:30 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <202011230439.0AN4dUcB028565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 23 Nov 2020 04:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367945 - head X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 367945 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 04:39:30 -0000 Author: eadler Date: Mon Nov 23 04:39:29 2020 New Revision: 367945 URL: https://svnweb.freebsd.org/changeset/base/367945 Log: arcconfig: add callsign again Problem When using git-svn or other non-pure-svn tooling the original subversion URL is not present. This causes arcanist/phabricator to be unable to determine which repository is being modified. Solution Restore callsign to .arcconfig to enable exact repository matching even with git-svn. Reported By: jhb Modified: head/.arcconfig Modified: head/.arcconfig ============================================================================== --- head/.arcconfig Mon Nov 23 02:49:53 2020 (r367944) +++ head/.arcconfig Mon Nov 23 04:39:29 2020 (r367945) @@ -1,4 +1,5 @@ { + "repository.callsign" : "S", "phabricator.uri" : "https://reviews.freebsd.org/", "history.immutable" : true } From owner-svn-src-all@freebsd.org Mon Nov 23 10:13:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8BC074A68C4; Mon, 23 Nov 2020 10:13:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cfjfs3WyYz3QVK; Mon, 23 Nov 2020 10:13:57 +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 6BDE5256D; Mon, 23 Nov 2020 10:13:57 +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 0ANADvGZ038721; Mon, 23 Nov 2020 10:13:57 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANADvHC038719; Mon, 23 Nov 2020 10:13:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202011231013.0ANADvHC038719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 23 Nov 2020 10:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367946 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 367946 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 10:13:57 -0000 Author: tuexen Date: Mon Nov 23 10:13:56 2020 New Revision: 367946 URL: https://svnweb.freebsd.org/changeset/base/367946 Log: Fix two occurences of a typo in a comment introduced in r367530. Reported by: lstewart@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27148 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Nov 23 04:39:29 2020 (r367945) +++ head/sys/netinet/tcp_input.c Mon Nov 23 10:13:56 2020 (r367946) @@ -1695,7 +1695,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru } /* * If timestamps were not negotiated during SYN/ACK and a - * segment without a timestamp is received, ignore the + * segment with a timestamp is received, ignore the * timestamp and process the packet normally. * See section 3.2 of RFC 7323. */ Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Mon Nov 23 04:39:29 2020 (r367945) +++ head/sys/netinet/tcp_syncache.c Mon Nov 23 10:13:56 2020 (r367946) @@ -1213,7 +1213,7 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt /* * If timestamps were not negotiated during SYN/ACK and a - * segment without a timestamp is received, ignore the + * segment with a timestamp is received, ignore the * timestamp and process the packet normally. * See section 3.2 of RFC 7323. */ From owner-svn-src-all@freebsd.org Mon Nov 23 12:47:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 521212EB426; Mon, 23 Nov 2020 12:47:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cfn3w1bb7z3qcV; Mon, 23 Nov 2020 12:47:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29B7C4C13; Mon, 23 Nov 2020 12:47:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ANClOwn031687; Mon, 23 Nov 2020 12:47:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANClOlp031686; Mon, 23 Nov 2020 12:47:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202011231247.0ANClOlp031686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 23 Nov 2020 12:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367947 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367947 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 12:47:24 -0000 Author: trasz Date: Mon Nov 23 12:47:23 2020 New Revision: 367947 URL: https://svnweb.freebsd.org/changeset/base/367947 Log: Remove the 'wantparent' variable, unused since r145004. Reviewed by: kib MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D27193 Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Mon Nov 23 10:13:56 2020 (r367946) +++ head/sys/kern/vfs_lookup.c Mon Nov 23 12:47:23 2020 (r367947) @@ -1305,7 +1305,6 @@ int relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) { struct vnode *dp = NULL; /* the directory we are searching */ - int wantparent; /* 1 => wantparent or lockparent flag */ int rdonly; /* lookup read-only flag bit */ int error = 0; @@ -1314,8 +1313,8 @@ relookup(struct vnode *dvp, struct vnode **vpp, struct /* * Setup: break out flag bits into variables. */ - wantparent = cnp->cn_flags & (LOCKPARENT|WANTPARENT); - KASSERT(wantparent, ("relookup: parent not wanted.")); + KASSERT((cnp->cn_flags & (LOCKPARENT | WANTPARENT)) != 0, + ("relookup: parent not wanted")); rdonly = cnp->cn_flags & RDONLY; cnp->cn_flags &= ~ISSYMLINK; dp = dvp; @@ -1406,13 +1405,8 @@ relookup(struct vnode *dvp, struct vnode **vpp, struct /* * Set the parent lock/ref state to the requested state. */ - if ((cnp->cn_flags & LOCKPARENT) == 0 && dvp != dp) { - if (wantparent) - VOP_UNLOCK(dvp); - else - vput(dvp); - } else if (!wantparent) - vrele(dvp); + if ((cnp->cn_flags & LOCKPARENT) == 0 && dvp != dp) + VOP_UNLOCK(dvp); /* * Check for symbolic link */ From owner-svn-src-all@freebsd.org Mon Nov 23 12:50:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 961812EB54B; Mon, 23 Nov 2020 12:50:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cfn7f3rJFz3qnS; Mon, 23 Nov 2020 12:50:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 771BF486A; Mon, 23 Nov 2020 12:50:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ANCocTM031930; Mon, 23 Nov 2020 12:50:38 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANCocsS031929; Mon, 23 Nov 2020 12:50:38 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202011231250.0ANCocsS031929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 23 Nov 2020 12:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367948 - head/sys/dev/arcmsr X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/arcmsr X-SVN-Commit-Revision: 367948 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 12:50:38 -0000 Author: trasz Date: Mon Nov 23 12:50:38 2020 New Revision: 367948 URL: https://svnweb.freebsd.org/changeset/base/367948 Log: arcmsr(4): don't bzero newly allocated ccb; xpt_alloc_ccb() already does that. Reviewed by: delphij, imp, ching2048@areca.com.tw Tested by: ching2048@areca.com.tw MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26840 Modified: head/sys/dev/arcmsr/arcmsr.c Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Mon Nov 23 12:47:23 2020 (r367947) +++ head/sys/dev/arcmsr/arcmsr.c Mon Nov 23 12:50:38 2020 (r367948) @@ -1707,7 +1707,6 @@ static void arcmsr_rescan_lun(struct AdapterControlBlo return; } /* printf("arcmsr_rescan_lun: Rescan Target=%x, Lun=%x\n", target, lun); */ - bzero(ccb, sizeof(union ccb)); xpt_setup_ccb(&ccb->ccb_h, path, 5); ccb->ccb_h.func_code = XPT_SCAN_LUN; ccb->ccb_h.cbfcnp = arcmsr_rescanLun_cb; From owner-svn-src-all@freebsd.org Mon Nov 23 12:54:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF2F22EB1F8; Mon, 23 Nov 2020 12:54:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfnCw4Y2bz3r5K; Mon, 23 Nov 2020 12:54:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A4EE4F03; Mon, 23 Nov 2020 12:54:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ANCsKAn037588; Mon, 23 Nov 2020 12:54:20 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANCsKcI037587; Mon, 23 Nov 2020 12:54:20 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202011231254.0ANCsKcI037587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 23 Nov 2020 12:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367949 - head/sys/dev/smartpqi X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/smartpqi X-SVN-Commit-Revision: 367949 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 12:54:20 -0000 Author: trasz Date: Mon Nov 23 12:54:19 2020 New Revision: 367949 URL: https://svnweb.freebsd.org/changeset/base/367949 Log: smartpqi: don't bzero the new ccb; xpt_alloc_ccb_nowait() already does that. Reviewed by: imp MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26838 Modified: head/sys/dev/smartpqi/smartpqi_cam.c Modified: head/sys/dev/smartpqi/smartpqi_cam.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_cam.c Mon Nov 23 12:50:38 2020 (r367948) +++ head/sys/dev/smartpqi/smartpqi_cam.c Mon Nov 23 12:54:19 2020 (r367949) @@ -623,7 +623,6 @@ static void smartpqi_lun_rescan(struct pqisrc_softstat return; } - bzero(ccb, sizeof(union ccb)); xpt_setup_ccb(&ccb->ccb_h, path, 5); ccb->ccb_h.func_code = XPT_SCAN_LUN; ccb->ccb_h.cbfcnp = smartpqi_lunrescan_cb; From owner-svn-src-all@freebsd.org Mon Nov 23 12:57:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 829E72EBA91; Mon, 23 Nov 2020 12:57:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfnHT3LyRz3r91; Mon, 23 Nov 2020 12:57:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 662934DAF; Mon, 23 Nov 2020 12:57:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ANCvP3d037815; Mon, 23 Nov 2020 12:57:25 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANCvPmq037814; Mon, 23 Nov 2020 12:57:25 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202011231257.0ANCvPmq037814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 23 Nov 2020 12:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367950 - head/sys/dev/hptmv X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/hptmv X-SVN-Commit-Revision: 367950 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 12:57:25 -0000 Author: trasz Date: Mon Nov 23 12:57:24 2020 New Revision: 367950 URL: https://svnweb.freebsd.org/changeset/base/367950 Log: Make hptmv(4) use xpt_alloc_ccb/xpt_free_ccb instead of malloc/free. Reviewed by: imp, mav MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26842 Modified: head/sys/dev/hptmv/entry.c Modified: head/sys/dev/hptmv/entry.c ============================================================================== --- head/sys/dev/hptmv/entry.c Mon Nov 23 12:54:19 2020 (r367949) +++ head/sys/dev/hptmv/entry.c Mon Nov 23 12:57:24 2020 (r367950) @@ -2008,9 +2008,8 @@ hpt_attach(device_t dev) } - if((ccb = (union ccb *)malloc(sizeof(*ccb), M_DEVBUF, M_WAITOK)) != (union ccb*)NULL) + if ((ccb = xpt_alloc_ccb()) != NULL) { - bzero(ccb, sizeof(*ccb)); ccb->ccb_h.pinfo.priority = 1; ccb->ccb_h.pinfo.index = CAM_UNQUEUED_INDEX; } @@ -2065,7 +2064,7 @@ hpt_attach(device_t dev) ccb->csa.callback = hpt_async; ccb->csa.callback_arg = hpt_vsim; xpt_action((union ccb *)ccb); - free(ccb, M_DEVBUF); + xpt_free_ccb(ccb); if (device_get_unit(dev) == 0) { /* Start the work thread. XXX */ From owner-svn-src-all@freebsd.org Mon Nov 23 12:59:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F8452EB966; Mon, 23 Nov 2020 12:59:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfnLN478pz3rNP; Mon, 23 Nov 2020 12:59:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FC604CC5; Mon, 23 Nov 2020 12:59:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ANCxuQI037981; Mon, 23 Nov 2020 12:59:56 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANCxuQD037980; Mon, 23 Nov 2020 12:59:56 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202011231259.0ANCxuQD037980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 23 Nov 2020 12:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367951 - head/sys/dev/hptmv X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/hptmv X-SVN-Commit-Revision: 367951 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 12:59:56 -0000 Author: trasz Date: Mon Nov 23 12:59:56 2020 New Revision: 367951 URL: https://svnweb.freebsd.org/changeset/base/367951 Log: Don't check return from xpt_alloc_ccb() for being NULL; since it's not the _nowait wariant, it cannot fail. Suggested by: mav MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Modified: head/sys/dev/hptmv/entry.c Modified: head/sys/dev/hptmv/entry.c ============================================================================== --- head/sys/dev/hptmv/entry.c Mon Nov 23 12:57:24 2020 (r367950) +++ head/sys/dev/hptmv/entry.c Mon Nov 23 12:59:56 2020 (r367951) @@ -2008,15 +2008,10 @@ hpt_attach(device_t dev) } - if ((ccb = xpt_alloc_ccb()) != NULL) - { - ccb->ccb_h.pinfo.priority = 1; - ccb->ccb_h.pinfo.index = CAM_UNQUEUED_INDEX; - } - else - { - return ENOMEM; - } + ccb = xpt_alloc_ccb(); + ccb->ccb_h.pinfo.priority = 1; + ccb->ccb_h.pinfo.index = CAM_UNQUEUED_INDEX; + /* * Create the device queue for our SIM(s). */ From owner-svn-src-all@freebsd.org Mon Nov 23 13:02:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAE3C2EB9FC; Mon, 23 Nov 2020 13:02:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfnPC5w32z3rgg; Mon, 23 Nov 2020 13:02:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDF14497F; Mon, 23 Nov 2020 13:02:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AND2NKF044057; Mon, 23 Nov 2020 13:02:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AND2NCw044056; Mon, 23 Nov 2020 13:02:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202011231302.0AND2NCw044056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 23 Nov 2020 13:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367952 - head/sys/dev/tws X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/tws X-SVN-Commit-Revision: 367952 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 13:02:23 -0000 Author: trasz Date: Mon Nov 23 13:02:23 2020 New Revision: 367952 URL: https://svnweb.freebsd.org/changeset/base/367952 Log: Make tws(4) use xpt_alloc_ccb()/xpt_free_ccb() instead of malloc/free. Reviewed by: imp MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26841 Modified: head/sys/dev/tws/tws.c Modified: head/sys/dev/tws/tws.c ============================================================================== --- head/sys/dev/tws/tws.c Mon Nov 23 12:59:56 2020 (r367951) +++ head/sys/dev/tws/tws.c Mon Nov 23 13:02:23 2020 (r367952) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include MALLOC_DEFINE(M_TWS, "twsbuf", "buffers used by tws driver"); int tws_queue_depth = TWS_MAX_REQS; @@ -412,7 +413,7 @@ tws_detach(device_t dev) callout_drain(&sc->stats_timer); free(sc->reqs, M_TWS); free(sc->sense_bufs, M_TWS); - free(sc->scan_ccb, M_TWS); + xpt_free_ccb(sc->scan_ccb); if (sc->ioctl_data_mem) bus_dmamem_free(sc->data_tag, sc->ioctl_data_mem, sc->ioctl_data_map); if (sc->data_tag) @@ -597,7 +598,7 @@ tws_init(struct tws_softc *sc) M_WAITOK | M_ZERO); sc->sense_bufs = malloc(sizeof(struct tws_sense) * tws_queue_depth, M_TWS, M_WAITOK | M_ZERO); - sc->scan_ccb = malloc(sizeof(union ccb), M_TWS, M_WAITOK | M_ZERO); + sc->scan_ccb = xpt_alloc_ccb(); if (bus_dmamem_alloc(sc->data_tag, (void **)&sc->ioctl_data_mem, (BUS_DMA_NOWAIT | BUS_DMA_ZERO), &sc->ioctl_data_map)) { device_printf(sc->tws_dev, "Cannot allocate ioctl data mem\n"); From owner-svn-src-all@freebsd.org Mon Nov 23 13:05:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D47B2EBA97; Mon, 23 Nov 2020 13:05:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfnSR3fGBz3rhw; Mon, 23 Nov 2020 13:05:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 704985014; Mon, 23 Nov 2020 13:05:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AND5BpX044223; Mon, 23 Nov 2020 13:05:11 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AND5Be3044222; Mon, 23 Nov 2020 13:05:11 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202011231305.0AND5Be3044222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 23 Nov 2020 13:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367953 - head/sys/dev/firewire X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/firewire X-SVN-Commit-Revision: 367953 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 13:05:11 -0000 Author: trasz Date: Mon Nov 23 13:05:11 2020 New Revision: 367953 URL: https://svnweb.freebsd.org/changeset/base/367953 Log: Make sbp(4) use xpt_alloc_ccb/xpt_free_ccb instead of malloc/free. Reviewed by: imp, mav MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26843 Modified: head/sys/dev/firewire/sbp.c Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Mon Nov 23 13:02:23 2020 (r367952) +++ head/sys/dev/firewire/sbp.c Mon Nov 23 13:05:11 2020 (r367953) @@ -987,7 +987,7 @@ END_DEBUG sdev = sbp_next_dev(target, sdev->lun_id + 1); if (sdev == NULL) { SBP_UNLOCK(sbp); - free(ccb, M_SBP); + xpt_free_ccb(ccb); return; } /* reuse ccb */ @@ -1019,9 +1019,9 @@ SBP_DEBUG(0) device_printf(sdev->target->sbp->fd.dev, "%s:%s\n", __func__, sdev->bustgtlun); END_DEBUG - ccb = malloc(sizeof(union ccb), M_SBP, M_NOWAIT | M_ZERO); + ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { - printf("sbp_cam_scan_target: malloc failed\n"); + printf("sbp_cam_scan_target: xpt_alloc_ccb_nowait() failed\n"); return; } SBP_UNLOCK(target->sbp); From owner-svn-src-all@freebsd.org Mon Nov 23 14:27:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6203D2ECC5A; Mon, 23 Nov 2020 14:27:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfqGr2KRjz3w09; Mon, 23 Nov 2020 14:27:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DE595E73; Mon, 23 Nov 2020 14:27:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ANER0Lk093771; Mon, 23 Nov 2020 14:27:00 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANER02l093766; Mon, 23 Nov 2020 14:27:00 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202011231427.0ANER02l093766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 23 Nov 2020 14:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367954 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 367954 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 14:27:00 -0000 Author: trasz Date: Mon Nov 23 14:26:59 2020 New Revision: 367954 URL: https://svnweb.freebsd.org/changeset/base/367954 Log: Assorted tweaks to hier(7): punctuation, some .Xr's, clarify wording. Reviewed by: 0mp, bcr, imp MFC after: 2 weeks Sponsored by: EPSRC Differential Revision: https://reviews.freebsd.org/D27248 Modified: head/share/man/man7/hier.7 Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Mon Nov 23 13:05:11 2020 (r367953) +++ head/share/man/man7/hier.7 Mon Nov 23 14:26:59 2020 (r367954) @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd January 20, 2020 +.Dd November 23, 2020 .Dt HIER 7 .Os .Sh NAME @@ -54,7 +54,7 @@ Compiled flattened device tree (FDT) files; see and .Xr dtc 1 .It Pa efi/ -Mount point for EFI System Partition (ESP) on UEFI systems. +Mount point for EFI System Partition (ESP) on UEFI systems .It Pa firmware/ loadable kernel modules containing binary firmware for hardware that needs firmware downloaded to it to function @@ -62,9 +62,8 @@ firmware downloaded to it to function pure kernel executable (the operating system loaded into memory at boot time) and kernel modules .It Pa modules/ -third-party loadable kernel modules; -see -.Xr kldstat 8 +third-party loadable kernel modules, such as the ones installed from +.Xr ports 7 .It Pa overlays/ Compiled flattened device tree (FDT) overlays; see .Xr fdt 4 @@ -197,8 +196,9 @@ contains the majority of user utilities and applicatio .It Pa bin/ common utilities, programming tools, and applications .It Pa compat/ -files needed to support binary compatibility with other operating systems, -such as Linux +files needed to support binary compatibility with other operating systems; +see +.Xr linux 4 .It Pa include/ standard C include files .Pp @@ -435,7 +435,7 @@ tree .Xr ports 7 , the .Fx -ports collection. +ports collection .It Pa sbin/ system daemons & system utilities (executed by users) .It Pa share/ @@ -604,8 +604,8 @@ see .El .Pp .It Pa src/ -.Bx , -third-party, and/or local source files +.Fx +source code .Pp .Bl -tag -width "kerberos5/" -compact .It Pa bin/ @@ -734,10 +734,8 @@ source code for files in .It Pa tests/ The .Fx -test suite. -See +test suite; see .Xr tests 7 -for more details. .El .It Pa /var/ multi-purpose log, temporary, transient, and spool files From owner-svn-src-all@freebsd.org Mon Nov 23 14:30:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DE452ED10C; Mon, 23 Nov 2020 14:30:23 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfqLl37gsz3wS8; Mon, 23 Nov 2020 14:30:23 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E958603C; Mon, 23 Nov 2020 14:30:23 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ANEUNVu094152; Mon, 23 Nov 2020 14:30:23 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANEUNBv094151; Mon, 23 Nov 2020 14:30:23 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202011231430.0ANEUNBv094151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Mon, 23 Nov 2020 14:30:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367955 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 367955 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 14:30:23 -0000 Author: mmel Date: Mon Nov 23 14:30:22 2020 New Revision: 367955 URL: https://svnweb.freebsd.org/changeset/base/367955 Log: Ensure that the buffer is in nvme_single_map() mapped to single segment. Not a functional change. MFC after: 1 week Modified: head/sys/dev/nvme/nvme_private.h Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Mon Nov 23 14:26:59 2020 (r367954) +++ head/sys/dev/nvme/nvme_private.h Mon Nov 23 14:30:22 2020 (r367955) @@ -478,6 +478,7 @@ nvme_single_map(void *arg, bus_dma_segment_t *seg, int { uint64_t *bus_addr = (uint64_t *)arg; + KASSERT(nseg == 1, ("number of segments (%d) is not 1", nseg)); if (error != 0) printf("nvme_single_map err %d\n", error); *bus_addr = seg[0].ds_addr; From owner-svn-src-all@freebsd.org Mon Nov 23 14:30:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A89FB2ECC7E; Mon, 23 Nov 2020 14:30:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfqLr71Sdz3wCB; Mon, 23 Nov 2020 14:30:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 297636141; Mon, 23 Nov 2020 14:30:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ANEURt0094202; Mon, 23 Nov 2020 14:30:27 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANEURX2094201; Mon, 23 Nov 2020 14:30:27 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202011231430.0ANEURX2094201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 23 Nov 2020 14:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367956 - head/usr.sbin/ctladm X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/ctladm X-SVN-Commit-Revision: 367956 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 14:30:34 -0000 Author: trasz Date: Mon Nov 23 14:30:27 2020 New Revision: 367956 URL: https://svnweb.freebsd.org/changeset/base/367956 Log: Replace paths in ctladm(8) examples with something sensible. PR: 251181 Reviewed by: 0mp, rm, ygy MFC after: 2 weeks Sponsored by: EPSRC Differential Revision: https://reviews.freebsd.org/D27249 Modified: head/usr.sbin/ctladm/ctladm.8 Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Mon Nov 23 14:30:22 2020 (r367955) +++ head/usr.sbin/ctladm/ctladm.8 Mon Nov 23 14:30:27 2020 (r367956) @@ -36,7 +36,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd August 6, 2020 +.Dd November 23, 2020 .Dt CTLADM 8 .Os .Sh NAME @@ -1029,23 +1029,17 @@ while reporting size of 10 terabytes, .Pp .Dl ctladm create -b ramdisk -s 10T -o capacity=10G .Pp -Create a LUN using the block backend, and specify the file -.Pa src/usr.sbin/ctladm/ctladm.8 -as the backing store. -The size of the LUN will be derived from the size of the file. -.Pp -.Dl ctladm create -b block -o file=src/usr.sbin/ctladm/ctladm.8 -.Pp -Create a LUN using the block backend, specify the file -.Pa src/usr.sbin/ctladm/ctladm.8 +Create a LUN using the block backend, specify the ZFS volume +.Pa tank/example as the backing store, and specify the .Tn SCSI VPD page 0x80 and 0x83 serial number .Fl ( S ) and device ID .Fl ( d ) . +The size of the LUN will be derived from the size of the ZVOL. .Pp -.Dl ctladm create -b block -o file=src/usr.sbin/ctladm/ctladm.8 -S MYSERIAL321 -d MYDEVID123 +.Dl ctladm create -b block -o file=/dev/zvol/tank/example -S MYSERIAL321 -d MYDEVID123 .Pp Use to specify generic options on ioctl frontend port, now it is only possible to set pp and/or vp port number. From owner-svn-src-all@freebsd.org Mon Nov 23 16:26:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C7692EF746; Mon, 23 Nov 2020 16:26:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cfsx61yVmz4Wt9; Mon, 23 Nov 2020 16:26:50 +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 3606474EA; Mon, 23 Nov 2020 16:26:50 +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 0ANGQoXZ068177; Mon, 23 Nov 2020 16:26:50 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANGQoh5068176; Mon, 23 Nov 2020 16:26:50 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202011231626.0ANGQoh5068176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 23 Nov 2020 16:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367957 - stable/12/sys/mips/cavium X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/mips/cavium X-SVN-Commit-Revision: 367957 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 16:26:50 -0000 Author: jhibbits Date: Mon Nov 23 16:26:49 2020 New Revision: 367957 URL: https://svnweb.freebsd.org/changeset/base/367957 Log: MFC r367807 Fix octeon_pmc post-r334827 Sponsored by: Juniper Networks, Inc Modified: stable/12/sys/mips/cavium/octeon_pmc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/mips/cavium/octeon_pmc.c ============================================================================== --- stable/12/sys/mips/cavium/octeon_pmc.c Mon Nov 23 14:30:27 2020 (r367956) +++ stable/12/sys/mips/cavium/octeon_pmc.c Mon Nov 23 16:26:49 2020 (r367957) @@ -111,7 +111,7 @@ octeon_pmc_intr(void *arg) struct trapframe *tf = PCPU_GET(curthread)->td_intr_frame; if (pmc_intr) - (*pmc_intr)(PCPU_GET(tf); + (*pmc_intr)(tf); return (FILTER_HANDLED); } From owner-svn-src-all@freebsd.org Mon Nov 23 17:00:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B53BD2EFE24; Mon, 23 Nov 2020 17:00:06 +0000 (UTC) (envelope-from arrowd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CftgV4Sbvz4Yb6; Mon, 23 Nov 2020 17:00:06 +0000 (UTC) (envelope-from arrowd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81D877EDF; Mon, 23 Nov 2020 17:00:06 +0000 (UTC) (envelope-from arrowd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ANH06DN087107; Mon, 23 Nov 2020 17:00:06 GMT (envelope-from arrowd@FreeBSD.org) Received: (from arrowd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANH0654087106; Mon, 23 Nov 2020 17:00:06 GMT (envelope-from arrowd@FreeBSD.org) Message-Id: <202011231700.0ANH0654087106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arrowd set sender to arrowd@FreeBSD.org using -f From: Gleb Popov Date: Mon, 23 Nov 2020 17:00:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367958 - head/bin/getfacl X-SVN-Group: head X-SVN-Commit-Author: arrowd X-SVN-Commit-Paths: head/bin/getfacl X-SVN-Commit-Revision: 367958 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 17:00:06 -0000 Author: arrowd (ports committer) Date: Mon Nov 23 17:00:06 2020 New Revision: 367958 URL: https://svnweb.freebsd.org/changeset/base/367958 Log: bin/setfacl: Little refactoring, no functional change. The acl_from_stat function accepts a stat_t * argument, but only uses its st_mode field. There is no reason to pass the whole struct, so make it accept a mode_t and rename the function to acl_from_mode. Linux has non-standard acl_from_mode function in its libacl, so naming the function this way may help discovering it during porting efforts. Reviewed by: tsoome, markj Approved by: markj Differential Revision: https://reviews.freebsd.org/D27292 Modified: head/bin/getfacl/getfacl.c Modified: head/bin/getfacl/getfacl.c ============================================================================== --- head/bin/getfacl/getfacl.c Mon Nov 23 16:26:49 2020 (r367957) +++ head/bin/getfacl/getfacl.c Mon Nov 23 17:00:06 2020 (r367958) @@ -85,10 +85,10 @@ getgname(gid_t gid) /* * return an ACL corresponding to the permissions - * contained in struct stat + * contained in mode_t */ static acl_t -acl_from_stat(const struct stat *sb) +acl_from_mode(const mode_t mode) { acl_t acl; acl_entry_t entry; @@ -111,13 +111,13 @@ acl_from_stat(const struct stat *sb) return NULL; /* calculate user mode */ - if (sb->st_mode & S_IRUSR) + if (mode & S_IRUSR) if (acl_add_perm(perms, ACL_READ) == -1) return NULL; - if (sb->st_mode & S_IWUSR) + if (mode & S_IWUSR) if (acl_add_perm(perms, ACL_WRITE) == -1) return NULL; - if (sb->st_mode & S_IXUSR) + if (mode & S_IXUSR) if (acl_add_perm(perms, ACL_EXECUTE) == -1) return NULL; if (acl_set_permset(entry, perms) == -1) @@ -135,13 +135,13 @@ acl_from_stat(const struct stat *sb) return NULL; /* calculate group mode */ - if (sb->st_mode & S_IRGRP) + if (mode & S_IRGRP) if (acl_add_perm(perms, ACL_READ) == -1) return NULL; - if (sb->st_mode & S_IWGRP) + if (mode & S_IWGRP) if (acl_add_perm(perms, ACL_WRITE) == -1) return NULL; - if (sb->st_mode & S_IXGRP) + if (mode & S_IXGRP) if (acl_add_perm(perms, ACL_EXECUTE) == -1) return NULL; if (acl_set_permset(entry, perms) == -1) @@ -159,13 +159,13 @@ acl_from_stat(const struct stat *sb) return NULL; /* calculate other mode */ - if (sb->st_mode & S_IROTH) + if (mode & S_IROTH) if (acl_add_perm(perms, ACL_READ) == -1) return NULL; - if (sb->st_mode & S_IWOTH) + if (mode & S_IWOTH) if (acl_add_perm(perms, ACL_WRITE) == -1) return NULL; - if (sb->st_mode & S_IXOTH) + if (mode & S_IXOTH) if (acl_add_perm(perms, ACL_EXECUTE) == -1) return NULL; if (acl_set_permset(entry, perms) == -1) @@ -229,9 +229,9 @@ print_acl(char *path, acl_type_t type, int hflag, int errno = 0; if (type == ACL_TYPE_DEFAULT) return(0); - acl = acl_from_stat(&sb); + acl = acl_from_mode(sb.st_mode); if (!acl) { - warn("%s: acl_from_stat() failed", path); + warn("%s: acl_from_mode() failed", path); return(-1); } } From owner-svn-src-all@freebsd.org Mon Nov 23 17:29:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 210CF4689CE; Mon, 23 Nov 2020 17:29:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfvKM0Tm6z4ZdS; Mon, 23 Nov 2020 17:29:27 +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 F323E105A4; Mon, 23 Nov 2020 17:29:26 +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 0ANHTQ3D005668; Mon, 23 Nov 2020 17:29:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANHTPX9005663; Mon, 23 Nov 2020 17:29:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011231729.0ANHTPX9005663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 23 Nov 2020 17:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367959 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367959 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 17:29:27 -0000 Author: kib Date: Mon Nov 23 17:29:25 2020 New Revision: 367959 URL: https://svnweb.freebsd.org/changeset/base/367959 Log: Provide ABI modules hooks for process exec/exit and thread exit. Exec and exit are same as corresponding eventhandler hooks. Thread exit hook is called somewhat earlier, while thread is still owned by the process and enough context is available. Note that the process lock is owned when the hook is called. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27309 Modified: head/sys/kern/kern_exec.c head/sys/kern/kern_exit.c head/sys/kern/kern_kthread.c head/sys/kern/kern_thr.c head/sys/sys/sysent.h Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Mon Nov 23 17:00:06 2020 (r367958) +++ head/sys/kern/kern_exec.c Mon Nov 23 17:29:25 2020 (r367959) @@ -1051,6 +1051,8 @@ exec_new_vmspace(struct image_params *imgp, struct sys sigfastblock_clear(td); umtx_exec(p); itimers_exec(p); + if (sv->sv_onexec != NULL) + sv->sv_onexec(p, imgp); EVENTHANDLER_DIRECT_INVOKE(process_exec, p, imgp); Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Mon Nov 23 17:00:06 2020 (r367958) +++ head/sys/kern/kern_exit.c Mon Nov 23 17:29:25 2020 (r367959) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #ifdef KTRACE @@ -327,6 +328,9 @@ exit1(struct thread *td, int rval, int signo) itimers_exit(p); + if (p->p_sysent->sv_onexit != NULL) + p->p_sysent->sv_onexit(p); + /* * Check if any loadable modules need anything done at process exit. * E.g. SYSV IPC stuff. @@ -560,6 +564,9 @@ exit1(struct thread *td, int rval, int signo) /* Save exit status. */ PROC_LOCK(p); p->p_xthread = td; + + if (p->p_sysent->sv_ontdexit != NULL) + p->p_sysent->sv_ontdexit(td); #ifdef KDTRACE_HOOKS /* Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Mon Nov 23 17:00:06 2020 (r367958) +++ head/sys/kern/kern_kthread.c Mon Nov 23 17:29:25 2020 (r367959) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -355,6 +356,10 @@ kthread_exit(void) PROC_UNLOCK(p); kproc_exit(0); } + + if (p->p_sysent->sv_ontdexit != NULL) + p->p_sysent->sv_ontdexit(td); + tidhash_remove(td); umtx_thread_exit(td); tdsigcleanup(td); Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Mon Nov 23 17:00:06 2020 (r367958) +++ head/sys/kern/kern_thr.c Mon Nov 23 17:29:25 2020 (r367959) @@ -353,6 +353,9 @@ kern_thr_exit(struct thread *td) return (0); } + if (p->p_sysent->sv_ontdexit != NULL) + p->p_sysent->sv_ontdexit(td); + td->td_dbgflags |= TDB_EXIT; if (p->p_ptevents & PTRACE_LWP) { p->p_pendingexits++; Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Mon Nov 23 17:00:06 2020 (r367958) +++ head/sys/sys/sysent.h Mon Nov 23 17:29:25 2020 (r367959) @@ -145,6 +145,9 @@ struct sysentvec { u_long *sv_hwcap2; /* Value passed in AT_HWCAP2. */ const char *(*sv_machine_arch)(struct proc *); vm_offset_t sv_fxrng_gen_base; + void (*sv_onexec)(struct proc *, struct image_params *); + void (*sv_onexit)(struct proc *); + void (*sv_ontdexit)(struct thread *td); }; #define SV_ILP32 0x000100 /* 32-bit executable. */ From owner-svn-src-all@freebsd.org Mon Nov 23 18:18:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4EFF44694E5; Mon, 23 Nov 2020 18:18:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfwPk1n8sz4cfc; Mon, 23 Nov 2020 18:18: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 2DD2910D5F; Mon, 23 Nov 2020 18:18: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 0ANIIHKd035957; Mon, 23 Nov 2020 18:18:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANIIGU6035950; Mon, 23 Nov 2020 18:18:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011231818.0ANIIGU6035950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 23 Nov 2020 18:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367960 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Commit-Revision: 367960 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 18:18:18 -0000 Author: kib Date: Mon Nov 23 18:18:16 2020 New Revision: 367960 URL: https://svnweb.freebsd.org/changeset/base/367960 Log: Linuxolator: Replace use of eventhandlers by sysent hooks. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27309 Modified: head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm64/linux/linux_sysvec.c head/sys/compat/linux/linux_common.c head/sys/compat/linux/linux_emul.c head/sys/compat/linux/linux_emul.h head/sys/i386/linux/linux_sysvec.c Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Mon Nov 23 17:29:25 2020 (r367959) +++ head/sys/amd64/linux/linux_sysvec.c Mon Nov 23 18:18:16 2020 (r367960) @@ -780,6 +780,9 @@ struct sysentvec elf_linux_sysvec = { .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, .sv_trap = linux_vsyscall, + .sv_onexec = linux_on_exec, + .sv_onexit = linux_on_exit, + .sv_ontdexit = linux_thread_dtor, }; static void Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Mon Nov 23 17:29:25 2020 (r367959) +++ head/sys/amd64/linux32/linux32_sysvec.c Mon Nov 23 18:18:16 2020 (r367960) @@ -925,6 +925,9 @@ struct sysentvec elf_linux_sysvec = { .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, .sv_trap = NULL, + .sv_onexec = linux_on_exec, + .sv_onexit = linux_on_exit, + .sv_ontdexit = linux_thread_dtor, }; static void Modified: head/sys/arm64/linux/linux_sysvec.c ============================================================================== --- head/sys/arm64/linux/linux_sysvec.c Mon Nov 23 17:29:25 2020 (r367959) +++ head/sys/arm64/linux/linux_sysvec.c Mon Nov 23 18:18:16 2020 (r367960) @@ -419,6 +419,9 @@ struct sysentvec elf_linux_sysvec = { .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, .sv_trap = linux_vsyscall, + .sv_onexec = linux_on_exec, + .sv_onexit = linux_on_exit, + .sv_ontdexit = linux_thread_dtor, }; static void Modified: head/sys/compat/linux/linux_common.c ============================================================================== --- head/sys/compat/linux/linux_common.c Mon Nov 23 17:29:25 2020 (r367959) +++ head/sys/compat/linux/linux_common.c Mon Nov 23 18:18:16 2020 (r367960) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include @@ -71,10 +71,6 @@ TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_ struct sx linux_ioctl_sx; SX_SYSINIT(linux_ioctl, &linux_ioctl_sx, "Linux ioctl handlers"); -static eventhandler_tag linux_exec_tag; -static eventhandler_tag linux_thread_dtor_tag; -static eventhandler_tag linux_exit_tag; - static int linux_common_modevent(module_t mod, int type, void *data) { @@ -87,12 +83,6 @@ linux_common_modevent(module_t mod, int type, void *da #endif linux_dev_shm_create(); linux_osd_jail_register(); - linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, - linux_proc_exit, NULL, 1000); - linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, - linux_proc_exec, NULL, 1000); - linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, - linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); SET_FOREACH(ldhp, linux_device_handler_set) linux_device_register_handler(*ldhp); LIST_INIT(&futex_list); @@ -104,9 +94,6 @@ linux_common_modevent(module_t mod, int type, void *da SET_FOREACH(ldhp, linux_device_handler_set) linux_device_unregister_handler(*ldhp); mtx_destroy(&futex_mtx); - EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); - EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); - EVENTHANDLER_DEREGISTER(thread_dtor, linux_thread_dtor_tag); break; default: return (EOPNOTSUPP); Modified: head/sys/compat/linux/linux_emul.c ============================================================================== --- head/sys/compat/linux/linux_emul.c Mon Nov 23 17:29:25 2020 (r367959) +++ head/sys/compat/linux/linux_emul.c Mon Nov 23 18:18:16 2020 (r367960) @@ -199,14 +199,13 @@ linux_proc_init(struct thread *td, struct thread *newt } void -linux_proc_exit(void *arg __unused, struct proc *p) +linux_on_exit(struct proc *p) { struct linux_pemuldata *pem; struct epoll_emuldata *emd; struct thread *td = curthread; - if (__predict_false(SV_CURPROC_ABI() != SV_ABI_LINUX)) - return; + MPASS(SV_CURPROC_ABI() == SV_ABI_LINUX); LINUX_CTR3(proc_exit, "thread(%d) proc(%d) p %p", td->td_tid, p->p_pid, p); @@ -313,7 +312,7 @@ linux_common_execve(struct thread *td, struct image_ar } void -linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp) +linux_on_exec(struct proc *p, struct image_params *imgp) { struct thread *td; struct thread *othertd; @@ -322,55 +321,52 @@ linux_proc_exec(void *arg __unused, struct proc *p, st #endif td = curthread; + MPASS((imgp->sysent->sv_flags & SV_ABI_MASK) == SV_ABI_LINUX); /* - * In a case of execing to Linux binary we create Linux - * emuldata thread entry. + * When execing to Linux binary, we create Linux emuldata + * thread entry. */ - if (__predict_false((imgp->sysent->sv_flags & SV_ABI_MASK) == - SV_ABI_LINUX)) { - if (SV_PROC_ABI(p) == SV_ABI_LINUX) { - /* - * Process already was under Linuxolator - * before exec. Update emuldata to reflect - * single-threaded cleaned state after exec. - */ - linux_proc_init(td, NULL, 0); - } else { - /* - * We are switching the process to Linux emulator. - */ - linux_proc_init(td, td, 0); + if (SV_PROC_ABI(p) == SV_ABI_LINUX) { + /* + * Process already was under Linuxolator + * before exec. Update emuldata to reflect + * single-threaded cleaned state after exec. + */ + linux_proc_init(td, NULL, 0); + } else { + /* + * We are switching the process to Linux emulator. + */ + linux_proc_init(td, td, 0); - /* - * Create a transient td_emuldata for all suspended - * threads, so that p->p_sysent->sv_thread_detach() == - * linux_thread_detach() can find expected but unused - * emuldata. - */ - FOREACH_THREAD_IN_PROC(td->td_proc, othertd) { - if (othertd != td) { - linux_proc_init(td, othertd, - LINUX_CLONE_THREAD); - } - } - } -#if defined(__amd64__) /* - * An IA32 executable which has executable stack will have the - * READ_IMPLIES_EXEC personality flag set automatically. + * Create a transient td_emuldata for all suspended + * threads, so that p->p_sysent->sv_thread_detach() == + * linux_thread_detach() can find expected but unused + * emuldata. */ - if (SV_PROC_FLAG(td->td_proc, SV_ILP32) && - imgp->stack_prot & VM_PROT_EXECUTE) { - pem = pem_find(p); - pem->persona |= LINUX_READ_IMPLIES_EXEC; + FOREACH_THREAD_IN_PROC(td->td_proc, othertd) { + if (othertd == td) + continue; + linux_proc_init(td, othertd, LINUX_CLONE_THREAD); } -#endif } +#if defined(__amd64__) + /* + * An IA32 executable which has executable stack will have the + * READ_IMPLIES_EXEC personality flag set automatically. + */ + if (SV_PROC_FLAG(td->td_proc, SV_ILP32) && + imgp->stack_prot & VM_PROT_EXECUTE) { + pem = pem_find(p); + pem->persona |= LINUX_READ_IMPLIES_EXEC; + } +#endif } void -linux_thread_dtor(void *arg __unused, struct thread *td) +linux_thread_dtor(struct thread *td) { struct linux_emuldata *em; Modified: head/sys/compat/linux/linux_emul.h ============================================================================== --- head/sys/compat/linux/linux_emul.h Mon Nov 23 17:29:25 2020 (r367959) +++ head/sys/compat/linux/linux_emul.h Mon Nov 23 18:18:16 2020 (r367960) @@ -52,10 +52,10 @@ struct linux_emuldata *em_find(struct thread *); int linux_exec_imgact_try(struct image_params *); void linux_proc_init(struct thread *, struct thread *, int); -void linux_proc_exit(void *, struct proc *); +void linux_on_exit(struct proc *); void linux_schedtail(struct thread *); -void linux_proc_exec(void *, struct proc *, struct image_params *); -void linux_thread_dtor(void *arg __unused, struct thread *); +void linux_on_exec(struct proc *, struct image_params *); +void linux_thread_dtor(struct thread *); void linux_thread_detach(struct thread *); int linux_common_execve(struct thread *, struct image_args *); Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Mon Nov 23 17:29:25 2020 (r367959) +++ head/sys/i386/linux/linux_sysvec.c Mon Nov 23 18:18:16 2020 (r367960) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -104,10 +103,6 @@ static void linux_vdso_deinstall(void *param); static int linux_szplatform; const char *linux_kplatform; -static eventhandler_tag linux_exit_tag; -static eventhandler_tag linux_exec_tag; -static eventhandler_tag linux_thread_dtor_tag; - #define LINUX_T_UNKNOWN 255 static int _bsd_to_linux_trapcode[] = { LINUX_T_UNKNOWN, /* 0 */ @@ -873,6 +868,9 @@ struct sysentvec linux_sysvec = { .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, .sv_trap = NULL, + .sv_onexec = linux_on_exec, + .sv_onexit = linux_on_exit, + .sv_ontdexit = linux_thread_dtor, }; INIT_SYSENTVEC(aout_sysvec, &linux_sysvec); @@ -907,6 +905,9 @@ struct sysentvec elf_linux_sysvec = { .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, .sv_trap = NULL, + .sv_onexec = linux_on_exec, + .sv_onexit = linux_on_exit, + .sv_ontdexit = linux_thread_dtor, }; static void @@ -1040,12 +1041,6 @@ linux_elf_modevent(module_t mod, int type, void *data) linux_ioctl_register_handler(*lihp); LIST_INIT(&futex_list); mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); - linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, linux_proc_exit, - NULL, 1000); - linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, linux_proc_exec, - NULL, 1000); - linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, - linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); linux_get_machine(&linux_kplatform); linux_szplatform = roundup(strlen(linux_kplatform) + 1, sizeof(char *)); @@ -1072,9 +1067,6 @@ linux_elf_modevent(module_t mod, int type, void *data) SET_FOREACH(lihp, linux_ioctl_handler_set) linux_ioctl_unregister_handler(*lihp); mtx_destroy(&futex_mtx); - EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); - EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); - EVENTHANDLER_DEREGISTER(thread_dtor, linux_thread_dtor_tag); linux_dev_shm_destroy(); linux_osd_jail_deregister(); if (bootverbose) From owner-svn-src-all@freebsd.org Mon Nov 23 18:26:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B21F6469660; Mon, 23 Nov 2020 18:26:48 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfwbX4Fddz4ckN; Mon, 23 Nov 2020 18:26:48 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 808A21138F; Mon, 23 Nov 2020 18:26:48 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ANIQmqJ042117; Mon, 23 Nov 2020 18:26:48 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANIQmJW042115; Mon, 23 Nov 2020 18:26:48 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011231826.0ANIQmJW042115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 23 Nov 2020 18:26:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367961 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367961 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 18:26:48 -0000 Author: mjg Date: Mon Nov 23 18:26:47 2020 New Revision: 367961 URL: https://svnweb.freebsd.org/changeset/base/367961 Log: thread: stash domain id to work around vtophys problems on ppc64 Adding to zombie list can be perfomed by idle threads, which on ppc64 leads to panics as it requires a sleepable lock. Reported by: alfredo Reviewed by: kib, markj Fixes: r367842 ("thread: numa-aware zombie reaping") Differential Revision: https://reviews.freebsd.org/D27288 Modified: head/sys/kern/kern_thread.c head/sys/sys/proc.h Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Mon Nov 23 18:18:16 2020 (r367960) +++ head/sys/kern/kern_thread.c Mon Nov 23 18:26:47 2020 (r367961) @@ -346,6 +346,7 @@ thread_ctor(void *mem, int size, void *arg, int flags) td = (struct thread *)mem; td->td_state = TDS_INACTIVE; td->td_lastcpu = td->td_oncpu = NOCPU; + td->td_allocdomain = vm_phys_domain(vtophys(td)); /* * Note that td_critnest begins life as 1 because the thread is not @@ -544,7 +545,7 @@ thread_zombie(struct thread *td) struct thread_domain_data *tdd; struct thread *ztd; - tdd = &thread_domain_data[vm_phys_domain(vtophys(td))]; + tdd = &thread_domain_data[td->td_allocdomain]; ztd = atomic_load_ptr(&tdd->tdd_zombies); for (;;) { td->td_zombie = ztd; Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Mon Nov 23 18:18:16 2020 (r367960) +++ head/sys/sys/proc.h Mon Nov 23 18:26:47 2020 (r367961) @@ -246,6 +246,7 @@ struct thread { sigqueue_t td_sigqueue; /* (c) Sigs arrived, not delivered. */ #define td_siglist td_sigqueue.sq_signals u_char td_lend_user_pri; /* (t) Lend user pri. */ + u_char td_allocdomain; /* (b) NUMA domain backing this struct thread. */ /* Cleared during fork1() */ #define td_startzero td_flags From owner-svn-src-all@freebsd.org Mon Nov 23 18:27:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0ADF446966A; Mon, 23 Nov 2020 18:27:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CfwcB6v3Mz4cyG; Mon, 23 Nov 2020 18:27:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF80E11483; Mon, 23 Nov 2020 18:27:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ANIRMsF042192; Mon, 23 Nov 2020 18:27:22 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANIRLoS042186; Mon, 23 Nov 2020 18:27:21 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011231827.0ANIRLoS042186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 23 Nov 2020 18:27:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367962 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367962 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 18:27:23 -0000 Author: mjg Date: Mon Nov 23 18:27:21 2020 New Revision: 367962 URL: https://svnweb.freebsd.org/changeset/base/367962 Log: dtrace: stop using eventhandlers for the part compiled into the kernel Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D27311 Modified: head/sys/kern/init_main.c head/sys/kern/kern_dtrace.c head/sys/kern/kern_proc.c head/sys/kern/kern_thread.c head/sys/sys/dtrace_bsd.h Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Mon Nov 23 18:26:47 2020 (r367961) +++ head/sys/kern/init_main.c Mon Nov 23 18:27:21 2020 (r367962) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -607,6 +608,10 @@ proc0_init(void *dummy __unused) */ EVENTHANDLER_DIRECT_INVOKE(process_init, p); EVENTHANDLER_DIRECT_INVOKE(thread_init, td); +#ifdef KDTRACE_HOOKS + kdtrace_proc_ctor(p); + kdtrace_thread_ctor(td); +#endif EVENTHANDLER_DIRECT_INVOKE(process_ctor, p); EVENTHANDLER_DIRECT_INVOKE(thread_ctor, td); Modified: head/sys/kern/kern_dtrace.c ============================================================================== --- head/sys/kern/kern_dtrace.c Mon Nov 23 18:26:47 2020 (r367961) +++ head/sys/kern/kern_dtrace.c Mon Nov 23 18:27:21 2020 (r367962) @@ -67,21 +67,19 @@ kdtrace_proc_size() return (KDTRACE_PROC_SIZE); } -static void -kdtrace_proc_ctor(void *arg __unused, struct proc *p) +void +kdtrace_proc_ctor(struct proc *p) { p->p_dtrace = malloc(KDTRACE_PROC_SIZE, M_KDTRACE, M_WAITOK|M_ZERO); } -static void -kdtrace_proc_dtor(void *arg __unused, struct proc *p) +void +kdtrace_proc_dtor(struct proc *p) { - if (p->p_dtrace != NULL) { - free(p->p_dtrace, M_KDTRACE); - p->p_dtrace = NULL; - } + free(p->p_dtrace, M_KDTRACE); + p->p_dtrace = NULL; } /* Return the DTrace thread data size compiled in the kernel hooks. */ @@ -92,38 +90,17 @@ kdtrace_thread_size() return (KDTRACE_THREAD_SIZE); } -static void -kdtrace_thread_ctor(void *arg __unused, struct thread *td) +void +kdtrace_thread_ctor(struct thread *td) { td->td_dtrace = malloc(KDTRACE_THREAD_SIZE, M_KDTRACE, M_WAITOK|M_ZERO); } -static void -kdtrace_thread_dtor(void *arg __unused, struct thread *td) +void +kdtrace_thread_dtor(struct thread *td) { - if (td->td_dtrace != NULL) { - free(td->td_dtrace, M_KDTRACE); - td->td_dtrace = NULL; - } + free(td->td_dtrace, M_KDTRACE); + td->td_dtrace = NULL; } - -/* - * Initialise the kernel DTrace hooks. - */ -static void -init_dtrace(void *dummy __unused) -{ - - EVENTHANDLER_REGISTER(process_ctor, kdtrace_proc_ctor, NULL, - EVENTHANDLER_PRI_ANY); - EVENTHANDLER_REGISTER(process_dtor, kdtrace_proc_dtor, NULL, - EVENTHANDLER_PRI_ANY); - EVENTHANDLER_REGISTER(thread_ctor, kdtrace_thread_ctor, NULL, - EVENTHANDLER_PRI_ANY); - EVENTHANDLER_REGISTER(thread_dtor, kdtrace_thread_dtor, NULL, - EVENTHANDLER_PRI_ANY); -} - -SYSINIT(kdtrace, SI_SUB_KDTRACE, SI_ORDER_FIRST, init_dtrace, NULL); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Nov 23 18:26:47 2020 (r367961) +++ head/sys/kern/kern_proc.c Mon Nov 23 18:27:21 2020 (r367962) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -207,6 +208,9 @@ proc_ctor(void *mem, int size, void *arg, int flags) struct thread *td; p = (struct proc *)mem; +#ifdef KDTRACE_HOOKS + kdtrace_proc_ctor(p); +#endif EVENTHANDLER_DIRECT_INVOKE(process_ctor, p); td = FIRST_THREAD_IN_PROC(p); if (td != NULL) { @@ -243,6 +247,9 @@ proc_dtor(void *mem, int size, void *arg) EVENTHANDLER_DIRECT_INVOKE(thread_dtor, td); } EVENTHANDLER_DIRECT_INVOKE(process_dtor, p); +#ifdef KDTRACE_HOOKS + kdtrace_proc_dtor(p); +#endif if (p->p_ksi != NULL) KASSERT(! KSI_ONQ(p->p_ksi), ("SIGCHLD queue")); } Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Mon Nov 23 18:26:47 2020 (r367961) +++ head/sys/kern/kern_thread.c Mon Nov 23 18:27:21 2020 (r367962) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -358,6 +359,9 @@ thread_ctor(void *mem, int size, void *arg, int flags) #ifdef AUDIT audit_thread_alloc(td); #endif +#ifdef KDTRACE_HOOKS + kdtrace_thread_ctor(td); +#endif umtx_thread_alloc(td); MPASS(td->td_sel == NULL); return (0); @@ -395,6 +399,9 @@ thread_dtor(void *mem, int size, void *arg) #endif #ifdef AUDIT audit_thread_free(td); +#endif +#ifdef KDTRACE_HOOKS + kdtrace_thread_dtor(td); #endif /* Free all OSD associated to this thread. */ osd_thread_exit(td); Modified: head/sys/sys/dtrace_bsd.h ============================================================================== --- head/sys/sys/dtrace_bsd.h Mon Nov 23 18:26:47 2020 (r367961) +++ head/sys/sys/dtrace_bsd.h Mon Nov 23 18:27:21 2020 (r367962) @@ -165,6 +165,11 @@ extern dtrace_nfsclient_nfs23_done_probe_func_t size_t kdtrace_proc_size(void); size_t kdtrace_thread_size(void); +void kdtrace_proc_ctor(struct proc *p); +void kdtrace_proc_dtor(struct proc *p); +void kdtrace_thread_ctor(struct thread *td); +void kdtrace_thread_dtor(struct thread *td); + /* * OpenSolaris compatible time functions returning nanoseconds. * On OpenSolaris these return hrtime_t which we define as uint64_t. From owner-svn-src-all@freebsd.org Mon Nov 23 18:37:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91C3C469B5E; Mon, 23 Nov 2020 18:37:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cfwqg3kSsz4df7; Mon, 23 Nov 2020 18:37:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72C8E11508; Mon, 23 Nov 2020 18:37:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ANIbJQk048755; Mon, 23 Nov 2020 18:37:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANIbJ2d048754; Mon, 23 Nov 2020 18:37:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202011231837.0ANIbJ2d048754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 23 Nov 2020 18:37:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367963 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 367963 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 18:37:19 -0000 Author: imp Date: Mon Nov 23 18:37:19 2020 New Revision: 367963 URL: https://svnweb.freebsd.org/changeset/base/367963 Log: Prefer Em to Ar for emphasis Em is better than Ar if all we want to do is underline the text. Submitted by: yuripv@ Modified: head/sbin/devd/devd.conf.5 Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Mon Nov 23 18:27:21 2020 (r367962) +++ head/sbin/devd/devd.conf.5 Mon Nov 23 18:37:19 2020 (r367963) @@ -416,7 +416,7 @@ node is destroyed. .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li ETHERNET Ta Ar inet Ta IFATTACH Ta Notification when the default VNET instance of the -.Ar inet +.Em inet interface is attached. .El .Pp @@ -454,18 +454,18 @@ provider size has changed. .Bl -column "System" "Subsystem" "1234567" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li IFNET -.It Li IFNET Ta Ar inet Ta Ta +.It Li IFNET Ta Em inet Ta Ta The .Dq subsystem is the actual name of the network interface on which the event took place. -.It Li IFNET Ta Ar inet Ta Li LINK_UP Ta +.It Li IFNET Ta Em inet Ta Li LINK_UP Ta Carrier status changed to UP. -.It Li IFNET Ta Ar inet Ta Li LINK_DOWN Ta +.It Li IFNET Ta Em inet Ta Li LINK_DOWN Ta Carrier status changed to DOWN. -.It Li IFNET Ta Ar inet Ta Li ATTACH Ta +.It Li IFNET Ta Em inet Ta Li ATTACH Ta The network interface is attached to the system. -.It Li IFNET Ta Ar inet Ta Li DETACH Ta +.It Li IFNET Ta Em inet Ta Li DETACH Ta The network interface is detached from the system. .El .Pp From owner-svn-src-all@freebsd.org Mon Nov 23 23:46:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A31EE46EBDE; Mon, 23 Nov 2020 23:46:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg3h04CMTz4tPQ; Mon, 23 Nov 2020 23:46:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 837E715302; Mon, 23 Nov 2020 23:46:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ANNk8AA042907; Mon, 23 Nov 2020 23:46:08 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANNk8el042905; Mon, 23 Nov 2020 23:46:08 GMT (envelope-from np@FreeBSD.org) Message-Id: <202011232346.0ANNk8el042905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 23 Nov 2020 23:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367964 - in stable/12/sys/dev/cxgbe: . common X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/12/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 367964 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 23:46:08 -0000 Author: np Date: Mon Nov 23 23:46:07 2020 New Revision: 367964 URL: https://svnweb.freebsd.org/changeset/base/367964 Log: MFC r365732 and r366589. r365732: cxgbe(4): Get the count of FCS errors from the MAC and not MPS for T6 ports. The MPS register on the T6 counts something other than FCS errors despite its name. r366589: cxgbe(4): More fixes for the T6 FCS error counter. r365732 was the first attempt to get an accurate count but it was writing to some read-only registers to clear them and that obviously didn't work. Instead, note the counter's value when it is supposed to be cleared and subtract it from future readings. dev..stats.rx_fcs_error should not be serviced from the MPS register for T6. The stats.* sysctls should all use T5_PORT_REG for T5 and above. This must have been missed in the initial T5 support years ago. Fix it while here. Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/adapter.h stable/12/sys/dev/cxgbe/common/t4_hw.c stable/12/sys/dev/cxgbe/t4_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/12/sys/dev/cxgbe/adapter.h Mon Nov 23 18:37:19 2020 (r367963) +++ stable/12/sys/dev/cxgbe/adapter.h Mon Nov 23 23:46:07 2020 (r367964) @@ -314,6 +314,8 @@ struct port_info { struct port_stats stats; u_int tnl_cong_drops; u_int tx_parse_error; + int fcs_reg; + uint64_t fcs_base; u_long tx_toe_tls_records; u_long tx_toe_tls_octets; u_long rx_toe_tls_records; Modified: stable/12/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/12/sys/dev/cxgbe/common/t4_hw.c Mon Nov 23 18:37:19 2020 (r367963) +++ stable/12/sys/dev/cxgbe/common/t4_hw.c Mon Nov 23 23:46:07 2020 (r367964) @@ -6852,7 +6852,8 @@ void t4_get_port_stats_offset(struct adapter *adap, in */ void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p) { - u32 bgmap = adap2pinfo(adap, idx)->mps_bg_map; + struct port_info *pi = adap->port[idx]; + u32 bgmap = pi->mps_bg_map; u32 stat_ctl = t4_read_reg(adap, A_MPS_STAT_CTL); #define GET_STAT(name) \ @@ -6902,7 +6903,6 @@ void t4_get_port_stats(struct adapter *adap, int idx, p->rx_ucast_frames = GET_STAT(RX_PORT_UCAST); p->rx_too_long = GET_STAT(RX_PORT_MTU_ERROR); p->rx_jabber = GET_STAT(RX_PORT_MTU_CRC_ERROR); - p->rx_fcs_err = GET_STAT(RX_PORT_CRC_ERROR); p->rx_len_err = GET_STAT(RX_PORT_LEN_ERROR); p->rx_symbol_err = GET_STAT(RX_PORT_SYM_ERROR); p->rx_runt = GET_STAT(RX_PORT_LESS_64B); @@ -6921,6 +6921,9 @@ void t4_get_port_stats(struct adapter *adap, int idx, p->rx_ppp5 = GET_STAT(RX_PORT_PPP5); p->rx_ppp6 = GET_STAT(RX_PORT_PPP6); p->rx_ppp7 = GET_STAT(RX_PORT_PPP7); + + if (pi->fcs_reg != -1) + p->rx_fcs_err = t4_read_reg64(adap, pi->fcs_reg) - pi->fcs_base; if (chip_id(adap) >= CHELSIO_T5) { if (stat_ctl & F_COUNTPAUSESTATRX) { Modified: stable/12/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_main.c Mon Nov 23 18:37:19 2020 (r367963) +++ stable/12/sys/dev/cxgbe/t4_main.c Mon Nov 23 23:46:07 2020 (r367964) @@ -1166,6 +1166,23 @@ t4_attach(device_t dev) mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF); sc->chan_map[pi->tx_chan] = i; + /* + * The MPS counter for FCS errors doesn't work correctly on the + * T6 so we use the MAC counter here. Which MAC is in use + * depends on the link settings which will be known when the + * link comes up. + */ + if (is_t6(sc)) { + pi->fcs_reg = -1; + } else if (is_t4(sc)) { + pi->fcs_reg = PORT_REG(pi->tx_chan, + A_MPS_PORT_STAT_RX_PORT_CRC_ERROR_L); + } else { + pi->fcs_reg = T5_PORT_REG(pi->tx_chan, + A_MPS_PORT_STAT_RX_PORT_CRC_ERROR_L); + } + pi->fcs_base = 0; + /* All VIs on this port share this media. */ ifmedia_init(&pi->media, IFM_IMASK, cxgbe_media_change, cxgbe_media_status); @@ -6677,155 +6694,88 @@ cxgbe_sysctls(struct port_info *pi) &pi->tx_parse_error, 0, "# of tx packets with invalid length or # of segments"); -#define SYSCTL_ADD_T4_REG64(pi, name, desc, reg) \ - SYSCTL_ADD_OID(ctx, children, OID_AUTO, name, \ - CTLTYPE_U64 | CTLFLAG_RD, sc, reg, \ - sysctl_handle_t4_reg64, "QU", desc) +#define T4_REGSTAT(name, stat, desc) \ + SYSCTL_ADD_OID(ctx, children, OID_AUTO, #name, \ + CTLTYPE_U64 | CTLFLAG_RD, sc, \ + (is_t4(sc) ? PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_##stat##_L) : \ + T5_PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_##stat##_L)), \ + sysctl_handle_t4_reg64, "QU", desc) - SYSCTL_ADD_T4_REG64(pi, "tx_octets", "# of octets in good frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_BYTES_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames", "total # of good frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_FRAMES_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_bcast_frames", "# of broadcast frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_BCAST_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_mcast_frames", "# of multicast frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_MCAST_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ucast_frames", "# of unicast frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_UCAST_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_error_frames", "# of error frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_ERROR_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames_64", - "# of tx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_64B_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames_65_127", - "# of tx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_65B_127B_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames_128_255", - "# of tx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_128B_255B_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames_256_511", - "# of tx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_256B_511B_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames_512_1023", - "# of tx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_512B_1023B_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames_1024_1518", - "# of tx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_1024B_1518B_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames_1519_max", - "# of tx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_1519B_MAX_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_drop", "# of dropped tx frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_DROP_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_pause", "# of pause frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PAUSE_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp0", "# of PPP prio 0 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP0_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp1", "# of PPP prio 1 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP1_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp2", "# of PPP prio 2 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP2_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp3", "# of PPP prio 3 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP3_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp4", "# of PPP prio 4 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP4_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp5", "# of PPP prio 5 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP5_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp6", "# of PPP prio 6 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP6_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp7", "# of PPP prio 7 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP7_L)); - - SYSCTL_ADD_T4_REG64(pi, "rx_octets", "# of octets in good frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_BYTES_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames", "total # of good frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_FRAMES_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_bcast_frames", "# of broadcast frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_BCAST_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_mcast_frames", "# of multicast frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_MCAST_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ucast_frames", "# of unicast frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_UCAST_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_too_long", "# of frames exceeding MTU", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_MTU_ERROR_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_jabber", "# of jabber frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_MTU_CRC_ERROR_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_fcs_err", - "# of frames received with bad FCS", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_CRC_ERROR_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_len_err", - "# of frames received with length error", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_LEN_ERROR_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_symbol_err", "symbol errors", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_SYM_ERROR_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_runt", "# of short frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_LESS_64B_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames_64", - "# of rx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_64B_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames_65_127", - "# of rx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_65B_127B_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames_128_255", - "# of rx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_128B_255B_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames_256_511", - "# of rx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_256B_511B_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames_512_1023", - "# of rx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_512B_1023B_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames_1024_1518", - "# of rx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_1024B_1518B_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames_1519_max", - "# of rx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_1519B_MAX_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_pause", "# of pause frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PAUSE_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp0", "# of PPP prio 0 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP0_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp1", "# of PPP prio 1 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP1_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp2", "# of PPP prio 2 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP2_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp3", "# of PPP prio 3 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP3_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp4", "# of PPP prio 4 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP4_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp5", "# of PPP prio 5 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP5_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp6", "# of PPP prio 6 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP6_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp7", "# of PPP prio 7 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP7_L)); - -#undef SYSCTL_ADD_T4_REG64 - -#define SYSCTL_ADD_T4_PORTSTAT(name, desc) \ +/* We get these from port_stats and they may be stale by up to 1s */ +#define T4_PORTSTAT(name, desc) \ SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, #name, CTLFLAG_RD, \ &pi->stats.name, desc) - /* We get these from port_stats and they may be stale by up to 1s */ - SYSCTL_ADD_T4_PORTSTAT(rx_ovflow0, - "# drops due to buffer-group 0 overflows"); - SYSCTL_ADD_T4_PORTSTAT(rx_ovflow1, - "# drops due to buffer-group 1 overflows"); - SYSCTL_ADD_T4_PORTSTAT(rx_ovflow2, - "# drops due to buffer-group 2 overflows"); - SYSCTL_ADD_T4_PORTSTAT(rx_ovflow3, - "# drops due to buffer-group 3 overflows"); - SYSCTL_ADD_T4_PORTSTAT(rx_trunc0, - "# of buffer-group 0 truncated packets"); - SYSCTL_ADD_T4_PORTSTAT(rx_trunc1, - "# of buffer-group 1 truncated packets"); - SYSCTL_ADD_T4_PORTSTAT(rx_trunc2, - "# of buffer-group 2 truncated packets"); - SYSCTL_ADD_T4_PORTSTAT(rx_trunc3, - "# of buffer-group 3 truncated packets"); + T4_REGSTAT(tx_octets, TX_PORT_BYTES, "# of octets in good frames"); + T4_REGSTAT(tx_frames, TX_PORT_FRAMES, "total # of good frames"); + T4_REGSTAT(tx_bcast_frames, TX_PORT_BCAST, "# of broadcast frames"); + T4_REGSTAT(tx_mcast_frames, TX_PORT_MCAST, "# of multicast frames"); + T4_REGSTAT(tx_ucast_frames, TX_PORT_UCAST, "# of unicast frames"); + T4_REGSTAT(tx_error_frames, TX_PORT_ERROR, "# of error frames"); + T4_REGSTAT(tx_frames_64, TX_PORT_64B, "# of tx frames in this range"); + T4_REGSTAT(tx_frames_65_127, TX_PORT_65B_127B, "# of tx frames in this range"); + T4_REGSTAT(tx_frames_128_255, TX_PORT_128B_255B, "# of tx frames in this range"); + T4_REGSTAT(tx_frames_256_511, TX_PORT_256B_511B, "# of tx frames in this range"); + T4_REGSTAT(tx_frames_512_1023, TX_PORT_512B_1023B, "# of tx frames in this range"); + T4_REGSTAT(tx_frames_1024_1518, TX_PORT_1024B_1518B, "# of tx frames in this range"); + T4_REGSTAT(tx_frames_1519_max, TX_PORT_1519B_MAX, "# of tx frames in this range"); + T4_REGSTAT(tx_drop, TX_PORT_DROP, "# of dropped tx frames"); + T4_REGSTAT(tx_pause, TX_PORT_PAUSE, "# of pause frames transmitted"); + T4_REGSTAT(tx_ppp0, TX_PORT_PPP0, "# of PPP prio 0 frames transmitted"); + T4_REGSTAT(tx_ppp1, TX_PORT_PPP1, "# of PPP prio 1 frames transmitted"); + T4_REGSTAT(tx_ppp2, TX_PORT_PPP2, "# of PPP prio 2 frames transmitted"); + T4_REGSTAT(tx_ppp3, TX_PORT_PPP3, "# of PPP prio 3 frames transmitted"); + T4_REGSTAT(tx_ppp4, TX_PORT_PPP4, "# of PPP prio 4 frames transmitted"); + T4_REGSTAT(tx_ppp5, TX_PORT_PPP5, "# of PPP prio 5 frames transmitted"); + T4_REGSTAT(tx_ppp6, TX_PORT_PPP6, "# of PPP prio 6 frames transmitted"); + T4_REGSTAT(tx_ppp7, TX_PORT_PPP7, "# of PPP prio 7 frames transmitted"); -#undef SYSCTL_ADD_T4_PORTSTAT + T4_REGSTAT(rx_octets, RX_PORT_BYTES, "# of octets in good frames"); + T4_REGSTAT(rx_frames, RX_PORT_FRAMES, "total # of good frames"); + T4_REGSTAT(rx_bcast_frames, RX_PORT_BCAST, "# of broadcast frames"); + T4_REGSTAT(rx_mcast_frames, RX_PORT_MCAST, "# of multicast frames"); + T4_REGSTAT(rx_ucast_frames, RX_PORT_UCAST, "# of unicast frames"); + T4_REGSTAT(rx_too_long, RX_PORT_MTU_ERROR, "# of frames exceeding MTU"); + T4_REGSTAT(rx_jabber, RX_PORT_MTU_CRC_ERROR, "# of jabber frames"); + if (is_t6(sc)) { + T4_PORTSTAT(rx_fcs_err, + "# of frames received with bad FCS since last link up"); + } else { + T4_REGSTAT(rx_fcs_err, RX_PORT_CRC_ERROR, + "# of frames received with bad FCS"); + } + T4_REGSTAT(rx_len_err, RX_PORT_LEN_ERROR, "# of frames received with length error"); + T4_REGSTAT(rx_symbol_err, RX_PORT_SYM_ERROR, "symbol errors"); + T4_REGSTAT(rx_runt, RX_PORT_LESS_64B, "# of short frames received"); + T4_REGSTAT(rx_frames_64, RX_PORT_64B, "# of rx frames in this range"); + T4_REGSTAT(rx_frames_65_127, RX_PORT_65B_127B, "# of rx frames in this range"); + T4_REGSTAT(rx_frames_128_255, RX_PORT_128B_255B, "# of rx frames in this range"); + T4_REGSTAT(rx_frames_256_511, RX_PORT_256B_511B, "# of rx frames in this range"); + T4_REGSTAT(rx_frames_512_1023, RX_PORT_512B_1023B, "# of rx frames in this range"); + T4_REGSTAT(rx_frames_1024_1518, RX_PORT_1024B_1518B, "# of rx frames in this range"); + T4_REGSTAT(rx_frames_1519_max, RX_PORT_1519B_MAX, "# of rx frames in this range"); + T4_REGSTAT(rx_pause, RX_PORT_PAUSE, "# of pause frames received"); + T4_REGSTAT(rx_ppp0, RX_PORT_PPP0, "# of PPP prio 0 frames received"); + T4_REGSTAT(rx_ppp1, RX_PORT_PPP1, "# of PPP prio 1 frames received"); + T4_REGSTAT(rx_ppp2, RX_PORT_PPP2, "# of PPP prio 2 frames received"); + T4_REGSTAT(rx_ppp3, RX_PORT_PPP3, "# of PPP prio 3 frames received"); + T4_REGSTAT(rx_ppp4, RX_PORT_PPP4, "# of PPP prio 4 frames received"); + T4_REGSTAT(rx_ppp5, RX_PORT_PPP5, "# of PPP prio 5 frames received"); + T4_REGSTAT(rx_ppp6, RX_PORT_PPP6, "# of PPP prio 6 frames received"); + T4_REGSTAT(rx_ppp7, RX_PORT_PPP7, "# of PPP prio 7 frames received"); + T4_PORTSTAT(rx_ovflow0, "# drops due to buffer-group 0 overflows"); + T4_PORTSTAT(rx_ovflow1, "# drops due to buffer-group 1 overflows"); + T4_PORTSTAT(rx_ovflow2, "# drops due to buffer-group 2 overflows"); + T4_PORTSTAT(rx_ovflow3, "# drops due to buffer-group 3 overflows"); + T4_PORTSTAT(rx_trunc0, "# of buffer-group 0 truncated packets"); + T4_PORTSTAT(rx_trunc1, "# of buffer-group 1 truncated packets"); + T4_PORTSTAT(rx_trunc2, "# of buffer-group 2 truncated packets"); + T4_PORTSTAT(rx_trunc3, "# of buffer-group 3 truncated packets"); + +#undef T4_REGSTAT +#undef T4_PORTSTAT + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "tx_toe_tls_records", CTLFLAG_RD, &pi->tx_toe_tls_records, "# of TLS records transmitted"); @@ -10188,6 +10138,12 @@ clear_stats(struct adapter *sc, u_int port_id) /* MAC stats */ t4_clr_port_stats(sc, pi->tx_chan); + if (is_t6(sc)) { + if (pi->fcs_reg != -1) + pi->fcs_base = t4_read_reg64(sc, pi->fcs_reg); + else + pi->stats.rx_fcs_err = 0; + } pi->tx_parse_error = 0; pi->tnl_cong_drops = 0; mtx_lock(&sc->reg_lock); @@ -10348,17 +10304,37 @@ t4_os_link_changed(struct port_info *pi) { struct vi_info *vi; struct ifnet *ifp; - struct link_config *lc; + struct link_config *lc = &pi->link_cfg; + struct adapter *sc = pi->adapter; int v; PORT_LOCK_ASSERT_OWNED(pi); + if (is_t6(sc)) { + if (lc->link_ok) { + if (lc->speed > 25000 || + (lc->speed == 25000 && lc->fec == FEC_RS)) { + pi->fcs_reg = T5_PORT_REG(pi->tx_chan, + A_MAC_PORT_AFRAMECHECKSEQUENCEERRORS); + } else { + pi->fcs_reg = T5_PORT_REG(pi->tx_chan, + A_MAC_PORT_MTIP_1G10G_RX_CRCERRORS); + } + pi->fcs_base = t4_read_reg64(sc, pi->fcs_reg); + pi->stats.rx_fcs_err = 0; + } else { + pi->fcs_reg = -1; + } + } else { + MPASS(pi->fcs_reg != -1); + MPASS(pi->fcs_base == 0); + } + for_each_vi(pi, v, vi) { ifp = vi->ifp; if (ifp == NULL) continue; - lc = &pi->link_cfg; if (lc->link_ok) { ifp->if_baudrate = IF_Mbps(lc->speed); if_link_state_change(ifp, LINK_STATE_UP); From owner-svn-src-all@freebsd.org Mon Nov 23 23:53:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5427746F046; Mon, 23 Nov 2020 23:53:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg3rL1vYVz4tqn; Mon, 23 Nov 2020 23:53:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 341A615324; Mon, 23 Nov 2020 23:53:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ANNrMDl049039; Mon, 23 Nov 2020 23:53:22 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANNrLkS049037; Mon, 23 Nov 2020 23:53:21 GMT (envelope-from np@FreeBSD.org) Message-Id: <202011232353.0ANNrLkS049037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 23 Nov 2020 23:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367965 - in stable/12: share/man/man4 sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/cxgbe X-SVN-Commit-Revision: 367965 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 23:53:22 -0000 Author: np Date: Mon Nov 23 23:53:21 2020 New Revision: 367965 URL: https://svnweb.freebsd.org/changeset/base/367965 Log: MFC r366532 and r366862. r366532: cxgbe(4): knobs to drop various kinds of undesirable frames on ingress. These kind of drops come for free in the sense that they do not use the filter TCAM or any other resource that wouldn't normally be used during rx. Frames dropped by the hardware get counted in the MAC's rx stats but are not delivered to the driver. hw.cxgbe.attack_filter Set to 1 to enable the "attack filter". Default is 0. The attack filter will drop an incoming frame if any of these conditions is true: src ip/ip6 == dst ip/ip6; tcp and src/dst ip is not unicast; src/dst ip is loopback (127.x.y.z); src ip6 is not unicast; src/dst ip6 is loopback (::1/128) or unspecified (::/128); tcp and src/dst ip6 is mcast (ff00::/8). hw.cxgbe.drop_ip_fragments Set to 1 to drop all incoming IP fragments. Default is 0. Note that this drops valid frames. hw.cxgbe.drop_pkts_with_l2_errors Set to 1 to drop incoming frames with Layer 2 length or checksum errors. Default is 1. hw.cxgbe.drop_pkts_with_l3_errors Set to 1 to drop incoming frames with IP version, length, or checksum errors. Default is 0. hw.cxgbe.drop_pkts_with_l4_errors Set to 1 to drop incoming frames with Layer 4 length, checksum, or other errors. Default is 0. r366862: cxgbe(4): Updates to the drop features from r366532. Sponsored by: Chelsio Communications Modified: stable/12/share/man/man4/cxgbe.4 stable/12/sys/dev/cxgbe/t4_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/cxgbe.4 ============================================================================== --- stable/12/share/man/man4/cxgbe.4 Mon Nov 23 23:46:07 2020 (r367964) +++ stable/12/share/man/man4/cxgbe.4 Mon Nov 23 23:53:21 2020 (r367965) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2020 +.Dd October 19, 2020 .Dt CXGBE 4 .Os .Sh NAME @@ -362,6 +362,29 @@ The default value is 0 and should be changed only if P to communicate with each other. Different interfaces can be assigned different values using the dev..X.tx_vm_wr sysctl when the interface is administratively down. +.It Va hw.cxgbe.attack_filter +Set to 1 to enable the "attack filter". +Default is 0. +The attack filter will drop an incoming frame if any of these conditions is +true: src ip/ip6 == dst ip/ip6; tcp and src/dst ip is not unicast; src/dst ip is +loopback (127.x.y.z); src ip6 is not unicast; src/dst ip6 is loopback (::1/128) +or unspecified (::/128); tcp and src/dst ip6 is mcast (ff00::/8). +This facility is available on T4 and T5 based cards only. +.It Va hw.cxgbe.drop_ip_fragments +Set to 1 to drop all incoming IP fragments. +Default is 0. +Note that this drops valid frames. +.It Va hw.cxgbe.drop_pkts_with_l2_errors +Set to 1 to drop incoming frames with Layer 2 length or checksum errors. +Default is 1. +.It Va hw.cxgbe.drop_pkts_with_l3_errors +Set to 1 to drop incoming frames with IP version, length, or checksum errors. +The IP checksum is validated for TCP or UDP packets only. +Default is 0. +.It Va hw.cxgbe.drop_pkts_with_l4_errors +Set to 1 to drop incoming frames with Layer 4 (TCP or UDP) length, +checksum, or other errors. +Default is 0. .El .Sh SUPPORT For general information and support, Modified: stable/12/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_main.c Mon Nov 23 23:46:07 2020 (r367964) +++ stable/12/sys/dev/cxgbe/t4_main.c Mon Nov 23 23:53:21 2020 (r367965) @@ -579,6 +579,46 @@ static int t4_tx_vm_wr = 0; SYSCTL_INT(_hw_cxgbe, OID_AUTO, tx_vm_wr, CTLFLAG_RWTUN, &t4_tx_vm_wr, 0, "Use VM work requests to transmit packets."); +/* + * Set to non-zero to enable the attack filter. A packet that matches any of + * these conditions will get dropped on ingress: + * 1) IP && source address == destination address. + * 2) TCP/IP && source address is not a unicast address. + * 3) TCP/IP && destination address is not a unicast address. + * 4) IP && source address is loopback (127.x.y.z). + * 5) IP && destination address is loopback (127.x.y.z). + * 6) IPv6 && source address == destination address. + * 7) IPv6 && source address is not a unicast address. + * 8) IPv6 && source address is loopback (::1/128). + * 9) IPv6 && destination address is loopback (::1/128). + * 10) IPv6 && source address is unspecified (::/128). + * 11) IPv6 && destination address is unspecified (::/128). + * 12) TCP/IPv6 && source address is multicast (ff00::/8). + * 13) TCP/IPv6 && destination address is multicast (ff00::/8). + */ +static int t4_attack_filter = 0; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, attack_filter, CTLFLAG_RDTUN, + &t4_attack_filter, 0, "Drop suspicious traffic"); + +static int t4_drop_ip_fragments = 0; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, drop_ip_fragments, CTLFLAG_RDTUN, + &t4_drop_ip_fragments, 0, "Drop IP fragments"); + +static int t4_drop_pkts_with_l2_errors = 1; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, drop_pkts_with_l2_errors, CTLFLAG_RDTUN, + &t4_drop_pkts_with_l2_errors, 0, + "Drop all frames with Layer 2 length or checksum errors"); + +static int t4_drop_pkts_with_l3_errors = 0; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, drop_pkts_with_l3_errors, CTLFLAG_RDTUN, + &t4_drop_pkts_with_l3_errors, 0, + "Drop all frames with IP version, length, or checksum errors"); + +static int t4_drop_pkts_with_l4_errors = 0; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, drop_pkts_with_l4_errors, CTLFLAG_RDTUN, + &t4_drop_pkts_with_l4_errors, 0, + "Drop all frames with Layer 4 length, checksum, or other errors"); + #ifdef TCP_OFFLOAD /* * TOE tunables. @@ -4547,7 +4587,7 @@ get_params__post_init(struct adapter *sc) static int set_params__post_init(struct adapter *sc) { - uint32_t param, val; + uint32_t mask, param, val; #ifdef TCP_OFFLOAD int i, v, shift; #endif @@ -4567,6 +4607,33 @@ set_params__post_init(struct adapter *sc) val = 1 << (G_MASKSIZE(t4_read_reg(sc, A_TP_RSS_CONFIG_TNL)) - 1); t4_set_reg_field(sc, A_TP_RSS_CONFIG_TNL, V_MASKFILTER(M_MASKFILTER), V_MASKFILTER(val - 1)); + + mask = F_DROPERRORANY | F_DROPERRORMAC | F_DROPERRORIPVER | + F_DROPERRORFRAG | F_DROPERRORATTACK | F_DROPERRORETHHDRLEN | + F_DROPERRORIPHDRLEN | F_DROPERRORTCPHDRLEN | F_DROPERRORPKTLEN | + F_DROPERRORTCPOPT | F_DROPERRORCSUMIP | F_DROPERRORCSUM; + val = 0; + if (chip_id(sc) < CHELSIO_T6 && t4_attack_filter != 0) { + t4_set_reg_field(sc, A_TP_GLOBAL_CONFIG, F_ATTACKFILTERENABLE, + F_ATTACKFILTERENABLE); + val |= F_DROPERRORATTACK; + } + if (t4_drop_ip_fragments != 0) { + t4_set_reg_field(sc, A_TP_GLOBAL_CONFIG, F_FRAGMENTDROP, + F_FRAGMENTDROP); + val |= F_DROPERRORFRAG; + } + if (t4_drop_pkts_with_l2_errors != 0) + val |= F_DROPERRORMAC | F_DROPERRORETHHDRLEN; + if (t4_drop_pkts_with_l3_errors != 0) { + val |= F_DROPERRORIPVER | F_DROPERRORIPHDRLEN | + F_DROPERRORCSUMIP; + } + if (t4_drop_pkts_with_l4_errors != 0) { + val |= F_DROPERRORTCPHDRLEN | F_DROPERRORPKTLEN | + F_DROPERRORTCPOPT | F_DROPERRORCSUM; + } + t4_set_reg_field(sc, A_TP_ERR_CONFIG, mask, val); #ifdef TCP_OFFLOAD /* From owner-svn-src-all@freebsd.org Mon Nov 23 23:58:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F5F846F5EF; Mon, 23 Nov 2020 23:58:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg3xz0NnRz4v9S; Mon, 23 Nov 2020 23:58:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F00C514E71; Mon, 23 Nov 2020 23:58:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ANNwEZr049327; Mon, 23 Nov 2020 23:58:14 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ANNwErI049326; Mon, 23 Nov 2020 23:58:14 GMT (envelope-from np@FreeBSD.org) Message-Id: <202011232358.0ANNwErI049326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 23 Nov 2020 23:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367966 - stable/12/sys/dev/cxgbe/cudbg X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe/cudbg X-SVN-Commit-Revision: 367966 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.34 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2020 23:58:15 -0000 Author: np Date: Mon Nov 23 23:58:14 2020 New Revision: 367966 URL: https://svnweb.freebsd.org/changeset/base/367966 Log: MFC r366694: cxgbe(4): unimplemented cudbg routines should return the correct internal error code and not an errno. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/cudbg/cudbg_lib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/cudbg/cudbg_lib.c ============================================================================== --- stable/12/sys/dev/cxgbe/cudbg/cudbg_lib.c Mon Nov 23 23:53:21 2020 (r367965) +++ stable/12/sys/dev/cxgbe/cudbg/cudbg_lib.c Mon Nov 23 23:58:14 2020 (r367966) @@ -2027,7 +2027,7 @@ err1: err: return rc; #endif - return (EDOOFUS); + return (CUDBG_STATUS_NOT_IMPLEMENTED); } /* CIM OBQ */ @@ -2664,7 +2664,7 @@ err1: err: return rc; #endif - return (EDOOFUS); + return (CUDBG_STATUS_NOT_IMPLEMENTED); } static void collect_mem_info(struct cudbg_init *pdbg_init, @@ -3130,7 +3130,7 @@ err1: err: return rc; #endif - return (EDOOFUS); + return (CUDBG_STATUS_NOT_IMPLEMENTED); } static int collect_pbt_tables(struct cudbg_init *pdbg_init, @@ -4450,5 +4450,5 @@ err1: err: return rc; #endif - return (EDOOFUS); + return (CUDBG_STATUS_NOT_IMPLEMENTED); } From owner-svn-src-all@freebsd.org Tue Nov 24 00:02:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DECFB46F34D; Tue, 24 Nov 2020 00:02:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg42Z60BLz4v3v; Tue, 24 Nov 2020 00:02:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0F52154B3; Tue, 24 Nov 2020 00:02:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AO02ESv054264; Tue, 24 Nov 2020 00:02:14 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AO02Eaw054263; Tue, 24 Nov 2020 00:02:14 GMT (envelope-from np@FreeBSD.org) Message-Id: <202011240002.0AO02Eaw054263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 24 Nov 2020 00:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367967 - stable/12/sys/dev/cxgbe/common X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe/common X-SVN-Commit-Revision: 367967 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 00:02:14 -0000 Author: np Date: Tue Nov 24 00:02:14 2020 New Revision: 367967 URL: https://svnweb.freebsd.org/changeset/base/367967 Log: MFC r366696: cxgbe(4): Do not request FEC when requesting speeds that don't have FEC. Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/common/t4_hw.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/12/sys/dev/cxgbe/common/t4_hw.c Mon Nov 23 23:58:14 2020 (r367966) +++ stable/12/sys/dev/cxgbe/common/t4_hw.c Tue Nov 24 00:02:14 2020 (r367967) @@ -3915,7 +3915,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m speed = fwcap_top_speed(lc->pcaps); fec = 0; - if (fec_supported(lc->pcaps)) { + if (fec_supported(speed)) { if (lc->requested_fec == FEC_AUTO) { if (lc->pcaps & FW_PORT_CAP32_FORCE_FEC) { if (speed & FW_PORT_CAP32_SPEED_100G) { From owner-svn-src-all@freebsd.org Tue Nov 24 00:07:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 155FE46FB9E; Tue, 24 Nov 2020 00:07:23 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg48W07xnz4vmP; Tue, 24 Nov 2020 00:07:23 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBBF215807; Tue, 24 Nov 2020 00:07:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AO07MX7055553; Tue, 24 Nov 2020 00:07:22 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AO07Mov055552; Tue, 24 Nov 2020 00:07:22 GMT (envelope-from np@FreeBSD.org) Message-Id: <202011240007.0AO07Mov055552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 24 Nov 2020 00:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367968 - stable/12/sys/dev/cxgbe/common X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe/common X-SVN-Commit-Revision: 367968 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 00:07:23 -0000 Author: np Date: Tue Nov 24 00:07:22 2020 New Revision: 367968 URL: https://svnweb.freebsd.org/changeset/base/367968 Log: MFC r366853: cxgbe(4): Fix page fault in t4_get_lb_stats with 2 port T5 cards. PR: 250449 Reported by: freqlabs@ Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/common/t4_hw.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/12/sys/dev/cxgbe/common/t4_hw.c Tue Nov 24 00:02:14 2020 (r367967) +++ stable/12/sys/dev/cxgbe/common/t4_hw.c Tue Nov 24 00:07:22 2020 (r367968) @@ -6957,7 +6957,6 @@ void t4_get_port_stats(struct adapter *adap, int idx, */ void t4_get_lb_stats(struct adapter *adap, int idx, struct lb_port_stats *p) { - u32 bgmap = adap2pinfo(adap, idx)->mps_bg_map; #define GET_STAT(name) \ t4_read_reg64(adap, \ @@ -6982,14 +6981,18 @@ void t4_get_lb_stats(struct adapter *adap, int idx, st p->frames_1519_max = GET_STAT(1519B_MAX); p->drop = GET_STAT(DROP_FRAMES); - p->ovflow0 = (bgmap & 1) ? GET_STAT_COM(RX_BG_0_LB_DROP_FRAME) : 0; - p->ovflow1 = (bgmap & 2) ? GET_STAT_COM(RX_BG_1_LB_DROP_FRAME) : 0; - p->ovflow2 = (bgmap & 4) ? GET_STAT_COM(RX_BG_2_LB_DROP_FRAME) : 0; - p->ovflow3 = (bgmap & 8) ? GET_STAT_COM(RX_BG_3_LB_DROP_FRAME) : 0; - p->trunc0 = (bgmap & 1) ? GET_STAT_COM(RX_BG_0_LB_TRUNC_FRAME) : 0; - p->trunc1 = (bgmap & 2) ? GET_STAT_COM(RX_BG_1_LB_TRUNC_FRAME) : 0; - p->trunc2 = (bgmap & 4) ? GET_STAT_COM(RX_BG_2_LB_TRUNC_FRAME) : 0; - p->trunc3 = (bgmap & 8) ? GET_STAT_COM(RX_BG_3_LB_TRUNC_FRAME) : 0; + if (idx < adap->params.nports) { + u32 bg = adap2pinfo(adap, idx)->mps_bg_map; + + p->ovflow0 = (bg & 1) ? GET_STAT_COM(RX_BG_0_LB_DROP_FRAME) : 0; + p->ovflow1 = (bg & 2) ? GET_STAT_COM(RX_BG_1_LB_DROP_FRAME) : 0; + p->ovflow2 = (bg & 4) ? GET_STAT_COM(RX_BG_2_LB_DROP_FRAME) : 0; + p->ovflow3 = (bg & 8) ? GET_STAT_COM(RX_BG_3_LB_DROP_FRAME) : 0; + p->trunc0 = (bg & 1) ? GET_STAT_COM(RX_BG_0_LB_TRUNC_FRAME) : 0; + p->trunc1 = (bg & 2) ? GET_STAT_COM(RX_BG_1_LB_TRUNC_FRAME) : 0; + p->trunc2 = (bg & 4) ? GET_STAT_COM(RX_BG_2_LB_TRUNC_FRAME) : 0; + p->trunc3 = (bg & 8) ? GET_STAT_COM(RX_BG_3_LB_TRUNC_FRAME) : 0; + } #undef GET_STAT #undef GET_STAT_COM From owner-svn-src-all@freebsd.org Tue Nov 24 00:12:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B08046FCC7; Tue, 24 Nov 2020 00:12:43 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg4Gg0KKbz3CbF; Tue, 24 Nov 2020 00:12:43 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F209D1544C; Tue, 24 Nov 2020 00:12:42 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AO0Cgk9062526; Tue, 24 Nov 2020 00:12:42 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AO0CgK7062525; Tue, 24 Nov 2020 00:12:42 GMT (envelope-from np@FreeBSD.org) Message-Id: <202011240012.0AO0CgK7062525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 24 Nov 2020 00:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367969 - stable/12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe X-SVN-Commit-Revision: 367969 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 00:12:43 -0000 Author: np Date: Tue Nov 24 00:12:42 2020 New Revision: 367969 URL: https://svnweb.freebsd.org/changeset/base/367969 Log: MFC r366916: cxgbe(4): display correct tid range for T6 based -SO cards. Reported by: Chelsio QA Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/t4_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_main.c Tue Nov 24 00:07:22 2020 (r367968) +++ stable/12/sys/dev/cxgbe/t4_main.c Tue Nov 24 00:12:42 2020 (r367969) @@ -9020,8 +9020,10 @@ sysctl_tids(SYSCTL_HANDLER_ARGS) if (b) sbuf_printf(sb, "%u-%u, ", t->tid_base, b - 1); sbuf_printf(sb, "%u-%u", hb, t->ntids - 1); - } else - sbuf_printf(sb, "%u-%u", t->tid_base, t->ntids - 1); + } else { + sbuf_printf(sb, "%u-%u", t->tid_base, t->tid_base + + t->ntids - 1); + } sbuf_printf(sb, ", in use: %u\n", atomic_load_acq_int(&t->tids_in_use)); } From owner-svn-src-all@freebsd.org Tue Nov 24 00:17:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19F64470306; Tue, 24 Nov 2020 00:17:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg4Ml0JXtz3Cxy; Tue, 24 Nov 2020 00:17:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1DBD157AF; Tue, 24 Nov 2020 00:17:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AO0H6VC062923; Tue, 24 Nov 2020 00:17:06 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AO0H6a7062918; Tue, 24 Nov 2020 00:17:06 GMT (envelope-from np@FreeBSD.org) Message-Id: <202011240017.0AO0H6a7062918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 24 Nov 2020 00:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367970 - stable/12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe X-SVN-Commit-Revision: 367970 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 00:17:07 -0000 Author: np Date: Tue Nov 24 00:17:05 2020 New Revision: 367970 URL: https://svnweb.freebsd.org/changeset/base/367970 Log: MFC r366929 and r367608. r366929: cxgbe(4): fix the size of the iq/eq maps. The firmware can allocate ingress and egress context ids anywhere from its configured range. Size the iq/eq maps to match the entire range instead of assuming that the firmware always allocates the first available context id. Reported by: Baptiste Wicht @ Verisign r367608: cxgbev(4): Make sure that the iq/eq map sizes are correct for VFs. This should have been part of r366929. Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/adapter.h stable/12/sys/dev/cxgbe/t4_main.c stable/12/sys/dev/cxgbe/t4_netmap.c stable/12/sys/dev/cxgbe/t4_sge.c stable/12/sys/dev/cxgbe/t4_vf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/12/sys/dev/cxgbe/adapter.h Tue Nov 24 00:12:42 2020 (r367969) +++ stable/12/sys/dev/cxgbe/adapter.h Tue Nov 24 00:17:05 2020 (r367970) @@ -785,6 +785,8 @@ struct sge { uint16_t iq_base; /* first abs_id */ int eq_start; /* first cntxt_id */ int eq_base; /* first abs_id */ + int iqmap_sz; + int eqmap_sz; struct sge_iq **iqmap; /* iq->cntxt_id to iq mapping */ struct sge_eq **eqmap; /* eq->cntxt_id to eq mapping */ Modified: stable/12/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_main.c Tue Nov 24 00:12:42 2020 (r367969) +++ stable/12/sys/dev/cxgbe/t4_main.c Tue Nov 24 00:17:05 2020 (r367970) @@ -1311,6 +1311,8 @@ t4_attach(device_t dev) s->nm_txq = malloc(s->nnmtxq * sizeof(struct sge_nm_txq), M_CXGBE, M_ZERO | M_WAITOK); #endif + MPASS(s->niq <= s->iqmap_sz); + MPASS(s->neq <= s->eqmap_sz); s->ctrlq = malloc(nports * sizeof(struct sge_wrq), M_CXGBE, M_ZERO | M_WAITOK); @@ -1318,9 +1320,9 @@ t4_attach(device_t dev) M_ZERO | M_WAITOK); s->txq = malloc(s->ntxq * sizeof(struct sge_txq), M_CXGBE, M_ZERO | M_WAITOK); - s->iqmap = malloc(s->niq * sizeof(struct sge_iq *), M_CXGBE, + s->iqmap = malloc(s->iqmap_sz * sizeof(struct sge_iq *), M_CXGBE, M_ZERO | M_WAITOK); - s->eqmap = malloc(s->neq * sizeof(struct sge_eq *), M_CXGBE, + s->eqmap = malloc(s->eqmap_sz * sizeof(struct sge_eq *), M_CXGBE, M_ZERO | M_WAITOK); sc->irq = malloc(sc->intr_count * sizeof(struct irq), M_CXGBE, @@ -4298,6 +4300,19 @@ get_params__post_init(struct adapter *sc) ("%s: L2 table size (%u) larger than expected (%u)", __func__, sc->vres.l2t.size, L2T_SIZE)); sc->params.core_vdd = val[6]; + + param[0] = FW_PARAM_PFVF(IQFLINT_END); + param[1] = FW_PARAM_PFVF(EQ_END); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 2, param, val); + if (rc != 0) { + device_printf(sc->dev, + "failed to query parameters (post_init2): %d.\n", rc); + return (rc); + } + MPASS((int)val[0] >= sc->sge.iq_start); + sc->sge.iqmap_sz = val[0] - sc->sge.iq_start + 1; + MPASS((int)val[1] >= sc->sge.eq_start); + sc->sge.eqmap_sz = val[1] - sc->sge.eq_start + 1; if (chip_id(sc) >= CHELSIO_T6) { Modified: stable/12/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_netmap.c Tue Nov 24 00:12:42 2020 (r367969) +++ stable/12/sys/dev/cxgbe/t4_netmap.c Tue Nov 24 00:17:05 2020 (r367970) @@ -188,9 +188,9 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq nm_rxq->iq_cntxt_id = be16toh(c.iqid); nm_rxq->iq_abs_id = be16toh(c.physiqid); cntxt_id = nm_rxq->iq_cntxt_id - sc->sge.iq_start; - if (cntxt_id >= sc->sge.niq) { + if (cntxt_id >= sc->sge.iqmap_sz) { panic ("%s: nm_rxq->iq_cntxt_id (%d) more than the max (%d)", - __func__, cntxt_id, sc->sge.niq - 1); + __func__, cntxt_id, sc->sge.iqmap_sz - 1); } sc->sge.iqmap[cntxt_id] = (void *)nm_rxq; @@ -201,9 +201,9 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq nm_rxq->fl_db_threshold = chip_id(sc) <= CHELSIO_T5 ? 8 : 4; MPASS(nm_rxq->fl_sidx == na->num_rx_desc); cntxt_id = nm_rxq->fl_cntxt_id - sc->sge.eq_start; - if (cntxt_id >= sc->sge.neq) { + if (cntxt_id >= sc->sge.eqmap_sz) { panic("%s: nm_rxq->fl_cntxt_id (%d) more than the max (%d)", - __func__, cntxt_id, sc->sge.neq - 1); + __func__, cntxt_id, sc->sge.eqmap_sz - 1); } sc->sge.eqmap[cntxt_id] = (void *)nm_rxq; @@ -300,9 +300,9 @@ alloc_nm_txq_hwq(struct vi_info *vi, struct sge_nm_txq nm_txq->cntxt_id = G_FW_EQ_ETH_CMD_EQID(be32toh(c.eqid_pkd)); cntxt_id = nm_txq->cntxt_id - sc->sge.eq_start; - if (cntxt_id >= sc->sge.neq) + if (cntxt_id >= sc->sge.eqmap_sz) panic("%s: nm_txq->cntxt_id (%d) more than the max (%d)", __func__, - cntxt_id, sc->sge.neq - 1); + cntxt_id, sc->sge.eqmap_sz - 1); sc->sge.eqmap[cntxt_id] = (void *)nm_txq; nm_txq->pidx = nm_txq->cidx = 0; Modified: stable/12/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_sge.c Tue Nov 24 00:12:42 2020 (r367969) +++ stable/12/sys/dev/cxgbe/t4_sge.c Tue Nov 24 00:17:05 2020 (r367970) @@ -3442,9 +3442,9 @@ alloc_iq_fl(struct vi_info *vi, struct sge_iq *iq, str iq->flags |= IQ_ALLOCATED; cntxt_id = iq->cntxt_id - sc->sge.iq_start; - if (cntxt_id >= sc->sge.niq) { + if (cntxt_id >= sc->sge.iqmap_sz) { panic ("%s: iq->cntxt_id (%d) more than the max (%d)", __func__, - cntxt_id, sc->sge.niq - 1); + cntxt_id, sc->sge.iqmap_sz - 1); } sc->sge.iqmap[cntxt_id] = iq; @@ -3456,9 +3456,9 @@ alloc_iq_fl(struct vi_info *vi, struct sge_iq *iq, str fl->pidx = fl->cidx = 0; cntxt_id = fl->cntxt_id - sc->sge.eq_start; - if (cntxt_id >= sc->sge.neq) { + if (cntxt_id >= sc->sge.eqmap_sz) { panic("%s: fl->cntxt_id (%d) more than the max (%d)", - __func__, cntxt_id, sc->sge.neq - 1); + __func__, cntxt_id, sc->sge.eqmap_sz - 1); } sc->sge.eqmap[cntxt_id] = (void *)fl; @@ -4027,9 +4027,9 @@ ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq) eq->cntxt_id = G_FW_EQ_CTRL_CMD_EQID(be32toh(c.cmpliqid_eqid)); cntxt_id = eq->cntxt_id - sc->sge.eq_start; - if (cntxt_id >= sc->sge.neq) + if (cntxt_id >= sc->sge.eqmap_sz) panic("%s: eq->cntxt_id (%d) more than the max (%d)", __func__, - cntxt_id, sc->sge.neq - 1); + cntxt_id, sc->sge.eqmap_sz - 1); sc->sge.eqmap[cntxt_id] = eq; return (rc); @@ -4073,9 +4073,9 @@ eth_eq_alloc(struct adapter *sc, struct vi_info *vi, s eq->cntxt_id = G_FW_EQ_ETH_CMD_EQID(be32toh(c.eqid_pkd)); eq->abs_id = G_FW_EQ_ETH_CMD_PHYSEQID(be32toh(c.physeqid_pkd)); cntxt_id = eq->cntxt_id - sc->sge.eq_start; - if (cntxt_id >= sc->sge.neq) + if (cntxt_id >= sc->sge.eqmap_sz) panic("%s: eq->cntxt_id (%d) more than the max (%d)", __func__, - cntxt_id, sc->sge.neq - 1); + cntxt_id, sc->sge.eqmap_sz - 1); sc->sge.eqmap[cntxt_id] = eq; return (rc); @@ -4118,9 +4118,9 @@ ofld_eq_alloc(struct adapter *sc, struct vi_info *vi, eq->cntxt_id = G_FW_EQ_OFLD_CMD_EQID(be32toh(c.eqid_pkd)); cntxt_id = eq->cntxt_id - sc->sge.eq_start; - if (cntxt_id >= sc->sge.neq) + if (cntxt_id >= sc->sge.eqmap_sz) panic("%s: eq->cntxt_id (%d) more than the max (%d)", __func__, - cntxt_id, sc->sge.neq - 1); + cntxt_id, sc->sge.eqmap_sz - 1); sc->sge.eqmap[cntxt_id] = eq; return (rc); Modified: stable/12/sys/dev/cxgbe/t4_vf.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_vf.c Tue Nov 24 00:12:42 2020 (r367969) +++ stable/12/sys/dev/cxgbe/t4_vf.c Tue Nov 24 00:17:05 2020 (r367970) @@ -684,13 +684,16 @@ t4vf_attach(device_t dev) s->neq += sc->params.nports; /* ctrl queues: 1 per port */ s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */ + s->iqmap_sz = s->niq; + s->eqmap_sz = s->neq; + s->rxq = malloc(s->nrxq * sizeof(struct sge_rxq), M_CXGBE, M_ZERO | M_WAITOK); s->txq = malloc(s->ntxq * sizeof(struct sge_txq), M_CXGBE, M_ZERO | M_WAITOK); - s->iqmap = malloc(s->niq * sizeof(struct sge_iq *), M_CXGBE, + s->iqmap = malloc(s->iqmap_sz * sizeof(struct sge_iq *), M_CXGBE, M_ZERO | M_WAITOK); - s->eqmap = malloc(s->neq * sizeof(struct sge_eq *), M_CXGBE, + s->eqmap = malloc(s->eqmap_sz * sizeof(struct sge_eq *), M_CXGBE, M_ZERO | M_WAITOK); sc->irq = malloc(sc->intr_count * sizeof(struct irq), M_CXGBE, From owner-svn-src-all@freebsd.org Tue Nov 24 00:22:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FDDF4701A8; Tue, 24 Nov 2020 00:22:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg4V26vq4z3DRG; Tue, 24 Nov 2020 00:22:34 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E021C15A69; Tue, 24 Nov 2020 00:22:34 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AO0MY5w068786; Tue, 24 Nov 2020 00:22:34 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AO0MXmv068780; Tue, 24 Nov 2020 00:22:33 GMT (envelope-from np@FreeBSD.org) Message-Id: <202011240022.0AO0MXmv068780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 24 Nov 2020 00:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367971 - in stable/12/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/12/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Commit-Revision: 367971 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 00:22:35 -0000 Author: np Date: Tue Nov 24 00:22:33 2020 New Revision: 367971 URL: https://svnweb.freebsd.org/changeset/base/367971 Log: MFC r367428 and r367495. r367428: cxgbe(4): Update firmwares to 1.25.0.40. This fixes a potential crash in firmware 1.25.0.0 on the passive open side during TOE operation. r367495: cxgbe(4): Add the firmware binaries missing in r367428. Obtained from: Chelsio Communications Sponsored by: Chelsio Communications Added: stable/12/sys/dev/cxgbe/firmware/t4fw-1.25.0.40.bin (contents, props changed) - copied, changed from r367428, head/sys/dev/cxgbe/firmware/t4fw-1.25.0.40.bin stable/12/sys/dev/cxgbe/firmware/t5fw-1.25.0.40.bin (contents, props changed) - copied, changed from r367428, head/sys/dev/cxgbe/firmware/t5fw-1.25.0.40.bin stable/12/sys/dev/cxgbe/firmware/t6fw-1.25.0.40.bin (contents, props changed) - copied, changed from r367428, head/sys/dev/cxgbe/firmware/t6fw-1.25.0.40.bin Deleted: stable/12/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin stable/12/sys/dev/cxgbe/firmware/t5fw-1.25.0.0.bin stable/12/sys/dev/cxgbe/firmware/t6fw-1.25.0.0.bin Modified: stable/12/sys/conf/files stable/12/sys/dev/cxgbe/firmware/t4fw_interface.h stable/12/sys/modules/cxgbe/t4_firmware/Makefile stable/12/sys/modules/cxgbe/t5_firmware/Makefile stable/12/sys/modules/cxgbe/t6_firmware/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Tue Nov 24 00:17:05 2020 (r367970) +++ stable/12/sys/conf/files Tue Nov 24 00:22:33 2020 (r367971) @@ -1476,7 +1476,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.25.0.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.25.0.40.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1510,7 +1510,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.25.0.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.25.0.40.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t5fw.fw" @@ -1544,7 +1544,7 @@ t6fw.fwo optional cxgbe \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.25.0.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.25.0.40.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t6fw.fw" Copied and modified: stable/12/sys/dev/cxgbe/firmware/t4fw-1.25.0.40.bin (from r367428, head/sys/dev/cxgbe/firmware/t4fw-1.25.0.40.bin) ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/12/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- stable/12/sys/dev/cxgbe/firmware/t4fw_interface.h Tue Nov 24 00:17:05 2020 (r367970) +++ stable/12/sys/dev/cxgbe/firmware/t4fw_interface.h Tue Nov 24 00:22:33 2020 (r367971) @@ -9985,17 +9985,17 @@ enum { T4FW_VERSION_MAJOR = 1, T4FW_VERSION_MINOR = 25, T4FW_VERSION_MICRO = 0, - T4FW_VERSION_BUILD = 0, + T4FW_VERSION_BUILD = 40, T5FW_VERSION_MAJOR = 1, T5FW_VERSION_MINOR = 25, T5FW_VERSION_MICRO = 0, - T5FW_VERSION_BUILD = 0, + T5FW_VERSION_BUILD = 40, T6FW_VERSION_MAJOR = 1, T6FW_VERSION_MINOR = 25, T6FW_VERSION_MICRO = 0, - T6FW_VERSION_BUILD = 0, + T6FW_VERSION_BUILD = 40, }; enum { Copied and modified: stable/12/sys/dev/cxgbe/firmware/t5fw-1.25.0.40.bin (from r367428, head/sys/dev/cxgbe/firmware/t5fw-1.25.0.40.bin) ============================================================================== Binary file (source and/or target). No diff available. Copied and modified: stable/12/sys/dev/cxgbe/firmware/t6fw-1.25.0.40.bin (from r367428, head/sys/dev/cxgbe/firmware/t6fw-1.25.0.40.bin) ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/12/sys/modules/cxgbe/t4_firmware/Makefile ============================================================================== --- stable/12/sys/modules/cxgbe/t4_firmware/Makefile Tue Nov 24 00:17:05 2020 (r367970) +++ stable/12/sys/modules/cxgbe/t4_firmware/Makefile Tue Nov 24 00:22:33 2020 (r367971) @@ -17,7 +17,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T4FW_VER= 1.25.0.0 +T4FW_VER= 1.25.0.40 FIRMWS+= t4fw-${T4FW_VER}.bin:t4fw:${T4FW_VER} .include Modified: stable/12/sys/modules/cxgbe/t5_firmware/Makefile ============================================================================== --- stable/12/sys/modules/cxgbe/t5_firmware/Makefile Tue Nov 24 00:17:05 2020 (r367970) +++ stable/12/sys/modules/cxgbe/t5_firmware/Makefile Tue Nov 24 00:22:33 2020 (r367971) @@ -17,7 +17,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T5FW_VER= 1.25.0.0 +T5FW_VER= 1.25.0.40 FIRMWS+= t5fw-${T5FW_VER}.bin:t5fw:${T5FW_VER} .include Modified: stable/12/sys/modules/cxgbe/t6_firmware/Makefile ============================================================================== --- stable/12/sys/modules/cxgbe/t6_firmware/Makefile Tue Nov 24 00:17:05 2020 (r367970) +++ stable/12/sys/modules/cxgbe/t6_firmware/Makefile Tue Nov 24 00:22:33 2020 (r367971) @@ -17,7 +17,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T6FW_VER= 1.25.0.0 +T6FW_VER= 1.25.0.40 FIRMWS+= t6fw-${T6FW_VER}.bin:t6fw:${T6FW_VER} .include From owner-svn-src-all@freebsd.org Tue Nov 24 00:25:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1ED4A4702B9; Tue, 24 Nov 2020 00:25:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg4Xw0MHSz3DdG; Tue, 24 Nov 2020 00:25:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEED015472; Tue, 24 Nov 2020 00:25:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AO0P3O9068959; Tue, 24 Nov 2020 00:25:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AO0P3KK068954; Tue, 24 Nov 2020 00:25:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <202011240025.0AO0P3KK068954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 24 Nov 2020 00:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367972 - in stable/12/sys/dev/cxgbe: . common X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/12/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 367972 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 00:25:04 -0000 Author: np Date: Tue Nov 24 00:25:03 2020 New Revision: 367972 URL: https://svnweb.freebsd.org/changeset/base/367972 Log: MFC r367497: cxgbev(4): Use the MAC address set by the the PF if there is one. Query the firmware for the MAC address set by the PF for the VF and use it instead of the firmware generated MAC if it's available. Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/common/common.h stable/12/sys/dev/cxgbe/common/t4vf_hw.c stable/12/sys/dev/cxgbe/t4_vf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/12/sys/dev/cxgbe/common/common.h Tue Nov 24 00:22:33 2020 (r367971) +++ stable/12/sys/dev/cxgbe/common/common.h Tue Nov 24 00:25:03 2020 (r367972) @@ -912,6 +912,8 @@ int t4vf_get_sge_params(struct adapter *adapter); int t4vf_get_rss_glb_config(struct adapter *adapter); int t4vf_get_vfres(struct adapter *adapter); int t4vf_prep_adapter(struct adapter *adapter); +int t4vf_get_vf_mac(struct adapter *adapter, unsigned int port, + unsigned int *naddr, u8 *addr); int t4_bar2_sge_qregs(struct adapter *adapter, unsigned int qid, enum t4_bar2_qtype qtype, int user, u64 *pbar2_qoffset, unsigned int *pbar2_qid); Modified: stable/12/sys/dev/cxgbe/common/t4vf_hw.c ============================================================================== --- stable/12/sys/dev/cxgbe/common/t4vf_hw.c Tue Nov 24 00:22:33 2020 (r367971) +++ stable/12/sys/dev/cxgbe/common/t4vf_hw.c Tue Nov 24 00:25:03 2020 (r367972) @@ -382,3 +382,49 @@ int t4vf_prep_adapter(struct adapter *adapter) return 0; } + +/* + * t4vf_get_vf_mac - Get the MAC address to be set to the VI of this VF. + * @adapter: The adapter + * @port: The port associated with vf + * @naddr: the number of ACL MAC addresses returned in addr + * @addr: Placeholder for MAC addresses + * + * Find the MAC address to be set to the VF's VI. The requested MAC address + * is from the host OS via callback in the PF driver. + */ +int t4vf_get_vf_mac(struct adapter *adapter, unsigned int port, + unsigned int *naddr, u8 *addr) +{ + struct fw_acl_mac_cmd cmd; + int ret; + + memset(&cmd, 0, sizeof(cmd)); + cmd.op_to_vfn = cpu_to_be32(V_FW_CMD_OP(FW_ACL_MAC_CMD) | + F_FW_CMD_REQUEST | + F_FW_CMD_READ); + cmd.en_to_len16 = cpu_to_be32((unsigned int)FW_LEN16(cmd)); + ret = t4vf_wr_mbox(adapter, &cmd, sizeof(cmd), &cmd); + if (ret) + return ret; + + if (cmd.nmac < *naddr) + *naddr = cmd.nmac; + + switch (port) { + case 3: + memcpy(addr, cmd.macaddr3, sizeof(cmd.macaddr3)); + break; + case 2: + memcpy(addr, cmd.macaddr2, sizeof(cmd.macaddr2)); + break; + case 1: + memcpy(addr, cmd.macaddr1, sizeof(cmd.macaddr1)); + break; + case 0: + memcpy(addr, cmd.macaddr0, sizeof(cmd.macaddr0)); + break; + } + + return ret; +} Modified: stable/12/sys/dev/cxgbe/t4_vf.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_vf.c Tue Nov 24 00:22:33 2020 (r367971) +++ stable/12/sys/dev/cxgbe/t4_vf.c Tue Nov 24 00:25:03 2020 (r367972) @@ -481,7 +481,7 @@ static int t4vf_attach(device_t dev) { struct adapter *sc; - int rc = 0, i, j, rqidx, tqidx; + int rc = 0, i, j, rqidx, tqidx, n, p, pmask; struct make_dev_args mda; struct intrs_and_queues iaq; struct sge *s; @@ -618,8 +618,10 @@ t4vf_attach(device_t dev) * First pass over all the ports - allocate VIs and initialize some * basic parameters like mac address, port type, etc. */ + pmask = sc->params.vfres.pmask; for_each_port(sc, i) { struct port_info *pi; + uint8_t mac[ETHER_ADDR_LEN]; pi = malloc(sizeof(*pi), M_CXGBE, M_ZERO | M_WAITOK); sc->port[i] = pi; @@ -644,6 +646,15 @@ t4vf_attach(device_t dev) sc->port[i] = NULL; goto done; } + + /* Prefer the MAC address set by the PF, if there is one. */ + n = 1; + p = ffs(pmask) - 1; + MPASS(p >= 0); + rc = t4vf_get_vf_mac(sc, p, &n, mac); + if (rc == 0 && n == 1) + t4_os_set_hw_addr(pi, mac); + pmask &= ~(1 << p); /* No t4_link_start. */ From owner-svn-src-all@freebsd.org Tue Nov 24 00:27:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 865A34701D0; Tue, 24 Nov 2020 00:27:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg4bZ3LHKz3DZN; Tue, 24 Nov 2020 00:27:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 656EF15A6A; Tue, 24 Nov 2020 00:27:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AO0RMJg069253; Tue, 24 Nov 2020 00:27:22 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AO0RLAU069250; Tue, 24 Nov 2020 00:27:21 GMT (envelope-from np@FreeBSD.org) Message-Id: <202011240027.0AO0RLAU069250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 24 Nov 2020 00:27:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367973 - in stable/12/sys/dev/cxgbe: . common X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/12/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 367973 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 00:27:22 -0000 Author: np Date: Tue Nov 24 00:27:21 2020 New Revision: 367973 URL: https://svnweb.freebsd.org/changeset/base/367973 Log: MFC r367502: cxgbe(4): Allow the PF driver to set a VF's MAC address. The MAC address can be set with the optional mac-addr property in the VF section of the iovctl.conf(5) used to instantiate the VFs. Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/common/common.h stable/12/sys/dev/cxgbe/common/t4_hw.c stable/12/sys/dev/cxgbe/t4_iov.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/12/sys/dev/cxgbe/common/common.h Tue Nov 24 00:25:03 2020 (r367972) +++ stable/12/sys/dev/cxgbe/common/common.h Tue Nov 24 00:27:21 2020 (r367973) @@ -691,6 +691,8 @@ void t4_idma_monitor_init(struct adapter *adapter, void t4_idma_monitor(struct adapter *adapter, struct sge_idma_monitor_state *idma, int hz, int ticks); +int t4_set_vf_mac(struct adapter *adapter, unsigned int pf, unsigned int vf, + unsigned int naddr, u8 *addr); unsigned int t4_get_regs_len(struct adapter *adapter); void t4_get_regs(struct adapter *adap, u8 *buf, size_t buf_size); Modified: stable/12/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/12/sys/dev/cxgbe/common/t4_hw.c Tue Nov 24 00:25:03 2020 (r367972) +++ stable/12/sys/dev/cxgbe/common/t4_hw.c Tue Nov 24 00:27:21 2020 (r367973) @@ -10202,6 +10202,48 @@ void t4_idma_monitor(struct adapter *adapter, } /** + * t4_set_vf_mac - Set MAC address for the specified VF + * @adapter: The adapter + * @pf: the PF used to instantiate the VFs + * @vf: one of the VFs instantiated by the specified PF + * @naddr: the number of MAC addresses + * @addr: the MAC address(es) to be set to the specified VF + */ +int t4_set_vf_mac(struct adapter *adapter, unsigned int pf, unsigned int vf, + unsigned int naddr, u8 *addr) +{ + struct fw_acl_mac_cmd cmd; + + memset(&cmd, 0, sizeof(cmd)); + cmd.op_to_vfn = cpu_to_be32(V_FW_CMD_OP(FW_ACL_MAC_CMD) | + F_FW_CMD_REQUEST | + F_FW_CMD_WRITE | + V_FW_ACL_MAC_CMD_PFN(pf) | + V_FW_ACL_MAC_CMD_VFN(vf)); + + /* Note: Do not enable the ACL */ + cmd.en_to_len16 = cpu_to_be32((unsigned int)FW_LEN16(cmd)); + cmd.nmac = naddr; + + switch (pf) { + case 3: + memcpy(cmd.macaddr3, addr, sizeof(cmd.macaddr3)); + break; + case 2: + memcpy(cmd.macaddr2, addr, sizeof(cmd.macaddr2)); + break; + case 1: + memcpy(cmd.macaddr1, addr, sizeof(cmd.macaddr1)); + break; + case 0: + memcpy(cmd.macaddr0, addr, sizeof(cmd.macaddr0)); + break; + } + + return t4_wr_mbox(adapter, adapter->mbox, &cmd, sizeof(cmd), &cmd); +} + +/** * t4_read_pace_tbl - read the pace table * @adap: the adapter * @pace_vals: holds the returned values Modified: stable/12/sys/dev/cxgbe/t4_iov.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_iov.c Tue Nov 24 00:25:03 2020 (r367972) +++ stable/12/sys/dev/cxgbe/t4_iov.c Tue Nov 24 00:27:21 2020 (r367973) @@ -42,12 +42,19 @@ __FBSDID("$FreeBSD$"); #endif #include "common/common.h" +#include "common/t4_regs.h" #include "t4_if.h" struct t4iov_softc { device_t sc_dev; device_t sc_main; bool sc_attached; + + int pf; + int regs_rid; + struct resource *regs_res; + bus_space_handle_t bh; + bus_space_tag_t bt; }; struct { @@ -113,6 +120,13 @@ struct { {0x6087, "Chelsio T6225-CR 87"}, }; +static inline uint32_t +t4iov_read_reg(struct t4iov_softc *sc, uint32_t reg) +{ + + return bus_space_read_4(sc->bt, sc->bh, reg); +} + static int t4iov_attach_child(device_t dev); static int @@ -179,10 +193,28 @@ static int t4iov_attach(device_t dev) { struct t4iov_softc *sc; + uint32_t pl_rev, whoami; sc = device_get_softc(dev); sc->sc_dev = dev; + sc->regs_rid = PCIR_BAR(0); + sc->regs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->regs_rid, RF_ACTIVE); + if (sc->regs_res == NULL) { + device_printf(dev, "cannot map registers.\n"); + return (ENXIO); + } + sc->bt = rman_get_bustag(sc->regs_res); + sc->bh = rman_get_bushandle(sc->regs_res); + + pl_rev = t4iov_read_reg(sc, A_PL_REV); + whoami = t4iov_read_reg(sc, A_PL_WHOAMI); + if (G_CHIPID(pl_rev) <= CHELSIO_T5) + sc->pf = G_SOURCEPF(whoami); + else + sc->pf = G_T6_SOURCEPF(whoami); + sc->sc_main = pci_find_dbsf(pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), 4); if (sc->sc_main == NULL) @@ -218,6 +250,7 @@ t4iov_attach_child(device_t dev) #ifdef PCI_IOV pf_schema = pci_iov_schema_alloc_node(); vf_schema = pci_iov_schema_alloc_node(); + pci_iov_schema_add_unicast_mac(vf_schema, "mac-addr", 0, NULL); error = pci_iov_attach_name(dev, pf_schema, vf_schema, "%s", device_get_nameunit(pdev)); if (error) { @@ -266,6 +299,10 @@ t4iov_detach(device_t dev) if (error) return (error); } + if (sc->regs_res) { + bus_release_resource(dev, SYS_RES_MEMORY, sc->regs_rid, + sc->regs_res); + } return (0); } @@ -286,6 +323,34 @@ t4iov_iov_uninit(device_t dev) static int t4iov_add_vf(device_t dev, uint16_t vfnum, const struct nvlist *config) { + const void *mac; + struct t4iov_softc *sc; + struct adapter *adap; + uint8_t ma[ETHER_ADDR_LEN]; + size_t size; + int rc; + + if (nvlist_exists_binary(config, "mac-addr")) { + mac = nvlist_get_binary(config, "mac-addr", &size); + bcopy(mac, ma, ETHER_ADDR_LEN); + + sc = device_get_softc(dev); + MPASS(sc->sc_attached); + MPASS(sc->sc_main != NULL); + adap = device_get_softc(sc->sc_main); + if (begin_synchronized_op(adap, NULL, SLEEP_OK | INTR_OK, + "t4vfma") != 0) + return (ENXIO); + rc = -t4_set_vf_mac(adap, sc->pf, vfnum + 1, 1, ma); + end_synchronized_op(adap, 0); + if (rc != 0) { + device_printf(dev, + "Failed to set VF%d MAC address to " + "%02x:%02x:%02x:%02x:%02x:%02x, rc = %d\n", vfnum, + ma[0], ma[1], ma[2], ma[3], ma[4], ma[5], rc); + return (rc); + } + } return (0); } From owner-svn-src-all@freebsd.org Tue Nov 24 00:30:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38FEB4705A2; Tue, 24 Nov 2020 00:30:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg4gX19Z6z3DrB; Tue, 24 Nov 2020 00:30:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A1DD15AB6; Tue, 24 Nov 2020 00:30:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AO0UlVw069514; Tue, 24 Nov 2020 00:30:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AO0Ulur069511; Tue, 24 Nov 2020 00:30:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011240030.0AO0Ulur069511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 24 Nov 2020 00:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367974 - in stable/12/sys/dev: ahci mvs siis X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/dev: ahci mvs siis X-SVN-Commit-Revision: 367974 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 00:30:48 -0000 Author: mav Date: Tue Nov 24 00:30:47 2020 New Revision: 367974 URL: https://svnweb.freebsd.org/changeset/base/367974 Log: MFC r366922, r367915, r367916: Pass lower 3 bits of sector_count for FPDMA commands. When this code was written those bits were N/A, but now the lowest bit is Rebuild Assist Recovery Control (RARC). Modified: stable/12/sys/dev/ahci/ahci.c stable/12/sys/dev/mvs/mvs.c stable/12/sys/dev/siis/siis.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ahci/ahci.c ============================================================================== --- stable/12/sys/dev/ahci/ahci.c Tue Nov 24 00:27:21 2020 (r367973) +++ stable/12/sys/dev/ahci/ahci.c Tue Nov 24 00:30:47 2020 (r367974) @@ -2579,10 +2579,10 @@ ahci_setup_fis(struct ahci_channel *ch, struct ahci_cm fis[9] = ccb->ataio.cmd.lba_mid_exp; fis[10] = ccb->ataio.cmd.lba_high_exp; fis[11] = ccb->ataio.cmd.features_exp; + fis[12] = ccb->ataio.cmd.sector_count; if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) { - fis[12] = tag << 3; - } else { - fis[12] = ccb->ataio.cmd.sector_count; + fis[12] &= 0x07; + fis[12] |= tag << 3; } fis[13] = ccb->ataio.cmd.sector_count_exp; if (ccb->ataio.ata_flags & ATA_FLAG_ICC) Modified: stable/12/sys/dev/mvs/mvs.c ============================================================================== --- stable/12/sys/dev/mvs/mvs.c Tue Nov 24 00:27:21 2020 (r367973) +++ stable/12/sys/dev/mvs/mvs.c Tue Nov 24 00:30:47 2020 (r367974) @@ -1495,7 +1495,8 @@ mvs_execute_transaction(struct mvs_slot *slot) crqb->cmd[i++] = ccb->ataio.cmd.features; crqb->cmd[i++] = 0x11; if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) { - crqb->cmd[i++] = slot->tag << 3; + crqb->cmd[i++] = (slot->tag << 3) | + (ccb->ataio.cmd.sector_count & 0x07); crqb->cmd[i++] = 0x12; } else { crqb->cmd[i++] = ccb->ataio.cmd.sector_count_exp; Modified: stable/12/sys/dev/siis/siis.c ============================================================================== --- stable/12/sys/dev/siis/siis.c Tue Nov 24 00:27:21 2020 (r367973) +++ stable/12/sys/dev/siis/siis.c Tue Nov 24 00:30:47 2020 (r367974) @@ -1722,13 +1722,12 @@ siis_setup_fis(device_t dev, struct siis_cmd *ctp, uni fis[9] = ccb->ataio.cmd.lba_mid_exp; fis[10] = ccb->ataio.cmd.lba_high_exp; fis[11] = ccb->ataio.cmd.features_exp; + fis[12] = ccb->ataio.cmd.sector_count; if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) { - fis[12] = tag << 3; - fis[13] = 0; - } else { - fis[12] = ccb->ataio.cmd.sector_count; - fis[13] = ccb->ataio.cmd.sector_count_exp; + fis[12] &= 0x07; + fis[12] |= tag << 3; } + fis[13] = ccb->ataio.cmd.sector_count_exp; if (ccb->ataio.ata_flags & ATA_FLAG_ICC) fis[14] = ccb->ataio.icc; fis[15] = ATA_A_4BIT; From owner-svn-src-all@freebsd.org Tue Nov 24 02:05:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 155CC473A36; Tue, 24 Nov 2020 02:05:44 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg6n404Sfz3LCN; Tue, 24 Nov 2020 02:05:44 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E97D516F13; Tue, 24 Nov 2020 02:05:43 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AO25hnO031238; Tue, 24 Nov 2020 02:05:43 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AO25hh4031236; Tue, 24 Nov 2020 02:05:43 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202011240205.0AO25hh4031236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Tue, 24 Nov 2020 02:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r367975 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 367975 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 02:05:44 -0000 Author: grehan Date: Tue Nov 24 02:05:43 2020 New Revision: 367975 URL: https://svnweb.freebsd.org/changeset/base/367975 Log: Restore Bryan Venteicher's commit bit grehan to rementor Approved by: core@ Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Tue Nov 24 00:30:47 2020 (r367974) +++ svnadmin/conf/access Tue Nov 24 02:05:43 2020 (r367975) @@ -43,6 +43,7 @@ br brd brooks brueffer +bryanv bwidawsk bz cem Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Nov 24 00:30:47 2020 (r367974) +++ svnadmin/conf/mentors Tue Nov 24 02:05:43 2020 (r367975) @@ -13,6 +13,7 @@ afedorov vmaffione Co-mentor: jhb anish jhb brd allanjude Co-mentor: bapt +bryanv grehan gordon delphij Co-mentor: emaste jceel trasz jkh rwatson From owner-svn-src-all@freebsd.org Tue Nov 24 02:51:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C28D475A23; Tue, 24 Nov 2020 02:51:46 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg7pB26qyz3Np9; Tue, 24 Nov 2020 02:51:46 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A798176AD; Tue, 24 Nov 2020 02:51:46 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AO2pkcZ058047; Tue, 24 Nov 2020 02:51:46 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AO2pkuJ058046; Tue, 24 Nov 2020 02:51:46 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202011240251.0AO2pkuJ058046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 24 Nov 2020 02:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367976 - head/sbin/ping6 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sbin/ping6 X-SVN-Commit-Revision: 367976 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 02:51:46 -0000 Author: asomers Date: Tue Nov 24 02:51:45 2020 New Revision: 367976 URL: https://svnweb.freebsd.org/changeset/base/367976 Log: ping6: update usage text after r365547 MFC after: 2 weeks Modified: head/sbin/ping6/ping6.c Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Tue Nov 24 02:05:43 2020 (r367975) +++ head/sbin/ping6/ping6.c Tue Nov 24 02:51:45 2020 (r367976) @@ -2868,7 +2868,8 @@ usage(void) " [-P policy]" #endif " [-S sourceaddr] [-s packetsize]\n" - " [-t timeout] [-W waittime] [hops ...] host\n"); + " [-t timeout] [-W waittime] [-z tclass] [hops ...] " + "host\n"); exit(1); } From owner-svn-src-all@freebsd.org Tue Nov 24 03:48:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF985476FDC; Tue, 24 Nov 2020 03:48:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg93w541Tz3hM5; Tue, 24 Nov 2020 03:48:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0D301822D; Tue, 24 Nov 2020 03:48:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AO3mio7094240; Tue, 24 Nov 2020 03:48:44 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AO3miBL094239; Tue, 24 Nov 2020 03:48:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011240348.0AO3miBL094239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 24 Nov 2020 03:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367977 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367977 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 03:48:44 -0000 Author: mjg Date: Tue Nov 24 03:48:44 2020 New Revision: 367977 URL: https://svnweb.freebsd.org/changeset/base/367977 Log: sx: drop spurious volatile keyword Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Tue Nov 24 02:51:45 2020 (r367976) +++ head/sys/kern/kern_sx.c Tue Nov 24 03:48:44 2020 (r367977) @@ -573,7 +573,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO GIANT_DECLARE; uintptr_t tid, setx; #ifdef ADAPTIVE_SX - volatile struct thread *owner; + struct thread *owner; u_int i, n, spintries = 0; enum { READERS, WRITER } sleep_reason = READERS; bool in_critical = false; @@ -1020,7 +1020,7 @@ _sx_slock_hard(struct sx *sx, int opts, uintptr_t x LO GIANT_DECLARE; struct thread *td; #ifdef ADAPTIVE_SX - volatile struct thread *owner; + struct thread *owner; u_int i, n, spintries = 0; #endif #ifdef LOCK_PROFILING From owner-svn-src-all@freebsd.org Tue Nov 24 03:49:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B303C477485; Tue, 24 Nov 2020 03:49:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg94y4gx0z3hHB; Tue, 24 Nov 2020 03:49:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9394818505; Tue, 24 Nov 2020 03:49:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AO3ncmV094324; Tue, 24 Nov 2020 03:49:38 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AO3nbiT094320; Tue, 24 Nov 2020 03:49:37 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011240349.0AO3nbiT094320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 24 Nov 2020 03:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367978 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367978 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 03:49:38 -0000 Author: mjg Date: Tue Nov 24 03:49:37 2020 New Revision: 367978 URL: https://svnweb.freebsd.org/changeset/base/367978 Log: locks: push lock_delay_arg_init calls down Minor cleanup to skip doing them when recursing on locks and so that they can act on found lock value if need be. Modified: head/sys/kern/kern_lock.c head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Tue Nov 24 03:48:44 2020 (r367977) +++ head/sys/kern/kern_lock.c Tue Nov 24 03:49:37 2020 (r367978) @@ -603,10 +603,10 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struc if (LK_CAN_WITNESS(flags)) WITNESS_CHECKORDER(&lk->lock_object, LOP_NEWORDER, file, line, flags & LK_INTERLOCK ? ilk : NULL); + x = lockmgr_read_value(lk); lock_delay_arg_init(&lda, &lockmgr_delay); if (!lk_adaptive) flags &= ~LK_ADAPTIVE; - x = lockmgr_read_value(lk); /* * The lock may already be locked exclusive by curthread, * avoid deadlock. Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Tue Nov 24 03:48:44 2020 (r367977) +++ head/sys/kern/kern_mutex.c Tue Nov 24 03:49:37 2020 (r367978) @@ -535,12 +535,6 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) if (SCHEDULER_STOPPED_TD(td)) return; -#if defined(ADAPTIVE_MUTEXES) - lock_delay_arg_init(&lda, &mtx_delay); -#elif defined(KDTRACE_HOOKS) - lock_delay_arg_init_noadapt(&lda); -#endif - if (__predict_false(v == MTX_UNOWNED)) v = MTX_READ_VALUE(m); @@ -562,6 +556,12 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) opts &= ~MTX_RECURSE; #endif +#if defined(ADAPTIVE_MUTEXES) + lock_delay_arg_init(&lda, &mtx_delay); +#elif defined(KDTRACE_HOOKS) + lock_delay_arg_init_noadapt(&lda); +#endif + #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif @@ -746,12 +746,12 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t if (SCHEDULER_STOPPED()) return; - lock_delay_arg_init(&lda, &mtx_spin_delay); - if (LOCK_LOG_TEST(&m->lock_object, opts)) CTR1(KTR_LOCK, "_mtx_lock_spin: %p spinning", m); KTR_STATE1(KTR_SCHED, "thread", sched_tdname((struct thread *)tid), "spinning", "lockname:\"%s\"", m->lock_object.lo_name); + + lock_delay_arg_init(&lda, &mtx_spin_delay); #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Tue Nov 24 03:48:44 2020 (r367977) +++ head/sys/kern/kern_rwlock.c Tue Nov 24 03:49:37 2020 (r367978) @@ -948,11 +948,6 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC if (SCHEDULER_STOPPED()) return; -#if defined(ADAPTIVE_RWLOCKS) - lock_delay_arg_init(&lda, &rw_delay); -#elif defined(KDTRACE_HOOKS) - lock_delay_arg_init_noadapt(&lda); -#endif if (__predict_false(v == RW_UNLOCKED)) v = RW_READ_VALUE(rw); @@ -970,6 +965,12 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR5(KTR_LOCK, "%s: %s contested (lock=%p) at %s:%d", __func__, rw->lock_object.lo_name, (void *)rw->rw_lock, file, line); + +#if defined(ADAPTIVE_RWLOCKS) + lock_delay_arg_init(&lda, &rw_delay); +#elif defined(KDTRACE_HOOKS) + lock_delay_arg_init_noadapt(&lda); +#endif #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Tue Nov 24 03:48:44 2020 (r367977) +++ head/sys/kern/kern_sx.c Tue Nov 24 03:49:37 2020 (r367978) @@ -620,12 +620,6 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO if (SCHEDULER_STOPPED()) return (0); -#if defined(ADAPTIVE_SX) - lock_delay_arg_init(&lda, &sx_delay); -#elif defined(KDTRACE_HOOKS) - lock_delay_arg_init_noadapt(&lda); -#endif - if (__predict_false(x == SX_LOCK_UNLOCKED)) x = SX_READ_VALUE(sx); @@ -644,6 +638,12 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO if (LOCK_LOG_TEST(&sx->lock_object, 0)) CTR5(KTR_LOCK, "%s: %s contested (lock=%p) at %s:%d", __func__, sx->lock_object.lo_name, (void *)sx->sx_lock, file, line); + +#if defined(ADAPTIVE_SX) + lock_delay_arg_init(&lda, &sx_delay); +#elif defined(KDTRACE_HOOKS) + lock_delay_arg_init_noadapt(&lda); +#endif #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); From owner-svn-src-all@freebsd.org Tue Nov 24 04:16:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EDD3477BA6; Tue, 24 Nov 2020 04:16:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cg9hM1HmSz3jb4; Tue, 24 Nov 2020 04:16:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EEFE1864E; Tue, 24 Nov 2020 04:16:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AO4GolM012798; Tue, 24 Nov 2020 04:16:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AO4GnP1012792; Tue, 24 Nov 2020 04:16:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011240416.0AO4GnP1012792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 24 Nov 2020 04:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367979 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 367979 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 04:16:51 -0000 Author: mav Date: Tue Nov 24 04:16:49 2020 New Revision: 367979 URL: https://svnweb.freebsd.org/changeset/base/367979 Log: Implement request queue overflow protection. Before this change in case of request queue overflow driver just froze the device queue for 100ms to retry after. It was pretty bad for performance. This change introduces SIM queue freezing when free space on the request queue drops below 255 entries (worst case of maximum I/O size S/G list), checking for a chance to release it on I/O completion. If the queue still get overflowed somehow, the old mechanism is still in place, just with delay reduced to 10ms. With the earlier queue length increase overflows should not happen often, but it is still easily reachable on synthetic tests. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_library.c head/sys/dev/isp/isp_library.h head/sys/dev/isp/ispmbox.h head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Tue Nov 24 03:49:37 2020 (r367978) +++ head/sys/dev/isp/isp.c Tue Nov 24 04:16:49 2020 (r367979) @@ -263,6 +263,9 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) return; } + isp->isp_reqidx = isp->isp_reqodx = 0; + isp->isp_resodx = 0; + isp->isp_atioodx = 0; ISP_WRITE(isp, BIU2400_REQINP, 0); ISP_WRITE(isp, BIU2400_REQOUTP, 0); ISP_WRITE(isp, BIU2400_RSPINP, 0); @@ -573,14 +576,16 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) } isp_prt(isp, ISP_LOGCONFIG, "%s", buf); + /* + * For the maximum number of commands take free exchange control block + * buffer count reported by firmware, limiting it to the maximum of our + * hardcoded handle format (16K now) minus some management reserve. + */ MBSINIT(&mbs, MBOX_GET_RESOURCE_COUNT, MBLOGALL, 0); isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) return; - } - isp->isp_maxcmds = mbs.param[3]; - /* Limit to the maximum of our hardcoded handle format (16K now). */ - isp->isp_maxcmds = MIN(isp->isp_maxcmds, ISP_HANDLE_MAX - ISP_HANDLE_RESERVE); + isp->isp_maxcmds = MIN(mbs.param[3], ISP_HANDLE_MAX - ISP_HANDLE_RESERVE); isp_prt(isp, ISP_LOGCONFIG, "%d max I/O command limit set", isp->isp_maxcmds); /* @@ -888,6 +893,8 @@ isp_init(ispsoftc_t *isp) isp_prt(isp, ISP_LOGERR, "No valid WWNs to use"); return; } + icbp->icb_rspnsin = isp->isp_resodx; + icbp->icb_rqstout = isp->isp_reqidx; icbp->icb_retry_count = fcp->isp_retry_count; icbp->icb_rqstqlen = RQUEST_QUEUE_LEN(isp); @@ -913,6 +920,7 @@ isp_init(ispsoftc_t *isp) #ifdef ISP_TARGET_MODE /* unconditionally set up the ATIO queue if we support target mode */ + icbp->icb_atio_in = isp->isp_atioodx; icbp->icb_atioqlen = ATIO_QUEUE_LEN(isp); if (icbp->icb_atioqlen < 8) { isp_prt(isp, ISP_LOGERR, "bad ATIO queue length %d", icbp->icb_atioqlen); @@ -1031,11 +1039,6 @@ isp_init(ispsoftc_t *isp) if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { return; } - isp->isp_reqidx = 0; - isp->isp_reqodx = 0; - isp->isp_residx = 0; - isp->isp_resodx = 0; - isp->isp_atioodx = 0; /* * Whatever happens, we're now committed to being here. @@ -3237,8 +3240,6 @@ isp_intr_respq(ispsoftc_t *isp) } iptr = ISP_READ(isp, BIU2400_RSPINP); - isp->isp_residx = iptr; - optr = isp->isp_resodx; while (optr != iptr) { sptr = cptr = optr; Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Tue Nov 24 03:49:37 2020 (r367978) +++ head/sys/dev/isp/isp_freebsd.c Tue Nov 24 04:16:49 2020 (r367979) @@ -54,6 +54,8 @@ static const char prom3[] = "Chan %d [%u] PortID 0x%06 static void isp_freeze_loopdown(ispsoftc_t *, int); static void isp_loop_changed(ispsoftc_t *isp, int chan); +static void isp_rq_check_above(ispsoftc_t *); +static void isp_rq_check_below(ispsoftc_t *); static d_ioctl_t ispioctl; static void isp_poll(struct cam_sim *); static callout_func_t isp_watchdog; @@ -350,6 +352,36 @@ isp_unfreeze_loopdown(ispsoftc_t *isp, int chan) } } +/* + * Functions to protect from request queue overflow by freezing SIM queue. + * XXX: freezing only one arbitrary SIM, since they all share the queue. + */ +static void +isp_rq_check_above(ispsoftc_t *isp) +{ + struct isp_fc *fc = ISP_FC_PC(isp, 0); + + if (isp->isp_rqovf || fc->sim == NULL) + return; + if (!isp_rqentry_avail(isp, QENTRY_MAX)) { + xpt_freeze_simq(fc->sim, 1); + isp->isp_rqovf = 1; + } +} + +static void +isp_rq_check_below(ispsoftc_t *isp) +{ + struct isp_fc *fc = ISP_FC_PC(isp, 0); + + if (!isp->isp_rqovf || fc->sim == NULL) + return; + if (isp_rqentry_avail(isp, QENTRY_MAX)) { + xpt_release_simq(fc->sim, 0); + isp->isp_rqovf = 0; + } +} + static int ispioctl(struct cdev *dev, u_long c, caddr_t addr, int flags, struct thread *td) { @@ -655,7 +687,7 @@ static void destroy_lun_state(ispsoftc_t *, int, tstat static void isp_enable_lun(ispsoftc_t *, union ccb *); static void isp_disable_lun(ispsoftc_t *, union ccb *); static callout_func_t isp_refire_notify_ack; -static void isp_complete_ctio(union ccb *); +static void isp_complete_ctio(ispsoftc_t *isp, union ccb *); enum Start_Ctio_How { FROM_CAM, FROM_TIMER, FROM_SRR, FROM_CTIO_DONE }; static void isp_target_start_ctio(ispsoftc_t *, union ccb *, enum Start_Ctio_How); static void isp_handle_platform_atio7(ispsoftc_t *, at7_entry_t *); @@ -733,6 +765,8 @@ isp_tmcmd_restart(ispsoftc_t *isp) isp_target_start_ctio(isp, ccb, FROM_TIMER); } } + isp_rq_check_above(isp); + isp_rq_check_below(isp); } static atio_private_data_t * @@ -1308,12 +1342,12 @@ isp_refire_notify_ack(void *arg) static void -isp_complete_ctio(union ccb *ccb) +isp_complete_ctio(ispsoftc_t *isp, union ccb *ccb) { - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG) { - ccb->ccb_h.status &= ~CAM_SIM_QUEUED; - xpt_done(ccb); - } + + isp_rq_check_below(isp); + ccb->ccb_h.status &= ~CAM_SIM_QUEUED; + xpt_done(ccb); } static void @@ -1570,7 +1604,7 @@ fail: isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); ccb->ccb_h.status &= ~CAM_STATUS_MASK; ccb->ccb_h.status |= CAM_REQ_CMP_ERR; - isp_complete_ctio(ccb); + isp_complete_ctio(isp, ccb); return; mdp: if (isp_notify_ack(isp, inot)) { @@ -1578,7 +1612,7 @@ mdp: goto fail; } ccb->ccb_h.status &= ~CAM_STATUS_MASK; - ccb->ccb_h.status = CAM_MESSAGE_RECV; + ccb->ccb_h.status |= CAM_MESSAGE_RECV; /* * This is not a strict interpretation of MDP, but it's close */ @@ -1591,7 +1625,7 @@ mdp: ccb->csio.msg_ptr[4] = srr_off >> 16; ccb->csio.msg_ptr[5] = srr_off >> 8; ccb->csio.msg_ptr[6] = srr_off; - isp_complete_ctio(ccb); + isp_complete_ctio(isp, ccb); } @@ -1718,7 +1752,7 @@ isp_handle_platform_ctio(ispsoftc_t *isp, ct7_entry_t * * 24XX cards never need an ATIO put back. */ - isp_complete_ctio(ccb); + isp_complete_ctio(isp, ccb); } static int @@ -2475,6 +2509,7 @@ isp_action(struct cam_sim *sim, union ccb *ccb) break; } error = isp_start((XS_T *) ccb); + isp_rq_check_above(isp); switch (error) { case 0: ccb->ccb_h.status |= CAM_SIM_QUEUED; @@ -2497,7 +2532,7 @@ isp_action(struct cam_sim *sim, union ccb *ccb) case CMD_EAGAIN: isp_free_pcmd(isp, ccb); cam_freeze_devq(ccb->ccb_h.path); - cam_release_devq(ccb->ccb_h.path, RELSIM_RELEASE_AFTER_TIMEOUT, 0, 100, 0); + cam_release_devq(ccb->ccb_h.path, RELSIM_RELEASE_AFTER_TIMEOUT, 0, 10, 0); ccb->ccb_h.status = CAM_REQUEUE_REQ; xpt_done(ccb); break; @@ -2589,6 +2624,7 @@ isp_action(struct cam_sim *sim, union ccb *ccb) } case XPT_CONT_TARGET_IO: isp_target_start_ctio(isp, ccb, FROM_CAM); + isp_rq_check_above(isp); break; #endif case XPT_RESET_DEV: /* BDR the specified SCSI device */ @@ -2877,6 +2913,7 @@ isp_done(XS_T *sccb) callout_stop(&PISP_PCMD(sccb)->wdog); isp_free_pcmd(isp, (union ccb *) sccb); } + isp_rq_check_below(isp); xpt_done((union ccb *) sccb); } Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Tue Nov 24 03:49:37 2020 (r367978) +++ head/sys/dev/isp/isp_library.c Tue Nov 24 04:16:49 2020 (r367979) @@ -65,7 +65,7 @@ isp_send_cmd(ispsoftc_t *isp, void *fqe, void *segp, u { ispcontreq64_t crq; uint8_t type, nqe = 1; - uint32_t seg, seglim, nxt, nxtnxt; + uint32_t seg, seglim, nxt; ispds64_t *dsp64 = NULL; void *qe0, *qe1; @@ -109,14 +109,8 @@ isp_send_cmd(ispsoftc_t *isp, void *fqe, void *segp, u * Second, start building additional continuation segments as needed. */ while (seg < nsegs) { - nxtnxt = ISP_NXT_QENTRY(nxt, RQUEST_QUEUE_LEN(isp)); - if (nxtnxt == isp->isp_reqodx) { - isp->isp_reqodx = ISP_READ(isp, BIU2400_REQOUTP); - if (nxtnxt == isp->isp_reqodx) - return (CMD_EAGAIN); - } - qe1 = ISP_QUEUE_ENTRY(isp->isp_rquest, nxt); - nxt = nxtnxt; + if (!isp_rqentry_avail(isp, ++nqe)) + return (CMD_EAGAIN); ISP_MEMZERO(&crq, QENTRY_LEN); crq.req_header.rqs_entry_type = RQSTYPE_A64_CONT; @@ -128,14 +122,17 @@ isp_send_cmd(ispsoftc_t *isp, void *fqe, void *segp, u seglim = nsegs; while (seg < seglim) XS_GET_DMA64_SEG(dsp64++, segp, seg++); + + qe1 = ISP_QUEUE_ENTRY(isp->isp_rquest, nxt); isp_put_cont64_req(isp, &crq, qe1); if (isp->isp_dblev & ISP_LOGDEBUG1) { isp_print_bytes(isp, "additional queue entry", QENTRY_LEN, qe1); } - nqe++; - } + nxt = ISP_NXT_QENTRY(nxt, RQUEST_QUEUE_LEN(isp)); + } + copy_and_sync: ((isphdr_t *)fqe)->rqs_entry_count = nqe; switch (type) { @@ -216,26 +213,6 @@ isp_destroy_handle(ispsoftc_t *isp, uint32_t handle) isp->isp_xflist[(handle & ISP_HANDLE_CMD_MASK)].cmd = isp->isp_xffree; isp->isp_xffree = &isp->isp_xflist[(handle & ISP_HANDLE_CMD_MASK)]; } -} - -/* - * Make sure we have space to put something on the request queue. - * Return a pointer to that entry if we do. A side effect of this - * function is to update the output index. The input index - * stays the same. - */ -void * -isp_getrqentry(ispsoftc_t *isp) -{ - uint32_t next; - - next = ISP_NXT_QENTRY(isp->isp_reqidx, RQUEST_QUEUE_LEN(isp)); - if (next == isp->isp_reqodx) { - isp->isp_reqodx = ISP_READ(isp, BIU2400_REQOUTP); - if (next == isp->isp_reqodx) - return (NULL); - } - return (ISP_QUEUE_ENTRY(isp->isp_rquest, isp->isp_reqidx)); } #define TBA (4 * (((QENTRY_LEN >> 2) * 3) + 1) + 1) Modified: head/sys/dev/isp/isp_library.h ============================================================================== --- head/sys/dev/isp/isp_library.h Tue Nov 24 03:49:37 2020 (r367978) +++ head/sys/dev/isp/isp_library.h Tue Nov 24 04:16:49 2020 (r367979) @@ -53,7 +53,23 @@ void isp_destroy_handle(ispsoftc_t *, uint32_t); /* * Request Queue allocation */ -void *isp_getrqentry(ispsoftc_t *); +inline int +isp_rqentry_avail(ispsoftc_t *isp, uint32_t num) +{ + if (ISP_QAVAIL(isp) >= num) + return (1); + /* We don't have enough in cached. Reread the hardware. */ + isp->isp_reqodx = ISP_READ(isp, BIU2400_REQOUTP); + return (ISP_QAVAIL(isp) >= num); +} + +inline void * +isp_getrqentry(ispsoftc_t *isp) +{ + if (!isp_rqentry_avail(isp, 1)) + return (NULL); + return (ISP_QUEUE_ENTRY(isp->isp_rquest, isp->isp_reqidx)); +} /* * Queue Entry debug functions Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Tue Nov 24 03:49:37 2020 (r367978) +++ head/sys/dev/isp/ispmbox.h Tue Nov 24 04:16:49 2020 (r367979) @@ -333,6 +333,7 @@ * All IOCB Queue entries are this size */ #define QENTRY_LEN 64 +#define QENTRY_MAX 255 /* * Command Structure Definitions @@ -1694,14 +1695,12 @@ typedef struct { /* * Miscellaneous * - * These are the limits of the number of dma segments we - * can deal with based not on the size of the segment counter - * (which is 16 bits), but on the size of the number of - * queue entries field (which is 8 bits). We assume no - * segments in the first queue entry, so we can have - * have 5 dma segments per continuation entry... - * multiplying out by 254.... + * This is the limit of the number of dma segments we can deal with based + * not on the size of the segment counter (which is 16 bits), but on the + * size of the number of queue entries field (which is 8 bits). We assume + * one segment in the first queue entry, plus we can have 5 segments per + * continuation entry, multiplied by maximum of continuation entries. */ -#define ISP_NSEG64_MAX 1270 +#define ISP_NSEG64_MAX (1 + (QENTRY_MAX - 1) * 5) #endif /* _ISPMBOX_H */ Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Tue Nov 24 03:49:37 2020 (r367978) +++ head/sys/dev/isp/ispvar.h Tue Nov 24 04:16:49 2020 (r367979) @@ -131,16 +131,17 @@ struct ispmdvec { */ /* This is the size of a queue entry (request and response) */ #define QENTRY_LEN 64 -/* Queue lengths must be a power of two and at least 8 elements. */ +/* + * Hardware requires queue lengths of at least 8 elements. Driver requires + * lengths to be a power of two, and request queue of at least 256 elements. + */ #define RQUEST_QUEUE_LEN(x) 8192 #define RESULT_QUEUE_LEN(x) 1024 #define ATIO_QUEUE_LEN(x) 1024 #define ISP_QUEUE_ENTRY(q, idx) (((uint8_t *)q) + ((size_t)(idx) * QENTRY_LEN)) #define ISP_QUEUE_SIZE(n) ((size_t)(n) * QENTRY_LEN) #define ISP_NXT_QENTRY(idx, qlen) (((idx) + 1) & ((qlen)-1)) -#define ISP_QFREE(in, out, qlen) \ - ((in == out)? (qlen - 1) : ((in > out)? \ - ((qlen - 1) - (in - out)) : (out - in - 1))) +#define ISP_QFREE(in, out, qlen) ((out - in - 1) & ((qlen) - 1)) #define ISP_QAVAIL(isp) \ ISP_QFREE(isp->isp_reqidx, isp->isp_reqodx, RQUEST_QUEUE_LEN(isp)) @@ -472,7 +473,6 @@ struct ispsoftc { volatile mbreg_t isp_curmbx; /* currently active mailbox command */ volatile uint32_t isp_reqodx; /* index of last ISP pickup */ volatile uint32_t isp_reqidx; /* index of next request */ - volatile uint32_t isp_residx; /* index of last ISP write */ volatile uint32_t isp_resodx; /* index of next result */ volatile uint32_t isp_atioodx; /* index of next ATIO */ volatile uint32_t isp_obits; /* mailbox command output */ @@ -480,6 +480,7 @@ struct ispsoftc { volatile uint16_t isp_mboxtmp[MAX_MAILBOX]; volatile uint16_t isp_lastmbxcmd; /* last mbox command sent */ volatile uint16_t isp_seqno; /* running sequence number */ + u_int isp_rqovf; /* request queue overflow */ /* * Active commands are stored here, indexed by handle functions. From owner-svn-src-all@freebsd.org Tue Nov 24 06:42:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A38547B589; Tue, 24 Nov 2020 06:42:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgDwT26n5z3rN3; Tue, 24 Nov 2020 06:42:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BCD71A6ED; Tue, 24 Nov 2020 06:42:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AO6gXYn005042; Tue, 24 Nov 2020 06:42:33 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AO6gXcY005041; Tue, 24 Nov 2020 06:42:33 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202011240642.0AO6gXcY005041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 24 Nov 2020 06:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367980 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367980 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 06:42:33 -0000 Author: cy Date: Tue Nov 24 06:42:32 2020 New Revision: 367980 URL: https://svnweb.freebsd.org/changeset/base/367980 Log: Fix a typo in a comment. MFC after: 3 days Modified: head/sys/kern/kern_ntptime.c Modified: head/sys/kern/kern_ntptime.c ============================================================================== --- head/sys/kern/kern_ntptime.c Tue Nov 24 04:16:49 2020 (r367979) +++ head/sys/kern/kern_ntptime.c Tue Nov 24 06:42:32 2020 (r367980) @@ -590,7 +590,7 @@ ntp_update_second(int64_t *adjustment, time_t *newsec) /* * Apply any correction from adjtime(2). If more than one second - * off we slew at a rate of 5ms/s (5000 PPM) else 500us/s (500PPM) + * off we slew at a rate of 5ms/s (5000 PPM) else 500us/s (500 PPM) * until the last second is slewed the final < 500 usecs. */ if (time_adjtime != 0) { From owner-svn-src-all@freebsd.org Tue Nov 24 07:14:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CAA847BF1B for ; Tue, 24 Nov 2020 07:14:34 +0000 (UTC) (envelope-from LTJVRYG84_npai+svn-src-all=freebsd.org.102160721@loursonblanc-news.com) Received: from loursonblanc-news.com (loursonblanc-news.com [62.4.26.69]) (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 4CgFdN5xQMz3sll for ; Tue, 24 Nov 2020 07:14:32 +0000 (UTC) (envelope-from LTJVRYG84_npai+svn-src-all=freebsd.org.102160721@loursonblanc-news.com) Received: from sendmail_check (localhost [127.0.0.1]) by loursonblanc-news.com (Postfix) with SMTP id E383C1E33B5 for ; Tue, 24 Nov 2020 08:14:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=loursonblanc-news.com; s=oxidkim; t=1606202060; bh=9PFxxjJWuQiZFsKXNXwAx7u5nbdv2x/1Ig+G9IPzBhg=; h=List-Unsubscribe:From:To:Subject:Date:From; b=ctaxQTpSd0NJauybbNXCtBJV6uWxr/iNmimPEgb0iu5LEmtqwStWaI8kYc4uFy3h+ u12RQNu8dj03NcmiPFNXGlfqUnI0fB9gz3qxix77U/taezYKgZ434/83JmIS7Zh04J H6yn6osTgcWEr4xRZWJSkpRP4sp88jmr1gVdOh0pLlX6LWsn8Zg3RgXjRZ5v6xVdQE Tf3JqVGknTbDfP07Og4ltMXkoaRoUjFBFBpbR0QGH81Bzt4UH+KP2P9wL5HSaqMh3k 2oUNx3FttqiRbSnljFI4gorKWFj/LmL/I89BZ9APo2rtpRTT6LRXbCDPEV2wAxx7Lb yogN5U02KUCnA== X-MessageId: 768474868289715652||8386784583826745657676647082696966836846798271||102160721||8||768474868289715652 Message-ID: From: "Dominique" To: Subject: Demande de devis Date: Tue, 24 Nov 2020 08:05:06 +0100 X-Mailer: OxiMailing 8.5.2 MIME-Version: 1.0 X-Rspamd-Queue-Id: 4CgFdN5xQMz3sll X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=loursonblanc-news.com header.s=oxidkim header.b=ctaxQTpS; dmarc=pass (policy=none) header.from=loursonblanc-news.com; spf=pass (mx1.freebsd.org: domain of LTJVRYG84_npai@loursonblanc-news.com designates 62.4.26.69 as permitted sender) smtp.mailfrom=LTJVRYG84_npai@loursonblanc-news.com X-Spamd-Result: default: False [-3.41 / 15.00]; ZERO_FONT(0.20)[2]; R_SPF_ALLOW(-0.20)[+a]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[loursonblanc-news.com:+]; DMARC_POLICY_ALLOW(-0.50)[loursonblanc-news.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[contact@loursonblanc-news.com,LTJVRYG84_npai@loursonblanc-news.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:12876, ipnet:62.4.0.0/19, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[contact@loursonblanc-news.com,LTJVRYG84_npai@loursonblanc-news.com]; TAGGED_FROM(0.00)[svn-src-all=freebsd.org.102160721]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[loursonblanc-news.com:s=oxidkim]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; MANY_INVISIBLE_PARTS(0.10)[2]; RWL_MAILSPIKE_VERYGOOD(0.00)[62.4.26.69:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 07:14:34 -0000 Besoin de..=2E Si vous ne voyez pas ce message correctement, [consultez-le en ligne] = (https://loursonblanc-news.com/c6.php?ec=3D2&l=3Df4iAuoK8eG9n&i=3DZGRolWaTa= Glk&t=3DZQ&e=3DpqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo&u=3Dm6iq1KOdYGafn9qko9Ggmc6V= 05Rg0Zir15KYpqRjr7Z9ioi9d5tlZmljlWdypHh6p3aqaWeWdWWlqmZvbGSomXVsaaZnmmRpkmO= ZYKDKog&v=3D8)=2E Bonjour, Avez-vous besoin de masques jetables pour prot=C3=A9ger vos clients & = collaborateurs ? Nous vous proposons des Masques certif=C3=A9s : Type 1, 2R et enfants =C3=80 partir de 0.09 =E2=82=AC HT pi=C3=A8ce (pour les grandes = quantit=C3=A9s) =E2=80=A2 Livrables imm=C3=A9diatement =E2=80=A2 Pas d=E2=80=99acompte =E2=80=A2 Paiement int=C3=A9gral apr=C3=A8s la livraison=2E [Pour demander un devis : cliquez-ici] = (mailto:thierry@createurdevisite.fr?subject=3DDemande%20de%20devis%20pour%2= 0les%20masques&body=3DIndiquez-nous%20le%20type%20et%20nombre%20de%20masque= s.%20%0D%0AVous%20recevrez%20imm%C3%A9diatement%20un%20devis%20%3A%20%0D%0A= Type%20%3A%20%0D%0ANombre%20%3A%20%0D%0ASouhaite%20%C3%AAtre%20rappel%C3%A9= %20au%20N%C2%B0%20%3A%20%0D%0A) Ou r=C3=A9pondez simplement =C3=A0 ce mail =C3=80 votre disposition=2E Tr=C3=A8s cordialement, Dominique DRUON +33 6 24 62 55 85 [dominique@loursonblanc.fr] (mailto:dominique@loursonblanc.fr) L=E2=80=99Ourson Blanc Livraison partout Europe et Domtom=20 59 bis rue des Poutrains - 59200 Tourcoing - Siret : 82746685500018 Si vous ne souhaitez plus recevoir nos messages, suivez ce lien : [Veuillez me retirer de votre liste de diffusion] = (https://loursonblanc-news.com/d6.php?ec=3D2&l=3Df4iAuoK8eG9n&e=3DpqqkkaPVl= GSUnNFyltSXnMSnyV+i1Zo&i=3DZGRolWaTaGlk&v=3D8) From owner-svn-src-all@freebsd.org Tue Nov 24 13:08:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 249EF4A5E02; Tue, 24 Nov 2020 13:08:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgPTD0WFyz4j0C; Tue, 24 Nov 2020 13:08:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 040E71F552; Tue, 24 Nov 2020 13:08:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AOD7x6q042173; Tue, 24 Nov 2020 13:07:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOD7x5w042172; Tue, 24 Nov 2020 13:07:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011241307.0AOD7x5w042172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 24 Nov 2020 13:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367981 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 367981 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 13:08:00 -0000 Author: hselasky Date: Tue Nov 24 13:07:59 2020 New Revision: 367981 URL: https://svnweb.freebsd.org/changeset/base/367981 Log: Remove erradic assert after SVN r367149 in mlx5en(4). The ratelimit tags may be shared, especially for unlimited TLS traffic, and then the refcount is allowed to be greater than one when freeing the send tag. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Tue Nov 24 06:42:32 2020 (r367980) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Tue Nov 24 13:07:59 2020 (r367981) @@ -466,7 +466,6 @@ mlx5e_tls_snd_tag_free(struct m_snd_tag *pmt) container_of(pmt, struct mlx5e_tls_tag, tag); struct mlx5e_priv *priv; - MPASS(ptag->rl_tag->refcount == 1); m_snd_tag_rele(ptag->rl_tag); MLX5E_TLS_TAG_LOCK(ptag); From owner-svn-src-all@freebsd.org Tue Nov 24 13:17:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F14D74A60B8; Tue, 24 Nov 2020 13:17:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgPgw6R4sz4jmC; Tue, 24 Nov 2020 13:17:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEAA51F698; Tue, 24 Nov 2020 13:17:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AODHGuV048220; Tue, 24 Nov 2020 13:17:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AODHCsG048200; Tue, 24 Nov 2020 13:17:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011241317.0AODHCsG048200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 24 Nov 2020 13:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367982 - in stable/12/sys: cam cam/ctl dev/iscsi dev/isp dev/mpr dev/mps dev/ocs_fc X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys: cam cam/ctl dev/iscsi dev/isp dev/mpr dev/mps dev/ocs_fc X-SVN-Commit-Revision: 367982 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 13:17:17 -0000 Author: mav Date: Tue Nov 24 13:17:12 2020 New Revision: 367982 URL: https://svnweb.freebsd.org/changeset/base/367982 Log: MFC r367044: Introduce support of SCSI Command Priority. SAM-3 specification introduced concept of Task Priority, that was renamed to Command Priority in SAM-4, and supported by all modern SCSI transports. It provides 15 levels of relative priorities: 1 - highest, 15 - lowest and 0 - default. SAT specification for SATA devices translates priorities 1-3 into NCQ high priority. This change adds new "priority" field into empty spots of struct ccb_scsiio and struct ccb_accept_tio of CAM and struct ctl_scsiio of CTL. Respective support is added into iscsi(4), isp(4), mpr(4), mps(4) and ocs_fc(4) drivers for both initiator and where applicable target roles. Minimal support was added to CTL to receive the priority value from different frontends, pass it between HA controllers and report in few places. This patch does not add consumers of this functionality, so nothing should really change yet, since the field is still set to 0 (default) on initiator and not actively used on target. Those are to be implemented separately. I've confirmed priority working on WD Red SATA disks connected via mpr(4) and properly transferred to CTL target via iscsi(4), isp(4) and ocs_fc(4). While there, added missing tag_action support to ocs_fc(4) initiator role. Modified: stable/12/sys/cam/cam_ccb.h stable/12/sys/cam/ctl/ctl.c stable/12/sys/cam/ctl/ctl_frontend_cam_sim.c stable/12/sys/cam/ctl/ctl_frontend_iscsi.c stable/12/sys/cam/ctl/ctl_io.h stable/12/sys/cam/ctl/ctl_util.c stable/12/sys/cam/ctl/scsi_ctl.c stable/12/sys/dev/iscsi/iscsi.c stable/12/sys/dev/isp/isp.c stable/12/sys/dev/isp/isp_freebsd.c stable/12/sys/dev/isp/isp_freebsd.h stable/12/sys/dev/isp/isp_stds.h stable/12/sys/dev/isp/ispvar.h stable/12/sys/dev/mpr/mpr_sas.c stable/12/sys/dev/mps/mps_sas.c stable/12/sys/dev/ocs_fc/ocs_cam.c stable/12/sys/dev/ocs_fc/ocs_scsi.c stable/12/sys/dev/ocs_fc/ocs_scsi.h stable/12/sys/dev/ocs_fc/ocs_unsol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/cam_ccb.h ============================================================================== --- stable/12/sys/cam/cam_ccb.h Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/cam/cam_ccb.h Tue Nov 24 13:17:12 2020 (r367982) @@ -758,6 +758,7 @@ struct ccb_scsiio { * from scsi_message.h. */ #define CAM_TAG_ACTION_NONE 0x00 + uint8_t priority; /* Command priority for SIMPLE tag */ u_int tag_id; /* tag id from initator (target mode) */ u_int init_id; /* initiator id of who selected */ #if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING) @@ -807,6 +808,7 @@ struct ccb_accept_tio { u_int8_t cdb_len; /* Number of bytes for the CDB */ u_int8_t tag_action; /* What to do for tag queueing */ u_int8_t sense_len; /* Number of bytes of Sense Data */ + uint8_t priority; /* Command priority for SIMPLE tag */ u_int tag_id; /* tag id from initator (target mode) */ u_int init_id; /* initiator id of who selected */ struct scsi_sense_data sense_data; @@ -1369,6 +1371,7 @@ cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retri csio->sense_len = sense_len; csio->cdb_len = cdb_len; csio->tag_action = tag_action; + csio->priority = 0; #if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING) csio->bio = NULL; #endif @@ -1391,6 +1394,7 @@ cam_fill_ctio(struct ccb_scsiio *csio, u_int32_t retri csio->dxfer_len = dxfer_len; csio->scsi_status = scsi_status; csio->tag_action = tag_action; + csio->priority = 0; csio->tag_id = tag_id; csio->init_id = init_id; } Modified: stable/12/sys/cam/ctl/ctl.c ============================================================================== --- stable/12/sys/cam/ctl/ctl.c Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/cam/ctl/ctl.c Tue Nov 24 13:17:12 2020 (r367982) @@ -1457,6 +1457,7 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e if (softc->ha_mode != CTL_HA_MODE_XFER) io->io_hdr.flags |= CTL_FLAG_INT_COPY; io->io_hdr.nexus = msg->hdr.nexus; + io->scsiio.priority = msg->scsi.priority; io->scsiio.tag_num = msg->scsi.tag_num; io->scsiio.tag_type = msg->scsi.tag_type; #ifdef CTL_TIME_IO @@ -11616,8 +11617,9 @@ ctl_scsiio_precheck(struct ctl_softc *softc, struct ct msg_info.hdr.nexus = ctsio->io_hdr.nexus; msg_info.scsi.tag_num = ctsio->tag_num; msg_info.scsi.tag_type = ctsio->tag_type; - msg_info.scsi.cdb_len = ctsio->cdb_len; memcpy(msg_info.scsi.cdb, ctsio->cdb, CTL_MAX_CDBLEN); + msg_info.scsi.cdb_len = ctsio->cdb_len; + msg_info.scsi.priority = ctsio->priority; if ((isc_retval = ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, sizeof(msg_info.scsi) - sizeof(msg_info.scsi.sense_data), @@ -12497,12 +12499,13 @@ ctl_datamove(union ctl_io *io) ctl_scsi_command_string(&io->scsiio, NULL, &sb); sbuf_printf(&sb, "\n"); sbuf_cat(&sb, path_str); - sbuf_printf(&sb, "Tag: 0x%04x, type %d\n", - io->scsiio.tag_num, io->scsiio.tag_type); + sbuf_printf(&sb, "Tag: 0x%04x/%d, Prio: %d\n", + io->scsiio.tag_num, io->scsiio.tag_type, + io->scsiio.priority); break; case CTL_IO_TASK: - sbuf_printf(&sb, "Task I/O type: %d, Tag: 0x%04x, " - "Tag Type: %d\n", io->taskio.task_action, + sbuf_printf(&sb, "Task Action: %d Tag: 0x%04x/%d\n", + io->taskio.task_action, io->taskio.tag_num, io->taskio.tag_type); break; default: @@ -12997,12 +13000,13 @@ ctl_process_done(union ctl_io *io) ctl_scsi_command_string(&io->scsiio, NULL, &sb); sbuf_printf(&sb, "\n"); sbuf_cat(&sb, path_str); - sbuf_printf(&sb, "Tag: 0x%04x, type %d\n", - io->scsiio.tag_num, io->scsiio.tag_type); + sbuf_printf(&sb, "Tag: 0x%04x/%d, Prio: %d\n", + io->scsiio.tag_num, io->scsiio.tag_type, + io->scsiio.priority); break; case CTL_IO_TASK: - sbuf_printf(&sb, "Task I/O type: %d, Tag: 0x%04x, " - "Tag Type: %d\n", io->taskio.task_action, + sbuf_printf(&sb, "Task Action: %d Tag: 0x%04x/%d\n", + io->taskio.task_action, io->taskio.tag_num, io->taskio.tag_type); break; default: Modified: stable/12/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/12/sys/cam/ctl/ctl_frontend_cam_sim.c Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/cam/ctl/ctl_frontend_cam_sim.c Tue Nov 24 13:17:12 2020 (r367982) @@ -540,6 +540,7 @@ cfcs_action(struct cam_sim *sim, union ccb *ccb) io->io_hdr.nexus.targ_port = softc->port.targ_port; io->io_hdr.nexus.targ_lun = ctl_decode_lun( CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); + io->scsiio.priority = csio->priority; /* * This tag scheme isn't the best, since we could in theory * have a very long-lived I/O and tag collision, especially Modified: stable/12/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/12/sys/cam/ctl/ctl_frontend_iscsi.c Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/cam/ctl/ctl_frontend_iscsi.c Tue Nov 24 13:17:12 2020 (r367982) @@ -519,6 +519,8 @@ cfiscsi_pdu_handle_scsi_command(struct icl_pdu *reques io->io_hdr.nexus.initid = cs->cs_ctl_initid; io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; io->io_hdr.nexus.targ_lun = ctl_decode_lun(be64toh(bhssc->bhssc_lun)); + io->scsiio.priority = (bhssc->bhssc_pri & BHSSC_PRI_MASK) >> + BHSSC_PRI_SHIFT; io->scsiio.tag_num = bhssc->bhssc_initiator_task_tag; switch ((bhssc->bhssc_flags & BHSSC_FLAGS_ATTR)) { case BHSSC_FLAGS_ATTR_UNTAGGED: Modified: stable/12/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/12/sys/cam/ctl/ctl_io.h Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/cam/ctl/ctl_io.h Tue Nov 24 13:17:12 2020 (r367982) @@ -322,6 +322,7 @@ struct ctl_scsiio { uint8_t sense_len; /* Returned sense length */ uint8_t scsi_status; /* SCSI status byte */ uint8_t sense_residual; /* Unused. */ + uint8_t priority; /* Command priority */ uint32_t residual; /* Unused */ uint32_t tag_num; /* tag number */ ctl_tag_type tag_type; /* simple, ordered, head of queue,etc.*/ @@ -482,6 +483,7 @@ struct ctl_ha_msg_scsi { uint8_t cdb_len; /* CDB length */ uint8_t scsi_status; /* SCSI status byte */ uint8_t sense_len; /* Returned sense length */ + uint8_t priority; /* Command priority */ uint32_t port_status; /* trans status, set by FETD, 0 = good*/ uint32_t kern_data_resid; /* for DATAMOVE_DONE */ Modified: stable/12/sys/cam/ctl/ctl_util.c ============================================================================== --- stable/12/sys/cam/ctl/ctl_util.c Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/cam/ctl/ctl_util.c Tue Nov 24 13:17:12 2020 (r367982) @@ -740,8 +740,9 @@ ctl_io_sbuf(union ctl_io *io, struct sbuf *sb) case CTL_IO_SCSI: sbuf_cat(sb, path_str); ctl_scsi_command_string(&io->scsiio, NULL, sb); - sbuf_printf(sb, " Tag: %#x/%d\n", - io->scsiio.tag_num, io->scsiio.tag_type); + sbuf_printf(sb, " Tag: %#x/%d, Prio: %d\n", + io->scsiio.tag_num, io->scsiio.tag_type, + io->scsiio.priority); break; case CTL_IO_TASK: sbuf_cat(sb, path_str); Modified: stable/12/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/12/sys/cam/ctl/scsi_ctl.c Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/cam/ctl/scsi_ctl.c Tue Nov 24 13:17:12 2020 (r367982) @@ -1153,6 +1153,7 @@ ctlfedone(struct cam_periph *periph, union ccb *done_c } else { io->io_hdr.nexus.targ_lun = atio->ccb_h.target_lun; } + io->scsiio.priority = atio->priority; io->scsiio.tag_num = atio->tag_id; switch (atio->tag_action) { case CAM_TAG_ACTION_NONE: Modified: stable/12/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/12/sys/dev/iscsi/iscsi.c Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/dev/iscsi/iscsi.c Tue Nov 24 13:17:12 2020 (r367982) @@ -2298,6 +2298,11 @@ iscsi_action_scsiio(struct iscsi_session *is, union cc } else bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_UNTAGGED; + if (is->is_protocol_level >= 2) { + bhssc->bhssc_pri = (csio->priority << BHSSC_PRI_SHIFT) & + BHSSC_PRI_MASK; + } + bhssc->bhssc_lun = htobe64(CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); bhssc->bhssc_initiator_task_tag = initiator_task_tag; bhssc->bhssc_expected_data_transfer_length = htonl(csio->dxfer_len); Modified: stable/12/sys/dev/isp/isp.c ============================================================================== --- stable/12/sys/dev/isp/isp.c Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/dev/isp/isp.c Tue Nov 24 13:17:12 2020 (r367982) @@ -4554,7 +4554,9 @@ isp_start(XS_T *xs) } else { ttype = FCP_CMND_TASK_ATTR_SIMPLE; } - ((ispreqt7_t *)reqp)->req_task_attribute = ttype; + ((ispreqt7_t *)reqp)->req_task_attribute = ttype | + ((XS_PRIORITY(xs) << FCP_CMND_PRIO_SHIFT) & + FCP_CMND_PRIO_MASK); } else if (IS_FC(isp)) { /* * See comment in isp_intr_respq Modified: stable/12/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/12/sys/dev/isp/isp_freebsd.c Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/dev/isp/isp_freebsd.c Tue Nov 24 13:17:12 2020 (r367982) @@ -1916,6 +1916,8 @@ isp_handle_platform_atio7(ispsoftc_t *isp, at7_entry_t atiop->tag_action = 0; break; } + atiop->priority = (aep->at_cmnd.fcp_cmnd_task_attribute & + FCP_CMND_PRIO_MASK) >> FCP_CMND_PRIO_SHIFT; atp->orig_datalen = aep->at_cmnd.cdb_dl.sf.fcp_cmnd_dl; atp->bytes_xfered = 0; atp->lun = lun; Modified: stable/12/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/12/sys/dev/isp/isp_freebsd.h Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/dev/isp/isp_freebsd.h Tue Nov 24 13:17:12 2020 (r367982) @@ -550,7 +550,8 @@ default: \ #define XS_TAG_TYPE(ccb) \ ((ccb->tag_action == MSG_SIMPLE_Q_TAG)? REQFLAG_STAG : \ ((ccb->tag_action == MSG_HEAD_OF_Q_TAG)? REQFLAG_HTAG : REQFLAG_OTAG)) - + +#define XS_PRIORITY(ccb) (ccb)->priority #define XS_SETERR(ccb, v) (ccb)->ccb_h.status &= ~CAM_STATUS_MASK, \ (ccb)->ccb_h.status |= v Modified: stable/12/sys/dev/isp/isp_stds.h ============================================================================== --- stable/12/sys/dev/isp/isp_stds.h Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/dev/isp/isp_stds.h Tue Nov 24 13:17:12 2020 (r367982) @@ -89,6 +89,9 @@ typedef struct { #define FCP_CMND_TASK_ATTR_UNTAGGED 0x05 #define FCP_CMND_TASK_ATTR_MASK 0x07 +#define FCP_CMND_PRIO_MASK 0x78 +#define FCP_CMND_PRIO_SHIFT 3 + #define FCP_CMND_ADDTL_CDBLEN_SHIFT 2 #define FCP_CMND_DATA_WRITE 0x01 Modified: stable/12/sys/dev/isp/ispvar.h ============================================================================== --- stable/12/sys/dev/isp/ispvar.h Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/dev/isp/ispvar.h Tue Nov 24 13:17:12 2020 (r367982) @@ -1036,6 +1036,7 @@ void isp_async(ispsoftc_t *, ispasync_t, ...); * XS_SNSASCQ(xs) dereferences XS_SNSP to get the current stored Additional Sense Code Qualifier * XS_TAG_P(xs) predicate of whether this command should be tagged * XS_TAG_TYPE(xs) which type of tag to use + * XS_PRIORITY(xs) command priority for SIMPLE tag * XS_SETERR(xs) set error state * * HBA_NOERROR command has no erros Modified: stable/12/sys/dev/mpr/mpr_sas.c ============================================================================== --- stable/12/sys/dev/mpr/mpr_sas.c Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/dev/mpr/mpr_sas.c Tue Nov 24 13:17:12 2020 (r367982) @@ -2093,6 +2093,8 @@ mprsas_action_scsiio(struct mprsas_softc *sassc, union mpi_control |= MPI2_SCSIIO_CONTROL_SIMPLEQ; break; } + mpi_control |= (csio->priority << MPI2_SCSIIO_CONTROL_CMDPRI_SHIFT) & + MPI2_SCSIIO_CONTROL_CMDPRI_MASK; mpi_control |= sc->mapping_table[csio->ccb_h.target_id].TLR_bits; req->Control = htole32(mpi_control); Modified: stable/12/sys/dev/mps/mps_sas.c ============================================================================== --- stable/12/sys/dev/mps/mps_sas.c Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/dev/mps/mps_sas.c Tue Nov 24 13:17:12 2020 (r367982) @@ -1819,6 +1819,8 @@ mpssas_action_scsiio(struct mpssas_softc *sassc, union mpi_control |= MPI2_SCSIIO_CONTROL_SIMPLEQ; break; } + mpi_control |= (csio->priority << MPI2_SCSIIO_CONTROL_TASKPRI_SHIFT) & + MPI2_SCSIIO_CONTROL_TASKPRI_MASK; mpi_control |= sc->mapping_table[csio->ccb_h.target_id].TLR_bits; req->Control = htole32(mpi_control); if (MPS_SET_LUN(req->LUN, csio->ccb_h.target_lun) != 0) { Modified: stable/12/sys/dev/ocs_fc/ocs_cam.c ============================================================================== --- stable/12/sys/dev/ocs_fc/ocs_cam.c Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/dev/ocs_fc/ocs_cam.c Tue Nov 24 13:17:12 2020 (r367982) @@ -583,8 +583,12 @@ int32_t ocs_scsi_recv_cmd(ocs_io_t *io, uint64_t lun, atio->tag_action = MSG_HEAD_OF_Q_TAG; else if (flags & OCS_SCSI_CMD_ORDERED) atio->tag_action = MSG_ORDERED_Q_TAG; + else if (flags & OCS_SCSI_CMD_ACA) + atio->tag_action = MSG_ACA_TASK; else - atio->tag_action = 0; + atio->tag_action = CAM_TAG_ACTION_NONE; + atio->priority = (flags & OCS_SCSI_PRIORITY_MASK) >> + OCS_SCSI_PRIORITY_SHIFT; atio->cdb_len = cdb_len; ocs_memcpy(atio->cdb_io.cdb_bytes, cdb, cdb_len); @@ -1780,7 +1784,7 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb *ccb ocs_node_t *node = NULL; ocs_io_t *io = NULL; ocs_scsi_sgl_t sgl[OCS_FC_MAX_SGL]; - int32_t sgl_count; + int32_t flags, sgl_count; ocs_fcport *fcp = NULL; fcp = FCPORT(ocs, cam_sim_bus(xpt_path_sim((ccb)->ccb_h.path))); @@ -1842,13 +1846,32 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb *ccb io->timeout = ccb->ccb_h.timeout; } + switch (csio->tag_action) { + case MSG_HEAD_OF_Q_TAG: + flags = OCS_SCSI_CMD_HEAD_OF_QUEUE; + break; + case MSG_ORDERED_Q_TAG: + flags = OCS_SCSI_CMD_ORDERED; + break; + case MSG_ACA_TASK: + flags = OCS_SCSI_CMD_ACA; + break; + case CAM_TAG_ACTION_NONE: + case MSG_SIMPLE_Q_TAG: + default: + flags = OCS_SCSI_CMD_SIMPLE; + break; + } + flags |= (csio->priority << OCS_SCSI_PRIORITY_SHIFT) & + OCS_SCSI_PRIORITY_MASK; + switch (ccb->ccb_h.flags & CAM_DIR_MASK) { case CAM_DIR_NONE: rc = ocs_scsi_send_nodata_io(node, io, ccb_h->target_lun, ccb->ccb_h.flags & CAM_CDB_POINTER ? csio->cdb_io.cdb_ptr: csio->cdb_io.cdb_bytes, csio->cdb_len, - ocs_scsi_initiator_io_cb, ccb); + ocs_scsi_initiator_io_cb, ccb, flags); break; case CAM_DIR_IN: rc = ocs_scsi_send_rd_io(node, io, ccb_h->target_lun, @@ -1857,7 +1880,7 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb *ccb csio->cdb_len, NULL, sgl, sgl_count, csio->dxfer_len, - ocs_scsi_initiator_io_cb, ccb); + ocs_scsi_initiator_io_cb, ccb, flags); break; case CAM_DIR_OUT: rc = ocs_scsi_send_wr_io(node, io, ccb_h->target_lun, @@ -1866,7 +1889,7 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb *ccb csio->cdb_len, NULL, sgl, sgl_count, csio->dxfer_len, - ocs_scsi_initiator_io_cb, ccb); + ocs_scsi_initiator_io_cb, ccb, flags); break; default: panic("%s invalid data direction %08x\n", __func__, Modified: stable/12/sys/dev/ocs_fc/ocs_scsi.c ============================================================================== --- stable/12/sys/dev/ocs_fc/ocs_scsi.c Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/dev/ocs_fc/ocs_scsi.c Tue Nov 24 13:17:12 2020 (r367982) @@ -301,7 +301,7 @@ ocs_scsi_send_io(ocs_hw_io_type_e type, ocs_node_t *no ocs_scsi_tmf_cmd_e tmf, uint8_t *cdb, uint32_t cdb_len, ocs_scsi_dif_info_t *dif_info, ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, uint32_t first_burst, - ocs_scsi_rsp_io_cb_t cb, void *arg); + ocs_scsi_rsp_io_cb_t cb, void *arg, uint32_t flags); /** * @brief Target response completion callback. @@ -2280,12 +2280,12 @@ int32_t ocs_scsi_send_rd_io(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t cdb_len, ocs_scsi_dif_info_t *dif_info, ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, - ocs_scsi_rsp_io_cb_t cb, void *arg) + ocs_scsi_rsp_io_cb_t cb, void *arg, uint32_t flags) { int32_t rc; rc = ocs_scsi_send_io(OCS_HW_IO_INITIATOR_READ, node, io, lun, 0, cdb, cdb_len, dif_info, sgl, sgl_count, - wire_len, 0, cb, arg); + wire_len, 0, cb, arg, flags); return rc; } @@ -2319,12 +2319,12 @@ ocs_scsi_send_rd_io(ocs_node_t *node, ocs_io_t *io, ui int32_t ocs_scsi_send_wr_io(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t cdb_len, ocs_scsi_dif_info_t *dif_info, ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, - ocs_scsi_rsp_io_cb_t cb, void *arg) + ocs_scsi_rsp_io_cb_t cb, void *arg, uint32_t flags) { int32_t rc; rc = ocs_scsi_send_io(OCS_HW_IO_INITIATOR_WRITE, node, io, lun, 0, cdb, cdb_len, dif_info, sgl, sgl_count, - wire_len, 0, cb, arg); + wire_len, 0, cb, arg, flags); return rc; } @@ -2360,12 +2360,12 @@ int32_t ocs_scsi_send_wr_io_first_burst(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t cdb_len, ocs_scsi_dif_info_t *dif_info, ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, uint32_t first_burst, - ocs_scsi_rsp_io_cb_t cb, void *arg) + ocs_scsi_rsp_io_cb_t cb, void *arg, uint32_t flags) { int32_t rc; rc = ocs_scsi_send_io(OCS_HW_IO_INITIATOR_WRITE, node, io, lun, 0, cdb, cdb_len, dif_info, sgl, sgl_count, - wire_len, 0, cb, arg); + wire_len, 0, cb, arg, flags); return rc; } @@ -2391,11 +2391,11 @@ ocs_scsi_send_wr_io_first_burst(ocs_node_t *node, ocs_ * @return Returns 0 on success, or a negative error code value on failure. */ int32_t ocs_scsi_send_nodata_io(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t cdb_len, - ocs_scsi_rsp_io_cb_t cb, void *arg) + ocs_scsi_rsp_io_cb_t cb, void *arg, uint32_t flags) { int32_t rc; - rc = ocs_scsi_send_io(OCS_HW_IO_INITIATOR_NODATA, node, io, lun, 0, cdb, cdb_len, NULL, NULL, 0, 0, 0, cb, arg); + rc = ocs_scsi_send_io(OCS_HW_IO_INITIATOR_NODATA, node, io, lun, 0, cdb, cdb_len, NULL, NULL, 0, 0, 0, cb, arg, flags); return rc; } @@ -2461,7 +2461,7 @@ ocs_scsi_send_tmf(ocs_node_t *node, ocs_io_t *io, ocs_ } else { io->display_name = "tmf"; rc = ocs_scsi_send_io(OCS_HW_IO_INITIATOR_READ, node, io, lun, tmf, NULL, 0, NULL, - sgl, sgl_count, len, 0, cb, arg); + sgl, sgl_count, len, 0, cb, arg, 0); } return rc; @@ -2498,7 +2498,7 @@ static int32_t ocs_scsi_send_io(ocs_hw_io_type_e type, ocs_scsi_tmf_cmd_e tmf, uint8_t *cdb, uint32_t cdb_len, ocs_scsi_dif_info_t *dif_info, ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, uint32_t first_burst, - ocs_scsi_rsp_io_cb_t cb, void *arg) + ocs_scsi_rsp_io_cb_t cb, void *arg, uint32_t flags) { int32_t rc; ocs_t *ocs; @@ -2583,6 +2583,18 @@ static int32_t ocs_scsi_send_io(ocs_hw_io_type_e type, return -1; } } + if (flags & OCS_SCSI_CMD_HEAD_OF_QUEUE) + cmnd->task_attribute = FCP_TASK_ATTR_HEAD_OF_QUEUE; + else if (flags & OCS_SCSI_CMD_ORDERED) + cmnd->task_attribute = FCP_TASK_ATTR_ORDERED; + else if (flags & OCS_SCSI_CMD_UNTAGGED) + cmnd->task_attribute = FCP_TASK_ATTR_UNTAGGED; + else if (flags & OCS_SCSI_CMD_ACA) + cmnd->task_attribute = FCP_TASK_ATTR_ACA; + else + cmnd->task_attribute = FCP_TASK_ATTR_SIMPLE; + cmnd->command_priority = (flags & OCS_SCSI_PRIORITY_MASK) >> + OCS_SCSI_PRIORITY_SHIFT; switch (tmf) { case OCS_SCSI_TMF_QUERY_TASK_SET: Modified: stable/12/sys/dev/ocs_fc/ocs_scsi.h ============================================================================== --- stable/12/sys/dev/ocs_fc/ocs_scsi.h Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/dev/ocs_fc/ocs_scsi.h Tue Nov 24 13:17:12 2020 (r367982) @@ -55,6 +55,8 @@ #define OCS_SCSI_CMD_ACA (1U << 6) #define OCS_SCSI_FIRST_BURST_ERR (1U << 7) #define OCS_SCSI_FIRST_BURST_ABORTED (1U << 8) +#define OCS_SCSI_PRIORITY_MASK 0xf0000 +#define OCS_SCSI_PRIORITY_SHIFT 16 /* ocs_scsi_send_rd_data/recv_wr_data/send_resp flags */ #define OCS_SCSI_LAST_DATAPHASE (1U << 0) @@ -352,17 +354,18 @@ extern int32_t ocs_scsi_del_target(ocs_node_t *node, o extern int32_t ocs_scsi_send_rd_io(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t cdb_len, ocs_scsi_dif_info_t *dif_info, - ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, ocs_scsi_rsp_io_cb_t cb, void *arg); + ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, ocs_scsi_rsp_io_cb_t cb, void *arg, uint32_t flags); extern int32_t ocs_scsi_send_wr_io(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t cdb_len, ocs_scsi_dif_info_t *dif_info, - ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, ocs_scsi_rsp_io_cb_t cb, void *arg); + ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, ocs_scsi_rsp_io_cb_t cb, void *arg, uint32_t flags); extern int32_t ocs_scsi_send_wr_io_first_burst(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t cdb_len, ocs_scsi_dif_info_t *dif_info, ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t wire_len, uint32_t first_burst, - ocs_scsi_rsp_io_cb_t cb, void *arg); + ocs_scsi_rsp_io_cb_t cb, void *arg, uint32_t flags); extern int32_t ocs_scsi_send_tmf(ocs_node_t *node, ocs_io_t *io, ocs_io_t *io_to_abort, uint64_t lun, ocs_scsi_tmf_cmd_e tmf, ocs_scsi_sgl_t *sgl, uint32_t sgl_count, uint32_t len, ocs_scsi_rsp_io_cb_t cb, void *arg); -extern int32_t ocs_scsi_send_nodata_io(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t cdb_len, ocs_scsi_rsp_io_cb_t cb, void *arg); +extern int32_t ocs_scsi_send_nodata_io(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t cdb_len, + ocs_scsi_rsp_io_cb_t cb, void *arg, uint32_t flags); extern void ocs_scsi_del_target_complete(ocs_node_t *node); typedef enum { Modified: stable/12/sys/dev/ocs_fc/ocs_unsol.c ============================================================================== --- stable/12/sys/dev/ocs_fc/ocs_unsol.c Tue Nov 24 13:07:59 2020 (r367981) +++ stable/12/sys/dev/ocs_fc/ocs_unsol.c Tue Nov 24 13:17:12 2020 (r367982) @@ -857,6 +857,7 @@ ocs_get_flags_fcp_cmd(fcp_cmnd_iu_t *cmnd) flags |= OCS_SCSI_CMD_UNTAGGED; break; } + flags |= (uint32_t)cmnd->command_priority << OCS_SCSI_PRIORITY_SHIFT; if (cmnd->wrdata) flags |= OCS_SCSI_CMD_DIR_IN; if (cmnd->rddata) From owner-svn-src-all@freebsd.org Tue Nov 24 13:19:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8A324A6043; Tue, 24 Nov 2020 13:19:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgPkW5Klrz4jkZ; Tue, 24 Nov 2020 13:19:31 +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 A9B331F3CD; Tue, 24 Nov 2020 13:19:31 +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 0AODJVVB048362; Tue, 24 Nov 2020 13:19:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AODJV6A048361; Tue, 24 Nov 2020 13:19:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011241319.0AODJV6A048361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 Nov 2020 13:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367983 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 367983 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 13:19:31 -0000 Author: kib Date: Tue Nov 24 13:19:31 2020 New Revision: 367983 URL: https://svnweb.freebsd.org/changeset/base/367983 Log: MFCr367741: vmem: trivial warning and style fixes. Modified: stable/12/sys/kern/subr_vmem.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_vmem.c ============================================================================== --- stable/12/sys/kern/subr_vmem.c Tue Nov 24 13:17:12 2020 (r367982) +++ stable/12/sys/kern/subr_vmem.c Tue Nov 24 13:19:31 2020 (r367983) @@ -512,7 +512,7 @@ bt_insseg_tail(vmem_t *vm, bt_t *bt) } static void -bt_remfree(vmem_t *vm, bt_t *bt) +bt_remfree(vmem_t *vm __unused, bt_t *bt) { MPASS(bt->bt_type == BT_TYPE_FREE); @@ -733,10 +733,9 @@ static int vmem_rehash(vmem_t *vm, vmem_size_t newhashsize) { bt_t *bt; - int i; struct vmem_hashlist *newhashlist; struct vmem_hashlist *oldhashlist; - vmem_size_t oldhashsize; + vmem_size_t i, oldhashsize; MPASS(newhashsize > 0); @@ -765,9 +764,8 @@ vmem_rehash(vmem_t *vm, vmem_size_t newhashsize) } VMEM_UNLOCK(vm); - if (oldhashlist != vm->vm_hash0) { + if (oldhashlist != vm->vm_hash0) free(oldhashlist, M_VMEM); - } return 0; } @@ -1216,7 +1214,7 @@ vmem_t * vmem_init(vmem_t *vm, const char *name, vmem_addr_t base, vmem_size_t size, vmem_size_t quantum, vmem_size_t qcache_max, int flags) { - int i; + vmem_size_t i; MPASS(quantum > 0); MPASS((quantum & (quantum - 1)) == 0); @@ -1457,7 +1455,7 @@ vmem_free(vmem_t *vm, vmem_addr_t addr, vmem_size_t si } void -vmem_xfree(vmem_t *vm, vmem_addr_t addr, vmem_size_t size) +vmem_xfree(vmem_t *vm, vmem_addr_t addr, vmem_size_t size __unused) { bt_t *bt; bt_t *t; From owner-svn-src-all@freebsd.org Tue Nov 24 14:05:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE4864A7411; Tue, 24 Nov 2020 14:05: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgQlg5TQdz4lpl; Tue, 24 Nov 2020 14:05:35 +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 AEDBE20186; Tue, 24 Nov 2020 14:05:35 +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 0AOE5ZrO078997; Tue, 24 Nov 2020 14:05:35 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOE5Z7Q078996; Tue, 24 Nov 2020 14:05:35 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011241405.0AOE5Z7Q078996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 24 Nov 2020 14:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367984 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 367984 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 14:05:35 -0000 Author: manu Date: Tue Nov 24 14:05:35 2020 New Revision: 367984 URL: https://svnweb.freebsd.org/changeset/base/367984 Log: arm64: Check if we have a map before checking the flags This fixes amdgpu on arm64 where linuxkpi is calling id_mapped and we call might_bounce without a map. Modified: head/sys/arm64/arm64/busdma_bounce.c Modified: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- head/sys/arm64/arm64/busdma_bounce.c Tue Nov 24 13:19:31 2020 (r367983) +++ head/sys/arm64/arm64/busdma_bounce.c Tue Nov 24 14:05:35 2020 (r367984) @@ -207,7 +207,7 @@ might_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus { /* Memory allocated by bounce_bus_dmamem_alloc won't bounce */ - if ((map->flags & DMAMAP_FROM_DMAMEM) != 0) + if (map && (map->flags & DMAMAP_FROM_DMAMEM) != 0) return (false); if ((dmat->bounce_flags & BF_COULD_BOUNCE) != 0) From owner-svn-src-all@freebsd.org Tue Nov 24 14:05:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8137D4A7594; Tue, 24 Nov 2020 14:05:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgQm139ztz4mBk; Tue, 24 Nov 2020 14:05:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FC3E1FD50; Tue, 24 Nov 2020 14:05:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AOE5rBO079053; Tue, 24 Nov 2020 14:05:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOE5rSf079052; Tue, 24 Nov 2020 14:05:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011241405.0AOE5rSf079052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 24 Nov 2020 14:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367985 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 367985 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 14:05:53 -0000 Author: mav Date: Tue Nov 24 14:05:52 2020 New Revision: 367985 URL: https://svnweb.freebsd.org/changeset/base/367985 Log: Remove unneeded locking around xpt_bus_[de]register(). MFC after: 2 weeks Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Tue Nov 24 14:05:35 2020 (r367984) +++ head/sys/dev/isp/isp_freebsd.c Tue Nov 24 14:05:52 2020 (r367985) @@ -121,17 +121,12 @@ isp_attach_chan(ispsoftc_t *isp, struct cam_devq *devq if (sim == NULL) return (ENOMEM); - ISP_LOCK(isp); if (xpt_bus_register(sim, isp->isp_dev, chan) != CAM_SUCCESS) { - ISP_UNLOCK(isp); cam_sim_free(sim, FALSE); return (EIO); } - ISP_UNLOCK(isp); if (xpt_create_path(&path, NULL, cam_sim_path(sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - ISP_LOCK(isp); xpt_bus_deregister(cam_sim_path(sim)); - ISP_UNLOCK(isp); cam_sim_free(sim, FALSE); return (ENXIO); } @@ -168,9 +163,7 @@ isp_attach_chan(ispsoftc_t *isp, struct cam_devq *devq if (kproc_create(isp_kthread, fc, &fc->kproc, 0, 0, "%s_%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { xpt_free_path(fc->path); - ISP_LOCK(isp); xpt_bus_deregister(cam_sim_path(fc->sim)); - ISP_UNLOCK(isp); cam_sim_free(fc->sim, FALSE); return (ENOMEM); } @@ -285,9 +278,7 @@ unwind: ISP_GET_PC(isp, chan, sim, sim); ISP_GET_PC(isp, chan, path, path); xpt_free_path(path); - ISP_LOCK(isp); xpt_bus_deregister(cam_sim_path(sim)); - ISP_UNLOCK(isp); cam_sim_free(sim, FALSE); } cam_simq_free(isp->isp_osinfo.devq); From owner-svn-src-all@freebsd.org Tue Nov 24 15:32:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 030052E9806; Tue, 24 Nov 2020 15:32:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgSgt6mVxz4rZ5; Tue, 24 Nov 2020 15:32:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB49E2122A; Tue, 24 Nov 2020 15:32:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AOFWQMH034868; Tue, 24 Nov 2020 15:32:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOFWQL0034845; Tue, 24 Nov 2020 15:32:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011241532.0AOFWQL0034845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 24 Nov 2020 15:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367986 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 367986 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 15:32:27 -0000 Author: mav Date: Tue Nov 24 15:32:25 2020 New Revision: 367986 URL: https://svnweb.freebsd.org/changeset/base/367986 Log: Remove concept of mbox_sleep_ok. It was broken by design and unused for years due to conflicts between different threads, fighting for the same set of mailbox registers, not designed for multiple requests at a time. So either request has to be synchronous and spin under the lock, or it should be sent asynchronously through the queues as Mailbox Command IOCB or some other way. This removes any OS specifics from the wait code, so it can be inlined. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Tue Nov 24 14:05:52 2020 (r367985) +++ head/sys/dev/isp/isp.c Tue Nov 24 15:32:25 2020 (r367986) @@ -3216,7 +3216,7 @@ isp_intr_mbox(ispsoftc_t *isp, uint16_t mbox0) continue; isp->isp_mboxtmp[i] = ISP_READ(isp, MBOX_OFF(i)); } - MBOX_NOTIFY_COMPLETE(isp); + isp->isp_mboxbsy = 0; } void @@ -3489,7 +3489,7 @@ isp_intr_async(ispsoftc_t *isp, uint16_t mbox) if (isp->isp_mboxbsy) { isp->isp_obits = 1; isp->isp_mboxtmp[0] = MBOX_HOST_INTERFACE_ERROR; - MBOX_NOTIFY_COMPLETE(isp); + isp->isp_mboxbsy = 0; } /* * It's up to the handler for isp_async to reinit stuff and @@ -4243,7 +4243,7 @@ isp_mboxcmd(ispsoftc_t *isp, mbreg_t *mbp) { const char *cname, *xname, *sname; char tname[16], mname[16]; - unsigned int ibits, obits, box, opcode; + unsigned int ibits, obits, box, opcode, t, to; opcode = mbp->param[0]; if (opcode > MAX_FC_OPCODE) { @@ -4279,14 +4279,6 @@ isp_mboxcmd(ispsoftc_t *isp, mbreg_t *mbp) return; } - /* - * Get exclusive usage of mailbox registers. - */ - if (MBOX_ACQUIRE(isp)) { - mbp->param[0] = MBOX_REGS_BUSY; - goto out; - } - for (box = 0; box < ISP_NMBOX(isp); box++) { if (ibits & (1 << box)) { isp_prt(isp, ISP_LOGDEBUG3, "IN mbox %d = 0x%04x", box, @@ -4297,10 +4289,6 @@ isp_mboxcmd(ispsoftc_t *isp, mbreg_t *mbp) } isp->isp_lastmbxcmd = opcode; - - /* - * We assume that we can't overwrite a previous command. - */ isp->isp_obits = obits; isp->isp_mboxbsy = 1; @@ -4312,14 +4300,24 @@ isp_mboxcmd(ispsoftc_t *isp, mbreg_t *mbp) /* * While we haven't finished the command, spin our wheels here. */ - MBOX_WAIT_COMPLETE(isp, mbp); + to = (mbp->timeout == 0) ? MBCMD_DEFAULT_TIMEOUT : mbp->timeout; + for (t = 0; t < to; t += 100) { + if (!isp->isp_mboxbsy) + break; + ISP_RUN_ISR(isp); + if (!isp->isp_mboxbsy) + break; + ISP_DELAY(100); + } /* * Did the command time out? */ - if (mbp->param[0] == MBOX_TIMEOUT) { + if (isp->isp_mboxbsy) { isp->isp_mboxbsy = 0; - MBOX_RELEASE(isp); + isp_prt(isp, ISP_LOGWARN, "Mailbox Command (0x%x) Timeout (%uus) (%s:%d)", + isp->isp_lastmbxcmd, to, mbp->func, mbp->lineno); + mbp->param[0] = MBOX_TIMEOUT; goto out; } @@ -4334,8 +4332,6 @@ isp_mboxcmd(ispsoftc_t *isp, mbreg_t *mbp) } } - isp->isp_mboxbsy = 0; - MBOX_RELEASE(isp); out: if (mbp->logval == 0 || mbp->param[0] == MBOX_COMMAND_COMPLETE) return; Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Tue Nov 24 14:05:52 2020 (r367985) +++ head/sys/dev/isp/isp_freebsd.c Tue Nov 24 15:32:25 2020 (r367986) @@ -3250,10 +3250,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cmd, ...) mbox1 = ISP_READ(isp, OUTMAILBOX1); isp_prt(isp, ISP_LOGERR, "Internal Firmware Error @ RISC Address 0x%x", mbox1); #if 0 - mbox1 = isp->isp_osinfo.mbox_sleep_ok; - isp->isp_osinfo.mbox_sleep_ok = 0; isp_reinit(isp, 1); - isp->isp_osinfo.mbox_sleep_ok = mbox1; isp_async(isp, ISPASYNC_FW_RESTARTED, NULL); #endif break; @@ -3357,64 +3354,6 @@ isp_nanotime_sub(struct timespec *b, struct timespec * if (elapsed == 0) elapsed++; return (elapsed); -} - -int -isp_mbox_acquire(ispsoftc_t *isp) -{ - if (isp->isp_osinfo.mboxbsy) { - return (1); - } else { - isp->isp_osinfo.mboxcmd_done = 0; - isp->isp_osinfo.mboxbsy = 1; - return (0); - } -} - -void -isp_mbox_wait_complete(ispsoftc_t *isp, mbreg_t *mbp) -{ - u_int t, to; - - to = (mbp->timeout == 0) ? MBCMD_DEFAULT_TIMEOUT : mbp->timeout; - if (isp->isp_osinfo.mbox_sleep_ok) { - isp->isp_osinfo.mbox_sleep_ok = 0; - isp->isp_osinfo.mbox_sleeping = 1; - msleep_sbt(&isp->isp_osinfo.mboxcmd_done, &isp->isp_lock, - PRIBIO, "ispmbx_sleep", to * SBT_1US, 0, 0); - isp->isp_osinfo.mbox_sleep_ok = 1; - isp->isp_osinfo.mbox_sleeping = 0; - } else { - for (t = 0; t < to; t += 100) { - if (isp->isp_osinfo.mboxcmd_done) - break; - ISP_RUN_ISR(isp); - if (isp->isp_osinfo.mboxcmd_done) - break; - ISP_DELAY(100); - } - } - if (isp->isp_osinfo.mboxcmd_done == 0) { - isp_prt(isp, ISP_LOGWARN, "%s Mailbox Command (0x%x) Timeout (%uus) (%s:%d)", - isp->isp_osinfo.mbox_sleep_ok? "Interrupting" : "Polled", - isp->isp_lastmbxcmd, to, mbp->func, mbp->lineno); - mbp->param[0] = MBOX_TIMEOUT; - isp->isp_osinfo.mboxcmd_done = 1; - } -} - -void -isp_mbox_notify_done(ispsoftc_t *isp) -{ - isp->isp_osinfo.mboxcmd_done = 1; - if (isp->isp_osinfo.mbox_sleeping) - wakeup(&isp->isp_osinfo.mboxcmd_done); -} - -void -isp_mbox_release(ispsoftc_t *isp) -{ - isp->isp_osinfo.mboxbsy = 0; } int Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Tue Nov 24 14:05:52 2020 (r367985) +++ head/sys/dev/isp/isp_freebsd.h Tue Nov 24 15:32:25 2020 (r367986) @@ -269,11 +269,6 @@ struct isposinfo { struct isp_pcmd * pcmd_pool; struct isp_pcmd * pcmd_free; - int mbox_sleeping; - int mbox_sleep_ok; - int mboxbsy; - int mboxcmd_done; - struct callout tmo; /* general timer */ /* @@ -428,11 +423,6 @@ default: \ break; \ } -#define MBOX_ACQUIRE isp_mbox_acquire -#define MBOX_WAIT_COMPLETE isp_mbox_wait_complete -#define MBOX_NOTIFY_COMPLETE isp_mbox_notify_done -#define MBOX_RELEASE isp_mbox_release - #define FC_SCRATCH_ACQUIRE isp_fc_scratch_acquire #define FC_SCRATCH_RELEASE(isp, chan) isp->isp_osinfo.pc.fc[chan].fcbsy = 0 @@ -631,10 +621,6 @@ extern int isp_quickboot_time; void isp_prt(ispsoftc_t *, int level, const char *, ...) __printflike(3, 4); void isp_xs_prt(ispsoftc_t *, XS_T *, int level, const char *, ...) __printflike(4, 5); uint64_t isp_nanotime_sub(struct timespec *, struct timespec *); -int isp_mbox_acquire(ispsoftc_t *); -void isp_mbox_wait_complete(ispsoftc_t *, mbreg_t *); -void isp_mbox_notify_done(ispsoftc_t *); -void isp_mbox_release(ispsoftc_t *); int isp_fc_scratch_acquire(ispsoftc_t *, int); void isp_platform_intr(void *); void isp_platform_intr_resp(void *); Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Tue Nov 24 14:05:52 2020 (r367985) +++ head/sys/dev/isp/ispvar.h Tue Nov 24 15:32:25 2020 (r367986) @@ -831,11 +831,6 @@ void isp_async(ispsoftc_t *, ispasync_t, ...); * various objects so that the ISP's and the system's view * of the same object is consistent. * - * MBOX_ACQUIRE(ispsoftc_t *) acquire lock on mailbox regs - * MBOX_WAIT_COMPLETE(ispsoftc_t *, mbreg_t *) wait for cmd to be done - * MBOX_NOTIFY_COMPLETE(ispsoftc_t *) notification of mbox cmd donee - * MBOX_RELEASE(ispsoftc_t *) release lock on mailbox regs - * * FC_SCRATCH_ACQUIRE(ispsoftc_t *, chan) acquire lock on FC scratch area * return -1 if you cannot * FC_SCRATCH_RELEASE(ispsoftc_t *, chan) acquire lock on FC scratch area From owner-svn-src-all@freebsd.org Tue Nov 24 16:18:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 926C62EA3D8; Tue, 24 Nov 2020 16:18:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgTjN3lMxz4vCT; Tue, 24 Nov 2020 16:18:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7326F218CB; Tue, 24 Nov 2020 16:18:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AOGImmW060858; Tue, 24 Nov 2020 16:18:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOGImKX060857; Tue, 24 Nov 2020 16:18:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011241618.0AOGImKX060857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 24 Nov 2020 16:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367987 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 367987 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 16:18:48 -0000 Author: markj Date: Tue Nov 24 16:18:47 2020 New Revision: 367987 URL: https://svnweb.freebsd.org/changeset/base/367987 Log: pf: Make tag hashing more robust tagname2tag() hashes the tag name before truncating it to 63 characters. tag_unref() removes the tag from the name hash by computing the hash over the truncated name. Ensure that both operations compute the same hash for a given tag. The larger issue is a lack of string validation in pf(4) ioctl handlers. This is intended to be fixed with some future work, but an extra safety belt in tagname2hashindex() is worthwhile regardless. Reported by: syzbot+a0988828aafb00de7d68@syzkaller.appspotmail.com Reviewed by: kp MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27346 Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Tue Nov 24 15:32:25 2020 (r367986) +++ head/sys/netpfil/pf/pf_ioctl.c Tue Nov 24 16:18:47 2020 (r367987) @@ -512,8 +512,10 @@ pf_cleanup_tagset(struct pf_tagset *ts) static uint16_t tagname2hashindex(const struct pf_tagset *ts, const char *tagname) { + size_t len; - return (murmur3_32_hash(tagname, strlen(tagname), ts->seed) & ts->mask); + len = strnlen(tagname, PF_TAG_NAME_SIZE - 1); + return (murmur3_32_hash(tagname, len, ts->seed) & ts->mask); } static uint16_t From owner-svn-src-all@freebsd.org Tue Nov 24 17:12:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F3542EBA03; Tue, 24 Nov 2020 17:12:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgVvX722tz4y9W; Tue, 24 Nov 2020 17:12:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E420D22465; Tue, 24 Nov 2020 17:12:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AOHCeDW098211; Tue, 24 Nov 2020 17:12:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOHCe7K098210; Tue, 24 Nov 2020 17:12:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011241712.0AOHCe7K098210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 24 Nov 2020 17:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367988 - head/sbin/ping X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/ping X-SVN-Commit-Revision: 367988 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 17:12:41 -0000 Author: markj Date: Tue Nov 24 17:12:40 2020 New Revision: 367988 URL: https://svnweb.freebsd.org/changeset/base/367988 Log: ping(8): Improve parameter validation - Use strtonum(3) to simplify bounds checking of numeric parameters. - Fix bounds checking when filling out packet data in "sweep" mode. PR: 239974, 239977, 239978 Reported by: Neeraj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25622 Modified: head/sbin/ping/ping.c Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Tue Nov 24 16:18:47 2020 (r367987) +++ head/sbin/ping/ping.c Tue Nov 24 17:12:40 2020 (r367988) @@ -238,6 +238,7 @@ main(int argc, char *const *argv) struct sigaction si_sa; size_t sz; u_char *datap, packet[IP_MAXPACKET] __aligned(4); + const char *errstr; char *ep, *source, *target, *payload; struct hostent *hp; #ifdef IPSEC_POLICY_IPSEC @@ -246,7 +247,7 @@ main(int argc, char *const *argv) struct sockaddr_in *to; double t; u_long alarmtimeout; - long ltmp; + long long ltmp; int almost_done, ch, df, hold, i, icmp_len, mib[4], preload; int ssend_errno, srecv_errno, tos, ttl, pcp; char ctrl[CMSG_SPACE(sizeof(struct timespec))]; @@ -317,18 +318,18 @@ main(int argc, char *const *argv) break; case 'C': options |= F_IP_VLAN_PCP; - ltmp = strtol(optarg, &ep, 0); - if (*ep || ep == optarg || ltmp > 7 || ltmp < -1) + ltmp = strtonum(optarg, -1, 7, &errstr); + if (errstr != NULL) errx(EX_USAGE, "invalid PCP: `%s'", optarg); pcp = ltmp; break; case 'c': - ltmp = strtol(optarg, &ep, 0); - if (*ep || ep == optarg || ltmp <= 0) + ltmp = strtonum(optarg, 1, LONG_MAX, &errstr); + if (errstr != NULL) errx(EX_USAGE, "invalid count of packets to transmit: `%s'", optarg); - npackets = ltmp; + npackets = (long)ltmp; break; case 'D': options |= F_HDRINCL; @@ -346,49 +347,49 @@ main(int argc, char *const *argv) setbuf(stdout, (char *)NULL); break; case 'G': /* Maximum packet size for ping sweep */ - ltmp = strtol(optarg, &ep, 0); - if (*ep || ep == optarg || ltmp <= 0) + ltmp = strtonum(optarg, 1, INT_MAX, &errstr); + if (errstr != NULL) { errx(EX_USAGE, "invalid packet size: `%s'", optarg); - if (uid != 0 && ltmp > DEFDATALEN) { - errno = EPERM; - err(EX_NOPERM, - "packet size too large: %ld > %u", - ltmp, DEFDATALEN); } + sweepmax = (int)ltmp; + if (uid != 0 && sweepmax > DEFDATALEN) { + errc(EX_NOPERM, EPERM, + "packet size too large: %d > %u", + sweepmax, DEFDATALEN); + } options |= F_SWEEP; - sweepmax = ltmp; break; case 'g': /* Minimum packet size for ping sweep */ - ltmp = strtol(optarg, &ep, 0); - if (*ep || ep == optarg || ltmp <= 0) + ltmp = strtonum(optarg, 1, INT_MAX, &errstr); + if (errstr != NULL) { errx(EX_USAGE, "invalid packet size: `%s'", optarg); - if (uid != 0 && ltmp > DEFDATALEN) { - errno = EPERM; - err(EX_NOPERM, - "packet size too large: %ld > %u", - ltmp, DEFDATALEN); } + sweepmin = (int)ltmp; + if (uid != 0 && sweepmin > DEFDATALEN) { + errc(EX_NOPERM, EPERM, + "packet size too large: %d > %u", + sweepmin, DEFDATALEN); + } options |= F_SWEEP; - sweepmin = ltmp; break; case 'H': options &= ~F_NUMERIC; break; case 'h': /* Packet size increment for ping sweep */ - ltmp = strtol(optarg, &ep, 0); - if (*ep || ep == optarg || ltmp < 1) - errx(EX_USAGE, "invalid increment size: `%s'", + ltmp = strtonum(optarg, 1, INT_MAX, &errstr); + if (errstr != NULL) { + errx(EX_USAGE, "invalid packet size: `%s'", optarg); - if (uid != 0 && ltmp > DEFDATALEN) { - errno = EPERM; - err(EX_NOPERM, - "packet size too large: %ld > %u", - ltmp, DEFDATALEN); } + sweepincr = (int)ltmp; + if (uid != 0 && sweepincr > DEFDATALEN) { + errc(EX_NOPERM, EPERM, + "packet size too large: %d > %u", + sweepincr, DEFDATALEN); + } options |= F_SWEEP; - sweepincr = ltmp; break; case 'I': /* multicast interface */ if (inet_aton(optarg, &ifaddr) == 0) @@ -414,15 +415,15 @@ main(int argc, char *const *argv) loop = 0; break; case 'l': - ltmp = strtol(optarg, &ep, 0); - if (*ep || ep == optarg || ltmp > INT_MAX || ltmp < 0) + ltmp = strtonum(optarg, 0, INT_MAX, &errstr); + if (errstr != NULL) errx(EX_USAGE, "invalid preload value: `%s'", optarg); if (uid) { errno = EPERM; err(EX_NOPERM, "-l flag"); } - preload = ltmp; + preload = (int)ltmp; break; case 'M': switch(optarg[0]) { @@ -440,10 +441,10 @@ main(int argc, char *const *argv) } break; case 'm': /* TTL */ - ltmp = strtol(optarg, &ep, 0); - if (*ep || ep == optarg || ltmp > MAXTTL || ltmp < 0) + ltmp = strtonum(optarg, 0, MAXTTL, &errstr); + if (errstr != NULL) errx(EX_USAGE, "invalid TTL: `%s'", optarg); - ttl = ltmp; + ttl = (int)ltmp; options |= F_TTL; break; case 'n': @@ -485,24 +486,24 @@ main(int argc, char *const *argv) source = optarg; break; case 's': /* size of packet to send */ - ltmp = strtol(optarg, &ep, 0); - if (*ep || ep == optarg || ltmp > INT_MAX || ltmp < 0) + ltmp = strtonum(optarg, 0, INT_MAX, &errstr); + if (errstr != NULL) errx(EX_USAGE, "invalid packet size: `%s'", optarg); - if (uid != 0 && ltmp > DEFDATALEN) { + datalen = (int)ltmp; + if (uid != 0 && datalen > DEFDATALEN) { errno = EPERM; err(EX_NOPERM, - "packet size too large: %ld > %u", - ltmp, DEFDATALEN); + "packet size too large: %d > %u", + datalen, DEFDATALEN); } - datalen = ltmp; break; case 'T': /* multicast TTL */ - ltmp = strtol(optarg, &ep, 0); - if (*ep || ep == optarg || ltmp > MAXTTL || ltmp < 0) + ltmp = strtonum(optarg, 0, MAXTTL, &errstr); + if (errstr != NULL) errx(EX_USAGE, "invalid multicast TTL: `%s'", optarg); - mttl = ltmp; + mttl = (unsigned char)ltmp; options |= F_MTTL; break; case 't': @@ -657,7 +658,7 @@ main(int argc, char *const *argv) if (datalen >= TIMEVAL_LEN) /* can we time transfer */ timing = 1; - if (!(options & F_PINGFILLED)) + if ((options & (F_PINGFILLED | F_SWEEP)) == 0) for (i = TIMEVAL_LEN; i < datalen; ++i) *datap++ = i; @@ -803,10 +804,15 @@ main(int argc, char *const *argv) #endif if (sweepmax) { if (sweepmin > sweepmax) - errx(EX_USAGE, "Maximum packet size must be no less than the minimum packet size"); + errx(EX_USAGE, + "Maximum packet size must be no less than the minimum packet size"); + if (sweepmax > maxpayload - TIMEVAL_LEN) + errx(EX_USAGE, "Invalid sweep maximum"); + if (datalen != DEFDATALEN) - errx(EX_USAGE, "Packet size and ping sweep are mutually exclusive"); + errx(EX_USAGE, + "Packet size and ping sweep are mutually exclusive"); if (npackets > 0) { snpackets = npackets; @@ -971,11 +977,11 @@ main(int argc, char *const *argv) } if (n == 0 || options & F_FLOOD) { if (sweepmax && sntransmitted == snpackets) { - for (i = 0; i < sweepincr ; ++i) + if (datalen + sweepincr > sweepmax) + break; + for (i = 0; i < sweepincr; i++) *datap++ = i; datalen += sweepincr; - if (datalen > sweepmax) - break; send_len = icmp_len + datalen; sntransmitted = 0; } From owner-svn-src-all@freebsd.org Tue Nov 24 17:13:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68DEE2EBD0C; Tue, 24 Nov 2020 17:13:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgVw52cXQz4yHd; Tue, 24 Nov 2020 17:13:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CA8B222E1; Tue, 24 Nov 2020 17:13:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AOHD92d098432; Tue, 24 Nov 2020 17:13:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOHD95h098431; Tue, 24 Nov 2020 17:13:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011241713.0AOHD95h098431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 24 Nov 2020 17:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367989 - head/sys/dev/ata X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/ata X-SVN-Commit-Revision: 367989 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 17:13:09 -0000 Author: markj Date: Tue Nov 24 17:13:08 2020 New Revision: 367989 URL: https://svnweb.freebsd.org/changeset/base/367989 Log: ata(4): Release the ioport resource if device initialization fails PR: 251346 Submitted by: janm@transactionware.com MFC after: 1 week Modified: head/sys/dev/ata/ata-pci.c Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Tue Nov 24 17:12:40 2020 (r367988) +++ head/sys/dev/ata/ata-pci.c Tue Nov 24 17:13:08 2020 (r367989) @@ -111,8 +111,12 @@ ata_pci_attach(device_t dev) RF_ACTIVE); } - if (ctlr->chipinit(dev)) + if (ctlr->chipinit(dev)) { + if (ctlr->r_res1) + bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1, + ctlr->r_res1); return ENXIO; + } /* attach all channels on this controller */ for (unit = 0; unit < ctlr->channels; unit++) { From owner-svn-src-all@freebsd.org Tue Nov 24 17:32:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7C5F2EC2DE; Tue, 24 Nov 2020 17:32:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgWLn4DtDz50Vy; Tue, 24 Nov 2020 17:32:49 +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 842B722BA3; Tue, 24 Nov 2020 17:32:49 +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 0AOHWnFq010818; Tue, 24 Nov 2020 17:32:49 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOHWnB7010817; Tue, 24 Nov 2020 17:32:49 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202011241732.0AOHWnB7010817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 24 Nov 2020 17:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367990 - head/tests/sys/netpfil/pf/ioctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf/ioctl X-SVN-Commit-Revision: 367990 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 17:32:49 -0000 Author: kp Date: Tue Nov 24 17:32:49 2020 New Revision: 367990 URL: https://svnweb.freebsd.org/changeset/base/367990 Log: pf tests: provoke tag hashing panic Attempt to provoke the panic fixed in r367987. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27350 Modified: head/tests/sys/netpfil/pf/ioctl/validation.c Modified: head/tests/sys/netpfil/pf/ioctl/validation.c ============================================================================== --- head/tests/sys/netpfil/pf/ioctl/validation.c Tue Nov 24 17:13:08 2020 (r367989) +++ head/tests/sys/netpfil/pf/ioctl/validation.c Tue Nov 24 17:32:49 2020 (r367990) @@ -790,6 +790,43 @@ ATF_TC_CLEANUP(getsrcnodes, tc) COMMON_CLEANUP(); } +ATF_TC_WITH_CLEANUP(tag); +ATF_TC_HEAD(tag, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} + +ATF_TC_BODY(tag, tc) +{ + struct pfioc_rule rule; + + COMMON_HEAD(); + + memset(&rule, 0x42, sizeof(rule)); + + rule.ticket = 0; + rule.pool_ticket = 0; + rule.anchor[0] = 0; + + rule.rule.return_icmp = 0; + bzero(&rule.rule.src, sizeof(rule.rule.src)); + bzero(&rule.rule.dst, sizeof(rule.rule.dst)); + + rule.rule.ifname[0] = 0; + rule.rule.action = 0; + rule.rule.rtableid = 0; + + rule.rule.tagname[0] = 0; + + for (int i = 0; i < 10; i++) + ioctl(dev, DIOCADDRULE, &rule); +} + +ATF_TC_CLEANUP(tag, tc) +{ + COMMON_CLEANUP(); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, addtables); @@ -811,6 +848,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, cxrollback); ATF_TP_ADD_TC(tp, commit); ATF_TP_ADD_TC(tp, getsrcnodes); + ATF_TP_ADD_TC(tp, tag); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Tue Nov 24 17:37:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3A462EC3FE; Tue, 24 Nov 2020 17:37:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgWRs51PXz50Wx; Tue, 24 Nov 2020 17:37:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 904A0229BF; Tue, 24 Nov 2020 17:37:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AOHbDdd011091; Tue, 24 Nov 2020 17:37:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOHbDRX011089; Tue, 24 Nov 2020 17:37:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011241737.0AOHbDRX011089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 24 Nov 2020 17:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367991 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 367991 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 17:37:13 -0000 Author: mav Date: Tue Nov 24 17:37:12 2020 New Revision: 367991 URL: https://svnweb.freebsd.org/changeset/base/367991 Log: Update RQSFLAG_* definitions. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/ispmbox.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Tue Nov 24 17:32:49 2020 (r367990) +++ head/sys/dev/isp/isp.c Tue Nov 24 17:37:12 2020 (r367991) @@ -3225,6 +3225,7 @@ isp_intr_respq(ispsoftc_t *isp) XS_T *xs, *cont_xs; uint8_t qe[QENTRY_LEN]; isp24xx_statusreq_t *sp = (isp24xx_statusreq_t *)qe; + ispstatus_cont_t *scp = (ispstatus_cont_t *)qe; isphdr_t *hp; uint8_t *resp, *snsp; int buddaboom, completion_status, cont = 0, etype, i; @@ -3272,7 +3273,6 @@ isp_intr_respq(ispsoftc_t *isp) req_state_flags = 0; resid = sp->req_resid; } else if (etype == RQSTYPE_STATUS_CONT) { - ispstatus_cont_t *scp = (ispstatus_cont_t *)qe; isp_get_cont_response(isp, (ispstatus_cont_t *)hp, scp); if (cont > 0) { i = min(cont, sizeof(scp->req_sense_data)); @@ -3310,24 +3310,13 @@ isp_intr_respq(ispsoftc_t *isp) buddaboom = 0; if (sp->req_header.rqs_flags & RQSFLAG_MASK) { - if (sp->req_header.rqs_flags & RQSFLAG_CONTINUATION) { - isp_print_qentry(isp, "unexpected continuation segment", + if (sp->req_header.rqs_flags & RQSFLAG_BADTYPE) { + isp_print_qentry(isp, "invalid entry type", cptr, hp); - continue; - } - if (sp->req_header.rqs_flags & RQSFLAG_FULL) { - isp_prt(isp, ISP_LOG_WARN1, "internal queues full"); - /* - * We'll synthesize a QUEUE FULL message below. - */ - } - if (sp->req_header.rqs_flags & RQSFLAG_BADHEADER) { - isp_print_qentry(isp, "bad header flag", - cptr, hp); buddaboom++; } - if (sp->req_header.rqs_flags & RQSFLAG_BADPACKET) { - isp_print_qentry(isp, "bad request packet", + if (sp->req_header.rqs_flags & RQSFLAG_BADPARAM) { + isp_print_qentry(isp, "invalid entry parameter", cptr, hp); buddaboom++; } @@ -3337,7 +3326,7 @@ isp_intr_respq(ispsoftc_t *isp) buddaboom++; } if (sp->req_header.rqs_flags & RQSFLAG_BADORDER) { - isp_print_qentry(isp, "invalid IOCB ordering", + isp_print_qentry(isp, "invalid entry order", cptr, hp); continue; } Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Tue Nov 24 17:32:49 2020 (r367990) +++ head/sys/dev/isp/ispmbox.h Tue Nov 24 17:37:12 2020 (r367991) @@ -353,10 +353,8 @@ typedef struct { } isphdr_t; /* RQS Flag definitions */ -#define RQSFLAG_CONTINUATION 0x01 -#define RQSFLAG_FULL 0x02 -#define RQSFLAG_BADHEADER 0x04 -#define RQSFLAG_BADPACKET 0x08 +#define RQSFLAG_BADTYPE 0x04 +#define RQSFLAG_BADPARAM 0x08 #define RQSFLAG_BADCOUNT 0x10 #define RQSFLAG_BADORDER 0x20 #define RQSFLAG_MASK 0x3f From owner-svn-src-all@freebsd.org Tue Nov 24 17:50:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B93CB2ECB04; Tue, 24 Nov 2020 17:50:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgWl24wf0z51R0; Tue, 24 Nov 2020 17:50:22 +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 9BC3722F04; Tue, 24 Nov 2020 17:50:22 +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 0AOHoMpr017384; Tue, 24 Nov 2020 17:50:22 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOHoM7Y017383; Tue, 24 Nov 2020 17:50:22 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011241750.0AOHoM7Y017383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 24 Nov 2020 17:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367992 - head/sys/arm/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/rockchip X-SVN-Commit-Revision: 367992 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 17:50:22 -0000 Author: manu Date: Tue Nov 24 17:50:22 2020 New Revision: 367992 URL: https://svnweb.freebsd.org/changeset/base/367992 Log: arm: Remove old rockchip support Remove the port for rk30xx. Kernel config was removed in r346096 and this port was never migrated to GENERIC. It is also impossible to obtain such hardware nowadays and this code don't provide anything beside booting. Reviewed by: imp Relnotes: yes Differential Revision: https://reviews.freebsd.org/D27280 Deleted: head/sys/arm/rockchip/files.rk30xx head/sys/arm/rockchip/rk30xx_gpio.c head/sys/arm/rockchip/rk30xx_grf.c head/sys/arm/rockchip/rk30xx_grf.h head/sys/arm/rockchip/rk30xx_machdep.c head/sys/arm/rockchip/rk30xx_mp.c head/sys/arm/rockchip/rk30xx_mp.h head/sys/arm/rockchip/rk30xx_pmu.c head/sys/arm/rockchip/rk30xx_pmu.h head/sys/arm/rockchip/rk30xx_wdog.c head/sys/arm/rockchip/rk30xx_wdog.h head/sys/arm/rockchip/std.rk30xx From owner-svn-src-all@freebsd.org Tue Nov 24 17:51:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 884482ECB99; Tue, 24 Nov 2020 17:51:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgWly3VCWz51lb; Tue, 24 Nov 2020 17:51:10 +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 6AD00229E8; Tue, 24 Nov 2020 17:51:10 +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 0AOHpA4Z018150; Tue, 24 Nov 2020 17:51:10 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOHpAsX018149; Tue, 24 Nov 2020 17:51:10 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011241751.0AOHpAsX018149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 24 Nov 2020 17:51:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367993 - head/sys/arm/amlogic/aml8726 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/amlogic/aml8726 X-SVN-Commit-Revision: 367993 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 17:51:10 -0000 Author: manu Date: Tue Nov 24 17:51:10 2020 New Revision: 367993 URL: https://svnweb.freebsd.org/changeset/base/367993 Log: arm: Remove old amlogic support Remove the port for aml8726. Kernel config was removed in r346096 and this port was never migrated to GENERIC. It is also impossible to obtain such hardware nowadays. Reviewed by: imp Relnotes: yes Differential Revision: https://reviews.freebsd.org/D27281 Deleted: head/sys/arm/amlogic/aml8726/aml8726_ccm.c head/sys/arm/amlogic/aml8726/aml8726_ccm.h head/sys/arm/amlogic/aml8726/aml8726_clkmsr.c head/sys/arm/amlogic/aml8726/aml8726_clkmsr.h head/sys/arm/amlogic/aml8726/aml8726_fb.c head/sys/arm/amlogic/aml8726/aml8726_fb.h head/sys/arm/amlogic/aml8726/aml8726_gpio.c head/sys/arm/amlogic/aml8726/aml8726_i2c.c head/sys/arm/amlogic/aml8726/aml8726_identsoc.c head/sys/arm/amlogic/aml8726/aml8726_if_dwc.c head/sys/arm/amlogic/aml8726/aml8726_l2cache.c head/sys/arm/amlogic/aml8726/aml8726_machdep.c head/sys/arm/amlogic/aml8726/aml8726_machdep.h head/sys/arm/amlogic/aml8726/aml8726_mmc.c head/sys/arm/amlogic/aml8726/aml8726_mmc.h head/sys/arm/amlogic/aml8726/aml8726_mp.c head/sys/arm/amlogic/aml8726/aml8726_pic.c head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c head/sys/arm/amlogic/aml8726/aml8726_pinctrl.h head/sys/arm/amlogic/aml8726/aml8726_rng.c head/sys/arm/amlogic/aml8726/aml8726_rtc.c head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.h head/sys/arm/amlogic/aml8726/aml8726_soc.h head/sys/arm/amlogic/aml8726/aml8726_timer.c head/sys/arm/amlogic/aml8726/aml8726_uart.h head/sys/arm/amlogic/aml8726/aml8726_uart_console.c head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c head/sys/arm/amlogic/aml8726/aml8726_wdt.c head/sys/arm/amlogic/aml8726/files.aml8726 head/sys/arm/amlogic/aml8726/std.aml8726 head/sys/arm/amlogic/aml8726/uart_dev_aml8726.c From owner-svn-src-all@freebsd.org Tue Nov 24 17:52:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE63F2ECD82; Tue, 24 Nov 2020 17:52:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgWmx4crwz51yS; Tue, 24 Nov 2020 17:52:01 +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 91E5522F3E; Tue, 24 Nov 2020 17:52:01 +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 0AOHq13t020834; Tue, 24 Nov 2020 17:52:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOHq1tN020833; Tue, 24 Nov 2020 17:52:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011241752.0AOHq1tN020833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 24 Nov 2020 17:52:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367994 - head/release/arm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/release/arm X-SVN-Commit-Revision: 367994 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 17:52:01 -0000 Author: manu Date: Tue Nov 24 17:52:01 2020 New Revision: 367994 URL: https://svnweb.freebsd.org/changeset/base/367994 Log: Release: arm: Remove config for old boards All those board are impossible to buy nowadays and could boot using the GENERICSD image after putting the correct u-boot on them. Reviewed by: imp Relnotes: yes Differential Revision: https://reviews.freebsd.org/D27282 Deleted: head/release/arm/BANANAPI.conf head/release/arm/CUBIEBOARD.conf head/release/arm/CUBIEBOARD2.conf head/release/arm/CUBOX-HUMMINGBOARD.conf head/release/arm/PANDABOARD.conf head/release/arm/WANDBOARD.conf From owner-svn-src-all@freebsd.org Tue Nov 24 17:53:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80B662ECC37; Tue, 24 Nov 2020 17:53:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgWpL3GQxz520Y; Tue, 24 Nov 2020 17:53:14 +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 56EED23183; Tue, 24 Nov 2020 17:53:14 +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 0AOHrE3W023469; Tue, 24 Nov 2020 17:53:14 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOHrECB023468; Tue, 24 Nov 2020 17:53:14 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011241753.0AOHrECB023468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 24 Nov 2020 17:53:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367995 - head/release/arm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/release/arm X-SVN-Commit-Revision: 367995 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 17:53:14 -0000 Author: manu Date: Tue Nov 24 17:53:13 2020 New Revision: 367995 URL: https://svnweb.freebsd.org/changeset/base/367995 Log: release: Merge the RPI2 and BEAGLEBONE image with the GENERICSD one Both RPI2 and BEAGLEBONE are still popular and used arm boards. Both u-boots can coexist as they are named differently and live in the fat partition. This leave us with only one image that can be used for both of those boards and all the other ones supported by FreeBSD provided that you install the correct u-boot on it. Reviewed by: imp Relnotes: yes Differential Revision: https://reviews.freebsd.org/D27283 Deleted: head/release/arm/BEAGLEBONE.conf head/release/arm/RPI2.conf Modified: head/release/arm/GENERICSD.conf Modified: head/release/arm/GENERICSD.conf ============================================================================== --- head/release/arm/GENERICSD.conf Tue Nov 24 17:52:01 2020 (r367994) +++ head/release/arm/GENERICSD.conf Tue Nov 24 17:53:13 2020 (r367995) @@ -6,11 +6,64 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 +EMBEDDEDPORTS="sysutils/u-boot-beaglebone sysutils/u-boot-rpi2 sysutils/rpi-firmware" FAT_SIZE="50m -b 1m" FAT_TYPE="16" IMAGE_SIZE="3072M" KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 +BBB_UBOOT_DIR="/usr/local/share/u-boot/u-boot-beaglebone" +RPI_UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi2" +RPI_FIRMWARE_DIR="/usr/local/share/rpi-firmware" +RPI_OL_DIR="${RPI_FIRMWARE_DIR}/overlays" +OVERLAYS="mmc.dtbo" PART_SCHEME="MBR" export BOARDNAME="GENERICSD" + +arm_install_uboot_rpi2() { + UBOOT_FILES="u-boot.bin" + RPI_FIRMWARE_FILES="bootcode.bin config.txt \ + fixup.dat fixup_cd.dat fixup_db.dat fixup_x.dat \ + start.elf start_cd.elf start_db.elf start_x.elf \ + bcm2709-rpi-2-b.dtb" + FATMOUNT="${DESTDIR%${KERNEL}}/fat" + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + for _UF in ${UBOOT_FILES}; do + chroot ${CHROOTDIR} cp -p ${RPI_UBOOT_DIR}/${_UF} \ + ${FATMOUNT}/${_UF} + done + for _UF in ${RPI_FIRMWARE_FILES}; do + chroot ${CHROOTDIR} cp -p ${RPI_FIRMWARE_DIR}/${_UF} \ + ${FATMOUNT}/${_UF} + done + chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays + for _OL in ${OVERLAYS}; do + chroot ${CHROOTDIR} cp -p ${RPI_OL_DIR}/${_OL} \ + ${FATMOUNT}/overlays/${_OL} + done + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + chroot ${CHROOTDIR} rmdir ${FATMOUNT} + + return 0 +} + +arm_install_uboot_bbb() { + FATMOUNT="${DESTDIR%${KERNEL}}/fat" + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} cp -p ${BBB_UBOOT_DIR}/MLO ${FATMOUNT}/MLO + chroot ${CHROOTDIR} cp -p ${BBB_UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + chroot ${CHROOTDIR} rmdir ${FATMOUNT} + + return 0 +} + +arm_install_uboot() { + arm_install_uboot_bbb + arm_install_uboot_rpi2 +} From owner-svn-src-all@freebsd.org Tue Nov 24 18:57:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B4992EE80E for ; Tue, 24 Nov 2020 18:57:03 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5a.ore.mailhop.org (outbound5a.ore.mailhop.org [44.233.67.66]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgYCy6v34z54Z0 for ; Tue, 24 Nov 2020 18:57:02 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1606244216; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=NkRzvapMELNrTptnOZBM7+M0rBj7M9Dw/3sYqsYzGIUO5ZK+zWVcI1OKE/PNWXk3gjL5DdI00WIAW 5IVanU1wPstzHnTGiNVSsrLUOp7+T1XnrZAJjbv3j/MOZOGLRIBvv+uy8ddcaVQcdZf16tqkEUrkmo hTDyQoPnsMxkjC9bPfor2UoTeqhVI5TPUN3aJ/L6p9U+hYN+zeuD48gYcGM4z+jovWd/OIfu9T0p6W 4eOQDFIdBbdcm52xal48W/QHUlLot8YtNa8mkP+BdG3HeXr85aGfa/W2cLW0oEWSvqJTFFd/u0hB+d jm4URmK0MIjkaEmEClWJ6E0TaEaepMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=gpCC85D+cn9B8Verd+1+tREdAMyETIwqKHhv4QTAJkc=; b=oM3rdKY/A0zZ5Orq1WX+sr1IxxVjyIJpEj81a0aEKdqd92BWe/FnmB6Qwl2iRQ3lma689fYSoir1b nFWhRP+xCwNFWbImLKbp6OJsU8drQfACtpvo3USa/f04ry5k9o3/djmlXInQ/0XwuJNbBibdaiJ6A8 x9pb5L3x6jzYTz8Bp5uOFn+0So+tl52igxB6GdJLkg2rmgp3JfipIiEucvIvBja223h8WSC5Q/SO20 wRCNpHZlXn3F3BZtPtTgAnrIMXfyH3099fEv/ow5fPsDhkBP+fDUwdOsjNv4f59ReCsIQhqx92rwHu iDZH2712DSUnA19S6wbE57ApDKgPWRg== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=gpCC85D+cn9B8Verd+1+tREdAMyETIwqKHhv4QTAJkc=; b=SegZf/v0noNRaCv32kef/8ZlMURs8nbPV2zT3Gc5q+GCAla3ffbZnOFy/sUFbFDRZiVYzuHSC3JXX F6+b9NtH/02gy6DswK6iec1t9zIWZt5zumATCpiy1VTgeQtHh40Pl3W5RcpjjoOb3nWUyd7kZnOrS5 gbFC3duv+DLh69+xVKpickVfFE+D4zcbvzl+vCNdBUdFB3j5V6LihwfLrr5zbCx32RmEn2Q5Yg30xz tb+6bTzqI+VtrdnaqZeW7EKhIUL2rD4++skHH5gkOGsiZ7BLtgDjFfaAFUy6Z0U4uNsiCe53zOBlW9 Toa8jPg/+XSmBxg+YX9yDwUzfoxU+KA== X-MHO-RoutePath: aGlwcGll X-MHO-User: d12e2f0c-2e86-11eb-8b38-614106969e8d 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 (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id d12e2f0c-2e86-11eb-8b38-614106969e8d; Tue, 24 Nov 2020 18:56:54 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 0AOIur9i069139; Tue, 24 Nov 2020 11:56:53 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1c6d8fa2da9dee0f1778c43fc98827cd3b1f3a44.camel@freebsd.org> Subject: Re: svn commit: r367994 - head/release/arm From: Ian Lepore To: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 24 Nov 2020 11:56:53 -0700 In-Reply-To: <202011241752.0AOHq1tN020833@repo.freebsd.org> References: <202011241752.0AOHq1tN020833@repo.freebsd.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CgYCy6v34z54Z0 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 18:57:03 -0000 On Tue, 2020-11-24 at 17:52 +0000, Emmanuel Vadot wrote: > Author: manu > Date: Tue Nov 24 17:52:01 2020 > New Revision: 367994 > URL: https://svnweb.freebsd.org/changeset/base/367994 > > Log: > Release: arm: Remove config for old boards > > All those board are impossible to buy nowadays and could boot using > the > GENERICSD image after putting the correct u-boot on them. > The imx6 boards are most certainly not impossible to buy. But I think they do work with the generic kernel. -- Ian > Reviewed by: imp > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D27282 > > Deleted: > head/release/arm/BANANAPI.conf > head/release/arm/CUBIEBOARD.conf > head/release/arm/CUBIEBOARD2.conf > head/release/arm/CUBOX-HUMMINGBOARD.conf > head/release/arm/PANDABOARD.conf > head/release/arm/WANDBOARD.conf From owner-svn-src-all@freebsd.org Tue Nov 24 19:12:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFE2B2EE9EE; Tue, 24 Nov 2020 19:12:26 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgYYk0SZNz5613; Tue, 24 Nov 2020 19:12:25 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1606245138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q3T5RuoM18LDf9d0RhnPebyKyZvxsTEWOmbUTvwfS3Y=; b=CmpxUrwv6/t5SQ67Iri8gpj+qGkmYuO+KHesTCxf1v/HToxpEWqKYmRRsai7vAnApXSIpJ PwGQTS1Oz/LrspPpc9UmA/76AxMOQclblpwdBwE1/otTS8Y9LglFFdscFgnQm/KBBgLgoa 5+5sT7MqvChHkgDd0J7jgtCP6qfOmE0= Received: from skull.home.blih.net (lfbn-idf2-1-288-247.w82-123.abo.wanadoo.fr [82.123.126.247]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 3c7da785 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 24 Nov 2020 19:12:18 +0000 (UTC) Date: Tue, 24 Nov 2020 20:12:15 +0100 From: Emmanuel Vadot To: Ian Lepore Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r367994 - head/release/arm Message-Id: <20201124201215.0b9d32e858d84ccbfc3144e4@bidouilliste.com> In-Reply-To: <1c6d8fa2da9dee0f1778c43fc98827cd3b1f3a44.camel@freebsd.org> References: <202011241752.0AOHq1tN020833@repo.freebsd.org> <1c6d8fa2da9dee0f1778c43fc98827cd3b1f3a44.camel@freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CgYYk0SZNz5613 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 19:12:26 -0000 On Tue, 24 Nov 2020 11:56:53 -0700 Ian Lepore wrote: > On Tue, 2020-11-24 at 17:52 +0000, Emmanuel Vadot wrote: > > Author: manu > > Date: Tue Nov 24 17:52:01 2020 > > New Revision: 367994 > > URL: https://svnweb.freebsd.org/changeset/base/367994 > > > > Log: > > Release: arm: Remove config for old boards > > > > All those board are impossible to buy nowadays and could boot using > > the > > GENERICSD image after putting the correct u-boot on them. > > > > The imx6 boards are most certainly not impossible to buy. But I think > they do work with the generic kernel. > > -- Ian Wandboard seems to be obtainable from wandboard.org but there is so many of them, does u-boot-wandboard works with all of them ? Same question for the hummingboard, I see some hummingboard on solid-run website but I don't know if u-boot-cubox-hummingboard is made for them or not. And yes they do boot with GENERIC kernel, in fact the release image have been using GENERIC kernel for a long time. > > Reviewed by: imp > > Relnotes: yes > > Differential Revision: https://reviews.freebsd.org/D27282 > > > > Deleted: > > head/release/arm/BANANAPI.conf > > head/release/arm/CUBIEBOARD.conf > > head/release/arm/CUBIEBOARD2.conf > > head/release/arm/CUBOX-HUMMINGBOARD.conf > > head/release/arm/PANDABOARD.conf > > head/release/arm/WANDBOARD.conf > -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Tue Nov 24 19:28:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D740F2EF483 for ; Tue, 24 Nov 2020 19:28:30 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2k.ore.mailhop.org (outbound2k.ore.mailhop.org [54.148.219.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgYwG41zTz56nb for ; Tue, 24 Nov 2020 19:28:30 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1606246109; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=JMTfz4b120/jy5eMw2Tp4ya/gitPuMtJ9Q+NllxUitrzBpz6IEpKvD339L6dJROo1h/mqytc0xjTF Iha+hysLOVFR/XCxCSXDTR/FexN1oQVB7hUJVJWcGLkGLxVSQz4aN82kVUSO4je0CEQ1r/J37JMoz3 GFBIfXPJOWLCR0d0Bz3OEx5J1BUxbDOVU962yauS8SHiLipFiM8CXz/6n58rLNsRlJO7XHMNIMAHfz M5kUU0bOyOvMWew7P+YQV1GH7FLS440NZWmQUjvgqirCFWNdzpvZ9u21a4ztw1Dxyc53Hu08hYpDmw 8oUQWG55h6MmMujf4UFq3l+ZQVRZ31A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=u+uTMmn3ggmhlpIvbzmDsL/DrRDRKc80bDHncAl/vcE=; b=pzQpVV+R7zAZlDAJs0ho6DihT+iSIqTz235TXX8njMReol1gYArMYixD5tPhLfZvAXiSJWsMoKSUp JCRU9D8c8UHBkKL/iCAnkAZkzvRPKVOlfzZKye7zg+HJOON+sSo+iIMUFAPahIwPt60+S6CrusNqL7 HI6+lWZbEO3ZKegK/nYvmJgFs+fGkWWSlVZ5HR6dqt68OBNj5hMiEWgA7y+AfPRgigoINymjpN4rS8 AbmOTQfANVugVbG/BygXNnOV9I3TmqcCScYyGkfI4wuC8DpA9vOGHZNxAUptvy+DkQ+Uva39W/hz08 h/Ow/m+idTDYjI9DBHWfxoaW5o0py3Q== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=u+uTMmn3ggmhlpIvbzmDsL/DrRDRKc80bDHncAl/vcE=; b=FtTT5rSByItGDy8KyZQ2vDInjqK0Kc2xGtdZQEtbqGm6qHToKFw9f5xT3OQWLV3d+Ma13T+DCN+jc KhSFYShNHMtjgQ1SKwwyrG0AM7zoUYlNqUGb1E1/wskbpyCpPLH47T/8ybxE6YBVj8/yws9bQ4c1g1 MzGD/8Uo2Rg2o9l3K+v91Mtu9N8n4w/SO7riuVx+SIrDoM3Rx8PzZ67/VzTDB1NUlQB8C78K4xBAzr Xie2ZKKkGbLkDCaaasZLl2LKwz9QVBIO1Dxl3Sz3Em+i41NpJifcEKYccegPPPzejPoTwyYlZFl8sS R/sz/2KsA0EXfnCA71jEbnCvUyDcV9Q== X-MHO-RoutePath: aGlwcGll X-MHO-User: 375597f9-2e8b-11eb-9e12-df46ed8f892f 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 (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 375597f9-2e8b-11eb-9e12-df46ed8f892f; Tue, 24 Nov 2020 19:28:27 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 0AOJSMN4069260; Tue, 24 Nov 2020 12:28:22 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r367994 - head/release/arm From: Ian Lepore To: Emmanuel Vadot Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 24 Nov 2020 12:28:22 -0700 In-Reply-To: <20201124201215.0b9d32e858d84ccbfc3144e4@bidouilliste.com> References: <202011241752.0AOHq1tN020833@repo.freebsd.org> <1c6d8fa2da9dee0f1778c43fc98827cd3b1f3a44.camel@freebsd.org> <20201124201215.0b9d32e858d84ccbfc3144e4@bidouilliste.com> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CgYwG41zTz56nb X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 19:28:30 -0000 On Tue, 2020-11-24 at 20:12 +0100, Emmanuel Vadot wrote: > On Tue, 24 Nov 2020 11:56:53 -0700 > Ian Lepore wrote: > > > On Tue, 2020-11-24 at 17:52 +0000, Emmanuel Vadot wrote: > > > Author: manu > > > Date: Tue Nov 24 17:52:01 2020 > > > New Revision: 367994 > > > URL: https://svnweb.freebsd.org/changeset/base/367994 > > > > > > Log: > > > Release: arm: Remove config for old boards > > > > > > All those board are impossible to buy nowadays and could boot > > > using > > > the > > > GENERICSD image after putting the correct u-boot on them. > > > > > > > The imx6 boards are most certainly not impossible to buy. But I > > think > > they do work with the generic kernel. > > > > -- Ian > > Wandboard seems to be obtainable from wandboard.org but there is so > many of them, does u-boot-wandboard works with all of them ? > Same question for the hummingboard, I see some hummingboard on > solid-run website but I don't know if u-boot-cubox-hummingboard is > made > for them or not. > And yes they do boot with GENERIC kernel, in fact the release image > have been using GENERIC kernel for a long time. > Afaik, all the wandboard and solidrun variants boot fine if you load the right dtb. -- Ian > > > Reviewed by: imp > > > Relnotes: yes > > > Differential Revision: https://reviews.freebsd.org/D27282 > > > > > > Deleted: > > > head/release/arm/BANANAPI.conf > > > head/release/arm/CUBIEBOARD.conf > > > head/release/arm/CUBIEBOARD2.conf > > > head/release/arm/CUBOX-HUMMINGBOARD.conf > > > head/release/arm/PANDABOARD.conf > > > head/release/arm/WANDBOARD.conf > > From owner-svn-src-all@freebsd.org Tue Nov 24 19:55:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D57012EFF2B; Tue, 24 Nov 2020 19:55:01 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgZVs5hGTz585G; Tue, 24 Nov 2020 19:55:01 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B611824851; Tue, 24 Nov 2020 19:55:01 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AOJt1GG096956; Tue, 24 Nov 2020 19:55:01 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOJt15c096954; Tue, 24 Nov 2020 19:55:01 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202011241955.0AOJt15c096954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Tue, 24 Nov 2020 19:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367996 - stable/12/tools/tools/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/tools/tools/netmap X-SVN-Commit-Revision: 367996 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 19:55:01 -0000 Author: vmaffione Date: Tue Nov 24 19:55:01 2020 New Revision: 367996 URL: https://svnweb.freebsd.org/changeset/base/367996 Log: MFC r367920, r367921 netmap: bridge: update man page with more information Update the man page to describe how it is necessary to enable promiscuous mode and/or disable offloads. Modified: stable/12/tools/tools/netmap/bridge.8 stable/12/tools/tools/netmap/pkt-gen.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/tools/netmap/bridge.8 ============================================================================== --- stable/12/tools/tools/netmap/bridge.8 Tue Nov 24 17:53:13 2020 (r367995) +++ stable/12/tools/tools/netmap/bridge.8 Tue Nov 24 19:55:01 2020 (r367996) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2018 +.Dd November 21, 2020 .Dt BRIDGE 8 .Os .Sh NAME @@ -49,6 +49,20 @@ forwards packets without copying the packets payload ( explicitly prevented by the .Fl c flag. +.Pp +When bridging two physical ports, it is necessary that both NICS are in +promiscuous mode, otherwise unicast traffic directed to other hosts will +be dropped by the hardware, and bridging will not work. +.Pp +When bridging the hardware rings of a physical port with the corresponding +host rings, it is necessary to turn off the offloads, because netmap does +not prepare the NIC rings with offload information. +Example: +.Bd -literal -offset indent +ifconfig em0 -rxcsum -txcsum -tso4 -tso6 -lro +.Ed +.Pp +Available options: .Bl -tag -width Ds .It Fl i Ar port Name of the netmap port. @@ -71,8 +85,8 @@ Disable zero-copy mode. .El .Sh SEE ALSO .Xr netmap 4 , -.Xr pkt-gen 8 , -.Xr lb 8 +.Xr lb 8 , +.Xr pkt-gen 8 .Sh AUTHORS .An -nosplit .Nm Modified: stable/12/tools/tools/netmap/pkt-gen.8 ============================================================================== --- stable/12/tools/tools/netmap/pkt-gen.8 Tue Nov 24 17:53:13 2020 (r367995) +++ stable/12/tools/tools/netmap/pkt-gen.8 Tue Nov 24 19:55:01 2020 (r367996) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 3, 2020 +.Dd November 21, 2020 .Dt PKT-GEN 8 .Os .Sh NAME @@ -287,7 +287,7 @@ Send a stream of fake DNS packets between two hosts wi length of 128 bytes. You must set the destination MAC address for packets to be received by the target host. -.Bd -literal -offset intent +.Bd -literal -offset indent pkt-gen -i netmap:ncxl0 -f tx -s 172.16.0.1:53 -d 172.16.1.3:53 -D 00:07:43:29:2a:e0 .Ed .Sh SEE ALSO From owner-svn-src-all@freebsd.org Tue Nov 24 21:14:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2637646A404; Tue, 24 Nov 2020 21:14:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgcGj0bhWz3JK9; Tue, 24 Nov 2020 21:14:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07B98256CA; Tue, 24 Nov 2020 21:14:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AOLEaH8051318; Tue, 24 Nov 2020 21:14:36 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOLEaue051317; Tue, 24 Nov 2020 21:14:36 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202011242114.0AOLEaue051317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 24 Nov 2020 21:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367997 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 367997 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 21:14:37 -0000 Author: jkim Date: Tue Nov 24 21:14:36 2020 New Revision: 367997 URL: https://svnweb.freebsd.org/changeset/base/367997 Log: Do not truncate the last character from serial number. strlcpy() requires one more byte for the NULL character. Submitted by: Henri Hennebert (hlh at restart dot be) MFC after: 3 days Modified: head/sys/cam/mmc/mmc_da.c Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Tue Nov 24 19:55:01 2020 (r367996) +++ head/sys/cam/mmc/mmc_da.c Tue Nov 24 21:14:36 2020 (r367997) @@ -1306,12 +1306,12 @@ sdda_start_init(void *context, union ccb *start_ccb) device->serial_num_len = strlen(softc->card_sn_string); device->serial_num = (u_int8_t *)malloc((device->serial_num_len + 1), M_CAMXPT, M_NOWAIT); - strlcpy(device->serial_num, softc->card_sn_string, device->serial_num_len); + strlcpy(device->serial_num, softc->card_sn_string, device->serial_num_len + 1); device->device_id_len = strlen(softc->card_id_string); device->device_id = (u_int8_t *)malloc((device->device_id_len + 1), M_CAMXPT, M_NOWAIT); - strlcpy(device->device_id, softc->card_id_string, device->device_id_len); + strlcpy(device->device_id, softc->card_id_string, device->device_id_len + 1); strlcpy(mmcp->model, softc->card_id_string, sizeof(mmcp->model)); From owner-svn-src-all@freebsd.org Tue Nov 24 21:28:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1327646B3AD; Tue, 24 Nov 2020 21:28:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cgcb16y5Dz3L6R; Tue, 24 Nov 2020 21:28:45 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1D6C25C08; Tue, 24 Nov 2020 21:28:45 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AOLSjrP057645; Tue, 24 Nov 2020 21:28:45 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOLSiAU057639; Tue, 24 Nov 2020 21:28:44 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202011242128.0AOLSiAU057639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 24 Nov 2020 21:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367998 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/rtsx sys/i386/conf sys/modules sys/modules/rtsx X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/rtsx sys/i386/conf sys/modules sys/modules/rtsx X-SVN-Commit-Revision: 367998 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 21:28:46 -0000 Author: jkim Date: Tue Nov 24 21:28:44 2020 New Revision: 367998 URL: https://svnweb.freebsd.org/changeset/base/367998 Log: Port rtsx(4) driver for Realtek SD card reader from OpenBSD. This driver provides support for Realtek PCI SD card readers. It attaches mmc(4) bus on card insertion and detaches it on card removal. It has been tested with RTS5209, RTS5227, RTS5229, RTS522A, RTS525A and RTL8411B. It should also work with RTS5249, RTL8402 and RTL8411. PR: 204521 Submitted by: Henri Hennebert (hlh at restart dot be) Reviewed by: imp, jkim Differential Revision: https://reviews.freebsd.org/D26435 Added: head/share/man/man4/rtsx.4 (contents, props changed) head/sys/dev/rtsx/ head/sys/dev/rtsx/rtsx.c (contents, props changed) head/sys/dev/rtsx/rtsxreg.h (contents, props changed) head/sys/modules/rtsx/ head/sys/modules/rtsx/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Nov 24 21:14:36 2020 (r367997) +++ head/share/man/man4/Makefile Tue Nov 24 21:28:44 2020 (r367998) @@ -446,6 +446,7 @@ MAN= aac.4 \ rl.4 \ rndtest.4 \ route.4 \ + rtsx.4 \ rtwn.4 \ rtwnfw.4 \ rtwn_pci.4 \ Added: head/share/man/man4/rtsx.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/rtsx.4 Tue Nov 24 21:28:44 2020 (r367998) @@ -0,0 +1,121 @@ +.\" +.\" Copyright (c) 2020 Henri Hennebert +.\" 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. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 24, 2020 +.Dt RTSX 4 +.Os +.Sh NAME +.Nm rtsx +.Nd Realtek SD card reader +.Sh SYNOPSIS +To compile this driver into the kernel, place the following +lines in the kernel configuration file: +.Bd -ragged -offset indent +.Cd "device mmc" +.Cd "device mmcsd" +.Cd "device rtsx" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, +place the following lines in +.Xr loader.conf 5 : +.Bd -literal -offset indent +mmc_load="YES" +mmcsd_load="YES" +rtsx_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for Realtek SD card reader. +Driver attaches mmc bus on card insertion and detaches it on card removing. +.Sh HARDWARE +The +.Nm +driver supports different specification compatible chips. +The following chips have been verified to work: +.Pp +.Bl -bullet -compact +.It +RTS5209 +.It +RTS5227 +.It +RTS5229 +.It +RTS522A +.It +RTS525A +.It +RTL8411B +.El +.Pp +It should also work for: +.Pp +.Bl -bullet -compact +.It +RTS5249 +.It +RTL8402 +.It +RTL8411 +.El +.Sh SEE ALSO +.Xr mmc 4 , +.Xr mmcsd 4 +.Rs +.%T "SD Specifications, Part 2, SD Host Controller, Simplified Specification" +.%T "SanDisk Secure Digital Card" +.Re +.Sh HISTORY +The +.Nm +driver was ported from +.Ox +with modifications found in Linux and +.Nx . +.Sh AUTHORS +.An Henri Hennebert Aq Mt hlh@restart.be +.An Gary Jennejohn Aq Mt gj@freebsd.org +.An Jesper Schmitz Mouridsen Aq Mt jsm@FreeBSD.org +.Sh CONTRIBUTORS +.An Lutz Bichler Aq Mt Lutz.Bichler@gmail.com +.Sh BUGS +.Bl -bullet +.It +The timeouts experienced during card insert and during I/O are solved in version 1.0g. +.It +RTS522A on Lenovo P50s and Lenovo T470p, card detection and read-only switch are reversed. +This is sovled by adding in +.Em loader.conf(5) : +.Bd -ragged +.Cd dev.rtsx.0.inversion=1 +.Ed +.It +Mounting a filesystem with write access on a card write protected may involve a kernel crash. +.It +Suspend/Resume do not work under MMCCAM. +.El Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue Nov 24 21:14:36 2020 (r367997) +++ head/sys/amd64/conf/GENERIC Tue Nov 24 21:28:44 2020 (r367998) @@ -354,6 +354,7 @@ device snd_via8233 # VIA VT8233x Audio device mmc # MMC/SD bus device mmcsd # MMC/SD memory card device sdhci # Generic PCI SD Host Controller +device rtsx # Realtek SD card reader # VirtIO support device virtio # Generic VirtIO bus (required) Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Nov 24 21:14:36 2020 (r367997) +++ head/sys/conf/NOTES Tue Nov 24 21:28:44 2020 (r367998) @@ -2212,10 +2212,11 @@ device cardbus # mmc MMC/SD bus # mmcsd MMC/SD memory card # sdhci Generic PCI SD Host Controller -# +# rtsx Realtek SD card reader (RTS5209, RTS5227, ...) device mmc device mmcsd device sdhci +device rtsx # # SMB bus Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Nov 24 21:14:36 2020 (r367997) +++ head/sys/conf/files Tue Nov 24 21:28:44 2020 (r367998) @@ -2834,6 +2834,8 @@ dev/re/if_re.c optional re dev/rl/if_rl.c optional rl pci dev/rndtest/rndtest.c optional rndtest # +dev/rtsx/rtsx.c optional rtsx pci +# dev/rtwn/if_rtwn.c optional rtwn dev/rtwn/if_rtwn_beacon.c optional rtwn dev/rtwn/if_rtwn_calib.c optional rtwn Added: head/sys/dev/rtsx/rtsx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/rtsx/rtsx.c Tue Nov 24 21:28:44 2020 (r367998) @@ -0,0 +1,3893 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2006 Uwe Stuehler + * Copyright (c) 2012 Stefan Sperling + * Copyright (c) 2020 Henri Hennebert + * Copyright (c) 2020 Gary Jennejohn + * Copyright (c) 2020 Jesper Schmitz Mouridsen + * All rights reserved. + * + * Patch from: + * - Lutz Bichler + * + * Base on OpenBSD /sys/dev/pci/rtsx_pci.c & /dev/ic/rtsx.c + * on Linux /drivers/mmc/host/rtsx_pci_sdmmc.c, + * /include/linux/rtsx_pci.h & + * /drivers/misc/cardreader/rtsx_pcr.c + * on NetBSD /sys/dev/ic/rtsx.c + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include /* For FreeBSD 11 */ +#include /* For FreeBSD 11 */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "opt_mmccam.h" + +#ifdef MMCCAM +#include +#include +#include +#include +#include +#endif /* MMCCAM */ + +#include "rtsxreg.h" + +/* The softc holds our per-instance data. */ +struct rtsx_softc { + struct mtx rtsx_mtx; /* device mutex */ + device_t rtsx_dev; /* device */ + uint16_t rtsx_flags; /* device flags */ + uint16_t rtsx_device_id; /* device ID */ + device_t rtsx_mmc_dev; /* device of mmc bus */ + uint32_t rtsx_intr_enabled; /* enabled interrupts */ + uint32_t rtsx_intr_status; /* soft interrupt status */ + int rtsx_irq_res_id; /* bus IRQ resource id */ + struct resource *rtsx_irq_res; /* bus IRQ resource */ + void *rtsx_irq_cookie; /* bus IRQ resource cookie */ + struct callout rtsx_timeout_callout; /* callout for timeout */ + int rtsx_timeout; /* interrupt timeout value */ + void (*rtsx_intr_trans_ok)(struct rtsx_softc *sc); + /* function to call if transfer succeed */ + void (*rtsx_intr_trans_ko)(struct rtsx_softc *sc); + /* function to call if transfer fail */ + struct timeout_task + rtsx_card_insert_task; /* card insert delayed task */ + struct task rtsx_card_remove_task; /* card remove task */ + + int rtsx_res_id; /* bus memory resource id */ + struct resource *rtsx_res; /* bus memory resource */ + int rtsx_res_type; /* bus memory resource type */ + bus_space_tag_t rtsx_btag; /* host register set tag */ + bus_space_handle_t rtsx_bhandle; /* host register set handle */ + + bus_dma_tag_t rtsx_cmd_dma_tag; /* DMA tag for command transfer */ + bus_dmamap_t rtsx_cmd_dmamap; /* DMA map for command transfer */ + void *rtsx_cmd_dmamem; /* DMA mem for command transfer */ + bus_addr_t rtsx_cmd_buffer; /* device visible address of the DMA segment */ + int rtsx_cmd_index; /* index in rtsx_cmd_buffer */ + + bus_dma_tag_t rtsx_data_dma_tag; /* DMA tag for data transfer */ + bus_dmamap_t rtsx_data_dmamap; /* DMA map for data transfer */ + void *rtsx_data_dmamem; /* DMA mem for data transfer */ + bus_addr_t rtsx_data_buffer; /* device visible address of the DMA segment */ + +#ifdef MMCCAM + struct cam_devq *rtsx_devq; /* CAM queue of requests */ + struct cam_sim *rtsx_sim; /* descriptor of our SCSI Interface Modules (SIM) */ + struct mtx rtsx_sim_mtx; /* SIM mutex */ + union ccb *rtsx_ccb; /* CAM control block */ + struct mmc_request rtsx_cam_req; /* CAM MMC request */ +#endif /* MMCCAM */ + + struct mmc_request *rtsx_req; /* MMC request */ + struct mmc_host rtsx_host; /* host parameters */ + int rtsx_pcie_cap; /* PCIe capability offset */ + int8_t rtsx_bus_busy; /* bus busy status */ + int8_t rtsx_ios_bus_width; /* current host.ios.bus_width */ + int32_t rtsx_ios_clock; /* current host.ios.clock */ + int8_t rtsx_ios_power_mode; /* current host.ios.power mode */ + int8_t rtsx_ios_timing; /* current host.ios.timing */ + int8_t rtsx_ios_vccq; /* current host.ios.vccq */ + uint8_t rtsx_read_only; /* card read only status */ + uint8_t rtsx_inversion; /* inversion of card detection and read only status */ + uint8_t rtsx_force_timing; /* force bus_timing_uhs_sdr50 */ + uint8_t rtsx_debug; /* print debugging */ +#ifdef MMCCAM + uint8_t rtsx_cam_status; /* CAM status - 1 if card in use */ +#endif /* MMCCAM */ + uint64_t rtsx_read_count; /* count of read operations */ + uint64_t rtsx_write_count; /* count of write operations */ + bool rtsx_discovery_mode; /* are we in discovery mode? */ + bool rtsx_tuning_mode; /* are we tuning */ + bool rtsx_double_clk; /* double clock freqency */ + bool rtsx_vpclk; /* voltage at Pulse-width Modulation(PWM) clock? */ + uint8_t rtsx_ssc_depth; /* Spread spectrum clocking depth */ + uint8_t rtsx_card_drive_sel; /* value for RTSX_CARD_DRIVE_SEL */ + uint8_t rtsx_sd30_drive_sel_3v3;/* value for RTSX_SD30_DRIVE_SEL */ +}; + +/* rtsx_flags values */ +#define RTSX_F_DEFAULT 0x0000 +#define RTSX_F_CARD_PRESENT 0x0001 +#define RTSX_F_SDIO_SUPPORT 0x0002 +#define RTSX_F_VERSION_A 0x0004 +#define RTSX_F_VERSION_B 0x0008 +#define RTSX_F_VERSION_C 0x0010 +#define RTSX_F_VERSION_D 0x0020 +#define RTSX_F_8411B_QFN48 0x0040 +#define RTSX_F_REVERSE_SOCKET 0x0080 + +#define RTSX_REALTEK 0x10ec +#define RTSX_RTS5209 0x5209 +#define RTSX_RTS5227 0x5227 +#define RTSX_RTS5229 0x5229 +#define RTSX_RTS522A 0x522a +#define RTSX_RTS525A 0x525a +#define RTSX_RTS5249 0x5249 +#define RTSX_RTL8402 0x5286 +#define RTSX_RTL8411 0x5289 +#define RTSX_RTL8411B 0x5287 + +#define RTSX_VERSION "2.0c" + +static const struct rtsx_device { + uint16_t vendor_id; + uint16_t device_id; + const char *desc; +} rtsx_devices[] = { + { RTSX_REALTEK, RTSX_RTS5209, RTSX_VERSION " Realtek RTS5209 PCI MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS5227, RTSX_VERSION " Realtek RTS5227 PCI MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS5229, RTSX_VERSION " Realtek RTS5229 PCI MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS522A, RTSX_VERSION " Realtek RTS522A PCI MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS525A, RTSX_VERSION " Realtek RTS525A PCI MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS5249, RTSX_VERSION " Realtek RTS5249 PCI MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTL8402, RTSX_VERSION " Realtek RTL8402 PCI MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTL8411, RTSX_VERSION " Realtek RTL8411 PCI MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTL8411B, RTSX_VERSION " Realtek RTL8411B PCI MMC/SD Card Reader"}, + { 0, 0, NULL} +}; + +static int rtsx_dma_alloc(struct rtsx_softc *sc); +static void rtsx_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error); +static void rtsx_dma_free(struct rtsx_softc *sc); +static void rtsx_intr(void *arg); +static void rtsx_handle_card_present(struct rtsx_softc *sc); +static void rtsx_card_task(void *arg, int pending __unused); +static bool rtsx_is_card_present(struct rtsx_softc *sc); +static int rtsx_init(struct rtsx_softc *sc); +static int rtsx_map_sd_drive(int index); +static int rtsx_rts5227_fill_driving(struct rtsx_softc *sc); +static int rtsx_rts5249_fill_driving(struct rtsx_softc *sc); +static int rtsx_read(struct rtsx_softc *, uint16_t, uint8_t *); +static int rtsx_read_cfg(struct rtsx_softc *sc, uint8_t func, uint16_t addr, uint32_t *val); +static int rtsx_write(struct rtsx_softc *sc, uint16_t addr, uint8_t mask, uint8_t val); +static int rtsx_read_phy(struct rtsx_softc *sc, uint8_t addr, uint16_t *val); +static int rtsx_write_phy(struct rtsx_softc *sc, uint8_t addr, uint16_t val); +static int rtsx_bus_power_off(struct rtsx_softc *sc); +static int rtsx_bus_power_on(struct rtsx_softc *sc); +static int rtsx_set_bus_width(struct rtsx_softc *sc, enum mmc_bus_width width); +static int rtsx_set_sd_timing(struct rtsx_softc *sc, enum mmc_bus_timing timing); +static int rtsx_set_sd_clock(struct rtsx_softc *sc, uint32_t freq); +static int rtsx_stop_sd_clock(struct rtsx_softc *sc); +static int rtsx_switch_sd_clock(struct rtsx_softc *sc, uint8_t clk, uint8_t n, uint8_t div, uint8_t mcu); +static void rtsx_sd_change_tx_phase(struct rtsx_softc *sc, uint8_t sample_point); +static void rtsx_sd_change_rx_phase(struct rtsx_softc *sc, uint8_t sample_point); +static void rtsx_sd_tuning_rx_phase(struct rtsx_softc *sc, uint32_t *phase_map); +static int rtsx_sd_tuning_rx_cmd(struct rtsx_softc *sc, uint8_t sample_point); +static int rtsx_sd_tuning_rx_cmd_wait(struct rtsx_softc *sc, struct mmc_command *cmd); +static void rtsx_sd_tuning_rx_cmd_wakeup(struct rtsx_softc *sc); +static void rtsx_sd_wait_data_idle(struct rtsx_softc *sc); +static uint8_t rtsx_sd_search_final_rx_phase(struct rtsx_softc *sc, uint32_t phase_map); +static int rtsx_sd_get_rx_phase_len(uint32_t phase_map, int start_bit); +#if 0 /* For led */ +static int rtsx_led_enable(struct rtsx_softc *sc); +static int rtsx_led_disable(struct rtsx_softc *sc); +#endif /* For led */ +static uint8_t rtsx_response_type(uint16_t mmc_rsp); +static void rtsx_init_cmd(struct rtsx_softc *sc, struct mmc_command *cmd); +static void rtsx_push_cmd(struct rtsx_softc *sc, uint8_t cmd, uint16_t reg, + uint8_t mask, uint8_t data); +static void rtsx_set_cmd_data_len(struct rtsx_softc *sc, uint16_t block_cnt, uint16_t byte_cnt); +static void rtsx_send_cmd(struct rtsx_softc *sc); +static void rtsx_ret_resp(struct rtsx_softc *sc); +static void rtsx_set_resp(struct rtsx_softc *sc, struct mmc_command *cmd); +static void rtsx_stop_cmd(struct rtsx_softc *sc); +static void rtsx_clear_error(struct rtsx_softc *sc); +static void rtsx_req_done(struct rtsx_softc *sc); +static int rtsx_send_req(struct rtsx_softc *sc, struct mmc_command *cmd); +static int rtsx_xfer_short(struct rtsx_softc *sc, struct mmc_command *cmd); +static void rtsx_ask_ppbuf_part1(struct rtsx_softc *sc); +static void rtsx_get_ppbuf_part1(struct rtsx_softc *sc); +static void rtsx_get_ppbuf_part2(struct rtsx_softc *sc); +static void rtsx_put_ppbuf_part1(struct rtsx_softc *sc); +static void rtsx_put_ppbuf_part2(struct rtsx_softc *sc); +static void rtsx_write_ppbuf(struct rtsx_softc *sc); +static int rtsx_xfer(struct rtsx_softc *sc, struct mmc_command *cmd); +static void rtsx_xfer_begin(struct rtsx_softc *sc); +static void rtsx_xfer_start(struct rtsx_softc *sc); +static void rtsx_xfer_finish(struct rtsx_softc *sc); +static void rtsx_timeout(void *arg); + +#ifdef MMCCAM +static void rtsx_cam_action(struct cam_sim *sim, union ccb *ccb); +static void rtsx_cam_poll(struct cam_sim *sim); +static void rtsx_cam_set_tran_settings(struct rtsx_softc *sc, union ccb *ccb); +static void rtsx_cam_request(struct rtsx_softc *sc, union ccb *ccb); +#endif /* MMCCAM */ + +static int rtsx_read_ivar(device_t bus, device_t child, int which, uintptr_t *result); +static int rtsx_write_ivar(device_t bus, device_t child, int which, uintptr_t value); + +static int rtsx_mmcbr_update_ios(device_t bus, device_t child __unused); +static int rtsx_mmcbr_switch_vccq(device_t bus, device_t child __unused); +static int rtsx_mmcbr_tune(device_t bus, device_t child __unused, bool hs400 __unused); +static int rtsx_mmcbr_retune(device_t bus, device_t child __unused, bool reset __unused); +static int rtsx_mmcbr_request(device_t bus, device_t child __unused, struct mmc_request *req); +static int rtsx_mmcbr_get_ro(device_t bus, device_t child __unused); +static int rtsx_mmcbr_acquire_host(device_t bus, device_t child __unused); +static int rtsx_mmcbr_release_host(device_t bus, device_t child __unused); + +static int rtsx_probe(device_t dev); +static int rtsx_attach(device_t dev); +static int rtsx_detach(device_t dev); +static int rtsx_shutdown(device_t dev); +static int rtsx_suspend(device_t dev); +static int rtsx_resume(device_t dev); + +#define RTSX_LOCK_INIT(_sc) mtx_init(&(_sc)->rtsx_mtx, \ + device_get_nameunit(sc->rtsx_dev), "rtsx", MTX_DEF) +#define RTSX_LOCK(_sc) mtx_lock(&(_sc)->rtsx_mtx) +#define RTSX_UNLOCK(_sc) mtx_unlock(&(_sc)->rtsx_mtx) +#define RTSX_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->rtsx_mtx) + +#define RTSX_SDCLK_OFF 0 +#define RTSX_SDCLK_250KHZ 250000 +#define RTSX_SDCLK_400KHZ 400000 +#define RTSX_SDCLK_25MHZ 25000000 +#define RTSX_SDCLK_50MHZ 50000000 +#define RTSX_SDCLK_100MHZ 100000000 +#define RTSX_SDCLK_208MHZ 208000000 + +#define RTSX_MIN_DIV_N 80 +#define RTSX_MAX_DIV_N 208 + +#define RTSX_MAX_DATA_BLKLEN 512 + +#define RTSX_DMA_ALIGN 4 +#define RTSX_HOSTCMD_MAX 256 +#define RTSX_DMA_CMD_BIFSIZE (sizeof(uint32_t) * RTSX_HOSTCMD_MAX) +#define RTSX_DMA_DATA_BUFSIZE MAXPHYS + +#define ISSET(t, f) ((t) & (f)) + +#define READ4(sc, reg) \ + (bus_space_read_4((sc)->rtsx_btag, (sc)->rtsx_bhandle, (reg))) +#define WRITE4(sc, reg, val) \ + (bus_space_write_4((sc)->rtsx_btag, (sc)->rtsx_bhandle, (reg), (val))) + +#define RTSX_READ(sc, reg, val) \ + do { \ + int err = rtsx_read((sc), (reg), (val)); \ + if (err) \ + return (err); \ + } while (0) + +#define RTSX_WRITE(sc, reg, val) \ + do { \ + int err = rtsx_write((sc), (reg), 0xff, (val)); \ + if (err) \ + return (err); \ + } while (0) +#define RTSX_CLR(sc, reg, bits) \ + do { \ + int err = rtsx_write((sc), (reg), (bits), 0); \ + if (err) \ + return (err); \ + } while (0) + +#define RTSX_SET(sc, reg, bits) \ + do { \ + int err = rtsx_write((sc), (reg), (bits), 0xff);\ + if (err) \ + return (err); \ + } while (0) + +#define RTSX_BITOP(sc, reg, mask, bits) \ + do { \ + int err = rtsx_write((sc), (reg), (mask), (bits)); \ + if (err) \ + return (err); \ + } while (0) + +/* + * We use two DMA buffers: a command buffer and a data buffer. + * + * The command buffer contains a command queue for the host controller, + * which describes SD/MMC commands to run, and other parameters. The chip + * runs the command queue when a special bit in the RTSX_HCBAR register is + * set and signals completion with the RTSX_TRANS_OK_INT interrupt. + * Each command is encoded as a 4 byte sequence containing command number + * (read, write, or check a host controller register), a register address, + * and a data bit-mask and value. + * SD/MMC commands which do not transfer any data from/to the card only use + * the command buffer. + * + * The data buffer is used for transfer longer than 512. Data transfer is + * controlled via the RTSX_HDBAR register and completion is signalled by + * the RTSX_TRANS_OK_INT interrupt. + * + * The chip is unable to perform DMA above 4GB. + */ + +/* + * Main commands in the usual seqence used: + * + * CMD0 Go idle state + * CMD8 Send interface condition + * CMD55 Application Command for next ACMD + * ACMD41 Send Operation Conditions Register (OCR: voltage profile of the card) + * CMD2 Send Card Identification (CID) Register + * CMD3 Send relative address + * CMD9 Send Card Specific Data (CSD) + * CMD13 Send status (32 bits - bit 25: card password protected) + * CMD7 Select card (before Get card SCR) + * ACMD51 Send SCR (SD CARD Configuration Register - [51:48]: Bus widths supported) + * CMD6 SD switch function + * ACMD13 Send SD status (512 bits) + * ACMD42 Set/Clear card detect + * ACMD6 Set bus width + * CMD19 Send tuning block + * CMD12 Stop transmission + * + * CMD17 Read single block (<=512) + * CMD18 Read multiple blocks (>512) + * CMD24 Write single block (<=512) + * CMD25 Write multiple blocks (>512) + * + * CMD52 IO R/W direct + * CMD5 Send Operation Conditions + */ + +static int +rtsx_dma_alloc(struct rtsx_softc *sc) +{ + int error = 0; + + error = bus_dma_tag_create(bus_get_dma_tag(sc->rtsx_dev), /* inherit from parent */ + RTSX_DMA_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + RTSX_DMA_CMD_BIFSIZE, 1, /* maxsize, nsegments */ + RTSX_DMA_CMD_BIFSIZE, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->rtsx_cmd_dma_tag); + if (error) { + device_printf(sc->rtsx_dev, + "Can't create cmd parent DMA tag\n"); + return (error); + } + error = bus_dmamem_alloc(sc->rtsx_cmd_dma_tag, /* DMA tag */ + &sc->rtsx_cmd_dmamem, /* will hold the KVA pointer */ + BUS_DMA_COHERENT | BUS_DMA_WAITOK | BUS_DMA_ZERO, /* flags */ + &sc->rtsx_cmd_dmamap); /* DMA map */ + if (error) { + device_printf(sc->rtsx_dev, + "Can't create DMA map for command transfer\n"); + goto destroy_cmd_dma_tag; + + } + error = bus_dmamap_load(sc->rtsx_cmd_dma_tag, /* DMA tag */ + sc->rtsx_cmd_dmamap, /* DMA map */ + sc->rtsx_cmd_dmamem, /* KVA pointer to be mapped */ + RTSX_DMA_CMD_BIFSIZE, /* size of buffer */ + rtsx_dmamap_cb, /* callback */ + &sc->rtsx_cmd_buffer, /* first arg of callback */ + 0); /* flags */ + if (error || sc->rtsx_cmd_buffer == 0) { + device_printf(sc->rtsx_dev, + "Can't load DMA memory for command transfer\n"); + error = (error) ? error : EFAULT; + goto destroy_cmd_dmamem_alloc; + } + + error = bus_dma_tag_create(bus_get_dma_tag(sc->rtsx_dev), /* inherit from parent */ + RTSX_DMA_DATA_BUFSIZE, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + RTSX_DMA_DATA_BUFSIZE, 1, /* maxsize, nsegments */ + RTSX_DMA_DATA_BUFSIZE, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->rtsx_data_dma_tag); + if (error) { + device_printf(sc->rtsx_dev, + "Can't create data parent DMA tag\n"); + goto destroy_cmd_dmamap_load; + } + error = bus_dmamem_alloc(sc->rtsx_data_dma_tag, /* DMA tag */ + &sc->rtsx_data_dmamem, /* will hold the KVA pointer */ + BUS_DMA_WAITOK | BUS_DMA_ZERO, /* flags */ + &sc->rtsx_data_dmamap); /* DMA map */ + if (error) { + device_printf(sc->rtsx_dev, + "Can't create DMA map for data transfer\n"); + goto destroy_data_dma_tag; + } + error = bus_dmamap_load(sc->rtsx_data_dma_tag, /* DMA tag */ + sc->rtsx_data_dmamap, /* DMA map */ + sc->rtsx_data_dmamem, /* KVA pointer to be mapped */ + RTSX_DMA_DATA_BUFSIZE, /* size of buffer */ + rtsx_dmamap_cb, /* callback */ + &sc->rtsx_data_buffer, /* first arg of callback */ + 0); /* flags */ + if (error || sc->rtsx_data_buffer == 0) { + device_printf(sc->rtsx_dev, + "Can't load DMA memory for data transfer\n"); + error = (error) ? error : EFAULT; + goto destroy_data_dmamem_alloc; + } + return (error); + + destroy_data_dmamem_alloc: + bus_dmamem_free(sc->rtsx_data_dma_tag, sc->rtsx_data_dmamem, sc->rtsx_data_dmamap); + destroy_data_dma_tag: + bus_dma_tag_destroy(sc->rtsx_data_dma_tag); + destroy_cmd_dmamap_load: + bus_dmamap_unload(sc->rtsx_cmd_dma_tag, sc->rtsx_cmd_dmamap); + destroy_cmd_dmamem_alloc: + bus_dmamem_free(sc->rtsx_cmd_dma_tag, sc->rtsx_cmd_dmamem, sc->rtsx_cmd_dmamap); + destroy_cmd_dma_tag: + bus_dma_tag_destroy(sc->rtsx_cmd_dma_tag); + + return (error); +} + +static void +rtsx_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + if (error) { + printf("rtsx_dmamap_cb: error %d\n", error); + return; + } + *(bus_addr_t *)arg = segs[0].ds_addr; +} + +static void +rtsx_dma_free(struct rtsx_softc *sc) +{ + if (sc->rtsx_cmd_dma_tag != NULL) { + if (sc->rtsx_cmd_dmamap != NULL) + bus_dmamap_unload(sc->rtsx_cmd_dma_tag, + sc->rtsx_cmd_dmamap); + if (sc->rtsx_cmd_dmamem != NULL) + bus_dmamem_free(sc->rtsx_cmd_dma_tag, + sc->rtsx_cmd_dmamem, + sc->rtsx_cmd_dmamap); + sc->rtsx_cmd_dmamap = NULL; + sc->rtsx_cmd_dmamem = NULL; + sc->rtsx_cmd_buffer = 0; + bus_dma_tag_destroy(sc->rtsx_cmd_dma_tag); + sc->rtsx_cmd_dma_tag = NULL; + } + if (sc->rtsx_data_dma_tag != NULL) { + if (sc->rtsx_data_dmamap != NULL) + bus_dmamap_unload(sc->rtsx_data_dma_tag, + sc->rtsx_data_dmamap); + if (sc->rtsx_data_dmamem != NULL) + bus_dmamem_free(sc->rtsx_data_dma_tag, + sc->rtsx_data_dmamem, + sc->rtsx_data_dmamap); + sc->rtsx_data_dmamap = NULL; + sc->rtsx_data_dmamem = NULL; + sc->rtsx_data_buffer = 0; + bus_dma_tag_destroy(sc->rtsx_data_dma_tag); + sc->rtsx_data_dma_tag = NULL; + } +} + +static void +rtsx_intr(void *arg) +{ + struct rtsx_softc *sc = arg; + uint32_t enabled; + uint32_t status; + + RTSX_LOCK(sc); + + enabled = sc->rtsx_intr_enabled; + status = READ4(sc, RTSX_BIPR); /* read Bus Interrupt Pending Register */ + sc->rtsx_intr_status = status; + + if (bootverbose) + device_printf(sc->rtsx_dev, "Interrupt handler - enabled: 0x%08x, status: 0x%08x\n", enabled, status); + + /* Ack interrupts. */ + WRITE4(sc, RTSX_BIPR, status); + + if (((enabled & status) == 0) || status == 0xffffffff) { + device_printf(sc->rtsx_dev, "Spurious interrupt - enabled: 0x%08x, status: 0x%08x\n", enabled, status); + RTSX_UNLOCK(sc); + return; + } + + /* Detect write protect. */ + if (status & RTSX_SD_WRITE_PROTECT) + sc->rtsx_read_only = 1; + else + sc->rtsx_read_only = 0; + + /* Start task to handle SD card status change (from dwmmc.c). */ + if (status & RTSX_SD_INT) { + device_printf(sc->rtsx_dev, "Interrupt card inserted/removed\n"); + rtsx_handle_card_present(sc); + } + + if (sc->rtsx_req == NULL) { + RTSX_UNLOCK(sc); + return; + } + + if (status & RTSX_TRANS_OK_INT) { + sc->rtsx_req->cmd->error = MMC_ERR_NONE; + if (sc->rtsx_intr_trans_ok != NULL) + sc->rtsx_intr_trans_ok(sc); + } else if (status & RTSX_TRANS_FAIL_INT) { + uint8_t stat1; + sc->rtsx_req->cmd->error = MMC_ERR_FAILED; + if (rtsx_read(sc, RTSX_SD_STAT1, &stat1) == 0 && + (stat1 & RTSX_SD_CRC_ERR)) { + device_printf(sc->rtsx_dev, "CRC error\n"); + sc->rtsx_req->cmd->error = MMC_ERR_BADCRC; + } + if (!sc->rtsx_tuning_mode) + device_printf(sc->rtsx_dev, "Transfer fail - status: 0x%08x\n", status); + rtsx_stop_cmd(sc); + if (sc->rtsx_intr_trans_ko != NULL) + sc->rtsx_intr_trans_ko(sc); + } + + RTSX_UNLOCK(sc); +} + +/* + * Function called from the IRQ handler (from dwmmc.c). + */ +static void +rtsx_handle_card_present(struct rtsx_softc *sc) +{ + bool was_present; + bool is_present; + +#ifdef MMCCAM + was_present = sc->rtsx_cam_status; +#else + was_present = sc->rtsx_mmc_dev != NULL; +#endif /* MMCCAM */ + is_present = rtsx_is_card_present(sc); + if (is_present) + device_printf(sc->rtsx_dev, "Card present\n"); + else + device_printf(sc->rtsx_dev, "Card absent\n"); + + if (!was_present && is_present) { + /* + * The delay is to debounce the card insert + * (sometimes the card detect pin stabilizes + * before the other pins have made good contact). + */ + taskqueue_enqueue_timeout(taskqueue_swi_giant, + &sc->rtsx_card_insert_task, -hz); + } else if (was_present && !is_present) { + taskqueue_enqueue(taskqueue_swi_giant, &sc->rtsx_card_remove_task); + } +} + +/* + * This funtion is called at startup. + */ +static void +rtsx_card_task(void *arg, int pending __unused) +{ + struct rtsx_softc *sc = arg; + + RTSX_LOCK(sc); + + if (rtsx_is_card_present(sc)) { + sc->rtsx_flags |= RTSX_F_CARD_PRESENT; + /* Card is present, attach if necessary. */ +#ifdef MMCCAM + if (sc->rtsx_cam_status == 0) { + union ccb *ccb; + uint32_t pathid; +#else + if (sc->rtsx_mmc_dev == NULL) { +#endif /* MMCCAM */ + if (bootverbose) + device_printf(sc->rtsx_dev, "Card inserted\n"); + + sc->rtsx_read_count = sc->rtsx_write_count = 0; +#ifdef MMCCAM + sc->rtsx_cam_status = 1; + pathid = cam_sim_path(sc->rtsx_sim); + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + device_printf(sc->rtsx_dev, "Unable to alloc CCB for rescan\n"); + RTSX_UNLOCK(sc); + return; + } + /* + * We create a rescan request for BUS:0:0, since the card + * will be at lun 0. + */ + if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, + /* target */ 0, /* lun */ 0) != CAM_REQ_CMP) { + device_printf(sc->rtsx_dev, "Unable to create path for rescan\n"); + RTSX_UNLOCK(sc); + xpt_free_ccb(ccb); + return; + } + RTSX_UNLOCK(sc); + xpt_rescan(ccb); +#else + sc->rtsx_mmc_dev = device_add_child(sc->rtsx_dev, "mmc", -1); + RTSX_UNLOCK(sc); + if (sc->rtsx_mmc_dev == NULL) { + device_printf(sc->rtsx_dev, "Adding MMC bus failed\n"); + } else { + device_set_ivars(sc->rtsx_mmc_dev, sc); + device_probe_and_attach(sc->rtsx_mmc_dev); + } +#endif /* MMCCAM */ + } else + RTSX_UNLOCK(sc); + } else { + sc->rtsx_flags &= ~RTSX_F_CARD_PRESENT; + /* Card isn't present, detach if necessary. */ +#ifdef MMCCAM + if (sc->rtsx_cam_status != 0) { + union ccb *ccb; + uint32_t pathid; +#else + if (sc->rtsx_mmc_dev != NULL) { +#endif /* MMCCAM */ + if (bootverbose) + device_printf(sc->rtsx_dev, "Card removed\n"); + + if (sc->rtsx_debug) + device_printf(sc->rtsx_dev, "Read count: %" PRIu64 ", write count: %" PRIu64 "\n", + sc->rtsx_read_count, sc->rtsx_write_count); +#ifdef MMCCAM + sc->rtsx_cam_status = 0; + pathid = cam_sim_path(sc->rtsx_sim); + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + device_printf(sc->rtsx_dev, "Unable to alloc CCB for rescan\n"); + RTSX_UNLOCK(sc); + return; + } + /* + * We create a rescan request for BUS:0:0, since the card + * will be at lun 0. + */ + if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, + /* target */ 0, /* lun */ 0) != CAM_REQ_CMP) { + device_printf(sc->rtsx_dev, "Unable to create path for rescan\n"); + RTSX_UNLOCK(sc); + xpt_free_ccb(ccb); + return; + } + RTSX_UNLOCK(sc); + xpt_rescan(ccb); +#else + RTSX_UNLOCK(sc); + if (device_delete_child(sc->rtsx_dev, sc->rtsx_mmc_dev)) + device_printf(sc->rtsx_dev, "Detaching MMC bus failed\n"); + sc->rtsx_mmc_dev = NULL; +#endif /* MMCCAM */ + } else + RTSX_UNLOCK(sc); + } +} + +static bool +rtsx_is_card_present(struct rtsx_softc *sc) +{ + uint32_t status; + + status = READ4(sc, RTSX_BIPR); + if (sc->rtsx_inversion == 0) + return (status & RTSX_SD_EXIST); + else + return !(status & RTSX_SD_EXIST); +} + +static int +rtsx_init(struct rtsx_softc *sc) +{ + bool rtsx_init_debug = false; + uint8_t version; + uint8_t val; + int error; + + sc->rtsx_host.host_ocr = RTSX_SUPPORTED_VOLTAGE; + sc->rtsx_host.f_min = RTSX_SDCLK_250KHZ; + sc->rtsx_host.f_max = RTSX_SDCLK_208MHZ; + sc->rtsx_host.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_HSPEED | + MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25; + + sc->rtsx_host.caps |= MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104; + if (sc->rtsx_device_id == RTSX_RTS5209) + sc->rtsx_host.caps |= MMC_CAP_8_BIT_DATA; + pci_find_cap(sc->rtsx_dev, PCIY_EXPRESS, &(sc->rtsx_pcie_cap)); + + /* + * Check IC version. + */ + switch (sc->rtsx_device_id) { + case RTSX_RTS5229: + /* Read IC version from dummy register. */ + RTSX_READ(sc, RTSX_DUMMY_REG, &version); + if ((version & 0x0F) == RTSX_IC_VERSION_C) + sc->rtsx_flags |= RTSX_F_VERSION_C; + break; + case RTSX_RTS522A: + /* Read IC version from dummy register. */ + RTSX_READ(sc, RTSX_DUMMY_REG, &version); + if ((version & 0x0F) == RTSX_IC_VERSION_A) + sc->rtsx_flags |= RTSX_F_VERSION_A; + break; + case RTSX_RTS525A: + /* Read IC version from dummy register. */ + RTSX_READ(sc, RTSX_DUMMY_REG, &version); + if ((version & 0x0F) == RTSX_IC_VERSION_A) + sc->rtsx_flags |= RTSX_F_VERSION_A; + break; + case RTSX_RTL8411B: + RTSX_READ(sc, RTSX_RTL8411B_PACKAGE, &version); + if (version & RTSX_RTL8411B_QFN48) + sc->rtsx_flags |= RTSX_F_8411B_QFN48; + break; + } + + /* + * Fetch vendor settings. + */ + /* + * Normally OEMs will set vendor setting to the config space + * of Realtek card reader in BIOS stage. This statement reads + * the setting and configure the internal registers according + * to it, to improve card reader's compatibility condition. + */ + sc->rtsx_card_drive_sel = RTSX_CARD_DRIVE_DEFAULT; + switch (sc->rtsx_device_id) { + uint32_t reg; + uint32_t reg1; + uint8_t reg3; + case RTSX_RTS5209: + sc->rtsx_card_drive_sel = RTSX_RTS5209_CARD_DRIVE_DEFAULT; + sc->rtsx_sd30_drive_sel_3v3 = RTSX_DRIVER_TYPE_D; + reg = pci_read_config(sc->rtsx_dev, RTSX_PCR_SETTING_REG2, 4); + if (!(reg & 0x80)) { + sc->rtsx_card_drive_sel = (reg >> 8) & 0x3F; + sc->rtsx_sd30_drive_sel_3v3 = reg & 0x07; + } else { + device_printf(sc->rtsx_dev, "pci_read_config() error - reg: 0x%08x\n", reg); + } + if (bootverbose || rtsx_init_debug) + device_printf(sc->rtsx_dev, "card_drive_sel: 0x%02x, sd30_drive_sel_3v3: 0x%02x\n", + sc->rtsx_card_drive_sel, sc->rtsx_sd30_drive_sel_3v3); + break; + case RTSX_RTS5227: + case RTSX_RTS522A: + sc->rtsx_sd30_drive_sel_3v3 = RTSX_CFG_DRIVER_TYPE_B; + reg = pci_read_config(sc->rtsx_dev, RTSX_PCR_SETTING_REG1, 4); + if (!(reg & 0x1000000)) { + sc->rtsx_card_drive_sel &= 0x3F; + sc->rtsx_card_drive_sel |= ((reg >> 25) & 0x01) << 6; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Nov 24 21:45:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8FE546BA74; Tue, 24 Nov 2020 21:45:41 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgcyY68cWz3MTF; Tue, 24 Nov 2020 21:45:41 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C549625DCD; Tue, 24 Nov 2020 21:45:41 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AOLjfO2070327; Tue, 24 Nov 2020 21:45:41 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOLjdGo070314; Tue, 24 Nov 2020 21:45:39 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <202011242145.0AOLjdGo070314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 24 Nov 2020 21:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367999 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 367999 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 21:45:42 -0000 Author: sjg Date: Tue Nov 24 21:45:38 2020 New Revision: 367999 URL: https://svnweb.freebsd.org/changeset/base/367999 Log: Update dirdeps.mk et al to latest Move some local tweaks to local.*.mk Reviewed by: bdrewery MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27300 Modified: head/share/mk/bsd.init.mk head/share/mk/dirdeps-options.mk head/share/mk/dirdeps-targets.mk head/share/mk/dirdeps.mk head/share/mk/gendirdeps.mk head/share/mk/local.autodep.mk head/share/mk/local.dirdeps.mk head/share/mk/local.gendirdeps.mk head/share/mk/local.meta.sys.mk head/share/mk/meta.autodep.mk head/share/mk/meta.stage.mk head/share/mk/meta.subdir.mk head/share/mk/meta.sys.mk head/share/mk/meta2deps.py head/share/mk/meta2deps.sh Modified: head/share/mk/bsd.init.mk ============================================================================== --- head/share/mk/bsd.init.mk Tue Nov 24 21:28:44 2020 (r367998) +++ head/share/mk/bsd.init.mk Tue Nov 24 21:45:38 2020 (r367999) @@ -55,9 +55,13 @@ $xGRP= ${_gid} # - make install is used without other targets. This is to avoid breaking # things like 'make all install' or 'make foo install'. # - non-build targets are called -.if ${MK_DIRDEPS_BUILD} == "yes" && ${.MAKE.LEVEL:U1} == 0 && \ - ${BUILD_AT_LEVEL0:Uyes:tl} == "no" && !make(clean*) && !make(*clean) +.if ${MK_DIRDEPS_BUILD} == "yes" && ${.MAKE.LEVEL} == 0 +# targets that are ok at level 0 +DIRDEPS_BUILD_LEVEL0_TARGETS += clean* destroy* +M_ListToSkip?= O:u:S,^,N,:ts: +.if ${.TARGETS:Uall:${DIRDEPS_BUILD_LEVEL0_TARGETS:${M_ListToSkip}}} != "" _SKIP_BUILD= not building at level 0 +.endif .elif !empty(.MAKEFLAGS:M-V${_V_DO_BUILD}) || \ ${.TARGETS:M*install*} == ${.TARGETS} || \ ${.TARGETS:Mclean*} == ${.TARGETS} || \ Modified: head/share/mk/dirdeps-options.mk ============================================================================== --- head/share/mk/dirdeps-options.mk Tue Nov 24 21:28:44 2020 (r367998) +++ head/share/mk/dirdeps-options.mk Tue Nov 24 21:45:38 2020 (r367999) @@ -1,7 +1,7 @@ # $FreeBSD$ -# $Id: dirdeps-options.mk,v 1.9 2018/09/20 00:07:19 sjg Exp $ +# $Id: dirdeps-options.mk,v 1.17 2020/08/07 01:57:38 sjg Exp $ # -# @(#) Copyright (c) 2018, Simon J. Gerraty +# @(#) Copyright (c) 2018-2020, Simon J. Gerraty # # This file is provided in the hope that it will # be of use. There is absolutely NO WARRANTY. @@ -38,6 +38,11 @@ # to whatever applies for that dir, or it can rely on globals # set in local.dirdeps-options.mk # Either way, we will .undef DIRDEPS.* when done. +# +# In some cases the value of MK_FOO might depend on TARGET_SPEC +# so we qualify MK_FOO with .${TARGET_SPEC} and each component +# TARGET_SPEC_VAR (in reverse order) before using MK_FOO. +# # This should have been set by Makefile.depend.options # before including us @@ -48,21 +53,43 @@ DIRDEPS_OPTIONS ?= .if ${.MAKE.LEVEL} == 0 # :U below avoids potential errors when we := -.for o in ${DIRDEPS_OPTIONS:tu} -DIRDEPS += ${DIRDEPS.$o.${MK_$o:U}:U} +# some options can depend on TARGET_SPEC! +DIRDEPS_OPTIONS_QUALIFIER_LIST ?= \ + ${DEP_TARGET_SPEC:U${TARGET_SPEC}} \ + ${TARGET_SPEC_VARSr:U${TARGET_SPEC_VARS}:@v@${DEP_$v:U${$v}}@} +# note that we need to include $o in the variable _o$o +# to ensure correct evaluation. +.for o in ${DIRDEPS_OPTIONS} +.undef _o$o _v$o +.for x in ${DIRDEPS_OPTIONS_QUALIFIER_LIST} +.if defined(MK_$o.$x) +_o$o ?= MK_$o.$x +_v$o ?= ${MK_$o.$x} +.endif .endfor +_v$o ?= ${MK_$o} +.if ${_debug_reldir:U0} +.info ${DEP_RELDIR:U${RELDIR}}.${DEP_TARGET_SPEC:U${TARGET_SPEC}}: o=$o ${_o$o:UMK_$o}=${_v$o:U} DIRDEPS += ${DIRDEPS.$o.${_v$o:U}:U} +.endif +DIRDEPS += ${DIRDEPS.$o.${_v$o:U}:U} +.endfor DIRDEPS := ${DIRDEPS:O:u} +.if ${_debug_reldir:U0} +.info ${DEP_RELDIR:U${RELDIR}}: DIRDEPS=${DIRDEPS} +.endif # avoid cross contamination -.for o in ${DIRDEPS_OPTIONS:tu} +.for o in ${DIRDEPS_OPTIONS} .undef DIRDEPS.$o.yes .undef DIRDEPS.$o.no +.undef _o$o +.undef _v$o .endfor .else # whether options are enabled or not, # we want to filter out the relevant DIRDEPS.* # we should only be included by meta.autodep.mk # if dependencies are to be updated -.for o in ${DIRDEPS_OPTIONS:tu} +.for o in ${DIRDEPS_OPTIONS} .for d in ${DIRDEPS.$o.yes} ${DIRDEPS.$o.no} .if exists(${SRCTOP}/$d) GENDIRDEPS_FILTER += N$d* Modified: head/share/mk/dirdeps-targets.mk ============================================================================== --- head/share/mk/dirdeps-targets.mk Tue Nov 24 21:28:44 2020 (r367998) +++ head/share/mk/dirdeps-targets.mk Tue Nov 24 21:45:38 2020 (r367999) @@ -1,16 +1,16 @@ # $FreeBSD$ # RCSid: -# $Id: dirdeps-targets.mk,v 1.9 2019/10/06 20:07:50 sjg Exp $ +# $Id: dirdeps-targets.mk,v 1.22 2020/08/15 18:00:11 sjg Exp $ # -# @(#) Copyright (c) 2019 Simon J. Gerraty +# @(#) Copyright (c) 2019-2020 Simon J. Gerraty # # This file is provided in the hope that it will # be of use. There is absolutely NO WARRANTY. # Permission to copy, redistribute or otherwise -# use this file is hereby granted provided that +# use this file is hereby granted provided that # the above copyright notice and this notice are -# left intact. -# +# left intact. +# # Please send copies of changes and bug-fixes to: # sjg@crufty.net # @@ -26,7 +26,16 @@ # We then search those dirs for any Makefile.depend* # Finally we select any that match conditions like REQUESTED_MACHINE # or TARGET_SPEC and initialize DIRDEPS accordingly. -# +# +# We will check each of the initial DIRDEPS for Makefile.dirdeps.options +# and include any found. +# This makes it feasible to tweak options like MK_DIRDEPS_CACHE +# for a specific target. +# +# If MK_STATIC_DIRDEPS_CACHE is defined we will check if the +# initial DIRDEPS has a static cache (Makefile.dirdeps.cache). +# This only makes sense for seriously expensive targets. +# .if ${.MAKE.LEVEL} == 0 # pickup customizations @@ -38,8 +47,11 @@ DIRDEPS_TARGETS_DIRS ?= targets targets/pseudo # they need to be stripped when looking for target dirs DIRDEPS_TARGETS_PREFIX_LIST ?= pkg- build- +# some .TARGETS need filtering +DIRDEPS_TARGETS_FILTER += Nall + # matching target dirs if any -tdirs := ${.TARGETS:Nall:${DIRDEPS_TARGETS_PREFIX_LIST:@p@S,^$p,,@:ts:}:@t@${DIRDEPS_TARGETS_DIRS:@d@$d/$t@}@:@d@${exists(${SRCTOP}/$d):?$d:}@} +tdirs := ${.TARGETS:${DIRDEPS_TARGETS_FILTER:ts:}:${DIRDEPS_TARGETS_PREFIX_LIST:@p@S,^$p,,@:ts:}:@t@${DIRDEPS_TARGETS_DIRS:@d@$d/$t@}@:@d@${exists(${SRCTOP}/$d):?$d:}@} .if !empty(DEBUG_DIRDEPS_TARGETS) .info tdirs=${tdirs} @@ -123,12 +135,38 @@ DIRDEPS := ${DIRDEPS:O:u} .endif # if we got DIRDEPS get to work .if !empty(DIRDEPS) +DIRDEPS.dirs := ${DIRDEPS:S,^,${SRCTOP}/,:@d@${exists($d):?$d:${d:R}}@} +# some targets what to tweak options we might want to process now +.for m in ${DIRDEPS.dirs:S,$,/Makefile.dirdeps.options,} +.-include <$m> +.endfor +.if defined(MK_STATIC_DIRDEPS_CACHE) +# some targets are very expensive to compute dirdeps for +# so we may have a static cache +.for c in ${DIRDEPS.dirs:S,$,/Makefile.dirdeps.cache,} +.if exists($c) +STATIC_DIRDEPS_CACHE ?= $c +.if ${MK_STATIC_DIRDEPS_CACHE} == "yes" +DIRDEPS_CACHE ?= $c +MK_DIRDEPS_CACHE = yes +.endif +.endif +.endfor +.if defined(STATIC_DIRDEPS_CACHE) +.export STATIC_DIRDEPS_CACHE +.endif +.endif + +# allow a top-level makefile to do other stuff +# before including dirdeps.mk +.if ${MK_DIRDEPS_TARGETS_INCLUDE_DIRDEPS:Uyes} == "yes" .include +.endif DIRDEPS_TARGETS_SKIP += all clean* destroy* .for t in ${.TARGETS:${DIRDEPS_TARGETS_SKIP:${M_ListToSkip}}} $t: dirdeps -.endfor +.endfor .endif .endif Modified: head/share/mk/dirdeps.mk ============================================================================== --- head/share/mk/dirdeps.mk Tue Nov 24 21:28:44 2020 (r367998) +++ head/share/mk/dirdeps.mk Tue Nov 24 21:45:38 2020 (r367999) @@ -1,7 +1,8 @@ # $FreeBSD$ -# $Id: dirdeps.mk,v 1.100 2019/11/12 06:47:58 sjg Exp $ +# $Id: dirdeps.mk,v 1.130 2020/11/02 00:34:30 sjg Exp $ -# Copyright (c) 2010-2013, Juniper Networks, Inc. +# Copyright (c) 2010-2020, Simon J. Gerraty +# Copyright (c) 2010-2018, Juniper Networks, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -41,7 +42,7 @@ # or . suffix (see TARGET_SPEC_VARS below), # for example to force building something for the pseudo # machines "host" or "common" regardless of current ${MACHINE}. -# +# # All unqualified entries end up being qualified with .${TARGET_SPEC} # and partially qualified (if TARGET_SPEC_VARS has multiple # entries) are also expanded to a full .. @@ -50,29 +51,22 @@ # # The fully qualified directory entries are used to construct a # dependency graph that will drive the build later. -# +# # Also, for each fully qualified directory target, we will search # using ${.MAKE.DEPENDFILE_PREFERENCE} to find additional # dependencies. We use Makefile.depend (default value for # .MAKE.DEPENDFILE_PREFIX) to refer to these makefiles to # distinguish them from others. -# +# # Before each Makefile.depend file is read, we set # DEP_RELDIR to be the RELDIR (path relative to SRCTOP) for # its directory, and DEP_MACHINE etc according to the . # represented by the suffix of the corresponding target. -# +# # Since each Makefile.depend file includes dirdeps.mk, this # processing is recursive and results in .MAKE.LEVEL 0 learning the # dependencies of the tree wrt the initial directory (_DEP_RELDIR). # -# BUILD_AT_LEVEL0 -# Indicates whether .MAKE.LEVEL 0 builds anything: -# if "no" sub-makes are used to build everything, -# if "yes" sub-makes are only used to build for other machines. -# It is best to use "no", but this can require fixing some -# makefiles to not do anything at .MAKE.LEVEL 0. -# # TARGET_SPEC_VARS # The default value is just MACHINE, and for most environments # this is sufficient. The _DIRDEP_USE target actually sets @@ -113,12 +107,12 @@ # # make sure we know what TARGET_SPEC is # # as we may need it to find Makefile.depend* # TARGET_SPEC = ${TARGET_SPEC_VARS:@v@${$v:U}@:ts,} -# +# # The following variables can influence the initial DIRDEPS # computation with regard to the TARGET_SPECs that will be # built. # Most should also be considered by init.mk -# +# # ONLY_TARGET_SPEC_LIST # Defines a list of TARGET_SPECs for which the current # directory can be built. @@ -137,7 +131,20 @@ # A list of MACHINEs the current directory should not be # built for. # +# _build_xtra_dirs +# local.dirdeps.mk can add targets to this variable. +# They will be hooked into the build, but independent of +# any other DIRDEP. +# +# This allows for adding TESTS to the build, such that the build +# if any test fails, but without the risk of introducing +# circular dependencies. +now_utc ?= ${%s:L:gmtime} +.if !defined(start_utc) +start_utc := ${now_utc} +.endif + .if !target(bootstrap) && (make(bootstrap) || \ make(bootstrap-this) || \ make(bootstrap-recurse) || \ @@ -157,11 +164,6 @@ _DIRDEP_USE_LEVEL?= 0 _CURDIR ?= ${.CURDIR} _OBJDIR ?= ${.OBJDIR} -now_utc = ${%s:L:gmtime} -.if !defined(start_utc) -start_utc := ${now_utc} -.endif - .if ${MAKEFILE:T} == ${.PARSEFILE} && empty(DIRDEPS) && ${.TARGETS:Uall:M*/*} != "" # This little trick let's us do # @@ -208,12 +210,9 @@ DEP_$v ?= ${$v} # so we need to construct a set of modifiers to fill in the gaps. .if ${MAKE_VERSION} >= 20170130 _tspec_x := ${TARGET_SPEC_VARS:range} -.elif ${TARGET_SPEC_VARS:[#]} > 10 -# seriously? better have jot(1) or equivalent to produce suitable sequence -_tspec_x := ${${JOT:Ujot} ${TARGET_SPEC_VARS:[#]}:L:sh} .else -# we can provide the sequence ourselves -_tspec_x := ${1 2 3 4 5 6 7 8 9 10:L:[1..${TARGET_SPEC_VARS:[#]}]} +# do it the hard way +_tspec_x := ${TARGET_SPEC_VARS:[#]:@x@i=1;while [ $$i -le $x ]; do echo $$i; i=$$((i + 1)); done;@:sh} .endif # this handles unqualified entries M_dep_qual_fixes = C;(/[^/.,]+)$$;\1.$${DEP_TARGET_SPEC}; @@ -223,6 +222,7 @@ _tspec_m$i := ${TARGET_SPEC_VARS:[2..$i]:@w@[^,]+@:ts, _tspec_a$i := ,${TARGET_SPEC_VARS:[$i..-1]:@v@$$$${DEP_$v}@:ts,} M_dep_qual_fixes += C;(\.${_tspec_m$i})$$;\1${_tspec_a$i}; .endfor +TARGET_SPEC_VARSr := ${TARGET_SPEC_VARS:[-1..1]} .else # A harmless? default. M_dep_qual_fixes = U @@ -307,6 +307,7 @@ DEP_MACHINE := ${_DEP_TARGET_SPEC} # reset each time through _build_all_dirs = +_build_xtra_dirs = # the first time we are included the _DIRDEP_USE target will not be defined # we can use this as a clue to do initialization and other one time things. @@ -337,9 +338,20 @@ BUILD_DIRDEPS ?= yes .if ${MK_DIRDEPS_CACHE} == "yes" # this is where we will cache all our work -DIRDEPS_CACHE ?= ${_OBJDIR:tA}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,_,g:S,^,.,:N.} +DIRDEPS_CACHE ?= ${_OBJDIR:tA}/dirdeps.cache${_TARGETS:U${.TARGETS}:Nall:O:u:ts-:S,/,_,g:S,^,.,:N.} .endif +.if ${DEBUG_DIRDEPS:@x@${DEP_RELDIR:M$x}${${DEP_RELDIR}.${DEP_MACHINE}:L:M$x}@} != "" +_debug_reldir = 1 +.else +_debug_reldir = 0 +.endif +.if ${DEBUG_DIRDEPS:@x@${DEP_RELDIR:M$x}${${DEP_RELDIR}.depend:L:M$x}@} != "" +_debug_search = 1 +.else +_debug_search = 0 +.endif + # pickup customizations # as below you can use !target(_DIRDEP_USE) to protect things # which should only be done once. @@ -382,6 +394,18 @@ DIRDEPS_FILTER += M${_DEP_RELDIR} DIRDEP_MAKE ?= ${.MAKE} DIRDEP_DIR ?= ${.TARGET:R} +# if you want us to report load averages during build +# DIRDEP_USE_PRELUDE += ${DIRDEP_LOADAVG_REPORT}; + +DIRDEP_LOADAVG_CMD ?= ${UPTIME:Uuptime} | sed 's,.*\(load\),\1,' +DIRDEP_LOADAVG_LAST = 0 +# yes the expression here is a bit complicated, +# the trick is to only eval ${DIRDEP_LOADAVG_LAST::=${now_utc}} +# when we want to report. +DIRDEP_LOADAVG_REPORT = \ + test -z "${"${expr ${now_utc} - ${DIRDEP_LOADAVG_INTEVAL:U60} - ${DIRDEP_LOADAVG_LAST}:L:sh:N-*}":?yes${DIRDEP_LOADAVG_LAST::=${now_utc}}:}" || \ + echo "${TRACER}`${DIRDEP_LOADAVG_CMD}`" + # we suppress SUBDIR when visiting the leaves # we assume sys.mk will set MACHINE_ARCH # you can add extras to DIRDEP_USE_ENV @@ -389,7 +413,7 @@ DIRDEP_DIR ?= ${.TARGET:R} _DIRDEP_USE: .USE .MAKE @for m in ${.MAKE.MAKEFILE_PREFERENCE}; do \ test -s ${.TARGET:R}/$$m || continue; \ - echo "${TRACER}Checking ${.TARGET:R} for ${.TARGET:E} ..."; \ + echo "${TRACER}Checking ${.TARGET:S,${SRCTOP}/,,} for ${.TARGET:E} ..."; \ ${DIRDEP_USE_PRELUDE} \ MACHINE_ARCH= NO_SUBDIR=1 ${DIRDEP_USE_ENV} \ TARGET_SPEC=${.TARGET:E} \ @@ -468,10 +492,19 @@ dirdeps-cached: ${DIRDEPS_CACHE} .MAKE @MAKELEVEL=${.MAKE.LEVEL} ${.MAKE} -C ${_CURDIR} -f ${DIRDEPS_CACHE} \ dirdeps MK_DIRDEPS_CACHE=no BUILD_DIRDEPS=no +# leaf makefiles rarely work for building DIRDEPS_CACHE +.if ${RELDIR} != "." +BUILD_DIRDEPS_MAKEFILE ?= -f dirdeps.mk +.endif + # these should generally do -BUILD_DIRDEPS_MAKEFILE ?= ${MAKEFILE} +BUILD_DIRDEPS_MAKEFILE ?= BUILD_DIRDEPS_TARGETS ?= ${.TARGETS} +.if ${DIRDEPS_CACHE} != ${STATIC_DIRDEPS_CACHE:Uno} && ${DIRDEPS_CACHE:M${SRCTOP}/*} == "" +# export this for dirdeps-cache-update.mk +DYNAMIC_DIRDEPS_CACHE := ${DIRDEPS_CACHE} +.export DYNAMIC_DIRDEPS_CACHE # we need the .meta file to ensure we update if # any of the Makefile.depend* changed. # We do not want to compare the command line though. @@ -483,40 +516,34 @@ ${DIRDEPS_CACHE}: .META .NOMETA_CMP +@MAKELEVEL=${.MAKE.LEVEL} DIRDEPS_CACHE=${DIRDEPS_CACHE} \ DIRDEPS="${DIRDEPS}" \ TARGET_SPEC=${TARGET_SPEC} \ - MAKEFLAGS= ${.MAKE} -C ${_CURDIR} -f ${BUILD_DIRDEPS_MAKEFILE} \ + MAKEFLAGS= ${DIRDEP_CACHE_MAKE:U${.MAKE}} -C ${_CURDIR} \ + ${BUILD_DIRDEPS_MAKEFILE} \ ${BUILD_DIRDEPS_TARGETS} BUILD_DIRDEPS_CACHE=yes \ .MAKE.DEPENDFILE=.none \ + ${"${DEBUG_DIRDEPS:Nno}":?DEBUG_DIRDEPS='${DEBUG_DIRDEPS}':} \ ${.MAKEFLAGS:tW:S,-D ,-D,g:tw:M*WITH*} \ - 3>&1 1>&2 | sed 's,${SRCTOP},$${SRCTOP},g' >> ${.TARGET}.new && \ + ${.MAKEFLAGS:tW:S,-d ,-d,g:tw:M-d*} \ + 3>&1 1>&2 | sed 's,${SRCTOP},$${SRCTOP},g;s,_{,$${,g' >> ${.TARGET}.new && \ mv ${.TARGET}.new ${.TARGET} .endif +.endif .elif !target(_count_dirdeps) # we want to capture the dirdeps count in the cache .END: _count_dirdeps _count_dirdeps: .NOMETA - @echo '.info $${.newline}$${TRACER}Makefiles read: total=${.MAKE.MAKEFILES:[#]} depend=${.MAKE.MAKEFILES:M*depend*:[#]} dirdeps=${.ALLTARGETS:M${SRCTOP}*:O:u:[#]}' >&3 + @{ echo; echo '.info $${.newline}$${TRACER}Makefiles read: total=${.MAKE.MAKEFILES:[#]} depend=${.MAKE.MAKEFILES:M*depend*:[#]} dirdeps=${.ALLTARGETS:M${SRCTOP}*:O:u:[#]} ${DIRDEP_INFO_XTRAS}'; } >&3 .endif .elif !make(dirdeps) && !target(_count_dirdeps) beforedirdeps: _count_dirdeps _count_dirdeps: .NOMETA - @echo "${TRACER}Makefiles read: total=${.MAKE.MAKEFILES:[#]} depend=${.MAKE.MAKEFILES:M*depend*:[#]} dirdeps=${.ALLTARGETS:M${SRCTOP}*:O:u:[#]} seconds=`expr ${now_utc} - ${start_utc}`" + @echo "${TRACER}Makefiles read: total=${.MAKE.MAKEFILES:[#]} depend=${.MAKE.MAKEFILES:M*depend*:[#]} dirdeps=${.ALLTARGETS:M${SRCTOP}*:O:u:[#]} ${DIRDEP_INFO_XTRAS} seconds=`expr ${now_utc} - ${start_utc}`" .endif .endif .if ${BUILD_DIRDEPS} == "yes" -.if ${DEBUG_DIRDEPS:@x@${DEP_RELDIR:M$x}${${DEP_RELDIR}.${DEP_MACHINE}:L:M$x}@} != "" -_debug_reldir = 1 -.else -_debug_reldir = 0 -.endif -.if ${DEBUG_DIRDEPS:@x@${DEP_RELDIR:M$x}${${DEP_RELDIR}.depend:L:M$x}@} != "" -_debug_search = 1 -.else -_debug_search = 0 -.endif # the rest is done repeatedly for every Makefile.depend we read. # if we are anything but the original dir we care only about the @@ -568,20 +595,8 @@ _build_dirs = .if ${DEP_RELDIR} == ${_DEP_RELDIR} # pickup other machines for this dir if necessary -.if ${BUILD_AT_LEVEL0:Uyes} == "no" _build_dirs += ${_machines:@m@${_CURDIR}.$m@} -.else -_build_dirs += ${_machines:N${DEP_TARGET_SPEC}:@m@${_CURDIR}.$m@} -.if ${DEP_TARGET_SPEC} == ${TARGET_SPEC} -# pickup local dependencies now -.if ${MAKE_VERSION} < 20160220 -.-include <.depend> -.else -.dinclude <.depend> .endif -.endif -.endif -.endif .if ${_debug_reldir} .info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: DIRDEPS='${DIRDEPS}' @@ -616,6 +631,7 @@ __qual_depdirs += ${__hostdpadd} .endif .if ${_debug_reldir} +.info DEP_DIRDEPS_FILTER=${DEP_DIRDEPS_FILTER:ts:} .info depdirs=${__depdirs} .info qualified=${__qual_depdirs} .info unqualified=${__unqual_depdirs} @@ -633,7 +649,7 @@ _build_dirs := ${_build_dirs:${M_dep_qual_fixes:ts:}:O .endif # empty DIRDEPS -_build_all_dirs += ${_build_dirs} +_build_all_dirs += ${_build_dirs} ${_build_xtra_dirs} _build_all_dirs := ${_build_all_dirs:O:u} # Normally if doing make -V something, @@ -642,19 +658,14 @@ _build_all_dirs := ${_build_all_dirs:O:u} .if ${.MAKEFLAGS:M-V${_V_READ_DIRDEPS}} == "" .if !empty(_build_all_dirs) .if ${BUILD_DIRDEPS_CACHE} == "yes" -# guard against _build_all_dirs being too big for a single command line -# first get list of dirs that need _DIRDEP_USE -# then export that and _build_all_dirs +x!= echo; { echo; echo '\# ${DEP_RELDIR}.${DEP_TARGET_SPEC}'; } >&3 +# guard against _new_dirdeps being too big for a single command line _new_dirdeps := ${_build_all_dirs:@x@${target($x):?:$x}@} -.export _new_dirdeps _build_all_dirs -x!= echo; { echo '\# ${DEP_RELDIR}.${DEP_TARGET_SPEC}'; \ - echo "dirdeps: \\"; \ - for x in $$_build_all_dirs; do echo " $$x \\"; done; echo; \ - for x in $$_new_dirdeps; do echo "$$x: _DIRDEP_USE"; done; echo; } >&3 +.export _build_xtra_dirs _new_dirdeps .if !empty(DEP_EXPORT_VARS) # Discouraged, but there are always exceptions. # Handle it here rather than explain how. -x!= { echo; ${DEP_EXPORT_VARS:@v@echo '$v=${$v}';@} echo '.export ${DEP_EXPORT_VARS}'; echo; } >&3; echo +x!= echo; { echo; ${DEP_EXPORT_VARS:@v@echo '$v=${$v}';@} echo '.export ${DEP_EXPORT_VARS}'; echo; } >&3 .endif .else # this makes it all happen @@ -673,6 +684,10 @@ DEP_EXPORT_VARS= # this builds the dependency graph .for m in ${_machines} +.if ${BUILD_DIRDEPS_CACHE} == "yes" && !empty(_build_dirs) +x!= echo; { echo; echo 'DIRDEPS.${_this_dir}.$m = \'; } >&3 +_cache_deps = +.endif # it would be nice to do :N${.TARGET} .if !empty(__qual_depdirs) .for q in ${__qual_depdirs:${M_dep_qual_fixes:ts:}:E:O:u:N$m} @@ -680,10 +695,7 @@ DEP_EXPORT_VARS= .info ${DEP_RELDIR}.$m: graph: ${_build_dirs:M*.$q} .endif .if ${BUILD_DIRDEPS_CACHE} == "yes" -_cache_deps := ${_build_dirs:M*.$q} -.export _cache_deps -x!= echo; { echo "${_this_dir}.$m: \\"; \ - for x in $$_cache_deps; do echo " $$x \\"; done; echo; } >&3 +_cache_deps += ${_build_dirs:M*.$q} .else ${_this_dir}.$m: ${_build_dirs:M*.$q} .endif @@ -693,10 +705,17 @@ ${_this_dir}.$m: ${_build_dirs:M*.$q} .info ${DEP_RELDIR}.$m: graph: ${_build_dirs:M*.$m:N${_this_dir}.$m} .endif .if ${BUILD_DIRDEPS_CACHE} == "yes" -_cache_deps := ${_build_dirs:M*.$m:N${_this_dir}.$m} +.if !empty(_build_dirs) +_cache_deps += ${_build_dirs:M*.$m:N${_this_dir}.$m} +.if !empty(_cache_deps) .export _cache_deps -x!= echo; { echo "${_this_dir}.$m: \\"; \ - for x in $$_cache_deps; do echo " $$x \\"; done; echo; } >&3 +x!= echo; for x in $$_cache_deps; do echo " $$x \\"; done >&3 +.endif +x!= echo; { echo; echo '${_this_dir}.$m: $${DIRDEPS.${_this_dir}.$m}'; \ + echo; echo 'dirdeps: ${_this_dir}.$m \'; \ + for x in $$_build_xtra_dirs; do echo " $$x \\"; done; \ + echo; for x in $$_new_dirdeps; do echo "$$x: _DIRDEP_USE"; done; } >&3 +.endif .else ${_this_dir}.$m: ${_build_dirs:M*.$m:N${_this_dir}.$m} .endif @@ -765,6 +784,27 @@ _DEP_RELDIR := ${RELDIR} # Since we are/should be included by .MAKE.DEPENDFILE # This is a final opportunity to add/hook global rules. .-include + +# skip _reldir_{finish,failed} if not included from Makefile.depend* +# or not in meta mode +.if !defined(WITHOUT_META_STATS) && ${.INCLUDEDFROMFILE:U:M${.MAKE.DEPENDFILE_PREFIX}*} != "" && ${.MAKE.MODE:Mmeta} != "" + +meta_stats= meta=${empty(.MAKE.META.FILES):?0:${.MAKE.META.FILES:[#]}} \ + created=${empty(.MAKE.META.CREATED):?0:${.MAKE.META.CREATED:[#]}} + +.if !target(_reldir_finish) +.END: _reldir_finish +_reldir_finish: .NOMETA + @echo "${TRACER}Finished ${RELDIR}.${TARGET_SPEC} seconds=$$(( ${now_utc} - ${start_utc} )) ${meta_stats}" +.endif + +.if !target(_reldir_failed) +.ERROR: _reldir_failed +_reldir_failed: .NOMETA + @echo "${TRACER}Failed ${RELDIR}.${TARGET_SPEC} seconds=$$(( ${now_utc} - ${start_utc} )) ${meta_stats}" +.endif + +.endif # pickup local dependencies .if ${MAKE_VERSION} < 20160220 Modified: head/share/mk/gendirdeps.mk ============================================================================== --- head/share/mk/gendirdeps.mk Tue Nov 24 21:28:44 2020 (r367998) +++ head/share/mk/gendirdeps.mk Tue Nov 24 21:45:38 2020 (r367999) @@ -1,18 +1,19 @@ # $FreeBSD$ -# $Id: gendirdeps.mk,v 1.41 2019/11/21 23:50:40 sjg Exp $ +# $Id: gendirdeps.mk,v 1.46 2020/08/19 17:51:53 sjg Exp $ -# Copyright (c) 2010-2013, Juniper Networks, Inc. +# Copyright (c) 2011-2020, Simon J. Gerraty +# Copyright (c) 2010-2018, Juniper Networks, Inc. # All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +# 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. +# 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. -# +# documentation and/or other materials provided with the distribution. +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -23,7 +24,7 @@ # 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. +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This makefile [re]generates ${.MAKE.DEPENDFILE} @@ -51,7 +52,7 @@ all: _CURDIR ?= ${.CURDIR} _OBJDIR ?= ${.OBJDIR} _OBJTOP ?= ${OBJTOP} -_OBJROOT ?= ${OBJROOT:U${_OBJTOP}} +_OBJROOT ?= ${OBJROOT:U${_OBJTOP:H}} .if ${_OBJROOT:M*/} _slash=/ .else @@ -104,7 +105,7 @@ GENDIRDEPS_FILTER += ${GENDIRDEPS_FILTER_DIR_VARS:@v@S GENDIRDEPS_FILTER += ${GENDIRDEPS_FILTER_VARS:@v@S,/${$v}/,/_{${v}}/,@:NS,//,*:u} .endif -# this (*should* be set in meta.sys.mk) +# this (*should* be set in meta.sys.mk) # is the script that extracts what we want. META2DEPS ?= ${.PARSEDIR}/meta2deps.sh META2DEPS := ${META2DEPS} @@ -122,7 +123,7 @@ _py_d = .if ${META2DEPS:E} == "py" # we can afford to do this all the time. DPDEPS ?= no -META2DEPS_CMD = ${_time} ${PYTHON} ${META2DEPS} ${_py_d} +META2DEPS_CMD = ${_time} ${PYTHON} ${META2DEPS} ${_py_d} .if ${DPDEPS:tl} != "no" META2DEPS_CMD += -D ${DPDEPS} .endif @@ -155,8 +156,8 @@ M2D_OBJROOTS += ${STAGE_ROOT} # and tell it not to add machine qualifiers META2DEPS_ARGS += MACHINE=none .endif -.if defined(SB_BACKING_SB) -META2DEPS_CMD += -S ${SB_BACKING_SB}/src +.if defined(SB_BACKING_SB) +META2DEPS_CMD += -S ${SB_BACKING_SB}/src M2D_OBJROOTS += ${SB_BACKING_SB}/${SB_OBJPREFIX} .endif @@ -177,7 +178,7 @@ _meta_files := ${META_FILES:N\*.meta:O:u} # assume a big list _meta_files_arg= @meta.list .if empty(_meta_files) && ${META_FILES:M\*.meta} != "" -# XXX this should be considered a bad idea, +# XXX this should be considered a bad idea, # since we cannot ignore stale .meta x != cd ${_OBJDIR} && find . -name '*.meta' -print -o \( -type d ! -name . -prune \) | sed 's,^./,,' > meta.list; echo .elif ${_meta_files:[#]} > 500 @@ -234,10 +235,10 @@ dir_list += ${ddeps} # DIRDEPS represent things that had to have been built first # so they should all be undir OBJTOP. -# Note that ${_OBJTOP}/bsd/include/machine will get reported +# Note that ${_OBJTOP}/bsd/include/machine will get reported # to us as $SRCTOP/bsd/sys/$MACHINE_ARCH/include meaning we # will want to visit bsd/include -# so we add +# so we add # ${"${dir_list:M*bsd/sys/${MACHINE_ARCH}/include}":?bsd/include:} # to GENDIRDEPS_DIR_LIST_XTRAS _objtops = ${OBJTOP} ${_OBJTOP} ${_objtop} @@ -272,11 +273,11 @@ DIRDEPS = \ # We only consider things below $RELDIR/ if they have a makefile. # This is the same test that _DIRDEP_USE applies. -# We have do a double test with dirdep_list as it _may_ contain +# We have do a double test with dirdep_list as it _may_ contain # qualified dirs - if we got anything from a stage dir. # qualdir_list we know are all qualified. # It would be nice do peform this check for all of DIRDEPS, -# but we cannot assume that all of the tree is present, +# but we cannot assume that all of the tree is present, # in fact we can only assume that RELDIR is. DIRDEPS += \ ${dirdep_list:M${RELDIR}/*:@d@${.MAKE.MAKEFILE_PREFERENCE:@m@${exists(${SRCTOP}/$d/$m):?$d:${exists(${SRCTOP}/${d:R}/$m):?$d:}}@}@} \ @@ -309,7 +310,7 @@ SRC_DIRDEPS = \ SRC_DIRDEPS := ${SRC_DIRDEPS:${GENDIRDEPS_SRC_FILTER:UN/*:ts:}:C,//+,/,g:O:u} # if you want to capture SRC_DIRDEPS in .MAKE.DEPENDFILE put -# SRC_DIRDEPS_FILE = ${_DEPENDFILE} +# SRC_DIRDEPS_FILE = ${_DEPENDFILE} # in local.gendirdeps.mk .if ${SRC_DIRDEPS_FILE:Uno:tl} != "no" ECHO_SRC_DIRDEPS = echo 'SRC_DIRDEPS = \'; echo '${SRC_DIRDEPS:@d@ $d \\${.newline}@}'; echo; @@ -324,7 +325,7 @@ ${SRC_DIRDEPS_FILE}: ${META_FILES} ${_this} ${META2DEP .endif .endif .endif -_include_src_dirdeps ?= +_include_src_dirdeps ?= all: ${_DEPENDFILE} @@ -339,6 +340,8 @@ CAT_DEPEND ?= .depend .PHONY: ${_DEPENDFILE} .endif +LOCAL_DEPENDS_GUARD ?= _{.MAKE.LEVEL} > 0 + # 'cat .depend' should suffice, but if we are mixing build modes # .depend may contain things we don't want. # The sed command at the end of the stream, allows for the filters @@ -350,7 +353,7 @@ ${_DEPENDFILE}: .NOMETA ${CAT_DEPEND:M.depend} ${META_ ${_include_src_dirdeps} \ echo '.include '; \ echo; \ - echo '.if $${DEP_RELDIR} == $${_DEP_RELDIR}'; \ + echo '.if ${LOCAL_DEPENDS_GUARD}'; \ echo '# local dependencies - needed for -jN in clean tree'; \ [ -s ${CAT_DEPEND} ] && { grep : ${CAT_DEPEND} | grep -v '[/\\]'; }; \ echo '.endif' ) | sed 's,_\([{(]\),$$\1,g' > $@.new${.MAKE.PID} Modified: head/share/mk/local.autodep.mk ============================================================================== --- head/share/mk/local.autodep.mk Tue Nov 24 21:28:44 2020 (r367998) +++ head/share/mk/local.autodep.mk Tue Nov 24 21:45:38 2020 (r367999) @@ -8,6 +8,9 @@ UPDATE_DEPENDFILE= no .endif .endif +NOSSPPICO?= .nossppico +OBJ_EXTENSIONS+= ${NOSSPPICO} + CFLAGS+= ${CFLAGS_LAST} CXXFLAGS+= ${CXXFLAGS_LAST} LDFLAGS+= ${LDFLAGS_LAST} Modified: head/share/mk/local.dirdeps.mk ============================================================================== --- head/share/mk/local.dirdeps.mk Tue Nov 24 21:28:44 2020 (r367998) +++ head/share/mk/local.dirdeps.mk Tue Nov 24 21:45:38 2020 (r367999) @@ -179,8 +179,6 @@ DIRDEPS+= usr.bin/yacc.host .endif _DPADD= ${DPADD} ${_PROGS_DPADD} .if !empty(_DPADD) -# Taken from meta.autodep.mk (where it only does something with -# BUILD_AT_LEVEL0, which we don't use). # This only works for DPADD with full OBJ/SRC paths, which is mostly just # _INTERNALLIBS. _DP_DIRDEPS= \ Modified: head/share/mk/local.gendirdeps.mk ============================================================================== --- head/share/mk/local.gendirdeps.mk Tue Nov 24 21:28:44 2020 (r367998) +++ head/share/mk/local.gendirdeps.mk Tue Nov 24 21:45:38 2020 (r367999) @@ -67,3 +67,6 @@ GENDIRDEPS_FILTER_VARS+= \ GENDIRDEPS_FILTER+= ${GENDIRDEPS_FILTER_DIR_VARS:@v@S,${$v},_{${v}},@} GENDIRDEPS_FILTER+= ${GENDIRDEPS_FILTER_VARS:@v@S,/${$v}/,/_{${v}}/,@:NS,//,*:u} + +# avoid churn for now +LOCAL_DEPENDS_GUARD= _{DEP_RELDIR} == _{_DEP_RELDIR} Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Tue Nov 24 21:28:44 2020 (r367998) +++ head/share/mk/local.meta.sys.mk Tue Nov 24 21:45:38 2020 (r367999) @@ -99,13 +99,10 @@ OBJTOP := ${HOST_OBJTOP} .if ${.MAKE.LEVEL} == 0 || empty(PYTHON) PYTHON ?= /usr/local/bin/python .export PYTHON -# this works best if share/mk is ready for it. -BUILD_AT_LEVEL0= no # _SKIP_BUILD is not 100% as it requires wrapping all 'all:' targets to avoid # building in MAKELEVEL0. Just prohibit 'all' entirely in this case to avoid # problems. -.if ${MK_DIRDEPS_BUILD} == "yes" && \ - ${.MAKE.LEVEL} == 0 && ${BUILD_AT_LEVEL0:Uyes:tl} == "no" +.if ${MK_DIRDEPS_BUILD} == "yes" && ${.MAKE.LEVEL} == 0 .MAIN: dirdeps .if make(all) .error DIRDEPS_BUILD: Please run '${MAKE}' instead of '${MAKE} all'. Modified: head/share/mk/meta.autodep.mk ============================================================================== --- head/share/mk/meta.autodep.mk Tue Nov 24 21:28:44 2020 (r367998) +++ head/share/mk/meta.autodep.mk Tue Nov 24 21:45:38 2020 (r367999) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: meta.autodep.mk,v 1.50 2018/06/08 01:25:31 sjg Exp $ +# $Id: meta.autodep.mk,v 1.53 2020/11/08 05:47:56 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -22,11 +22,10 @@ __${_this}__: .NOTMAIN .-include PICO?= .pico -NOSSPPICO?= .nossppico .if defined(SRCS) # it would be nice to be able to query .SUFFIXES -OBJ_EXTENSIONS+= .o .po .lo ${PICO} ${NOSSPPICO} +OBJ_EXTENSIONS+= .o .po .lo ${PICO} # explicit dependencies help short-circuit .SUFFIX searches SRCS_DEP_FILTER+= N*.[hly] @@ -59,7 +58,7 @@ _OBJTOP ?= ${OBJTOP} _OBJROOT ?= ${OBJROOT:U${_OBJTOP}} _DEPENDFILE := ${_CURDIR}/${.MAKE.DEPENDFILE:T} -.if ${.MAKE.LEVEL} > 0 || ${BUILD_AT_LEVEL0:Uyes:tl} == "yes" +.if ${.MAKE.LEVEL} > 0 # do not allow auto update if we ever built this dir without filemon NO_FILEMON_COOKIE = .nofilemon CLEANFILES += ${NO_FILEMON_COOKIE} @@ -75,10 +74,8 @@ UPDATE_DEPENDFILE = NO .endif .if ${.MAKE.LEVEL} == 0 -.if ${BUILD_AT_LEVEL0:Uyes:tl} == "no" UPDATE_DEPENDFILE = NO .endif -.endif .if !exists(${_DEPENDFILE}) _bootstrap_dirdeps = yes .endif @@ -182,7 +179,8 @@ DEPEND_SUFFIXES += .c .h .cpp .hpp .cxx .hxx .cc .hh @case "${.MAKE.META.FILES:T:M*.po.*}" in \ *.po.*) mv $@.${.MAKE.PID} $@;; \ *) { cat $@.${.MAKE.PID}; \ - sed 's,\${NOSSPPICO}:,.o:,;s,\${PICO}:,.o:,;s,\.o:,.po:,' $@.${.MAKE.PID}; } | sort -u > $@; \ + sed ${OBJ_EXTENSIONS:N.o:N.po:@o@-e 's,\$o:,.o:,'@} \ + -e 's,\.o:,.po:,' $@.${.MAKE.PID}; } | sort -u > $@; \ rm -f $@.${.MAKE.PID};; \ esac .else @@ -285,9 +283,7 @@ ${_DEPENDFILE}: ${_depend} ${.PARSEDIR}/gendirdeps.mk .endif .if ${_bootstrap_dirdeps} == "yes" -.if ${BUILD_AT_LEVEL0:Uno} == "no" DIRDEPS+= ${RELDIR}.${TARGET_SPEC:U${MACHINE}} -.endif # make sure this is included at least once .include .else @@ -314,7 +310,7 @@ _reldir_finish: .NOMETA _reldir_failed: .NOMETA @echo "${TIME_STAMP} Failed ${RELDIR}.${TARGET_SPEC} seconds=$$(( ${now_utc} - ${start_utc} )) ${meta_stats}" -.if defined(WITH_META_STATS) && ${.MAKE.LEVEL} > 0 +.if !defined(WITHOUT_META_STATS) && ${.MAKE.LEVEL} > 0 .END: _reldir_finish .ERROR: _reldir_failed .endif Modified: head/share/mk/meta.stage.mk ============================================================================== --- head/share/mk/meta.stage.mk Tue Nov 24 21:28:44 2020 (r367998) +++ head/share/mk/meta.stage.mk Tue Nov 24 21:45:38 2020 (r367999) @@ -1,15 +1,15 @@ # $FreeBSD$ -# $Id: meta.stage.mk,v 1.55 2017/10/27 01:17:09 sjg Exp $ +# $Id: meta.stage.mk,v 1.60 2020/08/19 17:51:53 sjg Exp $ # # @(#) Copyright (c) 2011-2017, Simon J. Gerraty # # This file is provided in the hope that it will # be of use. There is absolutely NO WARRANTY. # Permission to copy, redistribute or otherwise -# use this file is hereby granted provided that +# use this file is hereby granted provided that # the above copyright notice and this notice are -# left intact. -# +# left intact. +# # Please send copies of changes and bug-fixes to: # sjg@crufty.net # @@ -19,9 +19,11 @@ .if !target(__${.PARSEFILE}__) # the guard target is defined later +.-include + .if ${.MAKE.DEPENDFILE_PREFERENCE:U${.MAKE.DEPENDFILE}:M*.${MACHINE}} != "" # this is generally safer anyway -_dirdep ?= ${RELDIR}.${MACHINE} +_dirdep ?= ${RELDIR}.${TARGET_SPEC:U${MACHINE}} .else _dirdep ?= ${RELDIR} .endif @@ -68,7 +70,7 @@ LN_CP_SCRIPT = LnCp() { \ # a warning is handy when bootstapping different options. STAGE_CONFLICT?= ERROR .if ${STAGE_CONFLICT:tl} == "error" -STAGE_CONFLICT_ACTION= exit 1; +STAGE_CONFLICT_ACTION= exit 1 .else STAGE_CONFLICT_ACTION= .endif @@ -79,8 +81,10 @@ STAGE_DIRDEP_SCRIPT = ${LN_CP_SCRIPT}; StageDirdep() { t=$$1; \ if [ -s $$t.dirdep ]; then \ cmp -s .dirdep $$t.dirdep && return; \ - echo "${STAGE_CONFLICT}: $$t installed by `cat $$t.dirdep` not ${_dirdep}" >&2; \ - ${STAGE_CONFLICT_ACTION} \ + x=`cat $$t.dirdep`; \ + case "${RELDIR}:${_dirdep}" in $${x%.*}:$${x}*) ;; \ + *) echo "${STAGE_CONFLICT}: $$t installed by $$x not ${_dirdep}" >&2; \ + ${STAGE_CONFLICT_ACTION} ;; esac; \ fi; \ LnCp .dirdep $$t.dirdep || exit 1; } @@ -142,7 +146,7 @@ _STAGE_AS_BASENAME_USE: .USE .dirdep ${.TARGET: .if !empty(STAGE_INCSDIR) .if !empty(STAGE_INCS) -stage_incs: ${STAGE_INCS} +stage_incs: ${STAGE_INCS:N*\**} .endif .if target(stage_incs) || !empty(.ALLTARGETS:Mstage_includes) STAGE_TARGETS += stage_incs @@ -157,7 +161,7 @@ stage_incs: .dirdep .if !empty(STAGE_LIBDIR) .if !empty(STAGE_LIBS) -stage_libs: ${STAGE_LIBS} +stage_libs: ${STAGE_LIBS:N*\**} .endif .if target(stage_libs) STAGE_TARGETS += stage_libs @@ -192,7 +196,7 @@ CLEANFILES += ${STAGE_SETS:@s@stage*$s@} # some makefiles need to populate multiple directories .for s in ${STAGE_SETS:O:u} .if !empty(STAGE_FILES.$s) -stage_files.$s: ${STAGE_FILES.$s} +stage_files.$s: ${STAGE_FILES.$s:N*\**} .endif .if target(stage_files.$s) || target(stage_files${s:S,^,.,:N._default}) STAGE_TARGETS += stage_files @@ -206,7 +210,7 @@ stage_files.$s: .dirdep STAGE_FILES ?= ${.ALLSRC:N.dirdep:Nstage_*} stage_files: .dirdep .endif - @${STAGE_FILE_SCRIPT}; StageFiles ${FLAGS.$@} ${STAGE_FILES_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_FILES.$s} + @${STAGE_FILE_SCRIPT}; StageFiles ${FLAGS.$@} ${STAGE_FILES_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_FILES.$s:O} @touch $@ .endif .endif @@ -263,7 +267,7 @@ CLEANFILES += ${STAGE_AS_SETS:@s@stage*$s@} # both operations happen together .for s in ${STAGE_AS_SETS:O:u} .if !empty(STAGE_AS.$s) -stage_as.$s: ${STAGE_AS.$s} +stage_as.$s: ${STAGE_AS.$s:N*\**} .endif .if target(stage_as.$s) STAGE_TARGETS += stage_as @@ -272,13 +276,13 @@ STAGE_AS.$s ?= ${.ALLSRC:N.dirdep:Nstage_*} .stage_as.$s: stage_as: stage_as.$s stage_as.$s: .dirdep - @${STAGE_AS_SCRIPT}; StageAs ${FLAGS.$@} ${STAGE_FILES_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_AS.$s:@f@$f ${STAGE_AS_${f:tA}:U${STAGE_AS_${f:T}:U${f:T}}}@} + @${STAGE_AS_SCRIPT}; StageAs ${FLAGS.$@} ${STAGE_FILES_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_AS.$s:O:@f@$f ${STAGE_AS_${f:tA}:U${STAGE_AS_${f:T}:U${f:T}}}@} @touch $@ .endif .endif .if !empty(STAGE_AS_AND_SYMLINK.$s) -stage_as_and_symlink.$s: ${STAGE_AS_AND_SYMLINK.$s} +stage_as_and_symlink.$s: ${STAGE_AS_AND_SYMLINK.$s:N*\**} .endif .if target(stage_as_and_symlink.$s) STAGE_TARGETS += stage_as_and_symlink @@ -287,8 +291,8 @@ STAGE_AS_AND_SYMLINK.$s ?= ${.ALLSRC:N.dirdep:Nstage_* .stage_as_and_symlink.$s: stage_as_and_symlink: stage_as_and_symlink.$s stage_as_and_symlink.$s: .dirdep - @${STAGE_AS_SCRIPT}; StageAs ${FLAGS.$@} ${STAGE_FILES_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_AS_AND_SYMLINK.$s:@f@$f ${STAGE_AS_${f:tA}:U${STAGE_AS_${f:T}:U${f:T}}}@} - @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_FILES_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_AS_AND_SYMLINK.$s:@f@${STAGE_AS_${f:tA}:U${STAGE_AS_${f:T}:U${f:T}}} $f@} + @${STAGE_AS_SCRIPT}; StageAs ${FLAGS.$@} ${STAGE_FILES_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_AS_AND_SYMLINK.$s:O:@f@$f ${STAGE_AS_${f:tA}:U${STAGE_AS_${f:T}:U${f:T}}}@} + @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_FILES_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_AS_AND_SYMLINK.$s:O:@f@${STAGE_AS_${f:tA}:U${STAGE_AS_${f:T}:U${f:T}}} $f@} @touch $@ .endif .endif Modified: head/share/mk/meta.subdir.mk ============================================================================== --- head/share/mk/meta.subdir.mk Tue Nov 24 21:28:44 2020 (r367998) +++ head/share/mk/meta.subdir.mk Tue Nov 24 21:45:38 2020 (r367999) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: meta.subdir.mk,v 1.11 2015/11/24 22:26:51 sjg Exp $ +# $Id: meta.subdir.mk,v 1.12 2020/08/19 17:51:53 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -7,10 +7,10 @@ # This file is provided in the hope that it will # be of use. There is absolutely NO WARRANTY. # Permission to copy, redistribute or otherwise -# use this file is hereby granted provided that +# use this file is hereby granted provided that # the above copyright notice and this notice are -# left intact. -# +# left intact. +# # Please send copies of changes and bug-fixes to: # sjg@crufty.net # @@ -33,7 +33,7 @@ DIRDEPS = ${SUBDIR:N.WAIT:O:u:@d@${RELDIR}/$d@} .include .else # this is the cunning bit -# actually it is probably a bit risky +# actually it is probably a bit risky *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Nov 24 22:10:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E30C546C14C; Tue, 24 Nov 2020 22:10:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgdWF68Yfz3NWP; Tue, 24 Nov 2020 22:10:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C607225D7D; Tue, 24 Nov 2020 22:10:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AOMAX9a083213; Tue, 24 Nov 2020 22:10:33 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOMAXrK083211; Tue, 24 Nov 2020 22:10:33 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202011242210.0AOMAXrK083211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 24 Nov 2020 22:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368000 - head/lib/libfetch X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/lib/libfetch X-SVN-Commit-Revision: 368000 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 22:10:34 -0000 Author: jkim Date: Tue Nov 24 22:10:33 2020 New Revision: 368000 URL: https://svnweb.freebsd.org/changeset/base/368000 Log: Remove support for SSLv3 from fetch(3). Support for SSLv3 was already removed from OpenSSL (r361392). Differential Revision: https://reviews.freebsd.org/D24947 Modified: head/lib/libfetch/common.c head/lib/libfetch/fetch.3 Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Tue Nov 24 21:45:38 2020 (r367999) +++ head/lib/libfetch/common.c Tue Nov 24 22:10:33 2020 (r368000) @@ -1054,9 +1054,7 @@ fetch_ssl_setup_transport_layer(SSL_CTX *ctx, int verb { long ssl_ctx_options; - ssl_ctx_options = SSL_OP_ALL | SSL_OP_NO_SSLv2 | SSL_OP_NO_TICKET; - if (getenv("SSL_ALLOW_SSL3") == NULL) - ssl_ctx_options |= SSL_OP_NO_SSLv3; + ssl_ctx_options = SSL_OP_ALL | SSL_OP_NO_SSLv3 | SSL_OP_NO_TICKET; if (getenv("SSL_NO_TLS1") != NULL) ssl_ctx_options |= SSL_OP_NO_TLSv1; if (getenv("SSL_NO_TLS1_1") != NULL) Modified: head/lib/libfetch/fetch.3 ============================================================================== --- head/lib/libfetch/fetch.3 Tue Nov 24 21:45:38 2020 (r367999) +++ head/lib/libfetch/fetch.3 Tue Nov 24 22:10:33 2020 (r368000) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 28, 2019 +.Dd November 24, 2020 .Dt FETCH 3 .Os .Sh NAME @@ -465,12 +465,10 @@ By default allows TLSv1 and newer when negotiating the connecting with the remote peer. You can change this behavior by setting the -.Ev SSL_ALLOW_SSL3 -environment variable to allow SSLv3 and .Ev SSL_NO_TLS1 , .Ev SSL_NO_TLS1_1 and .Ev SSL_NO_TLS1_2 -to disable TLS 1.0, 1.1 and 1.2 respectively. +environment variables to disable TLS 1.0, 1.1 and 1.2 respectively. .Sh AUTHENTICATION Apart from setting the appropriate environment variables and specifying the user name and password in the URL or the @@ -675,8 +673,6 @@ IPv6 addresses must enclose the address in brackets. If no port is specified, the default is 1080. This setting will supercede a connection to an .Ev HTTP_PROXY . -.It Ev SSL_ALLOW_SSL3 -Allow SSL version 3 when negotiating the connection (not recommended). .It Ev SSL_CA_CERT_FILE CA certificate bundle containing trusted CA certificates. Default value: See HTTPS SCHEME above. From owner-svn-src-all@freebsd.org Tue Nov 24 22:43:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFCBF46CF3F; Tue, 24 Nov 2020 22:43:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgfFD55ndz3QFN; Tue, 24 Nov 2020 22:43:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A12182667F; Tue, 24 Nov 2020 22:43:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AOMhSMm008023; Tue, 24 Nov 2020 22:43:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOMhRGt008019; Tue, 24 Nov 2020 22:43:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011242243.0AOMhRGt008019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 24 Nov 2020 22:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368001 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 368001 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 22:43:28 -0000 Author: mav Date: Tue Nov 24 22:43:27 2020 New Revision: 368001 URL: https://svnweb.freebsd.org/changeset/base/368001 Log: Remove more legacy of parallel SCSI. Modified: head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/isp_pci.c head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Tue Nov 24 22:10:33 2020 (r368000) +++ head/sys/dev/isp/isp_freebsd.c Tue Nov 24 22:43:27 2020 (r368001) @@ -109,6 +109,11 @@ isp_role_sysctl(SYSCTL_HANDLER_ARGS) static int isp_attach_chan(ispsoftc_t *isp, struct cam_devq *devq, int chan) { + fcparam *fcp = FCPARAM(isp, chan); + struct isp_fc *fc = ISP_FC_PC(isp, chan); + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(isp->isp_osinfo.dev); + struct sysctl_oid *tree = device_get_sysctl_tree(isp->isp_osinfo.dev); + char name[16]; struct cam_sim *sim; struct cam_path *path; #ifdef ISP_TARGET_MODE @@ -131,12 +136,6 @@ isp_attach_chan(ispsoftc_t *isp, struct cam_devq *devq return (ENXIO); } - fcparam *fcp = FCPARAM(isp, chan); - struct isp_fc *fc = ISP_FC_PC(isp, chan); - struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(isp->isp_osinfo.dev); - struct sysctl_oid *tree = device_get_sysctl_tree(isp->isp_osinfo.dev); - char name[16]; - ISP_LOCK(isp); fc->sim = sim; fc->path = path; @@ -221,22 +220,16 @@ isp_attach_chan(ispsoftc_t *isp, struct cam_devq *devq static void isp_detach_chan(ispsoftc_t *isp, int chan) { - struct cam_sim *sim; - struct cam_path *path; - int *num_threads; + struct isp_fc *fc = ISP_FC_PC(isp, chan); - ISP_GET_PC(isp, chan, sim, sim); - ISP_GET_PC(isp, chan, path, path); - ISP_GET_PC_ADDR(isp, chan, num_threads, num_threads); + xpt_free_path(fc->path); + xpt_bus_deregister(cam_sim_path(fc->sim)); + cam_sim_free(fc->sim, FALSE); - xpt_free_path(path); - xpt_bus_deregister(cam_sim_path(sim)); - cam_sim_free(sim, FALSE); - /* Wait for the channel's spawned threads to exit. */ - wakeup(isp->isp_osinfo.pc.ptr); - while (*num_threads != 0) - mtx_sleep(isp, &isp->isp_lock, PRIBIO, "isp_reap", 100); + wakeup(fc); + while (fc->num_threads != 0) + mtx_sleep(&fc->num_threads, &isp->isp_lock, PRIBIO, "isp_reap", 0); } int @@ -271,16 +264,11 @@ isp_attach(ispsoftc_t *isp) return (0); unwind: - while (--chan >= 0) { - struct cam_sim *sim; - struct cam_path *path; - - ISP_GET_PC(isp, chan, sim, sim); - ISP_GET_PC(isp, chan, path, path); - xpt_free_path(path); - xpt_bus_deregister(cam_sim_path(sim)); - cam_sim_free(sim, FALSE); - } + ISP_LOCK(isp); + isp->isp_osinfo.is_exiting = 1; + while (--chan >= 0) + isp_detach_chan(isp, chan); + ISP_UNLOCK(isp); cam_simq_free(isp->isp_osinfo.devq); isp->isp_osinfo.devq = NULL; return (-1); @@ -673,7 +661,7 @@ static void isp_put_atpd(ispsoftc_t *, int, atio_priva static inot_private_data_t *isp_get_ntpd(ispsoftc_t *, int); static inot_private_data_t *isp_find_ntpd(ispsoftc_t *, int, uint32_t, uint32_t); static void isp_put_ntpd(ispsoftc_t *, int, inot_private_data_t *); -static cam_status create_lun_state(ispsoftc_t *, int, struct cam_path *, tstate_t **); +static tstate_t *create_lun_state(ispsoftc_t *, int, struct cam_path *); static void destroy_lun_state(ispsoftc_t *, int, tstate_t *); static void isp_enable_lun(ispsoftc_t *, union ccb *); static void isp_disable_lun(ispsoftc_t *, union ccb *); @@ -690,15 +678,12 @@ static void isp_target_mark_aborted_early(ispsoftc_t * static ISP_INLINE tstate_t * get_lun_statep(ispsoftc_t *isp, int bus, lun_id_t lun) { - tstate_t *tptr = NULL; - struct tslist *lhp; + struct isp_fc *fc = ISP_FC_PC(isp, bus); + tstate_t *tptr; - if (bus < isp->isp_nchan) { - ISP_GET_PC_ADDR(isp, bus, lun_hash[LUN_HASH_FUNC(lun)], lhp); - SLIST_FOREACH(tptr, lhp, next) { - if (tptr->ts_lun == lun) - return (tptr); - } + SLIST_FOREACH(tptr, &fc->lun_hash[LUN_HASH_FUNC(lun)], next) { + if (tptr->ts_lun == lun) + return (tptr); } return (NULL); } @@ -733,26 +718,24 @@ isp_atio_restart(ispsoftc_t *isp, int bus, tstate_t *t static void isp_tmcmd_restart(ispsoftc_t *isp) { + struct isp_fc *fc; tstate_t *tptr; union ccb *ccb; - struct tslist *lhp; - struct isp_ccbq *waitq; int bus, i; for (bus = 0; bus < isp->isp_nchan; bus++) { + fc = ISP_FC_PC(isp, bus); for (i = 0; i < LUN_HASH_SIZE; i++) { - ISP_GET_PC_ADDR(isp, bus, lun_hash[i], lhp); - SLIST_FOREACH(tptr, lhp, next) + SLIST_FOREACH(tptr, &fc->lun_hash[i], next) isp_atio_restart(isp, bus, tptr); } /* * We only need to do this once per channel. */ - ISP_GET_PC_ADDR(isp, bus, waitq, waitq); - ccb = (union ccb *)TAILQ_FIRST(waitq); + ccb = (union ccb *)TAILQ_FIRST(&fc->waitq); if (ccb != NULL) { - TAILQ_REMOVE(waitq, &ccb->ccb_h, sim_links.tqe); + TAILQ_REMOVE(&fc->waitq, &ccb->ccb_h, sim_links.tqe); isp_target_start_ctio(isp, ccb, FROM_TIMER); } } @@ -763,17 +746,14 @@ isp_tmcmd_restart(ispsoftc_t *isp) static atio_private_data_t * isp_get_atpd(ispsoftc_t *isp, int chan, uint32_t tag) { - struct atpdlist *atfree; - struct atpdlist *atused; + struct isp_fc *fc = ISP_FC_PC(isp, chan); atio_private_data_t *atp; - ISP_GET_PC_ADDR(isp, chan, atfree, atfree); - atp = LIST_FIRST(atfree); + atp = LIST_FIRST(&fc->atfree); if (atp) { LIST_REMOVE(atp, next); atp->tag = tag; - ISP_GET_PC(isp, chan, atused, atused); - LIST_INSERT_HEAD(&atused[ATPDPHASH(tag)], atp, next); + LIST_INSERT_HEAD(&fc->atused[ATPDPHASH(tag)], atp, next); } return (atp); } @@ -781,11 +761,10 @@ isp_get_atpd(ispsoftc_t *isp, int chan, uint32_t tag) static atio_private_data_t * isp_find_atpd(ispsoftc_t *isp, int chan, uint32_t tag) { - struct atpdlist *atused; + struct isp_fc *fc = ISP_FC_PC(isp, chan); atio_private_data_t *atp; - ISP_GET_PC(isp, chan, atused, atused); - LIST_FOREACH(atp, &atused[ATPDPHASH(tag)], next) { + LIST_FOREACH(atp, &fc->atused[ATPDPHASH(tag)], next) { if (atp->tag == tag) return (atp); } @@ -795,25 +774,23 @@ isp_find_atpd(ispsoftc_t *isp, int chan, uint32_t tag) static void isp_put_atpd(ispsoftc_t *isp, int chan, atio_private_data_t *atp) { - struct atpdlist *atfree; + struct isp_fc *fc = ISP_FC_PC(isp, chan); - if (atp->ests) { + if (atp->ests) isp_put_ecmd(isp, atp->ests); - } LIST_REMOVE(atp, next); memset(atp, 0, sizeof (*atp)); - ISP_GET_PC_ADDR(isp, chan, atfree, atfree); - LIST_INSERT_HEAD(atfree, atp, next); + LIST_INSERT_HEAD(&fc->atfree, atp, next); } static void isp_dump_atpd(ispsoftc_t *isp, int chan) { - atio_private_data_t *atp, *atpool; + struct isp_fc *fc = ISP_FC_PC(isp, chan); + atio_private_data_t *atp; const char *states[8] = { "Free", "ATIO", "CAM", "CTIO", "LAST_CTIO", "PDON", "?6", "7" }; - ISP_GET_PC(isp, chan, atpool, atpool); - for (atp = atpool; atp < &atpool[ATPDPSIZE]; atp++) { + for (atp = fc->atpool; atp < &fc->atpool[ATPDPSIZE]; atp++) { if (atp->state == ATPD_STATE_FREE) continue; isp_prt(isp, ISP_LOGALL, "Chan %d ATP [0x%x] origdlen %u bytes_xfrd %u lun %jx nphdl 0x%04x s_id 0x%06x d_id 0x%06x oxid 0x%04x state %s", @@ -824,24 +801,22 @@ isp_dump_atpd(ispsoftc_t *isp, int chan) static inot_private_data_t * isp_get_ntpd(ispsoftc_t *isp, int chan) { - struct ntpdlist *ntfree; + struct isp_fc *fc = ISP_FC_PC(isp, chan); inot_private_data_t *ntp; - ISP_GET_PC_ADDR(isp, chan, ntfree, ntfree); - ntp = STAILQ_FIRST(ntfree); + ntp = STAILQ_FIRST(&fc->ntfree); if (ntp) - STAILQ_REMOVE_HEAD(ntfree, next); + STAILQ_REMOVE_HEAD(&fc->ntfree, next); return (ntp); } static inot_private_data_t * isp_find_ntpd(ispsoftc_t *isp, int chan, uint32_t tag_id, uint32_t seq_id) { - inot_private_data_t *ntp, *ntp2; + struct isp_fc *fc = ISP_FC_PC(isp, chan); + inot_private_data_t *ntp; - ISP_GET_PC(isp, chan, ntpool, ntp); - ISP_GET_PC_ADDR(isp, chan, ntpool[ATPDPSIZE], ntp2); - for (; ntp < ntp2; ntp++) { + for (ntp = fc->ntpool; ntp < &fc->ntpool[ATPDPSIZE]; ntp++) { if (ntp->tag_id == tag_id && ntp->seq_id == seq_id) return (ntp); } @@ -851,41 +826,37 @@ isp_find_ntpd(ispsoftc_t *isp, int chan, uint32_t tag_ static void isp_put_ntpd(ispsoftc_t *isp, int chan, inot_private_data_t *ntp) { - struct ntpdlist *ntfree; + struct isp_fc *fc = ISP_FC_PC(isp, chan); ntp->tag_id = ntp->seq_id = 0; - ISP_GET_PC_ADDR(isp, chan, ntfree, ntfree); - STAILQ_INSERT_HEAD(ntfree, ntp, next); + STAILQ_INSERT_HEAD(&fc->ntfree, ntp, next); } -static cam_status -create_lun_state(ispsoftc_t *isp, int bus, struct cam_path *path, tstate_t **rslt) +tstate_t * +create_lun_state(ispsoftc_t *isp, int bus, struct cam_path *path) { + struct isp_fc *fc = ISP_FC_PC(isp, bus); lun_id_t lun; - struct tslist *lhp; tstate_t *tptr; lun = xpt_path_lun_id(path); tptr = malloc(sizeof (tstate_t), M_DEVBUF, M_NOWAIT|M_ZERO); - if (tptr == NULL) { - return (CAM_RESRC_UNAVAIL); - } + if (tptr == NULL) + return (NULL); tptr->ts_lun = lun; SLIST_INIT(&tptr->atios); SLIST_INIT(&tptr->inots); STAILQ_INIT(&tptr->restart_queue); - ISP_GET_PC_ADDR(isp, bus, lun_hash[LUN_HASH_FUNC(lun)], lhp); - SLIST_INSERT_HEAD(lhp, tptr, next); - *rslt = tptr; + SLIST_INSERT_HEAD(&fc->lun_hash[LUN_HASH_FUNC(lun)], tptr, next); ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, path, "created tstate\n"); - return (CAM_REQ_CMP); + return (tptr); } static void destroy_lun_state(ispsoftc_t *isp, int bus, tstate_t *tptr) { + struct isp_fc *fc = ISP_FC_PC(isp, bus); union ccb *ccb; - struct tslist *lhp; inot_private_data_t *ntp; while ((ccb = (union ccb *)SLIST_FIRST(&tptr->atios)) != NULL) { @@ -903,8 +874,7 @@ destroy_lun_state(ispsoftc_t *isp, int bus, tstate_t * STAILQ_REMOVE_HEAD(&tptr->restart_queue, next); isp_put_ntpd(isp, bus, ntp); } - ISP_GET_PC_ADDR(isp, bus, lun_hash[LUN_HASH_FUNC(tptr->ts_lun)], lhp); - SLIST_REMOVE(lhp, tptr, tstate, next); + SLIST_REMOVE(&fc->lun_hash[LUN_HASH_FUNC(tptr->ts_lun)], tptr, tstate, next); free(tptr, M_DEVBUF); } @@ -912,17 +882,14 @@ static void isp_enable_lun(ispsoftc_t *isp, union ccb *ccb) { tstate_t *tptr; - int bus; - target_id_t target; - lun_id_t lun; + int bus = XS_CHANNEL(ccb); + target_id_t target = ccb->ccb_h.target_id; + lun_id_t lun = ccb->ccb_h.target_lun; /* * We only support either target and lun both wildcard * or target and lun both non-wildcard. */ - bus = XS_CHANNEL(ccb); - target = ccb->ccb_h.target_id; - lun = ccb->ccb_h.target_lun; ISP_PATH_PRT(isp, ISP_LOGTDEBUG0|ISP_LOGCONFIG, ccb->ccb_h.path, "enabling lun %jx\n", (uintmax_t)lun); if ((target == CAM_TARGET_WILDCARD) != (lun == CAM_LUN_WILDCARD)) { @@ -938,8 +905,9 @@ isp_enable_lun(ispsoftc_t *isp, union ccb *ccb) xpt_done(ccb); return; } - ccb->ccb_h.status = create_lun_state(isp, bus, ccb->ccb_h.path, &tptr); - if (ccb->ccb_h.status != CAM_REQ_CMP) { + tptr = create_lun_state(isp, bus, ccb->ccb_h.path); + if (tptr == NULL) { + ccb->ccb_h.status = CAM_RESRC_UNAVAIL; xpt_done(ccb); return; } @@ -951,14 +919,11 @@ isp_enable_lun(ispsoftc_t *isp, union ccb *ccb) static void isp_disable_lun(ispsoftc_t *isp, union ccb *ccb) { - tstate_t *tptr = NULL; - int bus; - target_id_t target; - lun_id_t lun; + tstate_t *tptr; + int bus = XS_CHANNEL(ccb); + target_id_t target = ccb->ccb_h.target_id; + lun_id_t lun = ccb->ccb_h.target_lun; - bus = XS_CHANNEL(ccb); - target = ccb->ccb_h.target_id; - lun = ccb->ccb_h.target_lun; ISP_PATH_PRT(isp, ISP_LOGTDEBUG0|ISP_LOGCONFIG, ccb->ccb_h.path, "disabling lun %jx\n", (uintmax_t)lun); if ((target == CAM_TARGET_WILDCARD) != (lun == CAM_LUN_WILDCARD)) { @@ -993,7 +958,7 @@ isp_target_start_ctio(ispsoftc_t *isp, union ccb *ccb, isp_prt(isp, ISP_LOGTDEBUG0, "%s: ENTRY[0x%x] how %u xfrlen %u sendstatus %d sense_len %u", __func__, ccb->csio.tag_id, how, ccb->csio.dxfer_len, (ccb->ccb_h.flags & CAM_SEND_STATUS) != 0, ((ccb->ccb_h.flags & CAM_SEND_SENSE)? ccb->csio.sense_len : 0)); - ISP_GET_PC_ADDR(isp, XS_CHANNEL(ccb), waitq, waitq); + waitq = &ISP_FC_PC(isp, XS_CHANNEL(ccb))->waitq; switch (how) { case FROM_CAM: /* @@ -1971,7 +1936,8 @@ bad: static void isp_target_mark_aborted_early(ispsoftc_t *isp, int chan, tstate_t *tptr, uint32_t tag_id) { - atio_private_data_t *atp, *atpool; + struct isp_fc *fc = ISP_FC_PC(isp, chan); + atio_private_data_t *atp; inot_private_data_t *ntp, *tmp; uint32_t this_tag_id; @@ -1992,8 +1958,7 @@ isp_target_mark_aborted_early(ispsoftc_t *isp, int cha /* * Now mark other ones dead as well. */ - ISP_GET_PC(isp, chan, atpool, atpool); - for (atp = atpool; atp < &atpool[ATPDPSIZE]; atp++) { + for (atp = fc->atpool; atp < &fc->atpool[ATPDPSIZE]; atp++) { if (atp->lun != tptr->ts_lun) continue; if ((uint64_t)tag_id == TAG_ANY || atp->tag == tag_id) @@ -2131,7 +2096,7 @@ isp_gdt_task(void *arg, int pending) { struct isp_fc *fc = arg; ispsoftc_t *isp = fc->isp; - int chan = fc - isp->isp_osinfo.pc.fc; + int chan = fc - ISP_FC_PC(isp, 0); fcportdb_t *lp; struct ac_contract ac; struct ac_device_changed *adc; @@ -2294,7 +2259,7 @@ isp_kthread(void *arg) { struct isp_fc *fc = arg; ispsoftc_t *isp = fc->isp; - int chan = fc - isp->isp_osinfo.pc.fc; + int chan = fc - ISP_FC_PC(isp, 0); int slp = 0, d; int lb, lim; @@ -2355,6 +2320,7 @@ isp_kthread(void *arg) msleep(fc, &isp->isp_lock, PRIBIO, "ispf", slp * hz); } fc->num_threads -= 1; + wakeup(&fc->num_threads); ISP_UNLOCK(isp); kthread_exit(); } @@ -3359,13 +3325,12 @@ isp_nanotime_sub(struct timespec *b, struct timespec * int isp_fc_scratch_acquire(ispsoftc_t *isp, int chan) { - int ret = 0; - if (isp->isp_osinfo.pc.fc[chan].fcbsy) { - ret = -1; - } else { - isp->isp_osinfo.pc.fc[chan].fcbsy = 1; - } - return (ret); + struct isp_fc *fc = ISP_FC_PC(isp, chan); + + if (fc->fcbsy) + return (-1); + fc->fcbsy = 1; + return (0); } void @@ -3533,7 +3498,7 @@ isp_fcp_next_crn(ispsoftc_t *isp, uint8_t *crnp, XS_T chan = XS_CHANNEL(cmd); tgt = XS_TGT(cmd); lun = XS_LUN(cmd); - fc = &isp->isp_osinfo.pc.fc[chan]; + fc = ISP_FC_PC(isp, chan); idx = NEXUS_HASH(tgt, lun); nxp = fc->nexus_hash[idx]; Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Tue Nov 24 22:10:33 2020 (r368000) +++ head/sys/dev/isp/isp_freebsd.h Tue Nov 24 22:43:27 2020 (r368001) @@ -286,22 +286,13 @@ struct isposinfo { #endif /* - * Per-type private storage... + * Per-channel storage. */ - union { - struct isp_fc *fc; - void *ptr; - } pc; + struct isp_fc *fc; int is_exiting; }; -#define ISP_FC_PC(isp, chan) (&(isp)->isp_osinfo.pc.fc[(chan)]) -#define ISP_GET_PC(isp, chan, tag, rslt) \ - rslt = ISP_FC_PC(isp, chan)->tag -#define ISP_GET_PC_ADDR(isp, chan, tag, rp) \ - rp = &ISP_FC_PC(isp, chan)->tag -#define ISP_SET_PC(isp, chan, tag, val) \ - ISP_FC_PC(isp, chan)-> tag = val +#define ISP_FC_PC(isp, chan) (&(isp)->isp_osinfo.fc[(chan)]) #define FCP_NEXT_CRN isp_fcp_next_crn #define isp_lock isp_osinfo.lock @@ -424,7 +415,7 @@ default: \ } #define FC_SCRATCH_ACQUIRE isp_fc_scratch_acquire -#define FC_SCRATCH_RELEASE(isp, chan) isp->isp_osinfo.pc.fc[chan].fcbsy = 0 +#define FC_SCRATCH_RELEASE(isp, chan) ISP_FC_PC(isp, chan)->fcbsy = 0 #ifndef SCSI_GOOD #define SCSI_GOOD SCSI_STATUS_OK @@ -537,7 +528,7 @@ default: \ #define DEFAULT_ROLE(isp, chan) ISP_FC_PC(isp, chan)->def_role -#define DEFAULT_LOOPID(x, chan) isp->isp_osinfo.pc.fc[chan].default_id +#define DEFAULT_LOOPID(isp, chan) ISP_FC_PC(isp, chan)->default_id #define DEFAULT_NODEWWN(isp, chan) isp_default_wwn(isp, chan, 0, 1) #define DEFAULT_PORTWWN(isp, chan) isp_default_wwn(isp, chan, 0, 0) Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Tue Nov 24 22:10:33 2020 (r368000) +++ head/sys/dev/isp/isp_pci.c Tue Nov 24 22:43:27 2020 (r368001) @@ -543,8 +543,8 @@ isp_pci_attach(device_t dev) device_printf(dev, "cannot allocate parameter data\n"); goto bad; } - isp->isp_osinfo.pc.ptr = malloc(xsize, M_DEVBUF, M_NOWAIT | M_ZERO); - if (isp->isp_osinfo.pc.ptr == NULL) { + isp->isp_osinfo.fc = malloc(xsize, M_DEVBUF, M_NOWAIT | M_ZERO); + if (isp->isp_osinfo.fc == NULL) { device_printf(dev, "cannot allocate parameter data\n"); goto bad; } @@ -651,9 +651,9 @@ bad: free(pcs->pci_isp.isp_param, M_DEVBUF); pcs->pci_isp.isp_param = NULL; } - if (pcs->pci_isp.isp_osinfo.pc.ptr) { - free(pcs->pci_isp.isp_osinfo.pc.ptr, M_DEVBUF); - pcs->pci_isp.isp_osinfo.pc.ptr = NULL; + if (pcs->pci_isp.isp_osinfo.fc) { + free(pcs->pci_isp.isp_osinfo.fc, M_DEVBUF); + pcs->pci_isp.isp_osinfo.fc = NULL; } mtx_destroy(&isp->isp_lock); return (ENXIO); @@ -689,9 +689,9 @@ isp_pci_detach(device_t dev) free(pcs->pci_isp.isp_param, M_DEVBUF); pcs->pci_isp.isp_param = NULL; } - if (pcs->pci_isp.isp_osinfo.pc.ptr) { - free(pcs->pci_isp.isp_osinfo.pc.ptr, M_DEVBUF); - pcs->pci_isp.isp_osinfo.pc.ptr = NULL; + if (pcs->pci_isp.isp_osinfo.fc) { + free(pcs->pci_isp.isp_osinfo.fc, M_DEVBUF); + pcs->pci_isp.isp_osinfo.fc = NULL; } mtx_destroy(&isp->isp_lock); return (0); Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Tue Nov 24 22:10:33 2020 (r368000) +++ head/sys/dev/isp/ispvar.h Tue Nov 24 22:43:27 2020 (r368001) @@ -447,22 +447,17 @@ struct ispsoftc { * may contain some volatile state (e.g., current loop state). */ - void * isp_param; /* type specific */ + fcparam *isp_param; /* Per-channel storage. */ uint64_t isp_fwattr; /* firmware attributes */ uint16_t isp_fwrev[3]; /* Loaded F/W revision */ uint16_t isp_maxcmds; /* max possible I/O cmds */ + uint16_t isp_nchan; /* number of channels */ + uint16_t isp_dblev; /* debug log mask */ uint8_t isp_type; /* HBA Chip Type */ uint8_t isp_revision; /* HBA Chip H/W Revision */ uint8_t isp_nirq; /* number of IRQs */ - uint16_t isp_nchan; /* number of channels */ - - uint32_t isp_clock : 8, /* input clock */ - : 5, - isp_port : 1, /* 23XX/24XX only */ - isp_loaded_fw : 1, /* loaded firmware */ - isp_dblev : 16; /* debug log mask */ - - + uint8_t isp_port; /* physical port on a card */ + uint8_t isp_loaded_fw; /* loaded firmware */ uint32_t isp_confopts; /* config options */ /* @@ -508,7 +503,7 @@ struct ispsoftc { #endif }; -#define FCPARAM(isp, chan) (&((fcparam *)(isp)->isp_param)[(chan)]) +#define FCPARAM(isp, chan) (&(isp)->isp_param[(chan)]) #define ISP_SET_SENDMARKER(isp, chan, val) \ FCPARAM(isp, chan)->sendmarker = val \ From owner-svn-src-all@freebsd.org Tue Nov 24 22:52:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E34ED46D3E7; Tue, 24 Nov 2020 22:52:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgfRJ64QBz3Qwc; Tue, 24 Nov 2020 22:52:12 +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 C344727010; Tue, 24 Nov 2020 22:52:12 +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 0AOMqCGm014164; Tue, 24 Nov 2020 22:52:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AOMqCIh014163; Tue, 24 Nov 2020 22:52:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202011242252.0AOMqCIh014163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 24 Nov 2020 22:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368002 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 368002 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 22:52:12 -0000 Author: jhb Date: Tue Nov 24 22:52:12 2020 New Revision: 368002 URL: https://svnweb.freebsd.org/changeset/base/368002 Log: Correct entries for manpages removed in r359374. Reported by: Yuri Pankov Sponsored by: Chelsio Communications Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Nov 24 22:43:27 2020 (r368001) +++ head/ObsoleteFiles.inc Tue Nov 24 22:52:12 2020 (r368002) @@ -914,9 +914,9 @@ OLD_FILES+=usr/share/man/man1/gdbserver.1.gz OLD_FILES+=usr/share/man/man1/kgdb.1.gz # 20200327: OCF refactoring -OLD_FILES+=usr/share/man/man9/crypto_find_driver.9 -OLD_FILES+=usr/share/man/man9/crypto_register.9 -OLD_FILES+=usr/share/man/man9/crypto_unregister.9 +OLD_FILES+=usr/share/man/man9/crypto_find_driver.9.gz +OLD_FILES+=usr/share/man/man9/crypto_register.9.gz +OLD_FILES+=usr/share/man/man9/crypto_unregister.9.gz # 20200323: INTERNALLIB don't install headers anymore OLD_FILES+=usr/include/libelftc.h From owner-svn-src-all@freebsd.org Tue Nov 24 23:18:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C04B46DA77; Tue, 24 Nov 2020 23:18:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cgg260D1Rz3hTH; Tue, 24 Nov 2020 23:18:54 +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 EE6FB27216; Tue, 24 Nov 2020 23:18:53 +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 0AONIrbc027003; Tue, 24 Nov 2020 23:18:53 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AONIq7l026997; Tue, 24 Nov 2020 23:18:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202011242318.0AONIq7l026997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 24 Nov 2020 23:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368003 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/io usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/io usr.sbin/bhyve X-SVN-Commit-Revision: 368003 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 23:18:54 -0000 Author: jhb Date: Tue Nov 24 23:18:52 2020 New Revision: 368003 URL: https://svnweb.freebsd.org/changeset/base/368003 Log: Honor the disabled setting for MSI-X interrupts for passthrough devices. Add a new ioctl to disable all MSI-X interrupts for a PCI passthrough device and invoke it if a write to the MSI-X capability registers disables MSI-X. This avoids leaving MSI-X interrupts enabled on the host if a guest device driver has disabled them (e.g. as part of detaching a guest device driver). This was found by Chelsio QA when testing that a Linux guest could switch from MSI-X to MSI interrupts when using the cxgb4vf driver. While here, explicitly fail requests to enable MSI on a passthrough device if MSI-X is enabled and vice versa. Reported by: Sony Arpita Das @ Chelsio Reviewed by: grehan, markj MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D27212 Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/io/ppt.c head/sys/amd64/vmm/io/ppt.h head/sys/amd64/vmm/vmm_dev.c head/usr.sbin/bhyve/pci_passthru.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Tue Nov 24 22:52:12 2020 (r368002) +++ head/lib/libvmmapi/vmmapi.c Tue Nov 24 23:18:52 2020 (r368003) @@ -1017,6 +1017,19 @@ vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int return ioctl(ctx->fd, VM_PPTDEV_MSIX, &pptmsix); } +int +vm_disable_pptdev_msix(struct vmctx *ctx, int bus, int slot, int func) +{ + struct vm_pptdev ppt; + + bzero(&ppt, sizeof(ppt)); + ppt.bus = bus; + ppt.slot = slot; + ppt.func = func; + + return ioctl(ctx->fd, VM_PPTDEV_DISABLE_MSIX, &ppt); +} + uint64_t * vm_get_stats(struct vmctx *ctx, int vcpu, struct timeval *ret_tv, int *ret_entries) @@ -1641,7 +1654,8 @@ vm_get_ioctls(size_t *len) VM_ISA_DEASSERT_IRQ, VM_ISA_PULSE_IRQ, VM_ISA_SET_IRQ_TRIGGER, VM_SET_CAPABILITY, VM_GET_CAPABILITY, VM_BIND_PPTDEV, VM_UNBIND_PPTDEV, VM_MAP_PPTDEV_MMIO, VM_PPTDEV_MSI, - VM_PPTDEV_MSIX, VM_INJECT_NMI, VM_STATS, VM_STAT_DESC, + VM_PPTDEV_MSIX, VM_PPTDEV_DISABLE_MSIX, + VM_INJECT_NMI, VM_STATS, VM_STAT_DESC, VM_SET_X2APIC_STATE, VM_GET_X2APIC_STATE, VM_GET_HPET_CAPABILITIES, VM_GET_GPA_PMAP, VM_GLA2GPA, VM_GLA2GPA_NOFAULT, Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Tue Nov 24 22:52:12 2020 (r368002) +++ head/lib/libvmmapi/vmmapi.h Tue Nov 24 23:18:52 2020 (r368003) @@ -181,6 +181,7 @@ int vm_setup_pptdev_msi(struct vmctx *ctx, int vcpu, i int vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func, int idx, uint64_t addr, uint64_t msg, uint32_t vector_control); +int vm_disable_pptdev_msix(struct vmctx *ctx, int bus, int slot, int func); int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *i1, uint64_t *i2); int vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t exit_intinfo); Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Tue Nov 24 22:52:12 2020 (r368002) +++ head/sys/amd64/include/vmm_dev.h Tue Nov 24 23:18:52 2020 (r368003) @@ -301,6 +301,7 @@ enum { IOCNUM_MAP_PPTDEV_MMIO = 42, IOCNUM_PPTDEV_MSI = 43, IOCNUM_PPTDEV_MSIX = 44, + IOCNUM_PPTDEV_DISABLE_MSIX = 45, /* statistics */ IOCNUM_VM_STATS = 50, @@ -413,6 +414,8 @@ enum { _IOW('v', IOCNUM_PPTDEV_MSI, struct vm_pptdev_msi) #define VM_PPTDEV_MSIX \ _IOW('v', IOCNUM_PPTDEV_MSIX, struct vm_pptdev_msix) +#define VM_PPTDEV_DISABLE_MSIX \ + _IOW('v', IOCNUM_PPTDEV_DISABLE_MSIX, struct vm_pptdev) #define VM_INJECT_NMI \ _IOW('v', IOCNUM_INJECT_NMI, struct vm_nmi) #define VM_STATS \ Modified: head/sys/amd64/vmm/io/ppt.c ============================================================================== --- head/sys/amd64/vmm/io/ppt.c Tue Nov 24 22:52:12 2020 (r368002) +++ head/sys/amd64/vmm/io/ppt.c Tue Nov 24 23:18:52 2020 (r368003) @@ -518,6 +518,10 @@ ppt_setup_msi(struct vm *vm, int vcpu, int bus, int sl if (ppt->vm != vm) /* Make sure we own this device */ return (EBUSY); + /* Reject attempts to enable MSI while MSI-X is active. */ + if (ppt->msix.num_msgs != 0 && numvec != 0) + return (EBUSY); + /* Free any allocated resources */ ppt_teardown_msi(ppt); @@ -607,6 +611,10 @@ ppt_setup_msix(struct vm *vm, int vcpu, int bus, int s if (ppt->vm != vm) /* Make sure we own this device */ return (EBUSY); + /* Reject attempts to enable MSI-X while MSI is active. */ + if (ppt->msi.num_msgs != 0) + return (EBUSY); + dinfo = device_get_ivars(ppt->dev); if (!dinfo) return (ENXIO); @@ -698,5 +706,20 @@ ppt_setup_msix(struct vm *vm, int vcpu, int bus, int s ppt_teardown_msix_intr(ppt, idx); } + return (0); +} + +int +ppt_disable_msix(struct vm *vm, int bus, int slot, int func) +{ + struct pptdev *ppt; + + ppt = ppt_find(bus, slot, func); + if (ppt == NULL) + return (ENOENT); + if (ppt->vm != vm) /* Make sure we own this device */ + return (EBUSY); + + ppt_teardown_msix(ppt); return (0); } Modified: head/sys/amd64/vmm/io/ppt.h ============================================================================== --- head/sys/amd64/vmm/io/ppt.h Tue Nov 24 22:52:12 2020 (r368002) +++ head/sys/amd64/vmm/io/ppt.h Tue Nov 24 23:18:52 2020 (r368003) @@ -38,6 +38,7 @@ int ppt_setup_msi(struct vm *vm, int vcpu, int bus, in uint64_t addr, uint64_t msg, int numvec); int ppt_setup_msix(struct vm *vm, int vcpu, int bus, int slot, int func, int idx, uint64_t addr, uint64_t msg, uint32_t vector_control); +int ppt_disable_msix(struct vm *vm, int bus, int slot, int func); int ppt_assigned_devices(struct vm *vm); bool ppt_is_mmio(struct vm *vm, vm_paddr_t gpa); Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Tue Nov 24 22:52:12 2020 (r368002) +++ head/sys/amd64/vmm/vmm_dev.c Tue Nov 24 23:18:52 2020 (r368003) @@ -514,6 +514,11 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da pptmsix->addr, pptmsix->msg, pptmsix->vector_control); break; + case VM_PPTDEV_DISABLE_MSIX: + pptdev = (struct vm_pptdev *)data; + error = ppt_disable_msix(sc->vm, pptdev->bus, pptdev->slot, + pptdev->func); + break; case VM_MAP_PPTDEV_MMIO: pptmmio = (struct vm_pptdev_mmio *)data; error = ppt_map_mmio(sc->vm, pptmmio->bus, pptmmio->slot, Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Tue Nov 24 22:52:12 2020 (r368002) +++ head/usr.sbin/bhyve/pci_passthru.c Tue Nov 24 23:18:52 2020 (r368003) @@ -869,6 +869,11 @@ passthru_cfgwrite(struct vmctx *ctx, int vcpu, struct if (error) err(1, "vm_setup_pptdev_msix"); } + } else { + error = vm_disable_pptdev_msix(ctx, sc->psc_sel.pc_bus, + sc->psc_sel.pc_dev, sc->psc_sel.pc_func); + if (error) + err(1, "vm_disable_pptdev_msix"); } return (0); } From owner-svn-src-all@freebsd.org Tue Nov 24 23:56:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBBB246E812; Tue, 24 Nov 2020 23:56:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CggsY6398z3kk1; Tue, 24 Nov 2020 23:56:33 +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 BDFF927C93; Tue, 24 Nov 2020 23:56:33 +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 0AONuXDR052530; Tue, 24 Nov 2020 23:56:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AONuXXJ052529; Tue, 24 Nov 2020 23:56:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202011242356.0AONuXXJ052529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 24 Nov 2020 23:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368004 - head/sys/amd64/vmm/io X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/amd64/vmm/io X-SVN-Commit-Revision: 368004 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 23:56:34 -0000 Author: jhb Date: Tue Nov 24 23:56:33 2020 New Revision: 368004 URL: https://svnweb.freebsd.org/changeset/base/368004 Log: Pull the check for VM ownership into ppt_find(). This reduces some code duplication. One behavior change is that ppt_assign_device() will now only succeed if the device is unowned. Previously, a device could be assigned to the same VM multiple times, but each time it was assigned, the device's state was reset. Reviewed by: markj, grehan MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D27301 Modified: head/sys/amd64/vmm/io/ppt.c Modified: head/sys/amd64/vmm/io/ppt.c ============================================================================== --- head/sys/amd64/vmm/io/ppt.c Tue Nov 24 23:18:52 2020 (r368003) +++ head/sys/amd64/vmm/io/ppt.c Tue Nov 24 23:56:33 2020 (r368004) @@ -199,8 +199,8 @@ static devclass_t ppt_devclass; DEFINE_CLASS_0(ppt, ppt_driver, ppt_methods, sizeof(struct pptdev)); DRIVER_MODULE(ppt, pci, ppt_driver, ppt_devclass, NULL, NULL); -static struct pptdev * -ppt_find(int bus, int slot, int func) +static int +ppt_find(struct vm *vm, int bus, int slot, int func, struct pptdev **pptp) { device_t dev; struct pptdev *ppt; @@ -212,9 +212,15 @@ ppt_find(int bus, int slot, int func) s = pci_get_slot(dev); f = pci_get_function(dev); if (bus == b && slot == s && func == f) - return (ppt); + break; } - return (NULL); + + if (ppt == NULL) + return (ENOENT); + if (ppt->vm != vm) /* Make sure we own this device */ + return (EBUSY); + *pptp = ppt; + return (0); } static void @@ -378,50 +384,40 @@ int ppt_assign_device(struct vm *vm, int bus, int slot, int func) { struct pptdev *ppt; + int error; - ppt = ppt_find(bus, slot, func); - if (ppt != NULL) { - /* - * If this device is owned by a different VM then we - * cannot change its owner. - */ - if (ppt->vm != NULL && ppt->vm != vm) - return (EBUSY); + /* Passing NULL requires the device to be unowned. */ + error = ppt_find(NULL, bus, slot, func, &ppt); + if (error) + return (error); - pci_save_state(ppt->dev); - ppt_pci_reset(ppt->dev); - pci_restore_state(ppt->dev); - ppt->vm = vm; - iommu_add_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); - return (0); - } - return (ENOENT); + pci_save_state(ppt->dev); + ppt_pci_reset(ppt->dev); + pci_restore_state(ppt->dev); + ppt->vm = vm; + iommu_add_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); + return (0); } int ppt_unassign_device(struct vm *vm, int bus, int slot, int func) { struct pptdev *ppt; + int error; - ppt = ppt_find(bus, slot, func); - if (ppt != NULL) { - /* - * If this device is not owned by this 'vm' then bail out. - */ - if (ppt->vm != vm) - return (EBUSY); + error = ppt_find(vm, bus, slot, func, &ppt); + if (error) + return (error); - pci_save_state(ppt->dev); - ppt_pci_reset(ppt->dev); - pci_restore_state(ppt->dev); - ppt_unmap_mmio(vm, ppt); - ppt_teardown_msi(ppt); - ppt_teardown_msix(ppt); - iommu_remove_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); - ppt->vm = NULL; - return (0); - } - return (ENOENT); + pci_save_state(ppt->dev); + ppt_pci_reset(ppt->dev); + pci_restore_state(ppt->dev); + ppt_unmap_mmio(vm, ppt); + ppt_teardown_msi(ppt); + ppt_teardown_msix(ppt); + iommu_remove_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); + ppt->vm = NULL; + return (0); } int @@ -452,25 +448,22 @@ ppt_map_mmio(struct vm *vm, int bus, int slot, int fun struct pptseg *seg; struct pptdev *ppt; - ppt = ppt_find(bus, slot, func); - if (ppt != NULL) { - if (ppt->vm != vm) - return (EBUSY); + error = ppt_find(vm, bus, slot, func, &ppt); + if (error) + return (error); - for (i = 0; i < MAX_MMIOSEGS; i++) { - seg = &ppt->mmio[i]; - if (seg->len == 0) { - error = vm_map_mmio(vm, gpa, len, hpa); - if (error == 0) { - seg->gpa = gpa; - seg->len = len; - } - return (error); + for (i = 0; i < MAX_MMIOSEGS; i++) { + seg = &ppt->mmio[i]; + if (seg->len == 0) { + error = vm_map_mmio(vm, gpa, len, hpa); + if (error == 0) { + seg->gpa = gpa; + seg->len = len; } + return (error); } - return (ENOSPC); } - return (ENOENT); + return (ENOSPC); } static int @@ -512,11 +505,9 @@ ppt_setup_msi(struct vm *vm, int vcpu, int bus, int sl if (numvec < 0 || numvec > MAX_MSIMSGS) return (EINVAL); - ppt = ppt_find(bus, slot, func); - if (ppt == NULL) - return (ENOENT); - if (ppt->vm != vm) /* Make sure we own this device */ - return (EBUSY); + error = ppt_find(vm, bus, slot, func, &ppt); + if (error) + return (error); /* Reject attempts to enable MSI while MSI-X is active. */ if (ppt->msix.num_msgs != 0 && numvec != 0) @@ -605,11 +596,9 @@ ppt_setup_msix(struct vm *vm, int vcpu, int bus, int s int numvec, alloced, rid, error; size_t res_size, cookie_size, arg_size; - ppt = ppt_find(bus, slot, func); - if (ppt == NULL) - return (ENOENT); - if (ppt->vm != vm) /* Make sure we own this device */ - return (EBUSY); + error = ppt_find(vm, bus, slot, func, &ppt); + if (error) + return (error); /* Reject attempts to enable MSI-X while MSI is active. */ if (ppt->msi.num_msgs != 0) @@ -713,12 +702,11 @@ int ppt_disable_msix(struct vm *vm, int bus, int slot, int func) { struct pptdev *ppt; + int error; - ppt = ppt_find(bus, slot, func); - if (ppt == NULL) - return (ENOENT); - if (ppt->vm != vm) /* Make sure we own this device */ - return (EBUSY); + error = ppt_find(vm, bus, slot, func, &ppt); + if (error) + return (error); ppt_teardown_msix(ppt); return (0); From owner-svn-src-all@freebsd.org Wed Nov 25 00:10:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1ADDD46F097; Wed, 25 Nov 2020 00:10:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CghB90CCZz3ldF; Wed, 25 Nov 2020 00:10:57 +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 EDECE27C5A; Wed, 25 Nov 2020 00:10:56 +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 0AP0AuOv062561; Wed, 25 Nov 2020 00:10:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AP0AtH3061986; Wed, 25 Nov 2020 00:10:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202011250010.0AP0AtH3061986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 25 Nov 2020 00:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368005 - in head: lib/libprocstat share/man/man4 sys/opencrypto sys/sys tools/tools/crypto usr.bin/procstat X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: lib/libprocstat share/man/man4 sys/opencrypto sys/sys tools/tools/crypto usr.bin/procstat X-SVN-Commit-Revision: 368005 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 00:10:57 -0000 Author: jhb Date: Wed Nov 25 00:10:54 2020 New Revision: 368005 URL: https://svnweb.freebsd.org/changeset/base/368005 Log: Remove the cloned file descriptors for /dev/crypto. Crypto file descriptors were added in the original OCF import as a way to provide per-open data (specifically the list of symmetric sessions). However, this gives a bit of a confusing API where one has to open /dev/crypto and then invoke an ioctl to obtain a second file descriptor. This also does not match the API used with /dev/crypto on other BSDs or with Linux's /dev/crypto driver. Character devices have gained support for per-open data via cdevpriv since OCF was imported, so use cdevpriv to simplify the userland API by permitting ioctls directly on /dev/crypto descriptors. To provide backwards compatibility, CRIOGET now opens another /dev/crypto descriptor via kern_openat() rather than dup'ing the existing file descriptor. This preserves prior semantics in case CRIOGET is invoked multiple times on a single file descriptor. Reviewed by: markj Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D27302 Modified: head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h head/share/man/man4/crypto.4 head/sys/opencrypto/cryptodev.c head/sys/opencrypto/cryptodev.h head/sys/sys/user.h head/tools/tools/crypto/cryptocheck.c head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat_files.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Tue Nov 24 23:56:33 2020 (r368004) +++ head/lib/libprocstat/libprocstat.c Wed Nov 25 00:10:54 2020 (r368005) @@ -708,7 +708,6 @@ kinfo_type2fst(int kftype) int fst_type; } kftypes2fst[] = { { KF_TYPE_PROCDESC, PS_FST_TYPE_PROCDESC }, - { KF_TYPE_CRYPTO, PS_FST_TYPE_CRYPTO }, { KF_TYPE_DEV, PS_FST_TYPE_DEV }, { KF_TYPE_FIFO, PS_FST_TYPE_FIFO }, { KF_TYPE_KQUEUE, PS_FST_TYPE_KQUEUE }, Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Tue Nov 24 23:56:33 2020 (r368004) +++ head/lib/libprocstat/libprocstat.h Wed Nov 25 00:10:54 2020 (r368005) @@ -64,7 +64,7 @@ #define PS_FST_TYPE_PIPE 4 #define PS_FST_TYPE_PTS 5 #define PS_FST_TYPE_KQUEUE 6 -#define PS_FST_TYPE_CRYPTO 7 +/* was PS_FST_TYPE_CRYPTO 7 */ #define PS_FST_TYPE_MQUEUE 8 #define PS_FST_TYPE_SHM 9 #define PS_FST_TYPE_SEM 10 Modified: head/share/man/man4/crypto.4 ============================================================================== --- head/share/man/man4/crypto.4 Tue Nov 24 23:56:33 2020 (r368004) +++ head/share/man/man4/crypto.4 Wed Nov 25 00:10:54 2020 (r368005) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 6, 2020 +.Dd November 24, 2020 .Dt CRYPTO 4 .Os .Sh NAME @@ -122,19 +122,11 @@ Open the .Pa /dev/crypto device. .It -Create a new cryptography file descriptor via -.Dv CRIOGET -to use for all subsequent -.Xr ioctl 2 -commands. -.It -Close the -.Pa /dev/crypto -device. -.It If any symmetric-keyed cryptographic or digest operations will be performed, create a session with -.Dv CIOCGSESSION . +.Dv CIOCGSESSION +or +.Dv CIOCGSESSION2 . Most applications will require at least one symmetric session. Since cipher and MAC keys are tied to sessions, many applications will require more. @@ -152,8 +144,9 @@ or Optionally destroy a session with .Dv CIOCFSESSION . .It -Close the cryptography file descriptor with -.Xr close 2 . +Close the +.Pa /dev/crypto +device. This will automatically close any remaining sessions associated with the file desriptor. .El @@ -458,11 +451,3 @@ session: if you request a algorithm, you must supply a suitably-sized buffer. .Pp The scheme for passing arguments for asymmetric requests is baroque. -.Pp -.Dv CRIOGET -should not exist. -It should be possible to use the -.Dv CIOC Ns \&* -commands directly on a -.Pa /dev/crypto -file descriptor. Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Tue Nov 24 23:56:33 2020 (r368004) +++ head/sys/opencrypto/cryptodev.c Wed Nov 25 00:10:54 2020 (r368005) @@ -47,9 +47,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#include -#include #include #include #include @@ -57,8 +56,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include #include @@ -67,6 +66,17 @@ SDT_PROVIDER_DECLARE(opencrypto); SDT_PROBE_DEFINE1(opencrypto, dev, ioctl, error, "int"/*line number*/); +#ifdef COMPAT_FREEBSD12 +/* + * Previously, most ioctls were performed against a cloned descriptor + * of /dev/crypto obtained via CRIOGET. Now all ioctls are performed + * against /dev/crypto directly. + */ +#define CRIOGET _IOWR('c', 100, uint32_t) +#endif + +/* the following are done against the cloned descriptor */ + #ifdef COMPAT_FREEBSD32 #include #include @@ -351,29 +361,6 @@ SYSCTL_TIMEVAL_SEC(_kern, OID_AUTO, cryptodev_warn_int &warninterval, "Delay in seconds between warnings of deprecated /dev/crypto algorithms"); -static int cryptof_ioctl(struct file *, u_long, void *, struct ucred *, - struct thread *); -static int cryptof_stat(struct file *, struct stat *, struct ucred *, - struct thread *); -static int cryptof_close(struct file *, struct thread *); -static int cryptof_fill_kinfo(struct file *, struct kinfo_file *, - struct filedesc *); - -static struct fileops cryptofops = { - .fo_read = invfo_rdwr, - .fo_write = invfo_rdwr, - .fo_truncate = invfo_truncate, - .fo_ioctl = cryptof_ioctl, - .fo_poll = invfo_poll, - .fo_kqfilter = invfo_kqfilter, - .fo_stat = cryptof_stat, - .fo_close = cryptof_close, - .fo_chmod = invfo_chmod, - .fo_chown = invfo_chown, - .fo_sendfile = invfo_sendfile, - .fo_fill_kinfo = cryptof_fill_kinfo, -}; - /* * Check a crypto identifier to see if it requested * a software device/driver. This can be done either @@ -762,7 +749,7 @@ cse_delete(struct fcrypt *fcr, u_int ses) } static struct cryptop_data * -cod_alloc(struct csession *cse, size_t aad_len, size_t len, struct thread *td) +cod_alloc(struct csession *cse, size_t aad_len, size_t len) { struct cryptop_data *cod; @@ -808,8 +795,7 @@ cryptodev_cb(struct cryptop *crp) } static int -cryptodev_op(struct csession *cse, const struct crypt_op *cop, - struct ucred *active_cred, struct thread *td) +cryptodev_op(struct csession *cse, const struct crypt_op *cop) { struct cryptop_data *cod = NULL; struct cryptop *crp = NULL; @@ -845,7 +831,7 @@ cryptodev_op(struct csession *cse, const struct crypt_ } } - cod = cod_alloc(cse, 0, cop->len + cse->hashsize, td); + cod = cod_alloc(cse, 0, cop->len + cse->hashsize); dst = cop->dst; crp = crypto_getreq(cse->cses, M_WAITOK); @@ -1019,8 +1005,7 @@ bail: } static int -cryptodev_aead(struct csession *cse, struct crypt_aead *caead, - struct ucred *active_cred, struct thread *td) +cryptodev_aead(struct csession *cse, struct crypt_aead *caead) { struct cryptop_data *cod = NULL; struct cryptop *crp = NULL; @@ -1050,7 +1035,7 @@ cryptodev_aead(struct csession *cse, struct crypt_aead } } - cod = cod_alloc(cse, caead->aadlen, caead->len + cse->hashsize, td); + cod = cod_alloc(cse, caead->aadlen, caead->len + cse->hashsize); dst = caead->dst; crp = crypto_getreq(cse->cses, M_WAITOK); @@ -1358,12 +1343,44 @@ cryptodev_find(struct crypt_find_op *find) return (0); } +static void +fcrypt_dtor(void *data) +{ + struct fcrypt *fcr = data; + struct csession *cse; + + while ((cse = TAILQ_FIRST(&fcr->csessions))) { + TAILQ_REMOVE(&fcr->csessions, cse, next); + KASSERT(refcount_load(&cse->refs) == 1, + ("%s: crypto session %p with %d refs", __func__, cse, + refcount_load(&cse->refs))); + cse_free(cse); + } + mtx_destroy(&fcr->lock); + free(fcr, M_XDATA); +} + static int -cryptof_ioctl(struct file *fp, u_long cmd, void *data, - struct ucred *active_cred, struct thread *td) +crypto_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { + struct fcrypt *fcr; + int error; + + fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK | M_ZERO); + TAILQ_INIT(&fcr->csessions); + mtx_init(&fcr->lock, "fcrypt", NULL, MTX_DEF); + error = devfs_set_cdevpriv(fcr, fcrypt_dtor); + if (error) + fcrypt_dtor(fcr); + return (error); +} + +static int +crypto_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, + struct thread *td) +{ static struct timeval keywarn, featwarn; - struct fcrypt *fcr = fp->f_data; + struct fcrypt *fcr; struct csession *cse; struct session2_op *sop; struct crypt_op *cop; @@ -1390,14 +1407,14 @@ cryptof_ioctl(struct file *fp, u_long cmd, void *data, cmd32 = cmd; data32 = data; cmd = CIOCGSESSION; - data = &thunk.sopc; + data = (void *)&thunk.sopc; session_op_from_32((struct session_op32 *)data32, &thunk.sopc); break; case CIOCGSESSION232: cmd32 = cmd; data32 = data; cmd = CIOCGSESSION2; - data = &thunk.sopc; + data = (void *)&thunk.sopc; session2_op_from_32((struct session2_op32 *)data32, &thunk.sopc); break; @@ -1405,14 +1422,14 @@ cryptof_ioctl(struct file *fp, u_long cmd, void *data, cmd32 = cmd; data32 = data; cmd = CIOCCRYPT; - data = &thunk.copc; + data = (void *)&thunk.copc; crypt_op_from_32((struct crypt_op32 *)data32, &thunk.copc); break; case CIOCCRYPTAEAD32: cmd32 = cmd; data32 = data; cmd = CIOCCRYPTAEAD; - data = &thunk.aeadc; + data = (void *)&thunk.aeadc; crypt_aead_from_32((struct crypt_aead32 *)data32, &thunk.aeadc); break; case CIOCKEY32: @@ -1423,24 +1440,41 @@ cryptof_ioctl(struct file *fp, u_long cmd, void *data, cmd = CIOCKEY; else cmd = CIOCKEY2; - data = &thunk.kopc; + data = (void *)&thunk.kopc; crypt_kop_from_32((struct crypt_kop32 *)data32, &thunk.kopc); break; } #endif + devfs_get_cdevpriv((void **)&fcr); + switch (cmd) { +#ifdef COMPAT_FREEBSD12 + case CRIOGET: + /* + * NB: This may fail in cases that the old + * implementation did not if the current process has + * restricted filesystem access (e.g. running in a + * jail that does not expose /dev/crypto or in + * capability mode). + */ + error = kern_openat(td, AT_FDCWD, "/dev/crypto", UIO_SYSSPACE, + O_RDWR, 0); + if (error == 0) + *(uint32_t *)data = td->td_retval[0]; + break; +#endif case CIOCGSESSION: case CIOCGSESSION2: if (cmd == CIOCGSESSION) { - session2_op_from_op(data, &thunk.sopc); + session2_op_from_op((void *)data, &thunk.sopc); sop = &thunk.sopc; } else sop = (struct session2_op *)data; error = cse_create(fcr, sop); if (cmd == CIOCGSESSION && error == 0) - session2_op_to_op(sop, data); + session2_op_to_op(sop, (void *)data); break; case CIOCFSESSION: ses = *(uint32_t *)data; @@ -1456,7 +1490,7 @@ cryptof_ioctl(struct file *fp, u_long cmd, void *data, SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); } - error = cryptodev_op(cse, cop, active_cred, td); + error = cryptodev_op(cse, cop); cse_free(cse); break; case CIOCKEY: @@ -1509,7 +1543,7 @@ cryptof_ioctl(struct file *fp, u_long cmd, void *data, SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); } - error = cryptodev_aead(cse, caead, active_cred, td); + error = cryptodev_aead(cse, caead); cse_free(cse); break; default: @@ -1522,109 +1556,33 @@ cryptof_ioctl(struct file *fp, u_long cmd, void *data, switch (cmd32) { case CIOCGSESSION32: if (error == 0) - session_op_to_32(data, data32); + session_op_to_32((void *)data, data32); break; case CIOCGSESSION232: if (error == 0) - session2_op_to_32(data, data32); + session2_op_to_32((void *)data, data32); break; case CIOCCRYPT32: if (error == 0) - crypt_op_to_32(data, data32); + crypt_op_to_32((void *)data, data32); break; case CIOCCRYPTAEAD32: if (error == 0) - crypt_aead_to_32(data, data32); + crypt_aead_to_32((void *)data, data32); break; case CIOCKEY32: case CIOCKEY232: - crypt_kop_to_32(data, data32); + crypt_kop_to_32((void *)data, data32); break; } #endif return (error); } -/* ARGSUSED */ -static int -cryptof_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, - struct thread *td) -{ - - return (EOPNOTSUPP); -} - -/* ARGSUSED */ -static int -cryptof_close(struct file *fp, struct thread *td) -{ - struct fcrypt *fcr = fp->f_data; - struct csession *cse; - - while ((cse = TAILQ_FIRST(&fcr->csessions))) { - TAILQ_REMOVE(&fcr->csessions, cse, next); - KASSERT(cse->refs == 1, - ("%s: crypto session %p with %d refs", __func__, cse, - cse->refs)); - cse_free(cse); - } - free(fcr, M_XDATA); - fp->f_data = NULL; - return 0; -} - -static int -cryptof_fill_kinfo(struct file *fp, struct kinfo_file *kif, - struct filedesc *fdp) -{ - - kif->kf_type = KF_TYPE_CRYPTO; - return (0); -} - -static int -cryptoioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, - struct thread *td) -{ - struct file *f; - struct fcrypt *fcr; - int fd, error; - - switch (cmd) { - case CRIOGET: - error = falloc_noinstall(td, &f); - if (error) - break; - - fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK | M_ZERO); - TAILQ_INIT(&fcr->csessions); - mtx_init(&fcr->lock, "fcrypt", NULL, MTX_DEF); - - finit(f, FREAD | FWRITE, DTYPE_CRYPTO, fcr, &cryptofops); - error = finstall(td, f, &fd, 0, NULL); - if (error) { - mtx_destroy(&fcr->lock); - free(fcr, M_XDATA); - } else - *(uint32_t *)data = fd; - fdrop(f, td); - break; - case CRIOFINDDEV: - error = cryptodev_find((struct crypt_find_op *)data); - break; - case CRIOASYMFEAT: - error = crypto_getfeat((int *)data); - break; - default: - error = EINVAL; - break; - } - return (error); -} - static struct cdevsw crypto_cdevsw = { .d_version = D_VERSION, - .d_ioctl = cryptoioctl, + .d_open = crypto_open, + .d_ioctl = crypto_ioctl, .d_name = "crypto", }; static struct cdev *crypto_dev; Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Tue Nov 24 23:56:33 2020 (r368004) +++ head/sys/opencrypto/cryptodev.h Wed Nov 25 00:10:54 2020 (r368005) @@ -316,15 +316,6 @@ struct crypt_kop { #define CRF_DSA_VERIFY (1 << CRK_DSA_VERIFY) #define CRF_DH_COMPUTE_KEY (1 << CRK_DH_COMPUTE_KEY) -/* - * done against open of /dev/crypto, to get a cloned descriptor. - * Please use F_SETFD against the cloned descriptor. - */ -#define CRIOGET _IOWR('c', 100, uint32_t) -#define CRIOASYMFEAT CIOCASYMFEAT -#define CRIOFINDDEV CIOCFINDDEV - -/* the following are done against the cloned descriptor */ #define CIOCGSESSION _IOWR('c', 101, struct session_op) #define CIOCFSESSION _IOW('c', 102, uint32_t) #define CIOCCRYPT _IOWR('c', 103, struct crypt_op) Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Tue Nov 24 23:56:33 2020 (r368004) +++ head/sys/sys/user.h Wed Nov 25 00:10:54 2020 (r368005) @@ -257,7 +257,7 @@ struct user { #define KF_TYPE_PIPE 3 #define KF_TYPE_FIFO 4 #define KF_TYPE_KQUEUE 5 -#define KF_TYPE_CRYPTO 6 +/* was KF_TYPE_CRYPTO 6 */ #define KF_TYPE_MQUEUE 7 #define KF_TYPE_SHM 8 #define KF_TYPE_SEM 9 Modified: head/tools/tools/crypto/cryptocheck.c ============================================================================== --- head/tools/tools/crypto/cryptocheck.c Tue Nov 24 23:56:33 2020 (r368004) +++ head/tools/tools/crypto/cryptocheck.c Wed Nov 25 00:10:54 2020 (r368005) @@ -352,23 +352,11 @@ crfind(int crid) bzero(&find, sizeof(find)); find.crid = crid; - if (ioctl(devcrypto(), CRIOFINDDEV, &find) == -1) + if (ioctl(devcrypto(), CIOCFINDDEV, &find) == -1) err(1, "ioctl(CIOCFINDDEV): crid %d", crid); return (find.name); } -static int -crget(void) -{ - int fd; - - if (ioctl(devcrypto(), CRIOGET, &fd) == -1) - err(1, "ioctl(CRIOGET)"); - if (fcntl(fd, F_SETFD, 1) == -1) - err(1, "fcntl(F_SETFD) (crget)"); - return fd; -} - static char rdigit(void) { @@ -436,11 +424,10 @@ ocf_init_session(struct session2_op *sop, const char * { int fd; - fd = crget(); + fd = devcrypto(); if (ioctl(fd, CIOCGSESSION2, sop) < 0) { warn("cryptodev %s %s not supported for device %s", type, name, crfind(sop->crid)); - close(fd); ses->fd = -1; return (false); } @@ -458,8 +445,6 @@ ocf_destroy_session(struct ocf_session *ses) if (ioctl(ses->fd, CIOCFSESSION, &ses->ses) < 0) warn("ioctl(CIOCFSESSION)"); - - close(ses->fd); } static void Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Tue Nov 24 23:56:33 2020 (r368004) +++ head/usr.bin/procstat/procstat.1 Wed Nov 25 00:10:54 2020 (r368005) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2020 +.Dd November 24, 2020 .Dt PROCSTAT 1 .Os .Sh NAME @@ -311,8 +311,6 @@ file path or socket addresses (if available) The following file descriptor types may be displayed: .Pp .Bl -tag -width X -compact -.It c -crypto .It e POSIX semaphore .It f Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Tue Nov 24 23:56:33 2020 (r368004) +++ head/usr.bin/procstat/procstat_files.c Wed Nov 25 00:10:54 2020 (r368005) @@ -384,11 +384,6 @@ procstat_files(struct procstat *procstat, struct kinfo xo_emit("{eq:fd_type/kqueue}"); break; - case PS_FST_TYPE_CRYPTO: - str = "c"; - xo_emit("{eq:fd_type/crypto}"); - break; - case PS_FST_TYPE_MQUEUE: str = "m"; xo_emit("{eq:fd_type/mqueue}"); From owner-svn-src-all@freebsd.org Wed Nov 25 00:13:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 425C746EDC0; Wed, 25 Nov 2020 00:13:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CghDv15h3z3ly6; Wed, 25 Nov 2020 00:13:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id A0380260; Wed, 25 Nov 2020 00:13:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r367945 - head To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011230439.0AN4dUcB028565@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Tue, 24 Nov 2020 16:13:17 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202011230439.0AN4dUcB028565@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 00:13:19 -0000 On 11/22/20 8:39 PM, Eitan Adler wrote: > Author: eadler > Date: Mon Nov 23 04:39:29 2020 > New Revision: 367945 > URL: https://svnweb.freebsd.org/changeset/base/367945 > > Log: > arcconfig: add callsign again > > Problem > > When using git-svn or other non-pure-svn tooling the original subversion > URL is not present. This causes arcanist/phabricator to be unable to > determine which repository is being modified. > > Solution > > Restore callsign to .arcconfig to enable exact repository matching even > with git-svn. > > Reported By: jhb > > Modified: > head/.arcconfig In my case I wasn't using git svn, just using arc with git branches from the GH mirror. Thanks for fixing! -- John Baldwin From owner-svn-src-all@freebsd.org Wed Nov 25 00:15:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B2A446F055; Wed, 25 Nov 2020 00:15:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CghHQ1XZSz3mFk; Wed, 25 Nov 2020 00:15:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id C2FA4844; Wed, 25 Nov 2020 00:15:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r368005 - in head: lib/libprocstat share/man/man4 sys/opencrypto sys/sys tools/tools/crypto usr.bin/procstat From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011250010.0AP0AtH3061986@repo.freebsd.org> Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Tue, 24 Nov 2020 16:15:28 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202011250010.0AP0AtH3061986@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 00:15:30 -0000 On 11/24/20 4:10 PM, John Baldwin wrote: > Author: jhb > Date: Wed Nov 25 00:10:54 2020 > New Revision: 368005 > URL: https://svnweb.freebsd.org/changeset/base/368005 > > Log: > Remove the cloned file descriptors for /dev/crypto. > > Crypto file descriptors were added in the original OCF import as a way > to provide per-open data (specifically the list of symmetric > sessions). However, this gives a bit of a confusing API where one has > to open /dev/crypto and then invoke an ioctl to obtain a second file > descriptor. This also does not match the API used with /dev/crypto on > other BSDs or with Linux's /dev/crypto driver. > > Character devices have gained support for per-open data via cdevpriv > since OCF was imported, so use cdevpriv to simplify the userland API > by permitting ioctls directly on /dev/crypto descriptors. > > To provide backwards compatibility, CRIOGET now opens another > /dev/crypto descriptor via kern_openat() rather than dup'ing the > existing file descriptor. This preserves prior semantics in case > CRIOGET is invoked multiple times on a single file descriptor. > > Reviewed by: markj > Relnotes: yes > Sponsored by: Chelsio Communications > Differential Revision: https://reviews.freebsd.org/D27302 This also allows the devcrypto engine in OpenSSL 1.1.1 to work since it doesn't know about CRIOGET at all (though I have an open PR to teach OpenSSL about CRIOGET so that it will work again on older branches here: https://github.com/openssl/openssl/pull/13468 -- John Baldwin From owner-svn-src-all@freebsd.org Wed Nov 25 01:08:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0046846FBEE; Wed, 25 Nov 2020 01:08:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgjT56THdz3p4T; Wed, 25 Nov 2020 01:08:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D135D668; Wed, 25 Nov 2020 01:08:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AP18vlN096137; Wed, 25 Nov 2020 01:08:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AP18vhi096136; Wed, 25 Nov 2020 01:08:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011250108.0AP18vhi096136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Nov 2020 01:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368006 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 368006 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 01:08:58 -0000 Author: kevans Date: Wed Nov 25 01:08:57 2020 New Revision: 368006 URL: https://svnweb.freebsd.org/changeset/base/368006 Log: kern: never restart syscalls calling closefp(), e.g. close(2) All paths leading into closefp() will either replace or remove the fd from the filedesc table, and closefp() will call fo_close methods that can and do currently sleep without regard for the possibility of an ERESTART. This can be dangerous in multithreaded applications as another thread could have opened another file in its place that is subsequently operated on upon restart. The following are seemingly the only ones that will pass back ERESTART in-tree: - sockets (SO_LINGER) - fusefs - nfsclient Reviewed by: jilles, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27310 Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Nov 25 00:10:54 2020 (r368005) +++ head/sys/kern/kern_descrip.c Wed Nov 25 01:08:57 2020 (r368006) @@ -1279,6 +1279,15 @@ closefp(struct filedesc *fdp, int fd, struct file *fp, FILEDESC_XUNLOCK(fdp); error = closef(fp, td); + + /* + * All paths leading up to closefp() will have already removed or + * replaced the fd in the filedesc table, so a restart would not + * operate on the same file. + */ + if (error == ERESTART) + error = EINTR; + if (holdleaders) { FILEDESC_XLOCK(fdp); fdp->fd_holdleaderscount--; From owner-svn-src-all@freebsd.org Wed Nov 25 01:09:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0B15470083; Wed, 25 Nov 2020 01:09:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgjVG6Ygsz3pGc; Wed, 25 Nov 2020 01:09:58 +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 D2631B0A; Wed, 25 Nov 2020 01:09:58 +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 0AP19wmk096227; Wed, 25 Nov 2020 01:09:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AP19wTt096226; Wed, 25 Nov 2020 01:09:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202011250109.0AP19wTt096226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 25 Nov 2020 01:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368007 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 368007 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 01:09:59 -0000 Author: jhb Date: Wed Nov 25 01:09:58 2020 New Revision: 368007 URL: https://svnweb.freebsd.org/changeset/base/368007 Log: Remove a reference to CRIOGET missed in r368005. Modified: head/share/man/man4/crypto.4 Modified: head/share/man/man4/crypto.4 ============================================================================== --- head/share/man/man4/crypto.4 Wed Nov 25 01:08:57 2020 (r368006) +++ head/share/man/man4/crypto.4 Wed Nov 25 01:09:58 2020 (r368007) @@ -171,11 +171,6 @@ and .\" .Bl -tag -width CIOCGSESSION .\" -.It Dv CRIOGET Fa int *fd -Clone the fd argument to -.Xr ioctl 2 , -yielding a new file descriptor for the creation of sessions. -.\" .It Dv CIOCFINDDEV Fa struct crypt_find_op *fop .Bd -literal struct crypt_find_op { From owner-svn-src-all@freebsd.org Wed Nov 25 01:14:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E70047043D; Wed, 25 Nov 2020 01:14:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cgjc224G8z3pZ3; Wed, 25 Nov 2020 01:14:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id D1EF0DC; Wed, 25 Nov 2020 01:14:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r368005 - in head: lib/libprocstat share/man/man4 sys/opencrypto sys/sys tools/tools/crypto usr.bin/procstat From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011250010.0AP0AtH3061986@repo.freebsd.org> Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Tue, 24 Nov 2020 17:14:56 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202011250010.0AP0AtH3061986@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 01:14:58 -0000 On 11/24/20 4:10 PM, John Baldwin wrote: > Author: jhb > Date: Wed Nov 25 00:10:54 2020 > New Revision: 368005 > URL: https://svnweb.freebsd.org/changeset/base/368005 > > Log: > Remove the cloned file descriptors for /dev/crypto. > > Crypto file descriptors were added in the original OCF import as a way > to provide per-open data (specifically the list of symmetric > sessions). However, this gives a bit of a confusing API where one has > to open /dev/crypto and then invoke an ioctl to obtain a second file > descriptor. This also does not match the API used with /dev/crypto on > other BSDs or with Linux's /dev/crypto driver. > > Character devices have gained support for per-open data via cdevpriv > since OCF was imported, so use cdevpriv to simplify the userland API > by permitting ioctls directly on /dev/crypto descriptors. > > To provide backwards compatibility, CRIOGET now opens another > /dev/crypto descriptor via kern_openat() rather than dup'ing the > existing file descriptor. This preserves prior semantics in case > CRIOGET is invoked multiple times on a single file descriptor. Oof, I missed updating some tests that were still using CRIOGET. I have a patch at D27367 that I'm working on testing now. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Nov 25 01:31:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20903470725; Wed, 25 Nov 2020 01:31:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgjyZ0NlBz3qPS; Wed, 25 Nov 2020 01:31:02 +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 003BBE21; Wed, 25 Nov 2020 01:31:02 +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 0AP1V1CG008654; Wed, 25 Nov 2020 01:31:01 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AP1V1u4008649; Wed, 25 Nov 2020 01:31:01 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202011250131.0AP1V1u4008649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 25 Nov 2020 01:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368008 - in head: tests/sys/opencrypto tools/tools/crypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: tests/sys/opencrypto tools/tools/crypto X-SVN-Commit-Revision: 368008 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 01:31:02 -0000 Author: jhb Date: Wed Nov 25 01:31:00 2020 New Revision: 368008 URL: https://svnweb.freebsd.org/changeset/base/368008 Log: Remove uses of CRIOGET in OCF tests after r368005. Pointy hat to: jhb Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D27367 Modified: head/tests/sys/opencrypto/blake2_test.c head/tests/sys/opencrypto/cryptodev.py head/tests/sys/opencrypto/poly1305_test.c head/tools/tools/crypto/cryptokeytest.c head/tools/tools/crypto/cryptotest.c Modified: head/tests/sys/opencrypto/blake2_test.c ============================================================================== --- head/tests/sys/opencrypto/blake2_test.c Wed Nov 25 01:09:58 2020 (r368007) +++ head/tests/sys/opencrypto/blake2_test.c Wed Nov 25 01:31:00 2020 (r368008) @@ -88,17 +88,10 @@ lookup_crid(int fd, const char *devname) static int get_handle_fd(void) { - int dc_fd, fd; + int fd; - dc_fd = open("/dev/crypto", O_RDWR); - - /* - * Why do we do this dance instead of just operating on /dev/crypto - * directly? I have no idea. - */ - ATF_REQUIRE(dc_fd >= 0); - ATF_REQUIRE(ioctl(dc_fd, CRIOGET, &fd) != -1); - close(dc_fd); + fd = open("/dev/crypto", O_RDWR); + ATF_REQUIRE(fd >= 0); return (fd); } Modified: head/tests/sys/opencrypto/cryptodev.py ============================================================================== --- head/tests/sys/opencrypto/cryptodev.py Wed Nov 25 01:09:58 2020 (r368007) +++ head/tests/sys/opencrypto/cryptodev.py Wed Nov 25 01:31:00 2020 (r368008) @@ -115,7 +115,6 @@ class CryptAEAD(dpkt.Packet): ) # h2py.py can't handle multiarg macros -CRIOGET = 3221513060 CIOCGSESSION = 3224396645 CIOCFSESSION = 2147771238 CIOCKEY = 3230688104 @@ -131,17 +130,7 @@ else: CIOCCRYPT = 3223085927 CIOCCRYPTAEAD = 3223872365 -def _getdev(): - buf = array.array('I', [0]) - fd = os.open('/dev/crypto', os.O_RDWR) - try: - ioctl(fd, CRIOGET, buf, 1) - finally: - os.close(fd) - - return buf[0] - -_cryptodev = _getdev() +_cryptodev = os.open('/dev/crypto', os.O_RDWR) def str_to_ascii(val): if sys.version_info[0] >= 3: Modified: head/tests/sys/opencrypto/poly1305_test.c ============================================================================== --- head/tests/sys/opencrypto/poly1305_test.c Wed Nov 25 01:09:58 2020 (r368007) +++ head/tests/sys/opencrypto/poly1305_test.c Wed Nov 25 01:31:00 2020 (r368008) @@ -302,17 +302,10 @@ parse_vector(const struct poly1305_kat *kat, static int get_handle_fd(void) { - int dc_fd, fd; + int fd; - dc_fd = open("/dev/crypto", O_RDWR); - - /* - * Why do we do this dance instead of just operating on /dev/crypto - * directly? I have no idea. - */ - ATF_REQUIRE(dc_fd >= 0); - ATF_REQUIRE(ioctl(dc_fd, CRIOGET, &fd) != -1); - close(dc_fd); + fd = open("/dev/crypto", O_RDWR); + ATF_REQUIRE(fd >= 0); return (fd); } Modified: head/tools/tools/crypto/cryptokeytest.c ============================================================================== --- head/tools/tools/crypto/cryptokeytest.c Wed Nov 25 01:09:58 2020 (r368007) +++ head/tools/tools/crypto/cryptokeytest.c Wed Nov 25 01:31:00 2020 (r368008) @@ -113,10 +113,7 @@ UB_mod_exp(BIGNUM *res, const BIGNUM *a, const BIGNUM { struct crypt_kop kop; void *ale, *ble, *cle; - static int crypto_fd = -1; - - if (crypto_fd == -1 && ioctl(devcrypto(), CRIOGET, &crypto_fd) == -1) - err(1, "CRIOGET"); + int crypto_fd = devcrypto(); if ((ale = bignum_to_le(a)) == NULL) err(1, "bignum_to_le, a"); Modified: head/tools/tools/crypto/cryptotest.c ============================================================================== --- head/tools/tools/crypto/cryptotest.c Wed Nov 25 01:09:58 2020 (r368007) +++ head/tools/tools/crypto/cryptotest.c Wed Nov 25 01:31:00 2020 (r368008) @@ -229,23 +229,11 @@ crfind(int crid) bzero(&find, sizeof(find)); find.crid = crid; - if (ioctl(devcrypto(), CRIOFINDDEV, &find) == -1) + if (ioctl(devcrypto(), CIOCFINDDEV, &find) == -1) err(1, "ioctl(CIOCFINDDEV): crid %d", crid); return find.name; } -int -crget(void) -{ - int fd; - - if (ioctl(devcrypto(), CRIOGET, &fd) == -1) - err(1, "ioctl(CRIOGET)"); - if (fcntl(fd, F_SETFD, 1) == -1) - err(1, "fcntl(F_SETFD) (crget)"); - return fd; -} - char rdigit(void) { @@ -259,7 +247,7 @@ rdigit(void) void runtest(struct alg *ealg, struct alg *alg, int count, int size, u_long cmd, struct timeval *tv) { - int i, fd = crget(); + int i, fd = devcrypto(); struct timeval start, stop, dt; char *cleartext, *ciphertext, *originaltext, *key; struct session2_op sop; From owner-svn-src-all@freebsd.org Wed Nov 25 01:42:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62B83470AE0; Wed, 25 Nov 2020 01:42: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgkCs2LJdz3qsP; Wed, 25 Nov 2020 01:42: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 43359E5D; Wed, 25 Nov 2020 01:42: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 0AP1gXXM020739; Wed, 25 Nov 2020 01:42:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AP1gXav020738; Wed, 25 Nov 2020 01:42:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011250142.0AP1gXav020738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Nov 2020 01:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368009 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 368009 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 01:42:33 -0000 Author: kevans Date: Wed Nov 25 01:42:32 2020 New Revision: 368009 URL: https://svnweb.freebsd.org/changeset/base/368009 Log: kern: cpuset: allow cpuset_create() to take an allocated *setp Currently, it must always allocate a new set to be used for passing to _cpuset_create, but it doesn't have to. This is purely kern_cpuset.c internal and it's sparsely used, so just change it to use *setp if it's not-NULL and modify the two consumers to pass in the address of a NULL cpuset. This paves the way for consumers that want the unr allocation without the possibility of sleeping as long as they've done their due diligence to ensure that the mask will properly apply atop the supplied parent (i.e. avoiding the free_unr() in the last failure path). Reviewed by: jamie, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27297 Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Wed Nov 25 01:31:00 2020 (r368008) +++ head/sys/kern/kern_cpuset.c Wed Nov 25 01:42:32 2020 (r368009) @@ -326,6 +326,10 @@ _cpuset_create(struct cpuset *set, struct cpuset *pare * Create a new non-anonymous set with the requested parent and mask. May * return failures if the mask is invalid or a new number can not be * allocated. + * + * If *setp is not NULL, then it will be used as-is. The caller must take + * into account that *setp will be inserted at the head of cpuset_ids and + * plan any potentially conflicting cs_link usage accordingly. */ static int cpuset_create(struct cpuset **setp, struct cpuset *parent, const cpuset_t *mask) @@ -333,16 +337,22 @@ cpuset_create(struct cpuset **setp, struct cpuset *par struct cpuset *set; cpusetid_t id; int error; + bool dofree; id = alloc_unr(cpuset_unr); if (id == -1) return (ENFILE); - *setp = set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO); + dofree = (*setp == NULL); + if (*setp != NULL) + set = *setp; + else + *setp = set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO); error = _cpuset_create(set, parent, mask, NULL, id); if (error == 0) return (0); free_unr(cpuset_unr, id); - uma_zfree(cpuset_zone, set); + if (dofree) + uma_zfree(cpuset_zone, set); return (error); } @@ -1552,16 +1562,17 @@ cpuset_create_root(struct prison *pr, struct cpuset ** KASSERT(pr != NULL, ("[%s:%d] invalid pr", __func__, __LINE__)); KASSERT(setp != NULL, ("[%s:%d] invalid setp", __func__, __LINE__)); - error = cpuset_create(setp, pr->pr_cpuset, &pr->pr_cpuset->cs_mask); + set = NULL; + error = cpuset_create(&set, pr->pr_cpuset, &pr->pr_cpuset->cs_mask); if (error) return (error); - KASSERT(*setp != NULL, ("[%s:%d] cpuset_create returned invalid data", + KASSERT(set != NULL, ("[%s:%d] cpuset_create returned invalid data", __func__, __LINE__)); /* Mark the set as root. */ - set = *setp; set->cs_flags |= CPU_SET_ROOT; + *setp = set; return (0); } @@ -1618,6 +1629,7 @@ sys_cpuset(struct thread *td, struct cpuset_args *uap) thread_lock(td); root = cpuset_refroot(td->td_cpuset); thread_unlock(td); + set = NULL; error = cpuset_create(&set, root, &root->cs_mask); cpuset_rel(root); if (error) From owner-svn-src-all@freebsd.org Wed Nov 25 02:12:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EFBC47112D; Wed, 25 Nov 2020 02:12: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgktK3Fyzz3rrX; Wed, 25 Nov 2020 02:12: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 6329215D1; Wed, 25 Nov 2020 02:12: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 0AP2CP7m038737; Wed, 25 Nov 2020 02:12:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AP2CPtM038736; Wed, 25 Nov 2020 02:12:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011250212.0AP2CPtM038736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Nov 2020 02:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368010 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 368010 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 02:12:25 -0000 Author: kevans Date: Wed Nov 25 02:12:24 2020 New Revision: 368010 URL: https://svnweb.freebsd.org/changeset/base/368010 Log: kern: cpuset: rename _cpuset_create() to cpuset_init() cpuset_init() is better descriptor for what the function actually does. The name was previously taken by a sysinit that setup cpuset_zero's mask from all_cpus, it was removed in r331698 before stable/12 branched. A comment referencing the removed sysinit has now also been removed, since the setup previously done was moved into cpuset_thread0(). Suggested by: markj MFC after: 1 week Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Wed Nov 25 01:42:32 2020 (r368009) +++ head/sys/kern/kern_cpuset.c Wed Nov 25 02:12:24 2020 (r368010) @@ -287,12 +287,12 @@ cpuset_lookup(cpusetid_t setid, struct thread *td) } /* - * Create a set in the space provided in 'set' with the provided parameters. + * Initialize a set in the space provided in 'set' with the provided parameters. * The set is returned with a single ref. May return EDEADLK if the set * will have no valid cpu based on restrictions from the parent. */ static int -_cpuset_create(struct cpuset *set, struct cpuset *parent, +cpuset_init(struct cpuset *set, struct cpuset *parent, const cpuset_t *mask, struct domainset *domain, cpusetid_t id) { @@ -347,7 +347,7 @@ cpuset_create(struct cpuset **setp, struct cpuset *par set = *setp; else *setp = set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO); - error = _cpuset_create(set, parent, mask, NULL, id); + error = cpuset_init(set, parent, mask, NULL, id); if (error == 0) return (0); free_unr(cpuset_unr, id); @@ -983,7 +983,7 @@ cpuset_shadow(struct cpuset *set, struct cpuset **nset else d = set->cs_domain; nset = LIST_FIRST(cpusets); - error = _cpuset_create(nset, parent, mask, d, CPUSET_INVALID); + error = cpuset_init(nset, parent, mask, d, CPUSET_INVALID); if (error == 0) { LIST_REMOVE(nset, cs_link); *nsetp = nset; @@ -1463,9 +1463,7 @@ domainset_zero(void) * sets: * * 0 - The root set which should represent all valid processors in the - * system. It is initially created with a mask of all processors - * because we don't know what processors are valid until cpuset_init() - * runs. This set is immutable. + * system. This set is immutable. * 1 - The default set which all processes are a member of until changed. * This allows an administrator to move all threads off of given cpus to * dedicate them to high priority tasks or save power etc. @@ -1502,14 +1500,14 @@ cpuset_thread0(void) * Now derive a default (1), modifiable set from that to give out. */ set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO); - error = _cpuset_create(set, cpuset_zero, NULL, NULL, 1); + error = cpuset_init(set, cpuset_zero, NULL, NULL, 1); KASSERT(error == 0, ("Error creating default set: %d\n", error)); cpuset_default = set; /* * Create the kernel set (2). */ set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO); - error = _cpuset_create(set, cpuset_zero, NULL, NULL, 2); + error = cpuset_init(set, cpuset_zero, NULL, NULL, 2); KASSERT(error == 0, ("Error creating kernel set: %d\n", error)); set->cs_domain = &domainset2; cpuset_kernel = set; From owner-svn-src-all@freebsd.org Wed Nov 25 03:14:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 081D7473047; Wed, 25 Nov 2020 03:14:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgmFs6pzmz4SDS; Wed, 25 Nov 2020 03:14: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 DCD96215F; Wed, 25 Nov 2020 03:14: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 0AP3EPJE080940; Wed, 25 Nov 2020 03:14:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AP3EPcL080939; Wed, 25 Nov 2020 03:14:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011250314.0AP3EPcL080939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Nov 2020 03:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368011 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 368011 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 03:14:26 -0000 Author: kevans Date: Wed Nov 25 03:14:25 2020 New Revision: 368011 URL: https://svnweb.freebsd.org/changeset/base/368011 Log: kern: cpuset: properly rebase when attaching to a jail The current logic is a fine choice for a system administrator modifying process cpusets or a process creating a new cpuset(2), but not ideal for processes attaching to a jail. Currently, when a process attaches to a jail, it does exactly what any other process does and loses any mask it might have applied in the process of doing so because cpuset_setproc() is entirely based around the assumption that non-anonymous cpusets in the process can be replaced with the new parent set. This approach slightly improves the jail attach integration by modifying cpuset_setproc() callers to indicate if they should rebase their cpuset to the indicated set or not (i.e. cpuset_setproc_update_set). If we're rebasing and the process currently has a cpuset assigned that is not the containing jail's root set, then we will now create a new base set for it hanging off the jail's root with the existing mask applied instead of using the jail's root set as the new base set. Note that the common case will be that the process doesn't have a cpuset within the jail root, but the system root can freely assign a cpuset from a jail to a process outside of the jail with no restriction. We assume that that may have happened or that it could happen due to a race when we drop the proc lock, so we must recheck both within the loop to gather up sufficient freed cpusets and after the loop. To recap, here's how it worked before in all cases: 0 4 <-- jail 0 4 <-- jail / process | | 1 -> 1 | 3 <-- process Here's how it works now: 0 4 <-- jail 0 4 <-- jail | | | 1 -> 1 5 <-- process | 3 <-- process or 0 4 <-- jail 0 4 <-- jail / process | | 1 <-- process -> 1 More importantly, in both cases, the attaching process still retains the mask it had prior to attaching or the attach fails with EDEADLK if it's left with no CPUs to run on or the domain policy is incompatible. The author of this patch considers this almost a security feature, because a MAC policy could grant PRIV_JAIL_ATTACH to an unprivileged user that's restricted to some subset of available CPUs the ability to attach to a jail, which might lift the user's restrictions if they attach to a jail with a wider mask. In most cases, it's anticipated that admins will use this to be able to, for example, `cpuset -c -l 1 jail -c path=/ command=/long/running/cmd`, and avoid the need for contortions to spawn a command inside a jail with a more limited cpuset than the jail. Reviewed by: jamie MFC after: 1 month (maybe) Differential Revision: https://reviews.freebsd.org/D27298 Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Wed Nov 25 02:12:24 2020 (r368010) +++ head/sys/kern/kern_cpuset.c Wed Nov 25 03:14:25 2020 (r368011) @@ -1104,14 +1104,63 @@ cpuset_setproc_setthread(struct cpuset *tdset, struct domainlist); } +static int +cpuset_setproc_newbase(struct thread *td, struct cpuset *set, + struct cpuset *nroot, struct cpuset **nsetp, + struct setlist *cpusets, struct domainlist *domainlist) +{ + struct domainset ndomain; + cpuset_t nmask; + struct cpuset *pbase; + int error; + + pbase = cpuset_getbase(td->td_cpuset); + + /* Copy process mask, then further apply the new root mask. */ + CPU_COPY(&pbase->cs_mask, &nmask); + CPU_AND(&nmask, &nroot->cs_mask); + + domainset_copy(pbase->cs_domain, &ndomain); + DOMAINSET_AND(&ndomain.ds_mask, &set->cs_domain->ds_mask); + + /* Policy is too restrictive, will not work. */ + if (CPU_EMPTY(&nmask) || DOMAINSET_EMPTY(&ndomain.ds_mask)) + return (EDEADLK); + + /* + * Remove pbase from the freelist in advance, it'll be pushed to + * cpuset_ids on success. We assume here that cpuset_create() will not + * touch pbase on failure, and we just enqueue it back to the freelist + * to remain in a consistent state. + */ + pbase = LIST_FIRST(cpusets); + LIST_REMOVE(pbase, cs_link); + error = cpuset_create(&pbase, set, &nmask); + if (error != 0) { + LIST_INSERT_HEAD(cpusets, pbase, cs_link); + return (error); + } + + /* Duplicates some work from above... oh well. */ + pbase->cs_domain = domainset_shadow(set->cs_domain, &ndomain, + domainlist); + *nsetp = pbase; + return (0); +} + /* - * Handle three cases for updating an entire process. + * Handle four cases for updating an entire process. * - * 1) Set is non-null. This reparents all anonymous sets to the provided - * set and replaces all non-anonymous td_cpusets with the provided set. - * 2) Mask is non-null. This replaces or creates anonymous sets for every + * 1) Set is non-null and the process is not rebasing onto a new root. This + * reparents all anonymous sets to the provided set and replaces all + * non-anonymous td_cpusets with the provided set. + * 2) Set is non-null and the process is rebasing onto a new root. This + * creates a new base set if the process previously had its own base set, + * then reparents all anonymous sets either to that set or the provided set + * if one was not created. Non-anonymous sets are similarly replaced. + * 3) Mask is non-null. This replaces or creates anonymous sets for every * thread with the existing base as a parent. - * 3) domain is non-null. This creates anonymous sets for every thread + * 4) domain is non-null. This creates anonymous sets for every thread * and replaces the domain set. * * This is overly complicated because we can't allocate while holding a @@ -1120,15 +1169,15 @@ cpuset_setproc_setthread(struct cpuset *tdset, struct */ static int cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t *mask, - struct domainset *domain) + struct domainset *domain, bool rebase) { struct setlist freelist; struct setlist droplist; struct domainlist domainlist; - struct cpuset *nset; + struct cpuset *base, *nset, *nroot, *tdroot; struct thread *td; struct proc *p; - int threads; + int needed; int nfree; int error; @@ -1144,22 +1193,50 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t nfree = 1; LIST_INIT(&droplist); nfree = 0; + base = set; + nroot = NULL; + if (set != NULL) + nroot = cpuset_getroot(set); for (;;) { error = cpuset_which(CPU_WHICH_PID, pid, &p, &td, &nset); if (error) goto out; - if (nfree >= p->p_numthreads) + tdroot = cpuset_getroot(td->td_cpuset); + needed = p->p_numthreads; + if (set != NULL && rebase && tdroot != nroot) + needed++; + if (nfree >= needed) break; - threads = p->p_numthreads; PROC_UNLOCK(p); - if (nfree < threads) { - cpuset_freelist_add(&freelist, threads - nfree); - domainset_freelist_add(&domainlist, threads - nfree); - nfree = threads; + if (nfree < needed) { + cpuset_freelist_add(&freelist, needed - nfree); + domainset_freelist_add(&domainlist, needed - nfree); + nfree = needed; } } PROC_LOCK_ASSERT(p, MA_OWNED); + /* + * If we're changing roots and the root set is what has been specified + * as the parent, then we'll check if the process was previously using + * the root set and, if it wasn't, create a new base with the process's + * mask applied to it. + */ + if (set != NULL && rebase && nroot != tdroot) { + cpusetid_t base_id, root_id; + + root_id = td->td_ucred->cr_prison->pr_cpuset->cs_id; + base_id = cpuset_getbase(td->td_cpuset)->cs_id; + + if (base_id != root_id) { + error = cpuset_setproc_newbase(td, set, nroot, &base, + &freelist, &domainlist); + if (error != 0) + goto unlock_out; + } + } + + /* * Now that the appropriate locks are held and we have enough cpusets, * make sure the operation will succeed before applying changes. The * proc lock prevents td_cpuset from changing between calls. @@ -1169,7 +1246,7 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t thread_lock(td); if (set != NULL) error = cpuset_setproc_test_setthread(td->td_cpuset, - set); + base); else error = cpuset_setproc_test_maskthread(td->td_cpuset, mask, domain); @@ -1185,7 +1262,7 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); if (set != NULL) - error = cpuset_setproc_setthread(td->td_cpuset, set, + error = cpuset_setproc_setthread(td->td_cpuset, base, &nset, &freelist, &domainlist); else error = cpuset_setproc_maskthread(td->td_cpuset, mask, @@ -1200,6 +1277,8 @@ cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t unlock_out: PROC_UNLOCK(p); out: + if (base != NULL && base != set) + cpuset_rel(base); while ((nset = LIST_FIRST(&droplist)) != NULL) cpuset_rel_complete(nset); cpuset_freelist_free(&freelist); @@ -1584,7 +1663,7 @@ cpuset_setproc_update_set(struct proc *p, struct cpuse KASSERT(set != NULL, ("[%s:%d] invalid set", __func__, __LINE__)); cpuset_ref(set); - error = cpuset_setproc(p->p_pid, set, NULL, NULL); + error = cpuset_setproc(p->p_pid, set, NULL, NULL, true); if (error) return (error); cpuset_rel(set); @@ -1634,7 +1713,7 @@ sys_cpuset(struct thread *td, struct cpuset_args *uap) return (error); error = copyout(&set->cs_id, uap->setid, sizeof(set->cs_id)); if (error == 0) - error = cpuset_setproc(-1, set, NULL, NULL); + error = cpuset_setproc(-1, set, NULL, NULL, false); cpuset_rel(set); return (error); } @@ -1668,7 +1747,7 @@ kern_cpuset_setid(struct thread *td, cpuwhich_t which, set = cpuset_lookup(setid, td); if (set == NULL) return (ESRCH); - error = cpuset_setproc(id, set, NULL, NULL); + error = cpuset_setproc(id, set, NULL, NULL, false); cpuset_rel(set); return (error); } @@ -1942,7 +2021,7 @@ kern_cpuset_setaffinity(struct thread *td, cpulevel_t error = cpuset_setthread(id, mask); break; case CPU_WHICH_PID: - error = cpuset_setproc(id, NULL, mask, NULL); + error = cpuset_setproc(id, NULL, mask, NULL, false); break; case CPU_WHICH_CPUSET: case CPU_WHICH_JAIL: @@ -2226,7 +2305,7 @@ kern_cpuset_setdomain(struct thread *td, cpulevel_t le error = _cpuset_setthread(id, NULL, &domain); break; case CPU_WHICH_PID: - error = cpuset_setproc(id, NULL, NULL, &domain); + error = cpuset_setproc(id, NULL, NULL, &domain, false); break; case CPU_WHICH_CPUSET: case CPU_WHICH_JAIL: From owner-svn-src-all@freebsd.org Wed Nov 25 03:24:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51E2B47342F; Wed, 25 Nov 2020 03:24:44 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgmTm1jfMz4Spk; Wed, 25 Nov 2020 03:24:44 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22C7D2695; Wed, 25 Nov 2020 03:24:44 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AP3Oion086937; Wed, 25 Nov 2020 03:24:44 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AP3OhHV086935; Wed, 25 Nov 2020 03:24:43 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202011250324.0AP3OhHV086935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 25 Nov 2020 03:24:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368012 - in stable/12: share/man/man4 sys/contrib/ena-com sys/contrib/ena-com/ena_defs sys/dev/ena sys/modules/ena X-SVN-Group: stable-12 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/contrib/ena-com sys/contrib/ena-com/ena_defs sys/dev/ena sys/modules/ena X-SVN-Commit-Revision: 368012 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 03:24:44 -0000 Author: mw Date: Wed Nov 25 03:24:43 2020 New Revision: 368012 URL: https://svnweb.freebsd.org/changeset/base/368012 Log: MFC: Merge ENA v2.3.0 driver r367805 Update ENA driver version to v2.3.0 r367803 Rename descriptions of the supported ENA devices r367802 Add ENI metrics for the ENA driver r367801 Add SPDX license tag to the ENA driver files r367800 Add Rx offsets support for the ENA driver r367799 Adjust ENA driver files to latest ena-com changes r367795 Fix completion descriptors alignment for the ENA Obtained from: Semihalf Sponsored by: Amazon, Inc Modified: stable/12/share/man/man4/ena.4 stable/12/sys/contrib/ena-com/ena_com.c stable/12/sys/contrib/ena-com/ena_com.h stable/12/sys/contrib/ena-com/ena_defs/ena_admin_defs.h stable/12/sys/contrib/ena-com/ena_defs/ena_common_defs.h stable/12/sys/contrib/ena-com/ena_defs/ena_eth_io_defs.h stable/12/sys/contrib/ena-com/ena_defs/ena_gen_info.h stable/12/sys/contrib/ena-com/ena_defs/ena_regs_defs.h stable/12/sys/contrib/ena-com/ena_eth_com.c stable/12/sys/contrib/ena-com/ena_eth_com.h stable/12/sys/contrib/ena-com/ena_plat.h stable/12/sys/dev/ena/ena.c stable/12/sys/dev/ena/ena.h stable/12/sys/dev/ena/ena_datapath.c stable/12/sys/dev/ena/ena_datapath.h stable/12/sys/dev/ena/ena_netmap.c stable/12/sys/dev/ena/ena_netmap.h stable/12/sys/dev/ena/ena_sysctl.c stable/12/sys/dev/ena/ena_sysctl.h stable/12/sys/modules/ena/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/ena.4 ============================================================================== --- stable/12/share/man/man4/ena.4 Wed Nov 25 03:14:25 2020 (r368011) +++ stable/12/share/man/man4/ena.4 Wed Nov 25 03:24:43 2020 (r368012) @@ -1,4 +1,6 @@ -.\" Copyright (c) 2015-2017 Amazon.com, Inc. or its affiliates. +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: stable/12/sys/contrib/ena-com/ena_com.c ============================================================================== --- stable/12/sys/contrib/ena-com/ena_com.c Wed Nov 25 03:14:25 2020 (r368011) +++ stable/12/sys/contrib/ena-com/ena_com.c Wed Nov 25 03:24:43 2020 (r368012) @@ -1,5 +1,5 @@ /*- - * BSD LICENSE + * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. * All rights reserved. @@ -70,9 +70,9 @@ #define ENA_REGS_ADMIN_INTR_MASK 1 -#define ENA_MIN_POLL_US 100 +#define ENA_MIN_ADMIN_POLL_US 100 -#define ENA_MAX_POLL_US 5000 +#define ENA_MAX_ADMIN_POLL_US 5000 /*****************************************************************************/ /*****************************************************************************/ @@ -106,7 +106,7 @@ static int ena_com_mem_addr_set(struct ena_com_dev *en dma_addr_t addr) { if ((addr & GENMASK_ULL(ena_dev->dma_addr_bits - 1, 0)) != addr) { - ena_trc_err("dma address has more bits that the device supports\n"); + ena_trc_err(ena_dev, "DMA address has more bits that the device supports\n"); return ENA_COM_INVAL; } @@ -116,16 +116,17 @@ static int ena_com_mem_addr_set(struct ena_com_dev *en return 0; } -static int ena_com_admin_init_sq(struct ena_com_admin_queue *queue) +static int ena_com_admin_init_sq(struct ena_com_admin_queue *admin_queue) { - struct ena_com_admin_sq *sq = &queue->sq; - u16 size = ADMIN_SQ_SIZE(queue->q_depth); + struct ena_com_dev *ena_dev = admin_queue->ena_dev; + struct ena_com_admin_sq *sq = &admin_queue->sq; + u16 size = ADMIN_SQ_SIZE(admin_queue->q_depth); - ENA_MEM_ALLOC_COHERENT(queue->q_dmadev, size, sq->entries, sq->dma_addr, + ENA_MEM_ALLOC_COHERENT(admin_queue->q_dmadev, size, sq->entries, sq->dma_addr, sq->mem_handle); if (!sq->entries) { - ena_trc_err("memory allocation failed\n"); + ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -138,16 +139,17 @@ static int ena_com_admin_init_sq(struct ena_com_admin_ return 0; } -static int ena_com_admin_init_cq(struct ena_com_admin_queue *queue) +static int ena_com_admin_init_cq(struct ena_com_admin_queue *admin_queue) { - struct ena_com_admin_cq *cq = &queue->cq; - u16 size = ADMIN_CQ_SIZE(queue->q_depth); + struct ena_com_dev *ena_dev = admin_queue->ena_dev; + struct ena_com_admin_cq *cq = &admin_queue->cq; + u16 size = ADMIN_CQ_SIZE(admin_queue->q_depth); - ENA_MEM_ALLOC_COHERENT(queue->q_dmadev, size, cq->entries, cq->dma_addr, + ENA_MEM_ALLOC_COHERENT(admin_queue->q_dmadev, size, cq->entries, cq->dma_addr, cq->mem_handle); if (!cq->entries) { - ena_trc_err("memory allocation failed\n"); + ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -157,22 +159,22 @@ static int ena_com_admin_init_cq(struct ena_com_admin_ return 0; } -static int ena_com_admin_init_aenq(struct ena_com_dev *dev, +static int ena_com_admin_init_aenq(struct ena_com_dev *ena_dev, struct ena_aenq_handlers *aenq_handlers) { - struct ena_com_aenq *aenq = &dev->aenq; + struct ena_com_aenq *aenq = &ena_dev->aenq; u32 addr_low, addr_high, aenq_caps; u16 size; - dev->aenq.q_depth = ENA_ASYNC_QUEUE_DEPTH; + ena_dev->aenq.q_depth = ENA_ASYNC_QUEUE_DEPTH; size = ADMIN_AENQ_SIZE(ENA_ASYNC_QUEUE_DEPTH); - ENA_MEM_ALLOC_COHERENT(dev->dmadev, size, + ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev, size, aenq->entries, aenq->dma_addr, aenq->mem_handle); if (!aenq->entries) { - ena_trc_err("memory allocation failed\n"); + ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -182,18 +184,18 @@ static int ena_com_admin_init_aenq(struct ena_com_dev addr_low = ENA_DMA_ADDR_TO_UINT32_LOW(aenq->dma_addr); addr_high = ENA_DMA_ADDR_TO_UINT32_HIGH(aenq->dma_addr); - ENA_REG_WRITE32(dev->bus, addr_low, dev->reg_bar + ENA_REGS_AENQ_BASE_LO_OFF); - ENA_REG_WRITE32(dev->bus, addr_high, dev->reg_bar + ENA_REGS_AENQ_BASE_HI_OFF); + ENA_REG_WRITE32(ena_dev->bus, addr_low, ena_dev->reg_bar + ENA_REGS_AENQ_BASE_LO_OFF); + ENA_REG_WRITE32(ena_dev->bus, addr_high, ena_dev->reg_bar + ENA_REGS_AENQ_BASE_HI_OFF); aenq_caps = 0; - aenq_caps |= dev->aenq.q_depth & ENA_REGS_AENQ_CAPS_AENQ_DEPTH_MASK; + aenq_caps |= ena_dev->aenq.q_depth & ENA_REGS_AENQ_CAPS_AENQ_DEPTH_MASK; aenq_caps |= (sizeof(struct ena_admin_aenq_entry) << ENA_REGS_AENQ_CAPS_AENQ_ENTRY_SIZE_SHIFT) & ENA_REGS_AENQ_CAPS_AENQ_ENTRY_SIZE_MASK; - ENA_REG_WRITE32(dev->bus, aenq_caps, dev->reg_bar + ENA_REGS_AENQ_CAPS_OFF); + ENA_REG_WRITE32(ena_dev->bus, aenq_caps, ena_dev->reg_bar + ENA_REGS_AENQ_CAPS_OFF); if (unlikely(!aenq_handlers)) { - ena_trc_err("aenq handlers pointer is NULL\n"); + ena_trc_err(ena_dev, "AENQ handlers pointer is NULL\n"); return ENA_COM_INVAL; } @@ -209,31 +211,34 @@ static void comp_ctxt_release(struct ena_com_admin_que ATOMIC32_DEC(&queue->outstanding_cmds); } -static struct ena_comp_ctx *get_comp_ctxt(struct ena_com_admin_queue *queue, +static struct ena_comp_ctx *get_comp_ctxt(struct ena_com_admin_queue *admin_queue, u16 command_id, bool capture) { - if (unlikely(command_id >= queue->q_depth)) { - ena_trc_err("command id is larger than the queue size. cmd_id: %u queue size %d\n", - command_id, queue->q_depth); + if (unlikely(command_id >= admin_queue->q_depth)) { + ena_trc_err(admin_queue->ena_dev, + "Command id is larger than the queue size. cmd_id: %u queue size %d\n", + command_id, admin_queue->q_depth); return NULL; } - if (unlikely(!queue->comp_ctx)) { - ena_trc_err("Completion context is NULL\n"); + if (unlikely(!admin_queue->comp_ctx)) { + ena_trc_err(admin_queue->ena_dev, + "Completion context is NULL\n"); return NULL; } - if (unlikely(queue->comp_ctx[command_id].occupied && capture)) { - ena_trc_err("Completion context is occupied\n"); + if (unlikely(admin_queue->comp_ctx[command_id].occupied && capture)) { + ena_trc_err(admin_queue->ena_dev, + "Completion context is occupied\n"); return NULL; } if (capture) { - ATOMIC32_INC(&queue->outstanding_cmds); - queue->comp_ctx[command_id].occupied = true; + ATOMIC32_INC(&admin_queue->outstanding_cmds); + admin_queue->comp_ctx[command_id].occupied = true; } - return &queue->comp_ctx[command_id]; + return &admin_queue->comp_ctx[command_id]; } static struct ena_comp_ctx *__ena_com_submit_admin_cmd(struct ena_com_admin_queue *admin_queue, @@ -254,7 +259,7 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd /* In case of queue FULL */ cnt = (u16)ATOMIC32_READ(&admin_queue->outstanding_cmds); if (cnt >= admin_queue->q_depth) { - ena_trc_dbg("admin queue is full.\n"); + ena_trc_dbg(admin_queue->ena_dev, "Admin queue is full.\n"); admin_queue->stats.out_of_space++; return ERR_PTR(ENA_COM_NO_SPACE); } @@ -296,20 +301,21 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd return comp_ctx; } -static int ena_com_init_comp_ctxt(struct ena_com_admin_queue *queue) +static int ena_com_init_comp_ctxt(struct ena_com_admin_queue *admin_queue) { - size_t size = queue->q_depth * sizeof(struct ena_comp_ctx); + struct ena_com_dev *ena_dev = admin_queue->ena_dev; + size_t size = admin_queue->q_depth * sizeof(struct ena_comp_ctx); struct ena_comp_ctx *comp_ctx; u16 i; - queue->comp_ctx = ENA_MEM_ALLOC(queue->q_dmadev, size); - if (unlikely(!queue->comp_ctx)) { - ena_trc_err("memory allocation failed\n"); + admin_queue->comp_ctx = ENA_MEM_ALLOC(admin_queue->q_dmadev, size); + if (unlikely(!admin_queue->comp_ctx)) { + ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } - for (i = 0; i < queue->q_depth; i++) { - comp_ctx = get_comp_ctxt(queue, i, false); + for (i = 0; i < admin_queue->q_depth; i++) { + comp_ctx = get_comp_ctxt(admin_queue, i, false); if (comp_ctx) ENA_WAIT_EVENT_INIT(comp_ctx->wait_event); } @@ -377,7 +383,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ } if (!io_sq->desc_addr.virt_addr) { - ena_trc_err("memory allocation failed\n"); + ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } } @@ -402,7 +408,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ io_sq->bounce_buf_ctrl.base_buffer = ENA_MEM_ALLOC(ena_dev->dmadev, size); if (!io_sq->bounce_buf_ctrl.base_buffer) { - ena_trc_err("bounce buffer memory allocation failed\n"); + ena_trc_err(ena_dev, "Bounce buffer memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -449,23 +455,25 @@ static int ena_com_init_io_cq(struct ena_com_dev *ena_ size = io_cq->cdesc_entry_size_in_bytes * io_cq->q_depth; io_cq->bus = ena_dev->bus; - ENA_MEM_ALLOC_COHERENT_NODE(ena_dev->dmadev, - size, - io_cq->cdesc_addr.virt_addr, - io_cq->cdesc_addr.phys_addr, - io_cq->cdesc_addr.mem_handle, - ctx->numa_node, - prev_node); + ENA_MEM_ALLOC_COHERENT_NODE_ALIGNED(ena_dev->dmadev, + size, + io_cq->cdesc_addr.virt_addr, + io_cq->cdesc_addr.phys_addr, + io_cq->cdesc_addr.mem_handle, + ctx->numa_node, + prev_node, + ENA_CDESC_RING_SIZE_ALIGNMENT); if (!io_cq->cdesc_addr.virt_addr) { - ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev, - size, - io_cq->cdesc_addr.virt_addr, - io_cq->cdesc_addr.phys_addr, - io_cq->cdesc_addr.mem_handle); + ENA_MEM_ALLOC_COHERENT_ALIGNED(ena_dev->dmadev, + size, + io_cq->cdesc_addr.virt_addr, + io_cq->cdesc_addr.phys_addr, + io_cq->cdesc_addr.mem_handle, + ENA_CDESC_RING_SIZE_ALIGNMENT); } if (!io_cq->cdesc_addr.virt_addr) { - ena_trc_err("memory allocation failed\n"); + ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -486,7 +494,8 @@ static void ena_com_handle_single_admin_completion(str comp_ctx = get_comp_ctxt(admin_queue, cmd_id, false); if (unlikely(!comp_ctx)) { - ena_trc_err("comp_ctx is NULL. Changing the admin queue running state\n"); + ena_trc_err(admin_queue->ena_dev, + "comp_ctx is NULL. Changing the admin queue running state\n"); admin_queue->running_state = false; return; } @@ -538,10 +547,12 @@ static void ena_com_handle_admin_completion(struct ena admin_queue->stats.completed_cmd += comp_num; } -static int ena_com_comp_status_to_errno(u8 comp_status) +static int ena_com_comp_status_to_errno(struct ena_com_admin_queue *admin_queue, + u8 comp_status) { if (unlikely(comp_status != 0)) - ena_trc_err("admin command failed[%u]\n", comp_status); + ena_trc_err(admin_queue->ena_dev, + "Admin command failed[%u]\n", comp_status); switch (comp_status) { case ENA_ADMIN_SUCCESS: @@ -555,15 +566,17 @@ static int ena_com_comp_status_to_errno(u8 comp_status case ENA_ADMIN_ILLEGAL_PARAMETER: case ENA_ADMIN_UNKNOWN_ERROR: return ENA_COM_INVAL; + case ENA_ADMIN_RESOURCE_BUSY: + return ENA_COM_TRY_AGAIN; } return ENA_COM_INVAL; } -static inline void ena_delay_exponential_backoff_us(u32 exp, u32 delay_us) +static void ena_delay_exponential_backoff_us(u32 exp, u32 delay_us) { - delay_us = ENA_MAX32(ENA_MIN_POLL_US, delay_us); - delay_us = ENA_MIN32(delay_us * (1 << exp), ENA_MAX_POLL_US); + delay_us = ENA_MAX32(ENA_MIN_ADMIN_POLL_US, delay_us); + delay_us = ENA_MIN32(delay_us * (1U << exp), ENA_MAX_ADMIN_POLL_US); ENA_USLEEP(delay_us); } @@ -586,7 +599,8 @@ static int ena_com_wait_and_process_admin_cq_polling(s break; if (ENA_TIME_EXPIRE(timeout)) { - ena_trc_err("Wait for completion (polling) timeout\n"); + ena_trc_err(admin_queue->ena_dev, + "Wait for completion (polling) timeout\n"); /* ENA didn't have any completion */ ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); admin_queue->stats.no_completion++; @@ -597,11 +611,12 @@ static int ena_com_wait_and_process_admin_cq_polling(s goto err; } - ena_delay_exponential_backoff_us(exp++, admin_queue->ena_dev->ena_min_poll_delay_us); + ena_delay_exponential_backoff_us(exp++, + admin_queue->ena_dev->ena_min_poll_delay_us); } if (unlikely(comp_ctx->status == ENA_CMD_ABORTED)) { - ena_trc_err("Command was aborted\n"); + ena_trc_err(admin_queue->ena_dev, "Command was aborted\n"); ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); admin_queue->stats.aborted_cmd++; ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); @@ -610,15 +625,16 @@ static int ena_com_wait_and_process_admin_cq_polling(s } ENA_WARN(comp_ctx->status != ENA_CMD_COMPLETED, - "Invalid comp status %d\n", comp_ctx->status); + admin_queue->ena_dev, "Invalid comp status %d\n", + comp_ctx->status); - ret = ena_com_comp_status_to_errno(comp_ctx->comp_status); + ret = ena_com_comp_status_to_errno(admin_queue, comp_ctx->comp_status); err: comp_ctxt_release(admin_queue, comp_ctx); return ret; } -/** +/* * Set the LLQ configurations of the firmware * * The driver provides only the enabled feature values to the device, @@ -643,14 +659,10 @@ static int ena_com_set_llq(struct ena_com_dev *ena_dev cmd.u.llq.desc_num_before_header_enabled = llq_info->descs_num_before_header; cmd.u.llq.descriptors_stride_ctrl_enabled = llq_info->desc_stride_ctrl; - if (llq_info->disable_meta_caching) - cmd.u.llq.accel_mode.u.set.enabled_flags |= - BIT(ENA_ADMIN_DISABLE_META_CACHING); + cmd.u.llq.accel_mode.u.set.enabled_flags = + BIT(ENA_ADMIN_DISABLE_META_CACHING) | + BIT(ENA_ADMIN_LIMIT_TX_BURST); - if (llq_info->max_entries_in_tx_burst) - cmd.u.llq.accel_mode.u.set.enabled_flags |= - BIT(ENA_ADMIN_LIMIT_TX_BURST); - ret = ena_com_execute_admin_command(admin_queue, (struct ena_admin_aq_entry *)&cmd, sizeof(cmd), @@ -658,7 +670,7 @@ static int ena_com_set_llq(struct ena_com_dev *ena_dev sizeof(resp)); if (unlikely(ret)) - ena_trc_err("Failed to set LLQ configurations: %d\n", ret); + ena_trc_err(ena_dev, "Failed to set LLQ configurations: %d\n", ret); return ret; } @@ -668,6 +680,7 @@ static int ena_com_config_llq_info(struct ena_com_dev struct ena_llq_configurations *llq_default_cfg) { struct ena_com_llq_info *llq_info = &ena_dev->llq_info; + struct ena_admin_accel_mode_get llq_accel_mode_get; u16 supported_feat; int rc; @@ -679,7 +692,7 @@ static int ena_com_config_llq_info(struct ena_com_dev llq_info->header_location_ctrl = llq_default_cfg->llq_header_location; } else { - ena_trc_err("Invalid header location control, supported: 0x%x\n", + ena_trc_err(ena_dev, "Invalid header location control, supported: 0x%x\n", supported_feat); return -EINVAL; } @@ -694,12 +707,12 @@ static int ena_com_config_llq_info(struct ena_com_dev } else if (supported_feat & ENA_ADMIN_SINGLE_DESC_PER_ENTRY) { llq_info->desc_stride_ctrl = ENA_ADMIN_SINGLE_DESC_PER_ENTRY; } else { - ena_trc_err("Invalid desc_stride_ctrl, supported: 0x%x\n", + ena_trc_err(ena_dev, "Invalid desc_stride_ctrl, supported: 0x%x\n", supported_feat); return -EINVAL; } - ena_trc_err("Default llq stride ctrl is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", + ena_trc_err(ena_dev, "Default llq stride ctrl is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", llq_default_cfg->llq_stride_ctrl, supported_feat, llq_info->desc_stride_ctrl); @@ -723,11 +736,12 @@ static int ena_com_config_llq_info(struct ena_com_dev llq_info->desc_list_entry_size_ctrl = ENA_ADMIN_LIST_ENTRY_SIZE_256B; llq_info->desc_list_entry_size = 256; } else { - ena_trc_err("Invalid entry_size_ctrl, supported: 0x%x\n", supported_feat); + ena_trc_err(ena_dev, "Invalid entry_size_ctrl, supported: 0x%x\n", + supported_feat); return -EINVAL; } - ena_trc_err("Default llq ring entry size is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", + ena_trc_err(ena_dev, "Default llq ring entry size is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", llq_default_cfg->llq_ring_entry_size, supported_feat, llq_info->desc_list_entry_size); @@ -736,7 +750,7 @@ static int ena_com_config_llq_info(struct ena_com_dev /* The desc list entry size should be whole multiply of 8 * This requirement comes from __iowrite64_copy() */ - ena_trc_err("illegal entry size %d\n", + ena_trc_err(ena_dev, "Illegal entry size %d\n", llq_info->desc_list_entry_size); return -EINVAL; } @@ -760,29 +774,31 @@ static int ena_com_config_llq_info(struct ena_com_dev } else if (supported_feat & ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_8) { llq_info->descs_num_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_8; } else { - ena_trc_err("Invalid descs_num_before_header, supported: 0x%x\n", + ena_trc_err(ena_dev, "Invalid descs_num_before_header, supported: 0x%x\n", supported_feat); return -EINVAL; } - ena_trc_err("Default llq num descs before header is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", + ena_trc_err(ena_dev, "Default llq num descs before header is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", llq_default_cfg->llq_num_decs_before_header, supported_feat, llq_info->descs_num_before_header); } /* Check for accelerated queue supported */ + llq_accel_mode_get = llq_features->accel_mode.u.get; + llq_info->disable_meta_caching = - llq_features->accel_mode.u.get.supported_flags & - BIT(ENA_ADMIN_DISABLE_META_CACHING); + !!(llq_accel_mode_get.supported_flags & + BIT(ENA_ADMIN_DISABLE_META_CACHING)); - if (llq_features->accel_mode.u.get.supported_flags & BIT(ENA_ADMIN_LIMIT_TX_BURST)) + if (llq_accel_mode_get.supported_flags & BIT(ENA_ADMIN_LIMIT_TX_BURST)) llq_info->max_entries_in_tx_burst = - llq_features->accel_mode.u.get.max_tx_burst_size / + llq_accel_mode_get.max_tx_burst_size / llq_default_cfg->llq_ring_entry_size_value; rc = ena_com_set_llq(ena_dev); if (rc) - ena_trc_err("Cannot set LLQ configuration: %d\n", rc); + ena_trc_err(ena_dev, "Cannot set LLQ configuration: %d\n", rc); return rc; } @@ -808,13 +824,15 @@ static int ena_com_wait_and_process_admin_cq_interrupt ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); if (comp_ctx->status == ENA_CMD_COMPLETED) { - ena_trc_err("The ena device sent a completion but the driver didn't receive a MSI-X interrupt (cmd %d), autopolling mode is %s\n", + ena_trc_err(admin_queue->ena_dev, + "The ena device sent a completion but the driver didn't receive a MSI-X interrupt (cmd %d), autopolling mode is %s\n", comp_ctx->cmd_opcode, admin_queue->auto_polling ? "ON" : "OFF"); /* Check if fallback to polling is enabled */ if (admin_queue->auto_polling) admin_queue->polling = true; } else { - ena_trc_err("The ena device didn't send a completion for the admin cmd %d status %d\n", + ena_trc_err(admin_queue->ena_dev, + "The ena device didn't send a completion for the admin cmd %d status %d\n", comp_ctx->cmd_opcode, comp_ctx->status); } /* Check if shifted to polling mode. @@ -828,7 +846,7 @@ static int ena_com_wait_and_process_admin_cq_interrupt } } - ret = ena_com_comp_status_to_errno(comp_ctx->comp_status); + ret = ena_com_comp_status_to_errno(admin_queue, comp_ctx->comp_status); err: comp_ctxt_release(admin_queue, comp_ctx); return ret; @@ -876,7 +894,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev * } if (unlikely(i == timeout)) { - ena_trc_err("reading reg failed for timeout. expected: req id[%hu] offset[%hu] actual: req id[%hu] offset[%hu]\n", + ena_trc_err(ena_dev, "Reading reg failed for timeout. expected: req id[%hu] offset[%hu] actual: req id[%hu] offset[%hu]\n", mmio_read->seq_num, offset, read_resp->req_id, @@ -886,7 +904,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev * } if (read_resp->reg_off != offset) { - ena_trc_err("Read failure: wrong offset provided\n"); + ena_trc_err(ena_dev, "Read failure: wrong offset provided\n"); ret = ENA_MMIO_READ_TIMEOUT; } else { ret = read_resp->reg_val; @@ -945,7 +963,7 @@ static int ena_com_destroy_io_sq(struct ena_com_dev *e sizeof(destroy_resp)); if (unlikely(ret && (ret != ENA_COM_NO_DEVICE))) - ena_trc_err("failed to destroy io sq error: %d\n", ret); + ena_trc_err(ena_dev, "Failed to destroy io sq error: %d\n", ret); return ret; } @@ -1001,7 +1019,7 @@ static int wait_for_reset_state(struct ena_com_dev *en val = ena_com_reg_bar_read32(ena_dev, ENA_REGS_DEV_STS_OFF); if (unlikely(val == ENA_MMIO_READ_TIMEOUT)) { - ena_trc_err("Reg read timeout occurred\n"); + ena_trc_err(ena_dev, "Reg read timeout occurred\n"); return ENA_COM_TIMER_EXPIRED; } @@ -1041,7 +1059,7 @@ static int ena_com_get_feature_ex(struct ena_com_dev * int ret; if (!ena_com_check_supported_feature_id(ena_dev, feature_id)) { - ena_trc_dbg("Feature %d isn't supported\n", feature_id); + ena_trc_dbg(ena_dev, "Feature %d isn't supported\n", feature_id); return ENA_COM_UNSUPPORTED; } @@ -1060,7 +1078,7 @@ static int ena_com_get_feature_ex(struct ena_com_dev * &get_cmd.control_buffer.address, control_buf_dma_addr); if (unlikely(ret)) { - ena_trc_err("memory address set failed\n"); + ena_trc_err(ena_dev, "Memory address set failed\n"); return ret; } @@ -1077,7 +1095,7 @@ static int ena_com_get_feature_ex(struct ena_com_dev * sizeof(*get_resp)); if (unlikely(ret)) - ena_trc_err("Failed to submit get_feature command %d error: %d\n", + ena_trc_err(ena_dev, "Failed to submit get_feature command %d error: %d\n", feature_id, ret); return ret; @@ -1108,13 +1126,9 @@ static void ena_com_hash_key_fill_default_key(struct e ENA_RSS_FILL_KEY(&hash_key->key, sizeof(hash_key->key)); /* The key buffer is stored in the device in an array of - * uint32 elements. Therefore the number of elements can be derived - * by dividing the buffer length by the size of each array element. - * In current implementation each element is sized at uint32_t - * so it's actually a division by 4 but if the element size changes, - * there is no need to rewrite this code. + * uint32 elements. */ - hash_key->keys_num = sizeof(hash_key->key) / sizeof(hash_key->key[0]); + hash_key->key_parts = ENA_ADMIN_RSS_KEY_PARTS; } static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev) @@ -1187,13 +1201,13 @@ static int ena_com_indirect_table_allocate(struct ena_ int ret; ret = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG, 0); + ENA_ADMIN_RSS_INDIRECTION_TABLE_CONFIG, 0); if (unlikely(ret)) return ret; if ((get_resp.u.ind_table.min_size > log_size) || (get_resp.u.ind_table.max_size < log_size)) { - ena_trc_err("indirect table size doesn't fit. requested size: %d while min is:%d and max %d\n", + ena_trc_err(ena_dev, "Indirect table size doesn't fit. requested size: %d while min is:%d and max %d\n", 1 << log_size, 1 << get_resp.u.ind_table.min_size, 1 << get_resp.u.ind_table.max_size); @@ -1297,7 +1311,7 @@ static int ena_com_create_io_sq(struct ena_com_dev *en &create_cmd.sq_ba, io_sq->desc_addr.phys_addr); if (unlikely(ret)) { - ena_trc_err("memory address set failed\n"); + ena_trc_err(ena_dev, "Memory address set failed\n"); return ret; } } @@ -1308,7 +1322,7 @@ static int ena_com_create_io_sq(struct ena_com_dev *en (struct ena_admin_acq_entry *)&cmd_completion, sizeof(cmd_completion)); if (unlikely(ret)) { - ena_trc_err("Failed to create IO SQ. error: %d\n", ret); + ena_trc_err(ena_dev, "Failed to create IO SQ. error: %d\n", ret); return ret; } @@ -1326,7 +1340,7 @@ static int ena_com_create_io_sq(struct ena_com_dev *en cmd_completion.llq_descriptors_offset); } - ena_trc_dbg("created sq[%u], depth[%u]\n", io_sq->idx, io_sq->q_depth); + ena_trc_dbg(ena_dev, "Created sq[%u], depth[%u]\n", io_sq->idx, io_sq->q_depth); return ret; } @@ -1360,7 +1374,7 @@ static void ena_com_update_intr_delay_resolution(struc u16 prev_intr_delay_resolution = ena_dev->intr_delay_resolution; if (unlikely(!intr_delay_resolution)) { - ena_trc_err("Illegal intr_delay_resolution provided. Going to use default 1 usec resolution\n"); + ena_trc_err(ena_dev, "Illegal intr_delay_resolution provided. Going to use default 1 usec resolution\n"); intr_delay_resolution = ENA_DEFAULT_INTR_DELAY_RESOLUTION; } @@ -1396,23 +1410,25 @@ int ena_com_execute_admin_command(struct ena_com_admin comp, comp_size); if (IS_ERR(comp_ctx)) { if (comp_ctx == ERR_PTR(ENA_COM_NO_DEVICE)) - ena_trc_dbg("Failed to submit command [%ld]\n", + ena_trc_dbg(admin_queue->ena_dev, + "Failed to submit command [%ld]\n", PTR_ERR(comp_ctx)); else - ena_trc_err("Failed to submit command [%ld]\n", + ena_trc_err(admin_queue->ena_dev, + "Failed to submit command [%ld]\n", PTR_ERR(comp_ctx)); - return PTR_ERR(comp_ctx); + return (int)PTR_ERR(comp_ctx); } ret = ena_com_wait_and_process_admin_cq(comp_ctx, admin_queue); if (unlikely(ret)) { if (admin_queue->running_state) - ena_trc_err("Failed to process command. ret = %d\n", - ret); + ena_trc_err(admin_queue->ena_dev, + "Failed to process command. ret = %d\n", ret); else - ena_trc_dbg("Failed to process command. ret = %d\n", - ret); + ena_trc_dbg(admin_queue->ena_dev, + "Failed to process command. ret = %d\n", ret); } return ret; } @@ -1441,7 +1457,7 @@ int ena_com_create_io_cq(struct ena_com_dev *ena_dev, &create_cmd.cq_ba, io_cq->cdesc_addr.phys_addr); if (unlikely(ret)) { - ena_trc_err("memory address set failed\n"); + ena_trc_err(ena_dev, "Memory address set failed\n"); return ret; } @@ -1451,7 +1467,7 @@ int ena_com_create_io_cq(struct ena_com_dev *ena_dev, (struct ena_admin_acq_entry *)&cmd_completion, sizeof(cmd_completion)); if (unlikely(ret)) { - ena_trc_err("Failed to create IO CQ. error: %d\n", ret); + ena_trc_err(ena_dev, "Failed to create IO CQ. error: %d\n", ret); return ret; } @@ -1470,7 +1486,7 @@ int ena_com_create_io_cq(struct ena_com_dev *ena_dev, (u32 __iomem *)((uintptr_t)ena_dev->reg_bar + cmd_completion.numa_node_register_offset); - ena_trc_dbg("created cq[%u], depth[%u]\n", io_cq->idx, io_cq->q_depth); + ena_trc_dbg(ena_dev, "Created cq[%u], depth[%u]\n", io_cq->idx, io_cq->q_depth); return ret; } @@ -1480,7 +1496,7 @@ int ena_com_get_io_handlers(struct ena_com_dev *ena_de struct ena_com_io_cq **io_cq) { if (qid >= ENA_TOTAL_NUM_QUEUES) { - ena_trc_err("Invalid queue number %d but the max is %d\n", + ena_trc_err(ena_dev, "Invalid queue number %d but the max is %d\n", qid, ENA_TOTAL_NUM_QUEUES); return ENA_COM_INVAL; } @@ -1546,7 +1562,7 @@ int ena_com_destroy_io_cq(struct ena_com_dev *ena_dev, sizeof(destroy_resp)); if (unlikely(ret && (ret != ENA_COM_NO_DEVICE))) - ena_trc_err("Failed to destroy IO CQ. error: %d\n", ret); + ena_trc_err(ena_dev, "Failed to destroy IO CQ. error: %d\n", ret); return ret; } @@ -1570,7 +1586,7 @@ void ena_com_admin_aenq_enable(struct ena_com_dev *ena { u16 depth = ena_dev->aenq.q_depth; - ENA_WARN(ena_dev->aenq.head != depth, "Invalid AENQ state\n"); + ENA_WARN(ena_dev->aenq.head != depth, ena_dev, "Invalid AENQ state\n"); /* Init head_db to mark that all entries in the queue * are initially available @@ -1588,12 +1604,12 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_de ret = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_AENQ_CONFIG, 0); if (ret) { - ena_trc_info("Can't get aenq configuration\n"); + ena_trc_info(ena_dev, "Can't get aenq configuration\n"); return ret; } if ((get_resp.u.aenq.supported_groups & groups_flag) != groups_flag) { - ena_trc_warn("Trying to set unsupported aenq events. supported flag: 0x%x asked flag: 0x%x\n", + ena_trc_warn(ena_dev, "Trying to set unsupported aenq events. supported flag: 0x%x asked flag: 0x%x\n", get_resp.u.aenq.supported_groups, groups_flag); return ENA_COM_UNSUPPORTED; @@ -1614,7 +1630,7 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_de sizeof(resp)); if (unlikely(ret)) - ena_trc_err("Failed to config AENQ ret: %d\n", ret); + ena_trc_err(ena_dev, "Failed to config AENQ ret: %d\n", ret); return ret; } @@ -1622,20 +1638,20 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_de int ena_com_get_dma_width(struct ena_com_dev *ena_dev) { u32 caps = ena_com_reg_bar_read32(ena_dev, ENA_REGS_CAPS_OFF); - int width; + u32 width; if (unlikely(caps == ENA_MMIO_READ_TIMEOUT)) { - ena_trc_err("Reg read timeout occurred\n"); + ena_trc_err(ena_dev, "Reg read timeout occurred\n"); return ENA_COM_TIMER_EXPIRED; } width = (caps & ENA_REGS_CAPS_DMA_ADDR_WIDTH_MASK) >> ENA_REGS_CAPS_DMA_ADDR_WIDTH_SHIFT; - ena_trc_dbg("ENA dma width: %d\n", width); + ena_trc_dbg(ena_dev, "ENA dma width: %d\n", width); if ((width < 32) || width > ENA_MAX_PHYS_ADDR_SIZE_BITS) { - ena_trc_err("DMA width illegal value: %d\n", width); + ena_trc_err(ena_dev, "DMA width illegal value: %d\n", width); return ENA_COM_INVAL; } @@ -1659,16 +1675,16 @@ int ena_com_validate_version(struct ena_com_dev *ena_d if (unlikely((ver == ENA_MMIO_READ_TIMEOUT) || (ctrl_ver == ENA_MMIO_READ_TIMEOUT))) { - ena_trc_err("Reg read timeout occurred\n"); + ena_trc_err(ena_dev, "Reg read timeout occurred\n"); return ENA_COM_TIMER_EXPIRED; } - ena_trc_info("ena device version: %d.%d\n", + ena_trc_info(ena_dev, "ENA device version: %d.%d\n", (ver & ENA_REGS_VERSION_MAJOR_VERSION_MASK) >> ENA_REGS_VERSION_MAJOR_VERSION_SHIFT, ver & ENA_REGS_VERSION_MINOR_VERSION_MASK); - ena_trc_info("ena controller version: %d.%d.%d implementation version %d\n", + ena_trc_info(ena_dev, "ENA controller version: %d.%d.%d implementation version %d\n", (ctrl_ver & ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_MASK) >> ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_SHIFT, (ctrl_ver & ENA_REGS_CONTROLLER_VERSION_MINOR_VERSION_MASK) @@ -1684,13 +1700,29 @@ int ena_com_validate_version(struct ena_com_dev *ena_d /* Validate the ctrl version without the implementation ID */ if (ctrl_ver_masked < MIN_ENA_CTRL_VER) { - ena_trc_err("ENA ctrl version is lower than the minimal ctrl version the driver supports\n"); + ena_trc_err(ena_dev, "ENA ctrl version is lower than the minimal ctrl version the driver supports\n"); return -1; } return 0; } +static void +ena_com_free_ena_admin_queue_comp_ctx(struct ena_com_dev *ena_dev, + struct ena_com_admin_queue *admin_queue) + +{ + if (!admin_queue->comp_ctx) + return; + + ENA_WAIT_EVENTS_DESTROY(admin_queue); + ENA_MEM_FREE(ena_dev->dmadev, + admin_queue->comp_ctx, + (admin_queue->q_depth * sizeof(struct ena_comp_ctx))); + + admin_queue->comp_ctx = NULL; +} + void ena_com_admin_destroy(struct ena_com_dev *ena_dev) { struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue; @@ -1699,12 +1731,8 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev struct ena_com_aenq *aenq = &ena_dev->aenq; u16 size; - ENA_WAIT_EVENT_DESTROY(admin_queue->comp_ctx->wait_event); - if (admin_queue->comp_ctx) - ENA_MEM_FREE(ena_dev->dmadev, - admin_queue->comp_ctx, - (admin_queue->q_depth * sizeof(struct ena_comp_ctx))); - admin_queue->comp_ctx = NULL; + ena_com_free_ena_admin_queue_comp_ctx(ena_dev, admin_queue); + size = ADMIN_SQ_SIZE(admin_queue->q_depth); if (sq->entries) ENA_MEM_FREE_COHERENT(ena_dev->dmadev, size, sq->entries, @@ -1820,12 +1848,12 @@ int ena_com_admin_init(struct ena_com_dev *ena_dev, dev_sts = ena_com_reg_bar_read32(ena_dev, ENA_REGS_DEV_STS_OFF); if (unlikely(dev_sts == ENA_MMIO_READ_TIMEOUT)) { - ena_trc_err("Reg read timeout occurred\n"); + ena_trc_err(ena_dev, "Reg read timeout occurred\n"); return ENA_COM_TIMER_EXPIRED; } if (!(dev_sts & ENA_REGS_DEV_STS_READY_MASK)) { - ena_trc_err("Device isn't ready, abort com init\n"); + ena_trc_err(ena_dev, "Device isn't ready, abort com init\n"); return ENA_COM_NO_DEVICE; } @@ -1903,7 +1931,7 @@ int ena_com_create_io_queue(struct ena_com_dev *ena_de int ret; if (ctx->qid >= ENA_TOTAL_NUM_QUEUES) { - ena_trc_err("Qid (%d) is bigger than max num of queues (%d)\n", + ena_trc_err(ena_dev, "Qid (%d) is bigger than max num of queues (%d)\n", ctx->qid, ENA_TOTAL_NUM_QUEUES); return ENA_COM_INVAL; } @@ -1962,7 +1990,7 @@ void ena_com_destroy_io_queue(struct ena_com_dev *ena_ struct ena_com_io_cq *io_cq; if (qid >= ENA_TOTAL_NUM_QUEUES) { - ena_trc_err("Qid (%d) is bigger than max num of queues (%d)\n", + ena_trc_err(ena_dev, "Qid (%d) is bigger than max num of queues (%d)\n", qid, ENA_TOTAL_NUM_QUEUES); return; } @@ -1995,6 +2023,7 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ memcpy(&get_feat_ctx->dev_attr, &get_resp.u.dev_attr, sizeof(get_resp.u.dev_attr)); + ena_dev->supported_features = get_resp.u.dev_attr.supported_features; if (ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) { @@ -2061,17 +2090,6 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ else return rc; - rc = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG, 0); - if (!rc) - memcpy(&get_feat_ctx->ind_table, &get_resp.u.ind_table, - sizeof(get_resp.u.ind_table)); - else if (rc == ENA_COM_UNSUPPORTED) - memset(&get_feat_ctx->ind_table, 0x0, - sizeof(get_feat_ctx->ind_table)); - else - return rc; - return 0; } @@ -2083,10 +2101,10 @@ void ena_com_admin_q_comp_intr_handler(struct ena_com_ /* ena_handle_specific_aenq_event: * return the handler that is relevant to the specific event group */ -static ena_aenq_handler ena_com_get_specific_aenq_cb(struct ena_com_dev *dev, +static ena_aenq_handler ena_com_get_specific_aenq_cb(struct ena_com_dev *ena_dev, u16 group) { - struct ena_aenq_handlers *aenq_handlers = dev->aenq.aenq_handlers; + struct ena_aenq_handlers *aenq_handlers = ena_dev->aenq.aenq_handlers; if ((group < ENA_MAX_HANDLERS) && aenq_handlers->handlers[group]) return aenq_handlers->handlers[group]; @@ -2098,11 +2116,11 @@ static ena_aenq_handler ena_com_get_specific_aenq_cb(s * handles the aenq incoming events. * pop events from the queue and apply the specific handler */ -void ena_com_aenq_intr_handler(struct ena_com_dev *dev, void *data) +void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data) { struct ena_admin_aenq_entry *aenq_e; struct ena_admin_aenq_common_desc *aenq_common; - struct ena_com_aenq *aenq = &dev->aenq; + struct ena_com_aenq *aenq = &ena_dev->aenq; u64 timestamp; ena_aenq_handler handler_cb; u16 masked_head, processed = 0; @@ -2123,13 +2141,14 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev timestamp = (u64)aenq_common->timestamp_low | ((u64)aenq_common->timestamp_high << 32); - ena_trc_dbg("AENQ! Group[%x] Syndrom[%x] timestamp: [%" ENA_PRIu64 "s]\n", + + ena_trc_dbg(ena_dev, "AENQ! Group[%x] Syndrome[%x] timestamp: [%" ENA_PRIu64 "s]\n", aenq_common->group, - aenq_common->syndrom, + aenq_common->syndrome, timestamp); /* Handle specific event*/ - handler_cb = ena_com_get_specific_aenq_cb(dev, + handler_cb = ena_com_get_specific_aenq_cb(ena_dev, aenq_common->group); handler_cb(data, aenq_e); /* call the actual event handler*/ @@ -2154,8 +2173,8 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev /* write the aenq doorbell after all AENQ descriptors were read */ mb(); - ENA_REG_WRITE32_RELAXED(dev->bus, (u32)aenq->head, - dev->reg_bar + ENA_REGS_AENQ_HEAD_DB_OFF); + ENA_REG_WRITE32_RELAXED(ena_dev->bus, (u32)aenq->head, + ena_dev->reg_bar + ENA_REGS_AENQ_HEAD_DB_OFF); mmiowb(); } #ifdef ENA_EXTENDED_STATS @@ -2191,19 +2210,19 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev, if (unlikely((stat == ENA_MMIO_READ_TIMEOUT) || (cap == ENA_MMIO_READ_TIMEOUT))) { - ena_trc_err("Reg read32 timeout occurred\n"); + ena_trc_err(ena_dev, "Reg read32 timeout occurred\n"); return ENA_COM_TIMER_EXPIRED; } if ((stat & ENA_REGS_DEV_STS_READY_MASK) == 0) { - ena_trc_err("Device isn't ready, can't reset device\n"); + ena_trc_err(ena_dev, "Device isn't ready, can't reset device\n"); return ENA_COM_INVAL; } timeout = (cap & ENA_REGS_CAPS_RESET_TIMEOUT_MASK) >> ENA_REGS_CAPS_RESET_TIMEOUT_SHIFT; if (timeout == 0) { - ena_trc_err("Invalid timeout value\n"); + ena_trc_err(ena_dev, "Invalid timeout value\n"); return ENA_COM_INVAL; } @@ -2219,7 +2238,7 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev, rc = wait_for_reset_state(ena_dev, timeout, ENA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK); if (rc != 0) { - ena_trc_err("Reset indication didn't turn on\n"); + ena_trc_err(ena_dev, "Reset indication didn't turn on\n"); return rc; } @@ -2227,7 +2246,7 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Nov 25 04:20:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59F014746BB for ; Wed, 25 Nov 2020 04:20:30 +0000 (UTC) (envelope-from noreply@legacy.com) Received: from www.legacy.com (awsmail2.legacy.com [34.198.39.92]) by mx1.freebsd.org (Postfix) with ESMTP id 4Cgnk51hfnz4W9J for ; Wed, 25 Nov 2020 04:20:28 +0000 (UTC) (envelope-from noreply@legacy.com) Received: from prodleg104 ([10.60.1.184]) by www.legacy.com with Microsoft SMTPSVC(7.5.7601.17514); Tue, 24 Nov 2020 22:20:15 -0600 From: "bdc.syria via Legacy.com" To: svn-src-all@freebsd.org Date: 24 Nov 2020 22:20:14 -0600 Subject: bdc.syria has shared the Obituary for Derek Cropper (The Lancashire Evening Post) Message-ID: X-OriginalArrivalTime: 25 Nov 2020 04:20:15.0482 (UTC) FILETIME=[467A35A0:01D6C2E2] X-Rspamd-Queue-Id: 4Cgnk51hfnz4W9J X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of noreply@legacy.com designates 34.198.39.92 as permitted sender) smtp.mailfrom=noreply@legacy.com X-Spamd-Result: default: False [-0.30 / 15.00]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[34.198.39.92:from]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:34.198.39.92]; NEURAL_HAM_LONG(-1.00)[-0.999]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[legacy.com]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[34.198.39.92:from:127.0.2.255]; NEURAL_SPAM_SHORT(1.00)[1.000]; MIME_BASE64_TEXT(0.10)[]; MIME_HTML_ONLY(0.20)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:~]; ASN(0.00)[asn:14618, ipnet:34.192.0.0/12, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all]; MID_RHS_WWW(0.50)[] MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 04:20:30 -0000 From owner-svn-src-all@freebsd.org Wed Nov 25 05:05:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F7E4476190 for ; Wed, 25 Nov 2020 05:05:16 +0000 (UTC) (envelope-from NEYCGBV07_npai+svn-src-all=freebsd.org.102162070@chanzytampons-news.com) Received: from chanzytampons-news.com (chanzytampons-news.com [146.59.136.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cgpjk5yFbz4Yc1 for ; Wed, 25 Nov 2020 05:05:14 +0000 (UTC) (envelope-from NEYCGBV07_npai+svn-src-all=freebsd.org.102162070@chanzytampons-news.com) Received: from NEYCGBV07 (localhost [127.0.0.1]) by chanzytampons-news.com (Postfix) with SMTP id 8830F16AE6C for ; Wed, 25 Nov 2020 06:05:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=chanzytampons-news.com; s=oxidkim; t=1606280707; bh=+TS8g9SKpHt4U4HH0hkPpA2ea0PH3OJFG3gg9yZwRHs=; h=List-Unsubscribe:From:To:Subject:Date:From; b=XXGlyJ6gJzefwoOK1iMuSBMbSgfj+tnbnthKB7BG/txyrACFLJLIIH4QV6DfWAl/C Kx66/rLad9hmGuncTB8gexZBpQyvCHGMm7e3lUYo5C7v+ItCaD/1kkyTVzn0xdG9mC EJlc57jNSxhObDhIQIfjHDOdNkAXCW7tAIrg254sAKqd9TFRkSmyCbgZYdCvLveL0z 48KYnl2eGg7RmOcCQ+Tsx3qzPUP0dh5CHO3PSDonxYFxe/+mBFvdsh43/s/kravtB+ /AA6Ojx/z76mtY1mgMK4HBnjdLTpbH8TyExZDSI6Aq21eTSAME+pYQjAJSQvQOIA8G GetjsFMg/kfJQ== X-MessageId: 786989677166864855||8386784583826745657676647082696966836846798271||102162070||8||786989677166864855 Message-ID: From: "Chanzy" To: Subject: Votre tampon de bureau Date: Wed, 25 Nov 2020 06:03:42 +0100 X-Mailer: OxiMailing 8.5.2 MIME-Version: 1.0 X-Rspamd-Queue-Id: 4Cgpjk5yFbz4Yc1 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=chanzytampons-news.com header.s=oxidkim header.b=XXGlyJ6g; dmarc=pass (policy=none) header.from=chanzytampons-news.com; spf=pass (mx1.freebsd.org: domain of NEYCGBV07_npai@chanzytampons-news.com designates 146.59.136.229 as permitted sender) smtp.mailfrom=NEYCGBV07_npai@chanzytampons-news.com X-Spamd-Result: default: False [-1.56 / 15.00]; ZERO_FONT(0.10)[1]; R_SPF_ALLOW(-0.20)[+a]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[chanzytampons-news.com:+]; DMARC_POLICY_ALLOW(-0.50)[chanzytampons-news.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[contact@chanzytampons-news.com,NEYCGBV07_npai@chanzytampons-news.com]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[146.59.136.229:from]; ASN(0.00)[asn:16276, ipnet:146.59.0.0/16, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[contact@chanzytampons-news.com,NEYCGBV07_npai@chanzytampons-news.com]; TAGGED_FROM(0.00)[svn-src-all=freebsd.org.102162070]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[chanzytampons-news.com:s=oxidkim]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; HTML_SHORT_LINK_IMG_1(2.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[146.59.136.229:from:127.0.2.255]; MANY_INVISIBLE_PARTS(0.05)[1]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 05:05:16 -0000 Avez-vous..=2E Si vous ne voyez pas ce message correctement, [consultez-le en ligne] = (https://chanzytampons-news.com/c6.php?ec=3D2&l=3DgXmPp3elh2dq&i=3DZGRolWaV= YW5j&t=3DZQ&e=3DpqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo&u=3Dm6iq1KOdYGaWmMagqtummM+= k1J+mkKGZ29djmqahkrB4jXmrcrlhbmJlmXZko2tsqGeVZGWXZnWVpXt6fWmUpWpnaJdjlGN8eY= +WZl7Smqc&v=3D8)=2E Bonjour, Avez-vous besoin de tampons sp=C3=A9cifiques =C3=A0 votre profession ? Cr=C3=A9ez, modifiez et visualisez votre tampon de bureau avant de passer = la commande ! Pour une remise, faites votre demande via notre formulaire : [FORMULAIRE DEMANDE DE DEVIS] = (https://chanzytampons-news.com/c6.php?ec=3D2&l=3DgXmPp3elh2dq&i=3DZGRolWaV= YW5j&t=3DZA&e=3DpqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo&u=3Dm6iq1KOdYGaXn8ilXsmhpsm= gyl+W0qBjytOnpKpjx5GYY2eqcayhiH+DyKelyaePwWW3pZbWnJixyYNweYGYt5ZreK55p158mo= Hbo6Ckh6zSi8qdfcdog7rLZK2gmdrIoqajo6XWoXSjoMSnos4&v=3D8) [(image)] = (https://chanzytampons-news.com/c6.php?ec=3D2&l=3DgXmPp3elh2dq&i=3DZGRolWaV= YW5j&t=3DZA&e=3DpqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo&u=3Dm6iq1KOdYGaqp9xgk8qTpdy= tkqWU0KOj0tdjmqahkphkYarFndOgpaZdyqCk1Jen1J3YlmDMoZjN16WcpafExJ+ZqQ&v=3D8) Regardez notre vid=C3=A9o ci-dessous pour en savoir plus : [(image)] = (https://chanzytampons-news.com/c6.php?ec=3D2&l=3DgXmPp3elh2dq&i=3DZGRolWaV= YW5j&t=3DZA&e=3DpqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo&u=3Dm6iq1KOdYGaqp9xgqdGnq9e= Wyl+W0qBj28Wpmp9z2Z+rhqWUnbmJjGN5qg&v=3D8) Vous avez la libert=C3=A9 de r=C3=A9aliser tous vos textes ou de nous = envoyer vos fichiers. Sp=C3=A9cialiste des tampons de bureau depuis 40 = ans=2E + d'info Si vous ne souhaitez plus recevoir nos messages, suivez ce lien : [Veuillez me retirer de votre liste de diffusion] = (https://chanzytampons-news.com/d6.php?ec=3D2&l=3DgXmPp3elh2dq&e=3DpqqkkaPV= lGSUnNFyltSXnMSnyV+i1Zo&i=3DZGRolWaVYW5j&v=3D8) From owner-svn-src-all@freebsd.org Wed Nov 25 09:37:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 642B147C0F0; Wed, 25 Nov 2020 09:37:18 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cgwlf2Jsxz4n2P; Wed, 25 Nov 2020 09:37:18 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33D9B6FA6; Wed, 25 Nov 2020 09:37:18 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AP9bIKC016227; Wed, 25 Nov 2020 09:37:18 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AP9bHg8016225; Wed, 25 Nov 2020 09:37:17 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202011250937.0AP9bHg8016225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 25 Nov 2020 09:37:17 +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: r368013 - in stable/11: share/man/man4 sys/contrib/ena-com sys/contrib/ena-com/ena_defs sys/dev/ena sys/modules/ena X-SVN-Group: stable-11 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/contrib/ena-com sys/contrib/ena-com/ena_defs sys/dev/ena sys/modules/ena X-SVN-Commit-Revision: 368013 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 09:37:18 -0000 Author: mw Date: Wed Nov 25 09:37:17 2020 New Revision: 368013 URL: https://svnweb.freebsd.org/changeset/base/368013 Log: MFC: Merge ENA v2.3.0 driver r367805 Update ENA driver version to v2.3.0 r367803 Rename descriptions of the supported ENA devices r367802 Add ENI metrics for the ENA driver r367801 Add SPDX license tag to the ENA driver files r367800 Add Rx offsets support for the ENA driver r367799 Adjust ENA driver files to latest ena-com changes r367795 Fix completion descriptors alignment for the ENA Obtained from: Semihalf Sponsored by: Amazon, Inc Modified: stable/11/share/man/man4/ena.4 stable/11/sys/contrib/ena-com/ena_com.c stable/11/sys/contrib/ena-com/ena_com.h stable/11/sys/contrib/ena-com/ena_defs/ena_admin_defs.h stable/11/sys/contrib/ena-com/ena_defs/ena_common_defs.h stable/11/sys/contrib/ena-com/ena_defs/ena_eth_io_defs.h stable/11/sys/contrib/ena-com/ena_defs/ena_gen_info.h stable/11/sys/contrib/ena-com/ena_defs/ena_regs_defs.h stable/11/sys/contrib/ena-com/ena_eth_com.c stable/11/sys/contrib/ena-com/ena_eth_com.h stable/11/sys/contrib/ena-com/ena_plat.h stable/11/sys/dev/ena/ena.c stable/11/sys/dev/ena/ena.h stable/11/sys/dev/ena/ena_datapath.c stable/11/sys/dev/ena/ena_datapath.h stable/11/sys/dev/ena/ena_netmap.c stable/11/sys/dev/ena/ena_netmap.h stable/11/sys/dev/ena/ena_sysctl.c stable/11/sys/dev/ena/ena_sysctl.h stable/11/sys/modules/ena/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/ena.4 ============================================================================== --- stable/11/share/man/man4/ena.4 Wed Nov 25 03:24:43 2020 (r368012) +++ stable/11/share/man/man4/ena.4 Wed Nov 25 09:37:17 2020 (r368013) @@ -1,4 +1,6 @@ -.\" Copyright (c) 2015-2017 Amazon.com, Inc. or its affiliates. +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: stable/11/sys/contrib/ena-com/ena_com.c ============================================================================== --- stable/11/sys/contrib/ena-com/ena_com.c Wed Nov 25 03:24:43 2020 (r368012) +++ stable/11/sys/contrib/ena-com/ena_com.c Wed Nov 25 09:37:17 2020 (r368013) @@ -1,5 +1,5 @@ /*- - * BSD LICENSE + * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. * All rights reserved. @@ -70,9 +70,9 @@ #define ENA_REGS_ADMIN_INTR_MASK 1 -#define ENA_MIN_POLL_US 100 +#define ENA_MIN_ADMIN_POLL_US 100 -#define ENA_MAX_POLL_US 5000 +#define ENA_MAX_ADMIN_POLL_US 5000 /*****************************************************************************/ /*****************************************************************************/ @@ -106,7 +106,7 @@ static int ena_com_mem_addr_set(struct ena_com_dev *en dma_addr_t addr) { if ((addr & GENMASK_ULL(ena_dev->dma_addr_bits - 1, 0)) != addr) { - ena_trc_err("dma address has more bits that the device supports\n"); + ena_trc_err(ena_dev, "DMA address has more bits that the device supports\n"); return ENA_COM_INVAL; } @@ -116,16 +116,17 @@ static int ena_com_mem_addr_set(struct ena_com_dev *en return 0; } -static int ena_com_admin_init_sq(struct ena_com_admin_queue *queue) +static int ena_com_admin_init_sq(struct ena_com_admin_queue *admin_queue) { - struct ena_com_admin_sq *sq = &queue->sq; - u16 size = ADMIN_SQ_SIZE(queue->q_depth); + struct ena_com_dev *ena_dev = admin_queue->ena_dev; + struct ena_com_admin_sq *sq = &admin_queue->sq; + u16 size = ADMIN_SQ_SIZE(admin_queue->q_depth); - ENA_MEM_ALLOC_COHERENT(queue->q_dmadev, size, sq->entries, sq->dma_addr, + ENA_MEM_ALLOC_COHERENT(admin_queue->q_dmadev, size, sq->entries, sq->dma_addr, sq->mem_handle); if (!sq->entries) { - ena_trc_err("memory allocation failed\n"); + ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -138,16 +139,17 @@ static int ena_com_admin_init_sq(struct ena_com_admin_ return 0; } -static int ena_com_admin_init_cq(struct ena_com_admin_queue *queue) +static int ena_com_admin_init_cq(struct ena_com_admin_queue *admin_queue) { - struct ena_com_admin_cq *cq = &queue->cq; - u16 size = ADMIN_CQ_SIZE(queue->q_depth); + struct ena_com_dev *ena_dev = admin_queue->ena_dev; + struct ena_com_admin_cq *cq = &admin_queue->cq; + u16 size = ADMIN_CQ_SIZE(admin_queue->q_depth); - ENA_MEM_ALLOC_COHERENT(queue->q_dmadev, size, cq->entries, cq->dma_addr, + ENA_MEM_ALLOC_COHERENT(admin_queue->q_dmadev, size, cq->entries, cq->dma_addr, cq->mem_handle); if (!cq->entries) { - ena_trc_err("memory allocation failed\n"); + ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -157,22 +159,22 @@ static int ena_com_admin_init_cq(struct ena_com_admin_ return 0; } -static int ena_com_admin_init_aenq(struct ena_com_dev *dev, +static int ena_com_admin_init_aenq(struct ena_com_dev *ena_dev, struct ena_aenq_handlers *aenq_handlers) { - struct ena_com_aenq *aenq = &dev->aenq; + struct ena_com_aenq *aenq = &ena_dev->aenq; u32 addr_low, addr_high, aenq_caps; u16 size; - dev->aenq.q_depth = ENA_ASYNC_QUEUE_DEPTH; + ena_dev->aenq.q_depth = ENA_ASYNC_QUEUE_DEPTH; size = ADMIN_AENQ_SIZE(ENA_ASYNC_QUEUE_DEPTH); - ENA_MEM_ALLOC_COHERENT(dev->dmadev, size, + ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev, size, aenq->entries, aenq->dma_addr, aenq->mem_handle); if (!aenq->entries) { - ena_trc_err("memory allocation failed\n"); + ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -182,18 +184,18 @@ static int ena_com_admin_init_aenq(struct ena_com_dev addr_low = ENA_DMA_ADDR_TO_UINT32_LOW(aenq->dma_addr); addr_high = ENA_DMA_ADDR_TO_UINT32_HIGH(aenq->dma_addr); - ENA_REG_WRITE32(dev->bus, addr_low, dev->reg_bar + ENA_REGS_AENQ_BASE_LO_OFF); - ENA_REG_WRITE32(dev->bus, addr_high, dev->reg_bar + ENA_REGS_AENQ_BASE_HI_OFF); + ENA_REG_WRITE32(ena_dev->bus, addr_low, ena_dev->reg_bar + ENA_REGS_AENQ_BASE_LO_OFF); + ENA_REG_WRITE32(ena_dev->bus, addr_high, ena_dev->reg_bar + ENA_REGS_AENQ_BASE_HI_OFF); aenq_caps = 0; - aenq_caps |= dev->aenq.q_depth & ENA_REGS_AENQ_CAPS_AENQ_DEPTH_MASK; + aenq_caps |= ena_dev->aenq.q_depth & ENA_REGS_AENQ_CAPS_AENQ_DEPTH_MASK; aenq_caps |= (sizeof(struct ena_admin_aenq_entry) << ENA_REGS_AENQ_CAPS_AENQ_ENTRY_SIZE_SHIFT) & ENA_REGS_AENQ_CAPS_AENQ_ENTRY_SIZE_MASK; - ENA_REG_WRITE32(dev->bus, aenq_caps, dev->reg_bar + ENA_REGS_AENQ_CAPS_OFF); + ENA_REG_WRITE32(ena_dev->bus, aenq_caps, ena_dev->reg_bar + ENA_REGS_AENQ_CAPS_OFF); if (unlikely(!aenq_handlers)) { - ena_trc_err("aenq handlers pointer is NULL\n"); + ena_trc_err(ena_dev, "AENQ handlers pointer is NULL\n"); return ENA_COM_INVAL; } @@ -209,31 +211,34 @@ static void comp_ctxt_release(struct ena_com_admin_que ATOMIC32_DEC(&queue->outstanding_cmds); } -static struct ena_comp_ctx *get_comp_ctxt(struct ena_com_admin_queue *queue, +static struct ena_comp_ctx *get_comp_ctxt(struct ena_com_admin_queue *admin_queue, u16 command_id, bool capture) { - if (unlikely(command_id >= queue->q_depth)) { - ena_trc_err("command id is larger than the queue size. cmd_id: %u queue size %d\n", - command_id, queue->q_depth); + if (unlikely(command_id >= admin_queue->q_depth)) { + ena_trc_err(admin_queue->ena_dev, + "Command id is larger than the queue size. cmd_id: %u queue size %d\n", + command_id, admin_queue->q_depth); return NULL; } - if (unlikely(!queue->comp_ctx)) { - ena_trc_err("Completion context is NULL\n"); + if (unlikely(!admin_queue->comp_ctx)) { + ena_trc_err(admin_queue->ena_dev, + "Completion context is NULL\n"); return NULL; } - if (unlikely(queue->comp_ctx[command_id].occupied && capture)) { - ena_trc_err("Completion context is occupied\n"); + if (unlikely(admin_queue->comp_ctx[command_id].occupied && capture)) { + ena_trc_err(admin_queue->ena_dev, + "Completion context is occupied\n"); return NULL; } if (capture) { - ATOMIC32_INC(&queue->outstanding_cmds); - queue->comp_ctx[command_id].occupied = true; + ATOMIC32_INC(&admin_queue->outstanding_cmds); + admin_queue->comp_ctx[command_id].occupied = true; } - return &queue->comp_ctx[command_id]; + return &admin_queue->comp_ctx[command_id]; } static struct ena_comp_ctx *__ena_com_submit_admin_cmd(struct ena_com_admin_queue *admin_queue, @@ -254,7 +259,7 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd /* In case of queue FULL */ cnt = (u16)ATOMIC32_READ(&admin_queue->outstanding_cmds); if (cnt >= admin_queue->q_depth) { - ena_trc_dbg("admin queue is full.\n"); + ena_trc_dbg(admin_queue->ena_dev, "Admin queue is full.\n"); admin_queue->stats.out_of_space++; return ERR_PTR(ENA_COM_NO_SPACE); } @@ -296,20 +301,21 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd return comp_ctx; } -static int ena_com_init_comp_ctxt(struct ena_com_admin_queue *queue) +static int ena_com_init_comp_ctxt(struct ena_com_admin_queue *admin_queue) { - size_t size = queue->q_depth * sizeof(struct ena_comp_ctx); + struct ena_com_dev *ena_dev = admin_queue->ena_dev; + size_t size = admin_queue->q_depth * sizeof(struct ena_comp_ctx); struct ena_comp_ctx *comp_ctx; u16 i; - queue->comp_ctx = ENA_MEM_ALLOC(queue->q_dmadev, size); - if (unlikely(!queue->comp_ctx)) { - ena_trc_err("memory allocation failed\n"); + admin_queue->comp_ctx = ENA_MEM_ALLOC(admin_queue->q_dmadev, size); + if (unlikely(!admin_queue->comp_ctx)) { + ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } - for (i = 0; i < queue->q_depth; i++) { - comp_ctx = get_comp_ctxt(queue, i, false); + for (i = 0; i < admin_queue->q_depth; i++) { + comp_ctx = get_comp_ctxt(admin_queue, i, false); if (comp_ctx) ENA_WAIT_EVENT_INIT(comp_ctx->wait_event); } @@ -377,7 +383,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ } if (!io_sq->desc_addr.virt_addr) { - ena_trc_err("memory allocation failed\n"); + ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } } @@ -402,7 +408,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ io_sq->bounce_buf_ctrl.base_buffer = ENA_MEM_ALLOC(ena_dev->dmadev, size); if (!io_sq->bounce_buf_ctrl.base_buffer) { - ena_trc_err("bounce buffer memory allocation failed\n"); + ena_trc_err(ena_dev, "Bounce buffer memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -449,23 +455,25 @@ static int ena_com_init_io_cq(struct ena_com_dev *ena_ size = io_cq->cdesc_entry_size_in_bytes * io_cq->q_depth; io_cq->bus = ena_dev->bus; - ENA_MEM_ALLOC_COHERENT_NODE(ena_dev->dmadev, - size, - io_cq->cdesc_addr.virt_addr, - io_cq->cdesc_addr.phys_addr, - io_cq->cdesc_addr.mem_handle, - ctx->numa_node, - prev_node); + ENA_MEM_ALLOC_COHERENT_NODE_ALIGNED(ena_dev->dmadev, + size, + io_cq->cdesc_addr.virt_addr, + io_cq->cdesc_addr.phys_addr, + io_cq->cdesc_addr.mem_handle, + ctx->numa_node, + prev_node, + ENA_CDESC_RING_SIZE_ALIGNMENT); if (!io_cq->cdesc_addr.virt_addr) { - ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev, - size, - io_cq->cdesc_addr.virt_addr, - io_cq->cdesc_addr.phys_addr, - io_cq->cdesc_addr.mem_handle); + ENA_MEM_ALLOC_COHERENT_ALIGNED(ena_dev->dmadev, + size, + io_cq->cdesc_addr.virt_addr, + io_cq->cdesc_addr.phys_addr, + io_cq->cdesc_addr.mem_handle, + ENA_CDESC_RING_SIZE_ALIGNMENT); } if (!io_cq->cdesc_addr.virt_addr) { - ena_trc_err("memory allocation failed\n"); + ena_trc_err(ena_dev, "Memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -486,7 +494,8 @@ static void ena_com_handle_single_admin_completion(str comp_ctx = get_comp_ctxt(admin_queue, cmd_id, false); if (unlikely(!comp_ctx)) { - ena_trc_err("comp_ctx is NULL. Changing the admin queue running state\n"); + ena_trc_err(admin_queue->ena_dev, + "comp_ctx is NULL. Changing the admin queue running state\n"); admin_queue->running_state = false; return; } @@ -538,10 +547,12 @@ static void ena_com_handle_admin_completion(struct ena admin_queue->stats.completed_cmd += comp_num; } -static int ena_com_comp_status_to_errno(u8 comp_status) +static int ena_com_comp_status_to_errno(struct ena_com_admin_queue *admin_queue, + u8 comp_status) { if (unlikely(comp_status != 0)) - ena_trc_err("admin command failed[%u]\n", comp_status); + ena_trc_err(admin_queue->ena_dev, + "Admin command failed[%u]\n", comp_status); switch (comp_status) { case ENA_ADMIN_SUCCESS: @@ -555,15 +566,17 @@ static int ena_com_comp_status_to_errno(u8 comp_status case ENA_ADMIN_ILLEGAL_PARAMETER: case ENA_ADMIN_UNKNOWN_ERROR: return ENA_COM_INVAL; + case ENA_ADMIN_RESOURCE_BUSY: + return ENA_COM_TRY_AGAIN; } return ENA_COM_INVAL; } -static inline void ena_delay_exponential_backoff_us(u32 exp, u32 delay_us) +static void ena_delay_exponential_backoff_us(u32 exp, u32 delay_us) { - delay_us = ENA_MAX32(ENA_MIN_POLL_US, delay_us); - delay_us = ENA_MIN32(delay_us * (1 << exp), ENA_MAX_POLL_US); + delay_us = ENA_MAX32(ENA_MIN_ADMIN_POLL_US, delay_us); + delay_us = ENA_MIN32(delay_us * (1U << exp), ENA_MAX_ADMIN_POLL_US); ENA_USLEEP(delay_us); } @@ -586,7 +599,8 @@ static int ena_com_wait_and_process_admin_cq_polling(s break; if (ENA_TIME_EXPIRE(timeout)) { - ena_trc_err("Wait for completion (polling) timeout\n"); + ena_trc_err(admin_queue->ena_dev, + "Wait for completion (polling) timeout\n"); /* ENA didn't have any completion */ ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); admin_queue->stats.no_completion++; @@ -597,11 +611,12 @@ static int ena_com_wait_and_process_admin_cq_polling(s goto err; } - ena_delay_exponential_backoff_us(exp++, admin_queue->ena_dev->ena_min_poll_delay_us); + ena_delay_exponential_backoff_us(exp++, + admin_queue->ena_dev->ena_min_poll_delay_us); } if (unlikely(comp_ctx->status == ENA_CMD_ABORTED)) { - ena_trc_err("Command was aborted\n"); + ena_trc_err(admin_queue->ena_dev, "Command was aborted\n"); ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); admin_queue->stats.aborted_cmd++; ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); @@ -610,15 +625,16 @@ static int ena_com_wait_and_process_admin_cq_polling(s } ENA_WARN(comp_ctx->status != ENA_CMD_COMPLETED, - "Invalid comp status %d\n", comp_ctx->status); + admin_queue->ena_dev, "Invalid comp status %d\n", + comp_ctx->status); - ret = ena_com_comp_status_to_errno(comp_ctx->comp_status); + ret = ena_com_comp_status_to_errno(admin_queue, comp_ctx->comp_status); err: comp_ctxt_release(admin_queue, comp_ctx); return ret; } -/** +/* * Set the LLQ configurations of the firmware * * The driver provides only the enabled feature values to the device, @@ -643,14 +659,10 @@ static int ena_com_set_llq(struct ena_com_dev *ena_dev cmd.u.llq.desc_num_before_header_enabled = llq_info->descs_num_before_header; cmd.u.llq.descriptors_stride_ctrl_enabled = llq_info->desc_stride_ctrl; - if (llq_info->disable_meta_caching) - cmd.u.llq.accel_mode.u.set.enabled_flags |= - BIT(ENA_ADMIN_DISABLE_META_CACHING); + cmd.u.llq.accel_mode.u.set.enabled_flags = + BIT(ENA_ADMIN_DISABLE_META_CACHING) | + BIT(ENA_ADMIN_LIMIT_TX_BURST); - if (llq_info->max_entries_in_tx_burst) - cmd.u.llq.accel_mode.u.set.enabled_flags |= - BIT(ENA_ADMIN_LIMIT_TX_BURST); - ret = ena_com_execute_admin_command(admin_queue, (struct ena_admin_aq_entry *)&cmd, sizeof(cmd), @@ -658,7 +670,7 @@ static int ena_com_set_llq(struct ena_com_dev *ena_dev sizeof(resp)); if (unlikely(ret)) - ena_trc_err("Failed to set LLQ configurations: %d\n", ret); + ena_trc_err(ena_dev, "Failed to set LLQ configurations: %d\n", ret); return ret; } @@ -668,6 +680,7 @@ static int ena_com_config_llq_info(struct ena_com_dev struct ena_llq_configurations *llq_default_cfg) { struct ena_com_llq_info *llq_info = &ena_dev->llq_info; + struct ena_admin_accel_mode_get llq_accel_mode_get; u16 supported_feat; int rc; @@ -679,7 +692,7 @@ static int ena_com_config_llq_info(struct ena_com_dev llq_info->header_location_ctrl = llq_default_cfg->llq_header_location; } else { - ena_trc_err("Invalid header location control, supported: 0x%x\n", + ena_trc_err(ena_dev, "Invalid header location control, supported: 0x%x\n", supported_feat); return -EINVAL; } @@ -694,12 +707,12 @@ static int ena_com_config_llq_info(struct ena_com_dev } else if (supported_feat & ENA_ADMIN_SINGLE_DESC_PER_ENTRY) { llq_info->desc_stride_ctrl = ENA_ADMIN_SINGLE_DESC_PER_ENTRY; } else { - ena_trc_err("Invalid desc_stride_ctrl, supported: 0x%x\n", + ena_trc_err(ena_dev, "Invalid desc_stride_ctrl, supported: 0x%x\n", supported_feat); return -EINVAL; } - ena_trc_err("Default llq stride ctrl is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", + ena_trc_err(ena_dev, "Default llq stride ctrl is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", llq_default_cfg->llq_stride_ctrl, supported_feat, llq_info->desc_stride_ctrl); @@ -723,11 +736,12 @@ static int ena_com_config_llq_info(struct ena_com_dev llq_info->desc_list_entry_size_ctrl = ENA_ADMIN_LIST_ENTRY_SIZE_256B; llq_info->desc_list_entry_size = 256; } else { - ena_trc_err("Invalid entry_size_ctrl, supported: 0x%x\n", supported_feat); + ena_trc_err(ena_dev, "Invalid entry_size_ctrl, supported: 0x%x\n", + supported_feat); return -EINVAL; } - ena_trc_err("Default llq ring entry size is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", + ena_trc_err(ena_dev, "Default llq ring entry size is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", llq_default_cfg->llq_ring_entry_size, supported_feat, llq_info->desc_list_entry_size); @@ -736,7 +750,7 @@ static int ena_com_config_llq_info(struct ena_com_dev /* The desc list entry size should be whole multiply of 8 * This requirement comes from __iowrite64_copy() */ - ena_trc_err("illegal entry size %d\n", + ena_trc_err(ena_dev, "Illegal entry size %d\n", llq_info->desc_list_entry_size); return -EINVAL; } @@ -760,29 +774,31 @@ static int ena_com_config_llq_info(struct ena_com_dev } else if (supported_feat & ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_8) { llq_info->descs_num_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_8; } else { - ena_trc_err("Invalid descs_num_before_header, supported: 0x%x\n", + ena_trc_err(ena_dev, "Invalid descs_num_before_header, supported: 0x%x\n", supported_feat); return -EINVAL; } - ena_trc_err("Default llq num descs before header is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", + ena_trc_err(ena_dev, "Default llq num descs before header is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", llq_default_cfg->llq_num_decs_before_header, supported_feat, llq_info->descs_num_before_header); } /* Check for accelerated queue supported */ + llq_accel_mode_get = llq_features->accel_mode.u.get; + llq_info->disable_meta_caching = - llq_features->accel_mode.u.get.supported_flags & - BIT(ENA_ADMIN_DISABLE_META_CACHING); + !!(llq_accel_mode_get.supported_flags & + BIT(ENA_ADMIN_DISABLE_META_CACHING)); - if (llq_features->accel_mode.u.get.supported_flags & BIT(ENA_ADMIN_LIMIT_TX_BURST)) + if (llq_accel_mode_get.supported_flags & BIT(ENA_ADMIN_LIMIT_TX_BURST)) llq_info->max_entries_in_tx_burst = - llq_features->accel_mode.u.get.max_tx_burst_size / + llq_accel_mode_get.max_tx_burst_size / llq_default_cfg->llq_ring_entry_size_value; rc = ena_com_set_llq(ena_dev); if (rc) - ena_trc_err("Cannot set LLQ configuration: %d\n", rc); + ena_trc_err(ena_dev, "Cannot set LLQ configuration: %d\n", rc); return rc; } @@ -808,13 +824,15 @@ static int ena_com_wait_and_process_admin_cq_interrupt ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); if (comp_ctx->status == ENA_CMD_COMPLETED) { - ena_trc_err("The ena device sent a completion but the driver didn't receive a MSI-X interrupt (cmd %d), autopolling mode is %s\n", + ena_trc_err(admin_queue->ena_dev, + "The ena device sent a completion but the driver didn't receive a MSI-X interrupt (cmd %d), autopolling mode is %s\n", comp_ctx->cmd_opcode, admin_queue->auto_polling ? "ON" : "OFF"); /* Check if fallback to polling is enabled */ if (admin_queue->auto_polling) admin_queue->polling = true; } else { - ena_trc_err("The ena device didn't send a completion for the admin cmd %d status %d\n", + ena_trc_err(admin_queue->ena_dev, + "The ena device didn't send a completion for the admin cmd %d status %d\n", comp_ctx->cmd_opcode, comp_ctx->status); } /* Check if shifted to polling mode. @@ -828,7 +846,7 @@ static int ena_com_wait_and_process_admin_cq_interrupt } } - ret = ena_com_comp_status_to_errno(comp_ctx->comp_status); + ret = ena_com_comp_status_to_errno(admin_queue, comp_ctx->comp_status); err: comp_ctxt_release(admin_queue, comp_ctx); return ret; @@ -876,7 +894,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev * } if (unlikely(i == timeout)) { - ena_trc_err("reading reg failed for timeout. expected: req id[%hu] offset[%hu] actual: req id[%hu] offset[%hu]\n", + ena_trc_err(ena_dev, "Reading reg failed for timeout. expected: req id[%hu] offset[%hu] actual: req id[%hu] offset[%hu]\n", mmio_read->seq_num, offset, read_resp->req_id, @@ -886,7 +904,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev * } if (read_resp->reg_off != offset) { - ena_trc_err("Read failure: wrong offset provided\n"); + ena_trc_err(ena_dev, "Read failure: wrong offset provided\n"); ret = ENA_MMIO_READ_TIMEOUT; } else { ret = read_resp->reg_val; @@ -945,7 +963,7 @@ static int ena_com_destroy_io_sq(struct ena_com_dev *e sizeof(destroy_resp)); if (unlikely(ret && (ret != ENA_COM_NO_DEVICE))) - ena_trc_err("failed to destroy io sq error: %d\n", ret); + ena_trc_err(ena_dev, "Failed to destroy io sq error: %d\n", ret); return ret; } @@ -1001,7 +1019,7 @@ static int wait_for_reset_state(struct ena_com_dev *en val = ena_com_reg_bar_read32(ena_dev, ENA_REGS_DEV_STS_OFF); if (unlikely(val == ENA_MMIO_READ_TIMEOUT)) { - ena_trc_err("Reg read timeout occurred\n"); + ena_trc_err(ena_dev, "Reg read timeout occurred\n"); return ENA_COM_TIMER_EXPIRED; } @@ -1041,7 +1059,7 @@ static int ena_com_get_feature_ex(struct ena_com_dev * int ret; if (!ena_com_check_supported_feature_id(ena_dev, feature_id)) { - ena_trc_dbg("Feature %d isn't supported\n", feature_id); + ena_trc_dbg(ena_dev, "Feature %d isn't supported\n", feature_id); return ENA_COM_UNSUPPORTED; } @@ -1060,7 +1078,7 @@ static int ena_com_get_feature_ex(struct ena_com_dev * &get_cmd.control_buffer.address, control_buf_dma_addr); if (unlikely(ret)) { - ena_trc_err("memory address set failed\n"); + ena_trc_err(ena_dev, "Memory address set failed\n"); return ret; } @@ -1077,7 +1095,7 @@ static int ena_com_get_feature_ex(struct ena_com_dev * sizeof(*get_resp)); if (unlikely(ret)) - ena_trc_err("Failed to submit get_feature command %d error: %d\n", + ena_trc_err(ena_dev, "Failed to submit get_feature command %d error: %d\n", feature_id, ret); return ret; @@ -1108,13 +1126,9 @@ static void ena_com_hash_key_fill_default_key(struct e ENA_RSS_FILL_KEY(&hash_key->key, sizeof(hash_key->key)); /* The key buffer is stored in the device in an array of - * uint32 elements. Therefore the number of elements can be derived - * by dividing the buffer length by the size of each array element. - * In current implementation each element is sized at uint32_t - * so it's actually a division by 4 but if the element size changes, - * there is no need to rewrite this code. + * uint32 elements. */ - hash_key->keys_num = sizeof(hash_key->key) / sizeof(hash_key->key[0]); + hash_key->key_parts = ENA_ADMIN_RSS_KEY_PARTS; } static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev) @@ -1187,13 +1201,13 @@ static int ena_com_indirect_table_allocate(struct ena_ int ret; ret = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG, 0); + ENA_ADMIN_RSS_INDIRECTION_TABLE_CONFIG, 0); if (unlikely(ret)) return ret; if ((get_resp.u.ind_table.min_size > log_size) || (get_resp.u.ind_table.max_size < log_size)) { - ena_trc_err("indirect table size doesn't fit. requested size: %d while min is:%d and max %d\n", + ena_trc_err(ena_dev, "Indirect table size doesn't fit. requested size: %d while min is:%d and max %d\n", 1 << log_size, 1 << get_resp.u.ind_table.min_size, 1 << get_resp.u.ind_table.max_size); @@ -1297,7 +1311,7 @@ static int ena_com_create_io_sq(struct ena_com_dev *en &create_cmd.sq_ba, io_sq->desc_addr.phys_addr); if (unlikely(ret)) { - ena_trc_err("memory address set failed\n"); + ena_trc_err(ena_dev, "Memory address set failed\n"); return ret; } } @@ -1308,7 +1322,7 @@ static int ena_com_create_io_sq(struct ena_com_dev *en (struct ena_admin_acq_entry *)&cmd_completion, sizeof(cmd_completion)); if (unlikely(ret)) { - ena_trc_err("Failed to create IO SQ. error: %d\n", ret); + ena_trc_err(ena_dev, "Failed to create IO SQ. error: %d\n", ret); return ret; } @@ -1326,7 +1340,7 @@ static int ena_com_create_io_sq(struct ena_com_dev *en cmd_completion.llq_descriptors_offset); } - ena_trc_dbg("created sq[%u], depth[%u]\n", io_sq->idx, io_sq->q_depth); + ena_trc_dbg(ena_dev, "Created sq[%u], depth[%u]\n", io_sq->idx, io_sq->q_depth); return ret; } @@ -1360,7 +1374,7 @@ static void ena_com_update_intr_delay_resolution(struc u16 prev_intr_delay_resolution = ena_dev->intr_delay_resolution; if (unlikely(!intr_delay_resolution)) { - ena_trc_err("Illegal intr_delay_resolution provided. Going to use default 1 usec resolution\n"); + ena_trc_err(ena_dev, "Illegal intr_delay_resolution provided. Going to use default 1 usec resolution\n"); intr_delay_resolution = ENA_DEFAULT_INTR_DELAY_RESOLUTION; } @@ -1396,23 +1410,25 @@ int ena_com_execute_admin_command(struct ena_com_admin comp, comp_size); if (IS_ERR(comp_ctx)) { if (comp_ctx == ERR_PTR(ENA_COM_NO_DEVICE)) - ena_trc_dbg("Failed to submit command [%ld]\n", + ena_trc_dbg(admin_queue->ena_dev, + "Failed to submit command [%ld]\n", PTR_ERR(comp_ctx)); else - ena_trc_err("Failed to submit command [%ld]\n", + ena_trc_err(admin_queue->ena_dev, + "Failed to submit command [%ld]\n", PTR_ERR(comp_ctx)); - return PTR_ERR(comp_ctx); + return (int)PTR_ERR(comp_ctx); } ret = ena_com_wait_and_process_admin_cq(comp_ctx, admin_queue); if (unlikely(ret)) { if (admin_queue->running_state) - ena_trc_err("Failed to process command. ret = %d\n", - ret); + ena_trc_err(admin_queue->ena_dev, + "Failed to process command. ret = %d\n", ret); else - ena_trc_dbg("Failed to process command. ret = %d\n", - ret); + ena_trc_dbg(admin_queue->ena_dev, + "Failed to process command. ret = %d\n", ret); } return ret; } @@ -1441,7 +1457,7 @@ int ena_com_create_io_cq(struct ena_com_dev *ena_dev, &create_cmd.cq_ba, io_cq->cdesc_addr.phys_addr); if (unlikely(ret)) { - ena_trc_err("memory address set failed\n"); + ena_trc_err(ena_dev, "Memory address set failed\n"); return ret; } @@ -1451,7 +1467,7 @@ int ena_com_create_io_cq(struct ena_com_dev *ena_dev, (struct ena_admin_acq_entry *)&cmd_completion, sizeof(cmd_completion)); if (unlikely(ret)) { - ena_trc_err("Failed to create IO CQ. error: %d\n", ret); + ena_trc_err(ena_dev, "Failed to create IO CQ. error: %d\n", ret); return ret; } @@ -1470,7 +1486,7 @@ int ena_com_create_io_cq(struct ena_com_dev *ena_dev, (u32 __iomem *)((uintptr_t)ena_dev->reg_bar + cmd_completion.numa_node_register_offset); - ena_trc_dbg("created cq[%u], depth[%u]\n", io_cq->idx, io_cq->q_depth); + ena_trc_dbg(ena_dev, "Created cq[%u], depth[%u]\n", io_cq->idx, io_cq->q_depth); return ret; } @@ -1480,7 +1496,7 @@ int ena_com_get_io_handlers(struct ena_com_dev *ena_de struct ena_com_io_cq **io_cq) { if (qid >= ENA_TOTAL_NUM_QUEUES) { - ena_trc_err("Invalid queue number %d but the max is %d\n", + ena_trc_err(ena_dev, "Invalid queue number %d but the max is %d\n", qid, ENA_TOTAL_NUM_QUEUES); return ENA_COM_INVAL; } @@ -1546,7 +1562,7 @@ int ena_com_destroy_io_cq(struct ena_com_dev *ena_dev, sizeof(destroy_resp)); if (unlikely(ret && (ret != ENA_COM_NO_DEVICE))) - ena_trc_err("Failed to destroy IO CQ. error: %d\n", ret); + ena_trc_err(ena_dev, "Failed to destroy IO CQ. error: %d\n", ret); return ret; } @@ -1570,7 +1586,7 @@ void ena_com_admin_aenq_enable(struct ena_com_dev *ena { u16 depth = ena_dev->aenq.q_depth; - ENA_WARN(ena_dev->aenq.head != depth, "Invalid AENQ state\n"); + ENA_WARN(ena_dev->aenq.head != depth, ena_dev, "Invalid AENQ state\n"); /* Init head_db to mark that all entries in the queue * are initially available @@ -1588,12 +1604,12 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_de ret = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_AENQ_CONFIG, 0); if (ret) { - ena_trc_info("Can't get aenq configuration\n"); + ena_trc_info(ena_dev, "Can't get aenq configuration\n"); return ret; } if ((get_resp.u.aenq.supported_groups & groups_flag) != groups_flag) { - ena_trc_warn("Trying to set unsupported aenq events. supported flag: 0x%x asked flag: 0x%x\n", + ena_trc_warn(ena_dev, "Trying to set unsupported aenq events. supported flag: 0x%x asked flag: 0x%x\n", get_resp.u.aenq.supported_groups, groups_flag); return ENA_COM_UNSUPPORTED; @@ -1614,7 +1630,7 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_de sizeof(resp)); if (unlikely(ret)) - ena_trc_err("Failed to config AENQ ret: %d\n", ret); + ena_trc_err(ena_dev, "Failed to config AENQ ret: %d\n", ret); return ret; } @@ -1622,20 +1638,20 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_de int ena_com_get_dma_width(struct ena_com_dev *ena_dev) { u32 caps = ena_com_reg_bar_read32(ena_dev, ENA_REGS_CAPS_OFF); - int width; + u32 width; if (unlikely(caps == ENA_MMIO_READ_TIMEOUT)) { - ena_trc_err("Reg read timeout occurred\n"); + ena_trc_err(ena_dev, "Reg read timeout occurred\n"); return ENA_COM_TIMER_EXPIRED; } width = (caps & ENA_REGS_CAPS_DMA_ADDR_WIDTH_MASK) >> ENA_REGS_CAPS_DMA_ADDR_WIDTH_SHIFT; - ena_trc_dbg("ENA dma width: %d\n", width); + ena_trc_dbg(ena_dev, "ENA dma width: %d\n", width); if ((width < 32) || width > ENA_MAX_PHYS_ADDR_SIZE_BITS) { - ena_trc_err("DMA width illegal value: %d\n", width); + ena_trc_err(ena_dev, "DMA width illegal value: %d\n", width); return ENA_COM_INVAL; } @@ -1659,16 +1675,16 @@ int ena_com_validate_version(struct ena_com_dev *ena_d if (unlikely((ver == ENA_MMIO_READ_TIMEOUT) || (ctrl_ver == ENA_MMIO_READ_TIMEOUT))) { - ena_trc_err("Reg read timeout occurred\n"); + ena_trc_err(ena_dev, "Reg read timeout occurred\n"); return ENA_COM_TIMER_EXPIRED; } - ena_trc_info("ena device version: %d.%d\n", + ena_trc_info(ena_dev, "ENA device version: %d.%d\n", (ver & ENA_REGS_VERSION_MAJOR_VERSION_MASK) >> ENA_REGS_VERSION_MAJOR_VERSION_SHIFT, ver & ENA_REGS_VERSION_MINOR_VERSION_MASK); - ena_trc_info("ena controller version: %d.%d.%d implementation version %d\n", + ena_trc_info(ena_dev, "ENA controller version: %d.%d.%d implementation version %d\n", (ctrl_ver & ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_MASK) >> ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_SHIFT, (ctrl_ver & ENA_REGS_CONTROLLER_VERSION_MINOR_VERSION_MASK) @@ -1684,13 +1700,29 @@ int ena_com_validate_version(struct ena_com_dev *ena_d /* Validate the ctrl version without the implementation ID */ if (ctrl_ver_masked < MIN_ENA_CTRL_VER) { - ena_trc_err("ENA ctrl version is lower than the minimal ctrl version the driver supports\n"); + ena_trc_err(ena_dev, "ENA ctrl version is lower than the minimal ctrl version the driver supports\n"); return -1; } return 0; } +static void +ena_com_free_ena_admin_queue_comp_ctx(struct ena_com_dev *ena_dev, + struct ena_com_admin_queue *admin_queue) + +{ + if (!admin_queue->comp_ctx) + return; + + ENA_WAIT_EVENTS_DESTROY(admin_queue); + ENA_MEM_FREE(ena_dev->dmadev, + admin_queue->comp_ctx, + (admin_queue->q_depth * sizeof(struct ena_comp_ctx))); + + admin_queue->comp_ctx = NULL; +} + void ena_com_admin_destroy(struct ena_com_dev *ena_dev) { struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue; @@ -1699,12 +1731,8 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev struct ena_com_aenq *aenq = &ena_dev->aenq; u16 size; - ENA_WAIT_EVENT_DESTROY(admin_queue->comp_ctx->wait_event); - if (admin_queue->comp_ctx) - ENA_MEM_FREE(ena_dev->dmadev, - admin_queue->comp_ctx, - (admin_queue->q_depth * sizeof(struct ena_comp_ctx))); - admin_queue->comp_ctx = NULL; + ena_com_free_ena_admin_queue_comp_ctx(ena_dev, admin_queue); + size = ADMIN_SQ_SIZE(admin_queue->q_depth); if (sq->entries) ENA_MEM_FREE_COHERENT(ena_dev->dmadev, size, sq->entries, @@ -1820,12 +1848,12 @@ int ena_com_admin_init(struct ena_com_dev *ena_dev, dev_sts = ena_com_reg_bar_read32(ena_dev, ENA_REGS_DEV_STS_OFF); if (unlikely(dev_sts == ENA_MMIO_READ_TIMEOUT)) { - ena_trc_err("Reg read timeout occurred\n"); + ena_trc_err(ena_dev, "Reg read timeout occurred\n"); return ENA_COM_TIMER_EXPIRED; } if (!(dev_sts & ENA_REGS_DEV_STS_READY_MASK)) { - ena_trc_err("Device isn't ready, abort com init\n"); + ena_trc_err(ena_dev, "Device isn't ready, abort com init\n"); return ENA_COM_NO_DEVICE; } @@ -1903,7 +1931,7 @@ int ena_com_create_io_queue(struct ena_com_dev *ena_de int ret; if (ctx->qid >= ENA_TOTAL_NUM_QUEUES) { - ena_trc_err("Qid (%d) is bigger than max num of queues (%d)\n", + ena_trc_err(ena_dev, "Qid (%d) is bigger than max num of queues (%d)\n", ctx->qid, ENA_TOTAL_NUM_QUEUES); return ENA_COM_INVAL; } @@ -1962,7 +1990,7 @@ void ena_com_destroy_io_queue(struct ena_com_dev *ena_ struct ena_com_io_cq *io_cq; if (qid >= ENA_TOTAL_NUM_QUEUES) { - ena_trc_err("Qid (%d) is bigger than max num of queues (%d)\n", + ena_trc_err(ena_dev, "Qid (%d) is bigger than max num of queues (%d)\n", qid, ENA_TOTAL_NUM_QUEUES); return; } @@ -1995,6 +2023,7 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ memcpy(&get_feat_ctx->dev_attr, &get_resp.u.dev_attr, sizeof(get_resp.u.dev_attr)); + ena_dev->supported_features = get_resp.u.dev_attr.supported_features; if (ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) { @@ -2061,17 +2090,6 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ else return rc; - rc = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG, 0); - if (!rc) - memcpy(&get_feat_ctx->ind_table, &get_resp.u.ind_table, - sizeof(get_resp.u.ind_table)); - else if (rc == ENA_COM_UNSUPPORTED) - memset(&get_feat_ctx->ind_table, 0x0, - sizeof(get_feat_ctx->ind_table)); - else - return rc; - return 0; } @@ -2083,10 +2101,10 @@ void ena_com_admin_q_comp_intr_handler(struct ena_com_ /* ena_handle_specific_aenq_event: * return the handler that is relevant to the specific event group */ -static ena_aenq_handler ena_com_get_specific_aenq_cb(struct ena_com_dev *dev, +static ena_aenq_handler ena_com_get_specific_aenq_cb(struct ena_com_dev *ena_dev, u16 group) { - struct ena_aenq_handlers *aenq_handlers = dev->aenq.aenq_handlers; + struct ena_aenq_handlers *aenq_handlers = ena_dev->aenq.aenq_handlers; if ((group < ENA_MAX_HANDLERS) && aenq_handlers->handlers[group]) return aenq_handlers->handlers[group]; @@ -2098,11 +2116,11 @@ static ena_aenq_handler ena_com_get_specific_aenq_cb(s * handles the aenq incoming events. * pop events from the queue and apply the specific handler */ -void ena_com_aenq_intr_handler(struct ena_com_dev *dev, void *data) +void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data) { struct ena_admin_aenq_entry *aenq_e; struct ena_admin_aenq_common_desc *aenq_common; - struct ena_com_aenq *aenq = &dev->aenq; + struct ena_com_aenq *aenq = &ena_dev->aenq; u64 timestamp; ena_aenq_handler handler_cb; u16 masked_head, processed = 0; @@ -2123,13 +2141,14 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev timestamp = (u64)aenq_common->timestamp_low | ((u64)aenq_common->timestamp_high << 32); - ena_trc_dbg("AENQ! Group[%x] Syndrom[%x] timestamp: [%" ENA_PRIu64 "s]\n", + + ena_trc_dbg(ena_dev, "AENQ! Group[%x] Syndrome[%x] timestamp: [%" ENA_PRIu64 "s]\n", aenq_common->group, - aenq_common->syndrom, + aenq_common->syndrome, timestamp); /* Handle specific event*/ - handler_cb = ena_com_get_specific_aenq_cb(dev, + handler_cb = ena_com_get_specific_aenq_cb(ena_dev, aenq_common->group); handler_cb(data, aenq_e); /* call the actual event handler*/ @@ -2154,8 +2173,8 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev /* write the aenq doorbell after all AENQ descriptors were read */ mb(); - ENA_REG_WRITE32_RELAXED(dev->bus, (u32)aenq->head, - dev->reg_bar + ENA_REGS_AENQ_HEAD_DB_OFF); + ENA_REG_WRITE32_RELAXED(ena_dev->bus, (u32)aenq->head, + ena_dev->reg_bar + ENA_REGS_AENQ_HEAD_DB_OFF); mmiowb(); } #ifdef ENA_EXTENDED_STATS @@ -2191,19 +2210,19 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev, if (unlikely((stat == ENA_MMIO_READ_TIMEOUT) || (cap == ENA_MMIO_READ_TIMEOUT))) { - ena_trc_err("Reg read32 timeout occurred\n"); + ena_trc_err(ena_dev, "Reg read32 timeout occurred\n"); return ENA_COM_TIMER_EXPIRED; } if ((stat & ENA_REGS_DEV_STS_READY_MASK) == 0) { - ena_trc_err("Device isn't ready, can't reset device\n"); + ena_trc_err(ena_dev, "Device isn't ready, can't reset device\n"); return ENA_COM_INVAL; } timeout = (cap & ENA_REGS_CAPS_RESET_TIMEOUT_MASK) >> ENA_REGS_CAPS_RESET_TIMEOUT_SHIFT; if (timeout == 0) { - ena_trc_err("Invalid timeout value\n"); + ena_trc_err(ena_dev, "Invalid timeout value\n"); return ENA_COM_INVAL; } @@ -2219,7 +2238,7 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev, rc = wait_for_reset_state(ena_dev, timeout, ENA_REGS_DEV_STS_RESET_IN_PROGRESS_MASK); if (rc != 0) { - ena_trc_err("Reset indication didn't turn on\n"); + ena_trc_err(ena_dev, "Reset indication didn't turn on\n"); return rc; } @@ -2227,7 +2246,7 @@ int ena_com_dev_reset(struct ena_com_dev *ena_dev, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Nov 25 10:21:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A7FB47CF9B; Wed, 25 Nov 2020 10:21:30 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cgxkf2mVJz4pwv; Wed, 25 Nov 2020 10:21:30 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51FAC7A3F; Wed, 25 Nov 2020 10:21:30 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APALUlp043538; Wed, 25 Nov 2020 10:21:30 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APALU0U043537; Wed, 25 Nov 2020 10:21:30 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202011251021.0APALU0U043537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Wed, 25 Nov 2020 10:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368014 - head/usr.bin/fortune/datfiles X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/usr.bin/fortune/datfiles X-SVN-Commit-Revision: 368014 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 10:21:30 -0000 Author: bcr (doc committer) Date: Wed Nov 25 10:21:29 2020 New Revision: 368014 URL: https://svnweb.freebsd.org/changeset/base/368014 Log: Drop superfluous "of" from the systat example. Modified: head/usr.bin/fortune/datfiles/freebsd-tips Modified: head/usr.bin/fortune/datfiles/freebsd-tips ============================================================================== --- head/usr.bin/fortune/datfiles/freebsd-tips Wed Nov 25 09:37:17 2020 (r368013) +++ head/usr.bin/fortune/datfiles/freebsd-tips Wed Nov 25 10:21:29 2020 (r368014) @@ -584,7 +584,7 @@ zfs list -o space -- Benedict Reuschling % To learn more about what your system is doing, take a look at systat(1). For -example, to get various of statistics related to virtual memory usage, process +example, to get various statistics related to virtual memory usage, process scheduling, device interrupts, system name translation caching, and disk I/O, enter the following: From owner-svn-src-all@freebsd.org Wed Nov 25 10:56:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4ED647DE18; Wed, 25 Nov 2020 10:56:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgyWB6D8Vz4sPf; Wed, 25 Nov 2020 10:56:38 +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 C879F10490; Wed, 25 Nov 2020 10:56:38 +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 0APAuc1K066216; Wed, 25 Nov 2020 10:56:38 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APAucDm066214; Wed, 25 Nov 2020 10:56:38 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202011251056.0APAucDm066214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 25 Nov 2020 10:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368015 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 368015 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 10:56:39 -0000 Author: kp Date: Wed Nov 25 10:56:38 2020 New Revision: 368015 URL: https://svnweb.freebsd.org/changeset/base/368015 Log: if: Remove ifnet_rwlock It no longer serves any purpose, as evidenced by the fact that we never take it without ifnet_sxlock. Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D27278 Modified: head/sys/net/if.c head/sys/net/if_var.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed Nov 25 10:21:29 2020 (r368014) +++ head/sys/net/if.c Wed Nov 25 10:56:38 2020 (r368015) @@ -306,15 +306,9 @@ VNET_DEFINE(struct ifnet **, ifindex_table); /* * The global network interface list (V_ifnet) and related state (such as - * if_index, if_indexlim, and ifindex_table) are protected by an sxlock and - * an rwlock. Either may be acquired shared to stablize the list, but both - * must be acquired writable to modify the list. This model allows us to - * both stablize the interface list during interrupt thread processing, but - * also to stablize it over long-running ioctls, without introducing priority - * inversions and deadlocks. + * if_index, if_indexlim, and ifindex_table) are protected by an sxlock. + * This may be acquired to stabilise the list, or we may rely on NET_EPOCH. */ -struct rwlock ifnet_rwlock; -RW_SYSINIT_FLAGS(ifnet_rw, &ifnet_rwlock, "ifnet_rw", RW_RECURSE); struct sx ifnet_sxlock; SX_SYSINIT_FLAGS(ifnet_sx, &ifnet_sxlock, "ifnet_sx", SX_RECURSE); Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Wed Nov 25 10:21:29 2020 (r368014) +++ head/sys/net/if_var.h Wed Nov 25 10:56:38 2020 (r368015) @@ -593,29 +593,12 @@ struct ifmultiaddr { struct epoch_context ifma_epoch_ctx; }; -extern struct rwlock ifnet_rwlock; extern struct sx ifnet_sxlock; -#define IFNET_WLOCK() do { \ - sx_xlock(&ifnet_sxlock); \ - rw_wlock(&ifnet_rwlock); \ -} while (0) - -#define IFNET_WUNLOCK() do { \ - rw_wunlock(&ifnet_rwlock); \ - sx_xunlock(&ifnet_sxlock); \ -} while (0) - -/* - * To assert the ifnet lock, you must know not only whether it's for read or - * write, but also whether it was acquired with sleep support or not. - */ -#define IFNET_RLOCK_ASSERT() sx_assert(&ifnet_sxlock, SA_SLOCKED) -#define IFNET_WLOCK_ASSERT() do { \ - sx_assert(&ifnet_sxlock, SA_XLOCKED); \ - rw_assert(&ifnet_rwlock, RA_WLOCKED); \ -} while (0) - +#define IFNET_WLOCK() sx_xlock(&ifnet_sxlock) +#define IFNET_WUNLOCK() sx_xunlock(&ifnet_sxlock) +#define IFNET_RLOCK_ASSERT() sx_assert(&ifnet_sxlock, SA_SLOCKED) +#define IFNET_WLOCK_ASSERT() sx_assert(&ifnet_sxlock, SA_XLOCKED) #define IFNET_RLOCK() sx_slock(&ifnet_sxlock) #define IFNET_RUNLOCK() sx_sunlock(&ifnet_sxlock) From owner-svn-src-all@freebsd.org Wed Nov 25 11:11:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD81E47E227; Wed, 25 Nov 2020 11:11:30 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgyrL5KZPz4t3J; Wed, 25 Nov 2020 11:11:30 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-WLAN.fritz.box (p200300cd5f0ff700ac60d7652b2f1231.dip0.t-ipconnect.de [IPv6:2003:cd:5f0f:f700:ac60:d765:2b2f:1231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id EE5A95B38; Wed, 25 Nov 2020 11:11:29 +0000 (UTC) (envelope-from se@freebsd.org) To: Mateusz Guzik Cc: Jessica Clarke , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011181944.0AIJiUU3003699@repo.freebsd.org> <81fd2ce6-b5b1-7f05-c575-6b233e78b739@freebsd.org> From: Stefan Esser Subject: Re: svn commit: r367813 - head/lib/libutil Message-ID: <09a2828f-75ce-9cba-3687-b7f8001c3e96@freebsd.org> Date: Wed, 25 Nov 2020 12:11:26 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="AV3ZeQ2jb8vhhkulWX1xjSZf8PODlyWZ4" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 11:11:30 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --AV3ZeQ2jb8vhhkulWX1xjSZf8PODlyWZ4 Content-Type: multipart/mixed; boundary="bdjZ9S9Gk4NkJpstnxXD4ibwFF685BzDf"; protected-headers="v1" From: Stefan Esser To: Mateusz Guzik Cc: Jessica Clarke , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <09a2828f-75ce-9cba-3687-b7f8001c3e96@freebsd.org> Subject: Re: svn commit: r367813 - head/lib/libutil References: <202011181944.0AIJiUU3003699@repo.freebsd.org> <81fd2ce6-b5b1-7f05-c575-6b233e78b739@freebsd.org> In-Reply-To: --bdjZ9S9Gk4NkJpstnxXD4ibwFF685BzDf Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Am 19.11.20 um 01:37 schrieb Mateusz Guzik: > On 11/19/20, Stefan Esser wrote: [...] >> I just wanted to provide an implementation of this functionality to >> be used in a number of programs where other developers had expressed >> interest in such a feature (and one of these programs has been worked >> on by me in recent weeks, so I'm now able to make use of it myself). >=20 > The entire localbase saga is getting way out of hand. Yes, apparently. > To address this e-mail and things you wrote in another reply, my > comlaints are very simple and are not getting less valid for not being > raised sooner. I just was not watching any of this until recent > fallout. >=20 > For the change at hand, there has to be a reason to use a static > symbol. Standard example is catching otherwise expensive to obtain > data. For that the static localbase pointer makes perfect sense, while > the static lookup array does not have any justification that I see. The reason to use a static symbol for the return value is that I do not want to have to use the getlocalbase() on my systems at all. The static lookup array is trivially changed to be stack allocated and filled at run-time, this is a non-issue, IMHO. As explained in an earlier discussion, I'd rather build my systems with a _PATH_LOCALBASE set to a non-default value than use any run-time setting of this value. And thus, my implementation will be just to define getlocalbase in the libutil.h on my systems: #define getlocalbase() _PATH_LOCALBASE Copying into a user provided buffer is of course possible, and such an implementation had been committed before. It does not allow to enforce a compiled in _PATH_LOCALBASE in the way I want to use it, but I would find a way around this. But the diffs to programs that use getlocalbase with caller supplied buffers were significantly larger. My version can just replace the getenv("LOCALBASE") found in a number of places by getlocalbase() (and since getlocalbase() returns the default value if the environment variable has not been set, remove the fallback code for that case). > Bringing cache, TLB or whatever microarchitectural details into the > discussion is beyond not warranted. I did not start bringing in such issues, see the mail I responded to. And I argued that it just did not matter which way the argument array was defined, since either method has minor advantages and disadvantages. > More importantly though the commit comes with a self-confessed memory > leak and is a show stopper. There is no memory leak, actually. Only if you called getlocalbase() in a multi-threaded environment multiple times and in such a way that the non-NULL test before the assignment overlaps with an assignment in another thread, there could have been a leak of a few bytes. But you could not exploit this leak in any way, since there is a limited number of cores that can execute threads in parallel. My supposed initial version did not have any memory leak and had been rejected due to the pre-allocation of a static buffer. I do not agree that this is an issue, since the number of VM pages allocated for the data segment of the library does not grow, and this is what counts. It is easily possible to limit the user.localbase variable to a useful size in the kernel and the library (e.g. 64 bytes, which should be sufficient as a PREFIX). But even at MAXPATHLEN, the memory usage is not increased by this buffer. > That said, I'll see about patching this up. I have created a new review with a static buffer. It does not have any memory leaks, does not increase the memory usage of libutil, and it is fully thread safe and guaranteed to return the same value on each successive invocation (which seems to make sense for a system parameter like LOCALBASE - the code can easily be changed to perform the getenv and sysctl calls on each invocation again). https://reviews.freebsd.org/D27370 Regards, STefan --bdjZ9S9Gk4NkJpstnxXD4ibwFF685BzDf-- --AV3ZeQ2jb8vhhkulWX1xjSZf8PODlyWZ4 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAl++O94FAwAAAAAACgkQR+u171r99USs +wgAuJpC8WYHIiKllw/8eSQuBtEqcjXYJanl0f3MN/IQZFciI26kvi4kp/icqJFdLst0ZTGTc2OA htweKTDvvEScuyiK/ndzcPnlJW9b3aKNZU5b/sci4wpyjDi9CvwQh1IX71lzb6EHNQKYuWVp7ff6 KMbxfTZSSc9o4FHvmDUA7khjFQYM+t2WEvTuPDrzJKWXYk/5iwp2W6TxS3XUgRsARF07VPqIODM7 1m4L7BtKnYTLH3cyxlYanI3hgsNNlGgXyskRtKZN1DalvMkmOHbFfJ8BKbswcjqyubeHpdjFe2Bq CyzZzth7QcudNriH7y2qYD4ois0fXUaomChHVrSHUg== =K1vD -----END PGP SIGNATURE----- --AV3ZeQ2jb8vhhkulWX1xjSZf8PODlyWZ4-- From owner-svn-src-all@freebsd.org Wed Nov 25 11:19:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5EC247DFD5; Wed, 25 Nov 2020 11:19:42 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cgz1p4HVqz4tk1; Wed, 25 Nov 2020 11:19:42 +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 85ED17F72; Wed, 25 Nov 2020 11:19:42 +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 0APBJg66078433; Wed, 25 Nov 2020 11:19:42 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APBJg1K078432; Wed, 25 Nov 2020 11:19:42 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011251119.0APBJg1K078432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 25 Nov 2020 11:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368016 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 368016 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 11:19:42 -0000 Author: manu Date: Wed Nov 25 11:19:42 2020 New Revision: 368016 URL: https://svnweb.freebsd.org/changeset/base/368016 Log: arm64: allwinner: H6: Fix pll 4x clocks The clock configured by the registers are the 4x version not the 1x. Modified: head/sys/arm/allwinner/clkng/ccu_h6.c Modified: head/sys/arm/allwinner/clkng/ccu_h6.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_h6.c Wed Nov 25 10:56:38 2020 (r368015) +++ head/sys/arm/allwinner/clkng/ccu_h6.c Wed Nov 25 11:19:42 2020 (r368016) @@ -196,10 +196,10 @@ NMM_CLK(pll_ddr0_clk, 28, 1000, /* lock */ AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ -static const char *pll_peri0_parents[] = {"osc24M"}; -NMM_CLK(pll_peri0_clk, - CLK_PLL_PERIPH0, /* id */ - "pll_periph0", pll_peri0_parents, /* name, parents */ +static const char *pll_peri0_4x_parents[] = {"osc24M"}; +NMM_CLK(pll_peri0_4x_clk, + CLK_PLL_PERIPH0_4X, /* id */ + "pll_periph0_4x", pll_peri0_4x_parents, /* name, parents */ 0x20, /* offset */ 8, 7, 0, 0, /* n factor */ 0, 1, 0, 0, /* m0 factor */ @@ -207,7 +207,7 @@ NMM_CLK(pll_peri0_clk, 31, /* gate */ 28, 1000, /* lock */ AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ -static const char *pll_peri0_2x_parents[] = {"pll_periph0"}; +static const char *pll_peri0_2x_parents[] = {"pll_periph0_4x"}; FIXED_CLK(pll_peri0_2x_clk, CLK_PLL_PERIPH0_2X, /* id */ "pll_periph0_2x", /* name */ @@ -216,20 +216,20 @@ FIXED_CLK(pll_peri0_2x_clk, 1, /* mult */ 2, /* div */ 0); /* flags */ -static const char *pll_peri0_4x_parents[] = {"pll_periph0"}; -FIXED_CLK(pll_peri0_4x_clk, - CLK_PLL_PERIPH0_4X, /* id */ - "pll_periph0_4x", /* name */ - pll_peri0_4x_parents, /* parent */ +static const char *pll_peri0_parents[] = {"pll_periph0_4x"}; +FIXED_CLK(pll_peri0_clk, + CLK_PLL_PERIPH0, /* id */ + "pll_periph0", /* name */ + pll_peri0_parents, /* parent */ 0, /* freq */ 1, /* mult */ 4, /* div */ 0); /* flags */ -static const char *pll_peri1_parents[] = {"osc24M"}; -NMM_CLK(pll_peri1_clk, - CLK_PLL_PERIPH1, /* id */ - "pll_periph1", pll_peri1_parents, /* name, parents */ +static const char *pll_peri1_4x_parents[] = {"osc24M"}; +NMM_CLK(pll_peri1_4x_clk, + CLK_PLL_PERIPH1_4X, /* id */ + "pll_periph1_4x", pll_peri1_4x_parents, /* name, parents */ 0x28, /* offset */ 8, 7, 0, 0, /* n factor */ 0, 1, 0, 0, /* m0 factor */ @@ -237,7 +237,7 @@ NMM_CLK(pll_peri1_clk, 31, /* gate */ 28, 1000, /* lock */ AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ -static const char *pll_peri1_2x_parents[] = {"pll_periph1"}; +static const char *pll_peri1_2x_parents[] = {"pll_periph1_4x"}; FIXED_CLK(pll_peri1_2x_clk, CLK_PLL_PERIPH1_2X, /* id */ "pll_periph1_2x", /* name */ @@ -246,11 +246,11 @@ FIXED_CLK(pll_peri1_2x_clk, 1, /* mult */ 2, /* div */ 0); /* flags */ -static const char *pll_peri1_4x_parents[] = {"pll_periph1"}; -FIXED_CLK(pll_peri1_4x_clk, - CLK_PLL_PERIPH1_4X, /* id */ - "pll_periph1_4x", /* name */ - pll_peri1_4x_parents, /* parent */ +static const char *pll_peri1_parents[] = {"pll_periph1_4x"}; +FIXED_CLK(pll_peri1_clk, + CLK_PLL_PERIPH1, /* id */ + "pll_periph1", /* name */ + pll_peri1_parents, /* parent */ 0, /* freq */ 1, /* mult */ 4, /* div */ @@ -268,10 +268,10 @@ NMM_CLK(pll_gpu_clk, 28, 1000, /* lock */ AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ -static const char *pll_video0_parents[] = {"osc24M"}; -NMM_CLK(pll_video0_clk, - CLK_PLL_VIDEO0, /* id */ - "pll_video0", pll_video0_parents, /* name, parents */ +static const char *pll_video0_4x_parents[] = {"osc24M"}; +NMM_CLK(pll_video0_4x_clk, + CLK_PLL_VIDEO0_4X, /* id */ + "pll_video0_4x", pll_video0_4x_parents, /* name, parents */ 0x40, /* offset */ 8, 7, 0, 0, /* n factor */ 0, 1, 0, 0, /* m0 factor */ @@ -279,20 +279,20 @@ NMM_CLK(pll_video0_clk, 31, /* gate */ 28, 1000, /* lock */ AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ -static const char *pll_video0_4x_parents[] = {"pll_video0"}; -FIXED_CLK(pll_video0_4x_clk, - CLK_PLL_VIDEO0_4X, /* id */ - "pll_video0_4x", /* name */ - pll_video0_4x_parents, /* parent */ +static const char *pll_video0_parents[] = {"pll_video0_4x"}; +FIXED_CLK(pll_video0_clk, + CLK_PLL_VIDEO0, /* id */ + "pll_video0", /* name */ + pll_video0_parents, /* parent */ 0, /* freq */ 1, /* mult */ 4, /* div */ 0); /* flags */ -static const char *pll_video1_parents[] = {"osc24M"}; -NMM_CLK(pll_video1_clk, - CLK_PLL_VIDEO1, /* id */ - "pll_video1", pll_video1_parents, /* name, parents */ +static const char *pll_video1_4x_parents[] = {"osc24M"}; +NMM_CLK(pll_video1_4x_clk, + CLK_PLL_VIDEO1_4X, /* id */ + "pll_video1_4x", pll_video1_4x_parents, /* name, parents */ 0x48, /* offset */ 8, 7, 0, 0, /* n factor */ 0, 1, 0, 0, /* m0 factor */ @@ -300,11 +300,11 @@ NMM_CLK(pll_video1_clk, 31, /* gate */ 28, 1000, /* lock */ AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ -static const char *pll_video1_4x_parents[] = {"pll_video1"}; -FIXED_CLK(pll_video1_4x_clk, - CLK_PLL_VIDEO1_4X, /* id */ - "pll_video1_4x", /* name */ - pll_video1_4x_parents, /* parent */ +static const char *pll_video1_parents[] = {"pll_video1_4x"}; +FIXED_CLK(pll_video1_clk, + CLK_PLL_VIDEO1, /* id */ + "pll_video1", /* name */ + pll_video1_parents, /* parent */ 0, /* freq */ 1, /* mult */ 4, /* div */ @@ -426,11 +426,11 @@ NM_CLK(mmc2_clk, static struct aw_ccung_clk h6_ccu_clks[] = { { .type = AW_CLK_NP, .clk.np = &pll_cpux_clk}, { .type = AW_CLK_NMM, .clk.nmm = &pll_ddr0_clk}, - { .type = AW_CLK_NMM, .clk.nmm = &pll_peri0_clk}, - { .type = AW_CLK_NMM, .clk.nmm = &pll_peri1_clk}, + { .type = AW_CLK_NMM, .clk.nmm = &pll_peri0_4x_clk}, + { .type = AW_CLK_NMM, .clk.nmm = &pll_peri1_4x_clk}, { .type = AW_CLK_NMM, .clk.nmm = &pll_gpu_clk}, - { .type = AW_CLK_NMM, .clk.nmm = &pll_video0_clk}, - { .type = AW_CLK_NMM, .clk.nmm = &pll_video1_clk}, + { .type = AW_CLK_NMM, .clk.nmm = &pll_video0_4x_clk}, + { .type = AW_CLK_NMM, .clk.nmm = &pll_video1_4x_clk}, { .type = AW_CLK_NMM, .clk.nmm = &pll_ve_clk}, { .type = AW_CLK_NMM, .clk.nmm = &pll_de_clk}, { .type = AW_CLK_NMM, .clk.nmm = &pll_hsic_clk}, @@ -446,11 +446,11 @@ static struct aw_ccung_clk h6_ccu_clks[] = { { .type = AW_CLK_FIXED, .clk.fixed = &osc12m_clk}, { .type = AW_CLK_FIXED, .clk.fixed = &pll_peri0_2x_clk}, - { .type = AW_CLK_FIXED, .clk.fixed = &pll_peri0_4x_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_peri0_clk}, { .type = AW_CLK_FIXED, .clk.fixed = &pll_peri1_2x_clk}, - { .type = AW_CLK_FIXED, .clk.fixed = &pll_peri1_4x_clk}, - { .type = AW_CLK_FIXED, .clk.fixed = &pll_video0_4x_clk}, - { .type = AW_CLK_FIXED, .clk.fixed = &pll_video1_4x_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_peri1_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_video0_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_video1_clk}, }; static int From owner-svn-src-all@freebsd.org Wed Nov 25 11:20:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48B8C47E712; Wed, 25 Nov 2020 11:20:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cgz2F1Mxsz4tf0; Wed, 25 Nov 2020 11:20:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21ECF1088D; Wed, 25 Nov 2020 11:20:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APBK5jo078540; Wed, 25 Nov 2020 11:20:05 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APBK5fk078539; Wed, 25 Nov 2020 11:20:05 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011251120.0APBK5fk078539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 25 Nov 2020 11:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368017 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 368017 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 11:20:05 -0000 Author: manu Date: Wed Nov 25 11:20:04 2020 New Revision: 368017 URL: https://svnweb.freebsd.org/changeset/base/368017 Log: arm: allwinner: aw_rtc: Add H6 compatible Modified: head/sys/arm/allwinner/aw_rtc.c Modified: head/sys/arm/allwinner/aw_rtc.c ============================================================================== --- head/sys/arm/allwinner/aw_rtc.c Wed Nov 25 11:19:42 2020 (r368016) +++ head/sys/arm/allwinner/aw_rtc.c Wed Nov 25 11:20:04 2020 (r368017) @@ -138,6 +138,7 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun6i-a31-rtc", (uintptr_t) &a31_conf }, { "allwinner,sun8i-h3-rtc", (uintptr_t) &h3_conf }, { "allwinner,sun50i-h5-rtc", (uintptr_t) &h3_conf }, + { "allwinner,sun50i-h6-rtc", (uintptr_t) &h3_conf }, { NULL, 0 } }; From owner-svn-src-all@freebsd.org Wed Nov 25 11:21:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E1BC47E472; Wed, 25 Nov 2020 11:21:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cgz3N0PRyz4v98; Wed, 25 Nov 2020 11:21:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F275410570; Wed, 25 Nov 2020 11:21:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APBL38I082457; Wed, 25 Nov 2020 11:21:03 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APBL3Xo082456; Wed, 25 Nov 2020 11:21:03 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011251121.0APBL3Xo082456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 25 Nov 2020 11:21:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368018 - head/sys/modules/dtb/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/modules/dtb/allwinner X-SVN-Commit-Revision: 368018 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 11:21:04 -0000 Author: manu Date: Wed Nov 25 11:21:03 2020 New Revision: 368018 URL: https://svnweb.freebsd.org/changeset/base/368018 Log: dtb: allwinner: Add pineh64 to the build Modified: head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Wed Nov 25 11:20:04 2020 (r368017) +++ head/sys/modules/dtb/allwinner/Makefile Wed Nov 25 11:21:03 2020 (r368018) @@ -47,7 +47,9 @@ DTS= \ allwinner/sun50i-a64-pinebook.dts \ allwinner/sun50i-a64-sopine-baseboard.dts \ allwinner/sun50i-h5-orangepi-pc2.dts \ - allwinner/sun50i-h5-nanopi-neo2.dts + allwinner/sun50i-h5-nanopi-neo2.dts \ + allwinner/sun50i-h6-pine-h64.dts \ + allwinner/sun50i-h6-pine-h64-model-b.dts DTSO= sun50i-a64-opp.dtso \ sun50i-a64-pwm.dtso \ From owner-svn-src-all@freebsd.org Wed Nov 25 11:48:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16F5447F4D8; Wed, 25 Nov 2020 11:48:51 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CgzgQ71WJz3C73; Wed, 25 Nov 2020 11:48:50 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-WLAN.fritz.box (p200300cd5f0ff700ac60d7652b2f1231.dip0.t-ipconnect.de [IPv6:2003:cd:5f0f:f700:ac60:d765:2b2f:1231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 340D96281; Wed, 25 Nov 2020 11:48:50 +0000 (UTC) (envelope-from se@freebsd.org) To: Brooks Davis Cc: Jessica Clarke , src-committers , svn-src-all , svn-src-head References: <202011181944.0AIJiUU3003699@repo.freebsd.org> <25465269-5497-4981-A1E4-CC1FFAB68CF4@freebsd.org> <92a87ed8-4b22-4d03-9481-b02f92dcaaa0@freebsd.org> <9f719272-f1e4-5668-02d2-bd2fbd0e5d6a@freebsd.org> <20201118232034.GE1158@spindle.one-eyed-alien.net> From: Stefan Esser Subject: Re: svn commit: r367813 - head/lib/libutil Message-ID: <8e050429-b0e9-d4dd-c723-f2ba2dd3d00f@freebsd.org> Date: Wed, 25 Nov 2020 12:48:48 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20201118232034.GE1158@spindle.one-eyed-alien.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Z5NFINb7crvPmXNGjZlvjqE1u2yCdWQdH" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 11:48:51 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Z5NFINb7crvPmXNGjZlvjqE1u2yCdWQdH Content-Type: multipart/mixed; boundary="WXpJi1DbZdEgugAkkDt68BRCoIIDlws0g"; protected-headers="v1" From: Stefan Esser To: Brooks Davis Cc: Jessica Clarke , src-committers , svn-src-all , svn-src-head Message-ID: <8e050429-b0e9-d4dd-c723-f2ba2dd3d00f@freebsd.org> Subject: Re: svn commit: r367813 - head/lib/libutil References: <202011181944.0AIJiUU3003699@repo.freebsd.org> <25465269-5497-4981-A1E4-CC1FFAB68CF4@freebsd.org> <92a87ed8-4b22-4d03-9481-b02f92dcaaa0@freebsd.org> <9f719272-f1e4-5668-02d2-bd2fbd0e5d6a@freebsd.org> <20201118232034.GE1158@spindle.one-eyed-alien.net> In-Reply-To: <20201118232034.GE1158@spindle.one-eyed-alien.net> --WXpJi1DbZdEgugAkkDt68BRCoIIDlws0g Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Am 19.11.20 um 00:20 schrieb Brooks Davis: > On Thu, Nov 19, 2020 at 12:05:51AM +0100, Stefan Esser wrote: >> Am 18.11.20 um 23:14 schrieb Jessica Clarke: >>> Why not? There could easily be code out there calling getenv in a >>> multi-threaded context so this is inadequate as a replacement. Yes it= 's >>> inefficient but it's perfectly legal and imaginable. >> >> Yes, calling getenv() might occur, but getlocalbase() is generally >> called before configuration files are accessed, and the resulting >> path is saved in the program. Other uses are possible, but this is >> the recurring pattern. >=20 > This seems like a very naive assumption. I could easily see libraries > wanting to know where localbase is and calling this completely without > knowledge of the application programmer. Yes, and what's the issue, then? The implementation that I provided could be called in a multi- threaded environment and from within libraries. It checked whether a new allocation was required and returned the pointer stored by another thread (but with identical contents) in case it lost a potential race that could exist once during the execution of this function for a fraction of a microsecond. Only if another thread had managed to store its pointer after the check for it being NULL simultaneously, then a few bytes could have been lost. You might have been able to trigger this with a specifically built test program. But I had only added the run-time allocation of that buffer (which might be exploited to leak at most a few KB or heap space) due to requests in the discussion. My initial version used a statically allocated buffer and was completely safe. >> I have written about this possibility and I had appreciated >> if comments had been made on Phabricator before the commit. >=20 > Don't mistake posting something for review with obtaining > consensus. I glanced at the review, but it contained no use cases or > justification for the feature so it was impossible to comment on the > implementation in the time I had. I still don't understand what you ai= m > to support and why (except that your implementation fails to support > things like per-jail or per-ABI localbase which both seem like things > people might want.) As described in the review, adding per-jail variables is a way to extend the usefulness of this function, but out-of-scope at this time. It requires changes to other parts of FreeBSD (kernel, jails) that might then lead to an update of this function, but which can be developed independently of the initial use of this function in the limit way currently supported by the kernel. And I do not need the run-time configurability at all. In fact, I'd replace getlocalbase() calls by a macro substitution that just returns _PATH_LOCALBASE as the default value the system was built with. But there has been interest in this feature and getenv("LOCALBASE") has been used in a number of programs to be able to manipulate that prefix at run-time. This implementation just simplifies the getenv() calls in that case, and that alone might be a justification for this function. It has the added security feature of checking issetugid() and not using the environment value in that case. Thus it simplifies programs and allows them to take advantage of other methods to configure LOCALBASE (e.g. later per jail or per ABI) without changes to the programs reaching into LOCALBASE. The getlocalbase() function had been suggested by Scott Long to provide a generic means to retrieve the LOCALBASE prefix in programs. Therefore, he implemented the getenv() functionality found in a number of programs, before. I had patched the calendar program to support data files provided by a port (deskutils/calendar-data) to ease maintenance of these date files outside of the base system. While doing this, I noticed the use of literal "/usr/local" in a number of base system utilities and provided this value as _PATH_LOCALBASE to make it easier to override, if desired (not needed by me, but again requested on the maillists in several threads). A non-default _PATH_LOCALBASE can be compiled into programs, but not in e.g. shell scripts. I have added the user.localbase sysctl to query _PATH_LOCALBASE from programs that do not have it compiled in (e.g. shell scripts). The user.localbase sysctl variable is queried and passed to the rc subsystem as ${_localbase} by changes committed by me in SVN rev. 367294. All these changes are meant to allow building a system that has a non-default LOCALBASE, without hunting down all literal occurances of "/usr/local" in the tree. Making sysctl("user.localbase") available in getlocalbase() is then a logical consequence of all the other changes. As I wrote before: I'm interested in providing a standard method to obtain LOCALBASE in case it is not set to the FreeBSD default value of "/usr/local" to allow as many components of the system to automatically use the correct paths in such an environment. The function should always return a string value that can be used as a prefix for a file name (i.e. should never return NULL or any other value that needs to be explicitly checked for by the caller). Added functionality, e.g. jail or ABI specific values should be supported by extended versions of this functions without a need to change or even re-compile the calling programs. I have created a new review for a proposed replacement of the current implementation as: https://reviews.freebsd.org/D27370 I highly prefer that implementation and it is based on my initial review version of D27236, which did not use a heap-allocated buffer. Regards, STefan --WXpJi1DbZdEgugAkkDt68BRCoIIDlws0g-- --Z5NFINb7crvPmXNGjZlvjqE1u2yCdWQdH Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAl++RKAFAwAAAAAACgkQR+u171r99UQr lgf/YNYtULm/KAKtnSZ+Ko6XqGrXV7R+/ajyNzBChqxgIPEq4kbZaChgT1lPXq+98z+K9z0EDmo8 7e7Zt1Nu9EPguAdpyrpfg5tdHxtrm5NaBUidAwArRV00t+2V33dH973ZHJMh6BVjMgd1TBqyInHv GG+8hckebvgH5nECoaKp1YACK3vC0/R8HkV0MYU10I6n2P5VDMNDjb4SGU+xfKwamejyE/s/mcrI 7xNZgxSpqZX9z9oP16mZ1wppxyW761oEeH35CuqECNPPu++cM/+MzgMaJmn2R25R1YOSiOh/jw7C XKnMtNE9ZF9K7wBToPB/MbYnl2WefzxKh25qHN6zfA== =jfza -----END PGP SIGNATURE----- --Z5NFINb7crvPmXNGjZlvjqE1u2yCdWQdH-- From owner-svn-src-all@freebsd.org Wed Nov 25 14:26:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECB7746AECB; Wed, 25 Nov 2020 14:26:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ch39168klz3Lgh; Wed, 25 Nov 2020 14:26:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C66EE128D9; Wed, 25 Nov 2020 14:26:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APEQDBj096223; Wed, 25 Nov 2020 14:26:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APEQDqU096222; Wed, 25 Nov 2020 14:26:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202011251426.0APEQDqU096222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 25 Nov 2020 14:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368019 - head/contrib/llvm-project/clang/lib/Driver/ToolChains X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/llvm-project/clang/lib/Driver/ToolChains X-SVN-Commit-Revision: 368019 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 14:26:14 -0000 Author: emaste Date: Wed Nov 25 14:26:13 2020 New Revision: 368019 URL: https://svnweb.freebsd.org/changeset/base/368019 Log: clang: allow -fstack-clash-protection on FreeBSD -fstack-clash-protection was added in Clang commit e67cbac81211 but was enabled only on Linux. It should work fine on FreeBSD as well, so enable it. To be discussed and upstreamed with a test. The OS test should probably just be removed. Reviewed by: dim MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27366 Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Wed Nov 25 11:21:03 2020 (r368018) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Wed Nov 25 14:26:13 2020 (r368019) @@ -2967,7 +2967,7 @@ static void RenderSCPOptions(const ToolChain &TC, cons ArgStringList &CmdArgs) { const llvm::Triple &EffectiveTriple = TC.getEffectiveTriple(); - if (!EffectiveTriple.isOSLinux()) + if (!EffectiveTriple.isOSFreeBSD() && !EffectiveTriple.isOSLinux()) return; if (!EffectiveTriple.isX86() && !EffectiveTriple.isSystemZ() && From owner-svn-src-all@freebsd.org Wed Nov 25 15:07:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 166F746C92B; Wed, 25 Nov 2020 15:07:23 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ch44W0CQDz3P6d; Wed, 25 Nov 2020 15:07:23 +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 EE0551343E; Wed, 25 Nov 2020 15:07:22 +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 0APF7MFJ021740; Wed, 25 Nov 2020 15:07:22 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APF7M7s021739; Wed, 25 Nov 2020 15:07:22 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202011251507.0APF7M7s021739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 25 Nov 2020 15:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368020 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 368020 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 15:07:23 -0000 Author: kp Date: Wed Nov 25 15:07:22 2020 New Revision: 368020 URL: https://svnweb.freebsd.org/changeset/base/368020 Log: if: Protect V_ifnet in vnet_if_return() When we terminate a vnet (i.e. jail) we move interfaces back to their home vnet. We need to protect our access to the V_ifnet CK_LIST. We could enter NET_EPOCH, but if_detach_internal() (called from if_vmove()) waits for net epoch callback completion. That's not possible from NET_EPOCH. Instead, we take the IFNET_WLOCK, build a list of the interfaces that need to move and, once we've released the lock, move them back to their home vnet. We cannot hold the IFNET_WLOCK() during if_vmove(), because that results in a LOR between ifnet_sx, in_multi_sx and iflib ctx lock. Separate out moving the ifp into or out of V_ifnet, so we can hold the lock as we do the list manipulation, but do not hold it as we if_vmove(). Reviewed by: melifaro MFC after: 2 weeks Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D27279 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed Nov 25 14:26:13 2020 (r368019) +++ head/sys/net/if.c Wed Nov 25 15:07:22 2020 (r368020) @@ -275,6 +275,8 @@ static void if_delgroups(struct ifnet *); static void if_attach_internal(struct ifnet *, int, struct if_clone *); static int if_detach_internal(struct ifnet *, int, struct if_clone **); static void if_siocaddmulti(void *, int); +static void if_link_ifnet(struct ifnet *); +static bool if_unlink_ifnet(struct ifnet *, bool); #ifdef VIMAGE static int if_vmove(struct ifnet *, struct vnet *); #endif @@ -468,15 +470,81 @@ VNET_SYSUNINIT(vnet_if_uninit, SI_SUB_INIT_IF, SI_ORDE vnet_if_uninit, NULL); static void +if_link_ifnet(struct ifnet *ifp) +{ + + IFNET_WLOCK(); + CK_STAILQ_INSERT_TAIL(&V_ifnet, ifp, if_link); +#ifdef VIMAGE + curvnet->vnet_ifcnt++; +#endif + IFNET_WUNLOCK(); +} + +static bool +if_unlink_ifnet(struct ifnet *ifp, bool vmove) +{ + struct ifnet *iter; + int found = 0; + + IFNET_WLOCK(); + CK_STAILQ_FOREACH(iter, &V_ifnet, if_link) + if (iter == ifp) { + CK_STAILQ_REMOVE(&V_ifnet, ifp, ifnet, if_link); + if (!vmove) + ifp->if_flags |= IFF_DYING; + found = 1; + break; + } +#ifdef VIMAGE + curvnet->vnet_ifcnt--; +#endif + IFNET_WUNLOCK(); + + return (found); +} + +static void vnet_if_return(const void *unused __unused) { struct ifnet *ifp, *nifp; + struct ifnet **pending; + int found, i; + i = 0; + + /* + * We need to protect our access to the V_ifnet tailq. Ordinarily we'd + * enter NET_EPOCH, but that's not possible, because if_vmove() calls + * if_detach_internal(), which waits for NET_EPOCH callbacks to + * complete. We can't do that from within NET_EPOCH. + * + * However, we can also use the IFNET_xLOCK, which is the V_ifnet + * read/write lock. We cannot hold the lock as we call if_vmove() + * though, as that presents LOR w.r.t ifnet_sx, in_multi_sx and iflib + * ctx lock. + */ + IFNET_WLOCK(); + + pending = malloc(sizeof(struct ifnet *) * curvnet->vnet_ifcnt, + M_IFNET, M_WAITOK | M_ZERO); + /* Return all inherited interfaces to their parent vnets. */ CK_STAILQ_FOREACH_SAFE(ifp, &V_ifnet, if_link, nifp) { - if (ifp->if_home_vnet != ifp->if_vnet) - if_vmove(ifp, ifp->if_home_vnet); + if (ifp->if_home_vnet != ifp->if_vnet) { + found = if_unlink_ifnet(ifp, true); + MPASS(found); + + pending[i++] = ifp; + } } + IFNET_WUNLOCK(); + + for (int j = 0; j < i; j++) { + if_vmove(pending[j], pending[j]->if_home_vnet); + } + + free(pending, M_IFNET); } VNET_SYSUNINIT(vnet_if_return, SI_SUB_VNET_DONE, SI_ORDER_ANY, vnet_if_return, NULL); @@ -906,12 +974,7 @@ if_attach_internal(struct ifnet *ifp, int vmove, struc } #endif - IFNET_WLOCK(); - CK_STAILQ_INSERT_TAIL(&V_ifnet, ifp, if_link); -#ifdef VIMAGE - curvnet->vnet_ifcnt++; -#endif - IFNET_WUNLOCK(); + if_link_ifnet(ifp); if (domain_init_status >= 2) if_attachdomain1(ifp); @@ -1049,9 +1112,12 @@ if_purgemaddrs(struct ifnet *ifp) void if_detach(struct ifnet *ifp) { + bool found; CURVNET_SET_QUIET(ifp->if_vnet); - if_detach_internal(ifp, 0, NULL); + found = if_unlink_ifnet(ifp, false); + if (found) + if_detach_internal(ifp, 0, NULL); CURVNET_RESTORE(); } @@ -1071,46 +1137,16 @@ if_detach_internal(struct ifnet *ifp, int vmove, struc struct ifaddr *ifa; int i; struct domain *dp; - struct ifnet *iter; - int found = 0; #ifdef VIMAGE bool shutdown; shutdown = VNET_IS_SHUTTING_DOWN(ifp->if_vnet); #endif - IFNET_WLOCK(); - CK_STAILQ_FOREACH(iter, &V_ifnet, if_link) - if (iter == ifp) { - CK_STAILQ_REMOVE(&V_ifnet, ifp, ifnet, if_link); - if (!vmove) - ifp->if_flags |= IFF_DYING; - found = 1; - break; - } - IFNET_WUNLOCK(); - if (!found) { - /* - * While we would want to panic here, we cannot - * guarantee that the interface is indeed still on - * the list given we don't hold locks all the way. - */ - return (ENOENT); -#if 0 - if (vmove) - panic("%s: ifp=%p not on the ifnet tailq %p", - __func__, ifp, &V_ifnet); - else - return; /* XXX this should panic as well? */ -#endif - } /* * At this point we know the interface still was on the ifnet list * and we removed it so we are in a stable state. */ -#ifdef VIMAGE - curvnet->vnet_ifcnt--; -#endif epoch_wait_preempt(net_epoch_preempt); /* @@ -1340,6 +1376,7 @@ if_vmove_loan(struct thread *td, struct ifnet *ifp, ch struct prison *pr; struct ifnet *difp; int error; + bool found; bool shutdown; /* Try to find the prison within our visibility. */ @@ -1376,6 +1413,9 @@ if_vmove_loan(struct thread *td, struct ifnet *ifp, ch } CURVNET_RESTORE(); + found = if_unlink_ifnet(ifp, true); + MPASS(found); + /* Move the interface into the child jail/vnet. */ error = if_vmove(ifp, pr->pr_vnet); @@ -1393,7 +1433,7 @@ if_vmove_reclaim(struct thread *td, char *ifname, int struct prison *pr; struct vnet *vnet_dst; struct ifnet *ifp; - int error; + int error, found; bool shutdown; /* Try to find the prison within our visibility. */ @@ -1431,6 +1471,8 @@ if_vmove_reclaim(struct thread *td, char *ifname, int } /* Get interface back from child jail/vnet. */ + found = if_unlink_ifnet(ifp, true); + MPASS(found); error = if_vmove(ifp, vnet_dst); CURVNET_RESTORE(); From owner-svn-src-all@freebsd.org Wed Nov 25 15:45:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DFFA46D62A; Wed, 25 Nov 2020 15:45:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ch4wK1pkZz3R0R; Wed, 25 Nov 2020 15:45:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CECD13C9B; Wed, 25 Nov 2020 15:45:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APFjLcq046492; Wed, 25 Nov 2020 15:45:21 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APFjL0h046491; Wed, 25 Nov 2020 15:45:21 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202011251545.0APFjL0h046491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 25 Nov 2020 15:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368021 - head/sys/arm/ti X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti X-SVN-Commit-Revision: 368021 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 15:45:21 -0000 Author: ian Date: Wed Nov 25 15:45:20 2020 New Revision: 368021 URL: https://svnweb.freebsd.org/changeset/base/368021 Log: Only attach the ti_scm_syscon driver when running on a compatible TI chip. This prevents attaching on non-TI systems in the GENERIC kernel. Reviewed by: manu@, mmel@ Modified: head/sys/arm/ti/ti_scm_syscon.c Modified: head/sys/arm/ti/ti_scm_syscon.c ============================================================================== --- head/sys/arm/ti/ti_scm_syscon.c Wed Nov 25 15:07:22 2020 (r368020) +++ head/sys/arm/ti/ti_scm_syscon.c Wed Nov 25 15:45:20 2020 (r368021) @@ -54,6 +54,8 @@ __FBSDID("$FreeBSD$"); #include #include "clkdev_if.h" +#include + #if 0 #define DPRINTF(dev, msg...) device_printf(dev, msg) #else @@ -146,6 +148,9 @@ static int ti_scm_syscon_probe(device_t dev) { if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ti_soc_is_supported()) return (ENXIO); if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) From owner-svn-src-all@freebsd.org Wed Nov 25 16:30:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F29746E72C; Wed, 25 Nov 2020 16:30:57 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ch5wx3jqcz3jZ4; Wed, 25 Nov 2020 16:30:57 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 724BA143B8; Wed, 25 Nov 2020 16:30:57 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APGUvMS072231; Wed, 25 Nov 2020 16:30:57 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APGUvVO072230; Wed, 25 Nov 2020 16:30:57 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <202011251630.0APGUvVO072230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Wed, 25 Nov 2020 16:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368022 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 368022 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 16:30:57 -0000 Author: kaktus Date: Wed Nov 25 16:30:57 2020 New Revision: 368022 URL: https://svnweb.freebsd.org/changeset/base/368022 Log: libsysdecode: correctly decode mmap flags r352913 added decoding of mmap PROT_MAX()'d flags but didn’t account for the case where different values were specified for PROT_MAX and regular flags. Fix it. Submitted by: sigsys_gmail.com Reported by: sigsys_gmail.com MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D27312 Modified: head/lib/libsysdecode/flags.c Modified: head/lib/libsysdecode/flags.c ============================================================================== --- head/lib/libsysdecode/flags.c Wed Nov 25 15:45:20 2020 (r368021) +++ head/lib/libsysdecode/flags.c Wed Nov 25 16:30:57 2020 (r368022) @@ -662,11 +662,11 @@ sysdecode_mmap_prot(FILE *fp, int prot, int *rem) printed = false; protm = PROT_MAX_EXTRACT(prot); + prot = PROT_EXTRACT(prot); if (protm != 0) { fputs("PROT_MAX(", fp); printed = print_mask_int(fp, mmapprot, protm, rem); fputs(")|", fp); - prot = protm; } return (print_mask_int(fp, mmapprot, prot, rem) || printed); } From owner-svn-src-all@freebsd.org Wed Nov 25 17:04:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99BAA46EE78; Wed, 25 Nov 2020 17:04:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ch6gZ6rVHz3lbm; Wed, 25 Nov 2020 17:04:26 +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 D15DF14CB5; Wed, 25 Nov 2020 17:04:26 +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 0APH4QNd096471; Wed, 25 Nov 2020 17:04:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APH4Qgh096470; Wed, 25 Nov 2020 17:04:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011251704.0APH4Qgh096470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 25 Nov 2020 17:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368023 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 368023 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 17:04:27 -0000 Author: kib Date: Wed Nov 25 17:04:26 2020 New Revision: 368023 URL: https://svnweb.freebsd.org/changeset/base/368023 Log: Use designated initializers for libc pthread stubs' jump table. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/gen/_pthread_stubs.c Modified: head/lib/libc/gen/_pthread_stubs.c ============================================================================== --- head/lib/libc/gen/_pthread_stubs.c Wed Nov 25 16:30:57 2020 (r368022) +++ head/lib/libc/gen/_pthread_stubs.c Wed Nov 25 17:04:26 2020 (r368023) @@ -64,73 +64,73 @@ static void stub_exit(void); (pthread_func_t)entry, (pthread_func_t)entry pthread_func_entry_t __thr_jtable[PJT_MAX] = { - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATFORK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_DESTROY */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETDETACHSTATE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETGUARDSIZE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETINHERITSCHED */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETSCHEDPARAM */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETSCHEDPOLICY */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETSCOPE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETSTACKADDR */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_GETSTACKSIZE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_INIT */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETDETACHSTATE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETGUARDSIZE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETINHERITSCHED */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETSCHEDPARAM */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETSCHEDPOLICY */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETSCOPE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETSTACKADDR */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ATTR_SETSTACKSIZE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CANCEL */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CLEANUP_POP */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CLEANUP_PUSH */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_BROADCAST */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_DESTROY */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_INIT */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_SIGNAL */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_TIMEDWAIT */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_COND_WAIT */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_DETACH */ - {PJT_DUAL_ENTRY(stub_true)}, /* PJT_EQUAL */ - {PJT_DUAL_ENTRY(stub_exit)}, /* PJT_EXIT */ - {PJT_DUAL_ENTRY(stub_null)}, /* PJT_GETSPECIFIC */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_JOIN */ - {PJT_DUAL_ENTRY(stub_fail)}, /* PJT_KEY_CREATE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_KEY_DELETE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_KILL */ - {PJT_DUAL_ENTRY(stub_main)}, /* PJT_MAIN_NP */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_DESTROY */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_INIT */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_SETTYPE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_DESTROY */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_INIT */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_LOCK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_TRYLOCK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_UNLOCK */ - {PJT_DUAL_ENTRY(stub_fail)}, /* PJT_ONCE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_DESTROY */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_INIT */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_RDLOCK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_TRYRDLOCK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_TRYWRLOCK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_UNLOCK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_WRLOCK */ - {PJT_DUAL_ENTRY(stub_self)}, /* PJT_SELF */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_SETCANCELSTATE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_SETCANCELTYPE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_SETSPECIFIC */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_SIGMASK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_TESTCANCEL */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CLEANUP_POP_IMP */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CLEANUP_PUSH_IMP */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CANCEL_ENTER */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CANCEL_LEAVE */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_CONSISTENT */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_GETROBUST */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_SETROBUST */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_GETTHREADID_NP */ + [PJT_ATFORK] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_DESTROY] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_GETDETACHSTATE] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_GETGUARDSIZE] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_GETINHERITSCHED] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_GETSCHEDPARAM] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_GETSCHEDPOLICY] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_GETSCOPE] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_GETSTACKADDR] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_GETSTACKSIZE] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_INIT] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_SETDETACHSTATE] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_SETGUARDSIZE] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_SETINHERITSCHED] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_SETSCHEDPARAM] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_SETSCHEDPOLICY] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_SETSCOPE] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_SETSTACKADDR] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_SETSTACKSIZE] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_CANCEL] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_CLEANUP_POP] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_CLEANUP_PUSH] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_COND_BROADCAST] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_COND_DESTROY] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_COND_INIT] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_COND_SIGNAL] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_COND_TIMEDWAIT] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_COND_WAIT] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_DETACH] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_EQUAL] = {PJT_DUAL_ENTRY(stub_true)}, + [PJT_EXIT] = {PJT_DUAL_ENTRY(stub_exit)}, + [PJT_GETSPECIFIC] = {PJT_DUAL_ENTRY(stub_null)}, + [PJT_JOIN] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_KEY_CREATE] = {PJT_DUAL_ENTRY(stub_fail)}, + [PJT_KEY_DELETE] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_KILL] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_MAIN_NP] = {PJT_DUAL_ENTRY(stub_main)}, + [PJT_MUTEXATTR_DESTROY] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_MUTEXATTR_INIT] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_MUTEXATTR_SETTYPE] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_MUTEX_DESTROY] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_MUTEX_INIT] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_MUTEX_LOCK] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_MUTEX_TRYLOCK] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_MUTEX_UNLOCK] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ONCE] = {PJT_DUAL_ENTRY(stub_fail)}, + [PJT_RWLOCK_DESTROY] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_RWLOCK_INIT] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_RWLOCK_RDLOCK] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_RWLOCK_TRYRDLOCK] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_RWLOCK_TRYWRLOCK] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_RWLOCK_UNLOCK] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_RWLOCK_WRLOCK] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_SELF] = {PJT_DUAL_ENTRY(stub_self)}, + [PJT_SETCANCELSTATE] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_SETCANCELTYPE] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_SETSPECIFIC] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_SIGMASK] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_TESTCANCEL] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_CLEANUP_POP_IMP] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_CLEANUP_PUSH_IMP] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_CANCEL_ENTER] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_CANCEL_LEAVE] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_MUTEX_CONSISTENT] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_MUTEXATTR_GETROBUST] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_MUTEXATTR_SETROBUST] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_GETTHREADID_NP] = {PJT_DUAL_ENTRY(stub_zero)}, }; /* From owner-svn-src-all@freebsd.org Wed Nov 25 17:12:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B57F46F3FC; Wed, 25 Nov 2020 17:12:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ch6rj70zjz3mLX; Wed, 25 Nov 2020 17:12:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D953114A74; Wed, 25 Nov 2020 17:12:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APHCLa9002787; Wed, 25 Nov 2020 17:12:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APHCL8m002762; Wed, 25 Nov 2020 17:12:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011251712.0APHCL8m002762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 25 Nov 2020 17:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368024 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 368024 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 17:12:22 -0000 Author: kib Date: Wed Nov 25 17:12:21 2020 New Revision: 368024 URL: https://svnweb.freebsd.org/changeset/base/368024 Log: ffs_softdep.c: get_parent_vp(): Fix bp lock leak when inum inode was already freed. Reported by: markj, pho Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed Nov 25 17:04:26 2020 (r368023) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Nov 25 17:12:21 2020 (r368024) @@ -1409,6 +1409,29 @@ SYSCTL_INT(_debug_softdep, OID_AUTO, print_threads, CT /* List of all filesystems mounted with soft updates */ static TAILQ_HEAD(, mount_softdeps) softdepmounts; +static void +get_parent_vp_unlock_bp(struct mount *mp, struct buf *bp, + struct diraddhd *diraddhdp, struct diraddhd *unfinishedp) +{ + struct diradd *dap; + + /* + * Requeue unfinished dependencies before + * unlocking buffer, which could make + * diraddhdp invalid. + */ + ACQUIRE_LOCK(VFSTOUFS(mp)); + while ((dap = LIST_FIRST(unfinishedp)) != NULL) { + LIST_REMOVE(dap, da_pdlist); + LIST_INSERT_HEAD(diraddhdp, dap, da_pdlist); + } + FREE_LOCK(VFSTOUFS(mp)); + + bp->b_vflags &= ~BV_SCANNED; + BUF_NOREC(bp); + BUF_UNLOCK(bp); +} + /* * This function fetches inode inum on mount point mp. We already * hold a locked vnode vp, and might have a locked buffer bp belonging @@ -1439,7 +1462,6 @@ get_parent_vp(struct vnode *vp, struct mount *mp, ino_ struct vnode **rvp) { struct vnode *pvp; - struct diradd *dap; int error; bool bplocked; @@ -1455,31 +1477,18 @@ get_parent_vp(struct vnode *vp, struct mount *mp, ino_ * restart the syscall. */ if (VTOI(pvp)->i_mode == 0 || !bplocked) { + if (bp != NULL && bplocked) + get_parent_vp_unlock_bp(mp, bp, + diraddhdp, unfinishedp); if (VTOI(pvp)->i_mode == 0) vgone(pvp); - vput(pvp); error = ERELOOKUP; - goto out; + goto out2; } - - error = 0; goto out1; } if (bp != NULL && bplocked) { - /* - * Requeue unfinished dependencies before - * unlocking buffer, which could make - * diraddhdp invalid. - */ - ACQUIRE_LOCK(VFSTOUFS(mp)); - while ((dap = LIST_FIRST(unfinishedp)) != NULL) { - LIST_REMOVE(dap, da_pdlist); - LIST_INSERT_HEAD(diraddhdp, dap, da_pdlist); - } - FREE_LOCK(VFSTOUFS(mp)); - bp->b_vflags &= ~BV_SCANNED; - BUF_NOREC(bp); - BUF_UNLOCK(bp); + get_parent_vp_unlock_bp(mp, bp, diraddhdp, unfinishedp); bplocked = false; } @@ -1528,13 +1537,13 @@ get_parent_vp(struct vnode *vp, struct mount *mp, ino_ MPASS(!bplocked); error = ERELOOKUP; } +out2: if (error != 0 && pvp != NULL) { vput(pvp); pvp = NULL; } out1: *rvp = pvp; -out: ASSERT_VOP_ELOCKED(vp, "child vnode must be locked on return"); return (error); } From owner-svn-src-all@freebsd.org Wed Nov 25 17:15:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 665AF46F994; Wed, 25 Nov 2020 17:15:25 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ch6wF2PJ9z3mB1; Wed, 25 Nov 2020 17:15:25 +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 40BE914E98; Wed, 25 Nov 2020 17:15:25 +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 0APHFPnl003066; Wed, 25 Nov 2020 17:15:25 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APHFPix003065; Wed, 25 Nov 2020 17:15:25 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202011251715.0APHFPix003065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 25 Nov 2020 17:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368025 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 368025 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 17:15:25 -0000 Author: kp Date: Wed Nov 25 17:15:24 2020 New Revision: 368025 URL: https://svnweb.freebsd.org/changeset/base/368025 Log: if: Fix non-VIMAGE build if_link_ifnet() and if_unlink_ifnet() are needed even when VIMAGE is not enabled. MFC after: 2 weeks Sponsored by: Modirum MDPay Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed Nov 25 17:12:21 2020 (r368024) +++ head/sys/net/if.c Wed Nov 25 17:15:24 2020 (r368025) @@ -468,6 +468,7 @@ vnet_if_uninit(const void *unused __unused) } VNET_SYSUNINIT(vnet_if_uninit, SI_SUB_INIT_IF, SI_ORDER_FIRST, vnet_if_uninit, NULL); +#endif static void if_link_ifnet(struct ifnet *ifp) @@ -504,6 +505,7 @@ if_unlink_ifnet(struct ifnet *ifp, bool vmove) return (found); } +#ifdef VIMAGE static void vnet_if_return(const void *unused __unused) { From owner-svn-src-all@freebsd.org Wed Nov 25 18:09:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69261470A24; Wed, 25 Nov 2020 18:09:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ch8661g9Yz3pXW; Wed, 25 Nov 2020 18:09:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2770F152E5; Wed, 25 Nov 2020 18:09:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0API91pv034547; Wed, 25 Nov 2020 18:09:01 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0API91Aq034546; Wed, 25 Nov 2020 18:09:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202011251809.0API91Aq034546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 25 Nov 2020 18:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368026 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 368026 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 18:09:02 -0000 Author: ian Date: Wed Nov 25 18:09:01 2020 New Revision: 368026 URL: https://svnweb.freebsd.org/changeset/base/368026 Log: A couple small fixes for the imx6_sdma driver... Attach after interrupt controllers, since the attach function tries to set up an interrupt handler. Check for the availability of the required firmware early in the attach code (before allocating resources). If the firmware is not available, set a static var to remember that, so that if the device is re-probed on later passes it won't repeatedly try to attach and then complain again about missing firmware. Modified: head/sys/arm/freescale/imx/imx6_sdma.c Modified: head/sys/arm/freescale/imx/imx6_sdma.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_sdma.c Wed Nov 25 17:15:24 2020 (r368025) +++ head/sys/arm/freescale/imx/imx6_sdma.c Wed Nov 25 18:09:01 2020 (r368026) @@ -75,6 +75,12 @@ static struct resource_spec sdma_spec[] = { { -1, 0 } }; +/* + * This will get set to true if we can't load firmware while attaching, to + * prevent multiple attempts to re-attach the device on each bus pass. + */ +static bool firmware_unavailable; + static void sdma_intr(void *arg) { @@ -117,7 +123,7 @@ static int sdma_probe(device_t dev) { - if (!ofw_bus_status_okay(dev)) + if (!ofw_bus_status_okay(dev) || firmware_unavailable) return (ENXIO); if (!ofw_bus_is_compatible(dev, "fsl,imx6q-sdma")) @@ -468,6 +474,11 @@ sdma_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; + if (load_firmware(sc) == -1) { + firmware_unavailable = true; + return (ENXIO); + } + if (bus_alloc_resources(dev, sdma_spec, sc->res)) { device_printf(dev, "could not allocate resources\n"); return (ENXIO); @@ -487,9 +498,6 @@ sdma_attach(device_t dev) return (ENXIO); } - if (load_firmware(sc) == -1) - return (ENXIO); - if (boot_firmware(sc) == -1) return (ENXIO); @@ -511,5 +519,6 @@ static driver_t sdma_driver = { static devclass_t sdma_devclass; +/* We want to attach after all interrupt controllers, before anything else. */ EARLY_DRIVER_MODULE(sdma, simplebus, sdma_driver, sdma_devclass, 0, 0, - BUS_PASS_RESOURCE); + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); From owner-svn-src-all@freebsd.org Wed Nov 25 18:36:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B6814717CC; Wed, 25 Nov 2020 18:36:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ch8jz1Gv8z3s1W; Wed, 25 Nov 2020 18:36:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E8E515BA9; Wed, 25 Nov 2020 18:36:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APIadFO053899; Wed, 25 Nov 2020 18:36:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APIacIP053898; Wed, 25 Nov 2020 18:36:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202011251836.0APIacIP053898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 25 Nov 2020 18:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368027 - stable/12/lib/libc/string X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/lib/libc/string X-SVN-Commit-Revision: 368027 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 18:36:39 -0000 Author: emaste Date: Wed Nov 25 18:36:38 2020 New Revision: 368027 URL: https://svnweb.freebsd.org/changeset/base/368027 Log: MFC r351700: libc: Use musl's optimized memchr Parentheses added to HASZERO macro to avoid a GCC warning. Sponsored by: The FreeBSD Foundation Modified: stable/12/lib/libc/string/memchr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/string/memchr.c ============================================================================== --- stable/12/lib/libc/string/memchr.c Wed Nov 25 18:09:01 2020 (r368026) +++ stable/12/lib/libc/string/memchr.c Wed Nov 25 18:36:38 2020 (r368027) @@ -1,55 +1,54 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: MIT * - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2005-2014 Rich Felker, et al. * - * This code is derived from software contributed to Berkeley by - * Chris Torek. + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. * - * 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. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)memchr.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); #include +#include +#include -void * -memchr(const void *s, int c, size_t n) -{ - if (n != 0) { - const unsigned char *p = s; +#define SS (sizeof(size_t)) +#define ALIGN (sizeof(size_t)-1) +#define ONES ((size_t)-1/UCHAR_MAX) +#define HIGHS (ONES * (UCHAR_MAX/2+1)) +#define HASZERO(x) (((x)-ONES) & ~(x) & HIGHS) - do { - if (*p++ == (unsigned char)c) - return ((void *)(p - 1)); - } while (--n != 0); +void *memchr(const void *src, int c, size_t n) +{ + const unsigned char *s = src; + c = (unsigned char)c; +#ifdef __GNUC__ + for (; ((uintptr_t)s & ALIGN) && n && *s != c; s++, n--); + if (n && *s != c) { + typedef size_t __attribute__((__may_alias__)) word; + const word *w; + size_t k = ONES * c; + for (w = (const void *)s; n>=SS && !HASZERO(*w^k); w++, n-=SS); + s = (const void *)w; } - return (NULL); +#endif + for (; n && *s != c; s++, n--); + return n ? (void *)s : 0; } From owner-svn-src-all@freebsd.org Wed Nov 25 19:08:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 960B3472025; Wed, 25 Nov 2020 19:08:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ch9Qb3rvsz3t6t; Wed, 25 Nov 2020 19:08:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72D9915FD5; Wed, 25 Nov 2020 19:08:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APJ8NNj073838; Wed, 25 Nov 2020 19:08:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APJ8NU4073837; Wed, 25 Nov 2020 19:08:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202011251908.0APJ8NU4073837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 25 Nov 2020 19:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368028 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 368028 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 19:08:23 -0000 Author: ian Date: Wed Nov 25 19:08:22 2020 New Revision: 368028 URL: https://svnweb.freebsd.org/changeset/base/368028 Log: Add the standard extres pseudo devices to the IMX6 kernel config. Some imx6 drivers are being converted to use features that weren't available when they were first written (such as accessing shared device registers via the syscon pseudo-device), so imx6 custom kernels that reference those devices will now need this infrastructure in place. Modified: head/sys/arm/conf/IMX6 Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Wed Nov 25 18:36:38 2020 (r368027) +++ head/sys/arm/conf/IMX6 Wed Nov 25 19:08:22 2020 (r368028) @@ -117,6 +117,15 @@ options FDT # Configure using FDT/DTB data makeoptions MODULES_EXTRA="dtb/imx6 imx" device fdt_pinctrl # FDT pinmux driver +# EXT_RESOURCES pseudo devices +options EXT_RESOURCES +device clk +device phy +device hwreset +device nvmem +device regulator +device syscon + # SoC-specific devices device ffec # Freescale Fast Ethernet Controller device fsliic # Freescale i2c/iic From owner-svn-src-all@freebsd.org Wed Nov 25 19:10:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31DC44721D4; Wed, 25 Nov 2020 19:10:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ch9Ss0vBkz3tGc; Wed, 25 Nov 2020 19:10:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D6D115BFF; Wed, 25 Nov 2020 19:10:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APJAKT5074082; Wed, 25 Nov 2020 19:10:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APJAKTO074080; Wed, 25 Nov 2020 19:10:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202011251910.0APJAKTO074080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 25 Nov 2020 19:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368029 - in head/sys: arm/freescale/imx modules/imx/imx6_snvs X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/freescale/imx modules/imx/imx6_snvs X-SVN-Commit-Revision: 368029 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 19:10:21 -0000 Author: ian Date: Wed Nov 25 19:10:20 2020 New Revision: 368029 URL: https://svnweb.freebsd.org/changeset/base/368029 Log: Convert the imx6_snvs RTC driver to access registers via the syscon device. This is required for it to work correctly in the GENERIC kernel. Modified: head/sys/arm/freescale/imx/imx6_snvs.c head/sys/modules/imx/imx6_snvs/Makefile Modified: head/sys/arm/freescale/imx/imx6_snvs.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_snvs.c Wed Nov 25 19:08:22 2020 (r368028) +++ head/sys/arm/freescale/imx/imx6_snvs.c Wed Nov 25 19:10:20 2020 (r368029) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include "clock_if.h" +#include "syscon_if.h" #define SNVS_LPCR 0x38 /* Control register */ #define LPCR_LPCALB_VAL_SHIFT 10 /* Calibration shift */ @@ -68,13 +69,12 @@ __FBSDID("$FreeBSD$"); struct snvs_softc { device_t dev; - struct resource * memres; + struct syscon *syscon; uint32_t lpcr; }; static struct ofw_compat_data compat_data[] = { {"fsl,sec-v4.0-mon-rtc-lp", true}, - {"fsl,sec-v4.0-mon", true}, {NULL, false} }; @@ -82,14 +82,14 @@ static inline uint32_t RD4(struct snvs_softc *sc, bus_size_t offset) { - return (bus_read_4(sc->memres, offset)); + return (SYSCON_READ_4(sc->syscon, offset)); } static inline void WR4(struct snvs_softc *sc, bus_size_t offset, uint32_t value) { - bus_write_4(sc->memres, offset, value); + SYSCON_WRITE_4(sc->syscon, offset, value); } static void @@ -187,16 +187,12 @@ static int snvs_attach(device_t dev) { struct snvs_softc *sc; - int rid; sc = device_get_softc(dev); sc->dev = dev; - rid = 0; - sc->memres = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, &rid, - RF_ACTIVE); - if (sc->memres == NULL) { - device_printf(sc->dev, "could not allocate registers\n"); + if (syscon_get_handle_default(sc->dev, &sc->syscon) != 0) { + device_printf(sc->dev, "Cannot get syscon handle\n"); return (ENXIO); } @@ -212,7 +208,6 @@ snvs_detach(device_t dev) sc = device_get_softc(dev); clock_unregister(sc->dev); - bus_release_resource(sc->dev, SYS_RES_MEMORY, 0, sc->memres); return (0); } Modified: head/sys/modules/imx/imx6_snvs/Makefile ============================================================================== --- head/sys/modules/imx/imx6_snvs/Makefile Wed Nov 25 19:08:22 2020 (r368028) +++ head/sys/modules/imx/imx6_snvs/Makefile Wed Nov 25 19:10:20 2020 (r368029) @@ -11,5 +11,6 @@ SRCS+= \ clock_if.h \ device_if.h \ ofw_bus_if.h \ + syscon_if.h \ .include From owner-svn-src-all@freebsd.org Wed Nov 25 20:05:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDE134730D9; Wed, 25 Nov 2020 20:05:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChBh24t8Tz4R0T; Wed, 25 Nov 2020 20:05:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B69C16C7C; Wed, 25 Nov 2020 20:05:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APK56Fj012624; Wed, 25 Nov 2020 20:05:06 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APK56qO012623; Wed, 25 Nov 2020 20:05:06 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202011252005.0APK56qO012623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 25 Nov 2020 20:05:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368030 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 368030 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 20:05:06 -0000 Author: ian Date: Wed Nov 25 20:05:05 2020 New Revision: 368030 URL: https://svnweb.freebsd.org/changeset/base/368030 Log: Extend the imx6 gpc->gic interrupt controller fixup of fdt data at runtime to work with the pmu and tempmon nodes as well as the soc node. This allows interrupts to work on the pmu and tempmon devices even though we don't have a driver for the low-power gpc interrupt controller (which is not a problem because we also don't have support for entering deep power-down modes where it gets used). Modified: head/sys/arm/freescale/imx/imx6_machdep.c Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Wed Nov 25 19:10:20 2020 (r368029) +++ head/sys/arm/freescale/imx/imx6_machdep.c Wed Nov 25 20:05:05 2020 (r368030) @@ -78,6 +78,10 @@ static platform_cpu_reset_t imx6_cpu_reset; * node to refer to GIC instead of GPC. This will get us by until we write our * own GPC driver (or until linux changes its mind and the FDT data again). * + * 2020/11/25: The tempmon and pmu nodes are siblings (not children) of the soc + * node, so for them to use interrupts we need to apply the same fix as we do + * for the soc node. + * * We validate that we have data that looks like we expect before changing it: * - SOC node exists and has GPC as its interrupt parent. * - GPC node exists and has GIC as its interrupt parent. @@ -95,22 +99,30 @@ static platform_cpu_reset_t imx6_cpu_reset; * nodes by string matching we now have to search for both flavors of each node * name involved. */ + static void +fix_node_iparent(const char* nodepath, phandle_t gpcxref, phandle_t gicxref) +{ + static const char *propname = "interrupt-parent"; + phandle_t node, iparent; + + if ((node = OF_finddevice(nodepath)) == -1) + return; + if (OF_getencprop(node, propname, &iparent, sizeof(iparent)) <= 0) + return; + if (iparent != gpcxref) + return; + + OF_setprop(node, propname, &gicxref, sizeof(gicxref)); +} + +static void fix_fdt_interrupt_data(void) { phandle_t gicipar, gicnode, gicxref; phandle_t gpcipar, gpcnode, gpcxref; - phandle_t socipar, socnode; int result; - socnode = OF_finddevice("/soc"); - if (socnode == -1) - return; - result = OF_getencprop(socnode, "interrupt-parent", &socipar, - sizeof(socipar)); - if (result <= 0) - return; - /* GIC node may be child of soc node, or appear directly at root. */ gicnode = OF_finddevice("/soc/interrupt-controller@00a01000"); if (gicnode == -1) @@ -143,11 +155,13 @@ fix_fdt_interrupt_data(void) return; gpcxref = OF_xref_from_node(gpcnode); - if (socipar != gpcxref || gpcipar != gicxref || gicipar != gicxref) + if (gpcipar != gicxref || gicipar != gicxref) return; gicxref = cpu_to_fdt32(gicxref); - OF_setprop(socnode, "interrupt-parent", &gicxref, sizeof(gicxref)); + fix_node_iparent("/soc", gpcxref, gicxref); + fix_node_iparent("/pmu", gpcxref, gicxref); + fix_node_iparent("/tempmon", gpcxref, gicxref); } static void From owner-svn-src-all@freebsd.org Wed Nov 25 20:58:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0593947427F; Wed, 25 Nov 2020 20:58:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChCs56MPcz4T8n; Wed, 25 Nov 2020 20:58:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD4D2178BB; Wed, 25 Nov 2020 20:58:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APKw1DK043268; Wed, 25 Nov 2020 20:58:01 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APKw1FL043266; Wed, 25 Nov 2020 20:58:01 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202011252058.0APKw1FL043266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 25 Nov 2020 20:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368031 - in head: libexec/rc sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head: libexec/rc sys/netinet6 X-SVN-Commit-Revision: 368031 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 20:58:02 -0000 Author: bz Date: Wed Nov 25 20:58:01 2020 New Revision: 368031 URL: https://svnweb.freebsd.org/changeset/base/368031 Log: IPv6: set ifdisabled in the kernel rather than in rc Enable ND6_IFF_IFDISABLED when the interface is created in the kernel before return to user space. This avoids a race when an interface is create by a program which also calls ifconfig IF inet6 -ifdisabled and races with the devd -> /etc/pccard_ether -> .. netif start IF -> ifdisabled calls (the devd/rc framework disabling IPv6 again after the program had enabled it already). In case the global net.inet6.ip6.accept_rtadv was turned on, we also default to enabling IPv6 on the interfaces, rather than disabling them. PR: 248172 Reported by: Gert Doering (gert greenie.muc.de) Reviewed by: glebius (, phk) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27324 Modified: head/libexec/rc/network.subr head/sys/netinet6/nd6.c Modified: head/libexec/rc/network.subr ============================================================================== --- head/libexec/rc/network.subr Wed Nov 25 20:05:05 2020 (r368030) +++ head/libexec/rc/network.subr Wed Nov 25 20:58:01 2020 (r368031) @@ -134,8 +134,6 @@ ifconfig_up() if ! noafif $1 && afexists inet6; then if checkyesno ipv6_activate_all_interfaces; then _ipv6_opts="-ifdisabled" - elif [ "$1" != "lo0" ]; then - _ipv6_opts="ifdisabled" fi # backward compatibility: $ipv6_enable Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Wed Nov 25 20:05:05 2020 (r368030) +++ head/sys/netinet6/nd6.c Wed Nov 25 20:58:01 2020 (r368031) @@ -273,6 +273,10 @@ nd6_ifattach(struct ifnet *ifp) nd->flags = ND6_IFF_PERFORMNUD; + /* Set IPv6 disabled on all interfaces but loopback by default. */ + if ((ifp->if_flags & IFF_LOOPBACK) == 0) + nd->flags |= ND6_IFF_IFDISABLED; + /* A loopback interface always has ND6_IFF_AUTO_LINKLOCAL. * XXXHRS: Clear ND6_IFF_AUTO_LINKLOCAL on an IFT_BRIDGE interface by * default regardless of the V_ip6_auto_linklocal configuration to @@ -290,8 +294,11 @@ nd6_ifattach(struct ifnet *ifp) */ if (V_ip6_accept_rtadv && !(ifp->if_flags & IFF_LOOPBACK) && - (ifp->if_type != IFT_BRIDGE)) + (ifp->if_type != IFT_BRIDGE)) { nd->flags |= ND6_IFF_ACCEPT_RTADV; + /* If we globally accept rtadv, assume IPv6 on. */ + nd->flags &= ~ND6_IFF_IFDISABLED; + } if (V_ip6_no_radr && !(ifp->if_flags & IFF_LOOPBACK)) nd->flags |= ND6_IFF_NO_RADR; From owner-svn-src-all@freebsd.org Wed Nov 25 21:20:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76BBA474C04; Wed, 25 Nov 2020 21:20:56 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChDMX2xdKz4VPt; Wed, 25 Nov 2020 21:20:56 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57D4E17E25; Wed, 25 Nov 2020 21:20:56 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APLKunu056863; Wed, 25 Nov 2020 21:20:56 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APLKtbO056861; Wed, 25 Nov 2020 21:20:55 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202011252120.0APLKtbO056861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 25 Nov 2020 21:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368032 - stable/12/tools/tools/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/tools/tools/netmap X-SVN-Commit-Revision: 368032 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 21:20:56 -0000 Author: vmaffione Date: Wed Nov 25 21:20:55 2020 New Revision: 368032 URL: https://svnweb.freebsd.org/changeset/base/368032 Log: MFC r367931 netmap: bridge: switch to libnetmap Use the newer libnetmap (included in base) rather than the older nm_open()/nm_close() defined in netmap_user.h Modified: stable/12/tools/tools/netmap/Makefile stable/12/tools/tools/netmap/bridge.c Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/tools/netmap/Makefile ============================================================================== --- stable/12/tools/tools/netmap/Makefile Wed Nov 25 20:58:01 2020 (r368031) +++ stable/12/tools/tools/netmap/Makefile Wed Nov 25 21:20:55 2020 (r368032) @@ -11,7 +11,7 @@ MAN= .include .include -LDFLAGS += -lpthread +LDFLAGS += -lpthread -lnetmap .ifdef WITHOUT_PCAP CFLAGS += -DNO_PCAP .else @@ -27,7 +27,7 @@ pkt-gen: pkt-gen.o $(CC) $(CFLAGS) -o pkt-gen pkt-gen.o $(LDFLAGS) bridge: bridge.o - $(CC) $(CFLAGS) -o bridge bridge.o + $(CC) $(CFLAGS) -o bridge bridge.o $(LDFLAGS) nmreplay: nmreplay.o $(CC) $(CFLAGS) -o nmreplay nmreplay.o $(LDFLAGS) Modified: stable/12/tools/tools/netmap/bridge.c ============================================================================== --- stable/12/tools/tools/netmap/bridge.c Wed Nov 25 20:58:01 2020 (r368031) +++ stable/12/tools/tools/netmap/bridge.c Wed Nov 25 21:20:55 2020 (r368032) @@ -10,9 +10,12 @@ */ #include -#define NETMAP_WITH_LIBS -#include #include +#include +#include +#include +#include +#include static int verbose = 0; @@ -32,7 +35,7 @@ sigint_h(int sig) * how many packets on this set of queues ? */ static int -pkt_queued(struct nm_desc *d, int tx) +pkt_queued(struct nmport_d *d, int tx) { u_int i, tot = 0; @@ -61,8 +64,8 @@ process_rings(struct netmap_ring *rxring, struct netma if (rxring->flags || txring->flags) D("%s rxflags %x txflags %x", msg, rxring->flags, txring->flags); - j = rxring->cur; /* RX */ - k = txring->cur; /* TX */ + j = rxring->head; /* RX */ + k = txring->head; /* TX */ m = nm_ring_space(rxring); if (m < limit) limit = m; @@ -115,11 +118,11 @@ process_rings(struct netmap_ring *rxring, struct netma /* move packts from src to destination */ static int -move(struct nm_desc *src, struct nm_desc *dst, u_int limit) +move(struct nmport_d *src, struct nmport_d *dst, u_int limit) { struct netmap_ring *txring, *rxring; u_int m = 0, si = src->first_rx_ring, di = dst->first_tx_ring; - const char *msg = (src->req.nr_flags == NR_REG_SW) ? + const char *msg = (src->reg.nr_flags == NR_REG_SW) ? "host->net" : "net->host"; while (si <= src->last_rx_ring && di <= dst->last_tx_ring) { @@ -175,7 +178,7 @@ main(int argc, char **argv) struct pollfd pollfd[2]; int ch; u_int burst = 1024, wait_link = 4; - struct nm_desc *pa = NULL, *pb = NULL; + struct nmport_d *pa = NULL, *pb = NULL; char *ifa = NULL, *ifb = NULL; char ifabuf[64] = { 0 }; int loopback = 0; @@ -252,16 +255,16 @@ main(int argc, char **argv) } else { /* two different interfaces. Take all rings on if1 */ } - pa = nm_open(ifa, NULL, 0, NULL); + pa = nmport_open(ifa); if (pa == NULL) { D("cannot open %s", ifa); return (1); } /* try to reuse the mmap() of the first interface, if possible */ - pb = nm_open(ifb, NULL, NM_OPEN_NO_MMAP, pa); + pb = nmport_open(ifb); if (pb == NULL) { D("cannot open %s", ifb); - nm_close(pa); + nmport_close(pa); return (1); } zerocopy = zerocopy && (pa->mem == pb->mem); @@ -275,8 +278,8 @@ main(int argc, char **argv) D("Wait %d secs for link to come up...", wait_link); sleep(wait_link); D("Ready to go, %s 0x%x/%d <-> %s 0x%x/%d.", - pa->req.nr_name, pa->first_rx_ring, pa->req.nr_rx_rings, - pb->req.nr_name, pb->first_rx_ring, pb->req.nr_rx_rings); + pa->hdr.nr_name, pa->first_rx_ring, pa->reg.nr_rx_rings, + pb->hdr.nr_name, pb->first_rx_ring, pb->reg.nr_rx_rings); /* main loop */ signal(SIGINT, sigint_h); @@ -320,12 +323,12 @@ main(int argc, char **argv) pollfd[0].events, pollfd[0].revents, pkt_queued(pa, 0), - NETMAP_RXRING(pa->nifp, pa->cur_rx_ring)->cur, + NETMAP_RXRING(pa->nifp, pa->cur_rx_ring)->head, pkt_queued(pa, 1), pollfd[1].events, pollfd[1].revents, pkt_queued(pb, 0), - NETMAP_RXRING(pb->nifp, pb->cur_rx_ring)->cur, + NETMAP_RXRING(pb->nifp, pb->cur_rx_ring)->head, pkt_queued(pb, 1) ); if (ret < 0) @@ -349,8 +352,8 @@ main(int argc, char **argv) /* We don't need ioctl(NIOCTXSYNC) on the two file descriptors here, * kernel will txsync on next poll(). */ } - nm_close(pb); - nm_close(pa); + nmport_close(pb); + nmport_close(pa); return (0); } From owner-svn-src-all@freebsd.org Wed Nov 25 21:22:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04488474B3B; Wed, 25 Nov 2020 21:22:17 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChDP46lXxz4VdP; Wed, 25 Nov 2020 21:22:16 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA26217EC1; Wed, 25 Nov 2020 21:22:16 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APLMGRk061621; Wed, 25 Nov 2020 21:22:16 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APLMGZ0061620; Wed, 25 Nov 2020 21:22:16 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202011252122.0APLMGZ0061620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 25 Nov 2020 21:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368033 - stable/12/tools/tools/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/tools/tools/netmap X-SVN-Commit-Revision: 368033 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 21:22:17 -0000 Author: vmaffione Date: Wed Nov 25 21:22:16 2020 New Revision: 368033 URL: https://svnweb.freebsd.org/changeset/base/368033 Log: MFC r367932 netmap: pkt-gen: switch to libnetmap Use the newer libnetmap (included in base) rather than the older nm_open()/nm_close() defined in netmap_user.h Modified: stable/12/tools/tools/netmap/pkt-gen.c Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/tools/netmap/pkt-gen.c ============================================================================== --- stable/12/tools/tools/netmap/pkt-gen.c Wed Nov 25 21:20:55 2020 (r368032) +++ stable/12/tools/tools/netmap/pkt-gen.c Wed Nov 25 21:22:16 2020 (r368033) @@ -38,36 +38,40 @@ */ #define _GNU_SOURCE /* for CPU_SET() */ -#include -#define NETMAP_WITH_LIBS -#include - -#include // isprint() -#include // sysconf() -#include #include /* ntohs */ -#ifndef _WIN32 -#include /* sysctl */ -#endif +#include +#include // isprint() +#include +#include #include /* getifaddrs */ +#include +#include #include #include #include -#include #include +#include +#ifndef NO_PCAP +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#if !defined(_WIN32) && !defined(linux) +#include /* sysctl */ +#endif +#include +#include // sysconf() #ifdef linux #define IPV6_VERSION 0x60 #define IPV6_DEFHLIM 64 #endif -#include -#include -#include - -#ifndef NO_PCAP -#include -#endif - #include "ctrs.h" static void usage(int); @@ -236,7 +240,8 @@ struct mac_range { }; /* ifname can be netmap:foo-xxxx */ -#define MAX_IFNAMELEN 64 /* our buffer for ifname */ +#define MAX_IFNAMELEN 512 /* our buffer for ifname */ +//#define MAX_PKTSIZE 1536 #define MAX_PKTSIZE MAX_BODYSIZE /* XXX: + IP_HDR + ETH_HDR */ /* compact timestamp to fit into 60 byte packet. (enough to obtain RTT) */ @@ -288,7 +293,8 @@ struct glob_arg { int affinity; int main_fd; - struct nm_desc *nmd; + struct nmport_d *nmd; + uint32_t orig_mode; int report_interval; /* milliseconds between prints */ void *(*td_body)(void *); int td_type; @@ -322,7 +328,7 @@ struct targ { int completed; int cancel; int fd; - struct nm_desc *nmd; + struct nmport_d *nmd; /* these ought to be volatile, but they are * only sampled and errors should not accumulate */ @@ -515,17 +521,21 @@ extract_mac_range(struct mac_range *r) static int get_if_mtu(const struct glob_arg *g) { - char ifname[IFNAMSIZ]; struct ifreq ifreq; int s, ret; + const char *ifname = g->nmd->hdr.nr_name; + size_t len; - if (!strncmp(g->ifname, "netmap:", 7) && !strchr(g->ifname, '{') - && !strchr(g->ifname, '}')) { - /* Parse the interface name and ask the kernel for the - * MTU value. */ - strncpy(ifname, g->ifname+7, IFNAMSIZ-1); - ifname[strcspn(ifname, "-*^{}/@")] = '\0'; + if (!strncmp(g->ifname, "netmap:", 7) && !strchr(ifname, '{') + && !strchr(ifname, '}')) { + len = strlen(ifname); + + if (len > IFNAMSIZ) { + D("'%s' too long, cannot ask for MTU", ifname); + return -1; + } + s = socket(AF_INET, SOCK_DGRAM, 0); if (s < 0) { D("socket() failed: %s", strerror(errno)); @@ -533,13 +543,15 @@ get_if_mtu(const struct glob_arg *g) } memset(&ifreq, 0, sizeof(ifreq)); - strncpy(ifreq.ifr_name, ifname, IFNAMSIZ); + memcpy(ifreq.ifr_name, ifname, len); ret = ioctl(s, SIOCGIFMTU, &ifreq); if (ret) { D("ioctl(SIOCGIFMTU) failed: %s", strerror(errno)); } + close(s); + return ifreq.ifr_mtu; } @@ -620,7 +632,7 @@ system_ncpus(void) * and #rx-rings. */ static int -parse_nmr_config(const char* conf, struct nmreq *nmr) +parse_nmr_config(const char* conf, struct nmreq_register *nmr) { char *w, *tok; int i, v; @@ -654,9 +666,7 @@ parse_nmr_config(const char* conf, struct nmreq *nmr) nmr->nr_tx_rings, nmr->nr_tx_slots, nmr->nr_rx_rings, nmr->nr_rx_slots); free(w); - return (nmr->nr_tx_rings || nmr->nr_tx_slots || - nmr->nr_rx_rings || nmr->nr_rx_slots) ? - NM_OPEN_RING_CFG : 0; + return 0; } @@ -1108,20 +1118,22 @@ initialize_packet(struct targ *targ) static void get_vnet_hdr_len(struct glob_arg *g) { - struct nmreq req; + struct nmreq_header hdr; + struct nmreq_port_hdr ph; int err; - memset(&req, 0, sizeof(req)); - bcopy(g->nmd->req.nr_name, req.nr_name, sizeof(req.nr_name)); - req.nr_version = NETMAP_API; - req.nr_cmd = NETMAP_VNET_HDR_GET; - err = ioctl(g->main_fd, NIOCREGIF, &req); + hdr = g->nmd->hdr; /* copy name and version */ + hdr.nr_reqtype = NETMAP_REQ_PORT_HDR_GET; + hdr.nr_options = 0; + memset(&ph, 0, sizeof(ph)); + hdr.nr_body = (uintptr_t)&ph; + err = ioctl(g->main_fd, NIOCCTRL, &hdr); if (err) { D("Unable to get virtio-net header length"); return; } - g->virt_header = req.nr_arg1; + g->virt_header = ph.nr_hdr_len; if (g->virt_header) { D("Port requires virtio-net header, length = %d", g->virt_header); @@ -1132,17 +1144,18 @@ static void set_vnet_hdr_len(struct glob_arg *g) { int err, l = g->virt_header; - struct nmreq req; + struct nmreq_header hdr; + struct nmreq_port_hdr ph; if (l == 0) return; - memset(&req, 0, sizeof(req)); - bcopy(g->nmd->req.nr_name, req.nr_name, sizeof(req.nr_name)); - req.nr_version = NETMAP_API; - req.nr_cmd = NETMAP_BDG_VNET_HDR; - req.nr_arg1 = l; - err = ioctl(g->main_fd, NIOCREGIF, &req); + hdr = g->nmd->hdr; /* copy name and version */ + hdr.nr_reqtype = NETMAP_REQ_PORT_HDR_SET; + hdr.nr_options = 0; + memset(&ph, 0, sizeof(ph)); + hdr.nr_body = (uintptr_t)&ph; + err = ioctl(g->main_fd, NIOCCTRL, &hdr); if (err) { D("Unable to set virtio-net header length %d", l); } @@ -2480,7 +2493,7 @@ usage(int errcode) exit(errcode); } -static void +static int start_threads(struct glob_arg *g) { int i; @@ -2500,31 +2513,43 @@ start_threads(struct glob_arg *g) { memcpy(t->seed, &seed, sizeof(t->seed)); if (g->dev_type == DEV_NETMAP) { - struct nm_desc nmd = *g->nmd; /* copy, we overwrite ringid */ - uint64_t nmd_flags = 0; - nmd.self = &nmd; + int m = -1; + /* + * if the user wants both HW and SW rings, we need to + * know when to switch from NR_REG_ONE_NIC to NR_REG_ONE_SW + */ + if (g->orig_mode == NR_REG_NIC_SW) { + m = (g->td_type == TD_TYPE_RECEIVER ? + g->nmd->reg.nr_rx_rings : + g->nmd->reg.nr_tx_rings); + } + if (i > 0) { + int j; /* the first thread uses the fd opened by the main * thread, the other threads re-open /dev/netmap */ - if (g->nthreads > 1) { - nmd.req.nr_flags = - g->nmd->req.nr_flags & ~NR_REG_MASK; - nmd.req.nr_flags |= NR_REG_ONE_NIC; - nmd.req.nr_ringid = i; + t->nmd = nmport_clone(g->nmd); + if (t->nmd == NULL) + return -1; + + j = i; + if (m > 0 && j >= m) { + /* switch to the software rings */ + t->nmd->reg.nr_mode = NR_REG_ONE_SW; + j -= m; } + t->nmd->reg.nr_ringid = j & NETMAP_RING_MASK; /* Only touch one of the rings (rx is already ok) */ if (g->td_type == TD_TYPE_RECEIVER) - nmd_flags |= NETMAP_NO_TX_POLL; + t->nmd->reg.nr_flags |= NETMAP_NO_TX_POLL; /* register interface. Override ifname and ringid etc. */ - t->nmd = nm_open(t->g->ifname, NULL, nmd_flags | - NM_OPEN_IFNAME | NM_OPEN_NO_MMAP, &nmd); - if (t->nmd == NULL) { - D("Unable to open %s: %s", - t->g->ifname, strerror(errno)); - continue; + if (nmport_open_desc(t->nmd) < 0) { + nmport_undo_prepare(t->nmd); + t->nmd = NULL; + return -1; } } else { t->nmd = g->nmd; @@ -2556,6 +2581,7 @@ start_threads(struct glob_arg *g) { t->used = 0; } } + return 0; } static void @@ -2655,7 +2681,7 @@ main_thread(struct glob_arg *g) if (targs[i].used) pthread_join(targs[i].thread, NULL); /* blocking */ if (g->dev_type == DEV_NETMAP) { - nm_close(targs[i].nmd); + nmport_close(targs[i].nmd); targs[i].nmd = NULL; } else { close(targs[i].fd); @@ -3078,21 +3104,14 @@ main(int arc, char **argv) } else if (g.dummy_send) { /* but DEV_NETMAP */ D("using a dummy send routine"); } else { - struct nm_desc base_nmd; - char errmsg[MAXERRMSG]; - u_int flags; + g.nmd = nmport_prepare(g.ifname); + if (g.nmd == NULL) + goto out; - bzero(&base_nmd, sizeof(base_nmd)); + parse_nmr_config(g.nmr_config, &g.nmd->reg); - parse_nmr_config(g.nmr_config, &base_nmd.req); + g.nmd->reg.nr_flags |= NR_ACCEPT_VNET_HDR; - base_nmd.req.nr_flags |= NR_ACCEPT_VNET_HDR; - - if (nm_parse(g.ifname, &base_nmd, errmsg) < 0) { - D("Invalid name '%s': %s", g.ifname, errmsg); - goto out; - } - /* * Open the netmap device using nm_open(). * @@ -3100,20 +3119,25 @@ main(int arc, char **argv) * which in turn may take some time for the PHY to * reconfigure. We do the open here to have time to reset. */ - flags = NM_OPEN_IFNAME | NM_OPEN_ARG1 | NM_OPEN_ARG2 | - NM_OPEN_ARG3 | NM_OPEN_RING_CFG; + g.orig_mode = g.nmd->reg.nr_mode; if (g.nthreads > 1) { - base_nmd.req.nr_flags &= ~NR_REG_MASK; - base_nmd.req.nr_flags |= NR_REG_ONE_NIC; - base_nmd.req.nr_ringid = 0; + switch (g.orig_mode) { + case NR_REG_ALL_NIC: + case NR_REG_NIC_SW: + g.nmd->reg.nr_mode = NR_REG_ONE_NIC; + break; + case NR_REG_SW: + g.nmd->reg.nr_mode = NR_REG_ONE_SW; + break; + default: + break; + } + g.nmd->reg.nr_ringid = 0; } - g.nmd = nm_open(g.ifname, NULL, flags, &base_nmd); - if (g.nmd == NULL) { - D("Unable to open %s: %s", g.ifname, strerror(errno)); + if (nmport_open_desc(g.nmd) < 0) goto out; - } g.main_fd = g.nmd->fd; - D("mapped %luKB at %p", (unsigned long)(g.nmd->req.nr_memsize>>10), + ND("mapped %luKB at %p", (unsigned long)(g.nmd->req.nr_memsize>>10), g.nmd->mem); if (g.virt_header) { @@ -3128,9 +3152,9 @@ main(int arc, char **argv) /* get num of queues in tx or rx */ if (g.td_type == TD_TYPE_SENDER) - devqueues = g.nmd->req.nr_tx_rings; + devqueues = g.nmd->reg.nr_tx_rings + g.nmd->reg.nr_host_tx_rings; else - devqueues = g.nmd->req.nr_rx_rings; + devqueues = g.nmd->reg.nr_rx_rings + g.nmd->reg.nr_host_rx_rings; /* validate provided nthreads. */ if (g.nthreads < 1 || g.nthreads > devqueues) { @@ -3150,17 +3174,17 @@ main(int arc, char **argv) if (verbose) { struct netmap_if *nifp = g.nmd->nifp; - struct nmreq *req = &g.nmd->req; + struct nmreq_register *req = &g.nmd->reg; - D("nifp at offset %d, %d tx %d rx region %d", + D("nifp at offset %"PRIu64", %d tx %d rx region %d", req->nr_offset, req->nr_tx_rings, req->nr_rx_rings, - req->nr_arg2); - for (i = 0; i <= req->nr_tx_rings; i++) { + req->nr_mem_id); + for (i = 0; i < req->nr_tx_rings + req->nr_host_tx_rings; i++) { struct netmap_ring *ring = NETMAP_TXRING(nifp, i); D(" TX%d at 0x%p slots %d", i, (void *)((char *)ring - (char *)nifp), ring->num_slots); } - for (i = 0; i <= req->nr_rx_rings; i++) { + for (i = 0; i < req->nr_rx_rings + req->nr_host_rx_rings; i++) { struct netmap_ring *ring = NETMAP_RXRING(nifp, i); D(" RX%d at 0x%p slots %d", i, (void *)((char *)ring - (char *)nifp), ring->num_slots); @@ -3230,7 +3254,8 @@ out: if (pthread_sigmask(SIG_BLOCK, &ss, NULL) < 0) { D("failed to block SIGINT: %s", strerror(errno)); } - start_threads(&g); + if (start_threads(&g) < 0) + return 1; /* Install the handler and re-enable SIGINT for the main thread */ memset(&sa, 0, sizeof(sa)); sa.sa_handler = sigint_h; From owner-svn-src-all@freebsd.org Wed Nov 25 21:23:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A161474B9D; Wed, 25 Nov 2020 21:23:14 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChDQB1fTcz4W5S; Wed, 25 Nov 2020 21:23:14 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20B3117F2C; Wed, 25 Nov 2020 21:23:14 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APLNDRn061734; Wed, 25 Nov 2020 21:23:13 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APLNDnm061732; Wed, 25 Nov 2020 21:23:13 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202011252123.0APLNDnm061732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 25 Nov 2020 21:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368034 - stable/12/tools/tools/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/tools/tools/netmap X-SVN-Commit-Revision: 368034 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 21:23:14 -0000 Author: vmaffione Date: Wed Nov 25 21:23:13 2020 New Revision: 368034 URL: https://svnweb.freebsd.org/changeset/base/368034 Log: MFC r367933 netmap: lb: switch to libnetmap Use the newer libnetmap (included in base) rather than the older nm_open()/nm_close() defined in netmap_user.h Modified: stable/12/tools/tools/netmap/lb.c stable/12/tools/tools/netmap/pkt_hash.c Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/tools/netmap/lb.c ============================================================================== --- stable/12/tools/tools/netmap/lb.c Wed Nov 25 21:22:16 2020 (r368033) +++ stable/12/tools/tools/netmap/lb.c Wed Nov 25 21:23:13 2020 (r368034) @@ -23,21 +23,22 @@ * SUCH DAMAGE. */ /* $FreeBSD$ */ -#include -#include #include -#include +#include #include +#include +#include /* htonl */ +#include +#include +#include +#include +#include +#include #include - -#define NETMAP_WITH_LIBS -#include +#include #include +#include -#include /* htonl */ - -#include - #include "pkt_hash.h" #include "ctrs.h" @@ -86,12 +87,12 @@ struct compact_ipv6_hdr { #define DEF_BATCH 2048 #define DEF_WAIT_LINK 2 #define DEF_STATS_INT 600 -#define BUF_REVOKE 100 +#define BUF_REVOKE 150 #define STAT_MSG_MAXSIZE 1024 static struct { - char ifname[MAX_IFNAMELEN]; - char base_name[MAX_IFNAMELEN]; + char ifname[MAX_IFNAMELEN + 1]; + char base_name[MAX_IFNAMELEN + 1]; int netmap_fd; uint16_t output_rings; uint16_t num_groups; @@ -173,7 +174,7 @@ struct port_des { unsigned int last_sync; uint32_t last_tail; struct overflow_queue *oq; - struct nm_desc *nmd; + struct nmport_d *nmd; struct netmap_ring *ring; struct group_des *group; }; @@ -375,7 +376,7 @@ free_buffers(void) D("added %d buffers to netmap free list", tot); for (i = 0; i < glob_arg.output_rings + 1; ++i) { - nm_close(ports[i].nmd); + nmport_close(ports[i].nmd); } } @@ -480,6 +481,28 @@ init_groups(void) g->last = 1; } + +/* To support packets that span multiple slots (NS_MOREFRAG) we + * need to make sure of the following: + * + * - all fragments of the same packet must go to the same output pipe + * - when dropping, all fragments of the same packet must be dropped + * + * For the former point we remember and reuse the last hash computed + * in each input ring, and only update it when NS_MOREFRAG was not + * set in the last received slot (this marks the start of a new packet). + * + * For the latter point, we only update the output ring head pointer + * when an entire packet has been forwarded. We keep a shadow_head + * pointer to know where to put the next partial fragment and, + * when the need to drop arises, we roll it back to head. + */ +struct morefrag { + uint16_t last_flag; /* for intput rings */ + uint32_t last_hash; /* for input rings */ + uint32_t shadow_head; /* for output rings */ +}; + /* push the packet described by slot rs to the group g. * This may cause other buffers to be pushed down the * chain headed by g. @@ -493,21 +516,28 @@ forward_packet(struct group_des *g, struct netmap_slot struct port_des *port = &g->ports[output_port]; struct netmap_ring *ring = port->ring; struct overflow_queue *q = port->oq; + struct morefrag *mf = (struct morefrag *)ring->sem; + uint16_t curmf = rs->flags & NS_MOREFRAG; /* Move the packet to the output pipe, unless there is * either no space left on the ring, or there is some * packet still in the overflow queue (since those must * take precedence over the new one) */ - if (ring->head != ring->tail && (q == NULL || oq_empty(q))) { - struct netmap_slot *ts = &ring->slot[ring->head]; + if (mf->shadow_head != ring->tail && (q == NULL || oq_empty(q))) { + struct netmap_slot *ts = &ring->slot[mf->shadow_head]; struct netmap_slot old_slot = *ts; ts->buf_idx = rs->buf_idx; ts->len = rs->len; - ts->flags |= NS_BUF_CHANGED; + ts->flags = rs->flags | NS_BUF_CHANGED; ts->ptr = rs->ptr; - ring->head = nm_ring_next(ring, ring->head); + mf->shadow_head = nm_ring_next(ring, mf->shadow_head); + if (!curmf) { + ring->head = mf->shadow_head; + } + ND("curmf %2x ts->flags %2x shadow_head %3u head %3u tail %3u", + curmf, ts->flags, mf->shadow_head, ring->head, ring->tail); port->ctr.bytes += rs->len; port->ctr.pkts++; forwarded++; @@ -516,9 +546,20 @@ forward_packet(struct group_des *g, struct netmap_slot /* use the overflow queue, if available */ if (q == NULL || oq_full(q)) { + uint32_t scan; /* no space left on the ring and no overflow queue * available: we are forced to drop the packet */ + + /* drop previous fragments, if any */ + for (scan = ring->head; scan != mf->shadow_head; + scan = nm_ring_next(ring, scan)) { + struct netmap_slot *ts = &ring->slot[scan]; + dropped++; + port->ctr.drop_bytes += ts->len; + } + mf->shadow_head = ring->head; + dropped++; port->ctr.drop++; port->ctr.drop_bytes += rs->len; @@ -550,9 +591,12 @@ forward_packet(struct group_des *g, struct netmap_slot /* move the oldest BUF_REVOKE buffers from the * lp queue to the free queue + * + * We cannot revoke a partially received packet. + * To make thinks simple we make sure to leave + * at least NETMAP_MAX_FRAGS slots in the queue. */ - // XXX optimize this cycle - for (j = 0; lp->oq->n && j < BUF_REVOKE; j++) { + for (j = 0; lp->oq->n > NETMAP_MAX_FRAGS && j < BUF_REVOKE; j++) { struct netmap_slot tmp = oq_deq(lp->oq); dropped++; @@ -651,14 +695,6 @@ int main(int argc, char **argv) return 1; } - /* extract the base name */ - char *nscan = strncmp(glob_arg.ifname, "netmap:", 7) ? - glob_arg.ifname : glob_arg.ifname + 7; - strncpy(glob_arg.base_name, nscan, MAX_IFNAMELEN - 1); - for (nscan = glob_arg.base_name; *nscan && !index("-*^{}/@", *nscan); nscan++) - ; - *nscan = '\0'; - if (glob_arg.num_groups == 0) parse_pipes(""); @@ -678,6 +714,15 @@ int main(int argc, char **argv) return 1; } struct port_des *rxport = &ports[npipes]; + + rxport->nmd = nmport_prepare(glob_arg.ifname); + if (rxport->nmd == NULL) { + D("cannot parse %s", glob_arg.ifname); + return (1); + } + /* extract the base name */ + strncpy(glob_arg.base_name, rxport->nmd->hdr.nr_name, MAX_IFNAMELEN); + init_groups(); memset(&counters_buf, 0, sizeof(counters_buf)); @@ -687,24 +732,15 @@ int main(int argc, char **argv) return 1; } - /* we need base_req to specify pipes and extra bufs */ - struct nmreq base_req; - memset(&base_req, 0, sizeof(base_req)); + rxport->nmd->reg.nr_extra_bufs = glob_arg.extra_bufs; - base_req.nr_arg1 = npipes; - base_req.nr_arg3 = glob_arg.extra_bufs; - - rxport->nmd = nm_open(glob_arg.ifname, &base_req, 0, NULL); - - if (rxport->nmd == NULL) { + if (nmport_open_desc(rxport->nmd) < 0) { D("cannot open %s", glob_arg.ifname); return (1); - } else { - D("successfully opened %s (tx rings: %u)", glob_arg.ifname, - rxport->nmd->req.nr_tx_slots); } + D("successfully opened %s", glob_arg.ifname); - uint32_t extra_bufs = rxport->nmd->req.nr_arg3; + uint32_t extra_bufs = rxport->nmd->reg.nr_extra_bufs; struct overflow_queue *oq = NULL; /* reference ring to access the buffers */ rxport->ring = NETMAP_RXRING(rxport->nmd->nifp, 0); @@ -772,25 +808,31 @@ run: snprintf(p->interface, MAX_PORTNAMELEN, "%s%s{%d/xT@%d", (strncmp(g->pipename, "vale", 4) ? "netmap:" : ""), g->pipename, g->first_id + k, - rxport->nmd->req.nr_arg2); + rxport->nmd->reg.nr_mem_id); D("opening pipe named %s", p->interface); - p->nmd = nm_open(p->interface, NULL, 0, rxport->nmd); + p->nmd = nmport_open(p->interface); if (p->nmd == NULL) { D("cannot open %s", p->interface); return (1); - } else if (p->nmd->req.nr_arg2 != rxport->nmd->req.nr_arg2) { + } else if (p->nmd->mem != rxport->nmd->mem) { D("failed to open pipe #%d in zero-copy mode, " "please close any application that uses either pipe %s}%d, " "or %s{%d, and retry", k + 1, g->pipename, g->first_id + k, g->pipename, g->first_id + k); return (1); } else { + struct morefrag *mf; + D("successfully opened pipe #%d %s (tx slots: %d)", - k + 1, p->interface, p->nmd->req.nr_tx_slots); + k + 1, p->interface, p->nmd->reg.nr_tx_slots); p->ring = NETMAP_TXRING(p->nmd->nifp, 0); p->last_tail = nm_ring_next(p->ring, p->ring->tail); + mf = (struct morefrag *)p->ring->sem; + mf->last_flag = 0; /* unused */ + mf->last_hash = 0; /* unused */ + mf->shadow_head = p->ring->head; } D("zerocopy %s", (rxport->nmd->mem == p->nmd->mem) ? "enabled" : "disabled"); @@ -843,6 +885,16 @@ run: if (glob_arg.stdout_interval > 0 && glob_arg.stdout_interval < poll_timeout) poll_timeout = glob_arg.stdout_interval; + /* initialize the morefrag structures for the input rings */ + for (i = rxport->nmd->first_rx_ring; i <= rxport->nmd->last_rx_ring; i++) { + struct netmap_ring *rxring = NETMAP_RXRING(rxport->nmd->nifp, i); + struct morefrag *mf = (struct morefrag *)rxring->sem; + + mf->last_flag = 0; + mf->last_hash = 0; + mf->shadow_head = 0; /* unused */ + } + while (!do_abort) { u_int polli = 0; iter++; @@ -871,7 +923,7 @@ run: pollfd[polli].revents = 0; ++polli; - //RD(5, "polling %d file descriptors", polli+1); + ND(5, "polling %d file descriptors", polli); rv = poll(pollfd, polli, poll_timeout); if (rv <= 0) { if (rv < 0 && errno != EAGAIN && errno != EINTR) @@ -902,7 +954,7 @@ run: struct netmap_slot *rs = &ring->slot[last]; // XXX less aggressive? rs->buf_idx = forward_packet(g + 1, rs); - rs->flags |= NS_BUF_CHANGED; + rs->flags = NS_BUF_CHANGED; rs->ptr = 0; } p->last_tail = last; @@ -918,27 +970,34 @@ run: for (i = 0; i < npipes; i++) { struct port_des *p = &ports[i]; struct overflow_queue *q = p->oq; - uint32_t k, lim; + uint32_t k; + int64_t lim; struct netmap_ring *ring; struct netmap_slot *slot; + struct morefrag *mf; if (oq_empty(q)) continue; ring = p->ring; - lim = nm_ring_space(ring); + mf = (struct morefrag *)ring->sem; + lim = ring->tail - mf->shadow_head; if (!lim) continue; + if (lim < 0) + lim += ring->num_slots; if (q->n < lim) lim = q->n; for (k = 0; k < lim; k++) { struct netmap_slot s = oq_deq(q), tmp; tmp.ptr = 0; - slot = &ring->slot[ring->head]; + slot = &ring->slot[mf->shadow_head]; tmp.buf_idx = slot->buf_idx; oq_enq(freeq, &tmp); *slot = s; slot->flags |= NS_BUF_CHANGED; - ring->head = nm_ring_next(ring, ring->head); + mf->shadow_head = nm_ring_next(ring, mf->shadow_head); + if (!(slot->flags & NS_MOREFRAG)) + ring->head = mf->shadow_head; } } } @@ -947,6 +1006,7 @@ run: int batch = 0; for (i = rxport->nmd->first_rx_ring; i <= rxport->nmd->last_rx_ring; i++) { struct netmap_ring *rxring = NETMAP_RXRING(rxport->nmd->nifp, i); + struct morefrag *mf = (struct morefrag *)rxring->sem; //D("prepare to scan rings"); int next_head = rxring->head; @@ -959,7 +1019,15 @@ run: received_bytes += rs->len; // CHOOSE THE CORRECT OUTPUT PIPE - rs->ptr = pkt_hdr_hash((const unsigned char *)next_buf, 4, 'B'); + // If the previous slot had NS_MOREFRAG set, this is another + // fragment of the last packet and it should go to the same + // output pipe as before. + if (!mf->last_flag) { + // 'B' is just a hashing seed + mf->last_hash = pkt_hdr_hash((const unsigned char *)next_buf, 4, 'B'); + } + mf->last_flag = rs->flags & NS_MOREFRAG; + rs->ptr = mf->last_hash; if (rs->ptr == 0) { non_ip++; // XXX ?? } @@ -968,9 +1036,8 @@ run: next_slot = &rxring->slot[next_head]; next_buf = NETMAP_BUF(rxring, next_slot->buf_idx); __builtin_prefetch(next_buf); - // 'B' is just a hashing seed rs->buf_idx = forward_packet(g, rs); - rs->flags |= NS_BUF_CHANGED; + rs->flags = NS_BUF_CHANGED; rxring->head = rxring->cur = next_head; batch++; Modified: stable/12/tools/tools/netmap/pkt_hash.c ============================================================================== --- stable/12/tools/tools/netmap/pkt_hash.c Wed Nov 25 21:22:16 2020 (r368033) +++ stable/12/tools/tools/netmap/pkt_hash.c Wed Nov 25 21:23:13 2020 (r368034) @@ -26,6 +26,7 @@ ** POSSIBILITY OF SUCH DAMAGE. **/ /* $FreeBSD$ */ + /* for func prototypes */ #include "pkt_hash.h" From owner-svn-src-all@freebsd.org Wed Nov 25 21:23:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CD32474777; Wed, 25 Nov 2020 21:23:59 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChDR30lDvz4W8h; Wed, 25 Nov 2020 21:23:59 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C72218035; Wed, 25 Nov 2020 21:23:59 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APLNw41061821; Wed, 25 Nov 2020 21:23:58 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APLNwlL061820; Wed, 25 Nov 2020 21:23:58 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202011252123.0APLNwlL061820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 25 Nov 2020 21:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368035 - stable/12/tools/tools/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/tools/tools/netmap X-SVN-Commit-Revision: 368035 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 21:23:59 -0000 Author: vmaffione Date: Wed Nov 25 21:23:58 2020 New Revision: 368035 URL: https://svnweb.freebsd.org/changeset/base/368035 Log: MFC r367934 netmap: nmreplay: switch to libnetmap Use the newer libnetmap (included in base) rather than the older nm_open()/nm_close() defined in netmap_user.h Modified: stable/12/tools/tools/netmap/nmreplay.c Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/tools/netmap/nmreplay.c ============================================================================== --- stable/12/tools/tools/netmap/nmreplay.c Wed Nov 25 21:23:13 2020 (r368034) +++ stable/12/tools/tools/netmap/nmreplay.c Wed Nov 25 21:23:58 2020 (r368035) @@ -106,12 +106,27 @@ #define DDD(_fmt, ...) ED("--DDD-- " _fmt, ##__VA_ARGS__) #define _GNU_SOURCE // for CPU_SET() etc +#include +#include +#include +#include /* log, exp etc. */ +#include +#ifdef __FreeBSD__ +#include /* pthread w/ affinity */ +#include /* cpu_set */ +#endif /* __FreeBSD__ */ +#include #include -#define NETMAP_WITH_LIBS -#include +#include +#include /* memcpy */ +#include +#include +#include #include +#include // setpriority +#include +#include - /* * * A packet in the queue is q_pkt plus the payload. @@ -242,15 +257,6 @@ static struct nm_pcap_file *readpcap(const char *fn); static void destroy_pcap(struct nm_pcap_file *file); -#include -#include -#include -#include -#include -#include /* memcpy */ - -#include - #define NS_SCALE 1000000000UL /* nanoseconds in 1s */ static void destroy_pcap(struct nm_pcap_file *pf) @@ -435,18 +441,6 @@ static int verbose = 0; static int do_abort = 0; -#include -#include -#include -#include - -#include // setpriority - -#ifdef __FreeBSD__ -#include /* pthread w/ affinity */ -#include /* cpu_set */ -#endif /* __FreeBSD__ */ - #ifdef linux #define cpuset_t cpu_set_t #endif @@ -566,7 +560,7 @@ struct _qs { /* shared queue */ struct nm_pcap_file *pcap; /* the pcap struct */ /* parameters for reading from the netmap port */ - struct nm_desc *src_port; /* netmap descriptor */ + struct nmport_d *src_port; /* netmap descriptor */ const char * prod_ifname; /* interface name or pcap file */ struct netmap_ring *rxring; /* current ring being handled */ uint32_t si; /* ring index */ @@ -640,8 +634,8 @@ struct pipe_args { int cons_core; /* core for cons() */ int prod_core; /* core for prod() */ - struct nm_desc *pa; /* netmap descriptor */ - struct nm_desc *pb; + struct nmport_d *pa; /* netmap descriptor */ + struct nmport_d *pb; struct _qs q; }; @@ -843,7 +837,7 @@ fail: if (q->buf != NULL) { free(q->buf); } - nm_close(pa->pb); + nmport_close(pa->pb); return (NULL); } @@ -893,7 +887,7 @@ cons(void *_pa) continue; } /* XXX copy is inefficient but simple */ - if (nm_inject(pa->pb, (char *)(p + 1), p->pktlen) == 0) { + if (nmport_inject(pa->pb, (char *)(p + 1), p->pktlen) == 0) { RD(1, "inject failed len %d now %ld tx %ld h %ld t %ld next %ld", (int)p->pktlen, (u_long)q->cons_now, (u_long)p->pt_tx, (u_long)q->_head, (u_long)q->_tail, (u_long)p->next); @@ -939,7 +933,7 @@ nmreplay_main(void *_a) pcap_prod((void*)a); destroy_pcap(q->pcap); q->pcap = NULL; - a->pb = nm_open(q->cons_ifname, NULL, 0, NULL); + a->pb = nmport_open(q->cons_ifname); if (a->pb == NULL) { EEE("cannot open netmap on %s", q->cons_ifname); do_abort = 1; // XXX any better way ? @@ -1372,7 +1366,6 @@ parse_bw(const char *arg) * 24 useful random bits. */ -#include /* log, exp etc. */ static inline uint64_t my_random24(void) /* 24 useful bits */ { From owner-svn-src-all@freebsd.org Wed Nov 25 21:24:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 241B2474D65; Wed, 25 Nov 2020 21:24:40 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChDRr0W18z4W9f; Wed, 25 Nov 2020 21:24:40 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0445E17F2D; Wed, 25 Nov 2020 21:24:40 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APLOepV061911; Wed, 25 Nov 2020 21:24:40 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APLOdgV061909; Wed, 25 Nov 2020 21:24:39 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202011252124.0APLOdgV061909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 25 Nov 2020 21:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368036 - stable/12/usr.sbin/valectl X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/usr.sbin/valectl X-SVN-Commit-Revision: 368036 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 21:24:40 -0000 Author: vmaffione Date: Wed Nov 25 21:24:39 2020 New Revision: 368036 URL: https://svnweb.freebsd.org/changeset/base/368036 Log: MFC r367935 netmap: valectl: switch to libnetmap Use the newer libnetmap (included in base) rather than the older nm_open()/nm_close() defined in netmap_user.h Modified: stable/12/usr.sbin/valectl/Makefile stable/12/usr.sbin/valectl/valectl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/valectl/Makefile ============================================================================== --- stable/12/usr.sbin/valectl/Makefile Wed Nov 25 21:23:58 2020 (r368035) +++ stable/12/usr.sbin/valectl/Makefile Wed Nov 25 21:24:39 2020 (r368036) @@ -5,4 +5,6 @@ MAN= valectl.8 WARNS?= 3 +LIBADD= netmap + .include Modified: stable/12/usr.sbin/valectl/valectl.c ============================================================================== --- stable/12/usr.sbin/valectl/valectl.c Wed Nov 25 21:23:58 2020 (r368035) +++ stable/12/usr.sbin/valectl/valectl.c Wed Nov 25 21:24:39 2020 (r368036) @@ -25,9 +25,8 @@ /* $FreeBSD$ */ -#define NETMAP_WITH_LIBS -#include -#include +#define LIBNETMAP_NOTHREADSAFE +#include #include #include @@ -42,14 +41,58 @@ #include /* basename */ #include /* atoi, free */ +int verbose; + +struct args { + const char *name; + const char *config; + const char *mem_id; + + uint16_t nr_reqtype; + uint32_t nr_mode; +}; + static void -parse_nmr_config(const char* conf, struct nmreq *nmr) +dump_port_info(struct nmreq_port_info_get *v) { + printf("memsize: %"PRIu64"\n", v->nr_memsize); + printf("tx_slots: %"PRIu32"\n", v->nr_tx_slots); + printf("rx_slots: %"PRIu32"\n", v->nr_rx_slots); + printf("tx_rings: %"PRIu16"\n", v->nr_tx_rings); + printf("rx_rings %"PRIu16"\n", v->nr_rx_rings); + printf("mem_id: %"PRIu16"\n", v->nr_mem_id); +} + +static void +dump_newif(struct nmreq_vale_newif *v) +{ + printf("tx_slots: %"PRIu32"\n", v->nr_tx_slots); + printf("rx_slots: %"PRIu32"\n", v->nr_rx_slots); + printf("tx_rings: %"PRIu16"\n", v->nr_tx_rings); + printf("rx_ring: %"PRIu16"\n", v->nr_rx_rings); + printf("mem_id: %"PRIu16"\n", v->nr_mem_id); +} + +static void +dump_vale_list(struct nmreq_vale_list *v) +{ + printf("bridge_idx: %"PRIu16"\n", v->nr_bridge_idx); + printf("port_idx: %"PRIu16"\n", v->nr_port_idx); +} + + +static void +parse_ring_config(const char* conf, + uint32_t *nr_tx_slots, + uint32_t *nr_rx_slots, + uint16_t *nr_tx_rings, + uint16_t *nr_rx_rings) +{ char *w, *tok; int i, v; - nmr->nr_tx_rings = nmr->nr_rx_rings = 0; - nmr->nr_tx_slots = nmr->nr_rx_slots = 0; + *nr_tx_rings = *nr_rx_rings = 0; + *nr_tx_slots = *nr_rx_slots = 0; if (conf == NULL || ! *conf) return; w = strdup(conf); @@ -57,137 +100,235 @@ parse_nmr_config(const char* conf, struct nmreq *nmr) v = atoi(tok); switch (i) { case 0: - nmr->nr_tx_slots = nmr->nr_rx_slots = v; + *nr_tx_slots = *nr_rx_slots = v; break; case 1: - nmr->nr_rx_slots = v; + *nr_rx_slots = v; break; case 2: - nmr->nr_tx_rings = nmr->nr_rx_rings = v; + *nr_tx_rings = *nr_rx_rings = v; break; case 3: - nmr->nr_rx_rings = v; + *nr_rx_rings = v; break; default: - D("ignored config: %s", tok); + fprintf(stderr, "ignored config: %s", tok); break; } } - D("txr %d txd %d rxr %d rxd %d", - nmr->nr_tx_rings, nmr->nr_tx_slots, - nmr->nr_rx_rings, nmr->nr_rx_slots); + ND("txr %d txd %d rxr %d rxd %d", + *nr_tx_rings, *nr_tx_slots, + *nr_rx_rings, *nr_rx_slots); free(w); } static int -bdg_ctl(const char *name, int nr_cmd, int nr_arg, char *nmr_config, int nr_arg2) +parse_poll_config(const char *conf, struct nmreq_vale_polling *v) { - struct nmreq nmr; - int error = 0; - int fd = open("/dev/netmap", O_RDWR); + char *w, *tok; + int i, p; - if (fd == -1) { - D("Unable to open /dev/netmap"); + if (conf == NULL || ! *conf) { + fprintf(stderr, "invalid null/empty config\n"); return -1; } + w = strdup(conf); + for (i = 0, tok = strtok(w, ","); tok; i++, tok = strtok(NULL, ",")) { + p = atoi(tok); + switch (i) { + case 0: + v->nr_mode = p ? NETMAP_POLLING_MODE_MULTI_CPU : + NETMAP_POLLING_MODE_SINGLE_CPU; + break; + case 1: + v->nr_first_cpu_id = p; + break; + case 2: + if (v->nr_mode != NETMAP_POLLING_MODE_MULTI_CPU) { + fprintf(stderr, "too many numbers in '%s'\n", conf); + return -1; + } + v->nr_num_polling_cpus = p; + break; + case 3: + fprintf(stderr, "too many numbers in '%s'\n", conf); + return -1; + } + } + free(w); + return 0; +} - bzero(&nmr, sizeof(nmr)); - nmr.nr_version = NETMAP_API; - if (name != NULL) /* might be NULL */ - strncpy(nmr.nr_name, name, sizeof(nmr.nr_name)-1); - nmr.nr_cmd = nr_cmd; - parse_nmr_config(nmr_config, &nmr); - nmr.nr_arg2 = nr_arg2; +static int32_t +parse_mem_id(const char *mem_id) +{ + int32_t id; - switch (nr_cmd) { - case NETMAP_BDG_DELIF: - case NETMAP_BDG_NEWIF: - error = ioctl(fd, NIOCREGIF, &nmr); - if (error == -1) { - ND("Unable to %s %s", nr_cmd == NETMAP_BDG_DELIF ? "delete":"create", name); - perror(name); - } else { - ND("Success to %s %s", nr_cmd == NETMAP_BDG_DELIF ? "delete":"create", name); + if (mem_id == NULL) + return 0; + if (isdigit(*mem_id)) + return atoi(mem_id); + id = nmreq_get_mem_id(&mem_id, nmctx_get()); + if (id == 0) { + fprintf(stderr, "invalid format in '-m %s' (missing 'netmap:'?)\n", mem_id); + return -1; + } + return id; +} + +static int +list_all(int fd, struct nmreq_header *hdr) +{ + int error; + struct nmreq_vale_list *vale_list = + (struct nmreq_vale_list *)hdr->nr_body; + + for (;;) { + hdr->nr_name[0] = '\0'; + error = ioctl(fd, NIOCCTRL, hdr); + if (error < 0) { + if (errno == ENOENT) + break; + + fprintf(stderr, "failed to list all: %s\n", strerror(errno)); + return 1; } + printf("%s bridge_idx %"PRIu16" port_idx %"PRIu32"\n", hdr->nr_name, + vale_list->nr_bridge_idx, vale_list->nr_port_idx); + vale_list->nr_port_idx++; + } + return 1; +} + +static int +bdg_ctl(struct args *a) +{ + struct nmreq_header hdr; + struct nmreq_vale_attach vale_attach; + struct nmreq_vale_detach vale_detach; + struct nmreq_vale_newif vale_newif; + struct nmreq_vale_list vale_list; + struct nmreq_vale_polling vale_polling; + struct nmreq_port_info_get port_info_get; + int error = 0; + int fd; + int32_t mem_id; + const char *action = NULL; + + fd = open("/dev/netmap", O_RDWR); + if (fd == -1) { + perror("/dev/netmap"); + return 1; + } + + bzero(&hdr, sizeof(hdr)); + hdr.nr_version = NETMAP_API; + if (a->name != NULL) { /* might be NULL */ + strncpy(hdr.nr_name, a->name, NETMAP_REQ_IFNAMSIZ - 1); + hdr.nr_name[NETMAP_REQ_IFNAMSIZ - 1] = '\0'; + } + hdr.nr_reqtype = a->nr_reqtype; + + switch (a->nr_reqtype) { + case NETMAP_REQ_VALE_DELIF: + /* no body */ + action = "remove"; break; - case NETMAP_BDG_ATTACH: - case NETMAP_BDG_DETACH: - nmr.nr_flags = NR_REG_ALL_NIC; - if (nr_arg && nr_arg != NETMAP_BDG_HOST) { - nmr.nr_flags = NR_REG_NIC_SW; - nr_arg = 0; + + case NETMAP_REQ_VALE_NEWIF: + memset(&vale_newif, 0, sizeof(vale_newif)); + hdr.nr_body = (uintptr_t)&vale_newif; + parse_ring_config(a->config, + &vale_newif.nr_tx_slots, + &vale_newif.nr_rx_slots, + &vale_newif.nr_tx_rings, + &vale_newif.nr_rx_rings); + mem_id = parse_mem_id(a->mem_id); + if (mem_id < 0) + return 1; + vale_newif.nr_mem_id = mem_id; + action = "create"; + break; + + case NETMAP_REQ_VALE_ATTACH: + memset(&vale_attach, 0, sizeof(vale_attach)); + hdr.nr_body = (uintptr_t)&vale_attach; + vale_attach.reg.nr_mode = a->nr_mode; + parse_ring_config(a->config, + &vale_attach.reg.nr_tx_slots, + &vale_attach.reg.nr_rx_slots, + &vale_attach.reg.nr_tx_rings, + &vale_attach.reg.nr_rx_rings); + mem_id = parse_mem_id(a->mem_id); + if (mem_id < 0) + return 1; + vale_attach.reg.nr_mem_id = mem_id; + action = "attach"; + break; + + case NETMAP_REQ_VALE_DETACH: + memset(&vale_detach, 0, sizeof(vale_detach)); + hdr.nr_body = (uintptr_t)&vale_detach; + action = "detach"; + break; + + case NETMAP_REQ_VALE_LIST: + memset(&vale_list, 0, sizeof(vale_list)); + hdr.nr_body = (uintptr_t)&vale_list; + if (a->name == NULL) { + return list_all(fd, &hdr); } - nmr.nr_arg1 = nr_arg; - error = ioctl(fd, NIOCREGIF, &nmr); - if (error == -1) { - ND("Unable to %s %s to the bridge", nr_cmd == - NETMAP_BDG_DETACH?"detach":"attach", name); - perror(name); - } else - ND("Success to %s %s to the bridge", nr_cmd == - NETMAP_BDG_DETACH?"detach":"attach", name); + action = "list"; break; - case NETMAP_BDG_LIST: - if (strlen(nmr.nr_name)) { /* name to bridge/port info */ - error = ioctl(fd, NIOCGINFO, &nmr); - if (error) { - ND("Unable to obtain info for %s", name); - perror(name); - } else - D("%s at bridge:%d port:%d", name, nmr.nr_arg1, - nmr.nr_arg2); - break; + case NETMAP_REQ_VALE_POLLING_ENABLE: + action = "enable polling on"; + /* fall through */ + case NETMAP_REQ_VALE_POLLING_DISABLE: + memset(&vale_polling, 0, sizeof(vale_polling)); + hdr.nr_body = (uintptr_t)&vale_polling; + parse_poll_config(a->config, &vale_polling); + if (action == NULL) + action ="disable polling on"; + break; + + case NETMAP_REQ_PORT_INFO_GET: + memset(&port_info_get, 0, sizeof(port_info_get)); + hdr.nr_body = (uintptr_t)&port_info_get; + action = "obtain info for"; + break; + } + error = ioctl(fd, NIOCCTRL, &hdr); + if (error < 0) { + fprintf(stderr, "failed to %s %s: %s\n", + action, a->name, strerror(errno)); + return 1; + } + switch (hdr.nr_reqtype) { + case NETMAP_REQ_VALE_NEWIF: + if (verbose) { + dump_newif(&vale_newif); } + break; - /* scan all the bridges and ports */ - nmr.nr_arg1 = nmr.nr_arg2 = 0; - for (; !ioctl(fd, NIOCGINFO, &nmr); nmr.nr_arg2++) { - D("bridge:%d port:%d %s", nmr.nr_arg1, nmr.nr_arg2, - nmr.nr_name); - nmr.nr_name[0] = '\0'; + case NETMAP_REQ_VALE_ATTACH: + if (verbose) { + printf("port_index: %"PRIu32"\n", vale_attach.port_index); } + break; + case NETMAP_REQ_VALE_DETACH: + if (verbose) { + printf("port_index: %"PRIu32"\n", vale_detach.port_index); + } break; - case NETMAP_BDG_POLLING_ON: - case NETMAP_BDG_POLLING_OFF: - /* We reuse nmreq fields as follows: - * nr_tx_slots: 0 and non-zero indicate REG_ALL_NIC - * REG_ONE_NIC, respectively. - * nr_rx_slots: CPU core index. This also indicates the - * first queue in the case of REG_ONE_NIC - * nr_tx_rings: (REG_ONE_NIC only) indicates the - * number of CPU cores or the last queue - */ - nmr.nr_flags |= nmr.nr_tx_slots ? - NR_REG_ONE_NIC : NR_REG_ALL_NIC; - nmr.nr_ringid = nmr.nr_rx_slots; - /* number of cores/rings */ - if (nmr.nr_flags == NR_REG_ALL_NIC) - nmr.nr_arg1 = 1; - else - nmr.nr_arg1 = nmr.nr_tx_rings; - - error = ioctl(fd, NIOCREGIF, &nmr); - if (!error) - D("polling on %s %s", nmr.nr_name, - nr_cmd == NETMAP_BDG_POLLING_ON ? - "started" : "stopped"); - else - D("polling on %s %s (err %d)", nmr.nr_name, - nr_cmd == NETMAP_BDG_POLLING_ON ? - "couldn't start" : "couldn't stop", error); + case NETMAP_REQ_VALE_LIST: + dump_vale_list(&vale_list); break; - default: /* GINFO */ - nmr.nr_cmd = nmr.nr_arg1 = nmr.nr_arg2 = 0; - error = ioctl(fd, NIOCGINFO, &nmr); - if (error) { - ND("Unable to get if info for %s", name); - perror(name); - } else - D("%s: %d queues.", name, nmr.nr_rx_rings); + case NETMAP_REQ_PORT_INFO_GET: + dump_port_info(&port_info_get); break; } close(fd); @@ -199,82 +340,106 @@ usage(int errcode) { fprintf(stderr, "Usage:\n" - "valectl arguments\n" + "vale-ctl [arguments]\n" "\t-g interface interface name to get info\n" "\t-d interface interface name to be detached\n" "\t-a interface interface name to be attached\n" "\t-h interface interface name to be attached with the host stack\n" "\t-n interface interface name to be created\n" "\t-r interface interface name to be deleted\n" - "\t-l list all or specified bridge's interfaces (default)\n" + "\t-l vale-port show bridge and port indices\n" "\t-C string ring/slot setting of an interface creating by -n\n" "\t-p interface start polling. Additional -C x,y,z configures\n" "\t\t x: 0 (REG_ALL_NIC) or 1 (REG_ONE_NIC),\n" "\t\t y: CPU core id for ALL_NIC and core/ring for ONE_NIC\n" "\t\t z: (ONE_NIC only) num of total cores/rings\n" "\t-P interface stop polling\n" - "\t-m memid to use when creating a new interface\n"); + "\t-m memid to use when creating a new interface\n" + "\t-v increase verbosity\n" + "with no arguments: list all existing vale ports\n"); exit(errcode); } int main(int argc, char *argv[]) { - int ch, nr_cmd = 0, nr_arg = 0; - char *name = NULL, *nmr_config = NULL; - int nr_arg2 = 0; + int ch; + struct args a = { + .name = NULL, + .config = NULL, + .mem_id = NULL, + .nr_reqtype = 0, + .nr_mode = NR_REG_ALL_NIC, + }; - while ((ch = getopt(argc, argv, "d:a:h:g:l:n:r:C:p:P:m:")) != -1) { - if (ch != 'C' && ch != 'm') - name = optarg; /* default */ + while ((ch = getopt(argc, argv, "d:a:h:g:l:n:r:C:p:P:m:v")) != -1) { switch (ch) { default: fprintf(stderr, "bad option %c %s", ch, optarg); - usage(-1); + usage(1); break; case 'd': - nr_cmd = NETMAP_BDG_DETACH; + a.nr_reqtype = NETMAP_REQ_VALE_DETACH; + a.name = optarg; break; case 'a': - nr_cmd = NETMAP_BDG_ATTACH; + a.nr_reqtype = NETMAP_REQ_VALE_ATTACH; + a.nr_mode = NR_REG_ALL_NIC; + a.name = optarg; break; case 'h': - nr_cmd = NETMAP_BDG_ATTACH; - nr_arg = NETMAP_BDG_HOST; + a.nr_reqtype = NETMAP_REQ_VALE_ATTACH; + a.nr_mode = NR_REG_NIC_SW; + a.name = optarg; break; case 'n': - nr_cmd = NETMAP_BDG_NEWIF; + a.nr_reqtype = NETMAP_REQ_VALE_NEWIF; + a.name = optarg; break; case 'r': - nr_cmd = NETMAP_BDG_DELIF; + a.nr_reqtype = NETMAP_REQ_VALE_DELIF; + a.name = optarg; break; case 'g': - nr_cmd = 0; + a.nr_reqtype = NETMAP_REQ_PORT_INFO_GET; + a.name = optarg; break; case 'l': - nr_cmd = NETMAP_BDG_LIST; + a.nr_reqtype = NETMAP_REQ_VALE_LIST; + a.name = optarg; + if (strncmp(a.name, NM_BDG_NAME, strlen(NM_BDG_NAME))) { + fprintf(stderr, "invalid vale port name: '%s'\n", a.name); + usage(1); + } break; case 'C': - nmr_config = strdup(optarg); + a.config = optarg; break; case 'p': - nr_cmd = NETMAP_BDG_POLLING_ON; + a.nr_reqtype = NETMAP_REQ_VALE_POLLING_ENABLE; + a.name = optarg; break; case 'P': - nr_cmd = NETMAP_BDG_POLLING_OFF; + a.nr_reqtype = NETMAP_REQ_VALE_POLLING_DISABLE; + a.name = optarg; break; case 'm': - nr_arg2 = atoi(optarg); + a.mem_id = optarg; break; + case 'v': + verbose++; + break; } } if (optind != argc) { - // fprintf(stderr, "optind %d argc %d\n", optind, argc); - usage(-1); + usage(1); } if (argc == 1) { - nr_cmd = NETMAP_BDG_LIST; - name = NULL; + a.nr_reqtype = NETMAP_REQ_VALE_LIST; + a.name = NULL; } - return bdg_ctl(name, nr_cmd, nr_arg, nmr_config, nr_arg2) ? 1 : 0; + if (!a.nr_reqtype) { + usage(1); + } + return bdg_ctl(&a); } From owner-svn-src-all@freebsd.org Wed Nov 25 21:25:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87E3B474973; Wed, 25 Nov 2020 21:25:18 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChDSZ3SWyz4WCf; Wed, 25 Nov 2020 21:25:18 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A15E17BE4; Wed, 25 Nov 2020 21:25:18 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APLPIgk062012; Wed, 25 Nov 2020 21:25:18 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APLPIBK062011; Wed, 25 Nov 2020 21:25:18 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202011252125.0APLPIBK062011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 25 Nov 2020 21:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368037 - stable/12/tools/tools/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/tools/tools/netmap X-SVN-Commit-Revision: 368037 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 21:25:18 -0000 Author: vmaffione Date: Wed Nov 25 21:25:17 2020 New Revision: 368037 URL: https://svnweb.freebsd.org/changeset/base/368037 Log: MFC r367936 netmap: bridge: improve readability Multiple cosmetic changes, plus a fix to a verbose print (indicating wrong net->host/host->net direction). Modified: stable/12/tools/tools/netmap/bridge.c Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/tools/netmap/bridge.c ============================================================================== --- stable/12/tools/tools/netmap/bridge.c Wed Nov 25 21:24:39 2020 (r368036) +++ stable/12/tools/tools/netmap/bridge.c Wed Nov 25 21:25:17 2020 (r368037) @@ -3,19 +3,19 @@ * * BSD license * - * A netmap client to bridge two network interfaces - * (or one interface and the host stack). + * A netmap application to bridge two network interfaces, + * or one interface and the host stack. * * $FreeBSD$ */ +#include +#include #include #include #include -#include #include #include -#include static int verbose = 0; @@ -32,30 +32,39 @@ sigint_h(int sig) /* - * how many packets on this set of queues ? + * How many slots do we (user application) have on this + * set of queues ? */ static int -pkt_queued(struct nmport_d *d, int tx) +rx_slots_avail(struct nmport_d *d) { u_int i, tot = 0; - if (tx) { - for (i = d->first_tx_ring; i <= d->last_tx_ring; i++) { - tot += nm_ring_space(NETMAP_TXRING(d->nifp, i)); - } - } else { - for (i = d->first_rx_ring; i <= d->last_rx_ring; i++) { - tot += nm_ring_space(NETMAP_RXRING(d->nifp, i)); - } + for (i = d->first_rx_ring; i <= d->last_rx_ring; i++) { + tot += nm_ring_space(NETMAP_RXRING(d->nifp, i)); } + return tot; } +static int +tx_slots_avail(struct nmport_d *d) +{ + u_int i, tot = 0; + + for (i = d->first_tx_ring; i <= d->last_tx_ring; i++) { + tot += nm_ring_space(NETMAP_TXRING(d->nifp, i)); + } + + return tot; +} + /* - * move up to 'limit' pkts from rxring to txring swapping buffers. + * Move up to 'limit' pkts from rxring to txring, swapping buffers + * if zerocopy is possible. Otherwise fall back on packet copying. */ static int -process_rings(struct netmap_ring *rxring, struct netmap_ring *txring, +rings_move(struct netmap_ring *rxring, struct netmap_ring *txring, u_int limit, const char *msg) { u_int j, k, m = 0; @@ -63,7 +72,7 @@ process_rings(struct netmap_ring *rxring, struct netma /* print a warning if any of the ring flags is set (e.g. NM_REINIT) */ if (rxring->flags || txring->flags) D("%s rxflags %x txflags %x", - msg, rxring->flags, txring->flags); + msg, rxring->flags, txring->flags); j = rxring->head; /* RX */ k = txring->head; /* TX */ m = nm_ring_space(rxring); @@ -79,16 +88,18 @@ process_rings(struct netmap_ring *rxring, struct netma /* swap packets */ if (ts->buf_idx < 2 || rs->buf_idx < 2) { - RD(5, "wrong index rx[%d] = %d -> tx[%d] = %d", - j, rs->buf_idx, k, ts->buf_idx); + RD(2, "wrong index rxr[%d] = %d -> txr[%d] = %d", + j, rs->buf_idx, k, ts->buf_idx); sleep(2); } /* copy the packet length. */ if (rs->len > rxring->nr_buf_size) { - RD(5, "wrong len %d rx[%d] -> tx[%d]", rs->len, j, k); + RD(2, "%s: invalid len %u, rxr[%d] -> txr[%d]", + msg, rs->len, j, k); rs->len = 0; } else if (verbose > 1) { - D("%s send len %d rx[%d] -> tx[%d]", msg, rs->len, j, k); + D("%s: fwd len %u, rx[%d] -> tx[%d]", + msg, rs->len, j, k); } ts->len = rs->len; if (zerocopy) { @@ -111,24 +122,23 @@ process_rings(struct netmap_ring *rxring, struct netma rxring->head = rxring->cur = j; txring->head = txring->cur = k; if (verbose && m > 0) - D("%s sent %d packets to %p", msg, m, txring); + D("%s fwd %d packets: rxring %u --> txring %u", + msg, m, rxring->ringid, txring->ringid); return (m); } -/* move packts from src to destination */ +/* Move packets from source port to destination port. */ static int -move(struct nmport_d *src, struct nmport_d *dst, u_int limit) +ports_move(struct nmport_d *src, struct nmport_d *dst, u_int limit, + const char *msg) { struct netmap_ring *txring, *rxring; u_int m = 0, si = src->first_rx_ring, di = dst->first_tx_ring; - const char *msg = (src->reg.nr_flags == NR_REG_SW) ? - "host->net" : "net->host"; while (si <= src->last_rx_ring && di <= dst->last_tx_ring) { rxring = NETMAP_RXRING(src->nifp, si); txring = NETMAP_TXRING(dst->nifp, di); - ND("txring %p rxring %p", txring, rxring); if (nm_ring_empty(rxring)) { si++; continue; @@ -137,7 +147,7 @@ move(struct nmport_d *src, struct nmport_d *dst, u_int di++; continue; } - m += process_rings(rxring, txring, limit, msg); + m += rings_move(rxring, txring, limit, msg); } return (m); @@ -149,7 +159,7 @@ usage(void) { fprintf(stderr, "netmap bridge program: forward packets between two " - "network interfaces\n" + "netmap ports\n" " usage(1): bridge [-v] [-i ifa] [-i ifb] [-b burst] " "[-w wait_time] [-L]\n" " usage(2): bridge [-v] [-w wait_time] [-L] " @@ -161,6 +171,11 @@ usage(void) " is not specified, otherwise loopback traffic on ifa.\n" "\n" " example: bridge -w 10 -i netmap:eth3 -i netmap:eth1\n" + "\n" + " If ifa and ifb are two interfaces, they must be in\n" + " promiscuous mode. Otherwise, if bridging with the \n" + " host stack, the interface must have the offloads \n" + " disabled.\n" ); exit(1); } @@ -175,13 +190,15 @@ usage(void) int main(int argc, char **argv) { + char msg_a2b[128], msg_b2a[128]; struct pollfd pollfd[2]; - int ch; u_int burst = 1024, wait_link = 4; struct nmport_d *pa = NULL, *pb = NULL; char *ifa = NULL, *ifb = NULL; char ifabuf[64] = { 0 }; + int pa_sw_rings, pb_sw_rings; int loopback = 0; + int ch; fprintf(stderr, "%s built %s %s\n\n", argv[0], __DATE__, __TIME__); @@ -281,14 +298,27 @@ main(int argc, char **argv) pa->hdr.nr_name, pa->first_rx_ring, pa->reg.nr_rx_rings, pb->hdr.nr_name, pb->first_rx_ring, pb->reg.nr_rx_rings); + pa_sw_rings = (pa->reg.nr_mode == NR_REG_SW || + pa->reg.nr_mode == NR_REG_ONE_SW); + pb_sw_rings = (pb->reg.nr_mode == NR_REG_SW || + pb->reg.nr_mode == NR_REG_ONE_SW); + + snprintf(msg_a2b, sizeof(msg_a2b), "%s:%s --> %s:%s", + pa->hdr.nr_name, pa_sw_rings ? "host" : "nic", + pb->hdr.nr_name, pb_sw_rings ? "host" : "nic"); + + snprintf(msg_b2a, sizeof(msg_b2a), "%s:%s --> %s:%s", + pb->hdr.nr_name, pb_sw_rings ? "host" : "nic", + pa->hdr.nr_name, pa_sw_rings ? "host" : "nic"); + /* main loop */ signal(SIGINT, sigint_h); while (!do_abort) { int n0, n1, ret; pollfd[0].events = pollfd[1].events = 0; pollfd[0].revents = pollfd[1].revents = 0; - n0 = pkt_queued(pa, 0); - n1 = pkt_queued(pb, 0); + n0 = rx_slots_avail(pa); + n1 = rx_slots_avail(pb); #if defined(_WIN32) || defined(BUSYWAIT) if (n0) { ioctl(pollfd[1].fd, NIOCTXSYNC, NULL); @@ -322,35 +352,37 @@ main(int argc, char **argv) ret <= 0 ? "timeout" : "ok", pollfd[0].events, pollfd[0].revents, - pkt_queued(pa, 0), + rx_slots_avail(pa), NETMAP_RXRING(pa->nifp, pa->cur_rx_ring)->head, - pkt_queued(pa, 1), + tx_slots_avail(pa), pollfd[1].events, pollfd[1].revents, - pkt_queued(pb, 0), + rx_slots_avail(pb), NETMAP_RXRING(pb->nifp, pb->cur_rx_ring)->head, - pkt_queued(pb, 1) + tx_slots_avail(pb) ); if (ret < 0) continue; if (pollfd[0].revents & POLLERR) { struct netmap_ring *rx = NETMAP_RXRING(pa->nifp, pa->cur_rx_ring); D("error on fd0, rx [%d,%d,%d)", - rx->head, rx->cur, rx->tail); + rx->head, rx->cur, rx->tail); } if (pollfd[1].revents & POLLERR) { struct netmap_ring *rx = NETMAP_RXRING(pb->nifp, pb->cur_rx_ring); D("error on fd1, rx [%d,%d,%d)", - rx->head, rx->cur, rx->tail); + rx->head, rx->cur, rx->tail); } if (pollfd[0].revents & POLLOUT) - move(pb, pa, burst); + ports_move(pb, pa, burst, msg_b2a); if (pollfd[1].revents & POLLOUT) - move(pa, pb, burst); + ports_move(pa, pb, burst, msg_a2b); - /* We don't need ioctl(NIOCTXSYNC) on the two file descriptors here, - * kernel will txsync on next poll(). */ + /* + * We don't need ioctl(NIOCTXSYNC) on the two file descriptors. + * here. The kernel will txsync on next poll(). + */ } nmport_close(pb); nmport_close(pa); From owner-svn-src-all@freebsd.org Wed Nov 25 21:41:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74FF8474FC1; Wed, 25 Nov 2020 21:41:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChDq82xxNz4WtL; Wed, 25 Nov 2020 21:41:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 586B718155; Wed, 25 Nov 2020 21:41:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APLfO0n072859; Wed, 25 Nov 2020 21:41:24 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APLfO8H072858; Wed, 25 Nov 2020 21:41:24 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011252141.0APLfO8H072858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 25 Nov 2020 21:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368038 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 368038 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 21:41:24 -0000 Author: mjg Date: Wed Nov 25 21:41:23 2020 New Revision: 368038 URL: https://svnweb.freebsd.org/changeset/base/368038 Log: pipe: drop spurious pipeunlock/pipelock cycle on write Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Wed Nov 25 21:25:17 2020 (r368037) +++ head/sys/kern/sys_pipe.c Wed Nov 25 21:41:23 2020 (r368038) @@ -979,12 +979,8 @@ pipe_direct_write(struct pipe *wpipe, struct uio *uio) retry: PIPE_LOCK_ASSERT(wpipe, MA_OWNED); - error = pipelock(wpipe, 1); - if (error != 0) - goto error1; if ((wpipe->pipe_state & PIPE_EOF) != 0) { error = EPIPE; - pipeunlock(wpipe); goto error1; } if (wpipe->pipe_state & PIPE_DIRECTW) { @@ -997,10 +993,9 @@ retry: pipeunlock(wpipe); error = msleep(wpipe, PIPE_MTX(wpipe), PRIBIO | PCATCH, "pipdww", 0); + pipelock(wpipe, 0); if (error) goto error1; - else - goto retry; } if (wpipe->pipe_buffer.cnt > 0) { if (wpipe->pipe_state & PIPE_WANTR) { @@ -1012,6 +1007,7 @@ retry: pipeunlock(wpipe); error = msleep(wpipe, PIPE_MTX(wpipe), PRIBIO | PCATCH, "pipdwc", 0); + pipelock(wpipe, 0); if (error) goto error1; else @@ -1020,7 +1016,6 @@ retry: error = pipe_build_write_buffer(wpipe, uio); if (error) { - pipeunlock(wpipe); goto error1; } @@ -1050,7 +1045,6 @@ retry: } else { pipe_destroy_write_buffer(wpipe); } - pipeunlock(wpipe); KASSERT((wpipe->pipe_state & PIPE_DIRECTW) == 0, ("pipe %p leaked PIPE_DIRECTW", wpipe)); return (error); @@ -1124,16 +1118,12 @@ pipe_write(struct file *fp, struct uio *uio, struct uc } MPASS(wpipe->pipe_buffer.size != 0); - pipeunlock(wpipe); - orig_resid = uio->uio_resid; while (uio->uio_resid) { int space; - pipelock(wpipe, 0); if (wpipe->pipe_state & PIPE_EOF) { - pipeunlock(wpipe); error = EPIPE; break; } @@ -1151,7 +1141,6 @@ pipe_write(struct file *fp, struct uio *uio, struct uc uio->uio_iov->iov_len >= PIPE_MINDIRECT && wpipe->pipe_buffer.size >= PIPE_MINDIRECT && (fp->f_flag & FNONBLOCK) == 0) { - pipeunlock(wpipe); error = pipe_direct_write(wpipe, uio); if (error) break; @@ -1176,6 +1165,7 @@ pipe_write(struct file *fp, struct uio *uio, struct uc pipeunlock(wpipe); error = msleep(wpipe, PIPE_MTX(rpipe), PRIBIO | PCATCH, "pipbww", 0); + pipelock(wpipe, 0); if (error) break; else @@ -1251,7 +1241,6 @@ pipe_write(struct file *fp, struct uio *uio, struct uc wpipe->pipe_buffer.size, ("Pipe buffer overflow")); } - pipeunlock(wpipe); if (error != 0) break; } else { @@ -1268,7 +1257,6 @@ pipe_write(struct file *fp, struct uio *uio, struct uc */ if (fp->f_flag & FNONBLOCK) { error = EAGAIN; - pipeunlock(wpipe); break; } @@ -1282,12 +1270,13 @@ pipe_write(struct file *fp, struct uio *uio, struct uc pipeunlock(wpipe); error = msleep(wpipe, PIPE_MTX(rpipe), PRIBIO | PCATCH, "pipewr", 0); + pipelock(wpipe, 0); if (error != 0) break; + continue; } } - pipelock(wpipe, 0); --wpipe->pipe_busy; if ((wpipe->pipe_busy == 0) && (wpipe->pipe_state & PIPE_WANT)) { From owner-svn-src-all@freebsd.org Wed Nov 25 21:41:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2AF134753E4; Wed, 25 Nov 2020 21:41:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChDql0c0Nz4X0m; Wed, 25 Nov 2020 21:41:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 8ABE8A534; Wed, 25 Nov 2020 21:41:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r368022 - head/lib/libsysdecode To: Pawel Biernacki , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011251630.0APGUvVO072230@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Wed, 25 Nov 2020 13:41:53 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202011251630.0APGUvVO072230@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 21:41:55 -0000 On 11/25/20 8:30 AM, Pawel Biernacki wrote: > Author: kaktus > Date: Wed Nov 25 16:30:57 2020 > New Revision: 368022 > URL: https://svnweb.freebsd.org/changeset/base/368022 > > Log: > libsysdecode: correctly decode mmap flags > > r352913 added decoding of mmap PROT_MAX()'d flags but didn’t account for the > case where different values were specified for PROT_MAX and regular flags. > Fix it. > > Submitted by: sigsys_gmail.com > Reported by: sigsys_gmail.com > MFC after: 7 days > Differential Revision: https://reviews.freebsd.org/D27312 > > Modified: > head/lib/libsysdecode/flags.c > > Modified: head/lib/libsysdecode/flags.c > ============================================================================== > --- head/lib/libsysdecode/flags.c Wed Nov 25 15:45:20 2020 (r368021) > +++ head/lib/libsysdecode/flags.c Wed Nov 25 16:30:57 2020 (r368022) > @@ -662,11 +662,11 @@ sysdecode_mmap_prot(FILE *fp, int prot, int *rem) > > printed = false; > protm = PROT_MAX_EXTRACT(prot); > + prot = PROT_EXTRACT(prot); > if (protm != 0) { > fputs("PROT_MAX(", fp); > printed = print_mask_int(fp, mmapprot, protm, rem); > fputs(")|", fp); > - prot = protm; This was probably meant to be something more like 'prot &= ~PROT_MAX(protm);'. As it is, if there are any invalid bits set, those are now lost. The change to mask off only the PROT_MAX bits would preserve any invalid/unknown bits. (To test, try passing -1 or the like as a prot value and comparing the decoded output for kdump or truss.) -- John Baldwin From owner-svn-src-all@freebsd.org Wed Nov 25 21:54:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8827475635; Wed, 25 Nov 2020 21:54:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChF5v5bVXz4Xcq; Wed, 25 Nov 2020 21:54:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 42E9AA926; Wed, 25 Nov 2020 21:54:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r368038 - head/sys/kern To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011252141.0APLfO8H072858@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Wed, 25 Nov 2020 13:54:10 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202011252141.0APLfO8H072858@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 21:54:11 -0000 On 11/25/20 1:41 PM, Mateusz Guzik wrote: > Author: mjg > Date: Wed Nov 25 21:41:23 2020 > New Revision: 368038 > URL: https://svnweb.freebsd.org/changeset/base/368038 > > Log: > pipe: drop spurious pipeunlock/pipelock cycle on write > > Modified: > head/sys/kern/sys_pipe.c > > Modified: head/sys/kern/sys_pipe.c > ============================================================================== > --- head/sys/kern/sys_pipe.c Wed Nov 25 21:25:17 2020 (r368037) > +++ head/sys/kern/sys_pipe.c Wed Nov 25 21:41:23 2020 (r368038) > @@ -997,10 +993,9 @@ retry: > pipeunlock(wpipe); > error = msleep(wpipe, PIPE_MTX(wpipe), > PRIBIO | PCATCH, "pipdww", 0); > + pipelock(wpipe, 0); > if (error) > goto error1; > - else > - goto retry; > } Hmm, what ensures that PIPE_EOF and PIPE_DIRECTW aren't still set once awakened that would permit removing the 'goto retry'? The goto is still present in the other case in this function, it was only removed from this one? > @@ -1282,12 +1270,13 @@ pipe_write(struct file *fp, struct uio *uio, struct uc > pipeunlock(wpipe); > error = msleep(wpipe, PIPE_MTX(rpipe), > PRIBIO | PCATCH, "pipewr", 0); > + pipelock(wpipe, 0); > if (error != 0) > break; > + continue; A continue as the last line of a while() loop seems spurious? -- John Baldwin From owner-svn-src-all@freebsd.org Wed Nov 25 22:53:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47B57475F4B; Wed, 25 Nov 2020 22:53:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChGQB1dmPz4ZgC; Wed, 25 Nov 2020 22:53:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B3491918E; Wed, 25 Nov 2020 22:53:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APMrMRO017842; Wed, 25 Nov 2020 22:53:22 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APMrMLD017841; Wed, 25 Nov 2020 22:53:22 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011252253.0APMrMLD017841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 25 Nov 2020 22:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368039 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 368039 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 22:53:22 -0000 Author: mjg Date: Wed Nov 25 22:53:21 2020 New Revision: 368039 URL: https://svnweb.freebsd.org/changeset/base/368039 Log: pipe: follow up cleanup to previous The commited patch was incomplete. - add back missing goto retry, noted by jhb - 'if (error)' -> 'if (error != 0)' - consistently do: if (error != 0) break; continue; instead of: if (error != 0) break; else continue; This adds some 'continue' uses which are not needed, but line up with the rest of pipe_write. Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Wed Nov 25 21:41:23 2020 (r368038) +++ head/sys/kern/sys_pipe.c Wed Nov 25 22:53:21 2020 (r368039) @@ -994,8 +994,9 @@ retry: error = msleep(wpipe, PIPE_MTX(wpipe), PRIBIO | PCATCH, "pipdww", 0); pipelock(wpipe, 0); - if (error) + if (error != 0) goto error1; + goto retry; } if (wpipe->pipe_buffer.cnt > 0) { if (wpipe->pipe_state & PIPE_WANTR) { @@ -1008,10 +1009,9 @@ retry: error = msleep(wpipe, PIPE_MTX(wpipe), PRIBIO | PCATCH, "pipdwc", 0); pipelock(wpipe, 0); - if (error) + if (error != 0) goto error1; - else - goto retry; + goto retry; } error = pipe_build_write_buffer(wpipe, uio); @@ -1142,7 +1142,7 @@ pipe_write(struct file *fp, struct uio *uio, struct uc wpipe->pipe_buffer.size >= PIPE_MINDIRECT && (fp->f_flag & FNONBLOCK) == 0) { error = pipe_direct_write(wpipe, uio); - if (error) + if (error != 0) break; continue; } @@ -1166,10 +1166,9 @@ pipe_write(struct file *fp, struct uio *uio, struct uc error = msleep(wpipe, PIPE_MTX(rpipe), PRIBIO | PCATCH, "pipbww", 0); pipelock(wpipe, 0); - if (error) + if (error != 0) break; - else - continue; + continue; } space = wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt; @@ -1243,6 +1242,7 @@ pipe_write(struct file *fp, struct uio *uio, struct uc } if (error != 0) break; + continue; } else { /* * If the "read-side" has been blocked, wake it up now. From owner-svn-src-all@freebsd.org Wed Nov 25 23:17:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D13264768DA; Wed, 25 Nov 2020 23:17:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChGxw5cJ2z4bkt; Wed, 25 Nov 2020 23:17:24 +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 A44EC1907D; Wed, 25 Nov 2020 23:17:24 +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 0APNHOU6030230; Wed, 25 Nov 2020 23:17:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APNHOaC030228; Wed, 25 Nov 2020 23:17:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202011252317.0APNHOaC030228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 25 Nov 2020 23:17:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368040 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 368040 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 23:17:24 -0000 Author: jhb Date: Wed Nov 25 23:17:23 2020 New Revision: 368040 URL: https://svnweb.freebsd.org/changeset/base/368040 Log: Add a manpage for kernel TLS. This subsumes some of the content from tcp(4) describing the socket options but also adds additional notes. Reviewed by: gallatin, hselasky Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D27272 Added: head/share/man/man4/ktls.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/tcp.4 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Nov 25 22:53:21 2020 (r368039) +++ head/share/man/man4/Makefile Wed Nov 25 23:17:23 2020 (r368040) @@ -250,6 +250,7 @@ MAN= aac.4 \ kld.4 \ ksyms.4 \ ksz8995ma.4 \ + ktls.4 \ ktr.4 \ kue.4 \ lagg.4 \ Added: head/share/man/man4/ktls.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ktls.4 Wed Nov 25 23:17:23 2020 (r368040) @@ -0,0 +1,264 @@ +.\" Copyright (c) 2020, Chelsio Inc +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright notice, +.\" this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" 3. Neither the name of the Chelsio Inc nor the names of its +.\" contributors may be used to endorse or promote products derived from +.\" this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. +.\" +.\" * Other names and brands may be claimed as the property of others. +.\" +.\" $FreeBSD$ +.\" +.Dd November 25, 2020 +.Dt KTLS 4 +.Os +.Sh NAME +.Nm ktls +.Nd kernel Transport Layer Security +.Sh SYNOPSIS +.Cd options KERN_TLS +.Sh DESCRIPTION +The +.Nm +facility allows the kernel to perform Transport Layer Security (TLS) +framing on TCP sockets. +With +.Nm , +the initial handshake for a socket using TLS is performed in userland. +Once the session keys are negotiated, +they are provided to the kernel via the +.Dv TCP_TXTLS_ENABLE +and +.Dv TCP_RXTLS_ENABLE +socket options. +Both socket options accept a +.Vt struct tls_so_enable +structure as their argument. +The members of this structure describe the cipher suite used for the +TLS session and provide the session keys used for the respective +direction. +.Pp +.Nm +only permits the session keys to be set once in each direction. +As a result, +applications must disable rekeying when using +.Nm . +.Ss Modes +.Nm +can operate in different modes. +A given socket may use different modes for transmit and receive, +or a socket may only offload a single direction. +The available modes are: +.Bl -tag -width "Dv TCP_TLS_MODE_IFNET" +.It Dv TCP_TLS_MODE_NONE +.Nm +is not enabled. +.It Dv TCP_TLS_MODE_SW +TLS records are encrypted or decrypted in the kernel in the socket +layer. +Typically the encryption or decryption is performred in software, +but it may also be performed by co-processors via +.Xr crypto 9 . +.It Dv TCP_TLS_MODE_IFNET +TLS records are encrypted or decrypted by the network interface card (NIC). +In this mode, the network stack does not work with encrypted data. +Instead, the NIC is encrypts TLS records as they are being transmitted, +or decrypts received TLS records before providing them to the host. +.Pp +Network interfaces which support this feature will advertise the +.Dv TXTLS4 +(for IPv4) +and/or +.Dv TXTLS6 +(for IPv6) +capabilities as reported by +.Xr ifconfig 8 . +These capabilities can also be controlled by +.Xr ifconfig 8 . +.Pp +If a network interface supports rate limiting +(also known as packet pacing) for TLS offload, +the interface will advertise the +.Dv TXTLS_RTLMT +capability. +.It Dv TCP_TLS_MODE_TOE +TLS records are encrypted by the NIC using a TCP offload engine (TOE). +This is similar to +.Dv TCP_TLS_MODE_IFNET +in that the network stack does not work with encrypted data. +However, this mode works in tandem with a TOE to handle interactions +between TCP and TLS. +.El +.Ss Transmit +Once TLS transmit is enabled by a successful set of the +.Dv TCP_TXTLS_ENABLE +socket option, +all data written on the socket is stored in TLS records and encrypted. +Most data is transmitted in application layer TLS records, +and the kernel chooses how to partition data among TLS records. +Individual TLS records with a fixed length and record type can be sent +by +.Xr sendmsg 2 +with the TLS record type set in a +.Dv TLS_SET_RECORD_TYPE +control message. +The payload of this control message is a single byte holding the desired +TLS record type. +This can be used to send TLS records with a type other than +application data (for example, handshake messages) or to send +application data records with specific contents (for example, empty +fragments). +.Pp +TLS transmit requires the use of unmapped mbufs. +Unmapped mbufs are not enabled by default, but can be enabled by +setting the +.Va kern.ipc.mb_use_ext_pgs +sysctl node to 1. +.Pp +The current TLS transmit mode of a socket can be queried via the +.Dv TCP_TXTLS_MODE +socket option. +A socket using TLS transmit offload can also set the +.Dv TCP_TXTLS_MODE +socket option to toggle between +.Dv TCP_TLS_MODE_SW +and +.Dv TCP_TLS_MODE_IFNET . +.Ss Receive +Once TLS receive is enabled by a successful set of the +.Dv TCP_RXTLS_ENABLE +socket option, +all data read from the socket is returned as decrypted TLS records. +Each received TLS record must be read from the socket using +.Xr recvmsg 2 . +Each received TLS record will contain a +.Dv TLS_GET_RECORD +control message along with the decrypted payload. +The control message contains a +.Vt struct tls_get_record +which includes fields from the TLS record header. +If an invalid or corrupted TLS record is received, +recvmsg 2 +will fail with one of the following errors: +.Bl -tag -width Er +.It Bq Er EINVAL +The version fields in a TLS record's header did not match the version required +by the +.Vt struct tls_so_enable +structure used to enable in-kernel TLS. +.It Bq Er EMSGSIZE +A TLS record's length was either too small or too large. +.It Bq Er EMSGSIZE +The connection was closed after sending a truncated TLS record. +.It Bq Er EBADMSG +The TLS record failed to match the included authentication tag. +.El +.Pp +The current TLS receive mode of a socket can be queried via the +.Dv TCP_RXTLS_MODE +socket option. +At present, +the mode cannot be changed. +.Ss Sysctl Nodes +.Nm +uses several sysctl nodes under the +.Va kern.ipc.tls +node. +A few of them are described below: +.Bl -tag -width ".Va kern.ipc.tls.cbc_enable" +.It Va kern.ipc.tls.enable +Determines if new kernel TLS sessions can be created. +.It Va kern.ipc.tls.cbc_enable +Determines if new kernel TLS sessions with a cipher suite using AES-CBC +can be created. +.It Va kern.ipc.tls.sw +A tree of nodes containing statistics for TLS sessions using +.Dv TCP_TLS_MODE_SW . +.It Va kern.ipc.tls.ifnet +A tree of nodes containing statistics for TLS sessions using +.Dv TCP_TLS_MODE_IFNET . +.It Va kern.ipc.tls.toe +A tree of nodes containing statistics for TLS sessions using +.Dv TCP_TLS_MODE_TOE . +.It Va kern.ipc.tls.stats +A tree of nodes containing various kernel TLS statistics. +.El +.Ss Backends +The base system includes a software backend for the +.Dv TCP_TLS_MODE_SW +mode which uses +.Xr crypto 9 +to encrypt and decrypt TLS records. +This backend can be enabled by loading the +.Pa ktls_ocf.ko +kernel module. +.Pp +The +.Xr cxgbe 4 +and +.Xr mlx5en 4 +drivers include support for the +.Dv TCP_TLS_MODE_IFNET +mode. +.Pp +The +.Xr cxgbe 4 +driver includes support for the +.Dv TCP_TLS_MODE_TOE +mode. +.Ss Supported Libraries +OpenSSL 3.0 and later include support for +.Nm . +The +.Fa devel/openssl +port may also be built with support for +.Nm +by enabling the +.Dv KTLS +option . +.Pp +Applications using a supported library should generally work with +.Nm +without any changes provided they use standard interfaces such as +.Xr SSL_read 3 +and +.Xr SSL_write 3 . +Additional performance may be gained by the use of +.Xr SSL_sendfile 3 . +.Sh IMPLEMENTATION NOTES +.Nm +assumes the presence of a direct map of physical memory when performing +software encryption and decryption. +As a result, it is only supported on architectures with a direct map. +.Sh SEE ALSO +.Xr cxgbe 4 , +.Xr mlx5en 4 , +.Xr tcp 4 , +.Xr ifconfig 8 , +.Xr sysctl 8 , +.Xr crypto 9 +.Sh HISTORY +Kernel TLS first appeared in +.Fx 13.0 . Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Wed Nov 25 22:53:21 2020 (r368039) +++ head/share/man/man4/tcp.4 Wed Nov 25 23:17:23 2020 (r368040) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd July 23, 2020 +.Dd November 25, 2020 .Dt TCP 4 .Os .Sh NAME @@ -300,88 +300,22 @@ Each dropped segment is taken into account in the TCP .It Dv TCP_TXTLS_ENABLE Enable in-kernel Transport Layer Security (TLS) for data written to this socket. -The -.Vt struct tls_so_enable -argument defines the encryption and authentication algorithms and keys -used to encrypt the socket data as well as the maximum TLS record -payload size. -.Pp -All data written to this socket will be encapsulated in TLS records -and subsequently encrypted. -By default all data written to this socket is treated as application data. -Individual TLS records with a type other than application data -(for example, handshake messages), -may be transmitted by invoking -.Xr sendmsg 2 -with a custom TLS record type set in a -.Dv TLS_SET_RECORD_TYPE -control message. -The payload of this control message is a single byte holding the desired -TLS record type. -.Pp -At present, only a single transmit key may be set on a socket. -As such, users of this option must disable rekeying. +See +.Xr ktls 4 +for more details. .It Dv TCP_TXTLS_MODE The integer argument can be used to get or set the current TLS transmit mode of a socket. -Setting the mode can only used to toggle between software and NIC TLS after -TLS has been initially enabled via the -.Dv TCP_TXTLS_ENABLE -option. -The available modes are: -.Bl -tag -width "Dv TCP_TLS_MODE_IFNET" -.It Dv TCP_TLS_MODE_NONE -In-kernel TLS framing and encryption is not enabled for this socket. -.It Dv TCP_TLS_MODE_SW -TLS records are encrypted by the kernel prior to placing the data in the -socket buffer. -Typically this encryption is performed in software. -.It Dv TCP_TLS_MODE_IFNET -TLS records are encrypted by the network interface card (NIC). -.It Dv TCP_TLS_MODE_TOE -TLS records are encrypted by the NIC using a TCP offload engine (TOE). -.El +See +.Xr ktls 4 +for more details. .It Dv TCP_RXTLS_ENABLE Enable in-kernel TLS for data read from this socket. -The -.Vt struct tls_so_enable -argument defines the encryption and authentication algorithms and keys -used to decrypt the socket data. -.Pp -Each received TLS record must be read from the socket using -.Xr recvmsg 2 . -Each received TLS record will contain a -.Dv TLS_GET_RECORD -control message along with the decrypted payload. -The control message contains a -.Vt struct tls_get_record -which includes fields from the TLS record header. -If an invalid or corrupted TLS record is received, -recvmsg 2 -will fail with one of the following errors: -.Bl -tag -width Er -.It Bq Er EINVAL -The version fields in a TLS record's header did not match the version required -by the -.Vt struct tls_so_enable -structure used to enable in-kernel TLS. -.It Bq Er EMSGSIZE -A TLS record's length was either too small or too large. -.It Bq Er EMSGSIZE -The connection was closed after sending a truncated TLS record. -.It Bq Er EBADMSG -The TLS record failed to match the included authentication tag. +See +.Xr ktls 4 +for more details. .El .Pp -At present, only a single receive key may be set on a socket. -As such, users of this option must disable rekeying. -.It Dv TCP_RXTLS_MODE -The integer argument can be used to get the current TLS receive mode -of a socket. -The available modes are the same as for -.Dv TCP_TXTLS_MODE . -.El -.Pp The option level for the .Xr setsockopt 2 call is the protocol number for @@ -770,6 +704,7 @@ when trying to use a TCP function block that is not av .Xr inet 4 , .Xr intro 4 , .Xr ip 4 , +.Xr ktls 4 , .Xr mod_cc 4 , .Xr siftr 4 , .Xr syncache 4 , From owner-svn-src-all@freebsd.org Wed Nov 25 23:19:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B454476ACA; Wed, 25 Nov 2020 23:19:03 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChGzq19skz4c0k; Wed, 25 Nov 2020 23:19:03 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B4E5192F9; Wed, 25 Nov 2020 23:19:03 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0APNJ2br030343; Wed, 25 Nov 2020 23:19:02 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0APNJ2sT030338; Wed, 25 Nov 2020 23:19:02 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <202011252319.0APNJ2sT030338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Wed, 25 Nov 2020 23:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368041 - in head: stand/efi/loader sys/amd64/amd64 sys/amd64/include sys/conf X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: in head: stand/efi/loader sys/amd64/amd64 sys/amd64/include sys/conf X-SVN-Commit-Revision: 368041 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 23:19:03 -0000 Author: sobomax Date: Wed Nov 25 23:19:01 2020 New Revision: 368041 URL: https://svnweb.freebsd.org/changeset/base/368041 Log: Unobfuscate "KERNLOAD" parameter on amd64. This change lines-up amd64 with the i386 and the rest of supported architectures by defining KERNLOAD in the vmparam.h and getting rid of magic constant in the linker script, which albeit documented via comment but isn't programmatically accessible at a compile time. Use KERNLOAD to eliminate another (matching) magic constant 100 lines down inside unremarkable TU "copy.c" 3 levels deep in the EFI loader tree. Reviewed by: markj Approved by: markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D27355 Modified: head/stand/efi/loader/copy.c head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/locore.S head/sys/amd64/include/vmparam.h head/sys/conf/ldscript.amd64 Modified: head/stand/efi/loader/copy.c ============================================================================== --- head/stand/efi/loader/copy.c Wed Nov 25 23:17:23 2020 (r368040) +++ head/stand/efi/loader/copy.c Wed Nov 25 23:19:01 2020 (r368041) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #if defined(__i386__) || defined(__amd64__) #include #include +#include /* * The code is excerpted from sys/x86/x86/identcpu.c: identify_cpu(), @@ -89,8 +90,6 @@ running_on_hyperv(void) return (1); } -#define KERNEL_PHYSICAL_BASE (2*1024*1024) - static void efi_verify_staging_size(unsigned long *nr_pages) { @@ -134,12 +133,11 @@ efi_verify_staging_size(unsigned long *nr_pages) start = p->PhysicalStart; end = start + p->NumberOfPages * EFI_PAGE_SIZE; - if (KERNEL_PHYSICAL_BASE < start || - KERNEL_PHYSICAL_BASE >= end) + if (KERNLOAD < start || KERNLOAD >= end) continue; available_pages = p->NumberOfPages - - ((KERNEL_PHYSICAL_BASE - start) >> EFI_PAGE_SHIFT); + ((KERNLOAD - start) >> EFI_PAGE_SHIFT); break; } Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Wed Nov 25 23:17:23 2020 (r368040) +++ head/sys/amd64/amd64/genassym.c Wed Nov 25 23:19:01 2020 (r368041) @@ -115,6 +115,7 @@ ASSYM(val_KPML4I, KPML4I); ASSYM(val_PML4PML4I, PML4PML4I); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); ASSYM(KERNBASE, KERNBASE); +ASSYM(KERNLOAD, KERNLOAD); ASSYM(DMAP_MIN_ADDRESS, DMAP_MIN_ADDRESS); ASSYM(DMAP_MAX_ADDRESS, DMAP_MAX_ADDRESS); Modified: head/sys/amd64/amd64/locore.S ============================================================================== --- head/sys/amd64/amd64/locore.S Wed Nov 25 23:17:23 2020 (r368040) +++ head/sys/amd64/amd64/locore.S Wed Nov 25 23:19:01 2020 (r368041) @@ -36,8 +36,9 @@ /* * Compiled KERNBASE location */ - .globl kernbase, loc_PTmap, loc_PDmap, loc_PDPmap, dmapbase, dmapend + .globl kernbase, kernload, loc_PTmap, loc_PDmap, loc_PDPmap, dmapbase, dmapend .set kernbase,KERNBASE + .set kernload,KERNLOAD .set dmapbase,DMAP_MIN_ADDRESS .set dmapend,DMAP_MAX_ADDRESS Modified: head/sys/amd64/include/vmparam.h ============================================================================== --- head/sys/amd64/include/vmparam.h Wed Nov 25 23:17:23 2020 (r368040) +++ head/sys/amd64/include/vmparam.h Wed Nov 25 23:19:01 2020 (r368041) @@ -149,6 +149,14 @@ #endif /* + * Kernel physical load address. Needs to be aligned at 2MB superpage + * boundary. + */ +#ifndef KERNLOAD +#define KERNLOAD 0x200000 +#endif + +/* * Virtual addresses of things. Derived from the page directory and * page table indexes from pmap.h for precision. * Modified: head/sys/conf/ldscript.amd64 ============================================================================== --- head/sys/conf/ldscript.amd64 Wed Nov 25 23:17:23 2020 (r368040) +++ head/sys/conf/ldscript.amd64 Wed Nov 25 23:19:01 2020 (r368041) @@ -5,8 +5,8 @@ ENTRY(btext) SEARCH_DIR("/usr/lib"); SECTIONS { + kernphys = kernload; /* Read-only sections, merged into text segment: */ - kernphys = 0x200000; /* 2MB superpage size */ . = kernbase + kernphys + SIZEOF_HEADERS; /* * Use the AT keyword in order to set the right LMA that contains From owner-svn-src-all@freebsd.org Thu Nov 26 01:40:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B05B247BC48; Thu, 26 Nov 2020 01:40:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChL6Z4fSSz4mDL; Thu, 26 Nov 2020 01:40:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9209B1B230; Thu, 26 Nov 2020 01:40:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQ1e6qI018384; Thu, 26 Nov 2020 01:40:06 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQ1e5Lm018377; Thu, 26 Nov 2020 01:40:05 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202011260140.0AQ1e5Lm018377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 26 Nov 2020 01:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368042 - in head: share/doc/legal share/doc/legal/imx sys/arm/freescale/imx sys/contrib/dev/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head: share/doc/legal share/doc/legal/imx sys/arm/freescale/imx sys/contrib/dev/imx X-SVN-Commit-Revision: 368042 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 01:40:06 -0000 Author: ian Date: Thu Nov 26 01:40:04 2020 New Revision: 368042 URL: https://svnweb.freebsd.org/changeset/base/368042 Log: Add the firmware blob required to use the sdma hardware in the imx6 processor, and its associated license text (which is similar to a bsd-3-clause, but with a prohibition against decompiling). Install a copy of the license in /usr/share/doc/legal/imx, to comply with the license terms that requires a copy of the license to be delivered along with the firmware. Obtained from: https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/imx/sdma/sdma-imx6q.bin https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/LICENSE.sdma_firmware Added: head/share/doc/legal/Makefile.armv7 (contents, props changed) head/share/doc/legal/imx/ head/share/doc/legal/imx/Makefile (contents, props changed) head/sys/contrib/dev/imx/ head/sys/contrib/dev/imx/LICENSE head/sys/contrib/dev/imx/sdma-imx6q.bin.uu Modified: head/share/doc/legal/Makefile head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/imx6_sdma.c Modified: head/share/doc/legal/Makefile ============================================================================== --- head/share/doc/legal/Makefile Wed Nov 25 23:19:01 2020 (r368041) +++ head/share/doc/legal/Makefile Thu Nov 26 01:40:04 2020 (r368042) @@ -8,4 +8,5 @@ SUBDIR= intel_ipw \ SUBDIR_PARALLEL= +.include .include Added: head/share/doc/legal/Makefile.armv7 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/doc/legal/Makefile.armv7 Thu Nov 26 01:40:04 2020 (r368042) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SUBDIR += imx Added: head/share/doc/legal/imx/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/doc/legal/imx/Makefile Thu Nov 26 01:40:04 2020 (r368042) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +FILES= ${SRCTOP}/sys/contrib/dev/imx/LICENSE +FILESDIR= ${SHAREDIR}/doc/legal +FILESNAME= sdma-imx6q.LICENSE + +.include Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Wed Nov 25 23:19:01 2020 (r368041) +++ head/sys/arm/freescale/imx/files.imx6 Thu Nov 26 01:40:04 2020 (r368042) @@ -20,7 +20,7 @@ arm/freescale/imx/imx_i2c.c optional fsliic arm/freescale/imx/imx_spi.c optional imx_spi arm/freescale/imx/imx6_sdma.c optional fslsdma arm/freescale/imx/imx6_audmux.c optional sound -arm/freescale/imx/imx6_ssi.c optional sound +arm/freescale/imx/imx6_ssi.c optional sound fslsdma arm/freescale/imx/imx6_ahci.c optional ahci dev/hdmi/dwc_hdmi.c optional hdmi @@ -47,23 +47,18 @@ arm/freescale/imx/imx6_usbphy.c optional ehci # #arm/freescale/imx/imx_console.c standard -# -# Not ready yet... -# -#arm/freescale/imx/imx51_ipuv3.c optional sc - -# SDMA firmware -sdma_fw.c optional sdma_fw \ - compile-with "${AWK} -f $S/tools/fw_stub.awk sdma-imx6q-to1.bin:sdma_fw -msdma -c${.TARGET}" \ +# SDMA firmware. +sdma-imx6q.c optional fslsdma \ + compile-with "${AWK} -f $S/tools/fw_stub.awk sdma-imx6q.bin:sdma-imx6q -msdma -c${.TARGET}" \ no-implicit-rule before-depend local \ - clean "sdma_fw.c" -sdma-imx6q-to1.fwo optional sdma_fw \ - dependency "sdma-imx6q-to1.bin" \ - compile-with "${LD} -m ${LD_EMULATION} -b binary -d -warn-common -r -d -o ${.TARGET} sdma-imx6q-to1.bin" \ + clean "sdma-imx6q.c" +sdma-imx6q.fwo optional fslsdma \ + dependency "sdma-imx6q.bin" \ + compile-with "${LD} -m ${LD_EMULATION} -b binary -d -warn-common -r -d -o ${.TARGET} sdma-imx6q.bin" \ no-implicit-rule \ - clean "sdma-imx6q-to1.fwo" -sdma-imx6q-to1.bin optional sdma_fw \ - dependency "$S/contrib/dev/imx/sdma-imx6q-to1.bin.uu" \ - compile-with "uudecode < $S/contrib/dev/imx/sdma-imx6q-to1.bin.uu" \ + clean "sdma-imx6q.fwo" +sdma-imx6q.bin optional fslsdma \ + dependency "$S/contrib/dev/imx/sdma-imx6q.bin.uu" \ + compile-with "uudecode < $S/contrib/dev/imx/sdma-imx6q.bin.uu" \ no-obj no-implicit-rule \ - clean "sdma-imx6q-to1.bin" + clean "sdma-imx6q.bin" Modified: head/sys/arm/freescale/imx/imx6_sdma.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_sdma.c Wed Nov 25 23:19:01 2020 (r368041) +++ head/sys/arm/freescale/imx/imx6_sdma.c Thu Nov 26 01:40:04 2020 (r368042) @@ -358,7 +358,7 @@ load_firmware(struct sdma_softc *sc) const struct sdma_firmware_header *header; const struct firmware *fp; - fp = firmware_get("sdma_fw"); + fp = firmware_get("sdma-imx6q"); if (fp == NULL) { device_printf(sc->dev, "Can't get firmware.\n"); return (-1); Added: head/sys/contrib/dev/imx/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/imx/LICENSE Thu Nov 26 01:40:04 2020 (r368042) @@ -0,0 +1,47 @@ +Copyright 2017, NXP +All rights reserved. + +Redistribution. Reproduction and redistribution in binary form, without +modification, for use solely in conjunction with a NXP +chipset, is permitted provided that the following conditions are met: + + . Redistributions must reproduce the above copyright notice and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + . Neither the name of NXP nor the names of its suppliers + may be used to endorse or promote products derived from this Software + without specific prior written permission. + + . No reverse engineering, decompilation, or disassembly of this Software is + permitted. + +Limited patent license. NXP (.Licensor.) grants you +(.Licensee.) a limited, worldwide, royalty-free, non-exclusive license under +the Patents to make, have made, use, import, offer to sell and sell the +Software. No hardware per se is licensed hereunder. +The term .Patents. as used in this agreement means only those patents or patent +applications owned solely and exclusively by Licensor as of the date of +Licensor.s submission of the Software and any patents deriving priority (i.e., +having a first effective filing date) therefrom. The term .Software. as used in +this agreement means the firmware image submitted by Licensor, under the terms +of this license, to git://git.kernel.org/pub/scm/linux/kernel/git/firmware/ +linux-firmware.git. +Notwithstanding anything to the contrary herein, Licensor does not grant and +Licensee does not receive, by virtue of this agreement or the Licensor's +submission of any Software, any license or other rights under any patent or +patent application owned by any affiliate of Licensor or any other entity +(other than Licensor), whether expressly, impliedly, by virtue of estoppel or +exhaustion, or otherwise. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. Added: head/sys/contrib/dev/imx/sdma-imx6q.bin.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/imx/sdma-imx6q.bin.uu Thu Nov 26 01:40:04 2020 (r368042) @@ -0,0 +1,100 @@ +Copyright 2017, NXP +All rights reserved. + +Redistribution. Reproduction and redistribution in binary form, without +modification, for use solely in conjunction with a NXP +chipset, is permitted provided that the following conditions are met: + + . Redistributions must reproduce the above copyright notice and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + . Neither the name of NXP nor the names of its suppliers + may be used to endorse or promote products derived from this Software + without specific prior written permission. + + . No reverse engineering, decompilation, or disassembly of this Software is + permitted. + +Limited patent license. NXP (.Licensor.) grants you +(.Licensee.) a limited, worldwide, royalty-free, non-exclusive license under +the Patents to make, have made, use, import, offer to sell and sell the +Software. No hardware per se is licensed hereunder. +The term .Patents. as used in this agreement means only those patents or patent +applications owned solely and exclusively by Licensor as of the date of +Licensor.s submission of the Software and any patents deriving priority (i.e., +having a first effective filing date) therefrom. The term .Software. as used in +this agreement means the firmware image submitted by Licensor, under the terms +of this license, to git://git.kernel.org/pub/scm/linux/kernel/git/firmware/ +linux-firmware.git. +Notwithstanding anything to the contrary herein, Licensor does not grant and +Licensee does not receive, by virtue of this agreement or the Licensor's +submission of any Software, any license or other rights under any patent or +patent application owned by any affiliate of Licensor or any other entity +(other than Licensor), whether expressly, impliedly, by virtue of estoppel or +exhaustion, or otherwise. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + +begin 644 sdma-imx6q.bin +M4T1-00,````#````'````"D```#`````U`<``(("``#_________________ +M____________________________________0AH``/_____K`@``M!@``/__ +M__^>&@``_____\`#``#_______________^K`@``_____WL#``#_________ +M_TP$``!N!```__________________________\`&```6Q@``.X9``!-&P`` +MZ!H``(0;````&```X\';5_-2`6K[4M-J^U(<&L-JZ&(1`O\Z,`C0`C]\CP`_ +M`-4``7V-`*`%ZUUX!`-]>00005?.Y68`8%?0EE,WX*8C%^*9@*8BY^ +M"64L?A(%$@6M`LAJ)W\#(`!([7Q!F`)X"6+(:D"8%0`">`IBR&I`F!4`%0`" +M>`MBR&H4?-]M$G]_!PE]^U($&L-JTVK(8@0JR&K[4M-J``#K50!-!WWZP=M7 +M!I@'`,QH#&@3P@K"`9C9P>/!VU?C7^-7\U(A:H\`U0`!?8T`H`7K7?M6>`0# +M?7D$*GTQ?'D$('QP"Q$#ZU,`#V`#!7T)93=^"F(U?G^8"F(R?@EE,'X2!1(% +MK0)@!P)]!EJ'F"9:)W\!'P,@`$CH?'`+$0,34ZB8%0`$>`EB!EH)8B9:IY@5 +M`!4`!'@*8@9:"F(F6J>8%0`5`!4`!'@+8@9:"V(F6@=\``#K50!-!GWZP>-7 +M8I@'``QH$\(*PE^8<`L1`Q-3;`VUG36(\!$`$/ +M.8L`/,$K?M=CP(2`A("_SK:!0)\/@<3F:0" +MW0("?3X'$YE>!Q.9ZU4`30)\F`7K7?-2^U1J!SA];``)5 +M!%TB501=/YD5``1X`E4$70)5)%T=?`!."'QI!P-]`E47?DF9!%T4?XD&DU`` +M2`%](IG5F14`!G@"501=3P<"521=+PZ8 +M:0<$?6@'`GT!#G"9DUC6``%]C@"35:`%DUV@!FT'!WUN!PU]TVP">`)5R&V( +MF14`TVP$>`)5R&TB5,=JR&4$7,AE +M!%W(921=#WP`3@A\:0<#?00I?1]\>00N +M?.-=<`T1!>U5``]@!P)]!E(*FB92,WY@!0)]$`(2`@EJ+7\2`@EJ*G\2`@EJ +M)W\!'P,@`$CJ?.-5-9H5`!4`%0`$>`92"VHF4@MJ-)H5`!4`!'@&4@IJ)E(* +M:C2:%0`$>`92"6HF4@EJ"7PH:@=_``#;5P!-!7WZP=M7\YEWPE0$"L+PF>/! +MVU?S4@5J^U:.`I0:PVK(8FD")GV4'L-NTV[(8@$*$0+(:I0FF![#;LABF";# +M;F`"#WV8'L-NR&)L`@-]F";#;H&:$`H1`M-NR&J8)L-ND9K(8FV:"6H8?P$E +M`$T??56:XVZ/`-@%`7V-`,AB"6H,?P$E`2#Z?-M7`$T0?2AJ!'\``/K!VU=& +MF@<`!&(,:HZ:*&KZ?P1B>L)8!%0$_P@1`/\8O`#-``%\@9HH:NU_!&)ZP@K" +M0YK9P>/!VU?S4@5J^U:.`I0:`E)I`AU]E!X&4D@"!EJ4)I@>!E),`@9:F":8 +M'@928`(*?)@F!E)N`B-]"6H=?P$E`$TD?;.:*&H7?P1B>L+DFH\`V`4!?8T` +MH`4&4FX"$'T):@I_`2#Y?"AJ!G\```!-#7WZP=M7HYH'``1B#&KAFBAJ^G\$ +M8GK"6`14!"AJ]'\*PJ":+-O;5_-2!6K':8\`U0`!?8T`H`5X!`-]>0000>?.Y6R&(H?F`&`GT0`A(""6HB?Q(""6H??Q(""6H,AB"FH:FP)XR&():@E\*&H'?P!-!WW34@$(`E@`!.R: +M=\)4!--2`0@"6`$$1-OIFG`+$0,34]M?"@?36(L`^UX\P15]P%K(6T[!$7R( +M`_!=_PT1!?\=O`4`301]0YL(!]M?"@>+`,-2RU-9P>Q]``(TFP%N"V$O?@MB +M+7X+8RM^#`T7!!<$%P2=!`@=S`4!?`P-T6H`#T('R&_=;QQ_C@"=``%H"V<7 +M?M5K!`@">,AO$@<1?`MG#WX$"`)XR&\2!PI\W6\(?]%I`0_(;]UO`W\!`0`$ +M69L'`/]H#&@``EF;R=O;5_-2!6K[4L=JCP#5``%]C0"@!7@$`WUY!!Q]%7QY +M!!Y\[E;(8BA^8`8"?1`"$@():B)_$@():A]_$@():AQ_`R``2.]\N)L5`!4` +M`GC(8@MJMYL5``)XR&(*:K>;`GC(8@EJ"7PH:@=_`$T'?=-2`0@"6``$B)MW +MPE0$TU(!"`)8`03AVX6;<`L1`Q-3VU\*!]-8BP#[7CS!%7W`6LA;3L$1?(@# +D\%W_#1$%_QV\!0!-!'W@FP@'VU\*!XL`PU++4UG!['T``M&; +` +end From owner-svn-src-all@freebsd.org Thu Nov 26 01:59:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20A2547C88F; Thu, 26 Nov 2020 01:59:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChLYG0WQTz4nGK; Thu, 26 Nov 2020 01:59:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 048921B62F; Thu, 26 Nov 2020 01:59:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQ1xjTQ030487; Thu, 26 Nov 2020 01:59:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQ1xiAr030481; Thu, 26 Nov 2020 01:59:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011260159.0AQ1xiAr030481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 26 Nov 2020 01:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368043 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 368043 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 01:59:46 -0000 Author: mav Date: Thu Nov 26 01:59:44 2020 New Revision: 368043 URL: https://svnweb.freebsd.org/changeset/base/368043 Log: Remove some more dead code from pre-24xx. Modified: head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_library.c head/sys/dev/isp/isp_library.h head/sys/dev/isp/isp_target.c head/sys/dev/isp/isp_target.h head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Thu Nov 26 01:40:04 2020 (r368042) +++ head/sys/dev/isp/isp_freebsd.c Thu Nov 26 01:59:44 2020 (r368043) @@ -1794,16 +1794,6 @@ isp_handle_platform_target_notify_ack(ispsoftc_t *isp, } /* - * Handle logout cases here - */ - if (mp->nt_ncode == NT_GLOBAL_LOGOUT) { - isp_del_all_wwn_entries(isp, mp->nt_channel); - } - - if (mp->nt_ncode == NT_LOGOUT) - isp_del_wwn_entries(isp, mp); - - /* * General purpose acknowledgement */ if (mp->nt_need_ack) { @@ -2889,15 +2879,6 @@ isp_async(ispsoftc_t *isp, ispasync_t cmd, ...) va_list ap; switch (cmd) { - case ISPASYNC_BUS_RESET: - { - va_start(ap, cmd); - bus = va_arg(ap, int); - va_end(ap); - isp_prt(isp, ISP_LOGINFO, "SCSI bus reset on bus %d detected", bus); - xpt_async(AC_BUS_RESET, ISP_FC_PC(isp, bus)->path, NULL); - break; - } case ISPASYNC_LOOP_RESET: { uint16_t lipp; @@ -3141,7 +3122,6 @@ isp_async(ispsoftc_t *isp, ispasync_t cmd, ...) */ isp_handle_platform_target_tmf(isp, notify); break; - case NT_BUS_RESET: case NT_LIP_RESET: case NT_LINK_UP: case NT_LINK_DOWN: @@ -3149,13 +3129,6 @@ isp_async(ispsoftc_t *isp, ispasync_t cmd, ...) /* * No action need be taken here. */ - break; - case NT_GLOBAL_LOGOUT: - case NT_LOGOUT: - /* - * This is device arrival/departure notification - */ - isp_handle_platform_target_notify_ack(isp, notify, 0); break; case NT_SRR: isp_handle_platform_srr(isp, notify); Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Thu Nov 26 01:40:04 2020 (r368042) +++ head/sys/dev/isp/isp_library.c Thu Nov 26 01:59:44 2020 (r368043) @@ -1656,82 +1656,6 @@ isp_del_wwn_entry(ispsoftc_t *isp, int chan, uint64_t } void -isp_del_all_wwn_entries(ispsoftc_t *isp, int chan) -{ - fcparam *fcp; - int i; - - /* - * Handle iterations over all channels via recursion - */ - if (chan == ISP_NOCHAN) { - for (chan = 0; chan < isp->isp_nchan; chan++) { - isp_del_all_wwn_entries(isp, chan); - } - return; - } - - if (chan > isp->isp_nchan) { - return; - } - - fcp = FCPARAM(isp, chan); - if (fcp == NULL) { - return; - } - for (i = 0; i < MAX_FC_TARG; i++) { - fcportdb_t *lp = &fcp->portdb[i]; - - if (lp->state != FC_PORTDB_STATE_NIL) - isp_del_wwn_entry(isp, chan, lp->port_wwn, lp->handle, lp->portid); - } -} - -void -isp_del_wwn_entries(ispsoftc_t *isp, isp_notify_t *mp) -{ - fcportdb_t *lp; - - /* - * Handle iterations over all channels via recursion - */ - if (mp->nt_channel == ISP_NOCHAN) { - for (mp->nt_channel = 0; mp->nt_channel < isp->isp_nchan; mp->nt_channel++) { - isp_del_wwn_entries(isp, mp); - } - mp->nt_channel = ISP_NOCHAN; - return; - } - - /* - * We have an entry which is only partially identified. - * - * It's only known by WWN, N-Port handle, or Port ID. - * We need to find the actual entry so we can delete it. - */ - if (mp->nt_nphdl != NIL_HANDLE) { - if (isp_find_pdb_by_handle(isp, mp->nt_channel, mp->nt_nphdl, &lp)) { - isp_del_wwn_entry(isp, mp->nt_channel, lp->port_wwn, lp->handle, lp->portid); - return; - } - } - if (VALID_INI(mp->nt_wwn)) { - if (isp_find_pdb_by_wwpn(isp, mp->nt_channel, mp->nt_wwn, &lp)) { - isp_del_wwn_entry(isp, mp->nt_channel, lp->port_wwn, lp->handle, lp->portid); - return; - } - } - if (VALID_PORT(mp->nt_sid)) { - if (isp_find_pdb_by_portid(isp, mp->nt_channel, mp->nt_sid, &lp)) { - isp_del_wwn_entry(isp, mp->nt_channel, lp->port_wwn, lp->handle, lp->portid); - return; - } - } - isp_prt(isp, ISP_LOGWARN, "Chan %d unable to find entry to delete WWPN 0x%016jx PortID 0x%06x handle 0x%x", - mp->nt_channel, mp->nt_wwn, mp->nt_sid, mp->nt_nphdl); -} - -void isp_get_atio7(ispsoftc_t *isp, at7_entry_t *src, at7_entry_t *dst) { ISP_IOXGET_8(isp, &src->at_type, dst->at_type); Modified: head/sys/dev/isp/isp_library.h ============================================================================== --- head/sys/dev/isp/isp_library.h Thu Nov 26 01:40:04 2020 (r368042) +++ head/sys/dev/isp/isp_library.h Thu Nov 26 01:59:44 2020 (r368043) @@ -162,8 +162,6 @@ int isp_find_pdb_by_portid(ispsoftc_t *, int, uint32_t void isp_find_chan_by_did(ispsoftc_t *, uint32_t, uint16_t *); void isp_add_wwn_entry(ispsoftc_t *, int, uint64_t, uint64_t, uint16_t, uint32_t, uint16_t); void isp_del_wwn_entry(ispsoftc_t *, int, uint64_t, uint16_t, uint32_t); -void isp_del_all_wwn_entries(ispsoftc_t *, int); -void isp_del_wwn_entries(ispsoftc_t *, isp_notify_t *); void isp_get_atio7(ispsoftc_t *isp, at7_entry_t *, at7_entry_t *); void isp_put_ctio7(ispsoftc_t *, ct7_entry_t *, ct7_entry_t *); Modified: head/sys/dev/isp/isp_target.c ============================================================================== --- head/sys/dev/isp/isp_target.c Thu Nov 26 01:40:04 2020 (r368042) +++ head/sys/dev/isp/isp_target.c Thu Nov 26 01:59:44 2020 (r368043) @@ -374,17 +374,6 @@ isp_target_async(ispsoftc_t *isp, int bus, int event) notify.nt_ncode = NT_LIP_RESET; isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); break; - case ASYNC_BUS_RESET: - case ASYNC_TIMEOUT_RESET: /* XXX: where does this come from ? */ - isp_prt(isp, ISP_LOGTDEBUG0, "%s: BUS RESET", __func__); - notify.nt_ncode = NT_BUS_RESET; - isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); - break; - case ASYNC_DEVICE_RESET: - isp_prt(isp, ISP_LOGTDEBUG0, "%s: DEVICE RESET", __func__); - notify.nt_ncode = NT_TARGET_RESET; - isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); - break; default: isp_prt(isp, ISP_LOGERR, "%s: unknown event 0x%x", __func__, event); break; @@ -819,6 +808,9 @@ isp_handle_notify_24xx(ispsoftc_t *isp, in_fcentry_24x wwpn = be64dec(&ptr[IN24XX_PRLI_WWPN_OFF]); isp_add_wwn_entry(isp, chan, wwpn, wwnn, nphdl, portid, prli_options); + break; + case TPRLO: + msg = "TPRLO"; break; case PDISC: msg = "PDISC"; Modified: head/sys/dev/isp/isp_target.h ============================================================================== --- head/sys/dev/isp/isp_target.h Thu Nov 26 01:40:04 2020 (r368042) +++ head/sys/dev/isp/isp_target.h Thu Nov 26 01:59:44 2020 (r368043) @@ -46,13 +46,9 @@ typedef enum { NT_CLEAR_TASK_SET, NT_LUN_RESET, NT_TARGET_RESET, - NT_BUS_RESET, NT_LIP_RESET, NT_LINK_UP, NT_LINK_DOWN, - NT_LOGOUT, - NT_GLOBAL_LOGOUT, - NT_CHANGED, NT_HBA_RESET, NT_QUERY_TASK_SET, NT_QUERY_ASYNC_EVENT, Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Thu Nov 26 01:40:04 2020 (r368042) +++ head/sys/dev/isp/ispvar.h Thu Nov 26 01:59:44 2020 (r368043) @@ -738,7 +738,6 @@ int isp_control(ispsoftc_t *, ispctl_t, ...); */ typedef enum { - ISPASYNC_BUS_RESET, /* All Bus Was Reset */ ISPASYNC_LOOP_DOWN, /* FC Loop Down */ ISPASYNC_LOOP_UP, /* FC Loop Up */ ISPASYNC_LIP, /* FC LIP Received */ From owner-svn-src-all@freebsd.org Thu Nov 26 02:14:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B8C147CCE1; Thu, 26 Nov 2020 02:14:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChLtj0bMcz4nqL; Thu, 26 Nov 2020 02:14:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 073371BB9D; Thu, 26 Nov 2020 02:14:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQ2Eq8O042624; Thu, 26 Nov 2020 02:14:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQ2Eqt3042621; Thu, 26 Nov 2020 02:14:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011260214.0AQ2Eqt3042621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 26 Nov 2020 02:14:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368044 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 368044 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 02:14:53 -0000 Author: mav Date: Thu Nov 26 02:14:52 2020 New Revision: 368044 URL: https://svnweb.freebsd.org/changeset/base/368044 Log: Some minor FCoE bits I had lying around. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_library.c head/sys/dev/isp/ispmbox.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Thu Nov 26 01:59:44 2020 (r368043) +++ head/sys/dev/isp/isp.c Thu Nov 26 02:14:52 2020 (r368044) @@ -3696,12 +3696,24 @@ isp_intr_async(ispsoftc_t *isp, uint16_t mbox) isp_prt(isp, ISP_LOGERR, "Temperature alert (subcode 0x%x)", ISP_READ(isp, OUTMAILBOX1)); break; + case ASYNC_INTER_DRIVER_COMP: + isp_prt(isp, ISP_LOGDEBUG0, "Inter-driver communication complete"); + break; + case ASYNC_INTER_DRIVER_NOTIFY: + isp_prt(isp, ISP_LOGDEBUG0, "Inter-driver communication notification"); + break; + case ASYNC_INTER_DRIVER_TIME_EXT: + isp_prt(isp, ISP_LOGDEBUG0, "Inter-driver communication time extended"); + break; case ASYNC_TRANSCEIVER_INSERTION: isp_prt(isp, ISP_LOGDEBUG0, "Transceiver insertion (0x%x)", ISP_READ(isp, OUTMAILBOX1)); break; case ASYNC_TRANSCEIVER_REMOVAL: isp_prt(isp, ISP_LOGDEBUG0, "Transceiver removal"); + break; + case ASYNC_NIC_FW_STATE_CHANGE: + isp_prt(isp, ISP_LOGDEBUG0, "NIC Firmware State Change"); break; case ASYNC_AUTOLOAD_FW_COMPLETE: isp_prt(isp, ISP_LOGDEBUG0, "Autoload FW init complete"); Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Thu Nov 26 01:59:44 2020 (r368043) +++ head/sys/dev/isp/isp_library.c Thu Nov 26 02:14:52 2020 (r368044) @@ -782,8 +782,8 @@ isp_put_icb_2400(ispsoftc_t *isp, isp_icb_2400_t *src, ISP_IOXPUT_16(isp, src->icb_qos, &dst->icb_qos); for (i = 0; i < 3; i++) ISP_IOXPUT_16(isp, src->icb_reserved2[i], &dst->icb_reserved2[i]); - for (i = 0; i < 3; i++) - ISP_IOXPUT_16(isp, src->icb_enodemac[i], &dst->icb_enodemac[i]); + for (i = 0; i < 6; i++) + ISP_IOXPUT_8(isp, src->icb_enodemac[i], &dst->icb_enodemac[i]); ISP_IOXPUT_16(isp, src->icb_disctime, &dst->icb_disctime); for (i = 0; i < 4; i++) ISP_IOXPUT_16(isp, src->icb_reserved3[i], &dst->icb_reserved3[i]); Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Thu Nov 26 01:59:44 2020 (r368043) +++ head/sys/dev/isp/ispmbox.h Thu Nov 26 02:14:52 2020 (r368044) @@ -805,7 +805,7 @@ typedef struct { uint32_t icb_fwoptions3; uint16_t icb_qos; uint16_t icb_reserved2[3]; - uint16_t icb_enodemac[3]; + uint8_t icb_enodemac[6]; uint16_t icb_disctime; uint16_t icb_reserved3[4]; } isp_icb_2400_t; From owner-svn-src-all@freebsd.org Thu Nov 26 04:29:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CA6747FC50; Thu, 26 Nov 2020 04:29:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChPt522CLz4v8s; Thu, 26 Nov 2020 04:29:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33C051D61A; Thu, 26 Nov 2020 04:29:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQ4TXK8023813; Thu, 26 Nov 2020 04:29:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQ4TV2B023801; Thu, 26 Nov 2020 04:29:31 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202011260429.0AQ4TV2B023801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 26 Nov 2020 04:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk X-SVN-Commit-Revision: 368045 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 04:29:33 -0000 Author: asomers Date: Thu Nov 26 04:29:30 2020 New Revision: 368045 URL: https://svnweb.freebsd.org/changeset/base/368045 Log: Merge ping6 to ping There is now a single ping binary, which chooses to use ICMP or ICMPv4 based on the -4 and -6 options, and the format of the address. Submitted by: Ján SuÄŤan Sponsored by: Google LLC (Google Summer of Code 2019) MFC after: Never Differential Revision: https://reviews.freebsd.org/D21377 Added: head/sbin/ping/main.c (contents, props changed) head/sbin/ping/main.h (contents, props changed) head/sbin/ping/ping.h (contents, props changed) head/sbin/ping/ping6.c - copied, changed from r368010, head/sbin/ping6/ping6.c head/sbin/ping/ping6.h (contents, props changed) head/sbin/ping/tests/ping_6_c1_s8_t1.out - copied unchanged from r368010, head/sbin/ping6/tests/ping6_c1_s8_t1.out Deleted: head/sbin/ping6/Makefile head/sbin/ping6/Makefile.depend head/sbin/ping6/ping6.8 head/sbin/ping6/ping6.c head/sbin/ping6/tests/Makefile head/sbin/ping6/tests/ping6_c1_s8_t1.out head/sbin/ping6/tests/ping6_test.sh Modified: head/ObsoleteFiles.inc head/UPDATING head/etc/mtree/BSD.tests.dist head/rescue/rescue/Makefile head/sbin/Makefile head/sbin/ping/Makefile head/sbin/ping/ping.8 head/sbin/ping/ping.c head/sbin/ping/tests/Makefile head/sbin/ping/tests/ping_test.sh head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Nov 26 02:14:52 2020 (r368044) +++ head/ObsoleteFiles.inc Thu Nov 26 04:29:30 2020 (r368045) @@ -36,6 +36,16 @@ # xargs -n1 | sort | uniq -d; # done +# 20201124: ping6(8) was merged into ping(8) +OLD_FILES+=sbin/ping6 +OLD_FILES+=rescue/ping6 +OLD_FILES+=usr/lib/debug/sbin/ping6.debug +OLD_FILES+=usr/share/man/man8/ping6.8.gz +OLD_FILES+=usr/tests/sbin/ping6/Kyuafile +OLD_FILES+=usr/tests/sbin/ping6/ping6_c1_s8_t1.out +OLD_FILES+=usr/tests/sbin/ping6/ping6_test +OLD_DIRS+=usr/tests/sbin/ping6 + # 20201025: Remove cal data files OLD_FILES+=usr/share/calendar/calendar.all OLD_FILES+=usr/share/calendar/calendar.australia Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Nov 26 02:14:52 2020 (r368044) +++ head/UPDATING Thu Nov 26 04:29:30 2020 (r368045) @@ -26,6 +26,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20201124: + ping6 has been merged into ping. It can now be called as "ping -6". + See ping(8) for details. + 20201108: Default value of net.add_addr_allfibs has been changed to 0. If you have multi-fib configuration and rely on existence of all Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Thu Nov 26 02:14:52 2020 (r368044) +++ head/etc/mtree/BSD.tests.dist Thu Nov 26 04:29:30 2020 (r368045) @@ -448,8 +448,6 @@ .. ping .. - ping6 - .. route .. .. Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Thu Nov 26 02:14:52 2020 (r368044) +++ head/rescue/rescue/Makefile Thu Nov 26 04:29:30 2020 (r368045) @@ -103,7 +103,6 @@ CRUNCH_PROGS_sbin+= ccdconfig .endif .if ${MK_INET6_SUPPORT} != "no" -CRUNCH_PROGS_sbin+= ping6 CRUNCH_PROGS_sbin+= rtsol .endif Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Thu Nov 26 02:14:52 2020 (r368044) +++ head/sbin/Makefile Thu Nov 26 04:29:30 2020 (r368045) @@ -73,7 +73,6 @@ SUBDIR.${MK_CCD}+= ccdconfig SUBDIR.${MK_CXX}+= devd SUBDIR.${MK_HAST}+= hastctl SUBDIR.${MK_HAST}+= hastd -SUBDIR.${MK_INET6}+= ping6 SUBDIR.${MK_INET6}+= rtsol SUBDIR.${MK_IPFILTER}+= ipf SUBDIR.${MK_IPFW}+= ipfw Modified: head/sbin/ping/Makefile ============================================================================== --- head/sbin/ping/Makefile Thu Nov 26 02:14:52 2020 (r368044) +++ head/sbin/ping/Makefile Thu Nov 26 04:29:30 2020 (r368045) @@ -5,11 +5,17 @@ PACKAGE=runtime PROG= ping -SRCS= ping.c utils.c +SRCS= main.c ping.c utils.c MAN= ping.8 BINOWN= root BINMODE=4555 LIBADD= m + +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+= -DINET6 -DKAME_SCOPEID +SRCS+= ping6.c +LIBADD+= md +.endif .if ${MK_DYNAMICROOT} == "no" .warning ${PROG} built without libcasper support Added: head/sbin/ping/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/ping/main.c Thu Nov 26 04:29:30 2020 (r368045) @@ -0,0 +1,191 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2019 Jan Sucan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "main.h" +#include "ping.h" +#ifdef INET6 +#include "ping6.h" +#endif + +#ifdef INET6 +#define OPTSTR ":46" +#else +#define OPTSTR ":4" +#endif + +int +main(int argc, char *argv[]) +{ + struct in_addr a; + struct addrinfo hints; + int ch; + bool ipv4; +#ifdef INET6 + struct in6_addr a6; + bool ipv6; + + ipv6 = false; +#endif + ipv4 = false; + + while ((ch = getopt(argc, argv, OPTSTR)) != -1) { + switch(ch) { + case '4': + ipv4 = true; + break; +#ifdef INET6 + case '6': + ipv6 = true; + break; +#endif + default: + break; + } + } + + if (optind >= argc) + usage(); + + optreset = 1; + optind = 1; +#ifdef INET6 + if (ipv4 && ipv6) + errx(1, "-4 and -6 cannot be used simultaneously"); +#endif + + if (inet_pton(AF_INET, argv[argc - 1], &a) == 1) { +#ifdef INET6 + if (ipv6) + errx(1, "IPv6 requested but IPv4 target address " + "provided"); +#endif + hints.ai_family = AF_INET; + } +#ifdef INET6 + else if (inet_pton(AF_INET6, argv[argc - 1], &a6) == 1) { + if (ipv4) + errx(1, "IPv4 requested but IPv6 target address " + "provided"); + hints.ai_family = AF_INET6; + } else if (ipv6) + hints.ai_family = AF_INET6; +#endif + else if (ipv4) + hints.ai_family = AF_INET; + else { + struct addrinfo *res; + + memset(&hints, 0, sizeof(hints)); + hints.ai_socktype = SOCK_RAW; + hints.ai_family = AF_UNSPEC; + getaddrinfo(argv[argc - 1], NULL, &hints, &res); + if (res != NULL) { + hints.ai_family = res[0].ai_family; + freeaddrinfo(res); + } + } + + if (hints.ai_family == AF_INET) + return ping(argc, argv); +#ifdef INET6 + else if (hints.ai_family == AF_INET6) + return ping6(argc, argv); +#endif + else + errx(1, "Unknown host"); +} + +void +usage(void) +{ + (void)fprintf(stderr, + "usage: ping [-4AaDdfHnoQqRrv] [-C pcp] [-c count] " + "[-G sweepmaxsize]\n" + " [-g sweepminsize] [-h sweepincrsize] [-i wait] " + "[-l preload]\n" + " [-M mask | time] [-m ttl]" +#ifdef IPSEC + "[-P policy] " +#endif + "[-p pattern] [-S src_addr] \n" + " [-s packetsize] [-t timeout] [-W waittime] [-z tos] " + "IPv4-host\n" + " ping [-4AaDdfHLnoQqRrv] [-C pcp] [-c count] [-I iface] " + "[-i wait]\n" + " [-l preload] [-M mask | time] [-m ttl] " +#ifdef IPSEC + "[-P policy] " +#endif + "[-p pattern]\n" + " [-S src_addr] [-s packetsize] [-T ttl] [-t timeout] [-W waittime]\n" + " [-z tos] IPv4-mcast-group\n" +#ifdef INET6 + " ping [-6aADd" +#if defined(IPSEC) && !defined(IPSEC_POLICY_IPSEC) + "E" +#endif + "fHnNoOq" +#ifdef IPV6_USE_MIN_MTU + "u" +#endif + "vyY" +#if defined(IPSEC) && !defined(IPSEC_POLICY_IPSEC) + "Z" +#endif + "] " + "[-b bufsiz] [-c count] [-e gateway]\n" + " [-I interface] [-i wait] [-k addrtype] [-l preload] " + "[-m hoplimit]\n" + " [-p pattern]" +#if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC) + " [-P policy]" +#endif + " [-S sourceaddr] [-s packetsize] [-t timeout]\n" + " [-W waittime] [-z tclass] [IPv6-hops ...] IPv6-host\n" +#endif /* INET6 */ + ); + + exit(1); +} Added: head/sbin/ping/main.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/ping/main.h Thu Nov 26 04:29:30 2020 (r368045) @@ -0,0 +1,36 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2019 Jan Sucan + * 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$ + */ + +#ifndef MAIN_H +#define MAIN_H 1 + +void usage(void) __dead2; + +#endif Modified: head/sbin/ping/ping.8 ============================================================================== --- head/sbin/ping/ping.8 Thu Nov 26 02:14:52 2020 (r368044) +++ head/sbin/ping/ping.8 Thu Nov 26 04:29:30 2020 (r368045) @@ -28,17 +28,19 @@ .\" @(#)ping.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd October 2, 2020 +.Dd November 24, 2020 .Dt PING 8 .Os .Sh NAME .Nm ping .Nd send -.Tn ICMP ECHO_REQUEST +.Tn ICMP +or +.Tn ICMPv6 ECHO_REQUEST packets to network hosts .Sh SYNOPSIS .Nm -.Op Fl AaDdfHnoQqRrv +.Op Fl 4AaDdfHnoQqRrv .Op Fl C Ar pcp .Op Fl c Ar count .Op Fl G Ar sweepmaxsize @@ -55,9 +57,9 @@ packets to network hosts .Op Fl t Ar timeout .Op Fl W Ar waittime .Op Fl z Ar tos -.Ar host +.Ar IPv4-host .Nm -.Op Fl AaDdfHLnoQqRrv +.Op Fl 4AaDdfHLnoQqRrv .Op Fl C Ar pcp .Op Fl c Ar count .Op Fl I Ar iface @@ -73,11 +75,31 @@ packets to network hosts .Op Fl t Ar timeout .Op Fl W Ar waittime .Op Fl z Ar tos -.Ar mcast-group +.Ar IPv4-mcast-group +.Nm +.Op Fl 6AaDdEfHNnOoquvYyZ +.Op Fl b Ar bufsiz +.Op Fl c Ar count +.Op Fl e Ar gateway +.Op Fl I Ar interface +.Op Fl i Ar wait +.Op Fl k Ar addrtype +.Op Fl l Ar preload +.Op Fl m Ar hoplimit +.Op Fl P Ar policy +.Op Fl p Ar pattern +.Op Fl S Ar sourceaddr +.Op Fl s Ar packetsize +.Op Fl t Ar timeout +.Op Fl W Ar waittime +.Op Ar IPv6-hops ... +.Ar IPv6-host .Sh DESCRIPTION The .Nm -utility uses the +utility invoked with an IPv4 target +.Ns ( Ar IPv4-host No or Ar IPv4-mcast-group Ns ) +uses the .Tn ICMP .No protocol Ap s mandatory .Tn ECHO_REQUEST @@ -94,7 +116,32 @@ header, followed by a and then an arbitrary number of .Dq pad bytes used to fill out the packet. -The options are as follows: +.Pp +When invoked with an IPv6 target +.Ns ( Ar IPv6-host Ns ) Ns , +it uses the +.Tn ICMPv6 +protocol's mandatory +.Tn ICMP6_ECHO_REQUEST +datagram to elicit an +.Tn ICMP6_ECHO_REPLY +.Ns . +.Tn ICMP6_ECHO_REQUEST +datagrams have an IPv6 header and +.Tn ICMPv6 +header formatted as documented in RFC 2463. +.Pp +When invoked with a hostname, the version to which the target is +resolved first is used. In that case, the options and arguments used +must be valid for the specific IP version, otherwise +.Nm +exits with an error. If the target is resolved to both IPv4 and IPv6, +the specific IP version can be requested by +.Fl 4 +or +.Fl 6 +options, respectively. +.Ss Options common to both IPv4 and IPv6 targets .Bl -tag -width indent .It Fl A Audible. @@ -112,8 +159,6 @@ Include a bell .Tn ( ASCII 0x07) character in the output when any packet is received. -This option is ignored -if other format options are present. .It Fl C Ar pcp Add an 802.1p Ethernet Priority Code Point when sending a packet. 0..7 uses that specific PCP, -1 uses the interface default PCP (or none). @@ -126,12 +171,13 @@ packets. If this option is not specified, .Nm will operate until interrupted. -If this option is specified in conjunction with ping sweeps, +.Pp +For an IPv4 target, if this option is specified in conjunction with ping sweeps, each sweep will consist of .Ar count packets. .It Fl D -Set the Don't Fragment bit. +Disable fragmentation. .It Fl d Set the .Dv SO_DEBUG @@ -152,31 +198,24 @@ Only the super-user may use this option. .Bf -emphasis This can be very hard on a network and should be used with caution. .Ef -.It Fl G Ar sweepmaxsize -Specify the maximum size of -.Tn ICMP -payload when sending sweeping pings. -This option is required for ping sweeps. -.It Fl g Ar sweepminsize -Specify the size of -.Tn ICMP -payload to start with when sending sweeping pings. -The default value is 0. .It Fl H Hostname output. Try to do a reverse DNS lookup when displaying addresses. This is the opposite of the .Fl n option. -.It Fl h Ar sweepincrsize -Specify the number of bytes to increment the size of -.Tn ICMP -payload after -each sweep when sending sweeping pings. -The default value is 1. .It Fl I Ar iface -Source multicast packets with the given interface address. -This flag only applies if the ping destination is a multicast address. +For an IPv4 target, +.Ar iface +is an IP address indentifying an interface from which the packets will +be sent. This flag applies only if the ping target is a multicast +address. +.Pp +For an IPv6 target, +.Ar iface +is a name of an interface (e.g. `em0') from which the packets will be +sent. This flag applies if the ping target is a multicast address, or +link-local/site-local unicast address. .It Fl i Ar wait Wait .Ar wait @@ -188,9 +227,6 @@ values less than 1 second. This option is incompatible with the .Fl f option. -.It Fl L -Suppress loopback of multicast packets. -This flag only applies if the ping destination is a multicast address. .It Fl l Ar preload If .Ar preload @@ -199,35 +235,13 @@ is specified, sends that many packets as fast as possible before falling into its normal mode of behavior. Only the super-user may use this option. -.It Fl M Cm mask | time -Use -.Dv ICMP_MASKREQ -or -.Dv ICMP_TSTAMP -instead of -.Dv ICMP_ECHO . -For -.Cm mask , -print the netmask of the remote machine. -Set the -.Va net.inet.icmp.maskrepl -MIB variable to enable -.Dv ICMP_MASKREPLY -and -.Va net.inet.icmp.maskfake -if you want to override the netmask in the response. -For -.Cm time , -print the origination, reception and transmission timestamps. -Set the -.Va net.inet.icmp.tstamprepl -MIB variable to enable or disable -.Dv ICMP_TSTAMPREPLY . .It Fl m Ar ttl -Set the IP Time To Live for outgoing packets. +For an IPv4 target, set the IP Time To Live for outgoing packets. If not specified, the kernel uses the value of the .Va net.inet.ip.ttl MIB variable. +.Pp +For an IPv6 target, set the IPv6 hoplimit. .It Fl n Numeric output only. No attempt will be made to lookup symbolic names for host addresses. @@ -252,6 +266,97 @@ For example, .Dq Li \-p ff will cause the sent packet to be filled with all ones. +.It Fl q +Quiet output. +Nothing is displayed except the summary lines at startup time and +when finished. +.It Fl S Ar src_addr +Use the following IP address as the source address in outgoing packets. +On hosts with more than one IP address, this option can be used to +force the source address to be something other than the IP address +of the interface the probe packet is sent on. +.Pp +For IPv4, if the IP address is not one of this machine's interface +addresses, an error is returned and nothing is sent. +.Pp +For IPv6, the source address must be one of the unicast addresses of +the sending node, and must be numeric. +.It Fl s Ar packetsize +Specify the number of data bytes to be sent. +The default is 56, which translates into 64 +.Tn ICMP +data bytes when combined +with the 8 bytes of +.Tn ICMP +header data. +.Pp +For IPv4, only the super-user may specify values more than default. +This option cannot be used with ping sweeps. +.Pp +For IPv6, you may need to specify +.Fl b +as well to extend socket buffer size. +.It Fl t Ar timeout +Specify a timeout, in seconds, before ping exits regardless of how +many packets have been received. +.It Fl v +Verbose output. +.Tn ICMP +packets other than +.Tn ECHO_RESPONSE +that are received are listed. +.It Fl W Ar waittime +Time in milliseconds to wait for a reply for each packet sent. +If a reply arrives later, the packet is not printed as replied, but +considered as replied when calculating statistics. +.El +.Ss Options only for IPv4 targets +.Bl -tag -width indent +.It Fl 4 +Use IPv4 regardless of how the target is resolved. +.It Fl G Ar sweepmaxsize +Specify the maximum size of +.Tn ICMP +payload when sending sweeping pings. +This option is required for ping sweeps. +.It Fl g Ar sweepminsize +Specify the size of +.Tn ICMP +payload to start with when sending sweeping pings. +The default value is 0. +.It Fl h Ar sweepincrsize +Specify the number of bytes to increment the size of +.Tn ICMP +payload after +each sweep when sending sweeping pings. +The default value is 1. +.It Fl L +Suppress loopback of multicast packets. +This flag only applies if the ping destination is a multicast address. +.It Fl M Cm mask | time +Use +.Dv ICMP_MASKREQ +or +.Dv ICMP_TSTAMP +instead of +.Dv ICMP_ECHO . +For +.Cm mask , +print the netmask of the remote machine. +Set the +.Va net.inet.icmp.maskrepl +MIB variable to enable +.Dv ICMP_MASKREPLY +and +.Va net.inet.icmp.maskfake +if you want to override the netmask in the response. +For +.Cm time , +print the origination, reception and transmission timestamps. +Set the +.Va net.inet.icmp.tstamprepl +MIB variable to enable or disable +.Dv ICMP_TSTAMPREPLY . .It Fl Q Somewhat quiet output. .No Don Ap t @@ -268,10 +373,6 @@ flag, .Nm prints out any ICMP error messages caused by its own ECHO_REQUEST messages. -.It Fl q -Quiet output. -Nothing is displayed except the summary lines at startup time and -when finished. .It Fl R Record route. Includes the @@ -299,44 +400,123 @@ This option can be used to ping a local host through a that has no route through it (e.g., after the interface was dropped by .Xr routed 8 ) . -.It Fl S Ar src_addr -Use the following IP address as the source address in outgoing packets. -On hosts with more than one IP address, this option can be used to -force the source address to be something other than the IP address -of the interface the probe packet is sent on. -If the IP address -is not one of this machine's interface addresses, an error is -returned and nothing is sent. -.It Fl s Ar packetsize -Specify the number of data bytes to be sent. -The default is 56, which translates into 64 -.Tn ICMP -data bytes when combined -with the 8 bytes of -.Tn ICMP -header data. -Only the super-user may specify values more than default. -This option cannot be used with ping sweeps. .It Fl T Ar ttl Set the IP Time To Live for multicasted packets. This flag only applies if the ping destination is a multicast address. -.It Fl t Ar timeout -Specify a timeout, in seconds, before ping exits regardless of how -many packets have been received. -.It Fl v -Verbose output. -.Tn ICMP -packets other than -.Tn ECHO_RESPONSE -that are received are listed. -.It Fl W Ar waittime -Time in milliseconds to wait for a reply for each packet sent. -If a reply arrives later, the packet is not printed as replied, but -considered as replied when calculating statistics. .It Fl z Ar tos Use the specified type of service. +.It Ar IPv4-host +hostname or IPv4 address of the final destination node. +.It Ar IPv4-mcast-group +IPv4 multicast address of the final destination nodes. .El +.Ss Options only for IPv6 targets +.Bl -tag -width indent +.It Fl 6 +Use IPv6 regardless of how the target is resolved. +.It Fl b Ar bufsiz +Set socket buffer size. +.It Fl e Ar gateway +Specifies to use +.Ar gateway +as the next hop to the destination. +The gateway must be a neighbor of the sending node. +.It Fl k Ar addrtype +Generate ICMPv6 Node Information Node Addresses query, rather than echo-request. +.Ar addrtype +must be a string constructed of the following characters. +.Bl -tag -width Ds -compact +.It Ic a +requests unicast addresses from all of the responder's interfaces. +If the character is omitted, +only those addresses which belong to the interface which has the +responder's address are requests. +.It Ic c +requests responder's IPv4-compatible and IPv4-mapped addresses. +.It Ic g +requests responder's global-scope addresses. +.It Ic s +requests responder's site-local addresses. +.It Ic l +requests responder's link-local addresses. +.It Ic A +requests responder's anycast addresses. +Without this character, the responder will return unicast addresses only. +With this character, the responder will return anycast addresses only. +Note that the specification does not specify how to get responder's +anycast addresses. +This is an experimental option. +.El +.It Fl N +Probe node information multicast group address +.Pq Li ff02::2:ffxx:xxxx . +.Ar host +must be string hostname of the target +(must not be a numeric IPv6 address). +Node information multicast group will be computed based on given +.Ar host , +and will be used as the final destination. +Since node information multicast group is a link-local multicast group, +outgoing interface needs to be specified by +.Fl I +option. .Pp +When specified twice, the address +.Pq Li ff02::2:xxxx:xxxx +is used instead. +The former is in RFC 4620, the latter is in an old Internet Draft +draft-ietf-ipngwg-icmp-name-lookup. +Note that KAME-derived implementations including +.Fx +use the latter. +.It Fl O +Generate ICMPv6 Node Information supported query types query, +rather than echo-request. +.Fl s +has no effect if +.Fl O +is specified. +.It Fl u +By default, +.Nm +asks the kernel to fragment packets to fit into the minimum IPv6 MTU. +The +.Fl u +option +will suppress the behavior in the following two levels: +when the option is specified once, the behavior will be disabled for +unicast packets. +When the option is more than once, it will be disabled for both +unicast and multicast packets. +.It Fl Y +Same as +.Fl y , +but with old packet format based on 03 draft. +This option is present for backward compatibility. +.Fl s +has no effect if +.Fl y +is specified. +.It Fl y +Generate ICMPv6 Node Information DNS Name query, rather than echo-request. +.Fl s +has no effect if +.Fl y +is specified. +.It Ar IPv6-hops +IPv6 addresses for intermediate nodes, +which will be put into type 0 routing header. +.It Ar IPv6-host +IPv6 address of the final destination node. +.El +.Ss Experimental options only for IPv6 target +.Bl -tag -width indent +.It Fl E +Enables transport-mode IPsec encapsulated security payload. +.It Fl Z +Enables transport-mode IPsec authentication header. +.El +.Pp When using .Nm for fault isolation, it should first be run on the local host, to verify @@ -364,8 +544,8 @@ receives a argument for .Xr stty 1 ) signal, the current number of packets sent and received, and the -minimum, mean, and maximum of the round-trip times will be written to -the standard error output. +minimum, mean, maximum, and standard deviation of the round-trip times +will be written to the standard output. .Pp This program is intended for use in network testing, measurement and management. @@ -446,7 +626,7 @@ using the .Fl p option of .Nm . -.Sh TTL DETAILS +.Sh IPv4 TTL DETAILS The .Tn TTL value of an IP packet represents the maximum number of IP routers @@ -536,20 +716,74 @@ At least one response was heard from the specified The transmission was successful but no responses were received. .It any other value An error occurred. -These values are defined in -.In sysexits.h . .El +.Sh EXAMPLES +The following will send ICMPv6 echo request to +.Li dst.foo.com . +.Bd -literal -offset indent +ping -6 -n dst.foo.com +.Ed +.Pp +The following will probe hostnames for all nodes on the network link attached to +.Li wi0 +interface. +The address +.Li ff02::1 +is named the link-local all-node multicast address, and the packet would +reach every node on the network link. +.Bd -literal -offset indent +ping -6 -y ff02::1%wi0 +.Ed +.Pp +The following will probe addresses assigned to the destination node, +.Li dst.foo.com . +.Bd -literal -offset indent +ping -6 -k agl dst.foo.com +.Ed .Sh SEE ALSO .Xr netstat 1 , .Xr icmp 4 , +.Xr icmp6 4 , +.Xr inet6 4 , +.Xr ip6 4 , .Xr ifconfig 8 , .Xr routed 8 , .Xr traceroute 8 +.Xr traceroute6 8 +.Rs +.%A A. Conta +.%A S. Deering +.%T "Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification" +.%N RFC 2463 +.%D December 1998 +.Re +.Rs +.%A Matt Crawford +.%T "IPv6 Node Information Queries" +.%N draft-ietf-ipngwg-icmp-name-lookups-09.txt +.%D May 2002 +.%O work in progress material +.Re .Sh HISTORY The .Nm utility appeared in .Bx 4.3 . +The +.Nm ping6 +utility with IPv6 support first appeared in the WIDE Hydrangea IPv6 +protocol stack kit. +.Pp +IPv6 and IPsec support based on the KAME Project +.Pq Pa http://www.kame.net/ +stack was initially integrated into +.Fx 4.0 . +.Pp +The +.Nm ping6 +utility was merged to +.Nm +in Google Summer of Code 2019. .Sh AUTHORS The original .Nm @@ -558,7 +792,7 @@ utility was written by while at the US Army Ballistics Research Laboratory. .Sh BUGS -Many Hosts and Gateways ignore the +Many Hosts and Gateways ignore the IPv4 .Tn RECORD_ROUTE option. .Pp Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Thu Nov 26 02:14:52 2020 (r368044) +++ head/sbin/ping/ping.c Thu Nov 26 04:29:30 2020 (r368045) @@ -100,6 +100,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "main.h" +#include "ping.h" #include "utils.h" #define INADDR_LEN ((int)sizeof(in_addr_t)) @@ -225,10 +227,9 @@ static void pr_pack(char *, ssize_t, struct sockaddr_i static void pr_retip(struct ip *, const u_char *); static void status(int); static void stopit(int); -static void usage(void) __dead2; int -main(int argc, char *const *argv) +ping(int argc, char *const *argv) { struct sockaddr_in from, sock_in; struct in_addr ifaddr; @@ -301,7 +302,7 @@ main(int argc, char *const *argv) outpack = outpackhdr + sizeof(struct ip); while ((ch = getopt(argc, argv, - "AaC:c:DdfG:g:Hh:I:i:Ll:M:m:nop:QqRrS:s:T:t:vW:z:" + "4AaC:c:DdfG:g:Hh:I:i:Ll:M:m:nop:QqRrS:s:T:t:vW:z:" #ifdef IPSEC #ifdef IPSEC_POLICY_IPSEC "P:" @@ -310,6 +311,9 @@ main(int argc, char *const *argv) )) != -1) { switch(ch) { + case '4': + /* This option is processed in main(). */ + break; case 'A': options |= F_MISSED; break; @@ -1768,25 +1772,4 @@ capdns_setup(void) err(1, "unable to limit access to system.dns service"); #endif return (capdnsloc); -} - -#if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC) -#define SECOPT " [-P policy]" -#else -#define SECOPT "" -#endif -static void -usage(void) -{ - - (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", -"usage: ping [-AaDdfHnoQqRrv] [-C pcp] [-c count] [-G sweepmaxsize] [-g sweepminsize]", -" [-h sweepincrsize] [-i wait] [-l preload] [-M mask | time] [-m ttl]", -" " SECOPT " [-p pattern] [-S src_addr] [-s packetsize] [-t timeout]", -" [-W waittime] [-z tos] host", -" ping [-AaDdfHLnoQqRrv] [-C pcp] [-c count] [-I iface] [-i wait] [-l preload]", -" [-M mask | time] [-m ttl]" SECOPT " [-p pattern] [-S src_addr]", -" [-s packetsize] [-T ttl] [-t timeout] [-W waittime]", -" [-z tos] mcast-group"); - exit(EX_USAGE); } Added: head/sbin/ping/ping.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/ping/ping.h Thu Nov 26 04:29:30 2020 (r368045) @@ -0,0 +1,36 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2019 Jan Sucan + * 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 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Nov 26 04:55:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DB884A166D; Thu, 26 Nov 2020 04:55:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChQRY1wYGz3CHF; Thu, 26 Nov 2020 04:55:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 260191D6FD; Thu, 26 Nov 2020 04:55:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQ4t5rL042177; Thu, 26 Nov 2020 04:55:05 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQ4t2TJ042165; Thu, 26 Nov 2020 04:55:02 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202011260455.0AQ4t2TJ042165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 26 Nov 2020 04:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368046 - in head: contrib/traceroute share/man/man4 tests/sys/netinet tests/sys/netinet6 tests/sys/netipsec/tunnel tests/sys/netpfil/common tests/sys/netpfil/pf usr.sbin/traceroute6 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: contrib/traceroute share/man/man4 tests/sys/netinet tests/sys/netinet6 tests/sys/netipsec/tunnel tests/sys/netpfil/common tests/sys/netpfil/pf usr.sbin/traceroute6 X-SVN-Commit-Revision: 368046 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 04:55:05 -0000 Author: asomers Date: Thu Nov 26 04:55:02 2020 New Revision: 368046 URL: https://svnweb.freebsd.org/changeset/base/368046 Log: ping: fix some man pages and tests after r368045 MFC-with: r368045 Modified: head/contrib/traceroute/traceroute.8 head/share/man/man4/inet6.4 head/tests/sys/netinet/carp.sh head/tests/sys/netinet6/exthdr.sh head/tests/sys/netinet6/lpm6.sh head/tests/sys/netinet6/output6.sh head/tests/sys/netipsec/tunnel/utils.subr head/tests/sys/netpfil/common/pass_block.sh head/tests/sys/netpfil/pf/fragmentation.sh head/tests/sys/netpfil/pf/pass_block.sh head/tests/sys/netpfil/pf/table.sh head/usr.sbin/traceroute6/traceroute6.8 Modified: head/contrib/traceroute/traceroute.8 ============================================================================== --- head/contrib/traceroute/traceroute.8 Thu Nov 26 04:29:30 2020 (r368045) +++ head/contrib/traceroute/traceroute.8 Thu Nov 26 04:55:02 2020 (r368046) @@ -16,7 +16,7 @@ .\" $Id: traceroute.8,v 1.19 2000/09/21 08:44:19 leres Exp $ .\" $FreeBSD$ .\" -.Dd June 20, 2019 +.Dd November 25, 2020 .Dt TRACEROUTE 8 .Os .Sh NAME @@ -377,7 +377,6 @@ during normal operations or from automated scripts. .Sh SEE ALSO .Xr netstat 1 , .Xr ping 8 , -.Xr ping6 8 , .Xr traceroute6 8 . .Sh AUTHORS Implemented by Van Jacobson from a suggestion by Steve Deering. Debugged Modified: head/share/man/man4/inet6.4 ============================================================================== --- head/share/man/man4/inet6.4 Thu Nov 26 04:29:30 2020 (r368045) +++ head/share/man/man4/inet6.4 Thu Nov 26 04:55:02 2020 (r368046) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 14, 2018 +.Dd November 25, 2020 .Dt INET6 4 .Os .Sh NAME @@ -130,7 +130,7 @@ or are able to use this notation. With special programs like -.Xr ping6 8 , +.Xr ping 8 , you can specify the outgoing interface by an extra command line option to disambiguate scoped addresses. .Pp Modified: head/tests/sys/netinet/carp.sh ============================================================================== --- head/tests/sys/netinet/carp.sh Thu Nov 26 04:29:30 2020 (r368045) +++ head/tests/sys/netinet/carp.sh Thu Nov 26 04:55:02 2020 (r368046) @@ -137,7 +137,7 @@ basic_v6_body() carp_basic_v6_three ${epair_two}b atf_check -s exit:0 -o ignore jexec carp_basic_v6_one \ - ping6 -c 3 2001:db8::0:1 + ping -6 -c 3 2001:db8::0:1 } basic_v6_cleanup() Modified: head/tests/sys/netinet6/exthdr.sh ============================================================================== --- head/tests/sys/netinet6/exthdr.sh Thu Nov 26 04:29:30 2020 (r368045) +++ head/tests/sys/netinet6/exthdr.sh Thu Nov 26 04:55:02 2020 (r368046) @@ -74,7 +74,7 @@ exthdr_body() { pyname=$(atf_get ident) pyname=${pyname%*_[0-9]} - atf_check -o ignore -s exit:0 ping6 -c 3 -q -o ${ip6b} + atf_check -o ignore -s exit:0 ping -6 -c 3 -q -o ${ip6b} atf_check -s exit:0 $(atf_get_srcdir)/${pyname}.py \ --sendif ${epair}a --recvif ${epair}a \ Modified: head/tests/sys/netinet6/lpm6.sh ============================================================================== --- head/tests/sys/netinet6/lpm6.sh Thu Nov 26 04:29:30 2020 (r368045) +++ head/tests/sys/netinet6/lpm6.sh Thu Nov 26 04:55:02 2020 (r368046) @@ -100,7 +100,7 @@ lpm6_test1_success_body() valid_message="${count} packets transmitted, ${count} packets received" # Check that ${net_dst}:2:0 goes via epair0 - atf_check -o match:"${valid_message}" jexec ${jname}a ping6 -f -nc${count} ${net_dst}:2:0 + atf_check -o match:"${valid_message}" jexec ${jname}a ping -6 -f -nc${count} ${net_dst}:2:0 pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` if [ ${pkt_0} -le ${count} ]; then @@ -109,7 +109,7 @@ lpm6_test1_success_body() fi # Check that ${net_dst}:2:1 goes via epair1 - atf_check -o match:"${valid_message}" jexec ${jname}a ping6 -f -nc${count} ${net_dst}:2:1 + atf_check -o match:"${valid_message}" jexec ${jname}a ping -6 -f -nc${count} ${net_dst}:2:1 pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` if [ ${pkt_1} -le ${count} ]; then @@ -163,7 +163,7 @@ lpm6_test2_success_body() valid_message="${count} packets transmitted, ${count} packets received" # Check that ${net_dst}:2:0 goes via epair1 - atf_check -o match:"${valid_message}" jexec ${jname}a ping6 -f -nc${count} ${net_dst}:2:0 + atf_check -o match:"${valid_message}" jexec ${jname}a ping -6 -f -nc${count} ${net_dst}:2:0 pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` if [ ${pkt_1} -le ${count} ]; then @@ -172,7 +172,7 @@ lpm6_test2_success_body() fi # Check that ${net_dst}:2:2 goes via epair0 - atf_check -o match:"${valid_message}" jexec ${jname}a ping6 -f -nc${count} ${net_dst}:2:2 + atf_check -o match:"${valid_message}" jexec ${jname}a ping -6 -f -nc${count} ${net_dst}:2:2 pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` if [ ${pkt_0} -le ${count} ]; then Modified: head/tests/sys/netinet6/output6.sh ============================================================================== --- head/tests/sys/netinet6/output6.sh Thu Nov 26 04:29:30 2020 (r368045) +++ head/tests/sys/netinet6/output6.sh Thu Nov 26 04:55:02 2020 (r368046) @@ -227,7 +227,7 @@ output6_raw_success_body() sleep 0.1 done - atf_check -o match:'1 packets transmitted, 1 packets received' jexec ${jname}a ping6 -nc1 ${ip_dst} + atf_check -o match:'1 packets transmitted, 1 packets received' jexec ${jname}a ping -6 -nc1 ${ip_dst} } output6_raw_success_cleanup() @@ -340,7 +340,7 @@ output6_tcp_flowid_mpath_success_body() jexec ${jname}b route add -6 -net ${net_src}::/${plen} ${ll}%${epair1}b # Base setup verification - atf_check -o match:'1 packets transmitted, 1 packets received' jexec ${jname}a ping6 -c1 ${ip_dst} + atf_check -o match:'1 packets transmitted, 1 packets received' jexec ${jname}a ping -6 -c1 ${ip_dst} # run listener num_ports=`echo ${ports} | wc -w` @@ -482,7 +482,7 @@ output6_udp_flowid_mpath_success_body() jexec ${jname}b route add -6 -net ${net_src}::/${plen} ${ll}%${epair1}b # Base setup verification - atf_check -o match:'1 packets transmitted, 1 packets received' jexec ${jname}a ping6 -c1 ${ip_dst} + atf_check -o match:'1 packets transmitted, 1 packets received' jexec ${jname}a ping -6 -c1 ${ip_dst} # run listener num_ports=`echo ${ports} | wc -w` @@ -621,13 +621,13 @@ output6_raw_flowid_mpath_success_body() jexec ${jname}b route add -6 -net ${net_src}::/${plen} ${ll}%${epair1}b # Base setup verification - atf_check -o match:'1 packets transmitted, 1 packets received' jexec ${jname}a ping6 -nc1 ${ip_dst} + atf_check -o match:'1 packets transmitted, 1 packets received' jexec ${jname}a ping -6 -nc1 ${ip_dst} # run sender valid_message='1 packets transmitted, 1 packets received' for _ip in ${ips}; do ip="${net_dst}:${_ip}" - atf_check -o match:"${valid_message}" jexec ${jname}a ping6 -nc1 ${ip} + atf_check -o match:"${valid_message}" jexec ${jname}a ping -6 -nc1 ${ip} done pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` Modified: head/tests/sys/netipsec/tunnel/utils.subr ============================================================================== --- head/tests/sys/netipsec/tunnel/utils.subr Thu Nov 26 04:29:30 2020 (r368045) +++ head/tests/sys/netipsec/tunnel/utils.subr Thu Nov 26 04:55:02 2020 (r368046) @@ -124,7 +124,7 @@ ist_test() if [ $1 -eq 4 ]; then atf_check -s exit:0 -o ignore jexec hostA ping -c 1 203.0.113.1 else - atf_check -s exit:0 -o ignore jexec hostA ping6 -c 1 2001:db8:45::1 + atf_check -s exit:0 -o ignore jexec hostA ping -6 -c 1 2001:db8:45::1 fi } ist_cleanup() Modified: head/tests/sys/netpfil/common/pass_block.sh ============================================================================== --- head/tests/sys/netpfil/common/pass_block.sh Thu Nov 26 04:29:30 2020 (r368045) +++ head/tests/sys/netpfil/common/pass_block.sh Thu Nov 26 04:55:02 2020 (r368046) @@ -99,7 +99,7 @@ v6_body() "ipf" \ "block in all" - atf_check -s exit:2 -o ignore ping6 -c 1 -W 1 fd7a:803f:cc4b::2 + atf_check -s exit:2 -o ignore ping -6 -c 1 -W 1 fd7a:803f:cc4b::2 # Pass All firewall_config "iron" ${firewall} \ @@ -110,7 +110,7 @@ v6_body() "ipf" \ "pass in all" - atf_check -s exit:0 -o ignore ping6 -c 1 -W 1 fd7a:803f:cc4b::2 + atf_check -s exit:0 -o ignore ping -6 -c 1 -W 1 fd7a:803f:cc4b::2 } v6_cleanup() Modified: head/tests/sys/netpfil/pf/fragmentation.sh ============================================================================== --- head/tests/sys/netpfil/pf/fragmentation.sh Thu Nov 26 04:29:30 2020 (r368045) +++ head/tests/sys/netpfil/pf/fragmentation.sh Thu Nov 26 04:55:02 2020 (r368046) @@ -112,23 +112,23 @@ v6_body() # Host test atf_check -s exit:0 -o ignore \ - ping6 -c 1 2001:db8:42::2 + ping -6 -c 1 2001:db8:42::2 atf_check -s exit:0 -o ignore \ - ping6 -c 1 -s 4500 2001:db8:42::2 + ping -6 -c 1 -s 4500 2001:db8:42::2 atf_check -s exit:0 -o ignore\ - ping6 -c 1 -b 70000 -s 65000 2001:db8:42::2 + ping -6 -c 1 -b 70000 -s 65000 2001:db8:42::2 # Forwarding test atf_check -s exit:0 -o ignore \ - ping6 -c 1 2001:db8:43::3 + ping -6 -c 1 2001:db8:43::3 atf_check -s exit:0 -o ignore \ - ping6 -c 1 -s 4500 2001:db8:43::3 + ping -6 -c 1 -s 4500 2001:db8:43::3 atf_check -s exit:0 -o ignore\ - ping6 -c 1 -b 70000 -s 65000 2001:db8:43::3 + ping -6 -c 1 -b 70000 -s 65000 2001:db8:43::3 $(atf_get_srcdir)/CVE-2019-5597.py \ ${epair_send}a \ Modified: head/tests/sys/netpfil/pf/pass_block.sh ============================================================================== --- head/tests/sys/netpfil/pf/pass_block.sh Thu Nov 26 04:29:30 2020 (r368045) +++ head/tests/sys/netpfil/pf/pass_block.sh Thu Nov 26 04:55:02 2020 (r368046) @@ -85,23 +85,23 @@ v6_body() jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2/64 up no_dad # Trivial ping to the jail, without pf - atf_check -s exit:0 -o ignore ping6 -c 1 -W 1 2001:db8:42::2 + atf_check -s exit:0 -o ignore ping -6 -c 1 -W 1 2001:db8:42::2 # pf without policy will let us ping jexec alcatraz pfctl -e - atf_check -s exit:0 -o ignore ping6 -c 1 -W 1 2001:db8:42::2 + atf_check -s exit:0 -o ignore ping -6 -c 1 -W 1 2001:db8:42::2 # Block everything pft_set_rules alcatraz "block in" - atf_check -s exit:2 -o ignore ping6 -c 1 -W 1 2001:db8:42::2 + atf_check -s exit:2 -o ignore ping -6 -c 1 -W 1 2001:db8:42::2 # Block everything but ICMP pft_set_rules alcatraz "block in" "pass in proto icmp6" - atf_check -s exit:0 -o ignore ping6 -c 1 -W 1 2001:db8:42::2 + atf_check -s exit:0 -o ignore ping -6 -c 1 -W 1 2001:db8:42::2 # Allowing ICMPv4 does not allow ICMPv6 pft_set_rules alcatraz "block in" "pass in proto icmp" - atf_check -s exit:2 -o ignore ping6 -c 1 -W 1 2001:db8:42::2 + atf_check -s exit:2 -o ignore ping -6 -c 1 -W 1 2001:db8:42::2 } v6_cleanup() @@ -132,21 +132,21 @@ noalias_body() | cut -d % -f 1) # Sanity check - atf_check -s exit:0 -o ignore ping6 -c 3 -W 1 2001:db8:42::2 - atf_check -s exit:0 -o ignore ping6 -c 3 -W 1 ${linklocaladdr}%${epair}a + atf_check -s exit:0 -o ignore ping -6 -c 3 -W 1 2001:db8:42::2 + atf_check -s exit:0 -o ignore ping -6 -c 3 -W 1 ${linklocaladdr}%${epair}a jexec alcatraz pfctl -e pft_set_rules alcatraz "block out inet6 from (${epair}b:0) to any" - atf_check -s exit:2 -o ignore ping6 -c 3 -W 1 2001:db8:42::2 + atf_check -s exit:2 -o ignore ping -6 -c 3 -W 1 2001:db8:42::2 # We should still be able to ping the link-local address - atf_check -s exit:0 -o ignore ping6 -c 3 -W 1 ${linklocaladdr}%${epair}a + atf_check -s exit:0 -o ignore ping -6 -c 3 -W 1 ${linklocaladdr}%${epair}a pft_set_rules alcatraz "block out inet6 from (${epair}b) to any" # We cannot ping to the link-local address - atf_check -s exit:2 -o ignore ping6 -c 3 -W 1 ${linklocaladdr}%${epair}a + atf_check -s exit:2 -o ignore ping -6 -c 3 -W 1 ${linklocaladdr}%${epair}a } noalias_cleanup() Modified: head/tests/sys/netpfil/pf/table.sh ============================================================================== --- head/tests/sys/netpfil/pf/table.sh Thu Nov 26 04:29:30 2020 (r368045) +++ head/tests/sys/netpfil/pf/table.sh Thu Nov 26 04:55:02 2020 (r368046) @@ -93,7 +93,7 @@ v6_counters_body() "pass in from to any" \ "pass out from any to " - atf_check -s exit:0 -o ignore ping6 -c 3 2001:db8:42::2 + atf_check -s exit:0 -o ignore ping -6 -c 3 2001:db8:42::2 atf_check -s exit:0 -e ignore \ -o match:'In/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \ Modified: head/usr.sbin/traceroute6/traceroute6.8 ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.8 Thu Nov 26 04:29:30 2020 (r368045) +++ head/usr.sbin/traceroute6/traceroute6.8 Thu Nov 26 04:55:02 2020 (r368046) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2020 +.Dd November 25, 2020 .Dt TRACEROUTE6 8 .Os .\" @@ -202,7 +202,6 @@ utility will exit with 0 on success, and non-zero on e .\" .Sh SEE ALSO .Xr ping 8 , -.Xr ping6 8 , .Xr traceroute 8 .\" .Sh HISTORY From owner-svn-src-all@freebsd.org Thu Nov 26 05:58:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C3D34A22A2; Thu, 26 Nov 2020 05:58:56 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChRsD1xjBz3G1L; Thu, 26 Nov 2020 05:58:56 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35EF21E0E8; Thu, 26 Nov 2020 05:58:56 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQ5wu3L078971; Thu, 26 Nov 2020 05:58:56 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQ5wuYM078970; Thu, 26 Nov 2020 05:58:56 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202011260558.0AQ5wuYM078970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Thu, 26 Nov 2020 05:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368047 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 368047 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 05:58:56 -0000 Author: grehan Date: Thu Nov 26 05:58:55 2020 New Revision: 368047 URL: https://svnweb.freebsd.org/changeset/base/368047 Log: Remove manual instruction encodings for VMLOAD, VMRUN, and VMSAVE. This is a relic from when these instructions weren't supported by the toolchain. No functional change. Submitted by: adam_fenn.io Reviewed by: grehan Approved by: grehan (bhyve) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D27130 Modified: head/sys/amd64/vmm/amd/svm_support.S Modified: head/sys/amd64/vmm/amd/svm_support.S ============================================================================== --- head/sys/amd64/vmm/amd/svm_support.S Thu Nov 26 04:55:02 2020 (r368046) +++ head/sys/amd64/vmm/amd/svm_support.S Thu Nov 26 05:58:55 2020 (r368047) @@ -39,10 +39,6 @@ #define VENTER push %rbp ; mov %rsp,%rbp #define VLEAVE pop %rbp -#define VMLOAD .byte 0x0f, 0x01, 0xda -#define VMRUN .byte 0x0f, 0x01, 0xd8 -#define VMSAVE .byte 0x0f, 0x01, 0xdb - /* * svm_launch(uint64_t vmcb, struct svm_regctx *gctx, struct pcpu *pcpu) * %rdi: physical address of VMCB @@ -91,9 +87,9 @@ ENTRY(svm_launch) movq SCTX_RDI(%rsi), %rdi movq SCTX_RSI(%rsi), %rsi /* %rsi must be restored last */ - VMLOAD - VMRUN - VMSAVE + vmload %rax + vmrun %rax + vmsave %rax pop %rax /* pop guest context pointer from the stack */ From owner-svn-src-all@freebsd.org Thu Nov 26 06:59:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94A734A39A6; Thu, 26 Nov 2020 06:59:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChTC43jGtz3K18; Thu, 26 Nov 2020 06:59:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7221B1F31B; Thu, 26 Nov 2020 06:59:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQ6xS1W015975; Thu, 26 Nov 2020 06:59:28 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQ6xSu8015974; Thu, 26 Nov 2020 06:59:28 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011260659.0AQ6xSu8015974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 26 Nov 2020 06:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368048 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 368048 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 06:59:28 -0000 Author: mjg Date: Thu Nov 26 06:59:27 2020 New Revision: 368048 URL: https://svnweb.freebsd.org/changeset/base/368048 Log: thread: staticize thread_reap and move td_allocdomain thread_init is a much better fit as the the value is constant after initialization. Modified: head/sys/kern/kern_thread.c head/sys/sys/proc.h Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Thu Nov 26 05:58:55 2020 (r368047) +++ head/sys/kern/kern_thread.c Thu Nov 26 06:59:27 2020 (r368048) @@ -143,6 +143,7 @@ static struct task thread_reap_task; static struct callout thread_reap_callout; static void thread_zombie(struct thread *); +static void thread_reap(void); static void thread_reap_all(void); static void thread_reap_task_cb(void *, int); static void thread_reap_callout_cb(void *); @@ -347,7 +348,6 @@ thread_ctor(void *mem, int size, void *arg, int flags) td = (struct thread *)mem; td->td_state = TDS_INACTIVE; td->td_lastcpu = td->td_oncpu = NOCPU; - td->td_allocdomain = vm_phys_domain(vtophys(td)); /* * Note that td_critnest begins life as 1 because the thread is not @@ -420,6 +420,7 @@ thread_init(void *mem, int size, int flags) td = (struct thread *)mem; + td->td_allocdomain = vm_phys_domain(vtophys(td)); td->td_sleepqueue = sleepq_alloc(); td->td_turnstile = turnstile_alloc(); td->td_rlqe = NULL; @@ -663,7 +664,7 @@ thread_reap_all(void) /* * Reap zombies from local domain. */ -void +static void thread_reap(void) { struct thread_domain_data *tdd; Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Nov 26 05:58:55 2020 (r368047) +++ head/sys/sys/proc.h Thu Nov 26 06:59:27 2020 (r368048) @@ -1142,7 +1142,6 @@ int thread_create(struct thread *td, struct rtprio *rt void thread_exit(void) __dead2; void thread_free(struct thread *td); void thread_link(struct thread *td, struct proc *p); -void thread_reap(void); int thread_single(struct proc *p, int how); void thread_single_end(struct proc *p, int how); void thread_stash(struct thread *td); From owner-svn-src-all@freebsd.org Thu Nov 26 07:29:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBC7C4A4028; Thu, 26 Nov 2020 07:29:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChTsh6NDrz3LBP; Thu, 26 Nov 2020 07:29:28 +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 C30A91F7A7; Thu, 26 Nov 2020 07:29: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 0AQ7TSnY034555; Thu, 26 Nov 2020 07:29:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQ7TSb8034554; Thu, 26 Nov 2020 07:29:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011260729.0AQ7TSb8034554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 Nov 2020 07:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368049 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 368049 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 07:29:29 -0000 Author: kib Date: Thu Nov 26 07:29:28 2020 New Revision: 368049 URL: https://svnweb.freebsd.org/changeset/base/368049 Log: MFC r367606: bhyve: avoid allocating BARs above the end of supported physical addresses. Modified: stable/12/usr.sbin/bhyve/pci_emul.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_emul.c Thu Nov 26 06:59:27 2020 (r368048) +++ stable/12/usr.sbin/bhyve/pci_emul.c Thu Nov 26 07:29:28 2020 (r368049) @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include #include @@ -45,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include "acpi.h" @@ -97,6 +102,7 @@ SET_DECLARE(pci_devemu_set, struct pci_devemu); static uint64_t pci_emul_iobase; static uint64_t pci_emul_membase32; static uint64_t pci_emul_membase64; +static uint64_t pci_emul_memlim64; #define PCI_EMUL_IOBASE 0x2000 #define PCI_EMUL_IOLIMIT 0x10000 @@ -107,9 +113,6 @@ SYSRES_MEM(PCI_EMUL_ECFG_BASE, PCI_EMUL_ECFG_SIZE); #define PCI_EMUL_MEMLIMIT32 PCI_EMUL_ECFG_BASE -#define PCI_EMUL_MEMBASE64 0xD000000000UL -#define PCI_EMUL_MEMLIMIT64 0xFD00000000UL - static struct pci_devemu *pci_emul_finddev(char *name); static void pci_lintr_route(struct pci_devinst *pi); static void pci_lintr_update(struct pci_devinst *pi); @@ -631,7 +634,7 @@ pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, baseptr = &hostbase; else baseptr = &pci_emul_membase64; - limit = PCI_EMUL_MEMLIMIT64; + limit = pci_emul_memlim64; mask = PCIM_BAR_MEM_BASE; lobits = PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_64 | PCIM_BAR_MEM_PREFETCH; @@ -1100,12 +1103,25 @@ init_pci(struct vmctx *ctx) struct slotinfo *si; struct funcinfo *fi; size_t lowmem; - int bus, slot, func; - int error; + uint64_t cpu_maxphysaddr, pci_emul_memresv64; + u_int regs[4]; + int bus, slot, func, error; pci_emul_iobase = PCI_EMUL_IOBASE; pci_emul_membase32 = vm_get_lowmem_limit(ctx); - pci_emul_membase64 = PCI_EMUL_MEMBASE64; + + do_cpuid(0x80000008, regs); + cpu_maxphysaddr = 1ULL << (regs[0] & 0xff); + if (cpu_maxphysaddr > VM_MAXUSER_ADDRESS) + cpu_maxphysaddr = VM_MAXUSER_ADDRESS; + pci_emul_memresv64 = cpu_maxphysaddr / 4; + /* + * Max power of 2 that is less then + * cpu_maxphysaddr - pci_emul_memresv64. + */ + pci_emul_membase64 = 1ULL << (flsl(cpu_maxphysaddr - + pci_emul_memresv64) - 1); + pci_emul_memlim64 = cpu_maxphysaddr; for (bus = 0; bus < MAXBUSES; bus++) { if ((bi = pci_businfo[bus]) == NULL) From owner-svn-src-all@freebsd.org Thu Nov 26 07:30:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46D8F4A3FB8; Thu, 26 Nov 2020 07:30:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChTtt1WXSz3LfQ; Thu, 26 Nov 2020 07:30:30 +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 26EC71F91D; Thu, 26 Nov 2020 07:30:30 +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 0AQ7UUZb034698; Thu, 26 Nov 2020 07:30:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQ7UUxF034697; Thu, 26 Nov 2020 07:30:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011260730.0AQ7UUxF034697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 Nov 2020 07:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368050 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 368050 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 07:30:30 -0000 Author: kib Date: Thu Nov 26 07:30:29 2020 New Revision: 368050 URL: https://svnweb.freebsd.org/changeset/base/368050 Log: MFC r367607: bhyve: increase allowed size for 64bit BAR allocation below 4G from 32 to 128 MB. Modified: stable/12/usr.sbin/bhyve/pci_emul.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_emul.c Thu Nov 26 07:29:28 2020 (r368049) +++ stable/12/usr.sbin/bhyve/pci_emul.c Thu Nov 26 07:30:29 2020 (r368050) @@ -624,9 +624,9 @@ pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, * Some drivers do not work well if the 64-bit BAR is allocated * above 4GB. Allow for this by allocating small requests under * 4GB unless then allocation size is larger than some arbitrary - * number (32MB currently). + * number (128MB currently). */ - if (size > 32 * 1024 * 1024) { + if (size > 128 * 1024 * 1024) { /* * XXX special case for device requiring peer-peer DMA */ From owner-svn-src-all@freebsd.org Thu Nov 26 07:31:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DE8A4A40C9; Thu, 26 Nov 2020 07:31:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChTw32hscz3LwV; Thu, 26 Nov 2020 07:31:31 +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 4FD741F7B9; Thu, 26 Nov 2020 07:31:31 +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 0AQ7VVql037166; Thu, 26 Nov 2020 07:31:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQ7VUXe037163; Thu, 26 Nov 2020 07:31:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011260731.0AQ7VUXe037163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 Nov 2020 07:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368051 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 368051 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 07:31:31 -0000 Author: kib Date: Thu Nov 26 07:31:30 2020 New Revision: 368051 URL: https://svnweb.freebsd.org/changeset/base/368051 Log: MFC r367613: bhyve: remove a hack to map all 8G BARs 1:1 Modified: stable/12/usr.sbin/bhyve/pci_emul.c stable/12/usr.sbin/bhyve/pci_emul.h stable/12/usr.sbin/bhyve/pci_passthru.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_emul.c Thu Nov 26 07:30:29 2020 (r368050) +++ stable/12/usr.sbin/bhyve/pci_emul.c Thu Nov 26 07:31:30 2020 (r368051) @@ -453,14 +453,6 @@ pci_emul_alloc_resource(uint64_t *baseptr, uint64_t li return (-1); } -int -pci_emul_alloc_bar(struct pci_devinst *pdi, int idx, enum pcibar_type type, - uint64_t size) -{ - - return (pci_emul_alloc_pbar(pdi, idx, 0, type, size)); -} - /* * Register (or unregister) the MMIO or I/O region associated with the BAR * register 'idx' of an emulated pci device. @@ -585,8 +577,8 @@ update_bar_address(struct pci_devinst *pi, uint64_t ad } int -pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, uint64_t hostbase, - enum pcibar_type type, uint64_t size) +pci_emul_alloc_bar(struct pci_devinst *pdi, int idx, enum pcibar_type type, + uint64_t size) { int error; uint64_t *baseptr, limit, addr, mask, lobits, bar; @@ -627,13 +619,7 @@ pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, * number (128MB currently). */ if (size > 128 * 1024 * 1024) { - /* - * XXX special case for device requiring peer-peer DMA - */ - if (size == 0x100000000UL) - baseptr = &hostbase; - else - baseptr = &pci_emul_membase64; + baseptr = &pci_emul_membase64; limit = pci_emul_memlim64; mask = PCIM_BAR_MEM_BASE; lobits = PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_64 | Modified: stable/12/usr.sbin/bhyve/pci_emul.h ============================================================================== --- stable/12/usr.sbin/bhyve/pci_emul.h Thu Nov 26 07:30:29 2020 (r368050) +++ stable/12/usr.sbin/bhyve/pci_emul.h Thu Nov 26 07:31:30 2020 (r368051) @@ -215,8 +215,6 @@ int init_pci(struct vmctx *ctx); void pci_callback(void); int pci_emul_alloc_bar(struct pci_devinst *pdi, int idx, enum pcibar_type type, uint64_t size); -int pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, - uint64_t hostbase, enum pcibar_type type, uint64_t size); int pci_emul_add_msicap(struct pci_devinst *pi, int msgnum); int pci_emul_add_pciecap(struct pci_devinst *pi, int pcie_device_type); void pci_emul_capwrite(struct pci_devinst *pi, int offset, int bytes, Modified: stable/12/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_passthru.c Thu Nov 26 07:30:29 2020 (r368050) +++ stable/12/usr.sbin/bhyve/pci_passthru.c Thu Nov 26 07:31:30 2020 (r368051) @@ -583,7 +583,7 @@ cfginitbar(struct vmctx *ctx, struct passthru_softc *s sc->psc_bar[i].addr = base; /* Allocate the BAR in the guest I/O or MMIO space */ - error = pci_emul_alloc_pbar(pi, i, base, bartype, size); + error = pci_emul_alloc_bar(pi, i, bartype, size); if (error) return (-1); From owner-svn-src-all@freebsd.org Thu Nov 26 07:34:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A66C64A3FE7; Thu, 26 Nov 2020 07:34:21 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChTzK4N7Fz3MGv; Thu, 26 Nov 2020 07:34:21 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A7EB1F3F6; Thu, 26 Nov 2020 07:34:21 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQ7YLER040603; Thu, 26 Nov 2020 07:34:21 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQ7YL7L040602; Thu, 26 Nov 2020 07:34:21 GMT (envelope-from phk@FreeBSD.org) Message-Id: <202011260734.0AQ7YL7L040602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Thu, 26 Nov 2020 07:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368052 - head/sys/dev/superio X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: head/sys/dev/superio X-SVN-Commit-Revision: 368052 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 07:34:21 -0000 Author: phk Date: Thu Nov 26 07:34:20 2020 New Revision: 368052 URL: https://svnweb.freebsd.org/changeset/base/368052 Log: Add support for Fintek F81803 SuperIO chip Reviewed by: avg Modified: head/sys/dev/superio/superio.c head/sys/dev/superio/superio.h Modified: head/sys/dev/superio/superio.c ============================================================================== --- head/sys/dev/superio/superio.c Thu Nov 26 07:31:30 2020 (r368051) +++ head/sys/dev/superio/superio.c Thu Nov 26 07:34:20 2020 (r368052) @@ -233,9 +233,29 @@ static const struct sio_conf_methods nvt_conf_methods .vendor = SUPERIO_VENDOR_NUVOTON }; +static void +fintek_conf_enter(struct resource* res, uint16_t port) +{ + bus_write_1(res, 0, 0x87); + bus_write_1(res, 0, 0x87); +} + +static void +fintek_conf_exit(struct resource* res, uint16_t port) +{ + bus_write_1(res, 0, 0xaa); +} + +static const struct sio_conf_methods fintek_conf_methods = { + .enter = fintek_conf_enter, + .exit = fintek_conf_exit, + .vendor = SUPERIO_VENDOR_FINTEK +}; + static const struct sio_conf_methods * const methods_table[] = { &ite_conf_methods, &nvt_conf_methods, + &fintek_conf_methods, NULL }; @@ -261,6 +281,11 @@ const struct sio_device nct5104_devices[] = { { .type = SUPERIO_DEV_NONE }, }; +const struct sio_device fintek_devices[] = { + { .ldn = 7, .type = SUPERIO_DEV_WDT }, + { .type = SUPERIO_DEV_NONE }, +}; + static const struct { superio_vendor_t vendor; uint16_t devid; @@ -410,6 +435,11 @@ static const struct { .descr = "Nuvoton NCT6795", .devices = nvt_devices, }, + { + .vendor = SUPERIO_VENDOR_FINTEK, .devid = 0x1210, .mask = 0xff, + .descr = "Fintek F81803", + .devices = fintek_devices, + }, { 0, 0 } }; @@ -472,6 +502,10 @@ superio_detect(device_t dev, bool claim, struct siosc devid = sio_readw(res, 0x20); revid = sio_read(res, 0x22); } else if (methods_table[m]->vendor == SUPERIO_VENDOR_NUVOTON) { + devid = sio_read(res, 0x20); + revid = sio_read(res, 0x21); + devid = (devid << 8) | revid; + } else if (methods_table[m]->vendor == SUPERIO_VENDOR_FINTEK) { devid = sio_read(res, 0x20); revid = sio_read(res, 0x21); devid = (devid << 8) | revid; Modified: head/sys/dev/superio/superio.h ============================================================================== --- head/sys/dev/superio/superio.h Thu Nov 26 07:31:30 2020 (r368051) +++ head/sys/dev/superio/superio.h Thu Nov 26 07:34:20 2020 (r368052) @@ -34,6 +34,7 @@ typedef enum superio_vendor { SUPERIO_VENDOR_NONE, SUPERIO_VENDOR_ITE, SUPERIO_VENDOR_NUVOTON, + SUPERIO_VENDOR_FINTEK, SUPERIO_VENDOR_MAX } superio_vendor_t; @@ -58,7 +59,7 @@ device_t superio_find_dev(device_t superio, superio_de int ldn); enum superio_ivars { - SUPERIO_IVAR_LDN = 10600, + SUPERIO_IVAR_LDN = 10600, SUPERIO_IVAR_TYPE, SUPERIO_IVAR_IOBASE, SUPERIO_IVAR_IOBASE2, From owner-svn-src-all@freebsd.org Thu Nov 26 08:27:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 713034A582D; Thu, 26 Nov 2020 08:27:13 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChW8J5KvPz3Pr0; Thu, 26 Nov 2020 08:27:12 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1606379224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HoNaPdsbIXVPCr1akMJMTb2z4yy5X59B4L2ldGKU0TI=; b=TrPCptt4SN2qgfKn1xlKc+VpPD9BhuUmbkyAv/DUgPc0grPP+gkkh5WAc2jcjQtX/WT/nS F+oF87zM1AGBh4XICg/YJ1nugHp525ZAEmniGFqbXgcm0hEZlLlp9QVhw3IUrCFre7JwE8 TMxEgvMKLtQ6nmtjWjL8NqNyBpxjOl4= Received: from amy.home (lfbn-idf2-1-288-247.w82-123.abo.wanadoo.fr [82.123.126.247]) by mx.blih.net (OpenSMTPD) with ESMTPSA id fff58a2c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 26 Nov 2020 08:27:04 +0000 (UTC) Date: Thu, 26 Nov 2020 09:27:04 +0100 From: Emmanuel Vadot To: Alan Somers Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk Message-Id: <20201126092704.f689ac823d6571ca0c98212a@bidouilliste.com> In-Reply-To: <202011260429.0AQ4TV2B023801@repo.freebsd.org> References: <202011260429.0AQ4TV2B023801@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4ChW8J5KvPz3Pr0 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 08:27:13 -0000 Hi Alan, On Thu, 26 Nov 2020 04:29:31 +0000 (UTC) Alan Somers wrote: > Author: asomers > Date: Thu Nov 26 04:29:30 2020 > New Revision: 368045 > URL: https://svnweb.freebsd.org/changeset/base/368045 >=20 > Log: > Merge ping6 to ping > =20 > There is now a single ping binary, which chooses to use ICMP or ICMPv4 > based on the -4 and -6 options, and the format of the address. > =20 > Submitted by: J=E1n Su?an > Sponsored by: Google LLC (Google Summer of Code 2019) > MFC after: Never > Differential Revision: https://reviews.freebsd.org/D21377 >=20 > Added: > head/sbin/ping/main.c (contents, props changed) > head/sbin/ping/main.h (contents, props changed) > head/sbin/ping/ping.h (contents, props changed) > head/sbin/ping/ping6.c > - copied, changed from r368010, head/sbin/ping6/ping6.c > head/sbin/ping/ping6.h (contents, props changed) > head/sbin/ping/tests/ping_6_c1_s8_t1.out > - copied unchanged from r368010, head/sbin/ping6/tests/ping6_c1_s8_t= 1.out > Deleted: > head/sbin/ping6/Makefile > head/sbin/ping6/Makefile.depend > head/sbin/ping6/ping6.8 > head/sbin/ping6/ping6.c > head/sbin/ping6/tests/Makefile > head/sbin/ping6/tests/ping6_c1_s8_t1.out > head/sbin/ping6/tests/ping6_test.sh > Modified: > head/ObsoleteFiles.inc > head/UPDATING > head/etc/mtree/BSD.tests.dist > head/rescue/rescue/Makefile > head/sbin/Makefile > head/sbin/ping/Makefile > head/sbin/ping/ping.8 > head/sbin/ping/ping.c > head/sbin/ping/tests/Makefile > head/sbin/ping/tests/ping_test.sh > head/tools/build/mk/OptionalObsoleteFiles.inc >=20 > Modified: head/ObsoleteFiles.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/ObsoleteFiles.inc Thu Nov 26 02:14:52 2020 (r368044) > +++ head/ObsoleteFiles.inc Thu Nov 26 04:29:30 2020 (r368045) > @@ -36,6 +36,16 @@ > # xargs -n1 | sort | uniq -d; > # done > =20 > +# 20201124: ping6(8) was merged into ping(8) > +OLD_FILES+=3Dsbin/ping6 > +OLD_FILES+=3Drescue/ping6 > +OLD_FILES+=3Dusr/lib/debug/sbin/ping6.debug > +OLD_FILES+=3Dusr/share/man/man8/ping6.8.gz > +OLD_FILES+=3Dusr/tests/sbin/ping6/Kyuafile > +OLD_FILES+=3Dusr/tests/sbin/ping6/ping6_c1_s8_t1.out > +OLD_FILES+=3Dusr/tests/sbin/ping6/ping6_test > +OLD_DIRS+=3Dusr/tests/sbin/ping6 > + > # 20201025: Remove cal data files > OLD_FILES+=3Dusr/share/calendar/calendar.all > OLD_FILES+=3Dusr/share/calendar/calendar.australia >=20 > Modified: head/UPDATING > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/UPDATING Thu Nov 26 02:14:52 2020 (r368044) > +++ head/UPDATING Thu Nov 26 04:29:30 2020 (r368045) > @@ -26,6 +26,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: > world, or to merely disable the most expensive debugging functionality > at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > =20 > +20201124: > + ping6 has been merged into ping. It can now be called as "ping -6". > + See ping(8) for details. > + > 20201108: > Default value of net.add_addr_allfibs has been changed to 0. > If you have multi-fib configuration and rely on existence of all >=20 > Modified: head/etc/mtree/BSD.tests.dist > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/mtree/BSD.tests.dist Thu Nov 26 02:14:52 2020 (r368044) > +++ head/etc/mtree/BSD.tests.dist Thu Nov 26 04:29:30 2020 (r368045) > @@ -448,8 +448,6 @@ > .. > ping > .. > - ping6 > - .. > route > .. > .. >=20 > Modified: head/rescue/rescue/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/rescue/rescue/Makefile Thu Nov 26 02:14:52 2020 (r368044) > +++ head/rescue/rescue/Makefile Thu Nov 26 04:29:30 2020 (r368045) > @@ -103,7 +103,6 @@ CRUNCH_PROGS_sbin+=3D ccdconfig > .endif > =20 > .if ${MK_INET6_SUPPORT} !=3D "no" > -CRUNCH_PROGS_sbin+=3D ping6 > CRUNCH_PROGS_sbin+=3D rtsol > .endif > =20 >=20 > Modified: head/sbin/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/sbin/Makefile Thu Nov 26 02:14:52 2020 (r368044) > +++ head/sbin/Makefile Thu Nov 26 04:29:30 2020 (r368045) > @@ -73,7 +73,6 @@ SUBDIR.${MK_CCD}+=3D ccdconfig > SUBDIR.${MK_CXX}+=3D devd > SUBDIR.${MK_HAST}+=3D hastctl > SUBDIR.${MK_HAST}+=3D hastd > -SUBDIR.${MK_INET6}+=3D ping6 > SUBDIR.${MK_INET6}+=3D rtsol > SUBDIR.${MK_IPFILTER}+=3D ipf > SUBDIR.${MK_IPFW}+=3D ipfw >=20 > Modified: head/sbin/ping/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/sbin/ping/Makefile Thu Nov 26 02:14:52 2020 (r368044) > +++ head/sbin/ping/Makefile Thu Nov 26 04:29:30 2020 (r368045) > @@ -5,11 +5,17 @@ > =20 > PACKAGE=3Druntime > PROG=3D ping > -SRCS=3D ping.c utils.c > +SRCS=3D main.c ping.c utils.c I think you should add a LINKS=3D... here so people script which uses ping6 won't break (and of course adding support in the code to do ipv6 ping if progname is ping6 if this isn't the case). Cheers, > MAN=3D ping.8 > BINOWN=3D root > BINMODE=3D4555 > LIBADD=3D m > + > +.if ${MK_INET6_SUPPORT} !=3D "no" > +CFLAGS+=3D -DINET6 -DKAME_SCOPEID > +SRCS+=3D ping6.c > +LIBADD+=3D md > +.endif > =20 > .if ${MK_DYNAMICROOT} =3D=3D "no" > .warning ${PROG} built without libcasper support --=20 Emmanuel Vadot From owner-svn-src-all@freebsd.org Thu Nov 26 09:07:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0D724A60EE; Thu, 26 Nov 2020 09:07:45 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChX3564wGz3hWF; Thu, 26 Nov 2020 09:07:45 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3DE220779; Thu, 26 Nov 2020 09:07:45 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQ97jrx096591; Thu, 26 Nov 2020 09:07:45 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQ97jFq096590; Thu, 26 Nov 2020 09:07:45 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <202011260907.0AQ97jFq096590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Thu, 26 Nov 2020 09:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368053 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 368053 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 09:07:45 -0000 Author: kaktus Date: Thu Nov 26 09:07:45 2020 New Revision: 368053 URL: https://svnweb.freebsd.org/changeset/base/368053 Log: libsysdecode: account for invalid protection flags Reported by: jhb MFC with: r368022 Modified: head/lib/libsysdecode/flags.c Modified: head/lib/libsysdecode/flags.c ============================================================================== --- head/lib/libsysdecode/flags.c Thu Nov 26 07:34:20 2020 (r368052) +++ head/lib/libsysdecode/flags.c Thu Nov 26 09:07:45 2020 (r368053) @@ -662,7 +662,7 @@ sysdecode_mmap_prot(FILE *fp, int prot, int *rem) printed = false; protm = PROT_MAX_EXTRACT(prot); - prot = PROT_EXTRACT(prot); + prot &= ~PROT_MAX(protm); if (protm != 0) { fputs("PROT_MAX(", fp); printed = print_mask_int(fp, mmapprot, protm, rem); From owner-svn-src-all@freebsd.org Thu Nov 26 09:16:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EEF3B4A6373; Thu, 26 Nov 2020 09:16:36 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (cross.sbone.de [195.201.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChXFJ5kdqz3hmm; Thu, 26 Nov 2020 09:16:36 +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 88D428D4A23C; Thu, 26 Nov 2020 09:16:29 +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 F27F4E707D0; Thu, 26 Nov 2020 09:16:28 +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 FVP7ZckREHfh; Thu, 26 Nov 2020 09:16:27 +0000 (UTC) Received: from [127.0.0.1] (unknown [IPv6:fde9:577b:c1a9:4902:e197:ea4b:9bb7:a369]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 6E1B9E707AC; Thu, 26 Nov 2020 09:16:27 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Alan Somers" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk Date: Thu, 26 Nov 2020 09:16:25 +0000 X-Mailer: MailMate (2.0BETAr6151) Message-ID: In-Reply-To: <202011260429.0AQ4TV2B023801@repo.freebsd.org> References: <202011260429.0AQ4TV2B023801@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4ChXFJ5kdqz3hmm X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 09:16:37 -0000 On 26 Nov 2020, at 4:29, Alan Somers wrote: > Author: asomers > Date: Thu Nov 26 04:29:30 2020 > New Revision: 368045 > URL: https://svnweb.freebsd.org/changeset/base/368045 > > Log: > Merge ping6 to ping > > There is now a single ping binary, which chooses to use ICMP or > ICMPv4 > based on the -4 and -6 options, and the format of the address. > > Submitted by: Ján SuÄŤan > Sponsored by: Google LLC (Google Summer of Code 2019) > MFC after: Never > Differential Revision: https://reviews.freebsd.org/D21377 I don’t have IPv4 anymore. I don’t see any WITHOUT_INET or -DINET checks. How can I compile INET out now? Also can we please have a ping6 [binary, compat shell script, or hardlink] back which defaults to -6 with appropriate option parsing by default? People used that in scripts and whatnot for about 20 years (and there’s even still stuff in tools in our own tree referencing it). /bz From owner-svn-src-all@freebsd.org Thu Nov 26 09:20:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 093344A69A7 for ; Thu, 26 Nov 2020 09:20:20 +0000 (UTC) (envelope-from bounce@m2xmail.com) Received: from mta165.shmail.fr (mta165.shmail.fr [51.158.22.165]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChXKZ6266z3jGs for ; Thu, 26 Nov 2020 09:20:18 +0000 (UTC) (envelope-from bounce@m2xmail.com) Message-ID: Subject: =?utf-8?Q?C=C3=A2bles?= et bornes de recharge pour =?utf-8?Q?v=C3=A9hicules_=C3=A9lectrique?= ou hybride From: Florian BARRIERE Reply-To: Florian BARRIERE To: svn-src-all@freebsd.org MIME-Version: 1.0 X-Rid: 385792097 X-Job: 14109906 List-Unsubscribe-Post: List-Unsubscribe=One-Click Date: Thu, 26 Nov 2020 10:20:18 +0100 X-Virtual-MTA: mta165 X-Rspamd-Queue-Id: 4ChXKZ6266z3jGs X-Spamd-Bar: - X-Spamd-Result: default: False [-1.59 / 15.00]; HAS_REPLYTO(0.00)[mail@batirel.info]; ZERO_FONT(0.50)[5]; REPLYTO_DN_EQ_FROM_DN(0.00)[]; TO_DN_NONE(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:51.158.22.165]; DKIM_TRACE(0.00)[m2xmail.com:+,shmail.fr:+]; DMARC_POLICY_ALLOW(-0.50)[m2xmail.com,quarantine]; NEURAL_HAM_SHORT(-0.98)[-0.982]; FORGED_SENDER(0.30)[mail@m2xmail.com,bounce@m2xmail.com]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:12876, ipnet:51.158.0.0/15, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[mail@m2xmail.com,bounce@m2xmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[m2xmail.com:s=shm2,shmail.fr:s=s01]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; HTML_SHORT_LINK_IMG_2(1.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; MANY_INVISIBLE_PARTS(0.60)[7]; RWL_MAILSPIKE_VERYGOOD(0.00)[51.158.22.165:from]; MAILMAN_DEST(0.00)[svn-src-all] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 09:20:20 -0000 -30% sur certains articles [https://up.m2xmail.com/lnk/385792097/2b1f4008= f03656e01132dab1f79578e13ab4f3a3/aHR0cDovL3d3dy5ib3V0aXF1ZS5iYXRpcmVsLnNob3= A] =C2=A0Voir la version en ligne [https://live.m2xmail.com/previ= ew-html?id=3D14109906&h=3D287863d42e82ff0d171ab74e329c698c&email=3Dsvn-src-= all%40freebsd.org]=C2=A0 =09=09 [https://up.m2xmail.com/lnk/3857920= 97/8c52d6777641845b130f542907347b90a35b1e3f/aHR0cDovL3d3dy5iYXRpcmVsLnNob3A= ] Borne et c=C3=A2bles de recharge [https://up.m2xmail.com/lnk/38= 5792097/2b1f4008f03656e01132dab1f79578e13ab4f3a3/aHR0cDovL3d3dy5ib3V0aXF1ZS= 5iYXRpcmVsLnNob3A] pour v=C3=A9hicule =C3=A9lectrique ou hybride [https= ://up.m2xmail.com/lnk/385792097/2b1f4008f03656e01132dab1f79578e13ab4f3a3/aH= R0cDovL3d3dy5ib3V0aXF1ZS5iYXRpcmVsLnNob3A] JUSQU'=C3=80 [https://up.= m2xmail.com/lnk/385792097/2b1f4008f03656e01132dab1f79578e13ab4f3a3/aHR0cDov= L3d3dy5ib3V0aXF1ZS5iYXRpcmVsLnNob3A] -30% [https://up.m2xmail.com/ln= k/385792097/2b1f4008f03656e01132dab1f79578e13ab4f3a3/aHR0cDovL3d3dy5ib3V0aX= F1ZS5iYXRpcmVsLnNob3A] Dans la limite des stocks disponibles* [ht= tps://up.m2xmail.com/lnk/385792097/2b1f4008f03656e01132dab1f79578e13ab4f3a3= /aHR0cDovL3d3dy5ib3V0aXF1ZS5iYXRpcmVsLnNob3A] =09=09 [https://up= .m2xmail.com/lnk/385792097/2b1f4008f03656e01132dab1f79578e13ab4f3a3/aHR0cDo= vL3d3dy5ib3V0aXF1ZS5iYXRpcmVsLnNob3A] =09=09 Voir les offres [ht= tps://up.m2xmail.com/lnk/385792097/2b1f4008f03656e01132dab1f79578e13ab4f3a3= /aHR0cDovL3d3dy5ib3V0aXF1ZS5iYXRpcmVsLnNob3A] =09=09 [https://up= .m2xmail.com/lnk/385792097/5ee98ebec03ca6eecea5bebc630c3bc925e885ce/aHR0cDo= vL3d3dy5ib3JuZXMtZGUtcmVjaGFyZ2UtbW9iaWxlcy5iYXRpcmVsLnNob3A] -30%= [https://up.m2xmail.com/lnk/385792097/5ee98ebec03ca6eecea5bebc630c3bc925= e885ce/aHR0cDovL3d3dy5ib3JuZXMtZGUtcmVjaGFyZ2UtbW9iaWxlcy5iYXRpcmVsLnNob3A]= SUR LES CHARGEURS MOBILE [https://up.m2xmail.com/lnk/385792097/5ee9= 8ebec03ca6eecea5bebc630c3bc925e885ce/aHR0cDovL3d3dy5ib3JuZXMtZGUtcmVjaGFyZ2= UtbW9iaWxlcy5iYXRpcmVsLnNob3A] =09=09 [https://up.m2xmail.com/ln= k/385792097/e0847275ba43d1397232b3eb3685d281fffa3228/aHR0cHM6Ly9iYXRpcmVsLm= NvbS9ib3JuZXMtZGUtcmVjaGFyZ2UvYm9ybmVzLWRlLXJlY2hhcmdlLW11cmFsZXMv] = -30% [https://up.m2xmail.com/lnk/385792097/765841ab1dc963f1231a1be10af= 61a6abfdaee55/aHR0cDovL3d3dy5ib3JuZXMtZGUtcmVjaGFyZ2UtbXVyYWxlcy5iYXRpcmVsL= nNob3A] SUR LES BORNES HOMELOAD ET HUBLOAD [https://up.m2xmail.com/l= nk/385792097/765841ab1dc963f1231a1be10af61a6abfdaee55/aHR0cDovL3d3dy5ib3JuZ= XMtZGUtcmVjaGFyZ2UtbXVyYWxlcy5iYXRpcmVsLnNob3A] =09=09 [https://= up.m2xmail.com/lnk/385792097/7154b6dca4a7629b2b11d2e8f2bbd137b884ec4f/aHR0c= DovL3d3dy5jYWJsZXMtZGUtcmVjaGFyZ2UuYmF0aXJlbC5zaG9w] -30% [https:= //up.m2xmail.com/lnk/385792097/7154b6dca4a7629b2b11d2e8f2bbd137b884ec4f/aHR= 0cDovL3d3dy5jYWJsZXMtZGUtcmVjaGFyZ2UuYmF0aXJlbC5zaG9w] SUR LES C=C3= =82BLES DE RECHARGE [https://up.m2xmail.com/lnk/385792097/7154b6dca4a7629= b2b11d2e8f2bbd137b884ec4f/aHR0cDovL3d3dy5jYWJsZXMtZGUtcmVjaGFyZ2UuYmF0aXJlb= C5zaG9w] PROFITEZ DU CREDIT D'IMPOOT CITE DE 300=E2=82=AC,=20 AVEC= UN TAUX DE TVA REDUIT A 5,5%(*) [https://up.m2xmail.com/lnk/385792097/16= 644536a5db9853ca54e748357443b43c4aa35d/aHR0cDovL3d3dy5mb3JtdWxhaXJlLXByaW1l= LWJvcm5lcy1yZWNoYXJnZS5iYXRpcmVsLnNob3A] EN NOUS FAISANT REALISER LA POSE= DE VOTRE BORNE CONTACTEZ NOUS [https://up.m2xmail.com/lnk/385792097= /ab894aec11fa42b0e1ddc26d139e0daf3eaeb0a0/aHR0cDovL3d3dy5jb250YWN0LWJvdXRpc= XVlLmJhdGlyZWwuc2hvcA] ET LA PRIME ADVENIR POUR=20 LES PROFESSIONNELS = JUSQU'A 3720=E2=82=AC PAR BORNE(**) CONTACTEZ NOUS [https://up.m2= xmail.com/lnk/385792097/16644536a5db9853ca54e748357443b43c4aa35d/aHR0cDovL3= d3dy5mb3JtdWxhaXJlLXByaW1lLWJvcm5lcy1yZWNoYXJnZS5iYXRpcmVsLnNob3A] WWW= .BATIREL.COM [https://up.m2xmail.com/lnk/385792097/8c52d6777641845b130f54= 2907347b90a35b1e3f/aHR0cDovL3d3dy5iYXRpcmVsLnNob3A] =09=09 [Map] = 17 Rue Pierre et Marie CURIE 77380 COMBS LA VILLE BORNES=C2= =A0 =C2=A0|=C2=A0=C2=A0 C=C3=82BLES=C2=A0 =C2=A0|=C2=A0=C2=A0 BORNES=C2= =A0 =C2=A0| DE=C2=A0=C2=A0 RECHARGE MURALE=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0OU=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 MOBILE=20 =09=09 (*) Afin de b=C3=A9n=C3=A9ficier du cr=C3=A9dit d'= imp=C3=B4t CITE de 300 =E2=82=AC et du taux de TVA r=C3=A9duit =C3=A0 5,5= %, la fourniture et la pose doit =C3=AAtre effectu=C3=A9 par un professio= nnel labelis=C3=A9s IRVE (BATIREL et ses poseurs sont qualifi=C3=A9s IRVE= ) [https://up.m2xmail.com/lnk/385792097/ab894aec11fa42b0e1ddc26d139e0daf3= eaeb0a0/aHR0cDovL3d3dy5jb250YWN0LWJvdXRpcXVlLmJhdGlyZWwuc2hvcA] (**) P= rime ADVENIR de 40% de l'investissement HT, installation effectu=C3=A9e p= ar un professionnel labelis=C3=A9 IRVE [https://up.m2xmail.com/lnk/385792= 097/16644536a5db9853ca54e748357443b43c4aa35d/aHR0cDovL3d3dy5mb3JtdWxhaXJlLX= ByaW1lLWJvcm5lcy1yZWNoYXJnZS5iYXRpcmVsLnNob3A](BATIREL et ses poseurs son= t qualifi=C3=A9s IRVE) [https://up.m2xmail.com/lnk/385792097/ab894aec11fa= 42b0e1ddc26d139e0daf3eaeb0a0/aHR0cDovL3d3dy5jb250YWN0LWJvdXRpcXVlLmJhdGlyZW= wuc2hvcA] Cliquez ici pour vous d=C3=A9sabonner [https://stop.m2xmai= l.com?c=3D14109906&email=3Dsvn-src-all@freebsd.org&hash=3De2e4c02814c7203cd= 4cc47430369da05417faa51] From owner-svn-src-all@freebsd.org Thu Nov 26 10:17:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A86424A8213; Thu, 26 Nov 2020 10:17:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChYc44RPPz3mrT; Thu, 26 Nov 2020 10:17:56 +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 8B62F212F5; Thu, 26 Nov 2020 10:17:56 +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 0AQAHutu040109; Thu, 26 Nov 2020 10:17:56 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQAHum4040108; Thu, 26 Nov 2020 10:17:56 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202011261017.0AQAHum4040108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 26 Nov 2020 10:17:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368054 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 368054 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 10:17:56 -0000 Author: kp Date: Thu Nov 26 10:17:56 2020 New Revision: 368054 URL: https://svnweb.freebsd.org/changeset/base/368054 Log: Add missing NET_EPOCH_EXIT() to if_bridge In r367706 one return in bridge_input() did not NET_EPOCH_EXIT(), which caused seemingly random panics on the next use of NET_EPOCH. Direct commit to stable/12, because this code is different in CURRENT. Modified: stable/12/sys/net/if_bridge.c Modified: stable/12/sys/net/if_bridge.c ============================================================================== --- stable/12/sys/net/if_bridge.c Thu Nov 26 09:07:45 2020 (r368053) +++ stable/12/sys/net/if_bridge.c Thu Nov 26 10:17:56 2020 (r368054) @@ -2528,6 +2528,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) OR_PFIL_HOOKED_INET6)) { \ if (bridge_pfil(&m, NULL, ifp, \ PFIL_IN) != 0 || m == NULL) { \ + NET_EPOCH_EXIT_ET(et); \ return (NULL); \ } \ eh = mtod(m, struct ether_header *); \ From owner-svn-src-all@freebsd.org Thu Nov 26 13:31:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 21A0E4AC7DB; Thu, 26 Nov 2020 13:31:58 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chdvy0VN9z4V9k; Thu, 26 Nov 2020 13:31:58 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 037492420D; Thu, 26 Nov 2020 13:31:58 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQDVvxt063211; Thu, 26 Nov 2020 13:31:57 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQDVv3J063210; Thu, 26 Nov 2020 13:31:57 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202011261331.0AQDVv3J063210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Thu, 26 Nov 2020 13:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368055 - head/contrib/netbsd-tests/lib/libpthread X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libpthread X-SVN-Commit-Revision: 368055 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 13:31:58 -0000 Author: arichardson Date: Thu Nov 26 13:31:57 2020 New Revision: 368055 URL: https://svnweb.freebsd.org/changeset/base/368055 Log: Significantly speed up libthr/mutex_test and make more reliable Instead of using a simple global++ as the data race, with this change we perform the increment by loading the global, delaying for a bit and then storing back the incremented value. If I move the increment outside of the mutex protected range, I can now see the data race with only 100 iterations on amd64 in almost all cases. Before this change such a racy test almost always passed with < 100,000 iterations and only reliably failed with the current limit of 10 million. I noticed this poorly written test because the mutex:mutex{2,3} and timedmutex:mutex{2,3} tests were always timing out on our CheriBSD Jenkins. Writing good concurrency tests is hard so I won't attempt to do so, but this change should make the test more likely to fail if pthread_mutex_lock is not implemented correctly while also significantly reducing the time it takes to run these four tests. It will also reduce the time it takes for QEMU RISC-V testsuite runs by almost 40 minutes (out of currently 7 hours). Reviewed By: brooks, ngie Differential Revision: https://reviews.freebsd.org/D26473 Modified: head/contrib/netbsd-tests/lib/libpthread/t_mutex.c Modified: head/contrib/netbsd-tests/lib/libpthread/t_mutex.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_mutex.c Thu Nov 26 10:17:56 2020 (r368054) +++ head/contrib/netbsd-tests/lib/libpthread/t_mutex.c Thu Nov 26 13:31:57 2020 (r368055) @@ -35,6 +35,9 @@ __RCSID("$NetBSD: t_mutex.c,v 1.15 2017/01/16 16:23:41 #include /* For UINT16_MAX */ #include #include +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -128,16 +131,41 @@ ATF_TC_BODY(mutex1, tc) PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex)); } +#ifdef __FreeBSD__ +/* + * Increment the value using a noinline function that includes a small delay + * to increase the window for the RMW data race. + */ +__noinline static int +increment(int value) +{ + for (volatile int i = 0; i < 100; i++) { + /* Small delay between read+write to increase chance of race */ + __compiler_membar(); + } + return value + 1; +} + +static volatile bool thread2_started = false; +#endif + static void * mutex2_threadfunc(void *arg) { long count = *(int *)arg; +#ifdef __FreeBSD__ + thread2_started = true; +#endif printf("2: Second thread (%p). Count is %ld\n", pthread_self(), count); while (count--) { PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy)); +#ifdef __FreeBSD__ + global_x = increment(global_x); +#else global_x++; +#endif PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex)); } @@ -153,16 +181,13 @@ ATF_TC_HEAD(mutex2, tc) atf_tc_set_md_var(tc, "timeout", "40"); #endif #endif - -#ifdef __FreeBSD__ -#if defined(__riscv) - atf_tc_set_md_var(tc, "timeout", "600"); -#endif -#endif } ATF_TC_BODY(mutex2, tc) { int count, count2; +#ifdef __FreeBSD__ + int num_increments; +#endif pthread_t new; void *joinval; @@ -177,18 +202,39 @@ ATF_TC_BODY(mutex2, tc) PTHREAD_REQUIRE(pthread_mutex_init(&mutex, NULL)); global_x = 0; +#ifdef __FreeBSD__ + num_increments = count = count2 = 1000; + if (getenv("NUM_ITERATIONS") != NULL) { + num_increments = count = count2 = + MIN(INT_MAX, strtoul(getenv("NUM_ITERATIONS"), NULL, 10)); + } + printf("Will use %d iterations\n", num_increments); +#else count = count2 = 10000000; +#endif PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy)); +#ifdef __FreeBSD__ + thread2_started = false; +#endif PTHREAD_REQUIRE(pthread_create(&new, NULL, mutex2_threadfunc, &count2)); printf("1: Thread %p\n", pthread_self()); - +#ifdef __FreeBSD__ + while (!thread2_started) { + /* Wait for thread 2 to start to increase chance of race */ + } + printf("1: Unlocking to start increment loop %p\n", pthread_self()); +#endif PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex)); while (count--) { PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy)); +#ifdef __FreeBSD__ + global_x = increment(global_x); +#else global_x++; +#endif PTHREAD_REQUIRE(pthread_mutex_unlock(&mutex)); } @@ -197,7 +243,14 @@ ATF_TC_BODY(mutex2, tc) PTHREAD_REQUIRE(mutex_lock(&mutex, &ts_lengthy)); printf("1: Thread joined. X was %d. Return value (long) was %ld\n", global_x, (long)joinval); +#ifdef __FreeBSD__ + ATF_REQUIRE_EQ_MSG(count, -1, "%d", count); + ATF_REQUIRE_EQ_MSG((long)joinval, -1, "%ld", (long)joinval); + ATF_REQUIRE_EQ_MSG(global_x, num_increments * 2, "%d vs %d", global_x, + num_increments * 2); +#else ATF_REQUIRE_EQ(global_x, 20000000); +#endif #ifdef __NetBSD__ #if defined(__powerpc__) @@ -210,16 +263,27 @@ ATF_TC_BODY(mutex2, tc) #endif } +#ifdef __FreeBSD__ +static volatile bool thread3_started = false; +#endif + static void * mutex3_threadfunc(void *arg) { long count = *(int *)arg; +#ifdef __FreeBSD__ + thread3_started = true; +#endif printf("2: Second thread (%p). Count is %ld\n", pthread_self(), count); while (count--) { PTHREAD_REQUIRE(mutex_lock(&static_mutex, &ts_lengthy)); +#ifdef __FreeBSD__ + global_x = increment(global_x); +#else global_x++; +#endif PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex)); } @@ -236,16 +300,13 @@ ATF_TC_HEAD(mutex3, tc) atf_tc_set_md_var(tc, "timeout", "40"); #endif #endif - -#ifdef __FreeBSD__ -#if defined(__riscv) - atf_tc_set_md_var(tc, "timeout", "600"); -#endif -#endif } ATF_TC_BODY(mutex3, tc) { int count, count2; +#ifdef __FreeBSD__ + int num_increments; +#endif pthread_t new; void *joinval; @@ -258,18 +319,36 @@ ATF_TC_BODY(mutex3, tc) #endif global_x = 0; +#ifdef __FreeBSD__ + num_increments = count = count2 = 1000; + if (getenv("NUM_ITERATIONS") != NULL) { + num_increments = count = count2 = + MIN(INT_MAX, strtoul(getenv("NUM_ITERATIONS"), NULL, 10)); + } + printf("Will use %d iterations\n", num_increments); +#else count = count2 = 10000000; +#endif PTHREAD_REQUIRE(mutex_lock(&static_mutex, &ts_lengthy)); PTHREAD_REQUIRE(pthread_create(&new, NULL, mutex3_threadfunc, &count2)); printf("1: Thread %p\n", pthread_self()); - +#ifdef __FreeBSD__ + while (!thread3_started) { + /* Wait for thread 3 to start to increase chance of race */ + } + printf("1: Unlocking to start increment loop %p\n", pthread_self()); +#endif PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex)); while (count--) { PTHREAD_REQUIRE(mutex_lock(&static_mutex, &ts_lengthy)); +#ifdef __FreeBSD__ + global_x = increment(global_x); +#else global_x++; +#endif PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex)); } @@ -278,8 +357,14 @@ ATF_TC_BODY(mutex3, tc) PTHREAD_REQUIRE(mutex_lock(&static_mutex, &ts_lengthy)); printf("1: Thread joined. X was %d. Return value (long) was %ld\n", global_x, (long)joinval); +#ifdef __FreeBSD__ + ATF_REQUIRE_EQ_MSG(count, -1, "%d", count); + ATF_REQUIRE_EQ_MSG((long)joinval, -1, "%ld", (long)joinval); + ATF_REQUIRE_EQ_MSG(global_x, num_increments * 2, "%d vs %d", global_x, + num_increments * 2); +#else ATF_REQUIRE_EQ(global_x, 20000000); - +#endif #ifdef __NetBSD__ #if defined(__powerpc__) /* XXX force a timeout in ppc case since an un-triggered race From owner-svn-src-all@freebsd.org Thu Nov 26 14:36:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73F9E4AD773; Thu, 26 Nov 2020 14:36:50 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChgLp2nMxz4YHZ; Thu, 26 Nov 2020 14:36:50 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f51.google.com with SMTP id l36so2044288ota.4; Thu, 26 Nov 2020 06:36:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rFQU/XNDteTNTuvLzmsvXhMDX3rnVeCZITi6lAf8FXE=; b=iL8+ccI0PQcL4SrHdULOdb8drp73OuJR+ta1sqMv654TciojnbZe1EzcRuhHlgBggy lSZf60GTIsApQxf+hAIzmgK+g/IN5awcY8Pe3dNnSoNWpu035XZ+7+V8NVjH+0Kyp+jR w1w1waWAzNjQyKrJ8pJ0KRm3wT1kY/W+NHK3vHAm5g2l9R30gxTFQcX3BWLln5Vv+z8U Z5bltHrTKzuAJhTf9xOionoQQV87i/dP+Tbal9ALzRm+rvg3+1remt1Krb+gFG2UjJ1y K9BR37FIMf0Ktp7FB0vJvZRUnwD9M3cxoO3e60PkVZRegZg1qdTRxO2nsrzTH2D/SBI5 XPNA== X-Gm-Message-State: AOAM533Iq2Keb7JrIZmIuG+x6vuiFcxWdo8w3+gq8MtaL+2bHu+rjXSJ 7zJqfZxGlT1TvQ9dPTV5i/8+yVocd6l3NIn4tpduCES3Ji8= X-Google-Smtp-Source: ABdhPJzQ6GRzXRFcERb5QzAUVbUJM8yXu14WBaZOAQAlwDikOTHKF+qdOgcVh3h24EUYXPdW7gNmdrVghCVDHf6lSC8= X-Received: by 2002:a9d:6317:: with SMTP id q23mr2534339otk.251.1606401409260; Thu, 26 Nov 2020 06:36:49 -0800 (PST) MIME-Version: 1.0 References: <202011260429.0AQ4TV2B023801@repo.freebsd.org> <20201126092704.f689ac823d6571ca0c98212a@bidouilliste.com> In-Reply-To: <20201126092704.f689ac823d6571ca0c98212a@bidouilliste.com> From: Alan Somers Date: Thu, 26 Nov 2020 07:36:37 -0700 Message-ID: Subject: Re: svn commit: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk To: Emmanuel Vadot Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4ChgLp2nMxz4YHZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 14:36:50 -0000 On Thu, Nov 26, 2020 at 1:27 AM Emmanuel Vadot wrote: > > Hi Alan, > > On Thu, 26 Nov 2020 04:29:31 +0000 (UTC) > Alan Somers wrote: > > > Author: asomers > > Date: Thu Nov 26 04:29:30 2020 > > New Revision: 368045 > > URL: https://svnweb.freebsd.org/changeset/base/368045 > > > > Log: > > Merge ping6 to ping > > > > There is now a single ping binary, which chooses to use ICMP or ICMPv= 4 > > based on the -4 and -6 options, and the format of the address. > > > > Submitted by: J=C3=A1n Su?an > > Sponsored by: Google LLC (Google Summer of Code 2019) > > MFC after: Never > > Differential Revision: https://reviews.freebsd.org/D21377 > > > > Added: > > head/sbin/ping/main.c (contents, props changed) > > head/sbin/ping/main.h (contents, props changed) > > head/sbin/ping/ping.h (contents, props changed) > > head/sbin/ping/ping6.c > > - copied, changed from r368010, head/sbin/ping6/ping6.c > > head/sbin/ping/ping6.h (contents, props changed) > > head/sbin/ping/tests/ping_6_c1_s8_t1.out > > - copied unchanged from r368010, > head/sbin/ping6/tests/ping6_c1_s8_t1.out > > Deleted: > > head/sbin/ping6/Makefile > > head/sbin/ping6/Makefile.depend > > head/sbin/ping6/ping6.8 > > head/sbin/ping6/ping6.c > > head/sbin/ping6/tests/Makefile > > head/sbin/ping6/tests/ping6_c1_s8_t1.out > > head/sbin/ping6/tests/ping6_test.sh > > Modified: > > head/ObsoleteFiles.inc > > head/UPDATING > > head/etc/mtree/BSD.tests.dist > > head/rescue/rescue/Makefile > > head/sbin/Makefile > > head/sbin/ping/Makefile > > head/sbin/ping/ping.8 > > head/sbin/ping/ping.c > > head/sbin/ping/tests/Makefile > > head/sbin/ping/tests/ping_test.sh > > head/tools/build/mk/OptionalObsoleteFiles.inc > > > > Modified: head/ObsoleteFiles.inc > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/ObsoleteFiles.inc Thu Nov 26 02:14:52 2020 (r368044) > > +++ head/ObsoleteFiles.inc Thu Nov 26 04:29:30 2020 (r368045) > > @@ -36,6 +36,16 @@ > > # xargs -n1 | sort | uniq -d; > > # done > > > > +# 20201124: ping6(8) was merged into ping(8) > > +OLD_FILES+=3Dsbin/ping6 > > +OLD_FILES+=3Drescue/ping6 > > +OLD_FILES+=3Dusr/lib/debug/sbin/ping6.debug > > +OLD_FILES+=3Dusr/share/man/man8/ping6.8.gz > > +OLD_FILES+=3Dusr/tests/sbin/ping6/Kyuafile > > +OLD_FILES+=3Dusr/tests/sbin/ping6/ping6_c1_s8_t1.out > > +OLD_FILES+=3Dusr/tests/sbin/ping6/ping6_test > > +OLD_DIRS+=3Dusr/tests/sbin/ping6 > > + > > # 20201025: Remove cal data files > > OLD_FILES+=3Dusr/share/calendar/calendar.all > > OLD_FILES+=3Dusr/share/calendar/calendar.australia > > > > Modified: head/UPDATING > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/UPDATING Thu Nov 26 02:14:52 2020 (r368044) > > +++ head/UPDATING Thu Nov 26 04:29:30 2020 (r368045) > > @@ -26,6 +26,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: > > world, or to merely disable the most expensive debugging > functionality > > at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf"= .) > > > > +20201124: > > + ping6 has been merged into ping. It can now be called as "ping > -6". > > + See ping(8) for details. > > + > > 20201108: > > Default value of net.add_addr_allfibs has been changed to 0. > > If you have multi-fib configuration and rely on existence of all > > > > Modified: head/etc/mtree/BSD.tests.dist > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/mtree/BSD.tests.dist Thu Nov 26 02:14:52 2020 > (r368044) > > +++ head/etc/mtree/BSD.tests.dist Thu Nov 26 04:29:30 2020 > (r368045) > > @@ -448,8 +448,6 @@ > > .. > > ping > > .. > > - ping6 > > - .. > > route > > .. > > .. > > > > Modified: head/rescue/rescue/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/rescue/rescue/Makefile Thu Nov 26 02:14:52 2020 > (r368044) > > +++ head/rescue/rescue/Makefile Thu Nov 26 04:29:30 2020 > (r368045) > > @@ -103,7 +103,6 @@ CRUNCH_PROGS_sbin+=3D ccdconfig > > .endif > > > > .if ${MK_INET6_SUPPORT} !=3D "no" > > -CRUNCH_PROGS_sbin+=3D ping6 > > CRUNCH_PROGS_sbin+=3D rtsol > > .endif > > > > > > Modified: head/sbin/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/sbin/Makefile Thu Nov 26 02:14:52 2020 (r368044) > > +++ head/sbin/Makefile Thu Nov 26 04:29:30 2020 (r368045) > > @@ -73,7 +73,6 @@ SUBDIR.${MK_CCD}+=3D ccdconfig > > SUBDIR.${MK_CXX}+=3D devd > > SUBDIR.${MK_HAST}+=3D hastctl > > SUBDIR.${MK_HAST}+=3D hastd > > -SUBDIR.${MK_INET6}+=3D ping6 > > SUBDIR.${MK_INET6}+=3D rtsol > > SUBDIR.${MK_IPFILTER}+=3D ipf > > SUBDIR.${MK_IPFW}+=3D ipfw > > > > Modified: head/sbin/ping/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/sbin/ping/Makefile Thu Nov 26 02:14:52 2020 (r368044) > > +++ head/sbin/ping/Makefile Thu Nov 26 04:29:30 2020 (r368045) > > @@ -5,11 +5,17 @@ > > > > PACKAGE=3Druntime > > PROG=3D ping > > -SRCS=3D ping.c utils.c > > +SRCS=3D main.c ping.c utils.c > > I think you should add a LINKS=3D... here so people script which uses > ping6 won't break (and of course adding support in the code to do ipv6 > ping if progname is ping6 if this isn't the case). > > Cheers, > > -- > Emmanuel Vadot > Yes, that would make sense. But for how long? Would the ping6 hard link stick around forever, or eventually be removed in some future version of FreeBSD? From owner-svn-src-all@freebsd.org Thu Nov 26 14:42:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23F2E4AE140; Thu, 26 Nov 2020 14:42:17 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChgT50bmZz4YwX; Thu, 26 Nov 2020 14:42:17 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0665324E9C; Thu, 26 Nov 2020 14:42:17 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQEgGfo006731; Thu, 26 Nov 2020 14:42:16 GMT (envelope-from uqs@FreeBSD.org) Received: (from uqs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQEgG80006729; Thu, 26 Nov 2020 14:42:16 GMT (envelope-from uqs@FreeBSD.org) Message-Id: <202011261442.0AQEgG80006729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: uqs set sender to uqs@FreeBSD.org using -f From: =?UTF-8?Q?Ulrich_Sp=c3=b6rlein?= Date: Thu, 26 Nov 2020 14:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368056 - in head: .github/workflows tools/build X-SVN-Group: head X-SVN-Commit-Author: uqs X-SVN-Commit-Paths: in head: .github/workflows tools/build X-SVN-Commit-Revision: 368056 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 14:42:17 -0000 Author: uqs Date: Thu Nov 26 14:42:16 2020 New Revision: 368056 URL: https://svnweb.freebsd.org/changeset/base/368056 Log: GH Actions: Use pre-installed clang packages Also fix the run by setting up the environment in non-deprecated way. Always run with --debug to understand better what sort of stuff is happening in the background. Also split out the bmake bootstrap stage (takes about 31s on ubuntu, but 1m14 on macOS?) Drops the dependency on coreutils (realpath, nproc) and thus (?) fixes macOS to be just as fast (4 logical cores vs 2 physical cores before, go figure.) Reviewed by: arichardson Modified: head/.github/workflows/cross-bootstrap-tools.yml head/tools/build/make.py Modified: head/.github/workflows/cross-bootstrap-tools.yml ============================================================================== --- head/.github/workflows/cross-bootstrap-tools.yml Thu Nov 26 13:31:57 2020 (r368055) +++ head/.github/workflows/cross-bootstrap-tools.yml Thu Nov 26 14:42:16 2020 (r368056) @@ -1,4 +1,4 @@ -name: Cross-build CI +name: Cross-build Kernel on: push: @@ -8,28 +8,51 @@ on: jobs: build: - name: ${{ matrix.os }} + name: ${{ matrix.os }} (${{ matrix.compiler }}) runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [ubuntu-18.04, ubuntu-20.04, macOS-latest] + include: + # TODO: both Ubuntu and macOS have bmake packages, we should try them instead of bootstrapping our own copy. + - os: ubuntu-20.04 + compiler: clang-9 + cross-bindir: /usr/lib/llvm-9/bin + pkgs: bmake libarchive-dev + - os: ubuntu-20.04 + compiler: clang-10 + cross-bindir: /usr/lib/llvm-10/bin + pkgs: bmake libarchive-dev + - os: macOS-latest + compiler: clang-11 + #cross-bindir: /usr/local/Cellar/llvm/11.0.0/bin # script figures this out automatically + pkgs: bmake libarchive llvm@11 steps: - uses: actions/checkout@v2 - - name: install LLVM+libarchive (Ubuntu) + - name: install packages (Ubuntu) + if: runner.os == 'Linux' run: | - wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh - chmod +x /tmp/llvm.sh - sudo /tmp/llvm.sh 11 - sudo apt install -y libarchive-dev - echo "::set-env name=EXTRA_MAKE_ARGS::--cross-bindir=/usr/lib/llvm-11/bin" - if: ${{ startsWith(matrix.os, 'ubuntu') }} - - name: install LLVM+libarchive (macOS) - run: brew install llvm coreutils libarchive xz - if: ${{ startsWith(matrix.os, 'macOS') }} - - name: create build dir - run: rm -rf ../build && mkdir -p ../build + sudo apt-get update --quiet || true + sudo apt-get -yq --no-install-suggests --no-install-recommends install ${{ matrix.pkgs }} + - name: install packages (macOS) + if: runner.os == 'macOS' + run: | + brew update --quiet || true + brew install ${{ matrix.pkgs }} + - name: create environment + run: | + echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE" + if [ -n "${{ matrix.cross-bindir }}" ]; then + echo "EXTRA_BUILD_ARGS=--cross-bindir=${{ matrix.cross-bindir }}" >> $GITHUB_ENV + fi + mkdir -p ../build + echo "MAKEOBJDIRPREFIX=${PWD%/*}/build" >> $GITHUB_ENV + # heh, works on Linux/BSD/macOS ... + echo "NPROC=`getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1`" >> $GITHUB_ENV + - name: bootstrap bmake + run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=amd64 TARGET_ARCH=amd64 -n - name: make kernel-toolchain - run: env MAKEOBJDIRPREFIX=`realpath ../build` ./tools/build/make.py $EXTRA_MAKE_ARGS TARGET=amd64 TARGET_ARCH=amd64 kernel-toolchain -s -j$(nproc) + run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=amd64 TARGET_ARCH=amd64 kernel-toolchain -s -j$NPROC - name: make buildkernel - run: env MAKEOBJDIRPREFIX=`realpath ../build` ./tools/build/make.py $EXTRA_MAKE_ARGS TARGET=amd64 TARGET_ARCH=amd64 KERNCONF=GENERIC NO_MODULES=yes buildkernel -s -j$(nproc) + run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=amd64 TARGET_ARCH=amd64 KERNCONF=GENERIC NO_MODULES=yes buildkernel -s -j$NPROC $EXTRA_MAKE_ARGS Modified: head/tools/build/make.py ============================================================================== --- head/tools/build/make.py Thu Nov 26 13:31:57 2020 (r368055) +++ head/tools/build/make.py Thu Nov 26 14:42:16 2020 (r368056) @@ -115,6 +115,9 @@ def check_required_make_env_var(varname, binary_name, " does not exist") new_env_vars[varname] = guess debug("Inferred", varname, "as", guess) + global parsed_args + if parsed_args.debug: + run([guess, "--version"]) def default_cross_toolchain(): @@ -188,6 +191,9 @@ if __name__ == "__main__": if parsed_args.host_compiler_type == "gcc": default_cc, default_cxx, default_cpp = ("gcc", "g++", "cpp") + # FIXME: this should take values like `clang-9` and then look for + # clang-cpp-9, etc. Would alleviate the need to set the bindir on + # ubuntu/debian at least. elif parsed_args.host_compiler_type == "clang": default_cc, default_cxx, default_cpp = ( "clang", "clang++", "clang-cpp") @@ -235,7 +241,5 @@ if __name__ == "__main__": shlex.quote(s) for s in [str(bmake_binary)] + bmake_args) debug("Running `env ", env_cmd_str, " ", make_cmd_str, "`", sep="") os.environ.update(new_env_vars) - if parsed_args.debug: - input("Press enter to continue...") os.chdir(str(source_root)) os.execv(str(bmake_binary), [str(bmake_binary)] + bmake_args) From owner-svn-src-all@freebsd.org Thu Nov 26 14:49:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D9C44ADECB; Thu, 26 Nov 2020 14:49:35 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChgdW0sJmz4ZZQ; Thu, 26 Nov 2020 14:49:34 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1606402172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2oAAJJSjbIekCYnWiBKwz6MEAolOKEDcei5RB9GQmlg=; b=SeKyANVbL4YJQYiLx97NvcV9f+xOhR9DW2MBQCZn9UZMcM8diwXM+6V8IBQj3FGh9VqztQ nrKH6B00md9igOcaluswMJKntxjYx9yw5zsh+E1WGrYDd4Dser5zO/vFp9z0Du4xDZ1hFJ eijp/BXFXaHsDO4f2ZrkaqfsVYF2kCg= Received: from skull.home.blih.net (lfbn-idf2-1-288-247.w82-123.abo.wanadoo.fr [82.123.126.247]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 875e448e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 26 Nov 2020 14:49:32 +0000 (UTC) Date: Thu, 26 Nov 2020 15:49:31 +0100 From: Emmanuel Vadot To: Alan Somers Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk Message-Id: <20201126154931.093e7b5097480d18a01caaf7@bidouilliste.com> In-Reply-To: References: <202011260429.0AQ4TV2B023801@repo.freebsd.org> <20201126092704.f689ac823d6571ca0c98212a@bidouilliste.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4ChgdW0sJmz4ZZQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 14:49:35 -0000 On Thu, 26 Nov 2020 07:36:37 -0700 Alan Somers wrote: > On Thu, Nov 26, 2020 at 1:27 AM Emmanuel Vadot > wrote: >=20 > > > > Hi Alan, > > > > On Thu, 26 Nov 2020 04:29:31 +0000 (UTC) > > Alan Somers wrote: > > > > > Author: asomers > > > Date: Thu Nov 26 04:29:30 2020 > > > New Revision: 368045 > > > URL: https://svnweb.freebsd.org/changeset/base/368045 > > > > > > Log: > > > Merge ping6 to ping > > > > > > There is now a single ping binary, which chooses to use ICMP or ICM= Pv4 > > > based on the -4 and -6 options, and the format of the address. > > > > > > Submitted by: J=E1n Su?an > > > Sponsored by: Google LLC (Google Summer of Code 2019) > > > MFC after: Never > > > Differential Revision: https://reviews.freebsd.org/D21377 > > > > > > Added: > > > head/sbin/ping/main.c (contents, props changed) > > > head/sbin/ping/main.h (contents, props changed) > > > head/sbin/ping/ping.h (contents, props changed) > > > head/sbin/ping/ping6.c > > > - copied, changed from r368010, head/sbin/ping6/ping6.c > > > head/sbin/ping/ping6.h (contents, props changed) > > > head/sbin/ping/tests/ping_6_c1_s8_t1.out > > > - copied unchanged from r368010, > > head/sbin/ping6/tests/ping6_c1_s8_t1.out > > > Deleted: > > > head/sbin/ping6/Makefile > > > head/sbin/ping6/Makefile.depend > > > head/sbin/ping6/ping6.8 > > > head/sbin/ping6/ping6.c > > > head/sbin/ping6/tests/Makefile > > > head/sbin/ping6/tests/ping6_c1_s8_t1.out > > > head/sbin/ping6/tests/ping6_test.sh > > > Modified: > > > head/ObsoleteFiles.inc > > > head/UPDATING > > > head/etc/mtree/BSD.tests.dist > > > head/rescue/rescue/Makefile > > > head/sbin/Makefile > > > head/sbin/ping/Makefile > > > head/sbin/ping/ping.8 > > > head/sbin/ping/ping.c > > > head/sbin/ping/tests/Makefile > > > head/sbin/ping/tests/ping_test.sh > > > head/tools/build/mk/OptionalObsoleteFiles.inc > > > > > > Modified: head/ObsoleteFiles.inc > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/ObsoleteFiles.inc Thu Nov 26 02:14:52 2020 (r36804= 4) > > > +++ head/ObsoleteFiles.inc Thu Nov 26 04:29:30 2020 (r36804= 5) > > > @@ -36,6 +36,16 @@ > > > # xargs -n1 | sort | uniq -d; > > > # done > > > > > > +# 20201124: ping6(8) was merged into ping(8) > > > +OLD_FILES+=3Dsbin/ping6 > > > +OLD_FILES+=3Drescue/ping6 > > > +OLD_FILES+=3Dusr/lib/debug/sbin/ping6.debug > > > +OLD_FILES+=3Dusr/share/man/man8/ping6.8.gz > > > +OLD_FILES+=3Dusr/tests/sbin/ping6/Kyuafile > > > +OLD_FILES+=3Dusr/tests/sbin/ping6/ping6_c1_s8_t1.out > > > +OLD_FILES+=3Dusr/tests/sbin/ping6/ping6_test > > > +OLD_DIRS+=3Dusr/tests/sbin/ping6 > > > + > > > # 20201025: Remove cal data files > > > OLD_FILES+=3Dusr/share/calendar/calendar.all > > > OLD_FILES+=3Dusr/share/calendar/calendar.australia > > > > > > Modified: head/UPDATING > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/UPDATING Thu Nov 26 02:14:52 2020 (r368044) > > > +++ head/UPDATING Thu Nov 26 04:29:30 2020 (r368045) > > > @@ -26,6 +26,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: > > > world, or to merely disable the most expensive debugging > > functionality > > > at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.con= f".) > > > > > > +20201124: > > > + ping6 has been merged into ping. It can now be called as "ping > > -6". > > > + See ping(8) for details. > > > + > > > 20201108: > > > Default value of net.add_addr_allfibs has been changed to 0. > > > If you have multi-fib configuration and rely on existence of all > > > > > > Modified: head/etc/mtree/BSD.tests.dist > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/etc/mtree/BSD.tests.dist Thu Nov 26 02:14:52 2020 > > (r368044) > > > +++ head/etc/mtree/BSD.tests.dist Thu Nov 26 04:29:30 2020 > > (r368045) > > > @@ -448,8 +448,6 @@ > > > .. > > > ping > > > .. > > > - ping6 > > > - .. > > > route > > > .. > > > .. > > > > > > Modified: head/rescue/rescue/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/rescue/rescue/Makefile Thu Nov 26 02:14:52 2020 > > (r368044) > > > +++ head/rescue/rescue/Makefile Thu Nov 26 04:29:30 2020 > > (r368045) > > > @@ -103,7 +103,6 @@ CRUNCH_PROGS_sbin+=3D ccdconfig > > > .endif > > > > > > .if ${MK_INET6_SUPPORT} !=3D "no" > > > -CRUNCH_PROGS_sbin+=3D ping6 > > > CRUNCH_PROGS_sbin+=3D rtsol > > > .endif > > > > > > > > > Modified: head/sbin/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/sbin/Makefile Thu Nov 26 02:14:52 2020 (r36804= 4) > > > +++ head/sbin/Makefile Thu Nov 26 04:29:30 2020 (r36804= 5) > > > @@ -73,7 +73,6 @@ SUBDIR.${MK_CCD}+=3D ccdconfig > > > SUBDIR.${MK_CXX}+=3D devd > > > SUBDIR.${MK_HAST}+=3D hastctl > > > SUBDIR.${MK_HAST}+=3D hastd > > > -SUBDIR.${MK_INET6}+=3D ping6 > > > SUBDIR.${MK_INET6}+=3D rtsol > > > SUBDIR.${MK_IPFILTER}+=3D ipf > > > SUBDIR.${MK_IPFW}+=3D ipfw > > > > > > Modified: head/sbin/ping/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/sbin/ping/Makefile Thu Nov 26 02:14:52 2020 (r36804= 4) > > > +++ head/sbin/ping/Makefile Thu Nov 26 04:29:30 2020 (r36804= 5) > > > @@ -5,11 +5,17 @@ > > > > > > PACKAGE=3Druntime > > > PROG=3D ping > > > -SRCS=3D ping.c utils.c > > > +SRCS=3D main.c ping.c utils.c > > > > I think you should add a LINKS=3D... here so people script which uses > > ping6 won't break (and of course adding support in the code to do ipv6 > > ping if progname is ping6 if this isn't the case). > > > > Cheers, > > > > -- > > Emmanuel Vadot > > >=20 > Yes, that would make sense. But for how long? Would the ping6 hard link > stick around forever, or eventually be removed in some future version of > FreeBSD? I have no opinion on this matter. But since ping6 was present for a very long time I guess we're stuck with it for a long time too. --=20 Emmanuel Vadot From owner-svn-src-all@freebsd.org Thu Nov 26 14:57:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1BB824AE51E; Thu, 26 Nov 2020 14:57:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chgpg09lYz4bB4; Thu, 26 Nov 2020 14:57:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED3E5251A4; Thu, 26 Nov 2020 14:57:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQEvUNS013699; Thu, 26 Nov 2020 14:57:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQEvUi6013698; Thu, 26 Nov 2020 14:57:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011261457.0AQEvUi6013698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 26 Nov 2020 14:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368057 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 368057 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 14:57:31 -0000 Author: markj Date: Thu Nov 26 14:57:30 2020 New Revision: 368057 URL: https://svnweb.freebsd.org/changeset/base/368057 Log: MFC r367849: callout(9): Fix a race between CPU migration and callout_drain() Modified: stable/12/sys/kern/kern_timeout.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_timeout.c ============================================================================== --- stable/12/sys/kern/kern_timeout.c Thu Nov 26 14:42:16 2020 (r368056) +++ stable/12/sys/kern/kern_timeout.c Thu Nov 26 14:57:30 2020 (r368057) @@ -1274,7 +1274,7 @@ again: * just wait for the current invocation to * finish. */ - while (cc_exec_curr(cc, direct) == c) { + if (cc_exec_curr(cc, direct) == c) { /* * Use direct calls to sleepqueue interface * instead of cv/msleep in order to avoid @@ -1322,7 +1322,7 @@ again: /* Reacquire locks previously released. */ PICKUP_GIANT(); - CC_LOCK(cc); + goto again; } c->c_flags &= ~CALLOUT_ACTIVE; } else if (use_lock && From owner-svn-src-all@freebsd.org Thu Nov 26 15:37:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3FF44AE974; Thu, 26 Nov 2020 15:37:25 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chhhj4MyXz4d3t; Thu, 26 Nov 2020 15:37:25 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f42.google.com with SMTP id 79so2178800otc.7; Thu, 26 Nov 2020 07:37:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zX3xNguAzYtLNPC40kk1tZ2V8v0eRQ9vp0rdD89lkHs=; b=qRUJY1HHh2ctkTK2XUZ6xz/TPb9pn7age6zktBSOsWST+eXJsQdVQAFgAAgTqP892Y AEpVtl7iQPJIB8wwPdbDHIlTcA7J7CjabbOtYIH2jRfYDuTZ/5xbtNByDHIflOl8CaTW Eunecvb5VFjCQMJxWsuowSloWmcWex/0ZLPdWHouRT2lkad/fE4E1yPW97OBtWIqkg2+ hH9333ZkEgWZbT9dBB3ZKmu1mCg+0Q5yr8x41SCEQJlVQCBNlYp3y+vNFjyUglVXKOLC rUSY0aJRlmLLqLu74ehulaA2y0unRh6QbRXw4PIAqEnCVevZbmz58LejBK+cfMSzkQR1 erLA== X-Gm-Message-State: AOAM532Cy2K34ZgcrlzvpZThanWfJjR3k7VvSudVfgncnQvshEnz74fO W89uvQUudrQNE2Vl02RehP6u0BcNuhSaXIlTBzRB+/6CsSo= X-Google-Smtp-Source: ABdhPJwLKHOseU0XukweJQu/db/pN3Mw+yvBpHdpwfbqlsFfL+8DiMB83Czry8Q7oZSdJvHvRCHhQeLStgCwggo5O4E= X-Received: by 2002:a9d:3e1b:: with SMTP id a27mr2688902otd.291.1606405044665; Thu, 26 Nov 2020 07:37:24 -0800 (PST) MIME-Version: 1.0 References: <202011260429.0AQ4TV2B023801@repo.freebsd.org> <20201126092704.f689ac823d6571ca0c98212a@bidouilliste.com> <20201126154931.093e7b5097480d18a01caaf7@bidouilliste.com> In-Reply-To: <20201126154931.093e7b5097480d18a01caaf7@bidouilliste.com> From: Alan Somers Date: Thu, 26 Nov 2020 08:37:13 -0700 Message-ID: Subject: Re: svn commit: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk To: Emmanuel Vadot Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4Chhhj4MyXz4d3t X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 15:37:25 -0000 > > > > > I think you should add a LINKS=... here so people script which uses > > > ping6 won't break (and of course adding support in the code to do ipv6 > > > ping if progname is ping6 if this isn't the case). > > > > > > Cheers, > > > > > > -- > > > Emmanuel Vadot > > > > > > > Yes, that would make sense. But for how long? Would the ping6 hard link > > stick around forever, or eventually be removed in some future version of > > FreeBSD? > > I have no opinion on this matter. > But since ping6 was present for a very long time I guess we're stuck > with it for a long time too. > Do you have an opinion on whether there should be a /rescue/ping6 link too? From owner-svn-src-all@freebsd.org Thu Nov 26 15:46:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 126EE4AF315; Thu, 26 Nov 2020 15:46:15 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chhtt3RwWz4dc3; Thu, 26 Nov 2020 15:46:14 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1606405572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sczXNvBgFojjpEFw5UXUMwOVOvy2BfXVEwtFZ8FQVCY=; b=CPpaZeBs4+UvUsndpEuw973ccHKZUU0Te8Ypv91LveCH0YqFGkVYVmYxH1JA5OaubRtfpF B5kOEfnCQGRWlS/DPISRHGL0/q1FlzPkzMYubpaWkFzP+MUTDBkrAcFkn3aHn5HRg4Pmlx E2TEi8SM/Ty80q4eDUHU3ZRVtLueU3w= Received: from skull.home.blih.net (lfbn-idf2-1-288-247.w82-123.abo.wanadoo.fr [82.123.126.247]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 33dcb394 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 26 Nov 2020 15:46:12 +0000 (UTC) Date: Thu, 26 Nov 2020 16:46:12 +0100 From: Emmanuel Vadot To: Alan Somers Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk Message-Id: <20201126164612.0177933dc84807f75bb50d10@bidouilliste.com> In-Reply-To: References: <202011260429.0AQ4TV2B023801@repo.freebsd.org> <20201126092704.f689ac823d6571ca0c98212a@bidouilliste.com> <20201126154931.093e7b5097480d18a01caaf7@bidouilliste.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Chhtt3RwWz4dc3 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 15:46:15 -0000 On Thu, 26 Nov 2020 08:37:13 -0700 Alan Somers wrote: > > > > > > > I think you should add a LINKS=... here so people script which uses > > > > ping6 won't break (and of course adding support in the code to do ipv6 > > > > ping if progname is ping6 if this isn't the case). > > > > > > > > Cheers, > > > > > > > > -- > > > > Emmanuel Vadot > > > > > > > > > > Yes, that would make sense. But for how long? Would the ping6 hard link > > > stick around forever, or eventually be removed in some future version of > > > FreeBSD? > > > > I have no opinion on this matter. > > But since ping6 was present for a very long time I guess we're stuck > > with it for a long time too. > > > > Do you have an opinion on whether there should be a /rescue/ping6 link too? I'll be honest I don't use ipv6 at all, I've just noticed this problem when reading my morning email :) -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Thu Nov 26 16:26:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50ACE46859C for ; Thu, 26 Nov 2020 16:26:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chjnm1cTsz4hTt for ; Thu, 26 Nov 2020 16:26:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf33.google.com with SMTP id k3so1156118qvz.4 for ; Thu, 26 Nov 2020 08:26:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gKrv2a2Pykp94s+1BSMNMK/WJ3FGx4ER7JhkNMjgwvI=; b=PS9YHu1WYAg13dsAO9bgxb3bIbcc1a+59BxiPY2dhCmudL0KNvkQlMdnHT3vFMeRGu Y+3sw54mCJMYesTYYs4Xaw46VR3/evDVDIfSFaoBGcsBusSKL4M4Gftq4TlsAmRkXWaM o7Jcs0tqMVWO9Aa8H5rxMVBIaw9F7vkDSBYRanq3w7DnbHJfT8+9whAvgXBLuGPEGtRm B/oBekcDzp6LK7VHdEd3jpYAu+cP5FB43+EllUbfJHeHqAGVi50yBOBkdOyzRNitbXGd mYdanyzJThegWZpxSj9AKSMRhLEBEV8KGgyX06OEFDQfV10OHAVguMKfyqxFWd9AP71w +o3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gKrv2a2Pykp94s+1BSMNMK/WJ3FGx4ER7JhkNMjgwvI=; b=LoYV/H72C9/Y4jbI4GtiC+/OJJ23qGz/TCiNg+BcjozUkntCvicQPLHX7eefLH4ARF pxIMiP+ibdgbtzynyYA9njrZ+qBsXjrowh/rhRmvhw7E4cfn4hiOvrMqAYuDV3klz7Oy K34b6zdlGHGskU8ydqAwdEMkKRzG3Cq5JwoM4QNXiyj8Iw2Y5FFi7ySfEMXx67TatAGL 9FlNgQ3SAPA9boUJOpfrwIES3qZX8bVQUmXi3ue0jQLXl/SQr7a3K1WC9aiR8tQXP+fV k19ub5XYc9QKgZbuGu9awAbklffYPlnXnN98dQer+L5raqvs/hT045NSwTMjL5zecp6D A7MA== X-Gm-Message-State: AOAM531Q3SPDs+9t2iFX3lmHF2fp//wAV+boMib+oNdCPpoDp+Azln4p lVRFxkkxhg6iN2zhKH1QRBwkYuCOUswGP5fFhl/iIA== X-Google-Smtp-Source: ABdhPJys6fNDNmoRLGdpuvExUg70GGc87N/qVwOjTxeevwzTiCz0gr3OVcEDERD1GPh1GE6fjJVM42VBZirc9pLwiRI= X-Received: by 2002:ad4:4e13:: with SMTP id dl19mr3890766qvb.24.1606408011179; Thu, 26 Nov 2020 08:26:51 -0800 (PST) MIME-Version: 1.0 References: <202011260429.0AQ4TV2B023801@repo.freebsd.org> <20201126092704.f689ac823d6571ca0c98212a@bidouilliste.com> <20201126154931.093e7b5097480d18a01caaf7@bidouilliste.com> In-Reply-To: From: Warner Losh Date: Thu, 26 Nov 2020 09:26:39 -0700 Message-ID: Subject: Re: svn commit: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk To: Alan Somers Cc: Emmanuel Vadot , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4Chjnm1cTsz4hTt X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 16:26:52 -0000 On Thu, Nov 26, 2020, 8:37 AM Alan Somers wrote: > > > > > > >> > > I think you should add a LINKS=... here so people script which uses >> > > ping6 won't break (and of course adding support in the code to do ipv6 >> > > ping if progname is ping6 if this isn't the case). >> > > >> > > Cheers, >> > > >> > > -- >> > > Emmanuel Vadot >> > > >> > >> > Yes, that would make sense. But for how long? Would the ping6 hard >> link >> > stick around forever, or eventually be removed in some future version of >> > FreeBSD? >> >> I have no opinion on this matter. >> But since ping6 was present for a very long time I guess we're stuck >> with it for a long time too. >> > > Do you have an opinion on whether there should be a /rescue/ping6 link > too? > Yes. It should, imho. Warner > From owner-svn-src-all@freebsd.org Thu Nov 26 16:36:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A7614682F1; Thu, 26 Nov 2020 16:36:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chk1J0h9gz4hjp; Thu, 26 Nov 2020 16:36:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A5CC263F5; Thu, 26 Nov 2020 16:36:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQGapsx074936; Thu, 26 Nov 2020 16:36:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQGaolc074928; Thu, 26 Nov 2020 16:36:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011261636.0AQGaolc074928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 26 Nov 2020 16:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368058 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 368058 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 16:36:52 -0000 Author: hselasky Date: Thu Nov 26 16:36:50 2020 New Revision: 368058 URL: https://svnweb.freebsd.org/changeset/base/368058 Log: Ensure consistent error messages from ifconfig(8). If multiple threads are invoking "ifconfig XXX create" a race may occur which can lead to two different error messages for the same error. a) ifconfig: SIOCIFCREATE2: File exists b) ifconfig: interface XXX already exists This patch ensures ifconfig prints the same error code for the same case. Reviewed by: imp@ and kib@ Differential Revision: https://reviews.freebsd.org/D27380 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sbin/ifconfig/ifclone.c head/sbin/ifconfig/ifconfig.c head/sbin/ifconfig/ifconfig.h head/sbin/ifconfig/ifieee80211.c head/sbin/ifconfig/iflagg.c head/sbin/ifconfig/ifvlan.c head/sbin/ifconfig/ifvxlan.c Modified: head/sbin/ifconfig/ifclone.c ============================================================================== --- head/sbin/ifconfig/ifclone.c Thu Nov 26 14:57:30 2020 (r368057) +++ head/sbin/ifconfig/ifclone.c Thu Nov 26 16:36:50 2020 (r368058) @@ -151,8 +151,7 @@ ifclonecreate(int s, void *arg) } if (clone_cb == NULL) { /* NB: no parameters */ - if (ioctl(s, SIOCIFCREATE2, &ifr) < 0) - err(1, "SIOCIFCREATE2"); + ioctl_ifcreate(s, &ifr); } else { clone_cb(s, &ifr); } Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Thu Nov 26 14:57:30 2020 (r368057) +++ head/sbin/ifconfig/ifconfig.c Thu Nov 26 16:36:50 2020 (r368058) @@ -198,6 +198,19 @@ usage(void) exit(1); } +void +ioctl_ifcreate(int s, struct ifreq *ifr) +{ + if (ioctl(s, SIOCIFCREATE2, ifr) < 0) { + switch (errno) { + case EEXIST: + errx(1, "interface %s already exists", ifr->ifr_name); + default: + err(1, "SIOCIFCREATE2"); + } + } +} + #define ORDERS_SIZE(x) sizeof(x) / sizeof(x[0]) static int Modified: head/sbin/ifconfig/ifconfig.h ============================================================================== --- head/sbin/ifconfig/ifconfig.h Thu Nov 26 14:57:30 2020 (r368057) +++ head/sbin/ifconfig/ifconfig.h Thu Nov 26 16:36:50 2020 (r368058) @@ -160,3 +160,4 @@ struct ifmediareq *ifmedia_getstate(int s); void print_vhid(const struct ifaddrs *, const char *); +void ioctl_ifcreate(int s, struct ifreq *); Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Thu Nov 26 14:57:30 2020 (r368057) +++ head/sbin/ifconfig/ifieee80211.c Thu Nov 26 16:36:50 2020 (r368058) @@ -5758,8 +5758,7 @@ wlan_create(int s, struct ifreq *ifr) memcmp(params.icp_bssid, zerobssid, sizeof(zerobssid)) == 0) errx(1, "no bssid specified for WDS (use wlanbssid)"); ifr->ifr_data = (caddr_t) ¶ms; - if (ioctl(s, SIOCIFCREATE2, ifr) < 0) - err(1, "SIOCIFCREATE2"); + ioctl_ifcreate(s, ifr); /* XXX preserve original name for ifclonecreate(). */ strlcpy(orig_name, name, sizeof(orig_name)); Modified: head/sbin/ifconfig/iflagg.c ============================================================================== --- head/sbin/ifconfig/iflagg.c Thu Nov 26 14:57:30 2020 (r368057) +++ head/sbin/ifconfig/iflagg.c Thu Nov 26 16:36:50 2020 (r368058) @@ -324,8 +324,7 @@ static void lagg_create(int s, struct ifreq *ifr) { ifr->ifr_data = (caddr_t) ¶ms; - if (ioctl(s, SIOCIFCREATE2, ifr) < 0) - err(1, "SIOCIFCREATE2"); + ioctl_ifcreate(s, ifr); } static struct cmd lagg_cmds[] = { Modified: head/sbin/ifconfig/ifvlan.c ============================================================================== --- head/sbin/ifconfig/ifvlan.c Thu Nov 26 14:57:30 2020 (r368057) +++ head/sbin/ifconfig/ifvlan.c Thu Nov 26 16:36:50 2020 (r368058) @@ -162,8 +162,7 @@ vlan_create(int s, struct ifreq *ifr) errx(1, "must specify a parent device for vlan create"); ifr->ifr_data = (caddr_t) ¶ms; } - if (ioctl(s, SIOCIFCREATE2, ifr) < 0) - err(1, "SIOCIFCREATE2"); + ioctl_ifcreate(s, ifr); } static void Modified: head/sbin/ifconfig/ifvxlan.c ============================================================================== --- head/sbin/ifconfig/ifvxlan.c Thu Nov 26 14:57:30 2020 (r368057) +++ head/sbin/ifconfig/ifvxlan.c Thu Nov 26 16:36:50 2020 (r368058) @@ -191,8 +191,7 @@ vxlan_create(int s, struct ifreq *ifr) vxlan_check_params(); ifr->ifr_data = (caddr_t) ¶ms; - if (ioctl(s, SIOCIFCREATE2, ifr) < 0) - err(1, "SIOCIFCREATE2"); + ioctl_ifcreate(s, ifr); } static From owner-svn-src-all@freebsd.org Thu Nov 26 16:39:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 868E5468A01; Thu, 26 Nov 2020 16:39:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chk4s3R3Yz4j84; Thu, 26 Nov 2020 16:39:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E3A926266; Thu, 26 Nov 2020 16:39:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQGdvdX075107; Thu, 26 Nov 2020 16:39:57 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQGdv3b075106; Thu, 26 Nov 2020 16:39:57 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011261639.0AQGdv3b075106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 26 Nov 2020 16:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368059 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 368059 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 16:39:57 -0000 Author: manu Date: Thu Nov 26 16:39:56 2020 New Revision: 368059 URL: https://svnweb.freebsd.org/changeset/base/368059 Log: mmccam: We can't sleep during sdda_add_part so use M_NOWAIT Reviewed by: kibab Differential Revision: https://reviews.freebsd.org/D25947 Modified: head/sys/cam/mmc/mmc_da.c Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Thu Nov 26 16:36:50 2020 (r368058) +++ head/sys/cam/mmc/mmc_da.c Thu Nov 26 16:39:56 2020 (r368059) @@ -202,7 +202,7 @@ static inline bool sdda_get_read_only(struct cam_perip static uint32_t mmc_get_spec_vers(struct cam_periph *periph); static uint64_t mmc_get_media_size(struct cam_periph *periph); static uint32_t mmc_get_cmd6_timeout(struct cam_periph *periph); -static void sdda_add_part(struct cam_periph *periph, u_int type, +static bool sdda_add_part(struct cam_periph *periph, u_int type, const char *name, u_int cnt, off_t media_size, bool ro); static struct periph_driver sddadriver = @@ -1502,10 +1502,11 @@ finish_hs_tests: sdda_process_mmc_partitions(periph, start_ccb); } else if (mmcp->card_features & CARD_FEATURE_SD20) { /* For SD[HC] cards, just add one partition that is the whole card */ - sdda_add_part(periph, 0, "sdda", + if (sdda_add_part(periph, 0, "sdda", periph->unit_number, mmc_get_media_size(periph), - sdda_get_read_only(periph, start_ccb)); + sdda_get_read_only(periph, start_ccb)) == false) + return; softc->part_curr = 0; } cam_periph_hold(periph, PRIBIO|PCATCH); @@ -1521,7 +1522,7 @@ finish_hs_tests: AC_ADVINFO_CHANGED, sddaasync, periph, periph->path); } -static void +static bool sdda_add_part(struct cam_periph *periph, u_int type, const char *name, u_int cnt, off_t media_size, bool ro) { @@ -1536,7 +1537,11 @@ sdda_add_part(struct cam_periph *periph, u_int type, c ro ? "(read-only)" : "")); part = sc->part[type] = malloc(sizeof(*part), M_DEVBUF, - M_WAITOK | M_ZERO); + M_NOWAIT | M_ZERO); + if (part == NULL) { + printf("Cannot add partition for sdda\n"); + return (false); + } part->cnt = cnt; part->type = type; @@ -1554,7 +1559,7 @@ sdda_add_part(struct cam_periph *periph, u_int type, c /* TODO: Create device, assign IOCTL handler */ CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH, ("Don't know what to do with RPMB partitions yet\n")); - return; + return (false); } bioq_init(&part->bio_queue); @@ -1620,11 +1625,13 @@ sdda_add_part(struct cam_periph *periph, u_int type, c xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); - return; + return (false); } disk_create(part->disk, DISK_VERSION); cam_periph_lock(periph); cam_periph_unhold(periph); + + return (true); } /* From owner-svn-src-all@freebsd.org Thu Nov 26 16:40:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52647468995; Thu, 26 Nov 2020 16:40:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chk5K0fQ6z4j8q; Thu, 26 Nov 2020 16:40:21 +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 F214126683; Thu, 26 Nov 2020 16:40:20 +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 0AQGeK2r075211; Thu, 26 Nov 2020 16:40:20 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQGeKmM075210; Thu, 26 Nov 2020 16:40:20 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011261640.0AQGeKmM075210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 26 Nov 2020 16:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368060 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 368060 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 16:40:21 -0000 Author: manu Date: Thu Nov 26 16:40:20 2020 New Revision: 368060 URL: https://svnweb.freebsd.org/changeset/base/368060 Log: sdhci: Only print mmccam debug code if hw.sdhci.debug is > 1 Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Thu Nov 26 16:39:56 2020 (r368059) +++ head/sys/dev/sdhci/sdhci.c Thu Nov 26 16:40:20 2020 (r368060) @@ -2650,31 +2650,38 @@ sdhci_cam_settran_settings(struct sdhci_slot *slot, un /* Update only requested fields */ if (cts->ios_valid & MMC_CLK) { ios->clock = sdhci_cam_get_possible_host_clock(slot, new_ios->clock); - slot_printf(slot, "Clock => %d\n", ios->clock); + if (sdhci_debug > 1) + slot_printf(slot, "Clock => %d\n", ios->clock); } if (cts->ios_valid & MMC_VDD) { ios->vdd = new_ios->vdd; - slot_printf(slot, "VDD => %d\n", ios->vdd); + if (sdhci_debug > 1) + slot_printf(slot, "VDD => %d\n", ios->vdd); } if (cts->ios_valid & MMC_CS) { ios->chip_select = new_ios->chip_select; - slot_printf(slot, "CS => %d\n", ios->chip_select); + if (sdhci_debug > 1) + slot_printf(slot, "CS => %d\n", ios->chip_select); } if (cts->ios_valid & MMC_BW) { ios->bus_width = new_ios->bus_width; - slot_printf(slot, "Bus width => %d\n", ios->bus_width); + if (sdhci_debug > 1) + slot_printf(slot, "Bus width => %d\n", ios->bus_width); } if (cts->ios_valid & MMC_PM) { ios->power_mode = new_ios->power_mode; - slot_printf(slot, "Power mode => %d\n", ios->power_mode); + if (sdhci_debug > 1) + slot_printf(slot, "Power mode => %d\n", ios->power_mode); } if (cts->ios_valid & MMC_BT) { ios->timing = new_ios->timing; - slot_printf(slot, "Timing => %d\n", ios->timing); + if (sdhci_debug > 1) + slot_printf(slot, "Timing => %d\n", ios->timing); } if (cts->ios_valid & MMC_BM) { ios->bus_mode = new_ios->bus_mode; - slot_printf(slot, "Bus mode => %d\n", ios->bus_mode); + if (sdhci_debug > 1) + slot_printf(slot, "Bus mode => %d\n", ios->bus_mode); } /* XXX Provide a way to call a chip-specific IOS update, required for TI */ @@ -2686,7 +2693,8 @@ sdhci_cam_update_ios(struct sdhci_slot *slot) { struct mmc_ios *ios = &slot->host.ios; - slot_printf(slot, "%s: power_mode=%d, clk=%d, bus_width=%d, timing=%d\n", + if (sdhci_debug > 1) + slot_printf(slot, "%s: power_mode=%d, clk=%d, bus_width=%d, timing=%d\n", __func__, ios->power_mode, ios->clock, ios->bus_width, ios->timing); SDHCI_LOCK(slot); /* Do full reset on bus power down to clear from any state. */ From owner-svn-src-all@freebsd.org Thu Nov 26 16:40:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA5A34688C0; Thu, 26 Nov 2020 16:40:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chk5g4XR5z4jJM; Thu, 26 Nov 2020 16:40:39 +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 8EB8C26685; Thu, 26 Nov 2020 16:40:39 +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 0AQGedRo076021; Thu, 26 Nov 2020 16:40:39 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQGedox076020; Thu, 26 Nov 2020 16:40:39 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011261640.0AQGedox076020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 26 Nov 2020 16:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368061 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 368061 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 16:40:39 -0000 Author: manu Date: Thu Nov 26 16:40:39 2020 New Revision: 368061 URL: https://svnweb.freebsd.org/changeset/base/368061 Log: sdhci: mmccam: Update vccq in the driver ios Otherwise we always report that the card is running at 1.2V. Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Thu Nov 26 16:40:20 2020 (r368060) +++ head/sys/dev/sdhci/sdhci.c Thu Nov 26 16:40:39 2020 (r368061) @@ -2683,6 +2683,11 @@ sdhci_cam_settran_settings(struct sdhci_slot *slot, un if (sdhci_debug > 1) slot_printf(slot, "Bus mode => %d\n", ios->bus_mode); } + if (cts->ios_valid & MMC_VCCQ) { + ios->vccq = new_ios->vccq; + if (sdhci_debug > 1) + slot_printf(slot, "VCCQ => %d\n", ios->vccq); + } /* XXX Provide a way to call a chip-specific IOS update, required for TI */ return (sdhci_cam_update_ios(slot)); From owner-svn-src-all@freebsd.org Thu Nov 26 16:52:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1280F4689DF; Thu, 26 Nov 2020 16:52:20 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChkM774KYz4kNx; Thu, 26 Nov 2020 16:52:19 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5561268BB; Thu, 26 Nov 2020 16:52:19 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQGqJ7Q087396; Thu, 26 Nov 2020 16:52:19 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQGqHxu087384; Thu, 26 Nov 2020 16:52:17 GMT (envelope-from se@FreeBSD.org) Message-Id: <202011261652.0AQGqHxu087384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Thu, 26 Nov 2020 16:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r368062 - in vendor/bc/dist: . gen include manuals manuals/bc manuals/dc src X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: in vendor/bc/dist: . gen include manuals manuals/bc manuals/dc src X-SVN-Commit-Revision: 368062 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 16:52:20 -0000 Author: se Date: Thu Nov 26 16:52:17 2020 New Revision: 368062 URL: https://svnweb.freebsd.org/changeset/base/368062 Log: Update to version 3.2.0 Modified: vendor/bc/dist/.gitignore vendor/bc/dist/Makefile.in vendor/bc/dist/NEWS.md vendor/bc/dist/README.md vendor/bc/dist/configure.sh vendor/bc/dist/gen/lib.bc vendor/bc/dist/gen/strgen.c vendor/bc/dist/gen/strgen.sh vendor/bc/dist/include/file.h vendor/bc/dist/include/lex.h vendor/bc/dist/include/num.h vendor/bc/dist/include/parse.h vendor/bc/dist/include/rand.h vendor/bc/dist/include/status.h vendor/bc/dist/include/vector.h vendor/bc/dist/include/vm.h vendor/bc/dist/manpage.sh vendor/bc/dist/manuals/bc.1.md.in vendor/bc/dist/manuals/bc/A.1 vendor/bc/dist/manuals/bc/A.1.md vendor/bc/dist/manuals/bc/E.1 vendor/bc/dist/manuals/bc/E.1.md vendor/bc/dist/manuals/bc/EH.1 vendor/bc/dist/manuals/bc/EH.1.md vendor/bc/dist/manuals/bc/EHN.1 vendor/bc/dist/manuals/bc/EHN.1.md vendor/bc/dist/manuals/bc/EHNP.1 vendor/bc/dist/manuals/bc/EHNP.1.md vendor/bc/dist/manuals/bc/EHP.1 vendor/bc/dist/manuals/bc/EHP.1.md vendor/bc/dist/manuals/bc/EN.1 vendor/bc/dist/manuals/bc/EN.1.md vendor/bc/dist/manuals/bc/ENP.1 vendor/bc/dist/manuals/bc/ENP.1.md vendor/bc/dist/manuals/bc/EP.1 vendor/bc/dist/manuals/bc/EP.1.md vendor/bc/dist/manuals/bc/H.1 vendor/bc/dist/manuals/bc/H.1.md vendor/bc/dist/manuals/bc/HN.1 vendor/bc/dist/manuals/bc/HN.1.md vendor/bc/dist/manuals/bc/HNP.1 vendor/bc/dist/manuals/bc/HNP.1.md vendor/bc/dist/manuals/bc/HP.1 vendor/bc/dist/manuals/bc/HP.1.md vendor/bc/dist/manuals/bc/N.1 vendor/bc/dist/manuals/bc/N.1.md vendor/bc/dist/manuals/bc/NP.1 vendor/bc/dist/manuals/bc/NP.1.md vendor/bc/dist/manuals/bc/P.1 vendor/bc/dist/manuals/bc/P.1.md vendor/bc/dist/manuals/build.md vendor/bc/dist/manuals/dc.1.md.in vendor/bc/dist/manuals/dc/A.1 vendor/bc/dist/manuals/dc/A.1.md vendor/bc/dist/manuals/dc/E.1 vendor/bc/dist/manuals/dc/E.1.md vendor/bc/dist/manuals/dc/EH.1 vendor/bc/dist/manuals/dc/EH.1.md vendor/bc/dist/manuals/dc/EHN.1 vendor/bc/dist/manuals/dc/EHN.1.md vendor/bc/dist/manuals/dc/EHNP.1 vendor/bc/dist/manuals/dc/EHNP.1.md vendor/bc/dist/manuals/dc/EHP.1 vendor/bc/dist/manuals/dc/EHP.1.md vendor/bc/dist/manuals/dc/EN.1 vendor/bc/dist/manuals/dc/EN.1.md vendor/bc/dist/manuals/dc/ENP.1 vendor/bc/dist/manuals/dc/ENP.1.md vendor/bc/dist/manuals/dc/EP.1 vendor/bc/dist/manuals/dc/EP.1.md vendor/bc/dist/manuals/dc/H.1 vendor/bc/dist/manuals/dc/H.1.md vendor/bc/dist/manuals/dc/HN.1 vendor/bc/dist/manuals/dc/HN.1.md vendor/bc/dist/manuals/dc/HNP.1 vendor/bc/dist/manuals/dc/HNP.1.md vendor/bc/dist/manuals/dc/HP.1 vendor/bc/dist/manuals/dc/HP.1.md vendor/bc/dist/manuals/dc/N.1 vendor/bc/dist/manuals/dc/N.1.md vendor/bc/dist/manuals/dc/NP.1 vendor/bc/dist/manuals/dc/NP.1.md vendor/bc/dist/manuals/dc/P.1 vendor/bc/dist/manuals/dc/P.1.md vendor/bc/dist/release.sh vendor/bc/dist/src/args.c vendor/bc/dist/src/data.c vendor/bc/dist/src/file.c vendor/bc/dist/src/lang.c vendor/bc/dist/src/lex.c vendor/bc/dist/src/main.c vendor/bc/dist/src/num.c vendor/bc/dist/src/opt.c vendor/bc/dist/src/parse.c vendor/bc/dist/src/program.c vendor/bc/dist/src/read.c vendor/bc/dist/src/vector.c vendor/bc/dist/src/vm.c Modified: vendor/bc/dist/.gitignore ============================================================================== --- vendor/bc/dist/.gitignore Thu Nov 26 16:40:39 2020 (r368061) +++ vendor/bc/dist/.gitignore Thu Nov 26 16:52:17 2020 (r368062) @@ -9,6 +9,7 @@ bin/*bc bin/*bc.exe bin/*dc bin/*dc.exe +bin/bcl bc.old *.o *.a Modified: vendor/bc/dist/Makefile.in ============================================================================== --- vendor/bc/dist/Makefile.in Thu Nov 26 16:40:39 2020 (r368061) +++ vendor/bc/dist/Makefile.in Thu Nov 26 16:52:17 2020 (r368062) @@ -29,33 +29,13 @@ # .POSIX: -VERSION = 3.1.6 +VERSION = 3.2.0 SRC = %%SRC%% OBJ = %%OBJ%% GCDA = %%GCDA%% GCNO = %%GCNO%% -BC_SRC = %%BC_SRC%% -BC_OBJ = %%BC_OBJ%% -BC_GCDA = %%BC_GCDA%% -BC_GCNO = %%BC_GCNO%% - -DC_SRC = %%DC_SRC%% -DC_OBJ = %%DC_OBJ%% -DC_GCDA = %%DC_GCDA%% -DC_GCNO = %%DC_GCNO%% - -HISTORY_SRC = %%HISTORY_SRC%% -HISTORY_OBJ = %%HISTORY_OBJ%% -HISTORY_GCDA = %%HISTORY_GCDA%% -HISTORY_GCNO = %%HISTORY_GCNO%% - -RAND_SRC = %%RAND_SRC%% -RAND_OBJ = %%RAND_OBJ%% -RAND_GCDA = %%RAND_GCDA%% -RAND_GCNO = %%RAND_GCNO%% - BC_ENABLED_NAME = BC_ENABLED BC_ENABLED = %%BC_ENABLED%% DC_ENABLED_NAME = DC_ENABLED @@ -102,6 +82,13 @@ DC = dc BC_EXEC = $(BIN)/$(EXEC_PREFIX)$(BC) DC_EXEC = $(BIN)/$(EXEC_PREFIX)$(DC) +LIB = libbcl +LIB_NAME = $(LIB).a +LIBBC = $(BIN)/$(LIB_NAME) +BCL = bcl +BCL_TEST = $(BIN)/$(BCL) +BCL_TEST_C = tests/$(BCL).c + MANUALS = manuals BC_MANPAGE_NAME = $(EXEC_PREFIX)$(BC)$(EXEC_SUFFIX).1 BC_MANPAGE = $(MANUALS)/$(BC).1 @@ -109,16 +96,28 @@ BC_MD = $(BC_MANPAGE).md DC_MANPAGE_NAME = $(EXEC_PREFIX)$(DC)$(EXEC_SUFFIX).1 DC_MANPAGE = $(MANUALS)/$(DC).1 DC_MD = $(DC_MANPAGE).md +BCL_MANPAGE_NAME = bcl.3 +BCL_MANPAGE = $(MANUALS)/$(BCL_MANPAGE_NAME) +BCL_MD = $(BCL_MANPAGE).md MANPAGE_INSTALL_ARGS = -Dm644 +BINARY_INSTALL_ARGS = -Dm755 +BCL_HEADER_NAME = bcl.h +BCL_HEADER = include/$(BCL_HEADER_NAME) + %%DESTDIR%% BINDIR = %%BINDIR%% +INCLUDEDIR = %%INCLUDEDIR%% +LIBDIR = %%LIBDIR%% MAN1DIR = %%MAN1DIR%% +MAN3DIR = %%MAN3DIR%% MAIN_EXEC = $(EXEC_PREFIX)$(%%MAIN_EXEC%%)$(EXEC_SUFFIX) EXEC = $(%%EXEC%%) NLSPATH = %%NLSPATH%% +BC_ENABLE_LIBRARY = %%LIBRARY%% + BC_ENABLE_HISTORY = %%HISTORY%% BC_ENABLE_EXTRA_MATH_NAME = BC_ENABLE_EXTRA_MATH BC_ENABLE_EXTRA_MATH = %%EXTRA_MATH%% @@ -129,7 +128,7 @@ BC_LONG_BIT = %%LONG_BIT%% RM = rm MKDIR = mkdir -INSTALL = ./install.sh +INSTALL = ./exec-install.sh SAFE_INSTALL = ./safe-install.sh LINK = ./link.sh MANPAGE = ./manpage.sh @@ -148,7 +147,7 @@ CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_ CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) -DBC_ENABLE_PROMPT=$(BC_ENABLE_PROMPT) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) -CPPFLAGS = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) +CPPFLAGS = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY) CFLAGS = $(CPPFLAGS) %%CPPFLAGS%% %%CFLAGS%% LDFLAGS = %%LDFLAGS%% @@ -157,21 +156,24 @@ HOSTCFLAGS = %%HOSTCFLAGS%% CC = %%CC%% HOSTCC = %%HOSTCC%% -BC_LIB_C_ARGS = bc_lib bc.h bc_lib_name $(BC_ENABLED_NAME) 1 -BC_LIB2_C_ARGS = bc_lib2 bc.h bc_lib2_name "$(BC_ENABLED_NAME) && $(BC_ENABLE_EXTRA_MATH_NAME)" 1 +BC_LIB_C_ARGS = bc_lib bc_lib_name $(BC_ENABLED_NAME) 1 +BC_LIB2_C_ARGS = bc_lib2 bc_lib2_name "$(BC_ENABLED_NAME) && $(BC_ENABLE_EXTRA_MATH_NAME)" 1 -OBJS1 = $(OBJ) $(DC_OBJ) $(BC_OBJ) $(HISTORY_OBJ) $(RAND_OBJ) $(BC_HELP_O) $(DC_HELP_O) -OBJS = $(OBJS1) $(BC_LIB_O) $(BC_LIB2_O) $(BC_LIB3_O) -OBJ_TARGETS1 = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(BC_LIB3_O) -OBJ_TARGETS = $(OBJ_TARGETS1) $(BC_OBJ) $(DC_OBJ) $(HISTORY_OBJ) $(RAND_OBJ) $(OBJ) +OBJS = $(BC_HELP_O) $(DC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) +OBJ_TARGETS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) .c.o: $(CC) $(CFLAGS) -o $@ -c $< -all: make_bin $(OBJ_TARGETS) +all: %%ALL_PREREQ%% + +execs: make_bin $(OBJ_TARGETS) $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(EXEC) %%LINK%% +library: make_bin $(OBJ) $(BC_LIB_O) $(BC_LIB2_O) + ar -r -cu $(LIBBC) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) + $(GEN_EXEC): %%GEN_EXEC_TARGET%% @@ -182,10 +184,10 @@ $(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2) $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_LIB2_C_ARGS) $(BC_HELP_C): $(GEN_EXEC) $(BC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help bc.h "" $(BC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help "" $(BC_ENABLED_NAME) $(DC_HELP_C): $(GEN_EXEC) $(DC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help dc.h "" $(DC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help "" $(DC_ENABLED_NAME) make_bin: $(MKDIR) -p $(BIN) @@ -222,7 +224,7 @@ help: check: test -test: test_bc timeconst test_dc +test: %%TESTS%% test_bc: %%BC_TEST%% @@ -241,6 +243,12 @@ time_test_dc: timeconst: %%TIMECONST%% +library_test: library + $(CC) $(CFLAGS) $(BCL_TEST_C) $(LIBBC) -o $(BCL_TEST) + +test_library: library_test + $(BCL_TEST) + valgrind: valgrind_bc valgrind_dc valgrind_bc: @@ -272,6 +280,7 @@ extra_math: manpages: $(MANPAGE) bc $(MANPAGE) dc + $(MANPAGE) bcl clean_gen: @$(RM) -f $(GEN_EXEC) @@ -279,10 +288,6 @@ clean_gen: clean:%%CLEAN_PREREQS%% @printf 'Cleaning files...\n' @$(RM) -f $(OBJ) - @$(RM) -f $(BC_OBJ) - @$(RM) -f $(DC_OBJ) - @$(RM) -f $(HISTORY_OBJ) - @$(RM) -f $(RAND_OBJ) @$(RM) -f $(BC_EXEC) @$(RM) -f $(DC_EXEC) @$(RM) -fr $(BIN) @@ -343,9 +348,20 @@ install_bc_manpage: install_dc_manpage: $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(DC_MANPAGE) $(DESTDIR)$(MAN1DIR)/$(DC_MANPAGE_NAME) -install:%%INSTALL_LOCALES_PREREQS%%%%INSTALL_PREREQS%% +install_bcl_manpage: + $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(BCL_MANPAGE) $(DESTDIR)$(MAN3DIR)/$(BCL_MANPAGE_NAME) + +install_bcl_header: + $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(BCL_HEADER) $(DESTDIR)$(INCLUDEDIR)/$(BCL_HEADER_NAME) + +install_execs: $(INSTALL) $(DESTDIR)$(BINDIR) "$(EXEC_SUFFIX)" +install_library: + $(SAFE_INSTALL) $(BINARY_INSTALL_ARGS) $(LIBBC) $(DESTDIR)$(LIBDIR)/$(LIB_NAME) + +install:%%INSTALL_LOCALES_PREREQS%%%%INSTALL_MAN_PREREQS%%%%INSTALL_PREREQS%% + uninstall_locales: $(LOCALE_UNINSTALL) $(NLSPATH) $(MAIN_EXEC) $(DESTDIR) @@ -360,5 +376,14 @@ uninstall_dc_manpage: uninstall_dc: $(RM) -f $(DESTDIR)$(BINDIR)/$(EXEC_PREFIX)$(DC)$(EXEC_SUFFIX) + +uninstall_library: + $(RM) -f $(DESTDIR)$(LIBDIR)/$(LIB_NAME) + +uninstall_bcl_header: + $(RM) -f $(DESTDIR)$(INCLUDEDIR)/$(BCL_HEADER_NAME) + +uninstall_bcl_manpage: + $(RM) -f $(DESTDIR)$(MAN3DIR)/$(BCL_MANPAGE_NAME) uninstall:%%UNINSTALL_LOCALES_PREREQS%%%%UNINSTALL_MAN_PREREQS%%%%UNINSTALL_PREREQS%% Modified: vendor/bc/dist/NEWS.md ============================================================================== --- vendor/bc/dist/NEWS.md Thu Nov 26 16:40:39 2020 (r368061) +++ vendor/bc/dist/NEWS.md Thu Nov 26 16:52:17 2020 (r368062) @@ -1,5 +1,23 @@ # News +## 3.2.0 + +This is a production release that has one bug fix and a major addition. + +The bug fix was a missing `auto` variable in the bessel `j()` function in the +math library. + +The major addition is a way to build a version of `bc`'s math code as a library. +This is done with the `-a` option to `configure.sh`. The API for the library can +be read in `./manuals/bcl.3.md` or `man bcl` once the library is installed with +`make install`. + +This library was requested by developers before I even finished version 1.0, but +I could not figure out how to do it until now. + +If the library has API breaking changes, the major version of `bc` will be +incremented. + ## 3.1.6 This is a production release that fixes a new warning from Clang 12 for FreeBSD Modified: vendor/bc/dist/README.md ============================================================================== --- vendor/bc/dist/README.md Thu Nov 26 16:40:39 2020 (r368061) +++ vendor/bc/dist/README.md Thu Nov 26 16:52:17 2020 (r368062) @@ -107,6 +107,23 @@ other locations, use the `PREFIX` environment variable `configure.sh` or pass the `--prefix=` option to `configure.sh`. See the [build manual][5], or run `./configure.sh --help`, for more details. +### Library + +This `bc` does provide a way to build a math library with C bindings. This is +done by the `-a` or `--library` options to `configure.sh`: + +``` +./configure.sh -a +``` + +When building the library, the executables are not built. For more information, +see the [build manual][5]. + +The library API can be found in [`manuals/bcl.3.md`][26] or `man bcl` once the +library is installed. + +The library is built as `bin/libbcl.a`. + ### Package and Distro Maintainers #### Recommended Compiler @@ -335,3 +352,4 @@ Folders: [23]: https://svnweb.freebsd.org/base/head/contrib/bc/ [24]: https://bugs.freebsd.org/ [25]: https://reviews.freebsd.org/ +[26]: ./manuals/bcl.3.md Modified: vendor/bc/dist/configure.sh ============================================================================== --- vendor/bc/dist/configure.sh Thu Nov 26 16:40:39 2020 (r368061) +++ vendor/bc/dist/configure.sh Thu Nov 26 16:52:17 2020 (r368062) @@ -45,22 +45,27 @@ usage() { _usage_val=0 fi - printf 'usage: %s -h\n' "$script" - printf ' %s --help\n' "$script" - printf ' %s [-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" - printf ' %s \\\n' "$script" - printf ' [--bc-only --disable-dc|--dc-only --disable-bc|--coverage] \\\n' - printf ' [--debug --disable-extra-math --disable-generated-tests] \\\n' - printf ' [--disable-history --disable-man-pages --disable-nls] \\\n' - printf ' [--disable-prompt --disable-strip] [--install-all-locales] \\\n' - printf ' [--opt=OPT_LEVEL] [--karatsuba-len=KARATSUBA_LEN] \\\n' - printf ' [--prefix=PREFIX] [--bindir=BINDIR] [--datarootdir=DATAROOTDIR] \\\n' - printf ' [--datadir=DATADIR] [--mandir=MANDIR] [--man1dir=MAN1DIR] \\\n' - printf ' [--force] \\\n' + printf 'usage:\n' + printf ' %s -h\n' "$script" + printf ' %s --help\n' "$script" + printf ' %s [-a|-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" + printf ' %s \\\n' "$script" + printf ' [--library|--bc-only --disable-dc|--dc-only --disable-bc|--coverage]\\\n' + printf ' [--force --debug --disable-extra-math --disable-generated-tests] \\\n' + printf ' [--disable-history --disable-man-pages --disable-nls] \\\n' + printf ' [--disable-prompt --disable-strip] [--install-all-locales] \\\n' + printf ' [--opt=OPT_LEVEL] [--karatsuba-len=KARATSUBA_LEN] \\\n' + printf ' [--prefix=PREFIX] [--bindir=BINDIR] [--datarootdir=DATAROOTDIR] \\\n' + printf ' [--datadir=DATADIR] [--mandir=MANDIR] [--man1dir=MAN1DIR] \\\n' printf '\n' + printf ' -a, --library\n' + printf ' Build the libbc instead of the programs. This is meant to be used with\n' + printf ' Other software like programming languages that want to make use of the\n' + printf ' parsing and math capabilities. This option will install headers using\n' + printf ' `make install`.\n' printf ' -b, --bc-only\n' - printf ' Build bc only. It is an error if "-d", "--dc-only", "-B", or "--disable-bc"\n' - printf ' are specified too.\n' + printf ' Build bc only. It is an error if "-d", "--dc-only", "-B", or\n' + printf ' "--disable-bc" are specified too.\n' printf ' -B, --disable-bc\n' printf ' Disable bc. It is an error if "-b", "--bc-only", "-D", or "--disable-dc"\n' printf ' are specified too.\n' @@ -69,10 +74,10 @@ usage() { printf ' It is an error if either "-b" ("-D") or "-d" ("-B") is specified.\n' printf ' Requires a compiler that use gcc-compatible coverage options\n' printf ' -d, --dc-only\n' - printf ' Build dc only. It is an error if "-b", "--bc-only", "-D", or "--disable-dc"\n' - printf ' are specified too.\n' + printf ' Build dc only. It is an error if "-b", "--bc-only", "-D", or\n' + printf ' "--disable-dc" are specified too.\n' printf ' -D, --disable-dc\n' - printf ' Disable dc. It is an error if "-d", "--dc-only" "-B", or "--disable-bc"\n' + printf ' Disable dc. It is an error if "-d", "--dc-only", "-B", or "--disable-bc"\n' printf ' are specified too.\n' printf ' -E, --disable-extra-math\n' printf ' Disable extra math. This includes: "$" operator (truncate to integer),\n' @@ -122,8 +127,14 @@ usage() { printf ' If PREFIX is "/usr", install path will be "/usr/bin".\n' printf ' Default is "/usr/local".\n' printf ' --bindir BINDIR\n' - printf ' The directory to install binaries. Overrides "$BINDIR" if it exists.\n' + printf ' The directory to install binaries in. Overrides "$BINDIR" if it exists.\n' printf ' Default is "$PREFIX/bin".\n' + printf ' --includedir INCLUDEDIR\n' + printf ' The directory to install headers in. Overrides "$INCLUDEDIR" if it\n' + printf ' exists. Default is "$PREFIX/include".\n' + printf ' --libdir LIBDIR\n' + printf ' The directory to install libraries in. Overrides "$LIBDIR" if it exists.\n' + printf ' Default is "$PREFIX/lib".\n' printf ' --datarootdir DATAROOTDIR\n' printf ' The root location for data files. Overrides "$DATAROOTDIR" if it exists.\n' printf ' Default is "$PREFIX/share".\n' @@ -136,6 +147,9 @@ usage() { printf ' --man1dir MAN1DIR\n' printf ' The location to install Section 1 manpages to. Overrides "$MAN1DIR" if\n' printf ' it exists. Default is "$MANDIR/man1".\n' + printf ' --man3dir MAN3DIR\n' + printf ' The location to install Section 3 manpages to. Overrides "$MAN3DIR" if\n' + printf ' it exists. Default is "$MANDIR/man3".\n' printf '\n' printf 'In addition, the following environment variables are used:\n' printf '\n' @@ -157,12 +171,18 @@ usage() { printf ' LDFLAGS Linker flags. Default is "".\n' printf ' PREFIX The prefix to install to. Default is "/usr/local".\n' printf ' If PREFIX is "/usr", install path will be "/usr/bin".\n' - printf ' BINDIR The directory to install binaries. Default is "$PREFIX/bin".\n' + printf ' BINDIR The directory to install binaries in. Default is "$PREFIX/bin".\n' + printf ' INCLUDEDIR The directory to install header files in. Default is\n' + printf ' "$PREFIX/include".\n' + printf ' LIBDIR The directory to install libraries in. Default is\n' + printf ' "$PREFIX/lib".\n' printf ' DATAROOTDIR The root location for data files. Default is "$PREFIX/share".\n' printf ' DATADIR The location for data files. Default is "$DATAROOTDIR".\n' printf ' MANDIR The location to install manpages to. Default is "$DATADIR/man".\n' printf ' MAN1DIR The location to install Section 1 manpages to. Default is\n' printf ' "$MANDIR/man1".\n' + printf ' MAN3DIR The location to install Section 3 manpages to. Default is\n' + printf ' "$MANDIR/man3".\n' printf ' NLSPATH The location to install locale catalogs to. Must be an absolute\n' printf ' path (or contain one). This is treated the same as the POSIX\n' printf ' definition of $NLSPATH (see POSIX environment variables for\n' @@ -257,56 +277,55 @@ replace() { substring_replace "$_replace_str" "%%$_replace_needle%%" "$_replace_replacement" } -gen_file_lists() { +gen_file_list() { - if [ "$#" -lt 3 ]; then + if [ "$#" -lt 1 ]; then err_exit "Invalid number of args to $0" fi - _gen_file_lists_contents="$1" + _gen_file_list_contents="$1" shift - _gen_file_lists_filedir="$1" - shift + p=$(pwd) - _gen_file_lists_typ="$1" - shift + cd "$scriptdir" - # If there is an extra argument, and it - # is zero, we keep the file lists empty. - if [ "$#" -gt 0 ]; then - _gen_file_lists_use="$1" + if [ "$#" -ge 1 ]; then + + while [ "$#" -ge 1 ]; do + a="$1" + shift + args="$args ! -wholename src/${a}" + done + else - _gen_file_lists_use="1" + args="-print" fi - _gen_file_lists_needle_src="${_gen_file_lists_typ}SRC" - _gen_file_lists_needle_obj="${_gen_file_lists_typ}OBJ" - _gen_file_lists_needle_gcda="${_gen_file_lists_typ}GCDA" - _gen_file_lists_needle_gcno="${_gen_file_lists_typ}GCNO" + _gen_file_list_needle_src="SRC" + _gen_file_list_needle_obj="OBJ" + _gen_file_list_needle_gcda="GCDA" + _gen_file_list_needle_gcno="GCNO" - if [ "$_gen_file_lists_use" -ne 0 ]; then + _gen_file_list_replacement=$(find src/ -depth -name "*.c" $args | tr '\n' ' ') + _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ + "$_gen_file_list_needle_src" "$_gen_file_list_replacement") - _gen_file_lists_replacement=$(cd "$_gen_file_lists_filedir" && find . ! -name . -prune -name "*.c" | cut -d/ -f2 | sed "s@^@$_gen_file_lists_filedir/@g" | tr '\n' ' ') - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_src" "$_gen_file_lists_replacement") + _gen_file_list_replacement=$(replace_exts "$_gen_file_list_replacement" "c" "o") + _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ + "$_gen_file_list_needle_obj" "$_gen_file_list_replacement") - _gen_file_lists_replacement=$(replace_exts "$_gen_file_lists_replacement" "c" "o") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_obj" "$_gen_file_lists_replacement") + _gen_file_list_replacement=$(replace_exts "$_gen_file_list_replacement" "o" "gcda") + _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ + "$_gen_file_list_needle_gcda" "$_gen_file_list_replacement") - _gen_file_lists_replacement=$(replace_exts "$_gen_file_lists_replacement" "o" "gcda") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcda" "$_gen_file_lists_replacement") + _gen_file_list_replacement=$(replace_exts "$_gen_file_list_replacement" "gcda" "gcno") + _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ + "$_gen_file_list_needle_gcno" "$_gen_file_list_replacement") - _gen_file_lists_replacement=$(replace_exts "$_gen_file_lists_replacement" "gcda" "gcno") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcno" "$_gen_file_lists_replacement") + cd "$p" - else - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_src" "") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_obj" "") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcda" "") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcno" "") - fi - - printf '%s\n' "$_gen_file_lists_contents" + printf '%s\n' "$_gen_file_list_contents" } bc_only=0 @@ -324,10 +343,12 @@ prompt=1 force=0 strip_bin=1 all_locales=0 +library=0 -while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do +while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do case "$opt" in + a) library=1 ;; b) bc_only=1 ;; B) dc_only=1 ;; c) coverage=1 ;; @@ -352,6 +373,7 @@ while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do LONG_OPTARG="${arg#*=}" case $arg in help) usage ;; + library) library=1 ;; bc-only) bc_only=1 ;; dc-only) dc_only=1 ;; coverage) coverage=1 ;; @@ -371,6 +393,20 @@ while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do fi BINDIR="$2" shift ;; + includedir=?*) INCLUDEDIR="$LONG_OPTARG" ;; + includedir) + if [ "$#" -lt 2 ]; then + usage "No argument given for '--$arg' option" + fi + INCLUDEDIR="$2" + shift ;; + libdir=?*) LIBDIR="$LONG_OPTARG" ;; + libdir) + if [ "$#" -lt 2 ]; then + usage "No argument given for '--$arg' option" + fi + LIBDIR="$2" + shift ;; datarootdir=?*) DATAROOTDIR="$LONG_OPTARG" ;; datarootdir) if [ "$#" -lt 2 ]; then @@ -399,6 +435,13 @@ while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do fi MAN1DIR="$2" shift ;; + man3dir=?*) MAN3DIR="$LONG_OPTARG" ;; + man3dir) + if [ "$#" -lt 2 ]; then + usage "No argument given for '--$arg' option" + fi + MAN3DIR="$2" + shift ;; localedir=?*) LOCALEDIR="$LONG_OPTARG" ;; localedir) if [ "$#" -lt 2 ]; then @@ -454,6 +497,12 @@ if [ "$bc_only" -eq 1 ] && [ "$dc_only" -eq 1 ]; then usage "Can only specify one of -b(-D) or -d(-B)" fi +if [ "$library" -ne 0 ]; then + if [ "$bc_only" -eq 1 ] || [ "$dc_only" -eq 1 ]; then + usage "Must not specify -b(-D) or -d(-B) when building the library" + fi +fi + case $karatsuba_len in (*[!0-9]*|'') usage "KARATSUBA_LEN is not a number" ;; (*) ;; @@ -529,6 +578,8 @@ link="@printf 'No link necessary\\\\n'" main_exec="BC" executable="BC_EXEC" +tests="test_bc timeconst test_dc" + bc_test="@tests/all.sh bc $extra_math 1 $generate_tests 0 \$(BC_EXEC)" bc_time_test="@tests/all.sh bc $extra_math 1 $generate_tests 1 \$(BC_EXEC)" @@ -567,7 +618,8 @@ if [ "$bc_only" -eq 1 ]; then dc_time_test="@printf 'No dc tests to run\\\\n'" vg_dc_test="@printf 'No dc tests to run\\\\n'" - install_prereqs=" install_bc_manpage" + install_prereqs=" install_execs" + install_man_prereqs=" install_bc_manpage" uninstall_prereqs=" uninstall_bc" uninstall_man_prereqs=" uninstall_bc_manpage" @@ -590,7 +642,8 @@ elif [ "$dc_only" -eq 1 ]; then timeconst="@printf 'timeconst cannot be run because bc is not built\\\\n'" - install_prereqs=" install_dc_manpage" + install_prereqs=" install_execs" + install_man_prereqs=" install_dc_manpage" uninstall_prereqs=" uninstall_dc" uninstall_man_prereqs=" uninstall_dc_manpage" @@ -606,9 +659,18 @@ else karatsuba="@\$(KARATSUBA) 30 0 \$(BC_EXEC)" karatsuba_test="@\$(KARATSUBA) 1 100 \$(BC_EXEC)" - install_prereqs=" install_bc_manpage install_dc_manpage" - uninstall_prereqs=" uninstall_bc uninstall_dc" - uninstall_man_prereqs=" uninstall_bc_manpage uninstall_dc_manpage" + if [ "$library" -eq 0 ]; then + install_prereqs=" install_execs" + install_man_prereqs=" install_bc_manpage install_dc_manpage" + uninstall_prereqs=" uninstall_bc uninstall_dc" + uninstall_man_prereqs=" uninstall_bc_manpage uninstall_dc_manpage" + else + install_prereqs=" install_library install_bcl_header" + install_man_prereqs=" install_bcl_manpage" + uninstall_prereqs=" uninstall_library uninstall_bcl_header" + uninstall_man_prereqs=" uninstall_bcl_manpage" + tests="test_library" + fi fi @@ -664,6 +726,14 @@ if [ -z "${BINDIR+set}" ]; then BINDIR="$PREFIX/bin" fi +if [ -z "${INCLUDEDIR+set}" ]; then + INCLUDEDIR="$PREFIX/include" +fi + +if [ -z "${LIBDIR+set}" ]; then + LIBDIR="$PREFIX/lib" +fi + if [ "$install_manpages" -ne 0 ] || [ "$nls" -ne 0 ]; then if [ -z "${DATAROOTDIR+set}" ]; then DATAROOTDIR="$PREFIX/share" @@ -684,11 +754,25 @@ if [ "$install_manpages" -ne 0 ]; then MAN1DIR="$MANDIR/man1" fi + if [ -z "${MAN3DIR+set}" ]; then + MAN3DIR="$MANDIR/man3" + fi + else - install_prereqs="" + install_man_prereqs="" uninstall_man_prereqs="" fi +if [ "$library" -ne 0 ]; then + extra_math=1 + nls=0 + hist=0 + prompt=0 + ALL_PREREQ="library" +else + ALL_PREREQ="execs" +fi + if [ "$nls" -ne 0 ]; then set +e @@ -776,11 +860,11 @@ if [ "$hist" -eq 1 ]; then printf 'Testing history...\n' flags="-DBC_ENABLE_HISTORY=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc" - flags="$flags -DBC_ENABLE_NLS=$nls" + flags="$flags -DBC_ENABLE_NLS=$nls -DBC_ENABLE_LIBRARY=0" flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I./include/" flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" - "$CC" $CPPFLAGS $CFLAGS $flags -c "src/history/history.c" -o "$scriptdir/history.o" > /dev/null 2>&1 + "$CC" $CPPFLAGS $CFLAGS $flags -c "src/history.c" -o "$scriptdir/history.o" > /dev/null 2>&1 err="$?" @@ -804,7 +888,11 @@ if [ "$hist" -eq 1 ]; then fi -if [ "$extra_math" -eq 1 ] && [ "$bc" -ne 0 ]; then +if [ "$library" -eq 1 ]; then + bc_lib="" +fi + +if [ "$extra_math" -eq 1 ] && [ "$bc" -ne 0 ] && [ "$library" -eq 0 ]; then BC_LIB2_O="\$(GEN_DIR)/lib2.o" else BC_LIB2_O="" @@ -846,6 +934,33 @@ if [ "$manpage_args" = "" ]; then manpage_args="A" fi +unneeded="" + +if [ "$hist" -eq 0 ]; then + unneeded="$unneeded history.c" +fi + +if [ "$bc" -eq 0 ]; then + unneeded="$unneeded bc.c bc_lex.c bc_parse.c" +fi + +if [ "$dc" -eq 0 ]; then + unneeded="$unneeded dc.c dc_lex.c dc_parse.c" +fi + +if [ "$extra_math" -eq 0 ]; then + unneeded="$unneeded rand.c" +fi + +if [ "$library" -ne 0 ]; then + unneeded="$unneeded args.c opt.c read.c file.c main.c" + unneeded="$unneeded lang.c lex.c parse.c program.c" + unneeded="$unneeded bc.c bc_lex.c bc_parse.c" + unneeded="$unneeded dc.c dc_lex.c dc_parse.c" +else + unneeded="$unneeded library.c" +fi + # Print out the values; this is for debugging. if [ "$bc" -ne 0 ]; then printf 'Building bc\n' @@ -858,6 +973,7 @@ else printf 'Not building dc\n' fi printf '\n' +printf 'BC_ENABLE_LIBRARY=%s\n\n' "$library" printf 'BC_ENABLE_HISTORY=%s\n' "$hist" printf 'BC_ENABLE_EXTRA_MATH=%s\n' "$extra_math" printf 'BC_ENABLE_NLS=%s\n' "$nls" @@ -873,10 +989,13 @@ printf 'CPPFLAGS=%s\n' "$CPPFLAGS" printf 'LDFLAGS=%s\n' "$LDFLAGS" printf 'PREFIX=%s\n' "$PREFIX" printf 'BINDIR=%s\n' "$BINDIR" +printf 'INCLUDEDIR=%s\n' "$INCLUDEDIR" +printf 'LIBDIR=%s\n' "$LIBDIR" printf 'DATAROOTDIR=%s\n' "$DATAROOTDIR" printf 'DATADIR=%s\n' "$DATADIR" printf 'MANDIR=%s\n' "$MANDIR" printf 'MAN1DIR=%s\n' "$MAN1DIR" +printf 'MAN3DIR=%s\n' "$MAN3DIR" printf 'NLSPATH=%s\n' "$NLSPATH" printf 'EXECSUFFIX=%s\n' "$EXECSUFFIX" printf 'EXECPREFIX=%s\n' "$EXECPREFIX" @@ -892,16 +1011,17 @@ replacement='*** WARNING: Autogenerated from Makefile. contents=$(replace "$contents" "$needle" "$replacement") -contents=$(gen_file_lists "$contents" "$scriptdir/src" "") -contents=$(gen_file_lists "$contents" "$scriptdir/src/bc" "BC_" "$bc") -contents=$(gen_file_lists "$contents" "$scriptdir/src/dc" "DC_" "$dc") -contents=$(gen_file_lists "$contents" "$scriptdir/src/history" "HISTORY_" "$hist") -contents=$(gen_file_lists "$contents" "$scriptdir/src/rand" "RAND_" "$extra_math") +if [ "$unneeded" = "" ]; then + contents=$(gen_file_list "$contents" "library.c") +else + contents=$(gen_file_list "$contents" $unneeded) +fi contents=$(replace "$contents" "BC_ENABLED" "$bc") contents=$(replace "$contents" "DC_ENABLED" "$dc") contents=$(replace "$contents" "LINK" "$link") +contents=$(replace "$contents" "LIBRARY" "$library") contents=$(replace "$contents" "HISTORY" "$hist") contents=$(replace "$contents" "EXTRA_MATH" "$extra_math") contents=$(replace "$contents" "NLS" "$nls") @@ -917,7 +1037,10 @@ contents=$(replace "$contents" "DESTDIR" "$destdir") contents=$(replace "$contents" "EXECSUFFIX" "$EXECSUFFIX") contents=$(replace "$contents" "EXECPREFIX" "$EXECPREFIX") contents=$(replace "$contents" "BINDIR" "$BINDIR") +contents=$(replace "$contents" "INCLUDEDIR" "$INCLUDEDIR") +contents=$(replace "$contents" "LIBDIR" "$LIBDIR") contents=$(replace "$contents" "MAN1DIR" "$MAN1DIR") +contents=$(replace "$contents" "MAN3DIR" "$MAN3DIR") contents=$(replace "$contents" "CFLAGS" "$CFLAGS") contents=$(replace "$contents" "HOSTCFLAGS" "$HOSTCFLAGS") contents=$(replace "$contents" "CPPFLAGS" "$CPPFLAGS") @@ -927,15 +1050,19 @@ contents=$(replace "$contents" "HOSTCC" "$HOSTCC") contents=$(replace "$contents" "COVERAGE_OUTPUT" "$COVERAGE_OUTPUT") contents=$(replace "$contents" "COVERAGE_PREREQS" "$COVERAGE_PREREQS") contents=$(replace "$contents" "INSTALL_PREREQS" "$install_prereqs") +contents=$(replace "$contents" "INSTALL_MAN_PREREQS" "$install_man_prereqs") contents=$(replace "$contents" "INSTALL_LOCALES" "$install_locales") contents=$(replace "$contents" "INSTALL_LOCALES_PREREQS" "$install_locales_prereqs") contents=$(replace "$contents" "UNINSTALL_MAN_PREREQS" "$uninstall_man_prereqs") contents=$(replace "$contents" "UNINSTALL_PREREQS" "$uninstall_prereqs") contents=$(replace "$contents" "UNINSTALL_LOCALES_PREREQS" "$uninstall_locales_prereqs") +contents=$(replace "$contents" "ALL_PREREQ" "$ALL_PREREQ") + contents=$(replace "$contents" "EXECUTABLES" "$executables") contents=$(replace "$contents" "MAIN_EXEC" "$main_exec") contents=$(replace "$contents" "EXEC" "$executable") +contents=$(replace "$contents" "TESTS" "$tests") contents=$(replace "$contents" "BC_TEST" "$bc_test") contents=$(replace "$contents" "BC_TIME_TEST" "$bc_time_test") Modified: vendor/bc/dist/gen/lib.bc ============================================================================== --- vendor/bc/dist/gen/lib.bc Thu Nov 26 16:40:39 2020 (r368061) +++ vendor/bc/dist/gen/lib.bc Thu Nov 26 16:52:17 2020 (r368062) @@ -173,7 +173,7 @@ define a(x){ return((m*a+r)/n) } define j(n,x){ - auto b,s,o,a,i,v,f + auto b,s,o,a,i,r,v,f b=ibase ibase=A s=scale Modified: vendor/bc/dist/gen/strgen.c ============================================================================== --- vendor/bc/dist/gen/strgen.c Thu Nov 26 16:40:39 2020 (r368061) +++ vendor/bc/dist/gen/strgen.c Thu Nov 26 16:52:17 2020 (r368062) @@ -45,13 +45,14 @@ static const char* const bc_gen_header = "// Copyright (c) 2018-2020 Gavin D. Howard and contributors.\n" "// Licensed under the 2-clause BSD license.\n" - "// *** AUTOMATICALLY GENERATED FROM %s. DO NOT MODIFY. ***\n"; + "// *** AUTOMATICALLY GENERATED FROM %s. DO NOT MODIFY. ***\n\n"; -static const char* const bc_gen_include = "#include <%s>\n\n"; static const char* const bc_gen_label = "const char *%s = \"%s\";\n\n"; +static const char* const bc_gen_label_extern = "extern const char *%s;\n\n"; static const char* const bc_gen_ifdef = "#if %s\n"; static const char* const bc_gen_endif = "#endif // %s\n"; static const char* const bc_gen_name = "const char %s[] = {\n"; +static const char* const bc_gen_name_extern = "extern const char %s[];\n\n"; #define IO_ERR (1) #define INVALID_INPUT_FILE (2) @@ -62,7 +63,7 @@ static const char* const bc_gen_name = "const char %s[ int main(int argc, char *argv[]) { FILE *in, *out; - char *label, *define, *name, *include; + char *label, *define, *name; int c, count, slashes, err = IO_ERR; bool has_label, has_define, remove_tabs; @@ -72,15 +73,14 @@ int main(int argc, char *argv[]) { } name = argv[3]; - include = argv[4]; - has_label = (argc > 5 && strcmp("", argv[5]) != 0); - label = has_label ? argv[5] : ""; + has_label = (argc > 4 && strcmp("", argv[4]) != 0); + label = has_label ? argv[4] : ""; - has_define = (argc > 6 && strcmp("", argv[6]) != 0); - define = has_define ? argv[6] : ""; + has_define = (argc > 5 && strcmp("", argv[5]) != 0); + define = has_define ? argv[5] : ""; - remove_tabs = (argc > 7); + remove_tabs = (argc > 6); in = fopen(argv[1], "r"); if (!in) return INVALID_INPUT_FILE; @@ -89,8 +89,9 @@ int main(int argc, char *argv[]) { if (!out) goto out_err; if (fprintf(out, bc_gen_header, argv[1]) < 0) goto err; + if (has_label && fprintf(out, bc_gen_label_extern, label) < 0) goto err; + if (fprintf(out, bc_gen_name_extern, name) < 0) goto err; if (has_define && fprintf(out, bc_gen_ifdef, define) < 0) goto err; - if (fprintf(out, bc_gen_include, include) < 0) goto err; if (has_label && fprintf(out, bc_gen_label, label, argv[1]) < 0) goto err; if (fprintf(out, bc_gen_name, name) < 0) goto err; Modified: vendor/bc/dist/gen/strgen.sh ============================================================================== --- vendor/bc/dist/gen/strgen.sh Thu Nov 26 16:40:39 2020 (r368061) +++ vendor/bc/dist/gen/strgen.sh Thu Nov 26 16:52:17 2020 (r368062) @@ -50,6 +50,7 @@ exec > "$output" if [ -n "$label" ]; then nameline="const char *${label} = \"${input}\";" + labelexternline="extern const char *${label};" fi if [ -n "$define" ]; then @@ -64,11 +65,14 @@ if [ -n "$remove_tabs" ]; then fi cat< +$labelexternline + +extern const char $name[]; $nameline Modified: vendor/bc/dist/include/file.h ============================================================================== --- vendor/bc/dist/include/file.h Thu Nov 26 16:40:39 2020 (r368061) +++ vendor/bc/dist/include/file.h Thu Nov 26 16:52:17 2020 (r368062) @@ -62,6 +62,4 @@ void bc_file_printf(BcFile *restrict f, const char *fm void bc_file_vprintf(BcFile *restrict f, const char *fmt, va_list args); void bc_file_puts(BcFile *restrict f, const char *str); -void bc_file_ultoa(unsigned long long val, char buf[BC_FILE_ULL_LENGTH]); - #endif // BC_FILE_H Modified: vendor/bc/dist/include/lex.h ============================================================================== --- vendor/bc/dist/include/lex.h Thu Nov 26 16:40:39 2020 (r368061) +++ vendor/bc/dist/include/lex.h Thu Nov 26 16:52:17 2020 (r368062) @@ -43,8 +43,8 @@ #include #include -#define bc_lex_err(l, e) (bc_vm_error((e), (l)->line)) -#define bc_lex_verr(l, e, ...) (bc_vm_error((e), (l)->line, __VA_ARGS__)) +#define bc_lex_err(l, e) (bc_vm_handleError((e), (l)->line)) +#define bc_lex_verr(l, e, ...) (bc_vm_handleError((e), (l)->line, __VA_ARGS__)) #if BC_ENABLED Modified: vendor/bc/dist/include/num.h ============================================================================== --- vendor/bc/dist/include/num.h Thu Nov 26 16:40:39 2020 (r368061) +++ vendor/bc/dist/include/num.h Thu Nov 26 16:52:17 2020 (r368062) @@ -45,6 +45,7 @@ #include #include +#include #ifndef BC_ENABLE_EXTRA_MATH #define BC_ENABLE_EXTRA_MATH (1) @@ -54,25 +55,10 @@ typedef unsigned long ulong; -// For some reason, LONG_BIT is not defined in some versions of gcc. -// I define it here to the minimum accepted value in the POSIX standard. -#ifndef LONG_BIT -#define LONG_BIT (32) -#endif // LONG_BIT +typedef BclBigDig BcBigDig; -#ifndef BC_LONG_BIT -#define BC_LONG_BIT LONG_BIT -#endif // BC_LONG_BIT - -#if BC_LONG_BIT > LONG_BIT -#error BC_LONG_BIT cannot be greater than LONG_BIT -#endif // BC_LONG_BIT > LONG_BIT - #if BC_LONG_BIT >= 64 -typedef int_least32_t BcDig; -typedef uint64_t BcBigDig; - #define BC_NUM_BIGDIG_MAX ((BcBigDig) UINT64_MAX) #define BC_BASE_DIGS (9) @@ -80,11 +66,10 @@ typedef uint64_t BcBigDig; #define BC_NUM_BIGDIG_C UINT64_C +typedef int_least32_t BcDig; + #elif BC_LONG_BIT >= 32 -typedef int_least16_t BcDig; -typedef uint32_t BcBigDig; - #define BC_NUM_BIGDIG_MAX ((BcBigDig) UINT32_MAX) #define BC_BASE_DIGS (4) @@ -92,6 +77,8 @@ typedef uint32_t BcBigDig; #define BC_NUM_BIGDIG_C UINT32_C +typedef int_least16_t BcDig; + #else #error BC_LONG_BIT must be at least 32 @@ -106,7 +93,6 @@ typedef struct BcNum { size_t scale; size_t len; size_t cap; - bool neg; } BcNum; #if BC_ENABLE_EXTRA_MATH @@ -150,6 +136,30 @@ struct BcRNG; #define BC_NUM_ROUND_POW(s) (bc_vm_growSize((s), BC_BASE_DIGS - 1)) #define BC_NUM_RDX(s) (BC_NUM_ROUND_POW(s) / BC_BASE_DIGS) +#define BC_NUM_RDX_VAL(n) ((n)->rdx >> 1) +#define BC_NUM_RDX_VAL_NP(n) ((n).rdx >> 1) +#define BC_NUM_RDX_SET(n, v) \ + ((n)->rdx = (((v) << 1) | ((n)->rdx & (BcBigDig) 1))) +#define BC_NUM_RDX_SET_NP(n, v) \ + ((n).rdx = (((v) << 1) | ((n).rdx & (BcBigDig) 1))) +#define BC_NUM_RDX_SET_NEG(n, v, neg) \ + ((n)->rdx = (((v) << 1) | (neg))) + +#define BC_NUM_RDX_VALID(n) \ + (BC_NUM_ZERO(n) || BC_NUM_RDX_VAL(n) * BC_BASE_DIGS >= (n)->scale) +#define BC_NUM_RDX_VALID_NP(n) \ + ((!(n).len) || BC_NUM_RDX_VAL_NP(n) * BC_BASE_DIGS >= (n).scale) + +#define BC_NUM_NEG(n) ((n)->rdx & ((BcBigDig) 1)) +#define BC_NUM_NEG_NP(n) ((n).rdx & ((BcBigDig) 1)) +#define BC_NUM_NEG_CLR(n) ((n)->rdx &= ~((BcBigDig) 1)) +#define BC_NUM_NEG_CLR_NP(n) ((n).rdx &= ~((BcBigDig) 1)) +#define BC_NUM_NEG_SET(n) ((n)->rdx |= ((BcBigDig) 1)) +#define BC_NUM_NEG_TGL(n) ((n)->rdx ^= ((BcBigDig) 1)) +#define BC_NUM_NEG_TGL_NP(n) ((n).rdx ^= ((BcBigDig) 1)) +#define BC_NUM_NEG_VAL(n, v) (((n)->rdx & ~((BcBigDig) 1)) | (v)) +#define BC_NUM_NEG_VAL_NP(n, v) (((n).rdx & ~((BcBigDig) 1)) | (v)) + #define BC_NUM_SIZE(n) ((n) * sizeof(BcDig)) #if BC_DEBUG_CODE @@ -183,7 +193,7 @@ void bc_num_bigdig2num(BcNum *restrict n, BcBigDig val *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Nov 26 17:18:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8ADBC4697E5; Thu, 26 Nov 2020 17:18:21 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chkx93W61z4lDw; Thu, 26 Nov 2020 17:18:21 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A83E269FD; Thu, 26 Nov 2020 17:18:21 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQHILDK099815; Thu, 26 Nov 2020 17:18:21 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQHIJV9099803; Thu, 26 Nov 2020 17:18:19 GMT (envelope-from se@FreeBSD.org) Message-Id: <202011261718.0AQHIJV9099803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Thu, 26 Nov 2020 17:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r368063 - in vendor/bc/dist: . gen include manuals manuals/bc manuals/dc src X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: in vendor/bc/dist: . gen include manuals manuals/bc manuals/dc src X-SVN-Commit-Revision: 368063 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 17:18:21 -0000 Author: se Date: Thu Nov 26 17:18:18 2020 New Revision: 368063 URL: https://svnweb.freebsd.org/changeset/base/368063 Log: Revert incomplete import of version 3.2.0 Modified: vendor/bc/dist/.gitignore vendor/bc/dist/Makefile.in vendor/bc/dist/NEWS.md vendor/bc/dist/README.md vendor/bc/dist/configure.sh vendor/bc/dist/gen/lib.bc vendor/bc/dist/gen/strgen.c vendor/bc/dist/gen/strgen.sh vendor/bc/dist/include/file.h vendor/bc/dist/include/lex.h vendor/bc/dist/include/num.h vendor/bc/dist/include/parse.h vendor/bc/dist/include/rand.h vendor/bc/dist/include/status.h vendor/bc/dist/include/vector.h vendor/bc/dist/include/vm.h vendor/bc/dist/manpage.sh vendor/bc/dist/manuals/bc.1.md.in vendor/bc/dist/manuals/bc/A.1 vendor/bc/dist/manuals/bc/A.1.md vendor/bc/dist/manuals/bc/E.1 vendor/bc/dist/manuals/bc/E.1.md vendor/bc/dist/manuals/bc/EH.1 vendor/bc/dist/manuals/bc/EH.1.md vendor/bc/dist/manuals/bc/EHN.1 vendor/bc/dist/manuals/bc/EHN.1.md vendor/bc/dist/manuals/bc/EHNP.1 vendor/bc/dist/manuals/bc/EHNP.1.md vendor/bc/dist/manuals/bc/EHP.1 vendor/bc/dist/manuals/bc/EHP.1.md vendor/bc/dist/manuals/bc/EN.1 vendor/bc/dist/manuals/bc/EN.1.md vendor/bc/dist/manuals/bc/ENP.1 vendor/bc/dist/manuals/bc/ENP.1.md vendor/bc/dist/manuals/bc/EP.1 vendor/bc/dist/manuals/bc/EP.1.md vendor/bc/dist/manuals/bc/H.1 vendor/bc/dist/manuals/bc/H.1.md vendor/bc/dist/manuals/bc/HN.1 vendor/bc/dist/manuals/bc/HN.1.md vendor/bc/dist/manuals/bc/HNP.1 vendor/bc/dist/manuals/bc/HNP.1.md vendor/bc/dist/manuals/bc/HP.1 vendor/bc/dist/manuals/bc/HP.1.md vendor/bc/dist/manuals/bc/N.1 vendor/bc/dist/manuals/bc/N.1.md vendor/bc/dist/manuals/bc/NP.1 vendor/bc/dist/manuals/bc/NP.1.md vendor/bc/dist/manuals/bc/P.1 vendor/bc/dist/manuals/bc/P.1.md vendor/bc/dist/manuals/build.md vendor/bc/dist/manuals/dc.1.md.in vendor/bc/dist/manuals/dc/A.1 vendor/bc/dist/manuals/dc/A.1.md vendor/bc/dist/manuals/dc/E.1 vendor/bc/dist/manuals/dc/E.1.md vendor/bc/dist/manuals/dc/EH.1 vendor/bc/dist/manuals/dc/EH.1.md vendor/bc/dist/manuals/dc/EHN.1 vendor/bc/dist/manuals/dc/EHN.1.md vendor/bc/dist/manuals/dc/EHNP.1 vendor/bc/dist/manuals/dc/EHNP.1.md vendor/bc/dist/manuals/dc/EHP.1 vendor/bc/dist/manuals/dc/EHP.1.md vendor/bc/dist/manuals/dc/EN.1 vendor/bc/dist/manuals/dc/EN.1.md vendor/bc/dist/manuals/dc/ENP.1 vendor/bc/dist/manuals/dc/ENP.1.md vendor/bc/dist/manuals/dc/EP.1 vendor/bc/dist/manuals/dc/EP.1.md vendor/bc/dist/manuals/dc/H.1 vendor/bc/dist/manuals/dc/H.1.md vendor/bc/dist/manuals/dc/HN.1 vendor/bc/dist/manuals/dc/HN.1.md vendor/bc/dist/manuals/dc/HNP.1 vendor/bc/dist/manuals/dc/HNP.1.md vendor/bc/dist/manuals/dc/HP.1 vendor/bc/dist/manuals/dc/HP.1.md vendor/bc/dist/manuals/dc/N.1 vendor/bc/dist/manuals/dc/N.1.md vendor/bc/dist/manuals/dc/NP.1 vendor/bc/dist/manuals/dc/NP.1.md vendor/bc/dist/manuals/dc/P.1 vendor/bc/dist/manuals/dc/P.1.md vendor/bc/dist/release.sh vendor/bc/dist/src/args.c vendor/bc/dist/src/data.c vendor/bc/dist/src/file.c vendor/bc/dist/src/lang.c vendor/bc/dist/src/lex.c vendor/bc/dist/src/main.c vendor/bc/dist/src/num.c vendor/bc/dist/src/opt.c vendor/bc/dist/src/parse.c vendor/bc/dist/src/program.c vendor/bc/dist/src/read.c vendor/bc/dist/src/vector.c vendor/bc/dist/src/vm.c Modified: vendor/bc/dist/.gitignore ============================================================================== --- vendor/bc/dist/.gitignore Thu Nov 26 16:52:17 2020 (r368062) +++ vendor/bc/dist/.gitignore Thu Nov 26 17:18:18 2020 (r368063) @@ -9,7 +9,6 @@ bin/*bc bin/*bc.exe bin/*dc bin/*dc.exe -bin/bcl bc.old *.o *.a Modified: vendor/bc/dist/Makefile.in ============================================================================== --- vendor/bc/dist/Makefile.in Thu Nov 26 16:52:17 2020 (r368062) +++ vendor/bc/dist/Makefile.in Thu Nov 26 17:18:18 2020 (r368063) @@ -29,13 +29,33 @@ # .POSIX: -VERSION = 3.2.0 +VERSION = 3.1.6 SRC = %%SRC%% OBJ = %%OBJ%% GCDA = %%GCDA%% GCNO = %%GCNO%% +BC_SRC = %%BC_SRC%% +BC_OBJ = %%BC_OBJ%% +BC_GCDA = %%BC_GCDA%% +BC_GCNO = %%BC_GCNO%% + +DC_SRC = %%DC_SRC%% +DC_OBJ = %%DC_OBJ%% +DC_GCDA = %%DC_GCDA%% +DC_GCNO = %%DC_GCNO%% + +HISTORY_SRC = %%HISTORY_SRC%% +HISTORY_OBJ = %%HISTORY_OBJ%% +HISTORY_GCDA = %%HISTORY_GCDA%% +HISTORY_GCNO = %%HISTORY_GCNO%% + +RAND_SRC = %%RAND_SRC%% +RAND_OBJ = %%RAND_OBJ%% +RAND_GCDA = %%RAND_GCDA%% +RAND_GCNO = %%RAND_GCNO%% + BC_ENABLED_NAME = BC_ENABLED BC_ENABLED = %%BC_ENABLED%% DC_ENABLED_NAME = DC_ENABLED @@ -82,13 +102,6 @@ DC = dc BC_EXEC = $(BIN)/$(EXEC_PREFIX)$(BC) DC_EXEC = $(BIN)/$(EXEC_PREFIX)$(DC) -LIB = libbcl -LIB_NAME = $(LIB).a -LIBBC = $(BIN)/$(LIB_NAME) -BCL = bcl -BCL_TEST = $(BIN)/$(BCL) -BCL_TEST_C = tests/$(BCL).c - MANUALS = manuals BC_MANPAGE_NAME = $(EXEC_PREFIX)$(BC)$(EXEC_SUFFIX).1 BC_MANPAGE = $(MANUALS)/$(BC).1 @@ -96,28 +109,16 @@ BC_MD = $(BC_MANPAGE).md DC_MANPAGE_NAME = $(EXEC_PREFIX)$(DC)$(EXEC_SUFFIX).1 DC_MANPAGE = $(MANUALS)/$(DC).1 DC_MD = $(DC_MANPAGE).md -BCL_MANPAGE_NAME = bcl.3 -BCL_MANPAGE = $(MANUALS)/$(BCL_MANPAGE_NAME) -BCL_MD = $(BCL_MANPAGE).md MANPAGE_INSTALL_ARGS = -Dm644 -BINARY_INSTALL_ARGS = -Dm755 -BCL_HEADER_NAME = bcl.h -BCL_HEADER = include/$(BCL_HEADER_NAME) - %%DESTDIR%% BINDIR = %%BINDIR%% -INCLUDEDIR = %%INCLUDEDIR%% -LIBDIR = %%LIBDIR%% MAN1DIR = %%MAN1DIR%% -MAN3DIR = %%MAN3DIR%% MAIN_EXEC = $(EXEC_PREFIX)$(%%MAIN_EXEC%%)$(EXEC_SUFFIX) EXEC = $(%%EXEC%%) NLSPATH = %%NLSPATH%% -BC_ENABLE_LIBRARY = %%LIBRARY%% - BC_ENABLE_HISTORY = %%HISTORY%% BC_ENABLE_EXTRA_MATH_NAME = BC_ENABLE_EXTRA_MATH BC_ENABLE_EXTRA_MATH = %%EXTRA_MATH%% @@ -128,7 +129,7 @@ BC_LONG_BIT = %%LONG_BIT%% RM = rm MKDIR = mkdir -INSTALL = ./exec-install.sh +INSTALL = ./install.sh SAFE_INSTALL = ./safe-install.sh LINK = ./link.sh MANPAGE = ./manpage.sh @@ -147,7 +148,7 @@ CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_ CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) -DBC_ENABLE_PROMPT=$(BC_ENABLE_PROMPT) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) -CPPFLAGS = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY) +CPPFLAGS = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) CFLAGS = $(CPPFLAGS) %%CPPFLAGS%% %%CFLAGS%% LDFLAGS = %%LDFLAGS%% @@ -156,24 +157,21 @@ HOSTCFLAGS = %%HOSTCFLAGS%% CC = %%CC%% HOSTCC = %%HOSTCC%% -BC_LIB_C_ARGS = bc_lib bc_lib_name $(BC_ENABLED_NAME) 1 -BC_LIB2_C_ARGS = bc_lib2 bc_lib2_name "$(BC_ENABLED_NAME) && $(BC_ENABLE_EXTRA_MATH_NAME)" 1 +BC_LIB_C_ARGS = bc_lib bc.h bc_lib_name $(BC_ENABLED_NAME) 1 +BC_LIB2_C_ARGS = bc_lib2 bc.h bc_lib2_name "$(BC_ENABLED_NAME) && $(BC_ENABLE_EXTRA_MATH_NAME)" 1 -OBJS = $(BC_HELP_O) $(DC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) -OBJ_TARGETS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) +OBJS1 = $(OBJ) $(DC_OBJ) $(BC_OBJ) $(HISTORY_OBJ) $(RAND_OBJ) $(BC_HELP_O) $(DC_HELP_O) +OBJS = $(OBJS1) $(BC_LIB_O) $(BC_LIB2_O) $(BC_LIB3_O) +OBJ_TARGETS1 = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(BC_LIB3_O) +OBJ_TARGETS = $(OBJ_TARGETS1) $(BC_OBJ) $(DC_OBJ) $(HISTORY_OBJ) $(RAND_OBJ) $(OBJ) .c.o: $(CC) $(CFLAGS) -o $@ -c $< -all: %%ALL_PREREQ%% - -execs: make_bin $(OBJ_TARGETS) +all: make_bin $(OBJ_TARGETS) $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(EXEC) %%LINK%% -library: make_bin $(OBJ) $(BC_LIB_O) $(BC_LIB2_O) - ar -r -cu $(LIBBC) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) - $(GEN_EXEC): %%GEN_EXEC_TARGET%% @@ -184,10 +182,10 @@ $(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2) $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_LIB2_C_ARGS) $(BC_HELP_C): $(GEN_EXEC) $(BC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help "" $(BC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help bc.h "" $(BC_ENABLED_NAME) $(DC_HELP_C): $(GEN_EXEC) $(DC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help "" $(DC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help dc.h "" $(DC_ENABLED_NAME) make_bin: $(MKDIR) -p $(BIN) @@ -224,7 +222,7 @@ help: check: test -test: %%TESTS%% +test: test_bc timeconst test_dc test_bc: %%BC_TEST%% @@ -243,12 +241,6 @@ time_test_dc: timeconst: %%TIMECONST%% -library_test: library - $(CC) $(CFLAGS) $(BCL_TEST_C) $(LIBBC) -o $(BCL_TEST) - -test_library: library_test - $(BCL_TEST) - valgrind: valgrind_bc valgrind_dc valgrind_bc: @@ -280,7 +272,6 @@ extra_math: manpages: $(MANPAGE) bc $(MANPAGE) dc - $(MANPAGE) bcl clean_gen: @$(RM) -f $(GEN_EXEC) @@ -288,6 +279,10 @@ clean_gen: clean:%%CLEAN_PREREQS%% @printf 'Cleaning files...\n' @$(RM) -f $(OBJ) + @$(RM) -f $(BC_OBJ) + @$(RM) -f $(DC_OBJ) + @$(RM) -f $(HISTORY_OBJ) + @$(RM) -f $(RAND_OBJ) @$(RM) -f $(BC_EXEC) @$(RM) -f $(DC_EXEC) @$(RM) -fr $(BIN) @@ -348,20 +343,9 @@ install_bc_manpage: install_dc_manpage: $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(DC_MANPAGE) $(DESTDIR)$(MAN1DIR)/$(DC_MANPAGE_NAME) -install_bcl_manpage: - $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(BCL_MANPAGE) $(DESTDIR)$(MAN3DIR)/$(BCL_MANPAGE_NAME) - -install_bcl_header: - $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(BCL_HEADER) $(DESTDIR)$(INCLUDEDIR)/$(BCL_HEADER_NAME) - -install_execs: +install:%%INSTALL_LOCALES_PREREQS%%%%INSTALL_PREREQS%% $(INSTALL) $(DESTDIR)$(BINDIR) "$(EXEC_SUFFIX)" -install_library: - $(SAFE_INSTALL) $(BINARY_INSTALL_ARGS) $(LIBBC) $(DESTDIR)$(LIBDIR)/$(LIB_NAME) - -install:%%INSTALL_LOCALES_PREREQS%%%%INSTALL_MAN_PREREQS%%%%INSTALL_PREREQS%% - uninstall_locales: $(LOCALE_UNINSTALL) $(NLSPATH) $(MAIN_EXEC) $(DESTDIR) @@ -376,14 +360,5 @@ uninstall_dc_manpage: uninstall_dc: $(RM) -f $(DESTDIR)$(BINDIR)/$(EXEC_PREFIX)$(DC)$(EXEC_SUFFIX) - -uninstall_library: - $(RM) -f $(DESTDIR)$(LIBDIR)/$(LIB_NAME) - -uninstall_bcl_header: - $(RM) -f $(DESTDIR)$(INCLUDEDIR)/$(BCL_HEADER_NAME) - -uninstall_bcl_manpage: - $(RM) -f $(DESTDIR)$(MAN3DIR)/$(BCL_MANPAGE_NAME) uninstall:%%UNINSTALL_LOCALES_PREREQS%%%%UNINSTALL_MAN_PREREQS%%%%UNINSTALL_PREREQS%% Modified: vendor/bc/dist/NEWS.md ============================================================================== --- vendor/bc/dist/NEWS.md Thu Nov 26 16:52:17 2020 (r368062) +++ vendor/bc/dist/NEWS.md Thu Nov 26 17:18:18 2020 (r368063) @@ -1,23 +1,5 @@ # News -## 3.2.0 - -This is a production release that has one bug fix and a major addition. - -The bug fix was a missing `auto` variable in the bessel `j()` function in the -math library. - -The major addition is a way to build a version of `bc`'s math code as a library. -This is done with the `-a` option to `configure.sh`. The API for the library can -be read in `./manuals/bcl.3.md` or `man bcl` once the library is installed with -`make install`. - -This library was requested by developers before I even finished version 1.0, but -I could not figure out how to do it until now. - -If the library has API breaking changes, the major version of `bc` will be -incremented. - ## 3.1.6 This is a production release that fixes a new warning from Clang 12 for FreeBSD Modified: vendor/bc/dist/README.md ============================================================================== --- vendor/bc/dist/README.md Thu Nov 26 16:52:17 2020 (r368062) +++ vendor/bc/dist/README.md Thu Nov 26 17:18:18 2020 (r368063) @@ -107,23 +107,6 @@ other locations, use the `PREFIX` environment variable `configure.sh` or pass the `--prefix=` option to `configure.sh`. See the [build manual][5], or run `./configure.sh --help`, for more details. -### Library - -This `bc` does provide a way to build a math library with C bindings. This is -done by the `-a` or `--library` options to `configure.sh`: - -``` -./configure.sh -a -``` - -When building the library, the executables are not built. For more information, -see the [build manual][5]. - -The library API can be found in [`manuals/bcl.3.md`][26] or `man bcl` once the -library is installed. - -The library is built as `bin/libbcl.a`. - ### Package and Distro Maintainers #### Recommended Compiler @@ -352,4 +335,3 @@ Folders: [23]: https://svnweb.freebsd.org/base/head/contrib/bc/ [24]: https://bugs.freebsd.org/ [25]: https://reviews.freebsd.org/ -[26]: ./manuals/bcl.3.md Modified: vendor/bc/dist/configure.sh ============================================================================== --- vendor/bc/dist/configure.sh Thu Nov 26 16:52:17 2020 (r368062) +++ vendor/bc/dist/configure.sh Thu Nov 26 17:18:18 2020 (r368063) @@ -45,27 +45,22 @@ usage() { _usage_val=0 fi - printf 'usage:\n' - printf ' %s -h\n' "$script" - printf ' %s --help\n' "$script" - printf ' %s [-a|-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" - printf ' %s \\\n' "$script" - printf ' [--library|--bc-only --disable-dc|--dc-only --disable-bc|--coverage]\\\n' - printf ' [--force --debug --disable-extra-math --disable-generated-tests] \\\n' - printf ' [--disable-history --disable-man-pages --disable-nls] \\\n' - printf ' [--disable-prompt --disable-strip] [--install-all-locales] \\\n' - printf ' [--opt=OPT_LEVEL] [--karatsuba-len=KARATSUBA_LEN] \\\n' - printf ' [--prefix=PREFIX] [--bindir=BINDIR] [--datarootdir=DATAROOTDIR] \\\n' - printf ' [--datadir=DATADIR] [--mandir=MANDIR] [--man1dir=MAN1DIR] \\\n' + printf 'usage: %s -h\n' "$script" + printf ' %s --help\n' "$script" + printf ' %s [-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" + printf ' %s \\\n' "$script" + printf ' [--bc-only --disable-dc|--dc-only --disable-bc|--coverage] \\\n' + printf ' [--debug --disable-extra-math --disable-generated-tests] \\\n' + printf ' [--disable-history --disable-man-pages --disable-nls] \\\n' + printf ' [--disable-prompt --disable-strip] [--install-all-locales] \\\n' + printf ' [--opt=OPT_LEVEL] [--karatsuba-len=KARATSUBA_LEN] \\\n' + printf ' [--prefix=PREFIX] [--bindir=BINDIR] [--datarootdir=DATAROOTDIR] \\\n' + printf ' [--datadir=DATADIR] [--mandir=MANDIR] [--man1dir=MAN1DIR] \\\n' + printf ' [--force] \\\n' printf '\n' - printf ' -a, --library\n' - printf ' Build the libbc instead of the programs. This is meant to be used with\n' - printf ' Other software like programming languages that want to make use of the\n' - printf ' parsing and math capabilities. This option will install headers using\n' - printf ' `make install`.\n' printf ' -b, --bc-only\n' - printf ' Build bc only. It is an error if "-d", "--dc-only", "-B", or\n' - printf ' "--disable-bc" are specified too.\n' + printf ' Build bc only. It is an error if "-d", "--dc-only", "-B", or "--disable-bc"\n' + printf ' are specified too.\n' printf ' -B, --disable-bc\n' printf ' Disable bc. It is an error if "-b", "--bc-only", "-D", or "--disable-dc"\n' printf ' are specified too.\n' @@ -74,10 +69,10 @@ usage() { printf ' It is an error if either "-b" ("-D") or "-d" ("-B") is specified.\n' printf ' Requires a compiler that use gcc-compatible coverage options\n' printf ' -d, --dc-only\n' - printf ' Build dc only. It is an error if "-b", "--bc-only", "-D", or\n' - printf ' "--disable-dc" are specified too.\n' + printf ' Build dc only. It is an error if "-b", "--bc-only", "-D", or "--disable-dc"\n' + printf ' are specified too.\n' printf ' -D, --disable-dc\n' - printf ' Disable dc. It is an error if "-d", "--dc-only", "-B", or "--disable-bc"\n' + printf ' Disable dc. It is an error if "-d", "--dc-only" "-B", or "--disable-bc"\n' printf ' are specified too.\n' printf ' -E, --disable-extra-math\n' printf ' Disable extra math. This includes: "$" operator (truncate to integer),\n' @@ -127,14 +122,8 @@ usage() { printf ' If PREFIX is "/usr", install path will be "/usr/bin".\n' printf ' Default is "/usr/local".\n' printf ' --bindir BINDIR\n' - printf ' The directory to install binaries in. Overrides "$BINDIR" if it exists.\n' + printf ' The directory to install binaries. Overrides "$BINDIR" if it exists.\n' printf ' Default is "$PREFIX/bin".\n' - printf ' --includedir INCLUDEDIR\n' - printf ' The directory to install headers in. Overrides "$INCLUDEDIR" if it\n' - printf ' exists. Default is "$PREFIX/include".\n' - printf ' --libdir LIBDIR\n' - printf ' The directory to install libraries in. Overrides "$LIBDIR" if it exists.\n' - printf ' Default is "$PREFIX/lib".\n' printf ' --datarootdir DATAROOTDIR\n' printf ' The root location for data files. Overrides "$DATAROOTDIR" if it exists.\n' printf ' Default is "$PREFIX/share".\n' @@ -147,9 +136,6 @@ usage() { printf ' --man1dir MAN1DIR\n' printf ' The location to install Section 1 manpages to. Overrides "$MAN1DIR" if\n' printf ' it exists. Default is "$MANDIR/man1".\n' - printf ' --man3dir MAN3DIR\n' - printf ' The location to install Section 3 manpages to. Overrides "$MAN3DIR" if\n' - printf ' it exists. Default is "$MANDIR/man3".\n' printf '\n' printf 'In addition, the following environment variables are used:\n' printf '\n' @@ -171,18 +157,12 @@ usage() { printf ' LDFLAGS Linker flags. Default is "".\n' printf ' PREFIX The prefix to install to. Default is "/usr/local".\n' printf ' If PREFIX is "/usr", install path will be "/usr/bin".\n' - printf ' BINDIR The directory to install binaries in. Default is "$PREFIX/bin".\n' - printf ' INCLUDEDIR The directory to install header files in. Default is\n' - printf ' "$PREFIX/include".\n' - printf ' LIBDIR The directory to install libraries in. Default is\n' - printf ' "$PREFIX/lib".\n' + printf ' BINDIR The directory to install binaries. Default is "$PREFIX/bin".\n' printf ' DATAROOTDIR The root location for data files. Default is "$PREFIX/share".\n' printf ' DATADIR The location for data files. Default is "$DATAROOTDIR".\n' printf ' MANDIR The location to install manpages to. Default is "$DATADIR/man".\n' printf ' MAN1DIR The location to install Section 1 manpages to. Default is\n' printf ' "$MANDIR/man1".\n' - printf ' MAN3DIR The location to install Section 3 manpages to. Default is\n' - printf ' "$MANDIR/man3".\n' printf ' NLSPATH The location to install locale catalogs to. Must be an absolute\n' printf ' path (or contain one). This is treated the same as the POSIX\n' printf ' definition of $NLSPATH (see POSIX environment variables for\n' @@ -277,55 +257,56 @@ replace() { substring_replace "$_replace_str" "%%$_replace_needle%%" "$_replace_replacement" } -gen_file_list() { +gen_file_lists() { - if [ "$#" -lt 1 ]; then + if [ "$#" -lt 3 ]; then err_exit "Invalid number of args to $0" fi - _gen_file_list_contents="$1" + _gen_file_lists_contents="$1" shift - p=$(pwd) + _gen_file_lists_filedir="$1" + shift - cd "$scriptdir" + _gen_file_lists_typ="$1" + shift - if [ "$#" -ge 1 ]; then - - while [ "$#" -ge 1 ]; do - a="$1" - shift - args="$args ! -wholename src/${a}" - done - + # If there is an extra argument, and it + # is zero, we keep the file lists empty. + if [ "$#" -gt 0 ]; then + _gen_file_lists_use="$1" else - args="-print" + _gen_file_lists_use="1" fi - _gen_file_list_needle_src="SRC" - _gen_file_list_needle_obj="OBJ" - _gen_file_list_needle_gcda="GCDA" - _gen_file_list_needle_gcno="GCNO" + _gen_file_lists_needle_src="${_gen_file_lists_typ}SRC" + _gen_file_lists_needle_obj="${_gen_file_lists_typ}OBJ" + _gen_file_lists_needle_gcda="${_gen_file_lists_typ}GCDA" + _gen_file_lists_needle_gcno="${_gen_file_lists_typ}GCNO" - _gen_file_list_replacement=$(find src/ -depth -name "*.c" $args | tr '\n' ' ') - _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ - "$_gen_file_list_needle_src" "$_gen_file_list_replacement") + if [ "$_gen_file_lists_use" -ne 0 ]; then - _gen_file_list_replacement=$(replace_exts "$_gen_file_list_replacement" "c" "o") - _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ - "$_gen_file_list_needle_obj" "$_gen_file_list_replacement") + _gen_file_lists_replacement=$(cd "$_gen_file_lists_filedir" && find . ! -name . -prune -name "*.c" | cut -d/ -f2 | sed "s@^@$_gen_file_lists_filedir/@g" | tr '\n' ' ') + _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_src" "$_gen_file_lists_replacement") - _gen_file_list_replacement=$(replace_exts "$_gen_file_list_replacement" "o" "gcda") - _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ - "$_gen_file_list_needle_gcda" "$_gen_file_list_replacement") + _gen_file_lists_replacement=$(replace_exts "$_gen_file_lists_replacement" "c" "o") + _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_obj" "$_gen_file_lists_replacement") - _gen_file_list_replacement=$(replace_exts "$_gen_file_list_replacement" "gcda" "gcno") - _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ - "$_gen_file_list_needle_gcno" "$_gen_file_list_replacement") + _gen_file_lists_replacement=$(replace_exts "$_gen_file_lists_replacement" "o" "gcda") + _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcda" "$_gen_file_lists_replacement") - cd "$p" + _gen_file_lists_replacement=$(replace_exts "$_gen_file_lists_replacement" "gcda" "gcno") + _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcno" "$_gen_file_lists_replacement") - printf '%s\n' "$_gen_file_list_contents" + else + _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_src" "") + _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_obj" "") + _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcda" "") + _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcno" "") + fi + + printf '%s\n' "$_gen_file_lists_contents" } bc_only=0 @@ -343,12 +324,10 @@ prompt=1 force=0 strip_bin=1 all_locales=0 -library=0 -while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do +while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do case "$opt" in - a) library=1 ;; b) bc_only=1 ;; B) dc_only=1 ;; c) coverage=1 ;; @@ -373,7 +352,6 @@ while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do LONG_OPTARG="${arg#*=}" case $arg in help) usage ;; - library) library=1 ;; bc-only) bc_only=1 ;; dc-only) dc_only=1 ;; coverage) coverage=1 ;; @@ -393,20 +371,6 @@ while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do fi BINDIR="$2" shift ;; - includedir=?*) INCLUDEDIR="$LONG_OPTARG" ;; - includedir) - if [ "$#" -lt 2 ]; then - usage "No argument given for '--$arg' option" - fi - INCLUDEDIR="$2" - shift ;; - libdir=?*) LIBDIR="$LONG_OPTARG" ;; - libdir) - if [ "$#" -lt 2 ]; then - usage "No argument given for '--$arg' option" - fi - LIBDIR="$2" - shift ;; datarootdir=?*) DATAROOTDIR="$LONG_OPTARG" ;; datarootdir) if [ "$#" -lt 2 ]; then @@ -435,13 +399,6 @@ while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do fi MAN1DIR="$2" shift ;; - man3dir=?*) MAN3DIR="$LONG_OPTARG" ;; - man3dir) - if [ "$#" -lt 2 ]; then - usage "No argument given for '--$arg' option" - fi - MAN3DIR="$2" - shift ;; localedir=?*) LOCALEDIR="$LONG_OPTARG" ;; localedir) if [ "$#" -lt 2 ]; then @@ -497,12 +454,6 @@ if [ "$bc_only" -eq 1 ] && [ "$dc_only" -eq 1 ]; then usage "Can only specify one of -b(-D) or -d(-B)" fi -if [ "$library" -ne 0 ]; then - if [ "$bc_only" -eq 1 ] || [ "$dc_only" -eq 1 ]; then - usage "Must not specify -b(-D) or -d(-B) when building the library" - fi -fi - case $karatsuba_len in (*[!0-9]*|'') usage "KARATSUBA_LEN is not a number" ;; (*) ;; @@ -578,8 +529,6 @@ link="@printf 'No link necessary\\\\n'" main_exec="BC" executable="BC_EXEC" -tests="test_bc timeconst test_dc" - bc_test="@tests/all.sh bc $extra_math 1 $generate_tests 0 \$(BC_EXEC)" bc_time_test="@tests/all.sh bc $extra_math 1 $generate_tests 1 \$(BC_EXEC)" @@ -618,8 +567,7 @@ if [ "$bc_only" -eq 1 ]; then dc_time_test="@printf 'No dc tests to run\\\\n'" vg_dc_test="@printf 'No dc tests to run\\\\n'" - install_prereqs=" install_execs" - install_man_prereqs=" install_bc_manpage" + install_prereqs=" install_bc_manpage" uninstall_prereqs=" uninstall_bc" uninstall_man_prereqs=" uninstall_bc_manpage" @@ -642,8 +590,7 @@ elif [ "$dc_only" -eq 1 ]; then timeconst="@printf 'timeconst cannot be run because bc is not built\\\\n'" - install_prereqs=" install_execs" - install_man_prereqs=" install_dc_manpage" + install_prereqs=" install_dc_manpage" uninstall_prereqs=" uninstall_dc" uninstall_man_prereqs=" uninstall_dc_manpage" @@ -659,18 +606,9 @@ else karatsuba="@\$(KARATSUBA) 30 0 \$(BC_EXEC)" karatsuba_test="@\$(KARATSUBA) 1 100 \$(BC_EXEC)" - if [ "$library" -eq 0 ]; then - install_prereqs=" install_execs" - install_man_prereqs=" install_bc_manpage install_dc_manpage" - uninstall_prereqs=" uninstall_bc uninstall_dc" - uninstall_man_prereqs=" uninstall_bc_manpage uninstall_dc_manpage" - else - install_prereqs=" install_library install_bcl_header" - install_man_prereqs=" install_bcl_manpage" - uninstall_prereqs=" uninstall_library uninstall_bcl_header" - uninstall_man_prereqs=" uninstall_bcl_manpage" - tests="test_library" - fi + install_prereqs=" install_bc_manpage install_dc_manpage" + uninstall_prereqs=" uninstall_bc uninstall_dc" + uninstall_man_prereqs=" uninstall_bc_manpage uninstall_dc_manpage" fi @@ -726,14 +664,6 @@ if [ -z "${BINDIR+set}" ]; then BINDIR="$PREFIX/bin" fi -if [ -z "${INCLUDEDIR+set}" ]; then - INCLUDEDIR="$PREFIX/include" -fi - -if [ -z "${LIBDIR+set}" ]; then - LIBDIR="$PREFIX/lib" -fi - if [ "$install_manpages" -ne 0 ] || [ "$nls" -ne 0 ]; then if [ -z "${DATAROOTDIR+set}" ]; then DATAROOTDIR="$PREFIX/share" @@ -754,25 +684,11 @@ if [ "$install_manpages" -ne 0 ]; then MAN1DIR="$MANDIR/man1" fi - if [ -z "${MAN3DIR+set}" ]; then - MAN3DIR="$MANDIR/man3" - fi - else - install_man_prereqs="" + install_prereqs="" uninstall_man_prereqs="" fi -if [ "$library" -ne 0 ]; then - extra_math=1 - nls=0 - hist=0 - prompt=0 - ALL_PREREQ="library" -else - ALL_PREREQ="execs" -fi - if [ "$nls" -ne 0 ]; then set +e @@ -860,11 +776,11 @@ if [ "$hist" -eq 1 ]; then printf 'Testing history...\n' flags="-DBC_ENABLE_HISTORY=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc" - flags="$flags -DBC_ENABLE_NLS=$nls -DBC_ENABLE_LIBRARY=0" + flags="$flags -DBC_ENABLE_NLS=$nls" flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I./include/" flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" - "$CC" $CPPFLAGS $CFLAGS $flags -c "src/history.c" -o "$scriptdir/history.o" > /dev/null 2>&1 + "$CC" $CPPFLAGS $CFLAGS $flags -c "src/history/history.c" -o "$scriptdir/history.o" > /dev/null 2>&1 err="$?" @@ -888,11 +804,7 @@ if [ "$hist" -eq 1 ]; then fi -if [ "$library" -eq 1 ]; then - bc_lib="" -fi - -if [ "$extra_math" -eq 1 ] && [ "$bc" -ne 0 ] && [ "$library" -eq 0 ]; then +if [ "$extra_math" -eq 1 ] && [ "$bc" -ne 0 ]; then BC_LIB2_O="\$(GEN_DIR)/lib2.o" else BC_LIB2_O="" @@ -934,33 +846,6 @@ if [ "$manpage_args" = "" ]; then manpage_args="A" fi -unneeded="" - -if [ "$hist" -eq 0 ]; then - unneeded="$unneeded history.c" -fi - -if [ "$bc" -eq 0 ]; then - unneeded="$unneeded bc.c bc_lex.c bc_parse.c" -fi - -if [ "$dc" -eq 0 ]; then - unneeded="$unneeded dc.c dc_lex.c dc_parse.c" -fi - -if [ "$extra_math" -eq 0 ]; then - unneeded="$unneeded rand.c" -fi - -if [ "$library" -ne 0 ]; then - unneeded="$unneeded args.c opt.c read.c file.c main.c" - unneeded="$unneeded lang.c lex.c parse.c program.c" - unneeded="$unneeded bc.c bc_lex.c bc_parse.c" - unneeded="$unneeded dc.c dc_lex.c dc_parse.c" -else - unneeded="$unneeded library.c" -fi - # Print out the values; this is for debugging. if [ "$bc" -ne 0 ]; then printf 'Building bc\n' @@ -973,7 +858,6 @@ else printf 'Not building dc\n' fi printf '\n' -printf 'BC_ENABLE_LIBRARY=%s\n\n' "$library" printf 'BC_ENABLE_HISTORY=%s\n' "$hist" printf 'BC_ENABLE_EXTRA_MATH=%s\n' "$extra_math" printf 'BC_ENABLE_NLS=%s\n' "$nls" @@ -989,13 +873,10 @@ printf 'CPPFLAGS=%s\n' "$CPPFLAGS" printf 'LDFLAGS=%s\n' "$LDFLAGS" printf 'PREFIX=%s\n' "$PREFIX" printf 'BINDIR=%s\n' "$BINDIR" -printf 'INCLUDEDIR=%s\n' "$INCLUDEDIR" -printf 'LIBDIR=%s\n' "$LIBDIR" printf 'DATAROOTDIR=%s\n' "$DATAROOTDIR" printf 'DATADIR=%s\n' "$DATADIR" printf 'MANDIR=%s\n' "$MANDIR" printf 'MAN1DIR=%s\n' "$MAN1DIR" -printf 'MAN3DIR=%s\n' "$MAN3DIR" printf 'NLSPATH=%s\n' "$NLSPATH" printf 'EXECSUFFIX=%s\n' "$EXECSUFFIX" printf 'EXECPREFIX=%s\n' "$EXECPREFIX" @@ -1011,17 +892,16 @@ replacement='*** WARNING: Autogenerated from Makefile. contents=$(replace "$contents" "$needle" "$replacement") -if [ "$unneeded" = "" ]; then - contents=$(gen_file_list "$contents" "library.c") -else - contents=$(gen_file_list "$contents" $unneeded) -fi +contents=$(gen_file_lists "$contents" "$scriptdir/src" "") +contents=$(gen_file_lists "$contents" "$scriptdir/src/bc" "BC_" "$bc") +contents=$(gen_file_lists "$contents" "$scriptdir/src/dc" "DC_" "$dc") +contents=$(gen_file_lists "$contents" "$scriptdir/src/history" "HISTORY_" "$hist") +contents=$(gen_file_lists "$contents" "$scriptdir/src/rand" "RAND_" "$extra_math") contents=$(replace "$contents" "BC_ENABLED" "$bc") contents=$(replace "$contents" "DC_ENABLED" "$dc") contents=$(replace "$contents" "LINK" "$link") -contents=$(replace "$contents" "LIBRARY" "$library") contents=$(replace "$contents" "HISTORY" "$hist") contents=$(replace "$contents" "EXTRA_MATH" "$extra_math") contents=$(replace "$contents" "NLS" "$nls") @@ -1037,10 +917,7 @@ contents=$(replace "$contents" "DESTDIR" "$destdir") contents=$(replace "$contents" "EXECSUFFIX" "$EXECSUFFIX") contents=$(replace "$contents" "EXECPREFIX" "$EXECPREFIX") contents=$(replace "$contents" "BINDIR" "$BINDIR") -contents=$(replace "$contents" "INCLUDEDIR" "$INCLUDEDIR") -contents=$(replace "$contents" "LIBDIR" "$LIBDIR") contents=$(replace "$contents" "MAN1DIR" "$MAN1DIR") -contents=$(replace "$contents" "MAN3DIR" "$MAN3DIR") contents=$(replace "$contents" "CFLAGS" "$CFLAGS") contents=$(replace "$contents" "HOSTCFLAGS" "$HOSTCFLAGS") contents=$(replace "$contents" "CPPFLAGS" "$CPPFLAGS") @@ -1050,19 +927,15 @@ contents=$(replace "$contents" "HOSTCC" "$HOSTCC") contents=$(replace "$contents" "COVERAGE_OUTPUT" "$COVERAGE_OUTPUT") contents=$(replace "$contents" "COVERAGE_PREREQS" "$COVERAGE_PREREQS") contents=$(replace "$contents" "INSTALL_PREREQS" "$install_prereqs") -contents=$(replace "$contents" "INSTALL_MAN_PREREQS" "$install_man_prereqs") contents=$(replace "$contents" "INSTALL_LOCALES" "$install_locales") contents=$(replace "$contents" "INSTALL_LOCALES_PREREQS" "$install_locales_prereqs") contents=$(replace "$contents" "UNINSTALL_MAN_PREREQS" "$uninstall_man_prereqs") contents=$(replace "$contents" "UNINSTALL_PREREQS" "$uninstall_prereqs") contents=$(replace "$contents" "UNINSTALL_LOCALES_PREREQS" "$uninstall_locales_prereqs") -contents=$(replace "$contents" "ALL_PREREQ" "$ALL_PREREQ") - contents=$(replace "$contents" "EXECUTABLES" "$executables") contents=$(replace "$contents" "MAIN_EXEC" "$main_exec") contents=$(replace "$contents" "EXEC" "$executable") -contents=$(replace "$contents" "TESTS" "$tests") contents=$(replace "$contents" "BC_TEST" "$bc_test") contents=$(replace "$contents" "BC_TIME_TEST" "$bc_time_test") Modified: vendor/bc/dist/gen/lib.bc ============================================================================== --- vendor/bc/dist/gen/lib.bc Thu Nov 26 16:52:17 2020 (r368062) +++ vendor/bc/dist/gen/lib.bc Thu Nov 26 17:18:18 2020 (r368063) @@ -173,7 +173,7 @@ define a(x){ return((m*a+r)/n) } define j(n,x){ - auto b,s,o,a,i,r,v,f + auto b,s,o,a,i,v,f b=ibase ibase=A s=scale Modified: vendor/bc/dist/gen/strgen.c ============================================================================== --- vendor/bc/dist/gen/strgen.c Thu Nov 26 16:52:17 2020 (r368062) +++ vendor/bc/dist/gen/strgen.c Thu Nov 26 17:18:18 2020 (r368063) @@ -45,14 +45,13 @@ static const char* const bc_gen_header = "// Copyright (c) 2018-2020 Gavin D. Howard and contributors.\n" "// Licensed under the 2-clause BSD license.\n" - "// *** AUTOMATICALLY GENERATED FROM %s. DO NOT MODIFY. ***\n\n"; + "// *** AUTOMATICALLY GENERATED FROM %s. DO NOT MODIFY. ***\n"; +static const char* const bc_gen_include = "#include <%s>\n\n"; static const char* const bc_gen_label = "const char *%s = \"%s\";\n\n"; -static const char* const bc_gen_label_extern = "extern const char *%s;\n\n"; static const char* const bc_gen_ifdef = "#if %s\n"; static const char* const bc_gen_endif = "#endif // %s\n"; static const char* const bc_gen_name = "const char %s[] = {\n"; -static const char* const bc_gen_name_extern = "extern const char %s[];\n\n"; #define IO_ERR (1) #define INVALID_INPUT_FILE (2) @@ -63,7 +62,7 @@ static const char* const bc_gen_name_extern = "extern int main(int argc, char *argv[]) { FILE *in, *out; - char *label, *define, *name; + char *label, *define, *name, *include; int c, count, slashes, err = IO_ERR; bool has_label, has_define, remove_tabs; @@ -73,14 +72,15 @@ int main(int argc, char *argv[]) { } name = argv[3]; + include = argv[4]; - has_label = (argc > 4 && strcmp("", argv[4]) != 0); - label = has_label ? argv[4] : ""; + has_label = (argc > 5 && strcmp("", argv[5]) != 0); + label = has_label ? argv[5] : ""; - has_define = (argc > 5 && strcmp("", argv[5]) != 0); - define = has_define ? argv[5] : ""; + has_define = (argc > 6 && strcmp("", argv[6]) != 0); + define = has_define ? argv[6] : ""; - remove_tabs = (argc > 6); + remove_tabs = (argc > 7); in = fopen(argv[1], "r"); if (!in) return INVALID_INPUT_FILE; @@ -89,9 +89,8 @@ int main(int argc, char *argv[]) { if (!out) goto out_err; if (fprintf(out, bc_gen_header, argv[1]) < 0) goto err; - if (has_label && fprintf(out, bc_gen_label_extern, label) < 0) goto err; - if (fprintf(out, bc_gen_name_extern, name) < 0) goto err; if (has_define && fprintf(out, bc_gen_ifdef, define) < 0) goto err; + if (fprintf(out, bc_gen_include, include) < 0) goto err; if (has_label && fprintf(out, bc_gen_label, label, argv[1]) < 0) goto err; if (fprintf(out, bc_gen_name, name) < 0) goto err; Modified: vendor/bc/dist/gen/strgen.sh ============================================================================== --- vendor/bc/dist/gen/strgen.sh Thu Nov 26 16:52:17 2020 (r368062) +++ vendor/bc/dist/gen/strgen.sh Thu Nov 26 17:18:18 2020 (r368063) @@ -50,7 +50,6 @@ exec > "$output" if [ -n "$label" ]; then nameline="const char *${label} = \"${input}\";" - labelexternline="extern const char *${label};" fi if [ -n "$define" ]; then @@ -65,14 +64,11 @@ if [ -n "$remove_tabs" ]; then fi cat< $nameline Modified: vendor/bc/dist/include/file.h ============================================================================== --- vendor/bc/dist/include/file.h Thu Nov 26 16:52:17 2020 (r368062) +++ vendor/bc/dist/include/file.h Thu Nov 26 17:18:18 2020 (r368063) @@ -62,4 +62,6 @@ void bc_file_printf(BcFile *restrict f, const char *fm void bc_file_vprintf(BcFile *restrict f, const char *fmt, va_list args); void bc_file_puts(BcFile *restrict f, const char *str); +void bc_file_ultoa(unsigned long long val, char buf[BC_FILE_ULL_LENGTH]); + #endif // BC_FILE_H Modified: vendor/bc/dist/include/lex.h ============================================================================== --- vendor/bc/dist/include/lex.h Thu Nov 26 16:52:17 2020 (r368062) +++ vendor/bc/dist/include/lex.h Thu Nov 26 17:18:18 2020 (r368063) @@ -43,8 +43,8 @@ #include #include -#define bc_lex_err(l, e) (bc_vm_handleError((e), (l)->line)) -#define bc_lex_verr(l, e, ...) (bc_vm_handleError((e), (l)->line, __VA_ARGS__)) +#define bc_lex_err(l, e) (bc_vm_error((e), (l)->line)) +#define bc_lex_verr(l, e, ...) (bc_vm_error((e), (l)->line, __VA_ARGS__)) #if BC_ENABLED Modified: vendor/bc/dist/include/num.h ============================================================================== --- vendor/bc/dist/include/num.h Thu Nov 26 16:52:17 2020 (r368062) +++ vendor/bc/dist/include/num.h Thu Nov 26 17:18:18 2020 (r368063) @@ -45,7 +45,6 @@ #include #include -#include #ifndef BC_ENABLE_EXTRA_MATH #define BC_ENABLE_EXTRA_MATH (1) @@ -55,10 +54,25 @@ typedef unsigned long ulong; -typedef BclBigDig BcBigDig; +// For some reason, LONG_BIT is not defined in some versions of gcc. +// I define it here to the minimum accepted value in the POSIX standard. +#ifndef LONG_BIT +#define LONG_BIT (32) +#endif // LONG_BIT +#ifndef BC_LONG_BIT +#define BC_LONG_BIT LONG_BIT +#endif // BC_LONG_BIT + +#if BC_LONG_BIT > LONG_BIT +#error BC_LONG_BIT cannot be greater than LONG_BIT +#endif // BC_LONG_BIT > LONG_BIT + #if BC_LONG_BIT >= 64 +typedef int_least32_t BcDig; +typedef uint64_t BcBigDig; + #define BC_NUM_BIGDIG_MAX ((BcBigDig) UINT64_MAX) #define BC_BASE_DIGS (9) @@ -66,10 +80,11 @@ typedef BclBigDig BcBigDig; #define BC_NUM_BIGDIG_C UINT64_C -typedef int_least32_t BcDig; - #elif BC_LONG_BIT >= 32 +typedef int_least16_t BcDig; +typedef uint32_t BcBigDig; + #define BC_NUM_BIGDIG_MAX ((BcBigDig) UINT32_MAX) #define BC_BASE_DIGS (4) @@ -77,8 +92,6 @@ typedef int_least32_t BcDig; #define BC_NUM_BIGDIG_C UINT32_C -typedef int_least16_t BcDig; - #else #error BC_LONG_BIT must be at least 32 @@ -93,6 +106,7 @@ typedef struct BcNum { size_t scale; size_t len; size_t cap; + bool neg; } BcNum; #if BC_ENABLE_EXTRA_MATH @@ -136,30 +150,6 @@ struct BcRNG; #define BC_NUM_ROUND_POW(s) (bc_vm_growSize((s), BC_BASE_DIGS - 1)) #define BC_NUM_RDX(s) (BC_NUM_ROUND_POW(s) / BC_BASE_DIGS) -#define BC_NUM_RDX_VAL(n) ((n)->rdx >> 1) -#define BC_NUM_RDX_VAL_NP(n) ((n).rdx >> 1) -#define BC_NUM_RDX_SET(n, v) \ - ((n)->rdx = (((v) << 1) | ((n)->rdx & (BcBigDig) 1))) -#define BC_NUM_RDX_SET_NP(n, v) \ - ((n).rdx = (((v) << 1) | ((n).rdx & (BcBigDig) 1))) -#define BC_NUM_RDX_SET_NEG(n, v, neg) \ - ((n)->rdx = (((v) << 1) | (neg))) - -#define BC_NUM_RDX_VALID(n) \ - (BC_NUM_ZERO(n) || BC_NUM_RDX_VAL(n) * BC_BASE_DIGS >= (n)->scale) -#define BC_NUM_RDX_VALID_NP(n) \ - ((!(n).len) || BC_NUM_RDX_VAL_NP(n) * BC_BASE_DIGS >= (n).scale) - -#define BC_NUM_NEG(n) ((n)->rdx & ((BcBigDig) 1)) -#define BC_NUM_NEG_NP(n) ((n).rdx & ((BcBigDig) 1)) -#define BC_NUM_NEG_CLR(n) ((n)->rdx &= ~((BcBigDig) 1)) -#define BC_NUM_NEG_CLR_NP(n) ((n).rdx &= ~((BcBigDig) 1)) -#define BC_NUM_NEG_SET(n) ((n)->rdx |= ((BcBigDig) 1)) -#define BC_NUM_NEG_TGL(n) ((n)->rdx ^= ((BcBigDig) 1)) -#define BC_NUM_NEG_TGL_NP(n) ((n).rdx ^= ((BcBigDig) 1)) -#define BC_NUM_NEG_VAL(n, v) (((n)->rdx & ~((BcBigDig) 1)) | (v)) -#define BC_NUM_NEG_VAL_NP(n, v) (((n).rdx & ~((BcBigDig) 1)) | (v)) - #define BC_NUM_SIZE(n) ((n) * sizeof(BcDig)) #if BC_DEBUG_CODE @@ -193,7 +183,7 @@ void bc_num_bigdig2num(BcNum *restrict n, BcBigDig val *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Nov 26 17:18:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C0734697EC; Thu, 26 Nov 2020 17:18:55 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chkxq11DXz4lkg; Thu, 26 Nov 2020 17:18:55 +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 15B5026C54; Thu, 26 Nov 2020 17:18:55 +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 0AQHIsl6000192; Thu, 26 Nov 2020 17:18:54 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQHIseu000191; Thu, 26 Nov 2020 17:18:54 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011261718.0AQHIseu000191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 26 Nov 2020 17:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368064 - head/sys/arm/ti X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/ti X-SVN-Commit-Revision: 368064 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 17:18:55 -0000 Author: manu Date: Thu Nov 26 17:18:54 2020 New Revision: 368064 URL: https://svnweb.freebsd.org/changeset/base/368064 Log: arm: ti: Remove unused function ti_first_gpio_bank Modified: head/sys/arm/ti/ti_gpio.c Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Thu Nov 26 17:18:18 2020 (r368063) +++ head/sys/arm/ti/ti_gpio.c Thu Nov 26 17:18:54 2020 (r368064) @@ -134,22 +134,6 @@ static int ti_gpio_detach(device_t); static int ti_gpio_pic_attach(struct ti_gpio_softc *sc); static int ti_gpio_pic_detach(struct ti_gpio_softc *sc); -static u_int -ti_first_gpio_bank(void) -{ - switch(ti_chip()) { -#ifdef SOC_OMAP4 - case CHIP_OMAP_4: - return (OMAP4_FIRST_GPIO_BANK); -#endif -#ifdef SOC_TI_AM335X - case CHIP_AM335X: - return (AM335X_FIRST_GPIO_BANK); -#endif - } - return (0); -} - static uint32_t ti_gpio_rev(void) { From owner-svn-src-all@freebsd.org Thu Nov 26 17:19:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BA104697E5; Thu, 26 Nov 2020 17:19:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chky96tWnz4lj4; Thu, 26 Nov 2020 17:19:13 +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 DCDF726E41; Thu, 26 Nov 2020 17:19:13 +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 0AQHJDaj000252; Thu, 26 Nov 2020 17:19:13 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQHJDCv000251; Thu, 26 Nov 2020 17:19:13 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011261719.0AQHJDCv000251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 26 Nov 2020 17:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368065 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 368065 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 17:19:14 -0000 Author: manu Date: Thu Nov 26 17:19:13 2020 New Revision: 368065 URL: https://svnweb.freebsd.org/changeset/base/368065 Log: arm: mv: Remove unused code Modified: head/sys/arm/mv/mv_common.c Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Thu Nov 26 17:18:54 2020 (r368064) +++ head/sys/arm/mv/mv_common.c Thu Nov 26 17:19:13 2020 (r368065) @@ -79,7 +79,6 @@ struct soc_node_spec; static enum soc_family soc_family; -static int mv_win_cesa_attr(int wng_sel); static int mv_win_cesa_attr_armv5(int eng_sel); static int mv_win_cesa_attr_armada38x(int eng_sel); static int mv_win_cesa_attr_armadaxp(int eng_sel); @@ -93,7 +92,6 @@ void write_cpu_ctrl_armv7(uint32_t reg, uint32_t val); static int win_eth_can_remap(int i); static int decode_win_cesa_valid(void); -static int decode_win_cpu_valid(void); static int decode_win_usb_valid(void); static int decode_win_usb3_valid(void); static int decode_win_eth_valid(void); @@ -402,15 +400,6 @@ pm_is_disabled(uint32_t mask) * machines. */ -static int mv_win_cesa_attr(int eng_sel) -{ - - if (soc_decode_win_spec->win_cesa_attr != NULL) - return (soc_decode_win_spec->win_cesa_attr(eng_sel)); - - return (-1); -} - static int mv_win_cesa_attr_armv5(int eng_sel) { @@ -987,15 +976,6 @@ WIN_REG_BASE_IDX_WR(win_eth, br, MV_WIN_ETH_BASE) WIN_REG_BASE_IDX_WR(win_eth, sz, MV_WIN_ETH_SIZE) WIN_REG_BASE_IDX_WR(win_eth, har, MV_WIN_ETH_REMAP) -WIN_REG_BASE_IDX_RD2(win_xor, br, MV_WIN_XOR_BASE) -WIN_REG_BASE_IDX_RD2(win_xor, sz, MV_WIN_XOR_SIZE) -WIN_REG_BASE_IDX_RD2(win_xor, har, MV_WIN_XOR_REMAP) -WIN_REG_BASE_IDX_RD2(win_xor, ctrl, MV_WIN_XOR_CTRL) -WIN_REG_BASE_IDX_WR2(win_xor, br, MV_WIN_XOR_BASE) -WIN_REG_BASE_IDX_WR2(win_xor, sz, MV_WIN_XOR_SIZE) -WIN_REG_BASE_IDX_WR2(win_xor, har, MV_WIN_XOR_REMAP) -WIN_REG_BASE_IDX_WR2(win_xor, ctrl, MV_WIN_XOR_CTRL) - WIN_REG_BASE_RD(win_eth, bare, 0x290) WIN_REG_BASE_RD(win_eth, epap, 0x294) WIN_REG_BASE_WR(win_eth, bare, 0x290) @@ -1014,17 +994,6 @@ WIN_REG_BASE_IDX_WR(pcie_bar, br, MV_PCIE_BAR_BASE); WIN_REG_BASE_IDX_WR(pcie_bar, brh, MV_PCIE_BAR_BASE_H); WIN_REG_BASE_IDX_WR(pcie_bar, cr, MV_PCIE_BAR_CTRL); -WIN_REG_BASE_IDX_RD(win_idma, br, MV_WIN_IDMA_BASE) -WIN_REG_BASE_IDX_RD(win_idma, sz, MV_WIN_IDMA_SIZE) -WIN_REG_BASE_IDX_RD(win_idma, har, MV_WIN_IDMA_REMAP) -WIN_REG_BASE_IDX_RD(win_idma, cap, MV_WIN_IDMA_CAP) -WIN_REG_BASE_IDX_WR(win_idma, br, MV_WIN_IDMA_BASE) -WIN_REG_BASE_IDX_WR(win_idma, sz, MV_WIN_IDMA_SIZE) -WIN_REG_BASE_IDX_WR(win_idma, har, MV_WIN_IDMA_REMAP) -WIN_REG_BASE_IDX_WR(win_idma, cap, MV_WIN_IDMA_CAP) -WIN_REG_BASE_RD(win_idma, bare, 0xa80) -WIN_REG_BASE_WR(win_idma, bare, 0xa80) - WIN_REG_BASE_IDX_RD(win_sata, cr, MV_WIN_SATA_CTRL); WIN_REG_BASE_IDX_RD(win_sata, br, MV_WIN_SATA_BASE); WIN_REG_BASE_IDX_WR(win_sata, cr, MV_WIN_SATA_CTRL); @@ -1033,7 +1002,6 @@ WIN_REG_BASE_IDX_WR(win_sata, br, MV_WIN_SATA_BASE); WIN_REG_BASE_IDX_RD(win_sata_armada38x, sz, MV_WIN_SATA_SIZE_ARMADA38X); WIN_REG_BASE_IDX_WR(win_sata_armada38x, sz, MV_WIN_SATA_SIZE_ARMADA38X); WIN_REG_BASE_IDX_RD(win_sata_armada38x, cr, MV_WIN_SATA_CTRL_ARMADA38X); -WIN_REG_BASE_IDX_RD(win_sata_armada38x, br, MV_WIN_SATA_BASE_ARMADA38X); WIN_REG_BASE_IDX_WR(win_sata_armada38x, cr, MV_WIN_SATA_CTRL_ARMADA38X); WIN_REG_BASE_IDX_WR(win_sata_armada38x, br, MV_WIN_SATA_BASE_ARMADA38X); @@ -1200,65 +1168,6 @@ decode_win_overlap(int win, int win_no, const struct d } return (-1); -} - -static int -decode_win_cpu_valid(void) -{ - int i, j, rv; - uint32_t b, e, s; - - if (cpu_wins_no > soc_decode_win_spec->mv_win_cpu_max) { - printf("CPU windows: too many entries: %d\n", cpu_wins_no); - return (0); - } - - rv = 1; - for (i = 0; i < cpu_wins_no; i++) { - if (cpu_wins[i].target == 0) { - printf("CPU window#%d: DDR target window is not " - "supposed to be reprogrammed!\n", i); - rv = 0; - } - - if (cpu_wins[i].remap != ~0 && win_cpu_can_remap(i) != 1) { - printf("CPU window#%d: not capable of remapping, but " - "val 0x%08x defined\n", i, cpu_wins[i].remap); - rv = 0; - } - - s = cpu_wins[i].size; - b = cpu_wins[i].base; - e = b + s - 1; - if (s > (0xFFFFFFFF - b + 1)) { - /* - * XXX this boundary check should account for 64bit - * and remapping.. - */ - printf("CPU window#%d: no space for size 0x%08x at " - "0x%08x\n", i, s, b); - rv = 0; - continue; - } - - if (b != rounddown2(b, s)) { - printf("CPU window#%d: address 0x%08x is not aligned " - "to 0x%08x\n", i, b, s); - rv = 0; - continue; - } - - j = decode_win_overlap(i, cpu_wins_no, &cpu_wins[0]); - if (j >= 0) { - printf("CPU window#%d: (0x%08x - 0x%08x) overlaps " - "with #%d (0x%08x - 0x%08x)\n", i, b, e, j, - cpu_wins[j].base, - cpu_wins[j].base + cpu_wins[j].size - 1); - rv = 0; - } - } - - return (rv); } int From owner-svn-src-all@freebsd.org Thu Nov 26 17:19:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABF5A469A3D; Thu, 26 Nov 2020 17:19:30 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChkyV4YS7z4m4l; Thu, 26 Nov 2020 17:19:30 +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 8F5A926872; Thu, 26 Nov 2020 17:19:30 +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 0AQHJUGF000308; Thu, 26 Nov 2020 17:19:30 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQHJUIF000307; Thu, 26 Nov 2020 17:19:30 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011261719.0AQHJUIF000307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 26 Nov 2020 17:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368066 - head/sys/arm/nvidia/tegra124 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/nvidia/tegra124 X-SVN-Commit-Revision: 368066 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 17:19:30 -0000 Author: manu Date: Thu Nov 26 17:19:30 2020 New Revision: 368066 URL: https://svnweb.freebsd.org/changeset/base/368066 Log: arm: tegra: Remove unused variable Modified: head/sys/arm/nvidia/tegra124/tegra124_machdep.c Modified: head/sys/arm/nvidia/tegra124/tegra124_machdep.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_machdep.c Thu Nov 26 17:19:13 2020 (r368065) +++ head/sys/arm/nvidia/tegra124/tegra124_machdep.c Thu Nov 26 17:19:30 2020 (r368066) @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); PMC_SCRATCH0_MODE_RCM) static platform_attach_t tegra124_attach; -static platform_lastaddr_t tegra124_lastaddr; static platform_devmap_init_t tegra124_devmap_init; static platform_late_init_t tegra124_late_init; static platform_cpu_reset_t tegra124_cpu_reset; From owner-svn-src-all@freebsd.org Thu Nov 26 17:19:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8BAEF469C14; Thu, 26 Nov 2020 17:19:48 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chkyr2Sv3z4m19; Thu, 26 Nov 2020 17:19:48 +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 47C8426E43; Thu, 26 Nov 2020 17:19:48 +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 0AQHJmES000365; Thu, 26 Nov 2020 17:19:48 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQHJm1d000364; Thu, 26 Nov 2020 17:19:48 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011261719.0AQHJm1d000364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 26 Nov 2020 17:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368067 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 368067 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 17:19:48 -0000 Author: manu Date: Thu Nov 26 17:19:47 2020 New Revision: 368067 URL: https://svnweb.freebsd.org/changeset/base/368067 Log: arm: allwinner: a23 timer functions are only used for arm64 Modified: head/sys/arm/allwinner/a10_timer.c Modified: head/sys/arm/allwinner/a10_timer.c ============================================================================== --- head/sys/arm/allwinner/a10_timer.c Thu Nov 26 17:19:30 2020 (r368066) +++ head/sys/arm/allwinner/a10_timer.c Thu Nov 26 17:19:47 2020 (r368067) @@ -119,8 +119,10 @@ static uint64_t timer_read_counter64(struct a10_timer_ static void a10_timer_eventtimer_setup(struct a10_timer_softc *sc); #endif +#if defined(__aarch64__) static void a23_timer_timecounter_setup(struct a10_timer_softc *sc); static u_int a23_timer_get_timecount(struct timecounter *tc); +#endif static int a10_timer_irq(void *); static int a10_timer_probe(device_t); @@ -138,6 +140,7 @@ static struct timecounter a10_timer_timecounter = { .tc_quality = 1000, }; +#if defined(__aarch64__) static struct timecounter a23_timer_timecounter = { .tc_name = "a10_timer timer0", .tc_get_timecount = a23_timer_get_timecount, @@ -146,6 +149,7 @@ static struct timecounter a23_timer_timecounter = { /* We want it to be selected over the arm generic timecounter */ .tc_quality = 2000, }; +#endif #define A10_TIMER_MEMRES 0 #define A10_TIMER_IRQRES 1 @@ -158,7 +162,9 @@ static struct resource_spec a10_timer_spec[] = { static struct ofw_compat_data compat_data[] = { {"allwinner,sun4i-a10-timer", A10_TIMER}, +#if defined(__aarch64__) {"allwinner,sun8i-a23-timer", A23_TIMER}, +#endif {NULL, 0}, }; @@ -374,6 +380,7 @@ a10_timer_timer_stop(struct eventtimer *et) * Timecounter functions for A23 and above */ +#if defined(__aarch64__) static void a23_timer_timecounter_setup(struct a10_timer_softc *sc) { @@ -415,6 +422,7 @@ a23_timer_get_timecount(struct timecounter *tc) /* Counter count backwards */ return (~0u - val); } +#endif /* * Timecounter functions for A10 and A13, using the 64 bits counter From owner-svn-src-all@freebsd.org Thu Nov 26 17:27:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08CB6469D9C; Thu, 26 Nov 2020 17:27:10 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chl7K6nDWz4mZf; Thu, 26 Nov 2020 17:27:09 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB05727180; Thu, 26 Nov 2020 17:27:09 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQHR9Nd006745; Thu, 26 Nov 2020 17:27:09 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQHR7do006734; Thu, 26 Nov 2020 17:27:07 GMT (envelope-from se@FreeBSD.org) Message-Id: <202011261727.0AQHR7do006734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Thu, 26 Nov 2020 17:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r368068 - in vendor/bc/dist: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: in vendor/bc/dist: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests X-SVN-Commit-Revision: 368068 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 17:27:10 -0000 Author: se Date: Thu Nov 26 17:27:07 2020 New Revision: 368068 URL: https://svnweb.freebsd.org/changeset/base/368068 Log: Import version 3.2.0 Added: vendor/bc/dist/exec-install.sh - copied unchanged from r368067, vendor/bc/dist/install.sh vendor/bc/dist/include/bcl.h (contents, props changed) vendor/bc/dist/include/library.h (contents, props changed) vendor/bc/dist/manuals/bcl.3 (contents, props changed) vendor/bc/dist/manuals/bcl.3.md vendor/bc/dist/manuals/header.txt (contents, props changed) vendor/bc/dist/manuals/header_bc.txt (contents, props changed) vendor/bc/dist/manuals/header_bcl.txt (contents, props changed) vendor/bc/dist/manuals/header_dc.txt (contents, props changed) vendor/bc/dist/src/bc.c - copied, changed from r368067, vendor/bc/dist/src/bc/bc.c vendor/bc/dist/src/bc_lex.c - copied, changed from r368067, vendor/bc/dist/src/bc/lex.c vendor/bc/dist/src/bc_parse.c - copied, changed from r368067, vendor/bc/dist/src/bc/parse.c vendor/bc/dist/src/dc.c - copied, changed from r368067, vendor/bc/dist/src/dc/dc.c vendor/bc/dist/src/dc_lex.c - copied, changed from r368067, vendor/bc/dist/src/dc/lex.c vendor/bc/dist/src/dc_parse.c - copied, changed from r368067, vendor/bc/dist/src/dc/parse.c vendor/bc/dist/src/history.c - copied, changed from r368067, vendor/bc/dist/src/history/history.c vendor/bc/dist/src/library.c (contents, props changed) vendor/bc/dist/src/rand.c - copied, changed from r368067, vendor/bc/dist/src/rand/rand.c vendor/bc/dist/tests/bcl.c (contents, props changed) Deleted: vendor/bc/dist/install.sh vendor/bc/dist/src/bc/ vendor/bc/dist/src/dc/ vendor/bc/dist/src/history/ vendor/bc/dist/src/rand/ Modified: vendor/bc/dist/.gitignore vendor/bc/dist/Makefile.in vendor/bc/dist/NEWS.md vendor/bc/dist/README.md vendor/bc/dist/configure.sh vendor/bc/dist/gen/lib.bc vendor/bc/dist/gen/strgen.c vendor/bc/dist/gen/strgen.sh vendor/bc/dist/include/file.h vendor/bc/dist/include/lex.h vendor/bc/dist/include/num.h vendor/bc/dist/include/parse.h vendor/bc/dist/include/rand.h vendor/bc/dist/include/status.h vendor/bc/dist/include/vector.h vendor/bc/dist/include/vm.h vendor/bc/dist/manpage.sh vendor/bc/dist/manuals/bc.1.md.in vendor/bc/dist/manuals/bc/A.1 vendor/bc/dist/manuals/bc/A.1.md vendor/bc/dist/manuals/bc/E.1 vendor/bc/dist/manuals/bc/E.1.md vendor/bc/dist/manuals/bc/EH.1 vendor/bc/dist/manuals/bc/EH.1.md vendor/bc/dist/manuals/bc/EHN.1 vendor/bc/dist/manuals/bc/EHN.1.md vendor/bc/dist/manuals/bc/EHNP.1 vendor/bc/dist/manuals/bc/EHNP.1.md vendor/bc/dist/manuals/bc/EHP.1 vendor/bc/dist/manuals/bc/EHP.1.md vendor/bc/dist/manuals/bc/EN.1 vendor/bc/dist/manuals/bc/EN.1.md vendor/bc/dist/manuals/bc/ENP.1 vendor/bc/dist/manuals/bc/ENP.1.md vendor/bc/dist/manuals/bc/EP.1 vendor/bc/dist/manuals/bc/EP.1.md vendor/bc/dist/manuals/bc/H.1 vendor/bc/dist/manuals/bc/H.1.md vendor/bc/dist/manuals/bc/HN.1 vendor/bc/dist/manuals/bc/HN.1.md vendor/bc/dist/manuals/bc/HNP.1 vendor/bc/dist/manuals/bc/HNP.1.md vendor/bc/dist/manuals/bc/HP.1 vendor/bc/dist/manuals/bc/HP.1.md vendor/bc/dist/manuals/bc/N.1 vendor/bc/dist/manuals/bc/N.1.md vendor/bc/dist/manuals/bc/NP.1 vendor/bc/dist/manuals/bc/NP.1.md vendor/bc/dist/manuals/bc/P.1 vendor/bc/dist/manuals/bc/P.1.md vendor/bc/dist/manuals/build.md vendor/bc/dist/manuals/dc.1.md.in vendor/bc/dist/manuals/dc/A.1 vendor/bc/dist/manuals/dc/A.1.md vendor/bc/dist/manuals/dc/E.1 vendor/bc/dist/manuals/dc/E.1.md vendor/bc/dist/manuals/dc/EH.1 vendor/bc/dist/manuals/dc/EH.1.md vendor/bc/dist/manuals/dc/EHN.1 vendor/bc/dist/manuals/dc/EHN.1.md vendor/bc/dist/manuals/dc/EHNP.1 vendor/bc/dist/manuals/dc/EHNP.1.md vendor/bc/dist/manuals/dc/EHP.1 vendor/bc/dist/manuals/dc/EHP.1.md vendor/bc/dist/manuals/dc/EN.1 vendor/bc/dist/manuals/dc/EN.1.md vendor/bc/dist/manuals/dc/ENP.1 vendor/bc/dist/manuals/dc/ENP.1.md vendor/bc/dist/manuals/dc/EP.1 vendor/bc/dist/manuals/dc/EP.1.md vendor/bc/dist/manuals/dc/H.1 vendor/bc/dist/manuals/dc/H.1.md vendor/bc/dist/manuals/dc/HN.1 vendor/bc/dist/manuals/dc/HN.1.md vendor/bc/dist/manuals/dc/HNP.1 vendor/bc/dist/manuals/dc/HNP.1.md vendor/bc/dist/manuals/dc/HP.1 vendor/bc/dist/manuals/dc/HP.1.md vendor/bc/dist/manuals/dc/N.1 vendor/bc/dist/manuals/dc/N.1.md vendor/bc/dist/manuals/dc/NP.1 vendor/bc/dist/manuals/dc/NP.1.md vendor/bc/dist/manuals/dc/P.1 vendor/bc/dist/manuals/dc/P.1.md vendor/bc/dist/release.sh vendor/bc/dist/src/args.c vendor/bc/dist/src/data.c vendor/bc/dist/src/file.c vendor/bc/dist/src/lang.c vendor/bc/dist/src/lex.c vendor/bc/dist/src/main.c vendor/bc/dist/src/num.c vendor/bc/dist/src/opt.c vendor/bc/dist/src/parse.c vendor/bc/dist/src/program.c vendor/bc/dist/src/read.c vendor/bc/dist/src/vector.c vendor/bc/dist/src/vm.c Modified: vendor/bc/dist/.gitignore ============================================================================== --- vendor/bc/dist/.gitignore Thu Nov 26 17:19:47 2020 (r368067) +++ vendor/bc/dist/.gitignore Thu Nov 26 17:27:07 2020 (r368068) @@ -9,6 +9,7 @@ bin/*bc bin/*bc.exe bin/*dc bin/*dc.exe +bin/bcl bc.old *.o *.a Modified: vendor/bc/dist/Makefile.in ============================================================================== --- vendor/bc/dist/Makefile.in Thu Nov 26 17:19:47 2020 (r368067) +++ vendor/bc/dist/Makefile.in Thu Nov 26 17:27:07 2020 (r368068) @@ -29,33 +29,13 @@ # .POSIX: -VERSION = 3.1.6 +VERSION = 3.2.0 SRC = %%SRC%% OBJ = %%OBJ%% GCDA = %%GCDA%% GCNO = %%GCNO%% -BC_SRC = %%BC_SRC%% -BC_OBJ = %%BC_OBJ%% -BC_GCDA = %%BC_GCDA%% -BC_GCNO = %%BC_GCNO%% - -DC_SRC = %%DC_SRC%% -DC_OBJ = %%DC_OBJ%% -DC_GCDA = %%DC_GCDA%% -DC_GCNO = %%DC_GCNO%% - -HISTORY_SRC = %%HISTORY_SRC%% -HISTORY_OBJ = %%HISTORY_OBJ%% -HISTORY_GCDA = %%HISTORY_GCDA%% -HISTORY_GCNO = %%HISTORY_GCNO%% - -RAND_SRC = %%RAND_SRC%% -RAND_OBJ = %%RAND_OBJ%% -RAND_GCDA = %%RAND_GCDA%% -RAND_GCNO = %%RAND_GCNO%% - BC_ENABLED_NAME = BC_ENABLED BC_ENABLED = %%BC_ENABLED%% DC_ENABLED_NAME = DC_ENABLED @@ -102,6 +82,13 @@ DC = dc BC_EXEC = $(BIN)/$(EXEC_PREFIX)$(BC) DC_EXEC = $(BIN)/$(EXEC_PREFIX)$(DC) +LIB = libbcl +LIB_NAME = $(LIB).a +LIBBC = $(BIN)/$(LIB_NAME) +BCL = bcl +BCL_TEST = $(BIN)/$(BCL) +BCL_TEST_C = tests/$(BCL).c + MANUALS = manuals BC_MANPAGE_NAME = $(EXEC_PREFIX)$(BC)$(EXEC_SUFFIX).1 BC_MANPAGE = $(MANUALS)/$(BC).1 @@ -109,16 +96,28 @@ BC_MD = $(BC_MANPAGE).md DC_MANPAGE_NAME = $(EXEC_PREFIX)$(DC)$(EXEC_SUFFIX).1 DC_MANPAGE = $(MANUALS)/$(DC).1 DC_MD = $(DC_MANPAGE).md +BCL_MANPAGE_NAME = bcl.3 +BCL_MANPAGE = $(MANUALS)/$(BCL_MANPAGE_NAME) +BCL_MD = $(BCL_MANPAGE).md MANPAGE_INSTALL_ARGS = -Dm644 +BINARY_INSTALL_ARGS = -Dm755 +BCL_HEADER_NAME = bcl.h +BCL_HEADER = include/$(BCL_HEADER_NAME) + %%DESTDIR%% BINDIR = %%BINDIR%% +INCLUDEDIR = %%INCLUDEDIR%% +LIBDIR = %%LIBDIR%% MAN1DIR = %%MAN1DIR%% +MAN3DIR = %%MAN3DIR%% MAIN_EXEC = $(EXEC_PREFIX)$(%%MAIN_EXEC%%)$(EXEC_SUFFIX) EXEC = $(%%EXEC%%) NLSPATH = %%NLSPATH%% +BC_ENABLE_LIBRARY = %%LIBRARY%% + BC_ENABLE_HISTORY = %%HISTORY%% BC_ENABLE_EXTRA_MATH_NAME = BC_ENABLE_EXTRA_MATH BC_ENABLE_EXTRA_MATH = %%EXTRA_MATH%% @@ -129,7 +128,7 @@ BC_LONG_BIT = %%LONG_BIT%% RM = rm MKDIR = mkdir -INSTALL = ./install.sh +INSTALL = ./exec-install.sh SAFE_INSTALL = ./safe-install.sh LINK = ./link.sh MANPAGE = ./manpage.sh @@ -148,7 +147,7 @@ CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_ CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) -DBC_ENABLE_PROMPT=$(BC_ENABLE_PROMPT) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) -CPPFLAGS = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) +CPPFLAGS = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY) CFLAGS = $(CPPFLAGS) %%CPPFLAGS%% %%CFLAGS%% LDFLAGS = %%LDFLAGS%% @@ -157,21 +156,24 @@ HOSTCFLAGS = %%HOSTCFLAGS%% CC = %%CC%% HOSTCC = %%HOSTCC%% -BC_LIB_C_ARGS = bc_lib bc.h bc_lib_name $(BC_ENABLED_NAME) 1 -BC_LIB2_C_ARGS = bc_lib2 bc.h bc_lib2_name "$(BC_ENABLED_NAME) && $(BC_ENABLE_EXTRA_MATH_NAME)" 1 +BC_LIB_C_ARGS = bc_lib bc_lib_name $(BC_ENABLED_NAME) 1 +BC_LIB2_C_ARGS = bc_lib2 bc_lib2_name "$(BC_ENABLED_NAME) && $(BC_ENABLE_EXTRA_MATH_NAME)" 1 -OBJS1 = $(OBJ) $(DC_OBJ) $(BC_OBJ) $(HISTORY_OBJ) $(RAND_OBJ) $(BC_HELP_O) $(DC_HELP_O) -OBJS = $(OBJS1) $(BC_LIB_O) $(BC_LIB2_O) $(BC_LIB3_O) -OBJ_TARGETS1 = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(BC_LIB3_O) -OBJ_TARGETS = $(OBJ_TARGETS1) $(BC_OBJ) $(DC_OBJ) $(HISTORY_OBJ) $(RAND_OBJ) $(OBJ) +OBJS = $(BC_HELP_O) $(DC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) +OBJ_TARGETS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) .c.o: $(CC) $(CFLAGS) -o $@ -c $< -all: make_bin $(OBJ_TARGETS) +all: %%ALL_PREREQ%% + +execs: make_bin $(OBJ_TARGETS) $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(EXEC) %%LINK%% +library: make_bin $(OBJ) $(BC_LIB_O) $(BC_LIB2_O) + ar -r -cu $(LIBBC) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) + $(GEN_EXEC): %%GEN_EXEC_TARGET%% @@ -182,10 +184,10 @@ $(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2) $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_LIB2_C_ARGS) $(BC_HELP_C): $(GEN_EXEC) $(BC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help bc.h "" $(BC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help "" $(BC_ENABLED_NAME) $(DC_HELP_C): $(GEN_EXEC) $(DC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help dc.h "" $(DC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help "" $(DC_ENABLED_NAME) make_bin: $(MKDIR) -p $(BIN) @@ -222,7 +224,7 @@ help: check: test -test: test_bc timeconst test_dc +test: %%TESTS%% test_bc: %%BC_TEST%% @@ -241,6 +243,12 @@ time_test_dc: timeconst: %%TIMECONST%% +library_test: library + $(CC) $(CFLAGS) $(BCL_TEST_C) $(LIBBC) -o $(BCL_TEST) + +test_library: library_test + $(BCL_TEST) + valgrind: valgrind_bc valgrind_dc valgrind_bc: @@ -272,6 +280,7 @@ extra_math: manpages: $(MANPAGE) bc $(MANPAGE) dc + $(MANPAGE) bcl clean_gen: @$(RM) -f $(GEN_EXEC) @@ -279,10 +288,6 @@ clean_gen: clean:%%CLEAN_PREREQS%% @printf 'Cleaning files...\n' @$(RM) -f $(OBJ) - @$(RM) -f $(BC_OBJ) - @$(RM) -f $(DC_OBJ) - @$(RM) -f $(HISTORY_OBJ) - @$(RM) -f $(RAND_OBJ) @$(RM) -f $(BC_EXEC) @$(RM) -f $(DC_EXEC) @$(RM) -fr $(BIN) @@ -343,9 +348,20 @@ install_bc_manpage: install_dc_manpage: $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(DC_MANPAGE) $(DESTDIR)$(MAN1DIR)/$(DC_MANPAGE_NAME) -install:%%INSTALL_LOCALES_PREREQS%%%%INSTALL_PREREQS%% +install_bcl_manpage: + $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(BCL_MANPAGE) $(DESTDIR)$(MAN3DIR)/$(BCL_MANPAGE_NAME) + +install_bcl_header: + $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(BCL_HEADER) $(DESTDIR)$(INCLUDEDIR)/$(BCL_HEADER_NAME) + +install_execs: $(INSTALL) $(DESTDIR)$(BINDIR) "$(EXEC_SUFFIX)" +install_library: + $(SAFE_INSTALL) $(BINARY_INSTALL_ARGS) $(LIBBC) $(DESTDIR)$(LIBDIR)/$(LIB_NAME) + +install:%%INSTALL_LOCALES_PREREQS%%%%INSTALL_MAN_PREREQS%%%%INSTALL_PREREQS%% + uninstall_locales: $(LOCALE_UNINSTALL) $(NLSPATH) $(MAIN_EXEC) $(DESTDIR) @@ -360,5 +376,14 @@ uninstall_dc_manpage: uninstall_dc: $(RM) -f $(DESTDIR)$(BINDIR)/$(EXEC_PREFIX)$(DC)$(EXEC_SUFFIX) + +uninstall_library: + $(RM) -f $(DESTDIR)$(LIBDIR)/$(LIB_NAME) + +uninstall_bcl_header: + $(RM) -f $(DESTDIR)$(INCLUDEDIR)/$(BCL_HEADER_NAME) + +uninstall_bcl_manpage: + $(RM) -f $(DESTDIR)$(MAN3DIR)/$(BCL_MANPAGE_NAME) uninstall:%%UNINSTALL_LOCALES_PREREQS%%%%UNINSTALL_MAN_PREREQS%%%%UNINSTALL_PREREQS%% Modified: vendor/bc/dist/NEWS.md ============================================================================== --- vendor/bc/dist/NEWS.md Thu Nov 26 17:19:47 2020 (r368067) +++ vendor/bc/dist/NEWS.md Thu Nov 26 17:27:07 2020 (r368068) @@ -1,5 +1,23 @@ # News +## 3.2.0 + +This is a production release that has one bug fix and a major addition. + +The bug fix was a missing `auto` variable in the bessel `j()` function in the +math library. + +The major addition is a way to build a version of `bc`'s math code as a library. +This is done with the `-a` option to `configure.sh`. The API for the library can +be read in `./manuals/bcl.3.md` or `man bcl` once the library is installed with +`make install`. + +This library was requested by developers before I even finished version 1.0, but +I could not figure out how to do it until now. + +If the library has API breaking changes, the major version of `bc` will be +incremented. + ## 3.1.6 This is a production release that fixes a new warning from Clang 12 for FreeBSD Modified: vendor/bc/dist/README.md ============================================================================== --- vendor/bc/dist/README.md Thu Nov 26 17:19:47 2020 (r368067) +++ vendor/bc/dist/README.md Thu Nov 26 17:27:07 2020 (r368068) @@ -107,6 +107,23 @@ other locations, use the `PREFIX` environment variable `configure.sh` or pass the `--prefix=` option to `configure.sh`. See the [build manual][5], or run `./configure.sh --help`, for more details. +### Library + +This `bc` does provide a way to build a math library with C bindings. This is +done by the `-a` or `--library` options to `configure.sh`: + +``` +./configure.sh -a +``` + +When building the library, the executables are not built. For more information, +see the [build manual][5]. + +The library API can be found in [`manuals/bcl.3.md`][26] or `man bcl` once the +library is installed. + +The library is built as `bin/libbcl.a`. + ### Package and Distro Maintainers #### Recommended Compiler @@ -335,3 +352,4 @@ Folders: [23]: https://svnweb.freebsd.org/base/head/contrib/bc/ [24]: https://bugs.freebsd.org/ [25]: https://reviews.freebsd.org/ +[26]: ./manuals/bcl.3.md Modified: vendor/bc/dist/configure.sh ============================================================================== --- vendor/bc/dist/configure.sh Thu Nov 26 17:19:47 2020 (r368067) +++ vendor/bc/dist/configure.sh Thu Nov 26 17:27:07 2020 (r368068) @@ -45,22 +45,27 @@ usage() { _usage_val=0 fi - printf 'usage: %s -h\n' "$script" - printf ' %s --help\n' "$script" - printf ' %s [-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" - printf ' %s \\\n' "$script" - printf ' [--bc-only --disable-dc|--dc-only --disable-bc|--coverage] \\\n' - printf ' [--debug --disable-extra-math --disable-generated-tests] \\\n' - printf ' [--disable-history --disable-man-pages --disable-nls] \\\n' - printf ' [--disable-prompt --disable-strip] [--install-all-locales] \\\n' - printf ' [--opt=OPT_LEVEL] [--karatsuba-len=KARATSUBA_LEN] \\\n' - printf ' [--prefix=PREFIX] [--bindir=BINDIR] [--datarootdir=DATAROOTDIR] \\\n' - printf ' [--datadir=DATADIR] [--mandir=MANDIR] [--man1dir=MAN1DIR] \\\n' - printf ' [--force] \\\n' + printf 'usage:\n' + printf ' %s -h\n' "$script" + printf ' %s --help\n' "$script" + printf ' %s [-a|-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" + printf ' %s \\\n' "$script" + printf ' [--library|--bc-only --disable-dc|--dc-only --disable-bc|--coverage]\\\n' + printf ' [--force --debug --disable-extra-math --disable-generated-tests] \\\n' + printf ' [--disable-history --disable-man-pages --disable-nls] \\\n' + printf ' [--disable-prompt --disable-strip] [--install-all-locales] \\\n' + printf ' [--opt=OPT_LEVEL] [--karatsuba-len=KARATSUBA_LEN] \\\n' + printf ' [--prefix=PREFIX] [--bindir=BINDIR] [--datarootdir=DATAROOTDIR] \\\n' + printf ' [--datadir=DATADIR] [--mandir=MANDIR] [--man1dir=MAN1DIR] \\\n' printf '\n' + printf ' -a, --library\n' + printf ' Build the libbc instead of the programs. This is meant to be used with\n' + printf ' Other software like programming languages that want to make use of the\n' + printf ' parsing and math capabilities. This option will install headers using\n' + printf ' `make install`.\n' printf ' -b, --bc-only\n' - printf ' Build bc only. It is an error if "-d", "--dc-only", "-B", or "--disable-bc"\n' - printf ' are specified too.\n' + printf ' Build bc only. It is an error if "-d", "--dc-only", "-B", or\n' + printf ' "--disable-bc" are specified too.\n' printf ' -B, --disable-bc\n' printf ' Disable bc. It is an error if "-b", "--bc-only", "-D", or "--disable-dc"\n' printf ' are specified too.\n' @@ -69,10 +74,10 @@ usage() { printf ' It is an error if either "-b" ("-D") or "-d" ("-B") is specified.\n' printf ' Requires a compiler that use gcc-compatible coverage options\n' printf ' -d, --dc-only\n' - printf ' Build dc only. It is an error if "-b", "--bc-only", "-D", or "--disable-dc"\n' - printf ' are specified too.\n' + printf ' Build dc only. It is an error if "-b", "--bc-only", "-D", or\n' + printf ' "--disable-dc" are specified too.\n' printf ' -D, --disable-dc\n' - printf ' Disable dc. It is an error if "-d", "--dc-only" "-B", or "--disable-bc"\n' + printf ' Disable dc. It is an error if "-d", "--dc-only", "-B", or "--disable-bc"\n' printf ' are specified too.\n' printf ' -E, --disable-extra-math\n' printf ' Disable extra math. This includes: "$" operator (truncate to integer),\n' @@ -122,8 +127,14 @@ usage() { printf ' If PREFIX is "/usr", install path will be "/usr/bin".\n' printf ' Default is "/usr/local".\n' printf ' --bindir BINDIR\n' - printf ' The directory to install binaries. Overrides "$BINDIR" if it exists.\n' + printf ' The directory to install binaries in. Overrides "$BINDIR" if it exists.\n' printf ' Default is "$PREFIX/bin".\n' + printf ' --includedir INCLUDEDIR\n' + printf ' The directory to install headers in. Overrides "$INCLUDEDIR" if it\n' + printf ' exists. Default is "$PREFIX/include".\n' + printf ' --libdir LIBDIR\n' + printf ' The directory to install libraries in. Overrides "$LIBDIR" if it exists.\n' + printf ' Default is "$PREFIX/lib".\n' printf ' --datarootdir DATAROOTDIR\n' printf ' The root location for data files. Overrides "$DATAROOTDIR" if it exists.\n' printf ' Default is "$PREFIX/share".\n' @@ -136,6 +147,9 @@ usage() { printf ' --man1dir MAN1DIR\n' printf ' The location to install Section 1 manpages to. Overrides "$MAN1DIR" if\n' printf ' it exists. Default is "$MANDIR/man1".\n' + printf ' --man3dir MAN3DIR\n' + printf ' The location to install Section 3 manpages to. Overrides "$MAN3DIR" if\n' + printf ' it exists. Default is "$MANDIR/man3".\n' printf '\n' printf 'In addition, the following environment variables are used:\n' printf '\n' @@ -157,12 +171,18 @@ usage() { printf ' LDFLAGS Linker flags. Default is "".\n' printf ' PREFIX The prefix to install to. Default is "/usr/local".\n' printf ' If PREFIX is "/usr", install path will be "/usr/bin".\n' - printf ' BINDIR The directory to install binaries. Default is "$PREFIX/bin".\n' + printf ' BINDIR The directory to install binaries in. Default is "$PREFIX/bin".\n' + printf ' INCLUDEDIR The directory to install header files in. Default is\n' + printf ' "$PREFIX/include".\n' + printf ' LIBDIR The directory to install libraries in. Default is\n' + printf ' "$PREFIX/lib".\n' printf ' DATAROOTDIR The root location for data files. Default is "$PREFIX/share".\n' printf ' DATADIR The location for data files. Default is "$DATAROOTDIR".\n' printf ' MANDIR The location to install manpages to. Default is "$DATADIR/man".\n' printf ' MAN1DIR The location to install Section 1 manpages to. Default is\n' printf ' "$MANDIR/man1".\n' + printf ' MAN3DIR The location to install Section 3 manpages to. Default is\n' + printf ' "$MANDIR/man3".\n' printf ' NLSPATH The location to install locale catalogs to. Must be an absolute\n' printf ' path (or contain one). This is treated the same as the POSIX\n' printf ' definition of $NLSPATH (see POSIX environment variables for\n' @@ -257,56 +277,55 @@ replace() { substring_replace "$_replace_str" "%%$_replace_needle%%" "$_replace_replacement" } -gen_file_lists() { +gen_file_list() { - if [ "$#" -lt 3 ]; then + if [ "$#" -lt 1 ]; then err_exit "Invalid number of args to $0" fi - _gen_file_lists_contents="$1" + _gen_file_list_contents="$1" shift - _gen_file_lists_filedir="$1" - shift + p=$(pwd) - _gen_file_lists_typ="$1" - shift + cd "$scriptdir" - # If there is an extra argument, and it - # is zero, we keep the file lists empty. - if [ "$#" -gt 0 ]; then - _gen_file_lists_use="$1" + if [ "$#" -ge 1 ]; then + + while [ "$#" -ge 1 ]; do + a="$1" + shift + args="$args ! -wholename src/${a}" + done + else - _gen_file_lists_use="1" + args="-print" fi - _gen_file_lists_needle_src="${_gen_file_lists_typ}SRC" - _gen_file_lists_needle_obj="${_gen_file_lists_typ}OBJ" - _gen_file_lists_needle_gcda="${_gen_file_lists_typ}GCDA" - _gen_file_lists_needle_gcno="${_gen_file_lists_typ}GCNO" + _gen_file_list_needle_src="SRC" + _gen_file_list_needle_obj="OBJ" + _gen_file_list_needle_gcda="GCDA" + _gen_file_list_needle_gcno="GCNO" - if [ "$_gen_file_lists_use" -ne 0 ]; then + _gen_file_list_replacement=$(find src/ -depth -name "*.c" $args | tr '\n' ' ') + _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ + "$_gen_file_list_needle_src" "$_gen_file_list_replacement") - _gen_file_lists_replacement=$(cd "$_gen_file_lists_filedir" && find . ! -name . -prune -name "*.c" | cut -d/ -f2 | sed "s@^@$_gen_file_lists_filedir/@g" | tr '\n' ' ') - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_src" "$_gen_file_lists_replacement") + _gen_file_list_replacement=$(replace_exts "$_gen_file_list_replacement" "c" "o") + _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ + "$_gen_file_list_needle_obj" "$_gen_file_list_replacement") - _gen_file_lists_replacement=$(replace_exts "$_gen_file_lists_replacement" "c" "o") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_obj" "$_gen_file_lists_replacement") + _gen_file_list_replacement=$(replace_exts "$_gen_file_list_replacement" "o" "gcda") + _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ + "$_gen_file_list_needle_gcda" "$_gen_file_list_replacement") - _gen_file_lists_replacement=$(replace_exts "$_gen_file_lists_replacement" "o" "gcda") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcda" "$_gen_file_lists_replacement") + _gen_file_list_replacement=$(replace_exts "$_gen_file_list_replacement" "gcda" "gcno") + _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ + "$_gen_file_list_needle_gcno" "$_gen_file_list_replacement") - _gen_file_lists_replacement=$(replace_exts "$_gen_file_lists_replacement" "gcda" "gcno") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcno" "$_gen_file_lists_replacement") + cd "$p" - else - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_src" "") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_obj" "") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcda" "") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcno" "") - fi - - printf '%s\n' "$_gen_file_lists_contents" + printf '%s\n' "$_gen_file_list_contents" } bc_only=0 @@ -324,10 +343,12 @@ prompt=1 force=0 strip_bin=1 all_locales=0 +library=0 -while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do +while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do case "$opt" in + a) library=1 ;; b) bc_only=1 ;; B) dc_only=1 ;; c) coverage=1 ;; @@ -352,6 +373,7 @@ while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do LONG_OPTARG="${arg#*=}" case $arg in help) usage ;; + library) library=1 ;; bc-only) bc_only=1 ;; dc-only) dc_only=1 ;; coverage) coverage=1 ;; @@ -371,6 +393,20 @@ while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do fi BINDIR="$2" shift ;; + includedir=?*) INCLUDEDIR="$LONG_OPTARG" ;; + includedir) + if [ "$#" -lt 2 ]; then + usage "No argument given for '--$arg' option" + fi + INCLUDEDIR="$2" + shift ;; + libdir=?*) LIBDIR="$LONG_OPTARG" ;; + libdir) + if [ "$#" -lt 2 ]; then + usage "No argument given for '--$arg' option" + fi + LIBDIR="$2" + shift ;; datarootdir=?*) DATAROOTDIR="$LONG_OPTARG" ;; datarootdir) if [ "$#" -lt 2 ]; then @@ -399,6 +435,13 @@ while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do fi MAN1DIR="$2" shift ;; + man3dir=?*) MAN3DIR="$LONG_OPTARG" ;; + man3dir) + if [ "$#" -lt 2 ]; then + usage "No argument given for '--$arg' option" + fi + MAN3DIR="$2" + shift ;; localedir=?*) LOCALEDIR="$LONG_OPTARG" ;; localedir) if [ "$#" -lt 2 ]; then @@ -454,6 +497,12 @@ if [ "$bc_only" -eq 1 ] && [ "$dc_only" -eq 1 ]; then usage "Can only specify one of -b(-D) or -d(-B)" fi +if [ "$library" -ne 0 ]; then + if [ "$bc_only" -eq 1 ] || [ "$dc_only" -eq 1 ]; then + usage "Must not specify -b(-D) or -d(-B) when building the library" + fi +fi + case $karatsuba_len in (*[!0-9]*|'') usage "KARATSUBA_LEN is not a number" ;; (*) ;; @@ -529,6 +578,8 @@ link="@printf 'No link necessary\\\\n'" main_exec="BC" executable="BC_EXEC" +tests="test_bc timeconst test_dc" + bc_test="@tests/all.sh bc $extra_math 1 $generate_tests 0 \$(BC_EXEC)" bc_time_test="@tests/all.sh bc $extra_math 1 $generate_tests 1 \$(BC_EXEC)" @@ -567,7 +618,8 @@ if [ "$bc_only" -eq 1 ]; then dc_time_test="@printf 'No dc tests to run\\\\n'" vg_dc_test="@printf 'No dc tests to run\\\\n'" - install_prereqs=" install_bc_manpage" + install_prereqs=" install_execs" + install_man_prereqs=" install_bc_manpage" uninstall_prereqs=" uninstall_bc" uninstall_man_prereqs=" uninstall_bc_manpage" @@ -590,7 +642,8 @@ elif [ "$dc_only" -eq 1 ]; then timeconst="@printf 'timeconst cannot be run because bc is not built\\\\n'" - install_prereqs=" install_dc_manpage" + install_prereqs=" install_execs" + install_man_prereqs=" install_dc_manpage" uninstall_prereqs=" uninstall_dc" uninstall_man_prereqs=" uninstall_dc_manpage" @@ -606,9 +659,18 @@ else karatsuba="@\$(KARATSUBA) 30 0 \$(BC_EXEC)" karatsuba_test="@\$(KARATSUBA) 1 100 \$(BC_EXEC)" - install_prereqs=" install_bc_manpage install_dc_manpage" - uninstall_prereqs=" uninstall_bc uninstall_dc" - uninstall_man_prereqs=" uninstall_bc_manpage uninstall_dc_manpage" + if [ "$library" -eq 0 ]; then + install_prereqs=" install_execs" + install_man_prereqs=" install_bc_manpage install_dc_manpage" + uninstall_prereqs=" uninstall_bc uninstall_dc" + uninstall_man_prereqs=" uninstall_bc_manpage uninstall_dc_manpage" + else + install_prereqs=" install_library install_bcl_header" + install_man_prereqs=" install_bcl_manpage" + uninstall_prereqs=" uninstall_library uninstall_bcl_header" + uninstall_man_prereqs=" uninstall_bcl_manpage" + tests="test_library" + fi fi @@ -664,6 +726,14 @@ if [ -z "${BINDIR+set}" ]; then BINDIR="$PREFIX/bin" fi +if [ -z "${INCLUDEDIR+set}" ]; then + INCLUDEDIR="$PREFIX/include" +fi + +if [ -z "${LIBDIR+set}" ]; then + LIBDIR="$PREFIX/lib" +fi + if [ "$install_manpages" -ne 0 ] || [ "$nls" -ne 0 ]; then if [ -z "${DATAROOTDIR+set}" ]; then DATAROOTDIR="$PREFIX/share" @@ -684,11 +754,25 @@ if [ "$install_manpages" -ne 0 ]; then MAN1DIR="$MANDIR/man1" fi + if [ -z "${MAN3DIR+set}" ]; then + MAN3DIR="$MANDIR/man3" + fi + else - install_prereqs="" + install_man_prereqs="" uninstall_man_prereqs="" fi +if [ "$library" -ne 0 ]; then + extra_math=1 + nls=0 + hist=0 + prompt=0 + ALL_PREREQ="library" +else + ALL_PREREQ="execs" +fi + if [ "$nls" -ne 0 ]; then set +e @@ -776,11 +860,11 @@ if [ "$hist" -eq 1 ]; then printf 'Testing history...\n' flags="-DBC_ENABLE_HISTORY=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc" - flags="$flags -DBC_ENABLE_NLS=$nls" + flags="$flags -DBC_ENABLE_NLS=$nls -DBC_ENABLE_LIBRARY=0" flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I./include/" flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" - "$CC" $CPPFLAGS $CFLAGS $flags -c "src/history/history.c" -o "$scriptdir/history.o" > /dev/null 2>&1 + "$CC" $CPPFLAGS $CFLAGS $flags -c "src/history.c" -o "$scriptdir/history.o" > /dev/null 2>&1 err="$?" @@ -804,7 +888,11 @@ if [ "$hist" -eq 1 ]; then fi -if [ "$extra_math" -eq 1 ] && [ "$bc" -ne 0 ]; then +if [ "$library" -eq 1 ]; then + bc_lib="" +fi + +if [ "$extra_math" -eq 1 ] && [ "$bc" -ne 0 ] && [ "$library" -eq 0 ]; then BC_LIB2_O="\$(GEN_DIR)/lib2.o" else BC_LIB2_O="" @@ -846,6 +934,33 @@ if [ "$manpage_args" = "" ]; then manpage_args="A" fi +unneeded="" + +if [ "$hist" -eq 0 ]; then + unneeded="$unneeded history.c" +fi + +if [ "$bc" -eq 0 ]; then + unneeded="$unneeded bc.c bc_lex.c bc_parse.c" +fi + +if [ "$dc" -eq 0 ]; then + unneeded="$unneeded dc.c dc_lex.c dc_parse.c" +fi + +if [ "$extra_math" -eq 0 ]; then + unneeded="$unneeded rand.c" +fi + +if [ "$library" -ne 0 ]; then + unneeded="$unneeded args.c opt.c read.c file.c main.c" + unneeded="$unneeded lang.c lex.c parse.c program.c" + unneeded="$unneeded bc.c bc_lex.c bc_parse.c" + unneeded="$unneeded dc.c dc_lex.c dc_parse.c" +else + unneeded="$unneeded library.c" +fi + # Print out the values; this is for debugging. if [ "$bc" -ne 0 ]; then printf 'Building bc\n' @@ -858,6 +973,7 @@ else printf 'Not building dc\n' fi printf '\n' +printf 'BC_ENABLE_LIBRARY=%s\n\n' "$library" printf 'BC_ENABLE_HISTORY=%s\n' "$hist" printf 'BC_ENABLE_EXTRA_MATH=%s\n' "$extra_math" printf 'BC_ENABLE_NLS=%s\n' "$nls" @@ -873,10 +989,13 @@ printf 'CPPFLAGS=%s\n' "$CPPFLAGS" printf 'LDFLAGS=%s\n' "$LDFLAGS" printf 'PREFIX=%s\n' "$PREFIX" printf 'BINDIR=%s\n' "$BINDIR" +printf 'INCLUDEDIR=%s\n' "$INCLUDEDIR" +printf 'LIBDIR=%s\n' "$LIBDIR" printf 'DATAROOTDIR=%s\n' "$DATAROOTDIR" printf 'DATADIR=%s\n' "$DATADIR" printf 'MANDIR=%s\n' "$MANDIR" printf 'MAN1DIR=%s\n' "$MAN1DIR" +printf 'MAN3DIR=%s\n' "$MAN3DIR" printf 'NLSPATH=%s\n' "$NLSPATH" printf 'EXECSUFFIX=%s\n' "$EXECSUFFIX" printf 'EXECPREFIX=%s\n' "$EXECPREFIX" @@ -892,16 +1011,17 @@ replacement='*** WARNING: Autogenerated from Makefile. contents=$(replace "$contents" "$needle" "$replacement") -contents=$(gen_file_lists "$contents" "$scriptdir/src" "") -contents=$(gen_file_lists "$contents" "$scriptdir/src/bc" "BC_" "$bc") -contents=$(gen_file_lists "$contents" "$scriptdir/src/dc" "DC_" "$dc") -contents=$(gen_file_lists "$contents" "$scriptdir/src/history" "HISTORY_" "$hist") -contents=$(gen_file_lists "$contents" "$scriptdir/src/rand" "RAND_" "$extra_math") +if [ "$unneeded" = "" ]; then + contents=$(gen_file_list "$contents" "library.c") +else + contents=$(gen_file_list "$contents" $unneeded) +fi contents=$(replace "$contents" "BC_ENABLED" "$bc") contents=$(replace "$contents" "DC_ENABLED" "$dc") contents=$(replace "$contents" "LINK" "$link") +contents=$(replace "$contents" "LIBRARY" "$library") contents=$(replace "$contents" "HISTORY" "$hist") contents=$(replace "$contents" "EXTRA_MATH" "$extra_math") contents=$(replace "$contents" "NLS" "$nls") @@ -917,7 +1037,10 @@ contents=$(replace "$contents" "DESTDIR" "$destdir") contents=$(replace "$contents" "EXECSUFFIX" "$EXECSUFFIX") contents=$(replace "$contents" "EXECPREFIX" "$EXECPREFIX") contents=$(replace "$contents" "BINDIR" "$BINDIR") +contents=$(replace "$contents" "INCLUDEDIR" "$INCLUDEDIR") +contents=$(replace "$contents" "LIBDIR" "$LIBDIR") contents=$(replace "$contents" "MAN1DIR" "$MAN1DIR") +contents=$(replace "$contents" "MAN3DIR" "$MAN3DIR") contents=$(replace "$contents" "CFLAGS" "$CFLAGS") contents=$(replace "$contents" "HOSTCFLAGS" "$HOSTCFLAGS") contents=$(replace "$contents" "CPPFLAGS" "$CPPFLAGS") @@ -927,15 +1050,19 @@ contents=$(replace "$contents" "HOSTCC" "$HOSTCC") contents=$(replace "$contents" "COVERAGE_OUTPUT" "$COVERAGE_OUTPUT") contents=$(replace "$contents" "COVERAGE_PREREQS" "$COVERAGE_PREREQS") contents=$(replace "$contents" "INSTALL_PREREQS" "$install_prereqs") +contents=$(replace "$contents" "INSTALL_MAN_PREREQS" "$install_man_prereqs") contents=$(replace "$contents" "INSTALL_LOCALES" "$install_locales") contents=$(replace "$contents" "INSTALL_LOCALES_PREREQS" "$install_locales_prereqs") contents=$(replace "$contents" "UNINSTALL_MAN_PREREQS" "$uninstall_man_prereqs") contents=$(replace "$contents" "UNINSTALL_PREREQS" "$uninstall_prereqs") contents=$(replace "$contents" "UNINSTALL_LOCALES_PREREQS" "$uninstall_locales_prereqs") +contents=$(replace "$contents" "ALL_PREREQ" "$ALL_PREREQ") + contents=$(replace "$contents" "EXECUTABLES" "$executables") contents=$(replace "$contents" "MAIN_EXEC" "$main_exec") contents=$(replace "$contents" "EXEC" "$executable") +contents=$(replace "$contents" "TESTS" "$tests") contents=$(replace "$contents" "BC_TEST" "$bc_test") contents=$(replace "$contents" "BC_TIME_TEST" "$bc_time_test") Copied: vendor/bc/dist/exec-install.sh (from r368067, vendor/bc/dist/install.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bc/dist/exec-install.sh Thu Nov 26 17:27:07 2020 (r368068, copy of r368067, vendor/bc/dist/install.sh) @@ -0,0 +1,63 @@ +#! /bin/sh +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. +# + +usage() { + printf "usage: %s install_dir exec_suffix\n" "$0" 1>&2 + exit 1 +} + +script="$0" +scriptdir=$(dirname "$script") + +. "$scriptdir/functions.sh" + +INSTALL="$scriptdir/safe-install.sh" + +test "$#" -ge 2 || usage + +installdir="$1" +shift + +exec_suffix="$1" +shift + +bindir="$scriptdir/bin" + +for exe in $bindir/*; do + + base=$(basename "$exe") + + if [ -L "$exe" ]; then + link=$(readlink "$exe") + "$INSTALL" -Dlm 755 "$link$exec_suffix" "$installdir/$base$exec_suffix" + else + "$INSTALL" -Dm 755 "$exe" "$installdir/$base$exec_suffix" + fi + +done Modified: vendor/bc/dist/gen/lib.bc ============================================================================== --- vendor/bc/dist/gen/lib.bc Thu Nov 26 17:19:47 2020 (r368067) +++ vendor/bc/dist/gen/lib.bc Thu Nov 26 17:27:07 2020 (r368068) @@ -173,7 +173,7 @@ define a(x){ return((m*a+r)/n) } define j(n,x){ - auto b,s,o,a,i,v,f + auto b,s,o,a,i,r,v,f b=ibase ibase=A s=scale Modified: vendor/bc/dist/gen/strgen.c ============================================================================== --- vendor/bc/dist/gen/strgen.c Thu Nov 26 17:19:47 2020 (r368067) +++ vendor/bc/dist/gen/strgen.c Thu Nov 26 17:27:07 2020 (r368068) @@ -45,13 +45,14 @@ static const char* const bc_gen_header = "// Copyright (c) 2018-2020 Gavin D. Howard and contributors.\n" "// Licensed under the 2-clause BSD license.\n" - "// *** AUTOMATICALLY GENERATED FROM %s. DO NOT MODIFY. ***\n"; + "// *** AUTOMATICALLY GENERATED FROM %s. DO NOT MODIFY. ***\n\n"; -static const char* const bc_gen_include = "#include <%s>\n\n"; static const char* const bc_gen_label = "const char *%s = \"%s\";\n\n"; +static const char* const bc_gen_label_extern = "extern const char *%s;\n\n"; static const char* const bc_gen_ifdef = "#if %s\n"; static const char* const bc_gen_endif = "#endif // %s\n"; static const char* const bc_gen_name = "const char %s[] = {\n"; +static const char* const bc_gen_name_extern = "extern const char %s[];\n\n"; #define IO_ERR (1) #define INVALID_INPUT_FILE (2) @@ -62,7 +63,7 @@ static const char* const bc_gen_name = "const char %s[ int main(int argc, char *argv[]) { FILE *in, *out; - char *label, *define, *name, *include; + char *label, *define, *name; int c, count, slashes, err = IO_ERR; bool has_label, has_define, remove_tabs; @@ -72,15 +73,14 @@ int main(int argc, char *argv[]) { } name = argv[3]; - include = argv[4]; - has_label = (argc > 5 && strcmp("", argv[5]) != 0); - label = has_label ? argv[5] : ""; + has_label = (argc > 4 && strcmp("", argv[4]) != 0); + label = has_label ? argv[4] : ""; - has_define = (argc > 6 && strcmp("", argv[6]) != 0); - define = has_define ? argv[6] : ""; + has_define = (argc > 5 && strcmp("", argv[5]) != 0); + define = has_define ? argv[5] : ""; - remove_tabs = (argc > 7); + remove_tabs = (argc > 6); in = fopen(argv[1], "r"); if (!in) return INVALID_INPUT_FILE; @@ -89,8 +89,9 @@ int main(int argc, char *argv[]) { if (!out) goto out_err; if (fprintf(out, bc_gen_header, argv[1]) < 0) goto err; + if (has_label && fprintf(out, bc_gen_label_extern, label) < 0) goto err; + if (fprintf(out, bc_gen_name_extern, name) < 0) goto err; if (has_define && fprintf(out, bc_gen_ifdef, define) < 0) goto err; - if (fprintf(out, bc_gen_include, include) < 0) goto err; if (has_label && fprintf(out, bc_gen_label, label, argv[1]) < 0) goto err; if (fprintf(out, bc_gen_name, name) < 0) goto err; Modified: vendor/bc/dist/gen/strgen.sh ============================================================================== --- vendor/bc/dist/gen/strgen.sh Thu Nov 26 17:19:47 2020 (r368067) +++ vendor/bc/dist/gen/strgen.sh Thu Nov 26 17:27:07 2020 (r368068) @@ -50,6 +50,7 @@ exec > "$output" if [ -n "$label" ]; then nameline="const char *${label} = \"${input}\";" + labelexternline="extern const char *${label};" fi if [ -n "$define" ]; then @@ -64,11 +65,14 @@ if [ -n "$remove_tabs" ]; then fi cat< +$labelexternline + +extern const char $name[]; $nameline Added: vendor/bc/dist/include/bcl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bc/dist/include/bcl.h Thu Nov 26 17:27:07 2020 (r368068) @@ -0,0 +1,184 @@ +/* + * ***************************************************************************** + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. + * + * ***************************************************************************** + * + * The public header for the bc library. + * + */ + +#ifndef BC_BCL_H +#define BC_BCL_H + +#include +#include +#include +#include +#include + +#define BC_SEED_ULONGS (4) +#define BC_SEED_SIZE (sizeof(long) * BC_SEED_ULONGS) + +// For some reason, LONG_BIT is not defined in some versions of gcc. +// I define it here to the minimum accepted value in the POSIX standard. +#ifndef LONG_BIT +#define LONG_BIT (32) +#endif // LONG_BIT + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Nov 26 17:29:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A9BF46A007; Thu, 26 Nov 2020 17:29:17 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chl9n3Vk4z4mdc; Thu, 26 Nov 2020 17:29:17 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6081926DBB; Thu, 26 Nov 2020 17:29:17 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQHTHbu006875; Thu, 26 Nov 2020 17:29:17 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQHTHo4006874; Thu, 26 Nov 2020 17:29:17 GMT (envelope-from se@FreeBSD.org) Message-Id: <202011261729.0AQHTHo4006874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Thu, 26 Nov 2020 17:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r368069 - vendor/bc/3.2.0 X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: vendor/bc/3.2.0 X-SVN-Commit-Revision: 368069 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 17:29:17 -0000 Author: se Date: Thu Nov 26 17:29:16 2020 New Revision: 368069 URL: https://svnweb.freebsd.org/changeset/base/368069 Log: Tag version 3.2.0 Added: vendor/bc/3.2.0/ - copied from r368068, vendor/bc/dist/ From owner-svn-src-all@freebsd.org Thu Nov 26 17:37:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6E5B46A381; Thu, 26 Nov 2020 17:37:22 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChlM65jk1z4nJc; Thu, 26 Nov 2020 17:37:22 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6E962720D; Thu, 26 Nov 2020 17:37:22 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQHbMSt012762; Thu, 26 Nov 2020 17:37:22 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQHbMYp012761; Thu, 26 Nov 2020 17:37:22 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202011261737.0AQHbMYp012761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Thu, 26 Nov 2020 17:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368070 - head/sys/riscv/include X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/sys/riscv/include X-SVN-Commit-Revision: 368070 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 17:37:22 -0000 Author: arichardson Date: Thu Nov 26 17:37:22 2020 New Revision: 368070 URL: https://svnweb.freebsd.org/changeset/base/368070 Log: Add .cfi_{start,end}proc for RISC-V assembly functions This allows GDB to print more useful backtraces when setting a breakpoint on an assembly function. Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D27177 Modified: head/sys/riscv/include/asm.h Modified: head/sys/riscv/include/asm.h ============================================================================== --- head/sys/riscv/include/asm.h Thu Nov 26 17:29:16 2020 (r368069) +++ head/sys/riscv/include/asm.h Thu Nov 26 17:37:22 2020 (r368070) @@ -47,8 +47,8 @@ #define _C_LABEL(x) x #define ENTRY(sym) \ - .text; .globl sym; .type sym,@function; .align 4; sym: -#define END(sym) .size sym, . - sym + .text; .globl sym; .type sym,@function; .align 4; sym: .cfi_startproc; +#define END(sym) .cfi_endproc; .size sym, . - sym #define EENTRY(sym) \ .globl sym; sym: From owner-svn-src-all@freebsd.org Thu Nov 26 17:37:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F73C46A387; Thu, 26 Nov 2020 17:37:28 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChlMC506Sz4n87; Thu, 26 Nov 2020 17:37:27 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 863AD2738F; Thu, 26 Nov 2020 17:37:27 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQHbR3h012814; Thu, 26 Nov 2020 17:37:27 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQHbRNK012813; Thu, 26 Nov 2020 17:37:27 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202011261737.0AQHbRNK012813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Thu, 26 Nov 2020 17:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368071 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 368071 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 17:37:28 -0000 Author: arichardson Date: Thu Nov 26 17:37:27 2020 New Revision: 368071 URL: https://svnweb.freebsd.org/changeset/base/368071 Log: bsd.lib.mk: Work around build system raciness We are seeing regular build failures due to libc.so being installed again and another parallel make job tries to read the partially written libc.so at the same time. When building with -j32 or higher this almost always happens on the first clean build (subsequent incremental builds always work fine). Using -S should "fix" the "section header table goes past the end of the file: e_shoff = 0x..." errors that have started to plague our builds. We originally thought this only affected CheriBSD, but I just got the same error while building the latest upstream FreeBSD. The real fix should be to not install libraries twice, but until then this workaround is needed. Original patch by jrtc27@, I only made some minor changes to the comment. Obtained from: CheriBSD (https://github.com/CTSRD-CHERI/cheribsd/commit/49837edd3efd5d02a1b120c47f00cfc2d59a9a8e) Reviewed By: markj, bdrewery Differential Revision: https://reviews.freebsd.org/D27102 Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Thu Nov 26 17:37:22 2020 (r368070) +++ head/share/mk/bsd.lib.mk Thu Nov 26 17:37:27 2020 (r368071) @@ -422,7 +422,17 @@ SHLINSTALLFLAGS+= -fschg # Install libraries with -S to avoid risk of modifying in-use libraries when # installing to a running system. It is safe to avoid this for NO_ROOT builds # that are only creating an image. -.if !defined(NO_SAFE_LIBINSTALL) && !defined(NO_ROOT) +# +# XXX: Since Makefile.inc1 ends up building lib/libc both as part of +# _startup_libs and as part of _generic_libs it ends up getting installed a +# second time during the parallel build, and although the .WAIT in lib/Makefile +# stops that mattering for lib, other directories like secure/lib are built in +# parallel at the top level and are unaffected by that, so can sometimes race +# with the libc.so.7 reinstall and see a missing or corrupt file. Ideally the +# build system would be fixed to not build/install libc to WORLDTMP the second +# time round, but for now using -S ensures the install is atomic and thus we +# never see a broken intermediate state, so use it even for NO_ROOT builds. +.if !defined(NO_SAFE_LIBINSTALL) #&& !defined(NO_ROOT) SHLINSTALLFLAGS+= -S SHLINSTALLSYMLINKFLAGS+= -S .endif From owner-svn-src-all@freebsd.org Thu Nov 26 17:39:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B4F546A35D; Thu, 26 Nov 2020 17:39:53 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChlQ12zFLz4nTR; Thu, 26 Nov 2020 17:39:53 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5880D27025; Thu, 26 Nov 2020 17:39:53 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQHdrw5012993; Thu, 26 Nov 2020 17:39:53 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQHdpe5012982; Thu, 26 Nov 2020 17:39:51 GMT (envelope-from se@FreeBSD.org) Message-Id: <202011261739.0AQHdpe5012982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Thu, 26 Nov 2020 17:39:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368072 - in head/contrib/bc: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head/contrib/bc: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests X-SVN-Commit-Revision: 368072 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 17:39:53 -0000 Author: se Date: Thu Nov 26 17:39:51 2020 New Revision: 368072 URL: https://svnweb.freebsd.org/changeset/base/368072 Log: Update to version 3.2.0 Added: head/contrib/bc/exec-install.sh - copied unchanged from r368069, vendor/bc/dist/exec-install.sh head/contrib/bc/include/bcl.h - copied unchanged from r368069, vendor/bc/dist/include/bcl.h head/contrib/bc/include/library.h - copied unchanged from r368069, vendor/bc/dist/include/library.h head/contrib/bc/manuals/bcl.3 - copied unchanged from r368069, vendor/bc/dist/manuals/bcl.3 head/contrib/bc/manuals/bcl.3.md - copied unchanged from r368069, vendor/bc/dist/manuals/bcl.3.md head/contrib/bc/manuals/header.txt - copied unchanged from r368069, vendor/bc/dist/manuals/header.txt head/contrib/bc/manuals/header_bc.txt - copied unchanged from r368069, vendor/bc/dist/manuals/header_bc.txt head/contrib/bc/manuals/header_bcl.txt - copied unchanged from r368069, vendor/bc/dist/manuals/header_bcl.txt head/contrib/bc/manuals/header_dc.txt - copied unchanged from r368069, vendor/bc/dist/manuals/header_dc.txt head/contrib/bc/src/bc.c - copied unchanged from r368069, vendor/bc/dist/src/bc.c head/contrib/bc/src/bc_lex.c - copied unchanged from r368069, vendor/bc/dist/src/bc_lex.c head/contrib/bc/src/bc_parse.c - copied unchanged from r368069, vendor/bc/dist/src/bc_parse.c head/contrib/bc/src/dc.c - copied unchanged from r368069, vendor/bc/dist/src/dc.c head/contrib/bc/src/dc_lex.c - copied unchanged from r368069, vendor/bc/dist/src/dc_lex.c head/contrib/bc/src/dc_parse.c - copied unchanged from r368069, vendor/bc/dist/src/dc_parse.c head/contrib/bc/src/history.c - copied unchanged from r368069, vendor/bc/dist/src/history.c head/contrib/bc/src/library.c - copied unchanged from r368069, vendor/bc/dist/src/library.c head/contrib/bc/src/rand.c - copied unchanged from r368069, vendor/bc/dist/src/rand.c head/contrib/bc/tests/bcl.c - copied unchanged from r368069, vendor/bc/dist/tests/bcl.c Deleted: head/contrib/bc/install.sh head/contrib/bc/src/bc/ head/contrib/bc/src/dc/ head/contrib/bc/src/history/ head/contrib/bc/src/rand/ Modified: head/contrib/bc/.gitignore head/contrib/bc/Makefile.in head/contrib/bc/NEWS.md head/contrib/bc/README.md head/contrib/bc/configure.sh head/contrib/bc/gen/lib.bc head/contrib/bc/gen/strgen.c head/contrib/bc/gen/strgen.sh head/contrib/bc/include/file.h head/contrib/bc/include/lex.h head/contrib/bc/include/num.h head/contrib/bc/include/parse.h head/contrib/bc/include/rand.h head/contrib/bc/include/status.h head/contrib/bc/include/vector.h head/contrib/bc/include/vm.h head/contrib/bc/manpage.sh head/contrib/bc/manuals/bc.1.md.in head/contrib/bc/manuals/bc/A.1 head/contrib/bc/manuals/bc/A.1.md head/contrib/bc/manuals/bc/E.1 head/contrib/bc/manuals/bc/E.1.md head/contrib/bc/manuals/bc/EH.1 head/contrib/bc/manuals/bc/EH.1.md head/contrib/bc/manuals/bc/EHN.1 head/contrib/bc/manuals/bc/EHN.1.md head/contrib/bc/manuals/bc/EHNP.1 head/contrib/bc/manuals/bc/EHNP.1.md head/contrib/bc/manuals/bc/EHP.1 head/contrib/bc/manuals/bc/EHP.1.md head/contrib/bc/manuals/bc/EN.1 head/contrib/bc/manuals/bc/EN.1.md head/contrib/bc/manuals/bc/ENP.1 head/contrib/bc/manuals/bc/ENP.1.md head/contrib/bc/manuals/bc/EP.1 head/contrib/bc/manuals/bc/EP.1.md head/contrib/bc/manuals/bc/H.1 head/contrib/bc/manuals/bc/H.1.md head/contrib/bc/manuals/bc/HN.1 head/contrib/bc/manuals/bc/HN.1.md head/contrib/bc/manuals/bc/HNP.1 head/contrib/bc/manuals/bc/HNP.1.md head/contrib/bc/manuals/bc/HP.1 head/contrib/bc/manuals/bc/HP.1.md head/contrib/bc/manuals/bc/N.1 head/contrib/bc/manuals/bc/N.1.md head/contrib/bc/manuals/bc/NP.1 head/contrib/bc/manuals/bc/NP.1.md head/contrib/bc/manuals/bc/P.1 head/contrib/bc/manuals/bc/P.1.md head/contrib/bc/manuals/build.md head/contrib/bc/manuals/dc.1.md.in head/contrib/bc/manuals/dc/A.1 head/contrib/bc/manuals/dc/A.1.md head/contrib/bc/manuals/dc/E.1 head/contrib/bc/manuals/dc/E.1.md head/contrib/bc/manuals/dc/EH.1 head/contrib/bc/manuals/dc/EH.1.md head/contrib/bc/manuals/dc/EHN.1 head/contrib/bc/manuals/dc/EHN.1.md head/contrib/bc/manuals/dc/EHNP.1 head/contrib/bc/manuals/dc/EHNP.1.md head/contrib/bc/manuals/dc/EHP.1 head/contrib/bc/manuals/dc/EHP.1.md head/contrib/bc/manuals/dc/EN.1 head/contrib/bc/manuals/dc/EN.1.md head/contrib/bc/manuals/dc/ENP.1 head/contrib/bc/manuals/dc/ENP.1.md head/contrib/bc/manuals/dc/EP.1 head/contrib/bc/manuals/dc/EP.1.md head/contrib/bc/manuals/dc/H.1 head/contrib/bc/manuals/dc/H.1.md head/contrib/bc/manuals/dc/HN.1 head/contrib/bc/manuals/dc/HN.1.md head/contrib/bc/manuals/dc/HNP.1 head/contrib/bc/manuals/dc/HNP.1.md head/contrib/bc/manuals/dc/HP.1 head/contrib/bc/manuals/dc/HP.1.md head/contrib/bc/manuals/dc/N.1 head/contrib/bc/manuals/dc/N.1.md head/contrib/bc/manuals/dc/NP.1 head/contrib/bc/manuals/dc/NP.1.md head/contrib/bc/manuals/dc/P.1 head/contrib/bc/manuals/dc/P.1.md head/contrib/bc/release.sh head/contrib/bc/src/args.c head/contrib/bc/src/data.c head/contrib/bc/src/file.c head/contrib/bc/src/lang.c head/contrib/bc/src/lex.c head/contrib/bc/src/main.c head/contrib/bc/src/num.c head/contrib/bc/src/opt.c head/contrib/bc/src/parse.c head/contrib/bc/src/program.c head/contrib/bc/src/read.c head/contrib/bc/src/vector.c head/contrib/bc/src/vm.c Directory Properties: head/contrib/bc/ (props changed) Modified: head/contrib/bc/.gitignore ============================================================================== --- head/contrib/bc/.gitignore Thu Nov 26 17:37:27 2020 (r368071) +++ head/contrib/bc/.gitignore Thu Nov 26 17:39:51 2020 (r368072) @@ -9,6 +9,7 @@ bin/*bc bin/*bc.exe bin/*dc bin/*dc.exe +bin/bcl bc.old *.o *.a Modified: head/contrib/bc/Makefile.in ============================================================================== --- head/contrib/bc/Makefile.in Thu Nov 26 17:37:27 2020 (r368071) +++ head/contrib/bc/Makefile.in Thu Nov 26 17:39:51 2020 (r368072) @@ -29,33 +29,13 @@ # .POSIX: -VERSION = 3.1.6 +VERSION = 3.2.0 SRC = %%SRC%% OBJ = %%OBJ%% GCDA = %%GCDA%% GCNO = %%GCNO%% -BC_SRC = %%BC_SRC%% -BC_OBJ = %%BC_OBJ%% -BC_GCDA = %%BC_GCDA%% -BC_GCNO = %%BC_GCNO%% - -DC_SRC = %%DC_SRC%% -DC_OBJ = %%DC_OBJ%% -DC_GCDA = %%DC_GCDA%% -DC_GCNO = %%DC_GCNO%% - -HISTORY_SRC = %%HISTORY_SRC%% -HISTORY_OBJ = %%HISTORY_OBJ%% -HISTORY_GCDA = %%HISTORY_GCDA%% -HISTORY_GCNO = %%HISTORY_GCNO%% - -RAND_SRC = %%RAND_SRC%% -RAND_OBJ = %%RAND_OBJ%% -RAND_GCDA = %%RAND_GCDA%% -RAND_GCNO = %%RAND_GCNO%% - BC_ENABLED_NAME = BC_ENABLED BC_ENABLED = %%BC_ENABLED%% DC_ENABLED_NAME = DC_ENABLED @@ -102,6 +82,13 @@ DC = dc BC_EXEC = $(BIN)/$(EXEC_PREFIX)$(BC) DC_EXEC = $(BIN)/$(EXEC_PREFIX)$(DC) +LIB = libbcl +LIB_NAME = $(LIB).a +LIBBC = $(BIN)/$(LIB_NAME) +BCL = bcl +BCL_TEST = $(BIN)/$(BCL) +BCL_TEST_C = tests/$(BCL).c + MANUALS = manuals BC_MANPAGE_NAME = $(EXEC_PREFIX)$(BC)$(EXEC_SUFFIX).1 BC_MANPAGE = $(MANUALS)/$(BC).1 @@ -109,16 +96,28 @@ BC_MD = $(BC_MANPAGE).md DC_MANPAGE_NAME = $(EXEC_PREFIX)$(DC)$(EXEC_SUFFIX).1 DC_MANPAGE = $(MANUALS)/$(DC).1 DC_MD = $(DC_MANPAGE).md +BCL_MANPAGE_NAME = bcl.3 +BCL_MANPAGE = $(MANUALS)/$(BCL_MANPAGE_NAME) +BCL_MD = $(BCL_MANPAGE).md MANPAGE_INSTALL_ARGS = -Dm644 +BINARY_INSTALL_ARGS = -Dm755 +BCL_HEADER_NAME = bcl.h +BCL_HEADER = include/$(BCL_HEADER_NAME) + %%DESTDIR%% BINDIR = %%BINDIR%% +INCLUDEDIR = %%INCLUDEDIR%% +LIBDIR = %%LIBDIR%% MAN1DIR = %%MAN1DIR%% +MAN3DIR = %%MAN3DIR%% MAIN_EXEC = $(EXEC_PREFIX)$(%%MAIN_EXEC%%)$(EXEC_SUFFIX) EXEC = $(%%EXEC%%) NLSPATH = %%NLSPATH%% +BC_ENABLE_LIBRARY = %%LIBRARY%% + BC_ENABLE_HISTORY = %%HISTORY%% BC_ENABLE_EXTRA_MATH_NAME = BC_ENABLE_EXTRA_MATH BC_ENABLE_EXTRA_MATH = %%EXTRA_MATH%% @@ -129,7 +128,7 @@ BC_LONG_BIT = %%LONG_BIT%% RM = rm MKDIR = mkdir -INSTALL = ./install.sh +INSTALL = ./exec-install.sh SAFE_INSTALL = ./safe-install.sh LINK = ./link.sh MANPAGE = ./manpage.sh @@ -148,7 +147,7 @@ CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_ CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) -DBC_ENABLE_PROMPT=$(BC_ENABLE_PROMPT) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) -CPPFLAGS = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) +CPPFLAGS = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY) CFLAGS = $(CPPFLAGS) %%CPPFLAGS%% %%CFLAGS%% LDFLAGS = %%LDFLAGS%% @@ -157,21 +156,24 @@ HOSTCFLAGS = %%HOSTCFLAGS%% CC = %%CC%% HOSTCC = %%HOSTCC%% -BC_LIB_C_ARGS = bc_lib bc.h bc_lib_name $(BC_ENABLED_NAME) 1 -BC_LIB2_C_ARGS = bc_lib2 bc.h bc_lib2_name "$(BC_ENABLED_NAME) && $(BC_ENABLE_EXTRA_MATH_NAME)" 1 +BC_LIB_C_ARGS = bc_lib bc_lib_name $(BC_ENABLED_NAME) 1 +BC_LIB2_C_ARGS = bc_lib2 bc_lib2_name "$(BC_ENABLED_NAME) && $(BC_ENABLE_EXTRA_MATH_NAME)" 1 -OBJS1 = $(OBJ) $(DC_OBJ) $(BC_OBJ) $(HISTORY_OBJ) $(RAND_OBJ) $(BC_HELP_O) $(DC_HELP_O) -OBJS = $(OBJS1) $(BC_LIB_O) $(BC_LIB2_O) $(BC_LIB3_O) -OBJ_TARGETS1 = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(BC_LIB3_O) -OBJ_TARGETS = $(OBJ_TARGETS1) $(BC_OBJ) $(DC_OBJ) $(HISTORY_OBJ) $(RAND_OBJ) $(OBJ) +OBJS = $(BC_HELP_O) $(DC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) +OBJ_TARGETS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) .c.o: $(CC) $(CFLAGS) -o $@ -c $< -all: make_bin $(OBJ_TARGETS) +all: %%ALL_PREREQ%% + +execs: make_bin $(OBJ_TARGETS) $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(EXEC) %%LINK%% +library: make_bin $(OBJ) $(BC_LIB_O) $(BC_LIB2_O) + ar -r -cu $(LIBBC) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) + $(GEN_EXEC): %%GEN_EXEC_TARGET%% @@ -182,10 +184,10 @@ $(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2) $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_LIB2_C_ARGS) $(BC_HELP_C): $(GEN_EXEC) $(BC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help bc.h "" $(BC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help "" $(BC_ENABLED_NAME) $(DC_HELP_C): $(GEN_EXEC) $(DC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help dc.h "" $(DC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help "" $(DC_ENABLED_NAME) make_bin: $(MKDIR) -p $(BIN) @@ -222,7 +224,7 @@ help: check: test -test: test_bc timeconst test_dc +test: %%TESTS%% test_bc: %%BC_TEST%% @@ -241,6 +243,12 @@ time_test_dc: timeconst: %%TIMECONST%% +library_test: library + $(CC) $(CFLAGS) $(BCL_TEST_C) $(LIBBC) -o $(BCL_TEST) + +test_library: library_test + $(BCL_TEST) + valgrind: valgrind_bc valgrind_dc valgrind_bc: @@ -272,6 +280,7 @@ extra_math: manpages: $(MANPAGE) bc $(MANPAGE) dc + $(MANPAGE) bcl clean_gen: @$(RM) -f $(GEN_EXEC) @@ -279,10 +288,6 @@ clean_gen: clean:%%CLEAN_PREREQS%% @printf 'Cleaning files...\n' @$(RM) -f $(OBJ) - @$(RM) -f $(BC_OBJ) - @$(RM) -f $(DC_OBJ) - @$(RM) -f $(HISTORY_OBJ) - @$(RM) -f $(RAND_OBJ) @$(RM) -f $(BC_EXEC) @$(RM) -f $(DC_EXEC) @$(RM) -fr $(BIN) @@ -343,9 +348,20 @@ install_bc_manpage: install_dc_manpage: $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(DC_MANPAGE) $(DESTDIR)$(MAN1DIR)/$(DC_MANPAGE_NAME) -install:%%INSTALL_LOCALES_PREREQS%%%%INSTALL_PREREQS%% +install_bcl_manpage: + $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(BCL_MANPAGE) $(DESTDIR)$(MAN3DIR)/$(BCL_MANPAGE_NAME) + +install_bcl_header: + $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(BCL_HEADER) $(DESTDIR)$(INCLUDEDIR)/$(BCL_HEADER_NAME) + +install_execs: $(INSTALL) $(DESTDIR)$(BINDIR) "$(EXEC_SUFFIX)" +install_library: + $(SAFE_INSTALL) $(BINARY_INSTALL_ARGS) $(LIBBC) $(DESTDIR)$(LIBDIR)/$(LIB_NAME) + +install:%%INSTALL_LOCALES_PREREQS%%%%INSTALL_MAN_PREREQS%%%%INSTALL_PREREQS%% + uninstall_locales: $(LOCALE_UNINSTALL) $(NLSPATH) $(MAIN_EXEC) $(DESTDIR) @@ -360,5 +376,14 @@ uninstall_dc_manpage: uninstall_dc: $(RM) -f $(DESTDIR)$(BINDIR)/$(EXEC_PREFIX)$(DC)$(EXEC_SUFFIX) + +uninstall_library: + $(RM) -f $(DESTDIR)$(LIBDIR)/$(LIB_NAME) + +uninstall_bcl_header: + $(RM) -f $(DESTDIR)$(INCLUDEDIR)/$(BCL_HEADER_NAME) + +uninstall_bcl_manpage: + $(RM) -f $(DESTDIR)$(MAN3DIR)/$(BCL_MANPAGE_NAME) uninstall:%%UNINSTALL_LOCALES_PREREQS%%%%UNINSTALL_MAN_PREREQS%%%%UNINSTALL_PREREQS%% Modified: head/contrib/bc/NEWS.md ============================================================================== --- head/contrib/bc/NEWS.md Thu Nov 26 17:37:27 2020 (r368071) +++ head/contrib/bc/NEWS.md Thu Nov 26 17:39:51 2020 (r368072) @@ -1,5 +1,23 @@ # News +## 3.2.0 + +This is a production release that has one bug fix and a major addition. + +The bug fix was a missing `auto` variable in the bessel `j()` function in the +math library. + +The major addition is a way to build a version of `bc`'s math code as a library. +This is done with the `-a` option to `configure.sh`. The API for the library can +be read in `./manuals/bcl.3.md` or `man bcl` once the library is installed with +`make install`. + +This library was requested by developers before I even finished version 1.0, but +I could not figure out how to do it until now. + +If the library has API breaking changes, the major version of `bc` will be +incremented. + ## 3.1.6 This is a production release that fixes a new warning from Clang 12 for FreeBSD Modified: head/contrib/bc/README.md ============================================================================== --- head/contrib/bc/README.md Thu Nov 26 17:37:27 2020 (r368071) +++ head/contrib/bc/README.md Thu Nov 26 17:39:51 2020 (r368072) @@ -107,6 +107,23 @@ other locations, use the `PREFIX` environment variable `configure.sh` or pass the `--prefix=` option to `configure.sh`. See the [build manual][5], or run `./configure.sh --help`, for more details. +### Library + +This `bc` does provide a way to build a math library with C bindings. This is +done by the `-a` or `--library` options to `configure.sh`: + +``` +./configure.sh -a +``` + +When building the library, the executables are not built. For more information, +see the [build manual][5]. + +The library API can be found in [`manuals/bcl.3.md`][26] or `man bcl` once the +library is installed. + +The library is built as `bin/libbcl.a`. + ### Package and Distro Maintainers #### Recommended Compiler @@ -335,3 +352,4 @@ Folders: [23]: https://svnweb.freebsd.org/base/head/contrib/bc/ [24]: https://bugs.freebsd.org/ [25]: https://reviews.freebsd.org/ +[26]: ./manuals/bcl.3.md Modified: head/contrib/bc/configure.sh ============================================================================== --- head/contrib/bc/configure.sh Thu Nov 26 17:37:27 2020 (r368071) +++ head/contrib/bc/configure.sh Thu Nov 26 17:39:51 2020 (r368072) @@ -45,22 +45,27 @@ usage() { _usage_val=0 fi - printf 'usage: %s -h\n' "$script" - printf ' %s --help\n' "$script" - printf ' %s [-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" - printf ' %s \\\n' "$script" - printf ' [--bc-only --disable-dc|--dc-only --disable-bc|--coverage] \\\n' - printf ' [--debug --disable-extra-math --disable-generated-tests] \\\n' - printf ' [--disable-history --disable-man-pages --disable-nls] \\\n' - printf ' [--disable-prompt --disable-strip] [--install-all-locales] \\\n' - printf ' [--opt=OPT_LEVEL] [--karatsuba-len=KARATSUBA_LEN] \\\n' - printf ' [--prefix=PREFIX] [--bindir=BINDIR] [--datarootdir=DATAROOTDIR] \\\n' - printf ' [--datadir=DATADIR] [--mandir=MANDIR] [--man1dir=MAN1DIR] \\\n' - printf ' [--force] \\\n' + printf 'usage:\n' + printf ' %s -h\n' "$script" + printf ' %s --help\n' "$script" + printf ' %s [-a|-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" + printf ' %s \\\n' "$script" + printf ' [--library|--bc-only --disable-dc|--dc-only --disable-bc|--coverage]\\\n' + printf ' [--force --debug --disable-extra-math --disable-generated-tests] \\\n' + printf ' [--disable-history --disable-man-pages --disable-nls] \\\n' + printf ' [--disable-prompt --disable-strip] [--install-all-locales] \\\n' + printf ' [--opt=OPT_LEVEL] [--karatsuba-len=KARATSUBA_LEN] \\\n' + printf ' [--prefix=PREFIX] [--bindir=BINDIR] [--datarootdir=DATAROOTDIR] \\\n' + printf ' [--datadir=DATADIR] [--mandir=MANDIR] [--man1dir=MAN1DIR] \\\n' printf '\n' + printf ' -a, --library\n' + printf ' Build the libbc instead of the programs. This is meant to be used with\n' + printf ' Other software like programming languages that want to make use of the\n' + printf ' parsing and math capabilities. This option will install headers using\n' + printf ' `make install`.\n' printf ' -b, --bc-only\n' - printf ' Build bc only. It is an error if "-d", "--dc-only", "-B", or "--disable-bc"\n' - printf ' are specified too.\n' + printf ' Build bc only. It is an error if "-d", "--dc-only", "-B", or\n' + printf ' "--disable-bc" are specified too.\n' printf ' -B, --disable-bc\n' printf ' Disable bc. It is an error if "-b", "--bc-only", "-D", or "--disable-dc"\n' printf ' are specified too.\n' @@ -69,10 +74,10 @@ usage() { printf ' It is an error if either "-b" ("-D") or "-d" ("-B") is specified.\n' printf ' Requires a compiler that use gcc-compatible coverage options\n' printf ' -d, --dc-only\n' - printf ' Build dc only. It is an error if "-b", "--bc-only", "-D", or "--disable-dc"\n' - printf ' are specified too.\n' + printf ' Build dc only. It is an error if "-b", "--bc-only", "-D", or\n' + printf ' "--disable-dc" are specified too.\n' printf ' -D, --disable-dc\n' - printf ' Disable dc. It is an error if "-d", "--dc-only" "-B", or "--disable-bc"\n' + printf ' Disable dc. It is an error if "-d", "--dc-only", "-B", or "--disable-bc"\n' printf ' are specified too.\n' printf ' -E, --disable-extra-math\n' printf ' Disable extra math. This includes: "$" operator (truncate to integer),\n' @@ -122,8 +127,14 @@ usage() { printf ' If PREFIX is "/usr", install path will be "/usr/bin".\n' printf ' Default is "/usr/local".\n' printf ' --bindir BINDIR\n' - printf ' The directory to install binaries. Overrides "$BINDIR" if it exists.\n' + printf ' The directory to install binaries in. Overrides "$BINDIR" if it exists.\n' printf ' Default is "$PREFIX/bin".\n' + printf ' --includedir INCLUDEDIR\n' + printf ' The directory to install headers in. Overrides "$INCLUDEDIR" if it\n' + printf ' exists. Default is "$PREFIX/include".\n' + printf ' --libdir LIBDIR\n' + printf ' The directory to install libraries in. Overrides "$LIBDIR" if it exists.\n' + printf ' Default is "$PREFIX/lib".\n' printf ' --datarootdir DATAROOTDIR\n' printf ' The root location for data files. Overrides "$DATAROOTDIR" if it exists.\n' printf ' Default is "$PREFIX/share".\n' @@ -136,6 +147,9 @@ usage() { printf ' --man1dir MAN1DIR\n' printf ' The location to install Section 1 manpages to. Overrides "$MAN1DIR" if\n' printf ' it exists. Default is "$MANDIR/man1".\n' + printf ' --man3dir MAN3DIR\n' + printf ' The location to install Section 3 manpages to. Overrides "$MAN3DIR" if\n' + printf ' it exists. Default is "$MANDIR/man3".\n' printf '\n' printf 'In addition, the following environment variables are used:\n' printf '\n' @@ -157,12 +171,18 @@ usage() { printf ' LDFLAGS Linker flags. Default is "".\n' printf ' PREFIX The prefix to install to. Default is "/usr/local".\n' printf ' If PREFIX is "/usr", install path will be "/usr/bin".\n' - printf ' BINDIR The directory to install binaries. Default is "$PREFIX/bin".\n' + printf ' BINDIR The directory to install binaries in. Default is "$PREFIX/bin".\n' + printf ' INCLUDEDIR The directory to install header files in. Default is\n' + printf ' "$PREFIX/include".\n' + printf ' LIBDIR The directory to install libraries in. Default is\n' + printf ' "$PREFIX/lib".\n' printf ' DATAROOTDIR The root location for data files. Default is "$PREFIX/share".\n' printf ' DATADIR The location for data files. Default is "$DATAROOTDIR".\n' printf ' MANDIR The location to install manpages to. Default is "$DATADIR/man".\n' printf ' MAN1DIR The location to install Section 1 manpages to. Default is\n' printf ' "$MANDIR/man1".\n' + printf ' MAN3DIR The location to install Section 3 manpages to. Default is\n' + printf ' "$MANDIR/man3".\n' printf ' NLSPATH The location to install locale catalogs to. Must be an absolute\n' printf ' path (or contain one). This is treated the same as the POSIX\n' printf ' definition of $NLSPATH (see POSIX environment variables for\n' @@ -257,56 +277,55 @@ replace() { substring_replace "$_replace_str" "%%$_replace_needle%%" "$_replace_replacement" } -gen_file_lists() { +gen_file_list() { - if [ "$#" -lt 3 ]; then + if [ "$#" -lt 1 ]; then err_exit "Invalid number of args to $0" fi - _gen_file_lists_contents="$1" + _gen_file_list_contents="$1" shift - _gen_file_lists_filedir="$1" - shift + p=$(pwd) - _gen_file_lists_typ="$1" - shift + cd "$scriptdir" - # If there is an extra argument, and it - # is zero, we keep the file lists empty. - if [ "$#" -gt 0 ]; then - _gen_file_lists_use="$1" + if [ "$#" -ge 1 ]; then + + while [ "$#" -ge 1 ]; do + a="$1" + shift + args="$args ! -wholename src/${a}" + done + else - _gen_file_lists_use="1" + args="-print" fi - _gen_file_lists_needle_src="${_gen_file_lists_typ}SRC" - _gen_file_lists_needle_obj="${_gen_file_lists_typ}OBJ" - _gen_file_lists_needle_gcda="${_gen_file_lists_typ}GCDA" - _gen_file_lists_needle_gcno="${_gen_file_lists_typ}GCNO" + _gen_file_list_needle_src="SRC" + _gen_file_list_needle_obj="OBJ" + _gen_file_list_needle_gcda="GCDA" + _gen_file_list_needle_gcno="GCNO" - if [ "$_gen_file_lists_use" -ne 0 ]; then + _gen_file_list_replacement=$(find src/ -depth -name "*.c" $args | tr '\n' ' ') + _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ + "$_gen_file_list_needle_src" "$_gen_file_list_replacement") - _gen_file_lists_replacement=$(cd "$_gen_file_lists_filedir" && find . ! -name . -prune -name "*.c" | cut -d/ -f2 | sed "s@^@$_gen_file_lists_filedir/@g" | tr '\n' ' ') - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_src" "$_gen_file_lists_replacement") + _gen_file_list_replacement=$(replace_exts "$_gen_file_list_replacement" "c" "o") + _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ + "$_gen_file_list_needle_obj" "$_gen_file_list_replacement") - _gen_file_lists_replacement=$(replace_exts "$_gen_file_lists_replacement" "c" "o") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_obj" "$_gen_file_lists_replacement") + _gen_file_list_replacement=$(replace_exts "$_gen_file_list_replacement" "o" "gcda") + _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ + "$_gen_file_list_needle_gcda" "$_gen_file_list_replacement") - _gen_file_lists_replacement=$(replace_exts "$_gen_file_lists_replacement" "o" "gcda") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcda" "$_gen_file_lists_replacement") + _gen_file_list_replacement=$(replace_exts "$_gen_file_list_replacement" "gcda" "gcno") + _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ + "$_gen_file_list_needle_gcno" "$_gen_file_list_replacement") - _gen_file_lists_replacement=$(replace_exts "$_gen_file_lists_replacement" "gcda" "gcno") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcno" "$_gen_file_lists_replacement") + cd "$p" - else - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_src" "") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_obj" "") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcda" "") - _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_gcno" "") - fi - - printf '%s\n' "$_gen_file_lists_contents" + printf '%s\n' "$_gen_file_list_contents" } bc_only=0 @@ -324,10 +343,12 @@ prompt=1 force=0 strip_bin=1 all_locales=0 +library=0 -while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do +while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do case "$opt" in + a) library=1 ;; b) bc_only=1 ;; B) dc_only=1 ;; c) coverage=1 ;; @@ -352,6 +373,7 @@ while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do LONG_OPTARG="${arg#*=}" case $arg in help) usage ;; + library) library=1 ;; bc-only) bc_only=1 ;; dc-only) dc_only=1 ;; coverage) coverage=1 ;; @@ -371,6 +393,20 @@ while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do fi BINDIR="$2" shift ;; + includedir=?*) INCLUDEDIR="$LONG_OPTARG" ;; + includedir) + if [ "$#" -lt 2 ]; then + usage "No argument given for '--$arg' option" + fi + INCLUDEDIR="$2" + shift ;; + libdir=?*) LIBDIR="$LONG_OPTARG" ;; + libdir) + if [ "$#" -lt 2 ]; then + usage "No argument given for '--$arg' option" + fi + LIBDIR="$2" + shift ;; datarootdir=?*) DATAROOTDIR="$LONG_OPTARG" ;; datarootdir) if [ "$#" -lt 2 ]; then @@ -399,6 +435,13 @@ while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do fi MAN1DIR="$2" shift ;; + man3dir=?*) MAN3DIR="$LONG_OPTARG" ;; + man3dir) + if [ "$#" -lt 2 ]; then + usage "No argument given for '--$arg' option" + fi + MAN3DIR="$2" + shift ;; localedir=?*) LOCALEDIR="$LONG_OPTARG" ;; localedir) if [ "$#" -lt 2 ]; then @@ -454,6 +497,12 @@ if [ "$bc_only" -eq 1 ] && [ "$dc_only" -eq 1 ]; then usage "Can only specify one of -b(-D) or -d(-B)" fi +if [ "$library" -ne 0 ]; then + if [ "$bc_only" -eq 1 ] || [ "$dc_only" -eq 1 ]; then + usage "Must not specify -b(-D) or -d(-B) when building the library" + fi +fi + case $karatsuba_len in (*[!0-9]*|'') usage "KARATSUBA_LEN is not a number" ;; (*) ;; @@ -529,6 +578,8 @@ link="@printf 'No link necessary\\\\n'" main_exec="BC" executable="BC_EXEC" +tests="test_bc timeconst test_dc" + bc_test="@tests/all.sh bc $extra_math 1 $generate_tests 0 \$(BC_EXEC)" bc_time_test="@tests/all.sh bc $extra_math 1 $generate_tests 1 \$(BC_EXEC)" @@ -567,7 +618,8 @@ if [ "$bc_only" -eq 1 ]; then dc_time_test="@printf 'No dc tests to run\\\\n'" vg_dc_test="@printf 'No dc tests to run\\\\n'" - install_prereqs=" install_bc_manpage" + install_prereqs=" install_execs" + install_man_prereqs=" install_bc_manpage" uninstall_prereqs=" uninstall_bc" uninstall_man_prereqs=" uninstall_bc_manpage" @@ -590,7 +642,8 @@ elif [ "$dc_only" -eq 1 ]; then timeconst="@printf 'timeconst cannot be run because bc is not built\\\\n'" - install_prereqs=" install_dc_manpage" + install_prereqs=" install_execs" + install_man_prereqs=" install_dc_manpage" uninstall_prereqs=" uninstall_dc" uninstall_man_prereqs=" uninstall_dc_manpage" @@ -606,9 +659,18 @@ else karatsuba="@\$(KARATSUBA) 30 0 \$(BC_EXEC)" karatsuba_test="@\$(KARATSUBA) 1 100 \$(BC_EXEC)" - install_prereqs=" install_bc_manpage install_dc_manpage" - uninstall_prereqs=" uninstall_bc uninstall_dc" - uninstall_man_prereqs=" uninstall_bc_manpage uninstall_dc_manpage" + if [ "$library" -eq 0 ]; then + install_prereqs=" install_execs" + install_man_prereqs=" install_bc_manpage install_dc_manpage" + uninstall_prereqs=" uninstall_bc uninstall_dc" + uninstall_man_prereqs=" uninstall_bc_manpage uninstall_dc_manpage" + else + install_prereqs=" install_library install_bcl_header" + install_man_prereqs=" install_bcl_manpage" + uninstall_prereqs=" uninstall_library uninstall_bcl_header" + uninstall_man_prereqs=" uninstall_bcl_manpage" + tests="test_library" + fi fi @@ -664,6 +726,14 @@ if [ -z "${BINDIR+set}" ]; then BINDIR="$PREFIX/bin" fi +if [ -z "${INCLUDEDIR+set}" ]; then + INCLUDEDIR="$PREFIX/include" +fi + +if [ -z "${LIBDIR+set}" ]; then + LIBDIR="$PREFIX/lib" +fi + if [ "$install_manpages" -ne 0 ] || [ "$nls" -ne 0 ]; then if [ -z "${DATAROOTDIR+set}" ]; then DATAROOTDIR="$PREFIX/share" @@ -684,11 +754,25 @@ if [ "$install_manpages" -ne 0 ]; then MAN1DIR="$MANDIR/man1" fi + if [ -z "${MAN3DIR+set}" ]; then + MAN3DIR="$MANDIR/man3" + fi + else - install_prereqs="" + install_man_prereqs="" uninstall_man_prereqs="" fi +if [ "$library" -ne 0 ]; then + extra_math=1 + nls=0 + hist=0 + prompt=0 + ALL_PREREQ="library" +else + ALL_PREREQ="execs" +fi + if [ "$nls" -ne 0 ]; then set +e @@ -776,11 +860,11 @@ if [ "$hist" -eq 1 ]; then printf 'Testing history...\n' flags="-DBC_ENABLE_HISTORY=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc" - flags="$flags -DBC_ENABLE_NLS=$nls" + flags="$flags -DBC_ENABLE_NLS=$nls -DBC_ENABLE_LIBRARY=0" flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I./include/" flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" - "$CC" $CPPFLAGS $CFLAGS $flags -c "src/history/history.c" -o "$scriptdir/history.o" > /dev/null 2>&1 + "$CC" $CPPFLAGS $CFLAGS $flags -c "src/history.c" -o "$scriptdir/history.o" > /dev/null 2>&1 err="$?" @@ -804,7 +888,11 @@ if [ "$hist" -eq 1 ]; then fi -if [ "$extra_math" -eq 1 ] && [ "$bc" -ne 0 ]; then +if [ "$library" -eq 1 ]; then + bc_lib="" +fi + +if [ "$extra_math" -eq 1 ] && [ "$bc" -ne 0 ] && [ "$library" -eq 0 ]; then BC_LIB2_O="\$(GEN_DIR)/lib2.o" else BC_LIB2_O="" @@ -846,6 +934,33 @@ if [ "$manpage_args" = "" ]; then manpage_args="A" fi +unneeded="" + +if [ "$hist" -eq 0 ]; then + unneeded="$unneeded history.c" +fi + +if [ "$bc" -eq 0 ]; then + unneeded="$unneeded bc.c bc_lex.c bc_parse.c" +fi + +if [ "$dc" -eq 0 ]; then + unneeded="$unneeded dc.c dc_lex.c dc_parse.c" +fi + +if [ "$extra_math" -eq 0 ]; then + unneeded="$unneeded rand.c" +fi + +if [ "$library" -ne 0 ]; then + unneeded="$unneeded args.c opt.c read.c file.c main.c" + unneeded="$unneeded lang.c lex.c parse.c program.c" + unneeded="$unneeded bc.c bc_lex.c bc_parse.c" + unneeded="$unneeded dc.c dc_lex.c dc_parse.c" +else + unneeded="$unneeded library.c" +fi + # Print out the values; this is for debugging. if [ "$bc" -ne 0 ]; then printf 'Building bc\n' @@ -858,6 +973,7 @@ else printf 'Not building dc\n' fi printf '\n' +printf 'BC_ENABLE_LIBRARY=%s\n\n' "$library" printf 'BC_ENABLE_HISTORY=%s\n' "$hist" printf 'BC_ENABLE_EXTRA_MATH=%s\n' "$extra_math" printf 'BC_ENABLE_NLS=%s\n' "$nls" @@ -873,10 +989,13 @@ printf 'CPPFLAGS=%s\n' "$CPPFLAGS" printf 'LDFLAGS=%s\n' "$LDFLAGS" printf 'PREFIX=%s\n' "$PREFIX" printf 'BINDIR=%s\n' "$BINDIR" +printf 'INCLUDEDIR=%s\n' "$INCLUDEDIR" +printf 'LIBDIR=%s\n' "$LIBDIR" printf 'DATAROOTDIR=%s\n' "$DATAROOTDIR" printf 'DATADIR=%s\n' "$DATADIR" printf 'MANDIR=%s\n' "$MANDIR" printf 'MAN1DIR=%s\n' "$MAN1DIR" +printf 'MAN3DIR=%s\n' "$MAN3DIR" printf 'NLSPATH=%s\n' "$NLSPATH" printf 'EXECSUFFIX=%s\n' "$EXECSUFFIX" printf 'EXECPREFIX=%s\n' "$EXECPREFIX" @@ -892,16 +1011,17 @@ replacement='*** WARNING: Autogenerated from Makefile. contents=$(replace "$contents" "$needle" "$replacement") -contents=$(gen_file_lists "$contents" "$scriptdir/src" "") -contents=$(gen_file_lists "$contents" "$scriptdir/src/bc" "BC_" "$bc") -contents=$(gen_file_lists "$contents" "$scriptdir/src/dc" "DC_" "$dc") -contents=$(gen_file_lists "$contents" "$scriptdir/src/history" "HISTORY_" "$hist") -contents=$(gen_file_lists "$contents" "$scriptdir/src/rand" "RAND_" "$extra_math") +if [ "$unneeded" = "" ]; then + contents=$(gen_file_list "$contents" "library.c") +else + contents=$(gen_file_list "$contents" $unneeded) +fi contents=$(replace "$contents" "BC_ENABLED" "$bc") contents=$(replace "$contents" "DC_ENABLED" "$dc") contents=$(replace "$contents" "LINK" "$link") +contents=$(replace "$contents" "LIBRARY" "$library") contents=$(replace "$contents" "HISTORY" "$hist") contents=$(replace "$contents" "EXTRA_MATH" "$extra_math") contents=$(replace "$contents" "NLS" "$nls") @@ -917,7 +1037,10 @@ contents=$(replace "$contents" "DESTDIR" "$destdir") contents=$(replace "$contents" "EXECSUFFIX" "$EXECSUFFIX") contents=$(replace "$contents" "EXECPREFIX" "$EXECPREFIX") contents=$(replace "$contents" "BINDIR" "$BINDIR") +contents=$(replace "$contents" "INCLUDEDIR" "$INCLUDEDIR") +contents=$(replace "$contents" "LIBDIR" "$LIBDIR") contents=$(replace "$contents" "MAN1DIR" "$MAN1DIR") +contents=$(replace "$contents" "MAN3DIR" "$MAN3DIR") contents=$(replace "$contents" "CFLAGS" "$CFLAGS") contents=$(replace "$contents" "HOSTCFLAGS" "$HOSTCFLAGS") contents=$(replace "$contents" "CPPFLAGS" "$CPPFLAGS") @@ -927,15 +1050,19 @@ contents=$(replace "$contents" "HOSTCC" "$HOSTCC") contents=$(replace "$contents" "COVERAGE_OUTPUT" "$COVERAGE_OUTPUT") contents=$(replace "$contents" "COVERAGE_PREREQS" "$COVERAGE_PREREQS") contents=$(replace "$contents" "INSTALL_PREREQS" "$install_prereqs") +contents=$(replace "$contents" "INSTALL_MAN_PREREQS" "$install_man_prereqs") contents=$(replace "$contents" "INSTALL_LOCALES" "$install_locales") contents=$(replace "$contents" "INSTALL_LOCALES_PREREQS" "$install_locales_prereqs") contents=$(replace "$contents" "UNINSTALL_MAN_PREREQS" "$uninstall_man_prereqs") contents=$(replace "$contents" "UNINSTALL_PREREQS" "$uninstall_prereqs") contents=$(replace "$contents" "UNINSTALL_LOCALES_PREREQS" "$uninstall_locales_prereqs") +contents=$(replace "$contents" "ALL_PREREQ" "$ALL_PREREQ") + contents=$(replace "$contents" "EXECUTABLES" "$executables") contents=$(replace "$contents" "MAIN_EXEC" "$main_exec") contents=$(replace "$contents" "EXEC" "$executable") +contents=$(replace "$contents" "TESTS" "$tests") contents=$(replace "$contents" "BC_TEST" "$bc_test") contents=$(replace "$contents" "BC_TIME_TEST" "$bc_time_test") Copied: head/contrib/bc/exec-install.sh (from r368069, vendor/bc/dist/exec-install.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/bc/exec-install.sh Thu Nov 26 17:39:51 2020 (r368072, copy of r368069, vendor/bc/dist/exec-install.sh) @@ -0,0 +1,63 @@ +#! /bin/sh +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. +# + +usage() { + printf "usage: %s install_dir exec_suffix\n" "$0" 1>&2 + exit 1 +} + +script="$0" +scriptdir=$(dirname "$script") + +. "$scriptdir/functions.sh" + +INSTALL="$scriptdir/safe-install.sh" + +test "$#" -ge 2 || usage + +installdir="$1" +shift + +exec_suffix="$1" +shift + +bindir="$scriptdir/bin" + +for exe in $bindir/*; do + + base=$(basename "$exe") + + if [ -L "$exe" ]; then + link=$(readlink "$exe") + "$INSTALL" -Dlm 755 "$link$exec_suffix" "$installdir/$base$exec_suffix" + else + "$INSTALL" -Dm 755 "$exe" "$installdir/$base$exec_suffix" + fi + +done Modified: head/contrib/bc/gen/lib.bc ============================================================================== --- head/contrib/bc/gen/lib.bc Thu Nov 26 17:37:27 2020 (r368071) +++ head/contrib/bc/gen/lib.bc Thu Nov 26 17:39:51 2020 (r368072) @@ -173,7 +173,7 @@ define a(x){ return((m*a+r)/n) } define j(n,x){ - auto b,s,o,a,i,v,f + auto b,s,o,a,i,r,v,f b=ibase ibase=A s=scale Modified: head/contrib/bc/gen/strgen.c ============================================================================== --- head/contrib/bc/gen/strgen.c Thu Nov 26 17:37:27 2020 (r368071) +++ head/contrib/bc/gen/strgen.c Thu Nov 26 17:39:51 2020 (r368072) @@ -45,13 +45,14 @@ static const char* const bc_gen_header = "// Copyright (c) 2018-2020 Gavin D. Howard and contributors.\n" "// Licensed under the 2-clause BSD license.\n" - "// *** AUTOMATICALLY GENERATED FROM %s. DO NOT MODIFY. ***\n"; + "// *** AUTOMATICALLY GENERATED FROM %s. DO NOT MODIFY. ***\n\n"; -static const char* const bc_gen_include = "#include <%s>\n\n"; static const char* const bc_gen_label = "const char *%s = \"%s\";\n\n"; +static const char* const bc_gen_label_extern = "extern const char *%s;\n\n"; static const char* const bc_gen_ifdef = "#if %s\n"; static const char* const bc_gen_endif = "#endif // %s\n"; static const char* const bc_gen_name = "const char %s[] = {\n"; +static const char* const bc_gen_name_extern = "extern const char %s[];\n\n"; #define IO_ERR (1) #define INVALID_INPUT_FILE (2) @@ -62,7 +63,7 @@ static const char* const bc_gen_name = "const char %s[ int main(int argc, char *argv[]) { FILE *in, *out; - char *label, *define, *name, *include; + char *label, *define, *name; int c, count, slashes, err = IO_ERR; bool has_label, has_define, remove_tabs; @@ -72,15 +73,14 @@ int main(int argc, char *argv[]) { } name = argv[3]; - include = argv[4]; - has_label = (argc > 5 && strcmp("", argv[5]) != 0); - label = has_label ? argv[5] : ""; + has_label = (argc > 4 && strcmp("", argv[4]) != 0); + label = has_label ? argv[4] : ""; - has_define = (argc > 6 && strcmp("", argv[6]) != 0); - define = has_define ? argv[6] : ""; + has_define = (argc > 5 && strcmp("", argv[5]) != 0); + define = has_define ? argv[5] : ""; - remove_tabs = (argc > 7); + remove_tabs = (argc > 6); in = fopen(argv[1], "r"); if (!in) return INVALID_INPUT_FILE; @@ -89,8 +89,9 @@ int main(int argc, char *argv[]) { if (!out) goto out_err; if (fprintf(out, bc_gen_header, argv[1]) < 0) goto err; + if (has_label && fprintf(out, bc_gen_label_extern, label) < 0) goto err; + if (fprintf(out, bc_gen_name_extern, name) < 0) goto err; if (has_define && fprintf(out, bc_gen_ifdef, define) < 0) goto err; - if (fprintf(out, bc_gen_include, include) < 0) goto err; if (has_label && fprintf(out, bc_gen_label, label, argv[1]) < 0) goto err; if (fprintf(out, bc_gen_name, name) < 0) goto err; Modified: head/contrib/bc/gen/strgen.sh ============================================================================== --- head/contrib/bc/gen/strgen.sh Thu Nov 26 17:37:27 2020 (r368071) +++ head/contrib/bc/gen/strgen.sh Thu Nov 26 17:39:51 2020 (r368072) @@ -32,7 +32,7 @@ export LC_CTYPE=C progname=${0##*/} -if [ $# -lt 4 ]; then +if [ $# -lt 3 ]; then echo "usage: $progname input output name header [label [define [remove_tabs]]]" exit 1 fi @@ -40,16 +40,16 @@ fi input="$1" output="$2" name="$3" -header="$4" -label="$5" -define="$6" -remove_tabs="$7" +label="$4" +define="$5" +remove_tabs="$6" exec < "$input" exec > "$output" if [ -n "$label" ]; then nameline="const char *${label} = \"${input}\";" + labelexternline="extern const char *${label};" fi if [ -n "$define" ]; then @@ -64,11 +64,14 @@ if [ -n "$remove_tabs" ]; then fi cat< +$labelexternline + +extern const char $name[]; $nameline Copied: head/contrib/bc/include/bcl.h (from r368069, vendor/bc/dist/include/bcl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/bc/include/bcl.h Thu Nov 26 17:39:51 2020 (r368072, copy of r368069, vendor/bc/dist/include/bcl.h) @@ -0,0 +1,184 @@ +/* + * ***************************************************************************** + * + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. + * + * ***************************************************************************** + * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Nov 26 18:00:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F76046ADDC; Thu, 26 Nov 2020 18:00:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chlsl2D5Nz4pSr; Thu, 26 Nov 2020 18:00:27 +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 3F0F22770A; Thu, 26 Nov 2020 18:00:27 +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 0AQI0RuH025294; Thu, 26 Nov 2020 18:00:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQI0Qgq025291; Thu, 26 Nov 2020 18:00:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011261800.0AQI0Qgq025291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 Nov 2020 18:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368073 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 368073 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 18:00:27 -0000 Author: kib Date: Thu Nov 26 18:00:26 2020 New Revision: 368073 URL: https://svnweb.freebsd.org/changeset/base/368073 Log: Make max ticks for pause in vn_lock_pair() adjustable at runtime. Reduce default value from hz / 10 to hz / 100. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/subr_param.c head/sys/kern/vfs_vnops.c head/sys/sys/vnode.h Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Thu Nov 26 17:39:51 2020 (r368072) +++ head/sys/kern/subr_param.c Thu Nov 26 18:00:26 2020 (r368073) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -183,6 +184,10 @@ init_param1(void) * sign problems sooner. */ ticks = INT_MAX - (hz * 10 * 60); + + vn_lock_pair_pause_max = hz / 100; + if (vn_lock_pair_pause_max == 0) + vn_lock_pair_pause_max = 1; #ifdef VM_SWZONE_SIZE_MAX maxswzone = VM_SWZONE_SIZE_MAX; Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Nov 26 17:39:51 2020 (r368072) +++ head/sys/kern/vfs_vnops.c Thu Nov 26 18:00:26 2020 (r368073) @@ -3332,11 +3332,16 @@ SYSCTL_ULONG(_debug, OID_AUTO, vn_lock_pair_pause, CTL &vn_lock_pair_pause_cnt, 0, "Count of vn_lock_pair deadlocks"); +u_int vn_lock_pair_pause_max; +SYSCTL_UINT(_debug, OID_AUTO, vn_lock_pair_pause_max, CTLFLAG_RW, + &vn_lock_pair_pause_max, 0, + "Max ticks for vn_lock_pair deadlock avoidance sleep"); + static void vn_lock_pair_pause(const char *wmesg) { atomic_add_long(&vn_lock_pair_pause_cnt, 1); - pause(wmesg, prng32_bounded(hz / 10)); + pause(wmesg, prng32_bounded(vn_lock_pair_pause_max)); } /* Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Thu Nov 26 17:39:51 2020 (r368072) +++ head/sys/sys/vnode.h Thu Nov 26 18:00:26 2020 (r368073) @@ -448,6 +448,8 @@ extern u_long desiredvnodes; /* number of vnodes desi extern struct uma_zone *namei_zone; extern struct vattr va_null; /* predefined null vattr structure */ +extern u_int vn_lock_pair_pause_max; + #define VI_LOCK(vp) mtx_lock(&(vp)->v_interlock) #define VI_LOCK_FLAGS(vp, flags) mtx_lock_flags(&(vp)->v_interlock, (flags)) #define VI_TRYLOCK(vp) mtx_trylock(&(vp)->v_interlock) From owner-svn-src-all@freebsd.org Thu Nov 26 18:03:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 292C146AAE3; Thu, 26 Nov 2020 18:03:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chlx90kn9z4q5G; Thu, 26 Nov 2020 18:03:25 +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 0C84B27461; Thu, 26 Nov 2020 18:03:25 +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 0AQI3OSb031290; Thu, 26 Nov 2020 18:03:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQI3Ovr031289; Thu, 26 Nov 2020 18:03:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011261803.0AQI3Ovr031289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 Nov 2020 18:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368074 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 368074 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 18:03:25 -0000 Author: kib Date: Thu Nov 26 18:03:24 2020 New Revision: 368074 URL: https://svnweb.freebsd.org/changeset/base/368074 Log: clear_inodedeps: handle ERELOOKUP from ffs_syncvnode(). Reported and tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Nov 26 18:00:26 2020 (r368073) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Nov 26 18:03:24 2020 (r368074) @@ -14321,7 +14321,10 @@ clear_inodedeps(mp) if (VTOI(vp)->i_mode == 0) { vgone(vp); } else if (ino == lastino) { - if ((error = ffs_syncvnode(vp, MNT_WAIT, 0))) + do { + error = ffs_syncvnode(vp, MNT_WAIT, 0); + } while (error == ERELOOKUP); + if (error != 0) softdep_error("clear_inodedeps: fsync1", error); } else { if ((error = ffs_syncvnode(vp, MNT_NOWAIT, 0))) From owner-svn-src-all@freebsd.org Thu Nov 26 18:08:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 221EE46AAFB; Thu, 26 Nov 2020 18:08:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chm3H0T6nz4qGk; Thu, 26 Nov 2020 18:08:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02CA227891; Thu, 26 Nov 2020 18:08:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQI8go3031579; Thu, 26 Nov 2020 18:08:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQI8gZH031578; Thu, 26 Nov 2020 18:08:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011261808.0AQI8gZH031578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 Nov 2020 18:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368075 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 368075 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 18:08:43 -0000 Author: kib Date: Thu Nov 26 18:08:42 2020 New Revision: 368075 URL: https://svnweb.freebsd.org/changeset/base/368075 Log: More careful handling of the mount failure. - VFS_UNMOUNT() requires vn_start_write() around it [*]. - call VFS_PURGE() before unmount. - do not destroy mp if cleanup unmount did not succeed. - set MNTK_UNMOUNT, and indicate forced unmount with MNTK_UNMOUNTF for VFS_UNMOUNT() in cleanup. PR: 251320 [*] Reported by: Tong Zhang Reviewed by: markj, mjg Discussed with: rmacklem Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27327 Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Thu Nov 26 18:03:24 2020 (r368074) +++ head/sys/kern/vfs_mount.c Thu Nov 26 18:08:42 2020 (r368075) @@ -903,6 +903,7 @@ vfs_domount_first( struct mount *mp; struct vnode *newdp, *rootvp; int error, error1; + bool unmounted; ASSERT_VOP_ELOCKED(vp, __func__); KASSERT((fsflags & MNT_UPDATE) == 0, ("MNT_UPDATE shouldn't be here")); @@ -964,23 +965,39 @@ vfs_domount_first( * get. No freeing of cn_pnbuf. */ error1 = 0; + unmounted = true; if ((error = VFS_MOUNT(mp)) != 0 || (error1 = VFS_STATFS(mp, &mp->mnt_stat)) != 0 || (error1 = VFS_ROOT(mp, LK_EXCLUSIVE, &newdp)) != 0) { rootvp = NULL; if (error1 != 0) { - error = error1; + MPASS(error == 0); rootvp = vfs_cache_root_clear(mp); if (rootvp != NULL) { vhold(rootvp); vrele(rootvp); } - if ((error1 = VFS_UNMOUNT(mp, 0)) != 0) - printf("VFS_UNMOUNT returned %d\n", error1); + (void)vn_start_write(NULL, &mp, V_WAIT); + MNT_ILOCK(mp); + mp->mnt_kern_flag |= MNTK_UNMOUNT | MNTK_UNMOUNTF; + MNT_IUNLOCK(mp); + VFS_PURGE(mp); + error = VFS_UNMOUNT(mp, 0); + vn_finished_write(mp); + if (error != 0) { + printf( + "failed post-mount (%d): rollback unmount returned %d\n", + error1, error); + unmounted = false; + } + error = error1; } vfs_unbusy(mp); mp->mnt_vnodecovered = NULL; - vfs_mount_destroy(mp); + if (unmounted) { + /* XXXKIB wait for mnt_lockref drain? */ + vfs_mount_destroy(mp); + } VI_LOCK(vp); vp->v_iflag &= ~VI_MOUNT; VI_UNLOCK(vp); From owner-svn-src-all@freebsd.org Thu Nov 26 18:13:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7D2946B2F5; Thu, 26 Nov 2020 18:13:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chm8s6Jh5z4qsg; Thu, 26 Nov 2020 18:13:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBBA927935; Thu, 26 Nov 2020 18:13:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQIDXTb037528; Thu, 26 Nov 2020 18:13:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQIDXm8037527; Thu, 26 Nov 2020 18:13:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011261813.0AQIDXm8037527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 Nov 2020 18:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368076 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 368076 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 18:13:34 -0000 Author: kib Date: Thu Nov 26 18:13:33 2020 New Revision: 368076 URL: https://svnweb.freebsd.org/changeset/base/368076 Log: vn_read_from_obj(): fix handling of doomed vnodes. There is no reason why vp->v_object cannot be NULL. If it is, it's fine, handle it by delegating to VOP_READ(). Tested by: pho Reviewed by: markj, mjg Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27327 Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Nov 26 18:08:42 2020 (r368075) +++ head/sys/kern/vfs_vnops.c Thu Nov 26 18:13:33 2020 (r368076) @@ -870,10 +870,10 @@ vn_read_from_obj(struct vnode *vp, struct uio *uio) ssize_t resid; int error, i, j; - obj = vp->v_object; MPASS(uio->uio_resid <= ptoa(io_hold_cnt + 2)); - MPASS(obj != NULL); - MPASS(obj->type == OBJT_VNODE); + obj = atomic_load_ptr(&vp->v_object); + if (obj == NULL) + return (EJUSTRETURN); /* * Depends on type stability of vm_objects. From owner-svn-src-all@freebsd.org Thu Nov 26 18:16:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DED1146B7D6; Thu, 26 Nov 2020 18:16:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChmDJ5yZSz4r4r; Thu, 26 Nov 2020 18:16:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF7B72793A; Thu, 26 Nov 2020 18:16:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQIGWrP037730; Thu, 26 Nov 2020 18:16:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQIGWoQ037729; Thu, 26 Nov 2020 18:16:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011261816.0AQIGWoQ037729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 Nov 2020 18:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368077 - head/sys/fs/nullfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/nullfs X-SVN-Commit-Revision: 368077 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 18:16:32 -0000 Author: kib Date: Thu Nov 26 18:16:32 2020 New Revision: 368077 URL: https://svnweb.freebsd.org/changeset/base/368077 Log: nullfs: provide custom bypass for VOP_READ_PGCACHE(). Normal bypass expects locked vnode, which is not true for VOP_READ_PGCACHE(). Ensure liveness of the lower vnode by taking the upper vnode interlock, which is also taked by null_reclaim() when setting v_data to NULL. Reported and tested by: pho Reviewed by: markj, mjg Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27327 Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Thu Nov 26 18:13:33 2020 (r368076) +++ head/sys/fs/nullfs/null_vnops.c Thu Nov 26 18:16:32 2020 (r368077) @@ -947,6 +947,28 @@ null_vptocnp(struct vop_vptocnp_args *ap) return (error); } +static int +null_read_pgcache(struct vop_read_pgcache_args *ap) +{ + struct vnode *lvp, *vp; + struct null_node *xp; + int error; + + vp = ap->a_vp; + VI_LOCK(vp); + xp = VTONULL(vp); + if (xp == NULL) { + VI_UNLOCK(vp); + return (EJUSTRETURN); + } + lvp = xp->null_lowervp; + vref(lvp); + VI_UNLOCK(vp); + error = VOP_READ_PGCACHE(lvp, ap->a_uio, ap->a_ioflag, ap->a_cred); + vrele(lvp); + return (error); +} + /* * Global vfs data structures */ @@ -966,6 +988,7 @@ struct vop_vector null_vnodeops = { .vop_lookup = null_lookup, .vop_open = null_open, .vop_print = null_print, + .vop_read_pgcache = null_read_pgcache, .vop_reclaim = null_reclaim, .vop_remove = null_remove, .vop_rename = null_rename, From owner-svn-src-all@freebsd.org Thu Nov 26 18:19:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04C8046B5FE; Thu, 26 Nov 2020 18:19:59 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChmJG4JF0z4rSK; Thu, 26 Nov 2020 18:19:58 +0000 (UTC) (envelope-from ohartmann@walstatt.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606414796; bh=kXwvGdcjA1ofpRrNRPDJAZvYe9UbiDvLKKEocIUH5x4=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=c+n8iSOBG1+BAGAwHroNyatx97CY0v3St/pa7uY5Fp8s0NEhzB61iJgxzaJEckDhP c3AVJCMlkdsYhjJocCwFb0AIoxhCnB6RLXNplKfrsMR0e8Y9OkO11TOtlOZQupH3/r Zd835kTs9LI1Ic8iDw+vDz8sE7W+L21mLWtd08Dw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from thor.intern.walstatt.dynvpn.de ([89.12.41.174]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MyKDe-1kIqGm1C2u-00yksU; Thu, 26 Nov 2020 19:19:56 +0100 Date: Thu, 26 Nov 2020 19:19:22 +0100 From: "O. Hartmann" To: Stefan =?UTF-8?B?RcOfZXI=?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r368072 - in head/contrib/bc: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests Message-ID: <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> In-Reply-To: <202011261739.0AQHdpe5012982@repo.freebsd.org> References: <202011261739.0AQHdpe5012982@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:fGKRfwZoBWjb171T0KD2q9xGzu5SKM2q3+QoVbra+PVLObXEw8q xTFVDPDSmiq2wnv4Cr9Wkq81rLsoZ7ehQnekPA4txB4K3k6a1lKWB0qTmzFgT/leDDVMCj/ 6yLLZ1aCTSV3UsWMNiR/FM6mLwnVrkjSjk5+ngoe2KthPL4CyO8P/VKajRv9OLdRY+PPZdP JyBvGwRAPB2vCOqQgB5aA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:UzE6RY2+TtQ=:Occe1n1/cpmpoPPjHpSo84 DsQi3z3cBovIjbPCjSUbQY7WruIKVDxZuXAek3yXe0qUWwwr/A/8uJ2WwnECqyLBTfpJ2msxl sToK0WG12tngyd+rirGL+PODp9h3n2SD/QYvGjBiDhLRZ1MAOiQND3DnesAwmU/BPrbfckFo8 e0nXIJX+jBOHo0UvyyS1MuthrJGqi31IQR3NOUhNskjmd9MYQPslGZpBdis9uT0VGY3aNCauG LePLAYHrkOCbTdSDpKNLDWJKMfRBGJekKyk7/MQftoTMa55WQaneojHBFC1aG/VAkqikef5HQ JjfAxOxzx5cTZmNCoPCtSdcopUUp2flJoGC6w+0xY7TwBc4G1RqmeWT9eiePvTfxACfNrPRNW Vey5uNgRdrZywIilYor/J7LAf6ezi3DGabMIV50NVL1X9A60GyaPlEhpDnmUpPd+vKxhfNCvA BbeGFwigy/RdvPML2v8FeXg5Vhp06sMSI+7jDp/ZAKmA1LolvkiovlSUfbG3SWe6LCJz4hZvW kVAlBRcLivNe5cxM07lm34zyn2t4PKWHWs/lyFJiDUkmeWCrTIaDs0iX32PVLJRp3lzRdcMvz 51pnH7hp55FJ1fcF11WQ9FhPYfPhA+bwFugPKMmRsrQHViKvlSbtpkvbl6sOw1OAfWReVc8Lv aVd0OehM/64KDTLvbPZsa6LmCbaJrctdCF209Pgmiz+ShblgVMiRJ+hEiyoKSgwN9lZk8XE1P VCykDvcf6XMQ8KIo3/5KW635PepR2cm6cxPHlqQuNAVJ+EHAYwh7xvFjL5UYUFk6cT6TPDlxn /bimF1RTTVDmR+GHw54nCGXNGpZqCrKyH1ijOSYpgvTzhC+H2NUsiP/ejX6qaemINQTN/5G7n q8N/kTcMPmnQdmCLQKNg== X-Rspamd-Queue-Id: 4ChmJG4JF0z4rSK X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 18:19:59 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBMjU2DQoNCkFtIFRo dSwgMjYgTm92IDIwMjAgMTc6Mzk6NTEgKzAwMDAgKFVUQykNClN0ZWZhbiBFw59lciA8c2VARnJl ZUJTRC5vcmc+IHNjaHJpZWI6DQoNCj4gQXV0aG9yOiBzZQ0KPiBEYXRlOiBUaHUgTm92IDI2IDE3 OjM5OjUxIDIwMjANCj4gTmV3IFJldmlzaW9uOiAzNjgwNzINCj4gVVJMOiBodHRwczovL3N2bndl Yi5mcmVlYnNkLm9yZy9jaGFuZ2VzZXQvYmFzZS8zNjgwNzINCj4gDQo+IExvZzoNCj4gICBVcGRh dGUgdG8gdmVyc2lvbiAzLjIuMA0KPiANCj4gQWRkZWQ6DQo+ICAgaGVhZC9jb250cmliL2JjL2V4 ZWMtaW5zdGFsbC5zaA0KPiAgICAgIC0gY29waWVkIHVuY2hhbmdlZCBmcm9tIHIzNjgwNjksIHZl bmRvci9iYy9kaXN0L2V4ZWMtaW5zdGFsbC5zaA0KPiAgIGhlYWQvY29udHJpYi9iYy9pbmNsdWRl L2JjbC5oDQo+ICAgICAgLSBjb3BpZWQgdW5jaGFuZ2VkIGZyb20gcjM2ODA2OSwgdmVuZG9yL2Jj L2Rpc3QvaW5jbHVkZS9iY2wuaA0KPiAgIGhlYWQvY29udHJpYi9iYy9pbmNsdWRlL2xpYnJhcnku aA0KPiAgICAgIC0gY29waWVkIHVuY2hhbmdlZCBmcm9tIHIzNjgwNjksIHZlbmRvci9iYy9kaXN0 L2luY2x1ZGUvbGlicmFyeS5oDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvYmNsLjMNCj4g ICAgICAtIGNvcGllZCB1bmNoYW5nZWQgZnJvbSByMzY4MDY5LCB2ZW5kb3IvYmMvZGlzdC9tYW51 YWxzL2JjbC4zDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvYmNsLjMubWQNCj4gICAgICAt IGNvcGllZCB1bmNoYW5nZWQgZnJvbSByMzY4MDY5LCB2ZW5kb3IvYmMvZGlzdC9tYW51YWxzL2Jj bC4zLm1kDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvaGVhZGVyLnR4dA0KPiAgICAgIC0g Y29waWVkIHVuY2hhbmdlZCBmcm9tIHIzNjgwNjksIHZlbmRvci9iYy9kaXN0L21hbnVhbHMvaGVh ZGVyLnR4dA0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxzL2hlYWRlcl9iYy50eHQNCj4gICAg ICAtIGNvcGllZCB1bmNoYW5nZWQgZnJvbSByMzY4MDY5LCB2ZW5kb3IvYmMvZGlzdC9tYW51YWxz L2hlYWRlcl9iYy50eHQNCj4gICBoZWFkL2NvbnRyaWIvYmMvbWFudWFscy9oZWFkZXJfYmNsLnR4 dA0KPiAgICAgIC0gY29waWVkIHVuY2hhbmdlZCBmcm9tIHIzNjgwNjksIHZlbmRvci9iYy9kaXN0 L21hbnVhbHMvaGVhZGVyX2JjbC50eHQNCj4gICBoZWFkL2NvbnRyaWIvYmMvbWFudWFscy9oZWFk ZXJfZGMudHh0DQo+ICAgICAgLSBjb3BpZWQgdW5jaGFuZ2VkIGZyb20gcjM2ODA2OSwgdmVuZG9y L2JjL2Rpc3QvbWFudWFscy9oZWFkZXJfZGMudHh0DQo+ICAgaGVhZC9jb250cmliL2JjL3NyYy9i Yy5jDQo+ICAgICAgLSBjb3BpZWQgdW5jaGFuZ2VkIGZyb20gcjM2ODA2OSwgdmVuZG9yL2JjL2Rp c3Qvc3JjL2JjLmMNCj4gICBoZWFkL2NvbnRyaWIvYmMvc3JjL2JjX2xleC5jDQo+ICAgICAgLSBj b3BpZWQgdW5jaGFuZ2VkIGZyb20gcjM2ODA2OSwgdmVuZG9yL2JjL2Rpc3Qvc3JjL2JjX2xleC5j DQo+ICAgaGVhZC9jb250cmliL2JjL3NyYy9iY19wYXJzZS5jDQo+ICAgICAgLSBjb3BpZWQgdW5j aGFuZ2VkIGZyb20gcjM2ODA2OSwgdmVuZG9yL2JjL2Rpc3Qvc3JjL2JjX3BhcnNlLmMNCj4gICBo ZWFkL2NvbnRyaWIvYmMvc3JjL2RjLmMNCj4gICAgICAtIGNvcGllZCB1bmNoYW5nZWQgZnJvbSBy MzY4MDY5LCB2ZW5kb3IvYmMvZGlzdC9zcmMvZGMuYw0KPiAgIGhlYWQvY29udHJpYi9iYy9zcmMv ZGNfbGV4LmMNCj4gICAgICAtIGNvcGllZCB1bmNoYW5nZWQgZnJvbSByMzY4MDY5LCB2ZW5kb3Iv YmMvZGlzdC9zcmMvZGNfbGV4LmMNCj4gICBoZWFkL2NvbnRyaWIvYmMvc3JjL2RjX3BhcnNlLmMN Cj4gICAgICAtIGNvcGllZCB1bmNoYW5nZWQgZnJvbSByMzY4MDY5LCB2ZW5kb3IvYmMvZGlzdC9z cmMvZGNfcGFyc2UuYw0KPiAgIGhlYWQvY29udHJpYi9iYy9zcmMvaGlzdG9yeS5jDQo+ICAgICAg LSBjb3BpZWQgdW5jaGFuZ2VkIGZyb20gcjM2ODA2OSwgdmVuZG9yL2JjL2Rpc3Qvc3JjL2hpc3Rv cnkuYw0KPiAgIGhlYWQvY29udHJpYi9iYy9zcmMvbGlicmFyeS5jDQo+ICAgICAgLSBjb3BpZWQg dW5jaGFuZ2VkIGZyb20gcjM2ODA2OSwgdmVuZG9yL2JjL2Rpc3Qvc3JjL2xpYnJhcnkuYw0KPiAg IGhlYWQvY29udHJpYi9iYy9zcmMvcmFuZC5jDQo+ICAgICAgLSBjb3BpZWQgdW5jaGFuZ2VkIGZy b20gcjM2ODA2OSwgdmVuZG9yL2JjL2Rpc3Qvc3JjL3JhbmQuYw0KPiAgIGhlYWQvY29udHJpYi9i Yy90ZXN0cy9iY2wuYw0KPiAgICAgIC0gY29waWVkIHVuY2hhbmdlZCBmcm9tIHIzNjgwNjksIHZl bmRvci9iYy9kaXN0L3Rlc3RzL2JjbC5jDQo+IERlbGV0ZWQ6DQo+ICAgaGVhZC9jb250cmliL2Jj L2luc3RhbGwuc2gNCj4gICBoZWFkL2NvbnRyaWIvYmMvc3JjL2JjLw0KPiAgIGhlYWQvY29udHJp Yi9iYy9zcmMvZGMvDQo+ICAgaGVhZC9jb250cmliL2JjL3NyYy9oaXN0b3J5Lw0KPiAgIGhlYWQv Y29udHJpYi9iYy9zcmMvcmFuZC8NCj4gTW9kaWZpZWQ6DQo+ICAgaGVhZC9jb250cmliL2JjLy5n aXRpZ25vcmUNCj4gICBoZWFkL2NvbnRyaWIvYmMvTWFrZWZpbGUuaW4NCj4gICBoZWFkL2NvbnRy aWIvYmMvTkVXUy5tZA0KPiAgIGhlYWQvY29udHJpYi9iYy9SRUFETUUubWQNCj4gICBoZWFkL2Nv bnRyaWIvYmMvY29uZmlndXJlLnNoDQo+ICAgaGVhZC9jb250cmliL2JjL2dlbi9saWIuYmMNCj4g ICBoZWFkL2NvbnRyaWIvYmMvZ2VuL3N0cmdlbi5jDQo+ICAgaGVhZC9jb250cmliL2JjL2dlbi9z dHJnZW4uc2gNCj4gICBoZWFkL2NvbnRyaWIvYmMvaW5jbHVkZS9maWxlLmgNCj4gICBoZWFkL2Nv bnRyaWIvYmMvaW5jbHVkZS9sZXguaA0KPiAgIGhlYWQvY29udHJpYi9iYy9pbmNsdWRlL251bS5o DQo+ICAgaGVhZC9jb250cmliL2JjL2luY2x1ZGUvcGFyc2UuaA0KPiAgIGhlYWQvY29udHJpYi9i Yy9pbmNsdWRlL3JhbmQuaA0KPiAgIGhlYWQvY29udHJpYi9iYy9pbmNsdWRlL3N0YXR1cy5oDQo+ ICAgaGVhZC9jb250cmliL2JjL2luY2x1ZGUvdmVjdG9yLmgNCj4gICBoZWFkL2NvbnRyaWIvYmMv aW5jbHVkZS92bS5oDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnBhZ2Uuc2gNCj4gICBoZWFkL2Nv bnRyaWIvYmMvbWFudWFscy9iYy4xLm1kLmluDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMv YmMvQS4xDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvYmMvQS4xLm1kDQo+ICAgaGVhZC9j b250cmliL2JjL21hbnVhbHMvYmMvRS4xDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvYmMv RS4xLm1kDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvYmMvRUguMQ0KPiAgIGhlYWQvY29u dHJpYi9iYy9tYW51YWxzL2JjL0VILjEubWQNCj4gICBoZWFkL2NvbnRyaWIvYmMvbWFudWFscy9i Yy9FSE4uMQ0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxzL2JjL0VITi4xLm1kDQo+ICAgaGVh ZC9jb250cmliL2JjL21hbnVhbHMvYmMvRUhOUC4xDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVh bHMvYmMvRUhOUC4xLm1kDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvYmMvRUhQLjENCj4g ICBoZWFkL2NvbnRyaWIvYmMvbWFudWFscy9iYy9FSFAuMS5tZA0KPiAgIGhlYWQvY29udHJpYi9i Yy9tYW51YWxzL2JjL0VOLjENCj4gICBoZWFkL2NvbnRyaWIvYmMvbWFudWFscy9iYy9FTi4xLm1k DQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvYmMvRU5QLjENCj4gICBoZWFkL2NvbnRyaWIv YmMvbWFudWFscy9iYy9FTlAuMS5tZA0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxzL2JjL0VQ LjENCj4gICBoZWFkL2NvbnRyaWIvYmMvbWFudWFscy9iYy9FUC4xLm1kDQo+ICAgaGVhZC9jb250 cmliL2JjL21hbnVhbHMvYmMvSC4xDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvYmMvSC4x Lm1kDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvYmMvSE4uMQ0KPiAgIGhlYWQvY29udHJp Yi9iYy9tYW51YWxzL2JjL0hOLjEubWQNCj4gICBoZWFkL2NvbnRyaWIvYmMvbWFudWFscy9iYy9I TlAuMQ0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxzL2JjL0hOUC4xLm1kDQo+ICAgaGVhZC9j b250cmliL2JjL21hbnVhbHMvYmMvSFAuMQ0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxzL2Jj L0hQLjEubWQNCj4gICBoZWFkL2NvbnRyaWIvYmMvbWFudWFscy9iYy9OLjENCj4gICBoZWFkL2Nv bnRyaWIvYmMvbWFudWFscy9iYy9OLjEubWQNCj4gICBoZWFkL2NvbnRyaWIvYmMvbWFudWFscy9i Yy9OUC4xDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvYmMvTlAuMS5tZA0KPiAgIGhlYWQv Y29udHJpYi9iYy9tYW51YWxzL2JjL1AuMQ0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxzL2Jj L1AuMS5tZA0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxzL2J1aWxkLm1kDQo+ICAgaGVhZC9j b250cmliL2JjL21hbnVhbHMvZGMuMS5tZC5pbg0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxz L2RjL0EuMQ0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxzL2RjL0EuMS5tZA0KPiAgIGhlYWQv Y29udHJpYi9iYy9tYW51YWxzL2RjL0UuMQ0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxzL2Rj L0UuMS5tZA0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxzL2RjL0VILjENCj4gICBoZWFkL2Nv bnRyaWIvYmMvbWFudWFscy9kYy9FSC4xLm1kDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMv ZGMvRUhOLjENCj4gICBoZWFkL2NvbnRyaWIvYmMvbWFudWFscy9kYy9FSE4uMS5tZA0KPiAgIGhl YWQvY29udHJpYi9iYy9tYW51YWxzL2RjL0VITlAuMQ0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51 YWxzL2RjL0VITlAuMS5tZA0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxzL2RjL0VIUC4xDQo+ ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvZGMvRUhQLjEubWQNCj4gICBoZWFkL2NvbnRyaWIv YmMvbWFudWFscy9kYy9FTi4xDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvZGMvRU4uMS5t ZA0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxzL2RjL0VOUC4xDQo+ICAgaGVhZC9jb250cmli L2JjL21hbnVhbHMvZGMvRU5QLjEubWQNCj4gICBoZWFkL2NvbnRyaWIvYmMvbWFudWFscy9kYy9F UC4xDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvZGMvRVAuMS5tZA0KPiAgIGhlYWQvY29u dHJpYi9iYy9tYW51YWxzL2RjL0guMQ0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxzL2RjL0gu MS5tZA0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxzL2RjL0hOLjENCj4gICBoZWFkL2NvbnRy aWIvYmMvbWFudWFscy9kYy9ITi4xLm1kDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvZGMv SE5QLjENCj4gICBoZWFkL2NvbnRyaWIvYmMvbWFudWFscy9kYy9ITlAuMS5tZA0KPiAgIGhlYWQv Y29udHJpYi9iYy9tYW51YWxzL2RjL0hQLjENCj4gICBoZWFkL2NvbnRyaWIvYmMvbWFudWFscy9k Yy9IUC4xLm1kDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMvZGMvTi4xDQo+ICAgaGVhZC9j b250cmliL2JjL21hbnVhbHMvZGMvTi4xLm1kDQo+ICAgaGVhZC9jb250cmliL2JjL21hbnVhbHMv ZGMvTlAuMQ0KPiAgIGhlYWQvY29udHJpYi9iYy9tYW51YWxzL2RjL05QLjEubWQNCj4gICBoZWFk L2NvbnRyaWIvYmMvbWFudWFscy9kYy9QLjENCj4gICBoZWFkL2NvbnRyaWIvYmMvbWFudWFscy9k Yy9QLjEubWQNCj4gICBoZWFkL2NvbnRyaWIvYmMvcmVsZWFzZS5zaA0KPiAgIGhlYWQvY29udHJp Yi9iYy9zcmMvYXJncy5jDQo+ICAgaGVhZC9jb250cmliL2JjL3NyYy9kYXRhLmMNCj4gICBoZWFk L2NvbnRyaWIvYmMvc3JjL2ZpbGUuYw0KPiAgIGhlYWQvY29udHJpYi9iYy9zcmMvbGFuZy5jDQo+ ICAgaGVhZC9jb250cmliL2JjL3NyYy9sZXguYw0KPiAgIGhlYWQvY29udHJpYi9iYy9zcmMvbWFp bi5jDQo+ICAgaGVhZC9jb250cmliL2JjL3NyYy9udW0uYw0KPiAgIGhlYWQvY29udHJpYi9iYy9z cmMvb3B0LmMNCj4gICBoZWFkL2NvbnRyaWIvYmMvc3JjL3BhcnNlLmMNCj4gICBoZWFkL2NvbnRy aWIvYmMvc3JjL3Byb2dyYW0uYw0KPiAgIGhlYWQvY29udHJpYi9iYy9zcmMvcmVhZC5jDQo+ICAg aGVhZC9jb250cmliL2JjL3NyYy92ZWN0b3IuYw0KPiAgIGhlYWQvY29udHJpYi9iYy9zcmMvdm0u Yw0KPiBEaXJlY3RvcnkgUHJvcGVydGllczoNCj4gICBoZWFkL2NvbnRyaWIvYmMvICAgKHByb3Bz IGNoYW5nZWQpDQo+IA0KPiBNb2RpZmllZDogaGVhZC9jb250cmliL2JjLy5naXRpZ25vcmUNCj4g PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09DQo+IC0tLSBoZWFkL2NvbnRyaWIvYmMvLmdpdGlnbm9yZQlU aHUgTm92IDI2IDE3OjM3OjI3IDIwMjAJKHIzNjgwNzEpDQo+ICsrKyBoZWFkL2NvbnRyaWIvYmMv LmdpdGlnbm9yZQlUaHUgTm92IDI2IDE3OjM5OjUxIDIwMjAJKHIzNjgwNzIpDQo+IEBAIC05LDYg KzksNyBAQCBiaW4vKmJjDQo+ICBiaW4vKmJjLmV4ZQ0KPiAgYmluLypkYw0KPiAgYmluLypkYy5l eGUNCj4gK2Jpbi9iY2wNCj4gIGJjLm9sZA0KPiAgKi5vDQo+ICAqLmENCj4gDQo+IE1vZGlmaWVk OiBoZWFkL2NvbnRyaWIvYmMvTWFrZWZpbGUuaW4NCj4gPT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQo+ IC0tLSBoZWFkL2NvbnRyaWIvYmMvTWFrZWZpbGUuaW4JVGh1IE5vdiAyNiAxNzozNzoyNyAyMDIw CShyMzY4MDcxKQ0KPiArKysgaGVhZC9jb250cmliL2JjL01ha2VmaWxlLmluCVRodSBOb3YgMjYg MTc6Mzk6NTEgMjAyMAkocjM2ODA3MikNCj4gQEAgLTI5LDMzICsyOSwxMyBAQA0KPiAgIw0KPiAg LlBPU0lYOg0KPiAgDQo+IC1WRVJTSU9OID0gMy4xLjYNCj4gK1ZFUlNJT04gPSAzLjIuMA0KPiAg DQo+ICBTUkMgPSAlJVNSQyUlDQo+ICBPQkogPSAlJU9CSiUlDQo+ICBHQ0RBID0gJSVHQ0RBJSUN Cj4gIEdDTk8gPSAlJUdDTk8lJQ0KPiAgDQo+IC1CQ19TUkMgPSAlJUJDX1NSQyUlDQo+IC1CQ19P QkogPSAlJUJDX09CSiUlDQo+IC1CQ19HQ0RBID0gJSVCQ19HQ0RBJSUNCj4gLUJDX0dDTk8gPSAl JUJDX0dDTk8lJQ0KPiAtDQo+IC1EQ19TUkMgPSAlJURDX1NSQyUlDQo+IC1EQ19PQkogPSAlJURD X09CSiUlDQo+IC1EQ19HQ0RBID0gJSVEQ19HQ0RBJSUNCj4gLURDX0dDTk8gPSAlJURDX0dDTk8l JQ0KPiAtDQo+IC1ISVNUT1JZX1NSQyA9ICUlSElTVE9SWV9TUkMlJQ0KPiAtSElTVE9SWV9PQkog PSAlJUhJU1RPUllfT0JKJSUNCj4gLUhJU1RPUllfR0NEQSA9ICUlSElTVE9SWV9HQ0RBJSUNCj4g LUhJU1RPUllfR0NOTyA9ICUlSElTVE9SWV9HQ05PJSUNCj4gLQ0KPiAtUkFORF9TUkMgPSAlJVJB TkRfU1JDJSUNCj4gLVJBTkRfT0JKID0gJSVSQU5EX09CSiUlDQo+IC1SQU5EX0dDREEgPSAlJVJB TkRfR0NEQSUlDQo+IC1SQU5EX0dDTk8gPSAlJVJBTkRfR0NOTyUlDQo+IC0NCj4gIEJDX0VOQUJM RURfTkFNRSA9IEJDX0VOQUJMRUQNCj4gIEJDX0VOQUJMRUQgPSAlJUJDX0VOQUJMRUQlJQ0KPiAg RENfRU5BQkxFRF9OQU1FID0gRENfRU5BQkxFRA0KPiBAQCAtMTAyLDYgKzgyLDEzIEBAIERDID0g ZGMNCj4gIEJDX0VYRUMgPSAkKEJJTikvJChFWEVDX1BSRUZJWCkkKEJDKQ0KPiAgRENfRVhFQyA9 ICQoQklOKS8kKEVYRUNfUFJFRklYKSQoREMpDQo+ICANCj4gK0xJQiA9IGxpYmJjbA0KPiArTElC X05BTUUgPSAkKExJQikuYQ0KPiArTElCQkMgPSAkKEJJTikvJChMSUJfTkFNRSkNCj4gK0JDTCA9 IGJjbA0KPiArQkNMX1RFU1QgPSAkKEJJTikvJChCQ0wpDQo+ICtCQ0xfVEVTVF9DID0gdGVzdHMv JChCQ0wpLmMNCj4gKw0KPiAgTUFOVUFMUyA9IG1hbnVhbHMNCj4gIEJDX01BTlBBR0VfTkFNRSA9 ICQoRVhFQ19QUkVGSVgpJChCQykkKEVYRUNfU1VGRklYKS4xDQo+ICBCQ19NQU5QQUdFID0gJChN QU5VQUxTKS8kKEJDKS4xDQo+IEBAIC0xMDksMTYgKzk2LDI4IEBAIEJDX01EID0gJChCQ19NQU5Q QUdFKS5tZA0KPiAgRENfTUFOUEFHRV9OQU1FID0gJChFWEVDX1BSRUZJWCkkKERDKSQoRVhFQ19T VUZGSVgpLjENCj4gIERDX01BTlBBR0UgPSAkKE1BTlVBTFMpLyQoREMpLjENCj4gIERDX01EID0g JChEQ19NQU5QQUdFKS5tZA0KPiArQkNMX01BTlBBR0VfTkFNRSA9IGJjbC4zDQo+ICtCQ0xfTUFO UEFHRSA9ICQoTUFOVUFMUykvJChCQ0xfTUFOUEFHRV9OQU1FKQ0KPiArQkNMX01EID0gJChCQ0xf TUFOUEFHRSkubWQNCj4gIA0KPiAgTUFOUEFHRV9JTlNUQUxMX0FSR1MgPSAtRG02NDQNCj4gK0JJ TkFSWV9JTlNUQUxMX0FSR1MgPSAtRG03NTUNCj4gIA0KPiArQkNMX0hFQURFUl9OQU1FID0gYmNs LmgNCj4gK0JDTF9IRUFERVIgPSBpbmNsdWRlLyQoQkNMX0hFQURFUl9OQU1FKQ0KPiArDQo+ICAl JURFU1RESVIlJQ0KPiAgQklORElSID0gJSVCSU5ESVIlJQ0KPiArSU5DTFVERURJUiA9ICUlSU5D TFVERURJUiUlDQo+ICtMSUJESVIgPSAlJUxJQkRJUiUlDQo+ICBNQU4xRElSID0gJSVNQU4xRElS JSUNCj4gK01BTjNESVIgPSAlJU1BTjNESVIlJQ0KPiAgTUFJTl9FWEVDID0gJChFWEVDX1BSRUZJ WCkkKCUlTUFJTl9FWEVDJSUpJChFWEVDX1NVRkZJWCkNCj4gIEVYRUMgPSAkKCUlRVhFQyUlKQ0K PiAgTkxTUEFUSCA9ICUlTkxTUEFUSCUlDQo+ICANCj4gK0JDX0VOQUJMRV9MSUJSQVJZID0gJSVM SUJSQVJZJSUNCj4gKw0KPiAgQkNfRU5BQkxFX0hJU1RPUlkgPSAlJUhJU1RPUlklJQ0KPiAgQkNf RU5BQkxFX0VYVFJBX01BVEhfTkFNRSA9IEJDX0VOQUJMRV9FWFRSQV9NQVRIDQo+ICBCQ19FTkFC TEVfRVhUUkFfTUFUSCA9ICUlRVhUUkFfTUFUSCUlDQo+IEBAIC0xMjksNyArMTI4LDcgQEAgQkNf TE9OR19CSVQgPSAlJUxPTkdfQklUJSUNCj4gIFJNID0gcm0NCj4gIE1LRElSID0gbWtkaXINCj4g IA0KPiAtSU5TVEFMTCA9IC4vaW5zdGFsbC5zaA0KPiArSU5TVEFMTCA9IC4vZXhlYy1pbnN0YWxs LnNoDQo+ICBTQUZFX0lOU1RBTEwgPSAuL3NhZmUtaW5zdGFsbC5zaA0KPiAgTElOSyA9IC4vbGlu ay5zaA0KPiAgTUFOUEFHRSA9IC4vbWFucGFnZS5zaA0KPiBAQCAtMTQ4LDcgKzE0Nyw3IEBAIENQ UEZMQUdTNCA9ICQoQ1BQRkxBR1MzKSAtRF9QT1NJWF9DX1NPVVJDRT0yMDA4MDlMIC1EXw0KPiAg Q1BQRkxBR1M1ID0gJChDUFBGTEFHUzQpIC1EQkNfTlVNX0tBUkFUU1VCQV9MRU49JChCQ19OVU1f S0FSQVRTVUJBX0xFTikNCj4gIENQUEZMQUdTNiA9ICQoQ1BQRkxBR1M1KSAtREJDX0VOQUJMRV9O TFM9JChCQ19FTkFCTEVfTkxTKQ0KPiAtREJDX0VOQUJMRV9QUk9NUFQ9JChCQ19FTkFCTEVfUFJP TVBUKSBDUFBGTEFHUzcgPSAkKENQUEZMQUdTNikNCj4gLUQkKEJDX0VOQUJMRV9FWFRSQV9NQVRI X05BTUUpPSQoQkNfRU5BQkxFX0VYVFJBX01BVEgpIC1DUFBGTEFHUyA9ICQoQ1BQRkxBR1M3KQ0K PiAtREJDX0VOQUJMRV9ISVNUT1JZPSQoQkNfRU5BQkxFX0hJU1RPUlkpICtDUFBGTEFHUyA9ICQo Q1BQRkxBR1M3KQ0KPiAtREJDX0VOQUJMRV9ISVNUT1JZPSQoQkNfRU5BQkxFX0hJU1RPUlkpIC1E QkNfRU5BQkxFX0xJQlJBUlk9JChCQ19FTkFCTEVfTElCUkFSWSkgQ0ZMQUdTID0NCj4gJChDUFBG TEFHUykgJSVDUFBGTEFHUyUlICUlQ0ZMQUdTJSUgTERGTEFHUyA9ICUlTERGTEFHUyUlDQo+ICAN Cj4gQEAgLTE1NywyMSArMTU2LDI0IEBAIEhPU1RDRkxBR1MgPSAlJUhPU1RDRkxBR1MlJQ0KPiAg Q0MgPSAlJUNDJSUNCj4gIEhPU1RDQyA9ICUlSE9TVENDJSUNCj4gIA0KPiAtQkNfTElCX0NfQVJH UyA9IGJjX2xpYiBiYy5oIGJjX2xpYl9uYW1lICQoQkNfRU5BQkxFRF9OQU1FKSAxDQo+IC1CQ19M SUIyX0NfQVJHUyA9IGJjX2xpYjIgYmMuaCBiY19saWIyX25hbWUgIiQoQkNfRU5BQkxFRF9OQU1F KSAmJg0KPiAkKEJDX0VOQUJMRV9FWFRSQV9NQVRIX05BTUUpIiAxICtCQ19MSUJfQ19BUkdTID0g YmNfbGliIGJjX2xpYl9uYW1lICQoQkNfRU5BQkxFRF9OQU1FKSAxDQo+ICtCQ19MSUIyX0NfQVJH UyA9IGJjX2xpYjIgYmNfbGliMl9uYW1lICIkKEJDX0VOQUJMRURfTkFNRSkgJiYgJChCQ19FTkFC TEVfRVhUUkFfTUFUSF9OQU1FKSIgMQ0KPiAgDQo+IC1PQkpTMSA9ICQoT0JKKSAkKERDX09CSikg JChCQ19PQkopICQoSElTVE9SWV9PQkopICQoUkFORF9PQkopICQoQkNfSEVMUF9PKSAkKERDX0hF TFBfTykNCj4gLU9CSlMgPSAkKE9CSlMxKSAkKEJDX0xJQl9PKSAkKEJDX0xJQjJfTykgJChCQ19M SUIzX08pDQo+IC1PQkpfVEFSR0VUUzEgPSAkKERDX0hFTFBfTykgJChCQ19IRUxQX08pICQoQkNf TElCX08pICQoQkNfTElCMl9PKSAkKEJDX0xJQjNfTykNCj4gLU9CSl9UQVJHRVRTID0gJChPQkpf VEFSR0VUUzEpICQoQkNfT0JKKSAkKERDX09CSikgJChISVNUT1JZX09CSikgJChSQU5EX09CSikg JChPQkopDQo+ICtPQkpTID0gJChCQ19IRUxQX08pICQoRENfSEVMUF9PKSAkKEJDX0xJQl9PKSAk KEJDX0xJQjJfTykgJChPQkopDQo+ICtPQkpfVEFSR0VUUyA9ICQoRENfSEVMUF9PKSAkKEJDX0hF TFBfTykgJChCQ19MSUJfTykgJChCQ19MSUIyX08pICQoT0JKKQ0KPiAgDQo+ICAuYy5vOg0KPiAg CSQoQ0MpICQoQ0ZMQUdTKSAtbyAkQCAtYyAkPA0KPiAgDQo+IC1hbGw6IG1ha2VfYmluICQoT0JK X1RBUkdFVFMpDQo+ICthbGw6ICUlQUxMX1BSRVJFUSUlDQo+ICsNCj4gK2V4ZWNzOiBtYWtlX2Jp biAkKE9CSl9UQVJHRVRTKQ0KPiAgCSQoQ0MpICQoQ0ZMQUdTKSAkKE9CSlMpICQoTERGTEFHUykg LW8gJChFWEVDKQ0KPiAgCSUlTElOSyUlDQo+ICANCj4gK2xpYnJhcnk6IG1ha2VfYmluICQoT0JK KSAkKEJDX0xJQl9PKSAkKEJDX0xJQjJfTykNCj4gKwlhciAtciAtY3UgJChMSUJCQykgJChCQ19M SUJfTykgJChCQ19MSUIyX08pICQoT0JKKQ0KPiArDQo+ICAkKEdFTl9FWEVDKToNCj4gIAklJUdF Tl9FWEVDX1RBUkdFVCUlDQo+ICANCj4gQEAgLTE4MiwxMCArMTg0LDEwIEBAICQoQkNfTElCMl9D KTogJChHRU5fRVhFQykgJChCQ19MSUIyKQ0KPiAgCSQoR0VOX0VNVSkgJChHRU5fRVhFQykgJChC Q19MSUIyKSAkKEJDX0xJQjJfQykgJChCQ19MSUIyX0NfQVJHUykNCj4gIA0KPiAgJChCQ19IRUxQ X0MpOiAkKEdFTl9FWEVDKSAkKEJDX0hFTFApDQo+IC0JJChHRU5fRU1VKSAkKEdFTl9FWEVDKSAk KEJDX0hFTFApICQoQkNfSEVMUF9DKSBiY19oZWxwIGJjLmggIiIgJChCQ19FTkFCTEVEX05BTUUp DQo+ICsJJChHRU5fRU1VKSAkKEdFTl9FWEVDKSAkKEJDX0hFTFApICQoQkNfSEVMUF9DKSBiY19o ZWxwICIiICQoQkNfRU5BQkxFRF9OQU1FKQ0KPiAgDQo+ICAkKERDX0hFTFBfQyk6ICQoR0VOX0VY RUMpICQoRENfSEVMUCkNCj4gLQkkKEdFTl9FTVUpICQoR0VOX0VYRUMpICQoRENfSEVMUCkgJChE Q19IRUxQX0MpIGRjX2hlbHAgZGMuaCAiIiAkKERDX0VOQUJMRURfTkFNRSkNCj4gKwkkKEdFTl9F TVUpICQoR0VOX0VYRUMpICQoRENfSEVMUCkgJChEQ19IRUxQX0MpIGRjX2hlbHAgIiIgJChEQ19F TkFCTEVEX05BTUUpDQo+ICANCj4gIG1ha2VfYmluOg0KPiAgCSQoTUtESVIpIC1wICQoQklOKQ0K PiBAQCAtMjIyLDcgKzIyNCw3IEBAIGhlbHA6DQo+ICANCj4gIGNoZWNrOiB0ZXN0DQo+ICANCj4g LXRlc3Q6IHRlc3RfYmMgdGltZWNvbnN0IHRlc3RfZGMNCj4gK3Rlc3Q6ICUlVEVTVFMlJQ0KPiAg DQo+ICB0ZXN0X2JjOg0KPiAgCSUlQkNfVEVTVCUlDQo+IEBAIC0yNDEsNiArMjQzLDEyIEBAIHRp bWVfdGVzdF9kYzoNCj4gIHRpbWVjb25zdDoNCj4gIAklJVRJTUVDT05TVCUlDQo+ICANCj4gK2xp YnJhcnlfdGVzdDogbGlicmFyeQ0KPiArCSQoQ0MpICQoQ0ZMQUdTKSAkKEJDTF9URVNUX0MpICQo TElCQkMpIC1vICQoQkNMX1RFU1QpDQo+ICsNCj4gK3Rlc3RfbGlicmFyeTogbGlicmFyeV90ZXN0 DQo+ICsJJChCQ0xfVEVTVCkNCj4gKw0KPiAgdmFsZ3JpbmQ6IHZhbGdyaW5kX2JjIHZhbGdyaW5k X2RjDQo+ICANCj4gIHZhbGdyaW5kX2JjOg0KPiBAQCAtMjcyLDYgKzI4MCw3IEBAIGV4dHJhX21h dGg6DQo+ICBtYW5wYWdlczoNCj4gIAkkKE1BTlBBR0UpIGJjDQo+ICAJJChNQU5QQUdFKSBkYw0K PiArCSQoTUFOUEFHRSkgYmNsDQo+ICANCj4gIGNsZWFuX2dlbjoNCj4gIAlAJChSTSkgLWYgJChH RU5fRVhFQykNCj4gQEAgLTI3OSwxMCArMjg4LDYgQEAgY2xlYW5fZ2VuOg0KPiAgY2xlYW46JSVD TEVBTl9QUkVSRVFTJSUNCj4gIAlAcHJpbnRmICdDbGVhbmluZyBmaWxlcy4uLlxuJw0KPiAgCUAk KFJNKSAtZiAkKE9CSikNCj4gLQlAJChSTSkgLWYgJChCQ19PQkopDQo+IC0JQCQoUk0pIC1mICQo RENfT0JKKQ0KPiAtCUAkKFJNKSAtZiAkKEhJU1RPUllfT0JKKQ0KPiAtCUAkKFJNKSAtZiAkKFJB TkRfT0JKKQ0KPiAgCUAkKFJNKSAtZiAkKEJDX0VYRUMpDQo+ICAJQCQoUk0pIC1mICQoRENfRVhF QykNCj4gIAlAJChSTSkgLWZyICQoQklOKQ0KPiBAQCAtMzQzLDkgKzM0OCwyMCBAQCBpbnN0YWxs X2JjX21hbnBhZ2U6DQo+ICBpbnN0YWxsX2RjX21hbnBhZ2U6DQo+ICAJJChTQUZFX0lOU1RBTEwp ICQoTUFOUEFHRV9JTlNUQUxMX0FSR1MpICQoRENfTUFOUEFHRSkNCj4gJChERVNURElSKSQoTUFO MURJUikvJChEQ19NQU5QQUdFX05BTUUpIA0KPiAtaW5zdGFsbDolJUlOU1RBTExfTE9DQUxFU19Q UkVSRVFTJSUlJUlOU1RBTExfUFJFUkVRUyUlDQo+ICtpbnN0YWxsX2JjbF9tYW5wYWdlOg0KPiAr CSQoU0FGRV9JTlNUQUxMKSAkKE1BTlBBR0VfSU5TVEFMTF9BUkdTKSAkKEJDTF9NQU5QQUdFKQ0K PiAkKERFU1RESVIpJChNQU4zRElSKS8kKEJDTF9NQU5QQUdFX05BTUUpICsNCj4gK2luc3RhbGxf YmNsX2hlYWRlcjoNCj4gKwkkKFNBRkVfSU5TVEFMTCkgJChNQU5QQUdFX0lOU1RBTExfQVJHUykg JChCQ0xfSEVBREVSKQ0KPiAkKERFU1RESVIpJChJTkNMVURFRElSKS8kKEJDTF9IRUFERVJfTkFN RSkgKw0KPiAraW5zdGFsbF9leGVjczoNCj4gIAkkKElOU1RBTEwpICQoREVTVERJUikkKEJJTkRJ UikgIiQoRVhFQ19TVUZGSVgpIg0KPiAgDQo+ICtpbnN0YWxsX2xpYnJhcnk6DQo+ICsJJChTQUZF X0lOU1RBTEwpICQoQklOQVJZX0lOU1RBTExfQVJHUykgJChMSUJCQykgJChERVNURElSKSQoTElC RElSKS8kKExJQl9OQU1FKQ0KPiArDQo+ICtpbnN0YWxsOiUlSU5TVEFMTF9MT0NBTEVTX1BSRVJF UVMlJSUlSU5TVEFMTF9NQU5fUFJFUkVRUyUlJSVJTlNUQUxMX1BSRVJFUVMlJQ0KPiArDQo+ICB1 bmluc3RhbGxfbG9jYWxlczoNCj4gIAkkKExPQ0FMRV9VTklOU1RBTEwpICQoTkxTUEFUSCkgJChN QUlOX0VYRUMpICQoREVTVERJUikNCj4gIA0KPiBAQCAtMzYwLDUgKzM3NiwxNCBAQCB1bmluc3Rh bGxfZGNfbWFucGFnZToNCj4gIA0KPiAgdW5pbnN0YWxsX2RjOg0KPiAgCSQoUk0pIC1mICQoREVT VERJUikkKEJJTkRJUikvJChFWEVDX1BSRUZJWCkkKERDKSQoRVhFQ19TVUZGSVgpDQo+ICsNCj4g K3VuaW5zdGFsbF9saWJyYXJ5Og0KPiArCSQoUk0pIC1mICQoREVTVERJUikkKExJQkRJUikvJChM SUJfTkFNRSkNCj4gKw0KPiArdW5pbnN0YWxsX2JjbF9oZWFkZXI6DQo+ICsJJChSTSkgLWYgJChE RVNURElSKSQoSU5DTFVERURJUikvJChCQ0xfSEVBREVSX05BTUUpDQo+ICsNCj4gK3VuaW5zdGFs bF9iY2xfbWFucGFnZToNCj4gKwkkKFJNKSAtZiAkKERFU1RESVIpJChNQU4zRElSKS8kKEJDTF9N QU5QQUdFX05BTUUpDQo+ICANCj4gIHVuaW5zdGFsbDolJVVOSU5TVEFMTF9MT0NBTEVTX1BSRVJF UVMlJSUlVU5JTlNUQUxMX01BTl9QUkVSRVFTJSUlJVVOSU5TVEFMTF9QUkVSRVFTJSUNCj4gDQo+ IE1vZGlmaWVkOiBoZWFkL2NvbnRyaWIvYmMvTkVXUy5tZA0KPiA9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT0NCj4gLS0tIGhlYWQvY29udHJpYi9iYy9ORVdTLm1kCVRodSBOb3YgMjYgMTc6Mzc6MjcgMjAy MAkocjM2ODA3MSkNCj4gKysrIGhlYWQvY29udHJpYi9iYy9ORVdTLm1kCVRodSBOb3YgMjYgMTc6 Mzk6NTEgMjAyMAkocjM2ODA3MikNCj4gQEAgLTEsNSArMSwyMyBAQA0KPiAgIyBOZXdzDQo+ICAN Cj4gKyMjIDMuMi4wDQo+ICsNCj4gK1RoaXMgaXMgYSBwcm9kdWN0aW9uIHJlbGVhc2UgdGhhdCBo YXMgb25lIGJ1ZyBmaXggYW5kIGEgbWFqb3IgYWRkaXRpb24uDQo+ICsNCj4gK1RoZSBidWcgZml4 IHdhcyBhIG1pc3NpbmcgYGF1dG9gIHZhcmlhYmxlIGluIHRoZSBiZXNzZWwgYGooKWAgZnVuY3Rp b24gaW4gdGhlDQo+ICttYXRoIGxpYnJhcnkuDQo+ICsNCj4gK1RoZSBtYWpvciBhZGRpdGlvbiBp cyBhIHdheSB0byBidWlsZCBhIHZlcnNpb24gb2YgYGJjYCdzIG1hdGggY29kZSBhcyBhIGxpYnJh cnkuDQo+ICtUaGlzIGlzIGRvbmUgd2l0aCB0aGUgYC1hYCBvcHRpb24gdG8gYGNvbmZpZ3VyZS5z aGAuIFRoZSBBUEkgZm9yIHRoZSBsaWJyYXJ5IGNhbg0KPiArYmUgcmVhZCBpbiBgLi9tYW51YWxz L2JjbC4zLm1kYCBvciBgbWFuIGJjbGAgb25jZSB0aGUgbGlicmFyeSBpcyBpbnN0YWxsZWQgd2l0 aA0KPiArYG1ha2UgaW5zdGFsbGAuDQo+ICsNCj4gK1RoaXMgbGlicmFyeSB3YXMgcmVxdWVzdGVk IGJ5IGRldmVsb3BlcnMgYmVmb3JlIEkgZXZlbiBmaW5pc2hlZCB2ZXJzaW9uIDEuMCwgYnV0DQo+ ICtJIGNvdWxkIG5vdCBmaWd1cmUgb3V0IGhvdyB0byBkbyBpdCB1bnRpbCBub3cuDQo+ICsNCj4g K0lmIHRoZSBsaWJyYXJ5IGhhcyBBUEkgYnJlYWtpbmcgY2hhbmdlcywgdGhlIG1ham9yIHZlcnNp b24gb2YgYGJjYCB3aWxsIGJlDQo+ICtpbmNyZW1lbnRlZC4NCj4gKw0KPiAgIyMgMy4xLjYNCj4g IA0KPiAgVGhpcyBpcyBhIHByb2R1Y3Rpb24gcmVsZWFzZSB0aGF0IGZpeGVzIGEgbmV3IHdhcm5p bmcgZnJvbSBDbGFuZyAxMiBmb3IgRnJlZUJTRA0KPiANCj4gTW9kaWZpZWQ6IGhlYWQvY29udHJp Yi9iYy9SRUFETUUubWQNCj4gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQo+IC0tLSBoZWFkL2NvbnRy aWIvYmMvUkVBRE1FLm1kCVRodSBOb3YgMjYgMTc6Mzc6MjcgMjAyMAkocjM2ODA3MSkNCj4gKysr IGhlYWQvY29udHJpYi9iYy9SRUFETUUubWQJVGh1IE5vdiAyNiAxNzozOTo1MSAyMDIwCShyMzY4 MDcyKQ0KPiBAQCAtMTA3LDYgKzEwNywyMyBAQCBvdGhlciBsb2NhdGlvbnMsIHVzZSB0aGUgYFBS RUZJWGAgZW52aXJvbm1lbnQgdmFyaWFibGUNCj4gIGBjb25maWd1cmUuc2hgIG9yIHBhc3MgdGhl IGAtLXByZWZpeD08cHJlZml4PmAgb3B0aW9uIHRvIGBjb25maWd1cmUuc2hgLiBTZWUgdGhlDQo+ ICBbYnVpbGQgbWFudWFsXVs1XSwgb3IgcnVuIGAuL2NvbmZpZ3VyZS5zaCAtLWhlbHBgLCBmb3Ig bW9yZSBkZXRhaWxzLg0KPiAgDQo+ICsjIyMgTGlicmFyeQ0KPiArDQo+ICtUaGlzIGBiY2AgZG9l cyBwcm92aWRlIGEgd2F5IHRvIGJ1aWxkIGEgbWF0aCBsaWJyYXJ5IHdpdGggQyBiaW5kaW5ncy4g VGhpcyBpcw0KPiArZG9uZSBieSB0aGUgYC1hYCBvciBgLS1saWJyYXJ5YCBvcHRpb25zIHRvIGBj b25maWd1cmUuc2hgOg0KPiArDQo+ICtgYGANCj4gKy4vY29uZmlndXJlLnNoIC1hDQo+ICtgYGAN Cj4gKw0KPiArV2hlbiBidWlsZGluZyB0aGUgbGlicmFyeSwgdGhlIGV4ZWN1dGFibGVzIGFyZSBu b3QgYnVpbHQuIEZvciBtb3JlIGluZm9ybWF0aW9uLA0KPiArc2VlIHRoZSBbYnVpbGQgbWFudWFs XVs1XS4NCj4gKw0KPiArVGhlIGxpYnJhcnkgQVBJIGNhbiBiZSBmb3VuZCBpbiBbYG1hbnVhbHMv YmNsLjMubWRgXVsyNl0gb3IgYG1hbiBiY2xgIG9uY2UgdGhlDQo+ICtsaWJyYXJ5IGlzIGluc3Rh bGxlZC4NCj4gKw0KPiArVGhlIGxpYnJhcnkgaXMgYnVpbHQgYXMgYGJpbi9saWJiY2wuYWAuDQo+ ICsNCj4gICMjIyBQYWNrYWdlIGFuZCBEaXN0cm8gTWFpbnRhaW5lcnMNCj4gIA0KPiAgIyMjIyBS ZWNvbW1lbmRlZCBDb21waWxlcg0KPiBAQCAtMzM1LDMgKzM1Miw0IEBAIEZvbGRlcnM6DQo+ICBb MjNdOiBodHRwczovL3N2bndlYi5mcmVlYnNkLm9yZy9iYXNlL2hlYWQvY29udHJpYi9iYy8NCj4g IFsyNF06IGh0dHBzOi8vYnVncy5mcmVlYnNkLm9yZy8NCj4gIFsyNV06IGh0dHBzOi8vcmV2aWV3 cy5mcmVlYnNkLm9yZy8NCj4gK1syNl06IC4vbWFudWFscy9iY2wuMy5tZA0KPiANCj4gTW9kaWZp ZWQ6IGhlYWQvY29udHJpYi9iYy9jb25maWd1cmUuc2gNCj4gPT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 DQo+IC0tLSBoZWFkL2NvbnRyaWIvYmMvY29uZmlndXJlLnNoCVRodSBOb3YgMjYgMTc6Mzc6Mjcg MjAyMAkocjM2ODA3MSkNCj4gKysrIGhlYWQvY29udHJpYi9iYy9jb25maWd1cmUuc2gJVGh1IE5v diAyNiAxNzozOTo1MSAyMDIwCShyMzY4MDcyKQ0KPiBAQCAtNDUsMjIgKzQ1LDI3IEBAIHVzYWdl KCkgew0KPiAgCQlfdXNhZ2VfdmFsPTANCj4gIAlmaQ0KPiAgDQo+IC0JcHJpbnRmICd1c2FnZTog JXMgLWhcbicgIiRzY3JpcHQiDQo+IC0JcHJpbnRmICcgICAgICAgJXMgLS1oZWxwXG4nICIkc2Ny aXB0Ig0KPiAtCXByaW50ZiAnICAgICAgICVzIFstYkR8LWRCfC1jXSBbLUVmZ0dIbE1OUFRdIFst TyBPUFRfTEVWRUxdIFstayBLQVJBVFNVQkFfTEVOXVxuJw0KPiAiJHNjcmlwdCINCj4gLQlwcmlu dGYgJyAgICAgICAlcyBcXFxuJyAiJHNjcmlwdCINCj4gLQlwcmludGYgJyAgICAgICAgICAgWy0t YmMtb25seSAtLWRpc2FibGUtZGN8LS1kYy1vbmx5IC0tZGlzYWJsZS1iY3wtLWNvdmVyYWdlXQ0K PiBcXFxuJw0KPiAtCXByaW50ZiAnICAgICAgICAgICBbLS1kZWJ1ZyAtLWRpc2FibGUtZXh0cmEt bWF0aCAtLWRpc2FibGUtZ2VuZXJhdGVkLXRlc3RzXQ0KPiBcXFxuJw0KPiAtCXByaW50ZiAnICAg ICAgICAgICBbLS1kaXNhYmxlLWhpc3RvcnkgLS1kaXNhYmxlLW1hbi1wYWdlcyAtLWRpc2FibGUt bmxzXQ0KPiBcXFxuJw0KPiAtCXByaW50ZiAnICAgICAgICAgICBbLS1kaXNhYmxlLXByb21wdCAt LWRpc2FibGUtc3RyaXBdIFstLWluc3RhbGwtYWxsLWxvY2FsZXNdDQo+IFxcXG4nDQo+IC0JcHJp bnRmICcgICAgICAgICAgIFstLW9wdD1PUFRfTEVWRUxdIFstLWthcmF0c3ViYS1sZW49S0FSQVRT VUJBX0xFTl0NCj4gXFxcbicNCj4gLQlwcmludGYgJyAgICAgICAgICAgWy0tcHJlZml4PVBSRUZJ WF0gWy0tYmluZGlyPUJJTkRJUl0gWy0tZGF0YXJvb3RkaXI9REFUQVJPT1RESVJdDQo+IFxcXG4n DQo+IC0JcHJpbnRmICcgICAgICAgICAgIFstLWRhdGFkaXI9REFUQURJUl0gWy0tbWFuZGlyPU1B TkRJUl0gWy0tbWFuMWRpcj1NQU4xRElSXQ0KPiBcXFxuJw0KPiAtCXByaW50ZiAnICAgICAgICAg ICBbLS1mb3JjZV0NCj4gXFxcbicNCj4gKwlwcmludGYgJ3VzYWdlOlxuJw0KPiArCXByaW50ZiAn ICAgICVzIC1oXG4nICIkc2NyaXB0Ig0KPiArCXByaW50ZiAnICAgICVzIC0taGVscFxuJyAiJHNj cmlwdCINCj4gKwlwcmludGYgJyAgICAlcyBbLWF8LWJEfC1kQnwtY10gWy1FZmdHSGxNTlBUXSBb LU8gT1BUX0xFVkVMXSBbLWsgS0FSQVRTVUJBX0xFTl1cbicNCj4gIiRzY3JpcHQiDQo+ICsJcHJp bnRmICcgICAgJXMgXFxcbicgIiRzY3JpcHQiDQo+ICsJcHJpbnRmICcgICAgICAgWy0tbGlicmFy eXwtLWJjLW9ubHkgLS1kaXNhYmxlLWRjfC0tZGMtb25seQ0KPiAtLWRpc2FibGUtYmN8LS1jb3Zl cmFnZV1cXFxuJw0KPiArCXByaW50ZiAnICAgICAgIFstLWZvcmNlIC0tZGVidWcgLS1kaXNhYmxl LWV4dHJhLW1hdGggLS1kaXNhYmxlLWdlbmVyYXRlZC10ZXN0c10NCj4gXFxcbicNCj4gKwlwcmlu dGYgJyAgICAgICBbLS1kaXNhYmxlLWhpc3RvcnkgLS1kaXNhYmxlLW1hbi1wYWdlcyAtLWRpc2Fi bGUtbmxzXQ0KPiBcXFxuJw0KPiArCXByaW50ZiAnICAgICAgIFstLWRpc2FibGUtcHJvbXB0IC0t ZGlzYWJsZS1zdHJpcF0gWy0taW5zdGFsbC1hbGwtbG9jYWxlc10NCj4gXFxcbicNCj4gKwlwcmlu dGYgJyAgICAgICBbLS1vcHQ9T1BUX0xFVkVMXSBbLS1rYXJhdHN1YmEtbGVuPUtBUkFUU1VCQV9M RU5dDQo+IFxcXG4nDQo+ICsJcHJpbnRmICcgICAgICAgWy0tcHJlZml4PVBSRUZJWF0gWy0tYmlu ZGlyPUJJTkRJUl0gWy0tZGF0YXJvb3RkaXI9REFUQVJPT1RESVJdDQo+IFxcXG4nDQo+ICsJcHJp bnRmICcgICAgICAgWy0tZGF0YWRpcj1EQVRBRElSXSBbLS1tYW5kaXI9TUFORElSXSBbLS1tYW4x ZGlyPU1BTjFESVJdDQo+IFxcXG4nIHByaW50ZiAnXG4nDQo+ICsJcHJpbnRmICcgICAgLWEsIC0t bGlicmFyeVxuJw0KPiArCXByaW50ZiAnICAgICAgICBCdWlsZCB0aGUgbGliYmMgaW5zdGVhZCBv ZiB0aGUgcHJvZ3JhbXMuIFRoaXMgaXMgbWVhbnQgdG8gYmUgdXNlZA0KPiB3aXRoXG4nDQo+ICsJ cHJpbnRmICcgICAgICAgIE90aGVyIHNvZnR3YXJlIGxpa2UgcHJvZ3JhbW1pbmcgbGFuZ3VhZ2Vz IHRoYXQgd2FudCB0byBtYWtlIHVzZSBvZg0KPiB0aGVcbicNCj4gKwlwcmludGYgJyAgICAgICAg cGFyc2luZyBhbmQgbWF0aCBjYXBhYmlsaXRpZXMuIFRoaXMgb3B0aW9uIHdpbGwgaW5zdGFsbCBo ZWFkZXJzDQo+IHVzaW5nXG4nDQo+ICsJcHJpbnRmICcgICAgICAgIGBtYWtlIGluc3RhbGxgLlxu Jw0KPiAgCXByaW50ZiAnICAgIC1iLCAtLWJjLW9ubHlcbicNCj4gLQlwcmludGYgJyAgICAgICAg QnVpbGQgYmMgb25seS4gSXQgaXMgYW4gZXJyb3IgaWYgIi1kIiwgIi0tZGMtb25seSIsICItQiIs IG9yDQo+ICItLWRpc2FibGUtYmMiXG4nDQo+IC0JcHJpbnRmICcgICAgICAgIGFyZSBzcGVjaWZp ZWQgdG9vLlxuJw0KPiArCXByaW50ZiAnICAgICAgICBCdWlsZCBiYyBvbmx5LiBJdCBpcyBhbiBl cnJvciBpZiAiLWQiLCAiLS1kYy1vbmx5IiwgIi1CIiwgb3JcbicNCj4gKwlwcmludGYgJyAgICAg ICAgIi0tZGlzYWJsZS1iYyIgYXJlIHNwZWNpZmllZCB0b28uXG4nDQo+ICAJcHJpbnRmICcgICAg LUIsIC0tZGlzYWJsZS1iY1xuJw0KPiAgCXByaW50ZiAnICAgICAgICBEaXNhYmxlIGJjLiBJdCBp cyBhbiBlcnJvciBpZiAiLWIiLCAiLS1iYy1vbmx5IiwgIi1EIiwgb3INCj4gIi0tZGlzYWJsZS1k YyJcbicgcHJpbnRmICcgICAgICAgIGFyZSBzcGVjaWZpZWQgdG9vLlxuJw0KPiBAQCAtNjksMTAg Kzc0LDEwIEBAIHVzYWdlKCkgew0KPiAgCXByaW50ZiAnICAgICAgICBJdCBpcyBhbiBlcnJvciBp ZiBlaXRoZXIgIi1iIiAoIi1EIikgb3IgIi1kIiAoIi1CIikgaXMgc3BlY2lmaWVkLlxuJw0KPiAg CXByaW50ZiAnICAgICAgICBSZXF1aXJlcyBhIGNvbXBpbGVyIHRoYXQgdXNlIGdjYy1jb21wYXRp YmxlIGNvdmVyYWdlIG9wdGlvbnNcbicNCj4gIAlwcmludGYgJyAgICAtZCwgLS1kYy1vbmx5XG4n DQo+IC0JcHJpbnRmICcgICAgICAgIEJ1aWxkIGRjIG9ubHkuIEl0IGlzIGFuIGVycm9yIGlmICIt YiIsICItLWJjLW9ubHkiLCAiLUQiLCBvcg0KPiAiLS1kaXNhYmxlLWRjIlxuJw0KPiAtCXByaW50 ZiAnICAgICAgICBhcmUgc3BlY2lmaWVkIHRvby5cbicNCj4gKwlwcmludGYgJyAgICAgICAgQnVp bGQgZGMgb25seS4gSXQgaXMgYW4gZXJyb3IgaWYgIi1iIiwgIi0tYmMtb25seSIsICItRCIsIG9y XG4nDQo+ICsJcHJpbnRmICcgICAgICAgICItLWRpc2FibGUtZGMiIGFyZSBzcGVjaWZpZWQgdG9v LlxuJw0KPiAgCXByaW50ZiAnICAgIC1ELCAtLWRpc2FibGUtZGNcbicNCj4gLQlwcmludGYgJyAg ICAgICAgRGlzYWJsZSBkYy4gSXQgaXMgYW4gZXJyb3IgaWYgIi1kIiwgIi0tZGMtb25seSIgIi1C Iiwgb3INCj4gIi0tZGlzYWJsZS1iYyJcbicNCj4gKwlwcmludGYgJyAgICAgICAgRGlzYWJsZSBk Yy4gSXQgaXMgYW4gZXJyb3IgaWYgIi1kIiwgIi0tZGMtb25seSIsICItQiIsIG9yDQo+ICItLWRp c2FibGUtYmMiXG4nIHByaW50ZiAnICAgICAgICBhcmUgc3BlY2lmaWVkIHRvby5cbicNCj4gIAlw cmludGYgJyAgICAtRSwgLS1kaXNhYmxlLWV4dHJhLW1hdGhcbicNCj4gIAlwcmludGYgJyAgICAg ICAgRGlzYWJsZSBleHRyYSBtYXRoLiBUaGlzIGluY2x1ZGVzOiAiJCIgb3BlcmF0b3IgKHRydW5j YXRlIHRvDQo+IGludGVnZXIpLFxuJyBAQCAtMTIyLDggKzEyNywxNCBAQCB1c2FnZSgpIHsNCj4g IAlwcmludGYgJyAgICAgICAgSWYgUFJFRklYIGlzICIvdXNyIiwgaW5zdGFsbCBwYXRoIHdpbGwg YmUgIi91c3IvYmluIi5cbicNCj4gIAlwcmludGYgJyAgICAgICAgRGVmYXVsdCBpcyAiL3Vzci9s b2NhbCIuXG4nDQo+ICAJcHJpbnRmICcgICAgLS1iaW5kaXIgQklORElSXG4nDQo+IC0JcHJpbnRm ICcgICAgICAgIFRoZSBkaXJlY3RvcnkgdG8gaW5zdGFsbCBiaW5hcmllcy4gT3ZlcnJpZGVzICIk QklORElSIiBpZiBpdA0KPiBleGlzdHMuXG4nDQo+ICsJcHJpbnRmICcgICAgICAgIFRoZSBkaXJl Y3RvcnkgdG8gaW5zdGFsbCBiaW5hcmllcyBpbi4gT3ZlcnJpZGVzICIkQklORElSIiBpZiBpdA0K PiBleGlzdHMuXG4nIHByaW50ZiAnICAgICAgICBEZWZhdWx0IGlzICIkUFJFRklYL2JpbiIuXG4n DQo+ICsJcHJpbnRmICcgICAgLS1pbmNsdWRlZGlyIElOQ0xVREVESVJcbicNCj4gKwlwcmludGYg JyAgICAgICAgVGhlIGRpcmVjdG9yeSB0byBpbnN0YWxsIGhlYWRlcnMgaW4uIE92ZXJyaWRlcyAi JElOQ0xVREVESVIiIGlmDQo+IGl0XG4nDQo+ICsJcHJpbnRmICcgICAgICAgIGV4aXN0cy4gRGVm YXVsdCBpcyAiJFBSRUZJWC9pbmNsdWRlIi5cbicNCj4gKwlwcmludGYgJyAgICAtLWxpYmRpciBM SUJESVJcbicNCj4gKwlwcmludGYgJyAgICAgICAgVGhlIGRpcmVjdG9yeSB0byBpbnN0YWxsIGxp YnJhcmllcyBpbi4gT3ZlcnJpZGVzICIkTElCRElSIiBpZiBpdA0KPiBleGlzdHMuXG4nDQo+ICsJ cHJpbnRmICcgICAgICAgIERlZmF1bHQgaXMgIiRQUkVGSVgvbGliIi5cbicNCj4gIAlwcmludGYg JyAgICAtLWRhdGFyb290ZGlyIERBVEFST09URElSXG4nDQo+ICAJcHJpbnRmICcgICAgICAgIFRo ZSByb290IGxvY2F0aW9uIGZvciBkYXRhIGZpbGVzLiBPdmVycmlkZXMgIiREQVRBUk9PVERJUiIg aWYgaXQNCj4gZXhpc3RzLlxuJyBwcmludGYgJyAgICAgICAgRGVmYXVsdCBpcyAiJFBSRUZJWC9z aGFyZSIuXG4nDQo+IEBAIC0xMzYsNiArMTQ3LDkgQEAgdXNhZ2UoKSB7DQo+ICAJcHJpbnRmICcg ICAgLS1tYW4xZGlyIE1BTjFESVJcbicNCj4gIAlwcmludGYgJyAgICAgICAgVGhlIGxvY2F0aW9u IHRvIGluc3RhbGwgU2VjdGlvbiAxIG1hbnBhZ2VzIHRvLiBPdmVycmlkZXMgIiRNQU4xRElSIg0K PiBpZlxuJyBwcmludGYgJyAgICAgICAgaXQgZXhpc3RzLiBEZWZhdWx0IGlzICIkTUFORElSL21h bjEiLlxuJw0KPiArCXByaW50ZiAnICAgIC0tbWFuM2RpciBNQU4zRElSXG4nDQo+ICsJcHJpbnRm ICcgICAgICAgIFRoZSBsb2NhdGlvbiB0byBpbnN0YWxsIFNlY3Rpb24gMyBtYW5wYWdlcyB0by4g T3ZlcnJpZGVzICIkTUFOM0RJUiINCj4gaWZcbicNCj4gKwlwcmludGYgJyAgICAgICAgaXQgZXhp c3RzLiBEZWZhdWx0IGlzICIkTUFORElSL21hbjMiLlxuJw0KPiAgCXByaW50ZiAnXG4nDQo+ICAJ cHJpbnRmICdJbiBhZGRpdGlvbiwgdGhlIGZvbGxvd2luZyBlbnZpcm9ubWVudCB2YXJpYWJsZXMg YXJlIHVzZWQ6XG4nDQo+ICAJcHJpbnRmICdcbicNCj4gQEAgLTE1NywxMiArMTcxLDE4IEBAIHVz YWdlKCkgew0KPiAgCXByaW50ZiAnICAgIExERkxBR1MgICAgICBMaW5rZXIgZmxhZ3MuIERlZmF1 bHQgaXMgIiIuXG4nDQo+ICAJcHJpbnRmICcgICAgUFJFRklYICAgICAgIFRoZSBwcmVmaXggdG8g aW5zdGFsbCB0by4gRGVmYXVsdCBpcyAiL3Vzci9sb2NhbCIuXG4nDQo+ICAJcHJpbnRmICcgICAg ICAgICAgICAgICAgIElmIFBSRUZJWCBpcyAiL3VzciIsIGluc3RhbGwgcGF0aCB3aWxsIGJlICIv dXNyL2JpbiIuXG4nDQo+IC0JcHJpbnRmICcgICAgQklORElSICAgICAgIFRoZSBkaXJlY3Rvcnkg dG8gaW5zdGFsbCBiaW5hcmllcy4gRGVmYXVsdCBpcw0KPiAiJFBSRUZJWC9iaW4iLlxuJw0KPiAr CXByaW50ZiAnICAgIEJJTkRJUiAgICAgICBUaGUgZGlyZWN0b3J5IHRvIGluc3RhbGwgYmluYXJp ZXMgaW4uIERlZmF1bHQgaXMNCj4gIiRQUkVGSVgvYmluIi5cbicNCj4gKwlwcmludGYgJyAgICBJ TkNMVURFRElSICAgVGhlIGRpcmVjdG9yeSB0byBpbnN0YWxsIGhlYWRlciBmaWxlcyBpbi4gRGVm YXVsdCBpc1xuJw0KPiArCXByaW50ZiAnICAgICAgICAgICAgICAgICAiJFBSRUZJWC9pbmNsdWRl Ii5cbicNCj4gKwlwcmludGYgJyAgICBMSUJESVIgICAgICAgVGhlIGRpcmVjdG9yeSB0byBpbnN0 YWxsIGxpYnJhcmllcyBpbi4gRGVmYXVsdCBpc1xuJw0KPiArCXByaW50ZiAnICAgICAgICAgICAg ICAgICAiJFBSRUZJWC9saWIiLlxuJw0KPiAgCXByaW50ZiAnICAgIERBVEFST09URElSICBUaGUg cm9vdCBsb2NhdGlvbiBmb3IgZGF0YSBmaWxlcy4gRGVmYXVsdCBpcw0KPiAiJFBSRUZJWC9zaGFy ZSIuXG4nIHByaW50ZiAnICAgIERBVEFESVIgICAgICBUaGUgbG9jYXRpb24gZm9yIGRhdGEgZmls ZXMuIERlZmF1bHQgaXMNCj4gIiREQVRBUk9PVERJUiIuXG4nIHByaW50ZiAnICAgIE1BTkRJUiAg ICAgICBUaGUgbG9jYXRpb24gdG8gaW5zdGFsbCBtYW5wYWdlcyB0by4gRGVmYXVsdCBpcw0KPiAi JERBVEFESVIvbWFuIi5cbicgcHJpbnRmICcgICAgTUFOMURJUiAgICAgIFRoZSBsb2NhdGlvbiB0 byBpbnN0YWxsIFNlY3Rpb24gMSBtYW5wYWdlcyB0by4NCj4gRGVmYXVsdCBpc1xuJyBwcmludGYg JyAgICAgICAgICAgICAgICAgIiRNQU5ESVIvbWFuMSIuXG4nDQo+ICsJcHJpbnRmICcgICAgTUFO M0RJUiAgICAgIFRoZSBsb2NhdGlvbiB0byBpbnN0YWxsIFNlY3Rpb24gMyBtYW5wYWdlcyB0by4g RGVmYXVsdA0KPiBpc1xuJw0KPiArCXByaW50ZiAnICAgICAgICAgICAgICAgICAiJE1BTkRJUi9t YW4zIi5cbicNCj4gIAlwcmludGYgJyAgICBOTFNQQVRIICAgICAgVGhlIGxvY2F0aW9uIHRvIGlu c3RhbGwgbG9jYWxlIGNhdGFsb2dzIHRvLiBNdXN0IGJlIGFuDQo+IGFic29sdXRlXG4nIHByaW50 ZiAnICAgICAgICAgICAgICAgICBwYXRoIChvciBjb250YWluIG9uZSkuIFRoaXMgaXMgdHJlYXRl ZCB0aGUgc2FtZSBhcyB0aGUNCj4gUE9TSVhcbicgcHJpbnRmICcgICAgICAgICAgICAgICAgIGRl ZmluaXRpb24gb2YgJE5MU1BBVEggKHNlZSBQT1NJWCBlbnZpcm9ubWVudCB2YXJpYWJsZXMNCj4g Zm9yXG4nIEBAIC0yNTcsNTYgKzI3Nyw1NSBAQCByZXBsYWNlKCkgew0KPiAgCXN1YnN0cmluZ19y ZXBsYWNlICIkX3JlcGxhY2Vfc3RyIiAiJSUkX3JlcGxhY2VfbmVlZGxlJSUiICIkX3JlcGxhY2Vf cmVwbGFjZW1lbnQiDQo+ICB9DQo+ICANCj4gLWdlbl9maWxlX2xpc3RzKCkgew0KPiArZ2VuX2Zp bGVfbGlzdCgpIHsNCj4gIA0KPiAtCWlmIFsgIiQjIiAtbHQgMyBdOyB0aGVuDQo+ICsJaWYgWyAi JCMiIC1sdCAxIF07IHRoZW4NCj4gIAkJZXJyX2V4aXQgIkludmFsaWQgbnVtYmVyIG9mIGFyZ3Mg dG8gJDAiDQo+ICAJZmkNCj4gIA0KPiAtCV9nZW5fZmlsZV9saXN0c19jb250ZW50cz0iJDEiDQo+ ICsJX2dlbl9maWxlX2xpc3RfY29udGVudHM9IiQxIg0KPiAgCXNoaWZ0DQo+ICANCj4gLQlfZ2Vu X2ZpbGVfbGlzdHNfZmlsZWRpcj0iJDEiDQo+IC0Jc2hpZnQNCj4gKwlwPSQocHdkKQ0KPiAgDQo+ IC0JX2dlbl9maWxlX2xpc3RzX3R5cD0iJDEiDQo+IC0Jc2hpZnQNCj4gKwljZCAiJHNjcmlwdGRp ciINCj4gIA0KPiAtCSMgSWYgdGhlcmUgaXMgYW4gZXh0cmEgYXJndW1lbnQsIGFuZCBpdA0KPiAt CSMgaXMgemVybywgd2Uga2VlcCB0aGUgZmlsZSBsaXN0cyBlbXB0eS4NCj4gLQlpZiBbICIkIyIg LWd0IDAgXTsgdGhlbg0KPiAtCQlfZ2VuX2ZpbGVfbGlzdHNfdXNlPSIkMSINCj4gKwlpZiBbICIk IyIgLWdlIDEgXTsgdGhlbg0KPiArDQo+ICsJCXdoaWxlIFsgIiQjIiAtZ2UgMSBdOyBkbw0KPiAr CQkJYT0iJDEiDQo+ICsJCQlzaGlmdA0KPiArCQkJYXJncz0iJGFyZ3MgISAtd2hvbGVuYW1lIHNy Yy8ke2F9Ig0KPiArCQlkb25lDQo+ICsNCj4gIAllbHNlDQo+IC0JCV9nZW5fZmlsZV9saXN0c191 c2U9IjEiDQo+ICsJCWFyZ3M9Ii1wcmludCINCj4gIAlmaQ0KPiAgDQo+IC0JX2dlbl9maWxlX2xp c3RzX25lZWRsZV9zcmM9IiR7X2dlbl9maWxlX2xpc3RzX3R5cH1TUkMiDQo+IC0JX2dlbl9maWxl X2xpc3RzX25lZWRsZV9vYmo9IiR7X2dlbl9maWxlX2xpc3RzX3R5cH1PQkoiDQo+IC0JX2dlbl9m aWxlX2xpc3RzX25lZWRsZV9nY2RhPSIke19nZW5fZmlsZV9saXN0c190eXB9R0NEQSINCj4gLQlf Z2VuX2ZpbGVfbGlzdHNfbmVlZGxlX2djbm89IiR7X2dlbl9maWxlX2xpc3RzX3R5cH1HQ05PIg0K PiArCV9nZW5fZmlsZV9saXN0X25lZWRsZV9zcmM9IlNSQyINCj4gKwlfZ2VuX2ZpbGVfbGlzdF9u ZWVkbGVfb2JqPSJPQkoiDQo+ICsJX2dlbl9maWxlX2xpc3RfbmVlZGxlX2djZGE9IkdDREEiDQo+ ICsJX2dlbl9maWxlX2xpc3RfbmVlZGxlX2djbm89IkdDTk8iDQo+ICANCj4gLQlpZiBbICIkX2dl bl9maWxlX2xpc3RzX3VzZSIgLW5lIDAgXTsgdGhlbg0KPiArCV9nZW5fZmlsZV9saXN0X3JlcGxh Y2VtZW50PSQoZmluZCBzcmMvIC1kZXB0aCAtbmFtZSAiKi5jIiAkYXJncyB8IHRyICdcbicgJyAn KQ0KPiArCV9nZW5fZmlsZV9saXN0X2NvbnRlbnRzPSQocmVwbGFjZSAiJF9nZW5fZmlsZV9saXN0 X2NvbnRlbnRzIiBcDQo+ICsJCSIkX2dlbl9maWxlX2xpc3RfbmVlZGxlX3NyYyIgIiRfZ2VuX2Zp bGVfbGlzdF9yZXBsYWNlbWVudCIpDQo+ICANCj4gLQkJX2dlbl9maWxlX2xpc3RzX3JlcGxhY2Vt ZW50PSQoY2QgIiRfZ2VuX2ZpbGVfbGlzdHNfZmlsZWRpciIgJiYgZmluZCAuICENCj4gLW5hbWUg LiAtcHJ1bmUgLW5hbWUgIiouYyIgfCBjdXQgLWQvIC1mMiB8IHNlZCAic0BeQCRfZ2VuX2ZpbGVf bGlzdHNfZmlsZWRpci9AZyIgfCB0ciAnXG4nICcNCj4gJykNCj4gLQkJX2dlbl9maWxlX2xpc3Rz X2NvbnRlbnRzPSQocmVwbGFjZSAiJF9nZW5fZmlsZV9saXN0c19jb250ZW50cyINCj4gIiRfZ2Vu X2ZpbGVfbGlzdHNfbmVlZGxlX3NyYyIgIiRfZ2VuX2ZpbGVfbGlzdHNfcmVwbGFjZW1lbnQiKQ0K PiArCV9nZW5fZmlsZV9saXN0X3JlcGxhY2VtZW50PSQocmVwbGFjZV9leHRzICIkX2dlbl9maWxl X2xpc3RfcmVwbGFjZW1lbnQiICJjIiAibyIpDQo+ICsJX2dlbl9maWxlX2xpc3RfY29udGVudHM9 JChyZXBsYWNlICIkX2dlbl9maWxlX2xpc3RfY29udGVudHMiIFwNCj4gKwkJIiRfZ2VuX2ZpbGVf bGlzdF9uZWVkbGVfb2JqIiAiJF9nZW5fZmlsZV9saXN0X3JlcGxhY2VtZW50IikNCj4gIA0KPiAt CQlfZ2VuX2ZpbGVfbGlzdHNfcmVwbGFjZW1lbnQ9JChyZXBsYWNlX2V4dHMgIiRfZ2VuX2ZpbGVf bGlzdHNfcmVwbGFjZW1lbnQiDQo+ICJjIiAibyIpDQo+IC0JCV9nZW5fZmlsZV9saXN0c19jb250 ZW50cz0kKHJlcGxhY2UgIiRfZ2VuX2ZpbGVfbGlzdHNfY29udGVudHMiDQo+ICIkX2dlbl9maWxl X2xpc3RzX25lZWRsZV9vYmoiICIkX2dlbl9maWxlX2xpc3RzX3JlcGxhY2VtZW50IikNCj4gKwlf Z2VuX2ZpbGVfbGlzdF9yZXBsYWNlbWVudD0kKHJlcGxhY2VfZXh0cyAiJF9nZW5fZmlsZV9saXN0 X3JlcGxhY2VtZW50IiAibyIgImdjZGEiKQ0KPiArCV9nZW5fZmlsZV9saXN0X2NvbnRlbnRzPSQo cmVwbGFjZSAiJF9nZW5fZmlsZV9saXN0X2NvbnRlbnRzIiBcDQo+ICsJCSIkX2dlbl9maWxlX2xp c3RfbmVlZGxlX2djZGEiICIkX2dlbl9maWxlX2xpc3RfcmVwbGFjZW1lbnQiKQ0KPiAgDQo+IC0J CV9nZW5fZmlsZV9saXN0c19yZXBsYWNlbWVudD0kKHJlcGxhY2VfZXh0cyAiJF9nZW5fZmlsZV9s aXN0c19yZXBsYWNlbWVudCINCj4gIm8iICJnY2RhIikNCj4gLQkJX2dlbl9maWxlX2xpc3RzX2Nv bnRlbnRzPSQocmVwbGFjZSAiJF9nZW5fZmlsZV9saXN0c19jb250ZW50cyINCj4gIiRfZ2VuX2Zp bGVfbGlzdHNfbmVlZGxlX2djZGEiICIkX2dlbl9maWxlX2xpc3RzX3JlcGxhY2VtZW50IikNCj4g KwlfZ2VuX2ZpbGVfbGlzdF9yZXBsYWNlbWVudD0kKHJlcGxhY2VfZXh0cyAiJF9nZW5fZmlsZV9s aXN0X3JlcGxhY2VtZW50IiAiZ2NkYSINCj4gImdjbm8iKQ0KPiArCV9nZW5fZmlsZV9saXN0X2Nv bnRlbnRzPSQocmVwbGFjZSAiJF9nZW5fZmlsZV9saXN0X2NvbnRlbnRzIiBcDQo+ICsJCSIkX2dl bl9maWxlX2xpc3RfbmVlZGxlX2djbm8iICIkX2dlbl9maWxlX2xpc3RfcmVwbGFjZW1lbnQiKQ0K PiAgDQo+IC0JCV9nZW5fZmlsZV9saXN0c19yZXBsYWNlbWVudD0kKHJlcGxhY2VfZXh0cyAiJF9n ZW5fZmlsZV9saXN0c19yZXBsYWNlbWVudCINCj4gImdjZGEiICJnY25vIikNCj4gLQkJX2dlbl9m aWxlX2xpc3RzX2NvbnRlbnRzPSQocmVwbGFjZSAiJF9nZW5fZmlsZV9saXN0c19jb250ZW50cyIN Cj4gIiRfZ2VuX2ZpbGVfbGlzdHNfbmVlZGxlX2djbm8iICIkX2dlbl9maWxlX2xpc3RzX3JlcGxh Y2VtZW50IikNCj4gKwljZCAiJHAiDQo+ICANCj4gLQllbHNlDQo+IC0JCV9nZW5fZmlsZV9saXN0 c19jb250ZW50cz0kKHJlcGxhY2UgIiRfZ2VuX2ZpbGVfbGlzdHNfY29udGVudHMiDQo+ICIkX2dl bl9maWxlX2xpc3RzX25lZWRsZV9zcmMiICIiKQ0KPiAtCQlfZ2VuX2ZpbGVfbGlzdHNfY29udGVu dHM9JChyZXBsYWNlICIkX2dlbl9maWxlX2xpc3RzX2NvbnRlbnRzIg0KPiAiJF9nZW5fZmlsZV9s aXN0c19uZWVkbGVfb2JqIiAiIikNCj4gLQkJX2dlbl9maWxlX2xpc3RzX2NvbnRlbnRzPSQocmVw bGFjZSAiJF9nZW5fZmlsZV9saXN0c19jb250ZW50cyINCj4gIiRfZ2VuX2ZpbGVfbGlzdHNfbmVl ZGxlX2djZGEiICIiKQ0KPiAtCQlfZ2VuX2ZpbGVfbGlzdHNfY29udGVudHM9JChyZXBsYWNlICIk X2dlbl9maWxlX2xpc3RzX2NvbnRlbnRzIg0KPiAiJF9nZW5fZmlsZV9saXN0c19uZWVkbGVfZ2Nu byIgIiIpDQo+IC0JZmkNCj4gLQ0KPiAtCXByaW50ZiAnJXNcbicgIiRfZ2VuX2ZpbGVfbGlzdHNf Y29udGVudHMiDQo+ICsJcHJpbnRmICclc1xuJyAiJF9nZW5fZmlsZV9saXN0X2NvbnRlbnRzIg0K PiAgfQ0KPiAgDQo+ICBiY19vbmx5PTANCj4gQEAgLTMyNCwxMCArMzQzLDEyIEBAIHByb21wdD0x DQo+ICBmb3JjZT0wDQo+ICBzdHJpcF9iaW49MQ0KPiAgYWxsX2xvY2FsZXM9MA0KPiArbGlicmFy eT0wDQo+ICANCj4gLXdoaWxlIGdldG9wdHMgImJCY2RERWZnR2hIazpsTU5POlBTVC0iIG9wdDsg ZG8NCj4gK3doaWxlIGdldG9wdHMgImFiQmNkREVmZ0doSGs6bE1OTzpQU1QtIiBvcHQ7IGRvDQo+ ICANCj4gIAljYXNlICIkb3B0IiBpbg0KPiArCQlhKSBsaWJyYXJ5PTEgOzsNCj4gIAkJYikgYmNf b25seT0xIDs7DQo+ICAJCUIpIGRjX29ubHk9MSA7Ow0KPiAgCQljKSBjb3ZlcmFnZT0xIDs7DQo+ IEBAIC0zNTIsNiArMzczLDcgQEAgd2hpbGUgZ2V0b3B0cyAiYkJjZERFZmdHaEhrOmxNTk86UFNU LSIgb3B0OyBkbw0KPiAgCQkJTE9OR19PUFRBUkc9IiR7YXJnIyo9fSINCj4gIAkJCWNhc2UgJGFy ZyBpbg0KPiAgCQkJCWhlbHApIHVzYWdlIDs7DQo+ICsJCQkJbGlicmFyeSkgbGlicmFyeT0xIDs7 DQo+ICAJCQkJYmMtb25seSkgYmNfb25seT0xIDs7DQo+ICAJCQkJZGMtb25seSkgZGNfb25seT0x IDs7DQo+ICAJCQkJY292ZXJhZ2UpIGNvdmVyYWdlPTEgOzsNCj4gQEAgLTM3MSw2ICszOTMsMjAg QEAgd2hpbGUgZ2V0b3B0cyAiYkJjZERFZmdHaEhrOmxNTk86UFNULSIgb3B0OyBkbw0KPiAgCQkJ CQlmaQ0KPiAgCQkJCQlCSU5ESVI9IiQyIg0KPiAgCQkJCQlzaGlmdCA7Ow0KPiArCQkJCWluY2x1 ZGVkaXI9PyopIElOQ0xVREVESVI9IiRMT05HX09QVEFSRyIgOzsNCj4gKwkJCQlpbmNsdWRlZGly KQ0KPiArCQkJCQlpZiBbICIkIyIgLWx0IDIgXTsgdGhlbg0KPiArCQkJCQkJdXNhZ2UgIk5vIGFy Z3VtZW50IGdpdmVuIGZvciAnLS0kYXJnJw0KPiBvcHRpb24iDQo+ICsJCQkJCWZpDQo+ICsJCQkJ CUlOQ0xVREVESVI9IiQyIg0KPiArCQkJCQlzaGlmdCA7Ow0KPiArCQkJCWxpYmRpcj0/KikgTElC RElSPSIkTE9OR19PUFRBUkciIDs7DQo+ICsJCQkJbGliZGlyKQ0KPiArCQkJCQlpZiBbICIkIyIg LWx0IDIgXTsgdGhlbg0KPiArCQkJCQkJdXNhZ2UgIk5vIGFyZ3VtZW50IGdpdmVuIGZvciAnLS0k YXJnJw0KPiBvcHRpb24iDQo+ICsJCQkJCWZpDQo+ICsJCQkJCUxJQkRJUj0iJDIiDQo+ICsJCQkJ CXNoaWZ0IDs7DQo+ICAJCQkJZGF0YXJvb3RkaXI9PyopIERBVEFST09URElSPSIkTE9OR19PUFRB UkciIDs7DQo+ICAJCQkJZGF0YXJvb3RkaXIpDQo+ICAJCQkJCWlmIFsgIiQjIiAtbHQgMiBdOyB0 aGVuDQo+IEBAIC0zOTksNiArNDM1LDEzIEBAIHdoaWxlIGdldG9wdHMgImJCY2RERWZnR2hIazps TU5POlBTVC0iIG9wdDsgZG8NCj4gIAkJCQkJZmkNCj4gIAkJCQkJTUFOMURJUj0iJDIiDQo+ICAJ CQkJCXNoaWZ0IDs7DQo+ICsJCQkJbWFuM2Rpcj0/KikgTUFOM0RJUj0iJExPTkdfT1BUQVJHIiA7 Ow0KPiArCQkJCW1hbjNkaXIpDQo+ICsJCQkJCWlmIFsgIiQjIiAtbHQgMiBdOyB0aGVuDQo+ICsJ CQkJCQl1c2FnZSAiTm8gYXJndW1lbnQgZ2l2ZW4gZm9yICctLSRhcmcnDQo+IG9wdGlvbiINCj4g KwkJCQkJZmkNCj4gKwkJCQkJTUFOM0RJUj0iJDIiDQo+ICsJCQkJCXNoaWZ0IDs7DQo+ICAJCQkJ bG9jYWxlZGlyPT8qKSBMT0NBTEVESVI9IiRMT05HX09QVEFSRyIgOzsNCj4gIAkJCQlsb2NhbGVk aXIpDQo+ICAJCQkJCWlmIFsgIiQjIiAtbHQgMiBdOyB0aGVuDQo+IEBAIC00NTQsNiArNDk3LDEy IEBAIGlmIFsgIiRiY19vbmx5IiAtZXEgMSBdICYmIFsgIiRkY19vbmx5IiAtZXEgMSBdOyB0aGVu DQo+ICAJdXNhZ2UgIkNhbiBvbmx5IHNwZWNpZnkgb25lIG9mIC1iKC1EKSBvciAtZCgtQikiDQo+ ICBmaQ0KPiAgDQo+ICtpZiBbICIkbGlicmFyeSIgLW5lIDAgXTsgdGhlbg0KPiArCWlmIFsgIiRi Y19vbmx5IiAtZXEgMSBdIHx8IFsgIiRkY19vbmx5IiAtZXEgMSBdOyB0aGVuDQo+ICsJCXVzYWdl ICJNdXN0IG5vdCBzcGVjaWZ5IC1iKC1EKSBvciAtZCgtQikgd2hlbiBidWlsZGluZyB0aGUgbGli cmFyeSINCj4gKwlmaQ0KPiArZmkNCj4gKw0KPiAgY2FzZSAka2FyYXRzdWJhX2xlbiBpbg0KPiAg CSgqWyEwLTldKnwnJykgdXNhZ2UgIktBUkFUU1VCQV9MRU4gaXMgbm90IGEgbnVtYmVyIiA7Ow0K PiAgCSgqKSA7Ow0KPiBAQCAtNTI5LDYgKzU3OCw4IEBAIGxpbms9IkBwcmludGYgJ05vIGxpbmsg bmVjZXNzYXJ5XFxcXG4nIg0KPiAgbWFpbl9leGVjPSJCQyINCj4gIGV4ZWN1dGFibGU9IkJDX0VY RUMiDQo+ICANCj4gK3Rlc3RzPSJ0ZXN0X2JjIHRpbWVjb25zdCB0ZXN0X2RjIg0KPiArDQo+ICBi Y190ZXN0PSJAdGVzdHMvYWxsLnNoIGJjICRleHRyYV9tYXRoIDEgJGdlbmVyYXRlX3Rlc3RzIDAg XCQoQkNfRVhFQykiDQo+ICBiY190aW1lX3Rlc3Q9IkB0ZXN0cy9hbGwuc2ggYmMgJGV4dHJhX21h dGggMSAkZ2VuZXJhdGVfdGVzdHMgMSBcJChCQ19FWEVDKSINCj4gIA0KPiBAQCAtNTY3LDcgKzYx OCw4IEBAIGlmIFsgIiRiY19vbmx5IiAtZXEgMSBdOyB0aGVuDQo+ICAJZGNfdGltZV90ZXN0PSJA cHJpbnRmICdObyBkYyB0ZXN0cyB0byBydW5cXFxcbiciDQo+ICAJdmdfZGNfdGVzdD0iQHByaW50 ZiAnTm8gZGMgdGVzdHMgdG8gcnVuXFxcXG4nIg0KPiAgDQo+IC0JaW5zdGFsbF9wcmVyZXFzPSIg aW5zdGFsbF9iY19tYW5wYWdlIg0KPiArCWluc3RhbGxfcHJlcmVxcz0iIGluc3RhbGxfZXhlY3Mi DQo+ICsJaW5zdGFsbF9tYW5fcHJlcmVxcz0iIGluc3RhbGxfYmNfbWFucGFnZSINCj4gIAl1bmlu c3RhbGxfcHJlcmVxcz0iIHVuaW5zdGFsbF9iYyINCj4gIAl1bmluc3RhbGxfbWFuX3ByZXJlcXM9 IiB1bmluc3RhbGxfYmNfbWFucGFnZSINCj4gIA0KPiBAQCAtNTkwLDcgKzY0Miw4IEBAIGVsaWYg WyAiJGRjX29ubHkiIC1lcSAxIF07IHRoZW4NCj4gIA0KPiAgCXRpbWVjb25zdD0iQHByaW50ZiAn dGltZWNvbnN0IGNhbm5vdCBiZSBydW4gYmVjYXVzZSBiYyBpcyBub3QgYnVpbHRcXFxcbiciDQo+ ICANCj4gLQlpbnN0YWxsX3ByZXJlcXM9IiBpbnN0YWxsX2RjX21hbnBhZ2UiDQo+ICsJaW5zdGFs bF9wcmVyZXFzPSIgaW5zdGFsbF9leGVjcyINCj4gKwlpbnN0YWxsX21hbl9wcmVyZXFzPSIgaW5z dGFsbF9kY19tYW5wYWdlIg0KPiAgCXVuaW5zdGFsbF9wcmVyZXFzPSIgdW5pbnN0YWxsX2RjIg0K PiAgCXVuaW5zdGFsbF9tYW5fcHJlcmVxcz0iIHVuaW5zdGFsbF9kY19tYW5wYWdlIg0KPiAgDQo+ IEBAIC02MDYsOSArNjU5LDE4IEBAIGVsc2UNCj4gIAlrYXJhdHN1YmE9IkBcJChLQVJBVFNVQkEp IDMwIDAgXCQoQkNfRVhFQykiDQo+ICAJa2FyYXRzdWJhX3Rlc3Q9IkBcJChLQVJBVFNVQkEpIDEg MTAwIFwkKEJDX0VYRUMpIg0KPiAgDQo+IC0JaW5zdGFsbF9wcmVyZXFzPSIgaW5zdGFsbF9iY19t YW5wYWdlIGluc3RhbGxfZGNfbWFucGFnZSINCj4gLQl1bmluc3RhbGxfcHJlcmVxcz0iIHVuaW5z dGFsbF9iYyB1bmluc3RhbGxfZGMiDQo+IC0JdW5pbnN0YWxsX21hbl9wcmVyZXFzPSIgdW5pbnN0 YWxsX2JjX21hbnBhZ2UgdW5pbnN0YWxsX2RjX21hbnBhZ2UiDQo+ICsJaWYgWyAiJGxpYnJhcnki IC1lcSAwIF07IHRoZW4NCj4gKwkJaW5zdGFsbF9wcmVyZXFzPSIgaW5zdGFsbF9leGVjcyINCj4g KwkJaW5zdGFsbF9tYW5fcHJlcmVxcz0iIGluc3RhbGxfYmNfbWFucGFnZSBpbnN0YWxsX2RjX21h bnBhZ2UiDQo+ICsJCXVuaW5zdGFsbF9wcmVyZXFzPSIgdW5pbnN0YWxsX2JjIHVuaW5zdGFsbF9k YyINCj4gKwkJdW5pbnN0YWxsX21hbl9wcmVyZXFzPSIgdW5pbnN0YWxsX2JjX21hbnBhZ2UgdW5p bnN0YWxsX2RjX21hbnBhZ2UiDQo+ICsJZWxzZQ0KPiArCQlpbnN0YWxsX3ByZXJlcXM9IiBpbnN0 YWxsX2xpYnJhcnkgaW5zdGFsbF9iY2xfaGVhZGVyIg0KPiArCQlpbnN0YWxsX21hbl9wcmVyZXFz PSIgaW5zdGFsbF9iY2xfbWFucGFnZSINCj4gKwkJdW5pbnN0YWxsX3ByZXJlcXM9IiB1bmluc3Rh bGxfbGlicmFyeSB1bmluc3RhbGxfYmNsX2hlYWRlciINCj4gKwkJdW5pbnN0YWxsX21hbl9wcmVy ZXFzPSIgdW5pbnN0YWxsX2JjbF9tYW5wYWdlIg0KPiArCQl0ZXN0cz0idGVzdF9saWJyYXJ5Ig0K PiArCWZpDQo+ICANCj4gIGZpDQo+ICANCj4gQEAgLTY2NCw2ICs3MjYsMTQgQEAgaWYgWyAteiAi JHtCSU5ESVIrc2V0fSIgXTsgdGhlbg0KPiAgCUJJTkRJUj0iJFBSRUZJWC9iaW4iDQo+ICBmaQ0K PiAgDQo+ICtpZiBbIC16ICIke0lOQ0xVREVESVIrc2V0fSIgXTsgdGhlbg0KPiArCUlOQ0xVREVE SVI9IiRQUkVGSVgvaW5jbHVkZSINCj4gK2ZpDQo+ICsNCj4gK2lmIFsgLXogIiR7TElCRElSK3Nl dH0iIF07IHRoZW4NCj4gKwlMSUJESVI9IiRQUkVGSVgvbGliIg0KPiArZmkNCj4gKw0KPiAgaWYg WyAiJGluc3RhbGxfbWFucGFnZXMiIC1uZSAwIF0gfHwgWyAiJG5scyIgLW5lIDAgXTsgdGhlbg0K PiAgCWlmIFsgLXogIiR7REFUQVJPT1RESVIrc2V0fSIgXTsgdGhlbg0KPiAgCQlEQVRBUk9PVERJ Uj0iJFBSRUZJWC9zaGFyZSINCj4gQEAgLTY4NCwxMSArNzU0LDI1IEBAIGlmIFsgIiRpbnN0YWxs X21hbnBhZ2VzIiAtbmUgMCBdOyB0aGVuDQo+ICAJCU1BTjFESVI9IiRNQU5ESVIvbWFuMSINCj4g IAlmaQ0KPiAgDQo+ICsJaWYgWyAteiAiJHtNQU4zRElSK3NldH0iIF07IHRoZW4NCj4gKwkJTUFO M0RJUj0iJE1BTkRJUi9tYW4zIg0KPiArCWZpDQo+ICsNCj4gIGVsc2UNCj4gLQlpbnN0YWxsX3By ZXJlcXM9IiINCj4gKwlpbnN0YWxsX21hbl9wcmVyZXFzPSIiDQo+ICAJdW5pbnN0YWxsX21hbl9w cmVyZXFzPSIiDQo+ICBmaQ0KPiAgDQo+ICtpZiBbICIkbGlicmFyeSIgLW5lIDAgXTsgdGhlbg0K PiArCWV4dHJhX21hdGg9MQ0KPiArCW5scz0wDQo+ICsJaGlzdD0wDQo+ICsJcHJvbXB0PTANCj4g KwlBTExfUFJFUkVRPSJsaWJyYXJ5Ig0KPiArZWxzZQ0KPiArCUFMTF9QUkVSRVE9ImV4ZWNzIg0K PiArZmkNCj4gKw0KPiAgaWYgWyAiJG5scyIgLW5lIDAgXTsgdGhlbg0KPiAgDQo+ICAJc2V0ICtl DQo+IEBAIC03NzYsMTEgKzg2MCwxMSBAQCBpZiBbICIkaGlzdCIgLWVxIDEgXTsgdGhlbg0KPiAg CXByaW50ZiAnVGVzdGluZyBoaXN0b3J5Li4uXG4nDQo+ICANCj4gIAlmbGFncz0iLURCQ19FTkFC TEVfSElTVE9SWT0xIC1EQkNfRU5BQkxFRD0kYmMgLUREQ19FTkFCTEVEPSRkYyINCj4gLQlmbGFn cz0iJGZsYWdzIC1EQkNfRU5BQkxFX05MUz0kbmxzIg0KPiArCWZsYWdzPSIkZmxhZ3MgLURCQ19F TkFCTEVfTkxTPSRubHMgLURCQ19FTkFCTEVfTElCUkFSWT0wIg0KPiAgCWZsYWdzPSIkZmxhZ3Mg LURCQ19FTkFCTEVfRVhUUkFfTUFUSD0kZXh0cmFfbWF0aCAtSS4vaW5jbHVkZS8iDQo+ICAJZmxh Z3M9IiRmbGFncyAtRF9QT1NJWF9DX1NPVVJDRT0yMDA4MDlMIC1EX1hPUEVOX1NPVVJDRT03MDAi DQo+ICANCj4gLQkiJENDIiAkQ1BQRkxBR1MgJENGTEFHUyAkZmxhZ3MgLWMgInNyYy9oaXN0b3J5 L2hpc3RvcnkuYyIgLW8gIiRzY3JpcHRkaXIvaGlzdG9yeS5vIg0KPiA+IC9kZXYvbnVsbCAyPiYx DQo+ICsJIiRDQyIgJENQUEZMQUdTICRDRkxBR1MgJGZsYWdzIC1jICJzcmMvaGlzdG9yeS5jIiAt byAiJHNjcmlwdGRpci9oaXN0b3J5Lm8iID4NCj4gL2Rldi9udWxsIDI+JjEgDQo+ICAJZXJyPSIk PyINCj4gIA0KPiBAQCAtODA0LDcgKzg4OCwxMSBAQCBpZiBbICIkaGlzdCIgLWVxIDEgXTsgdGhl bg0KPiAgDQo+ICBmaQ0KPiAgDQo+IC1pZiBbICIkZXh0cmFfbWF0aCIgLWVxIDEgXSAmJiBbICIk YmMiIC1uZSAwIF07IHRoZW4NCj4gK2lmIFsgIiRsaWJyYXJ5IiAtZXEgMSBdOyB0aGVuDQo+ICsJ YmNfbGliPSIiDQo+ICtmaQ0KPiArDQo+ICtpZiBbICIkZXh0cmFfbWF0aCIgLWVxIDEgXSAmJiBb ICIkYmMiIC1uZSAwIF0gJiYgWyAiJGxpYnJhcnkiIC1lcSAwIF07IHRoZW4NCj4gIAlCQ19MSUIy X089IlwkKEdFTl9ESVIpL2xpYjIubyINCj4gIGVsc2UNCj4gIAlCQ19MSUIyX089IiINCj4gQEAg LTg0Niw2ICs5MzQsMzMgQEAgaWYgWyAiJG1hbnBhZ2VfYXJncyIgPSAiIiBdOyB0aGVuDQo+ICAJ bWFucGFnZV9hcmdzPSJBIg0KPiAgZmkNCj4gIA0KPiArdW5uZWVkZWQ9IiINCj4gKw0KPiAraWYg WyAiJGhpc3QiIC1lcSAwIF07IHRoZW4NCj4gKwl1bm5lZWRlZD0iJHVubmVlZGVkIGhpc3Rvcnku YyINCj4gK2ZpDQo+ICsNCj4gK2lmIFsgIiRiYyIgLWVxIDAgXTsgdGhlbg0KPiArCXVubmVlZGVk PSIkdW5uZWVkZWQgYmMuYyBiY19sZXguYyBiY19wYXJzZS5jIg0KPiArZmkNCj4gKw0KPiAraWYg WyAiJGRjIiAtZXEgMCBdOyB0aGVuDQo+ICsJdW5uZWVkZWQ9IiR1bm5lZWRlZCBkYy5jIGRjX2xl eC5jIGRjX3BhcnNlLmMiDQo+ICtmaQ0KPiArDQo+ICtpZiBbICIkZXh0cmFfbWF0aCIgLWVxIDAg XTsgdGhlbg0KPiArCXVubmVlZGVkPSIkdW5uZWVkZWQgcmFuZC5jIg0KPiArZmkNCj4gKw0KPiAr aWYgWyAiJGxpYnJhcnkiIC1uZSAwIF07IHRoZW4NCj4gKwl1bm5lZWRlZD0iJHVubmVlZGVkIGFy Z3MuYyBvcHQuYyByZWFkLmMgZmlsZS5jIG1haW4uYyINCj4gKwl1bm5lZWRlZD0iJHVubmVlZGVk IGxhbmcuYyBsZXguYyBwYXJzZS5jIHByb2dyYW0uYyINCj4gKwl1bm5lZWRlZD0iJHVubmVlZGVk IGJjLmMgYmNfbGV4LmMgYmNfcGFyc2UuYyINCj4gKwl1bm5lZWRlZD0iJHVubmVlZGVkIGRjLmMg ZGNfbGV4LmMgZGNfcGFyc2UuYyINCj4gK2Vsc2UNCj4gKwl1bm5lZWRlZD0iJHVubmVlZGVkIGxp YnJhcnkuYyINCj4gK2ZpDQo+ICsNCj4gICMgUHJpbnQgb3V0IHRoZSB2YWx1ZXM7IHRoaXMgaXMg Zm9yIGRlYnVnZ2luZy4NCj4gIGlmIFsgIiRiYyIgLW5lIDAgXTsgdGhlbg0KPiAgCXByaW50ZiAn QnVpbGRpbmcgYmNcbicNCj4gQEAgLTg1OCw2ICs5NzMsNyBAQCBlbHNlDQo+ICAJcHJpbnRmICdO b3QgYnVpbGRpbmcgZGNcbicNCj4gIGZpDQo+ICBwcmludGYgJ1xuJw0KPiArcHJpbnRmICdCQ19F TkFCTEVfTElCUkFSWT0lc1xuXG4nICIkbGlicmFyeSINCj4gIHByaW50ZiAnQkNfRU5BQkxFX0hJ U1RPUlk9JXNcbicgIiRoaXN0Ig0KPiAgcHJpbnRmICdCQ19FTkFCTEVfRVhUUkFfTUFUSD0lc1xu JyAiJGV4dHJhX21hdGgiDQo+ICBwcmludGYgJ0JDX0VOQUJMRV9OTFM9JXNcbicgIiRubHMiDQo+ IEBAIC04NzMsMTAgKzk4OSwxMyBAQCBwcmludGYgJ0NQUEZMQUdTPSVzXG4nICIkQ1BQRkxBR1Mi DQo+ICBwcmludGYgJ0xERkxBR1M9JXNcbicgIiRMREZMQUdTIg0KPiAgcHJpbnRmICdQUkVGSVg9 JXNcbicgIiRQUkVGSVgiDQo+ICBwcmludGYgJ0JJTkRJUj0lc1xuJyAiJEJJTkRJUiINCj4gK3By aW50ZiAnSU5DTFVERURJUj0lc1xuJyAiJElOQ0xVREVESVIiDQo+ICtwcmludGYgJ0xJQkRJUj0l c1xuJyAiJExJQkRJUiINCj4gIHByaW50ZiAnREFUQVJPT1RESVI9JXNcbicgIiREQVRBUk9PVERJ UiINCj4gIHByaW50ZiAnREFUQURJUj0lc1xuJyAiJERBVEFESVIiDQo+ICBwcmludGYgJ01BTkRJ Uj0lc1xuJyAiJE1BTkRJUiINCj4gIHByaW50ZiAnTUFOMURJUj0lc1xuJyAiJE1BTjFESVIiDQo+ ICtwcmludGYgJ01BTjNESVI9JXNcbicgIiRNQU4zRElSIg0KPiAgcHJpbnRmICdOTFNQQVRIPSVz XG4nICIkTkxTUEFUSCINCj4gIHByaW50ZiAnRVhFQ1NVRkZJWD0lc1xuJyAiJEVYRUNTVUZGSVgi DQo+ICBwcmludGYgJ0VYRUNQUkVGSVg9JXNcbicgIiRFWEVDUFJFRklYIg0KPiBAQCAtODkyLDE2 ICsxMDExLDE3IEBAIHJlcGxhY2VtZW50PScqKiogV0FSTklORzogQXV0b2dlbmVyYXRlZCBmcm9t IE1ha2VmaWxlLg0KPiAgDQo+ICBjb250ZW50cz0kKHJlcGxhY2UgIiRjb250ZW50cyIgIiRuZWVk bGUiICIkcmVwbGFjZW1lbnQiKQ0KPiAgDQo+IC1jb250ZW50cz0kKGdlbl9maWxlX2xpc3RzICIk Y29udGVudHMiICIkc2NyaXB0ZGlyL3NyYyIgIiIpDQo+IC1jb250ZW50cz0kKGdlbl9maWxlX2xp c3RzICIkY29udGVudHMiICIkc2NyaXB0ZGlyL3NyYy9iYyIgIkJDXyIgIiRiYyIpDQo+IC1jb250 ZW50cz0kKGdlbl9maWxlX2xpc3RzICIkY29udGVudHMiICIkc2NyaXB0ZGlyL3NyYy9kYyIgIkRD XyIgIiRkYyIpDQo+IC1jb250ZW50cz0kKGdlbl9maWxlX2xpc3RzICIkY29udGVudHMiICIkc2Ny aXB0ZGlyL3NyYy9oaXN0b3J5IiAiSElTVE9SWV8iICIkaGlzdCIpDQo+IC1jb250ZW50cz0kKGdl bl9maWxlX2xpc3RzICIkY29udGVudHMiICIkc2NyaXB0ZGlyL3NyYy9yYW5kIiAiUkFORF8iICIk ZXh0cmFfbWF0aCIpDQo+ICtpZiBbICIkdW5uZWVkZWQiID0gIiIgXTsgdGhlbg0KPiArCWNvbnRl bnRzPSQoZ2VuX2ZpbGVfbGlzdCAiJGNvbnRlbnRzIiAibGlicmFyeS5jIikNCj4gK2Vsc2UNCj4g Kwljb250ZW50cz0kKGdlbl9maWxlX2xpc3QgIiRjb250ZW50cyIgJHVubmVlZGVkKQ0KPiArZmkN Cj4gIA0KPiAgY29udGVudHM9JChyZXBsYWNlICIkY29udGVudHMiICJCQ19FTkFCTEVEIiAiJGJj IikNCj4gIGNvbnRlbnRzPSQocmVwbGFjZSAiJGNvbnRlbnRzIiAiRENfRU5BQkxFRCIgIiRkYyIp DQo+ICBjb250ZW50cz0kKHJlcGxhY2UgIiRjb250ZW50cyIgIkxJTksiICIkbGluayIpDQo+ICAN Cj4gK2NvbnRlbnRzPSQocmVwbGFjZSAiJGNvbnRlbnRzIiAiTElCUkFSWSIgIiRsaWJyYXJ5IikN Cj4gIGNvbnRlbnRzPSQocmVwbGFjZSAiJGNvbnRlbnRzIiAiSElTVE9SWSIgIiRoaXN0IikNCj4g IGNvbnRlbnRzPSQocmVwbGFjZSAiJGNvbnRlbnRzIiAiRVhUUkFfTUFUSCIgIiRleHRyYV9tYXRo IikNCj4gIGNvbnRlbnRzPSQocmVwbGFjZSAiJGNvbnRlbnRzIiAiTkxTIiAiJG5scyIpDQo+IEBA IC05MTcsNyArMTAzNywxMCBAQCBjb250ZW50cz0kKHJlcGxhY2UgIiRjb250ZW50cyIgIkRFU1RE SVIiICIkZGVzdGRpciIpDQo+ICBjb250ZW50cz0kKHJlcGxhY2UgIiRjb250ZW50cyIgIkVYRUNT VUZGSVgiICIkRVhFQ1NVRkZJWCIpDQo+ICBjb250ZW50cz0kKHJlcGxhY2UgIiRjb250ZW50cyIg IkVYRUNQUkVGSVgiICIkRVhFQ1BSRUZJWCIpDQo+ICBjb250ZW50cz0kKHJlcGxhY2UgIiRjb250 ZW50cyIgIkJJTkRJUiIgIiRCSU5ESVIiKQ0KPiArY29udGVudHM9JChyZXBsYWNlICIkY29udGVu dHMiICJJTkNMVURFRElSIiAiJElOQ0xVREVESVIiKQ0KPiArY29udGVudHM9JChyZXBsYWNlICIk Y29udGVudHMiICJMSUJESVIiICIkTElCRElSIikNCj4gIGNvbnRlbnRzPSQocmVwbGFjZSAiJGNv bnRlbnRzIiAiTUFOMURJUiIgIiRNQU4xRElSIikNCj4gK2NvbnRlbnRzPSQocmVwbGFjZSAiJGNv bnRlbnRzIiAiTUFOM0RJUiIgIiRNQU4zRElSIikNCj4gIGNvbnRlbnRzPSQocmVwbGFjZSAiJGNv bnRlbnRzIiAiQ0ZMQUdTIiAiJENGTEFHUyIpDQo+ICBjb250ZW50cz0kKHJlcGxhY2UgIiRjb250 ZW50cyIgIkhPU1RDRkxBR1MiICIkSE9TVENGTEFHUyIpDQo+ICBjb250ZW50cz0kKHJlcGxhY2Ug IiRjb250ZW50cyIgIkNQUEZMQUdTIiAiJENQUEZMQUdTIikNCj4gQEAgLTkyNywxNSArMTA1MCwx OSBAQCBjb250ZW50cz0kKHJlcGxhY2UgIiRjb250ZW50cyIgIkhPU1RDQyIgIiRIT1NUQ0MiKQ0K PiAgY29udGVudHM9JChyZXBsYWNlICIkY29udGVudHMiICJDT1ZFUkFHRV9PVVRQVVQiICIkQ09W RVJBR0VfT1VUUFVUIikNCj4gIGNvbnRlbnRzPSQocmVwbGFjZSAiJGNvbnRlbnRzIiAiQ09WRVJB R0VfUFJFUkVRUyIgIiRDT1ZFUkFHRV9QUkVSRVFTIikNCj4gIGNvbnRlbnRzPSQocmVwbGFjZSAi JGNvbnRlbnRzIiAiSU5TVEFMTF9QUkVSRVFTIiAiJGluc3RhbGxfcHJlcmVxcyIpDQo+ICtjb250 ZW50cz0kKHJlcGxhY2UgIiRjb250ZW50cyIgIklOU1RBTExfTUFOX1BSRVJFUVMiICIkaW5zdGFs bF9tYW5fcHJlcmVxcyIpDQo+ICBjb250ZW50cz0kKHJlcGxhY2UgIiRjb250ZW50cyIgIklOU1RB TExfTE9DQUxFUyIgIiRpbnN0YWxsX2xvY2FsZXMiKQ0KPiAgY29udGVudHM9JChyZXBsYWNlICIk Y29udGVudHMiICJJTlNUQUxMX0xPQ0FMRVNfUFJFUkVRUyIgIiRpbnN0YWxsX2xvY2FsZXNfcHJl cmVxcyIpDQo+ICBjb250ZW50cz0kKHJlcGxhY2UgIiRjb250ZW50cyIgIlVOSU5TVEFMTF9NQU5f UFJFUkVRUyIgIiR1bmluc3RhbGxfbWFuX3ByZXJlcXMiKQ0KPiAgY29udGVudHM9JChyZXBsYWNl ICIkY29udGVudHMiICJVTklOU1RBTExfUFJFUkVRUyIgIiR1bmluc3RhbGxfcHJlcmVxcyIpDQo+ ICBjb250ZW50cz0kKHJlcGxhY2UgIiRjb250ZW50cyIgIlVOSU5TVEFMTF9MT0NBTEVTX1BSRVJF UVMiICIkdW5pbnN0YWxsX2xvY2FsZXNfcHJlcmVxcyIpDQo+ICANCj4gK2NvbnRlbnRzPSQocmVw bGFjZSAiJGNvbnRlbnRzIiAiQUxMX1BSRVJFUSIgIiRBTExfUFJFUkVRIikNCj4gKw0KPiAgY29u dGVudHM9JChyZXBsYWNlICIkY29udGVudHMiICJFWEVDVVRBQkxFUyIgIiRleGVjdXRhYmxlcyIp DQo+ICBjb250ZW50cz0kKHJlcGxhY2UgIiRjb250ZW50cyIgIk1BSU5fRVhFQyIgIiRtYWluX2V4 ZWMiKQ0KPiAgY29udGVudHM9JChyZXBsYWNlICIkY29udGVudHMiICJFWEVDIiAiJGV4ZWN1dGFi bGUiKQ0KPiArY29udGVudHM9JChyZXBsYWNlICIkY29udGVudHMiICJURVNUUyIgIiR0ZXN0cyIp DQo+ICANCj4gIGNvbnRlbnRzPSQocmVwbGFjZSAiJGNvbnRlbnRzIiAiQkNfVEVTVCIgIiRiY190 ZXN0IikNCj4gIGNvbnRlbnRzPSQocmVwbGFjZSAiJGNvbnRlbnRzIiAiQkNfVElNRV9URVNUIiAi JGJjX3RpbWVfdGVzdCIpDQo+IA0KPiBDb3BpZWQ6IGhlYWQvY29udHJpYi9iYy9leGVjLWluc3Rh bGwuc2ggKGZyb20gcjM2ODA2OSwgdmVuZG9yL2JjL2Rpc3QvZXhlYy1pbnN0YWxsLnNoKQ0KPiA9 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT0NCj4gLS0tIC9kZXYvbnVsbAkwMDowMDowMCAxOTcwCShlbXB0 eSwgYmVjYXVzZSBmaWxlIGlzIG5ld2x5IGFkZGVkKQ0KPiArKysgaGVhZC9jb250cmliL2JjL2V4 ZWMtaW5zdGFsbC5zaAlUaHUgTm92IDI2IDE3OjM5OjUxIDIwMjAJKHIzNjgwNzIsIGNvcHkgb2YN Cj4gcjM2ODA2OSwgdmVuZG9yL2JjL2Rpc3QvZXhlYy1pbnN0YWxsLnNoKSBAQCAtMCwwICsxLDYz IEBADQo+ICsjISAvYmluL3NoDQo+ICsjDQo+ICsjIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBC U0QtMi1DbGF1c2UNCj4gKyMNCj4gKyMgQ29weXJpZ2h0IChjKSAyMDE4LTIwMjAgR2F2aW4gRC4g SG93YXJkIGFuZCBjb250cmlidXRvcnMuDQo+ICsjDQo+ICsjIFJlZGlzdHJpYnV0aW9uIGFuZCB1 c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dA0KPiArIyBtb2Rp ZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRp dGlvbnMgYXJlIG1ldDoNCj4gKyMNCj4gKyMgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNv ZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodCBub3RpY2UsIHRoaXMNCj4gKyMgICBs aXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci4NCj4gKyMNCj4g KyMgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFi b3ZlIGNvcHlyaWdodCBub3RpY2UsDQo+ICsjICAgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5k IHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGUgZG9jdW1lbnRhdGlvbg0KPiArIyAgIGFu ZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLg0KPiAr Iw0KPiArIyBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVS UyBBTkQgQ09OVFJJQlVUT1JTICJBUyBJUyINCj4gKyMgQU5EIEFOWSBFWFBSRVNTIE9SIElNUExJ RUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRQ0KPiArIyBJ TVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBB UlRJQ1VMQVIgUFVSUE9TRQ0KPiArIyBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwg VEhFIENPUFlSSUdIVCBIT0xERVIgT1IgQ09OVFJJQlVUT1JTIEJFDQo+ICsjIExJQUJMRSBGT1Ig QU5ZIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IN Cj4gKyMgQ09OU0VRVUVOVElBTCBEQU1BR0VTIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBU TywgUFJPQ1VSRU1FTlQgT0YNCj4gKyMgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUzsgTE9T UyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTDQo+ICsjIElOVEVSUlVQVElP TikgSE9XRVZFUiBDQVVTRUQgQU5EIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVS IElODQo+ICsjIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUIChJTkNMVURJTkcg TkVHTElHRU5DRSBPUiBPVEhFUldJU0UpDQo+ICsjIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0Yg VEhFIFVTRSBPRiBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFDQo+ICsjIFBP U1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLg0KPiArIw0KPiArDQo+ICt1c2FnZSgpIHsNCj4gKwlw cmludGYgInVzYWdlOiAlcyBpbnN0YWxsX2RpciBleGVjX3N1ZmZpeFxuIiAiJDAiIDE+JjINCj4g KwlleGl0IDENCj4gK30NCj4gKw0KPiArc2NyaXB0PSIkMCINCj4gK3NjcmlwdGRpcj0kKGRpcm5h bWUgIiRzY3JpcHQiKQ0KPiArDQo+ICsuICIkc2NyaXB0ZGlyL2Z1bmN0aW9ucy5zaCINCj4gKw0K PiArSU5TVEFMTD0iJHNjcmlwdGRpci9zYWZlLWluc3RhbGwuc2giDQo+ICsNCj4gK3Rlc3QgIiQj IiAtZ2UgMiB8fCB1c2FnZQ0KPiArDQo+ICtpbnN0YWxsZGlyPSIkMSINCj4gK3NoaWZ0DQo+ICsN Cj4gK2V4ZWNfc3VmZml4PSIkMSINCj4gK3NoaWZ0DQo+ICsNCj4gK2JpbmRpcj0iJHNjcmlwdGRp ci9iaW4iDQo+ICsNCj4gK2ZvciBleGUgaW4gJGJpbmRpci8qOyBkbw0KPiArDQo+ICsJYmFzZT0k KGJhc2VuYW1lICIkZXhlIikNCj4gKw0KPiArCWlmIFsgLUwgIiRleGUiIF07IHRoZW4NCj4gKwkJ bGluaz0kKHJlYWRsaW5rICIkZXhlIikNCj4gKwkJIiRJTlNUQUxMIiAtRGxtIDc1NSAiJGxpbmsk ZXhlY19zdWZmaXgiICIkaW5zdGFsbGRpci8kYmFzZSRleGVjX3N1ZmZpeCINCj4gKwllbHNlDQo+ ICsJCSIkSU5TVEFMTCIgLURtIDc1NSAiJGV4ZSIgIiRpbnN0YWxsZGlyLyRiYXNlJGV4ZWNfc3Vm Zml4Ig0KPiArCWZpDQo+ICsNCj4gK2RvbmUNCj4gDQo+IE1vZGlmaWVkOiBoZWFkL2NvbnRyaWIv YmMvZ2VuL2xpYi5iYw0KPiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCj4gLS0tIGhlYWQvY29udHJp Yi9iYy9nZW4vbGliLmJjCVRodSBOb3YgMjYgMTc6Mzc6MjcgMjAyMAkocjM2ODA3MSkNCj4gKysr IGhlYWQvY29udHJpYi9iYy9nZW4vbGliLmJjCVRodSBOb3YgMjYgMTc6Mzk6NTEgMjAyMAkocjM2 ODA3MikNCj4gQEAgLTE3Myw3ICsxNzMsNyBAQCBkZWZpbmUgYSh4KXsNCj4gIAlyZXR1cm4oKG0q YStyKS9uKQ0KPiAgfQ0KPiAgZGVmaW5lIGoobix4KXsNCj4gLQlhdXRvIGIscyxvLGEsaSx2LGYN Cj4gKwlhdXRvIGIscyxvLGEsaSxyLHYsZg0KPiAgCWI9aWJhc2UNCj4gIAlpYmFzZT1BDQo+ICAJ cz1zY2FsZQ0KPiANCj4gTW9kaWZpZWQ6IGhlYWQvY29udHJpYi9iYy9nZW4vc3RyZ2VuLmMNCj4g PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09DQo+IC0tLSBoZWFkL2NvbnRyaWIvYmMvZ2VuL3N0cmdlbi5j CVRodSBOb3YgMjYgMTc6Mzc6MjcgMjAyMAkocjM2ODA3MSkNCj4gKysrIGhlYWQvY29udHJpYi9i Yy9nZW4vc3RyZ2VuLmMJVGh1IE5vdiAyNiAxNzozOTo1MSAyMDIwCShyMzY4MDcyKQ0KPiBAQCAt NDUsMTMgKzQ1LDE0IEBADQo+ICBzdGF0aWMgY29uc3QgY2hhciogY29uc3QgYmNfZ2VuX2hlYWRl ciA9DQo+ICAJIi8vIENvcHlyaWdodCAoYykgMjAxOC0yMDIwIEdhdmluIEQuIEhvd2FyZCBhbmQg Y29udHJpYnV0b3JzLlxuIg0KPiAgCSIvLyBMaWNlbnNlZCB1bmRlciB0aGUgMi1jbGF1c2UgQlNE IGxpY2Vuc2UuXG4iDQo+IC0JIi8vICoqKiBBVVRPTUFUSUNBTExZIEdFTkVSQVRFRCBGUk9NICVz LiBETyBOT1QgTU9ESUZZLiAqKipcbiI7DQo+ICsJIi8vICoqKiBBVVRPTUFUSUNBTExZIEdFTkVS QVRFRCBGUk9NICVzLiBETyBOT1QgTU9ESUZZLiAqKipcblxuIjsNCj4gIA0KPiAtc3RhdGljIGNv bnN0IGNoYXIqIGNvbnN0IGJjX2dlbl9pbmNsdWRlID0gIiNpbmNsdWRlIDwlcz5cblxuIjsNCj4g IHN0YXRpYyBjb25zdCBjaGFyKiBjb25zdCBiY19nZW5fbGFiZWwgPSAiY29uc3QgY2hhciAqJXMg PSBcIiVzXCI7XG5cbiI7DQo+ICtzdGF0aWMgY29uc3QgY2hhciogY29uc3QgYmNfZ2VuX2xhYmVs X2V4dGVybiA9ICJleHRlcm4gY29uc3QgY2hhciAqJXM7XG5cbiI7DQo+ICBzdGF0aWMgY29uc3Qg Y2hhciogY29uc3QgYmNfZ2VuX2lmZGVmID0gIiNpZiAlc1xuIjsNCj4gIHN0YXRpYyBjb25zdCBj aGFyKiBjb25zdCBiY19nZW5fZW5kaWYgPSAiI2VuZGlmIC8vICVzXG4iOw0KPiAgc3RhdGljIGNv bnN0IGNoYXIqIGNvbnN0IGJjX2dlbl9uYW1lID0gImNvbnN0IGNoYXIgJXNbXSA9IHtcbiI7DQo+ ICtzdGF0aWMgY29uc3QgY2hhciogY29uc3QgYmNfZ2VuX25hbWVfZXh0ZXJuID0gImV4dGVybiBj b25zdCBjaGFyICVzW107XG5cbiI7DQo+ICANCj4gICNkZWZpbmUgSU9fRVJSICgxKQ0KPiAgI2Rl ZmluZSBJTlZBTElEX0lOUFVUX0ZJTEUgKDIpDQo+IEBAIC02Miw3ICs2Myw3IEBAIHN0YXRpYyBj b25zdCBjaGFyKiBjb25zdCBiY19nZW5fbmFtZSA9ICJjb25zdCBjaGFyICVzWw0KPiAgaW50IG1h aW4oaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkgew0KPiAgDQo+ICAJRklMRSAqaW4sICpvdXQ7DQo+ IC0JY2hhciAqbGFiZWwsICpkZWZpbmUsICpuYW1lLCAqaW5jbHVkZTsNCj4gKwljaGFyICpsYWJl bCwgKmRlZmluZSwgKm5hbWU7DQo+ICAJaW50IGMsIGNvdW50LCBzbGFzaGVzLCBlcnIgPSBJT19F UlI7DQo+ICAJYm9vbCBoYXNfbGFiZWwsIGhhc19kZWZpbmUsIHJlbW92ZV90YWJzOw0KPiAgDQo+ IEBAIC03MiwxNSArNzMsMTQgQEAgaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkgew0K PiAgCX0NCj4gIA0KPiAgCW5hbWUgPSBhcmd2WzNdOw0KPiAtCWluY2x1ZGUgPSBhcmd2WzRdOw0K PiAgDQo+IC0JaGFzX2xhYmVsID0gKGFyZ2MgPiA1ICYmIHN0cmNtcCgiIiwgYXJndls1XSkgIT0g MCk7DQo+IC0JbGFiZWwgPSBoYXNfbGFiZWwgPyBhcmd2WzVdIDogIiI7DQo+ICsJaGFzX2xhYmVs ID0gKGFyZ2MgPiA0ICYmIHN0cmNtcCgiIiwgYXJndls0XSkgIT0gMCk7DQo+ICsJbGFiZWwgPSBo YXNfbGFiZWwgPyBhcmd2WzRdIDogIiI7DQo+ICANCj4gLQloYXNfZGVmaW5lID0gKGFyZ2MgPiA2 ICYmIHN0cmNtcCgiIiwgYXJndls2XSkgIT0gMCk7DQo+IC0JZGVmaW5lID0gaGFzX2RlZmluZSA/ IGFyZ3ZbNl0gOiAiIjsNCj4gKwloYXNfZGVmaW5lID0gKGFyZ2MgPiA1ICYmIHN0cmNtcCgiIiwg YXJndls1XSkgIT0gMCk7DQo+ICsJZGVmaW5lID0gaGFzX2RlZmluZSA/IGFyZ3ZbNV0gOiAiIjsN Cj4gIA0KPiAtCXJlbW92ZV90YWJzID0gKGFyZ2MgPiA3KTsNCj4gKwlyZW1vdmVfdGFicyA9IChh cmdjID4gNik7DQo+ICANCj4gIAlpbiA9IGZvcGVuKGFyZ3ZbMV0sICJyIik7DQo+ICAJaWYgKCFp bikgcmV0dXJuIElOVkFMSURfSU5QVVRfRklMRTsNCj4gQEAgLTg5LDggKzg5LDkgQEAgaW50IG1h aW4oaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkgew0KPiAgCWlmICghb3V0KSBnb3RvIG91dF9lcnI7 DQo+ICANCj4gIAlpZiAoZnByaW50ZihvdXQsIGJjX2dlbl9oZWFkZXIsIGFyZ3ZbMV0pIDwgMCkg Z290byBlcnI7DQo+ICsJaWYgKGhhc19sYWJlbCAmJiBmcHJpbnRmKG91dCwgYmNfZ2VuX2xhYmVs X2V4dGVybiwgbGFiZWwpIDwgMCkgZ290byBlcnI7DQo+ICsJaWYgKGZwcmludGYob3V0LCBiY19n ZW5fbmFtZV9leHRlcm4sIG5hbWUpIDwgMCkgZ290byBlcnI7DQo+ICAJaWYgKGhhc19kZWZpbmUg JiYgZnByaW50ZihvdXQsIGJjX2dlbl9pZmRlZiwgZGVmaW5lKSA8IDApIGdvdG8gZXJyOw0KPiAt CWlmIChmcHJpbnRmKG91dCwgYmNfZ2VuX2luY2x1ZGUsIGluY2x1ZGUpIDwgMCkgZ290byBlcnI7 DQo+ICAJaWYgKGhhc19sYWJlbCAmJiBmcHJpbnRmKG91dCwgYmNfZ2VuX2xhYmVsLCBsYWJlbCwg YXJndlsxXSkgPCAwKSBnb3RvIGVycjsNCj4gIAlpZiAoZnByaW50ZihvdXQsIGJjX2dlbl9uYW1l LCBuYW1lKSA8IDApIGdvdG8gZXJyOw0KPiAgDQo+IA0KPiBNb2RpZmllZDogaGVhZC9jb250cmli L2JjL2dlbi9zdHJnZW4uc2gNCj4gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQo+IC0tLSBoZWFkL2Nv bnRyaWIvYmMvZ2VuL3N0cmdlbi5zaAlUaHUgTm92IDI2IDE3OjM3OjI3IDIwMjAJKHIzNjgwNzEp DQo+ICsrKyBoZWFkL2NvbnRyaWIvYmMvZ2VuL3N0cmdlbi5zaAlUaHUgTm92IDI2IDE3OjM5OjUx IDIwMjAJKHIzNjgwNzIpDQo+IEBAIC0zMiw3ICszMiw3IEBAIGV4cG9ydCBMQ19DVFlQRT1DDQo+ ICANCj4gIHByb2duYW1lPSR7MCMjKi99DQo+ICANCj4gLWlmIFsgJCMgLWx0IDQgXTsgdGhlbg0K PiAraWYgWyAkIyAtbHQgMyBdOyB0aGVuDQo+ICAJZWNobyAidXNhZ2U6ICRwcm9nbmFtZSBpbnB1 dCBvdXRwdXQgbmFtZSBoZWFkZXIgW2xhYmVsIFtkZWZpbmUgW3JlbW92ZV90YWJzXV1dIg0KPiAg CWV4aXQgMQ0KPiAgZmkNCj4gQEAgLTQwLDE2ICs0MCwxNiBAQCBmaQ0KPiAgaW5wdXQ9IiQxIg0K PiAgb3V0cHV0PSIkMiINCj4gIG5hbWU9IiQzIg0KPiAtaGVhZGVyPSIkNCINCj4gLWxhYmVsPSIk NSINCj4gLWRlZmluZT0iJDYiDQo+IC1yZW1vdmVfdGFicz0iJDciDQo+ICtsYWJlbD0iJDQiDQo+ ICtkZWZpbmU9IiQ1Ig0KPiArcmVtb3ZlX3RhYnM9IiQ2Ig0KPiAgDQo+ICBleGVjIDwgIiRpbnB1 dCINCj4gIGV4ZWMgPiAiJG91dHB1dCINCj4gIA0KPiAgaWYgWyAtbiAiJGxhYmVsIiBdOyB0aGVu DQo+ICAJbmFtZWxpbmU9ImNvbnN0IGNoYXIgKiR7bGFiZWx9ID0gXCIke2lucHV0fVwiOyINCj4g KwlsYWJlbGV4dGVybmxpbmU9ImV4dGVybiBjb25zdCBjaGFyICoke2xhYmVsfTsiDQo+ICBmaQ0K PiAgDQo+ICBpZiBbIC1uICIkZGVmaW5lIiBdOyB0aGVuDQo+IEBAIC02NCwxMSArNjQsMTQgQEAg aWYgWyAtbiAiJHJlbW92ZV90YWJzIiBdOyB0aGVuDQo+ICBmaQ0KPiAgDQo+ICBjYXQ8PEVPRg0K PiArLy8gQ29weXJpZ2h0IChjKSAyMDE4LTIwMjAgR2F2aW4gRC4gSG93YXJkIGFuZCBjb250cmli dXRvcnMuDQo+ICAvLyBMaWNlbnNlZCB1bmRlciB0aGUgMi1jbGF1c2UgQlNEIGxpY2Vuc2UuDQo+ ICAvLyAqKiogQVVUT01BVElDQUxMWSBHRU5FUkFURUQgRlJPTSAke2lucHV0fS4gRE8gTk9UIE1P RElGWS4gKioqDQo+ICANCj4gICR7Y29uZHN0YXJ0fQ0KPiAtI2luY2x1ZGUgPCR7aGVhZGVyfT4N Cj4gKyRsYWJlbGV4dGVybmxpbmUNCj4gKw0KPiArZXh0ZXJuIGNvbnN0IGNoYXIgJG5hbWVbXTsN Cj4gIA0KPiAgJG5hbWVsaW5lDQo+ICANCj4gDQo+IENvcGllZDogaGVhZC9jb250cmliL2JjL2lu Y2x1ZGUvYmNsLmggKGZyb20gcjM2ODA2OSwgdmVuZG9yL2JjL2Rpc3QvaW5jbHVkZS9iY2wuaCkN Cj4gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09DQo+IC0tLSAvZGV2L251bGwJMDA6MDA6MDAgMTk3MAko ZW1wdHksIGJlY2F1c2UgZmlsZSBpcyBuZXdseSBhZGRlZCkNCj4gKysrIGhlYWQvY29udHJpYi9i Yy9pbmNsdWRlL2JjbC5oCVRodSBOb3YgMjYgMTc6Mzk6NTEgMjAyMAkocjM2ODA3MiwgY29weSBv Zg0KPiByMzY4MDY5LCB2ZW5kb3IvYmMvZGlzdC9pbmNsdWRlL2JjbC5oKSBAQCAtMCwwICsxLDE4 NCBAQA0KPiArLyoNCj4gKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQo+ICsgKg0KPiArICogU1BE WC1MaWNlbnNlLUlkZW50aWZpZXI6IEJTRC0yLUNsYXVzZQ0KPiArICoNCj4gKyAqIENvcHlyaWdo dCAoYykgMjAxOC0yMDIwIEdhdmluIEQuIEhvd2FyZCBhbmQgY29udHJpYnV0b3JzLg0KPiArICoN Cj4gKyAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMs IHdpdGggb3Igd2l0aG91dA0KPiArICogbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3Zp ZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6DQo+ICsgKg0KPiArICog KiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNv cHlyaWdodCBub3RpY2UsIHRoaXMNCj4gKyAqICAgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUg Zm9sbG93aW5nIGRpc2NsYWltZXIuDQo+ICsgKg0KPiArICogKiBSZWRpc3RyaWJ1dGlvbnMgaW4g YmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodCBub3RpY2UsDQo+ ICsgKiAgIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWlt ZXIgaW4gdGhlIGRvY3VtZW50YXRpb24NCj4gKyAqICAgYW5kL29yIG90aGVyIG1hdGVyaWFscyBw cm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24uDQo+ICsgKg0KPiArICogVEhJUyBTT0ZUV0FS RSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyAi QVMgSVMiDQo+ICsgKiBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNM VURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFDQo+ICsgKiBJTVBMSUVEIFdBUlJBTlRJRVMg T0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRQ0K PiArICogQVJFIERJU0NMQUlNRUQuIElOIE5PIEVWRU5UIFNIQUxMIFRIRSBDT1BZUklHSFQgSE9M REVSIE9SIENPTlRSSUJVVE9SUyBCRQ0KPiArICogTElBQkxFIEZPUiBBTlkgRElSRUNULCBJTkRJ UkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUg0KPiArICogQ09OU0VRVUVO VElBTCBEQU1BR0VTIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQg T0YNCj4gKyAqIFNVQlNUSVRVVEUgR09PRFMgT1IgU0VSVklDRVM7IExPU1MgT0YgVVNFLCBEQVRB LCBPUiBQUk9GSVRTOyBPUiBCVVNJTkVTUw0KPiArICogSU5URVJSVVBUSU9OKSBIT1dFVkVSIENB VVNFRCBBTkQgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4NCj4gKyAqIENP TlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUIChJTkNMVURJTkcgTkVHTElHRU5DRSBP UiBPVEhFUldJU0UpDQo+ICsgKiBBUklTSU5HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBVU0UgT0Yg VEhJUyBTT0ZUV0FSRSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRQ0KPiArICogUE9TU0lCSUxJVFkg T0YgU1VDSCBEQU1BR0UuDQo+ICsgKg0KPiArICogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCj4gKyAq DQo+IA0KPiAqKiogRElGRiBPVVRQVVQgVFJVTkNBVEVEIEFUIDEwMDAgTElORVMgKioqDQo+IF9f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fDQo+IHN2bi1zcmMt aGVhZEBmcmVlYnNkLm9yZyBtYWlsaW5nIGxpc3QNCj4gaHR0cHM6Ly9saXN0cy5mcmVlYnNkLm9y Zy9tYWlsbWFuL2xpc3RpbmZvL3N2bi1zcmMtaGVhZA0KPiBUbyB1bnN1YnNjcmliZSwgc2VuZCBh bnkgbWFpbCB0byAic3ZuLXNyYy1oZWFkLXVuc3Vic2NyaWJlQGZyZWVic2Qub3JnIg0KQnVpbGR3 b3JsZCBmYWlscyB3aXRoICAiZG9uJ3Qga25vdyBob3cgdG8gbWFrZSBiYy9iYy5jIjoNCg0KPT09 PiB1c3Iuc2Jpbi9uZHAgKGFsbCkNCi0gLS0tIGFsbF9zdWJkaXJfdXNyLmJpbiAtLS0NCm1ha2Vb NF06IG1ha2VbNF06IGRvbid0IGtub3cgaG93IHRvIG1ha2UgYmMvYmMuYy4gU3RvcA0KDQptYWtl WzRdOiBzdG9wcGVkIGluIC91c3Ivc3JjL3Vzci5iaW4vZ2gtYmMNCi0gLS0tIGFsbF9zdWJkaXJf dXNyLnNiaW4gLS0tDQotIC0tLSBhbGxfc3ViZGlyX3Vzci5zYmluL2JzZGNvbmZpZyAtLS0NCi0g LS0tIGFsbF9zdWJkaXJfbGliIC0tLQ0KLSAtLS0gYWxsX3N1YmRpcl91c3Iuc2JpbiAtLS0NCi0g LS0tIGFsbF9zdWJkaXJfdXNyLnNiaW4vbmRwIC0tLQ0KDQoNClJlZ2FyZHMNCm9oDQoNCi0gLS0g DQpPLiBIYXJ0bWFubg0KDQpJY2ggd2lkZXJzcHJlY2hlIGRlciBOdXR6dW5nIG9kZXIgw5xiZXJt aXR0bHVuZyBtZWluZXIgRGF0ZW4gZsO8cg0KV2VyYmV6d2Vja2Ugb2RlciBmw7xyIGRpZSBNYXJr dC0gb2RlciBNZWludW5nc2ZvcnNjaHVuZyAowqcgMjggQWJzLiA0IEJEU0cpLg0KLS0tLS1CRUdJ TiBQR1AgU0lHTkFUVVJFLS0tLS0NCg0KaUhRRUFSWUlBQjBXSVFTeThJQnhBUERrcVZCYVRKNDRO MVpaUGJhNVJ3VUNYNy94eFFBS0NSQTROMVpaUGJhNQ0KUnp0b0FRQ1lJQnVibjAyc29DZit0U2JT bTBIUklsUVcvbGdPRDBWZStwZ2hKa0gxS0FEM2NtcUFkbFBKdkJkeg0KU3hna0RKeS92STQ1NVor eFVBdVVORXlMbUdNYUNBPT0NCj1PdXNUDQotLS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0NCg== From owner-svn-src-all@freebsd.org Thu Nov 26 18:33:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC84A46C2BD; Thu, 26 Nov 2020 18:33:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChmbP5RVPz4sZh; Thu, 26 Nov 2020 18:33:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADC5A27F39; Thu, 26 Nov 2020 18:33:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQIX5lh049875; Thu, 26 Nov 2020 18:33:05 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQIX42G049866; Thu, 26 Nov 2020 18:33:04 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202011261833.0AQIX42G049866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 26 Nov 2020 18:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368078 - in head: . rescue/rescue sbin/ping sbin/ping/tests tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: . rescue/rescue sbin/ping sbin/ping/tests tools/build/mk X-SVN-Commit-Revision: 368078 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 18:33:05 -0000 Author: asomers Date: Thu Nov 26 18:33:04 2020 New Revision: 368078 URL: https://svnweb.freebsd.org/changeset/base/368078 Log: ping: add a ping6 hard link for backwards compatibility When invoked as "ping6", ping will now attempt to use ICMPv6 for hostnames that resolve both IPv4 and IPv6 addresses. Reviewed by: bz, manu MFC-With: r368045 Differential Revision: https://reviews.freebsd.org/D27384 Modified: head/ObsoleteFiles.inc head/rescue/rescue/Makefile head/sbin/ping/Makefile head/sbin/ping/main.c head/sbin/ping/ping.8 head/sbin/ping/tests/ping_test.sh head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Nov 26 18:16:32 2020 (r368077) +++ head/ObsoleteFiles.inc Thu Nov 26 18:33:04 2020 (r368078) @@ -37,8 +37,6 @@ # done # 20201124: ping6(8) was merged into ping(8) -OLD_FILES+=sbin/ping6 -OLD_FILES+=rescue/ping6 OLD_FILES+=usr/lib/debug/sbin/ping6.debug OLD_FILES+=usr/share/man/man8/ping6.8.gz OLD_FILES+=usr/tests/sbin/ping6/Kyuafile Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Thu Nov 26 18:16:32 2020 (r368077) +++ head/rescue/rescue/Makefile Thu Nov 26 18:33:04 2020 (r368078) @@ -103,6 +103,7 @@ CRUNCH_PROGS_sbin+= ccdconfig .endif .if ${MK_INET6_SUPPORT} != "no" +CRUNCH_ALIAS_ping= ping6 CRUNCH_PROGS_sbin+= rtsol .endif Modified: head/sbin/ping/Makefile ============================================================================== --- head/sbin/ping/Makefile Thu Nov 26 18:16:32 2020 (r368077) +++ head/sbin/ping/Makefile Thu Nov 26 18:33:04 2020 (r368078) @@ -15,6 +15,7 @@ LIBADD= m CFLAGS+= -DINET6 -DKAME_SCOPEID SRCS+= ping6.c LIBADD+= md +LINKS= ${BINDIR}/ping ${BINDIR}/ping6 .endif .if ${MK_DYNAMICROOT} == "no" Modified: head/sbin/ping/main.c ============================================================================== --- head/sbin/ping/main.c Thu Nov 26 18:16:32 2020 (r368077) +++ head/sbin/ping/main.c Thu Nov 26 18:33:04 2020 (r368078) @@ -66,7 +66,10 @@ main(int argc, char *argv[]) struct in6_addr a6; bool ipv6; - ipv6 = false; + if (strcmp(getprogname(), "ping6") == 0) + ipv6 = true; + else + ipv6 = false; #endif ipv4 = false; Modified: head/sbin/ping/ping.8 ============================================================================== --- head/sbin/ping/ping.8 Thu Nov 26 18:16:32 2020 (r368077) +++ head/sbin/ping/ping.8 Thu Nov 26 18:33:04 2020 (r368078) @@ -28,7 +28,7 @@ .\" @(#)ping.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd November 24, 2020 +.Dd November 26, 2020 .Dt PING 8 .Os .Sh NAME @@ -141,6 +141,9 @@ the specific IP version can be requested by or .Fl 6 options, respectively. +For backwards-compatibility, ICMPv6 can also be selected by invoking the binary +as +.Nm ping6 . .Ss Options common to both IPv4 and IPv6 targets .Bl -tag -width indent .It Fl A Modified: head/sbin/ping/tests/ping_test.sh ============================================================================== --- head/sbin/ping/tests/ping_test.sh Thu Nov 26 18:16:32 2020 (r368077) +++ head/sbin/ping/tests/ping_test.sh Thu Nov 26 18:33:04 2020 (r368078) @@ -53,9 +53,23 @@ ping_6_c1_s8_t1_body() { check_ping_statistics std.out $(atf_get_srcdir)/ping_6_c1_s8_t1.out } +atf_test_case ping6_c1_s8_t1 +ping6_c1_s8_t1_head() { + atf_set "descr" "Use IPv6 when invoked as ping6" +} +ping6_c1_s8_t1_body() { + if ! getaddrinfo -f inet6 localhost 1>/dev/null 2>&1; then + atf_skip "IPv6 is not configured" + fi + atf_check -s exit:0 -o save:std.out -e empty \ + ping6 -c 1 -s 8 -t 1 localhost + check_ping_statistics std.out $(atf_get_srcdir)/ping_6_c1_s8_t1.out +} + atf_init_test_cases() { atf_add_test_case ping_c1_s56_t1 atf_add_test_case ping_6_c1_s8_t1 + atf_add_test_case ping6_c1_s8_t1 } check_ping_statistics() { Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Nov 26 18:16:32 2020 (r368077) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Nov 26 18:33:04 2020 (r368078) @@ -2583,6 +2583,7 @@ OLD_DIRS+=usr/share/i18n/csmapper/GB .endif .if ${MK_INET6} == no +OLD_FILES+=sbin/ping6 OLD_FILES+=sbin/rtsol OLD_FILES+=usr/sbin/ip6addrctl OLD_FILES+=usr/sbin/mld6query @@ -2611,6 +2612,7 @@ OLD_FILES+=usr/share/man/man8/traceroute6.8.gz .endif .if ${MK_INET6_SUPPORT} == no +OLD_FILES+=rescue/ping6 OLD_FILES+=rescue/rtsol .endif From owner-svn-src-all@freebsd.org Thu Nov 26 18:47:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C84D846CA19; Thu, 26 Nov 2020 18:47:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chmvw5Mc4z4t8b; Thu, 26 Nov 2020 18:47:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AACE3279F3; Thu, 26 Nov 2020 18:47:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQIlOkT056238; Thu, 26 Nov 2020 18:47:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQIlNAq056232; Thu, 26 Nov 2020 18:47:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011261847.0AQIlNAq056232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 26 Nov 2020 18:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368079 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 368079 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 18:47:24 -0000 Author: mav Date: Thu Nov 26 18:47:23 2020 New Revision: 368079 URL: https://svnweb.freebsd.org/changeset/base/368079 Log: More cleanup in response queue and reset code. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/ispmbox.h head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Thu Nov 26 18:33:04 2020 (r368078) +++ head/sys/dev/isp/isp.c Thu Nov 26 18:47:23 2020 (r368079) @@ -64,11 +64,6 @@ __FBSDID("$FreeBSD$"); #endif /* - * General defines - */ -#define MBOX_DELAY_COUNT 1000000 / 100 - -/* * Local static data */ static const char notresp[] = "Unknown IOCB in RESPONSE Queue (type 0x%x) @ idx %d (next %d)"; @@ -99,7 +94,7 @@ static const uint8_t alpa_map[] = { * Local function prototypes. */ static int isp_handle_other_response(ispsoftc_t *, int, isphdr_t *, uint32_t *, uint16_t); -static void isp_parse_status_24xx(ispsoftc_t *, isp24xx_statusreq_t *, XS_T *, uint32_t *); +static void isp_parse_status_24xx(ispsoftc_t *, isp24xx_statusreq_t *, XS_T *); static void isp_clear_portdb(ispsoftc_t *, int); static void isp_mark_portdb(ispsoftc_t *, int); static int isp_plogx(ispsoftc_t *, int, uint16_t, uint32_t, int); @@ -155,7 +150,7 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) char *buf; uint64_t fwt; uint32_t code_org, val; - int loops, i, dodnld = 1; + int loaded_fw, loops, i, dodnld = 1; const char *btype = "????"; static const char dcrc[] = "Downloaded RISC Code Checksum Failure"; @@ -188,25 +183,19 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) } /* - * Hit the chip over the head with hammer, - * and give it a chance to recover. - */ - - /* * Stop DMA and wait for it to stop. */ ISP_WRITE(isp, BIU2400_CSR, BIU2400_DMA_STOP|(3 << 4)); - for (val = loops = 0; loops < 30000; loops++) { + for (loops = 0; loops < 100000; loops++) { ISP_DELAY(10); val = ISP_READ(isp, BIU2400_CSR); if ((val & BIU2400_DMA_ACTIVE) == 0) { break; } } - if (val & BIU2400_DMA_ACTIVE) { + if (val & BIU2400_DMA_ACTIVE) isp_prt(isp, ISP_LOGERR, "DMA Failed to Stop on Reset"); - return; - } + /* * Hold it in SOFT_RESET and STOP state for 100us. */ @@ -215,33 +204,24 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) for (loops = 0; loops < 10000; loops++) { ISP_DELAY(5); val = ISP_READ(isp, OUTMAILBOX0); - } - for (val = loops = 0; loops < 500000; loops ++) { - val = ISP_READ(isp, BIU2400_CSR); - if ((val & BIU2400_SOFT_RESET) == 0) { + if (val != 0x4) break; - } } - if (val & BIU2400_SOFT_RESET) { - isp_prt(isp, ISP_LOGERR, "Failed to come out of reset"); + switch (val) { + case 0x0: + break; + case 0x4: + isp_prt(isp, ISP_LOGERR, "The ROM code is busy after 50ms."); return; + case 0xf: + isp_prt(isp, ISP_LOGERR, "Board configuration error."); + return; + default: + isp_prt(isp, ISP_LOGERR, "Unknown RISC Status Code 0x%x.", val); + return; } /* - * Wait for ISP to be ready to go... - */ - loops = MBOX_DELAY_COUNT; - for (;;) { - if (ISP_READ(isp, OUTMAILBOX0) == 0) - break; - ISP_DELAY(100); - if (--loops < 0) { - ISP_DUMPREGS(isp, "chip reset timed out"); - return; - } - } - - /* * Reset RISC Processor */ ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_RESET); @@ -251,16 +231,24 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) /* * Post-RISC Reset stuff. */ - for (val = loops = 0; loops < 5000000; loops++) { + for (loops = 0; loops < 10000; loops++) { ISP_DELAY(5); val = ISP_READ(isp, OUTMAILBOX0); - if (val == 0) { + if (val != 0x4) break; - } } - if (val != 0) { - isp_prt(isp, ISP_LOGERR, "reset didn't clear"); + switch (val) { + case 0x0: + break; + case 0x4: + isp_prt(isp, ISP_LOGERR, "The ROM code is busy after 50ms."); return; + case 0xf: + isp_prt(isp, ISP_LOGERR, "Board configuration error."); + return; + default: + isp_prt(isp, ISP_LOGERR, "Unknown RISC Status Code 0x%x.", val); + return; } isp->isp_reqidx = isp->isp_reqodx = 0; @@ -278,18 +266,6 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) ISP_WRITE(isp, BIU2400_ATIO_RSPOUTP, 0); /* - * Wait for everything to finish firing up. - */ - loops = MBOX_DELAY_COUNT; - while (ISP_READ(isp, OUTMAILBOX0) == MBOX_BUSY) { - ISP_DELAY(100); - if (--loops < 0) { - isp_prt(isp, ISP_LOGERR, "MBOX_BUSY never cleared on reset"); - return; - } - } - - /* * Up until this point we've done everything by just reading or * setting registers. From this point on we rely on at least *some* * kind of firmware running in the card. @@ -362,7 +338,7 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) } code_org = ISP_CODE_ORG_2400; - isp->isp_loaded_fw = 0; + loaded_fw = 0; if (dodnld) { const uint32_t *ptr = isp->isp_mdvec->dv_ispfw; uint32_t la, wi, wl; @@ -411,7 +387,7 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) } ptr += ptr[3]; } - isp->isp_loaded_fw = 1; + loaded_fw = 1; } else if (IS_26XX(isp)) { isp_prt(isp, ISP_LOGDEBUG1, "loading firmware from flash"); MBSINIT(&mbs, MBOX_LOAD_FLASH_FIRMWARE, MBLOGALL, 5000000); @@ -429,7 +405,7 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) /* * If we loaded firmware, verify its checksum */ - if (isp->isp_loaded_fw) { + if (loaded_fw) { MBSINIT(&mbs, MBOX_VERIFY_CHECKSUM, MBLOGNONE, 0); mbs.param[1] = code_org >> 16; mbs.param[2] = code_org; @@ -447,17 +423,10 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults) * we still need to (re)start it. */ MBSINIT(&mbs, MBOX_EXEC_FIRMWARE, MBLOGALL, 5000000); - if (IS_26XX(isp)) { - mbs.param[1] = code_org >> 16; - mbs.param[2] = code_org; - } else { - mbs.param[1] = code_org >> 16; - mbs.param[2] = code_org; - if (isp->isp_loaded_fw) - mbs.param[3] = 0; - else - mbs.param[3] = 1; - } + mbs.param[1] = code_org >> 16; + mbs.param[2] = code_org; + if (!IS_26XX(isp)) + mbs.param[3] = loaded_fw ? 0 : 1; isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) return; @@ -3227,10 +3196,9 @@ isp_intr_respq(ispsoftc_t *isp) isp24xx_statusreq_t *sp = (isp24xx_statusreq_t *)qe; ispstatus_cont_t *scp = (ispstatus_cont_t *)qe; isphdr_t *hp; - uint8_t *resp, *snsp; - int buddaboom, completion_status, cont = 0, etype, i; - int req_status_flags, req_state_flags, scsi_status; - uint32_t iptr, cptr, optr, rlen, slen, sptr, totslen, resid; + uint8_t *resp, *snsp, etype; + uint16_t scsi_status; + uint32_t iptr, cont = 0, cptr, optr, rlen, slen, sptr, totslen; /* * We can't be getting this now. @@ -3254,6 +3222,28 @@ isp_intr_respq(ispsoftc_t *isp) if (isp->isp_dblev & ISP_LOGDEBUG1) isp_print_qentry(isp, "Response Queue Entry", cptr, hp); isp_get_hdr(isp, hp, &sp->req_header); + + /* + * Log IOCBs rejected by the firmware. We can't really do + * much more about them, since it just should not happen. + */ + if (sp->req_header.rqs_flags & RQSFLAG_BADTYPE) { + isp_print_qentry(isp, "invalid entry type", cptr, hp); + continue; + } + if (sp->req_header.rqs_flags & RQSFLAG_BADPARAM) { + isp_print_qentry(isp, "invalid entry parameter", cptr, hp); + continue; + } + if (sp->req_header.rqs_flags & RQSFLAG_BADCOUNT) { + isp_print_qentry(isp, "invalid entry count", cptr, hp); + continue; + } + if (sp->req_header.rqs_flags & RQSFLAG_BADORDER) { + isp_print_qentry(isp, "invalid entry order", cptr, hp); + continue; + } + etype = sp->req_header.rqs_entry_type; /* We expected Status Continuation, but got different IOCB. */ @@ -3264,20 +3254,13 @@ isp_intr_respq(ispsoftc_t *isp) if (etype == RQSTYPE_RESPONSE) { isp_get_24xx_response(isp, (isp24xx_statusreq_t *)hp, sp); - scsi_status = sp->req_scsi_status; - completion_status = sp->req_completion_status; - req_status_flags = 0; - if ((scsi_status & 0xff) != 0) - req_state_flags = RQSF_GOT_STATUS; - else - req_state_flags = 0; - resid = sp->req_resid; + /* FALLTHROUGH */ } else if (etype == RQSTYPE_STATUS_CONT) { isp_get_cont_response(isp, (ispstatus_cont_t *)hp, scp); if (cont > 0) { - i = min(cont, sizeof(scp->req_sense_data)); - XS_SENSE_APPEND(cont_xs, scp->req_sense_data, i); - cont -= i; + slen = min(cont, sizeof(scp->req_sense_data)); + XS_SENSE_APPEND(cont_xs, scp->req_sense_data, slen); + cont -= slen; if (cont == 0) { isp_done(cont_xs); } else { @@ -3308,78 +3291,36 @@ isp_intr_respq(ispsoftc_t *isp) continue; } - buddaboom = 0; - if (sp->req_header.rqs_flags & RQSFLAG_MASK) { - if (sp->req_header.rqs_flags & RQSFLAG_BADTYPE) { - isp_print_qentry(isp, "invalid entry type", - cptr, hp); - buddaboom++; - } - if (sp->req_header.rqs_flags & RQSFLAG_BADPARAM) { - isp_print_qentry(isp, "invalid entry parameter", - cptr, hp); - buddaboom++; - } - if (sp->req_header.rqs_flags & RQSFLAG_BADCOUNT) { - isp_print_qentry(isp, "invalid entry count", - cptr, hp); - buddaboom++; - } - if (sp->req_header.rqs_flags & RQSFLAG_BADORDER) { - isp_print_qentry(isp, "invalid entry order", - cptr, hp); - continue; - } - } - xs = isp_find_xs(isp, sp->req_handle); if (xs == NULL) { - uint8_t ts = completion_status & 0xff; /* * Only whine if this isn't the expected fallout of * aborting the command or resetting the target. */ - if (etype != RQSTYPE_RESPONSE) { - isp_prt(isp, ISP_LOGERR, "cannot find handle 0x%x (type 0x%x)", sp->req_handle, etype); - } else if (ts != RQCS_ABORTED && ts != RQCS_RESET_OCCURRED) { - isp_prt(isp, ISP_LOGERR, "cannot find handle 0x%x (status 0x%x)", sp->req_handle, ts); - } + if (sp->req_completion_status != RQCS_ABORTED && + sp->req_completion_status != RQCS_RESET_OCCURRED) + isp_prt(isp, ISP_LOGERR, "cannot find handle 0x%x (status 0x%x)", + sp->req_handle, sp->req_completion_status); ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ continue; } - if (req_status_flags & RQSTF_BUS_RESET) { - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%jx bus was reset", - XS_CHANNEL(xs), XS_TGT(xs), (uintmax_t)XS_LUN(xs)); - XS_SETERR(xs, HBA_BUSRESET); - ISP_SET_SENDMARKER(isp, XS_CHANNEL(xs), 1); - } - if (buddaboom) { - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%jx buddaboom", - XS_CHANNEL(xs), XS_TGT(xs), (uintmax_t)XS_LUN(xs)); - XS_SETERR(xs, HBA_BOTCH); - } - resp = snsp = NULL; + resp = snsp = sp->req_rsp_sense; rlen = slen = totslen = 0; - if ((scsi_status & (RQCS_RV|RQCS_SV)) != 0) { - resp = sp->req_rsp_sense; + scsi_status = sp->req_scsi_status; + if (scsi_status & RQCS_RV) { rlen = sp->req_response_len; + snsp += rlen; } - if ((scsi_status & RQCS_SV) != 0) { - /* - * Fibre Channel F/W doesn't say we got status - * if there's Sense Data instead. I guess they - * think it goes w/o saying. - */ - req_state_flags |= RQSF_GOT_STATUS|RQSF_GOT_SENSE; - snsp = sp->req_rsp_sense + rlen; + if (scsi_status & RQCS_SV) { totslen = sp->req_sense_len; - slen = sizeof(sp->req_rsp_sense) - rlen; + slen = MIN(totslen, sizeof(sp->req_rsp_sense) - rlen); } - if (slen > totslen) - slen = totslen; - if (req_state_flags & RQSF_GOT_STATUS) - *XS_STSP(xs) = scsi_status & 0xff; + *XS_STSP(xs) = scsi_status & 0xff; + if (scsi_status & RQCS_RESID) + XS_SET_RESID(xs, sp->req_fcp_residual); + else + XS_SET_RESID(xs, 0); if (rlen >= 4 && resp[FCP_RSPNS_CODE_OFFSET] != 0) { const char *ptr; @@ -3397,7 +3338,7 @@ isp_intr_respq(ispsoftc_t *isp) "Task Management function incorrect logical unit number", }; uint8_t code = resp[FCP_RSPNS_CODE_OFFSET]; - if (code >= 10 || rnames[code] == NULL) { + if (code >= nitems(rnames) || rnames[code] == NULL) { ISP_SNPRINTF(lb, sizeof(lb), "Unknown FCP Response Code 0x%x", code); ptr = lb; @@ -3407,20 +3348,11 @@ isp_intr_respq(ispsoftc_t *isp) isp_xs_prt(isp, xs, ISP_LOGWARN, "FCP RESPONSE, LENGTH %u: %s CDB0=0x%02x", rlen, ptr, XS_CDBP(xs)[0] & 0xff); - if (code != 0 && code != 8) + if (code != FCP_RSPNS_TMF_DONE && + code != FCP_RSPNS_TMF_SUCCEEDED) XS_SETERR(xs, HBA_BOTCH); } - isp_parse_status_24xx(isp, sp, xs, &resid); - if ((XS_NOERR(xs) || XS_ERR(xs) == HBA_NOERROR) && - (*XS_STSP(xs) == SCSI_BUSY)) - XS_SETERR(xs, HBA_TGTBSY); - if (req_status_flags & RQSF_XFER_COMPLETE) { - XS_SET_RESID(xs, 0); - } else if (scsi_status & RQCS_RESID) { - XS_SET_RESID(xs, resid); - } else { - XS_SET_RESID(xs, 0); - } + isp_parse_status_24xx(isp, sp, xs); if (slen > 0) { XS_SAVE_SENSE(xs, snsp, slen); if (totslen > slen) { @@ -3431,12 +3363,9 @@ isp_intr_respq(ispsoftc_t *isp) cont); } } - isp_prt(isp, ISP_LOGDEBUG2, "asked for %lu got raw resid %lu settled for %lu", - (u_long)XS_XFRLEN(xs), (u_long)resid, (u_long)XS_GET_RESID(xs)); ISP_DMAFREE(isp, xs); isp_destroy_handle(isp, sp->req_handle); - ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ /* Complete command if we expect no Status Continuations. */ @@ -3808,70 +3737,64 @@ isp_handle_other_response(ispsoftc_t *isp, int type, i } static void -isp_parse_status_24xx(ispsoftc_t *isp, isp24xx_statusreq_t *sp, XS_T *xs, uint32_t *rp) +isp_parse_status_24xx(ispsoftc_t *isp, isp24xx_statusreq_t *sp, XS_T *xs) { int ru_marked, sv_marked; int chan = XS_CHANNEL(xs); switch (sp->req_completion_status) { case RQCS_COMPLETE: - if (XS_NOERR(xs)) { - XS_SETERR(xs, HBA_NOERROR); - } return; case RQCS_DMA_ERROR: isp_xs_prt(isp, xs, ISP_LOGERR, "DMA error"); + if (XS_NOERR(xs)) + XS_SETERR(xs, HBA_BOTCH); break; case RQCS_TRANSPORT_ERROR: isp_xs_prt(isp, xs, ISP_LOGERR, "Transport Error"); + if (XS_NOERR(xs)) + XS_SETERR(xs, HBA_BOTCH); break; case RQCS_RESET_OCCURRED: isp_xs_prt(isp, xs, ISP_LOGWARN, "reset destroyed command"); FCPARAM(isp, chan)->sendmarker = 1; - if (XS_NOERR(xs)) { + if (XS_NOERR(xs)) XS_SETERR(xs, HBA_BUSRESET); - } return; case RQCS_ABORTED: isp_xs_prt(isp, xs, ISP_LOGERR, "Command Aborted"); FCPARAM(isp, chan)->sendmarker = 1; - if (XS_NOERR(xs)) { + if (XS_NOERR(xs)) XS_SETERR(xs, HBA_ABORTED); - } return; case RQCS_TIMEOUT: isp_xs_prt(isp, xs, ISP_LOGWARN, "Command Timed Out"); - if (XS_NOERR(xs)) { + if (XS_NOERR(xs)) XS_SETERR(xs, HBA_CMDTIMEOUT); - } return; case RQCS_DATA_OVERRUN: XS_SET_RESID(xs, sp->req_resid); isp_xs_prt(isp, xs, ISP_LOGERR, "Data Overrun"); - if (XS_NOERR(xs)) { + if (XS_NOERR(xs)) XS_SETERR(xs, HBA_DATAOVR); - } return; - case RQCS_24XX_DRE: /* data reassembly error */ + case RQCS_DRE: /* data reassembly error */ isp_prt(isp, ISP_LOGERR, "Chan %d data reassembly error for target %d", chan, XS_TGT(xs)); - if (XS_NOERR(xs)) { - XS_SETERR(xs, HBA_ABORTED); - } - *rp = XS_XFRLEN(xs); + if (XS_NOERR(xs)) + XS_SETERR(xs, HBA_BOTCH); return; - case RQCS_24XX_TABORT: /* aborted by target */ + case RQCS_TABORT: /* aborted by target */ isp_prt(isp, ISP_LOGERR, "Chan %d target %d sent ABTS", chan, XS_TGT(xs)); - if (XS_NOERR(xs)) { + if (XS_NOERR(xs)) XS_SETERR(xs, HBA_ABORTED); - } return; case RQCS_DATA_UNDERRUN: @@ -3884,16 +3807,12 @@ isp_parse_status_24xx(ispsoftc_t *isp, isp24xx_statusr if ((ru_marked == 0 && sv_marked == 0) || (sp->req_resid > XS_XFRLEN(xs))) { isp_xs_prt(isp, xs, ISP_LOGWARN, bun, XS_XFRLEN(xs), sp->req_resid, (ru_marked)? "marked" : "not marked"); - if (XS_NOERR(xs)) { + if (XS_NOERR(xs)) XS_SETERR(xs, HBA_BOTCH); - } return; } XS_SET_RESID(xs, sp->req_resid); isp_xs_prt(isp, xs, ISP_LOG_WARN1, "Data Underrun (%d) for command 0x%x", sp->req_resid, XS_CDBP(xs)[0] & 0xff); - if (XS_NOERR(xs)) { - XS_SETERR(xs, HBA_NOERROR); - } return; case RQCS_PORT_UNAVAILABLE: @@ -3939,7 +3858,7 @@ isp_parse_status_24xx(ispsoftc_t *isp, isp24xx_statusr } return; - case RQCS_24XX_ENOMEM: /* f/w resource unavailable */ + case RQCS_ENOMEM: /* f/w resource unavailable */ isp_prt(isp, ISP_LOGWARN, "f/w resource unavailable for target %d chan %d", XS_TGT(xs), chan); if (XS_NOERR(xs)) { *XS_STSP(xs) = SCSI_BUSY; @@ -3947,7 +3866,7 @@ isp_parse_status_24xx(ispsoftc_t *isp, isp24xx_statusr } return; - case RQCS_24XX_TMO: /* task management overrun */ + case RQCS_TMO: /* task management overrun */ isp_prt(isp, ISP_LOGWARN, "command for target %d overlapped task management for chan %d", XS_TGT(xs), chan); if (XS_NOERR(xs)) { *XS_STSP(xs) = SCSI_BUSY; @@ -3959,9 +3878,8 @@ isp_parse_status_24xx(ispsoftc_t *isp, isp24xx_statusr isp_prt(isp, ISP_LOGERR, "Unknown Completion Status 0x%x on chan %d", sp->req_completion_status, chan); break; } - if (XS_NOERR(xs)) { + if (XS_NOERR(xs)) XS_SETERR(xs, HBA_BOTCH); - } } #define ISP_FC_IBITS(op) ((mbpfc[((op)<<3) + 0] << 24) | (mbpfc[((op)<<3) + 1] << 16) | (mbpfc[((op)<<3) + 2] << 8) | (mbpfc[((op)<<3) + 3])) @@ -4289,7 +4207,6 @@ isp_mboxcmd(ispsoftc_t *isp, mbreg_t *mbp) isp->isp_mboxtmp[box] = mbp->param[box] = 0; } - isp->isp_lastmbxcmd = opcode; isp->isp_obits = obits; isp->isp_mboxbsy = 1; @@ -4317,7 +4234,7 @@ isp_mboxcmd(ispsoftc_t *isp, mbreg_t *mbp) if (isp->isp_mboxbsy) { isp->isp_mboxbsy = 0; isp_prt(isp, ISP_LOGWARN, "Mailbox Command (0x%x) Timeout (%uus) (%s:%d)", - isp->isp_lastmbxcmd, to, mbp->func, mbp->lineno); + opcode, to, mbp->func, mbp->lineno); mbp->param[0] = MBOX_TIMEOUT; goto out; } Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Thu Nov 26 18:33:04 2020 (r368078) +++ head/sys/dev/isp/isp_freebsd.c Thu Nov 26 18:47:23 2020 (r368079) @@ -403,7 +403,6 @@ ispioctl(struct cdev *dev, u_long c, caddr_t addr, int *(int *)addr = FCPARAM(isp, chan)->role; retval = isp_control(isp, ISPCTL_CHANGE_ROLE, chan, nr); ISP_UNLOCK(isp); - retval = 0; break; case ISP_RESETHBA: @@ -1786,11 +1785,7 @@ isp_handle_platform_target_notify_ack(ispsoftc_t *isp, } mp->nt_need_ack = 0; } - if (isp_acknak_abts(isp, mp->nt_lreserved, 0) == ENOMEM) { - return (ENOMEM); - } else { - return (0); - } + return (isp_acknak_abts(isp, mp->nt_lreserved, 0)); } /* @@ -2558,7 +2553,7 @@ isp_action(struct cam_sim *sim, union ccb *ccb) if (isp_handle_platform_target_notify_ack(isp, &ntp->nt, (ccb->ccb_h.flags & CAM_SEND_STATUS) ? ccb->cna2.arg : 0)) { cam_freeze_devq(ccb->ccb_h.path); - cam_release_devq(ccb->ccb_h.path, RELSIM_RELEASE_AFTER_TIMEOUT, 0, 1000, 0); + cam_release_devq(ccb->ccb_h.path, RELSIM_RELEASE_AFTER_TIMEOUT, 0, 10, 0); ccb->ccb_h.status &= ~CAM_STATUS_MASK; ccb->ccb_h.status |= CAM_REQUEUE_REQ; break; Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Thu Nov 26 18:33:04 2020 (r368078) +++ head/sys/dev/isp/isp_freebsd.h Thu Nov 26 18:47:23 2020 (r368079) @@ -275,7 +275,6 @@ struct isposinfo { * misc- needs to be sorted better XXXXXX */ int framesize; - int cont_max; #ifdef ISP_TARGET_MODE bus_dma_tag_t ecmd_dmat; Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Thu Nov 26 18:33:04 2020 (r368078) +++ head/sys/dev/isp/ispmbox.h Thu Nov 26 18:47:23 2020 (r368079) @@ -209,8 +209,6 @@ #define ISP2100_SET_PCI_PARAM 0x00ff -#define MBOX_BUSY 0x04 - /* * Mailbox Command Complete Status Codes */ @@ -557,99 +555,20 @@ typedef struct { */ #define RQCS_COMPLETE 0x0000 #define RQCS_DMA_ERROR 0x0002 +#define RQCS_TRANSPORT_ERROR 0x0003 #define RQCS_RESET_OCCURRED 0x0004 #define RQCS_ABORTED 0x0005 #define RQCS_TIMEOUT 0x0006 #define RQCS_DATA_OVERRUN 0x0007 +#define RQCS_DRE 0x0011 /* data reassembly error */ +#define RQCS_TABORT 0x0013 /* aborted by target */ #define RQCS_DATA_UNDERRUN 0x0015 -#define RQCS_QUEUE_FULL 0x001C - -/* 1X00 Only Completion Codes */ -#define RQCS_INCOMPLETE 0x0001 -#define RQCS_TRANSPORT_ERROR 0x0003 -#define RQCS_COMMAND_OVERRUN 0x0008 -#define RQCS_STATUS_OVERRUN 0x0009 -#define RQCS_BAD_MESSAGE 0x000a -#define RQCS_NO_MESSAGE_OUT 0x000b -#define RQCS_EXT_ID_FAILED 0x000c -#define RQCS_IDE_MSG_FAILED 0x000d -#define RQCS_ABORT_MSG_FAILED 0x000e -#define RQCS_REJECT_MSG_FAILED 0x000f -#define RQCS_NOP_MSG_FAILED 0x0010 -#define RQCS_PARITY_ERROR_MSG_FAILED 0x0011 -#define RQCS_DEVICE_RESET_MSG_FAILED 0x0012 -#define RQCS_ID_MSG_FAILED 0x0013 -#define RQCS_UNEXP_BUS_FREE 0x0014 -#define RQCS_XACT_ERR1 0x0018 -#define RQCS_XACT_ERR2 0x0019 -#define RQCS_XACT_ERR3 0x001A -#define RQCS_BAD_ENTRY 0x001B -#define RQCS_PHASE_SKIPPED 0x001D -#define RQCS_ARQS_FAILED 0x001E -#define RQCS_WIDE_FAILED 0x001F -#define RQCS_SYNCXFER_FAILED 0x0020 -#define RQCS_LVD_BUSERR 0x0021 - -/* 2X00 Only Completion Codes */ #define RQCS_PORT_UNAVAILABLE 0x0028 #define RQCS_PORT_LOGGED_OUT 0x0029 #define RQCS_PORT_CHANGED 0x002A #define RQCS_PORT_BUSY 0x002B - -/* 24XX Only Completion Codes */ -#define RQCS_24XX_DRE 0x0011 /* data reassembly error */ -#define RQCS_24XX_TABORT 0x0013 /* aborted by target */ -#define RQCS_24XX_ENOMEM 0x002C /* f/w resource unavailable */ -#define RQCS_24XX_TMO 0x0030 /* task management overrun */ - - -/* - * 1X00 specific State Flags - */ -#define RQSF_GOT_BUS 0x0100 -#define RQSF_GOT_TARGET 0x0200 -#define RQSF_SENT_CDB 0x0400 -#define RQSF_XFRD_DATA 0x0800 -#define RQSF_GOT_STATUS 0x1000 -#define RQSF_GOT_SENSE 0x2000 -#define RQSF_XFER_COMPLETE 0x4000 - -/* - * 2X00 specific State Flags - * (same as 1X00 except RQSF_GOT_BUS/RQSF_GOT_TARGET are not available) - */ -#define RQSF_DATA_IN 0x0020 -#define RQSF_DATA_OUT 0x0040 -#define RQSF_STAG 0x0008 -#define RQSF_OTAG 0x0004 -#define RQSF_HTAG 0x0002 -/* - * 1X00 Status Flags - */ -#define RQSTF_DISCONNECT 0x0001 -#define RQSTF_SYNCHRONOUS 0x0002 -#define RQSTF_PARITY_ERROR 0x0004 -#define RQSTF_BUS_RESET 0x0008 -#define RQSTF_DEVICE_RESET 0x0010 -#define RQSTF_ABORTED 0x0020 -#define RQSTF_TIMEOUT 0x0040 -#define RQSTF_NEGOTIATION 0x0080 - -/* - * 2X00 specific state flags - */ -/* RQSF_SENT_CDB */ -/* RQSF_XFRD_DATA */ -/* RQSF_GOT_STATUS */ -/* RQSF_XFER_COMPLETE */ - -/* - * 2X00 specific status flags - */ -/* RQSTF_ABORTED */ -/* RQSTF_TIMEOUT */ -#define RQSTF_DMA_ERROR 0x0080 -#define RQSTF_LOGOUT 0x2000 +#define RQCS_ENOMEM 0x002C /* f/w resource unavailable */ +#define RQCS_TMO 0x0030 /* task management overrun */ /* * About Firmware returns an 'attribute' word. Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Thu Nov 26 18:33:04 2020 (r368078) +++ head/sys/dev/isp/ispvar.h Thu Nov 26 18:47:23 2020 (r368079) @@ -457,7 +457,6 @@ struct ispsoftc { uint8_t isp_revision; /* HBA Chip H/W Revision */ uint8_t isp_nirq; /* number of IRQs */ uint8_t isp_port; /* physical port on a card */ - uint8_t isp_loaded_fw; /* loaded firmware */ uint32_t isp_confopts; /* config options */ /* @@ -465,7 +464,6 @@ struct ispsoftc { */ volatile u_int isp_mboxbsy; /* mailbox command active */ volatile u_int isp_state; - volatile mbreg_t isp_curmbx; /* currently active mailbox command */ volatile uint32_t isp_reqodx; /* index of last ISP pickup */ volatile uint32_t isp_reqidx; /* index of next request */ volatile uint32_t isp_resodx; /* index of next result */ @@ -473,7 +471,6 @@ struct ispsoftc { volatile uint32_t isp_obits; /* mailbox command output */ volatile uint32_t isp_serno; /* rolling serial number */ volatile uint16_t isp_mboxtmp[MAX_MAILBOX]; - volatile uint16_t isp_lastmbxcmd; /* last mbox command sent */ volatile uint16_t isp_seqno; /* running sequence number */ u_int isp_rqovf; /* request queue overflow */ From owner-svn-src-all@freebsd.org Thu Nov 26 18:52:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5735A46CDBF; Thu, 26 Nov 2020 18:52:10 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chn1Q1xL9z4tqH; Thu, 26 Nov 2020 18:52:10 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f173.google.com with SMTP id k26so3269579oiw.0; Thu, 26 Nov 2020 10:52:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rS63zhX6FJ5aaE7U9YbBc9uIpomwR6WGWyTaoPUDWcY=; b=hfoUiITrvtOx0MOW8GjU354I93n6iNkDB5VxgnEc3VYF+m6sOQ0eNowngUX0CePRli hY0Do4cEgteAImDzpb35NszokoBxHDICmGmBxZcZKirnHr45ZlP/RJpmqBXzuwiXi2F4 L858UUqqR9XiHWC3PjZNkWcM/Q5KTMFlBk91xupoLiCnoN9PmokRIJNmwOg8dwqTdgyR Pmaz8FSyjxvmhhd+AGCzqIIz7dHaEZqxYG7Xvh6pHRgGcoszEbPoPU/FgDkvYL/8CEjj kpJ5loxAsCuZtZZcvawvHl9YOAkGYTIN1XgO0p2PNPl911/OfpuFYMqCjmiKF8gQ3Pn7 LakQ== X-Gm-Message-State: AOAM530jiWTagI1IyOWCKsQI3+OxDqdw/wB2/9k0Q9UlMRY8uiQkwLCw rVRaABrjapoGV3ZtnDwmMjXgi0h/1Km8dDag7wzqAh9hV2Q= X-Google-Smtp-Source: ABdhPJy9Bs9w6Sj33M1f1IbIxwSkMOhQHfV9PZ+iEsUot3M9Z8xFjwdZh41CY8xAXQ9fCAZmY0dAm9DZ8RBgY30yHAs= X-Received: by 2002:aca:3e84:: with SMTP id l126mr867271oia.55.1606416729101; Thu, 26 Nov 2020 10:52:09 -0800 (PST) MIME-Version: 1.0 References: <202011260429.0AQ4TV2B023801@repo.freebsd.org> In-Reply-To: From: Alan Somers Date: Thu, 26 Nov 2020 11:51:57 -0700 Message-ID: Subject: Re: svn commit: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk To: "Bjoern A. Zeeb" Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4Chn1Q1xL9z4tqH X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 18:52:10 -0000 On Thu, Nov 26, 2020 at 2:16 AM Bjoern A. Zeeb < bzeeb-lists@lists.zabbadoz.net> wrote: > On 26 Nov 2020, at 4:29, Alan Somers wrote: > > > Author: asomers > > Date: Thu Nov 26 04:29:30 2020 > > New Revision: 368045 > > URL: https://svnweb.freebsd.org/changeset/base/368045 > > > > Log: > > Merge ping6 to ping > > > > There is now a single ping binary, which chooses to use ICMP or > > ICMPv4 > > based on the -4 and -6 options, and the format of the address. > > > > Submitted by: J=C3=A1n Su=C4=8Dan > > Sponsored by: Google LLC (Google Summer of Code 2019) > > MFC after: Never > > Differential Revision: https://reviews.freebsd.org/D21377 > > I don=E2=80=99t have IPv4 anymore. > I don=E2=80=99t see any WITHOUT_INET or -DINET checks. > How can I compile INET out now? > I don't see any such checks before, either. Was it ever possible to exclude ping by building WITHOUT_INET? > > > Also can we please have a ping6 [binary, compat shell script, or > hardlink] back which defaults to -6 with appropriate option parsing by > default? > People used that in scripts and whatnot for about 20 years (and > there=E2=80=99s even still stuff in tools in our own tree referencing it)= . > Done. From owner-svn-src-all@freebsd.org Thu Nov 26 19:38:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3445846E162; Thu, 26 Nov 2020 19:38:03 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chp2M11tJz3D6f; Thu, 26 Nov 2020 19:38:03 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16218A1E; Thu, 26 Nov 2020 19:38:03 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQJc2N6087186; Thu, 26 Nov 2020 19:38:02 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQJc2S2087185; Thu, 26 Nov 2020 19:38:02 GMT (envelope-from se@FreeBSD.org) Message-Id: <202011261938.0AQJc2S2087185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Thu, 26 Nov 2020 19:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368080 - head/usr.bin/gh-bc X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/usr.bin/gh-bc X-SVN-Commit-Revision: 368080 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 19:38:03 -0000 Author: se Date: Thu Nov 26 19:38:02 2020 New Revision: 368080 URL: https://svnweb.freebsd.org/changeset/base/368080 Log: Update Makefile for new version 3.2.0 Modified: head/usr.bin/gh-bc/Makefile Modified: head/usr.bin/gh-bc/Makefile ============================================================================== --- head/usr.bin/gh-bc/Makefile Thu Nov 26 18:47:23 2020 (r368079) +++ head/usr.bin/gh-bc/Makefile Thu Nov 26 19:38:02 2020 (r368080) @@ -9,8 +9,8 @@ BCDIR= ${SRCTOP}/contrib/${PROGNAME} BCVERSION!= sed -n -e '/.*VERSION *= *[0-9]/s/.*VERSION *= *//p' ${BCDIR}/Makefile.in SRCS= args.c data.c file.c lang.c lex.c main.c num.c parse.c program.c read.c vector.c vm.c -SRCS+= bc/bc.c bc/lex.c bc/parse.c dc/dc.c dc/lex.c dc/parse.c history/history.c -SRCS+= bc_help.c dc_help.c lib.c lib2.c opt.c rand/rand.c +SRCS+= bc.c bc_lex.c bc_parse.c dc.c dc_lex.c dc_parse.c history.c library.c +SRCS+= bc_help.c dc_help.c lib.c lib2.c opt.c rand.c MAN= bc.1 dc.1 LINKS= ${BINDIR}/bc ${BINDIR}/dc @@ -96,16 +96,16 @@ NLSLINKS_pt_PT.ISO8859-1+= pt_PT.ISO8859-15 .endif lib.c: lib.bc - cd ${BCDIR} && sh gen/strgen.sh gen/lib.bc ${.OBJDIR}/lib.c bc_lib bc.h bc_lib_name 1 1 + cd ${BCDIR} && sh gen/strgen.sh gen/lib.bc ${.OBJDIR}/lib.c bc_lib bc_lib_name 1 1 lib2.c: lib2.bc - cd ${BCDIR} && sh gen/strgen.sh gen/lib2.bc ${.OBJDIR}/lib2.c bc_lib2 bc.h bc_lib2_name 1 1 + cd ${BCDIR} && sh gen/strgen.sh gen/lib2.bc ${.OBJDIR}/lib2.c bc_lib2 bc_lib2_name 1 1 bc_help.c: bc_help.txt - cd ${BCDIR} && sh gen/strgen.sh gen/bc_help.txt ${.OBJDIR}/bc_help.c bc_help bc.h + cd ${BCDIR} && sh gen/strgen.sh gen/bc_help.txt ${.OBJDIR}/bc_help.c bc_help dc_help.c: dc_help.txt - cd ${BCDIR} && sh gen/strgen.sh gen/dc_help.txt ${.OBJDIR}/dc_help.c dc_help dc.h + cd ${BCDIR} && sh gen/strgen.sh gen/dc_help.txt ${.OBJDIR}/dc_help.c dc_help bc.1: ${CP} ${BCDIR}/manuals/${MAN_SRC_BC} ${.OBJDIR}/bc.1 From owner-svn-src-all@freebsd.org Thu Nov 26 19:49:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1274F46DEB7; Thu, 26 Nov 2020 19:49:23 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChpHQ6yHvz3Ddj; Thu, 26 Nov 2020 19:49:22 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-WLAN.fritz.box (p50806162.dip0.t-ipconnect.de [80.128.97.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 44F8423DD9; Thu, 26 Nov 2020 19:49:22 +0000 (UTC) (envelope-from se@freebsd.org) To: "O. Hartmann" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011261739.0AQHdpe5012982@repo.freebsd.org> <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> From: Stefan Esser Subject: Re: svn commit: r368072 - in head/contrib/bc: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests Message-ID: <95c3e226-6050-2f91-debf-317d6d11494f@freebsd.org> Date: Thu, 26 Nov 2020 20:49:20 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2G5HCRtxQxuyxUK7KLlZTL2fMyBuBvAg7" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 19:49:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2G5HCRtxQxuyxUK7KLlZTL2fMyBuBvAg7 Content-Type: multipart/mixed; boundary="FsAoxbmUuUe0Y5w6qCnYUtYCPXSqZLgCr"; protected-headers="v1" From: Stefan Esser To: "O. Hartmann" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <95c3e226-6050-2f91-debf-317d6d11494f@freebsd.org> Subject: Re: svn commit: r368072 - in head/contrib/bc: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests References: <202011261739.0AQHdpe5012982@repo.freebsd.org> <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> In-Reply-To: <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> --FsAoxbmUuUe0Y5w6qCnYUtYCPXSqZLgCr Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Am 26.11.20 um 19:19 schrieb O. Hartmann: >> svn-src-head@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org= " > Buildworld fails with "don't know how to make bc/bc.c": >=20 > =3D=3D=3D> usr.sbin/ndp (all) > - --- all_subdir_usr.bin --- > make[4]: make[4]: don't know how to make bc/bc.c. Stop Hi Oliver, thanks - I had already noticed that for some reason the Makefile in usr.bin/gh-bc had not been included in the commit. I just checked the command in the shell history and found that I have used a wrong path in the commit: $ cd /usr/svn/base/head $ svn ci contrib/bc usr.bin/bc And that should have been usr.bin/gh-bc ... Sorry for the breakage! I have committed the fix before seeing your mail ... Regards, STefan --FsAoxbmUuUe0Y5w6qCnYUtYCPXSqZLgCr-- --2G5HCRtxQxuyxUK7KLlZTL2fMyBuBvAg7 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAl/ABsAFAwAAAAAACgkQR+u171r99UQm rggAvlaDsER1ye5YTKjYU/RCFUVgpfWZErNgWmOIq5wd96nCrwsRi0ShkJjZvn2V4MeNvWCgSWzC vR0n0S6/8QqQsqn2/EtruHANLGRuMiyTfohHZO0aDZVY1bmJNbLgK97kcmubxHPe38j0bMJiZfcQ 7OgwBdtoSFgaIPU+BgrBOZjoGaSha+gvFaX+piV54gbBUiSrm0E/uhPapY1xHg3Zl4WvFWc4CYjH b08P1dyPgGJ3IADPas6e2EcKayxXIvDvRzAIi5l/Yon4phehgWRu24dqgK8dCc4mobRY0H4Vp5N4 lgFNfYTXTSej/9eUYMDJh2EcC++cSZqlSYSHO2TwVQ== =R/DW -----END PGP SIGNATURE----- --2G5HCRtxQxuyxUK7KLlZTL2fMyBuBvAg7-- From owner-svn-src-all@freebsd.org Thu Nov 26 20:03:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E31DE46EF73; Thu, 26 Nov 2020 20:03:17 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChpbT3Tfrz3FXD; Thu, 26 Nov 2020 20:03:17 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id iNTzk0eKJktFkiNU1keFg0; Thu, 26 Nov 2020 13:03:15 -0700 X-Authority-Analysis: v=2.4 cv=NYRYa0P4 c=1 sm=1 tr=0 ts=5fc00a04 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=nNwsprhYR40A:10 a=6I5d2MoRAAAA:8 a=iaTFZB6CAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=GO3gDogPNiazT_QRQVkA:9 a=CjuIK1q_8ugA:10 a=9hVR9cDKP3oA:10 a=IjZwj45LgO3ly-622nXo:22 a=QWXrQ9iV8q7LKaLQ9lfw:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 1BF44C9C; Thu, 26 Nov 2020 12:03:11 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 0AQK3BTe076596; Thu, 26 Nov 2020 12:03:11 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202011262003.0AQK3BTe076596@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Stefan Esser cc: "O. Hartmann" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r368072 - in head/contrib/bc: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests In-reply-to: <95c3e226-6050-2f91-debf-317d6d11494f@freebsd.org> References: <202011261739.0AQHdpe5012982@repo.freebsd.org> <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> <95c3e226-6050-2f91-debf-317d6d11494f@freebsd.org> Comments: In-reply-to Stefan Esser message dated "Thu, 26 Nov 2020 20:49:20 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 26 Nov 2020 12:03:11 -0800 X-CMAE-Envelope: MS4xfBy88++Bn54eeIh3UcNi+YNGaS8luDXKVwZSOt0FEL/X4mMjh5EtucdmXUgz7znQW1dfen0HZBPmmE6ih0HVWcC/vQo+gy8Ti5t0fdStEkxxgv0KMbnR 3+UBkINRIvBvcrHWxebveXdjs2g3Yiup1HlZDrvw0cpF3hh0ljwNfHF7z3nBZiL0e98X4L4fMQHSd4JDkrheOmp9kcLf0my6EBbUzR4tAL4J8O8TW7GuunrX sLIWB3la6ZYhzIeH4VuADbG8VMp4To9xwaxz3vXzgrapWh2qaaZtit5W1hxM9N2E8eI5HvYiM5js3tgeJjBQ5AkpCRDrAplqTR9qendstaA= X-Rspamd-Queue-Id: 4ChpbT3Tfrz3FXD X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 20:03:17 -0000 In message <95c3e226-6050-2f91-debf-317d6d11494f@freebsd.org>, Stefan Esser wri tes: > This is an OpenPGP/MIME signed message (RFC 4880 and 3156) > --2G5HCRtxQxuyxUK7KLlZTL2fMyBuBvAg7 > Content-Type: multipart/mixed; boundary="FsAoxbmUuUe0Y5w6qCnYUtYCPXSqZLgCr"; > protected-headers="v1" > From: Stefan Esser > To: "O. Hartmann" > Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-head@freebsd.org > Message-ID: <95c3e226-6050-2f91-debf-317d6d11494f@freebsd.org> > Subject: Re: svn commit: r368072 - in head/contrib/bc: . gen include manuals > manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests > References: <202011261739.0AQHdpe5012982@repo.freebsd.org> > <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> > In-Reply-To: <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> > > --FsAoxbmUuUe0Y5w6qCnYUtYCPXSqZLgCr > Content-Type: text/plain; charset=utf-8; format=flowed > Content-Language: en-US > Content-Transfer-Encoding: quoted-printable > > Am 26.11.20 um 19:19 schrieb O. Hartmann: > >> svn-src-head@freebsd.org mailing list > >> https://lists.freebsd.org/mailman/listinfo/svn-src-head > >> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org= > " > > Buildworld fails with "don't know how to make bc/bc.c": > >=20 > > =3D=3D=3D> usr.sbin/ndp (all) > > - --- all_subdir_usr.bin --- > > make[4]: make[4]: don't know how to make bc/bc.c. Stop > > Hi Oliver, > > thanks - I had already noticed that for some reason the Makefile > in usr.bin/gh-bc had not been included in the commit. > > I just checked the command in the shell history and found that > I have used a wrong path in the commit: > > $ cd /usr/svn/base/head > $ svn ci contrib/bc usr.bin/bc > > And that should have been usr.bin/gh-bc ... > > Sorry for the breakage! I have committed the fix before seeing > your mail ... > > Regards, STefan But this is still a problem: ld: error: undefined symbol: bc_lib_name >>> referenced by vm.c:752 (/opt/src/svn-current/contrib/bc/src/vm.c:752) >>> lto.tmp:(bc_vm_boot) ld: error: undefined symbol: bc_lib >>> referenced by lex.c:225 (/opt/src/svn-current/contrib/bc/src/lex.c:225) >>> lto.tmp:(bc_vm_boot) >>> referenced by lex.c:227 (/opt/src/svn-current/contrib/bc/src/lex.c:227) >>> lto.tmp:(bc_vm_boot) cc: error: linker command failed with exit code 1 (use -v to see invocation) *** [gh-bc.full] Error code 1 make[4]: stopped in /opt/src/svn-current/usr.bin/gh-bc -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Thu Nov 26 20:22:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57C7E46F17B; Thu, 26 Nov 2020 20:22: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chq1l21vvz3G3h; Thu, 26 Nov 2020 20:22:35 +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 3878F12E7; Thu, 26 Nov 2020 20:22:35 +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 0AQKMZ1d018003; Thu, 26 Nov 2020 20:22:35 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQKMZaa018002; Thu, 26 Nov 2020 20:22:35 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011262022.0AQKMZaa018002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 26 Nov 2020 20:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368081 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 368081 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 20:22:35 -0000 Author: manu Date: Thu Nov 26 20:22:34 2020 New Revision: 368081 URL: https://svnweb.freebsd.org/changeset/base/368081 Log: arm64: Do not rely on SPCR table to detect acpi Since EDK2 commit d8e36289cef7bde628b023219cd65fa8e8d4562a, the Graphical console may completely hide SPCR, causing panics later when locating timers. As such simply rely on the ACPI Root pointer presence. Submitted by: dan.kotowski@a9development.com Reviewed by: andrew, mw Differential Revision: https://reviews.freebsd.org/D27306 Modified: head/sys/arm64/arm64/machdep.c Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Thu Nov 26 19:38:02 2020 (r368080) +++ head/sys/arm64/arm64/machdep.c Thu Nov 26 20:22:34 2020 (r368081) @@ -1036,7 +1036,7 @@ bus_probe(void) has_fdt = (OF_peer(0) != 0); #endif #ifdef DEV_ACPI - has_acpi = (acpi_find_table(ACPI_SIG_SPCR) != 0); + has_acpi = (AcpiOsGetRootPointer() != 0); #endif env = kern_getenv("kern.cfg.order"); From owner-svn-src-all@freebsd.org Thu Nov 26 20:23:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2D4346F70C; Thu, 26 Nov 2020 20:23:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chq2Y6ZDHz3GSx; Thu, 26 Nov 2020 20:23:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4A8810BF; Thu, 26 Nov 2020 20:23:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQKNHqS018089; Thu, 26 Nov 2020 20:23:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQKNHQ7018088; Thu, 26 Nov 2020 20:23:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011262023.0AQKNHQ7018088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 Nov 2020 20:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368082 - head/lib/libthr/thread X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libthr/thread X-SVN-Commit-Revision: 368082 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 20:23:18 -0000 Author: kib Date: Thu Nov 26 20:23:17 2020 New Revision: 368082 URL: https://svnweb.freebsd.org/changeset/base/368082 Log: Style. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/lib/libthr/thread/thr_attr.c Modified: head/lib/libthr/thread/thr_attr.c ============================================================================== --- head/lib/libthr/thread/thr_attr.c Thu Nov 26 20:22:34 2020 (r368081) +++ head/lib/libthr/thread/thr_attr.c Thu Nov 26 20:23:17 2020 (r368082) @@ -134,7 +134,7 @@ _thr_attr_destroy(pthread_attr_t *attr) *attr = NULL; ret = 0; } - return(ret); + return (ret); } __weak_reference(_thr_attr_get_np, pthread_attr_get_np); @@ -196,7 +196,7 @@ _thr_attr_getdetachstate(const pthread_attr_t *attr, i *detachstate = PTHREAD_CREATE_JOINABLE; ret = 0; } - return(ret); + return (ret); } __weak_reference(_thr_attr_getguardsize, pthread_attr_getguardsize); @@ -216,7 +216,7 @@ _thr_attr_getguardsize(const pthread_attr_t * __restri *guardsize = (*attr)->guardsize_attr; ret = 0; } - return(ret); + return (ret); } __weak_reference(_thr_attr_getinheritsched, pthread_attr_getinheritsched); @@ -233,7 +233,7 @@ _thr_attr_getinheritsched(const pthread_attr_t * __res else *sched_inherit = (*attr)->sched_inherit; - return(ret); + return (ret); } __weak_reference(_thr_attr_getschedparam, pthread_attr_getschedparam); @@ -250,7 +250,7 @@ _thr_attr_getschedparam(const pthread_attr_t * __restr else param->sched_priority = (*attr)->prio; - return(ret); + return (ret); } __weak_reference(_thr_attr_getschedpolicy, pthread_attr_getschedpolicy); @@ -267,7 +267,7 @@ _thr_attr_getschedpolicy(const pthread_attr_t * __rest else *policy = (*attr)->sched_policy; - return(ret); + return (ret); } __weak_reference(_thr_attr_getscope, pthread_attr_getscope); @@ -287,7 +287,7 @@ _thr_attr_getscope(const pthread_attr_t * __restrict a *contentionscope = (*attr)->flags & PTHREAD_SCOPE_SYSTEM ? PTHREAD_SCOPE_SYSTEM : PTHREAD_SCOPE_PROCESS; - return(ret); + return (ret); } __weak_reference(_pthread_attr_getstack, pthread_attr_getstack); @@ -308,7 +308,7 @@ _pthread_attr_getstack(const pthread_attr_t * __restri *stacksize = (*attr)->stacksize_attr; ret = 0; } - return(ret); + return (ret); } __weak_reference(_thr_attr_getstackaddr, pthread_attr_getstackaddr); @@ -327,7 +327,7 @@ _thr_attr_getstackaddr(const pthread_attr_t *attr, voi *stackaddr = (*attr)->stackaddr_attr; ret = 0; } - return(ret); + return (ret); } __weak_reference(_thr_attr_getstacksize, pthread_attr_getstacksize); @@ -347,7 +347,7 @@ _thr_attr_getstacksize(const pthread_attr_t * __restri *stacksize = (*attr)->stacksize_attr; ret = 0; } - return(ret); + return (ret); } __weak_reference(_thr_attr_init, pthread_attr_init); @@ -373,7 +373,7 @@ _thr_attr_init(pthread_attr_t *attr) *attr = pattr; ret = 0; } - return(ret); + return (ret); } __weak_reference(_pthread_attr_setcreatesuspend_np, pthread_attr_setcreatesuspend_np); @@ -389,7 +389,7 @@ _pthread_attr_setcreatesuspend_np(pthread_attr_t *attr (*attr)->suspend = THR_CREATE_SUSPENDED; ret = 0; } - return(ret); + return (ret); } __weak_reference(_thr_attr_setdetachstate, pthread_attr_setdetachstate); @@ -415,7 +415,7 @@ _thr_attr_setdetachstate(pthread_attr_t *attr, int det (*attr)->flags &= ~PTHREAD_DETACHED; ret = 0; } - return(ret); + return (ret); } __weak_reference(_thr_attr_setguardsize, pthread_attr_setguardsize); @@ -434,7 +434,7 @@ _thr_attr_setguardsize(pthread_attr_t *attr, size_t gu (*attr)->guardsize_attr = guardsize; ret = 0; } - return(ret); + return (ret); } __weak_reference(_thr_attr_setinheritsched, pthread_attr_setinheritsched); @@ -453,7 +453,7 @@ _thr_attr_setinheritsched(pthread_attr_t *attr, int sc else (*attr)->sched_inherit = sched_inherit; - return(ret); + return (ret); } __weak_reference(_thr_attr_setschedparam, pthread_attr_setschedparam); @@ -506,7 +506,7 @@ _thr_attr_setschedpolicy(pthread_attr_t *attr, int pol (*attr)->sched_policy = policy; (*attr)->prio = _thr_priorities[policy-1].pri_default; } - return(ret); + return (ret); } __weak_reference(_thr_attr_setscope, pthread_attr_setscope); @@ -549,7 +549,7 @@ _pthread_attr_setstack(pthread_attr_t *attr, void *sta (*attr)->stacksize_attr = stacksize; ret = 0; } - return(ret); + return (ret); } __weak_reference(_thr_attr_setstackaddr, pthread_attr_setstackaddr); @@ -587,7 +587,7 @@ _thr_attr_setstacksize(pthread_attr_t *attr, size_t st (*attr)->stacksize_attr = stacksize; ret = 0; } - return(ret); + return (ret); } static size_t From owner-svn-src-all@freebsd.org Thu Nov 26 20:27:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 86DC146F5BF; Thu, 26 Nov 2020 20:27:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chq7H3Th4z3GlW; Thu, 26 Nov 2020 20:27:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A83D12EE; Thu, 26 Nov 2020 20:27:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQKRN2e018345; Thu, 26 Nov 2020 20:27:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQKRNOB018344; Thu, 26 Nov 2020 20:27:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011262027.0AQKRNOB018344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 Nov 2020 20:27:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368083 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 368083 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 20:27:23 -0000 Author: kib Date: Thu Nov 26 20:27:23 2020 New Revision: 368083 URL: https://svnweb.freebsd.org/changeset/base/368083 Log: Remove stray column. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/lib/libc/gen/_pthread_stubs.c Modified: head/lib/libc/gen/_pthread_stubs.c ============================================================================== --- head/lib/libc/gen/_pthread_stubs.c Thu Nov 26 20:23:17 2020 (r368082) +++ head/lib/libc/gen/_pthread_stubs.c Thu Nov 26 20:27:23 2020 (r368083) @@ -285,7 +285,7 @@ STUB_FUNC2(pthread_setcanceltype, PJT_SETCANCELTYPE, i STUB_FUNC(pthread_testcancel, PJT_TESTCANCEL, void) STUB_FUNC1(__pthread_cleanup_pop_imp, PJT_CLEANUP_POP_IMP, void, int) STUB_FUNC3(__pthread_cleanup_push_imp, PJT_CLEANUP_PUSH_IMP, void, void *, - void *, void *); + void *, void *) STUB_FUNC1(_pthread_cancel_enter, PJT_CANCEL_ENTER, void, int) STUB_FUNC1(_pthread_cancel_leave, PJT_CANCEL_LEAVE, void, int) From owner-svn-src-all@freebsd.org Thu Nov 26 21:23:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 107D8471074; Thu, 26 Nov 2020 21:23:25 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChrMt4sGZz3PkY; Thu, 26 Nov 2020 21:23:21 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-WLAN.fritz.box (p50806162.dip0.t-ipconnect.de [80.128.97.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id C4F6F24EBD; Thu, 26 Nov 2020 21:23:18 +0000 (UTC) (envelope-from se@freebsd.org) To: Cy Schubert Cc: "O. Hartmann" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011261739.0AQHdpe5012982@repo.freebsd.org> <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> <95c3e226-6050-2f91-debf-317d6d11494f@freebsd.org> <202011262003.0AQK3BTe076596@slippy.cwsent.com> From: Stefan Esser Subject: Re: svn commit: r368072 - in head/contrib/bc: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests Message-ID: Date: Thu, 26 Nov 2020 22:23:17 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <202011262003.0AQK3BTe076596@slippy.cwsent.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="maOtBJEdTLpVHYJ8ME4Ow5t7gyU1h0CIy" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 21:23:25 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --maOtBJEdTLpVHYJ8ME4Ow5t7gyU1h0CIy Content-Type: multipart/mixed; boundary="m8M7hYutSXzrBuT8orVd2JNQQPKxzBZwZ"; protected-headers="v1" From: Stefan Esser To: Cy Schubert Cc: "O. Hartmann" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r368072 - in head/contrib/bc: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests References: <202011261739.0AQHdpe5012982@repo.freebsd.org> <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> <95c3e226-6050-2f91-debf-317d6d11494f@freebsd.org> <202011262003.0AQK3BTe076596@slippy.cwsent.com> In-Reply-To: <202011262003.0AQK3BTe076596@slippy.cwsent.com> --m8M7hYutSXzrBuT8orVd2JNQQPKxzBZwZ Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Am 26.11.20 um 21:03 schrieb Cy Schubert:> But this is still a problem: >=20 > ld: error: undefined symbol: bc_lib_name >>>> referenced by vm.c:752 (/opt/src/svn-current/contrib/bc/src/vm.c:752= ) >>>> lto.tmp:(bc_vm_boot) >=20 > ld: error: undefined symbol: bc_lib >>>> referenced by lex.c:225 (/opt/src/svn-current/contrib/bc/src/lex.c:2= 25) >>>> lto.tmp:(bc_vm_boot) >>>> referenced by lex.c:227 (/opt/src/svn-current/contrib/bc/src/lex.c:2= 27) >>>> lto.tmp:(bc_vm_boot) > cc: error: linker command failed with exit code 1 (use -v to see invoca= tion) > *** [gh-bc.full] Error code 1 I cannot reproduce this issue on my system. The symbols are defined in files generated by gen/strgen.sh and there was a change in the parameters passed to this script, but I had fixed usr.bin/gh-bc/Makefile accordingly (first in the port and then in base). The generated file lib.c should start like this: ----------------------------------------------------------------- // Copyright (c) 2018-2020 Gavin D. Howard and contributors. // Licensed under the 2-clause BSD license. // *** AUTOMATICALLY GENERATED FROM gen/lib.bc. DO NOT MODIFY. *** #if 1 extern const char *bc_lib_name; extern const char bc_lib[]; const char *bc_lib_name =3D "gen/lib.bc"; const char bc_lib[] =3D "scale=3D20\n" ----------------------------------------------------------------- This file is generated by this rule in usr.bin/gh-bc/Makefile: lib.c: lib.bc cd ${BCDIR} && sh gen/strgen.sh gen/lib.bc=20 ${.OBJDIR}/lib.c bc_lib bc_lib_name 1 1 By a script that assigns parameters to variables: input=3D"$1" output=3D"$2" name=3D"$3" label=3D"$4" define=3D"$5" remove_tabs=3D"$6" And label=3D"bc_lib_name" is used to generate lib.c as included above (passed as 4th parameter). I'm rebuilding a clean world, now, but I'd be surprised if it failed after succeeding before readying the commit ... Regards, STefan --m8M7hYutSXzrBuT8orVd2JNQQPKxzBZwZ-- --maOtBJEdTLpVHYJ8ME4Ow5t7gyU1h0CIy Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAl/AHMUFAwAAAAAACgkQR+u171r99USD UQf8Dj9o/OUbC355s/FyrADVuwd6pnaMWyaIpUjMp+bQV+xL+7sMcyrjaXlz7/+aEkrAbEGQhxCF cogDTtGf+68HIl2/H4NepMVP2zCodbqeFM10NiLeKCF/cTThMfjwjic/+4u9M00aQlIMujs6uO/L G7CB3iEX7Sj7OCk/QWAi/rCmLGZ9Q+cAIGUO25iD9/Txc08U/NHE3px2Db0G6gt+rH4duTwZG635 4ZnZ+Qzea7on+ypk6bCC2Jz5jBtqWjoVf7zIzmJFbDQ/7nGVmLJYTduF254i94lFNzFMeEifezzn vYEJEpHAYFeRc4ovaHV5khcwfcWFIk3pacARDwcTPQ== =Ht8B -----END PGP SIGNATURE----- --maOtBJEdTLpVHYJ8ME4Ow5t7gyU1h0CIy-- From owner-svn-src-all@freebsd.org Thu Nov 26 22:23:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83CB5472ACE; Thu, 26 Nov 2020 22:23:14 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chshy33G6z3kH4; Thu, 26 Nov 2020 22:23:14 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-WLAN.fritz.box (p50806162.dip0.t-ipconnect.de [80.128.97.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 9F13125F36; Thu, 26 Nov 2020 22:23:13 +0000 (UTC) (envelope-from se@freebsd.org) From: Stefan Esser To: Cy Schubert Cc: "O. Hartmann" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011261739.0AQHdpe5012982@repo.freebsd.org> <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> <95c3e226-6050-2f91-debf-317d6d11494f@freebsd.org> <202011262003.0AQK3BTe076596@slippy.cwsent.com> Subject: Re: svn commit: r368072 - in head/contrib/bc: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests Message-ID: <94afc036-0c96-589b-47a4-7d9972b642cc@freebsd.org> Date: Thu, 26 Nov 2020 23:23:11 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LNh7JZBKUks6iTmPthYYHSJRZLxtgUw39" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 22:23:14 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LNh7JZBKUks6iTmPthYYHSJRZLxtgUw39 Content-Type: multipart/mixed; boundary="UukPFASfKyppXv6KjFIjzyho2LVowmUF8"; protected-headers="v1" From: Stefan Esser To: Cy Schubert Cc: "O. Hartmann" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <94afc036-0c96-589b-47a4-7d9972b642cc@freebsd.org> Subject: Re: svn commit: r368072 - in head/contrib/bc: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests References: <202011261739.0AQHdpe5012982@repo.freebsd.org> <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> <95c3e226-6050-2f91-debf-317d6d11494f@freebsd.org> <202011262003.0AQK3BTe076596@slippy.cwsent.com> In-Reply-To: --UukPFASfKyppXv6KjFIjzyho2LVowmUF8 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: de-DE Content-Transfer-Encoding: quoted-printable FYI: Another "make buildworld" has succeeded on my system. I cannot reproduce the issue your report and need more information from your system, e.g. a TAR file with the contents of usr.bin/gh-bc, contrib/bc and your object directory ${.OBJDIR}. Regards, STefan Am 26.11.20 um 22:23 schrieb Stefan Esser: > Am 26.11.20 um 21:03 schrieb Cy Schubert:> But this is still a problem:= >> >> ld: error: undefined symbol: bc_lib_name >>>>> referenced by vm.c:752 (/opt/src/svn-current/contrib/bc/src/vm.c:75= 2) >>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 lto.tmp:(bc_vm_boot) >> >> ld: error: undefined symbol: bc_lib >>>>> referenced by lex.c:225=20 >>>>> (/opt/src/svn-current/contrib/bc/src/lex.c:225) >>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 lto.tmp:(bc_vm_boot) >>>>> referenced by lex.c:227=20 >>>>> (/opt/src/svn-current/contrib/bc/src/lex.c:227) >>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 lto.tmp:(bc_vm_boot) >> cc: error: linker command failed with exit code 1 (use -v to see=20 >> invocation) >> *** [gh-bc.full] Error code 1 >=20 > I cannot reproduce this issue on my system. >=20 > The symbols are defined in files generated by gen/strgen.sh and > there was a change in the parameters passed to this script, but > I had fixed usr.bin/gh-bc/Makefile accordingly (first in the port > and then in base). >=20 > The generated file lib.c should start like this: > ----------------------------------------------------------------- > // Copyright (c) 2018-2020 Gavin D. Howard and contributors. > // Licensed under the 2-clause BSD license. > // *** AUTOMATICALLY GENERATED FROM gen/lib.bc. DO NOT MODIFY. *** >=20 > #if 1 > extern const char *bc_lib_name; >=20 > extern const char bc_lib[]; >=20 > const char *bc_lib_name =3D "gen/lib.bc"; >=20 > const char bc_lib[] =3D > "scale=3D20\n" > ----------------------------------------------------------------- >=20 > This file is generated by this rule in usr.bin/gh-bc/Makefile: >=20 > lib.c:=A0=A0=A0=A0=A0=A0=A0=A0=A0 lib.bc > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 cd ${BCDIR} && sh gen/st= rgen.sh gen/lib.bc=20 > ${.OBJDIR}/lib.c bc_lib bc_lib_name 1 1 >=20 > By a script that assigns parameters to variables: >=20 > input=3D"$1" > output=3D"$2" > name=3D"$3" > label=3D"$4" > define=3D"$5" > remove_tabs=3D"$6" >=20 > And label=3D"bc_lib_name" is used to generate lib.c as included > above (passed as 4th parameter). >=20 > I'm rebuilding a clean world, now, but I'd be surprised if it failed > after succeeding before readying the commit ... >=20 > Regards, STefan >=20 --UukPFASfKyppXv6KjFIjzyho2LVowmUF8-- --LNh7JZBKUks6iTmPthYYHSJRZLxtgUw39 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAl/AKs8FAwAAAAAACgkQR+u171r99UTb PQgAyB516biVoiagMuoLx2hEWmFtSVi81YJp89y0LMutWOiQNEqo7vSjDSp8lQFIxzLvuJs3ycyb tv3LdoHVZHAJHUc/Tyxzs2DAbiUnyF5p6zhYRkUIZjnW7NVF0PF5MiWZzhMjnNOczsFPdrBvY6Ey q1UoxrPLBFXavi53Q36q9ZuJFI7cv1l5Vsll+G0tAZzu4PXJQ6EDRhkQGpGWbvDb3gqIjnc2peEE tT0JfT6jo6/hNPTTvFo8McYeiwYqAXooa+mH/xjbq3WjGZ9s+vknr+pleH5YGYEP8NaNc+bzxZLk pehxZTxhS71hnvwtgf6ZWiH1QNzRNuWacHkPJy9gQg== =Vfzz -----END PGP SIGNATURE----- --LNh7JZBKUks6iTmPthYYHSJRZLxtgUw39-- From owner-svn-src-all@freebsd.org Thu Nov 26 22:48:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B19A5473804; Thu, 26 Nov 2020 22:48:02 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChtFZ1zzhz3lBS; Thu, 26 Nov 2020 22:48:01 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id iQ3Pk1l04ktFkiQ3QkexBR; Thu, 26 Nov 2020 15:47:57 -0700 X-Authority-Analysis: v=2.4 cv=NYRYa0P4 c=1 sm=1 tr=0 ts=5fc030a0 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=nNwsprhYR40A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=iaTFZB6CAAAA:8 a=VxmjJ2MpAAAA:8 a=EkcXrb_YAAAA:8 a=GY2cRAgL2TZMnOFPKX8A:9 a=CjuIK1q_8ugA:10 a=rBBtE5aJX-cA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=QWXrQ9iV8q7LKaLQ9lfw:22 a=7gXAzLPJhVmCkEl4_tsf:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id A282610B1; Thu, 26 Nov 2020 14:47:54 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 0AQMlrE5071306; Thu, 26 Nov 2020 14:47:53 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202011262247.0AQMlrE5071306@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Stefan Esser cc: Cy Schubert , "O. Hartmann" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r368072 - in head/contrib/bc: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests In-reply-to: References: <202011261739.0AQHdpe5012982@repo.freebsd.org> <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> <95c3e226-6050-2f91-debf-317d6d11494f@freebsd.org> <202011262003.0AQK3BTe076596@slippy.cwsent.com> Comments: In-reply-to Stefan Esser message dated "Thu, 26 Nov 2020 22:23:17 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 26 Nov 2020 14:47:53 -0800 X-CMAE-Envelope: MS4xfPB2+lA0Sh3nN6lx7pV8oessqv2J5HXx4vUf5EwzUzOPpcB+EIQHGBt9JKWMSYAxjjzwBRDtTCGTBuXDOg2hIEQYjgvJhopBXUKl1gywFus2ngcuCqxA QzBZp3XdERHfQx+i45sER1P3pSrthDSrCPAE5/8ryFPyn1J43dLFMnWX72isOCh7bYv29AGrj7O9p6jh9JMF6v/vGpNRMVxJEULIIcFII9felOTF8dX4swcF jTl1T82DgOCrOFYADXPzFOGFuV3YDwQimeOOCB+qiLf8poFDya9MKuxOUcxb5nkaRKGxBa9brrH9FSSkJFAgFIj6xsKIFmxfm+bGj0wCRZo= X-Rspamd-Queue-Id: 4ChtFZ1zzhz3lBS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 22:48:02 -0000 In message , Stefan Esser wri tes: > This is an OpenPGP/MIME signed message (RFC 4880 and 3156) > --maOtBJEdTLpVHYJ8ME4Ow5t7gyU1h0CIy > Content-Type: multipart/mixed; boundary="m8M7hYutSXzrBuT8orVd2JNQQPKxzBZwZ"; > protected-headers="v1" > From: Stefan Esser > To: Cy Schubert > Cc: "O. Hartmann" , src-committers@freebsd.org, > svn-src-all@freebsd.org, svn-src-head@freebsd.org > Message-ID: > Subject: Re: svn commit: r368072 - in head/contrib/bc: . gen include manuals > manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests > References: <202011261739.0AQHdpe5012982@repo.freebsd.org> > <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> > <95c3e226-6050-2f91-debf-317d6d11494f@freebsd.org> > <202011262003.0AQK3BTe076596@slippy.cwsent.com> > In-Reply-To: <202011262003.0AQK3BTe076596@slippy.cwsent.com> > > --m8M7hYutSXzrBuT8orVd2JNQQPKxzBZwZ > Content-Type: text/plain; charset=windows-1252; format=flowed > Content-Language: en-US > Content-Transfer-Encoding: quoted-printable > > Am 26.11.20 um 21:03 schrieb Cy Schubert:> But this is still a problem: > >=20 > > ld: error: undefined symbol: bc_lib_name > >>>> referenced by vm.c:752 (/opt/src/svn-current/contrib/bc/src/vm.c:752= > ) > >>>> lto.tmp:(bc_vm_boot) > >=20 > > ld: error: undefined symbol: bc_lib > >>>> referenced by lex.c:225 (/opt/src/svn-current/contrib/bc/src/lex.c:2= > 25) > >>>> lto.tmp:(bc_vm_boot) > >>>> referenced by lex.c:227 (/opt/src/svn-current/contrib/bc/src/lex.c:2= > 27) > >>>> lto.tmp:(bc_vm_boot) > > cc: error: linker command failed with exit code 1 (use -v to see invoca= > tion) > > *** [gh-bc.full] Error code 1 > > I cannot reproduce this issue on my system. > > The symbols are defined in files generated by gen/strgen.sh and > there was a change in the parameters passed to this script, but > I had fixed usr.bin/gh-bc/Makefile accordingly (first in the port > and then in base). > > The generated file lib.c should start like this: > ----------------------------------------------------------------- > // Copyright (c) 2018-2020 Gavin D. Howard and contributors. > // Licensed under the 2-clause BSD license. > // *** AUTOMATICALLY GENERATED FROM gen/lib.bc. DO NOT MODIFY. *** > > #if 1 > extern const char *bc_lib_name; > > extern const char bc_lib[]; > > const char *bc_lib_name =3D "gen/lib.bc"; > > const char bc_lib[] =3D > "scale=3D20\n" > ----------------------------------------------------------------- > > This file is generated by this rule in usr.bin/gh-bc/Makefile: > > lib.c: lib.bc > cd ${BCDIR} && sh gen/strgen.sh gen/lib.bc=20 > ${.OBJDIR}/lib.c bc_lib bc_lib_name 1 1 > > By a script that assigns parameters to variables: > > input=3D"$1" > output=3D"$2" > name=3D"$3" > label=3D"$4" > define=3D"$5" > remove_tabs=3D"$6" > > And label=3D"bc_lib_name" is used to generate lib.c as included > above (passed as 4th parameter). > > I'm rebuilding a clean world, now, but I'd be surprised if it failed > after succeeding before readying the commit ... A clean build (sort of) did fix it: rm the appropriate subdir actually. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Thu Nov 26 22:49:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87F20473811; Thu, 26 Nov 2020 22:49:06 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChtGp2FsWz3lSR; Thu, 26 Nov 2020 22:49:06 +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 3B0373032; Thu, 26 Nov 2020 22:49:06 +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 0AQMn6MW013478; Thu, 26 Nov 2020 22:49:06 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQMn6nL013477; Thu, 26 Nov 2020 22:49:06 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011262249.0AQMn6nL013477@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: Thu, 26 Nov 2020 22:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368084 - head/lib/libprocstat X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/lib/libprocstat X-SVN-Commit-Revision: 368084 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 22:49:06 -0000 Author: 0mp (doc,ports committer) Date: Thu Nov 26 22:49:05 2020 New Revision: 368084 URL: https://svnweb.freebsd.org/changeset/base/368084 Log: libprocstat.3: Correct two occurrences of kvm_getprocs to procstat_getprocs Submitted by: otis_sk.freebsd.org Reviewed by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D26151 Modified: head/lib/libprocstat/libprocstat.3 Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Thu Nov 26 20:27:23 2020 (r368083) +++ head/lib/libprocstat/libprocstat.3 Thu Nov 26 22:49:05 2020 (r368084) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 29, 2017 +.Dd November 26, 2020 .Dt LIBPROCSTAT 3 .Os .Sh NAME @@ -345,7 +345,7 @@ structure from one of the functions, a pointer to .Vt kinfo_proc structure from the array obtained from the -.Fn kvm_getprocs +.Fn procstat_getprocs function, and returns a null-terminated argument vector that corresponds to the command line arguments passed to the process. The @@ -402,7 +402,7 @@ structure initialized with one of the functions, a pointer to .Vt kinfo_proc structure from the array obtained from the -.Fn kvm_getprocs +.Fn procstat_getprocs function, and returns a dynamically allocated linked list of filled in .Vt filestat_list structures using the STAILQ macros defined in From owner-svn-src-all@freebsd.org Thu Nov 26 22:49:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85374473546; Thu, 26 Nov 2020 22:49:39 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChtHR0dTGz3lcH; Thu, 26 Nov 2020 22:49:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id iQ52k1lfQktFkiQ53kexe3; Thu, 26 Nov 2020 15:49:38 -0700 X-Authority-Analysis: v=2.4 cv=NYRYa0P4 c=1 sm=1 tr=0 ts=5fc03102 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=nNwsprhYR40A:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=iaTFZB6CAAAA:8 a=VxmjJ2MpAAAA:8 a=URlIQRexi9ZdSdjzFIUA:9 a=CjuIK1q_8ugA:10 a=Mtf76EmLPjYA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=QWXrQ9iV8q7LKaLQ9lfw:22 a=7gXAzLPJhVmCkEl4_tsf:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 1C7B71071; Thu, 26 Nov 2020 14:49:36 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 0AQMnZvB071334; Thu, 26 Nov 2020 14:49:35 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202011262249.0AQMnZvB071334@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Stefan Esser cc: Cy Schubert , "O. Hartmann" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r368072 - in head/contrib/bc: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests In-reply-to: <94afc036-0c96-589b-47a4-7d9972b642cc@freebsd.org> References: <202011261739.0AQHdpe5012982@repo.freebsd.org> <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> <95c3e226-6050-2f91-debf-317d6d11494f@freebsd.org> <202011262003.0AQK3BTe076596@slippy.cwsent.com> <94afc036-0c96-589b-47a4-7d9972b642cc@freebsd.org> Comments: In-reply-to Stefan Esser message dated "Thu, 26 Nov 2020 23:23:11 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 26 Nov 2020 14:49:35 -0800 X-CMAE-Envelope: MS4xfCBRtzbaUUZ8eOWo7r5DQKvjsABB5dFiMYMx+JuhKAzUqRsBmKjAulP3khiPb1XR78iuWtJ0h4hXEdCQiWgxrjOxrMUYKFoe4kLp1x0cUbH9RakWC/Yd ycxCvTx7C3rk6suFWLTDx1wU5ufle9xsSjmy79F1OUb6Mlb8RZTyN35dF4yvmFLSefDF28fluEfG9GEzXSdyKLElrfw+lxbJFPcy++JL2xYmtDX/uBlLnJnd fH9gXef+PWEwPG3tkdGZ2Ffg3bMBtFju/zhbhP5wPw/JOcj5lj5ugNDX12cs/mWkCFy8DkOx7WDe/mdtT+gSB8azbhAJ5LT72ZpKaEPDMPc= X-Rspamd-Queue-Id: 4ChtHR0dTGz3lcH X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 22:49:39 -0000 Just came in from outside to check my buildworld. Removing the gh-bc subdir in obj fixed it. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. In message <94afc036-0c96-589b-47a4-7d9972b642cc@freebsd.org>, Stefan Esser wri tes: > This is an OpenPGP/MIME signed message (RFC 4880 and 3156) > --LNh7JZBKUks6iTmPthYYHSJRZLxtgUw39 > Content-Type: multipart/mixed; boundary="UukPFASfKyppXv6KjFIjzyho2LVowmUF8"; > protected-headers="v1" > From: Stefan Esser > To: Cy Schubert > Cc: "O. Hartmann" , src-committers@freebsd.org, > svn-src-all@freebsd.org, svn-src-head@freebsd.org > Message-ID: <94afc036-0c96-589b-47a4-7d9972b642cc@freebsd.org> > Subject: Re: svn commit: r368072 - in head/contrib/bc: . gen include manuals > manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests > References: <202011261739.0AQHdpe5012982@repo.freebsd.org> > <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> > <95c3e226-6050-2f91-debf-317d6d11494f@freebsd.org> > <202011262003.0AQK3BTe076596@slippy.cwsent.com> > > In-Reply-To: > > --UukPFASfKyppXv6KjFIjzyho2LVowmUF8 > Content-Type: text/plain; charset=windows-1252; format=flowed > Content-Language: de-DE > Content-Transfer-Encoding: quoted-printable > > FYI: Another "make buildworld" has succeeded on my system. > > I cannot reproduce the issue your report and need more > information from your system, e.g. a TAR file with the > contents of usr.bin/gh-bc, contrib/bc and your object > directory ${.OBJDIR}. > > Regards, STefan > > Am 26.11.20 um 22:23 schrieb Stefan Esser: > > Am 26.11.20 um 21:03 schrieb Cy Schubert:> But this is still a problem:= > > >> > >> ld: error: undefined symbol: bc_lib_name > >>>>> referenced by vm.c:752 (/opt/src/svn-current/contrib/bc/src/vm.c:75= > 2) > >>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 lto.tmp:(bc_vm_boot) > >> > >> ld: error: undefined symbol: bc_lib > >>>>> referenced by lex.c:225=20 > >>>>> (/opt/src/svn-current/contrib/bc/src/lex.c:225) > >>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 lto.tmp:(bc_vm_boot) > >>>>> referenced by lex.c:227=20 > >>>>> (/opt/src/svn-current/contrib/bc/src/lex.c:227) > >>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 lto.tmp:(bc_vm_boot) > >> cc: error: linker command failed with exit code 1 (use -v to see=20 > >> invocation) > >> *** [gh-bc.full] Error code 1 > >=20 > > I cannot reproduce this issue on my system. > >=20 > > The symbols are defined in files generated by gen/strgen.sh and > > there was a change in the parameters passed to this script, but > > I had fixed usr.bin/gh-bc/Makefile accordingly (first in the port > > and then in base). > >=20 > > The generated file lib.c should start like this: > > ----------------------------------------------------------------- > > // Copyright (c) 2018-2020 Gavin D. Howard and contributors. > > // Licensed under the 2-clause BSD license. > > // *** AUTOMATICALLY GENERATED FROM gen/lib.bc. DO NOT MODIFY. *** > >=20 > > #if 1 > > extern const char *bc_lib_name; > >=20 > > extern const char bc_lib[]; > >=20 > > const char *bc_lib_name =3D "gen/lib.bc"; > >=20 > > const char bc_lib[] =3D > > "scale=3D20\n" > > ----------------------------------------------------------------- > >=20 > > This file is generated by this rule in usr.bin/gh-bc/Makefile: > >=20 > > lib.c:=A0=A0=A0=A0=A0=A0=A0=A0=A0 lib.bc > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 cd ${BCDIR} && sh gen/st= > rgen.sh gen/lib.bc=20 > > ${.OBJDIR}/lib.c bc_lib bc_lib_name 1 1 > >=20 > > By a script that assigns parameters to variables: > >=20 > > input=3D"$1" > > output=3D"$2" > > name=3D"$3" > > label=3D"$4" > > define=3D"$5" > > remove_tabs=3D"$6" > >=20 > > And label=3D"bc_lib_name" is used to generate lib.c as included > > above (passed as 4th parameter). > >=20 > > I'm rebuilding a clean world, now, but I'd be surprised if it failed > > after succeeding before readying the commit ... > >=20 > > Regards, STefan > >=20 > > > --UukPFASfKyppXv6KjFIjzyho2LVowmUF8-- > > --LNh7JZBKUks6iTmPthYYHSJRZLxtgUw39 > Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" > Content-Description: OpenPGP digital signature > Content-Disposition: attachment; filename="OpenPGP_signature" > > -----BEGIN PGP SIGNATURE----- > > wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAl/AKs8FAwAAAAAACgkQR+u171r99UTb > PQgAyB516biVoiagMuoLx2hEWmFtSVi81YJp89y0LMutWOiQNEqo7vSjDSp8lQFIxzLvuJs3ycyb > tv3LdoHVZHAJHUc/Tyxzs2DAbiUnyF5p6zhYRkUIZjnW7NVF0PF5MiWZzhMjnNOczsFPdrBvY6Ey > q1UoxrPLBFXavi53Q36q9ZuJFI7cv1l5Vsll+G0tAZzu4PXJQ6EDRhkQGpGWbvDb3gqIjnc2peEE > tT0JfT6jo6/hNPTTvFo8McYeiwYqAXooa+mH/xjbq3WjGZ9s+vknr+pleH5YGYEP8NaNc+bzxZLk > pehxZTxhS71hnvwtgf6ZWiH1QNzRNuWacHkPJy9gQg== > =Vfzz > -----END PGP SIGNATURE----- > > --LNh7JZBKUks6iTmPthYYHSJRZLxtgUw39-- From owner-svn-src-all@freebsd.org Thu Nov 26 23:34:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31B1E4749ED; Thu, 26 Nov 2020 23:34:03 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChvGg0wbXz3p1g; Thu, 26 Nov 2020 23:34:03 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 129473C21; Thu, 26 Nov 2020 23:34:03 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQNY2Ym044290; Thu, 26 Nov 2020 23:34:02 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQNY2Mt044289; Thu, 26 Nov 2020 23:34:02 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202011262334.0AQNY2Mt044289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 26 Nov 2020 23:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368085 - stable/12/lib/libc/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/lib/libc/gen X-SVN-Commit-Revision: 368085 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 23:34:03 -0000 Author: asomers Date: Thu Nov 26 23:34:02 2020 New Revision: 368085 URL: https://svnweb.freebsd.org/changeset/base/368085 Log: MFC r365910: fix integer underflow in getgrnam_r and getpwnam_r Sometimes nscd(8) will return a 1-byte buffer for a nonexistent entry. This triggered an integer underflow in grp_unmarshal_func, causing getgrnam_r to return ERANGE instead of 0. Fix the user's buffer size check, and add a correct check for a too-small nscd buffer. PR: 248932 Event: September 2020 Bugathon Reviewed by: markj Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D26204 Modified: stable/12/lib/libc/gen/getgrent.c stable/12/lib/libc/gen/getpwent.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/gen/getgrent.c ============================================================================== --- stable/12/lib/libc/gen/getgrent.c Thu Nov 26 22:49:05 2020 (r368084) +++ stable/12/lib/libc/gen/getgrent.c Thu Nov 26 23:34:02 2020 (r368085) @@ -334,14 +334,27 @@ grp_unmarshal_func(char *buffer, size_t buffer_size, v orig_buf_size = va_arg(ap, size_t); ret_errno = va_arg(ap, int *); - if (orig_buf_size < - buffer_size - sizeof(struct group) - sizeof(char *)) { + if (orig_buf_size + sizeof(struct group) + sizeof(char *) < buffer_size) + { *ret_errno = ERANGE; return (NS_RETURN); + } else if (buffer_size < sizeof(struct group) + sizeof(char *)) { + /* + * nscd(8) sometimes returns buffer_size=1 for nonexistent + * entries. + */ + *ret_errno = 0; + return (NS_NOTFOUND); } memcpy(grp, buffer, sizeof(struct group)); memcpy(&p, buffer + sizeof(struct group), sizeof(char *)); + + if (orig_buf_size + sizeof(struct group) + sizeof(char *) + + _ALIGN(p) - (size_t)p < buffer_size) { + *ret_errno = ERANGE; + return (NS_RETURN); + } orig_buf = (char *)_ALIGN(orig_buf); memcpy(orig_buf, buffer + sizeof(struct group) + sizeof(char *) + Modified: stable/12/lib/libc/gen/getpwent.c ============================================================================== --- stable/12/lib/libc/gen/getpwent.c Thu Nov 26 22:49:05 2020 (r368084) +++ stable/12/lib/libc/gen/getpwent.c Thu Nov 26 23:34:02 2020 (r368085) @@ -389,10 +389,17 @@ pwd_unmarshal_func(char *buffer, size_t buffer_size, v orig_buf_size = va_arg(ap, size_t); ret_errno = va_arg(ap, int *); - if (orig_buf_size < - buffer_size - sizeof(struct passwd) - sizeof(char *)) { + if (orig_buf_size + sizeof(struct passwd) + sizeof(char *) < + buffer_size) { *ret_errno = ERANGE; return (NS_RETURN); + } else if (buffer_size < sizeof(struct passwd) + sizeof(char *)) { + /* + * nscd(8) sometimes returns buffer_size=1 for nonexistent + * entries. + */ + *ret_errno = 0; + return (NS_NOTFOUND); } memcpy(pwd, buffer, sizeof(struct passwd)); From owner-svn-src-all@freebsd.org Thu Nov 26 23:35:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9313F474CA7; Thu, 26 Nov 2020 23:35:14 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChvJ23kCjz3p1H; Thu, 26 Nov 2020 23:35:14 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 685633AEF; Thu, 26 Nov 2020 23:35:14 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQNZEgr044426; Thu, 26 Nov 2020 23:35:14 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQNZEvD044423; Thu, 26 Nov 2020 23:35:14 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202011262335.0AQNZEvD044423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 26 Nov 2020 23:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368086 - stable/12/tools/regression/fsx X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/tools/regression/fsx X-SVN-Commit-Revision: 368086 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 23:35:14 -0000 Author: asomers Date: Thu Nov 26 23:35:13 2020 New Revision: 368086 URL: https://svnweb.freebsd.org/changeset/base/368086 Log: MFC r365956: fsx: fix build with WARNS=6 * signed/unsigned comparisons * use standard warn(3) * Suppress warnings about local vars and funcs not declared static * const-correctness * declaration shadows a variable in the global scope Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D26516 Modified: stable/12/tools/regression/fsx/Makefile stable/12/tools/regression/fsx/fsx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/regression/fsx/Makefile ============================================================================== --- stable/12/tools/regression/fsx/Makefile Thu Nov 26 23:34:02 2020 (r368085) +++ stable/12/tools/regression/fsx/Makefile Thu Nov 26 23:35:13 2020 (r368086) @@ -4,4 +4,9 @@ PROG= fsx MAN= +NO_WMISSING_VARIABLE_DECLARATIONS= + .include + +# Don't require static declarations. It's line noise in a single-file program. +CWARNFLAGS+= -Wno-strict-prototypes -Wno-missing-prototypes Modified: stable/12/tools/regression/fsx/fsx.c ============================================================================== --- stable/12/tools/regression/fsx/fsx.c Thu Nov 26 23:34:02 2020 (r368085) +++ stable/12/tools/regression/fsx/fsx.c Thu Nov 26 23:35:13 2020 (r368086) @@ -112,7 +112,7 @@ int closeprob = 0; /* -c flag */ int invlprob = 0; /* -i flag */ int debug = 0; /* -d flag */ unsigned long debugstart = 0; /* -D flag */ -unsigned long maxfilelen = 256 * 1024; /* -l flag */ +off_t maxfilelen = 256 * 1024; /* -l flag */ int sizechecks = 1; /* -n flag disables them */ int maxoplen = 64 * 1024; /* -o flag */ int quiet = 0; /* -q flag */ @@ -138,33 +138,8 @@ int invl = 0; void -vwarnc(code, fmt, ap) - int code; - const char *fmt; - va_list ap; +prt(const char *fmt, ...) { - fprintf(stderr, "fsx: "); - if (fmt != NULL) { - vfprintf(stderr, fmt, ap); - fprintf(stderr, ": "); - } - fprintf(stderr, "%s\n", strerror(code)); -} - - -void -warn(const char * fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - vwarnc(errno, fmt, ap); - va_end(ap); -} - - -void -prt(char *fmt, ...) -{ va_list args; va_start(args, fmt); @@ -179,7 +154,7 @@ prt(char *fmt, ...) } void -prterr(char *prefix) +prterr(const char *prefix) { prt("%s%s%s\n", prefix, prefix ? ": " : "", strerror(errno)); } @@ -317,12 +292,12 @@ logdump(void) void -save_buffer(char *buffer, off_t bufferlength, int fd) +save_buffer(char *buffer, off_t bufferlength, int savefd) { off_t ret; ssize_t byteswritten; - if (fd <= 0 || bufferlength == 0) + if (savefd <= 0 || bufferlength == 0) return; if (bufferlength > SSIZE_MAX) { @@ -330,7 +305,7 @@ save_buffer(char *buffer, off_t bufferlength, int fd) exit(67); } if (lite) { - off_t size_by_seek = lseek(fd, (off_t)0, SEEK_END); + off_t size_by_seek = lseek(savefd, (off_t)0, SEEK_END); if (size_by_seek == (off_t)-1) prterr("save_buffer: lseek eof"); else if (bufferlength > size_by_seek) { @@ -340,11 +315,11 @@ save_buffer(char *buffer, off_t bufferlength, int fd) } } - ret = lseek(fd, (off_t)0, SEEK_SET); + ret = lseek(savefd, (off_t)0, SEEK_SET); if (ret == (off_t)-1) prterr("save_buffer: lseek 0"); - byteswritten = write(fd, buffer, (size_t)bufferlength); + byteswritten = write(savefd, buffer, (size_t)bufferlength); if (byteswritten != bufferlength) { if (byteswritten == -1) prterr("save_buffer write"); @@ -458,10 +433,10 @@ check_trunc_hack(void) void -doread(unsigned offset, unsigned size) +doread(off_t offset, off_t size) { off_t ret; - unsigned iret; + ssize_t iret; offset -= offset % readbdy; if (size == 0) { @@ -509,7 +484,7 @@ doread(unsigned offset, unsigned size) void -check_eofpage(char *s, unsigned offset, char *p, int size) +check_eofpage(const char *s, unsigned offset, char *p, int size) { uintptr_t last_page, should_be_zero; @@ -592,7 +567,7 @@ domapread(unsigned offset, unsigned size) void -gendata(char *original_buf, char *good_buf, unsigned offset, unsigned size) +gendata(unsigned offset, unsigned size) { while (size--) { good_buf[offset] = testcalls % 256; @@ -607,7 +582,7 @@ void dowrite(unsigned offset, unsigned size) { off_t ret; - unsigned iret; + ssize_t iret; offset -= offset % writebdy; if (size == 0) { @@ -619,7 +594,7 @@ dowrite(unsigned offset, unsigned size) log4(OP_WRITE, offset, size, file_size); - gendata(original_buf, good_buf, offset, size); + gendata(offset, size); if (file_size < offset + size) { if (file_size < offset) memset(good_buf + file_size, '\0', offset - file_size); @@ -677,7 +652,7 @@ domapwrite(unsigned offset, unsigned size) log4(OP_MAPWRITE, offset, size, 0); - gendata(original_buf, good_buf, offset, size); + gendata(offset, size); if (file_size < offset + size) { if (file_size < offset) memset(good_buf + file_size, '\0', offset - file_size); @@ -842,8 +817,8 @@ doinvl(void) void test(void) { - unsigned long offset; - unsigned long size = maxoplen; + off_t offset; + off_t size = maxoplen; unsigned long rv = random(); unsigned long op = rv % (3 + !lite + mapped_writes); @@ -858,9 +833,9 @@ test(void) testcalls++; if (closeprob) - closeopen = (rv >> 3) < (1 << 28) / closeprob; + closeopen = (rv >> 3) < (1ul << 28) / closeprob; if (invlprob) - invl = (rv >> 3) < (1 << 28) / invlprob; + invl = (rv >> 3) < (1ul << 28) / invlprob; if (debugstart > 0 && testcalls >= debugstart) debug = 1; From owner-svn-src-all@freebsd.org Thu Nov 26 23:44:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57F72474FEB; Thu, 26 Nov 2020 23:44:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChvWG23XRz3pfM; Thu, 26 Nov 2020 23:44:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 398453D53; Thu, 26 Nov 2020 23:44:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQNiwnj050623; Thu, 26 Nov 2020 23:44:58 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQNiwX7050622; Thu, 26 Nov 2020 23:44:58 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202011262344.0AQNiwX7050622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 26 Nov 2020 23:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368087 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 368087 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 23:44:58 -0000 Author: asomers Date: Thu Nov 26 23:44:57 2020 New Revision: 368087 URL: https://svnweb.freebsd.org/changeset/base/368087 Log: MFC r366118: Fix some signed/unsigned comparison warnings in NFS Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D26533 Modified: stable/12/sys/kern/subr_acl_nfs4.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_acl_nfs4.c ============================================================================== --- stable/12/sys/kern/subr_acl_nfs4.c Thu Nov 26 23:35:13 2020 (r368086) +++ stable/12/sys/kern/subr_acl_nfs4.c Thu Nov 26 23:44:57 2020 (r368087) @@ -349,9 +349,9 @@ _acl_append(struct acl *aclp, acl_tag_t tag, acl_perm_ } static struct acl_entry * -_acl_duplicate_entry(struct acl *aclp, int entry_index) +_acl_duplicate_entry(struct acl *aclp, unsigned entry_index) { - int i; + unsigned i; KASSERT(aclp->acl_cnt + 1 <= ACL_MAX_ENTRIES, ("aclp->acl_cnt + 1 <= ACL_MAX_ENTRIES")); @@ -368,7 +368,8 @@ static void acl_nfs4_sync_acl_from_mode_draft(struct acl *aclp, mode_t mode, int file_owner_id) { - int i, meets, must_append; + int meets, must_append; + unsigned i; struct acl_entry *entry, *copy, *previous, *a1, *a2, *a3, *a4, *a5, *a6; mode_t amode; From owner-svn-src-all@freebsd.org Thu Nov 26 23:54:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53CF04754B4; Thu, 26 Nov 2020 23:54:14 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Chvjy1tl5z3pkk; Thu, 26 Nov 2020 23:54:14 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33D653EB9; Thu, 26 Nov 2020 23:54:14 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AQNsELw057187; Thu, 26 Nov 2020 23:54:14 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AQNsEKv057186; Thu, 26 Nov 2020 23:54:14 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202011262354.0AQNsEKv057186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 26 Nov 2020 23:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368088 - stable/12/lib/libc/tests/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/lib/libc/tests/sys X-SVN-Commit-Revision: 368088 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 23:54:14 -0000 Author: asomers Date: Thu Nov 26 23:54:13 2020 New Revision: 368088 URL: https://svnweb.freebsd.org/changeset/base/368088 Log: MFC r366131: lib/libc/tests/sys: raise WARNS to 6 Modified: stable/12/lib/libc/tests/sys/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/tests/sys/Makefile ============================================================================== --- stable/12/lib/libc/tests/sys/Makefile Thu Nov 26 23:44:57 2020 (r368087) +++ stable/12/lib/libc/tests/sys/Makefile Thu Nov 26 23:54:13 2020 (r368088) @@ -80,12 +80,6 @@ LIBADD.timer_create_test+= rt SRCS.mlock_test+= mlock_helper.c SRCS.setrlimit_test+= mlock_helper.c -.if ${COMPILER_TYPE} == "gcc" -WARNS?= 3 -.else -WARNS?= 4 -.endif - FILESGROUPS+= truncate_test_FILES truncate_test_FILES= truncate_test.root_owned From owner-svn-src-all@freebsd.org Fri Nov 27 03:17:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1FE347A537; Fri, 27 Nov 2020 03:17:21 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cj0DK5cBDz4VBV; Fri, 27 Nov 2020 03:17:21 +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 B3DF26B8F; Fri, 27 Nov 2020 03:17:21 +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 0AR3HLrr081335; Fri, 27 Nov 2020 03:17:21 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AR3HLea081334; Fri, 27 Nov 2020 03:17:21 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202011270317.0AR3HLea081334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 27 Nov 2020 03:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r368089 - in stable: 11/sys/kern 12/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/kern 12/sys/kern X-SVN-Commit-Revision: 368089 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 03:17:21 -0000 Author: cy Date: Fri Nov 27 03:17:21 2020 New Revision: 368089 URL: https://svnweb.freebsd.org/changeset/base/368089 Log: MFC r367980: Fix a typo in a comment. Modified: stable/11/sys/kern/kern_ntptime.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/kern/kern_ntptime.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/kern/kern_ntptime.c ============================================================================== --- stable/11/sys/kern/kern_ntptime.c Thu Nov 26 23:54:13 2020 (r368088) +++ stable/11/sys/kern/kern_ntptime.c Fri Nov 27 03:17:21 2020 (r368089) @@ -590,7 +590,7 @@ ntp_update_second(int64_t *adjustment, time_t *newsec) /* * Apply any correction from adjtime(2). If more than one second - * off we slew at a rate of 5ms/s (5000 PPM) else 500us/s (500PPM) + * off we slew at a rate of 5ms/s (5000 PPM) else 500us/s (500 PPM) * until the last second is slewed the final < 500 usecs. */ if (time_adjtime != 0) { From owner-svn-src-all@freebsd.org Fri Nov 27 03:17:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 132C747A5A8; Fri, 27 Nov 2020 03:17:22 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cj0DL06jnz4V5K; Fri, 27 Nov 2020 03:17:22 +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 EA94E6B90; Fri, 27 Nov 2020 03:17:21 +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 0AR3HLwI081341; Fri, 27 Nov 2020 03:17:21 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AR3HLnm081340; Fri, 27 Nov 2020 03:17:21 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202011270317.0AR3HLnm081340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 27 Nov 2020 03:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368089 - in stable: 11/sys/kern 12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/kern 12/sys/kern X-SVN-Commit-Revision: 368089 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 03:17:22 -0000 Author: cy Date: Fri Nov 27 03:17:21 2020 New Revision: 368089 URL: https://svnweb.freebsd.org/changeset/base/368089 Log: MFC r367980: Fix a typo in a comment. Modified: stable/12/sys/kern/kern_ntptime.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/kern/kern_ntptime.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/kern/kern_ntptime.c ============================================================================== --- stable/12/sys/kern/kern_ntptime.c Thu Nov 26 23:54:13 2020 (r368088) +++ stable/12/sys/kern/kern_ntptime.c Fri Nov 27 03:17:21 2020 (r368089) @@ -590,7 +590,7 @@ ntp_update_second(int64_t *adjustment, time_t *newsec) /* * Apply any correction from adjtime(2). If more than one second - * off we slew at a rate of 5ms/s (5000 PPM) else 500us/s (500PPM) + * off we slew at a rate of 5ms/s (5000 PPM) else 500us/s (500 PPM) * until the last second is slewed the final < 500 usecs. */ if (time_adjtime != 0) { From owner-svn-src-all@freebsd.org Fri Nov 27 04:45:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4E0147CA35; Fri, 27 Nov 2020 04:45:10 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cj29f6BZJz4ZDR; Fri, 27 Nov 2020 04:45:10 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C78337B7C; Fri, 27 Nov 2020 04:45:10 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AR4jAnx036920; Fri, 27 Nov 2020 04:45:10 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AR4jA8R036918; Fri, 27 Nov 2020 04:45:10 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202011270445.0AR4jA8R036918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 27 Nov 2020 04:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368090 - stable/12/lib/libc/tests/iconv X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/lib/libc/tests/iconv X-SVN-Commit-Revision: 368090 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 04:45:11 -0000 Author: asomers Date: Fri Nov 27 04:45:10 2020 New Revision: 368090 URL: https://svnweb.freebsd.org/changeset/base/368090 Log: MFC r366132: lib/libc/tests/iconv: raise WARNS to 6 Modified: stable/12/lib/libc/tests/iconv/Makefile stable/12/lib/libc/tests/iconv/iconvctl_test.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/tests/iconv/Makefile ============================================================================== --- stable/12/lib/libc/tests/iconv/Makefile Fri Nov 27 03:17:21 2020 (r368089) +++ stable/12/lib/libc/tests/iconv/Makefile Fri Nov 27 04:45:10 2020 (r368090) @@ -3,6 +3,5 @@ TESTSDIR= ${TESTSBASE}/lib/libc/iconv ATF_TESTS_C+= iconvctl_test -WARNS?= 2 .include Modified: stable/12/lib/libc/tests/iconv/iconvctl_test.c ============================================================================== --- stable/12/lib/libc/tests/iconv/iconvctl_test.c Fri Nov 27 03:17:21 2020 (r368089) +++ stable/12/lib/libc/tests/iconv/iconvctl_test.c Fri Nov 27 04:45:10 2020 (r368090) @@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$"); #include -void +static void test_trivialp(const char *src, const char *dst, int expected) { iconv_t ic; From owner-svn-src-all@freebsd.org Fri Nov 27 05:13:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A49D047D606; Fri, 27 Nov 2020 05:13:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cj2pn3kR4z4byy; Fri, 27 Nov 2020 05:13:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72D4D1037E; Fri, 27 Nov 2020 05:13:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AR5DrPU055359; Fri, 27 Nov 2020 05:13:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AR5DrFQ055358; Fri, 27 Nov 2020 05:13:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011270513.0AR5DrFQ055358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Nov 2020 05:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368091 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 368091 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 05:13:53 -0000 Author: mav Date: Fri Nov 27 05:13:52 2020 New Revision: 368091 URL: https://svnweb.freebsd.org/changeset/base/368091 Log: Restore break statement lost in r367857. Modified: head/sys/dev/isp/isp_target.c Modified: head/sys/dev/isp/isp_target.c ============================================================================== --- head/sys/dev/isp/isp_target.c Fri Nov 27 04:45:10 2020 (r368090) +++ head/sys/dev/isp/isp_target.c Fri Nov 27 05:13:52 2020 (r368091) @@ -174,6 +174,7 @@ isp_target_notify(ispsoftc_t *isp, void *vptr, uint32_ case RQSTYPE_NOTIFY: isp_get_notify_24xx(isp, inot_24xx, (in_fcentry_24xx_t *)local); isp_handle_notify_24xx(isp, (in_fcentry_24xx_t *)local); + break; case RQSTYPE_NOTIFY_ACK: /* From owner-svn-src-all@freebsd.org Fri Nov 27 07:53:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A654347FD37; Fri, 27 Nov 2020 07:53:15 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cj6Lg4JB4z4jPp; Fri, 27 Nov 2020 07:53:15 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8691A122B6; Fri, 27 Nov 2020 07:53:15 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AR7rF5W052660; Fri, 27 Nov 2020 07:53:15 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AR7rFrf052659; Fri, 27 Nov 2020 07:53:15 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <202011270753.0AR7rFrf052659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Fri, 27 Nov 2020 07:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368092 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 368092 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 07:53:15 -0000 Author: bcran Date: Fri Nov 27 07:53:15 2020 New Revision: 368092 URL: https://svnweb.freebsd.org/changeset/base/368092 Log: bhyve: fix smbiostbl.c style issues and add comment about date format Fix a couple of style issues introduced in my previous commit. Add a comment explaining that the SMBIOS specification defines the date format to be mm/dd/yyyy, which is why we don't use ISO 8601. Modified: head/usr.sbin/bhyve/smbiostbl.c Modified: head/usr.sbin/bhyve/smbiostbl.c ============================================================================== --- head/usr.sbin/bhyve/smbiostbl.c Fri Nov 27 05:13:52 2020 (r368091) +++ head/usr.sbin/bhyve/smbiostbl.c Fri Nov 27 07:53:15 2020 (r368092) @@ -51,8 +51,9 @@ __FBSDID("$FreeBSD$"); #define SMBIOS_BASE 0xF1000 -#define FIRMWARE_VERSION "13.0" -#define FIRMWARE_RELEASE_DATE "11/10/2020" +#define FIRMWARE_VERSION "13.0" +/* The SMBIOS specification defines the date format to be mm/dd/yyyy */ +#define FIRMWARE_RELEASE_DATE "11/10/2020" /* BHYVE_ACPI_BASE - SMBIOS_BASE) */ #define SMBIOS_MAX_LENGTH (0xF2400 - 0xF1000) From owner-svn-src-all@freebsd.org Fri Nov 27 08:00:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BB2C4A1481; Fri, 27 Nov 2020 08:00:33 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cj6W536wpz4jyq; Fri, 27 Nov 2020 08:00:33 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E317120C7; Fri, 27 Nov 2020 08:00:33 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AR80Xkv053131; Fri, 27 Nov 2020 08:00:33 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AR80XCA053130; Fri, 27 Nov 2020 08:00:33 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <202011270800.0AR80XCA053130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Fri, 27 Nov 2020 08:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368093 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 368093 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 08:00:33 -0000 Author: bcran Date: Fri Nov 27 08:00:32 2020 New Revision: 368093 URL: https://svnweb.freebsd.org/changeset/base/368093 Log: Fix bhyve SMBIOS type 19 handling to avoid misreporting total RAM amount This fixes the amount of memory displayed in the EDK2 UiApp to be the same as passed on the bhyve command line. Otherwise, 8GB is displayed as 4GB, 32GB as 28GB etc. Reviewed by: jhb, kib, rgrimes Differential Revision: https://reviews.freebsd.org/D27348 Modified: head/usr.sbin/bhyve/smbiostbl.c Modified: head/usr.sbin/bhyve/smbiostbl.c ============================================================================== --- head/usr.sbin/bhyve/smbiostbl.c Fri Nov 27 07:53:15 2020 (r368092) +++ head/usr.sbin/bhyve/smbiostbl.c Fri Nov 27 08:00:32 2020 (r368093) @@ -758,7 +758,7 @@ smbios_type19_initializer(struct smbios_structure *tem type19 = (struct smbios_table_type19 *)curaddr; type19->arrayhand = type16_handle; type19->xsaddr = 4*GB; - type19->xeaddr = guest_himem; + type19->xeaddr = type19->xsaddr + guest_himem; } return (0); From owner-svn-src-all@freebsd.org Fri Nov 27 08:33:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC6334A1B7C for ; Fri, 27 Nov 2020 08:33:55 +0000 (UTC) (envelope-from noreply@pros2.nje-diffusion.com) Received: from pros2.nje-diffusion.com (pros2.nje-diffusion.com [185.24.146.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cj7FZ0Tngz4lkW for ; Fri, 27 Nov 2020 08:33:53 +0000 (UTC) (envelope-from noreply@pros2.nje-diffusion.com) DKIM-Signature: a=rsa-sha256; bh=/x0MuDZ4AzpjFo3E6xi50Yksu+nvhm/412V0k5fP/gY=; c=relaxed/relaxed; d=com20.nje-diffusion.fr; h=to:cc:from:reply-to:subject:date:mime-version:content-type:list-id:list-unsubscribe:x-csa-complaints:list-unsubscribe-post:message-id:sender:x-sib-id:x-mailin-client:x-mailin-campaign:feedback-id; q=dns/txt; s=mail; t=1606466025; v=1; b=e26bmC2xj5kQI1U34Y+eelQR8etcXqD/DUryzH+Ihw9rSRJZf/IK+X2W8hkGWEwC+RM+lwDI wc02D9hgeUrgefmWJetj6OSjV58JZA22YKFYJFWEyPd1286BL6kYhMp4oOz5olKh2FAs0myti/e J/nm8WypTkUhgZO0Cyv9Pt/0= To: Subject: =?utf-8?q?Masques_personnalisables_100_lavages_2,50=E2=82=AC?= Date: Fri, 27 Nov 2020 08:33:45 +0000 Feedback-ID: 185.24.146.98:19012_1628:19012:Sendinblue From: =?UTF-8?q?J=C3=A9r=C3=B4me_Sebbane?= List-Unsubscribe-Post: List-Unsubscribe=One-Click MIME-Version: 1.0 Message-Id: <202027110833.bdo7iyow1qwg1nj@pros2.nje-diffusion.com> Precedence: bulk Reply-To: jerome@tous-en-masque.com X-Csa-Complaints: whitelist-complaints@eco.de X-Mailer: Sendinblue X-Mailin-Campaign: 1628 X-Mailin-Client: 19012 X-sib-id: dYJdMxH8yEFpjkjDLoxEDZDcB244dlEf-8CNKAHBPEbZVLnh_W02adYKzFrzx8Xo62c1TMckovyITWQ9JzjRqyRNK9WsjNV-pGZ3XCL8Mb2AjTCP5cgkEd9MRpjY173Lqlnp5T6o6HTvBRE4OQc9gXXtszM3hjP_0K7GnGg2KPptqL_g X-Rspamd-Queue-Id: 4Cj7FZ0Tngz4lkW X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=com20.nje-diffusion.fr header.s=mail header.b=e26bmC2x; dmarc=pass (policy=none) header.from=com20.nje-diffusion.fr; spf=pass (mx1.freebsd.org: domain of noreply@pros2.nje-diffusion.com designates 185.24.146.98 as permitted sender) smtp.mailfrom=noreply@pros2.nje-diffusion.com X-Spamd-Result: default: False [-1.70 / 15.00]; HAS_REPLYTO(0.00)[jerome@tous-en-masque.com]; XM_UA_NO_VERSION(0.01)[]; R_SPF_ALLOW(-0.20)[+ip4:185.24.144.0/22]; SUBJECT_HAS_CURRENCY(1.00)[]; TO_DN_NONE(0.00)[]; URI_COUNT_ODD(1.00)[15]; DKIM_TRACE(0.00)[com20.nje-diffusion.fr:+]; DMARC_POLICY_ALLOW(-0.50)[com20.nje-diffusion.fr,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[dif.10v1@com20.nje-diffusion.fr,noreply@pros2.nje-diffusion.com]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[185.24.146.98:from]; ASN(0.00)[asn:200484, ipnet:185.24.144.0/22, country:FR]; FROM_NEQ_ENVFROM(0.00)[dif.10v1@com20.nje-diffusion.fr,noreply@pros2.nje-diffusion.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[com20.nje-diffusion.fr:s=mail]; FROM_HAS_DN(0.00)[]; SH_EMAIL_DBL_DONT_QUERY_IPS(0.00)[0.0.2.88:email,0.0.0.0:email]; TO_MATCH_ENVRCPT_ALL(0.00)[]; PRECEDENCE_BULK(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[185.24.146.98:from:127.0.2.255]; DBL_PROHIBIT(0.00)[0.0.2.88:email]; MAILMAN_DEST(0.00)[svn-src-all] Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 08:33:55 -0000 [ SANS DOUTE LE MEILLEUR MASQUE ! ]( http://r.pros2.nje-diffusion.com/mk/cl= /f/3ouiZPPu5GvblaqUyH7_Vk4oOUSu6idliHGHJv-3azopVY6dfuEKL3f5GPR9uuCTH3sgJOoe= te41yE4d42CfYzLmUHAuqdRp2RKXg1KDUugafVl1DIKZord-vj0M0OupkiSHcLAE5Ml82d0VlAb= -llASEsDLtq8byUX4I9LsGMk8ae9FVp9K ) [ PERSONNALISABLE =E2=80=A2 TEST=C3= =89 100 LAVAGES ]( http://r.pros2.nje-diffusion.com/mk/cl/f/ELEht_wTuR8GLy4= -tjsCF3WiB23eFDATBVJw5qmZDnY3dq8VDL64yo1YIvzn-7WSOYan6YckVIiXy_7zpEWhBiidwi= RFrE28KgJhoB95zEalLPk-P9680K4lijgbk7EGrSV5wpM0T8tFfYa7VuBAxoQPoMZnKjfKDoybs= CHKl1Crs27Qyfc7 ) [ Cliquez ici : www.tous-en-masque.com ]( http://r.pros2.nje-diffusion.com/= mk/cl/f/6CJLG_RlP1wBokGmqdxSAoZpbQgOPPcCxQ24cIQ0Srzqk9vwFuLsGRYGFwQXGe9i_TQ= rbtvUxLs9YpbVzNSP68VIfMEfYsawLHmlH0VKS3X2hxUaOFF48ZNqTu7ONwtC90_m_hD1O4BT_-= Yylq4hEeCKAYFaEhl9ZSYJyYI7ODymn7Yshxr8 ) COMMUNIQUEZ GR=C3=82CE =C3=80 VOS MASQUES ! =C2=A0 =C2=A0 =C2=A0 [ Cliquez ici : www.tous-en-masque.com ]( http://r.pros2.nje-diffusion.com/= mk/cl/f/v54sKkM7ptyJi3xsDb9E-SnHlOM7E3HWwlJlIAcUjSAtu8TSk1UaOWikr6UvxRsg5uy= WmydAvavHUFQMbeSLia-Ck6Og7VqFJQLjstYzGimvJi1StpuCLOP4qY8KtcXhAVobC0NgEN_aun= BElmt_MtxLqJGgzN-XTMvityl7tUwS9S_QcFre ) =C2=A0 DADA ART 13, rue Emmanuel Chabrier 26000 VALENCE RCS 751 108 002 000 21 Capital: 100 000=E2=82=AC [ 04 27 24 04 69 ]( tel:+33427240469 ) [ jerome@tous-en-masque.com ]( mailto:jerome@tous-en-masque.com ) From owner-svn-src-all@freebsd.org Fri Nov 27 08:45:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B93684A2403; Fri, 27 Nov 2020 08:45:43 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cj7WC4tCCz4mRn; Fri, 27 Nov 2020 08:45:43 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A54812D89; Fri, 27 Nov 2020 08:45:43 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AR8jhYu084031; Fri, 27 Nov 2020 08:45:43 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AR8jhtp084030; Fri, 27 Nov 2020 08:45:43 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202011270845.0AR8jhtp084030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Fri, 27 Nov 2020 08:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368095 - stable/12/usr.bin/grep X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/usr.bin/grep X-SVN-Commit-Revision: 368095 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 08:45:43 -0000 Author: eugen Date: Fri Nov 27 08:45:43 2020 New Revision: 368095 URL: https://svnweb.freebsd.org/changeset/base/368095 Log: MFC r367866: bzgrep: make flag --no-filename work PR: 248813 Modified: stable/12/usr.bin/grep/zgrep.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/grep/zgrep.sh ============================================================================== --- stable/12/usr.bin/grep/zgrep.sh Fri Nov 27 08:41:38 2020 (r368094) +++ stable/12/usr.bin/grep/zgrep.sh Fri Nov 27 08:45:43 2020 (r368095) @@ -90,6 +90,10 @@ do pattern_found=1 shift ;; + -h|--no-filename) + silent=1 + shift + ;; --*) grep_args="${grep_args} $1" shift @@ -118,10 +122,6 @@ do ;; -) hyphen=1 - shift - ;; - -h) - silent=1 shift ;; -r|-R) From owner-svn-src-all@freebsd.org Fri Nov 27 09:00:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E8334A2576; Fri, 27 Nov 2020 09:00:22 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cj7r60qgGz4nfr; Fri, 27 Nov 2020 09:00:22 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F70412EB7; Fri, 27 Nov 2020 09:00:22 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AR90LLr090654; Fri, 27 Nov 2020 09:00:21 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AR90LL0090653; Fri, 27 Nov 2020 09:00:21 GMT (envelope-from se@FreeBSD.org) Message-Id: <202011270900.0AR90LL0090653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Fri, 27 Nov 2020 09:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368097 - head/usr.bin/gh-bc X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/usr.bin/gh-bc X-SVN-Commit-Revision: 368097 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 09:00:22 -0000 Author: se Date: Fri Nov 27 09:00:21 2020 New Revision: 368097 URL: https://svnweb.freebsd.org/changeset/base/368097 Log: Make generated C files depend on this Makefile The contents of lib.c, lib2.c, bc_help.c, and dc_help.c depends on the parameters passed to strgen.sh in this Makefile. A change to the number of parameters of strgen.sh has been applied to the invocation of this command, but this did not cause a rebuild of the generated files. Reported by: Cy.Schubert@cschubert.com Modified: head/usr.bin/gh-bc/Makefile Modified: head/usr.bin/gh-bc/Makefile ============================================================================== --- head/usr.bin/gh-bc/Makefile Fri Nov 27 08:53:59 2020 (r368096) +++ head/usr.bin/gh-bc/Makefile Fri Nov 27 09:00:21 2020 (r368097) @@ -95,16 +95,16 @@ NLSLINKS_pt_PT.ISO8859-1+= pt_BR.ISO8859-1 NLSLINKS_pt_PT.ISO8859-1+= pt_PT.ISO8859-15 .endif -lib.c: lib.bc +lib.c: lib.bc Makefile cd ${BCDIR} && sh gen/strgen.sh gen/lib.bc ${.OBJDIR}/lib.c bc_lib bc_lib_name 1 1 -lib2.c: lib2.bc +lib2.c: lib2.bc Makefile cd ${BCDIR} && sh gen/strgen.sh gen/lib2.bc ${.OBJDIR}/lib2.c bc_lib2 bc_lib2_name 1 1 -bc_help.c: bc_help.txt +bc_help.c: bc_help.txt Makefile cd ${BCDIR} && sh gen/strgen.sh gen/bc_help.txt ${.OBJDIR}/bc_help.c bc_help -dc_help.c: dc_help.txt +dc_help.c: dc_help.txt Makefile cd ${BCDIR} && sh gen/strgen.sh gen/dc_help.txt ${.OBJDIR}/dc_help.c dc_help bc.1: From owner-svn-src-all@freebsd.org Fri Nov 27 09:03:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 807D74A2C8E; Fri, 27 Nov 2020 09:03:59 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cj7wH3DfKz4p3b; Fri, 27 Nov 2020 09:03:59 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-WLAN.fritz.box (p200300cd5f150a0090717e4dd010f96d.dip0.t-ipconnect.de [IPv6:2003:cd:5f15:a00:9071:7e4d:d010:f96d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id A73B22AD1D; Fri, 27 Nov 2020 09:03:58 +0000 (UTC) (envelope-from se@freebsd.org) To: Cy Schubert Cc: "O. Hartmann" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202011261739.0AQHdpe5012982@repo.freebsd.org> <20201126191949.092c9eba@thor.intern.walstatt.dynvpn.de> <95c3e226-6050-2f91-debf-317d6d11494f@freebsd.org> <202011262003.0AQK3BTe076596@slippy.cwsent.com> <202011262247.0AQMlrE5071306@slippy.cwsent.com> From: Stefan Esser Subject: Re: svn commit: r368072 - in head/contrib/bc: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests Message-ID: Date: Fri, 27 Nov 2020 10:03:55 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <202011262247.0AQMlrE5071306@slippy.cwsent.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 09:03:59 -0000 Am 26.11.20 um 23:47 schrieb Cy Schubert: > A clean build (sort of) did fix it: rm the appropriate subdir actually. Now I see what caused your issues: The file lib.c is created by running strgen.sh with parameters from the Makefile, and the invocation of this script changed. I have made the generated files depend on the Makefile to catch and parameter changes. Maybe I should have added a dependency on the script too, but do not expect it to change again. Regards, STefan From owner-svn-src-all@freebsd.org Fri Nov 27 11:12:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 917DB4A514B; Fri, 27 Nov 2020 11:12:11 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjBmC301bz4vqY; Fri, 27 Nov 2020 11:12:11 +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 59889145F0; Fri, 27 Nov 2020 11:12:11 +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 0ARBCBRC076867; Fri, 27 Nov 2020 11:12:11 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ARBCBaQ076866; Fri, 27 Nov 2020 11:12:11 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202011271112.0ARBCBaQ076866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 27 Nov 2020 11:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368100 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 368100 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 11:12:11 -0000 Author: kp Date: Fri Nov 27 11:12:10 2020 New Revision: 368100 URL: https://svnweb.freebsd.org/changeset/base/368100 Log: MFC r367867: pf: Fix incorrect assertion We never set PFRULE_RULESRCTRACK when calling pf_insert_src_node(). We do set PFRULE_SRCTRACK, so update the assertion to match. Modified: stable/12/sys/netpfil/pf/pf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/pf.c ============================================================================== --- stable/12/sys/netpfil/pf/pf.c Fri Nov 27 09:07:46 2020 (r368099) +++ stable/12/sys/netpfil/pf/pf.c Fri Nov 27 11:12:10 2020 (r368100) @@ -705,7 +705,7 @@ pf_insert_src_node(struct pf_src_node **sn, struct pf_ struct pf_addr *src, sa_family_t af) { - KASSERT((rule->rule_flag & PFRULE_RULESRCTRACK || + KASSERT((rule->rule_flag & PFRULE_SRCTRACK || rule->rpool.opts & PF_POOL_STICKYADDR), ("%s for non-tracking rule %p", __func__, rule)); From owner-svn-src-all@freebsd.org Fri Nov 27 11:13:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C43284A4F9D; Fri, 27 Nov 2020 11:13:00 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjBn85G2Hz4vjj; Fri, 27 Nov 2020 11:13:00 +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 A7D2614453; Fri, 27 Nov 2020 11:13:00 +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 0ARBD0Kg076957; Fri, 27 Nov 2020 11:13:00 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ARBD08f076955; Fri, 27 Nov 2020 11:13:00 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202011271113.0ARBD08f076955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 27 Nov 2020 11:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368101 - stable/12/tests/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/tests/sys/netpfil/pf X-SVN-Commit-Revision: 368101 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 11:13:00 -0000 Author: kp Date: Fri Nov 27 11:12:59 2020 New Revision: 368101 URL: https://svnweb.freebsd.org/changeset/base/368101 Log: MFC r367869: pf tests: Basic source tracking test Added: stable/12/tests/sys/netpfil/pf/src_track.sh - copied unchanged from r367869, head/tests/sys/netpfil/pf/src_track.sh Modified: stable/12/tests/sys/netpfil/pf/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/netpfil/pf/Makefile ============================================================================== --- stable/12/tests/sys/netpfil/pf/Makefile Fri Nov 27 11:12:10 2020 (r368100) +++ stable/12/tests/sys/netpfil/pf/Makefile Fri Nov 27 11:12:59 2020 (r368101) @@ -12,6 +12,7 @@ ATF_TESTS_SH+= anchor \ names \ nat \ set_tos \ + src_track \ rdr \ route_to \ synproxy \ Copied: stable/12/tests/sys/netpfil/pf/src_track.sh (from r367869, head/tests/sys/netpfil/pf/src_track.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tests/sys/netpfil/pf/src_track.sh Fri Nov 27 11:12:59 2020 (r368101, copy of r367869, head/tests/sys/netpfil/pf/src_track.sh) @@ -0,0 +1,66 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 Kristof Provost +# +# 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. + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "source_track" "cleanup" +source_track_head() +{ + atf_set descr 'Basic source tracking test' + atf_set require.user root +} + +source_track_body() +{ + pft_init + + epair=$(vnet_mkepair) + + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a 192.0.2.2/24 up + jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up + + # Enable pf! + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "pass in keep state (source-track)" \ + "pass out keep state (source-track)" + + ping -c 3 192.0.2.1 + jexec alcatraz pfctl -s all -v +} + +source_track_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "source_track" +} From owner-svn-src-all@freebsd.org Fri Nov 27 11:48:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43D3F4A5E0D; Fri, 27 Nov 2020 11:48:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjCZB1HpCz3DNN; Fri, 27 Nov 2020 11:48:34 +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 1AC6E14EA6; Fri, 27 Nov 2020 11:48:34 +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 0ARBmXUf095733; Fri, 27 Nov 2020 11:48:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ARBmXFZ095732; Fri, 27 Nov 2020 11:48:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011271148.0ARBmXFZ095732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 27 Nov 2020 11:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368102 - stable/12/sys/fs/msdosfs X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/fs/msdosfs X-SVN-Commit-Revision: 368102 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 11:48:34 -0000 Author: kib Date: Fri Nov 27 11:48:33 2020 New Revision: 368102 URL: https://svnweb.freebsd.org/changeset/base/368102 Log: MFC r367890: msdosfs: Add trivial support for suspension. Modified: stable/12/sys/fs/msdosfs/msdosfs_vfsops.c stable/12/sys/fs/msdosfs/msdosfs_vnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- stable/12/sys/fs/msdosfs/msdosfs_vfsops.c Fri Nov 27 11:12:59 2020 (r368101) +++ stable/12/sys/fs/msdosfs/msdosfs_vfsops.c Fri Nov 27 11:48:33 2020 (r368102) @@ -941,6 +941,12 @@ loop: error = msdosfs_fsiflush(pmp, waitfor); if (error != 0) allerror = error; + + if (allerror == 0 && waitfor == MNT_SUSPEND) { + MNT_ILOCK(mp); + mp->mnt_kern_flag |= MNTK_SUSPEND2 | MNTK_SUSPENDED; + MNT_IUNLOCK(mp); + } return (allerror); } Modified: stable/12/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/12/sys/fs/msdosfs/msdosfs_vnops.c Fri Nov 27 11:12:59 2020 (r368101) +++ stable/12/sys/fs/msdosfs/msdosfs_vnops.c Fri Nov 27 11:48:33 2020 (r368102) @@ -849,7 +849,7 @@ msdosfs_fsync(struct vop_fsync_args *ap) * Non-critical metadata for associated directory entries only * gets synced accidentally, as in most file systems. */ - if (ap->a_waitfor == MNT_WAIT) { + if (ap->a_waitfor != MNT_NOWAIT) { devvp = VTODE(ap->a_vp)->de_pmp->pm_devvp; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); allerror = VOP_FSYNC(devvp, MNT_WAIT, ap->a_td); @@ -857,7 +857,7 @@ msdosfs_fsync(struct vop_fsync_args *ap) } else allerror = 0; - error = deupdat(VTODE(ap->a_vp), ap->a_waitfor == MNT_WAIT); + error = deupdat(VTODE(ap->a_vp), ap->a_waitfor != MNT_NOWAIT); if (allerror == 0) allerror = error; return (allerror); From owner-svn-src-all@freebsd.org Fri Nov 27 11:51:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA5464A5FB3; Fri, 27 Nov 2020 11:51:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjCd76JZRz3Dtf; Fri, 27 Nov 2020 11:51:07 +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 CBD8614D4C; Fri, 27 Nov 2020 11:51:07 +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 0ARBp7PH096647; Fri, 27 Nov 2020 11:51:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ARBp7wl096638; Fri, 27 Nov 2020 11:51:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011271151.0ARBp7wl096638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 27 Nov 2020 11:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368103 - stable/12/sys/dev/sound/pcm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/sound/pcm X-SVN-Commit-Revision: 368103 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 11:51:08 -0000 Author: kib Date: Fri Nov 27 11:51:07 2020 New Revision: 368103 URL: https://svnweb.freebsd.org/changeset/base/368103 Log: MFC r367892: Unlock channels when any of them are locked, when returning for non-busy state. Modified: stable/12/sys/dev/sound/pcm/dsp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sound/pcm/dsp.c ============================================================================== --- stable/12/sys/dev/sound/pcm/dsp.c Fri Nov 27 11:48:33 2020 (r368102) +++ stable/12/sys/dev/sound/pcm/dsp.c Fri Nov 27 11:51:07 2020 (r368103) @@ -858,6 +858,8 @@ dsp_io_ops(struct cdev *i_dev, struct uio *buf) getchns(i_dev, &rdch, &wrch, prio); if (*ch == NULL || !((*ch)->flags & CHN_F_BUSY)) { + if (rdch != NULL || wrch != NULL) + relchns(i_dev, rdch, wrch, prio); PCM_GIANT_EXIT(d); return (EBADF); } From owner-svn-src-all@freebsd.org Fri Nov 27 12:08:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EEE624A6970; Fri, 27 Nov 2020 12:08:31 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjD1C5pBxz3Fn9; Fri, 27 Nov 2020 12:08:31 +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 762868D4A166; Fri, 27 Nov 2020 12:08:23 +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 EBBA2E708BC; Fri, 27 Nov 2020 12:08:22 +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 kVRnwQMz9MMy; Fri, 27 Nov 2020 12:08:21 +0000 (UTC) Received: from [127.0.0.1] (unknown [IPv6:fde9:577b:c1a9:4902:a426:5154:d8c0:5efb]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 2EBF1E707C0; Fri, 27 Nov 2020 12:08:20 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Alan Somers" Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk Date: Fri, 27 Nov 2020 12:08:19 +0000 X-Mailer: MailMate (2.0BETAr6151) Message-ID: <1E846E83-998A-4ACC-9491-D0411899C1A7@lists.zabbadoz.net> In-Reply-To: References: <202011260429.0AQ4TV2B023801@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CjD1C5pBxz3Fn9 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 12:08:32 -0000 On 26 Nov 2020, at 18:51, Alan Somers wrote: > On Thu, Nov 26, 2020 at 2:16 AM Bjoern A. Zeeb < > bzeeb-lists@lists.zabbadoz.net> wrote: > >> On 26 Nov 2020, at 4:29, Alan Somers wrote: >> >>> Author: asomers >>> Date: Thu Nov 26 04:29:30 2020 >>> New Revision: 368045 >>> URL: https://svnweb.freebsd.org/changeset/base/368045 >>> >>> Log: >>> Merge ping6 to ping >>> >>> There is now a single ping binary, which chooses to use ICMP or >>> ICMPv4 >>> based on the -4 and -6 options, and the format of the address. >>> >>> Submitted by: Ján SuÄŤan >>> Sponsored by: Google LLC (Google Summer of Code 2019) >>> MFC after: Never >>> Differential Revision: https://reviews.freebsd.org/D21377 >> >> I don’t have IPv4 anymore. >> I don’t see any WITHOUT_INET or -DINET checks. >> How can I compile INET out now? >> > > I don't see any such checks before, either. Was it ever possible to > exclude ping by building WITHOUT_INET? No, for various reasons including startup scripts relying on it etc. I think no one ever bothered to fully find it all. But it was possible to just ditch the binary (not installing it into custom images, or rm -f it post-install along with other things). Now it’s a “dual-stack handling” binary and those we’ve tried with a lot of care to make sure they grow compiling out both ways as you cannot throw away the binary anymore. I don’t know how hard it is to do this now. I’ll be happy to have a look and help if it’s not a 5 minute job for you knowing the code and split up. Would we just have to handle main.c with #ifdefs and the old ping[4] files from the Makefile or is ping6 also using shared code from the former ping[4]? /bz From owner-svn-src-all@freebsd.org Fri Nov 27 13:25:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94A244A7CB4; Fri, 27 Nov 2020 13:25:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjFjh3qlMz3KM9; Fri, 27 Nov 2020 13:25:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 766A316222; Fri, 27 Nov 2020 13:25:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ARDPCpP057664; Fri, 27 Nov 2020 13:25:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ARDPCKg057663; Fri, 27 Nov 2020 13:25:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011271325.0ARDPCKg057663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Nov 2020 13:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368104 - stable/12/sys/cam X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam X-SVN-Commit-Revision: 368104 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 13:25:12 -0000 Author: mav Date: Fri Nov 27 13:25:12 2020 New Revision: 368104 URL: https://svnweb.freebsd.org/changeset/base/368104 Log: MFC r367862: Microoptimize cam_num_doneqs math in xpt_done(). Modified: stable/12/sys/cam/cam_xpt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/cam_xpt.c ============================================================================== --- stable/12/sys/cam/cam_xpt.c Fri Nov 27 11:51:07 2020 (r368103) +++ stable/12/sys/cam/cam_xpt.c Fri Nov 27 13:25:12 2020 (r368104) @@ -179,7 +179,7 @@ struct cam_doneq { }; static struct cam_doneq cam_doneqs[MAXCPU]; -static int cam_num_doneqs; +static u_int __read_mostly cam_num_doneqs; static struct proc *cam_proc; SYSCTL_INT(_kern_cam, OID_AUTO, num_doneqs, CTLFLAG_RDTUN, @@ -4671,7 +4671,7 @@ xpt_done(union ccb *done_ccb) /* Store the time the ccb was in the sim */ done_ccb->ccb_h.qos.periph_data = cam_iosched_delta_t(done_ccb->ccb_h.qos.periph_data); - hash = (done_ccb->ccb_h.path_id + done_ccb->ccb_h.target_id + + hash = (u_int)(done_ccb->ccb_h.path_id + done_ccb->ccb_h.target_id + done_ccb->ccb_h.target_lun) % cam_num_doneqs; queue = &cam_doneqs[hash]; mtx_lock(&queue->cam_doneq_mtx); From owner-svn-src-all@freebsd.org Fri Nov 27 14:32:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19B2B4A8CB3; Fri, 27 Nov 2020 14:32:42 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjHCY70Tlz3Msj; Fri, 27 Nov 2020 14:32:41 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f51.google.com with SMTP id n12so4883103otk.0; Fri, 27 Nov 2020 06:32:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9GhjiNJE36sOIxpjvwo9YyXBktg/tHu2zlm17cCNIKc=; b=sGZK2IRzLmDxu1Z3MiZdVofhIEq7ilKmbec0L41WTF2OOp4aQBK9aSdPOUJrnH14Ai gMATD0B5hC9WcAvIczNlPnZI2mp5MeTFyz+iWG7OcRRqUkftDpO/3mCunP7eBgV77ACM JJc7jfZBocmaihoXe/+ZpaSpKgLFCkJu27Wf2N7qVdyKFhELYFIMbbKyTYJ3G8YRLIbB r/gG7W6f10Mbn2DRz1OPYiAbMj8kCeIN45XrqfBF9L21J40mnFyuBpCYIYFabg4JK0fX G1pXMywDT/vc0Rl0ahVTRILvPYl3hxQkKNlDXV/H8mJrFUejod0veLJoXaUVeQ9vWw7m yAtw== X-Gm-Message-State: AOAM533x2BUZbrk3iAoGp6S7hv1PrTRYl05qck1xIfgcQpMDC86wTH08 yC4cc9ZQqmhYgUTqxCv+v2Nmcoe9KyOrITK4FBNTl0sADWc= X-Google-Smtp-Source: ABdhPJxJvHhqX6sMNTu/04lpZLAQHxwTtHgMUH2MBRn70n4guY/dJUENotbsZYZ5WdnhqEvRhYik4S07FRgoLjsowl0= X-Received: by 2002:a9d:3e1b:: with SMTP id a27mr6296572otd.291.1606487559950; Fri, 27 Nov 2020 06:32:39 -0800 (PST) MIME-Version: 1.0 References: <202011260429.0AQ4TV2B023801@repo.freebsd.org> <1E846E83-998A-4ACC-9491-D0411899C1A7@lists.zabbadoz.net> In-Reply-To: <1E846E83-998A-4ACC-9491-D0411899C1A7@lists.zabbadoz.net> From: Alan Somers Date: Fri, 27 Nov 2020 07:32:28 -0700 Message-ID: Subject: Re: svn commit: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk To: "Bjoern A. Zeeb" Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4CjHCY70Tlz3Msj X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 14:32:42 -0000 On Fri, Nov 27, 2020 at 5:08 AM Bjoern A. Zeeb < bzeeb-lists@lists.zabbadoz.net> wrote: > On 26 Nov 2020, at 18:51, Alan Somers wrote: > > > On Thu, Nov 26, 2020 at 2:16 AM Bjoern A. Zeeb < > > bzeeb-lists@lists.zabbadoz.net> wrote: > > > >> On 26 Nov 2020, at 4:29, Alan Somers wrote: > >> > >>> Author: asomers > >>> Date: Thu Nov 26 04:29:30 2020 > >>> New Revision: 368045 > >>> URL: https://svnweb.freebsd.org/changeset/base/368045 > >>> > >>> Log: > >>> Merge ping6 to ping > >>> > >>> There is now a single ping binary, which chooses to use ICMP or > >>> ICMPv4 > >>> based on the -4 and -6 options, and the format of the address. > >>> > >>> Submitted by: J=C3=A1n Su=C4=8Dan > >>> Sponsored by: Google LLC (Google Summer of Code 2019) > >>> MFC after: Never > >>> Differential Revision: https://reviews.freebsd.org/D21377 > >> > >> I don=E2=80=99t have IPv4 anymore. > >> I don=E2=80=99t see any WITHOUT_INET or -DINET checks. > >> How can I compile INET out now? > >> > > > > I don't see any such checks before, either. Was it ever possible to > > exclude ping by building WITHOUT_INET? > > No, for various reasons including startup scripts relying on it etc. > I think no one ever bothered to fully find it all. > > But it was possible to just ditch the binary (not installing it into > custom images, or rm -f it post-install along with other things). > > > Now it=E2=80=99s a =E2=80=9Cdual-stack handling=E2=80=9D binary and those= we=E2=80=99ve tried > with a lot of care to make sure they grow compiling out both ways as you > cannot throw away the binary anymore. > > I don=E2=80=99t know how hard it is to do this now. I=E2=80=99ll be happ= y to have a > look and help if it=E2=80=99s not a 5 minute job for you knowing the code= and > split up. Would we just have to handle main.c with #ifdefs and the old > ping[4] files from the Makefile or is ping6 also using shared code from > the former ping[4]? > > > /bz > Yes, that's about right. ping.c is the old ping.c, and ping6.c is the old ping6.c, with main() removed from both. So it should be pretty easy to compile out INET. -Alan From owner-svn-src-all@freebsd.org Fri Nov 27 15:50:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 846704AAFF8; Fri, 27 Nov 2020 15:50:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjJxB2Krsz3hJV; Fri, 27 Nov 2020 15:50:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DBF1178E1; Fri, 27 Nov 2020 15:50:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ARFoM8v043813; Fri, 27 Nov 2020 15:50:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ARFoKBo043804; Fri, 27 Nov 2020 15:50:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011271550.0ARFoKBo043804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Nov 2020 15:50:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368105 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 368105 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 15:50:22 -0000 Author: mav Date: Fri Nov 27 15:50:20 2020 New Revision: 368105 URL: https://svnweb.freebsd.org/changeset/base/368105 Log: Some code reorganization. - Remove code duplication by adding two new functions to execute prepared queue entry via either mbox or request queue and wait for result. - Since the new function executing via request queue sleeps any way, make it sleep also in case of overflows or handle shortages. It should make it more reliable and less affecting other less flexible request queue users. - Turn isp_target_put_entry() into not target-specific isp_send_entry(). - Make handling of responses with control handles more universal. - Move RQSTYPE_RPT_ID_ACQ handling into new function. - Inline isp_handle_other_response(), becoming trivial after above. - Clean the list of IOCBs from pre-24xx ones. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_library.c head/sys/dev/isp/isp_library.h head/sys/dev/isp/isp_target.c head/sys/dev/isp/isp_target.h head/sys/dev/isp/ispmbox.h head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Fri Nov 27 13:25:12 2020 (r368104) +++ head/sys/dev/isp/isp.c Fri Nov 27 15:50:20 2020 (r368105) @@ -93,7 +93,8 @@ static const uint8_t alpa_map[] = { /* * Local function prototypes. */ -static int isp_handle_other_response(ispsoftc_t *, int, isphdr_t *, uint32_t *, uint16_t); +static int isp_handle_control(ispsoftc_t *, isphdr_t *); +static void isp_handle_rpt_id_acq(ispsoftc_t *, isphdr_t *); static void isp_parse_status_24xx(ispsoftc_t *, isp24xx_statusreq_t *, XS_T *); static void isp_clear_portdb(ispsoftc_t *, int); static void isp_mark_portdb(ispsoftc_t *, int); @@ -1020,8 +1021,7 @@ isp_fc_enable_vp(ispsoftc_t *isp, int chan) { fcparam *fcp = FCPARAM(isp, chan); vp_modify_t vp; - void *reqp; - uint8_t resp[QENTRY_LEN]; + int retval; /* Build a VP MODIFY command in memory */ ISP_MEMZERO(&vp, sizeof(vp)); @@ -1044,37 +1044,13 @@ isp_fc_enable_vp(ispsoftc_t *isp, int chan) MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwpn, fcp->isp_wwpn); MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwnn, fcp->isp_wwnn); - /* Prepare space for response in memory */ - memset(resp, 0xff, sizeof(resp)); - vp.vp_mod_hdl = isp_allocate_handle(isp, resp, ISP_HANDLE_CTRL); - if (vp.vp_mod_hdl == 0) { - isp_prt(isp, ISP_LOGERR, - "%s: VP_MODIFY of Chan %d out of handles", __func__, chan); - return (EIO); + retval = isp_exec_entry_queue(isp, &vp, &vp, 5); + if (retval != 0) { + isp_prt(isp, ISP_LOGERR, "%s: VP_MODIFY of chan %d error %d", + __func__, chan, retval); + return (retval); } - /* Send request and wait for response. */ - reqp = isp_getrqentry(isp); - if (reqp == NULL) { - isp_prt(isp, ISP_LOGERR, - "%s: VP_MODIFY of Chan %d out of rqent", __func__, chan); - isp_destroy_handle(isp, vp.vp_mod_hdl); - return (EIO); - } - isp_put_vp_modify(isp, &vp, (vp_modify_t *)reqp); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "IOCB VP_MODIFY", QENTRY_LEN, reqp); - ISP_SYNC_REQUEST(isp); - if (msleep(resp, &isp->isp_lock, 0, "VP_MODIFY", 5*hz) == EWOULDBLOCK) { - isp_prt(isp, ISP_LOGERR, - "%s: VP_MODIFY of Chan %d timed out", __func__, chan); - isp_destroy_handle(isp, vp.vp_mod_hdl); - return (EIO); - } - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "IOCB VP_MODIFY response", QENTRY_LEN, resp); - isp_get_vp_modify(isp, (vp_modify_t *)resp, &vp); - if (vp.vp_mod_hdr.rqs_flags != 0 || vp.vp_mod_status != VP_STS_OK) { isp_prt(isp, ISP_LOGERR, "%s: VP_MODIFY of Chan %d failed with flags %x status %d", @@ -1088,8 +1064,7 @@ static int isp_fc_disable_vp(ispsoftc_t *isp, int chan) { vp_ctrl_info_t vp; - void *reqp; - uint8_t resp[QENTRY_LEN]; + int retval; /* Build a VP CTRL command in memory */ ISP_MEMZERO(&vp, sizeof(vp)); @@ -1105,37 +1080,13 @@ isp_fc_disable_vp(ispsoftc_t *isp, int chan) vp.vp_ctrl_vp_count = 1; vp.vp_ctrl_idmap[chan / 16] |= (1 << chan % 16); - /* Prepare space for response in memory */ - memset(resp, 0xff, sizeof(resp)); - vp.vp_ctrl_handle = isp_allocate_handle(isp, resp, ISP_HANDLE_CTRL); - if (vp.vp_ctrl_handle == 0) { - isp_prt(isp, ISP_LOGERR, - "%s: VP_CTRL of Chan %d out of handles", __func__, chan); - return (EIO); + retval = isp_exec_entry_queue(isp, &vp, &vp, 5); + if (retval != 0) { + isp_prt(isp, ISP_LOGERR, "%s: VP_CTRL of chan %d error %d", + __func__, chan, retval); + return (retval); } - /* Send request and wait for response. */ - reqp = isp_getrqentry(isp); - if (reqp == NULL) { - isp_prt(isp, ISP_LOGERR, - "%s: VP_CTRL of Chan %d out of rqent", __func__, chan); - isp_destroy_handle(isp, vp.vp_ctrl_handle); - return (EIO); - } - isp_put_vp_ctrl_info(isp, &vp, (vp_ctrl_info_t *)reqp); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "IOCB VP_CTRL", QENTRY_LEN, reqp); - ISP_SYNC_REQUEST(isp); - if (msleep(resp, &isp->isp_lock, 0, "VP_CTRL", 5*hz) == EWOULDBLOCK) { - isp_prt(isp, ISP_LOGERR, - "%s: VP_CTRL of Chan %d timed out", __func__, chan); - isp_destroy_handle(isp, vp.vp_ctrl_handle); - return (EIO); - } - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "IOCB VP_CTRL response", QENTRY_LEN, resp); - isp_get_vp_ctrl_info(isp, (vp_ctrl_info_t *)resp, &vp); - if (vp.vp_ctrl_hdr.rqs_flags != 0 || vp.vp_ctrl_status != 0) { isp_prt(isp, ISP_LOGERR, "%s: VP_CTRL of Chan %d failed with flags %x status %d %d", @@ -1230,10 +1181,8 @@ static int isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, uint32_t portid, int flags) { isp_plogx_t pl; - void *reqp; - uint8_t resp[QENTRY_LEN]; uint32_t sst, parm1; - int rval, lev; + int retval, lev; const char *msg; char buf[64]; @@ -1250,40 +1199,13 @@ isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, pl.plogx_rspsz_porthi = (portid >> 16) & 0xff; pl.plogx_flags = flags; - /* Prepare space for response in memory */ - memset(resp, 0xff, sizeof(resp)); - pl.plogx_handle = isp_allocate_handle(isp, resp, ISP_HANDLE_CTRL); - if (pl.plogx_handle == 0) { - isp_prt(isp, ISP_LOGERR, - "%s: PLOGX of Chan %d out of handles", __func__, chan); - return (-1); + retval = isp_exec_entry_queue(isp, &pl, &pl, 3 * ICB_LOGIN_TOV); + if (retval != 0) { + isp_prt(isp, ISP_LOGERR, "%s: PLOGX of chan %d error %d", + __func__, chan, retval); + return (retval); } - /* Send request and wait for response. */ - reqp = isp_getrqentry(isp); - if (reqp == NULL) { - isp_prt(isp, ISP_LOGERR, - "%s: PLOGX of Chan %d out of rqent", __func__, chan); - isp_destroy_handle(isp, pl.plogx_handle); - return (-1); - } - isp_put_plogx(isp, &pl, (isp_plogx_t *)reqp); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "IOCB LOGX", QENTRY_LEN, reqp); - FCPARAM(isp, chan)->isp_login_hdl = handle; - ISP_SYNC_REQUEST(isp); - if (msleep(resp, &isp->isp_lock, 0, "PLOGX", 3 * ICB_LOGIN_TOV * hz) - == EWOULDBLOCK) { - isp_prt(isp, ISP_LOGERR, - "%s: PLOGX of Chan %d timed out", __func__, chan); - isp_destroy_handle(isp, pl.plogx_handle); - return (-1); - } - FCPARAM(isp, chan)->isp_login_hdl = NIL_HANDLE; - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, resp); - isp_get_plogx(isp, (isp_plogx_t *)resp, &pl); - if (pl.plogx_status == PLOGX_STATUS_OK) { return (0); } else if (pl.plogx_status != PLOGX_STATUS_IOCBERR) { @@ -1296,7 +1218,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, sst = pl.plogx_ioparm[0].lo16 | (pl.plogx_ioparm[0].hi16 << 16); parm1 = pl.plogx_ioparm[1].lo16 | (pl.plogx_ioparm[1].hi16 << 16); - rval = -1; + retval = -1; lev = ISP_LOGERR; msg = NULL; @@ -1323,7 +1245,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, case PLOGX_IOCBERR_NOLOGIN: ISP_SNPRINTF(buf, sizeof (buf), "not logged in (last state 0x%x)", parm1); msg = buf; - rval = MBOX_NOT_LOGGED_IN; + retval = MBOX_NOT_LOGGED_IN; break; case PLOGX_IOCBERR_REJECT: ISP_SNPRINTF(buf, sizeof (buf), "LS_RJT = 0x%x", parm1); @@ -1340,13 +1262,13 @@ isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, lev = ISP_LOG_SANCFG|ISP_LOG_WARN1; ISP_SNPRINTF(buf, sizeof (buf), "already logged in with N-Port handle 0x%x", parm1); msg = buf; - rval = MBOX_PORT_ID_USED | (parm1 << 16); + retval = MBOX_PORT_ID_USED | (parm1 << 16); break; case PLOGX_IOCBERR_HNDLUSED: lev = ISP_LOG_SANCFG|ISP_LOG_WARN1; ISP_SNPRINTF(buf, sizeof (buf), "handle already used for PortID 0x%06x", parm1); msg = buf; - rval = MBOX_LOOP_ID_USED; + retval = MBOX_LOOP_ID_USED; break; case PLOGX_IOCBERR_NOHANDLE: msg = "no handle allocated"; @@ -1363,7 +1285,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, isp_prt(isp, lev, "Chan %d PLOGX PortID 0x%06x to N-Port handle 0x%x: %s", chan, portid, handle, msg); } - return (rval); + return (retval); } static int @@ -1883,8 +1805,7 @@ isp_ct_passthru(ispsoftc_t *isp, int chan, uint32_t cm { fcparam *fcp = FCPARAM(isp, chan); isp_ct_pt_t pt; - void *reqp; - uint8_t resp[QENTRY_LEN]; + int retval; if (isp->isp_dblev & ISP_LOGDEBUG1) isp_print_bytes(isp, "CT request", cmd_bcnt, fcp->isp_scratch); @@ -1909,37 +1830,13 @@ isp_ct_passthru(ispsoftc_t *isp, int chan, uint32_t cm pt.ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma); pt.ctp_dataseg[1].ds_count = rsp_bcnt; - /* Prepare space for response in memory */ - memset(resp, 0xff, sizeof(resp)); - pt.ctp_handle = isp_allocate_handle(isp, resp, ISP_HANDLE_CTRL); - if (pt.ctp_handle == 0) { - isp_prt(isp, ISP_LOGERR, - "%s: CTP of Chan %d out of handles", __func__, chan); - return (-1); + retval = isp_exec_entry_queue(isp, &pt, &pt, 2 * pt.ctp_time); + if (retval != 0) { + isp_prt(isp, ISP_LOGERR, "%s: CTP of chan %d error %d", + __func__, chan, retval); + return (retval); } - /* Send request and wait for response. */ - reqp = isp_getrqentry(isp); - if (reqp == NULL) { - isp_prt(isp, ISP_LOGERR, - "%s: CTP of Chan %d out of rqent", __func__, chan); - isp_destroy_handle(isp, pt.ctp_handle); - return (-1); - } - isp_put_ct_pt(isp, &pt, (isp_ct_pt_t *)reqp); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT IOCB request", QENTRY_LEN, reqp); - ISP_SYNC_REQUEST(isp); - if (msleep(resp, &isp->isp_lock, 0, "CTP", pt.ctp_time*hz) == EWOULDBLOCK) { - isp_prt(isp, ISP_LOGERR, - "%s: CTP of Chan %d timed out", __func__, chan); - isp_destroy_handle(isp, pt.ctp_handle); - return (-1); - } - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT IOCB response", QENTRY_LEN, resp); - - isp_get_ct_pt(isp, (isp_ct_pt_t *)resp, &pt); if (pt.ctp_status && pt.ctp_status != RQCS_DATA_UNDERRUN) { isp_prt(isp, ISP_LOGWARN, "Chan %d CT pass-through returned 0x%x", @@ -2873,7 +2770,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...) fcparam *fcp; fcportdb_t *lp; XS_T *xs; - mbreg_t mbs; + mbreg_t *mbr; int chan, tgt; uint32_t handle; va_list ap; @@ -2919,32 +2816,15 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...) tmf->tmf_tidlo = lp->portid; tmf->tmf_tidhi = lp->portid >> 16; tmf->tmf_vpidx = ISP_GET_VPIDX(isp, chan); - isp_put_24xx_tmf(isp, tmf, isp->isp_iocb); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "TMF IOCB request", QENTRY_LEN, isp->isp_iocb); - MEMORYBARRIER(isp, SYNC_IFORDEV, 0, QENTRY_LEN, chan); fcp->sendmarker = 1; - isp_prt(isp, ISP_LOGALL, "Chan %d Reset N-Port Handle 0x%04x @ Port 0x%06x", chan, lp->handle, lp->portid); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, - MBCMD_DEFAULT_TIMEOUT + tmf->tmf_timeout * 1000000); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(isp->isp_iocb_dma); - mbs.param[3] = DMA_WD0(isp->isp_iocb_dma); - mbs.param[6] = DMA_WD3(isp->isp_iocb_dma); - mbs.param[7] = DMA_WD2(isp->isp_iocb_dma); - isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) - break; - MEMORYBARRIER(isp, SYNC_IFORCPU, QENTRY_LEN, QENTRY_LEN, chan); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "TMF IOCB response", QENTRY_LEN, &((isp24xx_statusreq_t *)isp->isp_iocb)[1]); sp = (isp24xx_statusreq_t *) local; - isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)isp->isp_iocb)[1], sp); - if (sp->req_completion_status == 0) { + if (isp_exec_entry_mbox(isp, tmf, sp, 2 * tmf->tmf_timeout)) + break; + + if (sp->req_completion_status == 0) return (0); - } isp_prt(isp, ISP_LOGWARN, "Chan %d reset of target %d returned 0x%x", chan, tgt, sp->req_completion_status); break; } @@ -2984,30 +2864,12 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...) ab->abrt_tidlo = lp->portid; ab->abrt_tidhi = lp->portid >> 16; ab->abrt_vpidx = ISP_GET_VPIDX(isp, chan); - isp_put_24xx_abrt(isp, ab, isp->isp_iocb); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "AB IOCB quest", QENTRY_LEN, isp->isp_iocb); - MEMORYBARRIER(isp, SYNC_IFORDEV, 0, 2 * QENTRY_LEN, chan); - ISP_MEMZERO(&mbs, sizeof (mbs)); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 5000000); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(isp->isp_iocb_dma); - mbs.param[3] = DMA_WD0(isp->isp_iocb_dma); - mbs.param[6] = DMA_WD3(isp->isp_iocb_dma); - mbs.param[7] = DMA_WD2(isp->isp_iocb_dma); - - isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) + if (isp_exec_entry_mbox(isp, ab, ab, 5)) break; - MEMORYBARRIER(isp, SYNC_IFORCPU, QENTRY_LEN, QENTRY_LEN, chan); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "AB IOCB response", QENTRY_LEN, &((isp24xx_abrt_t *)isp->isp_iocb)[1]); - isp_get_24xx_abrt(isp, &((isp24xx_abrt_t *)isp->isp_iocb)[1], ab); - if (ab->abrt_nphdl == ISP24XX_ABRT_OKAY) { + if (ab->abrt_nphdl == ISP24XX_ABRT_OKAY) return (0); - } isp_prt(isp, ISP_LOGWARN, "Chan %d handle %d abort returned 0x%x", chan, tgt, ab->abrt_nphdl); } case ISPCTL_FCLINK_TEST: @@ -3082,6 +2944,14 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...) } return (0); } + case ISPCTL_RUN_MBOXCMD: + { + va_start(ap, ctl); + mbr = va_arg(ap, mbreg_t *); + va_end(ap); + isp_mboxcmd(isp, mbr); + return (0); + } case ISPCTL_PLOGX: { isp_plcmd_t *p; @@ -3134,8 +3004,6 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...) void isp_intr_atioq(ispsoftc_t *isp) { - uint8_t qe[QENTRY_LEN]; - isphdr_t *hp; void *addr; uint32_t iptr, optr, oop; @@ -3145,9 +3013,7 @@ isp_intr_atioq(ispsoftc_t *isp) oop = optr; MEMORYBARRIER(isp, SYNC_ATIOQ, oop, QENTRY_LEN, -1); addr = ISP_QUEUE_ENTRY(isp->isp_atioq, oop); - isp_get_hdr(isp, addr, (isphdr_t *)qe); - hp = (isphdr_t *)qe; - switch (hp->rqs_entry_type) { + switch (((isphdr_t *)addr)->rqs_entry_type) { case RQSTYPE_NOTIFY: case RQSTYPE_ATIO: case RQSTYPE_NOTIFY_ACK: /* Can be set to ATIO queue.*/ @@ -3252,10 +3118,20 @@ isp_intr_respq(ispsoftc_t *isp) isp_done(cont_xs); } - if (etype == RQSTYPE_RESPONSE) { + if (isp_handle_control(isp, hp)) { + ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ + continue; + } + + switch (etype) { + case RQSTYPE_RESPONSE: isp_get_24xx_response(isp, (isp24xx_statusreq_t *)hp, sp); - /* FALLTHROUGH */ - } else if (etype == RQSTYPE_STATUS_CONT) { + break; + case RQSTYPE_MARKER: + isp_prt(isp, ISP_LOG_WARN1, "Marker Response"); + ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ + continue; + case RQSTYPE_STATUS_CONT: isp_get_cont_response(isp, (ispstatus_cont_t *)hp, scp); if (cont > 0) { slen = min(cont, sizeof(scp->req_sense_data)); @@ -3273,8 +3149,12 @@ isp_intr_respq(ispsoftc_t *isp) } ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ continue; - } else if (isp_handle_other_response(isp, etype, hp, - &cptr, RESULT_QUEUE_LEN(isp))) { +#ifdef ISP_TARGET_MODE + case RQSTYPE_NOTIFY_ACK: /* Can be set to ATIO queue. */ + case RQSTYPE_CTIO7: + case RQSTYPE_ABTS_RCVD: /* Can be set to ATIO queue. */ + case RQSTYPE_ABTS_RSP: + isp_target_notify(isp, hp, &cptr, RESULT_QUEUE_LEN(isp)); /* More then one IOCB could be consumed. */ while (sptr != cptr) { ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ @@ -3284,7 +3164,12 @@ isp_intr_respq(ispsoftc_t *isp) ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ optr = ISP_NXT_QENTRY(cptr, RESULT_QUEUE_LEN(isp)); continue; - } else { +#endif + case RQSTYPE_RPT_ID_ACQ: /* Can be set to ATIO queue.*/ + isp_handle_rpt_id_acq(isp, hp); + ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ + continue; + default: /* We don't know what was this -- log and skip. */ isp_prt(isp, ISP_LOGERR, notresp, etype, cptr, optr); ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ @@ -3657,65 +3542,30 @@ isp_intr_async(ispsoftc_t *isp, uint16_t mbox) } /* - * Handle other response entries. A pointer to the request queue output - * index is here in case we want to eat several entries at once, although - * this is not used currently. + * Handle completions with control handles by waking up waiting threads. */ - static int -isp_handle_other_response(ispsoftc_t *isp, int type, isphdr_t *hp, uint32_t *optrp, uint16_t ql) +isp_handle_control(ispsoftc_t *isp, isphdr_t *hp) { - isp_ridacq_t rid; - int chan, c; - uint32_t hdl, portid; + uint32_t hdl; void *ptr; - switch (type) { + switch (hp->rqs_entry_type) { + case RQSTYPE_RESPONSE: case RQSTYPE_MARKER: - isp_prt(isp, ISP_LOG_WARN1, "Marker Response"); - return (1); - case RQSTYPE_RPT_ID_ACQ: /* Can be set to ATIO queue.*/ - isp_get_ridacq(isp, (isp_ridacq_t *)hp, &rid); - portid = (uint32_t)rid.ridacq_vp_port_hi << 16 | - rid.ridacq_vp_port_lo; - if (rid.ridacq_format == 0) { - for (chan = 0; chan < isp->isp_nchan; chan++) { - fcparam *fcp = FCPARAM(isp, chan); - if (fcp->role == ISP_ROLE_NONE) - continue; - c = (chan == 0) ? 127 : (chan - 1); - if (rid.ridacq_map[c / 16] & (1 << (c % 16)) || - chan == 0) { - fcp->isp_loopstate = LOOP_HAVE_LINK; - isp_async(isp, ISPASYNC_CHANGE_NOTIFY, - chan, ISPASYNC_CHANGE_OTHER); - } else { - fcp->isp_loopstate = LOOP_NIL; - isp_async(isp, ISPASYNC_LOOP_DOWN, - chan); - } - } - } else { - fcparam *fcp = FCPARAM(isp, rid.ridacq_vp_index); - if (rid.ridacq_vp_status == RIDACQ_STS_COMPLETE || - rid.ridacq_vp_status == RIDACQ_STS_CHANGED) { - fcp->isp_topo = (rid.ridacq_map[0] >> 9) & 0x7; - fcp->isp_portid = portid; - fcp->isp_loopstate = LOOP_HAVE_ADDR; - isp_async(isp, ISPASYNC_CHANGE_NOTIFY, - rid.ridacq_vp_index, ISPASYNC_CHANGE_OTHER); - } else { - fcp->isp_loopstate = LOOP_NIL; - isp_async(isp, ISPASYNC_LOOP_DOWN, - rid.ridacq_vp_index); - } - } - return (1); + case RQSTYPE_NOTIFY_ACK: + case RQSTYPE_CTIO7: + case RQSTYPE_TSK_MGMT: case RQSTYPE_CT_PASSTHRU: case RQSTYPE_VP_MODIFY: case RQSTYPE_VP_CTRL: + case RQSTYPE_ABORT_IO: + case RQSTYPE_MBOX: case RQSTYPE_LOGIN: + case RQSTYPE_ELS_PASSTHRU: ISP_IOXGET_32(isp, (uint32_t *)(hp + 1), hdl); + if (ISP_H2HT(hdl) != ISP_HANDLE_CTRL) + break; ptr = isp_find_xs(isp, hdl); if (ptr != NULL) { isp_destroy_handle(isp, hdl); @@ -3723,16 +3573,52 @@ isp_handle_other_response(ispsoftc_t *isp, int type, i wakeup(ptr); } return (1); - case RQSTYPE_NOTIFY_ACK: /* Can be set to ATIO queue. */ - case RQSTYPE_CTIO7: - case RQSTYPE_ABTS_RCVD: /* Can be set to ATIO queue. */ - case RQSTYPE_ABTS_RSP: -#ifdef ISP_TARGET_MODE - return (isp_target_notify(isp, hp, optrp, ql)); -#endif - /* FALLTHROUGH */ - default: - return (0); + } + return (0); +} + +static void +isp_handle_rpt_id_acq(ispsoftc_t *isp, isphdr_t *hp) +{ + fcparam *fcp; + isp_ridacq_t rid; + int chan, c; + uint32_t portid; + + isp_get_ridacq(isp, (isp_ridacq_t *)hp, &rid); + portid = (uint32_t)rid.ridacq_vp_port_hi << 16 | + rid.ridacq_vp_port_lo; + if (rid.ridacq_format == 0) { + for (chan = 0; chan < isp->isp_nchan; chan++) { + fcp = FCPARAM(isp, chan); + if (fcp->role == ISP_ROLE_NONE) + continue; + c = (chan == 0) ? 127 : (chan - 1); + if (rid.ridacq_map[c / 16] & (1 << (c % 16)) || + chan == 0) { + fcp->isp_loopstate = LOOP_HAVE_LINK; + isp_async(isp, ISPASYNC_CHANGE_NOTIFY, + chan, ISPASYNC_CHANGE_OTHER); + } else { + fcp->isp_loopstate = LOOP_NIL; + isp_async(isp, ISPASYNC_LOOP_DOWN, + chan); + } + } + } else { + fcp = FCPARAM(isp, rid.ridacq_vp_index); + if (rid.ridacq_vp_status == RIDACQ_STS_COMPLETE || + rid.ridacq_vp_status == RIDACQ_STS_CHANGED) { + fcp->isp_topo = (rid.ridacq_map[0] >> 9) & 0x7; + fcp->isp_portid = portid; + fcp->isp_loopstate = LOOP_HAVE_ADDR; + isp_async(isp, ISPASYNC_CHANGE_NOTIFY, + rid.ridacq_vp_index, ISPASYNC_CHANGE_OTHER); + } else { + fcp->isp_loopstate = LOOP_NIL; + isp_async(isp, ISPASYNC_LOOP_DOWN, + rid.ridacq_vp_index); + } } } Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Fri Nov 27 13:25:12 2020 (r368104) +++ head/sys/dev/isp/isp_freebsd.c Fri Nov 27 15:50:20 2020 (r368105) @@ -492,8 +492,6 @@ ispioctl(struct cdev *dev, u_long c, caddr_t addr, int int needmarker; struct isp_fc_tsk_mgmt *fct = (struct isp_fc_tsk_mgmt *) addr; uint16_t nphdl; - void *reqp; - uint8_t resp[QENTRY_LEN]; isp24xx_tmf_t tmf; isp24xx_statusreq_t sp; fcparam *fcp; @@ -564,47 +562,14 @@ ispioctl(struct cdev *dev, u_long c, caddr_t addr, int break; } - /* Prepare space for response in memory */ - memset(resp, 0xff, sizeof(resp)); - tmf.tmf_handle = isp_allocate_handle(isp, resp, - ISP_HANDLE_CTRL); - if (tmf.tmf_handle == 0) { - isp_prt(isp, ISP_LOGERR, - "%s: TMF of Chan %d out of handles", - __func__, chan); + retval = isp_exec_entry_queue(isp, &tmf, &sp, 5); + if (retval != 0) { + isp_prt(isp, ISP_LOGERR, "%s: TMF of chan %d error %d", + __func__, chan, retval); ISP_UNLOCK(isp); - retval = ENOMEM; break; } - /* Send request and wait for response. */ - reqp = isp_getrqentry(isp); - if (reqp == NULL) { - isp_prt(isp, ISP_LOGERR, - "%s: TMF of Chan %d out of rqent", - __func__, chan); - isp_destroy_handle(isp, tmf.tmf_handle); - ISP_UNLOCK(isp); - retval = EIO; - break; - } - isp_put_24xx_tmf(isp, &tmf, (isp24xx_tmf_t *)reqp); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "IOCB TMF", QENTRY_LEN, reqp); - ISP_SYNC_REQUEST(isp); - if (msleep(resp, &isp->isp_lock, 0, "TMF", 5*hz) == EWOULDBLOCK) { - isp_prt(isp, ISP_LOGERR, - "%s: TMF of Chan %d timed out", - __func__, chan); - isp_destroy_handle(isp, tmf.tmf_handle); - ISP_UNLOCK(isp); - retval = EIO; - break; - } - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "IOCB TMF response", QENTRY_LEN, resp); - isp_get_24xx_response(isp, (isp24xx_statusreq_t *)resp, &sp); - if (sp.req_completion_status != 0) retval = EIO; else if (needmarker) @@ -1755,7 +1720,7 @@ isp_handle_platform_target_notify_ack(ispsoftc_t *isp, cto->rsp.m1.ct_resp[2] = (rsp >> 16) & 0xff; cto->rsp.m1.ct_resp[3] = (rsp >> 24) & 0xff; } - return (isp_target_put_entry(isp, &cto)); + return (isp_send_entry(isp, cto)); } /* @@ -1780,7 +1745,7 @@ isp_handle_platform_target_notify_ack(ispsoftc_t *isp, cto->ct_oxid = abts->abts_ox_id; cto->ct_vpidx = mp->nt_channel; cto->ct_flags = CT7_NOACK|CT7_TERMINATE; - if (isp_target_put_entry(isp, cto)) { + if (isp_send_entry(isp, cto)) { return (ENOMEM); } mp->nt_need_ack = 0; @@ -2353,7 +2318,7 @@ isp_abort_atio(ispsoftc_t *isp, union ccb *ccb) cto->ct_oxid = atp->oxid; cto->ct_vpidx = XS_CHANNEL(accb); cto->ct_flags = CT7_NOACK|CT7_TERMINATE; - isp_target_put_entry(isp, cto); + isp_send_entry(isp, cto); } isp_put_atpd(isp, XS_CHANNEL(accb), atp); ccb->ccb_h.status = CAM_REQ_CMP; Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Fri Nov 27 13:25:12 2020 (r368104) +++ head/sys/dev/isp/isp_library.c Fri Nov 27 15:50:20 2020 (r368105) @@ -490,6 +490,7 @@ isp_clear_commands(ispsoftc_t *isp) } #endif case ISP_HANDLE_CTRL: + ISP_MEMZERO(hdp->cmd, QENTRY_LEN); wakeup(hdp->cmd); isp_destroy_handle(isp, hdp->handle); break; @@ -1654,6 +1655,7 @@ isp_del_wwn_entry(ispsoftc_t *isp, int chan, uint64_t /* Notify above levels about gone port. */ isp_async(isp, ISPASYNC_DEV_GONE, chan, lp); } +#endif /* ISP_TARGET_MODE */ void isp_get_atio7(ispsoftc_t *isp, at7_entry_t *src, at7_entry_t *dst) @@ -2030,7 +2032,156 @@ isp_get_abts_rsp(ispsoftc_t *isp, abts_rsp_t *src, abt ISP_IOXGET_32(isp, &src->abts_rsp_payload.rsp.subcode2, dst->abts_rsp_payload.rsp.subcode2); ISP_IOXGET_32(isp, &src->abts_rsp_rxid_task, dst->abts_rsp_rxid_task); } -#endif /* ISP_TARGET_MODE */ + +void +isp_put_entry(ispsoftc_t *isp, void *src, void *dst) +{ + uint8_t etype = ((isphdr_t *)src)->rqs_entry_type; + + switch (etype) { + case RQSTYPE_NOTIFY_ACK: + isp_put_notify_ack_24xx(isp, (na_fcentry_24xx_t *)src, + (na_fcentry_24xx_t *)dst); + break; + case RQSTYPE_CTIO7: + isp_put_ctio7(isp, (ct7_entry_t *)src, (ct7_entry_t *)dst); + break; + case RQSTYPE_TSK_MGMT: + isp_put_24xx_tmf(isp, (isp24xx_tmf_t *)src, (isp24xx_tmf_t *)dst); + break; + case RQSTYPE_CT_PASSTHRU: + isp_put_ct_pt(isp, (isp_ct_pt_t *)src, (isp_ct_pt_t *)dst); + break; + case RQSTYPE_VP_CTRL: + isp_put_vp_ctrl_info(isp, (vp_ctrl_info_t *)src, (vp_ctrl_info_t *)dst); + break; + case RQSTYPE_VP_MODIFY: + isp_put_vp_modify(isp, (vp_modify_t *)src, (vp_modify_t *)dst); + break; + case RQSTYPE_ABORT_IO: + isp_put_24xx_abrt(isp, (isp24xx_abrt_t *)src, (isp24xx_abrt_t *)dst); + break; + case RQSTYPE_LOGIN: + isp_put_plogx(isp, (isp_plogx_t *)src, (isp_plogx_t *)dst); + break; + case RQSTYPE_ABTS_RSP: + isp_put_abts_rsp(isp, (abts_rsp_t *)src, (abts_rsp_t *)dst); + break; + default: + panic("%s: Unknown type 0x%x\n", __func__, etype); + } +} + +void +isp_get_entry(ispsoftc_t *isp, void *src, void *dst) +{ + uint8_t etype; + + isp_get_hdr(isp, src, (isphdr_t *)dst); + etype = ((isphdr_t *)dst)->rqs_entry_type; + switch (etype) { + case 0: /* After isp_clear_commands() */ + ISP_MEMZERO(dst, QENTRY_LEN); + break; + case RQSTYPE_RESPONSE: + isp_get_24xx_response(isp, (isp24xx_statusreq_t *)src, (isp24xx_statusreq_t *)dst); + break; + case RQSTYPE_CT_PASSTHRU: + isp_get_ct_pt(isp, (isp_ct_pt_t *)src, (isp_ct_pt_t *)dst); + break; + case RQSTYPE_VP_CTRL: + isp_get_vp_ctrl_info(isp, (vp_ctrl_info_t *)src, (vp_ctrl_info_t *)dst); + break; + case RQSTYPE_VP_MODIFY: + isp_get_vp_modify(isp, (vp_modify_t *)src, (vp_modify_t *)dst); + break; + case RQSTYPE_ABORT_IO: + isp_get_24xx_abrt(isp, (isp24xx_abrt_t *)src, (isp24xx_abrt_t *)dst); + break; + case RQSTYPE_LOGIN: + isp_get_plogx(isp, (isp_plogx_t *)src, (isp_plogx_t *)dst); + break; + default: + panic("%s: Unknown type 0x%x\n", __func__, etype); + } +} + +int +isp_send_entry(ispsoftc_t *isp, void *src) +{ + void *outp; + + outp = isp_getrqentry(isp); + if (outp == NULL) { + isp_prt(isp, ISP_LOGWARN, "%s: Request Queue Overflow", __func__); + return (-1); + } + isp_put_entry(isp, src, outp); + if (isp->isp_dblev & ISP_LOGTDEBUG2) + isp_print_qentry(isp, __func__, isp->isp_reqidx, outp); + ISP_SYNC_REQUEST(isp); + return (0); +} + +int +isp_exec_entry_mbox(ispsoftc_t *isp, void *src, void *dst, int timeout) +{ + mbreg_t mbs; + + isp_put_entry(isp, src, isp->isp_iocb); + MEMORYBARRIER(isp, SYNC_IFORDEV, 0, 2 * QENTRY_LEN, 0); + + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, + MBCMD_DEFAULT_TIMEOUT + timeout * 1000000); + mbs.param[1] = QENTRY_LEN; + mbs.param[2] = DMA_WD1(isp->isp_iocb_dma); + mbs.param[3] = DMA_WD0(isp->isp_iocb_dma); + mbs.param[6] = DMA_WD3(isp->isp_iocb_dma); + mbs.param[7] = DMA_WD2(isp->isp_iocb_dma); + isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) + return (EIO); + + MEMORYBARRIER(isp, SYNC_IFORCPU, QENTRY_LEN, QENTRY_LEN, 0); + isp_get_entry(isp, &((isp24xx_statusreq_t *)isp->isp_iocb)[1], dst); + return (0); +} + +int +isp_exec_entry_queue(ispsoftc_t *isp, void *src, void *dst, int timeout) +{ + uint8_t resp[QENTRY_LEN]; + uint32_t hdl; + + timeout *= hz; +again: + /* Wait for empty request queue slot. */ + while (!isp_rqentry_avail(isp, QENTRY_MAX) && timeout-- > 0) + msleep(resp, &isp->isp_lock, 0, "isprqa", 1); + if (timeout <= 0) + return (ENOMEM); + + /* Allocate handle. Should always be available, but stay safe. */ + hdl = isp_allocate_handle(isp, resp, ISP_HANDLE_CTRL); + if (hdl == 0) { + if (timeout-- > 0) { + msleep(resp, &isp->isp_lock, 0, "ispha", 1); + goto again; + } + return (ENOMEM); + } + ((uint32_t *)src)[1] = hdl; + + /* Execute the request and wait for response. */ + isp_send_entry(isp, src); + if (msleep(resp, &isp->isp_lock, 0, "ispeeq", timeout) != 0) { + isp_destroy_handle(isp, hdl); + return (EWOULDBLOCK); + } + isp_get_entry(isp, resp, dst); + return (0); +} + /* * vim:ts=8:sw=8 */ Modified: head/sys/dev/isp/isp_library.h ============================================================================== --- head/sys/dev/isp/isp_library.h Fri Nov 27 13:25:12 2020 (r368104) +++ head/sys/dev/isp/isp_library.h Fri Nov 27 15:50:20 2020 (r368105) @@ -141,7 +141,23 @@ void isp_put_rsnn_nn(ispsoftc_t *, rsnn_nn_t *, rsnn_n void isp_get_ct_hdr(ispsoftc_t *isp, ct_hdr_t *, ct_hdr_t *); void isp_put_ct_hdr(ispsoftc_t *isp, ct_hdr_t *, ct_hdr_t *); void isp_put_fcp_rsp_iu(ispsoftc_t *isp, fcp_rsp_iu_t *, fcp_rsp_iu_t *); +void isp_get_atio7(ispsoftc_t *isp, at7_entry_t *, at7_entry_t *); +void isp_put_ctio7(ispsoftc_t *, ct7_entry_t *, ct7_entry_t *); +void isp_get_ctio7(ispsoftc_t *, ct7_entry_t *, ct7_entry_t *); +void isp_put_notify_24xx(ispsoftc_t *, in_fcentry_24xx_t *, in_fcentry_24xx_t *); +void isp_get_notify_24xx(ispsoftc_t *, in_fcentry_24xx_t *, in_fcentry_24xx_t *); +void isp_put_notify_ack_24xx(ispsoftc_t *, na_fcentry_24xx_t *, na_fcentry_24xx_t *); +void isp_get_notify_ack_24xx(ispsoftc_t *, na_fcentry_24xx_t *, na_fcentry_24xx_t *); +void isp_get_abts(ispsoftc_t *, abts_t *, abts_t *); +void isp_put_abts_rsp(ispsoftc_t *, abts_rsp_t *, abts_rsp_t *); +void isp_get_abts_rsp(ispsoftc_t *, abts_rsp_t *, abts_rsp_t *); +void isp_put_entry(ispsoftc_t *, void *, void *); +void isp_get_entry(ispsoftc_t *, void *, void *); +int isp_send_entry(ispsoftc_t *, void *); +int isp_exec_entry_mbox(ispsoftc_t *, void *, void *, int); +int isp_exec_entry_queue(ispsoftc_t *, void *, void *, int); + #define ISP_HANDLE_MASK 0x7fff #ifdef ISP_TARGET_MODE @@ -162,16 +178,5 @@ int isp_find_pdb_by_portid(ispsoftc_t *, int, uint32_t void isp_find_chan_by_did(ispsoftc_t *, uint32_t, uint16_t *); void isp_add_wwn_entry(ispsoftc_t *, int, uint64_t, uint64_t, uint16_t, uint32_t, uint16_t); void isp_del_wwn_entry(ispsoftc_t *, int, uint64_t, uint16_t, uint32_t); - -void isp_get_atio7(ispsoftc_t *isp, at7_entry_t *, at7_entry_t *); -void isp_put_ctio7(ispsoftc_t *, ct7_entry_t *, ct7_entry_t *); -void isp_get_ctio7(ispsoftc_t *, ct7_entry_t *, ct7_entry_t *); -void isp_put_notify_24xx(ispsoftc_t *, in_fcentry_24xx_t *, in_fcentry_24xx_t *); -void isp_get_notify_24xx(ispsoftc_t *, in_fcentry_24xx_t *, in_fcentry_24xx_t *); -void isp_put_notify_ack_24xx(ispsoftc_t *, na_fcentry_24xx_t *, na_fcentry_24xx_t *); -void isp_get_notify_ack_24xx(ispsoftc_t *, na_fcentry_24xx_t *, na_fcentry_24xx_t *); -void isp_get_abts(ispsoftc_t *, abts_t *, abts_t *); -void isp_put_abts_rsp(ispsoftc_t *, abts_rsp_t *, abts_rsp_t *); -void isp_get_abts_rsp(ispsoftc_t *, abts_rsp_t *, abts_rsp_t *); #endif /* ISP_TARGET_MODE */ #endif /* _ISP_LIBRARY_H */ Modified: head/sys/dev/isp/isp_target.c ============================================================================== --- head/sys/dev/isp/isp_target.c Fri Nov 27 13:25:12 2020 (r368104) +++ head/sys/dev/isp/isp_target.c Fri Nov 27 15:50:20 2020 (r368105) @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); #endif #ifdef ISP_TARGET_MODE -static const char rqo[] = "%s: Request Queue Overflow"; - static void isp_got_tmf_24xx(ispsoftc_t *, at7_entry_t *); static void isp_handle_abts(ispsoftc_t *, abts_t *); static void isp_handle_ctio7(ispsoftc_t *, ct7_entry_t *); @@ -134,7 +132,8 @@ isp_target_notify(ispsoftc_t *isp, void *vptr, uint32_ type = isp_get_response_type(isp, (isphdr_t *)vptr); unp.vp = vptr; - ISP_TDQE(isp, "isp_target_notify", (int) *optrp, vptr); + if (isp->isp_dblev & ISP_LOGTDEBUG2) + isp_print_qentry(isp, __func__, *optrp, vptr); switch (type) { case RQSTYPE_ATIO: @@ -219,37 +218,6 @@ isp_target_notify(ispsoftc_t *isp, void *vptr, uint32_ return (rval); } -int -isp_target_put_entry(ispsoftc_t *isp, void *ap) -{ - void *outp; - uint8_t etype = ((isphdr_t *) ap)->rqs_entry_type; - - outp = isp_getrqentry(isp); - if (outp == NULL) { - isp_prt(isp, ISP_LOGWARN, rqo, __func__); - return (-1); - } - switch (etype) { - case RQSTYPE_NOTIFY_ACK: - isp_put_notify_ack_24xx(isp, (na_fcentry_24xx_t *)ap, - (na_fcentry_24xx_t *)outp); - break; - case RQSTYPE_CTIO7: - isp_put_ctio7(isp, (ct7_entry_t *)ap, (ct7_entry_t *)outp); - break; - case RQSTYPE_ABTS_RSP: - isp_put_abts_rsp(isp, (abts_rsp_t *)ap, (abts_rsp_t *)outp); - break; - default: - isp_prt(isp, ISP_LOGERR, "%s: Unknown type 0x%x", __func__, etype); - return (-1); - } - ISP_TDQE(isp, __func__, isp->isp_reqidx, ap); - ISP_SYNC_REQUEST(isp); - return (0); -} - /* * Command completion- both for handling cases of no resources or * no blackhole driver, or other cases where we have to, inline, @@ -331,7 +299,7 @@ isp_endcmd(ispsoftc_t *isp, ...) cto->ct_scsi_status |= (FCP_RESID_UNDERFLOW << 8); } cto->ct_syshandle = hdl; - return (isp_target_put_entry(isp, cto)); + return (isp_send_entry(isp, cto)); } /* @@ -494,7 +462,7 @@ isp_notify_ack(ispsoftc_t *isp, void *arg) na->na_srr_reject_explanation = 0x2a; } } - return (isp_target_put_entry(isp, na)); + return (isp_send_entry(isp, na)); } int @@ -553,7 +521,7 @@ isp_acknak_abts(ispsoftc_t *isp, void *arg, int errno) break; } } - return (isp_target_put_entry(isp, rsp)); + return (isp_send_entry(isp, rsp)); } static void Modified: head/sys/dev/isp/isp_target.h ============================================================================== --- head/sys/dev/isp/isp_target.h Fri Nov 27 13:25:12 2020 (r368104) +++ head/sys/dev/isp/isp_target.h Fri Nov 27 15:50:20 2020 (r368105) @@ -71,13 +71,6 @@ typedef struct isp_notify { } isp_notify_t; /* - * Debug macros - */ - -#define ISP_TDQE(isp, msg, idx, arg) \ - if (isp->isp_dblev & ISP_LOGTDEBUG2) isp_print_qentry(isp, msg, idx, arg) - -/* * Special Constatns */ #define INI_ANY ((uint64_t) -1) Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Fri Nov 27 13:25:12 2020 (r368104) +++ head/sys/dev/isp/ispmbox.h Fri Nov 27 15:50:20 2020 (r368105) @@ -358,48 +358,29 @@ typedef struct { #define RQSFLAG_MASK 0x3f /* RQS entry_type definitions */ -#define RQSTYPE_REQUEST 0x01 -#define RQSTYPE_DATASEG 0x02 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Nov 27 16:35:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9189A4ABDAE; Fri, 27 Nov 2020 16:35:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjKxX3SYqz3kFZ; Fri, 27 Nov 2020 16:35:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6538D18816; Fri, 27 Nov 2020 16:35:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ARGZiFZ074748; Fri, 27 Nov 2020 16:35:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ARGZiFN074747; Fri, 27 Nov 2020 16:35:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011271635.0ARGZiFN074747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 27 Nov 2020 16:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368108 - head/sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm/include X-SVN-Commit-Revision: 368108 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 16:35:44 -0000 Author: markj Date: Fri Nov 27 16:35:43 2020 New Revision: 368108 URL: https://svnweb.freebsd.org/changeset/base/368108 Log: arm: Correctly report the size of FPA registers to GDB Modern ARM systems do not have an FPA unit but GDB reserves register indices for FPA registers and expects the stub to know their sizes. PR: 251022 Submitted by: Dmitry Salychev MFC after: 2 weeks Modified: head/sys/arm/include/gdb_machdep.h Modified: head/sys/arm/include/gdb_machdep.h ============================================================================== --- head/sys/arm/include/gdb_machdep.h Fri Nov 27 16:29:54 2020 (r368107) +++ head/sys/arm/include/gdb_machdep.h Fri Nov 27 16:35:43 2020 (r368108) @@ -36,9 +36,13 @@ #define GDB_REG_PC 15 static __inline size_t -gdb_cpu_regsz(int regnum __unused) +gdb_cpu_regsz(int regnum) { - return (sizeof(int)); + /* + * GDB expects the FPA registers f0-f7, each 96 bits wide, to be placed + * in between the PC and CSPR in response to a "g" packet. + */ + return (regnum >= 16 && regnum <= 23 ? 12 : sizeof(int)); } static __inline int From owner-svn-src-all@freebsd.org Fri Nov 27 18:40:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2B904AE4B6; Fri, 27 Nov 2020 18:40:51 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjNjv647Gz3rrx; Fri, 27 Nov 2020 18:40:51 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1B3C1A090; Fri, 27 Nov 2020 18:40:51 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ARIepAo049834; Fri, 27 Nov 2020 18:40:51 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ARIepbI049833; Fri, 27 Nov 2020 18:40:51 GMT (envelope-from ume@FreeBSD.org) Message-Id: <202011271840.0ARIepbI049833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Fri, 27 Nov 2020 18:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368111 - head/usr.sbin/rtsold X-SVN-Group: head X-SVN-Commit-Author: ume X-SVN-Commit-Paths: head/usr.sbin/rtsold X-SVN-Commit-Revision: 368111 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 18:40:52 -0000 Author: ume Date: Fri Nov 27 18:40:51 2020 New Revision: 368111 URL: https://svnweb.freebsd.org/changeset/base/368111 Log: fix casper initialization for setting scripts. MFC after: 1 week Modified: head/usr.sbin/rtsold/rtsold.c Modified: head/usr.sbin/rtsold/rtsold.c ============================================================================== --- head/usr.sbin/rtsold/rtsold.c Fri Nov 27 16:51:58 2020 (r368110) +++ head/usr.sbin/rtsold/rtsold.c Fri Nov 27 18:40:51 2020 (r368111) @@ -333,6 +333,7 @@ init_capabilities(void) #ifdef WITH_CASPER const char *const scripts[] = { resolvconf_script, managedconf_script, otherconf_script }; + const char *scripts_set[nitems(scripts)]; cap_channel_t *capcasper; nvlist_t *limits; int count; @@ -351,9 +352,9 @@ init_capabilities(void) count = 0; for (size_t i = 0; i < nitems(scripts); i++) if (scripts[i] != NULL) - count++; + scripts_set[count++] = scripts[i]; limits = nvlist_create(0); - nvlist_add_string_array(limits, "scripts", scripts, count); + nvlist_add_string_array(limits, "scripts", scripts_set, count); if (cap_limit_set(capscript, limits) != 0) return (-1); From owner-svn-src-all@freebsd.org Fri Nov 27 20:46:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E582468898; Fri, 27 Nov 2020 20:46:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjRVM1Jkmz4S88; Fri, 27 Nov 2020 20:46:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FDBC1B4D2; Fri, 27 Nov 2020 20:46:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ARKk31U029434; Fri, 27 Nov 2020 20:46:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ARKk2kc029432; Fri, 27 Nov 2020 20:46:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011272046.0ARKk2kc029432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 27 Nov 2020 20:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368112 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 368112 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 20:46:03 -0000 Author: markj Date: Fri Nov 27 20:46:02 2020 New Revision: 368112 URL: https://svnweb.freebsd.org/changeset/base/368112 Log: callout(9): Remove some leftover APM BIOS support This code is obsolete since r366546. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27267 Modified: head/sys/kern/kern_timeout.c head/sys/sys/systm.h Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Fri Nov 27 18:40:51 2020 (r368111) +++ head/sys/kern/kern_timeout.c Fri Nov 27 20:46:02 2020 (r368112) @@ -1339,71 +1339,6 @@ _callout_init_lock(struct callout *c, struct lock_obje c->c_cpu = cc_default_cpu; } -#ifdef APM_FIXUP_CALLTODO -/* - * Adjust the kernel calltodo timeout list. This routine is used after - * an APM resume to recalculate the calltodo timer list values with the - * number of hz's we have been sleeping. The next hardclock() will detect - * that there are fired timers and run softclock() to execute them. - * - * Please note, I have not done an exhaustive analysis of what code this - * might break. I am motivated to have my select()'s and alarm()'s that - * have expired during suspend firing upon resume so that the applications - * which set the timer can do the maintanence the timer was for as close - * as possible to the originally intended time. Testing this code for a - * week showed that resuming from a suspend resulted in 22 to 25 timers - * firing, which seemed independent on whether the suspend was 2 hours or - * 2 days. Your milage may vary. - Ken Key - */ -void -adjust_timeout_calltodo(struct timeval *time_change) -{ - struct callout *p; - unsigned long delta_ticks; - - /* - * How many ticks were we asleep? - * (stolen from tvtohz()). - */ - - /* Don't do anything */ - if (time_change->tv_sec < 0) - return; - else if (time_change->tv_sec <= LONG_MAX / 1000000) - delta_ticks = howmany(time_change->tv_sec * 1000000 + - time_change->tv_usec, tick) + 1; - else if (time_change->tv_sec <= LONG_MAX / hz) - delta_ticks = time_change->tv_sec * hz + - howmany(time_change->tv_usec, tick) + 1; - else - delta_ticks = LONG_MAX; - - if (delta_ticks > INT_MAX) - delta_ticks = INT_MAX; - - /* - * Now rip through the timer calltodo list looking for timers - * to expire. - */ - - /* don't collide with softclock() */ - CC_LOCK(cc); - for (p = calltodo.c_next; p != NULL; p = p->c_next) { - p->c_time -= delta_ticks; - - /* Break if the timer had more time on it than delta_ticks */ - if (p->c_time > 0) - break; - - /* take back the ticks the timer didn't use (p->c_time <= 0) */ - delta_ticks = -p->c_time; - } - CC_UNLOCK(cc); - - return; -} -#endif /* APM_FIXUP_CALLTODO */ - static int flssbt(sbintime_t sbt) { Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Nov 27 18:40:51 2020 (r368111) +++ head/sys/sys/systm.h Fri Nov 27 20:46:02 2020 (r368112) @@ -482,11 +482,6 @@ extern cpu_tick_f *cpu_ticks; uint64_t cpu_tickrate(void); uint64_t cputick2usec(uint64_t tick); -#ifdef APM_FIXUP_CALLTODO -struct timeval; -void adjust_timeout_calltodo(struct timeval *time_change); -#endif /* APM_FIXUP_CALLTODO */ - #include /* Initialize the world */ From owner-svn-src-all@freebsd.org Fri Nov 27 21:37:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 304FD4693D3; Fri, 27 Nov 2020 21:37:49 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjSf50sd8z4V3q; Fri, 27 Nov 2020 21:37:49 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01BD61C414; Fri, 27 Nov 2020 21:37:49 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ARLbmaA060119; Fri, 27 Nov 2020 21:37:48 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ARLbmNN060116; Fri, 27 Nov 2020 21:37:48 GMT (envelope-from br@FreeBSD.org) Message-Id: <202011272137.0ARLbmNN060116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 27 Nov 2020 21:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368113 - in head/sys: amd64/conf i386/conf X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: amd64/conf i386/conf X-SVN-Commit-Revision: 368113 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 21:37:49 -0000 Author: br Date: Fri Nov 27 21:37:48 2020 New Revision: 368113 URL: https://svnweb.freebsd.org/changeset/base/368113 Log: o Move options IOMMU from Debugging section back to the Bus section where it originally was. The bug introduced in r366267. o Remove options IOMMU from i386/MINIMAL as we don't have it in i386/GENERIC. Reported by: Harry Schmalzbauer Reviewed by: kib Sponsored by: Innovate DSbD Differential Revision: https://reviews.freebsd.org/D27399 Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/MINIMAL head/sys/i386/conf/MINIMAL Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri Nov 27 20:46:02 2020 (r368112) +++ head/sys/amd64/conf/GENERIC Fri Nov 27 21:37:48 2020 (r368113) @@ -102,7 +102,6 @@ options WITNESS # Enable checks to detect deadlocks options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default -options IOMMU # Kernel Sanitizers #options COVERAGE # Generic kernel coverage. Used by KCOV @@ -128,6 +127,7 @@ device cpufreq # Bus support. device acpi +options IOMMU device pci options PCI_HP # PCI-Express native HotPlug options PCI_IOV # PCI SR-IOV support Modified: head/sys/amd64/conf/MINIMAL ============================================================================== --- head/sys/amd64/conf/MINIMAL Fri Nov 27 20:46:02 2020 (r368112) +++ head/sys/amd64/conf/MINIMAL Fri Nov 27 21:37:48 2020 (r368113) @@ -93,7 +93,6 @@ options WITNESS # Enable checks to detect deadlocks options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default -options IOMMU # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel @@ -104,6 +103,7 @@ device cpufreq # Bus support. device acpi +options IOMMU device pci # atkbdc0 controls both the keyboard and the PS/2 mouse Modified: head/sys/i386/conf/MINIMAL ============================================================================== --- head/sys/i386/conf/MINIMAL Fri Nov 27 20:46:02 2020 (r368112) +++ head/sys/i386/conf/MINIMAL Fri Nov 27 21:37:48 2020 (r368113) @@ -93,7 +93,6 @@ options WITNESS # Enable checks to detect deadlocks options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default -options IOMMU # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel From owner-svn-src-all@freebsd.org Fri Nov 27 21:38:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B484469905; Fri, 27 Nov 2020 21:38:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjSfN1H12z4V73; Fri, 27 Nov 2020 21:38:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F0B31C312; Fri, 27 Nov 2020 21:38:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ARLc4aR060182; Fri, 27 Nov 2020 21:38:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ARLc3DX060181; Fri, 27 Nov 2020 21:38:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202011272138.0ARLc3DX060181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Nov 2020 21:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368114 - head/contrib/elftoolchain/addr2line X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/addr2line X-SVN-Commit-Revision: 368114 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2020 21:38:04 -0000 Author: emaste Date: Fri Nov 27 21:38:03 2020 New Revision: 368114 URL: https://svnweb.freebsd.org/changeset/base/368114 Log: addr2line: add label checks when DW_AT_range and DW_AT_low_pc cannot be used Check label's ranges for address we want to translate if a CU doesn't have usable DW_AT_range or DW_AT_low_pc. Use more appropriate names: "struct CU" -> "struct range" Developed as part of upstream ELF Tool Chain bug report https://sourceforge.net/p/elftoolchain/tickets/552/ although this does not address the specific case reported there. Submitted by: Tiger Gao MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23782 Modified: head/contrib/elftoolchain/addr2line/addr2line.c Modified: head/contrib/elftoolchain/addr2line/addr2line.c ============================================================================== --- head/contrib/elftoolchain/addr2line/addr2line.c Fri Nov 27 21:37:48 2020 (r368113) +++ head/contrib/elftoolchain/addr2line/addr2line.c Fri Nov 27 21:38:03 2020 (r368114) @@ -57,8 +57,8 @@ struct Func { STAILQ_ENTRY(Func) next; }; -struct CU { - RB_ENTRY(CU) entry; +struct range { + RB_ENTRY(range) entry; Dwarf_Off off; Dwarf_Unsigned lopc; Dwarf_Unsigned hipc; @@ -89,16 +89,16 @@ static char unknown[] = { '?', '?', '\0' }; static Dwarf_Addr section_base; /* Need a new curlopc that stores last lopc value. */ static Dwarf_Unsigned curlopc = ~0ULL; -static RB_HEAD(cutree, CU) cuhead = RB_INITIALIZER(&cuhead); +static RB_HEAD(cutree, range) cuhead = RB_INITIALIZER(&cuhead); static int -lopccmp(struct CU *e1, struct CU *e2) +lopccmp(struct range *e1, struct range *e2) { return (e1->lopc < e2->lopc ? -1 : e1->lopc > e2->lopc); } -RB_PROTOTYPE(cutree, CU, entry, lopccmp); -RB_GENERATE(cutree, CU, entry, lopccmp) +RB_PROTOTYPE(cutree, range, entry, lopccmp); +RB_GENERATE(cutree, range, entry, lopccmp) #define USAGE_MESSAGE "\ Usage: %s [options] hexaddress...\n\ @@ -171,7 +171,7 @@ handle_high_pc(Dwarf_Die die, Dwarf_Unsigned lopc, Dwa } static struct Func * -search_func(struct CU *cu, Dwarf_Unsigned addr) +search_func(struct range *range, Dwarf_Unsigned addr) { struct Func *f, *f0; Dwarf_Unsigned lopc, hipc, addr_base; @@ -179,7 +179,7 @@ search_func(struct CU *cu, Dwarf_Unsigned addr) f0 = NULL; - STAILQ_FOREACH(f, &cu->funclist, next) { + STAILQ_FOREACH(f, &range->funclist, next) { if (f->ranges != NULL) { addr_base = 0; for (i = 0; i < f->ranges_cnt; i++) { @@ -216,7 +216,8 @@ search_func(struct CU *cu, Dwarf_Unsigned addr) } static void -collect_func(Dwarf_Debug dbg, Dwarf_Die die, struct Func *parent, struct CU *cu) +collect_func(Dwarf_Debug dbg, Dwarf_Die die, struct Func *parent, + struct range *range) { Dwarf_Die ret_die, abst_die, spec_die; Dwarf_Error de; @@ -238,7 +239,7 @@ collect_func(Dwarf_Debug dbg, Dwarf_Die die, struct Fu goto cont_search; } if (tag == DW_TAG_subprogram || tag == DW_TAG_entry_point || - tag == DW_TAG_inlined_subroutine) { + tag == DW_TAG_inlined_subroutine || tag == DW_TAG_label) { /* * Function address range can be specified by either * a DW_AT_ranges attribute which points to a range list or @@ -258,14 +259,21 @@ collect_func(Dwarf_Debug dbg, Dwarf_Die die, struct Fu } /* - * Search for DW_AT_low_pc/DW_AT_high_pc if ranges pointer - * not found. - */ - if (dwarf_attrval_unsigned(die, DW_AT_low_pc, &lopc, &de) || - dwarf_attrval_unsigned(die, DW_AT_high_pc, &hipc, &de)) - goto cont_search; - if (handle_high_pc(die, lopc, &hipc) != DW_DLV_OK) - goto cont_search; + * Ranges pointer not found. Search for DW_AT_low_pc, and + * DW_AT_high_pc iff die is not a label. Labels doesn't have + * hipc attr. */ + if (tag == DW_TAG_label) { + if (dwarf_attrval_unsigned(die, DW_AT_low_pc, &lopc, + &de) != DW_DLV_OK) + goto cont_search; + } else { + if (dwarf_attrval_unsigned(die, DW_AT_low_pc, &lopc, + &de) || dwarf_attrval_unsigned(die, DW_AT_high_pc, + &hipc, &de)) + goto cont_search; + if (handle_high_pc(die, lopc, &hipc) != DW_DLV_OK) + goto cont_search; + } get_func_name: /* @@ -323,7 +331,7 @@ collect_func(Dwarf_Debug dbg, Dwarf_Die die, struct Fu dwarf_attrval_unsigned(die, DW_AT_call_line, &f->call_line, &de); } - STAILQ_INSERT_TAIL(&cu->funclist, f, next); + STAILQ_INSERT_TAIL(&range->funclist, f, next); } cont_search: @@ -334,9 +342,9 @@ cont_search: warnx("dwarf_child: %s", dwarf_errmsg(de)); else if (ret == DW_DLV_OK) { if (f != NULL) - collect_func(dbg, ret_die, f, cu); + collect_func(dbg, ret_die, f, range); else - collect_func(dbg, ret_die, parent, cu); + collect_func(dbg, ret_die, parent, range); } /* Search sibling. */ @@ -344,10 +352,10 @@ cont_search: if (ret == DW_DLV_ERROR) warnx("dwarf_siblingof: %s", dwarf_errmsg(de)); else if (ret == DW_DLV_OK) - collect_func(dbg, ret_die, parent, cu); + collect_func(dbg, ret_die, parent, range); /* Cleanup */ - if (die != cu->die) + if (die != range->die) dwarf_dealloc(dbg, die, DW_DLA_DIE); if (abst_die != NULL) @@ -358,14 +366,14 @@ cont_search: } static void -print_inlines(struct CU *cu, struct Func *f, Dwarf_Unsigned call_file, +print_inlines(struct range *range, struct Func *f, Dwarf_Unsigned call_file, Dwarf_Unsigned call_line) { char demangled[1024]; char *file; - if (call_file > 0 && (Dwarf_Signed) call_file <= cu->nsrcfiles) - file = cu->srcfiles[call_file - 1]; + if (call_file > 0 && (Dwarf_Signed) call_file <= range->nsrcfiles) + file = range->srcfiles[call_file - 1]; else file = unknown; @@ -390,14 +398,14 @@ print_inlines(struct CU *cu, struct Func *f, Dwarf_Uns (uintmax_t) call_line); if (f->inlined_caller != NULL) - print_inlines(cu, f->inlined_caller, f->call_file, + print_inlines(range, f->inlined_caller, f->call_file, f->call_line); } -static struct CU * +static struct range * culookup(Dwarf_Unsigned addr) { - struct CU find, *res; + struct range find, *res; find.lopc = addr; res = RB_NFIND(cutree, &cuhead, &find); @@ -415,12 +423,149 @@ culookup(Dwarf_Unsigned addr) } /* - * Check whether addr falls into range(s) of current CU, and save current CU - * to lookup tree if so. + * When DW_AT_ranges, DW_AT_low_pc/DW_AT_high_pc are all absent, we check the + * children of cu die for labels. If the address falls into one of the labels + * ranges(aranges), return the label DIE. */ static int +check_labels(Dwarf_Debug dbg, Dwarf_Die die, Dwarf_Unsigned addr, + struct range **range) { + Dwarf_Addr start; + Dwarf_Arange *aranges; + Dwarf_Die prev_die, ret_die; + Dwarf_Error de; + Dwarf_Half tag; + Dwarf_Off die_off; + Dwarf_Unsigned lopc, length; + Dwarf_Signed arcnt; + struct range *labelp, **labels; + int i, j, label_cnt, ret; + + prev_die = ret_die = NULL; + labels = NULL; + i = label_cnt = 0; + + /* Find aranges. */ + ret = dwarf_get_aranges(dbg, &aranges, &arcnt, &de); + if (ret != DW_DLV_OK && ret != DW_DLV_NO_ENTRY) + warnx("dwarf_get_aranges failed: %s", dwarf_errmsg(de)); + + /* Child of current CU. */ + ret = dwarf_child(die, &prev_die, &de); + if (ret == DW_DLV_ERROR) + warnx("dwarf_child: %s", dwarf_errmsg(de)); + + /* Count labels. */ + while (1) { + if (dwarf_tag(prev_die, &tag, &de) != DW_DLV_OK) { + warnx("dwarf_tag failed: %s", + dwarf_errmsg(de)); + return DW_DLV_ERROR; + } + if (tag == DW_TAG_label) { + if (dwarf_attrval_unsigned(prev_die, DW_AT_low_pc, + &lopc, &de) == DW_DLV_OK) + label_cnt++; + } + + if (dwarf_siblingof(dbg, prev_die, &ret_die, &de) != DW_DLV_OK) + break; + + if (prev_die != NULL) + dwarf_dealloc(dbg, prev_die, DW_DLA_DIE); + prev_die = ret_die; + } + + if (label_cnt == 0) + return (DW_DLV_NO_ENTRY); + + /* Allocate space for labels. */ + if ((labels = calloc(label_cnt, sizeof(struct range *))) == NULL) + err(EXIT_FAILURE, "calloc"); + + /* Add labels to list. */ + ret = dwarf_child(die, &prev_die, &de); + if (ret == DW_DLV_ERROR) + warnx("dwarf_child: %s", dwarf_errmsg(de)); + while (1) { + if (dwarf_tag(prev_die, &tag, &de) != DW_DLV_OK) { + warnx("dwarf_tag failed: %s", + dwarf_errmsg(de)); + return DW_DLV_ERROR; + } + if (tag == DW_TAG_label) { + if (dwarf_attrval_unsigned(prev_die, DW_AT_low_pc, + &lopc, &de) == DW_DLV_OK) { + if (curlopc == lopc) { + for (i = 0; i < label_cnt - 1; i++) { + if (labels[i] != *range) + free(labels[i]); + } + free(labels); + return DW_DLV_ERROR; + } + labelp = calloc(1, sizeof(struct range)); + if (labelp == NULL) + err(EXIT_FAILURE, "calloc"); + labelp->lopc = lopc; + labelp->die = prev_die; + labelp->dbg = dbg; + STAILQ_INIT(&labelp->funclist); + labels[i++] = labelp; + } + } + if (dwarf_siblingof(dbg, prev_die, &ret_die, &de) != DW_DLV_OK) + break; + if (prev_die != NULL && tag != DW_TAG_label) + dwarf_dealloc(dbg, prev_die, DW_DLA_DIE); + prev_die = ret_die; + } + + /* Set hipc for each label using aranges */ + for (i = 0; i < label_cnt; i++) { + for (j = 0; j < arcnt; j++) { + if (dwarf_get_arange_info(aranges[j], &start, &length, + &die_off, &de) != DW_DLV_OK) { + warnx("dwarf_get_arange_info failed: %s", + dwarf_errmsg(de)); + continue; + } + if (labels[i]->lopc == (Dwarf_Unsigned)start) { + labels[i]->hipc = start + length; + break; + } + } + } + + /* If addr in label's range, we have found the range for this label. */ + for (i = 0; i < label_cnt; i++) { + if (addr >= labels[i]->lopc && addr < labels[i]->hipc) { + *range = labels[i]; + RB_INSERT(cutree, &cuhead, (*range)); + curlopc = (*range)->lopc; + break; + } + } + + for (i = 0; i < label_cnt - 1; i++) { + if (labels[i] != *range) + free(labels[i]); + } + free(labels); + + if (*range != NULL) + return (DW_DLV_OK); + else + return (DW_DLV_NO_ENTRY); +} + +/* + * Check whether addr falls into range(s) of current CU. + * If so, save current CU to lookup tree. + */ +static int check_range(Dwarf_Debug dbg, Dwarf_Die die, Dwarf_Unsigned addr, - struct CU **cu) + struct range **range) { Dwarf_Error de; Dwarf_Unsigned addr_base, lopc, hipc; @@ -428,12 +573,12 @@ check_range(Dwarf_Debug dbg, Dwarf_Die die, Dwarf_Unsi Dwarf_Signed ranges_cnt; Dwarf_Ranges *ranges; int i, ret; - bool in_range; + bool in_cu; addr_base = 0; ranges = NULL; ranges_cnt = 0; - in_range = false; + in_cu = false; ret = dwarf_attrval_unsigned(die, DW_AT_ranges, &ranges_off, &de); if (ret == DW_DLV_OK) { @@ -463,11 +608,11 @@ check_range(Dwarf_Debug dbg, Dwarf_Die die, Dwarf_Unsi return (DW_DLV_ERROR); if (addr >= lopc && addr < hipc){ - in_range = true; + in_cu = true; break; } } - } else if (ret == DW_DLV_NO_ENTRY) { + } else { if (dwarf_attrval_unsigned(die, DW_AT_low_pc, &lopc, &de) == DW_DLV_OK) { if (lopc == curlopc) @@ -482,27 +627,29 @@ check_range(Dwarf_Debug dbg, Dwarf_Die die, Dwarf_Unsi DW_DLV_OK) return (DW_DLV_ERROR); } else { - /* Assume ~0ULL if DW_AT_high_pc not present */ + /* Assume ~0ULL if DW_AT_high_pc not present. */ hipc = ~0ULL; } if (addr >= lopc && addr < hipc) { - in_range = true; + in_cu = true; } + } else { + /* Addr not in range die, try labels. */ + ret = check_labels(dbg, die, addr, range); + return ret; } - } else { - return (DW_DLV_ERROR); } - - if (in_range) { - if ((*cu = calloc(1, sizeof(struct CU))) == NULL) + + if (in_cu) { + if ((*range = calloc(1, sizeof(struct range))) == NULL) err(EXIT_FAILURE, "calloc"); - (*cu)->lopc = lopc; - (*cu)->hipc = hipc; - (*cu)->die = die; - (*cu)->dbg = dbg; - STAILQ_INIT(&(*cu)->funclist); - RB_INSERT(cutree, &cuhead, *cu); + (*range)->lopc = lopc; + (*range)->hipc = hipc; + (*range)->die = die; + (*range)->dbg = dbg; + STAILQ_INIT(&(*range)->funclist); + RB_INSERT(cutree, &cuhead, *range); curlopc = lopc; return (DW_DLV_OK); } else { @@ -520,7 +667,7 @@ translate(Dwarf_Debug dbg, Elf *e, const char* addrstr Dwarf_Unsigned addr, lineno, plineno; Dwarf_Signed lcount; Dwarf_Addr lineaddr, plineaddr; - struct CU *cu; + struct range *range; struct Func *f; const char *funcname; char *file, *file0, *pfile; @@ -534,10 +681,10 @@ translate(Dwarf_Debug dbg, Elf *e, const char* addrstr die = NULL; ret = DW_DLV_OK; - cu = culookup(addr); - if (cu != NULL) { - die = cu->die; - dbg = cu->dbg; + range = culookup(addr); + if (range != NULL) { + die = range->die; + dbg = range->dbg; goto status_ok; } @@ -576,7 +723,7 @@ translate(Dwarf_Debug dbg, Elf *e, const char* addrstr warnx("could not find DW_TAG_compile_unit die"); goto next_cu; } - ret = check_range(dbg, die, addr, &cu); + ret = check_range(dbg, die, addr, &range); if (ret == DW_DLV_OK) break; if (ret == DW_DLV_ERROR) @@ -634,16 +781,16 @@ status_ok: out: f = NULL; funcname = NULL; - if (ret == DW_DLV_OK && (func || inlines) && cu != NULL) { - if (cu->srcfiles == NULL) - if (dwarf_srcfiles(die, &cu->srcfiles, &cu->nsrcfiles, - &de)) + if (ret == DW_DLV_OK && (func || inlines) && range != NULL) { + if (range->srcfiles == NULL) + if (dwarf_srcfiles(die, &range->srcfiles, + &range->nsrcfiles, &de)) warnx("dwarf_srcfiles: %s", dwarf_errmsg(de)); - if (STAILQ_EMPTY(&cu->funclist)) { - collect_func(dbg, die, NULL, cu); + if (STAILQ_EMPTY(&range->funclist)) { + collect_func(dbg, range->die, NULL, range); die = NULL; } - f = search_func(cu, addr); + f = search_func(range, addr); if (f != NULL) funcname = f->name; } @@ -686,9 +833,9 @@ out: (void) printf("%s:%ju\n", base ? basename(file) : file, (uintmax_t) lineno); - if (ret == DW_DLV_OK && inlines && cu != NULL && - cu->srcfiles != NULL && f != NULL && f->inlined_caller != NULL) - print_inlines(cu, f->inlined_caller, f->call_file, + if (ret == DW_DLV_OK && inlines && range != NULL && + range->srcfiles != NULL && f != NULL && f->inlined_caller != NULL) + print_inlines(range, f->inlined_caller, f->call_file, f->call_line); } From owner-svn-src-all@freebsd.org Sat Nov 28 01:17:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 402F746F429; Sat, 28 Nov 2020 01:17:01 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjYW11N2rz4hv3; Sat, 28 Nov 2020 01:17:01 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 220A71E8F1; Sat, 28 Nov 2020 01:17:01 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AS1H1Kn097301; Sat, 28 Nov 2020 01:17:01 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AS1Gxem097290; Sat, 28 Nov 2020 01:16:59 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202011280116.0AS1Gxem097290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Sat, 28 Nov 2020 01:16:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368115 - in head/sys/amd64: include vmm vmm/amd vmm/intel X-SVN-Group: head X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: in head/sys/amd64: include vmm vmm/amd vmm/intel X-SVN-Commit-Revision: 368115 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 01:17:01 -0000 Author: grehan Date: Sat Nov 28 01:16:59 2020 New Revision: 368115 URL: https://svnweb.freebsd.org/changeset/base/368115 Log: Convert vmm_ops calls to IFUNC There is no need for these to be function pointers since they are never modified post-module load. Rename AMD/Intel ops to be more consistent. Submitted by: adam_fenn.io Reviewed by: markj, grehan Approved by: grehan (bhyve) MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D27375 Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/intel/vmx.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_util.c head/sys/amd64/vmm/vmm_util.h Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Fri Nov 27 21:38:03 2020 (r368114) +++ head/sys/amd64/include/vmm.h Sat Nov 28 01:16:59 2020 (r368115) @@ -189,32 +189,32 @@ typedef int (*vmi_snapshot_vmcx_t)(void *vmi, struct v typedef int (*vmi_restore_tsc_t)(void *vmi, int vcpuid, uint64_t now); struct vmm_ops { - vmm_init_func_t init; /* module wide initialization */ - vmm_cleanup_func_t cleanup; - vmm_resume_func_t resume; + vmm_init_func_t modinit; /* module wide initialization */ + vmm_cleanup_func_t modcleanup; + vmm_resume_func_t modresume; - vmi_init_func_t vminit; /* vm-specific initialization */ - vmi_run_func_t vmrun; - vmi_cleanup_func_t vmcleanup; - vmi_get_register_t vmgetreg; - vmi_set_register_t vmsetreg; - vmi_get_desc_t vmgetdesc; - vmi_set_desc_t vmsetdesc; - vmi_get_cap_t vmgetcap; - vmi_set_cap_t vmsetcap; + vmi_init_func_t init; /* vm-specific initialization */ + vmi_run_func_t run; + vmi_cleanup_func_t cleanup; + vmi_get_register_t getreg; + vmi_set_register_t setreg; + vmi_get_desc_t getdesc; + vmi_set_desc_t setdesc; + vmi_get_cap_t getcap; + vmi_set_cap_t setcap; vmi_vmspace_alloc vmspace_alloc; vmi_vmspace_free vmspace_free; vmi_vlapic_init vlapic_init; vmi_vlapic_cleanup vlapic_cleanup; /* checkpoint operations */ - vmi_snapshot_t vmsnapshot; + vmi_snapshot_t snapshot; vmi_snapshot_vmcx_t vmcx_snapshot; - vmi_restore_tsc_t vm_restore_tsc; + vmi_restore_tsc_t restore_tsc; }; -extern struct vmm_ops vmm_ops_intel; -extern struct vmm_ops vmm_ops_amd; +extern const struct vmm_ops vmm_ops_intel; +extern const struct vmm_ops vmm_ops_amd; int vm_create(const char *name, struct vm **retvm); void vm_destroy(struct vm *vm); Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Fri Nov 27 21:38:03 2020 (r368114) +++ head/sys/amd64/vmm/amd/svm.c Sat Nov 28 01:16:59 2020 (r368115) @@ -132,6 +132,7 @@ static VMM_STAT_AMD(VCPU_EXITINTINFO, "VM exits during static VMM_STAT_AMD(VCPU_INTINFO_INJECTED, "Events pending at VM entry"); static VMM_STAT_AMD(VMEXIT_VINTR, "VM exits due to interrupt window"); +static int svm_getdesc(void *arg, int vcpu, int reg, struct seg_desc *desc); static int svm_setreg(void *arg, int vcpu, int ident, uint64_t val); static __inline int @@ -162,7 +163,7 @@ svm_disable(void *arg __unused) * Disable SVM on all CPUs. */ static int -svm_cleanup(void) +svm_modcleanup(void) { smp_rendezvous(NULL, svm_disable, NULL, NULL); @@ -240,7 +241,7 @@ svm_available(void) } static int -svm_init(int ipinum) +svm_modinit(int ipinum) { int error, cpu; @@ -274,7 +275,7 @@ svm_init(int ipinum) } static void -svm_restore(void) +svm_modresume(void) { svm_enable(NULL); @@ -551,7 +552,7 @@ vmcb_init(struct svm_softc *sc, int vcpu, uint64_t iop * Initialize a virtual machine. */ static void * -svm_vminit(struct vm *vm, pmap_t pmap) +svm_init(struct vm *vm, pmap_t pmap) { struct svm_softc *svm_sc; struct svm_vcpu *vcpu; @@ -728,7 +729,7 @@ svm_inout_str_seginfo(struct svm_softc *svm_sc, int vc vis->seg_name = vm_segment_name(s); } - error = vmcb_getdesc(svm_sc, vcpu, vis->seg_name, &vis->seg_desc); + error = svm_getdesc(svm_sc, vcpu, vis->seg_name, &vis->seg_desc); KASSERT(error == 0, ("%s: svm_getdesc error %d", __func__, error)); } @@ -1984,7 +1985,7 @@ svm_dr_leave_guest(struct svm_regctx *gctx) * Start vcpu with specified RIP. */ static int -svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t pmap, +svm_run(void *arg, int vcpu, register_t rip, pmap_t pmap, struct vm_eventinfo *evinfo) { struct svm_regctx *gctx; @@ -2137,7 +2138,7 @@ svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t } static void -svm_vmcleanup(void *arg) +svm_cleanup(void *arg) { struct svm_softc *sc = arg; @@ -2260,6 +2261,18 @@ svm_setreg(void *arg, int vcpu, int ident, uint64_t va return (EINVAL); } +static int +svm_getdesc(void *arg, int vcpu, int reg, struct seg_desc *desc) +{ + return (vmcb_getdesc(arg, vcpu, reg, desc)); +} + +static int +svm_setdesc(void *arg, int vcpu, int reg, struct seg_desc *desc) +{ + return (vmcb_setdesc(arg, vcpu, reg, desc)); +} + #ifdef BHYVE_SNAPSHOT static int svm_snapshot_reg(void *arg, int vcpu, int ident, @@ -2347,6 +2360,18 @@ svm_getcap(void *arg, int vcpu, int type, int *retval) return (error); } +static struct vmspace * +svm_vmspace_alloc(vm_offset_t min, vm_offset_t max) +{ + return (svm_npt_alloc(min, max)); +} + +static void +svm_vmspace_free(struct vmspace *vmspace) +{ + svm_npt_free(vmspace); +} + static struct vlapic * svm_vlapic_init(void *arg, int vcpuid) { @@ -2374,7 +2399,7 @@ svm_vlapic_cleanup(void *arg, struct vlapic *vlapic) #ifdef BHYVE_SNAPSHOT static int -svm_snapshot_vmi(void *arg, struct vm_snapshot_meta *meta) +svm_snapshot(void *arg, struct vm_snapshot_meta *meta) { /* struct svm_softc is AMD's representation for SVM softc */ struct svm_softc *sc; @@ -2527,7 +2552,7 @@ done: } static int -svm_snapshot_vmcx(void *arg, struct vm_snapshot_meta *meta, int vcpu) +svm_vmcx_snapshot(void *arg, struct vm_snapshot_meta *meta, int vcpu) { struct vmcb *vmcb; struct svm_softc *sc; @@ -2672,26 +2697,26 @@ svm_restore_tsc(void *arg, int vcpu, uint64_t offset) } #endif -struct vmm_ops vmm_ops_amd = { +const struct vmm_ops vmm_ops_amd = { + .modinit = svm_modinit, + .modcleanup = svm_modcleanup, + .modresume = svm_modresume, .init = svm_init, + .run = svm_run, .cleanup = svm_cleanup, - .resume = svm_restore, - .vminit = svm_vminit, - .vmrun = svm_vmrun, - .vmcleanup = svm_vmcleanup, - .vmgetreg = svm_getreg, - .vmsetreg = svm_setreg, - .vmgetdesc = vmcb_getdesc, - .vmsetdesc = vmcb_setdesc, - .vmgetcap = svm_getcap, - .vmsetcap = svm_setcap, - .vmspace_alloc = svm_npt_alloc, - .vmspace_free = svm_npt_free, + .getreg = svm_getreg, + .setreg = svm_setreg, + .getdesc = svm_getdesc, + .setdesc = svm_setdesc, + .getcap = svm_getcap, + .setcap = svm_setcap, + .vmspace_alloc = svm_vmspace_alloc, + .vmspace_free = svm_vmspace_free, .vlapic_init = svm_vlapic_init, .vlapic_cleanup = svm_vlapic_cleanup, #ifdef BHYVE_SNAPSHOT - .vmsnapshot = svm_snapshot_vmi, - .vmcx_snapshot = svm_snapshot_vmcx, - .vm_restore_tsc = svm_restore_tsc, + .snapshot = svm_snapshot, + .vmcx_snapshot = svm_vmcx_snapshot, + .restore_tsc = svm_restore_tsc, #endif }; Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Fri Nov 27 21:38:03 2020 (r368114) +++ head/sys/amd64/vmm/intel/vmx.c Sat Nov 28 01:16:59 2020 (r368115) @@ -610,7 +610,7 @@ vmx_disable(void *arg __unused) } static int -vmx_cleanup(void) +vmx_modcleanup(void) { if (pirvec >= 0) @@ -652,7 +652,7 @@ vmx_enable(void *arg __unused) } static void -vmx_restore(void) +vmx_modresume(void) { if (vmxon_enabled[curcpu]) @@ -660,7 +660,7 @@ vmx_restore(void) } static int -vmx_init(int ipinum) +vmx_modinit(int ipinum) { int error; uint64_t basic, fixed0, fixed1, feature_control; @@ -668,7 +668,8 @@ vmx_init(int ipinum) /* CPUID.1:ECX[bit 5] must be 1 for processor to support VMX */ if (!(cpu_feature2 & CPUID2_VMX)) { - printf("vmx_init: processor does not support VMX operation\n"); + printf("vmx_modinit: processor does not support VMX " + "operation\n"); return (ENXIO); } @@ -679,7 +680,7 @@ vmx_init(int ipinum) feature_control = rdmsr(MSR_IA32_FEATURE_CONTROL); if ((feature_control & IA32_FEATURE_CONTROL_LOCK) == 1 && (feature_control & IA32_FEATURE_CONTROL_VMX_EN) == 0) { - printf("vmx_init: VMX operation disabled by BIOS\n"); + printf("vmx_modinit: VMX operation disabled by BIOS\n"); return (ENXIO); } @@ -689,7 +690,7 @@ vmx_init(int ipinum) */ basic = rdmsr(MSR_VMX_BASIC); if ((basic & (1UL << 54)) == 0) { - printf("vmx_init: processor does not support desired basic " + printf("vmx_modinit: processor does not support desired basic " "capabilities\n"); return (EINVAL); } @@ -700,8 +701,8 @@ vmx_init(int ipinum) PROCBASED_CTLS_ONE_SETTING, PROCBASED_CTLS_ZERO_SETTING, &procbased_ctls); if (error) { - printf("vmx_init: processor does not support desired primary " - "processor-based controls\n"); + printf("vmx_modinit: processor does not support desired " + "primary processor-based controls\n"); return (error); } @@ -714,8 +715,8 @@ vmx_init(int ipinum) PROCBASED_CTLS2_ONE_SETTING, PROCBASED_CTLS2_ZERO_SETTING, &procbased_ctls2); if (error) { - printf("vmx_init: processor does not support desired secondary " - "processor-based controls\n"); + printf("vmx_modinit: processor does not support desired " + "secondary processor-based controls\n"); return (error); } @@ -731,8 +732,8 @@ vmx_init(int ipinum) PINBASED_CTLS_ONE_SETTING, PINBASED_CTLS_ZERO_SETTING, &pinbased_ctls); if (error) { - printf("vmx_init: processor does not support desired " - "pin-based controls\n"); + printf("vmx_modinit: processor does not support desired " + "pin-based controls\n"); return (error); } @@ -742,7 +743,7 @@ vmx_init(int ipinum) VM_EXIT_CTLS_ZERO_SETTING, &exit_ctls); if (error) { - printf("vmx_init: processor does not support desired " + printf("vmx_modinit: processor does not support desired " "exit controls\n"); return (error); } @@ -752,7 +753,7 @@ vmx_init(int ipinum) VM_ENTRY_CTLS_ONE_SETTING, VM_ENTRY_CTLS_ZERO_SETTING, &entry_ctls); if (error) { - printf("vmx_init: processor does not support desired " + printf("vmx_modinit: processor does not support desired " "entry controls\n"); return (error); } @@ -873,8 +874,9 @@ vmx_init(int ipinum) &IDTVEC(justreturn)); if (pirvec < 0) { if (bootverbose) { - printf("vmx_init: unable to allocate " - "posted interrupt vector\n"); + printf("vmx_modinit: unable to " + "allocate posted interrupt " + "vector\n"); } } else { posted_interrupts = 1; @@ -890,7 +892,7 @@ vmx_init(int ipinum) /* Initialize EPT */ error = ept_init(ipinum); if (error) { - printf("vmx_init: ept initialization failed (%d)\n", error); + printf("vmx_modinit: ept initialization failed (%d)\n", error); return (error); } @@ -1015,7 +1017,7 @@ vmx_setup_cr_shadow(int which, struct vmcs *vmcs, uint #define vmx_setup_cr4_shadow(vmcs,init) vmx_setup_cr_shadow(4, (vmcs), (init)) static void * -vmx_vminit(struct vm *vm, pmap_t pmap) +vmx_init(struct vm *vm, pmap_t pmap) { uint16_t vpid[VM_MAXCPU]; int i, error; @@ -1083,7 +1085,7 @@ vmx_vminit(struct vm *vm, pmap_t pmap) guest_msr_rw(vmx, MSR_EFER) || guest_msr_ro(vmx, MSR_TSC) || ((cap_rdpid || cap_rdtscp) && guest_msr_ro(vmx, MSR_TSC_AUX))) - panic("vmx_vminit: error setting guest msr access"); + panic("vmx_init: error setting guest msr access"); vpid_alloc(vpid, VM_MAXCPU); @@ -1100,7 +1102,7 @@ vmx_vminit(struct vm *vm, pmap_t pmap) vmcs->identifier = vmx_revision(); error = vmclear(vmcs); if (error != 0) { - panic("vmx_vminit: vmclear error %d on vcpu %d\n", + panic("vmx_init: vmclear error %d on vcpu %d\n", error, i); } @@ -1158,7 +1160,7 @@ vmx_vminit(struct vm *vm, pmap_t pmap) vtophys(&vmx->pir_desc[i])); } VMCLEAR(vmcs); - KASSERT(error == 0, ("vmx_vminit: error customizing the vmcs")); + KASSERT(error == 0, ("vmx_init: error customizing the vmcs")); vmx->cap[i].set = 0; vmx->cap[i].set |= cap_rdpid != 0 ? 1 << VM_CAP_RDPID : 0; @@ -3001,7 +3003,7 @@ vmx_run(void *arg, int vcpu, register_t rip, pmap_t pm * from a different process than the one that actually runs it. * * If the life of a virtual machine was spent entirely in the context - * of a single process we could do this once in vmx_vminit(). + * of a single process we could do this once in vmx_init(). */ vmcs_write(VMCS_HOST_CR3, rcr3()); @@ -3177,7 +3179,7 @@ vmx_run(void *arg, int vcpu, register_t rip, pmap_t pm } static void -vmx_vmcleanup(void *arg) +vmx_cleanup(void *arg) { int i; struct vmx *vmx = arg; @@ -3547,7 +3549,7 @@ vmx_setcap(void *arg, int vcpu, int type, int val) /* * Choose not to support enabling/disabling * RDPID/RDTSCP via libvmmapi since, as per the - * discussion in vmx_init(), RDPID/RDTSCP are + * discussion in vmx_modinit(), RDPID/RDTSCP are * either always enabled or always disabled. */ error = EOPNOTSUPP; @@ -3617,6 +3619,18 @@ vmx_setcap(void *arg, int vcpu, int type, int val) return (0); } +static struct vmspace * +vmx_vmspace_alloc(vm_offset_t min, vm_offset_t max) +{ + return (ept_vmspace_alloc(min, max)); +} + +static void +vmx_vmspace_free(struct vmspace *vmspace) +{ + ept_vmspace_free(vmspace); +} + struct vlapic_vtx { struct vlapic vlapic; struct pir_desc *pir_desc; @@ -4032,7 +4046,7 @@ vmx_vlapic_cleanup(void *arg, struct vlapic *vlapic) #ifdef BHYVE_SNAPSHOT static int -vmx_snapshot_vmi(void *arg, struct vm_snapshot_meta *meta) +vmx_snapshot(void *arg, struct vm_snapshot_meta *meta) { struct vmx *vmx; struct vmxctx *vmxctx; @@ -4076,7 +4090,7 @@ done: } static int -vmx_snapshot_vmcx(void *arg, struct vm_snapshot_meta *meta, int vcpu) +vmx_vmcx_snapshot(void *arg, struct vm_snapshot_meta *meta, int vcpu) { struct vmcs *vmcs; struct vmx *vmx; @@ -4177,26 +4191,26 @@ vmx_restore_tsc(void *arg, int vcpu, uint64_t offset) } #endif -struct vmm_ops vmm_ops_intel = { +const struct vmm_ops vmm_ops_intel = { + .modinit = vmx_modinit, + .modcleanup = vmx_modcleanup, + .modresume = vmx_modresume, .init = vmx_init, + .run = vmx_run, .cleanup = vmx_cleanup, - .resume = vmx_restore, - .vminit = vmx_vminit, - .vmrun = vmx_run, - .vmcleanup = vmx_vmcleanup, - .vmgetreg = vmx_getreg, - .vmsetreg = vmx_setreg, - .vmgetdesc = vmx_getdesc, - .vmsetdesc = vmx_setdesc, - .vmgetcap = vmx_getcap, - .vmsetcap = vmx_setcap, - .vmspace_alloc = ept_vmspace_alloc, - .vmspace_free = ept_vmspace_free, + .getreg = vmx_getreg, + .setreg = vmx_setreg, + .getdesc = vmx_getdesc, + .setdesc = vmx_setdesc, + .getcap = vmx_getcap, + .setcap = vmx_setcap, + .vmspace_alloc = vmx_vmspace_alloc, + .vmspace_free = vmx_vmspace_free, .vlapic_init = vmx_vlapic_init, .vlapic_cleanup = vmx_vlapic_cleanup, #ifdef BHYVE_SNAPSHOT - .vmsnapshot = vmx_snapshot_vmi, - .vmcx_snapshot = vmx_snapshot_vmcx, - .vm_restore_tsc = vmx_restore_tsc, + .snapshot = vmx_snapshot, + .vmcx_snapshot = vmx_vmcx_snapshot, + .restore_tsc = vmx_restore_tsc, #endif }; Modified: head/sys/amd64/vmm/intel/vmx.h ============================================================================== --- head/sys/amd64/vmm/intel/vmx.h Fri Nov 27 21:38:03 2020 (r368114) +++ head/sys/amd64/vmm/intel/vmx.h Sat Nov 28 01:16:59 2020 (r368115) @@ -160,8 +160,8 @@ vmx_have_msr_tsc_aux(struct vmx *vmx) /* * Since the values of these bits are uniform across all vCPUs - * (see discussion in vmx_init() and initialization of these bits - * in vmx_vminit()), just always use vCPU-zero's capability set and + * (see discussion in vmx_modinit() and initialization of these bits + * in vmx_init()), just always use vCPU-zero's capability set and * remove the need to require a vcpuid argument. */ return ((vmx->cap[0].set & rdpid_rdtscp_bits) != 0); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Fri Nov 27 21:38:03 2020 (r368114) +++ head/sys/amd64/vmm/vmm.c Sat Nov 28 01:16:59 2020 (r368115) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -184,42 +185,53 @@ struct vm { static int vmm_initialized; -static struct vmm_ops *ops; -#define VMM_INIT(num) (ops != NULL ? (*ops->init)(num) : 0) -#define VMM_CLEANUP() (ops != NULL ? (*ops->cleanup)() : 0) -#define VMM_RESUME() (ops != NULL ? (*ops->resume)() : 0) +static void vmmops_panic(void); -#define VMINIT(vm, pmap) (ops != NULL ? (*ops->vminit)(vm, pmap): NULL) -#define VMRUN(vmi, vcpu, rip, pmap, evinfo) \ - (ops != NULL ? (*ops->vmrun)(vmi, vcpu, rip, pmap, evinfo) : ENXIO) -#define VMCLEANUP(vmi) (ops != NULL ? (*ops->vmcleanup)(vmi) : NULL) -#define VMSPACE_ALLOC(min, max) \ - (ops != NULL ? (*ops->vmspace_alloc)(min, max) : NULL) -#define VMSPACE_FREE(vmspace) \ - (ops != NULL ? (*ops->vmspace_free)(vmspace) : ENXIO) -#define VMGETREG(vmi, vcpu, num, retval) \ - (ops != NULL ? (*ops->vmgetreg)(vmi, vcpu, num, retval) : ENXIO) -#define VMSETREG(vmi, vcpu, num, val) \ - (ops != NULL ? (*ops->vmsetreg)(vmi, vcpu, num, val) : ENXIO) -#define VMGETDESC(vmi, vcpu, num, desc) \ - (ops != NULL ? (*ops->vmgetdesc)(vmi, vcpu, num, desc) : ENXIO) -#define VMSETDESC(vmi, vcpu, num, desc) \ - (ops != NULL ? (*ops->vmsetdesc)(vmi, vcpu, num, desc) : ENXIO) -#define VMGETCAP(vmi, vcpu, num, retval) \ - (ops != NULL ? (*ops->vmgetcap)(vmi, vcpu, num, retval) : ENXIO) -#define VMSETCAP(vmi, vcpu, num, val) \ - (ops != NULL ? (*ops->vmsetcap)(vmi, vcpu, num, val) : ENXIO) -#define VLAPIC_INIT(vmi, vcpu) \ - (ops != NULL ? (*ops->vlapic_init)(vmi, vcpu) : NULL) -#define VLAPIC_CLEANUP(vmi, vlapic) \ - (ops != NULL ? (*ops->vlapic_cleanup)(vmi, vlapic) : NULL) +static void +vmmops_panic(void) +{ + panic("vmm_ops func called when !vmm_is_intel() && !vmm_is_svm()"); +} + +#define DEFINE_VMMOPS_IFUNC(ret_type, opname, args) \ + DEFINE_IFUNC(static, ret_type, vmmops_##opname, args) \ + { \ + if (vmm_is_intel()) \ + return (vmm_ops_intel.opname); \ + else if (vmm_is_svm()) \ + return (vmm_ops_amd.opname); \ + else \ + return ((ret_type (*)args)vmmops_panic); \ + } + +DEFINE_VMMOPS_IFUNC(int, modinit, (int ipinum)) +DEFINE_VMMOPS_IFUNC(int, modcleanup, (void)) +DEFINE_VMMOPS_IFUNC(void, modresume, (void)) +DEFINE_VMMOPS_IFUNC(void *, init, (struct vm *vm, struct pmap *pmap)) +DEFINE_VMMOPS_IFUNC(int, run, (void *vmi, int vcpu, register_t rip, + struct pmap *pmap, struct vm_eventinfo *info)) +DEFINE_VMMOPS_IFUNC(void, cleanup, (void *vmi)) +DEFINE_VMMOPS_IFUNC(int, getreg, (void *vmi, int vcpu, int num, + uint64_t *retval)) +DEFINE_VMMOPS_IFUNC(int, setreg, (void *vmi, int vcpu, int num, + uint64_t val)) +DEFINE_VMMOPS_IFUNC(int, getdesc, (void *vmi, int vcpu, int num, + struct seg_desc *desc)) +DEFINE_VMMOPS_IFUNC(int, setdesc, (void *vmi, int vcpu, int num, + struct seg_desc *desc)) +DEFINE_VMMOPS_IFUNC(int, getcap, (void *vmi, int vcpu, int num, int *retval)) +DEFINE_VMMOPS_IFUNC(int, setcap, (void *vmi, int vcpu, int num, int val)) +DEFINE_VMMOPS_IFUNC(struct vmspace *, vmspace_alloc, (vm_offset_t min, + vm_offset_t max)) +DEFINE_VMMOPS_IFUNC(void, vmspace_free, (struct vmspace *vmspace)) +DEFINE_VMMOPS_IFUNC(struct vlapic *, vlapic_init, (void *vmi, int vcpu)) +DEFINE_VMMOPS_IFUNC(void, vlapic_cleanup, (void *vmi, struct vlapic *vlapic)) #ifdef BHYVE_SNAPSHOT -#define VM_SNAPSHOT_VMI(vmi, meta) \ - (ops != NULL ? (*ops->vmsnapshot)(vmi, meta) : ENXIO) -#define VM_SNAPSHOT_VMCX(vmi, meta, vcpuid) \ - (ops != NULL ? (*ops->vmcx_snapshot)(vmi, meta, vcpuid) : ENXIO) -#define VM_RESTORE_TSC(vmi, vcpuid, offset) \ - (ops != NULL ? (*ops->vm_restore_tsc)(vmi, vcpuid, offset) : ENXIO) +DEFINE_VMMOPS_IFUNC(int, snapshot, (void *vmi, struct vm_snapshot_meta + *meta)) +DEFINE_VMMOPS_IFUNC(int, vmcx_snapshot, (void *vmi, struct vm_snapshot_meta + *meta, int vcpu)) +DEFINE_VMMOPS_IFUNC(int, restore_tsc, (void *vmi, int vcpuid, uint64_t now)) #endif #define fpu_start_emulating() load_cr0(rcr0() | CR0_TS) @@ -282,7 +294,7 @@ vcpu_cleanup(struct vm *vm, int i, bool destroy) { struct vcpu *vcpu = &vm->vcpu[i]; - VLAPIC_CLEANUP(vm->cookie, vcpu->vlapic); + vmmops_vlapic_cleanup(vm->cookie, vcpu->vlapic); if (destroy) { vmm_stat_free(vcpu->stats); fpu_save_area_free(vcpu->guestfpu); @@ -310,7 +322,7 @@ vcpu_init(struct vm *vm, int vcpu_id, bool create) vcpu->tsc_offset = 0; } - vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); + vcpu->vlapic = vmmops_vlapic_init(vm->cookie, vcpu_id); vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED); vcpu->reqidle = 0; vcpu->exitintinfo = 0; @@ -342,17 +354,14 @@ vm_exitinfo(struct vm *vm, int cpuid) return (&vcpu->exitinfo); } -static void -vmm_resume(void) -{ - VMM_RESUME(); -} - static int vmm_init(void) { int error; + if (!vmm_is_hw_supported()) + return (ENXIO); + vmm_host_state_init(); vmm_ipinum = lapic_ipi_alloc(pti ? &IDTVEC(justreturn1_pti) : @@ -364,16 +373,9 @@ vmm_init(void) if (error) return (error); - if (vmm_is_intel()) - ops = &vmm_ops_intel; - else if (vmm_is_svm()) - ops = &vmm_ops_amd; - else - return (ENXIO); + vmm_resume_p = vmmops_modresume; - vmm_resume_p = vmm_resume; - - return (VMM_INIT(vmm_ipinum)); + return (vmmops_modinit(vmm_ipinum)); } static int @@ -383,25 +385,33 @@ vmm_handler(module_t mod, int what, void *arg) switch (what) { case MOD_LOAD: - vmmdev_init(); - error = vmm_init(); - if (error == 0) - vmm_initialized = 1; + if (vmm_is_hw_supported()) { + vmmdev_init(); + error = vmm_init(); + if (error == 0) + vmm_initialized = 1; + } else { + error = ENXIO; + } break; case MOD_UNLOAD: - error = vmmdev_cleanup(); - if (error == 0) { - vmm_resume_p = NULL; - iommu_cleanup(); - if (vmm_ipinum != IPI_AST) - lapic_ipi_free(vmm_ipinum); - error = VMM_CLEANUP(); - /* - * Something bad happened - prevent new - * VMs from being created - */ - if (error) - vmm_initialized = 0; + if (vmm_is_hw_supported()) { + error = vmmdev_cleanup(); + if (error == 0) { + vmm_resume_p = NULL; + iommu_cleanup(); + if (vmm_ipinum != IPI_AST) + lapic_ipi_free(vmm_ipinum); + error = vmmops_modcleanup(); + /* + * Something bad happened - prevent new + * VMs from being created + */ + if (error) + vmm_initialized = 0; + } + } else { + error = 0; } break; default: @@ -431,7 +441,7 @@ vm_init(struct vm *vm, bool create) { int i; - vm->cookie = VMINIT(vm, vmspace_pmap(vm->vmspace)); + vm->cookie = vmmops_init(vm, vmspace_pmap(vm->vmspace)); vm->iommu = NULL; vm->vioapic = vioapic_init(vm); vm->vhpet = vhpet_init(vm); @@ -473,7 +483,7 @@ vm_create(const char *name, struct vm **retvm) if (name == NULL || strlen(name) >= VM_MAX_NAMELEN) return (EINVAL); - vmspace = VMSPACE_ALLOC(0, VM_MAXUSER_ADDRESS); + vmspace = vmmops_vmspace_alloc(0, VM_MAXUSER_ADDRESS); if (vmspace == NULL) return (ENOMEM); @@ -549,7 +559,7 @@ vm_cleanup(struct vm *vm, bool destroy) for (i = 0; i < vm->maxcpus; i++) vcpu_cleanup(vm, i, destroy); - VMCLEANUP(vm->cookie); + vmmops_cleanup(vm->cookie); /* * System memory is removed from the guest address space only when @@ -569,7 +579,7 @@ vm_cleanup(struct vm *vm, bool destroy) for (i = 0; i < VM_MAX_MEMSEGS; i++) vm_free_memseg(vm, i); - VMSPACE_FREE(vm->vmspace); + vmmops_vmspace_free(vm->vmspace); vm->vmspace = NULL; } } @@ -1033,7 +1043,7 @@ vm_get_register(struct vm *vm, int vcpu, int reg, uint if (reg >= VM_REG_LAST) return (EINVAL); - return (VMGETREG(vm->cookie, vcpu, reg, retval)); + return (vmmops_getreg(vm->cookie, vcpu, reg, retval)); } int @@ -1048,7 +1058,7 @@ vm_set_register(struct vm *vm, int vcpuid, int reg, ui if (reg >= VM_REG_LAST) return (EINVAL); - error = VMSETREG(vm->cookie, vcpuid, reg, val); + error = vmmops_setreg(vm->cookie, vcpuid, reg, val); if (error || reg != VM_REG_GUEST_RIP) return (error); @@ -1102,7 +1112,7 @@ vm_get_seg_desc(struct vm *vm, int vcpu, int reg, if (!is_segment_register(reg) && !is_descriptor_table(reg)) return (EINVAL); - return (VMGETDESC(vm->cookie, vcpu, reg, desc)); + return (vmmops_getdesc(vm->cookie, vcpu, reg, desc)); } int @@ -1115,7 +1125,7 @@ vm_set_seg_desc(struct vm *vm, int vcpu, int reg, if (!is_segment_register(reg) && !is_descriptor_table(reg)) return (EINVAL); - return (VMSETDESC(vm->cookie, vcpu, reg, desc)); + return (vmmops_setdesc(vm->cookie, vcpu, reg, desc)); } static void @@ -1333,7 +1343,7 @@ vm_handle_hlt(struct vm *vm, int vcpuid, bool intr_dis * software events that would cause this vcpu to wakeup. * * These interrupts/events could have happened after the - * vcpu returned from VMRUN() and before it acquired the + * vcpu returned from vmmops_run() and before it acquired the * vcpu lock above. */ if (vm->rendezvous_func != NULL || vm->suspend || vcpu->reqidle) @@ -1730,7 +1740,7 @@ restart: restore_guest_fpustate(vcpu); vcpu_require_state(vm, vcpuid, VCPU_RUNNING); - error = VMRUN(vm->cookie, vcpuid, vcpu->nextrip, pmap, &evinfo); + error = vmmops_run(vm->cookie, vcpuid, vcpu->nextrip, pmap, &evinfo); vcpu_require_state(vm, vcpuid, VCPU_FROZEN); save_guest_fpustate(vcpu); @@ -1819,9 +1829,9 @@ vm_restart_instruction(void *arg, int vcpuid) } else if (state == VCPU_FROZEN) { /* * When a vcpu is "frozen" it is outside the critical section - * around VMRUN() and 'nextrip' points to the next instruction. - * Thus instruction restart is achieved by setting 'nextrip' - * to the vcpu's %rip. + * around vmmops_run() and 'nextrip' points to the next + * instruction. Thus instruction restart is achieved by setting + * 'nextrip' to the vcpu's %rip. */ error = vm_get_register(vm, vcpuid, VM_REG_GUEST_RIP, &rip); KASSERT(!error, ("%s: error %d getting rip", __func__, error)); @@ -2226,7 +2236,7 @@ vm_get_capability(struct vm *vm, int vcpu, int type, i if (type < 0 || type >= VM_CAP_MAX) return (EINVAL); - return (VMGETCAP(vm->cookie, vcpu, type, retval)); + return (vmmops_getcap(vm->cookie, vcpu, type, retval)); } int @@ -2238,7 +2248,7 @@ vm_set_capability(struct vm *vm, int vcpu, int type, i if (type < 0 || type >= VM_CAP_MAX) return (EINVAL); - return (VMSETCAP(vm->cookie, vcpu, type, val)); + return (vmmops_setcap(vm->cookie, vcpu, type, val)); } struct vlapic * @@ -2824,7 +2834,7 @@ vm_snapshot_vmcx(struct vm *vm, struct vm_snapshot_met error = 0; for (i = 0; i < VM_MAXCPU; i++) { - error = VM_SNAPSHOT_VMCX(vm->cookie, meta, i); + error = vmmops_vmcx_snapshot(vm->cookie, meta, i); if (error != 0) { printf("%s: failed to snapshot vmcs/vmcb data for " "vCPU: %d; error: %d\n", __func__, i, error); @@ -2846,7 +2856,7 @@ vm_snapshot_req(struct vm *vm, struct vm_snapshot_meta switch (meta->dev_req) { case STRUCT_VMX: - ret = VM_SNAPSHOT_VMI(vm->cookie, meta); + ret = vmmops_snapshot(vm->cookie, meta); break; case STRUCT_VMCX: ret = vm_snapshot_vmcx(vm, meta); @@ -2913,7 +2923,8 @@ vm_restore_time(struct vm *vm) for (i = 0; i < nitems(vm->vcpu); i++) { vcpu = &vm->vcpu[i]; - error = VM_RESTORE_TSC(vm->cookie, i, vcpu->tsc_offset - now); + error = vmmops_restore_tsc(vm->cookie, i, vcpu->tsc_offset - + now); if (error) return (error); } Modified: head/sys/amd64/vmm/vmm_util.c ============================================================================== --- head/sys/amd64/vmm/vmm_util.c Fri Nov 27 21:38:03 2020 (r368114) +++ head/sys/amd64/vmm/vmm_util.c Sat Nov 28 01:16:59 2020 (r368115) @@ -39,6 +39,12 @@ __FBSDID("$FreeBSD$"); #include "vmm_util.h" bool +vmm_is_hw_supported(void) +{ + return (vmm_is_intel() || vmm_is_svm()); +} + +bool vmm_is_intel(void) { Modified: head/sys/amd64/vmm/vmm_util.h ============================================================================== --- head/sys/amd64/vmm/vmm_util.h Fri Nov 27 21:38:03 2020 (r368114) +++ head/sys/amd64/vmm/vmm_util.h Sat Nov 28 01:16:59 2020 (r368115) @@ -33,6 +33,7 @@ struct trapframe; +bool vmm_is_hw_supported(void); bool vmm_is_intel(void); bool vmm_is_svm(void); bool vmm_supports_1G_pages(void); From owner-svn-src-all@freebsd.org Sat Nov 28 01:21:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95C5F46FE71; Sat, 28 Nov 2020 01:21:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjYbr31P2z4jVQ; Sat, 28 Nov 2020 01:21: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 58B711E7F1; Sat, 28 Nov 2020 01:21: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 0AS1LCxg098245; Sat, 28 Nov 2020 01:21:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AS1LCeV098244; Sat, 28 Nov 2020 01:21:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011280121.0AS1LCeV098244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 28 Nov 2020 01:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368116 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 368116 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 01:21:12 -0000 Author: kevans Date: Sat Nov 28 01:21:11 2020 New Revision: 368116 URL: https://svnweb.freebsd.org/changeset/base/368116 Log: kern: cpuset: drop the lock to allocate domainsets Restructure the loop a little bit to make it a little more clear how it really operates: we never allocate any domains at the beginning of the first iteration, and it will run until we've satisfied the amount we need or we encounter an error. The lock is now taken outside of the loop to make stuff inside the loop easier to evaluate w.r.t. locking. This fixes it to not try and allocate any domains for the freelist under the spinlock, which would have happened before if we needed any new domains. Reported by: syzbot+6743fa07b9b7528dc561@syzkaller.appspotmail.com Reviewed by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D27371 Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Sat Nov 28 01:16:59 2020 (r368115) +++ head/sys/kern/kern_cpuset.c Sat Nov 28 01:21:11 2020 (r368116) @@ -794,14 +794,11 @@ cpuset_modify_domain(struct cpuset *set, struct domain return (EPERM); domainset_freelist_init(&domains, 0); domain = domainset_create(domain); - ndomains = needed = 0; - do { - if (ndomains < needed) { - domainset_freelist_add(&domains, needed - ndomains); - ndomains = needed; - } + ndomains = 0; + + mtx_lock_spin(&cpuset_lock); + for (;;) { root = cpuset_getroot(set); - mtx_lock_spin(&cpuset_lock); dset = root->cs_domain; /* * Verify that we have access to this set of domains. @@ -826,7 +823,15 @@ cpuset_modify_domain(struct cpuset *set, struct domain &needed, 0); if (error) goto out; - } while (ndomains < needed); + if (ndomains >= needed) + break; + + /* Dropping the lock; we'll need to re-evaluate again. */ + mtx_unlock_spin(&cpuset_lock); + domainset_freelist_add(&domains, needed - ndomains); + ndomains = needed; + mtx_lock_spin(&cpuset_lock); + } dset = set->cs_domain; cpuset_update_domain(set, domain, dset, &domains); out: From owner-svn-src-all@freebsd.org Sat Nov 28 03:54:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD4AA475112; Sat, 28 Nov 2020 03:54:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cjd145tCBz4sJg; Sat, 28 Nov 2020 03:54:48 +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 B1FEA20D67; Sat, 28 Nov 2020 03:54:48 +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 0AS3smVP096704; Sat, 28 Nov 2020 03:54:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AS3smDr096703; Sat, 28 Nov 2020 03:54:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202011280354.0AS3smDr096703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 28 Nov 2020 03:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368117 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 368117 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 03:54:48 -0000 Author: jhb Date: Sat Nov 28 03:54:48 2020 New Revision: 368117 URL: https://svnweb.freebsd.org/changeset/base/368117 Log: bhyve: 'xhci,tablet' snapshot fixes Permit suspend/resume of a XHCI device model that has not been attached to by a driver in a guest OS. Submitted by: Vitaliy Gusev Differential Revision: https://reviews.freebsd.org/D26264 Modified: head/usr.sbin/bhyve/pci_xhci.c Modified: head/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- head/usr.sbin/bhyve/pci_xhci.c Sat Nov 28 01:21:11 2020 (r368116) +++ head/usr.sbin/bhyve/pci_xhci.c Sat Nov 28 03:54:48 2020 (r368117) @@ -2251,7 +2251,6 @@ pci_xhci_write(struct vmctx *ctx, int vcpu, struct pci assert(baridx == 0); - pthread_mutex_lock(&sc->mtx); if (offset < XHCI_CAPLEN) /* read only registers */ WPRINTF(("pci_xhci: write RO-CAPs offset %ld", offset)); @@ -2981,11 +2980,11 @@ pci_xhci_snapshot(struct vm_snapshot_meta *meta) /* opregs.cr_p */ SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(sc->opregs.cr_p, - XHCI_GADDR_SIZE(sc->opregs.cr_p), false, meta, ret, done); + XHCI_GADDR_SIZE(sc->opregs.cr_p), true, meta, ret, done); /* opregs.dcbaa_p */ SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(sc->opregs.dcbaa_p, - XHCI_GADDR_SIZE(sc->opregs.dcbaa_p), false, meta, ret, done); + XHCI_GADDR_SIZE(sc->opregs.dcbaa_p), true, meta, ret, done); /* rtsregs */ SNAPSHOT_VAR_OR_LEAVE(sc->rtsregs.mfindex, meta, ret, done); @@ -3000,11 +2999,11 @@ pci_xhci_snapshot(struct vm_snapshot_meta *meta) /* rtsregs.erstba_p */ SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(sc->rtsregs.erstba_p, - XHCI_GADDR_SIZE(sc->rtsregs.erstba_p), false, meta, ret, done); + XHCI_GADDR_SIZE(sc->rtsregs.erstba_p), true, meta, ret, done); /* rtsregs.erst_p */ SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(sc->rtsregs.erst_p, - XHCI_GADDR_SIZE(sc->rtsregs.erst_p), false, meta, ret, done); + XHCI_GADDR_SIZE(sc->rtsregs.erst_p), true, meta, ret, done); SNAPSHOT_VAR_OR_LEAVE(sc->rtsregs.er_deq_seg, meta, ret, done); SNAPSHOT_VAR_OR_LEAVE(sc->rtsregs.er_enq_idx, meta, ret, done); @@ -3090,12 +3089,14 @@ pci_xhci_snapshot(struct vm_snapshot_meta *meta) continue; SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(dev->dev_ctx, - XHCI_GADDR_SIZE(dev->dev_ctx), false, meta, ret, done); + XHCI_GADDR_SIZE(dev->dev_ctx), true, meta, ret, done); - for (j = 1; j < XHCI_MAX_ENDPOINTS; j++) { - ret = pci_xhci_snapshot_ep(sc, dev, j, meta); - if (ret != 0) - goto done; + if (dev->dev_ctx != NULL) { + for (j = 1; j < XHCI_MAX_ENDPOINTS; j++) { + ret = pci_xhci_snapshot_ep(sc, dev, j, meta); + if (ret != 0) + goto done; + } } SNAPSHOT_VAR_OR_LEAVE(dev->dev_slotstate, meta, ret, done); From owner-svn-src-all@freebsd.org Sat Nov 28 04:06:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D38D44751B9; Sat, 28 Nov 2020 04:06:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjdG95fXwz4slX; Sat, 28 Nov 2020 04:06:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4E1D21198; Sat, 28 Nov 2020 04:06:09 +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 0AS469jH003271; Sat, 28 Nov 2020 04:06:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AS469BM003269; Sat, 28 Nov 2020 04:06:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202011280406.0AS469BM003269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 28 Nov 2020 04:06:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368118 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 368118 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 04:06:09 -0000 Author: jhb Date: Sat Nov 28 04:06:09 2020 New Revision: 368118 URL: https://svnweb.freebsd.org/changeset/base/368118 Log: bhyve: Add snapshot support for virtio-rnd. This uses the same snapshot routine as other VirtIO devices. Submitted by: Vitaliy Gusev Differential Revision: https://reviews.freebsd.org/D26265 Modified: head/usr.sbin/bhyve/pci_virtio_rnd.c head/usr.sbin/bhyve/snapshot.c Modified: head/usr.sbin/bhyve/pci_virtio_rnd.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_rnd.c Sat Nov 28 03:54:48 2020 (r368117) +++ head/usr.sbin/bhyve/pci_virtio_rnd.c Sat Nov 28 04:06:09 2020 (r368118) @@ -205,6 +205,9 @@ struct pci_devemu pci_de_vrnd = { .pe_emu = "virtio-rnd", .pe_init = pci_vtrnd_init, .pe_barwrite = vi_pci_write, - .pe_barread = vi_pci_read + .pe_barread = vi_pci_read, +#ifdef BHYVE_SNAPSHOT + .pe_snapshot = vi_pci_snapshot, +#endif }; PCI_EMUL_SET(pci_de_vrnd); Modified: head/usr.sbin/bhyve/snapshot.c ============================================================================== --- head/usr.sbin/bhyve/snapshot.c Sat Nov 28 03:54:48 2020 (r368117) +++ head/usr.sbin/bhyve/snapshot.c Sat Nov 28 04:06:09 2020 (r368118) @@ -147,6 +147,7 @@ const struct vm_snapshot_dev_info snapshot_devs[] = { { "atkbdc", atkbdc_snapshot, NULL, NULL }, { "virtio-net", pci_snapshot, pci_pause, pci_resume }, { "virtio-blk", pci_snapshot, pci_pause, pci_resume }, + { "virtio-rnd", pci_snapshot, NULL, NULL }, { "lpc", pci_snapshot, NULL, NULL }, { "fbuf", pci_snapshot, NULL, NULL }, { "xhci", pci_snapshot, NULL, NULL }, From owner-svn-src-all@freebsd.org Sat Nov 28 04:21:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 478904751E8; Sat, 28 Nov 2020 04:21:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cjdbl1BX9z4tkT; Sat, 28 Nov 2020 04:21:23 +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 1BBDB2146B; Sat, 28 Nov 2020 04:21:23 +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 0AS4LMfY014458; Sat, 28 Nov 2020 04:21:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AS4LMTX014457; Sat, 28 Nov 2020 04:21:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202011280421.0AS4LMTX014457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 28 Nov 2020 04:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368119 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 368119 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 04:21:23 -0000 Author: jhb Date: Sat Nov 28 04:21:22 2020 New Revision: 368119 URL: https://svnweb.freebsd.org/changeset/base/368119 Log: Suspend I/O on ahci-cd devices during a snapshot. Submitted by: Vitaliy Gusev Modified: head/usr.sbin/bhyve/snapshot.c Modified: head/usr.sbin/bhyve/snapshot.c ============================================================================== --- head/usr.sbin/bhyve/snapshot.c Sat Nov 28 04:06:09 2020 (r368118) +++ head/usr.sbin/bhyve/snapshot.c Sat Nov 28 04:21:22 2020 (r368119) @@ -154,7 +154,7 @@ const struct vm_snapshot_dev_info snapshot_devs[] = { { "e1000", pci_snapshot, NULL, NULL }, { "ahci", pci_snapshot, pci_pause, pci_resume }, { "ahci-hd", pci_snapshot, pci_pause, pci_resume }, - { "ahci-cd", pci_snapshot, NULL, NULL }, + { "ahci-cd", pci_snapshot, pci_pause, pci_resume }, }; const struct vm_snapshot_kern_info snapshot_kern_structs[] = { From owner-svn-src-all@freebsd.org Sat Nov 28 09:06:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4764E47B4B6; Sat, 28 Nov 2020 09:06:52 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cjlx81Vl8z3N66; Sat, 28 Nov 2020 09:06:52 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 222B124E82; Sat, 28 Nov 2020 09:06:52 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AS96p3D088966; Sat, 28 Nov 2020 09:06:51 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AS96pOc088965; Sat, 28 Nov 2020 09:06:51 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202011280906.0AS96pOc088965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 28 Nov 2020 09:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368121 - stable/12/stand/efi/loader X-SVN-Group: stable-12 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/12/stand/efi/loader X-SVN-Commit-Revision: 368121 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 09:06:52 -0000 Author: mmel Date: Sat Nov 28 09:06:51 2020 New Revision: 368121 URL: https://svnweb.freebsd.org/changeset/base/368121 Log: MFC r366700: Add 'netserver' command to EFI loader. Modified: stable/12/stand/efi/loader/main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/efi/loader/main.c ============================================================================== --- stable/12/stand/efi/loader/main.c Sat Nov 28 08:07:55 2020 (r368120) +++ stable/12/stand/efi/loader/main.c Sat Nov 28 09:06:51 2020 (r368121) @@ -37,10 +37,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include #include +#include +#include #include #include @@ -1565,3 +1569,34 @@ command_chain(int argc, char *argv[]) } COMMAND_SET(chain, "chain", "chain load file", command_chain); + +extern struct in_addr servip; +static int +command_netserver(int argc, char *argv[]) +{ + char *proto; + n_long rootaddr; + + if (argc > 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } + if (argc < 2) { + proto = netproto == NET_TFTP ? "tftp://" : "nfs://"; + printf("Netserver URI: %s%s%s\n", proto, intoa(rootip.s_addr), + rootpath); + return (CMD_OK); + } + if (argc == 2) { + strncpy(rootpath, argv[1], sizeof(rootpath)); + rootpath[sizeof(rootpath) -1] = '\0'; + if ((rootaddr = net_parse_rootpath()) != INADDR_NONE) + servip.s_addr = rootip.s_addr = rootaddr; + return (CMD_OK); + } + return (CMD_ERROR); /* not reached */ + +} + +COMMAND_SET(netserver, "netserver", "change or display netserver URI", + command_netserver); From owner-svn-src-all@freebsd.org Sat Nov 28 10:36:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E30ED47CF9E; Sat, 28 Nov 2020 10:36:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjnwN63kfz3hGV; Sat, 28 Nov 2020 10:36:20 +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 BE19125F27; Sat, 28 Nov 2020 10:36:20 +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 0ASAaKdH044762; Sat, 28 Nov 2020 10:36:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ASAaKaw044759; Sat, 28 Nov 2020 10:36:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011281036.0ASAaKaw044759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 28 Nov 2020 10:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368122 - in stable/12/sys: kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: kern sys X-SVN-Commit-Revision: 368122 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 10:36:21 -0000 Author: kib Date: Sat Nov 28 10:36:19 2020 New Revision: 368122 URL: https://svnweb.freebsd.org/changeset/base/368122 Log: MFC r367918, r367919: Stop using eventhandler to invoke umtx_exec hook. Modified: stable/12/sys/kern/kern_exec.c stable/12/sys/kern/kern_umtx.c stable/12/sys/sys/umtx.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_exec.c ============================================================================== --- stable/12/sys/kern/kern_exec.c Sat Nov 28 09:06:51 2020 (r368121) +++ stable/12/sys/kern/kern_exec.c Sat Nov 28 10:36:19 2020 (r368122) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #ifdef KTRACE @@ -1106,7 +1107,8 @@ exec_new_vmspace(struct image_params *imgp, struct sys imgp->vmspace_destroyed = 1; imgp->sysent = sv; - /* May be called with Giant held */ + umtx_exec(p); + EVENTHANDLER_DIRECT_INVOKE(process_exec, p, imgp); /* Modified: stable/12/sys/kern/kern_umtx.c ============================================================================== --- stable/12/sys/kern/kern_umtx.c Sat Nov 28 09:06:51 2020 (r368121) +++ stable/12/sys/kern/kern_umtx.c Sat Nov 28 10:36:19 2020 (r368122) @@ -281,8 +281,6 @@ static void umtx_pi_free(struct umtx_pi *pi); static int do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags, bool rb); static void umtx_thread_cleanup(struct thread *td); -static void umtx_exec_hook(void *arg __unused, struct proc *p __unused, - struct image_params *imgp __unused); SYSINIT(umtx, SI_SUB_EVENTHANDLER+1, SI_ORDER_MIDDLE, umtxq_sysinit, NULL); #define umtxq_signal(key, nwake) umtxq_signal_queue((key), (nwake), UMTX_SHARED_QUEUE) @@ -450,8 +448,6 @@ umtxq_sysinit(void *arg __unused) umtx_init_profiling(); #endif mtx_init(&umtx_lock, "umtx lock", NULL, MTX_DEF); - EVENTHANDLER_REGISTER(process_exec, umtx_exec_hook, NULL, - EVENTHANDLER_PRI_ANY); umtx_shm_init(); } @@ -4492,12 +4488,11 @@ umtx_thread_alloc(struct thread *td) * exec() hook. * * Clear robust lists for all process' threads, not delaying the - * cleanup to thread_exit hook, since the relevant address space is + * cleanup to thread exit, since the relevant address space is * destroyed right now. */ -static void -umtx_exec_hook(void *arg __unused, struct proc *p, - struct image_params *imgp __unused) +void +umtx_exec(struct proc *p) { struct thread *td; @@ -4519,7 +4514,7 @@ umtx_exec_hook(void *arg __unused, struct proc *p, } /* - * thread_exit() hook. + * thread exit hook. */ void umtx_thread_exit(struct thread *td) Modified: stable/12/sys/sys/umtx.h ============================================================================== --- stable/12/sys/sys/umtx.h Sat Nov 28 09:06:51 2020 (r368121) +++ stable/12/sys/sys/umtx.h Sat Nov 28 10:36:19 2020 (r368122) @@ -188,6 +188,7 @@ umtx_key_match(const struct umtx_key *k1, const struct } int umtx_copyin_timeout(const void *, struct timespec *); +void umtx_exec(struct proc *p); int umtx_key_get(const void *, int, int, struct umtx_key *); void umtx_key_release(struct umtx_key *); struct umtx_q *umtxq_alloc(void); From owner-svn-src-all@freebsd.org Sat Nov 28 10:38:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 393E047D19A; Sat, 28 Nov 2020 10:38:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjnyL0pSMz3hW9; Sat, 28 Nov 2020 10:38:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A11026012; Sat, 28 Nov 2020 10:38:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ASAc1qc044903; Sat, 28 Nov 2020 10:38:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ASAc1tq044899; Sat, 28 Nov 2020 10:38:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011281038.0ASAc1tq044899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 28 Nov 2020 10:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368123 - in stable/12/sys: kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: kern sys X-SVN-Commit-Revision: 368123 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 10:38:02 -0000 Author: kib Date: Sat Nov 28 10:38:00 2020 New Revision: 368123 URL: https://svnweb.freebsd.org/changeset/base/368123 Log: MFC r367923: Stop using eventhandlers for itimers subsystem exec and exit hooks. Modified: stable/12/sys/kern/kern_exec.c stable/12/sys/kern/kern_exit.c stable/12/sys/kern/kern_time.c stable/12/sys/sys/timers.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_exec.c ============================================================================== --- stable/12/sys/kern/kern_exec.c Sat Nov 28 10:36:19 2020 (r368122) +++ stable/12/sys/kern/kern_exec.c Sat Nov 28 10:38:00 2020 (r368123) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1108,6 +1109,7 @@ exec_new_vmspace(struct image_params *imgp, struct sys imgp->sysent = sv; umtx_exec(p); + itimers_exec(p); EVENTHANDLER_DIRECT_INVOKE(process_exec, p, imgp); Modified: stable/12/sys/kern/kern_exit.c ============================================================================== --- stable/12/sys/kern/kern_exit.c Sat Nov 28 10:36:19 2020 (r368122) +++ stable/12/sys/kern/kern_exit.c Sat Nov 28 10:38:00 2020 (r368123) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef KTRACE #include @@ -320,6 +321,8 @@ exit1(struct thread *td, int rval, int signo) msleep(p, &ppeers_lock, PWAIT, "exit1", 0); mtx_unlock(&ppeers_lock); } + + itimers_exit(p); /* * Check if any loadable modules need anything done at process exit. Modified: stable/12/sys/kern/kern_time.c ============================================================================== --- stable/12/sys/kern/kern_time.c Sat Nov 28 10:36:19 2020 (r368122) +++ stable/12/sys/kern/kern_time.c Sat Nov 28 10:38:00 2020 (r368123) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -99,8 +98,6 @@ static void itimer_enter(struct itimer *); static void itimer_leave(struct itimer *); static struct itimer *itimer_find(struct proc *, int); static void itimers_alloc(struct proc *); -static void itimers_event_hook_exec(void *arg, struct proc *p, struct image_params *imgp); -static void itimers_event_hook_exit(void *arg, struct proc *p); static int realtimer_create(struct itimer *); static int realtimer_gettime(struct itimer *, struct itimerspec *); static int realtimer_settime(struct itimer *, int, @@ -109,7 +106,7 @@ static int realtimer_delete(struct itimer *); static void realtimer_clocktime(clockid_t, struct timespec *); static void realtimer_expire(void *); -int register_posix_clock(int, struct kclock *); +static int register_posix_clock(int, const struct kclock *); void itimer_fire(struct itimer *it); int itimespecfix(struct timespec *ts); @@ -1089,12 +1086,11 @@ ppsratecheck(struct timeval *lasttime, int *curpps, in static void itimer_start(void) { - struct kclock rt_clock = { + static const struct kclock rt_clock = { .timer_create = realtimer_create, .timer_delete = realtimer_delete, .timer_settime = realtimer_settime, .timer_gettime = realtimer_gettime, - .event_hook = NULL }; itimer_zone = uma_zcreate("itimer", sizeof(struct itimer), @@ -1104,14 +1100,10 @@ itimer_start(void) p31b_setcfg(CTL_P1003_1B_TIMERS, 200112L); p31b_setcfg(CTL_P1003_1B_DELAYTIMER_MAX, INT_MAX); p31b_setcfg(CTL_P1003_1B_TIMER_MAX, TIMER_MAX); - EVENTHANDLER_REGISTER(process_exit, itimers_event_hook_exit, - (void *)ITIMER_EV_EXIT, EVENTHANDLER_PRI_ANY); - EVENTHANDLER_REGISTER(process_exec, itimers_event_hook_exec, - (void *)ITIMER_EV_EXEC, EVENTHANDLER_PRI_ANY); } -int -register_posix_clock(int clockid, struct kclock *clk) +static int +register_posix_clock(int clockid, const struct kclock *clk) { if ((unsigned)clockid >= MAX_CLOCKS) { printf("%s: invalid clockid\n", __func__); @@ -1717,46 +1709,41 @@ itimers_alloc(struct proc *p) } } -static void -itimers_event_hook_exec(void *arg, struct proc *p, struct image_params *imgp __unused) -{ - itimers_event_hook_exit(arg, p); -} - /* Clean up timers when some process events are being triggered. */ static void -itimers_event_hook_exit(void *arg, struct proc *p) +itimers_event_exit_exec(int start_idx, struct proc *p) { struct itimers *its; struct itimer *it; - int event = (int)(intptr_t)arg; int i; - if (p->p_itimers != NULL) { - its = p->p_itimers; - for (i = 0; i < MAX_CLOCKS; ++i) { - if (posix_clocks[i].event_hook != NULL) - CLOCK_CALL(i, event_hook, (p, i, event)); - } - /* - * According to susv3, XSI interval timers should be inherited - * by new image. - */ - if (event == ITIMER_EV_EXEC) - i = 3; - else if (event == ITIMER_EV_EXIT) - i = 0; - else - panic("unhandled event"); - for (; i < TIMER_MAX; ++i) { - if ((it = its->its_timers[i]) != NULL) - kern_ktimer_delete(curthread, i); - } - if (its->its_timers[0] == NULL && - its->its_timers[1] == NULL && - its->its_timers[2] == NULL) { - free(its, M_SUBPROC); - p->p_itimers = NULL; - } + its = p->p_itimers; + if (its == NULL) + return; + + for (i = start_idx; i < TIMER_MAX; ++i) { + if ((it = its->its_timers[i]) != NULL) + kern_ktimer_delete(curthread, i); } + if (its->its_timers[0] == NULL && its->its_timers[1] == NULL && + its->its_timers[2] == NULL) { + free(its, M_SUBPROC); + p->p_itimers = NULL; + } +} + +void +itimers_exec(struct proc *p) +{ + /* + * According to susv3, XSI interval timers should be inherited + * by new image. + */ + itimers_event_exit_exec(3, p); +} + +void +itimers_exit(struct proc *p) +{ + itimers_event_exit_exec(0, p); } Modified: stable/12/sys/sys/timers.h ============================================================================== --- stable/12/sys/sys/timers.h Sat Nov 28 10:36:19 2020 (r368122) +++ stable/12/sys/sys/timers.h Sat Nov 28 10:38:00 2020 (r368123) @@ -107,13 +107,10 @@ struct kclock { int (*timer_delete)(struct itimer * timer); int (*timer_gettime)(struct itimer * timer, struct itimerspec * cur_value); - void (*event_hook)(struct proc *p, clockid_t clock_id, int event); }; -/* Event values for event_hook() */ -#define ITIMER_EV_EXEC 0 -#define ITIMER_EV_EXIT 1 - +void itimers_exec(struct proc *p); +void itimers_exit(struct proc *p); int itimer_accept(struct proc *p, int tid, ksiginfo_t *ksi); #endif #endif /* !_SYS_TIMERS_H_ */ From owner-svn-src-all@freebsd.org Sat Nov 28 12:13:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B44047F0A5; Sat, 28 Nov 2020 12:13:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cjr3x1xZtz3mXb; Sat, 28 Nov 2020 12:13:01 +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 34E832721B; Sat, 28 Nov 2020 12:13:01 +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 0ASCD0fW007052; Sat, 28 Nov 2020 12:13:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ASCCpjQ006999; Sat, 28 Nov 2020 12:12:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011281212.0ASCCpjQ006999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 28 Nov 2020 12:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368124 - in head/sys: cam cam/ata cam/ctl cam/mmc cam/nvme cam/scsi compat/linprocfs compat/linux conf contrib/openzfs/module/os/freebsd/zfs dev/ahci dev/ata dev/firewire dev/flash dev... X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: cam cam/ata cam/ctl cam/mmc cam/nvme cam/scsi compat/linprocfs compat/linux conf contrib/openzfs/module/os/freebsd/zfs dev/ahci dev/ata dev/firewire dev/flash dev/isci/scil dev/iscsi dev/... X-SVN-Commit-Revision: 368124 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 12:13:01 -0000 Author: kib Date: Sat Nov 28 12:12:51 2020 New Revision: 368124 URL: https://svnweb.freebsd.org/changeset/base/368124 Log: Make MAXPHYS tunable. Bump MAXPHYS to 1M. Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys. Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer cache buffers exactly to atop(maxbcachebuf) (currently it is sized to atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1. The +1 for pbufs allow several pbuf consumers, among them vmapbuf(), to use unaligned buffers still sized to maxphys, esp. when such buffers come from userspace (*). Overall, we save significant amount of otherwise wasted memory in b_pages[] for buffer cache buffers, while bumping MAXPHYS to desired high value. Eliminate all direct uses of the MAXPHYS constant in kernel and driver sources, except a place which initialize maxphys. Some random (and arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted straight. Some drivers, which use MAXPHYS to size embeded structures, get private MAXPHYS-like constant; their convertion is out of scope for this work. Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs, dev/siis, where either submitted by, or based on changes by mav. Suggested by: mav (*) Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27225 Modified: head/sys/cam/ata/ata_da.c head/sys/cam/cam_compat.c head/sys/cam/cam_periph.c head/sys/cam/cam_xpt.c head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/mmc/mmc_da.c head/sys/cam/nvme/nvme_da.c head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_pass.c head/sys/cam/scsi/scsi_sa.c head/sys/cam/scsi/scsi_sg.c head/sys/cam/scsi/scsi_target.c head/sys/compat/linprocfs/linprocfs.c head/sys/compat/linux/linux_ioctl.c head/sys/conf/options head/sys/contrib/openzfs/module/os/freebsd/zfs/vdev_geom.c head/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h head/sys/dev/ahci/ahciem.c head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-all.h head/sys/dev/ata/ata-dma.c head/sys/dev/firewire/sbp.c head/sys/dev/flash/cqspi.c head/sys/dev/isci/scil/sci_controller_constants.h head/sys/dev/iscsi/iscsi.c head/sys/dev/md/md.c head/sys/dev/mfi/mfi.c head/sys/dev/mpr/mpr.c head/sys/dev/mps/mps.c head/sys/dev/mpt/mpt.c head/sys/dev/mpt/mpt.h head/sys/dev/mrsas/mrsas.c head/sys/dev/mvs/mvs.c head/sys/dev/mvs/mvs.h head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/pms/freebsd/driver/ini/src/agdef.h head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c head/sys/dev/sdhci/sdhci.c head/sys/dev/siis/siis.c head/sys/dev/siis/siis.h head/sys/dev/sym/sym_conf.h head/sys/dev/usb/storage/umass.c head/sys/dev/virtio/block/virtio_blk.c head/sys/dev/virtio/scsi/virtio_scsi.c head/sys/dev/xen/blkback/blkback.c head/sys/dev/xen/blkfront/blkfront.c head/sys/fs/cd9660/cd9660_vfsops.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/fs/udf/udf_vfsops.c head/sys/geom/cache/g_cache.c head/sys/geom/eli/g_eli_integrity.c head/sys/geom/geom_dev.c head/sys/geom/geom_io.c head/sys/geom/journal/g_journal.c head/sys/geom/journal/g_journal.h head/sys/geom/mirror/g_mirror.c head/sys/geom/nop/g_nop.c head/sys/geom/part/g_part_apm.c head/sys/geom/part/g_part_gpt.c head/sys/geom/part/g_part_ldm.c head/sys/geom/raid/md_ddf.c head/sys/geom/raid/md_promise.c head/sys/geom/raid3/g_raid3.c head/sys/geom/shsec/g_shsec.c head/sys/geom/stripe/g_stripe.c head/sys/geom/uzip/g_uzip.c head/sys/geom/vinum/geom_vinum_var.h head/sys/geom/virstor/g_virstor.c head/sys/geom/virstor/g_virstor.h head/sys/kern/kern_mib.c head/sys/kern/kern_physio.c head/sys/kern/kern_sendfile.c head/sys/kern/subr_param.c head/sys/kern/vfs_aio.c head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c head/sys/kern/vfs_default.c head/sys/mips/ingenic/jz4780_mmc.c head/sys/net/if.c head/sys/powerpc/mambo/mambo_disk.c head/sys/powerpc/mpc85xx/fsl_sata.c head/sys/sys/aio.h head/sys/sys/buf.h head/sys/sys/param.h head/sys/sys/systm.h head/sys/ufs/ffs/ffs_vfsops.c head/sys/vm/swap_pager.c head/sys/vm/vm_fault.c head/sys/vm/vm_init.c head/sys/vm/vm_map.h head/sys/vm/vm_pager.c head/sys/vm/vm_pager.h head/sys/vm/vnode_pager.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/cam/ata/ata_da.c Sat Nov 28 12:12:51 2020 (r368124) @@ -3447,8 +3447,8 @@ adasetgeom(struct ada_softc *softc, struct ccb_getdev maxio = softc->cpi.maxio; /* Honor max I/O size of SIM */ if (maxio == 0) maxio = DFLTPHYS; /* traditional default */ - else if (maxio > MAXPHYS) - maxio = MAXPHYS; /* for safety */ + else if (maxio > maxphys) + maxio = maxphys; /* for safety */ if (softc->flags & ADA_FLAG_CAN_48BIT) maxio = min(maxio, 65536 * softc->params.secsize); else /* 28bit ATA command limit */ Modified: head/sys/cam/cam_compat.c ============================================================================== --- head/sys/cam/cam_compat.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/cam/cam_compat.c Sat Nov 28 12:12:51 2020 (r368124) @@ -368,7 +368,7 @@ cam_compat_translate_dev_match_0x18(union ccb *ccb) /* Remap the CCB into kernel address space */ bzero(&mapinfo, sizeof(mapinfo)); - cam_periph_mapmem(ccb, &mapinfo, MAXPHYS); + cam_periph_mapmem(ccb, &mapinfo, maxphys); dm = ccb->cdm.matches; /* Translate in-place: old fields are smaller */ Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/cam/cam_periph.c Sat Nov 28 12:12:51 2020 (r368124) @@ -772,7 +772,7 @@ camperiphfree(struct cam_periph *periph) * Map user virtual pointers into kernel virtual address space, so we can * access the memory. This is now a generic function that centralizes most * of the sanity checks on the data flags, if any. - * This also only works for up to MAXPHYS memory. Since we use + * This also only works for up to maxphys memory. Since we use * buffers to map stuff in and out, we're limited to the buffer size. */ int @@ -788,8 +788,8 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma bzero(mapinfo, sizeof(*mapinfo)); if (maxmap == 0) maxmap = DFLTPHYS; /* traditional default */ - else if (maxmap > MAXPHYS) - maxmap = MAXPHYS; /* for safety */ + else if (maxmap > maxphys) + maxmap = maxphys; /* for safety */ switch(ccb->ccb_h.func_code) { case XPT_DEV_MATCH: if (ccb->cdm.match_buf_len == 0) { @@ -813,9 +813,9 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma } /* * This request will not go to the hardware, no reason - * to be so strict. vmapbuf() is able to map up to MAXPHYS. + * to be so strict. vmapbuf() is able to map up to maxphys. */ - maxmap = MAXPHYS; + maxmap = maxphys; break; case XPT_SCSI_IO: case XPT_CONT_TARGET_IO: @@ -881,9 +881,9 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma /* * This request will not go to the hardware, no reason - * to be so strict. vmapbuf() is able to map up to MAXPHYS. + * to be so strict. vmapbuf() is able to map up to maxphys. */ - maxmap = MAXPHYS; + maxmap = maxphys; break; default: return(EINVAL); @@ -911,7 +911,7 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma * boundary. */ misaligned[i] = (lengths[i] + - (((vm_offset_t)(*data_ptrs[i])) & PAGE_MASK) > MAXPHYS); + (((vm_offset_t)(*data_ptrs[i])) & PAGE_MASK) > maxphys); } /* Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/cam/cam_xpt.c Sat Nov 28 12:12:51 2020 (r368124) @@ -553,7 +553,7 @@ xptdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, * Map the pattern and match buffers into kernel * virtual address space. */ - error = cam_periph_mapmem(inccb, &mapinfo, MAXPHYS); + error = cam_periph_mapmem(inccb, &mapinfo, maxphys); if (error) { inccb->ccb_h.path = old_path; Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/cam/ctl/ctl_backend_block.c Sat Nov 28 12:12:51 2020 (r368124) @@ -102,9 +102,11 @@ __FBSDID("$FreeBSD$"); */ #define CTLBLK_HALF_IO_SIZE (512 * 1024) #define CTLBLK_MAX_IO_SIZE (CTLBLK_HALF_IO_SIZE * 2) -#define CTLBLK_MAX_SEG MIN(CTLBLK_HALF_IO_SIZE, MAXPHYS) -#define CTLBLK_HALF_SEGS MAX(CTLBLK_HALF_IO_SIZE / CTLBLK_MAX_SEG, 1) +#define CTLBLK_MIN_SEG (128 * 1024) +#define CTLBLK_MAX_SEG MIN(CTLBLK_HALF_IO_SIZE, maxphys) +#define CTLBLK_HALF_SEGS MAX(CTLBLK_HALF_IO_SIZE / CTLBLK_MIN_SEG, 1) #define CTLBLK_MAX_SEGS (CTLBLK_HALF_SEGS * 2) +#define CTLBLK_NUM_SEGS (CTLBLK_MAX_IO_SIZE / CTLBLK_MAX_SEG) #ifdef CTLBLK_DEBUG #define DPRINTF(fmt, args...) \ @@ -189,10 +191,8 @@ struct ctl_be_block_softc { int num_luns; SLIST_HEAD(, ctl_be_block_lun) lun_list; uma_zone_t beio_zone; - uma_zone_t buf_zone; -#if (CTLBLK_MAX_SEG > 131072) - uma_zone_t buf128_zone; -#endif + uma_zone_t bufmin_zone; + uma_zone_t bufmax_zone; }; static struct ctl_be_block_softc backend_block_softc; @@ -307,12 +307,13 @@ ctl_alloc_seg(struct ctl_be_block_softc *softc, struct size_t len) { -#if (CTLBLK_MAX_SEG > 131072) - if (len <= 131072) - sg->addr = uma_zalloc(softc->buf128_zone, M_WAITOK); - else -#endif - sg->addr = uma_zalloc(softc->buf_zone, M_WAITOK); + if (len <= CTLBLK_MIN_SEG) { + sg->addr = uma_zalloc(softc->bufmin_zone, M_WAITOK); + } else { + KASSERT(len <= CTLBLK_MAX_SEG, + ("Too large alloc %zu > %lu", len, CTLBLK_MAX_SEG)); + sg->addr = uma_zalloc(softc->bufmax_zone, M_WAITOK); + } sg->len = len; } @@ -320,12 +321,13 @@ static void ctl_free_seg(struct ctl_be_block_softc *softc, struct ctl_sg_entry *sg) { -#if (CTLBLK_MAX_SEG > 131072) - if (sg->len <= 131072) - uma_zfree(softc->buf128_zone, sg->addr); - else -#endif - uma_zfree(softc->buf_zone, sg->addr); + if (sg->len <= CTLBLK_MIN_SEG) { + uma_zfree(softc->bufmin_zone, sg->addr); + } else { + KASSERT(sg->len <= CTLBLK_MAX_SEG, + ("Too large free %zu > %lu", sg->len, CTLBLK_MAX_SEG)); + uma_zfree(softc->bufmax_zone, sg->addr); + } } static struct ctl_be_block_io * @@ -1344,7 +1346,7 @@ ctl_be_block_cw_dispatch_ws(struct ctl_be_block_lun *b else pbo = 0; len_left = (uint64_t)lbalen->len * cbe_lun->blocksize; - for (i = 0, lba = 0; i < CTLBLK_MAX_SEGS && len_left > 0; i++) { + for (i = 0, lba = 0; i < CTLBLK_NUM_SEGS && len_left > 0; i++) { /* * Setup the S/G entry for this chunk. */ @@ -1631,7 +1633,7 @@ ctl_be_block_dispatch(struct ctl_be_block_lun *be_lun, * Setup the S/G entry for this chunk. */ ctl_alloc_seg(softc, &beio->sg_segs[i], - min(CTLBLK_MAX_SEG, len_left)); + MIN(CTLBLK_MAX_SEG, len_left)); DPRINTF("segment %d addr %p len %zd\n", i, beio->sg_segs[i].addr, beio->sg_segs[i].len); @@ -2802,12 +2804,11 @@ ctl_be_block_init(void) mtx_init(&softc->lock, "ctlblock", NULL, MTX_DEF); softc->beio_zone = uma_zcreate("beio", sizeof(struct ctl_be_block_io), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - softc->buf_zone = uma_zcreate("ctlblock", CTLBLK_MAX_SEG, + softc->bufmin_zone = uma_zcreate("ctlblockmin", CTLBLK_MIN_SEG, NULL, NULL, NULL, NULL, /*align*/ 0, /*flags*/0); -#if (CTLBLK_MAX_SEG > 131072) - softc->buf128_zone = uma_zcreate("ctlblock128", 131072, - NULL, NULL, NULL, NULL, /*align*/ 0, /*flags*/0); -#endif + if (CTLBLK_MIN_SEG < CTLBLK_MAX_SEG) + softc->bufmax_zone = uma_zcreate("ctlblockmax", CTLBLK_MAX_SEG, + NULL, NULL, NULL, NULL, /*align*/ 0, /*flags*/0); SLIST_INIT(&softc->lun_list); return (0); } @@ -2832,10 +2833,9 @@ ctl_be_block_shutdown(void) mtx_lock(&softc->lock); } mtx_unlock(&softc->lock); - uma_zdestroy(softc->buf_zone); -#if (CTLBLK_MAX_SEG > 131072) - uma_zdestroy(softc->buf128_zone); -#endif + uma_zdestroy(softc->bufmin_zone); + if (CTLBLK_MIN_SEG < CTLBLK_MAX_SEG) + uma_zdestroy(softc->bufmax_zone); uma_zdestroy(softc->beio_zone); mtx_destroy(&softc->lock); sx_destroy(&softc->modify_lock); Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/cam/mmc/mmc_da.c Sat Nov 28 12:12:51 2020 (r368124) @@ -1592,7 +1592,7 @@ sdda_add_part(struct cam_periph *periph, u_int type, c part->disk->d_name = part->name; part->disk->d_drv1 = part; part->disk->d_maxsize = - MIN(MAXPHYS, sdda_get_max_data(periph, + MIN(maxphys, sdda_get_max_data(periph, (union ccb *)&cpi) * mmc_get_sector_size(periph)); part->disk->d_unit = cnt; part->disk->d_flags = 0; Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/cam/nvme/nvme_da.c Sat Nov 28 12:12:51 2020 (r368124) @@ -906,8 +906,8 @@ ndaregister(struct cam_periph *periph, void *arg) maxio = cpi.maxio; /* Honor max I/O size of SIM */ if (maxio == 0) maxio = DFLTPHYS; /* traditional default */ - else if (maxio > MAXPHYS) - maxio = MAXPHYS; /* for safety */ + else if (maxio > maxphys) + maxio = maxphys; /* for safety */ disk->d_maxsize = maxio; flbas_fmt = (nsd->flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) & NVME_NS_DATA_FLBAS_FORMAT_MASK; Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/cam/scsi/scsi_cd.c Sat Nov 28 12:12:51 2020 (r368124) @@ -696,8 +696,8 @@ cdregister(struct cam_periph *periph, void *arg) softc->disk->d_drv1 = periph; if (cpi.maxio == 0) softc->disk->d_maxsize = DFLTPHYS; /* traditional default */ - else if (cpi.maxio > MAXPHYS) - softc->disk->d_maxsize = MAXPHYS; /* for safety */ + else if (cpi.maxio > maxphys) + softc->disk->d_maxsize = maxphys; /* for safety */ else softc->disk->d_maxsize = cpi.maxio; softc->disk->d_flags = 0; Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/cam/scsi/scsi_da.c Sat Nov 28 12:12:51 2020 (r368124) @@ -2921,8 +2921,8 @@ daregister(struct cam_periph *periph, void *arg) softc->disk->d_drv1 = periph; if (cpi.maxio == 0) softc->maxio = DFLTPHYS; /* traditional default */ - else if (cpi.maxio > MAXPHYS) - softc->maxio = MAXPHYS; /* for safety */ + else if (cpi.maxio > maxphys) + softc->maxio = maxphys; /* for safety */ else softc->maxio = cpi.maxio; if (softc->quirks & DA_Q_128KB) @@ -4819,7 +4819,7 @@ dadone_proberc(struct cam_periph *periph, union ccb *d if (maxsector == 0) maxsector = -1; } - if (block_size >= MAXPHYS) { + if (block_size >= maxphys) { xpt_print(periph->path, "unsupportable block size %ju\n", (uintmax_t) block_size); Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/cam/scsi/scsi_pass.c Sat Nov 28 12:12:51 2020 (r368124) @@ -583,15 +583,15 @@ passregister(struct cam_periph *periph, void *arg) periph->periph_name, periph->unit_number); snprintf(softc->io_zone_name, sizeof(softc->io_zone_name), "%s%dIO", periph->periph_name, periph->unit_number); - softc->io_zone_size = MAXPHYS; + softc->io_zone_size = maxphys; knlist_init_mtx(&softc->read_select.si_note, cam_periph_mtx(periph)); xpt_path_inq(&cpi, periph->path); if (cpi.maxio == 0) softc->maxio = DFLTPHYS; /* traditional default */ - else if (cpi.maxio > MAXPHYS) - softc->maxio = MAXPHYS; /* for safety */ + else if (cpi.maxio > maxphys) + softc->maxio = maxphys; /* for safety */ else softc->maxio = cpi.maxio; /* real value */ @@ -1507,7 +1507,7 @@ passmemsetup(struct cam_periph *periph, struct pass_io /* * We allocate buffers in io_zone_size increments for an - * S/G list. This will generally be MAXPHYS. + * S/G list. This will generally be maxphys. */ if (lengths[0] <= softc->io_zone_size) num_segs_needed = 1; Modified: head/sys/cam/scsi/scsi_sa.c ============================================================================== --- head/sys/cam/scsi/scsi_sa.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/cam/scsi/scsi_sa.c Sat Nov 28 12:12:51 2020 (r368124) @@ -2447,12 +2447,12 @@ saregister(struct cam_periph *periph, void *arg) /* * If maxio isn't set, we fall back to DFLTPHYS. Otherwise we take - * the smaller of cpi.maxio or MAXPHYS. + * the smaller of cpi.maxio or maxphys. */ if (cpi.maxio == 0) softc->maxio = DFLTPHYS; - else if (cpi.maxio > MAXPHYS) - softc->maxio = MAXPHYS; + else if (cpi.maxio > maxphys) + softc->maxio = maxphys; else softc->maxio = cpi.maxio; Modified: head/sys/cam/scsi/scsi_sg.c ============================================================================== --- head/sys/cam/scsi/scsi_sg.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/cam/scsi/scsi_sg.c Sat Nov 28 12:12:51 2020 (r368124) @@ -327,8 +327,8 @@ sgregister(struct cam_periph *periph, void *arg) if (cpi.maxio == 0) softc->maxio = DFLTPHYS; /* traditional default */ - else if (cpi.maxio > MAXPHYS) - softc->maxio = MAXPHYS; /* for safety */ + else if (cpi.maxio > maxphys) + softc->maxio = maxphys; /* for safety */ else softc->maxio = cpi.maxio; /* real value */ Modified: head/sys/cam/scsi/scsi_target.c ============================================================================== --- head/sys/cam/scsi/scsi_target.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/cam/scsi/scsi_target.c Sat Nov 28 12:12:51 2020 (r368124) @@ -404,8 +404,8 @@ targenable(struct targ_softc *softc, struct cam_path * } if (cpi.maxio == 0) softc->maxio = DFLTPHYS; /* traditional default */ - else if (cpi.maxio > MAXPHYS) - softc->maxio = MAXPHYS; /* for safety */ + else if (cpi.maxio > maxphys) + softc->maxio = maxphys; /* for safety */ else softc->maxio = cpi.maxio; /* real value */ Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/compat/linprocfs/linprocfs.c Sat Nov 28 12:12:51 2020 (r368124) @@ -1928,8 +1928,8 @@ linprocfs_doauxv(PFS_FILL_ARGS) buflen = resid; if (buflen > IOSIZE_MAX) return (EINVAL); - if (buflen > MAXPHYS) - buflen = MAXPHYS; + if (buflen > maxphys) + buflen = maxphys; if (resid <= 0) return (0); Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/compat/linux/linux_ioctl.c Sat Nov 28 12:12:51 2020 (r368124) @@ -2152,7 +2152,7 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) if (error != 0) return (error); - max_len = MAXPHYS - 1; + max_len = maxphys - 1; CURVNET_SET(TD_TO_VNET(td)); /* handle the 'request buffer size' case */ Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/conf/options Sat Nov 28 12:12:51 2020 (r368124) @@ -602,7 +602,7 @@ INVARIANTS opt_global.h KASSERT_PANIC_OPTIONAL opt_global.h MAXCPU opt_global.h MAXMEMDOM opt_global.h -MAXPHYS opt_global.h +MAXPHYS opt_maxphys.h MCLSHIFT opt_global.h MUTEX_NOINLINE opt_global.h LOCK_PROFILING opt_global.h Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/vdev_geom.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/zfs/vdev_geom.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/contrib/openzfs/module/os/freebsd/zfs/vdev_geom.c Sat Nov 28 12:12:51 2020 (r368124) @@ -379,7 +379,7 @@ vdev_geom_io(struct g_consumer *cp, int *cmds, void ** int i, n_bios, j; size_t bios_size; - maxio = MAXPHYS - (MAXPHYS % cp->provider->sectorsize); + maxio = maxphys - (maxphys % cp->provider->sectorsize); n_bios = 0; /* How many bios are required for all commands ? */ Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c Sat Nov 28 12:12:51 2020 (r368124) @@ -1191,7 +1191,7 @@ zvol_rename_minor(zvol_state_t *zv, const char *newnam args.mda_si_drv2 = zv; if (make_dev_s(&args, &dev, "%s/%s", ZVOL_DRIVER, newname) == 0) { - dev->si_iosize_max = MAXPHYS; + dev->si_iosize_max = maxphys; zsd->zsd_cdev = dev; } } @@ -1327,7 +1327,7 @@ zvol_create_minor_impl(const char *name) dmu_objset_disown(os, B_TRUE, FTAG); goto out_giant; } - dev->si_iosize_max = MAXPHYS; + dev->si_iosize_max = maxphys; zsd->zsd_cdev = dev; } (void) strlcpy(zv->zv_name, name, MAXPATHLEN); Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/ahci/ahci.c Sat Nov 28 12:12:51 2020 (r368124) @@ -1124,8 +1124,7 @@ ahci_dmainit(device_t dev) error = bus_dma_tag_create(bus_get_dma_tag(dev), 2, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, - AHCI_SG_ENTRIES * PAGE_SIZE * ch->numslots, - AHCI_SG_ENTRIES, AHCI_PRD_MAX, + AHCI_SG_ENTRIES * PAGE_SIZE, AHCI_SG_ENTRIES, AHCI_PRD_MAX, 0, busdma_lock_mutex, &ch->mtx, &ch->dma.data_tag); if (error != 0) goto error; @@ -1187,6 +1186,7 @@ ahci_slotsalloc(device_t dev) slot->ch = ch; slot->slot = i; slot->state = AHCI_SLOT_EMPTY; + slot->ct_offset = AHCI_CT_OFFSET + AHCI_CT_SIZE * i; slot->ccb = NULL; callout_init_mtx(&slot->timeout, &ch->mtx, 0); @@ -1642,8 +1642,7 @@ ahci_dmasetprd(void *arg, bus_dma_segment_t *segs, int } KASSERT(nsegs <= AHCI_SG_ENTRIES, ("too many DMA segment entries\n")); /* Get a piece of the workspace for this request */ - ctp = (struct ahci_cmd_tab *) - (ch->dma.work + AHCI_CT_OFFSET + (AHCI_CT_SIZE * slot->slot)); + ctp = (struct ahci_cmd_tab *)(ch->dma.work + slot->ct_offset); /* Fill S/G table */ prd = &ctp->prd_tab[0]; for (i = 0; i < nsegs; i++) { @@ -1672,8 +1671,7 @@ ahci_execute_transaction(struct ahci_slot *slot) uint16_t cmd_flags; /* Get a piece of the workspace for this request */ - ctp = (struct ahci_cmd_tab *) - (ch->dma.work + AHCI_CT_OFFSET + (AHCI_CT_SIZE * slot->slot)); + ctp = (struct ahci_cmd_tab *)(ch->dma.work + slot->ct_offset); /* Setup the FIS for this request */ if (!(fis_size = ahci_setup_fis(ch, ctp, ccb, slot->slot))) { device_printf(ch->dev, "Setting up SATA FIS failed\n"); @@ -1710,8 +1708,7 @@ ahci_execute_transaction(struct ahci_slot *slot) softreset = 0; clp->bytecount = 0; clp->cmd_flags = htole16(cmd_flags); - clp->cmd_table_phys = htole64(ch->dma.work_bus + AHCI_CT_OFFSET + - (AHCI_CT_SIZE * slot->slot)); + clp->cmd_table_phys = htole64(ch->dma.work_bus + slot->ct_offset); bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); bus_dmamap_sync(ch->dma.rfis_tag, ch->dma.rfis_map, @@ -2868,7 +2865,7 @@ ahciaction(struct cam_sim *sim, union ccb *ccb) cpi->transport_version = XPORT_VERSION_UNSPECIFIED; cpi->protocol = PROTO_ATA; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; - cpi->maxio = MAXPHYS; + cpi->maxio = ctob(AHCI_SG_ENTRIES - 1); /* ATI SB600 can't handle 256 sectors with FPDMA (NCQ). */ if (ch->quirks & AHCI_Q_MAXIO_64K) cpi->maxio = min(cpi->maxio, 128 * 512); Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/ahci/ahci.h Sat Nov 28 12:12:51 2020 (r368124) @@ -310,13 +310,8 @@ #define AHCI_P_DEVSLP_DM 0x0e000000 #define AHCI_P_DEVSLP_DM_SHIFT 25 -/* Just to be sure, if building as module. */ -#if MAXPHYS < 512 * 1024 -#undef MAXPHYS -#define MAXPHYS 512 * 1024 -#endif /* Pessimistic prognosis on number of required S/G entries */ -#define AHCI_SG_ENTRIES (roundup(btoc(MAXPHYS) + 1, 8)) +#define AHCI_SG_ENTRIES MIN(roundup(btoc(maxphys) + 1, 8), 65528) /* Command list. 32 commands. First, 1Kbyte aligned. */ #define AHCI_CL_OFFSET 0 #define AHCI_CL_SIZE 32 @@ -344,7 +339,7 @@ struct ahci_cmd_tab { u_int8_t cfis[64]; u_int8_t acmd[32]; u_int8_t reserved[32]; - struct ahci_dma_prd prd_tab[AHCI_SG_ENTRIES]; + struct ahci_dma_prd prd_tab[]; } __packed; struct ahci_cmd_list { @@ -394,6 +389,7 @@ struct ahci_slot { struct ahci_channel *ch; /* Channel */ u_int8_t slot; /* Number of this slot */ enum ahci_slot_states state; /* Slot state */ + u_int ct_offset; /* cmd_tab offset */ union ccb *ccb; /* CCB occupying slot */ struct ata_dmaslot dma; /* DMA data of this slot */ struct callout timeout; /* Execution timeout */ Modified: head/sys/dev/ahci/ahciem.c ============================================================================== --- head/sys/dev/ahci/ahciem.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/ahci/ahciem.c Sat Nov 28 12:12:51 2020 (r368124) @@ -641,7 +641,7 @@ ahciemaction(struct cam_sim *sim, union ccb *ccb) cpi->transport_version = XPORT_VERSION_UNSPECIFIED; cpi->protocol = PROTO_ATA; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; - cpi->maxio = MAXPHYS; + cpi->maxio = maxphys; cpi->hba_vendor = pci_get_vendor(parent); cpi->hba_device = pci_get_device(parent); cpi->hba_subvendor = pci_get_subvendor(parent); Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/ata/ata-all.c Sat Nov 28 12:12:51 2020 (r368124) @@ -139,7 +139,7 @@ ata_attach(device_t dev) if (ch->flags & ATA_SATA) ch->user[i].bytecount = 8192; else - ch->user[i].bytecount = MAXPHYS; + ch->user[i].bytecount = 65536; ch->user[i].caps = 0; ch->curr[i] = ch->user[i]; if (ch->flags & ATA_SATA) { Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/ata/ata-all.h Sat Nov 28 12:12:51 2020 (r368124) @@ -152,7 +152,7 @@ #define ATA_SACTIVE 16 /* DMA register defines */ -#define ATA_DMA_ENTRIES 256 +#define ATA_DMA_ENTRIES MAX(17, btoc(maxphys) + 1) #define ATA_DMA_EOT 0x80000000 #define ATA_BMCMD_PORT 17 Modified: head/sys/dev/ata/ata-dma.c ============================================================================== --- head/sys/dev/ata/ata-dma.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/ata/ata-dma.c Sat Nov 28 12:12:51 2020 (r368124) @@ -87,7 +87,7 @@ ata_dmainit(device_t dev) if (ch->dma.segsize == 0) ch->dma.segsize = 65536; if (ch->dma.max_iosize == 0) - ch->dma.max_iosize = MIN((ATA_DMA_ENTRIES - 1) * PAGE_SIZE, MAXPHYS); + ch->dma.max_iosize = (ATA_DMA_ENTRIES - 1) * PAGE_SIZE; if (ch->dma.max_address == 0) ch->dma.max_address = BUS_SPACE_MAXADDR_32BIT; if (ch->dma.dma_slots == 0) Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/firewire/sbp.c Sat Nov 28 12:12:51 2020 (r368124) @@ -71,7 +71,7 @@ * because of CAM_SCSI2_MAXLUN in cam_xpt.c */ #define SBP_NUM_LUNS 64 -#define SBP_MAXPHYS MIN(MAXPHYS, (512*1024) /* 512KB */) +#define SBP_MAXPHYS (128 * 1024) #define SBP_DMA_SIZE PAGE_SIZE #define SBP_LOGIN_SIZE sizeof(struct sbp_login_res) #define SBP_QUEUE_LEN ((SBP_DMA_SIZE - SBP_LOGIN_SIZE) / sizeof(struct sbp_ocb)) Modified: head/sys/dev/flash/cqspi.c ============================================================================== --- head/sys/dev/flash/cqspi.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/flash/cqspi.c Sat Nov 28 12:12:51 2020 (r368124) @@ -721,9 +721,9 @@ cqspi_attach(device_t dev) return (ENXIO); } - xdma_prep_sg(sc->xchan_tx, TX_QUEUE_SIZE, MAXPHYS, 8, 16, 0, + xdma_prep_sg(sc->xchan_tx, TX_QUEUE_SIZE, maxphys, 8, 16, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR); - xdma_prep_sg(sc->xchan_rx, TX_QUEUE_SIZE, MAXPHYS, 8, 16, 0, + xdma_prep_sg(sc->xchan_rx, TX_QUEUE_SIZE, maxphys, 8, 16, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR); cqspi_init(sc); Modified: head/sys/dev/isci/scil/sci_controller_constants.h ============================================================================== --- head/sys/dev/isci/scil/sci_controller_constants.h Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/isci/scil/sci_controller_constants.h Sat Nov 28 12:12:51 2020 (r368124) @@ -157,7 +157,7 @@ extern "C" { * posted to hardware always contain pairs of elements (with second * element set to zeroes if not needed). */ -#define __MAXPHYS_ELEMENTS ((MAXPHYS / PAGE_SIZE) + 1) +#define __MAXPHYS_ELEMENTS ((128 * 1024 / PAGE_SIZE) + 1) #define SCI_MAX_SCATTER_GATHER_ELEMENTS ((__MAXPHYS_ELEMENTS + 1) & ~0x1) #endif Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/iscsi/iscsi.c Sat Nov 28 12:12:51 2020 (r368124) @@ -2407,7 +2407,7 @@ iscsi_action(struct cam_sim *sim, union ccb *ccb) cpi->transport_version = 0; cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_SPC3; - cpi->maxio = MAXPHYS; + cpi->maxio = maxphys; cpi->ccb_h.status = CAM_REQ_CMP; break; } Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/md/md.c Sat Nov 28 12:12:51 2020 (r368124) @@ -960,9 +960,10 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) piov = auio.uio_iov; } else if ((bp->bio_flags & BIO_UNMAPPED) != 0) { pb = uma_zalloc(md_pbuf_zone, M_WAITOK); + MPASS((pb->b_flags & B_MAXPHYS) != 0); bp->bio_resid = len; unmapped_step: - npages = atop(min(MAXPHYS, round_page(len + (ma_offs & + npages = atop(min(maxphys, round_page(len + (ma_offs & PAGE_MASK)))); iolen = min(ptoa(npages) - (ma_offs & PAGE_MASK), len); KASSERT(iolen > 0, ("zero iolen")); @@ -1684,7 +1685,7 @@ kern_mdattach_locked(struct thread *td, struct md_req sectsize = DEV_BSIZE; else sectsize = mdr->md_sectorsize; - if (sectsize > MAXPHYS || mdr->md_mediasize < sectsize) + if (sectsize > maxphys || mdr->md_mediasize < sectsize) return (EINVAL); if (mdr->md_options & MD_AUTOUNIT) sc = mdnew(-1, &error, mdr->md_type); Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/mfi/mfi.c Sat Nov 28 12:12:51 2020 (r368124) @@ -457,7 +457,7 @@ mfi_attach(struct mfi_softc *sc) /* * Get information needed for sizing the contiguous memory for the * frame pool. Size down the sgl parameter since we know that - * we will never need more than what's required for MAXPHYS. + * we will never need more than what's required for MFI_MAXPHYS. * It would be nice if these constants were available at runtime * instead of compile time. */ Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/mpr/mpr.c Sat Nov 28 12:12:51 2020 (r368124) @@ -436,14 +436,14 @@ mpr_resize_queues(struct mpr_softc *sc) /* * If I/O size limitation requested then use it and pass up to CAM. - * If not, use MAXPHYS as an optimization hint, but report HW limit. + * If not, use maxphys as an optimization hint, but report HW limit. */ if (sc->max_io_pages > 0) { maxio = min(maxio, sc->max_io_pages * PAGE_SIZE); sc->maxio = maxio; } else { sc->maxio = maxio; - maxio = min(maxio, MAXPHYS); + maxio = min(maxio, maxphys); } sc->num_chains = (maxio / PAGE_SIZE + sges_per_frame - 2) / Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/mps/mps.c Sat Nov 28 12:12:51 2020 (r368124) @@ -418,14 +418,14 @@ mps_resize_queues(struct mps_softc *sc) /* * If I/O size limitation requested, then use it and pass up to CAM. - * If not, use MAXPHYS as an optimization hint, but report HW limit. + * If not, use maxphys as an optimization hint, but report HW limit. */ if (sc->max_io_pages > 0) { maxio = min(maxio, sc->max_io_pages * PAGE_SIZE); sc->maxio = maxio; } else { sc->maxio = maxio; - maxio = min(maxio, MAXPHYS); + maxio = min(maxio, maxphys); } sc->num_chains = (maxio / PAGE_SIZE + sges_per_frame - 2) / Modified: head/sys/dev/mpt/mpt.c ============================================================================== --- head/sys/dev/mpt/mpt.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/mpt/mpt.c Sat Nov 28 12:12:51 2020 (r368124) @@ -2691,7 +2691,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, int tn, int n /* * Use this as the basis for reporting the maximum I/O size to CAM. */ - mpt->max_cam_seg_cnt = min(mpt->max_seg_cnt, (MAXPHYS / PAGE_SIZE) + 1); + mpt->max_cam_seg_cnt = min(mpt->max_seg_cnt, btoc(maxphys) + 1); /* XXX Lame Locking! */ MPT_UNLOCK(mpt); Modified: head/sys/dev/mpt/mpt.h ============================================================================== --- head/sys/dev/mpt/mpt.h Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/mpt/mpt.h Sat Nov 28 12:12:51 2020 (r368124) @@ -668,7 +668,7 @@ struct mpt_softc { bus_addr_t request_phys; /* BusAddr of request memory */ uint32_t max_seg_cnt; /* calculated after IOC facts */ - uint32_t max_cam_seg_cnt;/* calculated from MAXPHYS*/ + uint32_t max_cam_seg_cnt;/* calculated from maxphys */ /* * Hardware management Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/mrsas/mrsas.c Sat Nov 28 12:12:51 2020 (r368124) @@ -1922,9 +1922,9 @@ mrsas_alloc_mem(struct mrsas_softc *sc) BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MAXPHYS, /* maxsize */ + maxphys, /* maxsize */ sc->max_num_sge, /* nsegments */ - MAXPHYS, /* maxsegsize */ + maxphys, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &sc->mrsas_parent_tag /* tag */ @@ -2154,9 +2154,9 @@ mrsas_alloc_mem(struct mrsas_softc *sc) BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, - MAXPHYS, + maxphys, sc->max_num_sge, /* nsegments */ - MAXPHYS, + maxphys, BUS_DMA_ALLOCNOW, busdma_lock_mutex, &sc->io_lock, Modified: head/sys/dev/mvs/mvs.c ============================================================================== --- head/sys/dev/mvs/mvs.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/mvs/mvs.c Sat Nov 28 12:12:51 2020 (r368124) @@ -370,8 +370,7 @@ mvs_dmainit(device_t dev) if (bus_dma_tag_create(bus_get_dma_tag(dev), 2, MVS_EPRD_MAX, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, - MVS_SG_ENTRIES * PAGE_SIZE * MVS_MAX_SLOTS, - MVS_SG_ENTRIES, MVS_EPRD_MAX, + MVS_SG_ENTRIES * PAGE_SIZE, MVS_SG_ENTRIES, MVS_EPRD_MAX, 0, busdma_lock_mutex, &ch->mtx, &ch->dma.data_tag)) { goto error; } @@ -438,6 +437,7 @@ mvs_slotsalloc(device_t dev) slot->dev = dev; slot->slot = i; slot->state = MVS_SLOT_EMPTY; + slot->eprd_offset = MVS_EPRD_OFFSET + MVS_EPRD_SIZE * i; slot->ccb = NULL; callout_init_mtx(&slot->timeout, &ch->mtx, 0); @@ -1286,8 +1286,7 @@ mvs_dmasetprd(void *arg, bus_dma_segment_t *segs, int } else { slot->dma.addr = 0; /* Get a piece of the workspace for this EPRD */ - eprd = (struct mvs_eprd *) - (ch->dma.workrq + MVS_EPRD_OFFSET + (MVS_EPRD_SIZE * slot->slot)); + eprd = (struct mvs_eprd *)(ch->dma.workrq + slot->eprd_offset); /* Fill S/G table */ for (i = 0; i < nsegs; i++) { eprd[i].prdbal = htole32(segs[i].ds_addr); @@ -1405,8 +1404,7 @@ mvs_legacy_execute_transaction(struct mvs_slot *slot) DELAY(10); if (ch->basic_dma) { /* Start basic DMA. */ - eprd = ch->dma.workrq_bus + MVS_EPRD_OFFSET + - (MVS_EPRD_SIZE * slot->slot); + eprd = ch->dma.workrq_bus + slot->eprd_offset; ATA_OUTL(ch->r_mem, DMA_DTLBA, eprd); ATA_OUTL(ch->r_mem, DMA_DTHBA, (eprd >> 16) >> 16); ATA_OUTL(ch->r_mem, DMA_C, DMA_C_START | @@ -1433,7 +1431,7 @@ mvs_execute_transaction(struct mvs_slot *slot) int i; /* Get address of the prepared EPRD */ - eprd = ch->dma.workrq_bus + MVS_EPRD_OFFSET + (MVS_EPRD_SIZE * slot->slot); + eprd = ch->dma.workrq_bus + slot->eprd_offset; /* Prepare CRQB. Gen IIe uses different CRQB format. */ if (ch->quirks & MVS_Q_GENIIE) { crqb2e = (struct mvs_crqb_gen2e *) @@ -2423,7 +2421,7 @@ mvsaction(struct cam_sim *sim, union ccb *ccb) cpi->transport_version = XPORT_VERSION_UNSPECIFIED; cpi->protocol = PROTO_ATA; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; - cpi->maxio = MAXPHYS; + cpi->maxio = maxphys; if ((ch->quirks & MVS_Q_SOC) == 0) { cpi->hba_vendor = pci_get_vendor(parent); cpi->hba_device = pci_get_device(parent); Modified: head/sys/dev/mvs/mvs.h ============================================================================== --- head/sys/dev/mvs/mvs.h Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/mvs/mvs.h Sat Nov 28 12:12:51 2020 (r368124) @@ -392,7 +392,7 @@ #define MVS_MAX_SLOTS 32 /* Pessimistic prognosis on number of required S/G entries */ -#define MVS_SG_ENTRIES (btoc(MAXPHYS) + 1) +#define MVS_SG_ENTRIES (btoc(maxphys) + 1) /* EDMA Command Request Block (CRQB) Data */ struct mvs_crqb { @@ -505,6 +505,7 @@ struct mvs_slot { int slot; /* Number of this slot */ int tag; /* Used command tag */ enum mvs_slot_states state; /* Slot state */ + u_int eprd_offset; /* EPRD offset */ union ccb *ccb; /* CCB occupying slot */ struct ata_dmaslot dma; /* DMA data of this slot */ struct callout timeout; /* Execution timeout */ Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/nvme/nvme.h Sat Nov 28 12:12:51 2020 (r368124) @@ -60,7 +60,7 @@ #define NVME_GLOBAL_NAMESPACE_TAG ((uint32_t)0xFFFFFFFF) /* Cap nvme to 1MB transfers driver explodes with larger sizes */ -#define NVME_MAX_XFER_SIZE (MAXPHYS < (1<<20) ? MAXPHYS : (1<<20)) +#define NVME_MAX_XFER_SIZE (maxphys < (1<<20) ? maxphys : (1<<20)) /* Register field definitions */ #define NVME_CAP_LO_REG_MQES_SHIFT (0) Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/nvme/nvme_ctrlr.c Sat Nov 28 12:12:51 2020 (r368124) @@ -1248,13 +1248,13 @@ nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctr if (pt->len > 0) { /* * vmapbuf calls vm_fault_quick_hold_pages which only maps full - * pages. Ensure this request has fewer than MAXPHYS bytes when + * pages. Ensure this request has fewer than maxphys bytes when * extended to full pages. */ addr = (vm_offset_t)pt->buf; end = round_page(addr + pt->len); addr = trunc_page(addr); - if (end - addr > MAXPHYS) + if (end - addr > maxphys) return EIO; if (pt->len > ctrlr->max_xfer_size) { Modified: head/sys/dev/pms/freebsd/driver/ini/src/agdef.h ============================================================================== --- head/sys/dev/pms/freebsd/driver/ini/src/agdef.h Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/pms/freebsd/driver/ini/src/agdef.h Sat Nov 28 12:12:51 2020 (r368124) @@ -62,7 +62,7 @@ EW 09-17-2004 1.0.0 Constant definitions #define AGTIAPI_MAX_DEVICE_7H 256 /*Max devices per channel in 7H */ #define AGTIAPI_MAX_DEVICE_8H 512 /*Max devices per channel in 8H*/ #define AGTIAPI_MAX_CAM_Q_DEPTH 1024 -#define AGTIAPI_NSEGS (MAXPHYS / PAGE_SIZE) +#define AGTIAPI_NSEGS (maxphys / PAGE_SIZE) /* ** Adapter specific defines */ Modified: head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c ============================================================================== --- head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Sat Nov 28 12:12:51 2020 (r368124) @@ -1623,8 +1623,8 @@ int agtiapi_alloc_requests( struct agtiapi_softc *pmcs nsegs = AGTIAPI_NSEGS; rsize = AGTIAPI_MAX_DMA_SEGS; // 128 - AGTIAPI_PRINTK( "agtiapi_alloc_requests: MAXPHYS 0x%x PAGE_SIZE 0x%x \n", - MAXPHYS, PAGE_SIZE ); + AGTIAPI_PRINTK( "agtiapi_alloc_requests: maxphys 0x%lx PAGE_SIZE 0x%x \n", + maxphys, PAGE_SIZE ); AGTIAPI_PRINTK( "agtiapi_alloc_requests: nsegs %d rsize %d \n", nsegs, rsize ); // 32, 128 // This is for csio->data_ptr Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/sdhci/sdhci.c Sat Nov 28 12:12:51 2020 (r368124) @@ -722,19 +722,19 @@ sdhci_dma_alloc(struct sdhci_slot *slot) int err; if (!(slot->quirks & SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY)) { - if (MAXPHYS <= 1024 * 4) + if (maxphys <= 1024 * 4) slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_4K; - else if (MAXPHYS <= 1024 * 8) + else if (maxphys <= 1024 * 8) slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_8K; - else if (MAXPHYS <= 1024 * 16) + else if (maxphys <= 1024 * 16) slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_16K; - else if (MAXPHYS <= 1024 * 32) + else if (maxphys <= 1024 * 32) slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_32K; - else if (MAXPHYS <= 1024 * 64) + else if (maxphys <= 1024 * 64) slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_64K; - else if (MAXPHYS <= 1024 * 128) + else if (maxphys <= 1024 * 128) slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_128K; - else if (MAXPHYS <= 1024 * 256) + else if (maxphys <= 1024 * 256) slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_256K; else slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_512K; @@ -2534,7 +2534,7 @@ sdhci_cam_action(struct cam_sim *sim, union ccb *ccb) switch (ccb->ccb_h.func_code) { case XPT_PATH_INQ: - mmc_path_inq(&ccb->cpi, "Deglitch Networks", sim, MAXPHYS); + mmc_path_inq(&ccb->cpi, "Deglitch Networks", sim, maxphys); break; case XPT_GET_TRAN_SETTINGS: Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/siis/siis.c Sat Nov 28 12:12:51 2020 (r368124) @@ -688,8 +688,7 @@ siis_dmainit(device_t dev) if (bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, - SIIS_SG_ENTRIES * PAGE_SIZE * SIIS_MAX_SLOTS, - SIIS_SG_ENTRIES, 0xFFFFFFFF, + SIIS_SG_ENTRIES * PAGE_SIZE, SIIS_SG_ENTRIES, 0xFFFFFFFF, 0, busdma_lock_mutex, &ch->mtx, &ch->dma.data_tag)) { goto error; } @@ -745,6 +744,7 @@ siis_slotsalloc(device_t dev) slot->dev = dev; slot->slot = i; slot->state = SIIS_SLOT_EMPTY; + slot->prb_offset = SIIS_PRB_SIZE * i; slot->ccb = NULL; callout_init_mtx(&slot->timeout, &ch->mtx, 0); @@ -1034,8 +1034,7 @@ siis_dmasetprd(void *arg, bus_dma_segment_t *segs, int slot->dma.nsegs = nsegs; if (nsegs != 0) { /* Get a piece of the workspace for this request */ - ctp = (struct siis_cmd *)(ch->dma.work + SIIS_CT_OFFSET + - (SIIS_CT_SIZE * slot->slot)); + ctp = (struct siis_cmd *)(ch->dma.work + slot->prb_offset); /* Fill S/G table */ if (slot->ccb->ccb_h.func_code == XPT_ATA_IO) prd = &ctp->u.ata.prd[0]; @@ -1066,8 +1065,7 @@ siis_execute_transaction(struct siis_slot *slot) mtx_assert(&ch->mtx, MA_OWNED); /* Get a piece of the workspace for this request */ - ctp = (struct siis_cmd *) - (ch->dma.work + SIIS_CT_OFFSET + (SIIS_CT_SIZE * slot->slot)); + ctp = (struct siis_cmd *)(ch->dma.work + slot->prb_offset); ctp->control = 0; ctp->protocol_override = 0; ctp->transfer_count = 0; @@ -1117,8 +1115,7 @@ siis_execute_transaction(struct siis_slot *slot) /* Issue command to the controller. */ slot->state = SIIS_SLOT_RUNNING; ch->rslots |= (1 << slot->slot); - prb_bus = ch->dma.work_bus + - SIIS_CT_OFFSET + (SIIS_CT_SIZE * slot->slot); + prb_bus = ch->dma.work_bus + slot->prb_offset; ATA_OUTL(ch->r_mem, SIIS_P_CACTL(slot->slot), prb_bus); ATA_OUTL(ch->r_mem, SIIS_P_CACTH(slot->slot), prb_bus >> 32); /* Start command execution timeout */ @@ -1967,7 +1964,7 @@ siisaction(struct cam_sim *sim, union ccb *ccb) cpi->transport_version = XPORT_VERSION_UNSPECIFIED; cpi->protocol = PROTO_ATA; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; - cpi->maxio = MAXPHYS; + cpi->maxio = maxphys; cpi->hba_vendor = pci_get_vendor(parent); cpi->hba_device = pci_get_device(parent); cpi->hba_subvendor = pci_get_subvendor(parent); Modified: head/sys/dev/siis/siis.h ============================================================================== --- head/sys/dev/siis/siis.h Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/siis/siis.h Sat Nov 28 12:12:51 2020 (r368124) @@ -263,18 +263,12 @@ #define SIIS_OFFSET 0x100 #define SIIS_STEP 0x80 -/* Just to be sure, if building as module. */ -#if MAXPHYS < 512 * 1024 -#undef MAXPHYS -#define MAXPHYS 512 * 1024 -#endif /* Pessimistic prognosis on number of required S/G entries */ -#define SIIS_SG_ENTRIES (roundup(btoc(MAXPHYS), 4) + 1) -/* Command tables. Up to 32 commands, Each, 128byte aligned. */ -#define SIIS_CT_OFFSET 0 -#define SIIS_CT_SIZE (32 + 16 + SIIS_SG_ENTRIES * 16) +#define SIIS_SG_ENTRIES (roundup(btoc(maxphys), 4) + 1) +/* Port Request Block + S/G entries. 128byte aligned. */ +#define SIIS_PRB_SIZE (32 + 16 + SIIS_SG_ENTRIES * 16) /* Total main work area. */ -#define SIIS_WORK_SIZE (SIIS_CT_OFFSET + SIIS_CT_SIZE * SIIS_MAX_SLOTS) +#define SIIS_WORK_SIZE (SIIS_PRB_SIZE * SIIS_MAX_SLOTS) struct siis_dma_prd { u_int64_t dba; @@ -287,12 +281,12 @@ struct siis_dma_prd { } __packed; struct siis_cmd_ata { - struct siis_dma_prd prd[1 + SIIS_SG_ENTRIES]; + struct siis_dma_prd prd[2]; } __packed; struct siis_cmd_atapi { u_int8_t ccb[16]; - struct siis_dma_prd prd[SIIS_SG_ENTRIES]; + struct siis_dma_prd prd[1]; } __packed; struct siis_cmd { @@ -349,6 +343,7 @@ struct siis_slot { device_t dev; /* Device handle */ u_int8_t slot; /* Number of this slot */ enum siis_slot_states state; /* Slot state */ + u_int prb_offset; /* PRB offset */ union ccb *ccb; /* CCB occupying slot */ struct ata_dmaslot dma; /* DMA data of this slot */ struct callout timeout; /* Execution timeout */ Modified: head/sys/dev/sym/sym_conf.h ============================================================================== --- head/sys/dev/sym/sym_conf.h Sat Nov 28 10:38:00 2020 (r368123) +++ head/sys/dev/sym/sym_conf.h Sat Nov 28 12:12:51 2020 (r368124) @@ -95,9 +95,9 @@ * Max number of scatter/gather entries for an I/O. * Each entry costs 8 bytes in the internal CCB data structure. * We use at most 33 segments but also no more than required for handling - * MAXPHYS. + * legacy MAXPHYS == 128 * 1024. */ -#define SYM_CONF_MAX_SG (MIN(33, (MAXPHYS / PAGE_SIZE) + 1)) +#define SYM_CONF_MAX_SG (MIN(33, (128 * 1024 / PAGE_SIZE) + 1)) /* * Max number of targets. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Nov 28 12:19:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD0E847F3B5; Sat, 28 Nov 2020 12:19:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjrCF5F3rz3mxB; Sat, 28 Nov 2020 12:19:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6DD426FCC; Sat, 28 Nov 2020 12:19:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ASCJLt3007577; Sat, 28 Nov 2020 12:19:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ASCJKkh007573; Sat, 28 Nov 2020 12:19:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011281219.0ASCJKkh007573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 28 Nov 2020 12:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368125 - in head/lib: libc/gen libc/include libthr/thread X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/lib: libc/gen libc/include libthr/thread X-SVN-Commit-Revision: 368125 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 12:19:21 -0000 Author: kib Date: Sat Nov 28 12:19:20 2020 New Revision: 368125 URL: https://svnweb.freebsd.org/changeset/base/368125 Log: libc: Add pthread_attr_get_np(3) stub, reporting ESRCH. This seems to be required by recent clang asan. I do not see other way than put the symbol under FBSD_1.0 version. PR: 251112 Reported by: Andrew Stitcher Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D27389 Modified: head/lib/libc/gen/Symbol.map head/lib/libc/gen/_pthread_stubs.c head/lib/libc/include/libc_private.h head/lib/libthr/thread/thr_init.c Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Sat Nov 28 12:12:51 2020 (r368124) +++ head/lib/libc/gen/Symbol.map Sat Nov 28 12:19:20 2020 (r368125) @@ -6,6 +6,7 @@ FBSD_1.0 { __xuname; pthread_atfork; pthread_attr_destroy; + pthread_attr_get_np; pthread_attr_getdetachstate; pthread_attr_getguardsize; pthread_attr_getinheritsched; Modified: head/lib/libc/gen/_pthread_stubs.c ============================================================================== --- head/lib/libc/gen/_pthread_stubs.c Sat Nov 28 12:12:51 2020 (r368124) +++ head/lib/libc/gen/_pthread_stubs.c Sat Nov 28 12:19:20 2020 (r368125) @@ -59,6 +59,7 @@ static int stub_zero(void); static int stub_fail(void); static int stub_true(void); static void stub_exit(void); +static int stub_esrch(void); #define PJT_DUAL_ENTRY(entry) \ (pthread_func_t)entry, (pthread_func_t)entry @@ -131,6 +132,7 @@ pthread_func_entry_t __thr_jtable[PJT_MAX] = { [PJT_MUTEXATTR_GETROBUST] = {PJT_DUAL_ENTRY(stub_zero)}, [PJT_MUTEXATTR_SETROBUST] = {PJT_DUAL_ENTRY(stub_zero)}, [PJT_GETTHREADID_NP] = {PJT_DUAL_ENTRY(stub_zero)}, + [PJT_ATTR_GET_NP] = {PJT_DUAL_ENTRY(stub_esrch)}, }; /* @@ -288,6 +290,7 @@ STUB_FUNC3(__pthread_cleanup_push_imp, PJT_CLEANUP_PUS void *, void *) STUB_FUNC1(_pthread_cancel_enter, PJT_CANCEL_ENTER, void, int) STUB_FUNC1(_pthread_cancel_leave, PJT_CANCEL_LEAVE, void, int) +STUB_FUNC2(pthread_attr_get_np, PJT_ATTR_GET_NP, int, pthread_t, pthread_attr_t *) static int stub_zero(void) @@ -329,4 +332,10 @@ static void stub_exit(void) { exit(0); +} + +static int +stub_esrch(void) +{ + return (ESRCH); } Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Sat Nov 28 12:12:51 2020 (r368124) +++ head/lib/libc/include/libc_private.h Sat Nov 28 12:19:20 2020 (r368125) @@ -177,6 +177,7 @@ typedef enum { PJT_MUTEXATTR_GETROBUST, PJT_MUTEXATTR_SETROBUST, PJT_GETTHREADID_NP, + PJT_ATTR_GET_NP, PJT_MAX } pjt_index_t; Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Sat Nov 28 12:12:51 2020 (r368124) +++ head/lib/libthr/thread/thr_init.c Sat Nov 28 12:19:20 2020 (r368125) @@ -271,6 +271,7 @@ static pthread_func_t jmp_table[][2] = { [PJT_MUTEXATTR_GETROBUST] = {DUAL_ENTRY(_thr_mutexattr_getrobust)}, [PJT_MUTEXATTR_SETROBUST] = {DUAL_ENTRY(_thr_mutexattr_setrobust)}, [PJT_GETTHREADID_NP] = {DUAL_ENTRY(_thr_getthreadid_np)}, + [PJT_ATTR_GET_NP] = {DUAL_ENTRY(_thr_attr_get_np)}, }; static int init_once = 0; From owner-svn-src-all@freebsd.org Sat Nov 28 15:00:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3A5B4A330C; Sat, 28 Nov 2020 15:00:10 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cjvmp59x8z3vVn; Sat, 28 Nov 2020 15:00:10 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4C1D2935E; Sat, 28 Nov 2020 15:00:10 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ASF0ACE006676; Sat, 28 Nov 2020 15:00:10 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ASF09oD006670; Sat, 28 Nov 2020 15:00:09 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202011281500.0ASF09oD006670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 28 Nov 2020 15:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368126 - in head/sys: arm/arm arm/include conf X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head/sys: arm/arm arm/include conf X-SVN-Commit-Revision: 368126 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 15:00:10 -0000 Author: mmel Date: Sat Nov 28 15:00:08 2020 New Revision: 368126 URL: https://svnweb.freebsd.org/changeset/base/368126 Log: Remove now unused armv4 and not-INTRNG files. Deleted: head/sys/arm/arm/identcpu-v4.c head/sys/arm/arm/intr.c head/sys/arm/arm/locore-v4.S head/sys/arm/arm/pmap-v4.c head/sys/arm/arm/swtch-v4.S head/sys/arm/arm/trap-v4.c head/sys/arm/include/atomic-v4.h head/sys/arm/include/cpu-v4.h head/sys/arm/include/pmap-v4.h head/sys/arm/include/pte-v4.h Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/locore.S head/sys/arm/include/atomic.h head/sys/arm/include/cpu.h head/sys/arm/include/pmap.h head/sys/conf/files.arm Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Sat Nov 28 12:19:20 2020 (r368125) +++ head/sys/arm/arm/cpufunc.c Sat Nov 28 15:00:08 2020 (r368126) @@ -256,9 +256,6 @@ struct cpu_functions cortexa_cpufuncs = { struct cpu_functions cpufuncs; u_int cputype; -#if __ARM_ARCH <= 5 -u_int cpu_reset_needs_v4_MMU_disable; /* flag used in locore-v4.s */ -#endif #if defined (CPU_ARM9E) || \ defined(CPU_ARM1176) || \ Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Sat Nov 28 12:19:20 2020 (r368125) +++ head/sys/arm/arm/locore.S Sat Nov 28 15:00:08 2020 (r368126) @@ -34,8 +34,4 @@ #include -#if __ARM_ARCH >= 6 #include "locore-v6.S" -#else -#include "locore-v4.S" -#endif Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Sat Nov 28 12:19:20 2020 (r368125) +++ head/sys/arm/include/atomic.h Sat Nov 28 15:00:08 2020 (r368126) @@ -49,11 +49,7 @@ #include #endif -#if __ARM_ARCH >= 6 #include -#else /* < armv6 */ -#include -#endif /* Arch >= v6 */ static __inline u_long atomic_swap_long(volatile u_long *p, u_long v) Modified: head/sys/arm/include/cpu.h ============================================================================== --- head/sys/arm/include/cpu.h Sat Nov 28 12:19:20 2020 (r368125) +++ head/sys/arm/include/cpu.h Sat Nov 28 15:00:08 2020 (r368126) @@ -11,11 +11,7 @@ void cpu_halt(void); void swi_vm(void *); #ifdef _KERNEL -#if __ARM_ARCH >= 6 #include -#else -#include -#endif /* __ARM_ARCH >= 6 */ static __inline uint64_t get_cyclecount(void) Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Sat Nov 28 12:19:20 2020 (r368125) +++ head/sys/arm/include/pmap.h Sat Nov 28 15:00:08 2020 (r368126) @@ -32,11 +32,7 @@ #ifndef _MACHINE_PMAP_H_ #define _MACHINE_PMAP_H_ -#if __ARM_ARCH >= 6 #include -#else -#include -#endif #ifdef _KERNEL #include Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Sat Nov 28 12:19:20 2020 (r368125) +++ head/sys/conf/files.arm Sat Nov 28 15:00:08 2020 (r368126) @@ -19,7 +19,7 @@ arm/arm/cpufunc_asm_armv7.S optional cpu_cortexa | cpu arm/arm/cpufunc_asm_pj4b.S optional cpu_mv_pj4b arm/arm/cpufunc_asm_sheeva.S optional cpu_arm9e arm/arm/cpuinfo.c standard -arm/arm/cpu_asm-v6.S optional armv7 | armv6 +arm/arm/cpu_asm-v6.S standard arm/arm/db_disasm.c optional ddb arm/arm/db_interface.c optional ddb arm/arm/db_trace.c optional ddb @@ -37,14 +37,12 @@ arm/arm/gdb_machdep.c optional gdb arm/arm/generic_timer.c optional generic_timer arm/arm/gic.c optional gic arm/arm/gic_fdt.c optional gic fdt -arm/arm/identcpu-v4.c optional !armv7 !armv6 -arm/arm/identcpu-v6.c optional armv7 | armv6 +arm/arm/identcpu-v6.c standard arm/arm/in_cksum.c optional inet | inet6 arm/arm/in_cksum_arm.S optional inet | inet6 -arm/arm/intr.c optional !intrng -kern/subr_intr.c optional intrng +kern/subr_intr.c standard arm/arm/locore.S standard no-obj -arm/arm/hypervisor-stub.S optional armv7 | armv6 +arm/arm/hypervisor-stub.S standard arm/arm/machdep.c standard arm/arm/machdep_boot.c standard arm/arm/machdep_kdb.c standard @@ -61,8 +59,7 @@ arm/arm/pl310.c optional pl310 arm/arm/platform.c optional platform arm/arm/platform_if.m optional platform arm/arm/platform_pl310_if.m optional platform pl310 -arm/arm/pmap-v4.c optional !armv7 !armv6 -arm/arm/pmap-v6.c optional armv7 | armv6 +arm/arm/pmap-v6.c standard arm/arm/pmu.c optional pmu | fdt hwpmc arm/arm/ptrace_machdep.c standard arm/arm/sc_machdep.c optional sc @@ -73,12 +70,10 @@ arm/arm/stdatomic.c standard \ compile-with "${NORMAL_C:N-Wmissing-prototypes}" arm/arm/support.S standard arm/arm/swtch.S standard -arm/arm/swtch-v4.S optional !armv7 !armv6 -arm/arm/swtch-v6.S optional armv7 | armv6 +arm/arm/swtch-v6.S standard arm/arm/sys_machdep.c standard arm/arm/syscall.c standard -arm/arm/trap-v4.c optional !armv7 !armv6 -arm/arm/trap-v6.c optional armv7 | armv6 +arm/arm/trap-v6.c standard arm/arm/uio_machdep.c standard arm/arm/undefined.c standard arm/arm/unwind.c optional ddb | kdtrace_hooks | stack From owner-svn-src-all@freebsd.org Sat Nov 28 15:12:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 795844A38BD; Sat, 28 Nov 2020 15:12:00 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cjw2S34mzz4Rbj; Sat, 28 Nov 2020 15:12:00 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CA4329144; Sat, 28 Nov 2020 15:12:00 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ASFC08f017410; Sat, 28 Nov 2020 15:12:00 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ASFC06M017409; Sat, 28 Nov 2020 15:12:00 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202011281512.0ASFC06M017409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 28 Nov 2020 15:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368127 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 368127 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 15:12:00 -0000 Author: melifaro Date: Sat Nov 28 15:11:59 2020 New Revision: 368127 URL: https://svnweb.freebsd.org/changeset/base/368127 Log: Cleanup nexthops request flags: * remove NHR_IFAIF as it was used by previous version of nexthop KPI * update NHR_REF description Modified: head/sys/net/route.h Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sat Nov 28 15:00:08 2020 (r368126) +++ head/sys/net/route.h Sat Nov 28 15:11:59 2020 (r368127) @@ -223,8 +223,7 @@ VNET_DECLARE(u_int, fib_hash_outbound); /* Nexthop request flags */ #define NHR_NONE 0x00 /* empty flags field */ -#define NHR_IFAIF 0x01 /* Return ifa_ifp interface */ -#define NHR_REF 0x02 /* For future use */ +#define NHR_REF 0x02 /* reference nexhop */ /* uRPF */ #define NHR_NODEFAULT 0x04 /* do not consider default route */ From owner-svn-src-all@freebsd.org Sat Nov 28 15:46:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 858284A3FE7; Sat, 28 Nov 2020 15:46:41 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CjwpT2xKYz4T42; Sat, 28 Nov 2020 15:46:41 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5357C29D03; Sat, 28 Nov 2020 15:46:41 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ASFkfba039424; Sat, 28 Nov 2020 15:46:41 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ASFkeNc039423; Sat, 28 Nov 2020 15:46:40 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202011281546.0ASFkeNc039423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 28 Nov 2020 15:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368128 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 368128 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 15:46:41 -0000 Author: melifaro Date: Sat Nov 28 15:46:40 2020 New Revision: 368128 URL: https://svnweb.freebsd.org/changeset/base/368128 Log: Add nhgrp_get_idx() as a counterpart for nhop_get_idx(). It allows the routing-related code to reference nexthop groups by index instead of storing a pointer. Modified: head/sys/net/route/nhgrp_ctl.c head/sys/net/route/route_var.h Modified: head/sys/net/route/nhgrp_ctl.c ============================================================================== --- head/sys/net/route/nhgrp_ctl.c Sat Nov 28 15:11:59 2020 (r368127) +++ head/sys/net/route/nhgrp_ctl.c Sat Nov 28 15:46:40 2020 (r368128) @@ -753,6 +753,15 @@ dump_nhgrp_entry(struct rib_head *rh, const struct nhg return (error); } +uint32_t +nhgrp_get_idx(const struct nhgrp_object *nhg) +{ + const struct nhgrp_priv *nhg_priv; + + nhg_priv = NHGRP_PRIV_CONST(nhg); + return (nhg_priv->nhg_idx); +} + int nhgrp_dump_sysctl(struct rib_head *rh, struct sysctl_req *w) { Modified: head/sys/net/route/route_var.h ============================================================================== --- head/sys/net/route/route_var.h Sat Nov 28 15:11:59 2020 (r368127) +++ head/sys/net/route/route_var.h Sat Nov 28 15:46:40 2020 (r368128) @@ -305,6 +305,7 @@ int nhgrp_get_addition_group(struct rib_head *rnh, struct route_nhop_data *rnd_orig, struct route_nhop_data *rnd_add, struct route_nhop_data *rnd_new); +uint32_t nhgrp_get_idx(const struct nhgrp_object *nhg); void nhgrp_free(struct nhgrp_object *nhg); /* Entropy data used for outbound hashing */ From owner-svn-src-all@freebsd.org Sat Nov 28 18:09:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABF324A6E65; Sat, 28 Nov 2020 18:09:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cjzz34PzDz4bN8; Sat, 28 Nov 2020 18:09:19 +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 8062A2B5D2; Sat, 28 Nov 2020 18:09:19 +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 0ASI9JAj025696; Sat, 28 Nov 2020 18:09:19 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ASI9H4f025686; Sat, 28 Nov 2020 18:09:17 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202011281809.0ASI9H4f025686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 28 Nov 2020 18:09:17 +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: r368129 - in stable: 11/contrib/unbound 11/contrib/unbound/contrib 11/contrib/unbound/daemon 11/contrib/unbound/dnstap 11/contrib/unbound/doc 11/contrib/unbound/dynlibmod 11/contrib/unb... X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/unbound 11/contrib/unbound/contrib 11/contrib/unbound/daemon 11/contrib/unbound/dnstap 11/contrib/unbound/doc 11/contrib/unbound/dynlibmod 11/contrib/unbound/iterator 11/contrib/... X-SVN-Commit-Revision: 368129 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 18:09:19 -0000 Author: cy Date: Sat Nov 28 18:09:16 2020 New Revision: 368129 URL: https://svnweb.freebsd.org/changeset/base/368129 Log: MFC r367094: MFV r367082: Update unbound 1.11.0 --> 1.12.0. Modified: stable/11/contrib/unbound/Makefile.in stable/11/contrib/unbound/README.md stable/11/contrib/unbound/acx_nlnetlabs.m4 stable/11/contrib/unbound/config.guess stable/11/contrib/unbound/config.h.in stable/11/contrib/unbound/config.sub stable/11/contrib/unbound/configure stable/11/contrib/unbound/configure.ac stable/11/contrib/unbound/contrib/aaaa-filter-iterator.patch stable/11/contrib/unbound/contrib/unbound.service.in stable/11/contrib/unbound/contrib/unbound_munin_ stable/11/contrib/unbound/daemon/daemon.c stable/11/contrib/unbound/daemon/remote.c stable/11/contrib/unbound/daemon/stats.c stable/11/contrib/unbound/daemon/unbound.c stable/11/contrib/unbound/daemon/worker.c stable/11/contrib/unbound/dnstap/dnstap.c stable/11/contrib/unbound/dnstap/dnstap.h stable/11/contrib/unbound/dnstap/dtstream.c stable/11/contrib/unbound/dnstap/dtstream.h stable/11/contrib/unbound/dnstap/unbound-dnstap-socket.c stable/11/contrib/unbound/doc/Changelog stable/11/contrib/unbound/doc/README stable/11/contrib/unbound/doc/example.conf.in stable/11/contrib/unbound/doc/libunbound.3.in stable/11/contrib/unbound/doc/unbound-anchor.8.in stable/11/contrib/unbound/doc/unbound-checkconf.8.in stable/11/contrib/unbound/doc/unbound-control.8.in stable/11/contrib/unbound/doc/unbound-host.1.in stable/11/contrib/unbound/doc/unbound.8.in stable/11/contrib/unbound/doc/unbound.conf.5.in stable/11/contrib/unbound/dynlibmod/dynlibmod.c stable/11/contrib/unbound/iterator/iterator.c stable/11/contrib/unbound/libunbound/context.c stable/11/contrib/unbound/libunbound/libunbound.c stable/11/contrib/unbound/libunbound/libworker.c stable/11/contrib/unbound/libunbound/unbound.h stable/11/contrib/unbound/services/cache/dns.c stable/11/contrib/unbound/services/listen_dnsport.c stable/11/contrib/unbound/services/listen_dnsport.h stable/11/contrib/unbound/services/mesh.c stable/11/contrib/unbound/services/mesh.h stable/11/contrib/unbound/services/outside_network.c stable/11/contrib/unbound/services/rpz.c stable/11/contrib/unbound/sldns/parseutil.c stable/11/contrib/unbound/sldns/parseutil.h stable/11/contrib/unbound/sldns/rrdef.h stable/11/contrib/unbound/smallapp/unbound-checkconf.c stable/11/contrib/unbound/smallapp/unbound-control.c stable/11/contrib/unbound/util/config_file.c stable/11/contrib/unbound/util/config_file.h stable/11/contrib/unbound/util/configlexer.lex stable/11/contrib/unbound/util/configparser.y stable/11/contrib/unbound/util/edns.c stable/11/contrib/unbound/util/edns.h stable/11/contrib/unbound/util/fptr_wlist.c stable/11/contrib/unbound/util/iana_ports.inc stable/11/contrib/unbound/util/mini_event.h stable/11/contrib/unbound/util/module.h stable/11/contrib/unbound/util/net_help.c stable/11/contrib/unbound/util/net_help.h stable/11/contrib/unbound/util/netevent.c stable/11/contrib/unbound/util/netevent.h stable/11/contrib/unbound/validator/val_anchor.c stable/11/contrib/unbound/validator/val_anchor.h stable/11/contrib/unbound/validator/val_neg.c stable/11/contrib/unbound/validator/val_neg.h stable/11/contrib/unbound/validator/val_nsec.c stable/11/contrib/unbound/validator/val_nsec.h stable/11/contrib/unbound/validator/validator.c stable/11/contrib/unbound/validator/validator.h stable/11/usr.sbin/unbound/config.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/unbound/Makefile.in stable/12/contrib/unbound/README.md stable/12/contrib/unbound/acx_nlnetlabs.m4 stable/12/contrib/unbound/config.guess stable/12/contrib/unbound/config.h.in stable/12/contrib/unbound/config.sub stable/12/contrib/unbound/configure stable/12/contrib/unbound/configure.ac stable/12/contrib/unbound/contrib/aaaa-filter-iterator.patch stable/12/contrib/unbound/contrib/unbound.service.in stable/12/contrib/unbound/contrib/unbound_munin_ stable/12/contrib/unbound/daemon/daemon.c stable/12/contrib/unbound/daemon/remote.c stable/12/contrib/unbound/daemon/stats.c stable/12/contrib/unbound/daemon/unbound.c stable/12/contrib/unbound/daemon/worker.c stable/12/contrib/unbound/dnstap/dnstap.c stable/12/contrib/unbound/dnstap/dnstap.h stable/12/contrib/unbound/dnstap/dtstream.c stable/12/contrib/unbound/dnstap/dtstream.h stable/12/contrib/unbound/dnstap/unbound-dnstap-socket.c stable/12/contrib/unbound/doc/Changelog stable/12/contrib/unbound/doc/README stable/12/contrib/unbound/doc/example.conf.in stable/12/contrib/unbound/doc/libunbound.3.in stable/12/contrib/unbound/doc/unbound-anchor.8.in stable/12/contrib/unbound/doc/unbound-checkconf.8.in stable/12/contrib/unbound/doc/unbound-control.8.in stable/12/contrib/unbound/doc/unbound-host.1.in stable/12/contrib/unbound/doc/unbound.8.in stable/12/contrib/unbound/doc/unbound.conf.5.in stable/12/contrib/unbound/dynlibmod/dynlibmod.c stable/12/contrib/unbound/iterator/iterator.c stable/12/contrib/unbound/libunbound/context.c stable/12/contrib/unbound/libunbound/libunbound.c stable/12/contrib/unbound/libunbound/libworker.c stable/12/contrib/unbound/libunbound/unbound.h stable/12/contrib/unbound/services/cache/dns.c stable/12/contrib/unbound/services/listen_dnsport.c stable/12/contrib/unbound/services/listen_dnsport.h stable/12/contrib/unbound/services/mesh.c stable/12/contrib/unbound/services/mesh.h stable/12/contrib/unbound/services/outside_network.c stable/12/contrib/unbound/services/rpz.c stable/12/contrib/unbound/sldns/parseutil.c stable/12/contrib/unbound/sldns/parseutil.h stable/12/contrib/unbound/sldns/rrdef.h stable/12/contrib/unbound/smallapp/unbound-checkconf.c stable/12/contrib/unbound/smallapp/unbound-control.c stable/12/contrib/unbound/util/config_file.c stable/12/contrib/unbound/util/config_file.h stable/12/contrib/unbound/util/configlexer.lex stable/12/contrib/unbound/util/configparser.y stable/12/contrib/unbound/util/edns.c stable/12/contrib/unbound/util/edns.h stable/12/contrib/unbound/util/fptr_wlist.c stable/12/contrib/unbound/util/iana_ports.inc stable/12/contrib/unbound/util/mini_event.h stable/12/contrib/unbound/util/module.h stable/12/contrib/unbound/util/net_help.c stable/12/contrib/unbound/util/net_help.h stable/12/contrib/unbound/util/netevent.c stable/12/contrib/unbound/util/netevent.h stable/12/contrib/unbound/validator/val_anchor.c stable/12/contrib/unbound/validator/val_anchor.h stable/12/contrib/unbound/validator/val_neg.c stable/12/contrib/unbound/validator/val_neg.h stable/12/contrib/unbound/validator/val_nsec.c stable/12/contrib/unbound/validator/val_nsec.h stable/12/contrib/unbound/validator/validator.c stable/12/contrib/unbound/validator/validator.h stable/12/usr.sbin/unbound/config.h Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/unbound/Makefile.in ============================================================================== --- stable/11/contrib/unbound/Makefile.in Sat Nov 28 15:46:40 2020 (r368128) +++ stable/11/contrib/unbound/Makefile.in Sat Nov 28 18:09:16 2020 (r368129) @@ -231,6 +231,10 @@ STREAMTCP_SRC=testcode/streamtcp.c STREAMTCP_OBJ=streamtcp.lo STREAMTCP_OBJ_LINK=$(STREAMTCP_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ) \ $(SLDNS_OBJ) +DOHCLIENT_SRC=testcode/dohclient.c +DOHCLIENT_OBJ=dohclient.lo +DOHCLIENT_OBJ_LINK=$(DOHCLIENT_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ) \ +$(SLDNS_OBJ) PERF_SRC=testcode/perf.c PERF_OBJ=perf.lo PERF_OBJ_LINK=$(PERF_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ) $(SLDNS_OBJ) @@ -272,7 +276,8 @@ ALL_SRC=$(COMMON_SRC) $(UNITTEST_SRC) $(DAEMON_SRC) \ $(ASYNCLOOK_SRC) $(STREAMTCP_SRC) $(PERF_SRC) $(DELAYER_SRC) \ $(CONTROL_SRC) $(UBANCHOR_SRC) $(PETAL_SRC) $(DNSTAP_SOCKET_SRC)\ $(PYTHONMOD_SRC) $(PYUNBOUND_SRC) $(WIN_DAEMON_THE_SRC) \ - $(SVCINST_SRC) $(SVCUNINST_SRC) $(ANCHORUPD_SRC) $(SLDNS_SRC) + $(SVCINST_SRC) $(SVCUNINST_SRC) $(ANCHORUPD_SRC) $(SLDNS_SRC) \ + $(DOHCLIENT_SRC) ALL_OBJ=$(COMMON_OBJ) $(UNITTEST_OBJ) $(DAEMON_OBJ) \ $(TESTBOUND_OBJ) $(LOCKVERIFY_OBJ) $(PKTVIEW_OBJ) \ @@ -280,7 +285,8 @@ ALL_OBJ=$(COMMON_OBJ) $(UNITTEST_OBJ) $(DAEMON_OBJ) \ $(ASYNCLOOK_OBJ) $(STREAMTCP_OBJ) $(PERF_OBJ) $(DELAYER_OBJ) \ $(CONTROL_OBJ) $(UBANCHOR_OBJ) $(PETAL_OBJ) $(DNSTAP_SOCKET_OBJ)\ $(COMPAT_OBJ) $(PYUNBOUND_OBJ) \ - $(SVCINST_OBJ) $(SVCUNINST_OBJ) $(ANCHORUPD_OBJ) $(SLDNS_OBJ) + $(SVCINST_OBJ) $(SVCUNINST_OBJ) $(ANCHORUPD_OBJ) $(SLDNS_OBJ) \ + $(DOHCLIENT_OBJ) COMPILE=$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) @PTHREAD_CFLAGS_ONLY@ LINK=$(LIBTOOL) --tag=CC --mode=link $(CC) $(staticexe) $(RUNTIME_PATH) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) @@ -317,7 +323,7 @@ rsrc_unbound_checkconf.o: $(srcdir)/winrc/rsrc_unbound TEST_BIN=asynclook$(EXEEXT) delayer$(EXEEXT) \ lock-verify$(EXEEXT) memstats$(EXEEXT) perf$(EXEEXT) \ petal$(EXEEXT) pktview$(EXEEXT) streamtcp$(EXEEXT) \ - unbound-dnstap-socket$(EXEEXT) \ + unbound-dnstap-socket$(EXEEXT) dohclient$(EXEEXT) \ testbound$(EXEEXT) unittest$(EXEEXT) tests: all $(TEST_BIN) @@ -387,6 +393,9 @@ asynclook$(EXEEXT): $(ASYNCLOOK_OBJ_LINK) libunbound.l streamtcp$(EXEEXT): $(STREAMTCP_OBJ_LINK) $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) +dohclient$(EXEEXT): $(DOHCLIENT_OBJ_LINK) + $(LINK) -o $@ $(DOHCLIENT_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + perf$(EXEEXT): $(PERF_OBJ_LINK) $(LINK) -o $@ $(PERF_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) @@ -672,7 +681,7 @@ dns.lo dns.o: $(srcdir)/services/cache/dns.c config.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/validator/val_utils.h $(srcdir)/sldns/pkthdr.h $(srcdir)/services/cache/dns.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/dname.h $(srcdir)/util/module.h \ $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/sldns/sbuffer.h infra.lo infra.o: $(srcdir)/services/cache/infra.c config.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/services/cache/infra.h \ @@ -713,10 +722,11 @@ msgreply.lo msgreply.o: $(srcdir)/util/data/msgreply.c $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/respip/respip.h -packed_rrset.lo packed_rrset.o: $(srcdir)/util/data/packed_rrset.c config.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/alloc.h $(srcdir)/util/regional.h \ - $(srcdir)/util/net_help.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h +packed_rrset.lo packed_rrset.o: $(srcdir)/util/data/packed_rrset.c config.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/storage/lookup3.h $(srcdir)/util/alloc.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h iterator.lo iterator.o: $(srcdir)/iterator/iterator.c config.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/module.h \ @@ -785,7 +795,7 @@ listen_dnsport.lo listen_dnsport.o: $(srcdir)/services $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/log.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ @@ -808,10 +818,10 @@ mesh.lo mesh.o: $(srcdir)/services/mesh.c config.h $(s $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/dns.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/regional.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ - $(srcdir)/util/alloc.h $(srcdir)/util/edns.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/data/dname.h \ - $(srcdir)/services/listen_dnsport.h + $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/alloc.h \ + $(srcdir)/util/edns.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/data/dname.h $(srcdir)/services/listen_dnsport.h modstack.lo modstack.o: $(srcdir)/services/modstack.c config.h $(srcdir)/services/modstack.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ @@ -1204,7 +1214,8 @@ testpkts.lo testpkts.o: $(srcdir)/testcode/testpkts.c $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h unitldns.lo unitldns.o: $(srcdir)/testcode/unitldns.c config.h $(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/sldns/parseutil.h unitecs.lo unitecs.o: $(srcdir)/testcode/unitecs.c config.h unitauth.lo unitauth.o: $(srcdir)/testcode/unitauth.c config.h $(srcdir)/services/authzone.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ @@ -1310,7 +1321,8 @@ worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h + $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h \ + $(srcdir)/dnstap/dtstream.h testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h \ @@ -1344,7 +1356,8 @@ worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h + $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h \ + $(srcdir)/dnstap/dtstream.h acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ @@ -1507,6 +1520,12 @@ unbound-control.lo unbound-control.o: $(srcdir)/smalla unbound-anchor.lo unbound-anchor.o: $(srcdir)/smallapp/unbound-anchor.c config.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h petal.lo petal.o: $(srcdir)/testcode/petal.c config.h +unbound-dnstap-socket.lo unbound-dnstap-socket.o: $(srcdir)/dnstap/unbound-dnstap-socket.c config.h \ + $(srcdir)/dnstap/dtstream.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/dnstap/dnstap_fstrm.h \ + $(srcdir)/util/ub_event.h $(srcdir)/util/net_help.h $(srcdir)/services/listen_dnsport.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h pythonmod_utils.lo pythonmod_utils.o: $(srcdir)/pythonmod/pythonmod_utils.c config.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ @@ -1542,6 +1561,10 @@ parseutil.lo parseutil.o: $(srcdir)/sldns/parseutil.c rrdef.lo rrdef.o: $(srcdir)/sldns/rrdef.c config.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h str2wire.lo str2wire.o: $(srcdir)/sldns/str2wire.c config.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h \ $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parse.h $(srcdir)/sldns/parseutil.h +dohclient.lo dohclient.o: $(srcdir)/testcode/dohclient.c config.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgencode.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/net_help.h ctime_r.lo ctime_r.o: $(srcdir)/compat/ctime_r.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h fake-rfc2553.lo fake-rfc2553.o: $(srcdir)/compat/fake-rfc2553.c $(srcdir)/compat/fake-rfc2553.h config.h gmtime_r.lo gmtime_r.o: $(srcdir)/compat/gmtime_r.c config.h Modified: stable/11/contrib/unbound/README.md ============================================================================== --- stable/11/contrib/unbound/README.md Sat Nov 28 15:46:40 2020 (r368128) +++ stable/11/contrib/unbound/README.md Sat Nov 28 18:09:16 2020 (r368129) @@ -9,7 +9,7 @@ fast and lean and incorporates modern features based o have any feedback, we would love to hear from you. Don’t hesitate to [create an issue on Github](https://github.com/NLnetLabs/unbound/issues/new) or post a message on the [Unbound mailing list](https://lists.nlnetlabs.nl/mailman/listinfo/unbound-users). -You can lean more about Unbound by reading our +You can learn more about Unbound by reading our [documentation](https://nlnetlabs.nl/documentation/unbound/). ## Compiling Modified: stable/11/contrib/unbound/acx_nlnetlabs.m4 ============================================================================== --- stable/11/contrib/unbound/acx_nlnetlabs.m4 Sat Nov 28 15:46:40 2020 (r368128) +++ stable/11/contrib/unbound/acx_nlnetlabs.m4 Sat Nov 28 18:09:16 2020 (r368129) @@ -2,7 +2,8 @@ # Copyright 2009, Wouter Wijngaards, NLnet Labs. # BSD licensed. # -# Version 34 +# Version 35 +# 2020-08-24 Use EVP_sha256 instead of HMAC_Update (for openssl-3.0.0). # 2016-03-21 Check -ldl -pthread for libcrypto for ldns and openssl 1.1.0. # 2016-03-21 Use HMAC_Update instead of HMAC_CTX_Init (for openssl-1.1.0). # 2016-01-04 -D_DEFAULT_SOURCE defined with -D_BSD_SOURCE for Linux glibc 2.20 @@ -673,16 +674,16 @@ AC_DEFUN([ACX_SSL_CHECKS], [ ACX_RUNTIME_PATH_ADD([$ssldir/lib]) fi - AC_MSG_CHECKING([for HMAC_Update in -lcrypto]) + AC_MSG_CHECKING([for EVP_sha256 in -lcrypto]) LIBS="$LIBS -lcrypto" LIBSSL_LIBS="$LIBSSL_LIBS -lcrypto" AC_TRY_LINK(, [ - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ], [ AC_MSG_RESULT(yes) - AC_DEFINE([HAVE_HMAC_UPDATE], 1, - [If you have HMAC_Update]) + AC_DEFINE([HAVE_EVP_SHA256], 1, + [If you have EVP_sha256]) ], [ AC_MSG_RESULT(no) # check if -lwsock32 or -lgdi32 are needed. @@ -692,11 +693,11 @@ AC_DEFUN([ACX_SSL_CHECKS], [ LIBSSL_LIBS="$LIBSSL_LIBS -lgdi32 -lws2_32" AC_MSG_CHECKING([if -lcrypto needs -lgdi32]) AC_TRY_LINK([], [ - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ],[ - AC_DEFINE([HAVE_HMAC_UPDATE], 1, - [If you have HMAC_Update]) + AC_DEFINE([HAVE_EVP_SHA256], 1, + [If you have EVP_sha256]) AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no) @@ -706,11 +707,11 @@ AC_DEFUN([ACX_SSL_CHECKS], [ LIBSSL_LIBS="$LIBSSL_LIBS -ldl" AC_MSG_CHECKING([if -lcrypto needs -ldl]) AC_TRY_LINK([], [ - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ],[ - AC_DEFINE([HAVE_HMAC_UPDATE], 1, - [If you have HMAC_Update]) + AC_DEFINE([HAVE_EVP_SHA256], 1, + [If you have EVP_sha256]) AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no) @@ -720,11 +721,11 @@ AC_DEFUN([ACX_SSL_CHECKS], [ LIBSSL_LIBS="$LIBSSL_LIBS -ldl -pthread" AC_MSG_CHECKING([if -lcrypto needs -ldl -pthread]) AC_TRY_LINK([], [ - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ],[ - AC_DEFINE([HAVE_HMAC_UPDATE], 1, - [If you have HMAC_Update]) + AC_DEFINE([HAVE_EVP_SHA256], 1, + [If you have EVP_sha256]) AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no) Modified: stable/11/contrib/unbound/config.guess ============================================================================== --- stable/11/contrib/unbound/config.guess Sat Nov 28 15:46:40 2020 (r368128) +++ stable/11/contrib/unbound/config.guess Sat Nov 28 18:09:16 2020 (r368129) @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2020 Free Software Foundation, Inc. -timestamp='2020-07-12' +timestamp='2020-09-19' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -150,17 +150,15 @@ Linux|GNU|GNU/*) #elif defined(__dietlibc__) LIBC=dietlibc #else + #include + #ifdef __DEFINED_va_list + LIBC=musl + #else LIBC=gnu #endif + #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" - - # If ldd exists, use it to detect musl libc. - if command -v ldd >/dev/null && \ - ldd --version 2>&1 | grep -q ^musl - then - LIBC=musl - fi ;; esac @@ -404,7 +402,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNA # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null @@ -544,10 +542,10 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ - [ "$TARGET_BINARY_INTERFACE"x = x ] + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then echo m88k-dg-dgux"$UNAME_RELEASE" else @@ -580,7 +578,7 @@ EOF echo i386-ibm-aix exit ;; ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then + if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" @@ -620,7 +618,7 @@ EOF else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then + if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else @@ -655,7 +653,7 @@ EOF 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then + if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in @@ -669,7 +667,7 @@ EOF esac ;; esac fi - if [ "$HP_ARCH" = "" ]; then + if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -708,7 +706,7 @@ EOF test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ "$HP_ARCH" = hppa2.0w ] + if test "$HP_ARCH" = hppa2.0w then set_cc_for_build @@ -782,7 +780,7 @@ EOF echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then + if test -x /usr/sbin/sysversion ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 @@ -1097,7 +1095,7 @@ EOF x86_64:Linux:*:*) set_cc_for_build LIBCABI=$LIBC - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_X32 >/dev/null @@ -1294,7 +1292,7 @@ EOF echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then + if test -d /usr/nec; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" @@ -1359,7 +1357,7 @@ EOF else set_cc_for_build fi - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null Modified: stable/11/contrib/unbound/config.h.in ============================================================================== --- stable/11/contrib/unbound/config.h.in Sat Nov 28 15:46:40 2020 (r368128) +++ stable/11/contrib/unbound/config.h.in Sat Nov 28 18:09:16 2020 (r368129) @@ -113,6 +113,10 @@ don't. */ #undef HAVE_DECL_INET_PTON +/* Define to 1 if you have the declaration of `nghttp2_session_server_new', + and to 0 if you don't. */ +#undef HAVE_DECL_NGHTTP2_SESSION_SERVER_NEW + /* Define to 1 if you have the declaration of `NID_ED25519', and to 0 if you don't. */ #undef HAVE_DECL_NID_ED25519 @@ -221,6 +225,9 @@ /* Define to 1 if you have the `EVP_EncryptInit_ex' function. */ #undef HAVE_EVP_ENCRYPTINIT_EX +/* Define to 1 if you have the `EVP_MAC_CTX_set_params' function. */ +#undef HAVE_EVP_MAC_CTX_SET_PARAMS + /* Define to 1 if you have the `EVP_MD_CTX_new' function. */ #undef HAVE_EVP_MD_CTX_NEW @@ -269,6 +276,9 @@ /* Define to 1 if you have the `getentropy' function. */ #undef HAVE_GETENTROPY +/* Define to 1 if you have the `getifaddrs' function. */ +#undef HAVE_GETIFADDRS + /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H @@ -296,12 +306,12 @@ /* Define to 1 if you have the `HMAC_Init_ex' function. */ #undef HAVE_HMAC_INIT_EX -/* If you have HMAC_Update */ -#undef HAVE_HMAC_UPDATE - /* If we have htobe64 */ #undef HAVE_HTOBE64 +/* Define to 1 if you have the header file. */ +#undef HAVE_IFADDRS_H + /* Define to 1 if you have the `inet_aton' function. */ #undef HAVE_INET_ATON @@ -371,6 +381,15 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETTLE_EDDSA_H +/* Define to 1 if you have the header file. */ +#undef HAVE_NET_IF_H + +/* Define this to use nghttp2 client. */ +#undef HAVE_NGHTTP2 + +/* Define to 1 if you have the header file. */ +#undef HAVE_NGHTTP2_NGHTTP2_H + /* Use libnss for crypto */ #undef HAVE_NSS @@ -497,6 +516,9 @@ /* Define if you have the SSL libraries installed. */ #undef HAVE_SSL +/* Define to 1 if you have the `SSL_CTX_set_alpn_select_cb' function. */ +#undef HAVE_SSL_CTX_SET_ALPN_SELECT_CB + /* Define to 1 if you have the `SSL_CTX_set_ciphersuites' function. */ #undef HAVE_SSL_CTX_SET_CIPHERSUITES @@ -573,6 +595,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_RESOURCE_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SHA2_H @@ -1358,6 +1383,8 @@ void *unbound_stat_realloc_log(void *ptr, size_t size, #define UNBOUND_DNS_PORT 53 /** default port for DNS over TLS traffic. */ #define UNBOUND_DNS_OVER_TLS_PORT 853 +/** default port for DNS over HTTPS traffic. */ +#define UNBOUND_DNS_OVER_HTTPS_PORT 443 /** default port for unbound control traffic, registered port with IANA, ub-dns-control 8953/tcp unbound dns nameserver control */ #define UNBOUND_CONTROL_PORT 8953 Modified: stable/11/contrib/unbound/config.sub ============================================================================== --- stable/11/contrib/unbound/config.sub Sat Nov 28 15:46:40 2020 (r368128) +++ stable/11/contrib/unbound/config.sub Sat Nov 28 18:09:16 2020 (r368129) @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2020 Free Software Foundation, Inc. -timestamp='2020-07-10' +timestamp='2020-09-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -1278,7 +1278,7 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x$basic_os != x ] +if test x$basic_os != x then # First recognize some ad-hoc caes, or perhaps split kernel-os, or else just @@ -1367,13 +1367,7 @@ case $os in os=psos ;; qnx*) - case $cpu in - x86 | i*86) - ;; - *) - os=nto-$os - ;; - esac + os=qnx ;; hiux*) os=hiuxwe2 @@ -1722,7 +1716,7 @@ case $os in | skyos* | haiku* | rdos* | toppers* | drops* | es* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ - | nsk* | powerunix* | genode* | zvmoe* ) + | nsk* | powerunix* | genode* | zvmoe* | qnx* ) ;; # This one is extra strict with allowed versions sco3.2v2 | sco3.2v[4-9]* | sco5v6*) @@ -1740,6 +1734,8 @@ esac # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) + ;; + uclinux-uclibc* ) ;; -dietlibc* | -newlib* | -musl* | -uclibc* ) # These are just libc implementations, not actual OSes, and thus Modified: stable/11/contrib/unbound/configure ============================================================================== --- stable/11/contrib/unbound/configure Sat Nov 28 15:46:40 2020 (r368128) +++ stable/11/contrib/unbound/configure Sat Nov 28 18:09:16 2020 (r368129) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for unbound 1.11.0. +# Generated by GNU Autoconf 2.69 for unbound 1.12.0. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='unbound' PACKAGE_TARNAME='unbound' -PACKAGE_VERSION='1.11.0' -PACKAGE_STRING='unbound 1.11.0' +PACKAGE_VERSION='1.12.0' +PACKAGE_STRING='unbound 1.12.0' PACKAGE_BUGREPORT='unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues' PACKAGE_URL='' @@ -882,6 +882,7 @@ enable_tfo_server with_libevent with_libexpat with_libhiredis +with_libnghttp2 enable_static_exe enable_fully_static enable_lock_checks @@ -1458,7 +1459,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 unbound 1.11.0 to adapt to many kinds of systems. +\`configure' configures unbound 1.12.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1523,7 +1524,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of unbound 1.11.0:";; + short | recursive ) echo "Configuration of unbound 1.12.0:";; esac cat <<\_ACEOF @@ -1642,6 +1643,7 @@ Optional Packages: outgoing port ranges. --with-libexpat=path specify explicit path for libexpat. --with-libhiredis=path specify explicit path for libhiredis. + --with-libnghttp2=path specify explicit path for libnghttp2. --with-dnstap-socket-path=pathname set default dnstap socket path --with-protobuf-c=path Path where protobuf-c is installed, for dnstap @@ -1750,7 +1752,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -unbound configure 1.11.0 +unbound configure 1.12.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2459,7 +2461,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 unbound $as_me 1.11.0, which was +It was created by unbound $as_me 1.12.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2809,13 +2811,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu UNBOUND_VERSION_MAJOR=1 -UNBOUND_VERSION_MINOR=11 +UNBOUND_VERSION_MINOR=12 UNBOUND_VERSION_MICRO=0 LIBUNBOUND_CURRENT=9 -LIBUNBOUND_REVISION=9 +LIBUNBOUND_REVISION=10 LIBUNBOUND_AGE=1 # 1.0.0 had 0:12:0 # 1.0.1 had 0:13:0 @@ -2892,6 +2894,7 @@ LIBUNBOUND_AGE=1 # 1.10.0 had 9:7:1 # 1.10.1 had 9:8:1 # 1.11.0 had 9:9:1 +# 1.12.0 had 9:10:1 # Current -- the number of the binary API that we're implementing # Revision -- which iteration of the implementation of the binary @@ -14725,7 +14728,7 @@ $as_echo "no" >&6; } fi # Checks for header files. -for ac_header in stdarg.h stdbool.h netinet/in.h netinet/tcp.h sys/param.h sys/socket.h sys/un.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h endian.h sys/endian.h libkern/OSByteOrder.h sys/ipc.h sys/shm.h +for ac_header in stdarg.h stdbool.h netinet/in.h netinet/tcp.h sys/param.h sys/select.h sys/socket.h sys/un.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h endian.h sys/endian.h libkern/OSByteOrder.h sys/ipc.h sys/shm.h ifaddrs.h net/if.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default @@ -17942,8 +17945,8 @@ $as_echo "found in $ssldir" >&6; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HMAC_Update in -lcrypto" >&5 -$as_echo_n "checking for HMAC_Update in -lcrypto... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_sha256 in -lcrypto" >&5 +$as_echo_n "checking for EVP_sha256 in -lcrypto... " >&6; } LIBS="$LIBS -lcrypto" LIBSSL_LIBS="$LIBSSL_LIBS -lcrypto" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17953,8 +17956,8 @@ int main () { - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ; return 0; @@ -17965,7 +17968,7 @@ if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -$as_echo "#define HAVE_HMAC_UPDATE 1" >>confdefs.h +$as_echo "#define HAVE_EVP_SHA256 1" >>confdefs.h else @@ -17986,8 +17989,8 @@ int main () { - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ; return 0; @@ -17996,7 +17999,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : -$as_echo "#define HAVE_HMAC_UPDATE 1" >>confdefs.h +$as_echo "#define HAVE_EVP_SHA256 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -18018,8 +18021,8 @@ int main () { - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ; return 0; @@ -18028,7 +18031,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : -$as_echo "#define HAVE_HMAC_UPDATE 1" >>confdefs.h +$as_echo "#define HAVE_EVP_SHA256 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -18050,8 +18053,8 @@ int main () { - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ; return 0; @@ -18060,7 +18063,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : -$as_echo "#define HAVE_HMAC_UPDATE 1" >>confdefs.h +$as_echo "#define HAVE_EVP_SHA256 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -18245,11 +18248,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char HMAC_Update (); +char EVP_sha256 (); int main () { -return HMAC_Update (); +return EVP_sha256 (); ; return 0; } @@ -18340,7 +18343,7 @@ fi done -for ac_func in OPENSSL_config EVP_sha1 EVP_sha256 EVP_sha512 FIPS_mode EVP_MD_CTX_new OpenSSL_add_all_digests OPENSSL_init_crypto EVP_cleanup ENGINE_cleanup ERR_load_crypto_strings CRYPTO_cleanup_all_ex_data ERR_free_strings RAND_cleanup DSA_SIG_set0 EVP_dss1 EVP_DigestVerify EVP_aes_256_cbc EVP_EncryptInit_ex HMAC_Init_ex CRYPTO_THREADID_set_callback +for ac_func in OPENSSL_config EVP_sha1 EVP_sha256 EVP_sha512 FIPS_mode EVP_MD_CTX_new OpenSSL_add_all_digests OPENSSL_init_crypto EVP_cleanup ENGINE_cleanup ERR_load_crypto_strings CRYPTO_cleanup_all_ex_data ERR_free_strings RAND_cleanup DSA_SIG_set0 EVP_dss1 EVP_DigestVerify EVP_aes_256_cbc EVP_EncryptInit_ex HMAC_Init_ex CRYPTO_THREADID_set_callback EVP_MAC_CTX_set_params do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -18356,7 +18359,7 @@ done # these check_funcs need -lssl BAKLIBS="$LIBS" LIBS="-lssl $LIBS" -for ac_func in OPENSSL_init_ssl SSL_CTX_set_security_level SSL_set1_host SSL_get0_peername X509_VERIFY_PARAM_set1_host SSL_CTX_set_ciphersuites SSL_CTX_set_tlsext_ticket_key_evp_cb +for ac_func in OPENSSL_init_ssl SSL_CTX_set_security_level SSL_set1_host SSL_get0_peername X509_VERIFY_PARAM_set1_host SSL_CTX_set_ciphersuites SSL_CTX_set_tlsext_ticket_key_evp_cb SSL_CTX_set_alpn_select_cb do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -19668,6 +19671,70 @@ _ACEOF fi +# nghttp2 + +# Check whether --with-libnghttp2 was given. +if test "${with_libnghttp2+set}" = set; then : + withval=$with_libnghttp2; +else + withval="no" +fi + +found_libnghttp2="no" +if test x_$withval = x_yes -o x_$withval != x_no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libnghttp2" >&5 +$as_echo_n "checking for libnghttp2... " >&6; } + if test x_$withval = x_ -o x_$withval = x_yes; then + withval="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr" + fi + for dir in $withval ; do + if test -f "$dir/include/nghttp2/nghttp2.h"; then + found_libnghttp2="yes" + if test "$dir" != "/usr"; then + CPPFLAGS="$CPPFLAGS -I$dir/include" + LDFLAGS="$LDFLAGS -L$dir/lib" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found in $dir" >&5 +$as_echo "found in $dir" >&6; } + +$as_echo "#define HAVE_NGHTTP2 1" >>confdefs.h + + LIBS="$LIBS -lnghttp2" + break; + fi + done + if test x_$found_libnghttp2 != x_yes; then + as_fn_error $? "Could not find libnghttp2, nghttp2.h" "$LINENO" 5 + fi + for ac_header in nghttp2/nghttp2.h +do : + ac_fn_c_check_header_compile "$LINENO" "nghttp2/nghttp2.h" "ac_cv_header_nghttp2_nghttp2_h" "$ac_includes_default +" +if test "x$ac_cv_header_nghttp2_nghttp2_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NGHTTP2_NGHTTP2_H 1 +_ACEOF + +fi + +done + + ac_fn_c_check_decl "$LINENO" "nghttp2_session_server_new" "ac_cv_have_decl_nghttp2_session_server_new" "$ac_includes_default + #include + +" +if test "x$ac_cv_have_decl_nghttp2_session_server_new" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NGHTTP2_SESSION_SERVER_NEW $ac_have_decl +_ACEOF + +fi + # set static linking for uninstalled libraries if requested staticexe="" @@ -20223,7 +20290,7 @@ if test "$ac_res" != no; then : fi -for ac_func in tzset sigprocmask fcntl getpwnam endpwent getrlimit setrlimit setsid chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent fsync shmget accept4 +for ac_func in tzset sigprocmask fcntl getpwnam endpwent getrlimit setrlimit setsid chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent fsync shmget accept4 getifaddrs do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -21619,7 +21686,7 @@ _ACEOF -version=1.11.0 +version=1.12.0 date=`date +'%b %e, %Y'` @@ -22138,7 +22205,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 unbound $as_me 1.11.0, which was +This file was extended by unbound $as_me 1.12.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22204,7 +22271,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="\\ -unbound config.status 1.11.0 +unbound config.status 1.12.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/11/contrib/unbound/configure.ac ============================================================================== --- stable/11/contrib/unbound/configure.ac Sat Nov 28 15:46:40 2020 (r368128) +++ stable/11/contrib/unbound/configure.ac Sat Nov 28 18:09:16 2020 (r368129) @@ -10,7 +10,7 @@ sinclude(dnscrypt/dnscrypt.m4) # must be numbers. ac_defun because of later processing m4_define([VERSION_MAJOR],[1]) -m4_define([VERSION_MINOR],[11]) +m4_define([VERSION_MINOR],[12]) m4_define([VERSION_MICRO],[0]) AC_INIT(unbound, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues, unbound) AC_SUBST(UNBOUND_VERSION_MAJOR, [VERSION_MAJOR]) @@ -18,7 +18,7 @@ AC_SUBST(UNBOUND_VERSION_MINOR, [VERSION_MINOR]) AC_SUBST(UNBOUND_VERSION_MICRO, [VERSION_MICRO]) LIBUNBOUND_CURRENT=9 -LIBUNBOUND_REVISION=9 +LIBUNBOUND_REVISION=10 LIBUNBOUND_AGE=1 # 1.0.0 had 0:12:0 # 1.0.1 had 0:13:0 @@ -95,6 +95,7 @@ LIBUNBOUND_AGE=1 # 1.10.0 had 9:7:1 # 1.10.1 had 9:8:1 # 1.11.0 had 9:9:1 +# 1.12.0 had 9:10:1 # Current -- the number of the binary API that we're implementing # Revision -- which iteration of the implementation of the binary @@ -398,7 +399,7 @@ ACX_LIBTOOL_C_ONLY PKG_PROG_PKG_CONFIG # Checks for header files. -AC_CHECK_HEADERS([stdarg.h stdbool.h netinet/in.h netinet/tcp.h sys/param.h sys/socket.h sys/un.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h endian.h sys/endian.h libkern/OSByteOrder.h sys/ipc.h sys/shm.h],,, [AC_INCLUDES_DEFAULT]) +AC_CHECK_HEADERS([stdarg.h stdbool.h netinet/in.h netinet/tcp.h sys/param.h sys/select.h sys/socket.h sys/un.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h endian.h sys/endian.h libkern/OSByteOrder.h sys/ipc.h sys/shm.h ifaddrs.h net/if.h],,, [AC_INCLUDES_DEFAULT]) # Check for Apple header. This uncovers TARGET_OS_IPHONE, TARGET_OS_TV or TARGET_OS_WATCH AC_CHECK_HEADERS([TargetConditionals.h]) @@ -831,7 +832,7 @@ AC_SUBST(PC_CRYPTO_DEPENDENCY) BAKLIBS="$LIBS" LIBS="-lssl $LIBS" AC_MSG_CHECKING([if libssl needs -lcrypt32]) -AC_TRY_LINK_FUNC([HMAC_Update], [ +AC_TRY_LINK_FUNC([EVP_sha256], [ AC_MSG_RESULT([no]) LIBS="$BAKLIBS" ], [ @@ -851,12 +852,12 @@ else AC_MSG_RESULT([no]) fi AC_CHECK_HEADERS([openssl/conf.h openssl/engine.h openssl/bn.h openssl/dh.h openssl/dsa.h openssl/rsa.h openssl/core_names.h],,, [AC_INCLUDES_DEFAULT]) -AC_CHECK_FUNCS([OPENSSL_config EVP_sha1 EVP_sha256 EVP_sha512 FIPS_mode EVP_MD_CTX_new OpenSSL_add_all_digests OPENSSL_init_crypto EVP_cleanup ENGINE_cleanup ERR_load_crypto_strings CRYPTO_cleanup_all_ex_data ERR_free_strings RAND_cleanup DSA_SIG_set0 EVP_dss1 EVP_DigestVerify EVP_aes_256_cbc EVP_EncryptInit_ex HMAC_Init_ex CRYPTO_THREADID_set_callback]) +AC_CHECK_FUNCS([OPENSSL_config EVP_sha1 EVP_sha256 EVP_sha512 FIPS_mode EVP_MD_CTX_new OpenSSL_add_all_digests OPENSSL_init_crypto EVP_cleanup ENGINE_cleanup ERR_load_crypto_strings CRYPTO_cleanup_all_ex_data ERR_free_strings RAND_cleanup DSA_SIG_set0 EVP_dss1 EVP_DigestVerify EVP_aes_256_cbc EVP_EncryptInit_ex HMAC_Init_ex CRYPTO_THREADID_set_callback EVP_MAC_CTX_set_params]) # these check_funcs need -lssl BAKLIBS="$LIBS" LIBS="-lssl $LIBS" -AC_CHECK_FUNCS([OPENSSL_init_ssl SSL_CTX_set_security_level SSL_set1_host SSL_get0_peername X509_VERIFY_PARAM_set1_host SSL_CTX_set_ciphersuites SSL_CTX_set_tlsext_ticket_key_evp_cb]) +AC_CHECK_FUNCS([OPENSSL_init_ssl SSL_CTX_set_security_level SSL_set1_host SSL_get0_peername X509_VERIFY_PARAM_set1_host SSL_CTX_set_ciphersuites SSL_CTX_set_tlsext_ticket_key_evp_cb SSL_CTX_set_alpn_select_cb]) LIBS="$BAKLIBS" AC_CHECK_DECLS([SSL_COMP_get_compression_methods,sk_SSL_COMP_pop_free,SSL_CTX_set_ecdh_auto], [], [], [ @@ -1395,6 +1396,39 @@ if test x_$withval = x_yes -o x_$withval != x_no; then ]) fi +# nghttp2 +AC_ARG_WITH(libnghttp2, AC_HELP_STRING([--with-libnghttp2=path], + [specify explicit path for libnghttp2.]), + [ ],[ withval="no" ]) +found_libnghttp2="no" +if test x_$withval = x_yes -o x_$withval != x_no; then + AC_MSG_CHECKING(for libnghttp2) + if test x_$withval = x_ -o x_$withval = x_yes; then + withval="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr" + fi + for dir in $withval ; do + if test -f "$dir/include/nghttp2/nghttp2.h"; then + found_libnghttp2="yes" + dnl assume /usr is in default path. + if test "$dir" != "/usr"; then + CPPFLAGS="$CPPFLAGS -I$dir/include" + LDFLAGS="$LDFLAGS -L$dir/lib" + fi + AC_MSG_RESULT(found in $dir) + AC_DEFINE([HAVE_NGHTTP2], [1], [Define this to use nghttp2 client.]) + LIBS="$LIBS -lnghttp2" + break; + fi + done + if test x_$found_libnghttp2 != x_yes; then + AC_ERROR([Could not find libnghttp2, nghttp2.h]) + fi + AC_CHECK_HEADERS([nghttp2/nghttp2.h],,, [AC_INCLUDES_DEFAULT]) + AC_CHECK_DECLS([nghttp2_session_server_new], [], [], [AC_INCLUDES_DEFAULT + #include + ]) +fi + # set static linking for uninstalled libraries if requested AC_SUBST(staticexe) staticexe="" @@ -1551,7 +1585,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([ AC_MSG_RESULT(no)) AC_SEARCH_LIBS([setusercontext], [util]) -AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam endpwent getrlimit setrlimit setsid chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent fsync shmget accept4]) +AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam endpwent getrlimit setrlimit setsid chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent fsync shmget accept4 getifaddrs]) AC_CHECK_FUNCS([setresuid],,[AC_CHECK_FUNCS([setreuid])]) AC_CHECK_FUNCS([setresgid],,[AC_CHECK_FUNCS([setregid])]) @@ -2131,6 +2165,8 @@ void *unbound_stat_realloc_log(void *ptr, size_t size, #define UNBOUND_DNS_PORT 53 /** default port for DNS over TLS traffic. */ #define UNBOUND_DNS_OVER_TLS_PORT 853 +/** default port for DNS over HTTPS traffic. */ +#define UNBOUND_DNS_OVER_HTTPS_PORT 443 /** default port for unbound control traffic, registered port with IANA, ub-dns-control 8953/tcp unbound dns nameserver control */ #define UNBOUND_CONTROL_PORT 8953 Modified: stable/11/contrib/unbound/contrib/aaaa-filter-iterator.patch ============================================================================== --- stable/11/contrib/unbound/contrib/aaaa-filter-iterator.patch Sat Nov 28 15:46:40 2020 (r368128) +++ stable/11/contrib/unbound/contrib/aaaa-filter-iterator.patch Sat Nov 28 18:09:16 2020 (r368129) @@ -1,10 +1,10 @@ -Index: trunk/doc/unbound.conf.5.in -=================================================================== ---- trunk/doc/unbound.conf.5.in (revision 4357) -+++ trunk/doc/unbound.conf.5.in (working copy) -@@ -701,6 +701,13 @@ +diff --git a/doc/unbound.conf.5.in b/doc/unbound.conf.5.in +index f426ac5f..147fbfa9 100644 +--- a/doc/unbound.conf.5.in ++++ b/doc/unbound.conf.5.in *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Nov 28 18:09:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B8664A6A62; Sat, 28 Nov 2020 18:09:22 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cjzz575Njz4b1c; Sat, 28 Nov 2020 18:09:21 +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 E3FA22B826; Sat, 28 Nov 2020 18:09:21 +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 0ASI9LmI025711; Sat, 28 Nov 2020 18:09:21 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ASI9JJc025702; Sat, 28 Nov 2020 18:09:19 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202011281809.0ASI9JJc025702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 28 Nov 2020 18:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368129 - in stable: 11/contrib/unbound 11/contrib/unbound/contrib 11/contrib/unbound/daemon 11/contrib/unbound/dnstap 11/contrib/unbound/doc 11/contrib/unbound/dynlibmod 11/contrib/unb... X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/unbound 11/contrib/unbound/contrib 11/contrib/unbound/daemon 11/contrib/unbound/dnstap 11/contrib/unbound/doc 11/contrib/unbound/dynlibmod 11/contrib/unbound/iterator 11/contrib/... X-SVN-Commit-Revision: 368129 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 18:09:22 -0000 Author: cy Date: Sat Nov 28 18:09:16 2020 New Revision: 368129 URL: https://svnweb.freebsd.org/changeset/base/368129 Log: MFC r367094: MFV r367082: Update unbound 1.11.0 --> 1.12.0. Modified: stable/12/contrib/unbound/Makefile.in stable/12/contrib/unbound/README.md stable/12/contrib/unbound/acx_nlnetlabs.m4 stable/12/contrib/unbound/config.guess stable/12/contrib/unbound/config.h.in stable/12/contrib/unbound/config.sub stable/12/contrib/unbound/configure stable/12/contrib/unbound/configure.ac stable/12/contrib/unbound/contrib/aaaa-filter-iterator.patch stable/12/contrib/unbound/contrib/unbound.service.in stable/12/contrib/unbound/contrib/unbound_munin_ stable/12/contrib/unbound/daemon/daemon.c stable/12/contrib/unbound/daemon/remote.c stable/12/contrib/unbound/daemon/stats.c stable/12/contrib/unbound/daemon/unbound.c stable/12/contrib/unbound/daemon/worker.c stable/12/contrib/unbound/dnstap/dnstap.c stable/12/contrib/unbound/dnstap/dnstap.h stable/12/contrib/unbound/dnstap/dtstream.c stable/12/contrib/unbound/dnstap/dtstream.h stable/12/contrib/unbound/dnstap/unbound-dnstap-socket.c stable/12/contrib/unbound/doc/Changelog stable/12/contrib/unbound/doc/README stable/12/contrib/unbound/doc/example.conf.in stable/12/contrib/unbound/doc/libunbound.3.in stable/12/contrib/unbound/doc/unbound-anchor.8.in stable/12/contrib/unbound/doc/unbound-checkconf.8.in stable/12/contrib/unbound/doc/unbound-control.8.in stable/12/contrib/unbound/doc/unbound-host.1.in stable/12/contrib/unbound/doc/unbound.8.in stable/12/contrib/unbound/doc/unbound.conf.5.in stable/12/contrib/unbound/dynlibmod/dynlibmod.c stable/12/contrib/unbound/iterator/iterator.c stable/12/contrib/unbound/libunbound/context.c stable/12/contrib/unbound/libunbound/libunbound.c stable/12/contrib/unbound/libunbound/libworker.c stable/12/contrib/unbound/libunbound/unbound.h stable/12/contrib/unbound/services/cache/dns.c stable/12/contrib/unbound/services/listen_dnsport.c stable/12/contrib/unbound/services/listen_dnsport.h stable/12/contrib/unbound/services/mesh.c stable/12/contrib/unbound/services/mesh.h stable/12/contrib/unbound/services/outside_network.c stable/12/contrib/unbound/services/rpz.c stable/12/contrib/unbound/sldns/parseutil.c stable/12/contrib/unbound/sldns/parseutil.h stable/12/contrib/unbound/sldns/rrdef.h stable/12/contrib/unbound/smallapp/unbound-checkconf.c stable/12/contrib/unbound/smallapp/unbound-control.c stable/12/contrib/unbound/util/config_file.c stable/12/contrib/unbound/util/config_file.h stable/12/contrib/unbound/util/configlexer.lex stable/12/contrib/unbound/util/configparser.y stable/12/contrib/unbound/util/edns.c stable/12/contrib/unbound/util/edns.h stable/12/contrib/unbound/util/fptr_wlist.c stable/12/contrib/unbound/util/iana_ports.inc stable/12/contrib/unbound/util/mini_event.h stable/12/contrib/unbound/util/module.h stable/12/contrib/unbound/util/net_help.c stable/12/contrib/unbound/util/net_help.h stable/12/contrib/unbound/util/netevent.c stable/12/contrib/unbound/util/netevent.h stable/12/contrib/unbound/validator/val_anchor.c stable/12/contrib/unbound/validator/val_anchor.h stable/12/contrib/unbound/validator/val_neg.c stable/12/contrib/unbound/validator/val_neg.h stable/12/contrib/unbound/validator/val_nsec.c stable/12/contrib/unbound/validator/val_nsec.h stable/12/contrib/unbound/validator/validator.c stable/12/contrib/unbound/validator/validator.h stable/12/usr.sbin/unbound/config.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/unbound/Makefile.in stable/11/contrib/unbound/README.md stable/11/contrib/unbound/acx_nlnetlabs.m4 stable/11/contrib/unbound/config.guess stable/11/contrib/unbound/config.h.in stable/11/contrib/unbound/config.sub stable/11/contrib/unbound/configure stable/11/contrib/unbound/configure.ac stable/11/contrib/unbound/contrib/aaaa-filter-iterator.patch stable/11/contrib/unbound/contrib/unbound.service.in stable/11/contrib/unbound/contrib/unbound_munin_ stable/11/contrib/unbound/daemon/daemon.c stable/11/contrib/unbound/daemon/remote.c stable/11/contrib/unbound/daemon/stats.c stable/11/contrib/unbound/daemon/unbound.c stable/11/contrib/unbound/daemon/worker.c stable/11/contrib/unbound/dnstap/dnstap.c stable/11/contrib/unbound/dnstap/dnstap.h stable/11/contrib/unbound/dnstap/dtstream.c stable/11/contrib/unbound/dnstap/dtstream.h stable/11/contrib/unbound/dnstap/unbound-dnstap-socket.c stable/11/contrib/unbound/doc/Changelog stable/11/contrib/unbound/doc/README stable/11/contrib/unbound/doc/example.conf.in stable/11/contrib/unbound/doc/libunbound.3.in stable/11/contrib/unbound/doc/unbound-anchor.8.in stable/11/contrib/unbound/doc/unbound-checkconf.8.in stable/11/contrib/unbound/doc/unbound-control.8.in stable/11/contrib/unbound/doc/unbound-host.1.in stable/11/contrib/unbound/doc/unbound.8.in stable/11/contrib/unbound/doc/unbound.conf.5.in stable/11/contrib/unbound/dynlibmod/dynlibmod.c stable/11/contrib/unbound/iterator/iterator.c stable/11/contrib/unbound/libunbound/context.c stable/11/contrib/unbound/libunbound/libunbound.c stable/11/contrib/unbound/libunbound/libworker.c stable/11/contrib/unbound/libunbound/unbound.h stable/11/contrib/unbound/services/cache/dns.c stable/11/contrib/unbound/services/listen_dnsport.c stable/11/contrib/unbound/services/listen_dnsport.h stable/11/contrib/unbound/services/mesh.c stable/11/contrib/unbound/services/mesh.h stable/11/contrib/unbound/services/outside_network.c stable/11/contrib/unbound/services/rpz.c stable/11/contrib/unbound/sldns/parseutil.c stable/11/contrib/unbound/sldns/parseutil.h stable/11/contrib/unbound/sldns/rrdef.h stable/11/contrib/unbound/smallapp/unbound-checkconf.c stable/11/contrib/unbound/smallapp/unbound-control.c stable/11/contrib/unbound/util/config_file.c stable/11/contrib/unbound/util/config_file.h stable/11/contrib/unbound/util/configlexer.lex stable/11/contrib/unbound/util/configparser.y stable/11/contrib/unbound/util/edns.c stable/11/contrib/unbound/util/edns.h stable/11/contrib/unbound/util/fptr_wlist.c stable/11/contrib/unbound/util/iana_ports.inc stable/11/contrib/unbound/util/mini_event.h stable/11/contrib/unbound/util/module.h stable/11/contrib/unbound/util/net_help.c stable/11/contrib/unbound/util/net_help.h stable/11/contrib/unbound/util/netevent.c stable/11/contrib/unbound/util/netevent.h stable/11/contrib/unbound/validator/val_anchor.c stable/11/contrib/unbound/validator/val_anchor.h stable/11/contrib/unbound/validator/val_neg.c stable/11/contrib/unbound/validator/val_neg.h stable/11/contrib/unbound/validator/val_nsec.c stable/11/contrib/unbound/validator/val_nsec.h stable/11/contrib/unbound/validator/validator.c stable/11/contrib/unbound/validator/validator.h stable/11/usr.sbin/unbound/config.h Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/unbound/Makefile.in ============================================================================== --- stable/12/contrib/unbound/Makefile.in Sat Nov 28 15:46:40 2020 (r368128) +++ stable/12/contrib/unbound/Makefile.in Sat Nov 28 18:09:16 2020 (r368129) @@ -231,6 +231,10 @@ STREAMTCP_SRC=testcode/streamtcp.c STREAMTCP_OBJ=streamtcp.lo STREAMTCP_OBJ_LINK=$(STREAMTCP_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ) \ $(SLDNS_OBJ) +DOHCLIENT_SRC=testcode/dohclient.c +DOHCLIENT_OBJ=dohclient.lo +DOHCLIENT_OBJ_LINK=$(DOHCLIENT_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ) \ +$(SLDNS_OBJ) PERF_SRC=testcode/perf.c PERF_OBJ=perf.lo PERF_OBJ_LINK=$(PERF_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ) $(SLDNS_OBJ) @@ -272,7 +276,8 @@ ALL_SRC=$(COMMON_SRC) $(UNITTEST_SRC) $(DAEMON_SRC) \ $(ASYNCLOOK_SRC) $(STREAMTCP_SRC) $(PERF_SRC) $(DELAYER_SRC) \ $(CONTROL_SRC) $(UBANCHOR_SRC) $(PETAL_SRC) $(DNSTAP_SOCKET_SRC)\ $(PYTHONMOD_SRC) $(PYUNBOUND_SRC) $(WIN_DAEMON_THE_SRC) \ - $(SVCINST_SRC) $(SVCUNINST_SRC) $(ANCHORUPD_SRC) $(SLDNS_SRC) + $(SVCINST_SRC) $(SVCUNINST_SRC) $(ANCHORUPD_SRC) $(SLDNS_SRC) \ + $(DOHCLIENT_SRC) ALL_OBJ=$(COMMON_OBJ) $(UNITTEST_OBJ) $(DAEMON_OBJ) \ $(TESTBOUND_OBJ) $(LOCKVERIFY_OBJ) $(PKTVIEW_OBJ) \ @@ -280,7 +285,8 @@ ALL_OBJ=$(COMMON_OBJ) $(UNITTEST_OBJ) $(DAEMON_OBJ) \ $(ASYNCLOOK_OBJ) $(STREAMTCP_OBJ) $(PERF_OBJ) $(DELAYER_OBJ) \ $(CONTROL_OBJ) $(UBANCHOR_OBJ) $(PETAL_OBJ) $(DNSTAP_SOCKET_OBJ)\ $(COMPAT_OBJ) $(PYUNBOUND_OBJ) \ - $(SVCINST_OBJ) $(SVCUNINST_OBJ) $(ANCHORUPD_OBJ) $(SLDNS_OBJ) + $(SVCINST_OBJ) $(SVCUNINST_OBJ) $(ANCHORUPD_OBJ) $(SLDNS_OBJ) \ + $(DOHCLIENT_OBJ) COMPILE=$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) @PTHREAD_CFLAGS_ONLY@ LINK=$(LIBTOOL) --tag=CC --mode=link $(CC) $(staticexe) $(RUNTIME_PATH) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) @@ -317,7 +323,7 @@ rsrc_unbound_checkconf.o: $(srcdir)/winrc/rsrc_unbound TEST_BIN=asynclook$(EXEEXT) delayer$(EXEEXT) \ lock-verify$(EXEEXT) memstats$(EXEEXT) perf$(EXEEXT) \ petal$(EXEEXT) pktview$(EXEEXT) streamtcp$(EXEEXT) \ - unbound-dnstap-socket$(EXEEXT) \ + unbound-dnstap-socket$(EXEEXT) dohclient$(EXEEXT) \ testbound$(EXEEXT) unittest$(EXEEXT) tests: all $(TEST_BIN) @@ -387,6 +393,9 @@ asynclook$(EXEEXT): $(ASYNCLOOK_OBJ_LINK) libunbound.l streamtcp$(EXEEXT): $(STREAMTCP_OBJ_LINK) $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) +dohclient$(EXEEXT): $(DOHCLIENT_OBJ_LINK) + $(LINK) -o $@ $(DOHCLIENT_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + perf$(EXEEXT): $(PERF_OBJ_LINK) $(LINK) -o $@ $(PERF_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) @@ -672,7 +681,7 @@ dns.lo dns.o: $(srcdir)/services/cache/dns.c config.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/validator/val_utils.h $(srcdir)/sldns/pkthdr.h $(srcdir)/services/cache/dns.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/dname.h $(srcdir)/util/module.h \ $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/sldns/sbuffer.h infra.lo infra.o: $(srcdir)/services/cache/infra.c config.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/services/cache/infra.h \ @@ -713,10 +722,11 @@ msgreply.lo msgreply.o: $(srcdir)/util/data/msgreply.c $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/respip/respip.h -packed_rrset.lo packed_rrset.o: $(srcdir)/util/data/packed_rrset.c config.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/alloc.h $(srcdir)/util/regional.h \ - $(srcdir)/util/net_help.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h +packed_rrset.lo packed_rrset.o: $(srcdir)/util/data/packed_rrset.c config.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/storage/lookup3.h $(srcdir)/util/alloc.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h iterator.lo iterator.o: $(srcdir)/iterator/iterator.c config.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/module.h \ @@ -785,7 +795,7 @@ listen_dnsport.lo listen_dnsport.o: $(srcdir)/services $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/log.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ @@ -808,10 +818,10 @@ mesh.lo mesh.o: $(srcdir)/services/mesh.c config.h $(s $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/dns.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/regional.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ - $(srcdir)/util/alloc.h $(srcdir)/util/edns.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/data/dname.h \ - $(srcdir)/services/listen_dnsport.h + $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/alloc.h \ + $(srcdir)/util/edns.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/data/dname.h $(srcdir)/services/listen_dnsport.h modstack.lo modstack.o: $(srcdir)/services/modstack.c config.h $(srcdir)/services/modstack.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ @@ -1204,7 +1214,8 @@ testpkts.lo testpkts.o: $(srcdir)/testcode/testpkts.c $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h unitldns.lo unitldns.o: $(srcdir)/testcode/unitldns.c config.h $(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/sldns/parseutil.h unitecs.lo unitecs.o: $(srcdir)/testcode/unitecs.c config.h unitauth.lo unitauth.o: $(srcdir)/testcode/unitauth.c config.h $(srcdir)/services/authzone.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ @@ -1310,7 +1321,8 @@ worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h + $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h \ + $(srcdir)/dnstap/dtstream.h testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h \ @@ -1344,7 +1356,8 @@ worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h + $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h \ + $(srcdir)/dnstap/dtstream.h acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ @@ -1507,6 +1520,12 @@ unbound-control.lo unbound-control.o: $(srcdir)/smalla unbound-anchor.lo unbound-anchor.o: $(srcdir)/smallapp/unbound-anchor.c config.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h petal.lo petal.o: $(srcdir)/testcode/petal.c config.h +unbound-dnstap-socket.lo unbound-dnstap-socket.o: $(srcdir)/dnstap/unbound-dnstap-socket.c config.h \ + $(srcdir)/dnstap/dtstream.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/dnstap/dnstap_fstrm.h \ + $(srcdir)/util/ub_event.h $(srcdir)/util/net_help.h $(srcdir)/services/listen_dnsport.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h pythonmod_utils.lo pythonmod_utils.o: $(srcdir)/pythonmod/pythonmod_utils.c config.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ @@ -1542,6 +1561,10 @@ parseutil.lo parseutil.o: $(srcdir)/sldns/parseutil.c rrdef.lo rrdef.o: $(srcdir)/sldns/rrdef.c config.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h str2wire.lo str2wire.o: $(srcdir)/sldns/str2wire.c config.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h \ $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parse.h $(srcdir)/sldns/parseutil.h +dohclient.lo dohclient.o: $(srcdir)/testcode/dohclient.c config.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgencode.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/net_help.h ctime_r.lo ctime_r.o: $(srcdir)/compat/ctime_r.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h fake-rfc2553.lo fake-rfc2553.o: $(srcdir)/compat/fake-rfc2553.c $(srcdir)/compat/fake-rfc2553.h config.h gmtime_r.lo gmtime_r.o: $(srcdir)/compat/gmtime_r.c config.h Modified: stable/12/contrib/unbound/README.md ============================================================================== --- stable/12/contrib/unbound/README.md Sat Nov 28 15:46:40 2020 (r368128) +++ stable/12/contrib/unbound/README.md Sat Nov 28 18:09:16 2020 (r368129) @@ -9,7 +9,7 @@ fast and lean and incorporates modern features based o have any feedback, we would love to hear from you. Don’t hesitate to [create an issue on Github](https://github.com/NLnetLabs/unbound/issues/new) or post a message on the [Unbound mailing list](https://lists.nlnetlabs.nl/mailman/listinfo/unbound-users). -You can lean more about Unbound by reading our +You can learn more about Unbound by reading our [documentation](https://nlnetlabs.nl/documentation/unbound/). ## Compiling Modified: stable/12/contrib/unbound/acx_nlnetlabs.m4 ============================================================================== --- stable/12/contrib/unbound/acx_nlnetlabs.m4 Sat Nov 28 15:46:40 2020 (r368128) +++ stable/12/contrib/unbound/acx_nlnetlabs.m4 Sat Nov 28 18:09:16 2020 (r368129) @@ -2,7 +2,8 @@ # Copyright 2009, Wouter Wijngaards, NLnet Labs. # BSD licensed. # -# Version 34 +# Version 35 +# 2020-08-24 Use EVP_sha256 instead of HMAC_Update (for openssl-3.0.0). # 2016-03-21 Check -ldl -pthread for libcrypto for ldns and openssl 1.1.0. # 2016-03-21 Use HMAC_Update instead of HMAC_CTX_Init (for openssl-1.1.0). # 2016-01-04 -D_DEFAULT_SOURCE defined with -D_BSD_SOURCE for Linux glibc 2.20 @@ -673,16 +674,16 @@ AC_DEFUN([ACX_SSL_CHECKS], [ ACX_RUNTIME_PATH_ADD([$ssldir/lib]) fi - AC_MSG_CHECKING([for HMAC_Update in -lcrypto]) + AC_MSG_CHECKING([for EVP_sha256 in -lcrypto]) LIBS="$LIBS -lcrypto" LIBSSL_LIBS="$LIBSSL_LIBS -lcrypto" AC_TRY_LINK(, [ - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ], [ AC_MSG_RESULT(yes) - AC_DEFINE([HAVE_HMAC_UPDATE], 1, - [If you have HMAC_Update]) + AC_DEFINE([HAVE_EVP_SHA256], 1, + [If you have EVP_sha256]) ], [ AC_MSG_RESULT(no) # check if -lwsock32 or -lgdi32 are needed. @@ -692,11 +693,11 @@ AC_DEFUN([ACX_SSL_CHECKS], [ LIBSSL_LIBS="$LIBSSL_LIBS -lgdi32 -lws2_32" AC_MSG_CHECKING([if -lcrypto needs -lgdi32]) AC_TRY_LINK([], [ - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ],[ - AC_DEFINE([HAVE_HMAC_UPDATE], 1, - [If you have HMAC_Update]) + AC_DEFINE([HAVE_EVP_SHA256], 1, + [If you have EVP_sha256]) AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no) @@ -706,11 +707,11 @@ AC_DEFUN([ACX_SSL_CHECKS], [ LIBSSL_LIBS="$LIBSSL_LIBS -ldl" AC_MSG_CHECKING([if -lcrypto needs -ldl]) AC_TRY_LINK([], [ - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ],[ - AC_DEFINE([HAVE_HMAC_UPDATE], 1, - [If you have HMAC_Update]) + AC_DEFINE([HAVE_EVP_SHA256], 1, + [If you have EVP_sha256]) AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no) @@ -720,11 +721,11 @@ AC_DEFUN([ACX_SSL_CHECKS], [ LIBSSL_LIBS="$LIBSSL_LIBS -ldl -pthread" AC_MSG_CHECKING([if -lcrypto needs -ldl -pthread]) AC_TRY_LINK([], [ - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ],[ - AC_DEFINE([HAVE_HMAC_UPDATE], 1, - [If you have HMAC_Update]) + AC_DEFINE([HAVE_EVP_SHA256], 1, + [If you have EVP_sha256]) AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no) Modified: stable/12/contrib/unbound/config.guess ============================================================================== --- stable/12/contrib/unbound/config.guess Sat Nov 28 15:46:40 2020 (r368128) +++ stable/12/contrib/unbound/config.guess Sat Nov 28 18:09:16 2020 (r368129) @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2020 Free Software Foundation, Inc. -timestamp='2020-07-12' +timestamp='2020-09-19' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -150,17 +150,15 @@ Linux|GNU|GNU/*) #elif defined(__dietlibc__) LIBC=dietlibc #else + #include + #ifdef __DEFINED_va_list + LIBC=musl + #else LIBC=gnu #endif + #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" - - # If ldd exists, use it to detect musl libc. - if command -v ldd >/dev/null && \ - ldd --version 2>&1 | grep -q ^musl - then - LIBC=musl - fi ;; esac @@ -404,7 +402,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNA # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null @@ -544,10 +542,10 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ - [ "$TARGET_BINARY_INTERFACE"x = x ] + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then echo m88k-dg-dgux"$UNAME_RELEASE" else @@ -580,7 +578,7 @@ EOF echo i386-ibm-aix exit ;; ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then + if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" @@ -620,7 +618,7 @@ EOF else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then + if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else @@ -655,7 +653,7 @@ EOF 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then + if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in @@ -669,7 +667,7 @@ EOF esac ;; esac fi - if [ "$HP_ARCH" = "" ]; then + if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -708,7 +706,7 @@ EOF test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ "$HP_ARCH" = hppa2.0w ] + if test "$HP_ARCH" = hppa2.0w then set_cc_for_build @@ -782,7 +780,7 @@ EOF echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then + if test -x /usr/sbin/sysversion ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 @@ -1097,7 +1095,7 @@ EOF x86_64:Linux:*:*) set_cc_for_build LIBCABI=$LIBC - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_X32 >/dev/null @@ -1294,7 +1292,7 @@ EOF echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then + if test -d /usr/nec; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" @@ -1359,7 +1357,7 @@ EOF else set_cc_for_build fi - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null Modified: stable/12/contrib/unbound/config.h.in ============================================================================== --- stable/12/contrib/unbound/config.h.in Sat Nov 28 15:46:40 2020 (r368128) +++ stable/12/contrib/unbound/config.h.in Sat Nov 28 18:09:16 2020 (r368129) @@ -113,6 +113,10 @@ don't. */ #undef HAVE_DECL_INET_PTON +/* Define to 1 if you have the declaration of `nghttp2_session_server_new', + and to 0 if you don't. */ +#undef HAVE_DECL_NGHTTP2_SESSION_SERVER_NEW + /* Define to 1 if you have the declaration of `NID_ED25519', and to 0 if you don't. */ #undef HAVE_DECL_NID_ED25519 @@ -221,6 +225,9 @@ /* Define to 1 if you have the `EVP_EncryptInit_ex' function. */ #undef HAVE_EVP_ENCRYPTINIT_EX +/* Define to 1 if you have the `EVP_MAC_CTX_set_params' function. */ +#undef HAVE_EVP_MAC_CTX_SET_PARAMS + /* Define to 1 if you have the `EVP_MD_CTX_new' function. */ #undef HAVE_EVP_MD_CTX_NEW @@ -269,6 +276,9 @@ /* Define to 1 if you have the `getentropy' function. */ #undef HAVE_GETENTROPY +/* Define to 1 if you have the `getifaddrs' function. */ +#undef HAVE_GETIFADDRS + /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H @@ -296,12 +306,12 @@ /* Define to 1 if you have the `HMAC_Init_ex' function. */ #undef HAVE_HMAC_INIT_EX -/* If you have HMAC_Update */ -#undef HAVE_HMAC_UPDATE - /* If we have htobe64 */ #undef HAVE_HTOBE64 +/* Define to 1 if you have the header file. */ +#undef HAVE_IFADDRS_H + /* Define to 1 if you have the `inet_aton' function. */ #undef HAVE_INET_ATON @@ -371,6 +381,15 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETTLE_EDDSA_H +/* Define to 1 if you have the header file. */ +#undef HAVE_NET_IF_H + +/* Define this to use nghttp2 client. */ +#undef HAVE_NGHTTP2 + +/* Define to 1 if you have the header file. */ +#undef HAVE_NGHTTP2_NGHTTP2_H + /* Use libnss for crypto */ #undef HAVE_NSS @@ -497,6 +516,9 @@ /* Define if you have the SSL libraries installed. */ #undef HAVE_SSL +/* Define to 1 if you have the `SSL_CTX_set_alpn_select_cb' function. */ +#undef HAVE_SSL_CTX_SET_ALPN_SELECT_CB + /* Define to 1 if you have the `SSL_CTX_set_ciphersuites' function. */ #undef HAVE_SSL_CTX_SET_CIPHERSUITES @@ -573,6 +595,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_RESOURCE_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SHA2_H @@ -1358,6 +1383,8 @@ void *unbound_stat_realloc_log(void *ptr, size_t size, #define UNBOUND_DNS_PORT 53 /** default port for DNS over TLS traffic. */ #define UNBOUND_DNS_OVER_TLS_PORT 853 +/** default port for DNS over HTTPS traffic. */ +#define UNBOUND_DNS_OVER_HTTPS_PORT 443 /** default port for unbound control traffic, registered port with IANA, ub-dns-control 8953/tcp unbound dns nameserver control */ #define UNBOUND_CONTROL_PORT 8953 Modified: stable/12/contrib/unbound/config.sub ============================================================================== --- stable/12/contrib/unbound/config.sub Sat Nov 28 15:46:40 2020 (r368128) +++ stable/12/contrib/unbound/config.sub Sat Nov 28 18:09:16 2020 (r368129) @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2020 Free Software Foundation, Inc. -timestamp='2020-07-10' +timestamp='2020-09-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -1278,7 +1278,7 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x$basic_os != x ] +if test x$basic_os != x then # First recognize some ad-hoc caes, or perhaps split kernel-os, or else just @@ -1367,13 +1367,7 @@ case $os in os=psos ;; qnx*) - case $cpu in - x86 | i*86) - ;; - *) - os=nto-$os - ;; - esac + os=qnx ;; hiux*) os=hiuxwe2 @@ -1722,7 +1716,7 @@ case $os in | skyos* | haiku* | rdos* | toppers* | drops* | es* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ - | nsk* | powerunix* | genode* | zvmoe* ) + | nsk* | powerunix* | genode* | zvmoe* | qnx* ) ;; # This one is extra strict with allowed versions sco3.2v2 | sco3.2v[4-9]* | sco5v6*) @@ -1740,6 +1734,8 @@ esac # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) + ;; + uclinux-uclibc* ) ;; -dietlibc* | -newlib* | -musl* | -uclibc* ) # These are just libc implementations, not actual OSes, and thus Modified: stable/12/contrib/unbound/configure ============================================================================== --- stable/12/contrib/unbound/configure Sat Nov 28 15:46:40 2020 (r368128) +++ stable/12/contrib/unbound/configure Sat Nov 28 18:09:16 2020 (r368129) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for unbound 1.11.0. +# Generated by GNU Autoconf 2.69 for unbound 1.12.0. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='unbound' PACKAGE_TARNAME='unbound' -PACKAGE_VERSION='1.11.0' -PACKAGE_STRING='unbound 1.11.0' +PACKAGE_VERSION='1.12.0' +PACKAGE_STRING='unbound 1.12.0' PACKAGE_BUGREPORT='unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues' PACKAGE_URL='' @@ -882,6 +882,7 @@ enable_tfo_server with_libevent with_libexpat with_libhiredis +with_libnghttp2 enable_static_exe enable_fully_static enable_lock_checks @@ -1458,7 +1459,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 unbound 1.11.0 to adapt to many kinds of systems. +\`configure' configures unbound 1.12.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1523,7 +1524,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of unbound 1.11.0:";; + short | recursive ) echo "Configuration of unbound 1.12.0:";; esac cat <<\_ACEOF @@ -1642,6 +1643,7 @@ Optional Packages: outgoing port ranges. --with-libexpat=path specify explicit path for libexpat. --with-libhiredis=path specify explicit path for libhiredis. + --with-libnghttp2=path specify explicit path for libnghttp2. --with-dnstap-socket-path=pathname set default dnstap socket path --with-protobuf-c=path Path where protobuf-c is installed, for dnstap @@ -1750,7 +1752,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -unbound configure 1.11.0 +unbound configure 1.12.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2459,7 +2461,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 unbound $as_me 1.11.0, which was +It was created by unbound $as_me 1.12.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2809,13 +2811,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu UNBOUND_VERSION_MAJOR=1 -UNBOUND_VERSION_MINOR=11 +UNBOUND_VERSION_MINOR=12 UNBOUND_VERSION_MICRO=0 LIBUNBOUND_CURRENT=9 -LIBUNBOUND_REVISION=9 +LIBUNBOUND_REVISION=10 LIBUNBOUND_AGE=1 # 1.0.0 had 0:12:0 # 1.0.1 had 0:13:0 @@ -2892,6 +2894,7 @@ LIBUNBOUND_AGE=1 # 1.10.0 had 9:7:1 # 1.10.1 had 9:8:1 # 1.11.0 had 9:9:1 +# 1.12.0 had 9:10:1 # Current -- the number of the binary API that we're implementing # Revision -- which iteration of the implementation of the binary @@ -14725,7 +14728,7 @@ $as_echo "no" >&6; } fi # Checks for header files. -for ac_header in stdarg.h stdbool.h netinet/in.h netinet/tcp.h sys/param.h sys/socket.h sys/un.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h endian.h sys/endian.h libkern/OSByteOrder.h sys/ipc.h sys/shm.h +for ac_header in stdarg.h stdbool.h netinet/in.h netinet/tcp.h sys/param.h sys/select.h sys/socket.h sys/un.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h endian.h sys/endian.h libkern/OSByteOrder.h sys/ipc.h sys/shm.h ifaddrs.h net/if.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default @@ -17942,8 +17945,8 @@ $as_echo "found in $ssldir" >&6; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HMAC_Update in -lcrypto" >&5 -$as_echo_n "checking for HMAC_Update in -lcrypto... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_sha256 in -lcrypto" >&5 +$as_echo_n "checking for EVP_sha256 in -lcrypto... " >&6; } LIBS="$LIBS -lcrypto" LIBSSL_LIBS="$LIBSSL_LIBS -lcrypto" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17953,8 +17956,8 @@ int main () { - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ; return 0; @@ -17965,7 +17968,7 @@ if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -$as_echo "#define HAVE_HMAC_UPDATE 1" >>confdefs.h +$as_echo "#define HAVE_EVP_SHA256 1" >>confdefs.h else @@ -17986,8 +17989,8 @@ int main () { - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ; return 0; @@ -17996,7 +17999,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : -$as_echo "#define HAVE_HMAC_UPDATE 1" >>confdefs.h +$as_echo "#define HAVE_EVP_SHA256 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -18018,8 +18021,8 @@ int main () { - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ; return 0; @@ -18028,7 +18031,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : -$as_echo "#define HAVE_HMAC_UPDATE 1" >>confdefs.h +$as_echo "#define HAVE_EVP_SHA256 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -18050,8 +18053,8 @@ int main () { - int HMAC_Update(void); - (void)HMAC_Update(); + int EVP_sha256(void); + (void)EVP_sha256(); ; return 0; @@ -18060,7 +18063,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : -$as_echo "#define HAVE_HMAC_UPDATE 1" >>confdefs.h +$as_echo "#define HAVE_EVP_SHA256 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -18245,11 +18248,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char HMAC_Update (); +char EVP_sha256 (); int main () { -return HMAC_Update (); +return EVP_sha256 (); ; return 0; } @@ -18340,7 +18343,7 @@ fi done -for ac_func in OPENSSL_config EVP_sha1 EVP_sha256 EVP_sha512 FIPS_mode EVP_MD_CTX_new OpenSSL_add_all_digests OPENSSL_init_crypto EVP_cleanup ENGINE_cleanup ERR_load_crypto_strings CRYPTO_cleanup_all_ex_data ERR_free_strings RAND_cleanup DSA_SIG_set0 EVP_dss1 EVP_DigestVerify EVP_aes_256_cbc EVP_EncryptInit_ex HMAC_Init_ex CRYPTO_THREADID_set_callback +for ac_func in OPENSSL_config EVP_sha1 EVP_sha256 EVP_sha512 FIPS_mode EVP_MD_CTX_new OpenSSL_add_all_digests OPENSSL_init_crypto EVP_cleanup ENGINE_cleanup ERR_load_crypto_strings CRYPTO_cleanup_all_ex_data ERR_free_strings RAND_cleanup DSA_SIG_set0 EVP_dss1 EVP_DigestVerify EVP_aes_256_cbc EVP_EncryptInit_ex HMAC_Init_ex CRYPTO_THREADID_set_callback EVP_MAC_CTX_set_params do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -18356,7 +18359,7 @@ done # these check_funcs need -lssl BAKLIBS="$LIBS" LIBS="-lssl $LIBS" -for ac_func in OPENSSL_init_ssl SSL_CTX_set_security_level SSL_set1_host SSL_get0_peername X509_VERIFY_PARAM_set1_host SSL_CTX_set_ciphersuites SSL_CTX_set_tlsext_ticket_key_evp_cb +for ac_func in OPENSSL_init_ssl SSL_CTX_set_security_level SSL_set1_host SSL_get0_peername X509_VERIFY_PARAM_set1_host SSL_CTX_set_ciphersuites SSL_CTX_set_tlsext_ticket_key_evp_cb SSL_CTX_set_alpn_select_cb do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -19668,6 +19671,70 @@ _ACEOF fi +# nghttp2 + +# Check whether --with-libnghttp2 was given. +if test "${with_libnghttp2+set}" = set; then : + withval=$with_libnghttp2; +else + withval="no" +fi + +found_libnghttp2="no" +if test x_$withval = x_yes -o x_$withval != x_no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libnghttp2" >&5 +$as_echo_n "checking for libnghttp2... " >&6; } + if test x_$withval = x_ -o x_$withval = x_yes; then + withval="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr" + fi + for dir in $withval ; do + if test -f "$dir/include/nghttp2/nghttp2.h"; then + found_libnghttp2="yes" + if test "$dir" != "/usr"; then + CPPFLAGS="$CPPFLAGS -I$dir/include" + LDFLAGS="$LDFLAGS -L$dir/lib" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found in $dir" >&5 +$as_echo "found in $dir" >&6; } + +$as_echo "#define HAVE_NGHTTP2 1" >>confdefs.h + + LIBS="$LIBS -lnghttp2" + break; + fi + done + if test x_$found_libnghttp2 != x_yes; then + as_fn_error $? "Could not find libnghttp2, nghttp2.h" "$LINENO" 5 + fi + for ac_header in nghttp2/nghttp2.h +do : + ac_fn_c_check_header_compile "$LINENO" "nghttp2/nghttp2.h" "ac_cv_header_nghttp2_nghttp2_h" "$ac_includes_default +" +if test "x$ac_cv_header_nghttp2_nghttp2_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NGHTTP2_NGHTTP2_H 1 +_ACEOF + +fi + +done + + ac_fn_c_check_decl "$LINENO" "nghttp2_session_server_new" "ac_cv_have_decl_nghttp2_session_server_new" "$ac_includes_default + #include + +" +if test "x$ac_cv_have_decl_nghttp2_session_server_new" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NGHTTP2_SESSION_SERVER_NEW $ac_have_decl +_ACEOF + +fi + # set static linking for uninstalled libraries if requested staticexe="" @@ -20223,7 +20290,7 @@ if test "$ac_res" != no; then : fi -for ac_func in tzset sigprocmask fcntl getpwnam endpwent getrlimit setrlimit setsid chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent fsync shmget accept4 +for ac_func in tzset sigprocmask fcntl getpwnam endpwent getrlimit setrlimit setsid chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent fsync shmget accept4 getifaddrs do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -21619,7 +21686,7 @@ _ACEOF -version=1.11.0 +version=1.12.0 date=`date +'%b %e, %Y'` @@ -22138,7 +22205,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 unbound $as_me 1.11.0, which was +This file was extended by unbound $as_me 1.12.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22204,7 +22271,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="\\ -unbound config.status 1.11.0 +unbound config.status 1.12.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/12/contrib/unbound/configure.ac ============================================================================== --- stable/12/contrib/unbound/configure.ac Sat Nov 28 15:46:40 2020 (r368128) +++ stable/12/contrib/unbound/configure.ac Sat Nov 28 18:09:16 2020 (r368129) @@ -10,7 +10,7 @@ sinclude(dnscrypt/dnscrypt.m4) # must be numbers. ac_defun because of later processing m4_define([VERSION_MAJOR],[1]) -m4_define([VERSION_MINOR],[11]) +m4_define([VERSION_MINOR],[12]) m4_define([VERSION_MICRO],[0]) AC_INIT(unbound, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues, unbound) AC_SUBST(UNBOUND_VERSION_MAJOR, [VERSION_MAJOR]) @@ -18,7 +18,7 @@ AC_SUBST(UNBOUND_VERSION_MINOR, [VERSION_MINOR]) AC_SUBST(UNBOUND_VERSION_MICRO, [VERSION_MICRO]) LIBUNBOUND_CURRENT=9 -LIBUNBOUND_REVISION=9 +LIBUNBOUND_REVISION=10 LIBUNBOUND_AGE=1 # 1.0.0 had 0:12:0 # 1.0.1 had 0:13:0 @@ -95,6 +95,7 @@ LIBUNBOUND_AGE=1 # 1.10.0 had 9:7:1 # 1.10.1 had 9:8:1 # 1.11.0 had 9:9:1 +# 1.12.0 had 9:10:1 # Current -- the number of the binary API that we're implementing # Revision -- which iteration of the implementation of the binary @@ -398,7 +399,7 @@ ACX_LIBTOOL_C_ONLY PKG_PROG_PKG_CONFIG # Checks for header files. -AC_CHECK_HEADERS([stdarg.h stdbool.h netinet/in.h netinet/tcp.h sys/param.h sys/socket.h sys/un.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h endian.h sys/endian.h libkern/OSByteOrder.h sys/ipc.h sys/shm.h],,, [AC_INCLUDES_DEFAULT]) +AC_CHECK_HEADERS([stdarg.h stdbool.h netinet/in.h netinet/tcp.h sys/param.h sys/select.h sys/socket.h sys/un.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h endian.h sys/endian.h libkern/OSByteOrder.h sys/ipc.h sys/shm.h ifaddrs.h net/if.h],,, [AC_INCLUDES_DEFAULT]) # Check for Apple header. This uncovers TARGET_OS_IPHONE, TARGET_OS_TV or TARGET_OS_WATCH AC_CHECK_HEADERS([TargetConditionals.h]) @@ -831,7 +832,7 @@ AC_SUBST(PC_CRYPTO_DEPENDENCY) BAKLIBS="$LIBS" LIBS="-lssl $LIBS" AC_MSG_CHECKING([if libssl needs -lcrypt32]) -AC_TRY_LINK_FUNC([HMAC_Update], [ +AC_TRY_LINK_FUNC([EVP_sha256], [ AC_MSG_RESULT([no]) LIBS="$BAKLIBS" ], [ @@ -851,12 +852,12 @@ else AC_MSG_RESULT([no]) fi AC_CHECK_HEADERS([openssl/conf.h openssl/engine.h openssl/bn.h openssl/dh.h openssl/dsa.h openssl/rsa.h openssl/core_names.h],,, [AC_INCLUDES_DEFAULT]) -AC_CHECK_FUNCS([OPENSSL_config EVP_sha1 EVP_sha256 EVP_sha512 FIPS_mode EVP_MD_CTX_new OpenSSL_add_all_digests OPENSSL_init_crypto EVP_cleanup ENGINE_cleanup ERR_load_crypto_strings CRYPTO_cleanup_all_ex_data ERR_free_strings RAND_cleanup DSA_SIG_set0 EVP_dss1 EVP_DigestVerify EVP_aes_256_cbc EVP_EncryptInit_ex HMAC_Init_ex CRYPTO_THREADID_set_callback]) +AC_CHECK_FUNCS([OPENSSL_config EVP_sha1 EVP_sha256 EVP_sha512 FIPS_mode EVP_MD_CTX_new OpenSSL_add_all_digests OPENSSL_init_crypto EVP_cleanup ENGINE_cleanup ERR_load_crypto_strings CRYPTO_cleanup_all_ex_data ERR_free_strings RAND_cleanup DSA_SIG_set0 EVP_dss1 EVP_DigestVerify EVP_aes_256_cbc EVP_EncryptInit_ex HMAC_Init_ex CRYPTO_THREADID_set_callback EVP_MAC_CTX_set_params]) # these check_funcs need -lssl BAKLIBS="$LIBS" LIBS="-lssl $LIBS" -AC_CHECK_FUNCS([OPENSSL_init_ssl SSL_CTX_set_security_level SSL_set1_host SSL_get0_peername X509_VERIFY_PARAM_set1_host SSL_CTX_set_ciphersuites SSL_CTX_set_tlsext_ticket_key_evp_cb]) +AC_CHECK_FUNCS([OPENSSL_init_ssl SSL_CTX_set_security_level SSL_set1_host SSL_get0_peername X509_VERIFY_PARAM_set1_host SSL_CTX_set_ciphersuites SSL_CTX_set_tlsext_ticket_key_evp_cb SSL_CTX_set_alpn_select_cb]) LIBS="$BAKLIBS" AC_CHECK_DECLS([SSL_COMP_get_compression_methods,sk_SSL_COMP_pop_free,SSL_CTX_set_ecdh_auto], [], [], [ @@ -1395,6 +1396,39 @@ if test x_$withval = x_yes -o x_$withval != x_no; then ]) fi +# nghttp2 +AC_ARG_WITH(libnghttp2, AC_HELP_STRING([--with-libnghttp2=path], + [specify explicit path for libnghttp2.]), + [ ],[ withval="no" ]) +found_libnghttp2="no" +if test x_$withval = x_yes -o x_$withval != x_no; then + AC_MSG_CHECKING(for libnghttp2) + if test x_$withval = x_ -o x_$withval = x_yes; then + withval="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr" + fi + for dir in $withval ; do + if test -f "$dir/include/nghttp2/nghttp2.h"; then + found_libnghttp2="yes" + dnl assume /usr is in default path. + if test "$dir" != "/usr"; then + CPPFLAGS="$CPPFLAGS -I$dir/include" + LDFLAGS="$LDFLAGS -L$dir/lib" + fi + AC_MSG_RESULT(found in $dir) + AC_DEFINE([HAVE_NGHTTP2], [1], [Define this to use nghttp2 client.]) + LIBS="$LIBS -lnghttp2" + break; + fi + done + if test x_$found_libnghttp2 != x_yes; then + AC_ERROR([Could not find libnghttp2, nghttp2.h]) + fi + AC_CHECK_HEADERS([nghttp2/nghttp2.h],,, [AC_INCLUDES_DEFAULT]) + AC_CHECK_DECLS([nghttp2_session_server_new], [], [], [AC_INCLUDES_DEFAULT + #include + ]) +fi + # set static linking for uninstalled libraries if requested AC_SUBST(staticexe) staticexe="" @@ -1551,7 +1585,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([ AC_MSG_RESULT(no)) AC_SEARCH_LIBS([setusercontext], [util]) -AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam endpwent getrlimit setrlimit setsid chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent fsync shmget accept4]) +AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam endpwent getrlimit setrlimit setsid chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent fsync shmget accept4 getifaddrs]) AC_CHECK_FUNCS([setresuid],,[AC_CHECK_FUNCS([setreuid])]) AC_CHECK_FUNCS([setresgid],,[AC_CHECK_FUNCS([setregid])]) @@ -2131,6 +2165,8 @@ void *unbound_stat_realloc_log(void *ptr, size_t size, #define UNBOUND_DNS_PORT 53 /** default port for DNS over TLS traffic. */ #define UNBOUND_DNS_OVER_TLS_PORT 853 +/** default port for DNS over HTTPS traffic. */ +#define UNBOUND_DNS_OVER_HTTPS_PORT 443 /** default port for unbound control traffic, registered port with IANA, ub-dns-control 8953/tcp unbound dns nameserver control */ #define UNBOUND_CONTROL_PORT 8953 Modified: stable/12/contrib/unbound/contrib/aaaa-filter-iterator.patch ============================================================================== --- stable/12/contrib/unbound/contrib/aaaa-filter-iterator.patch Sat Nov 28 15:46:40 2020 (r368128) +++ stable/12/contrib/unbound/contrib/aaaa-filter-iterator.patch Sat Nov 28 18:09:16 2020 (r368129) @@ -1,10 +1,10 @@ -Index: trunk/doc/unbound.conf.5.in -=================================================================== ---- trunk/doc/unbound.conf.5.in (revision 4357) -+++ trunk/doc/unbound.conf.5.in (working copy) -@@ -701,6 +701,13 @@ +diff --git a/doc/unbound.conf.5.in b/doc/unbound.conf.5.in +index f426ac5f..147fbfa9 100644 +--- a/doc/unbound.conf.5.in ++++ b/doc/unbound.conf.5.in *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Nov 28 22:34:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F55846D1EC; Sat, 28 Nov 2020 22:34:35 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ck5s72DmQz4rCX; Sat, 28 Nov 2020 22:34:35 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F7D42EB1B; Sat, 28 Nov 2020 22:34:35 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ASMYZtc094039; Sat, 28 Nov 2020 22:34:35 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ASMYYo8094034; Sat, 28 Nov 2020 22:34:34 GMT (envelope-from phk@FreeBSD.org) Message-Id: <202011282234.0ASMYYo8094034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sat, 28 Nov 2020 22:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368130 - in head: share/man/man4 sys/dev/ftwd sys/modules sys/modules/ftwd X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/ftwd sys/modules sys/modules/ftwd X-SVN-Commit-Revision: 368130 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 22:34:35 -0000 Author: phk Date: Sat Nov 28 22:34:33 2020 New Revision: 368130 URL: https://svnweb.freebsd.org/changeset/base/368130 Log: Add watchdog(9) driver for the Fintek F81803 SuperIO chip Added: head/share/man/man4/ftwd.4 (contents, props changed) head/sys/dev/ftwd/ head/sys/dev/ftwd/ftwd.c (contents, props changed) head/sys/modules/ftwd/ head/sys/modules/ftwd/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Nov 28 18:09:16 2020 (r368129) +++ head/share/man/man4/Makefile Sat Nov 28 22:34:33 2020 (r368130) @@ -158,6 +158,7 @@ MAN= aac.4 \ ffclock.4 \ filemon.4 \ firewire.4 \ + ${_ftwd.4} \ full.4 \ fwe.4 \ fwip.4 \ @@ -785,6 +786,7 @@ _chvgpio.4= chvgpio.4 _coretemp.4= coretemp.4 _cpuctl.4= cpuctl.4 _dpms.4= dpms.4 +_ftwd.4= ftwd.4 _hpt27xx.4= hpt27xx.4 _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 Added: head/share/man/man4/ftwd.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ftwd.4 Sat Nov 28 22:34:33 2020 (r368130) @@ -0,0 +1,66 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2012 Bjoern A. Zeeb +.\" Copyright (c) 2019 Andriy Gapon +.\" +.\" 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 November 26, 2020 +.Dt FTWD 4 +.Os +.Sh NAME +.Nm ftwd +.Nd Fintek F81803 watchdog timer +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device superio" +.Cd "device ftwd" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place the following +line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +ftwd_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides +.Xr watchdog 4 +support for the watchdog timer in the Fintek F81803 chip. +.Sh SEE ALSO +.Xr superio 4 , +.Xr watchdog 4 , +.Xr device.hints 5 , +.Xr watchdog 8 , +.Xr watchdogd 8 , +.Xr watchdog 9 +.Sh AUTHORS +.An -nosplit +This manual page was written by +.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org . Added: head/sys/dev/ftwd/ftwd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ftwd/ftwd.c Sat Nov 28 22:34:33 2020 (r368130) @@ -0,0 +1,157 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 Poul-Henning Kamp + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +struct ftwd_softc { + eventhandler_tag wd_ev; +}; + +static void +ftwd_func(void *priv, u_int cmd, int *error) +{ + device_t dev = priv; + uint64_t timeout; + uint8_t val = 0; + uint8_t minutes = 0; + + if (cmd != 0) { + cmd &= WD_INTERVAL; + + /* Convert the requested timeout to seconds. */ + if (cmd >= WD_TO_1SEC) + timeout = (uint64_t)1 << (cmd - WD_TO_1SEC); + else + timeout = 1; + + if (timeout <= UINT8_MAX) { + val = timeout; + *error = 0; + } else if ((timeout / 60) <= UINT8_MAX) { + val = timeout / 60; + minutes = 1; + *error = 0; + } + } + if (bootverbose) { + if (val == 0) { + device_printf(dev, "disabling watchdog\n"); + } else { + device_printf(dev, + "arm watchdog to %d %s%s (Was: 0x%02x)\n", + val, minutes ? "minute" : "second", + val == 1 ? "" : "s", + superio_read(dev, 0xf6) + ); + } + } + superio_write(dev, 0xf0, 0x00); // Disable WDTRST# + superio_write(dev, 0xf6, val); // Set Counter + + if (minutes) + superio_write(dev, 0xf5, 0x7d); // minutes, act high, 125ms + else + superio_write(dev, 0xf5, 0x75); // seconds, act high, 125ms + + if (val) + superio_write(dev, 0xf7, 0x01); // Disable PME + if (val) + superio_write(dev, 0xf0, 0x81); // Enable WDTRST# + else + superio_write(dev, 0xf0, 0x00); // Disable WDTRST +} + +static int +ftwd_probe(device_t dev) +{ + + if (superio_vendor(dev) != SUPERIO_VENDOR_FINTEK || + superio_get_type(dev) != SUPERIO_DEV_WDT) + return (ENXIO); + device_set_desc(dev, "Watchdog Timer on Fintek SuperIO"); + return (BUS_PROBE_DEFAULT); +} + +static int +ftwd_attach(device_t dev) +{ + struct ftwd_softc *sc = device_get_softc(dev); + + /* + * We do not touch the watchdog at this time, it might be armed + * by firmware to protect the full boot sequence. + */ + + sc->wd_ev = EVENTHANDLER_REGISTER(watchdog_list, ftwd_func, dev, 0); + return (0); +} + +static int +ftwd_detach(device_t dev) +{ + struct ftwd_softc *sc = device_get_softc(dev); + int dummy; + + if (sc->wd_ev != NULL) + EVENTHANDLER_DEREGISTER(watchdog_list, sc->wd_ev); + ftwd_func(dev, 0, &dummy); + return (0); +} + +static device_method_t ftwd_methods[] = { + DEVMETHOD(device_probe, ftwd_probe), + DEVMETHOD(device_attach, ftwd_attach), + DEVMETHOD(device_detach, ftwd_detach), + { 0, 0 } +}; + +static driver_t ftwd_driver = { + "ftwd", + ftwd_methods, + sizeof (struct ftwd_softc) +}; + +static devclass_t ftwd_devclass; + +DRIVER_MODULE(ftwd, superio, ftwd_driver, ftwd_devclass, NULL, NULL); +MODULE_DEPEND(ftwd, superio, 1, 1, 1); +MODULE_VERSION(ftwd, 1); Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Nov 28 18:09:16 2020 (r368129) +++ head/sys/modules/Makefile Sat Nov 28 22:34:33 2020 (r368130) @@ -121,6 +121,7 @@ SUBDIR= \ filemon \ firewire \ firmware \ + ${_ftwd} \ fusefs \ ${_fxp} \ gem \ @@ -618,6 +619,7 @@ _cpufreq= cpufreq _dpms= dpms _em= em _et= et +_ftwd= ftwd _exca= exca _if_ndis= if_ndis _io= io Added: head/sys/modules/ftwd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/ftwd/Makefile Sat Nov 28 22:34:33 2020 (r368130) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/ftwd + +KMOD= ftwd +SRCS= ftwd.c +SRCS+= device_if.h bus_if.h isa_if.h + +.include From owner-svn-src-all@freebsd.org Sat Nov 28 23:24:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BF8446E180; Sat, 28 Nov 2020 23:24:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ck6yX36xzz4t7g; Sat, 28 Nov 2020 23:24:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E1DB2F63D; Sat, 28 Nov 2020 23:24:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ASNOKhw024965; Sat, 28 Nov 2020 23:24:20 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ASNOJCX024962; Sat, 28 Nov 2020 23:24:20 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202011282324.0ASNOJCX024962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 28 Nov 2020 23:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368131 - head/sbin/ping X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sbin/ping X-SVN-Commit-Revision: 368131 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.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Nov 2020 23:24:20 -0000 Author: asomers Date: Sat Nov 28 23:24:19 2020 New Revision: 368131 URL: https://svnweb.freebsd.org/changeset/base/368131 Log: ping: allow building without INET support Building without INET6 support was already possible. Now it's possible to build ping with only INET6, or even with neither INET nor INET6. Reported by: bz Reviewed by: bz MFC-With: 368045 Differential Revision: https://reviews.freebsd.org/D27394 Modified: head/sbin/ping/Makefile head/sbin/ping/main.c Modified: head/sbin/ping/Makefile ============================================================================== --- head/sbin/ping/Makefile Sat Nov 28 22:34:33 2020 (r368130) +++ head/sbin/ping/Makefile Sat Nov 28 23:24:19 2020 (r368131) @@ -5,11 +5,16 @@ PACKAGE=runtime PROG= ping -SRCS= main.c ping.c utils.c +SRCS= main.c MAN= ping.8 BINOWN= root BINMODE=4555 LIBADD= m + +.if ${MK_INET_SUPPORT}!= "no" +CFLAGS+= -DINET +SRCS+= ping.c utils.c +.endif .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 -DKAME_SCOPEID Modified: head/sbin/ping/main.c ============================================================================== --- head/sbin/ping/main.c Sat Nov 28 22:34:33 2020 (r368130) +++ head/sbin/ping/main.c Sat Nov 28 23:24:19 2020 (r368131) @@ -44,40 +44,51 @@ __FBSDID("$FreeBSD$"); #include #include "main.h" +#ifdef INET #include "ping.h" +#endif #ifdef INET6 #include "ping6.h" #endif -#ifdef INET6 +#if defined(INET) && defined(INET6) #define OPTSTR ":46" -#else +#elif defined(INET) #define OPTSTR ":4" +#elif defined(INET6) +#define OPTSTR ":6" +#else +#define OPTSTR "" #endif int main(int argc, char *argv[]) { +#if defined(INET) && defined(INET6) struct in_addr a; + struct in6_addr a6; +#endif +#if defined(INET) || defined(INET6) struct addrinfo hints; +#endif int ch; - bool ipv4; +#ifdef INET + bool ipv4 = false; +#endif #ifdef INET6 - struct in6_addr a6; - bool ipv6; + bool ipv6 = false; if (strcmp(getprogname(), "ping6") == 0) ipv6 = true; - else - ipv6 = false; #endif - ipv4 = false; while ((ch = getopt(argc, argv, OPTSTR)) != -1) { switch(ch) { +#ifdef INET case '4': ipv4 = true; break; +#endif #ifdef INET6 case '6': ipv6 = true; @@ -93,20 +104,18 @@ main(int argc, char *argv[]) optreset = 1; optind = 1; -#ifdef INET6 +#if defined(INET) && defined(INET6) if (ipv4 && ipv6) errx(1, "-4 and -6 cannot be used simultaneously"); #endif +#if defined(INET) && defined(INET6) if (inet_pton(AF_INET, argv[argc - 1], &a) == 1) { -#ifdef INET6 if (ipv6) errx(1, "IPv6 requested but IPv4 target address " "provided"); -#endif hints.ai_family = AF_INET; } -#ifdef INET6 else if (inet_pton(AF_INET6, argv[argc - 1], &a6) == 1) { if (ipv4) errx(1, "IPv4 requested but IPv6 target address " @@ -114,7 +123,6 @@ main(int argc, char *argv[]) hints.ai_family = AF_INET6; } else if (ipv6) hints.ai_family = AF_INET6; -#endif else if (ipv4) hints.ai_family = AF_INET; else { @@ -129,22 +137,30 @@ main(int argc, char *argv[]) freeaddrinfo(res); } } +#elif defined(INET) + hints.ai_family = AF_INET; +#elif defined(INET6) + hints.ai_family = AF_INET6; +#endif +#ifdef INET if (hints.ai_family == AF_INET) return ping(argc, argv); +#endif /* INET */ #ifdef INET6 - else if (hints.ai_family == AF_INET6) + if (hints.ai_family == AF_INET6) return ping6(argc, argv); -#endif - else - errx(1, "Unknown host"); +#endif /* INET6 */ + errx(1, "Unknown host"); } void usage(void) { (void)fprintf(stderr, - "usage: ping [-4AaDdfHnoQqRrv] [-C pcp] [-c count] " + "usage:\n" +#ifdef INET + "\tping [-4AaDdfHnoQqRrv] [-C pcp] [-c count] " "[-G sweepmaxsize]\n" " [-g sweepminsize] [-h sweepincrsize] [-i wait] " "[-l preload]\n" @@ -155,7 +171,7 @@ usage(void) "[-p pattern] [-S src_addr] \n" " [-s packetsize] [-t timeout] [-W waittime] [-z tos] " "IPv4-host\n" - " ping [-4AaDdfHLnoQqRrv] [-C pcp] [-c count] [-I iface] " + "\tping [-4AaDdfHLnoQqRrv] [-C pcp] [-c count] [-I iface] " "[-i wait]\n" " [-l preload] [-M mask | time] [-m ttl] " #ifdef IPSEC @@ -164,8 +180,9 @@ usage(void) "[-p pattern]\n" " [-S src_addr] [-s packetsize] [-T ttl] [-t timeout] [-W waittime]\n" " [-z tos] IPv4-mcast-group\n" +#endif /* INET */ #ifdef INET6 - " ping [-6aADd" + "\tping [-6aADd" #if defined(IPSEC) && !defined(IPSEC_POLICY_IPSEC) "E" #endif