From owner-svn-src-head@freebsd.org Sun May 10 01:53:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 510902D4B38; Sun, 10 May 2020 01:53:15 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KRt15Qrvz4Ylr; Sun, 10 May 2020 01:53:13 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-qk1-f175.google.com with SMTP id f13so5551417qkh.2; Sat, 09 May 2020 18:53:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JEjhkQ2+h7afKSH3fM9x187CBb3BlPWX0fJDa3iB3qM=; b=p+zPyHAFMYiI5hjLSj3+1ZkWBKUh+yhga38Ntb1LjH9dwoZT2nKeW+TJiyklcARorW KwgVnoQN3y4fucnllBAbTl2i9bBOhmPjc2SKDclob8PyLSLpKnjlG1m8EaKBhx8Dlk+x unijeqS6LIMvtLQEW0Gf0JRw6F+voNDOAHvmLWG1AY2R20GPDTUQWknIrGddCHFMStm8 t4+bL/u82TF13J6r8P5cmjdRR5VVBqZG3IVMsiwTjaX6yGj2lpDE7cvrERUIxH1nTKvO LLgUwjawi6i/9YJZll+lLh9pyP54/gqDXYgClTAzbvk/amohkVhMFh1qFUc6p2Dql57Y iHkw== X-Gm-Message-State: AGi0PuZUgcDfqbyx03edzj6gVquBX57xrdKlc4svBA4fVTu66NwokvqN DowTA5vjZL8/s6ng9FzNhJQuiJ8O X-Google-Smtp-Source: APiQypJHgBMaBdION+BknKdKej0FPXxJBZE58CEt3x5XRuV+t4OQsTcoMCseIcVsJbNgUJO6nWHzIQ== X-Received: by 2002:ae9:ed95:: with SMTP id c143mr5193023qkg.394.1589075592276; Sat, 09 May 2020 18:53:12 -0700 (PDT) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com. [209.85.160.175]) by smtp.gmail.com with ESMTPSA id s15sm5686986qtc.31.2020.05.09.18.53.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 May 2020 18:53:12 -0700 (PDT) Received: by mail-qt1-f175.google.com with SMTP id h26so5013433qtu.8; Sat, 09 May 2020 18:53:11 -0700 (PDT) X-Received: by 2002:ac8:46d0:: with SMTP id h16mr10826153qto.242.1589075591681; Sat, 09 May 2020 18:53:11 -0700 (PDT) MIME-Version: 1.0 References: <202003311559.02VFxTKv095318@repo.freebsd.org> In-Reply-To: <202003311559.02VFxTKv095318@repo.freebsd.org> From: Kyle Evans Date: Sat, 9 May 2020 20:53:00 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r359488 - head/share/mk To: "Simon J. Gerraty" Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49KRt15Qrvz4Ylr X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of byondlenox@gmail.com designates 209.85.222.175 as permitted sender) smtp.mailfrom=byondlenox@gmail.com X-Spamd-Result: default: False [-3.02 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_NEQ_ENVFROM(0.00)[self@kyle-evans.net,byondlenox@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[kyle-evans.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-1.02)[ip: (-4.24), ipnet: 209.85.128.0/17(-0.39), asn: 15169(-0.43), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[175.222.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[self@kyle-evans.net,byondlenox@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[175.222.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.32 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 01:53:15 -0000 On Tue, Mar 31, 2020 at 11:00 AM Simon J. Gerraty wrote: > > Author: sjg > Date: Tue Mar 31 15:59:29 2020 > New Revision: 359488 > URL: https://svnweb.freebsd.org/changeset/base/359488 > > Log: > Include ${.CURDIR}/local.init.mk if it exists > > This is handy for making local hacks to an app > (eg to build it as tool for non-BSD host) > without making a mess of the code base. > > Reviewed by: bdrewery > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org//D24101 > In hindsight, I wonder if this should have been ${.CURDIR}/Makefile.local instead, to match the convention used in ports already for this kind of thing. Thoughts? Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Sun May 10 03:36:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AF2D2D6BFC; Sun, 10 May 2020 03:36:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KV8q6zb0z4dw1; Sun, 10 May 2020 03:36:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA3F826A21; Sun, 10 May 2020 03:36:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04A3aBc1082769; Sun, 10 May 2020 03:36:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04A3aBo5082767; Sun, 10 May 2020 03:36:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005100336.04A3aBo5082767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 10 May 2020 03:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360865 - head/sys/mips/atheros X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/atheros X-SVN-Commit-Revision: 360865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.32 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 03:36:12 -0000 Author: adrian Date: Sun May 10 03:36:11 2020 New Revision: 360865 URL: https://svnweb.freebsd.org/changeset/base/360865 Log: [atheros] [if_arge] Various fixes to avoid TX stalls and bad sized packets This is stuff I've been running for a couple years. It's inspired by changes I found in the linux ag71xx ethernet driver. * Delay between stopping DMA and checking to see if it's stopped; this gives the hardware time to do its thing. * Non-final frames in the chain need to be a multiple of 4 bytes in size. Ensure this is the case when assembling a TX DMA list. * Add counters for tx/rx underflow and too-short packets. * Log if TX/RX DMA couldn't be stopped when resetting the MAC. * Add some more debugging / logging around TX/RX ring bits. Tested: * AR7240, AR7241 * AR9344 (TL-WDR3600/TL-WDR4300 APs) * AR9331 (Carambola 2) Modified: head/sys/mips/atheros/if_arge.c head/sys/mips/atheros/if_argevar.h Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Sun May 10 02:14:23 2020 (r360864) +++ head/sys/mips/atheros/if_arge.c Sun May 10 03:36:11 2020 (r360865) @@ -333,6 +333,11 @@ arge_attach_sysctl(device_t dev) 0, "number of TX unaligned packets (len)"); SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "tx_pkts_unaligned_tooshort", CTLFLAG_RW, + &sc->stats.tx_pkts_unaligned_tooshort, + 0, "number of TX unaligned packets (mbuf length < 4 bytes)"); + + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "tx_pkts_nosegs", CTLFLAG_RW, &sc->stats.tx_pkts_nosegs, 0, "number of TX packets fail with no ring slots avail"); @@ -347,6 +352,13 @@ arge_attach_sysctl(device_t dev) SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "intr_ok", CTLFLAG_RW, &sc->stats.intr_ok, 0, "number of OK interrupts"); + + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "tx_underflow", CTLFLAG_RW, &sc->stats.tx_underflow, + 0, "Number of TX underflows"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "rx_overflow", CTLFLAG_RW, &sc->stats.rx_overflow, + 0, "Number of RX overflows"); #ifdef ARGE_DEBUG SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "tx_prod", CTLFLAG_RW, &sc->arge_cdata.arge_tx_prod, 0, ""); @@ -1365,15 +1377,24 @@ arge_set_pll(struct arge_softc *sc, int media, int dup static void arge_reset_dma(struct arge_softc *sc) { + uint32_t val; ARGEDEBUG(sc, ARGE_DBG_RESET, "%s: called\n", __func__); ARGE_WRITE(sc, AR71XX_DMA_RX_CONTROL, 0); ARGE_WRITE(sc, AR71XX_DMA_TX_CONTROL, 0); + /* Give hardware a chance to finish */ + DELAY(1000); + ARGE_WRITE(sc, AR71XX_DMA_RX_DESC, 0); ARGE_WRITE(sc, AR71XX_DMA_TX_DESC, 0); + ARGEDEBUG(sc, ARGE_DBG_RESET, "%s: RX_STATUS=%08x, TX_STATUS=%08x\n", + __func__, + ARGE_READ(sc, AR71XX_DMA_RX_STATUS), + ARGE_READ(sc, AR71XX_DMA_TX_STATUS)); + /* Clear all possible RX interrupts */ while(ARGE_READ(sc, AR71XX_DMA_RX_STATUS) & DMA_RX_STATUS_PKT_RECVD) ARGE_WRITE(sc, AR71XX_DMA_RX_STATUS, DMA_RX_STATUS_PKT_RECVD); @@ -1397,6 +1418,24 @@ arge_reset_dma(struct arge_softc *sc) * flushed to RAM before underlying buffers are freed. */ arge_flush_ddr(sc); + + /* Check if we cleared RX status */ + val = ARGE_READ(sc, AR71XX_DMA_RX_STATUS); + if (val != 0) { + device_printf(sc->arge_dev, + "%s: unable to clear DMA_RX_STATUS: %08x\n", + __func__, val); + } + + /* Check if we cleared TX status */ + val = ARGE_READ(sc, AR71XX_DMA_TX_STATUS); + /* Mask out reserved bits */ + val = val & 0x00ffffff; + if (val != 0) { + device_printf(sc->arge_dev, + "%s: unable to clear DMA_TX_STATUS: %08x\n", + __func__, val); + } } static void @@ -1417,9 +1456,13 @@ arge_init_locked(struct arge_softc *sc) ARGE_LOCK_ASSERT(sc); + ARGEDEBUG(sc, ARGE_DBG_RESET, "%s: called\n", __func__); + if ((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & IFF_DRV_RUNNING)) return; + ARGEDEBUG(sc, ARGE_DBG_RESET, "%s: init'ing\n", __func__); + /* Init circular RX list. */ if (arge_rx_ring_init(sc) != 0) { device_printf(sc->arge_dev, @@ -1431,6 +1474,7 @@ arge_init_locked(struct arge_softc *sc) /* Init tx descriptors. */ arge_tx_ring_init(sc); + /* Restart DMA */ arge_reset_dma(sc); if (sc->arge_miibus) { @@ -1452,6 +1496,11 @@ arge_init_locked(struct arge_softc *sc) arge_update_link_locked(sc); } + ARGEDEBUG(sc, ARGE_DBG_RESET, "%s: desc ring; TX=0x%x, RX=0x%x\n", + __func__, + ARGE_TX_RING_ADDR(sc, 0), + ARGE_RX_RING_ADDR(sc, 0)); + ARGE_WRITE(sc, AR71XX_DMA_TX_DESC, ARGE_TX_RING_ADDR(sc, 0)); ARGE_WRITE(sc, AR71XX_DMA_RX_DESC, ARGE_RX_RING_ADDR(sc, 0)); @@ -1495,6 +1544,15 @@ arge_mbuf_chain_is_tx_aligned(struct arge_softc *sc, s sc->stats.tx_pkts_unaligned_len++; return 0; } + + /* + * All chips have this requirement for length being greater + * than 4. + */ + if ((m->m_next != NULL) && ((m->m_len < 4))) { + sc->stats.tx_pkts_unaligned_tooshort++; + return 0; + } } return 1; } @@ -1582,6 +1640,11 @@ arge_encap(struct arge_softc *sc, struct mbuf **m_head tmp |= ARGE_DESC_EMPTY; desc->packet_ctrl = tmp; + ARGEDEBUG(sc, ARGE_DBG_TX, " [%d / %d] addr=0x%x, len=%d\n", + i, + prod, + (uint32_t) txsegs[i].ds_addr, (int) txsegs[i].ds_len); + /* XXX Note: only relevant for older MACs; but check length! */ if ((sc->arge_hw_flags & ARGE_HW_FLG_TX_DESC_ALIGN_4BYTE) && (txsegs[i].ds_addr & 3)) @@ -2606,7 +2669,7 @@ arge_intr(void *arg) } /* - * If we've finished TXing and there's space for more packets + * If we've finished RX /or/ TX and there's space for more packets * to be queued for TX, do so. Otherwise we may end up in a * situation where the interface send queue was filled * whilst the hardware queue was full, then the hardware @@ -2620,8 +2683,7 @@ arge_intr(void *arg) * after a TX underrun, then having the hardware queue added * to below. */ - if (status & (DMA_INTR_TX_PKT_SENT | DMA_INTR_TX_UNDERRUN) && - (ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { if (!IFQ_IS_EMPTY(&ifp->if_snd)) arge_start_locked(ifp); } Modified: head/sys/mips/atheros/if_argevar.h ============================================================================== --- head/sys/mips/atheros/if_argevar.h Sun May 10 02:14:23 2020 (r360864) +++ head/sys/mips/atheros/if_argevar.h Sun May 10 03:36:11 2020 (r360865) @@ -206,6 +206,7 @@ struct arge_softc { uint32_t tx_pkts_unaligned; uint32_t tx_pkts_unaligned_start; uint32_t tx_pkts_unaligned_len; + uint32_t tx_pkts_unaligned_tooshort; uint32_t tx_pkts_nosegs; uint32_t tx_pkts_aligned; uint32_t rx_overflow; From owner-svn-src-head@freebsd.org Sun May 10 09:34:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0E442DFAB7; Sun, 10 May 2020 09:34:49 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Kf6d3l7Sz3ySH; Sun, 10 May 2020 09:34:49 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BA122EFA; Sun, 10 May 2020 09:34:49 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04A9YnRc006388; Sun, 10 May 2020 09:34:49 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04A9YnB5006386; Sun, 10 May 2020 09:34:49 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005100934.04A9YnB5006386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 10 May 2020 09:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360866 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 360866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 09:34:49 -0000 Author: melifaro Date: Sun May 10 09:34:48 2020 New Revision: 360866 URL: https://svnweb.freebsd.org/changeset/base/360866 Log: Remove rtalloc1(_fib) KPI. Last user of rtalloc1() KPI has been eliminated in rS360631. As kernel is now fully switched to use new routing KPI defined in rS359823, remove old lookup functions. Differential Revision: https://reviews.freebsd.org/D24776 Modified: head/sys/net/route.c head/sys/net/route.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sun May 10 03:36:11 2020 (r360865) +++ head/sys/net/route.c Sun May 10 09:34:48 2020 (r360866) @@ -420,76 +420,6 @@ sys_setfib(struct thread *td, struct setfib_args *uap) } /* - * Look up the route that matches the address given - * Or, at least try.. Create a cloned route if needed. - * - * The returned route, if any, is locked. - */ -struct rtentry * -rtalloc1(struct sockaddr *dst, int report, u_long ignflags) -{ - - return (rtalloc1_fib(dst, report, ignflags, RT_DEFAULT_FIB)); -} - -struct rtentry * -rtalloc1_fib(struct sockaddr *dst, int report, u_long ignflags, - u_int fibnum) -{ - RIB_RLOCK_TRACKER; - struct rib_head *rh; - struct radix_node *rn; - struct rtentry *newrt; - struct rt_addrinfo info; - int err = 0, msgtype = RTM_MISS; - - KASSERT((fibnum < rt_numfibs), ("rtalloc1_fib: bad fibnum")); - rh = rt_tables_get_rnh(fibnum, dst->sa_family); - newrt = NULL; - if (rh == NULL) - goto miss; - - /* - * Look up the address in the table for that Address Family - */ - if ((ignflags & RTF_RNH_LOCKED) == 0) - RIB_RLOCK(rh); -#ifdef INVARIANTS - else - RIB_LOCK_ASSERT(rh); -#endif - rn = rh->rnh_matchaddr(dst, &rh->head); - if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { - newrt = RNTORT(rn); - RT_LOCK(newrt); - RT_ADDREF(newrt); - if ((ignflags & RTF_RNH_LOCKED) == 0) - RIB_RUNLOCK(rh); - return (newrt); - - } else if ((ignflags & RTF_RNH_LOCKED) == 0) - RIB_RUNLOCK(rh); - /* - * Either we hit the root or could not find any match, - * which basically means: "cannot get there from here". - */ -miss: - RTSTAT_INC(rts_unreach); - - if (report) { - /* - * If required, report the failure to the supervising - * Authorities. - * For a delete, this is not an error. (report == 0) - */ - bzero(&info, sizeof(info)); - info.rti_info[RTAX_DST] = dst; - rt_missmsg_fib(msgtype, &info, 0, err, fibnum); - } - return (newrt); -} - -/* * Remove a reference count from an rtentry. * If the count gets low enough, take it out of the routing table */ Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sun May 10 03:36:11 2020 (r360865) +++ head/sys/net/route.h Sun May 10 09:34:48 2020 (r360866) @@ -392,8 +392,6 @@ struct sockaddr *rtsock_fix_netmask(const struct socka /* * Note the following locking behavior: * - * rtalloc1() returns a locked rtentry - * * rtfree() and RTFREE_LOCKED() require a locked rtentry * * RTFREE() uses an unlocked entry. @@ -414,14 +412,12 @@ void rt_flushifroutes(struct ifnet *ifp); /* XXX MRT COMPAT VERSIONS THAT SET UNIVERSE to 0 */ /* Thes are used by old code not yet converted to use multiple FIBS */ -struct rtentry *rtalloc1(struct sockaddr *, int, u_long); int rtinit(struct ifaddr *, int, int); /* XXX MRT NEW VERSIONS THAT USE FIBs * For now the protocol indepedent versions are the same as the AF_INET ones * but this will change.. */ -struct rtentry *rtalloc1_fib(struct sockaddr *, int, u_long, u_int); int rtioctl_fib(u_long, caddr_t, u_int); int rtrequest_fib(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); From owner-svn-src-head@freebsd.org Sun May 10 10:03:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F6582E0838; Sun, 10 May 2020 10:03:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KflL6dvTz41Tk; Sun, 10 May 2020 10:03:10 +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 DD9B8370C; Sun, 10 May 2020 10:03:10 +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 04AA3AqM024800; Sun, 10 May 2020 10:03:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AA3A2w024799; Sun, 10 May 2020 10:03:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005101003.04AA3A2w024799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 10 May 2020 10:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360869 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 360869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 10:03:11 -0000 Author: tuexen Date: Sun May 10 10:03:10 2020 New Revision: 360869 URL: https://svnweb.freebsd.org/changeset/base/360869 Log: Only drop DATA chunk with lower priorities as specified in RFC 7496. This issue was found by looking at a reproducer generated by syzkaller. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun May 10 09:50:44 2020 (r360868) +++ head/sys/netinet/sctp_output.c Sun May 10 10:03:10 2020 (r360869) @@ -6199,11 +6199,11 @@ sctp_prune_prsctp(struct sctp_tcb *stcb, * This one is PR-SCTP AND buffer space * limited type */ - if (chk->rec.data.timetodrop.tv_sec >= (long)srcv->sinfo_timetolive) { + if (chk->rec.data.timetodrop.tv_sec > (long)srcv->sinfo_timetolive) { /* * Lower numbers equates to higher * priority so if the one we are - * looking at has a larger or equal + * looking at has a larger * priority we want to drop the data * and NOT retransmit it. */ @@ -6234,7 +6234,7 @@ sctp_prune_prsctp(struct sctp_tcb *stcb, TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { /* Here we must move to the sent queue and mark */ if (PR_SCTP_BUF_ENABLED(chk->flags)) { - if (chk->rec.data.timetodrop.tv_sec >= (long)srcv->sinfo_timetolive) { + if (chk->rec.data.timetodrop.tv_sec > (long)srcv->sinfo_timetolive) { if (chk->data) { /* * We release the book_size @@ -12617,7 +12617,7 @@ sctp_lower_sosend(struct socket *so, top = SCTP_HEADER_TO_CHAIN(i_pak); sndlen = SCTP_HEADER_LEN(i_pak); } - SCTPDBG(SCTP_DEBUG_OUTPUT1, "Send called addr:%p send length %zu\n", + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Send called addr:%p send length %zd\n", (void *)addr, sndlen); if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && From owner-svn-src-head@freebsd.org Sun May 10 13:07:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54A782E6F41; Sun, 10 May 2020 13:07: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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KkqT1cPJz4BXB; Sun, 10 May 2020 13:07: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 32A905A26; Sun, 10 May 2020 13:07: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 04AD71XB036241; Sun, 10 May 2020 13:07:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AD712L036240; Sun, 10 May 2020 13:07:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005101307.04AD712L036240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 10 May 2020 13:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360870 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 360870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 13:07:01 -0000 Author: manu Date: Sun May 10 13:07:00 2020 New Revision: 360870 URL: https://svnweb.freebsd.org/changeset/base/360870 Log: linuxkpi: Add bitmap_alloc and bitmap_free This is a simple call to kmallock_array/kfree, therefore include linux/slab.h as this is where the kmalloc_array/kfree definition is. Sponsored-by: The FreeBSD Foundation Reviewed by: hselsasky Differential Revision: https://reviews.freebsd.org/D24794 Modified: head/sys/compat/linuxkpi/common/include/linux/bitmap.h Modified: head/sys/compat/linuxkpi/common/include/linux/bitmap.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitmap.h Sun May 10 10:03:10 2020 (r360869) +++ head/sys/compat/linuxkpi/common/include/linux/bitmap.h Sun May 10 13:07:00 2020 (r360870) @@ -30,6 +30,7 @@ #define _LINUX_BITMAP_H_ #include +#include static inline void bitmap_zero(unsigned long *addr, const unsigned int size) @@ -307,6 +308,12 @@ bitmap_xor(unsigned long *dst, const unsigned long *sr for (i = 0; i != end; i++) dst[i] = src1[i] ^ src2[i]; +} + +static inline void +bitmap_free(const unsigned long *bitmap) +{ + kfree(bitmap); } #endif /* _LINUX_BITMAP_H_ */ From owner-svn-src-head@freebsd.org Sun May 10 13:12:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE9182E71B3; Sun, 10 May 2020 13:12: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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KkxK4cNpz4Bth; Sun, 10 May 2020 13:12: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 999F05AC1; Sun, 10 May 2020 13:12: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 04ADC5aj040726; Sun, 10 May 2020 13:12:05 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04ADC52j040725; Sun, 10 May 2020 13:12:05 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005101312.04ADC52j040725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 10 May 2020 13:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360871 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 360871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 13:12:05 -0000 Author: manu Date: Sun May 10 13:12:05 2020 New Revision: 360871 URL: https://svnweb.freebsd.org/changeset/base/360871 Log: linuxkpi: Really add bitmap_alloc and bitmap_zalloc This was missing in r360870 Sponsored-by: The FreeBSD Foundation Modified: head/sys/compat/linuxkpi/common/include/linux/bitmap.h Modified: head/sys/compat/linuxkpi/common/include/linux/bitmap.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitmap.h Sun May 10 13:07:00 2020 (r360870) +++ head/sys/compat/linuxkpi/common/include/linux/bitmap.h Sun May 10 13:12:05 2020 (r360871) @@ -310,6 +310,19 @@ bitmap_xor(unsigned long *dst, const unsigned long *sr dst[i] = src1[i] ^ src2[i]; } +static inline unsigned long * +bitmap_alloc(unsigned int size, gfp_t flags) +{ + return (kmalloc_array(BITS_TO_LONGS(size), + sizeof(unsigned long), flags)); +} + +static inline unsigned long * +bitmap_zalloc(unsigned int size, gfp_t flags) +{ + return (bitmap_alloc(size, flags | __GFP_ZERO)); +} + static inline void bitmap_free(const unsigned long *bitmap) { From owner-svn-src-head@freebsd.org Sun May 10 14:09:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 464942E88FA; Sun, 10 May 2020 14:09:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KmCb1B7kz4FMJ; Sun, 10 May 2020 14:09:31 +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 23D7365A5; Sun, 10 May 2020 14:09:31 +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 04AE9Vnl073578; Sun, 10 May 2020 14:09:31 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AE9VHM073577; Sun, 10 May 2020 14:09:31 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005101409.04AE9VHM073577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 10 May 2020 14:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360872 - head/sys/dev/qlnx/qlnxe X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/qlnx/qlnxe X-SVN-Commit-Revision: 360872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 14:09:31 -0000 Author: manu Date: Sun May 10 14:09:30 2020 New Revision: 360872 URL: https://svnweb.freebsd.org/changeset/base/360872 Log: qnlx: Do not redifines types. r360870 added linux/slab.h into liunx/bitmap.h and this include linux/types.h The qlnx driver is redefining some of those types so remove them and add an explicit linux/types.h include. Pointy hat: manu Reported by: Austin Shafer Modified: head/sys/dev/qlnx/qlnxe/bcm_osal.h Modified: head/sys/dev/qlnx/qlnxe/bcm_osal.h ============================================================================== --- head/sys/dev/qlnx/qlnxe/bcm_osal.h Sun May 10 13:12:05 2020 (r360871) +++ head/sys/dev/qlnx/qlnxe/bcm_osal.h Sun May 10 14:09:30 2020 (r360872) @@ -34,6 +34,8 @@ #include "ecore_status.h" #include +#include + #if __FreeBSD_version >= 1200032 #include #else @@ -112,11 +114,6 @@ extern void qlnx_vf_flr_update(void *p_hwfn); #define s32 uint32_t #ifndef QLNX_RDMA - -typedef uint16_t __le16; -typedef uint32_t __le32; -typedef uint16_t __be16; -typedef uint32_t __be32; static __inline unsigned long roundup_pow_of_two(unsigned long x) From owner-svn-src-head@freebsd.org Sun May 10 16:11:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96E672EBA09; Sun, 10 May 2020 16:11:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Kpw83sFhz4MPh; Sun, 10 May 2020 16:11:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DAC17DF9; Sun, 10 May 2020 16:11:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04AGBKfT049118; Sun, 10 May 2020 16:11:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AGBKnD049116; Sun, 10 May 2020 16:11:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005101611.04AGBKnD049116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 10 May 2020 16:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360877 - head/tools/pkgbase X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/pkgbase X-SVN-Commit-Revision: 360877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 16:11:20 -0000 Author: emaste Date: Sun May 10 16:11:19 2020 New Revision: 360877 URL: https://svnweb.freebsd.org/changeset/base/360877 Log: Add pkgbase METALOG parse/check tool `metalog.lua` is a script that reads METALOG file created by pkgbase (make packages) and generates reports about the installed system and issues. This was developed as part of Yang's W2020 University of Waterloo co- operative education term with the FreeBSD Foundation. kevans provided some initial review; we will iterate on it in the tree. Submitted by: Yang Wang <2333@outlook.jp> Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24563 Added: head/tools/pkgbase/ head/tools/pkgbase/README.md (contents, props changed) head/tools/pkgbase/metalog_reader.lua (contents, props changed) Added: head/tools/pkgbase/README.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/pkgbase/README.md Sun May 10 16:11:19 2020 (r360877) @@ -0,0 +1,61 @@ +`metalog.lua` is a script that reads METALOG file created by pkgbase +(make packages) and generates reports about the installed system +and issues + +the script accepts an mtree file in a format that's returned by +`mtree -c | mtree -C` + +synopsis: +``` +metalog_reader.lua [-h] [-a | -c | -p [-count] [-size] [-f...]] [-W...] [-v] metalog-path +``` + +options: + +* `-a` prints all scan results. this is the default option if no option is + provided. +* `-c` lints the file and gives warnings/errors, including duplication and + conflicting metadata + * `-Wcheck-notagdir` entries with dir type and no tags will be also included + the first time they appear (1) +* `-p` list all package names found in the file as exactly specified by + `tags=package=...` + * `-count` display the number of files of the package + * `-size` display the size of the package + * `-fsetgid` only include packages with setgid files + * `-fsetuid` only include packages with setuid files + * `-fsetid` only include packages with setgid or setuid files +* `-v` verbose mode +* `-h` help page + +some examples: + +* `metalog_reader.lua -a METALOG` + prints all scan results described below. this is the default option +* `metalog_reader.lua -c METALOG` + only prints errors and warnings found in the file +* `metalog_reader.lua -c -Wcheck-notagdir METALOG` + prints errors and warnings found in the file, including directories with no + tags +* `metalog_reader.lua -p METALOG` + only prints all the package names found in the file +* `metalog_reader.lua -p -count -size METALOG` + prints all the package names, followed by number of files, followed by total + size +* `metalog_reader.lua -p -size -fsetid METALOG` + prints packages that has either setuid/setgid files, followed by the total + size +* `metalog_reader.lua -p -fsetuid -fsetgid METALOG` + prints packages that has both setuid and setgid files (if more than one + filters are specified, they are composed using logic and) +* `metalog_reader.lua -p -count -size -fsetuid METALOG` + prints packages that has setuid files, followed by number of files and total + size + +(1) if we have two entries +``` +./bin type=dir uname=root gname=wheel mode=0755 +./bin type=dir uname=root gname=wheel mode=0755 tags=... +``` +by default, this is not warned. if the option is enabled, this will be warned +as the second line sufficiently covers the first line. Added: head/tools/pkgbase/metalog_reader.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/pkgbase/metalog_reader.lua Sun May 10 16:11:19 2020 (r360877) @@ -0,0 +1,521 @@ +#!/usr/libexec/flua + +-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD +-- +-- Copyright(c) 2020 The FreeBSD Foundation. +-- +-- 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$ + +function main(args) + if #args == 0 then usage() end + local filename + local printall, checkonly, pkgonly = + #args == 1, false, false + local dcount, dsize, fuid, fgid, fid = + false, false, false, false, false + local verbose = false + local w_notagdirs = false + + local i = 1 + while i <= #args do + if args[i] == '-h' then + usage(true) + elseif args[i] == '-a' then + printall = true + elseif args[i] == '-c' then + printall = false + checkonly = true + elseif args[i] == '-p' then + printall = false + pkgonly = true + while i < #args do + i = i+1 + if args[i] == '-count' then + dcount = true + elseif args[i] == '-size' then + dsize = true + elseif args[i] == '-fsetuid' then + fuid = true + elseif args[i] == '-fsetgid' then + fgid = true + elseif args[i] == '-fsetid' then + fid = true + else + i = i-1 + break + end + end + elseif args[i] == '-v' then + verbose = true + elseif args[i] == '-Wcheck-notagdir' then + w_notagdirs = true + elseif args[i]:match('^%-') then + io.stderr:write('Unknown argument '..args[i]..'.\n') + usage() + else + filename = args[i] + end + i = i+1 + end + + if filename == nil then + io.stderr:write('Missing filename.\n') + usage() + end + + local sess = Analysis_session(filename, verbose, w_notagdirs) + + if printall then + io.write('--- PACKAGE REPORTS ---\n') + io.write(sess.pkg_report_full()) + io.write('--- LINTING REPORTS ---\n') + print_lints(sess) + elseif checkonly then + print_lints(sess) + elseif pkgonly then + io.write(sess.pkg_report_simple(dcount, dsize, { + fuid and sess.pkg_issetuid or nil, + fgid and sess.pkg_issetgid or nil, + fid and sess.pkg_issetid or nil + })) + else + io.stderr:write('This text should not be displayed.') + usage() + end +end + +--- @param man boolean +function usage(man) + local sn = 'Usage: '..arg[0].. ' [-h] [-a | -c | -p [-count] [-size] [-f...]] [-W...] metalog-path \n' + if man then + io.write('\n') + io.write(sn) + io.write( +[[ + +The script reads METALOG file created by pkgbase (make packages) and generates +reports about the installed system and issues. It accepts an mtree file in a +format that's returned by `mtree -c | mtree -C` + + Options: + -a prints all scan results. this is the default option if no option + is provided. + -c lints the file and gives warnings/errors, including duplication + and conflicting metadata + -Wcheck-notagdir entries with dir type and no tags will be also + included the first time they appear + -p list all package names found in the file as exactly specified by + `tags=package=...` + -count display the number of files of the package + -size display the size of the package + -fsetgid only include packages with setgid files + -fsetuid only include packages with setuid files + -fsetid only include packages with setgid or setuid files + -v verbose mode + -h help page + +]]) + os.exit() + else + io.stderr:write(sn) + os.exit(1) + end +end + +--- @param sess Analysis_session +function print_lints(sess) + local dupwarn, duperr = sess.dup_report() + io.write(dupwarn) + io.write(duperr) + local inodewarn, inodeerr = sess.inode_report() + io.write(inodewarn) + io.write(inodeerr) +end + +--- @param t table +function sortedPairs(t) + local sortedk = {} + for k in next, t do sortedk[#sortedk+1] = k end + table.sort(sortedk) + local i = 0 + return function() + i = i + 1 + return sortedk[i], t[sortedk[i]] + end +end + +--- @param t table +--- @param f function U> +function table_map(t, f) + local res = {} + for k, v in pairs(t) do res[k] = f(v) end + return res +end + +--- @class MetalogRow +-- a table contaning file's info, from a line content from METALOG file +-- all fields in the table are strings +-- sample output: +-- { +-- filename = ./usr/share/man/man3/inet6_rthdr_segments.3.gz +-- lineno = 5 +-- attrs = { +-- gname = 'wheel' +-- uname = 'root' +-- mode = '0444' +-- size = '1166' +-- time = nil +-- type = 'file' +-- tags = 'package=clibs,debug' +-- } +-- } +--- @param line string +function MetalogRow(line, lineno) + local res, attrs = {}, {} + local filename, rest = line:match('^(%S+) (.+)$') + -- mtree file has space escaped as '\\040', not affecting splitting + -- string by space + for attrpair in rest:gmatch('[^ ]+') do + local k, v = attrpair:match('^(.-)=(.+)') + attrs[k] = v + end + res.filename = filename + res.linenum = lineno + res.attrs = attrs + return res +end + +-- check if an array of MetalogRows are equivalent. if not, the first field +-- that's different is returned secondly +--- @param rows MetalogRow[] +--- @param ignore_name boolean +--- @param ignore_tags boolean +function metalogrows_all_equal(rows, ignore_name, ignore_tags) + local __eq = function(l, o) + if not ignore_name and l.filename ~= o.filename then + return false, 'filename' + end + -- ignoring linenum in METALOG file as it's not relavant + for k in pairs(l.attrs) do + if ignore_tags and k == 'tags' then goto continue end + if l.attrs[k] ~= o.attrs[k] and o.attrs[k] ~= nil then + return false, k + end + ::continue:: + end + return true + end + for _, v in ipairs(rows) do + local bol, offby = __eq(v, rows[1]) + if not bol then return false, offby end + end + return true +end + +--- @param tagstr string +function pkgname_from_tag(tagstr) + local ext, pkgname, pkgend = '', '', '' + for seg in tagstr:gmatch('[^,]+') do + if seg:match('package=') then + pkgname = seg:sub(9) + elseif seg == 'development' or seg == 'profile' + or seg == 'debug' or seg == 'docs' then + pkgend = seg + else + ext = ext == '' and seg or ext..'-'..seg + end + end + pkgname = pkgname + ..(ext == '' and '' or '-'..ext) + ..(pkgend == '' and '' or '-'..pkgend) + return pkgname +end + +--- @class Analysis_session +--- @param metalog string +--- @param verbose boolean +--- @param w_notagdirs boolean turn on to also check directories +function Analysis_session(metalog, verbose, w_notagdirs) + local files = {} -- map + -- set is map. if bool is true then elem exists + local pkgs = {} -- map> + ----- used to keep track of files not belonging to a pkg. not used so + ----- it is commented with ----- + -----local nopkg = {} -- set + --- @public + local swarn = {} + --- @public + local serrs = {} + + -- returns number of files in package and size of package + -- nil is returned upon errors + --- @param pkgname string + local function pkg_size(pkgname) + local filecount, sz = 0, 0 + for filename in pairs(pkgs[pkgname]) do + local rows = files[filename] + -- normally, there should be only one row per filename + -- if these rows are equal, there should be warning, but it + -- does not affect size counting. if not, it is an error + if #rows > 1 and not metalogrows_all_equal(rows) then + return nil + end + local row = rows[1] + if row.attrs.type == 'file' then + sz = sz + tonumber(row.attrs.size) + end + filecount = filecount + 1 + end + return filecount, sz + end + + --- @param pkgname string + --- @param mode number + local function pkg_ismode(pkgname, mode) + for filename in pairs(pkgs[pkgname]) do + for _, row in ipairs(files[filename]) do + if tonumber(row.attrs.mode, 8) & mode ~= 0 then + return true + end + end + end + return false + end + + --- @param pkgname string + --- @public + local function pkg_issetuid(pkgname) + return pkg_ismode(pkgname, 2048) + end + + --- @param pkgname string + --- @public + local function pkg_issetgid(pkgname) + return pkg_ismode(pkgname, 1024) + end + + --- @param pkgname string + --- @public + local function pkg_issetid(pkgname) + return pkg_issetuid(pkgname) or pkg_issetgid(pkgname) + end + + -- sample return: + -- { [*string]: { count=1, size=2, issetuid=true, issetgid=true } } + local function pkg_report_helper_table() + local res = {} + for pkgname in pairs(pkgs) do + res[pkgname] = {} + res[pkgname].count, + res[pkgname].size = pkg_size(pkgname) + res[pkgname].issetuid = pkg_issetuid(pkgname) + res[pkgname].issetgid = pkg_issetgid(pkgname) + end + return res + end + + -- returns a string describing package scan report + --- @public + local function pkg_report_full() + local sb = {} + for pkgname, v in sortedPairs(pkg_report_helper_table()) do + sb[#sb+1] = 'Package '..pkgname..':' + if v.issetuid or v.issetgid then + sb[#sb+1] = ''..table.concat({ + v.issetuid and ' setuid' or '', + v.issetgid and ' setgid' or '' }, '') + end + sb[#sb+1] = '\n number of files: '..(v.count or '?') + ..'\n total size: '..(v.size or '?') + sb[#sb+1] = '\n' + end + return table.concat(sb, '') + end + + --- @param have_count boolean + --- @param have_size boolean + --- @param filters function[] + --- @public + -- returns a string describing package size report. + -- sample: "mypackage 2 2048"* if both booleans are true + local function pkg_report_simple(have_count, have_size, filters) + filters = filters or {} + local sb = {} + for pkgname, v in sortedPairs(pkg_report_helper_table()) do + local pred = true + -- doing a foldl to all the function results with (and) + for _, f in pairs(filters) do pred = pred and f(pkgname) end + if pred then + sb[#sb+1] = pkgname..table.concat({ + have_count and (' '..(v.count or '?')) or '', + have_size and (' '..(v.size or '?')) or ''}, '') + ..'\n' + end + end + return table.concat(sb, '') + end + + -- returns a string describing duplicate file warnings, + -- returns a string describing duplicate file errors + --- @public + local function dup_report() + local warn, errs = {}, {} + for filename, rows in sortedPairs(files) do + if #rows == 1 then goto continue end + local iseq, offby = metalogrows_all_equal(rows) + if iseq then -- repeated line, just a warning + warn[#warn+1] = 'warning: '..filename + ..' repeated with same meta: line ' + ..table.concat( + table_map(rows, function(e) return e.linenum end), ',') + warn[#warn+1] = '\n' + elseif not metalogrows_all_equal(rows, false, true) then + -- same filename (possibly different tags), different metadata, an error + errs[#errs+1] = 'error: '..filename + ..' exists in multiple locations and with different meta: line ' + ..table.concat( + table_map(rows, function(e) return e.linenum end), ',') + ..'. off by "'..offby..'"' + errs[#errs+1] = '\n' + end + ::continue:: + end + return table.concat(warn, ''), table.concat(errs, '') + end + + -- returns a string describing warnings of found hard links + -- returns a string describing errors of found hard links + --- @public + local function inode_report() + -- obtain inodes of filenames + local attributes = require('lfs').attributes + local inm = {} -- map + local unstatables = {} -- string[] + for filename in pairs(files) do + -- i only took the first row of a filename, + -- and skip links and folders + if files[filename][1].attrs.type ~= 'file' then + goto continue + end + -- make ./xxx become /xxx so that we can stat + filename = filename:sub(2) + local fs = attributes(filename) + if fs == nil then + unstatables[#unstatables+1] = filename + goto continue + end + local inode = fs.ino + inm[inode] = inm[inode] or {} + -- add back the dot prefix + table.insert(inm[inode], '.'..filename) + ::continue:: + end + + local warn, errs = {}, {} + for _, filenames in pairs(inm) do + if #filenames == 1 then goto continue end + -- i only took the first row of a filename + local rows = table_map(filenames, function(e) + return files[e][1] + end) + local iseq, offby = metalogrows_all_equal(rows, true, true) + if not iseq then + errs[#errs+1] = 'error: ' + ..'entries point to the same inode but have different meta: ' + ..table.concat(filenames, ',')..' in line ' + ..table.concat( + table_map(rows, function(e) return e.linenum end), ',') + ..'. off by "'..offby..'"' + errs[#errs+1] = '\n' + end + ::continue:: + end + + if #unstatables > 0 then + warn[#warn+1] = verbose and + 'note: skipped checking inodes: '..table.concat(unstatables, ',')..'\n' + or + 'note: skipped checking inodes for '..#unstatables..' entries\n' + end + + return table.concat(warn, ''), table.concat(errs, '') + end + + do + local fp, errmsg, errcode = io.open(metalog, 'r') + if fp == nil then + io.stderr:write('cannot open '..metalog..': '..errmsg..': '..errcode..'\n') + os.exit(1) + end + + -- scan all lines and put file data into the dictionaries + local firsttimes = {} -- set + local lineno = 0 + for line in fp:lines() do + -----local isinpkg = false + lineno = lineno + 1 + -- skip lines begining with # + if line:match('^%s*#') then goto continue end + -- skip blank lines + if line:match('^%s*$') then goto continue end + + local data = MetalogRow(line, lineno) + -- entries with dir and no tags... ignore for the first time + if not w_notagdirs and + data.attrs.tags == nil and data.attrs.type == 'dir' + and not firsttimes[data.filename] then + firsttimes[data.filename] = true + goto continue + end + + files[data.filename] = files[data.filename] or {} + table.insert(files[data.filename], data) + + if data.attrs.tags ~= nil then + pkgname = pkgname_from_tag(data.attrs.tags) + pkgs[pkgname] = pkgs[pkgname] or {} + pkgs[pkgname][data.filename] = true + ------isinpkg = true + end + -----if not isinpkg then nopkg[data.filename] = true end + ::continue:: + end + + fp:close() + end + + return { + warn = swarn, + errs = serrs, + pkg_issetuid = pkg_issetuid, + pkg_issetgid = pkg_issetgid, + pkg_issetid = pkg_issetid, + pkg_report_full = pkg_report_full, + pkg_report_simple = pkg_report_simple, + dup_report = dup_report, + inode_report = inode_report + } +end + +main(arg) From owner-svn-src-head@freebsd.org Sun May 10 17:19:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9BD42ED57E; Sun, 10 May 2020 17:19:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KrQc4VNTz4Qb8; Sun, 10 May 2020 17:19:20 +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 9591A8A0E; Sun, 10 May 2020 17:19:20 +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 04AHJKUa090576; Sun, 10 May 2020 17:19:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AHJJB8090571; Sun, 10 May 2020 17:19:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005101719.04AHJJB8090571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 10 May 2020 17:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360878 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 360878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 17:19:20 -0000 Author: tuexen Date: Sun May 10 17:19:19 2020 New Revision: 360878 URL: https://svnweb.freebsd.org/changeset/base/360878 Log: Ensure that we have a path when starting the T3 RXT timer. Reported by: syzbot+f2321629047f89486fa3@syzkaller.appspotmail.com MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Sun May 10 16:11:19 2020 (r360877) +++ head/sys/netinet/sctp_asconf.c Sun May 10 17:19:19 2020 (r360878) @@ -1032,9 +1032,14 @@ sctp_assoc_immediate_retrans(struct sctp_tcb *stcb, st (stcb->asoc.sent_queue_cnt > 0)) { struct sctp_tmit_chunk *chk; - chk = TAILQ_FIRST(&stcb->asoc.sent_queue); - sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, - stcb, chk->whoTo); + TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { + if (chk->whoTo != NULL) { + break; + } + } + if (chk != NULL) { + sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, chk->whoTo); + } } } return; Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun May 10 16:11:19 2020 (r360877) +++ head/sys/netinet/sctp_indata.c Sun May 10 17:19:19 2020 (r360878) @@ -4439,7 +4439,12 @@ again: } } } - if (lchk) { + for (; lchk != NULL; lchk = TAILQ_NEXT(lchk, sctp_next)) { + if (lchk->whoTo != NULL) { + break; + } + } + if (lchk != NULL) { /* Assure a timer is up */ sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, lchk->whoTo); @@ -5279,7 +5284,12 @@ again: } } } - if (lchk) { + for (; lchk != NULL; lchk = TAILQ_NEXT(lchk, sctp_next)) { + if (lchk->whoTo != NULL) { + break; + } + } + if (lchk != NULL) { /* Assure a timer is up */ sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, lchk->whoTo); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun May 10 16:11:19 2020 (r360877) +++ head/sys/netinet/sctp_input.c Sun May 10 17:19:19 2020 (r360878) @@ -2956,6 +2956,7 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c { /* cp must not be used, others call this without a c-ack :-) */ struct sctp_association *asoc; + struct sctp_tmit_chunk *chk; SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_cookie_ack: handling COOKIE-ACK\n"); @@ -3059,11 +3060,13 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c closed_socket: /* Toss the cookie if I can */ sctp_toss_old_cookies(stcb, asoc); - if (!TAILQ_EMPTY(&asoc->sent_queue)) { - /* Restart the timer if we have pending data */ - struct sctp_tmit_chunk *chk; - - chk = TAILQ_FIRST(&asoc->sent_queue); + /* Restart the timer if we have pending data */ + TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { + if (chk->whoTo != NULL) { + break; + } + } + if (chk != NULL) { sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, chk->whoTo); } } @@ -5159,6 +5162,7 @@ process_control_chunks: } else { struct mbuf *ret_buf; struct sctp_inpcb *linp; + struct sctp_tmit_chunk *chk; if (stcb) { linp = NULL; @@ -5220,14 +5224,13 @@ process_control_chunks: got_auth = 1; auth_skipped = 0; } - if (!TAILQ_EMPTY(&stcb->asoc.sent_queue)) { - /* - * Restart the timer if we have - * pending data - */ - struct sctp_tmit_chunk *chk; - - chk = TAILQ_FIRST(&stcb->asoc.sent_queue); + /* Restart the timer if we have pending data */ + TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { + if (chk->whoTo != NULL) { + break; + } + } + if (chk != NULL) { sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, chk->whoTo); } } Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Sun May 10 16:11:19 2020 (r360877) +++ head/sys/netinet/sctp_timer.c Sun May 10 17:19:19 2020 (r360878) @@ -974,7 +974,12 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, /* C3. See if we need to send a Fwd-TSN */ if (SCTP_TSN_GT(stcb->asoc.advanced_peer_ack_point, stcb->asoc.last_acked_seq)) { send_forward_tsn(stcb, &stcb->asoc); - if (lchk) { + for (; lchk != NULL; lchk = TAILQ_NEXT(lchk, sctp_next)) { + if (lchk->whoTo != NULL) { + break; + } + } + if (lchk != NULL) { /* Assure a timer is up */ sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, lchk->whoTo); } Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun May 10 16:11:19 2020 (r360877) +++ head/sys/netinet/sctputil.c Sun May 10 17:19:19 2020 (r360878) @@ -1841,14 +1841,19 @@ sctp_timeout_handler(void *t) struct sctp_tmit_chunk *chk; /* - * safeguard. If there on some on the sent queue + * Safeguard. If there on some on the sent queue * somewhere but no timers running something is * wrong... so we start a timer on the first chunk * on the send queue on whatever net it is sent to. */ - chk = TAILQ_FIRST(&stcb->asoc.sent_queue); - sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, - chk->whoTo); + TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { + if (chk->whoTo != NULL) { + break; + } + } + if (chk != NULL) { + sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, chk->whoTo); + } } break; case SCTP_TIMER_TYPE_INIT: From owner-svn-src-head@freebsd.org Sun May 10 17:43:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC91A2EDF5A; Sun, 10 May 2020 17:43:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Kryk48VXz4Rwp; Sun, 10 May 2020 17:43:42 +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 89BF88FBA; Sun, 10 May 2020 17:43:42 +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 04AHhgea008754; Sun, 10 May 2020 17:43:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AHhg66008753; Sun, 10 May 2020 17:43:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005101743.04AHhg66008753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 10 May 2020 17:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360879 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 360879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 17:43:42 -0000 Author: tuexen Date: Sun May 10 17:43:42 2020 New Revision: 360879 URL: https://svnweb.freebsd.org/changeset/base/360879 Log: Remove trailing whitespace. Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Sun May 10 17:19:19 2020 (r360878) +++ head/sys/netinet/tcp_usrreq.c Sun May 10 17:43:42 2020 (r360879) @@ -1373,7 +1373,7 @@ tcp_usr_close(struct socket *so) NET_EPOCH_EXIT(et); } -static int +static int tcp_pru_options_support(struct tcpcb *tp, int flags) { /* From owner-svn-src-head@freebsd.org Sun May 10 19:00:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 196502F0EFB; Sun, 10 May 2020 19:00:59 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Ktgt6mX3z4XJR; Sun, 10 May 2020 19:00:58 +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 E38E19DB6; Sun, 10 May 2020 19:00:58 +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 04AJ0w0W051821; Sun, 10 May 2020 19:00:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AJ0v5h051816; Sun, 10 May 2020 19:00:57 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005101900.04AJ0v5h051816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 10 May 2020 19:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360881 - in head/sys/powerpc: aim booke include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: aim booke include powerpc X-SVN-Commit-Revision: 360881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 19:00:59 -0000 Author: jhibbits Date: Sun May 10 19:00:57 2020 New Revision: 360881 URL: https://svnweb.freebsd.org/changeset/base/360881 Log: powerpc: Add a CPU-custom machine check handler Summary: Some machine checks are process-recoverable, others are not. Let a CPU-specific handler decide what to do. This works around a machine check error hit while building www/firefox and mail/thunderbird, which would otherwise cause the build to fail. More work is needed to handle all possible machine check conditions, but this is sufficient to unblock some ports building. Differential Revision: https://reviews.freebsd.org/D23731 Modified: head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/booke/machdep_e500.c head/sys/powerpc/include/cpu.h head/sys/powerpc/include/spr.h head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Sun May 10 18:17:25 2020 (r360880) +++ head/sys/powerpc/aim/aim_machdep.c Sun May 10 19:00:57 2020 (r360881) @@ -515,6 +515,32 @@ memcpy(pcpu->pc_aim.slb, PCPU_GET(aim.slb), sizeof(pcp #endif } +/* Return 0 on handled success, otherwise signal number. */ +int +cpu_machine_check(struct thread *td, struct trapframe *frame, int *ucode) +{ +#ifdef __powerpc64__ + /* + * This block is 64-bit CPU specific currently. Punt running in 32-bit + * mode on 64-bit CPUs. + */ + /* Check if the important information is in DSISR */ + if ((frame->srr1 & SRR1_MCHK_DATA) != 0) { + printf("Machine check, DSISR: %016lx\n", frame->cpu.aim.dsisr); + /* SLB multi-hit is recoverable. */ + if ((frame->cpu.aim.dsisr & DSISR_MC_SLB_MULTIHIT) != 0) + return (0); + /* TODO: Add other machine check recovery procedures. */ + } else { + if ((frame->srr1 & SRR1_MCHK_IFETCH_M) == SRR1_MCHK_IFETCH_SLBMH) + return (0); + } +#endif + *ucode = BUS_OBJERR; + return (SIGBUS); +} + + #ifndef __powerpc64__ uint64_t va_to_vsid(pmap_t pm, vm_offset_t va) Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Sun May 10 18:17:25 2020 (r360880) +++ head/sys/powerpc/aim/trap_subr64.S Sun May 10 19:00:57 2020 (r360881) @@ -797,6 +797,8 @@ generictrap: std %r31,(PC_TEMPSAVE+CPUSAVE_R31)(%r1) mfdar %r30 std %r30,(PC_TEMPSAVE+CPUSAVE_AIM_DAR)(%r1) + mfdsisr %r30 + std %r30,(PC_TEMPSAVE+CPUSAVE_AIM_DSISR)(%r1) mfsprg1 %r1 /* restore SP, in case of branch */ mfsprg2 %r28 /* save LR */ mfcr %r29 /* save CR */ Modified: head/sys/powerpc/booke/machdep_e500.c ============================================================================== --- head/sys/powerpc/booke/machdep_e500.c Sun May 10 18:17:25 2020 (r360880) +++ head/sys/powerpc/booke/machdep_e500.c Sun May 10 19:00:57 2020 (r360881) @@ -119,3 +119,15 @@ void booke_disable_l2_cache(void) { } + +/* Return 0 on handled success, otherwise signal number. */ +int +cpu_machine_check(struct thread *td, struct trapframe *frame, int *ucode) +{ + register_t mcsr; + + mcsr = mfspr(SPR_MCSR); + + *ucode = BUS_OBJERR; + return (SIGBUS); +} Modified: head/sys/powerpc/include/cpu.h ============================================================================== --- head/sys/powerpc/include/cpu.h Sun May 10 18:17:25 2020 (r360880) +++ head/sys/powerpc/include/cpu.h Sun May 10 19:00:57 2020 (r360881) @@ -134,6 +134,8 @@ get_cyclecount(void) extern char btext[]; extern char etext[]; +struct thread; + #ifdef __powerpc64__ extern void enter_idle_powerx(void); extern uint64_t can_wakeup; @@ -146,5 +148,6 @@ void cpu_sleep(void); void flush_disable_caches(void); void fork_trampoline(void); void swi_vm(void *); +int cpu_machine_check(struct thread *, struct trapframe *, int *); #endif /* _MACHINE_CPU_H_ */ Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sun May 10 18:17:25 2020 (r360880) +++ head/sys/powerpc/include/spr.h Sun May 10 19:00:57 2020 (r360881) @@ -108,6 +108,15 @@ #define DSISR_DABR 0x00400000 /* DABR match */ #define DSISR_SEGMENT 0x00200000 /* XXX; not in 6xx PEM */ #define DSISR_EAR 0x00100000 /* eciwx/ecowx && EAR[E] == 0 */ +#define DSISR_MC_UE_DEFERRED 0x00008000 /* UE deferred error */ +#define DSISR_MC_UE_TABLEWALK 0x00004000 /* UE deferred error during tablewalk */ +#define DSISR_MC_DERAT_MULTIHIT 0x00000800 /* D-ERAT multi-hit */ +#define DSISR_MC_TLB_MULTIHIT 0x00000400 /* TLB multi-hit */ +#define DSISR_MC_TLBIE_ERR 0x00000200 /* TLBIE or TLBIEL programming error */ +#define DSISR_MC_SLB_PARITY 0x00000100 /* SLB parity error */ +#define DSISR_MC_SLB_MULTIHIT 0x00000080 /* SLB Multi-hit detected (D-side) */ +#define DSISR_MC_BAD_REAL_LD 0x00000040 /* Bad real address for load. */ +#define DSISR_MC_BAD_ADDR 0x00000020 /* Bad address for load or store tablewalk */ #define SPR_DAR 0x013 /* .68 Data Address Register */ #define SPR_RTCU_W 0x014 /* .6. 601 RTC Upper - Write */ #define SPR_RTCL_W 0x015 /* .6. 601 RTC Lower - Write */ @@ -115,9 +124,12 @@ #define SPR_SDR1 0x019 /* .68 Page table base address register */ #define SPR_SRR0 0x01a /* 468 Save/Restore Register 0 */ #define SPR_SRR1 0x01b /* 468 Save/Restore Register 1 */ -#define SRR1_ISI_PFAULT 0x40000000 /* ISI page not found */ -#define SRR1_ISI_NOEXECUTE 0x10000000 /* Memory marked no-execute */ -#define SRR1_ISI_PP 0x08000000 /* PP bits forbid access */ +#define SRR1_ISI_PFAULT 0x40000000 /* ISI page not found */ +#define SRR1_ISI_NOEXECUTE 0x10000000 /* Memory marked no-execute */ +#define SRR1_ISI_PP 0x08000000 /* PP bits forbid access */ +#define SRR1_MCHK_DATA 0x00200000 /* Machine check data in DSISR */ +#define SRR1_MCHK_IFETCH_M 0x081c0000 /* Machine check instr fetch mask */ +#define SRR1_MCHK_IFETCH_SLBMH 0x000c0000 /* SLB multihit */ #define SPR_DECAR 0x036 /* ..8 Decrementer auto reload */ #define SPR_EIE 0x050 /* ..8 Exception Interrupt ??? */ #define SPR_EID 0x051 /* ..8 Exception Interrupt ??? */ @@ -725,6 +737,16 @@ #define SPR_MCARU 0x239 /* ..8 Machine Check Address register upper bits */ #define SPR_MCSR 0x23c /* ..8 Machine Check Syndrome register */ +#define MCSR_MCP 0x80000000 /* Machine check input signal to core */ +#define MCSR_L2MMU_MHIT 0x08000000 /* L2 MMU simultaneous hit */ +#define MCSR_NMI 0x00100000 /* Non-maskable interrupt */ +#define MCSR_MAV 0x00080000 /* MCAR address valid */ +#define MCSR_MEA 0x00040000 /* MCAR effective address */ +#define MCSR_IF 0x00010000 /* Instruction fetch error report */ +#define MCSR_LD 0x00008000 /* Load instruction error report */ +#define MCSR_ST 0x00004000 /* Store instruction error report */ +#define MCSR_LDG 0x00002000 /* Guarded load instruction error report */ +#define MCSR_TLBSYNC 0x00000002 /* Simultaneous TLBSYNC detected */ #define SPR_MCAR 0x23d /* ..8 Machine Check Address register */ #define SPR_ESR 0x003e /* ..8 Exception Syndrome Register */ Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Sun May 10 18:17:25 2020 (r360880) +++ head/sys/powerpc/powerpc/trap.c Sun May 10 19:00:57 2020 (r360881) @@ -402,13 +402,8 @@ trap(struct trapframe *frame) break; case EXC_MCHK: - /* - * Note that this may not be recoverable for the user - * process, depending on the type of machine check, - * but it at least prevents the kernel from dying. - */ - sig = SIGBUS; - ucode = BUS_OBJERR; + sig = cpu_machine_check(td, frame, &ucode); + printtrap(frame->exc, frame, 0, (frame->srr1 & PSL_PR)); break; #if defined(__powerpc64__) && defined(AIM) @@ -513,18 +508,17 @@ cpu_printtrap(u_int vector, struct trapframe *frame, i uint16_t ver; switch (vector) { + case EXC_MCHK: + ver = mfpvr() >> 16; + if (MPC745X_P(ver)) + printf(" msssr0 = 0x%b\n", + (int)mfspr(SPR_MSSSR0), MSSSR_BITMASK); case EXC_DSE: case EXC_DSI: case EXC_DTMISS: printf(" dsisr = 0x%lx\n", (u_long)frame->cpu.aim.dsisr); break; - case EXC_MCHK: - ver = mfpvr() >> 16; - if (MPC745X_P(ver)) - printf(" msssr0 = 0x%b\n", - (int)mfspr(SPR_MSSSR0), MSSSR_BITMASK); - break; } #elif defined(BOOKE) vm_paddr_t pa; @@ -556,14 +550,13 @@ printtrap(u_int vector, struct trapframe *frame, int i case EXC_DSI: case EXC_DTMISS: case EXC_ALI: + case EXC_MCHK: printf(" virtual address = 0x%" PRIxPTR "\n", frame->dar); break; case EXC_ISE: case EXC_ISI: case EXC_ITMISS: printf(" virtual address = 0x%" PRIxPTR "\n", frame->srr0); - break; - case EXC_MCHK: break; } cpu_printtrap(vector, frame, isfatal, user); From owner-svn-src-head@freebsd.org Sun May 10 20:28:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF9BC2F2C71; Sun, 10 May 2020 20:28:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Kwd25byFz4cZZ; Sun, 10 May 2020 20:28:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBC21AE92; Sun, 10 May 2020 20:28:38 +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 04AKSciA007144; Sun, 10 May 2020 20:28:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AKScO4007143; Sun, 10 May 2020 20:28:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005102028.04AKScO4007143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 10 May 2020 20:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360882 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 360882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 20:28:38 -0000 Author: kevans Date: Sun May 10 20:28:38 2020 New Revision: 360882 URL: https://svnweb.freebsd.org/changeset/base/360882 Log: buildworld: add back in missing semicolon if foo; then blah else blah; fi has a drastically different meaning than if foo; then blah; else blah; fi. Fix it. Reported by: 0mp X-MFC-With: r360833 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun May 10 19:00:57 2020 (r360881) +++ head/Makefile.inc1 Sun May 10 20:28:38 2020 (r360882) @@ -1409,7 +1409,7 @@ distributeworld installworld stageworld: _installcheck # basis, otherwise we'll just mention that we're not doing it to raise # awareness. @if which certctl>/dev/null; then \ - certctl rehash \ + certctl rehash; \ else \ echo "No certctl on the host, not rehashing target -- /etc/ssl may not be populated."; \ fi From owner-svn-src-head@freebsd.org Sun May 10 22:54:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9B392F66A0; Sun, 10 May 2020 22:54:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KzsL4Vlrz3HlC; Sun, 10 May 2020 22:54:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95B89CDFC; Sun, 10 May 2020 22:54:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04AMsU7i098986; Sun, 10 May 2020 22:54:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AMsUBW098985; Sun, 10 May 2020 22:54:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005102254.04AMsUBW098985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 10 May 2020 22:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360885 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 360885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 22:54:30 -0000 Author: tuexen Date: Sun May 10 22:54:30 2020 New Revision: 360885 URL: https://svnweb.freebsd.org/changeset/base/360885 Log: Ensure that the SCTP iterator runs with an stcb and inp, which belong to each other. Reported by: syzbot+82d39d14f2f765e38db0@syzkaller.appspotmail.com MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun May 10 21:37:39 2020 (r360884) +++ head/sys/netinet/sctputil.c Sun May 10 22:54:30 2020 (r360885) @@ -1489,6 +1489,7 @@ select_a_new_ep: } tinp = it->inp; it->inp = LIST_NEXT(it->inp, sctp_list); + it->stcb = NULL; SCTP_INP_RUNLOCK(tinp); if (it->inp == NULL) { goto done_with_iterator; @@ -1558,6 +1559,9 @@ select_a_new_ep: atomic_add_int(&it->stcb->asoc.refcnt, -1); iteration_count = 0; } + KASSERT(it->inp == it->stcb->sctp_ep, + ("%s: stcb %p does not belong to inp %p, but inp %p", + __func__, it->stcb, it->inp, it->stcb->sctp_ep)); /* run function on this one */ (*it->function_assoc) (it->inp, it->stcb, it->pointer, it->val); @@ -1590,6 +1594,7 @@ no_stcb: } else { it->inp = LIST_NEXT(it->inp, sctp_list); } + it->stcb = NULL; if (it->inp == NULL) { goto done_with_iterator; } From owner-svn-src-head@freebsd.org Mon May 11 02:33:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B2262D32C6; Mon, 11 May 2020 02:33:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49L4kB6tL4z3wqk; Mon, 11 May 2020 02:33:38 +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 E6EF3F773; Mon, 11 May 2020 02:33:38 +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 04B2Xcqj033581; Mon, 11 May 2020 02:33:38 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04B2XcpD033576; Mon, 11 May 2020 02:33:38 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005110233.04B2XcpD033576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 11 May 2020 02:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360887 - in head/sys: conf powerpc/aim powerpc/booke powerpc/include powerpc/powerpc vm X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: conf powerpc/aim powerpc/booke powerpc/include powerpc/powerpc vm X-SVN-Commit-Revision: 360887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 02:33:39 -0000 Author: jhibbits Date: Mon May 11 02:33:37 2020 New Revision: 360887 URL: https://svnweb.freebsd.org/changeset/base/360887 Log: powerpc64: Implement Radix MMU for POWER9 CPUs Summary: POWER9 supports two MMU formats: traditional hashed page tables, and Radix page tables, similar to what's presesnt on most other architectures. The PowerISA also specifies a process table -- a table of page table pointers-- which on the POWER9 is only available with the Radix MMU, so we can take advantage of it with the Radix MMU driver. Written by Matt Macy. Differential Revision: https://reviews.freebsd.org/D19516 Added: head/sys/powerpc/aim/mmu_radix.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/cpufunc.h head/sys/powerpc/include/mmuvar.h head/sys/powerpc/include/param.h head/sys/powerpc/include/pmap.h head/sys/powerpc/include/proc.h head/sys/powerpc/include/pte.h head/sys/powerpc/include/spr.h head/sys/powerpc/include/sr.h head/sys/powerpc/include/vmparam.h head/sys/powerpc/powerpc/machdep.c head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c head/sys/powerpc/powerpc/trap.c head/sys/vm/vm_fault.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon May 11 01:20:40 2020 (r360886) +++ head/sys/conf/files.powerpc Mon May 11 02:33:37 2020 (r360887) @@ -135,6 +135,7 @@ powerpc/aim/locore.S optional aim no-obj powerpc/aim/aim_machdep.c optional aim powerpc/aim/mmu_oea.c optional aim powerpc powerpc/aim/mmu_oea64.c optional aim +powerpc/aim/mmu_radix.c optional aim powerpc64 powerpc/aim/moea64_if.m optional aim powerpc/aim/moea64_native.c optional aim powerpc/aim/mp_cpudep.c optional aim Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Mon May 11 01:20:40 2020 (r360886) +++ head/sys/powerpc/aim/aim_machdep.c Mon May 11 02:33:37 2020 (r360887) @@ -136,6 +136,8 @@ __FBSDID("$FreeBSD$"); struct bat battable[16]; #endif +int radix_mmu = 0; + #ifndef __powerpc64__ /* Bits for running on 64-bit systems in 32-bit mode. */ extern void *testppc64, *testppc64size; @@ -451,7 +453,14 @@ aim_cpu_init(vm_offset_t toc) * in case the platform module had a better idea of what we * should do. */ - if (cpu_features & PPC_FEATURE_64) + if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { + radix_mmu = 0; + TUNABLE_INT_FETCH("radix_mmu", &radix_mmu); + if (radix_mmu) + pmap_mmu_install(MMU_TYPE_RADIX, BUS_PROBE_GENERIC); + else + pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); + } else if (cpu_features & PPC_FEATURE_64) pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); else pmap_mmu_install(MMU_TYPE_OEA, BUS_PROBE_GENERIC); Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Mon May 11 01:20:40 2020 (r360886) +++ head/sys/powerpc/aim/mmu_oea.c Mon May 11 02:33:37 2020 (r360887) @@ -322,6 +322,7 @@ void moea_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t void moea_scan_init(mmu_t mmu); vm_offset_t moea_quick_enter_page(mmu_t mmu, vm_page_t m); void moea_quick_remove_page(mmu_t mmu, vm_offset_t addr); +boolean_t moea_page_is_mapped(mmu_t mmu, vm_page_t m); static int moea_map_user_ptr(mmu_t mmu, pmap_t pm, volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); static int moea_decode_kernel_ptr(mmu_t mmu, vm_offset_t addr, @@ -364,6 +365,7 @@ static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_page_set_memattr, moea_page_set_memattr), MMUMETHOD(mmu_quick_enter_page, moea_quick_enter_page), MMUMETHOD(mmu_quick_remove_page, moea_quick_remove_page), + MMUMETHOD(mmu_page_is_mapped, moea_page_is_mapped), /* Internal interfaces */ MMUMETHOD(mmu_bootstrap, moea_bootstrap), @@ -1102,6 +1104,12 @@ moea_quick_enter_page(mmu_t mmu, vm_page_t m) void moea_quick_remove_page(mmu_t mmu, vm_offset_t addr) { +} + +boolean_t +moea_page_is_mapped(mmu_t mmu, vm_page_t m) +{ + return (!LIST_EMPTY(&(m)->md.mdpg_pvoh)); } /* Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon May 11 01:20:40 2020 (r360886) +++ head/sys/powerpc/aim/mmu_oea64.c Mon May 11 02:33:37 2020 (r360887) @@ -120,8 +120,7 @@ uintptr_t moea64_get_unique_vsid(void); * */ -#define PV_LOCK_PER_DOM (PA_LOCK_COUNT * 3) -#define PV_LOCK_COUNT (PV_LOCK_PER_DOM * MAXMEMDOM) +#define PV_LOCK_COUNT PA_LOCK_COUNT static struct mtx_padalign pv_lock[PV_LOCK_COUNT]; /* @@ -130,8 +129,7 @@ static struct mtx_padalign pv_lock[PV_LOCK_COUNT]; * index at (N << 45). */ #ifdef __powerpc64__ -#define PV_LOCK_IDX(pa) (pa_index(pa) % PV_LOCK_PER_DOM + \ - (((pa) >> 45) % MAXMEMDOM) * PV_LOCK_PER_DOM) +#define PV_LOCK_IDX(pa) ((pa_index(pa) * (((pa) >> 45) + 1)) % PV_LOCK_COUNT) #else #define PV_LOCK_IDX(pa) (pa_index(pa) % PV_LOCK_COUNT) #endif @@ -305,6 +303,7 @@ void moea64_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size void moea64_scan_init(mmu_t mmu); vm_offset_t moea64_quick_enter_page(mmu_t mmu, vm_page_t m); void moea64_quick_remove_page(mmu_t mmu, vm_offset_t addr); +boolean_t moea64_page_is_mapped(mmu_t mmu, vm_page_t m); static int moea64_map_user_ptr(mmu_t mmu, pmap_t pm, volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); static int moea64_decode_kernel_ptr(mmu_t mmu, vm_offset_t addr, @@ -353,6 +352,7 @@ static mmu_method_t moea64_methods[] = { MMUMETHOD(mmu_page_set_memattr, moea64_page_set_memattr), MMUMETHOD(mmu_quick_enter_page, moea64_quick_enter_page), MMUMETHOD(mmu_quick_remove_page, moea64_quick_remove_page), + MMUMETHOD(mmu_page_is_mapped, moea64_page_is_mapped), #ifdef __powerpc64__ MMUMETHOD(mmu_page_array_startup, moea64_page_array_startup), #endif @@ -1423,6 +1423,12 @@ moea64_quick_remove_page(mmu_t mmu, vm_offset_t addr) ("moea64_quick_remove_page: invalid address")); mtx_unlock(PCPU_PTR(aim.qmap_lock)); sched_unpin(); +} + +boolean_t +moea64_page_is_mapped(mmu_t mmu, vm_page_t m) +{ + return (!LIST_EMPTY(&(m)->md.mdpg_pvoh)); } /* Added: head/sys/powerpc/aim/mmu_radix.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/aim/mmu_radix.c Mon May 11 02:33:37 2020 (r360887) @@ -0,0 +1,6507 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Matthew Macy + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#include +__FBSDID("$FreeBSD$"); + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef INVARIANTS +#include +#endif + +#define PPC_BITLSHIFT(bit) (sizeof(long)*NBBY - 1 - (bit)) +#define PPC_BIT(bit) (1UL << PPC_BITLSHIFT(bit)) +#define PPC_BITLSHIFT_VAL(val, bit) ((val) << PPC_BITLSHIFT(bit)) + +#include "opt_ddb.h" +#ifdef DDB +static void pmap_pte_walk(pml1_entry_t *l1, vm_offset_t va); +#endif + +#define PG_W RPTE_WIRED +#define PG_V RPTE_VALID +#define PG_MANAGED RPTE_MANAGED +#define PG_PROMOTED RPTE_PROMOTED +#define PG_M RPTE_C +#define PG_A RPTE_R +#define PG_X RPTE_EAA_X +#define PG_RW RPTE_EAA_W +#define PG_PTE_CACHE RPTE_ATTR_MASK + +#define RPTE_SHIFT 9 +#define NLS_MASK ((1UL<<5)-1) +#define RPTE_ENTRIES (1UL<> L3_PAGE_SIZE_SHIFT); +} + +static __inline vm_pindex_t +pmap_pml3e_index(vm_offset_t va) +{ + + return ((va >> L3_PAGE_SIZE_SHIFT) & RPTE_MASK); +} + +static __inline vm_pindex_t +pmap_pml2e_index(vm_offset_t va) +{ + return ((va >> L2_PAGE_SIZE_SHIFT) & RPTE_MASK); +} + +static __inline vm_pindex_t +pmap_pml1e_index(vm_offset_t va) +{ + return ((va & PG_FRAME) >> L1_PAGE_SIZE_SHIFT); +} + +/* Return various clipped indexes for a given VA */ +static __inline vm_pindex_t +pmap_pte_index(vm_offset_t va) +{ + + return ((va >> PAGE_SHIFT) & RPTE_MASK); +} + +/* Return a pointer to the PT slot that corresponds to a VA */ +static __inline pt_entry_t * +pmap_l3e_to_pte(pt_entry_t *l3e, vm_offset_t va) +{ + pt_entry_t *pte; + vm_paddr_t ptepa; + + ptepa = (*l3e & NLB_MASK); + pte = (pt_entry_t *)PHYS_TO_DMAP(ptepa); + return (&pte[pmap_pte_index(va)]); +} + +/* Return a pointer to the PD slot that corresponds to a VA */ +static __inline pt_entry_t * +pmap_l2e_to_l3e(pt_entry_t *l2e, vm_offset_t va) +{ + pt_entry_t *l3e; + vm_paddr_t l3pa; + + l3pa = (*l2e & NLB_MASK); + l3e = (pml3_entry_t *)PHYS_TO_DMAP(l3pa); + return (&l3e[pmap_pml3e_index(va)]); +} + +/* Return a pointer to the PD slot that corresponds to a VA */ +static __inline pt_entry_t * +pmap_l1e_to_l2e(pt_entry_t *l1e, vm_offset_t va) +{ + pt_entry_t *l2e; + vm_paddr_t l2pa; + + l2pa = (*l1e & NLB_MASK); + + l2e = (pml2_entry_t *)PHYS_TO_DMAP(l2pa); + return (&l2e[pmap_pml2e_index(va)]); +} + +static __inline pml1_entry_t * +pmap_pml1e(pmap_t pmap, vm_offset_t va) +{ + + return (&pmap->pm_pml1[pmap_pml1e_index(va)]); +} + +static pt_entry_t * +pmap_pml2e(pmap_t pmap, vm_offset_t va) +{ + pt_entry_t *l1e; + + l1e = pmap_pml1e(pmap, va); + if (l1e == NULL || (*l1e & RPTE_VALID) == 0) + return (NULL); + return (pmap_l1e_to_l2e(l1e, va)); +} + +static __inline pt_entry_t * +pmap_pml3e(pmap_t pmap, vm_offset_t va) +{ + pt_entry_t *l2e; + + l2e = pmap_pml2e(pmap, va); + if (l2e == NULL || (*l2e & RPTE_VALID) == 0) + return (NULL); + return (pmap_l2e_to_l3e(l2e, va)); +} + +static __inline pt_entry_t * +pmap_pte(pmap_t pmap, vm_offset_t va) +{ + pt_entry_t *l3e; + + l3e = pmap_pml3e(pmap, va); + if (l3e == NULL || (*l3e & RPTE_VALID) == 0) + return (NULL); + return (pmap_l3e_to_pte(l3e, va)); +} + +int nkpt = 64; +SYSCTL_INT(_machdep, OID_AUTO, nkpt, CTLFLAG_RD, &nkpt, 0, + "Number of kernel page table pages allocated on bootup"); + +vm_paddr_t dmaplimit; + +SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); + +static int pg_ps_enabled = 1; +SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, + &pg_ps_enabled, 0, "Are large page mappings enabled?"); +#ifdef INVARIANTS +#define VERBOSE_PMAP 0 +#define VERBOSE_PROTECT 0 +static int pmap_logging; +SYSCTL_INT(_vm_pmap, OID_AUTO, pmap_logging, CTLFLAG_RWTUN, + &pmap_logging, 0, "verbose debug logging"); +#endif + +static u_int64_t KPTphys; /* phys addr of kernel level 1 */ + +//static vm_paddr_t KERNend; /* phys addr of end of bootstrap data */ + +static vm_offset_t qframe = 0; +static struct mtx qframe_mtx; +static epoch_t pmap_epoch; + +void mmu_radix_activate(mmu_t mmu, struct thread *); +void mmu_radix_advise(mmu_t mmu, pmap_t, vm_offset_t, vm_offset_t, int); +void mmu_radix_align_superpage(mmu_t mmu, vm_object_t, vm_ooffset_t, vm_offset_t *, + vm_size_t); +void mmu_radix_clear_modify(mmu_t, vm_page_t); +void mmu_radix_copy(mmu_t, pmap_t, pmap_t, vm_offset_t, vm_size_t, vm_offset_t); +int mmu_radix_map_user_ptr(mmu_t mmu, pmap_t pm, + volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); +int mmu_radix_decode_kernel_ptr(mmu_t, vm_offset_t, int *, vm_offset_t *); +int mmu_radix_enter(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t, u_int, int8_t); +void mmu_radix_enter_object(mmu_t, pmap_t, vm_offset_t, vm_offset_t, vm_page_t, + vm_prot_t); +void mmu_radix_enter_quick(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t); +vm_paddr_t mmu_radix_extract(mmu_t, pmap_t pmap, vm_offset_t va); +vm_page_t mmu_radix_extract_and_hold(mmu_t, pmap_t, vm_offset_t, vm_prot_t); +void mmu_radix_kenter(mmu_t, vm_offset_t, vm_paddr_t); +vm_paddr_t mmu_radix_kextract(mmu_t, vm_offset_t); +void mmu_radix_kremove(mmu_t, vm_offset_t); +boolean_t mmu_radix_is_modified(mmu_t, vm_page_t); +boolean_t mmu_radix_is_prefaultable(mmu_t, pmap_t, vm_offset_t); +boolean_t mmu_radix_is_referenced(mmu_t, vm_page_t); +void mmu_radix_object_init_pt(mmu_t, pmap_t, vm_offset_t, vm_object_t, + vm_pindex_t, vm_size_t); +boolean_t mmu_radix_page_exists_quick(mmu_t, pmap_t, vm_page_t); +void mmu_radix_page_init(mmu_t, vm_page_t); +boolean_t mmu_radix_page_is_mapped(mmu_t, vm_page_t m); +void mmu_radix_page_set_memattr(mmu_t, vm_page_t, vm_memattr_t); +int mmu_radix_page_wired_mappings(mmu_t, vm_page_t); +void mmu_radix_pinit(mmu_t, pmap_t); +void mmu_radix_protect(mmu_t, pmap_t, vm_offset_t, vm_offset_t, vm_prot_t); +boolean_t mmu_radix_ps_enabled(mmu_t, pmap_t); +void mmu_radix_qenter(mmu_t, vm_offset_t, vm_page_t *, int); +void mmu_radix_qremove(mmu_t, vm_offset_t, int); +vm_offset_t mmu_radix_quick_enter_page(mmu_t, vm_page_t); +void mmu_radix_quick_remove_page(mmu_t, vm_offset_t); +boolean_t mmu_radix_ts_referenced(mmu_t, vm_page_t); +void mmu_radix_release(mmu_t, pmap_t); +void mmu_radix_remove(mmu_t, pmap_t, vm_offset_t, vm_offset_t); +void mmu_radix_remove_all(mmu_t, vm_page_t); +void mmu_radix_remove_pages(mmu_t, pmap_t); +void mmu_radix_remove_write(mmu_t, vm_page_t); +void mmu_radix_unwire(mmu_t, pmap_t, vm_offset_t, vm_offset_t); +void mmu_radix_zero_page(mmu_t, vm_page_t); +void mmu_radix_zero_page_area(mmu_t, vm_page_t, int, int); +int mmu_radix_change_attr(mmu_t, vm_offset_t, vm_size_t, vm_memattr_t); +void mmu_radix_page_array_startup(mmu_t mmu, long pages); + +#include "mmu_oea64.h" +#include "mmu_if.h" +#include "moea64_if.h" + +/* + * Kernel MMU interface + */ + +static void mmu_radix_bootstrap(mmu_t mmup, + vm_offset_t kernelstart, vm_offset_t kernelend); + +static void mmu_radix_copy_page(mmu_t, vm_page_t, vm_page_t); +static void mmu_radix_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offset_t a_offset, + vm_page_t *mb, vm_offset_t b_offset, int xfersize); +static void mmu_radix_growkernel(mmu_t, vm_offset_t); +static void mmu_radix_init(mmu_t); +static int mmu_radix_mincore(mmu_t, pmap_t, vm_offset_t, vm_paddr_t *); +static vm_offset_t mmu_radix_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); +static void mmu_radix_pinit0(mmu_t, pmap_t); + +static void *mmu_radix_mapdev(mmu_t, vm_paddr_t, vm_size_t); +static void *mmu_radix_mapdev_attr(mmu_t, vm_paddr_t, vm_size_t, vm_memattr_t); +static void mmu_radix_unmapdev(mmu_t, vm_offset_t, vm_size_t); +static void mmu_radix_kenter_attr(mmu_t, vm_offset_t, vm_paddr_t, vm_memattr_t ma); +static boolean_t mmu_radix_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); +static void mmu_radix_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t sz, + void **va); +static void mmu_radix_scan_init(mmu_t mmu); +static void mmu_radix_cpu_bootstrap(mmu_t, int ap); + +static mmu_method_t mmu_radix_methods[] = { + MMUMETHOD(mmu_bootstrap, mmu_radix_bootstrap), + MMUMETHOD(mmu_copy_page, mmu_radix_copy_page), + MMUMETHOD(mmu_copy_pages, mmu_radix_copy_pages), + MMUMETHOD(mmu_cpu_bootstrap, mmu_radix_cpu_bootstrap), + MMUMETHOD(mmu_growkernel, mmu_radix_growkernel), + MMUMETHOD(mmu_init, mmu_radix_init), + MMUMETHOD(mmu_map, mmu_radix_map), + MMUMETHOD(mmu_mincore, mmu_radix_mincore), + MMUMETHOD(mmu_pinit, mmu_radix_pinit), + MMUMETHOD(mmu_pinit0, mmu_radix_pinit0), + + MMUMETHOD(mmu_mapdev, mmu_radix_mapdev), + MMUMETHOD(mmu_mapdev_attr, mmu_radix_mapdev_attr), + MMUMETHOD(mmu_unmapdev, mmu_radix_unmapdev), + MMUMETHOD(mmu_kenter_attr, mmu_radix_kenter_attr), + MMUMETHOD(mmu_dev_direct_mapped,mmu_radix_dev_direct_mapped), + MMUMETHOD(mmu_scan_init, mmu_radix_scan_init), + MMUMETHOD(mmu_dumpsys_map, mmu_radix_dumpsys_map), + MMUMETHOD(mmu_page_is_mapped, mmu_radix_page_is_mapped), + MMUMETHOD(mmu_ps_enabled, mmu_radix_ps_enabled), + MMUMETHOD(mmu_object_init_pt, mmu_radix_object_init_pt), + MMUMETHOD(mmu_protect, mmu_radix_protect), + /* pmap dispatcher interface */ + MMUMETHOD(mmu_clear_modify, mmu_radix_clear_modify), + MMUMETHOD(mmu_copy, mmu_radix_copy), + MMUMETHOD(mmu_enter, mmu_radix_enter), + MMUMETHOD(mmu_enter_object, mmu_radix_enter_object), + MMUMETHOD(mmu_enter_quick, mmu_radix_enter_quick), + MMUMETHOD(mmu_extract, mmu_radix_extract), + MMUMETHOD(mmu_extract_and_hold, mmu_radix_extract_and_hold), + MMUMETHOD(mmu_is_modified, mmu_radix_is_modified), + MMUMETHOD(mmu_is_prefaultable, mmu_radix_is_prefaultable), + MMUMETHOD(mmu_is_referenced, mmu_radix_is_referenced), + MMUMETHOD(mmu_ts_referenced, mmu_radix_ts_referenced), + MMUMETHOD(mmu_page_exists_quick,mmu_radix_page_exists_quick), + MMUMETHOD(mmu_page_init, mmu_radix_page_init), + MMUMETHOD(mmu_page_wired_mappings, mmu_radix_page_wired_mappings), + MMUMETHOD(mmu_qenter, mmu_radix_qenter), + MMUMETHOD(mmu_qremove, mmu_radix_qremove), + MMUMETHOD(mmu_release, mmu_radix_release), + MMUMETHOD(mmu_remove, mmu_radix_remove), + MMUMETHOD(mmu_remove_all, mmu_radix_remove_all), + MMUMETHOD(mmu_remove_write, mmu_radix_remove_write), + MMUMETHOD(mmu_unwire, mmu_radix_unwire), + MMUMETHOD(mmu_zero_page, mmu_radix_zero_page), + MMUMETHOD(mmu_zero_page_area, mmu_radix_zero_page_area), + MMUMETHOD(mmu_activate, mmu_radix_activate), + MMUMETHOD(mmu_quick_enter_page, mmu_radix_quick_enter_page), + MMUMETHOD(mmu_quick_remove_page, mmu_radix_quick_remove_page), + MMUMETHOD(mmu_page_set_memattr, mmu_radix_page_set_memattr), + MMUMETHOD(mmu_page_array_startup, mmu_radix_page_array_startup), + + /* Internal interfaces */ + MMUMETHOD(mmu_kenter, mmu_radix_kenter), + MMUMETHOD(mmu_kextract, mmu_radix_kextract), + MMUMETHOD(mmu_kremove, mmu_radix_kremove), + MMUMETHOD(mmu_change_attr, mmu_radix_change_attr), + MMUMETHOD(mmu_map_user_ptr, mmu_radix_map_user_ptr), + MMUMETHOD(mmu_decode_kernel_ptr, mmu_radix_decode_kernel_ptr), + { 0, 0 } +}; + +MMU_DEF(mmu_radix, MMU_TYPE_RADIX, mmu_radix_methods, 0); + +#define METHODVOID(m) mmu_radix_ ## m(mmu_t mmup) + +static boolean_t pmap_demote_l3e_locked(pmap_t pmap, pml3_entry_t *l3e, vm_offset_t va, + struct rwlock **lockp); +static boolean_t pmap_demote_l3e(pmap_t pmap, pml3_entry_t *pde, vm_offset_t va); +static int pmap_unuse_pt(pmap_t, vm_offset_t, pml3_entry_t, struct spglist *); +static int pmap_remove_l3e(pmap_t pmap, pml3_entry_t *pdq, vm_offset_t sva, + struct spglist *free, struct rwlock **lockp); +static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva, + pml3_entry_t ptepde, struct spglist *free, struct rwlock **lockp); +static vm_page_t pmap_remove_pt_page(pmap_t pmap, vm_offset_t va); +static bool pmap_remove_page(pmap_t pmap, vm_offset_t va, pml3_entry_t *pde, + struct spglist *free); +static bool pmap_remove_ptes(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, + pml3_entry_t *l3e, struct spglist *free, struct rwlock **lockp); + +static bool pmap_pv_insert_l3e(pmap_t pmap, vm_offset_t va, pml3_entry_t l3e, + u_int flags, struct rwlock **lockp); +#if VM_NRESERVLEVEL > 0 +static void pmap_pv_promote_l3e(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct rwlock **lockp); +#endif +static void pmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_offset_t va); +static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); +static vm_page_t mmu_radix_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, + vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp, bool *invalidate); + +static bool pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, + vm_prot_t prot, struct rwlock **lockp); +static int pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry_t newpde, + u_int flags, vm_page_t m, struct rwlock **lockp); + +static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp); +static void free_pv_chunk(struct pv_chunk *pc); +static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp); +static vm_page_t pmap_allocl3e(pmap_t pmap, vm_offset_t va, + struct rwlock **lockp); +static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, + struct rwlock **lockp); +static void _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, + struct spglist *free); +static boolean_t pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free); + +static void pmap_invalidate_page(pmap_t pmap, vm_offset_t start); +static void pmap_invalidate_all(pmap_t pmap); +static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode, bool flush); + +/* + * Internal flags for pmap_enter()'s helper functions. + */ +#define PMAP_ENTER_NORECLAIM 0x1000000 /* Don't reclaim PV entries. */ +#define PMAP_ENTER_NOREPLACE 0x2000000 /* Don't replace mappings. */ + +#define UNIMPLEMENTED() panic("%s not implemented", __func__) +#define UNTESTED() panic("%s not yet tested", __func__) + + + +/* Number of supported PID bits */ +static unsigned int isa3_pid_bits; + +/* PID to start allocating from */ +static unsigned int isa3_base_pid; + +#define PROCTAB_SIZE_SHIFT (isa3_pid_bits + 4) +#define PROCTAB_ENTRIES (1ul << isa3_pid_bits) + + +/* + * Map of physical memory regions. + */ +static struct mem_region *regions, *pregions; +static struct numa_mem_region *numa_pregions; +static u_int phys_avail_count; +static int regions_sz, pregions_sz, numa_pregions_sz; +static struct pate *isa3_parttab; +static struct prte *isa3_proctab; +static vmem_t *asid_arena; + +extern void bs_remap_earlyboot(void); + +#define RADIX_PGD_SIZE_SHIFT 16 +#define RADIX_PGD_SIZE (1UL << RADIX_PGD_SIZE_SHIFT) + +#define RADIX_PGD_INDEX_SHIFT (RADIX_PGD_SIZE_SHIFT-3) +#define NL2EPG (PAGE_SIZE/sizeof(pml2_entry_t)) +#define NL3EPG (PAGE_SIZE/sizeof(pml3_entry_t)) + +#define NUPML1E (RADIX_PGD_SIZE/sizeof(uint64_t)) /* number of userland PML1 pages */ +#define NUPDPE (NUPML1E * NL2EPG)/* number of userland PDP pages */ +#define NUPDE (NUPDPE * NL3EPG) /* number of userland PD entries */ + +/* POWER9 only permits a 64k partition table size. */ +#define PARTTAB_SIZE_SHIFT 16 +#define PARTTAB_SIZE (1UL << PARTTAB_SIZE_SHIFT) + +#define PARTTAB_HR (1UL << 63) /* host uses radix */ +#define PARTTAB_GR (1UL << 63) /* guest uses radix must match host */ + +/* TLB flush actions. Used as argument to tlbiel_all() */ +enum { + TLB_INVAL_SCOPE_LPID = 0, /* invalidate TLBs for current LPID */ + TLB_INVAL_SCOPE_GLOBAL = 1, /* invalidate all TLBs */ +}; + +#define NPV_LIST_LOCKS MAXCPU +static int pmap_initialized; +static vm_paddr_t proctab0pa; +static vm_paddr_t parttab_phys; +CTASSERT(sizeof(struct pv_chunk) == PAGE_SIZE); + +/* + * Data for the pv entry allocation mechanism. + * Updates to pv_invl_gen are protected by the pv_list_locks[] + * elements, but reads are not. + */ +static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks); +static struct mtx __exclusive_cache_line pv_chunks_mutex; +static struct rwlock __exclusive_cache_line pv_list_locks[NPV_LIST_LOCKS]; +static struct md_page *pv_table; +static struct md_page pv_dummy; + +#ifdef PV_STATS +#define PV_STAT(x) do { x ; } while (0) +#else +#define PV_STAT(x) do { } while (0) +#endif + +#define pa_radix_index(pa) ((pa) >> L3_PAGE_SIZE_SHIFT) +#define pa_to_pvh(pa) (&pv_table[pa_radix_index(pa)]) + +#define PHYS_TO_PV_LIST_LOCK(pa) \ + (&pv_list_locks[pa_radix_index(pa) % NPV_LIST_LOCKS]) + +#define CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa) do { \ + struct rwlock **_lockp = (lockp); \ + struct rwlock *_new_lock; \ + \ + _new_lock = PHYS_TO_PV_LIST_LOCK(pa); \ + if (_new_lock != *_lockp) { \ + if (*_lockp != NULL) \ + rw_wunlock(*_lockp); \ + *_lockp = _new_lock; \ + rw_wlock(*_lockp); \ + } \ +} while (0) + +#define CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m) \ + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, VM_PAGE_TO_PHYS(m)) + +#define RELEASE_PV_LIST_LOCK(lockp) do { \ + struct rwlock **_lockp = (lockp); \ + \ + if (*_lockp != NULL) { \ + rw_wunlock(*_lockp); \ + *_lockp = NULL; \ + } \ +} while (0) + +#define VM_PAGE_TO_PV_LIST_LOCK(m) \ + PHYS_TO_PV_LIST_LOCK(VM_PAGE_TO_PHYS(m)) + +/* + * We support 52 bits, hence: + * bits 52 - 31 = 21, 0b10101 + * RTS encoding details + * bits 0 - 3 of rts -> bits 6 - 8 unsigned long + * bits 4 - 5 of rts -> bits 62 - 63 of unsigned long + */ +#define RTS_SIZE ((0x2UL << 61) | (0x5UL << 5)) + + +static int powernv_enabled = 1; + +static inline void +tlbiel_radix_set_isa300(uint32_t set, uint32_t is, + uint32_t pid, uint32_t ric, uint32_t prs) +{ + uint64_t rb; + uint64_t rs; + + rb = PPC_BITLSHIFT_VAL(set, 51) | PPC_BITLSHIFT_VAL(is, 53); + rs = PPC_BITLSHIFT_VAL((uint64_t)pid, 31); + + __asm __volatile(PPC_TLBIEL(%0, %1, %2, %3, 1) + : : "r"(rb), "r"(rs), "i"(ric), "i"(prs) + : "memory"); +} + +static void +tlbiel_flush_isa3(uint32_t num_sets, uint32_t is) +{ + uint32_t set; + + __asm __volatile("ptesync": : :"memory"); + + /* + * Flush the first set of the TLB, and the entire Page Walk Cache + * and partition table entries. Then flush the remaining sets of the + * TLB. + */ + tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 0); + for (set = 1; set < num_sets; set++) + tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, 0); + + /* Do the same for process scoped entries. */ + tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 1); + for (set = 1; set < num_sets; set++) + tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, 1); + + __asm __volatile("ptesync": : :"memory"); +} + +static void +mmu_radix_tlbiel_flush(int scope) +{ + int is; + + MPASS(scope == TLB_INVAL_SCOPE_LPID || + scope == TLB_INVAL_SCOPE_GLOBAL); + is = scope + 2; + + tlbiel_flush_isa3(POWER9_TLB_SETS_RADIX, is); + __asm __volatile(PPC_INVALIDATE_ERAT "; isync" : : :"memory"); +} + +static void +mmu_radix_init_amor(void) +{ + /* + * In HV mode, we init AMOR (Authority Mask Override Register) so that + * the hypervisor and guest can setup IAMR (Instruction Authority Mask + * Register), enable key 0 and set it to 1. + * + * AMOR = 0b1100 .... 0000 (Mask for key 0 is 11) + */ + mtspr(SPR_AMOR, (3ul << 62)); +} + +static void +mmu_radix_init_iamr(void) +{ + /* + * Radix always uses key0 of the IAMR to determine if an access is + * allowed. We set bit 0 (IBM bit 1) of key0, to prevent instruction + * fetch. + */ + mtspr(SPR_IAMR, (1ul << 62)); +} + +static void +mmu_radix_pid_set(pmap_t pmap) +{ + + mtspr(SPR_PID, pmap->pm_pid); + isync(); +} + +/* Quick sort callout for comparing physical addresses. */ +static int +pa_cmp(const void *a, const void *b) +{ + const vm_paddr_t *pa = a, *pb = b; + + if (*pa < *pb) + return (-1); + else if (*pa > *pb) + return (1); + else + return (0); +} + +#define pte_load_store(ptep, pte) atomic_swap_long(ptep, pte) +#define pte_load_clear(ptep) atomic_swap_long(ptep, 0) +#define pte_store(ptep, pte) do { \ + MPASS((pte) & (RPTE_EAA_R | RPTE_EAA_W | RPTE_EAA_X)); \ + *(u_long *)(ptep) = (u_long)((pte) | PG_V | RPTE_LEAF); \ +} while (0) +/* + * NB: should only be used for adding directories - not for direct mappings + */ +#define pde_store(ptep, pa) do { \ + *(u_long *)(ptep) = (u_long)(pa|RPTE_VALID|RPTE_SHIFT); \ +} while (0) + +#define pte_clear(ptep) do { \ + *(u_long *)(ptep) = (u_long)(0); \ +} while (0) + +#define PMAP_PDE_SUPERPAGE (1 << 8) /* supports 2MB superpages */ + +/* + * Promotion to a 2MB (PDE) page mapping requires that the corresponding 4KB + * (PTE) page mappings have identical settings for the following fields: + */ +#define PG_PTE_PROMOTE (PG_X | PG_MANAGED | PG_W | PG_PTE_CACHE | \ + PG_M | PG_A | RPTE_EAA_MASK | PG_V) + + +static void +pmap_epoch_init(void *arg __unused) +{ + pmap_epoch = epoch_alloc("pmap", EPOCH_PREEMPT | EPOCH_LOCKED); +} +SYSINIT(epoch, SI_SUB_EPOCH + 1, SI_ORDER_ANY, pmap_epoch_init, NULL); + +static bool +pmap_not_in_di(void) +{ + + return (curthread->td_md.md_invl_gen.gen == 0); +} + +#define PMAP_ASSERT_NOT_IN_DI() \ + KASSERT(pmap_not_in_di(), ("DI already started")) + +static void +pmap_delayed_invl_started(epoch_tracker_t et) +{ + epoch_enter_preempt(pmap_epoch, et); + curthread->td_md.md_invl_gen.gen = 1; +} + +static void +pmap_delayed_invl_finished(epoch_tracker_t et) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon May 11 02:53:29 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8050A2D3A7D for ; Mon, 11 May 2020 02:53:29 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic312-25.consmr.mail.gq1.yahoo.com (sonic312-25.consmr.mail.gq1.yahoo.com [98.137.69.206]) (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 49L594158Kz3xkF for ; Mon, 11 May 2020 02:53:27 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: GEM_aYgVM1kUIyTf_LYoiFGb0Q7rW6OYpsUWyv59NjxsvA.W1mj_sUC6My4Hxor Xw.RK_oOsQKkGfhVtwZT4UPnAONfx8ljF1I4kwjNoPzDe46arN78Q1l35UlrMQbCP.eb7JcER3PV XGYU9jzY7uQrMYb0qOGYvsdv0BhaeTxXOXtgzG20NZWxeIer6reUAFA3G5Pr81RXpZ6h..jLIl9D 2teTg3EQWNMDGp8._cA6ki3jEfys5dIuB57PHbSmJPPSm_AVvWDAIK0ml2mMfRSK6oK.NJ62SWx. sOXmnsK4lNfvTU3bubG9eFWv3wXRW.OhzQvRNu7TUwrcfoKj6Kh6.hkFWUIvm6kN2bAucNSPtz6d on10mk5d9jWx4MY3oicMbQEZEAH4zpzI8ftYWQ5aEnWFNMeTtgGbW45rJiaXpZx.hCBHhCzNxDe0 HdvjJMBbHRHWfqKwKjgGHu97m3MXe_bnq5ef782Gw0P0aMd5RaWSNbNZ5DvA8x3R45O5yM1DlvTi 1_Fpk_GZu.GEi6rxyqB.l_udPOddLljo8MQ9PphkBPP4KLK1nhU4MkRaFOmgOvIGacMz.JpotjdZ mzFfE8QIqCeavOw45n5ZR7ov2C5xihkP20WM.7OD9HszMRVNN362zapGzuFQ0mjRN.7_P0Q_1EOZ x7KNVFniO0NCCT_iToBQ0TABf8fNydPesyVQvmct.b8pLEfrBN5_j97PJIl_thYu8z5Aq8.8ULAS fAUXsLvqv9TfdOrl8wPWYBeNCRB.GT76kR9ddhPaNwsw58V96u2NJCWcRBX8QjsH.lAZ96EFCVCK ImcJWpkADaUSaUqH7ekW.jA3gFEIdCnxKLA4mFN4RKnyg6VvYkBDZQJkSL_U1QprwWfotRFTFWbx e1KEDHUydze5Bugac3l8oOAz4v2XrzdbzxXxEzqcKVLVQvmdjcj9SkCJJ.pMU3w8K5F70Wi7tYlJ xjqAXP0lmwN2hzbwHlM7lY8CDEhZks04ipicvaeEOWar7xW8i9OJihIpimuFO6BRE.c4ldLTlyS_ _3phTkpX13rgAVVcSXIiVFyFM2dvDlCz1lw4O2HsN_2Xt5MLCO_3h2u7yEpxZoLMHQanWY3XdZEY Ytb0Q2PtislE8fnzD6c0W2O8pTGXvHk2iH6Vb431KrjDBTmt3agMXXsAuzib9Xt0Gapyx3QRPskM miyX23sHgbE3SNhPkqnC7aSu8D.2vAd271A19Zc17B7iwJCfGsuy6kFrlCluRNmkGFbvx4Aj8AOc tDmBHl.RsnrsIXl73CxyFhg.Z.g8avkyde6baMwXhDbH_FpeVbn_jw0pYVInPM_5WOikgsCMQtfU 6Fe15UM2xnBz2ZAqDWA7BgLmwTn2u1DCJ9qnBORAty.kJtWNvEprgAVA9DuyvnO0e6b81p8OrFro hy2HOI23hVggrLpumFJkhfrFKJdYbvhwm0vyWFxnfiE6B_TX1i4W5gSLTWzFh Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.gq1.yahoo.com with HTTP; Mon, 11 May 2020 02:53:26 +0000 Received: by smtp414.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 1e0514e9cf2507050b754f47e602e546; Mon, 11 May 2020 02:53:21 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r360233 - in head: contrib/jemalloc . . . : This partially breaks a 2-socket 32-bit powerpc (old PowerMac G4) based on head -r360311 From: Mark Millard In-Reply-To: Date: Sun, 10 May 2020 19:53:19 -0700 Cc: Brandon Bergren , Justin Hibbits Content-Transfer-Encoding: 7bit Message-Id: References: <8479DD58-44F6-446A-9CA5-D01F0F7C1B38@yahoo.com> <17ACDA02-D7EF-4F26-874A-BB3E935CD072@yahoo.com> <695E6836-F860-4557-B7DE-CC1EDB347F18@yahoo.com> <121B9B09-141B-4DC3-918B-1E7CFB99E779@yahoo.com> <8AAB0462-3FA8-490C-8D8D-7C15B1C9E2DE@yahoo.com> <18E62746-80DB-4195-977D-4FF32D0129EE@yahoo.com> To: "vangyzen@freebsd.org" , svn-src-head@freebsd.org, FreeBSD Current , FreeBSD Hackers , FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49L594158Kz3xkF X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.50 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (-3.69), ipnet: 98.137.64.0/21(0.83), asn: 36647(0.66), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[206.69.137.98.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[206.69.137.98.rep.mailspike.net : 127.0.0.17]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 02:53:29 -0000 [A new kind of experiment and partial results.] Given the zero'ed memory page(s) that for some of the example contexts include a page that should not be changing after initialization in my context (jemalloc global variables), I have attempted the following for such examples: A) Run gdb B) Attach to one of the live example processes. C) Check that the page is not zeroed yet. (print/x __je_sz_size2index_tab) D) protect the page containing the start of __je_sz_size2index_tab, using 0x1 as the PROT_READ mask. (print (int)mprotect(ADDRESS,1,0x1)) E) detach. The hope was to discover which of the following was involved: A) user-space code trying to write the page should get a SIGSEGV. In this case I'd likely be able to see what code was attempting the write. B) kernel-code doing something odd to the content or mapping of memory would not (or need not) lead to SIGSEGV. In this case I'd be unlikely to see what code lead to the zeros on the page. So far I've gotten only one failure example, nfsd during its handling of a SIGUSR1. Previous nfs mounts and dismounts worked fine, not asserting, indicating that at the time the page was not zeroed. I got no evidence of SIGSEGV from an attempted user space write to the page. But the nfsd.core shows the page as zeroed and the assert having caused abort(). That suggests the kernel side of things for what leads to the zeros. It turns out that just before the "unregsiteration()" activity is "killchildren()" activity: (gdb) list 971 972 static void 973 nfsd_exit(int status) 974 { 975 killchildren(); 976 unregistration(); 977 exit(status); 978 } (frame #12) used via: (gdb) list cleanup 954 /* 955 * Cleanup master after SIGUSR1. 956 */ 957 static void 958 cleanup(__unused int signo) 959 { 960 nfsd_exit(0); 961 } . . . and (for master): (void)signal(SIGUSR1, cleanup); This suggests the possibility that the zero'd pages could be associated with killing the child processes. (I've had a past aarch64 context where forking had problems with pages that were initially common to parent and child processes. In that context having the processes swap out [not just mostly paged out] and then swap back in was involved in showing the problem. The issue was fixed and was aarch64 specific. But it leaves me willing to consider fork-related memory management as possibly odd in some way for 32-bit powerpc.) Notes . . . Another possible kind of evidence: I've gone far longer with the machine doing just normal background processing with nothing failing on its own. This suggests that the (int)mprotect(ADDRESS,1,0x1) might be changing the context --or just doing the attach and detach in gdb does. I've nothing solid in this area so I'll ignore it, other than this note. === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Mon May 11 05:53:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E00E2D71FB; Mon, 11 May 2020 05:53:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49L98T3JSTz46Yg; Mon, 11 May 2020 05:53:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CA9A19D36; Mon, 11 May 2020 05:53:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04B5rDUf057601; Mon, 11 May 2020 05:53:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04B5rDq8057599; Mon, 11 May 2020 05:53:13 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005110553.04B5rDq8057599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 11 May 2020 05:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360888 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Commit-Revision: 360888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 05:53:13 -0000 Author: adrian Date: Mon May 11 05:53:12 2020 New Revision: 360888 URL: https://svnweb.freebsd.org/changeset/base/360888 Log: [ar9300] Disable unconditionally reducing transmit power in the case of FCC. Ok, yeah, the commit title is a bit misleading. This has to do with CDD (cyclic delay diversity) - how this and later wifi hardware transmits lower rates over more antennas. Eg, if you're transmitting legacy 11abg rates on 2 or 3 antennas, you COULD just send them all at the same time or you could delay each by tens/hundreds of nanoseconds to try and get some better diversity characteristics. However, this has a fun side effect - the antenna pattern is no longer a bunch of interacting dipoles, but are a bunch of interacting dipoles plus a bunch of changing phases. And it's frequency dependent - 50-200nS is not exactly the same fraction of a wavelength across all of 2GHz or 5GHz! Thus the power spectral density and maximum directional gain that you're effectively getting is not .. well, as flat as it once was. For more information, look up FCC/OET 13TR1003 in the FCC technical report database. It has pretty graphics and everything. Anyway, the problem lies thusly - the CDD code just subtracts another 3dB or 5dB for the lower rates based on transmit antenna configuration. However, it's not done based on operating configuration and it doesn't take into account how far from any regulatory limits the hardware is at. It also doesn't let us do things like transmit legacy rates and frames on a single antenna without losing up to 5dB when we absolutely don't need to in that case (there's no CDD used when one antenna is used!) This shows up as the hardware behaving even worse for longer distance links at 20MHz because, well, those are the exact rates losing a bunch more transmit power. * For lower power NICs (ie the majority of what is out there!) it's highly unlikely we're going to hit anywhere near the PSD limits. * It's doing it based on the existing limits from the CTL table (conformance testing limits) - this isn't the regulatory max! It's what the NIC is allowed to put out in each frequency and rate configuration! So things like band edges, power amplifier behaviour and maximum current draw apply here. Blindly subtracting 3 to 5dB from /this/ value is /very/ conservative.. * /and/ ath9k just plainly doesn't do any of this at all. So, for now disable it and get the TX power back, thus matching what ath9k in Linux is doing. If/once I get some more cycles I'll look at making it a bit more adaptive and really only kick in if we're a few dB away from hard regulatory limits. Tested: * AR9344 (2GHz + SoC, 2x2 configuration) - AP and STA modes * QCA9580 (5GHz 2x2 and 3x3 configurations) - AP and STA modes Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Mon May 11 02:33:37 2020 (r360887) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Mon May 11 05:53:12 2020 (r360888) @@ -3040,6 +3040,33 @@ ar9300_eeprom_set_transmit_power(struct ath_hal *ah, ahp->reg_dmn = ath_hal_getctl(ah, chan); /* + * After reading FCC/OET 13TR1003 (Directional Gain of IEEE 802.11 + * MIMO devices employing cyclic delay diversity) and looking at what + * ath9k does, let's disable the CDD check until it's clearer exactly + * how the maximum cap should be applied here. + * + * Right now the CDD check is simply unconditionally reducing the + * gain of legacy and 1/2 stream rates depending upon the chainmask. + * (CDD is used when transmitting rates that don't already use up the + * full set of streams - eg OFDM or MCS0-7 on a 2 or 3 chain TX path.) + * + * It's dropping the 2-chain TX by 3dB and 3-chain by 5dB to "meet" + * power spectral density requirements but it's not currently taking + * into account how close to the regulatory limit the hardware/antenna + * system is already at. It doesn't help that the conductive testing + * limits have the array gain at 0dB for all AR9300/derivative + * configurations. + * + * It also doesn't let us do single chain transmit at the full allowed + * power for the regulatory/CTL limits as it subtracts it from what's + * programmed into the hardware. + * + * ath9k doesn't factor any of the CDD stuff into account, so I'm going + * to disable it here and in the TPC path until I get a better idea + * of what to really do here. + */ +#if 0 + /* * Always use CDD/direct per rate power table for register based approach. * For FCC, CDD calculations should factor in the array gain, hence * this adjust call. ETSI and MKK does not have this requirement. @@ -3050,6 +3077,7 @@ ar9300_eeprom_set_transmit_power(struct ath_hal *ah, __func__); ar9300_adjust_reg_txpower_cdd(ah, target_power_val_t2); } +#endif if (ar9300_eeprom_get(ahp, EEP_PAPRD_ENABLED)) { for (i = 0; i < ar9300_rate_size; i++) { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c Mon May 11 02:33:37 2020 (r360887) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c Mon May 11 05:53:12 2020 (r360888) @@ -55,10 +55,12 @@ static inline void ar9300_init_rate_txpower_stbc(struc const HAL_RATE_TABLE *rt, HAL_BOOL is40, int rt_ss_offset, int rt_ds_offset, int rt_ts_offset, u_int8_t chainmask); +#if 0 static inline void ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, const HAL_RATE_TABLE *rt, HAL_BOOL is40, int rt_ss_offset, int rt_ds_offset, int rt_ts_offset, u_int8_t chainmask); +#endif #define AR9300_11A_RT_OFDM_OFFSET 0 HAL_RATE_TABLE ar9300_11a_table = { @@ -442,6 +444,8 @@ ar9300_adjust_reg_txpower_cdd(struct ath_hal *ah, ((int16_t)AH_MIN((ahp->twice_antenna_reduction - (ahp->twice_antenna_gain + AR9300_TXBF_2TX_ARRAY_GAIN)), 0)); cdd_power = ahp->upper_limit[1] + twice_array_gain; + + HALDEBUG(ah, HAL_DEBUG_CALIBRATE, "%s: 2 chain; cdd_power=%d", __func__, cdd_power); /* Adjust OFDM legacy rates as well */ for (i = ALL_TARGET_LEGACY_6_24; i <= ALL_TARGET_LEGACY_54; i++) { if (power_per_rate[i] > cdd_power) { @@ -471,6 +475,7 @@ ar9300_adjust_reg_txpower_cdd(struct ath_hal *ah, ((int16_t)AH_MIN((ahp->twice_antenna_reduction - (ahp->twice_antenna_gain + AR9300_TXBF_3TX_ARRAY_GAIN)), 0)); cdd_power = ahp->upper_limit[2] + twice_array_gain; + HALDEBUG(ah, HAL_DEBUG_CALIBRATE, "%s: 3 chain; cdd_power=%d", __func__, cdd_power); /* Adjust OFDM legacy rates as well */ for (i = ALL_TARGET_LEGACY_6_24; i <= ALL_TARGET_LEGACY_54; i++) { if (power_per_rate[i] > cdd_power) { @@ -531,6 +536,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NA_RT_HT_SS_OFFSET, AR9300_11NA_RT_HT_DS_OFFSET, AR9300_11NA_RT_HT_TS_OFFSET, chainmask); +#if 0 /* For FCC the array gain has to be factored for CDD mode */ if (is_reg_dmn_fcc(ath_hal_getctl(ah, chan))) { ar9300_adjust_rate_txpower_cdd(ah, rt, is40, @@ -538,6 +544,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NA_RT_HT_DS_OFFSET, AR9300_11NA_RT_HT_TS_OFFSET, chainmask); } +#endif break; case HAL_MODE_11G: ar9300_init_rate_txpower_cck(ah, rt, power_per_rate, chainmask); @@ -561,6 +568,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NG_RT_HT_SS_OFFSET, AR9300_11NG_RT_HT_DS_OFFSET, AR9300_11NG_RT_HT_TS_OFFSET, chainmask); +#if 0 /* For FCC the array gain needs to be factored for CDD mode */ if (is_reg_dmn_fcc(ath_hal_getctl(ah, chan))) { ar9300_adjust_rate_txpower_cdd(ah, rt, is40, @@ -568,6 +576,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NG_RT_HT_DS_OFFSET, AR9300_11NG_RT_HT_TS_OFFSET, chainmask); } +#endif break; default: HALDEBUG(ah, HAL_DEBUG_POWER_MGMT, "%s: invalid mode 0x%x\n", @@ -941,6 +950,10 @@ ar9300_init_rate_txpower_stbc(struct ath_hal *ah, cons return; } +/* + * To see why this is disabled, look at ar9300_eeprom.c for FCC/OET 13TR1003. + */ +#if 0 static inline void ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, const HAL_RATE_TABLE *rt, HAL_BOOL is40, @@ -1037,6 +1050,7 @@ ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, con return; } +#endif void ar9300_disp_tpc_tables(struct ath_hal *ah) { From owner-svn-src-head@freebsd.org Mon May 11 06:09:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6176B2D7648; Mon, 11 May 2020 06:09:19 +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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49L9W31z4cz47F8; Mon, 11 May 2020 06:09:19 +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 3EEF219F1F; Mon, 11 May 2020 06:09:19 +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 04B69JKj064143; Mon, 11 May 2020 06:09:19 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04B69IQ5064141; Mon, 11 May 2020 06:09:18 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005110609.04B69IQ5064141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 11 May 2020 06:09:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360889 - in head/sys/net: . route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys/net: . route X-SVN-Commit-Revision: 360889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 06:09:19 -0000 Author: melifaro Date: Mon May 11 06:09:18 2020 New Revision: 360889 URL: https://svnweb.freebsd.org/changeset/base/360889 Log: Remove unused rnh_close callback from rtable & cleanup depends. rnh_close callbackes was used by the in[6]_clsroute() handlers, doing cleanup in the route cloning code. Route cloning was eliminated somewhere around r186119. Last callback user was eliminated in r186215, 11 years ago. Differential Revision: https://reviews.freebsd.org/D24793 Modified: head/sys/net/route.c head/sys/net/route/route_var.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon May 11 05:53:12 2020 (r360888) +++ head/sys/net/route.c Mon May 11 06:09:18 2020 (r360889) @@ -426,11 +426,8 @@ sys_setfib(struct thread *td, struct setfib_args *uap) void rtfree(struct rtentry *rt) { - struct rib_head *rnh; KASSERT(rt != NULL,("%s: NULL rt", __func__)); - rnh = rt_tables_get_rnh(rt->rt_fibnum, rt_key(rt)->sa_family); - KASSERT(rnh != NULL,("%s: NULL rnh", __func__)); RT_LOCK_ASSERT(rt); @@ -445,18 +442,6 @@ rtfree(struct rtentry *rt) } /* - * On last reference give the "close method" a chance - * to cleanup private state. This also permits (for - * IPv4 and IPv6) a chance to decide if the routing table - * entry should be purged immediately or at a later time. - * When an immediate purge is to happen the close routine - * typically calls rtexpunge which clears the RTF_UP flag - * on the entry so that the code below reclaims the storage. - */ - if (rt->rt_refcnt == 0 && rnh->rnh_close) - rnh->rnh_close((struct radix_node *)rt, &rnh->head); - - /* * If we are no longer "up" (and ref == 0) * then we can free the resources associated * with the route. @@ -1501,7 +1486,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in return (ENOBUFS); } rt->rt_flags = RTF_UP | flags; - rt->rt_fibnum = rnh->rib_fibnum; rt->rt_nhop = nh; /* Fill in dst */ Modified: head/sys/net/route/route_var.h ============================================================================== --- head/sys/net/route/route_var.h Mon May 11 05:53:12 2020 (r360888) +++ head/sys/net/route/route_var.h Mon May 11 06:09:18 2020 (r360889) @@ -50,7 +50,6 @@ struct rib_head { rn_lookup_f_t *rnh_lookup; /* exact match for sockaddr */ rn_walktree_t *rnh_walktree; /* traverse tree */ rn_walktree_from_t *rnh_walktree_from; /* traverse tree below a */ - rn_close_t *rnh_close; /*do something when the last ref drops*/ rnh_preadd_entry_f_t *rnh_preadd; /* hook to alter record prior to insertion */ rt_gen_t rnh_gen; /* generation counter */ int rnh_multipath; /* multipath capable ? */ @@ -144,7 +143,6 @@ struct rtentry { int rt_flags; /* up/down?, host/net */ int rt_refcnt; /* # held references */ - u_int rt_fibnum; /* which FIB */ u_long rt_weight; /* absolute weight */ u_long rt_expire; /* lifetime for route, e.g. redirect */ #define rt_endzero rt_mtx From owner-svn-src-head@freebsd.org Mon May 11 08:40:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75D4D2DB2CE; Mon, 11 May 2020 08:40:34 +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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LDsZ2Z6nz4GRl; Mon, 11 May 2020 08:40:34 +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 538191BB77; Mon, 11 May 2020 08:40:34 +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 04B8eYv3057167; Mon, 11 May 2020 08:40:34 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04B8eXHF057165; Mon, 11 May 2020 08:40:33 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202005110840.04B8eXHF057165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 11 May 2020 08:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360894 - in head/stand/i386: boot2 pxeldr zfsboot X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head/stand/i386: boot2 pxeldr zfsboot X-SVN-Commit-Revision: 360894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 08:40:34 -0000 Author: arichardson Date: Mon May 11 08:40:33 2020 New Revision: 360894 URL: https://svnweb.freebsd.org/changeset/base/360894 Log: Avoid using non-portable dd conv=osync option The same thing can be achieved using the bs=$SIZE and conv=sync options. Unlike conv=osync, conv=sync is support on both Linux and macOS. Reviewed By: imp, jhb (earlier version) Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D24788 Modified: head/stand/i386/boot2/Makefile head/stand/i386/pxeldr/Makefile head/stand/i386/zfsboot/Makefile Modified: head/stand/i386/boot2/Makefile ============================================================================== --- head/stand/i386/boot2/Makefile Mon May 11 07:21:59 2020 (r360893) +++ head/stand/i386/boot2/Makefile Mon May 11 08:40:33 2020 (r360894) @@ -66,7 +66,7 @@ BOOT2SIZE= 7680 boot2: boot2.ld @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync + ${DD} if=${.ALLSRC} of=${.TARGET} bs=${BOOT2SIZE} conv=sync boot2.ld: boot2.ldr boot2.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ Modified: head/stand/i386/pxeldr/Makefile ============================================================================== --- head/stand/i386/pxeldr/Makefile Mon May 11 07:21:59 2020 (r360893) +++ head/stand/i386/pxeldr/Makefile Mon May 11 08:40:33 2020 (r360894) @@ -31,7 +31,7 @@ CLEANFILES+= ${BOOT}.tmp ${BOOT}: ${LDR} ${LOADER} cat ${LDR} ${LOADER} > ${.TARGET}.tmp - ${DD} if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync + ${DD} if=${.TARGET}.tmp of=${.TARGET} bs=2048 conv=sync rm ${.TARGET}.tmp LDFLAGS+=${LDFLAGS_BIN} Modified: head/stand/i386/zfsboot/Makefile ============================================================================== --- head/stand/i386/zfsboot/Makefile Mon May 11 07:21:59 2020 (r360893) +++ head/stand/i386/zfsboot/Makefile Mon May 11 08:40:33 2020 (r360894) @@ -62,7 +62,7 @@ BOOT2SIZE= 262144 zfsboot2: zfsboot.ld @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync + ${DD} if=${.ALLSRC} of=${.TARGET} bs=${BOOT2SIZE} conv=sync zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l zfsboot.ldr \ From owner-svn-src-head@freebsd.org Mon May 11 15:32:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F6C82E4308; Mon, 11 May 2020 15:32:34 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LQ0y3hFgz3Cwg; Mon, 11 May 2020 15:32:34 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F56920A50; Mon, 11 May 2020 15:32:34 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BFWYMD021332; Mon, 11 May 2020 15:32:34 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BFWXlb021326; Mon, 11 May 2020 15:32:33 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <202005111532.04BFWXlb021326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Mon, 11 May 2020 15:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360899 - head/usr.sbin/bluetooth/hccontrol X-SVN-Group: head X-SVN-Commit-Author: takawata X-SVN-Commit-Paths: head/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 360899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 15:32:34 -0000 Author: takawata Date: Mon May 11 15:32:32 2020 New Revision: 360899 URL: https://svnweb.freebsd.org/changeset/base/360899 Log: Add le_scan subcommand to hccontrol. PR: 246141 Submitted by: Marc Veldman Added: head/usr.sbin/bluetooth/hccontrol/adv_data.c (contents, props changed) Modified: head/usr.sbin/bluetooth/hccontrol/Makefile head/usr.sbin/bluetooth/hccontrol/hccontrol.8 head/usr.sbin/bluetooth/hccontrol/hccontrol.h head/usr.sbin/bluetooth/hccontrol/le.c head/usr.sbin/bluetooth/hccontrol/node.c head/usr.sbin/bluetooth/hccontrol/util.c Modified: head/usr.sbin/bluetooth/hccontrol/Makefile ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/Makefile Mon May 11 15:21:03 2020 (r360898) +++ head/usr.sbin/bluetooth/hccontrol/Makefile Mon May 11 15:32:32 2020 (r360899) @@ -8,7 +8,7 @@ PROG= hccontrol MAN= hccontrol.8 SRCS= send_recv.c link_policy.c link_control.c le.c\ host_controller_baseband.c info.c status.c node.c hccontrol.c \ - util.c + util.c adv_data.c WARNS?= 2 LIBADD= bluetooth Added: head/usr.sbin/bluetooth/hccontrol/adv_data.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bluetooth/hccontrol/adv_data.c Mon May 11 15:32:32 2020 (r360899) @@ -0,0 +1,249 @@ +/*- + * adv_data.c + * + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + + * Copyright (c) 2020 Marc Veldman + * 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. + * + * $Id$ + * $FreeBSD$ + */ + +#include +#include +#include +#include +#define L2CAP_SOCKET_CHECKED +#include +#include "hccontrol.h" + +static char* const adv_data2str(int len, uint8_t* data, char* buffer, + int size); +static char* const adv_name2str(int len, uint8_t* advdata, char* buffer, + int size); +static char* const adv_uuid2str(int datalen, uint8_t* data, char* buffer, + int size); + +void dump_adv_data(int len, uint8_t* advdata) +{ + int n=0; + fprintf(stdout, "\tADV Data: "); + for (n = 0; n < len+1; n++) { + fprintf(stdout, "%02x ", advdata[n]); + } + fprintf(stdout, "\n"); +} + +void print_adv_data(int len, uint8_t* advdata) +{ + int n=0; + while(n < len) + { + char buffer[2048]; + uint8_t datalen = advdata[n]; + uint8_t datatype = advdata[++n]; + /* Skip type */ + ++n; + datalen--; + switch (datatype) { + case 0x01: + fprintf(stdout, + "\tFlags: %s\n", + adv_data2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x02: + fprintf(stdout, + "\tIncomplete list of service" + " class UUIDs (16-bit): %s\n", + adv_data2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x03: + fprintf(stdout, + "\tComplete list of service " + "class UUIDs (16-bit): %s\n", + adv_data2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x07: + fprintf(stdout, + "\tComplete list of service " + "class UUIDs (128 bit): %s\n", + adv_uuid2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x08: + fprintf(stdout, + "\tShortened local name: %s\n", + adv_name2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x09: + fprintf(stdout, + "\tComplete local name: %s\n", + adv_name2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x0a: + fprintf(stdout, + "\tTx Power level: %d dBm\n", + (int8_t)advdata[n]); + break; + case 0x0d: + fprintf(stdout, + "\tClass of device: %s\n", + adv_data2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x16: + fprintf(stdout, + "\tService data: %s\n", + adv_data2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x19: + fprintf(stdout, + "\tAppearance: %s\n", + adv_data2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0xff: + fprintf(stdout, + "\tManufacturer: %s\n", + hci_manufacturer2str( + advdata[n]|advdata[n+1]<<8)); + fprintf(stdout, + "\tManufacturer specific data: %s\n", + adv_data2str( + datalen-2, + &advdata[n+2], + buffer, + sizeof(buffer))); + break; + default: + fprintf(stdout, + "\tUNKNOWN datatype: %02x data %s\n", + datatype, + adv_data2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + } + n += datalen; + } +} + +static char* const adv_data2str(int datalen, uint8_t* data, char* buffer, + int size) +{ + int i = 0; + char tmpbuf[5]; + + if (buffer == NULL) + return NULL; + + memset(buffer, 0, size); + + while(i < datalen) { + (void)snprintf(tmpbuf, sizeof(tmpbuf), "%02x ", data[i]); + /* Check if buffer is full */ + if (strlcat(buffer, tmpbuf, size) > size) + break; + i++; + } + return buffer; +} + +static char* const adv_name2str(int datalen, uint8_t* data, char* buffer, + int size) +{ + if (buffer == NULL) + return NULL; + + memset(buffer, 0, size); + + (void)strlcpy(buffer, (char*)data, datalen+1); + return buffer; +} + +static char* const adv_uuid2str(int datalen, uint8_t* data, char* buffer, + int size) +{ + int i; + uuid_t uuid; + uint32_t ustatus; + char* tmpstr; + + if (buffer == NULL) + return NULL; + + memset(buffer, 0, size); + if (datalen < 16) + return buffer; + uuid.time_low = le32dec(data+12); + uuid.time_mid = le16dec(data+10); + uuid.time_hi_and_version = le16dec(data+8); + uuid.clock_seq_hi_and_reserved = data[7]; + uuid.clock_seq_low = data[6]; + for(i = 0; i < _UUID_NODE_LEN; i++){ + uuid.node[i] = data[5 - i]; + } + uuid_to_string(&uuid, &tmpstr, &ustatus); + if(ustatus == uuid_s_ok) { + strlcpy(buffer, tmpstr, size); + } + free(tmpstr); + + return buffer; +} Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.8 ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 11 15:21:03 2020 (r360898) +++ head/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 11 15:32:32 2020 (r360899) @@ -25,7 +25,7 @@ .\" $Id: hccontrol.8,v 1.6 2003/08/06 21:26:38 max Exp $ .\" $FreeBSD$ .\" -.Dd April 27, 2020 +.Dd May 3, 2020 .Dt HCCONTROL 8 .Os .Sh NAME @@ -156,6 +156,7 @@ are: .It Cm LE_Set_Scan_Enable .It Cm LE_Read_Supported_States .It Cm LE_Read_Buffer_Size +.It Cm LE Scan .El .Pp The currently supported node commands in Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.h ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 11 15:21:03 2020 (r360898) +++ head/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 11 15:32:32 2020 (r360899) @@ -79,6 +79,10 @@ char const * hci_cc2str (int); char const * hci_con_state2str (int); char const * hci_status2str (int); char const * hci_bdaddr2str (bdaddr_t const *); +char const * hci_addrtype2str (int type); + +void dump_adv_data(int len, uint8_t* advdata); +void print_adv_data(int len, uint8_t* advdata); #endif /* _HCCONTROL_H_ */ Modified: head/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/le.c Mon May 11 15:21:03 2020 (r360898) +++ head/usr.sbin/bluetooth/hccontrol/le.c Mon May 11 15:32:32 2020 (r360899) @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +61,8 @@ static int le_enable(int s, int argc, char *argv[]); static int le_set_advertising_enable(int s, int argc, char *argv[]); static int le_set_advertising_param(int s, int argc, char *argv[]); static int le_read_advertising_channel_tx_power(int s, int argc, char *argv[]); +static int le_scan(int s, int argc, char *argv[]); +static void handle_le_event(ng_hci_event_pkt_t* e, bool verbose); static int le_set_scan_param(int s, int argc, char *argv[]) @@ -613,6 +616,152 @@ le_read_buffer_size(int s, int argc, char *argv[]) return (OK); } +static int +le_scan(int s, int argc, char *argv[]) +{ + int n, bufsize, scancount, numscans; + bool verbose; + uint8_t active = 0; + char ch; + + char b[512]; + ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b; + + ng_hci_le_set_scan_parameters_cp scan_param_cp; + ng_hci_le_set_scan_parameters_rp scan_param_rp; + + ng_hci_le_set_scan_enable_cp scan_enable_cp; + ng_hci_le_set_scan_enable_rp scan_enable_rp; + + optreset = 1; + optind = 0; + verbose = false; + numscans = 1; + + while ((ch = getopt(argc, argv , "an:v")) != -1) { + switch(ch) { + case 'a': + active = 1; + break; + case 'n': + numscans = (uint8_t)strtol(optarg, NULL, 10); + break; + case 'v': + verbose = true; + break; + } + } + + scan_param_cp.le_scan_type = active; + scan_param_cp.le_scan_interval = (uint16_t)(100/0.625); + scan_param_cp.le_scan_window = (uint16_t)(50/0.625); + /* Address type public */ + scan_param_cp.own_address_type = 0; + /* 'All' filter policy */ + scan_param_cp.scanning_filter_policy = 0; + n = sizeof(scan_param_rp); + + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_SCAN_PARAMETERS), + (void *)&scan_param_cp, sizeof(scan_param_cp), + (void *)&scan_param_rp, &n) == ERROR) + return (ERROR); + + if (scan_param_rp.status != 0x00) { + fprintf(stdout, "LE_Set_Scan_Parameters failed. Status: %s [%#02x]\n", + hci_status2str(scan_param_rp.status), + scan_param_rp.status); + return (FAILED); + } + + /* Enable scanning */ + n = sizeof(scan_enable_rp); + scan_enable_cp.le_scan_enable = 1; + scan_enable_cp.filter_duplicates = 1; + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_SCAN_ENABLE), + (void *)&scan_enable_cp, sizeof(scan_enable_cp), + (void *)&scan_enable_rp, &n) == ERROR) + return (ERROR); + + if (scan_enable_rp.status != 0x00) { + fprintf(stdout, "LE_Scan_Enable enable failed. Status: %s [%#02x]\n", + hci_status2str(scan_enable_rp.status), + scan_enable_rp.status); + return (FAILED); + } + + scancount = 0; + while (scancount < numscans) { + /* wait for scan events */ + bufsize = sizeof(b); + if (hci_recv(s, b, &bufsize) == ERROR) { + return (ERROR); + } + + if (bufsize < sizeof(*e)) { + errno = EIO; + return (ERROR); + } + scancount++; + if (e->event == NG_HCI_EVENT_LE) { + fprintf(stdout, "Scan %d\n", scancount); + handle_le_event(e, verbose); + } + } + + fprintf(stdout, "Scan complete\n"); + + /* Disable scanning */ + n = sizeof(scan_enable_rp); + scan_enable_cp.le_scan_enable = 0; + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_SCAN_ENABLE), + (void *)&scan_enable_cp, sizeof(scan_enable_cp), + (void *)&scan_enable_rp, &n) == ERROR) + return (ERROR); + + if (scan_enable_rp.status != 0x00) { + fprintf(stdout, "LE_Scan_Enable disable failed. Status: %s [%#02x]\n", + hci_status2str(scan_enable_rp.status), + scan_enable_rp.status); + return (FAILED); + } + + return (OK); +} + +static void handle_le_event(ng_hci_event_pkt_t* e, bool verbose) +{ + int rc; + ng_hci_le_ep *leer = + (ng_hci_le_ep *)(e + 1); + ng_hci_le_advertising_report_ep *advrep = + (ng_hci_le_advertising_report_ep *)(leer + 1); + ng_hci_le_advreport *reports = + (ng_hci_le_advreport *)(advrep + 1); + + if (leer->subevent_code == NG_HCI_LEEV_ADVREP) { + fprintf(stdout, "Scan result, num_reports: %d\n", + advrep->num_reports); + for(rc = 0; rc < advrep->num_reports; rc++) { + uint8_t length = (uint8_t)reports[rc].length_data; + fprintf(stdout, "\tBD_ADDR %s \n", + hci_bdaddr2str(&reports[rc].bdaddr)); + fprintf(stdout, "\tAddress type: %s\n", + hci_addrtype2str(reports[rc].addr_type)); + if (length > 0 && verbose) { + dump_adv_data(length, reports[rc].data); + print_adv_data(length, reports[rc].data); + fprintf(stdout, + "\tRSSI: %d dBm\n", + (int8_t)reports[rc].data[length]); + fprintf(stdout, "\n"); + } + } + } +} + struct hci_command le_commands[] = { { "le_enable", @@ -684,5 +833,11 @@ struct hci_command le_commands[] = { "le_read_buffer_size [-v 1|2]\n" "Read the maximum size of ACL and ISO data packets", &le_read_buffer_size + }, + { + "le_scan", + "le_scan [-a] [-v] [-n number_of_scans]\n" + "Do an LE scan", + &le_scan }, }; Modified: head/usr.sbin/bluetooth/hccontrol/node.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/node.c Mon May 11 15:21:03 2020 (r360898) +++ head/usr.sbin/bluetooth/hccontrol/node.c Mon May 11 15:32:32 2020 (r360899) @@ -211,83 +211,6 @@ hci_flush_neighbor_cache(int s, int argc, char **argv) return (OK); } /* hci_flush_neighbor_cache */ -#define MIN(a,b) (((a)>(b)) ? (b) :(a) ) - -static int hci_dump_adv(uint8_t *data, int length) -{ - int elemlen; - int type; - int i; - - while(length>0){ - elemlen = *data; - data++; - length --; - if(length<=0) - break; - type = *data; - data++; - length --; - elemlen--; - if(length <= 0) - break; - switch(type){ - case 0x1: - printf("NDflag:%x\n", *data); - break; - case 0x8: - case 0x9: - printf("LocalName:"); - for(i = 0; i < MIN(length,elemlen); i++){ - putchar(data[i]); - } - printf("\n"); - break; - case 0x6: - case 0x7: - { - uuid_t uuid; - char *uuidstr; - uint32_t ustatus; - if (elemlen < 16) - break; - uuid.time_low = le32dec(data+12); - uuid.time_mid = le16dec(data+10); - uuid.time_hi_and_version = le16dec(data+8); - uuid.clock_seq_hi_and_reserved = data[7]; - uuid.clock_seq_low = data[6]; - for(i = 0; i < _UUID_NODE_LEN; i++){ - uuid.node[i] = data[5 - i]; - } - uuid_to_string(&uuid, &uuidstr, &ustatus); - - printf("ServiceUUID: %s\n", uuidstr); - break; - } - case 0xff: - if (elemlen < 2) - break; - printf("Vendor:%s:", - hci_manufacturer2str(data[0]|data[1]<<8)); - for (i = 2; i < MIN(length,elemlen); i++) { - printf("%02x ",data[i]); - } - printf("\n"); - break; - default: - printf("Type%d:", type); - for(i=0; i < MIN(length,elemlen); i++){ - printf("%02x ",data[i]); - } - printf("\n"); - break; - } - data += elemlen; - length -= elemlen; - } - return 0; -} -#undef MIN /* Send Read_Neighbor_Cache command to the node */ static int hci_read_neighbor_cache(int s, int argc, char **argv) @@ -337,8 +260,8 @@ hci_read_neighbor_cache(int s, int argc, char **argv) r.entries[n].features[6], r.entries[n].features[7], r.entries[n].clock_offset, r.entries[n].page_scan_mode, r.entries[n].page_scan_rep_mode); - hci_dump_adv(r.entries[n].extinq_data, - r.entries[n].extinq_size); + print_adv_data(r.entries[n].extinq_size, + r.entries[n].extinq_data); fprintf(stdout,"\n"); } out: Modified: head/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/util.c Mon May 11 15:21:03 2020 (r360898) +++ head/usr.sbin/bluetooth/hccontrol/util.c Mon May 11 15:32:32 2020 (r360899) @@ -3281,3 +3281,17 @@ hci_bdaddr2str(bdaddr_t const *ba) return (buffer); } /* hci_bdaddr2str */ + +char const * +hci_addrtype2str(int type) +{ + static char const * const t[] = { + /* 0x00 */ "Public Device Address", + /* 0x01 */ "Random Device Address", + /* 0x02 */ "Public Identity Address", + /* 0x03 */ "Random (static) Identity Address" + }; + + return (type >= SIZE(t)? "?" : t[type]); +} /* hci_addrtype2str */ + From owner-svn-src-head@freebsd.org Mon May 11 15:38:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C311C2E43F9; Mon, 11 May 2020 15:38:44 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LQ844pnsz3DD7; Mon, 11 May 2020 15:38:44 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B7AE20A5A; Mon, 11 May 2020 15:38:44 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BFci49021825; Mon, 11 May 2020 15:38:44 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BFci1g021824; Mon, 11 May 2020 15:38:44 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005111538.04BFci1g021824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Mon, 11 May 2020 15:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360900 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 360900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 15:38:44 -0000 Author: freqlabs Date: Mon May 11 15:38:44 2020 New Revision: 360900 URL: https://svnweb.freebsd.org/changeset/base/360900 Log: vfs_exports: Tighten bounds and assert consistency of numsecflavors We know the value must be greater than 0 and less than MAXSECFLAVORS. Reject values outside this range in the initial check in vfs_export and add KASSERTs in the later consumers. Also check that we are called with one of either MNT_DELEXPORT or MNT_EXPORTED set. Reviewed by: rmacklem Approved by: mav (mentor) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24753 Modified: head/sys/kern/vfs_export.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Mon May 11 15:32:32 2020 (r360899) +++ head/sys/kern/vfs_export.c Mon May 11 15:38:44 2020 (r360900) @@ -112,6 +112,11 @@ vfs_hang_addrlist(struct mount *mp, struct netexport * #endif int error; + KASSERT(argp->ex_numsecflavors > 0, + ("%s: numsecflavors <= 0", __func__)); + KASSERT(argp->ex_numsecflavors < MAXSECFLAVORS, + ("%s: numsecflavors >= MAXSECFLAVORS", __func__)); + /* * XXX: This routine converts from a `struct xucred' * (argp->ex_anon) to a `struct ucred' (np->netc_anon). This @@ -300,10 +305,14 @@ vfs_export(struct mount *mp, struct export_args *argp) struct netexport *nep; int error; - if (argp->ex_numsecflavors < 0 - || argp->ex_numsecflavors >= MAXSECFLAVORS) + if ((argp->ex_flags & (MNT_DELEXPORT | MNT_EXPORTED)) == 0) return (EINVAL); + if ((argp->ex_flags & MNT_EXPORTED) != 0 && + (argp->ex_numsecflavors <= 0 + || argp->ex_numsecflavors >= MAXSECFLAVORS)) + return (EINVAL); + error = 0; lockmgr(&mp->mnt_explock, LK_EXCLUSIVE, NULL); nep = mp->mnt_export; @@ -518,8 +527,13 @@ vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam *extflagsp = np->netc_exflags; if ((*credanonp = np->netc_anon) != NULL) crhold(*credanonp); - if (numsecflavors) + if (numsecflavors) { *numsecflavors = np->netc_numsecflavors; + KASSERT(*numsecflavors > 0, + ("%s: numsecflavors <= 0", __func__)); + KASSERT(*numsecflavors < MAXSECFLAVORS, + ("%s: numsecflavors >= MAXSECFLAVORS", __func__)); + } if (secflavors) *secflavors = np->netc_secflavors; lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); From owner-svn-src-head@freebsd.org Mon May 11 17:42:06 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06A052E66D7; Mon, 11 May 2020 17:42:06 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LStP6TR4z3Kwb; Mon, 11 May 2020 17:42:05 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D99F6222AF; Mon, 11 May 2020 17:42:05 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BHg5WN001119; Mon, 11 May 2020 17:42:05 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BHg40G001112; Mon, 11 May 2020 17:42:04 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202005111742.04BHg40G001112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 11 May 2020 17:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360902 - in head/sys/dev: e1000 ixgbe ixl X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in head/sys/dev: e1000 ixgbe ixl X-SVN-Commit-Revision: 360902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 17:42:06 -0000 Author: erj Date: Mon May 11 17:42:04 2020 New Revision: 360902 URL: https://svnweb.freebsd.org/changeset/base/360902 Log: em/ix/ixv/ixl/iavf: Implement ifdi_needs_restart iflib method Pursuant to r360398, implement driver-specific versions of the ifdi_needs_restart iflib device method. Some (if not most?) Intel network cards don't need reinitializing when a VLAN is added or removed from the device hardware, so these implement ifdi_needs_restart in a way that tell iflib not to bring the interface up or down when a VLAN is added or removed, regardless of whether the VLAN_HWFILTER interface capability flag is set or not. This could potentially solve several PRs relating to link flaps that occur when VLANs are added/removed to devices. Signed-off-by: Eric Joyner PR: 240818, 241785 Reviewed by: gallatin@, olivier@ MFC after: 3 days MFC with: r360398 Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D24659 Modified: head/sys/dev/e1000/if_em.c head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixl/if_iavf.c head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon May 11 16:14:20 2020 (r360901) +++ head/sys/dev/e1000/if_em.c Mon May 11 17:42:04 2020 (r360902) @@ -251,6 +251,7 @@ static void em_if_timer(if_ctx_t ctx, uint16_t qid); static void em_if_vlan_register(if_ctx_t ctx, u16 vtag); static void em_if_vlan_unregister(if_ctx_t ctx, u16 vtag); static void em_if_watchdog_reset(if_ctx_t ctx); +static bool em_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); static void em_identify_hardware(if_ctx_t ctx); static int em_allocate_pci_resources(if_ctx_t ctx); @@ -400,6 +401,7 @@ static device_method_t em_if_methods[] = { DEVMETHOD(ifdi_rx_queue_intr_enable, em_if_rx_queue_intr_enable), DEVMETHOD(ifdi_tx_queue_intr_enable, em_if_tx_queue_intr_enable), DEVMETHOD(ifdi_debug, em_if_debug), + DEVMETHOD(ifdi_needs_restart, em_if_needs_restart), DEVMETHOD_END }; @@ -437,6 +439,7 @@ static device_method_t igb_if_methods[] = { DEVMETHOD(ifdi_rx_queue_intr_enable, igb_if_rx_queue_intr_enable), DEVMETHOD(ifdi_tx_queue_intr_enable, igb_if_tx_queue_intr_enable), DEVMETHOD(ifdi_debug, em_if_debug), + DEVMETHOD(ifdi_needs_restart, em_if_needs_restart), DEVMETHOD_END }; @@ -4035,6 +4038,25 @@ em_if_get_counter(if_ctx_t ctx, ift_counter cnt) adapter->watchdog_events); default: return (if_get_counter_default(ifp, cnt)); + } +} + +/* em_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning true for unknown events. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +em_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + return (false); + default: + return (true); } } Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Mon May 11 16:14:20 2020 (r360901) +++ head/sys/dev/ixgbe/if_ix.c Mon May 11 17:42:04 2020 (r360902) @@ -139,6 +139,7 @@ static void ixgbe_if_update_admin_status(if_ctx_t ctx) static void ixgbe_if_vlan_register(if_ctx_t ctx, u16 vtag); static void ixgbe_if_vlan_unregister(if_ctx_t ctx, u16 vtag); static int ixgbe_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); +static bool ixgbe_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); int ixgbe_intr(void *arg); /************************************************************************ @@ -273,6 +274,7 @@ static device_method_t ixgbe_if_methods[] = { DEVMETHOD(ifdi_vlan_unregister, ixgbe_if_vlan_unregister), DEVMETHOD(ifdi_get_counter, ixgbe_if_get_counter), DEVMETHOD(ifdi_i2c_req, ixgbe_if_i2c_req), + DEVMETHOD(ifdi_needs_restart, ixgbe_if_needs_restart), #ifdef PCI_IOV DEVMETHOD(ifdi_iov_init, ixgbe_if_iov_init), DEVMETHOD(ifdi_iov_uninit, ixgbe_if_iov_uninit), @@ -1234,6 +1236,25 @@ ixgbe_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req) req->dev_addr, &req->data[i]); return (0); } /* ixgbe_if_i2c_req */ + +/* ixgbe_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning true for unknown events. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +ixgbe_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + return (false); + default: + return (true); + } +} /************************************************************************ * ixgbe_add_media_types Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Mon May 11 16:14:20 2020 (r360901) +++ head/sys/dev/ixgbe/if_ixv.c Mon May 11 17:42:04 2020 (r360902) @@ -110,6 +110,7 @@ static void ixv_if_register_vlan(if_ctx_t, u16); static void ixv_if_unregister_vlan(if_ctx_t, u16); static uint64_t ixv_if_get_counter(if_ctx_t, ift_counter); +static bool ixv_if_needs_restart(if_ctx_t, enum iflib_restart_event); static void ixv_save_stats(struct adapter *); static void ixv_init_stats(struct adapter *); @@ -172,6 +173,7 @@ static device_method_t ixv_if_methods[] = { DEVMETHOD(ifdi_vlan_register, ixv_if_register_vlan), DEVMETHOD(ifdi_vlan_unregister, ixv_if_unregister_vlan), DEVMETHOD(ifdi_get_counter, ixv_if_get_counter), + DEVMETHOD(ifdi_needs_restart, ixv_if_needs_restart), DEVMETHOD_END }; @@ -1186,6 +1188,25 @@ ixv_if_get_counter(if_ctx_t ctx, ift_counter cnt) return (if_get_counter_default(ifp, cnt)); } } /* ixv_if_get_counter */ + +/* ixv_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning true for every event. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +ixv_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + /* XXX: This may not need to return true */ + default: + return (true); + } +} /************************************************************************ * ixv_initialize_transmit_units - Enable transmit unit. Modified: head/sys/dev/ixl/if_iavf.c ============================================================================== --- head/sys/dev/ixl/if_iavf.c Mon May 11 16:14:20 2020 (r360901) +++ head/sys/dev/ixl/if_iavf.c Mon May 11 17:42:04 2020 (r360902) @@ -92,6 +92,7 @@ static void iavf_if_vlan_register(if_ctx_t ctx, u16 v static void iavf_if_vlan_unregister(if_ctx_t ctx, u16 vtag); static uint64_t iavf_if_get_counter(if_ctx_t ctx, ift_counter cnt); static void iavf_if_stop(if_ctx_t ctx); +static bool iavf_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); static int iavf_allocate_pci_resources(struct iavf_sc *); static int iavf_reset_complete(struct i40e_hw *); @@ -190,6 +191,7 @@ static device_method_t iavf_if_methods[] = { DEVMETHOD(ifdi_vlan_register, iavf_if_vlan_register), DEVMETHOD(ifdi_vlan_unregister, iavf_if_vlan_unregister), DEVMETHOD(ifdi_get_counter, iavf_if_get_counter), + DEVMETHOD(ifdi_needs_restart, iavf_if_needs_restart), DEVMETHOD_END }; @@ -1467,7 +1469,27 @@ iavf_if_get_counter(if_ctx_t ctx, ift_counter cnt) } } - +/* iavf_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning true for every event. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +iavf_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + /* This case must return true if VLAN anti-spoof checks are + * enabled by the PF driver for the VF. + */ + default: + return (true); + } +} + static void iavf_free_pci_resources(struct iavf_sc *sc) { Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Mon May 11 16:14:20 2020 (r360901) +++ head/sys/dev/ixl/if_ixl.c Mon May 11 17:42:04 2020 (r360902) @@ -117,6 +117,7 @@ static void ixl_if_vlan_unregister(if_ctx_t ctx, u16 static uint64_t ixl_if_get_counter(if_ctx_t ctx, ift_counter cnt); static int ixl_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); static int ixl_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data); +static bool ixl_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); #ifdef PCI_IOV static void ixl_if_vflr_handle(if_ctx_t ctx); #endif @@ -187,6 +188,7 @@ static device_method_t ixl_if_methods[] = { DEVMETHOD(ifdi_get_counter, ixl_if_get_counter), DEVMETHOD(ifdi_i2c_req, ixl_if_i2c_req), DEVMETHOD(ifdi_priv_ioctl, ixl_if_priv_ioctl), + DEVMETHOD(ifdi_needs_restart, ixl_if_needs_restart), #ifdef PCI_IOV DEVMETHOD(ifdi_iov_init, ixl_if_iov_init), DEVMETHOD(ifdi_iov_uninit, ixl_if_iov_uninit), @@ -1650,6 +1652,24 @@ ixl_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_ } return (error); +} + +/* ixl_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning false for every event. + * + * @returns true if iflib needs to reinit the interface, false otherwise + */ +static bool +ixl_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + default: + return (false); + } } static u_int From owner-svn-src-head@freebsd.org Mon May 11 18:10:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F3F82E6FC5; Mon, 11 May 2020 18:10:35 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49LTWF6DbVz3MN9; Mon, 11 May 2020 18:10:33 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 55C473C0199; Mon, 11 May 2020 18:10:27 +0000 (UTC) Date: Mon, 11 May 2020 18:10:27 +0000 From: Brooks Davis To: Kyle Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360833 - head Message-ID: <20200511181027.GA60902@spindle.one-eyed-alien.net> References: <202005090201.04921Tpf028388@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline In-Reply-To: <202005090201.04921Tpf028388@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 49LTWF6DbVz3MN9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-6.53 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-3.63)[ip: (-9.55), ipnet: 199.48.128.0/22(-4.77), asn: 36236(-3.80), country: US(-0.05)]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 18:10:35 -0000 --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 09, 2020 at 02:01:29AM +0000, Kyle Evans wrote: > Author: kevans > Date: Sat May 9 02:01:29 2020 > New Revision: 360833 > URL: https://svnweb.freebsd.org/changeset/base/360833 >=20 > Log: > installworld: attempt a certctl rehash at the tail end > =20 > This can be run as root or normal user with no problem; if they hadn't > twisted the WITHOUT_CAROOT knob, we'll attempt to use the host certctl = to > rehash the DESTDIR. This would allow one to build systems WITHOUT_OPENS= SL + > WITH_CAROOT with a populated /etc/ssl that they can then use with an > appropriate *ssl from somewhere else. > =20 > Cross-builds are fine because this will always use the host certctl, or= just > nag if it's missing and it wasn't a WITHOUT_CAROOT build. > =20 > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D24641 >=20 > Modified: > head/Makefile.inc1 >=20 > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/Makefile.inc1 Sat May 9 01:48:08 2020 (r360832) > +++ head/Makefile.inc1 Sat May 9 02:01:29 2020 (r360833) > @@ -1403,6 +1403,16 @@ distributeworld installworld stageworld: _installc= heck > ${DESTDIR}/${DISTDIR}/${dist}.debug.meta > .endfor > .endif > +.elif make(installworld) && ${MK_CAROOT} !=3D "no" > + # We could make certctl a bootstrap tool, but it requires OpenSSL and > + # friends, which we likely don't want. We'll rehash on a best-effort > + # basis, otherwise we'll just mention that we're not doing it to raise > + # awareness. > + @if which certctl>/dev/null; then \ > + certctl rehash \ Does this update METALOG with the added links? It seems a little weird to rely on DESTDIR from the environment. In general I'm not enthusiastic about additions to installworld that do anything other than copying files, creating links, etc in simple ways. -- Brooks --5mCyUwZo2JvN/JJP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJeuZURAAoJEKzQXbSebgfAVx8IAJpjGA7VQT+08/rV2+4QkpO+ Dc1JDgQKqiEVwqeqPocmY22a+9fxh2hKyOQsV3cXK7jLpoapdEaVE8talZZFec/C Bs/G8hEb7EbXOwwtPOpiwtVGAqUkqTIjaw5VgnddW0ifQn5v5/oIgDoBYAtD9ahw AiEUY5Rpc4M3Hbn/8ZctOHfZ08OXgpMZy6c8FaUqame/I21D5eIAcJX7ICurFYvq 0If/QfXWKMyGNy1YsPoxxmIAs8ITYJ9fiRf33cfe8kggYQISfjL7chLtSp+2zCE4 cjey/a+8Qrob0K/BFXw6Bbj9ijEt8+rAPsbmqAM7zug/xYukPh+vMNT/QCsfGcw= =C34C -----END PGP SIGNATURE----- --5mCyUwZo2JvN/JJP-- From owner-svn-src-head@freebsd.org Mon May 11 18:45:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0AC12E7DA9; Mon, 11 May 2020 18:45:26 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LVHV25xpz3PN8; Mon, 11 May 2020 18:45:26 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (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 36C6314862; Mon, 11 May 2020 18:45:26 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f48.google.com with SMTP id v15so927726qvr.8; Mon, 11 May 2020 11:45:26 -0700 (PDT) X-Gm-Message-State: AGi0PuahnAEMfzym0oB9qXATc/hKRvEW8fgJgTQrWWEDdRrHKgGgHc7v mptWZOkG33eTZX1leIPNI3lEJPZLyXXMUUKOH60= X-Google-Smtp-Source: APiQypJanY8PSvfGTpnjUP8SXqdvSLHQdPxLyDGAv0qOdPrOpmnx+g6f/U9oSd/mzq26Ad+yLZos7bsh1O5ySBA1z/k= X-Received: by 2002:a05:6214:28d:: with SMTP id l13mr17301508qvv.181.1589222725681; Mon, 11 May 2020 11:45:25 -0700 (PDT) MIME-Version: 1.0 References: <202005090201.04921Tpf028388@repo.freebsd.org> <20200511181027.GA60902@spindle.one-eyed-alien.net> In-Reply-To: <20200511181027.GA60902@spindle.one-eyed-alien.net> From: Kyle Evans Date: Mon, 11 May 2020 13:45:14 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r360833 - head To: Brooks Davis Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 18:45:26 -0000 On Mon, May 11, 2020 at 1:10 PM Brooks Davis wrote: > > On Sat, May 09, 2020 at 02:01:29AM +0000, Kyle Evans wrote: > > Author: kevans > > Date: Sat May 9 02:01:29 2020 > > New Revision: 360833 > > URL: https://svnweb.freebsd.org/changeset/base/360833 > > > > Log: > > installworld: attempt a certctl rehash at the tail end > > > > This can be run as root or normal user with no problem; if they hadn't > > twisted the WITHOUT_CAROOT knob, we'll attempt to use the host certctl to > > rehash the DESTDIR. This would allow one to build systems WITHOUT_OPENSSL + > > WITH_CAROOT with a populated /etc/ssl that they can then use with an > > appropriate *ssl from somewhere else. > > > > Cross-builds are fine because this will always use the host certctl, or just > > nag if it's missing and it wasn't a WITHOUT_CAROOT build. > > > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D24641 > > > > Modified: > > head/Makefile.inc1 > > > > Modified: head/Makefile.inc1 > > ============================================================================== > > --- head/Makefile.inc1 Sat May 9 01:48:08 2020 (r360832) > > +++ head/Makefile.inc1 Sat May 9 02:01:29 2020 (r360833) > > @@ -1403,6 +1403,16 @@ distributeworld installworld stageworld: _installcheck > > ${DESTDIR}/${DISTDIR}/${dist}.debug.meta > > .endfor > > .endif > > +.elif make(installworld) && ${MK_CAROOT} != "no" > > + # We could make certctl a bootstrap tool, but it requires OpenSSL and > > + # friends, which we likely don't want. We'll rehash on a best-effort > > + # basis, otherwise we'll just mention that we're not doing it to raise > > + # awareness. > > + @if which certctl>/dev/null; then \ > > + certctl rehash \ > > Does this update METALOG with the added links? > > It seems a little weird to rely on DESTDIR from the environment. > > In general I'm not enthusiastic about additions to installworld that do > anything other than copying files, creating links, etc in simple ways. I will happily back this out if I can get some qualified eyes to review/improve it. It does not update METALOG, and it probably should. Agreed on DESTDIR. As for point #3, I guess we can continue spreading `certctl rehash` all over the tree in various points that may need it; the release(7) scripts will need to be done if we don't do it here at a minimum, and I haven't put much thought into it beyond that. The close-to-infuriating part of the caroot project has been that it's incredibly hard to get almost anyone else (with some obvious exceptions) to do more than informal discussion on the matter; actual review, in particular, is difficult to obtain. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Mon May 11 18:47:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EA522E7E50; Mon, 11 May 2020 18:47:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LVL32LyMz3PVl; Mon, 11 May 2020 18:47:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 475A622E0D; Mon, 11 May 2020 18:47:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BIld1k038355; Mon, 11 May 2020 18:47:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BIlcxr038354; Mon, 11 May 2020 18:47:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005111847.04BIlcxr038354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 11 May 2020 18:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360903 - in head: share/man/man5 sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man5 sys/netpfil/pf X-SVN-Commit-Revision: 360903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 18:47:39 -0000 Author: markj Date: Mon May 11 18:47:38 2020 New Revision: 360903 URL: https://svnweb.freebsd.org/changeset/base/360903 Log: pf: Don't allocate per-table entry counters unless required. pf by default does not do per-table address accounting unless the "counters" keyword is specified in the corresponding pf.conf table definition. Yet, we always allocate 12 per-CPU counters per table. For large tables this carries a lot of overhead, so only allocate counters when they will actually be used. A further enhancement might be to use a dedicated UMA zone to allocate counter arrays for table entries, since close to half of the structure size comes from counter pointers. A related issue is the cost of zeroing counters, since counter_u64_zero() calls smp_rendezvous() on some architectures. Reported by: loos, Jim Pingle Reviewed by: kp MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) Differential Revision: https://reviews.freebsd.org/D24803 Modified: head/share/man/man5/pf.conf.5 head/sys/netpfil/pf/pf_table.c Modified: head/share/man/man5/pf.conf.5 ============================================================================== --- head/share/man/man5/pf.conf.5 Mon May 11 17:42:04 2020 (r360902) +++ head/share/man/man5/pf.conf.5 Mon May 11 18:47:38 2020 (r360903) @@ -189,6 +189,7 @@ The .Ar counters flag enables per-address packet and byte counters which can be displayed with .Xr pfctl 8 . +Note that this feature carries significant memory overhead for large tables. .El .Pp For example, Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Mon May 11 17:42:04 2020 (r360902) +++ head/sys/netpfil/pf/pf_table.c Mon May 11 18:47:38 2020 (r360903) @@ -144,9 +144,9 @@ static void pfr_mark_addrs(struct pfr_ktable *); static struct pfr_kentry *pfr_lookup_addr(struct pfr_ktable *, struct pfr_addr *, int); -static bool pfr_create_kentry_counter(struct pfr_kcounters *, - int, int); -static struct pfr_kentry *pfr_create_kentry(struct pfr_addr *); +static bool pfr_create_kentry_counter(struct pfr_kentry *, int, + int); +static struct pfr_kentry *pfr_create_kentry(struct pfr_addr *, bool); static void pfr_destroy_kentries(struct pfr_kentryworkq *); static void pfr_destroy_kentry_counter(struct pfr_kcounters *, int, int); @@ -155,8 +155,8 @@ static void pfr_insert_kentries(struct pfr_ktable *, struct pfr_kentryworkq *, long); static void pfr_remove_kentries(struct pfr_ktable *, struct pfr_kentryworkq *); -static void pfr_clstats_kentries(struct pfr_kentryworkq *, long, - int); +static void pfr_clstats_kentries(struct pfr_ktable *, + struct pfr_kentryworkq *, long, int); static void pfr_reset_feedback(struct pfr_addr *, int); static void pfr_prepare_network(union sockaddr_union *, int, int); static int pfr_route_kentry(struct pfr_ktable *, @@ -285,7 +285,8 @@ pfr_add_addrs(struct pfr_table *tbl, struct pfr_addr * ad->pfra_fback = PFR_FB_NONE; } if (p == NULL && q == NULL) { - p = pfr_create_kentry(ad); + p = pfr_create_kentry(ad, + (kt->pfrkt_flags & PFR_TFLAG_COUNTERS) != 0); if (p == NULL) senderr(ENOMEM); if (pfr_route_kentry(tmpkt, p)) { @@ -451,7 +452,8 @@ pfr_set_addrs(struct pfr_table *tbl, struct pfr_addr * ad.pfra_fback = PFR_FB_DUPLICATE; goto _skip; } - p = pfr_create_kentry(&ad); + p = pfr_create_kentry(&ad, + (kt->pfrkt_flags & PFR_TFLAG_COUNTERS) != 0); if (p == NULL) senderr(ENOMEM); if (pfr_route_kentry(tmpkt, p)) { @@ -485,7 +487,7 @@ _skip: if (!(flags & PFR_FLAG_DUMMY)) { pfr_insert_kentries(kt, &addq, tzero); pfr_remove_kentries(kt, &delq); - pfr_clstats_kentries(&changeq, tzero, INVERT_NEG_FLAG); + pfr_clstats_kentries(kt, &changeq, tzero, INVERT_NEG_FLAG); } else pfr_destroy_kentries(&addq); if (nadd != NULL) @@ -623,7 +625,7 @@ pfr_get_astats(struct pfr_table *tbl, struct pfr_astat pfr_walktree, &w); if (!rv && (flags & PFR_FLAG_CLSTATS)) { pfr_enqueue_addrs(kt, &workq, NULL, 0); - pfr_clstats_kentries(&workq, tzero, 0); + pfr_clstats_kentries(kt, &workq, tzero, 0); } if (rv) return (rv); @@ -671,7 +673,7 @@ pfr_clr_astats(struct pfr_table *tbl, struct pfr_addr } if (!(flags & PFR_FLAG_DUMMY)) - pfr_clstats_kentries(&workq, 0, 0); + pfr_clstats_kentries(kt, &workq, 0, 0); if (nzero != NULL) *nzero = xzero; return (0); @@ -784,31 +786,28 @@ pfr_lookup_addr(struct pfr_ktable *kt, struct pfr_addr } static bool -pfr_create_kentry_counter(struct pfr_kcounters *kc, int pfr_dir, int pfr_op) +pfr_create_kentry_counter(struct pfr_kentry *ke, int pfr_dir, int pfr_op) { - kc->pfrkc_packets[pfr_dir][pfr_op] = counter_u64_alloc(M_NOWAIT); - if (! kc->pfrkc_packets[pfr_dir][pfr_op]) - return (false); + counter_u64_t c; - kc->pfrkc_bytes[pfr_dir][pfr_op] = counter_u64_alloc(M_NOWAIT); - if (! kc->pfrkc_bytes[pfr_dir][pfr_op]) { - /* Previous allocation will be freed through - * pfr_destroy_kentry() */ + c = counter_u64_alloc(M_NOWAIT); + if (c == NULL) return (false); - } - - kc->pfrkc_tzero = 0; - + ke->pfrke_counters.pfrkc_packets[pfr_dir][pfr_op] = c; + c = counter_u64_alloc(M_NOWAIT); + if (c == NULL) + return (false); + ke->pfrke_counters.pfrkc_bytes[pfr_dir][pfr_op] = c; return (true); } static struct pfr_kentry * -pfr_create_kentry(struct pfr_addr *ad) +pfr_create_kentry(struct pfr_addr *ad, bool counters) { struct pfr_kentry *ke; int pfr_dir, pfr_op; - ke = uma_zalloc(V_pfr_kentry_z, M_NOWAIT | M_ZERO); + ke = uma_zalloc(V_pfr_kentry_z, M_NOWAIT | M_ZERO); if (ke == NULL) return (NULL); @@ -819,14 +818,16 @@ pfr_create_kentry(struct pfr_addr *ad) ke->pfrke_af = ad->pfra_af; ke->pfrke_net = ad->pfra_net; ke->pfrke_not = ad->pfra_not; - for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir ++) - for (pfr_op = 0; pfr_op < PFR_OP_ADDR_MAX; pfr_op ++) { - if (! pfr_create_kentry_counter(&ke->pfrke_counters, - pfr_dir, pfr_op)) { - pfr_destroy_kentry(ke); - return (NULL); + ke->pfrke_counters.pfrkc_tzero = 0; + if (counters) + for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir++) + for (pfr_op = 0; pfr_op < PFR_OP_ADDR_MAX; pfr_op++) { + if (!pfr_create_kentry_counter(ke, pfr_dir, + pfr_op)) { + pfr_destroy_kentry(ke); + return (NULL); + } } - } return (ke); } @@ -844,8 +845,12 @@ pfr_destroy_kentries(struct pfr_kentryworkq *workq) static void pfr_destroy_kentry_counter(struct pfr_kcounters *kc, int pfr_dir, int pfr_op) { - counter_u64_free(kc->pfrkc_packets[pfr_dir][pfr_op]); - counter_u64_free(kc->pfrkc_bytes[pfr_dir][pfr_op]); + counter_u64_t c; + + if ((c = kc->pfrkc_packets[pfr_dir][pfr_op]) != NULL) + counter_u64_free(c); + if ((c = kc->pfrkc_bytes[pfr_dir][pfr_op]) != NULL) + counter_u64_free(c); } static void @@ -890,7 +895,7 @@ pfr_insert_kentry(struct pfr_ktable *kt, struct pfr_ad p = pfr_lookup_addr(kt, ad, 1); if (p != NULL) return (0); - p = pfr_create_kentry(ad); + p = pfr_create_kentry(ad, (kt->pfrkt_flags & PFR_TFLAG_COUNTERS) != 0); if (p == NULL) return (ENOMEM); @@ -930,22 +935,28 @@ pfr_clean_node_mask(struct pfr_ktable *kt, } static void -pfr_clstats_kentries(struct pfr_kentryworkq *workq, long tzero, int negchange) +pfr_clear_kentry_counters(struct pfr_kentry *p, int pfr_dir, int pfr_op) { + counter_u64_zero(p->pfrke_counters.pfrkc_packets[pfr_dir][pfr_op]); + counter_u64_zero(p->pfrke_counters.pfrkc_bytes[pfr_dir][pfr_op]); +} + +static void +pfr_clstats_kentries(struct pfr_ktable *kt, struct pfr_kentryworkq *workq, + long tzero, int negchange) +{ struct pfr_kentry *p; - int pfr_dir, pfr_op; + int pfr_dir, pfr_op; SLIST_FOREACH(p, workq, pfrke_workq) { if (negchange) p->pfrke_not = !p->pfrke_not; - for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir ++) { - for (pfr_op = 0; pfr_op < PFR_OP_ADDR_MAX; pfr_op ++) { - counter_u64_zero(p->pfrke_counters. - pfrkc_packets[pfr_dir][pfr_op]); - counter_u64_zero(p->pfrke_counters. - pfrkc_bytes[pfr_dir][pfr_op]); - } - } + if ((kt->pfrkt_flags & PFR_TFLAG_COUNTERS) != 0) + for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir++) + for (pfr_op = 0; pfr_op < PFR_OP_ADDR_MAX; + pfr_op++) + pfr_clear_kentry_counters(p, pfr_dir, + pfr_op); p->pfrke_counters.pfrkc_tzero = tzero; } } @@ -1551,7 +1562,8 @@ _skip: senderr(EINVAL); if (pfr_lookup_addr(shadow, ad, 1) != NULL) continue; - p = pfr_create_kentry(ad); + p = pfr_create_kentry(ad, + (shadow->pfrkt_flags & PFR_TFLAG_COUNTERS) != 0); if (p == NULL) senderr(ENOMEM); if (pfr_route_kentry(shadow, p)) { @@ -1707,7 +1719,7 @@ pfr_commit_ktable(struct pfr_ktable *kt, long tzero) pfr_enqueue_addrs(kt, &delq, NULL, ENQUEUE_UNMARKED_ONLY); pfr_insert_kentries(kt, &addq, tzero); pfr_remove_kentries(kt, &delq); - pfr_clstats_kentries(&changeq, tzero, INVERT_NEG_FLAG); + pfr_clstats_kentries(kt, &changeq, tzero, INVERT_NEG_FLAG); pfr_destroy_kentries(&garbageq); } else { /* kt cannot contain addresses */ @@ -1888,7 +1900,7 @@ pfr_clstats_ktable(struct pfr_ktable *kt, long tzero, if (recurse) { pfr_enqueue_addrs(kt, &addrq, NULL, 0); - pfr_clstats_kentries(&addrq, tzero, 0); + pfr_clstats_kentries(kt, &addrq, tzero, 0); } for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir ++) { for (pfr_op = 0; pfr_op < PFR_OP_TABLE_MAX; pfr_op ++) { From owner-svn-src-head@freebsd.org Mon May 11 19:07:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19B692E85F7; Mon, 11 May 2020 19:07:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LVn15Vp5z3RBM; Mon, 11 May 2020 19:07:33 +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 B3C7823207; Mon, 11 May 2020 19:07:33 +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 04BJ7XP1051444; Mon, 11 May 2020 19:07:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJ7XQs051443; Mon, 11 May 2020 19:07:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005111907.04BJ7XQs051443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 11 May 2020 19:07:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360905 - in head/tests/sys/netpfil: common pf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/tests/sys/netpfil: common pf X-SVN-Commit-Revision: 360905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:07:34 -0000 Author: markj Date: Mon May 11 19:07:33 2020 New Revision: 360905 URL: https://svnweb.freebsd.org/changeset/base/360905 Log: Remove the svn:executable property from some pf test files. The test makefiles will handle setting mode bits during install. Also, Phabricator gets upset when uploading an executable plain-text file without a shebang. MFC after: 1 week Modified: Directory Properties: head/tests/sys/netpfil/common/forward.sh (props changed) head/tests/sys/netpfil/pf/anchor.sh (props changed) head/tests/sys/netpfil/pf/forward.sh (props changed) head/tests/sys/netpfil/pf/fragmentation.sh (props changed) head/tests/sys/netpfil/pf/icmp.sh (props changed) head/tests/sys/netpfil/pf/names.sh (props changed) head/tests/sys/netpfil/pf/nat.sh (props changed) head/tests/sys/netpfil/pf/pass_block.sh (props changed) head/tests/sys/netpfil/pf/pfsync.sh (props changed) head/tests/sys/netpfil/pf/rdr.sh (props changed) head/tests/sys/netpfil/pf/route_to.sh (props changed) head/tests/sys/netpfil/pf/set_skip.sh (props changed) head/tests/sys/netpfil/pf/set_tos.sh (props changed) head/tests/sys/netpfil/pf/synproxy.sh (props changed) From owner-svn-src-head@freebsd.org Mon May 11 19:08:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A090E2E869F; Mon, 11 May 2020 19:08:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LVnc1V6Mz3RLx; Mon, 11 May 2020 19:08:04 +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 2C23523209; Mon, 11 May 2020 19:08:04 +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 04BJ84L8051512; Mon, 11 May 2020 19:08:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJ83Te051510; Mon, 11 May 2020 19:08:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005111908.04BJ83Te051510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 11 May 2020 19:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360906 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 360906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:08:04 -0000 Author: markj Date: Mon May 11 19:08:03 2020 New Revision: 360906 URL: https://svnweb.freebsd.org/changeset/base/360906 Log: Add a basic table entry counter regression test. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24809 Added: head/tests/sys/netpfil/pf/table.sh (contents, props changed) Modified: head/tests/sys/netpfil/pf/Makefile Modified: head/tests/sys/netpfil/pf/Makefile ============================================================================== --- head/tests/sys/netpfil/pf/Makefile Mon May 11 19:07:33 2020 (r360905) +++ head/tests/sys/netpfil/pf/Makefile Mon May 11 19:08:03 2020 (r360906) @@ -16,6 +16,7 @@ ATF_TESTS_SH+= anchor \ route_to \ synproxy \ set_skip \ + table \ pfsync \ icmp Added: head/tests/sys/netpfil/pf/table.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/table.sh Mon May 11 19:08:03 2020 (r360906) @@ -0,0 +1,115 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 Mark Johnston +# +# 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 + +TABLE_STATS_ZERO_REGEXP='Packets: 0[[:space:]]*Bytes: 0[[:space:]]' +TABLE_STATS_NONZERO_REGEXP='Packets: [1-9][0-9]*[[:space:]]*Bytes: [1-9][0-9]*[[:space:]]' + +atf_test_case "v4_counters" "cleanup" +v4_counters_head() +{ + atf_set descr 'Verify per-address counters for v4' + atf_set require.user root +} + +v4_counters_body() +{ + pft_init + + epair_send=$(vnet_mkepair) + ifconfig ${epair_send}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair_send}b + jexec alcatraz ifconfig ${epair_send}b 192.0.2.2/24 up + jexec alcatraz pfctl -e + + pft_set_rules alcatraz \ + "table counters { 192.0.2.1 }" \ + "block all" \ + "pass in from to any" \ + "pass out from any to " + + atf_check -s exit:0 -o ignore ping -c 3 192.0.2.2 + + atf_check -s exit:0 -e ignore \ + -o match:'In/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \ + -o match:'In/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ + -o match:'Out/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \ + -o match:'Out/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ + jexec alcatraz pfctl -t foo -T show -vv +} + +v4_counters_cleanup() +{ + pft_cleanup +} + +atf_test_case "v6_counters" "cleanup" +v6_counters_head() +{ + atf_set descr 'Verify per-address counters for v6' + atf_set require.user root +} + +v6_counters_body() +{ + pft_init + + epair_send=$(vnet_mkepair) + ifconfig ${epair_send}a inet6 2001:db8:42::1/64 up no_dad -ifdisabled + + vnet_mkjail alcatraz ${epair_send}b + jexec alcatraz ifconfig ${epair_send}b inet6 2001:db8:42::2/64 up no_dad + jexec alcatraz pfctl -e + + pft_set_rules alcatraz \ + "table counters { 2001:db8:42::1 }" \ + "block all" \ + "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 -e ignore \ + -o match:'In/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \ + -o match:'In/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ + -o match:'Out/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \ + -o match:'Out/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ + jexec alcatraz pfctl -t foo6 -T show -vv +} + +v6_counters_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "v4_counters" + atf_add_test_case "v6_counters" +} From owner-svn-src-head@freebsd.org Mon May 11 19:17:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76FCA2E8CF8; Mon, 11 May 2020 19:17:34 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LW0Z2WsRz3xsc; Mon, 11 May 2020 19:17:34 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51F3C233E7; Mon, 11 May 2020 19:17:34 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BJHYKu057927; Mon, 11 May 2020 19:17:34 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJHYJj057926; Mon, 11 May 2020 19:17:34 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <202005111917.04BJHYJj057926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Mon, 11 May 2020 19:17:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360914 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 360914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:17:34 -0000 Author: gallatin Date: Mon May 11 19:17:33 2020 New Revision: 360914 URL: https://svnweb.freebsd.org/changeset/base/360914 Log: Ktls: never skip stamping tags for NIC TLS The newer RACK and BBR TCP stacks have added a mechanism to disable hardware packet pacing for TCP retransmits. This mechanism works by skipping the send-tag stamp on rate-limited connections when the TCP stack calls ip_output() with the IP_NO_SND_TAG_RL flag set. When doing NIC TLS, we must ignore this flag, as NIC TLS packets must always be stamped. Failure to stamp a NIC TLS packet will result in crypto issues. Reviewed by: hselasky, rrs Sponsored by: Netflix, Mellanox Modified: head/sys/netinet/ip_output.c head/sys/netinet6/ip6_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Mon May 11 19:16:49 2020 (r360913) +++ head/sys/netinet/ip_output.c Mon May 11 19:17:33 2020 (r360914) @@ -242,6 +242,10 @@ ip_output_send(struct inpcb *inp, struct ifnet *ifp, s error = EAGAIN; goto done; } + /* + * Always stamp tags that include NIC ktls. + */ + stamp_tag = true; } #endif #ifdef RATELIMIT Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Mon May 11 19:16:49 2020 (r360913) +++ head/sys/netinet6/ip6_output.c Mon May 11 19:17:33 2020 (r360914) @@ -353,6 +353,10 @@ ip6_output_send(struct inpcb *inp, struct ifnet *ifp, error = EAGAIN; goto done; } + /* + * Always stamp tags that include NIC ktls. + */ + stamp_tag = true; } #endif #ifdef RATELIMIT From owner-svn-src-head@freebsd.org Mon May 11 19:36:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EF9F2E9689; Mon, 11 May 2020 19:36:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LWQb0zW1z40FF; Mon, 11 May 2020 19:36:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C525237A4; Mon, 11 May 2020 19:36:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BJacaP070027; Mon, 11 May 2020 19:36:38 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJac6K070026; Mon, 11 May 2020 19:36:38 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005111936.04BJac6K070026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 11 May 2020 19:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360915 - head/lib/csu X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/csu X-SVN-Commit-Revision: 360915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:36:39 -0000 Author: dim Date: Mon May 11 19:36:38 2020 New Revision: 360915 URL: https://svnweb.freebsd.org/changeset/base/360915 Log: Use -fno-asynchronous-unwind-tables to compile lib/csu Summary: In r209294 kib added -fno-asynchronous-unwind-tables to the compile flags for the GNU C startup components. This was done to work around a BFD ld assertion, "no .eh_frame_hdr table will be created", which is produced because of the layout of the startup objects. Add the same flag to lib/csu too, for the same reason. And similarly to r209294, also add -fno-omit-frame-pointer. This is primarily meant to quickly MFC to stable/11, so it can end up in the 11.4 release, as a fix for https://bugs.freebsd.org/246322. PR: 246322 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24797 Modified: head/lib/csu/Makefile.inc Modified: head/lib/csu/Makefile.inc ============================================================================== --- head/lib/csu/Makefile.inc Mon May 11 19:17:33 2020 (r360914) +++ head/lib/csu/Makefile.inc Mon May 11 19:36:38 2020 (r360915) @@ -13,6 +13,9 @@ NO_WMISSING_VARIABLE_DECLARATIONS= OBJS+= crtbegin.o crtbeginS.o crtbeginT.o OBJS+= crtend.o crtendS.o +CFLAGS+= -fno-asynchronous-unwind-tables +CFLAGS+= -fno-omit-frame-pointer + CFLAGS_CRTS= -DSHARED ${PICFLAG} crtbegin.o: crtbegin.c From owner-svn-src-head@freebsd.org Mon May 11 20:30:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6905C2EAB5C; Mon, 11 May 2020 20:30:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LXcl28BNz44y0; Mon, 11 May 2020 20:30:31 +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 44BF82417D; Mon, 11 May 2020 20:30:31 +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 04BKUVAE004150; Mon, 11 May 2020 20:30:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKUTBt004140; Mon, 11 May 2020 20:30:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112030.04BKUTBt004140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 20:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360918 - in head: . share/man/man4 sys/conf sys/dev/random sys/dev/ubsec sys/modules sys/modules/ubsec sys/sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: . share/man/man4 sys/conf sys/dev/random sys/dev/ubsec sys/modules sys/modules/ubsec sys/sys X-SVN-Commit-Revision: 360918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:30:31 -0000 Author: jhb Date: Mon May 11 20:30:28 2020 New Revision: 360918 URL: https://svnweb.freebsd.org/changeset/base/360918 Log: Remove ubsec(4). This driver was previously marked for deprecation in r360710. Approved by: csprng (cem, gordon, delphij) Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24766 Deleted: head/share/man/man4/ubsec.4 head/sys/dev/ubsec/ubsec.c head/sys/dev/ubsec/ubsecreg.h head/sys/dev/ubsec/ubsecvar.h head/sys/modules/ubsec/Makefile Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/share/man/man4/crypto.4 head/share/man/man4/rndtest.4 head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/dev/random/random_harvestq.c head/sys/modules/Makefile head/sys/sys/random.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon May 11 20:10:01 2020 (r360917) +++ head/ObsoleteFiles.inc Mon May 11 20:30:28 2020 (r360918) @@ -36,6 +36,9 @@ # xargs -n1 | sort | uniq -d; # done +# 2020xxxx: Remove ubsec(4) +OLD_FILES+=usr/share/man/man4/ubsec.4.gz + # 20200506: GNU objdump 2.17.50 retired OLD_FILES+=usr/bin/objdump OLD_FILES+=usr/share/man/man1/objdump.1.gz Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon May 11 20:10:01 2020 (r360917) +++ head/share/man/man4/Makefile Mon May 11 20:30:28 2020 (r360918) @@ -966,7 +966,6 @@ MAN+= \ uart.4 \ uath.4 \ ubsa.4 \ - ubsec.4 \ ubser.4 \ ubtbcmfw.4 \ uchcom.4 \ Modified: head/share/man/man4/crypto.4 ============================================================================== --- head/share/man/man4/crypto.4 Mon May 11 20:10:01 2020 (r360917) +++ head/share/man/man4/crypto.4 Mon May 11 20:30:28 2020 (r360918) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2020 +.Dd May 11, 2020 .Dt CRYPTO 4 .Os .Sh NAME @@ -424,7 +424,6 @@ The semantics of these arguments are currently undocum .Xr ipsec 4 , .Xr padlock 4 , .Xr safe 4 , -.Xr ubsec 4 , .Xr crypto 7 , .Xr geli 8 , .Xr crypto 9 Modified: head/share/man/man4/rndtest.4 ============================================================================== --- head/share/man/man4/rndtest.4 Mon May 11 20:10:01 2020 (r360917) +++ head/share/man/man4/rndtest.4 Mon May 11 20:30:28 2020 (r360918) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2003 +.Dd May 11, 2020 .Dt RNDTEST 4 .Os .Sh NAME @@ -54,7 +54,6 @@ Failures are optionally reported on the console. .Xr hifn 4 , .Xr random 4 , .Xr safe 4 , -.Xr ubsec 4 , .Xr crypto 9 .Sh HISTORY The idea for this and the original code came from Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon May 11 20:10:01 2020 (r360917) +++ head/sys/conf/NOTES Mon May 11 20:30:28 2020 (r360918) @@ -2630,10 +2630,6 @@ device hifn # Hifn 7951, 7781, etc. options HIFN_DEBUG # enable debugging support: hw.hifn.debug options HIFN_RNDTEST # enable rndtest support -device ubsec # Broadcom 5501, 5601, 58xx -options UBSEC_DEBUG # enable debugging support: hw.ubsec.debug -options UBSEC_RNDTEST # enable rndtest support - ##################################################################### Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 11 20:10:01 2020 (r360917) +++ head/sys/conf/files Mon May 11 20:30:28 2020 (r360918) @@ -3182,7 +3182,6 @@ dev/uart/uart_dev_z8530.c optional uart uart_z8530 | u dev/uart/uart_if.m optional uart dev/uart/uart_subr.c optional uart dev/uart/uart_tty.c optional uart -dev/ubsec/ubsec.c optional ubsec # # USB controller drivers # Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon May 11 20:10:01 2020 (r360917) +++ head/sys/conf/options Mon May 11 20:30:28 2020 (r360918) @@ -734,11 +734,6 @@ BCE_NVRAM_WRITE_SUPPORT opt_bce.h SOCKBUF_DEBUG opt_global.h -# options for ubsec driver -UBSEC_DEBUG opt_ubsec.h -UBSEC_RNDTEST opt_ubsec.h -UBSEC_NO_RNG opt_ubsec.h - # options for hifn driver HIFN_DEBUG opt_hifn.h HIFN_RNDTEST opt_hifn.h Modified: head/sys/dev/random/random_harvestq.c ============================================================================== --- head/sys/dev/random/random_harvestq.c Mon May 11 20:10:01 2020 (r360917) +++ head/sys/dev/random/random_harvestq.c Mon May 11 20:30:28 2020 (r360918) @@ -347,7 +347,6 @@ static const char *random_source_descr[ENTROPYSOURCE] [RANDOM_PURE_OCTEON] = "PURE_OCTEON", /* PURE_START */ [RANDOM_PURE_SAFE] = "PURE_SAFE", [RANDOM_PURE_GLXSB] = "PURE_GLXSB", - [RANDOM_PURE_UBSEC] = "PURE_UBSEC", [RANDOM_PURE_HIFN] = "PURE_HIFN", [RANDOM_PURE_RDRAND] = "PURE_RDRAND", [RANDOM_PURE_NEHEMIAH] = "PURE_NEHEMIAH", Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon May 11 20:10:01 2020 (r360917) +++ head/sys/modules/Makefile Mon May 11 20:30:28 2020 (r360918) @@ -354,7 +354,6 @@ SUBDIR= \ twe \ tws \ uart \ - ubsec \ udf \ udf_iconv \ ufs \ Modified: head/sys/sys/random.h ============================================================================== --- head/sys/sys/random.h Mon May 11 20:10:01 2020 (r360917) +++ head/sys/sys/random.h Mon May 11 20:30:28 2020 (r360918) @@ -92,7 +92,6 @@ enum random_entropy_source { RANDOM_PURE_OCTEON = RANDOM_PURE_START, RANDOM_PURE_SAFE, RANDOM_PURE_GLXSB, - RANDOM_PURE_UBSEC, RANDOM_PURE_HIFN, RANDOM_PURE_RDRAND, RANDOM_PURE_NEHEMIAH, From owner-svn-src-head@freebsd.org Mon May 11 20:34:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 683542EB122; Mon, 11 May 2020 20:34:53 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LXjn274Lz45c5; Mon, 11 May 2020 20:34:53 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4419A2434A; Mon, 11 May 2020 20:34:53 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BKYruw009954; Mon, 11 May 2020 20:34:53 GMT (envelope-from mr@FreeBSD.org) Received: (from mr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKYq1J009950; Mon, 11 May 2020 20:34:52 GMT (envelope-from mr@FreeBSD.org) Message-Id: <202005112034.04BKYq1J009950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mr set sender to mr@FreeBSD.org using -f From: Michael Reifenberger Date: Mon, 11 May 2020 20:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360919 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: mr X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 360919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:34:53 -0000 Author: mr Date: Mon May 11 20:34:52 2020 New Revision: 360919 URL: https://svnweb.freebsd.org/changeset/base/360919 Log: Patch systat -zarc to display cumulative rate and round down large numbers by SI units PR: 237664 Submitted by: ota@j.email.ne.jp MFC after: 2 weeks Modified: head/usr.bin/systat/Makefile head/usr.bin/systat/extern.h head/usr.bin/systat/main.c head/usr.bin/systat/zarc.c Modified: head/usr.bin/systat/Makefile ============================================================================== --- head/usr.bin/systat/Makefile Mon May 11 20:30:28 2020 (r360918) +++ head/usr.bin/systat/Makefile Mon May 11 20:34:52 2020 (r360919) @@ -4,7 +4,7 @@ .include PROG= systat -SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c \ +SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c sysput.c \ netcmds.c netstat.c pigs.c swap.c icmp.c \ mode.c ip.c sctp.c tcp.c zarc.c \ vmstat.c convtbl.c ifcmds.c ifstat.c Modified: head/usr.bin/systat/extern.h ============================================================================== --- head/usr.bin/systat/extern.h Mon May 11 20:30:28 2020 (r360918) +++ head/usr.bin/systat/extern.h Mon May 11 20:34:52 2020 (r360919) @@ -165,6 +165,8 @@ void showtcp(void); void status(void); void suspend(int); char *sysctl_dynread(const char *, size_t *); +void sysputstrs(WINDOW* , int, int, int); +void sysputuint64(WINDOW* , int, int, int, uint64_t, int); #define SYSTAT_CMD(name) \ void close ## name(WINDOW *); \ @@ -176,4 +178,4 @@ char *sysctl_dynread(const char *, size_t *); void show ## name(void) SYSTAT_CMD( zarc ); -SYSTAT_CMD ( sctp ); +SYSTAT_CMD( sctp ); Modified: head/usr.bin/systat/main.c ============================================================================== --- head/usr.bin/systat/main.c Mon May 11 20:30:28 2020 (r360918) +++ head/usr.bin/systat/main.c Mon May 11 20:34:52 2020 (r360919) @@ -300,17 +300,8 @@ display(void) GETSYSCTL("kstat.zfs.misc.arcstats.dbuf_size", arc_stat); arc[6] += arc_stat; wmove(wload, 0, 0); wclrtoeol(wload); - for (i = 0 ; i < nitems(arc); i++) { - if (arc[i] > 10llu * 1024 * 1024 * 1024 ) { - wprintw(wload, "%7lluG", arc[i] >> 30); - } - else if (arc[i] > 10 * 1024 * 1024 ) { - wprintw(wload, "%7lluM", arc[i] >> 20); - } - else { - wprintw(wload, "%7lluK", arc[i] >> 10); - } - } + for (i = 0 ; i < nitems(arc); i++) + sysputuint64(wload, 0, i*8+2, 6, arc[i], 0); } } (*curcmd->c_refresh)(); Modified: head/usr.bin/systat/zarc.c ============================================================================== --- head/usr.bin/systat/zarc.c Mon May 11 20:30:28 2020 (r360918) +++ head/usr.bin/systat/zarc.c Mon May 11 20:34:52 2020 (r360919) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 - 2017 Yoshihiro Ota + * Copyright (c) 2014 - 2017, 2019 Yoshihiro Ota * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,16 +32,16 @@ __FBSDID("$FreeBSD$"); #include #include -/* #include */ #include #include #include +#include #include "systat.h" #include "extern.h" #include "devs.h" -struct zfield{ +struct zfield { uint64_t arcstats; uint64_t arcstats_demand_data; uint64_t arcstats_demand_metadata; @@ -57,18 +57,25 @@ static struct zarcstats { struct zfield misses; } curstat, initstat, oldstat; +struct zarcrates { + struct zfield current; + struct zfield total; +}; + static void getinfo(struct zarcstats *ls); WINDOW * openzarc(void) { - return (subwin(stdscr, LINES-3-1, 0, MAINWIN_ROW, 0)); + + return (subwin(stdscr, LINES - 3 - 1, 0, MAINWIN_ROW, 0)); } void closezarc(WINDOW *w) { + if (w == NULL) return; wclear(w); @@ -80,12 +87,12 @@ void labelzarc(void) { int row = 1; + wmove(wnd, 0, 0); wclrtoeol(wnd); - mvwprintw(wnd, 0, 31+1, "%4.4s %7.7s %7.7s %12.12s %12.12s", - "rate", "hits", "misses", "total hits", "total misses"); -#define L(str) mvwprintw(wnd, row, 5, #str); \ - mvwprintw(wnd, row, 31, ":"); \ - mvwprintw(wnd, row, 31+4, "%%"); ++row + mvwprintw(wnd, 0, 31+1, "%4.4s %6.6s %6.6s | Total %4.4s %6.6s %6.6s", + "Rate", "Hits", "Misses", "Rate", "Hits", "Misses"); +#define L(str) mvwprintw(wnd, row++, 5, \ + "%-26.26s: %% | %%", #str) L(arcstats); L(arcstats.demand_data); L(arcstats.demand_metadata); @@ -98,21 +105,23 @@ labelzarc(void) dslabel(12, 0, 18); } -static int calc(uint64_t hits, uint64_t misses) +static int +calc_rate(uint64_t hits, uint64_t misses) { - if( hits ) - return 100 * hits / ( hits + misses ); + if(hits) + return 100 * hits / (hits + misses); else return 0; } static void -domode(struct zarcstats *delta, struct zarcstats *rate) +domode(struct zarcstats *delta, struct zarcrates *rate) { #define DO(stat) \ delta->hits.stat = (curstat.hits.stat - oldstat.hits.stat); \ delta->misses.stat = (curstat.misses.stat - oldstat.misses.stat); \ - rate->hits.stat = calc(delta->hits.stat, delta->misses.stat) + rate->current.stat = calc_rate(delta->hits.stat, delta->misses.stat); \ + rate->total.stat = calc_rate(curstat.hits.stat, curstat.misses.stat) DO(arcstats); DO(arcstats_demand_data); DO(arcstats_demand_metadata); @@ -136,21 +145,20 @@ void showzarc(void) { int row = 1; - struct zarcstats delta, rate; + struct zarcstats delta = {}; + struct zarcrates rate = {}; - memset(&delta, 0, sizeof delta); - memset(&rate, 0, sizeof rate); - domode(&delta, &rate); -#define DO(stat, col, fmt) \ - mvwprintw(wnd, row, col, fmt, stat) -#define R(stat) DO(rate.hits.stat, 31+1, "%3"PRIu64) -#define H(stat) DO(delta.hits.stat, 31+1+5, "%7"PRIu64); \ - DO(curstat.hits.stat, 31+1+5+8+8, "%12"PRIu64) -#define M(stat) DO(delta.misses.stat, 31+1+5+8, "%7"PRIu64); \ - DO(curstat.misses.stat, 31+1+5+8+8+13, "%12"PRIu64) -#define E(stat) R(stat); H(stat); M(stat); ++row +#define DO(stat, col, width) \ + sysputuint64(wnd, row, col, width, stat, HN_DIVISOR_1000) +#define RATES(stat) mvwprintw(wnd, row, 31+1, "%3"PRIu64, rate.current.stat);\ + mvwprintw(wnd, row, 31+1+5+7+7+8, "%3"PRIu64, rate.total.stat) +#define HITS(stat) DO(delta.hits.stat, 31+1+5, 6); \ + DO(curstat.hits.stat, 31+1+5+7+7+8+5, 6) +#define MISSES(stat) DO(delta.misses.stat, 31+1+5+7, 6); \ + DO(curstat.misses.stat, 31+1+5+7+7+8+5+7, 6) +#define E(stat) RATES(stat); HITS(stat); MISSES(stat); ++row E(arcstats); E(arcstats_demand_data); E(arcstats_demand_metadata); @@ -161,9 +169,9 @@ showzarc(void) E(vdev_cache_stats); #undef DO #undef E -#undef M -#undef H -#undef R +#undef MISSES +#undef HITS +#undef RATES dsshow(12, 0, 18, &cur_dev, &last_dev); } @@ -180,6 +188,7 @@ initzarc(void) void resetzarc(void) { + initzarc(); } @@ -193,11 +202,11 @@ getinfo(struct zarcstats *ls) cur_dev.dinfo = tmp_dinfo; last_dev.snap_time = cur_dev.snap_time; - dsgetinfo( &cur_dev ); + dsgetinfo(&cur_dev); - size_t size = sizeof( ls->hits.arcstats ); - if ( sysctlbyname("kstat.zfs.misc.arcstats.hits", - &ls->hits.arcstats, &size, NULL, 0 ) != 0 ) + size_t size = sizeof(ls->hits.arcstats); + if (sysctlbyname("kstat.zfs.misc.arcstats.hits", + &ls->hits.arcstats, &size, NULL, 0) != 0) return; GETSYSCTL("kstat.zfs.misc.arcstats.misses", ls->misses.arcstats); @@ -234,6 +243,7 @@ getinfo(struct zarcstats *ls) void fetchzarc(void) { + oldstat = curstat; getinfo(&curstat); } From owner-svn-src-head@freebsd.org Mon May 11 20:40:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B44692EB45D; Mon, 11 May 2020 20:40:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LXrJ4H62z46KJ; Mon, 11 May 2020 20:40:32 +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 8E1A42438C; Mon, 11 May 2020 20:40:32 +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 04BKeWCR010309; Mon, 11 May 2020 20:40:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKeUlr010298; Mon, 11 May 2020 20:40:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112040.04BKeUlr010298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 20:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360920 - in head: share/man/man4 share/man/man9 sys/dev/cesa sys/dev/hifn sys/dev/sec sys/mips/nlm/dev/sec sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man4 share/man/man9 sys/dev/cesa sys/dev/hifn sys/dev/sec sys/mips/nlm/dev/sec sys/opencrypto X-SVN-Commit-Revision: 360920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:40:32 -0000 Author: jhb Date: Mon May 11 20:40:30 2020 New Revision: 360920 URL: https://svnweb.freebsd.org/changeset/base/360920 Log: Remove incomplete support for plain MD5 from OCF. Although a few drivers supported this algorithm, there were never any in-kernel consumers. cryptosoft and cryptodev never supported it, and there was not a software xform auth_hash for it. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24767 Modified: head/share/man/man4/hifn.4 head/share/man/man9/crypto.9 head/sys/dev/cesa/cesa.c head/sys/dev/hifn/hifn7751.c head/sys/dev/sec/sec.c head/sys/mips/nlm/dev/sec/nlmsec.c head/sys/mips/nlm/dev/sec/nlmseclib.c head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.c head/sys/opencrypto/cryptosoft.c Modified: head/share/man/man4/hifn.4 ============================================================================== --- head/share/man/man4/hifn.4 Mon May 11 20:34:52 2020 (r360919) +++ head/share/man/man4/hifn.4 Mon May 11 20:40:30 2020 (r360920) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 19, 2009 +.Dd May 11, 2020 .Dt HIFN 4 .Os .Sh NAME @@ -57,7 +57,7 @@ driver supports various cards containing the Hifn 7751 The .Nm driver registers itself to accelerate DES, Triple-DES, -AES (7955 and 7956 only), ARC4, MD5, +AES (7955 and 7956 only), ARC4, MD5-HMAC, SHA1, and SHA1-HMAC operations for .Xr ipsec 4 and Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 20:34:52 2020 (r360919) +++ head/share/man/man9/crypto.9 Mon May 11 20:40:30 2020 (r360920) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2020 +.Dd May 11, 2020 .Dt CRYPTO 9 .Os .Sh NAME @@ -106,7 +106,6 @@ The following authentication algorithms are supported: .It Dv CRYPTO_AES_NIST_GMAC .It Dv CRYPTO_BLAKE2B .It Dv CRYPTO_BLAKE2S -.It Dv CRYPTO_MD5 .It Dv CRYPTO_MD5_HMAC .It Dv CRYPTO_MD5_KPDK .It Dv CRYPTO_NULL_HMAC Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/dev/cesa/cesa.c Mon May 11 20:40:30 2020 (r360920) @@ -1607,7 +1607,6 @@ cesa_auth_supported(struct cesa_softc *sc, sc->sc_soc_id == MV_DEV_88F6810)) return (false); /* FALLTHROUGH */ - case CRYPTO_MD5: case CRYPTO_MD5_HMAC: case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: @@ -1686,12 +1685,6 @@ cesa_newsession(device_t dev, crypto_session_t cses, } switch (csp->csp_auth_alg) { - case CRYPTO_MD5: - cs->cs_mblen = 1; - cs->cs_hlen = (csp->csp_auth_mlen == 0) ? MD5_HASH_LEN : - csp->csp_auth_mlen; - cs->cs_config |= CESA_CSHD_MD5; - break; case CRYPTO_MD5_HMAC: cs->cs_mblen = MD5_BLOCK_LEN; cs->cs_hlen = (csp->csp_auth_mlen == 0) ? MD5_HASH_LEN : Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/dev/hifn/hifn7751.c Mon May 11 20:40:30 2020 (r360920) @@ -2315,7 +2315,6 @@ hifn_auth_supported(struct hifn_softc *sc, } switch (csp->csp_auth_alg) { - case CRYPTO_MD5: case CRYPTO_SHA1: break; case CRYPTO_MD5_HMAC: @@ -2524,11 +2523,6 @@ hifn_process(device_t dev, struct cryptop *crp, int hi cmd->base_masks |= HIFN_BASE_CMD_MAC; switch (csp->csp_auth_alg) { - case CRYPTO_MD5: - cmd->mac_masks |= HIFN_MAC_CMD_ALG_MD5 | - HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HASH | - HIFN_MAC_CMD_POS_IPSEC; - break; case CRYPTO_MD5_HMAC: cmd->mac_masks |= HIFN_MAC_CMD_ALG_MD5 | HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HMAC | Modified: head/sys/dev/sec/sec.c ============================================================================== --- head/sys/dev/sec/sec.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/dev/sec/sec.c Mon May 11 20:40:30 2020 (r360920) @@ -1180,7 +1180,6 @@ sec_auth_supported(struct sec_softc *sc, if (csp->csp_auth_klen > SEC_MAX_KEY_LEN) return (false); break; - case CRYPTO_MD5: case CRYPTO_SHA1: break; default: @@ -1530,7 +1529,6 @@ static bool sec_mdeu_can_handle(u_int alg) { switch (alg) { - case CRYPTO_MD5: case CRYPTO_SHA1: case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: @@ -1554,8 +1552,6 @@ sec_mdeu_config(const struct crypto_session_params *cs switch (csp->csp_auth_alg) { case CRYPTO_MD5_HMAC: *mode |= SEC_MDEU_MODE_HMAC; - /* FALLTHROUGH */ - case CRYPTO_MD5: *eu = SEC_EU_MDEU_A; *mode |= SEC_MDEU_MODE_MD5; *hashlen = MD5_HASH_LEN; Modified: head/sys/mips/nlm/dev/sec/nlmsec.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 11 20:40:30 2020 (r360920) @@ -376,7 +376,6 @@ xlp_sec_auth_supported(const struct crypto_session_par { switch (csp->csp_auth_alg) { - case CRYPTO_MD5: case CRYPTO_SHA1: case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: Modified: head/sys/mips/nlm/dev/sec/nlmseclib.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmseclib.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/mips/nlm/dev/sec/nlmseclib.c Mon May 11 20:40:30 2020 (r360920) @@ -273,10 +273,6 @@ nlm_get_digest_param(struct xlp_sec_command *cmd, const struct crypto_session_params *csp) { switch(csp->csp_auth_alg) { - case CRYPTO_MD5: - cmd->hashalg = NLM_HASH_MD5; - cmd->hashmode = NLM_HASH_MODE_SHA1; - break; case CRYPTO_SHA1: cmd->hashalg = NLM_HASH_SHA; cmd->hashmode = NLM_HASH_MODE_SHA1; Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/opencrypto/crypto.c Mon May 11 20:40:30 2020 (r360920) @@ -550,10 +550,6 @@ crypto_auth_hash(const struct crypto_session_params *c return (&auth_hash_key_md5); case CRYPTO_SHA1_KPDK: return (&auth_hash_key_sha1); -#ifdef notyet - case CRYPTO_MD5: - return (&auth_hash_md5); -#endif case CRYPTO_SHA1: return (&auth_hash_sha1); case CRYPTO_SHA2_224: @@ -704,7 +700,6 @@ static enum alg_type { [CRYPTO_SHA1_KPDK] = ALG_KEYED_DIGEST, [CRYPTO_AES_CBC] = ALG_CIPHER, [CRYPTO_ARC4] = ALG_CIPHER, - [CRYPTO_MD5] = ALG_DIGEST, [CRYPTO_SHA1] = ALG_DIGEST, [CRYPTO_NULL_HMAC] = ALG_DIGEST, [CRYPTO_NULL_CBC] = ALG_CIPHER, Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/opencrypto/cryptodev.c Mon May 11 20:40:30 2020 (r360920) @@ -506,11 +506,6 @@ cryptof_ioctl( return (EINVAL); } break; -#ifdef notdef - case CRYPTO_MD5: - thash = &auth_hash_md5; - break; -#endif case CRYPTO_SHA1: thash = &auth_hash_sha1; break; Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/opencrypto/cryptosoft.c Mon May 11 20:40:30 2020 (r360920) @@ -980,9 +980,6 @@ swcr_setup_auth(struct swcr_session *ses, if (csp->csp_mode == CSP_MODE_DIGEST) ses->swcr_process = swcr_authcompute; break; -#ifdef notdef - case CRYPTO_MD5: -#endif case CRYPTO_SHA1: case CRYPTO_SHA2_224: case CRYPTO_SHA2_256: From owner-svn-src-head@freebsd.org Mon May 11 20:41:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22C012EB665; Mon, 11 May 2020 20:41:04 +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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LXrw09wyz46hD; Mon, 11 May 2020 20:41:04 +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 0175E2450D; Mon, 11 May 2020 20:41:04 +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 04BKf3u9012031; Mon, 11 May 2020 20:41:03 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKf3tN012030; Mon, 11 May 2020 20:41:03 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005112041.04BKf3tN012030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 11 May 2020 20:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360921 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 360921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:41:04 -0000 Author: melifaro Date: Mon May 11 20:41:03 2020 New Revision: 360921 URL: https://svnweb.freebsd.org/changeset/base/360921 Log: Fix NOINET[6] build by using af-independent route lookup function. Reported by: rpokala Modified: head/sys/netinet/sctp_os_bsd.h Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Mon May 11 20:40:30 2020 (r360920) +++ head/sys/netinet/sctp_os_bsd.h Mon May 11 20:41:03 2020 (r360921) @@ -402,10 +402,7 @@ typedef struct route sctp_route_t; #define SCTP_RTALLOC(ro, vrf_id, fibnum) \ { \ if ((ro)->ro_nh == NULL) { \ - if ((ro)->ro_dst.sa_family == AF_INET) \ - (ro)->ro_nh = fib4_lookup(fibnum, ((struct sockaddr_in *)&(ro)->ro_dst)->sin_addr, 0, NHR_REF, 0); \ - if ((ro)->ro_dst.sa_family == AF_INET6) \ - (ro)->ro_nh = fib6_lookup(fibnum, &((struct sockaddr_in6 *)&(ro)->ro_dst)->sin6_addr, 0, NHR_REF, 0); \ + (ro)->ro_nh = rib_lookup(fibnum, &(ro)->ro_dst, NHR_REF, 0); \ } \ } From owner-svn-src-head@freebsd.org Mon May 11 20:44:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC1782EBA3F for ; Mon, 11 May 2020 20:44:12 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LXwW4kZPz47NM for ; Mon, 11 May 2020 20:44:11 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-io1-xd41.google.com with SMTP id k18so2393172ion.0 for ; Mon, 11 May 2020 13:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JmYKuk47ZFALbZxrlZRpWQGMRLRXhDZ1kuEguFbR3CA=; b=Cii3dl7Y5zSkVe+BgWdsIoPVdXnGb69SLgC448LRw7XbgiSLB/UqahRWSO8Q5XwZoh olv8tQiuOH/fD0A3Mh/BnpiU6MwgU7EKqS1kLwLxAyh3ZWx8ZWan4O8A0Wyj3KQp8WkB V/c+UWM+SGgj9N2zNbQZpyqwr+nF4OsTxqtAw= 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=JmYKuk47ZFALbZxrlZRpWQGMRLRXhDZ1kuEguFbR3CA=; b=Zj7Jf/VqCP/jHF42jQaLV0GIL8l6iEzW8IHOtn7osyQTNE8MWHO39BjwrFVzEDuJlL vLe9j11xlZz9f7odoogwIv6ZnkqwvyaTpH5r9aNoa3cRLWAep9JWrhMMx8RqvXCB4Lyr UbhQYabl2Dk9IanEQ5gU3l5TeXt5QxcNVMWgAqHBcSrSB/VhzbuQas6+A28Tg+iwCjao avYip184WQCj8BTVsyMU4QB0BRnMkGD4F1wXGS3nX3U1bwWgeEvye/6hbPYxQvMgvzLw Y4pP7AVB2j91wqCrJGRyJ6hEEj2SYKVhJfgV/bovpnQMcHwI/vY6py7Xbw2GZEPG2PZw i9lQ== X-Gm-Message-State: AGi0PubSmjFPMRwmNViNGpstYX3MlPgAXmCnipbn5iO8ESOguqRLtAnf 8DqUo2GBZiMIE7oZuDR96QT0+9JIM9u6yFJXKYvpKtG50Rk= X-Google-Smtp-Source: APiQypJgpe80b3jHW7kDJjfqAeFbB5USJeSEoiu4N5+B4EbWzu/lybUgxPFnVk1PAt0Qq5PAQvkrMCa9cuWiKCnKsTI= X-Received: by 2002:a6b:cd8e:: with SMTP id d136mr17283501iog.113.1589229849664; Mon, 11 May 2020 13:44:09 -0700 (PDT) MIME-Version: 1.0 References: <202005110233.04B2XcpD033576@repo.freebsd.org> In-Reply-To: <202005110233.04B2XcpD033576@repo.freebsd.org> From: Kevin Bowling Date: Mon, 11 May 2020 13:43:58 -0700 Message-ID: Subject: Re: svn commit: r360887 - in head/sys: conf powerpc/aim powerpc/booke powerpc/include powerpc/powerpc vm To: Justin Hibbits Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49LXwW4kZPz47NM X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none (invalid DKIM record) header.d=kev009.com header.s=google header.b=Cii3dl7Y; dmarc=none; spf=pass (mx1.freebsd.org: domain of kevin.bowling@kev009.com designates 2607:f8b0:4864:20::d41 as permitted sender) smtp.mailfrom=kevin.bowling@kev009.com X-Spamd-Result: default: False [-2.41 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[kev009.com]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[kev009.com:~]; RCVD_IN_DNSWL_NONE(0.00)[1.4.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_DKIM_PERMFAIL(0.00)[kev009.com:s=google]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-0.11)[ip: (0.23), ipnet: 2607:f8b0::/32(-0.33), asn: 15169(-0.43), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:44:13 -0000 Were there any major changes you can summarize from the P9BSD integration, and any TODO list (perhaps wiki for this question)? On Sun, May 10, 2020 at 7:33 PM Justin Hibbits wrote: > > Author: jhibbits > Date: Mon May 11 02:33:37 2020 > New Revision: 360887 > URL: https://svnweb.freebsd.org/changeset/base/360887 > > Log: > powerpc64: Implement Radix MMU for POWER9 CPUs > > Summary: > POWER9 supports two MMU formats: traditional hashed page tables, and Radix > page tables, similar to what's presesnt on most other architectures. The > PowerISA also specifies a process table -- a table of page table pointers-- > which on the POWER9 is only available with the Radix MMU, so we can take > advantage of it with the Radix MMU driver. > > Written by Matt Macy. > > Differential Revision: https://reviews.freebsd.org/D19516 > > Added: > head/sys/powerpc/aim/mmu_radix.c (contents, props changed) > Modified: > head/sys/conf/files.powerpc > head/sys/powerpc/aim/aim_machdep.c > head/sys/powerpc/aim/mmu_oea.c > head/sys/powerpc/aim/mmu_oea64.c > head/sys/powerpc/booke/pmap.c > head/sys/powerpc/include/cpufunc.h > head/sys/powerpc/include/mmuvar.h > head/sys/powerpc/include/param.h > head/sys/powerpc/include/pmap.h > head/sys/powerpc/include/proc.h > head/sys/powerpc/include/pte.h > head/sys/powerpc/include/spr.h > head/sys/powerpc/include/sr.h > head/sys/powerpc/include/vmparam.h > head/sys/powerpc/powerpc/machdep.c > head/sys/powerpc/powerpc/mmu_if.m > head/sys/powerpc/powerpc/pmap_dispatch.c > head/sys/powerpc/powerpc/trap.c > head/sys/vm/vm_fault.c > > Modified: head/sys/conf/files.powerpc > ============================================================================== > --- head/sys/conf/files.powerpc Mon May 11 01:20:40 2020 (r360886) > +++ head/sys/conf/files.powerpc Mon May 11 02:33:37 2020 (r360887) > @@ -135,6 +135,7 @@ powerpc/aim/locore.S optional aim no-obj > powerpc/aim/aim_machdep.c optional aim > powerpc/aim/mmu_oea.c optional aim powerpc > powerpc/aim/mmu_oea64.c optional aim > +powerpc/aim/mmu_radix.c optional aim powerpc64 > powerpc/aim/moea64_if.m optional aim > powerpc/aim/moea64_native.c optional aim > powerpc/aim/mp_cpudep.c optional aim > > Modified: head/sys/powerpc/aim/aim_machdep.c > ============================================================================== > --- head/sys/powerpc/aim/aim_machdep.c Mon May 11 01:20:40 2020 (r360886) > +++ head/sys/powerpc/aim/aim_machdep.c Mon May 11 02:33:37 2020 (r360887) > @@ -136,6 +136,8 @@ __FBSDID("$FreeBSD$"); > struct bat battable[16]; > #endif > > +int radix_mmu = 0; > + > #ifndef __powerpc64__ > /* Bits for running on 64-bit systems in 32-bit mode. */ > extern void *testppc64, *testppc64size; > @@ -451,7 +453,14 @@ aim_cpu_init(vm_offset_t toc) > * in case the platform module had a better idea of what we > * should do. > */ > - if (cpu_features & PPC_FEATURE_64) > + if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { > + radix_mmu = 0; > + TUNABLE_INT_FETCH("radix_mmu", &radix_mmu); > + if (radix_mmu) > + pmap_mmu_install(MMU_TYPE_RADIX, BUS_PROBE_GENERIC); > + else > + pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); > + } else if (cpu_features & PPC_FEATURE_64) > pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); > else > pmap_mmu_install(MMU_TYPE_OEA, BUS_PROBE_GENERIC); > > Modified: head/sys/powerpc/aim/mmu_oea.c > ============================================================================== > --- head/sys/powerpc/aim/mmu_oea.c Mon May 11 01:20:40 2020 (r360886) > +++ head/sys/powerpc/aim/mmu_oea.c Mon May 11 02:33:37 2020 (r360887) > @@ -322,6 +322,7 @@ void moea_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t > void moea_scan_init(mmu_t mmu); > vm_offset_t moea_quick_enter_page(mmu_t mmu, vm_page_t m); > void moea_quick_remove_page(mmu_t mmu, vm_offset_t addr); > +boolean_t moea_page_is_mapped(mmu_t mmu, vm_page_t m); > static int moea_map_user_ptr(mmu_t mmu, pmap_t pm, > volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); > static int moea_decode_kernel_ptr(mmu_t mmu, vm_offset_t addr, > @@ -364,6 +365,7 @@ static mmu_method_t moea_methods[] = { > MMUMETHOD(mmu_page_set_memattr, moea_page_set_memattr), > MMUMETHOD(mmu_quick_enter_page, moea_quick_enter_page), > MMUMETHOD(mmu_quick_remove_page, moea_quick_remove_page), > + MMUMETHOD(mmu_page_is_mapped, moea_page_is_mapped), > > /* Internal interfaces */ > MMUMETHOD(mmu_bootstrap, moea_bootstrap), > @@ -1102,6 +1104,12 @@ moea_quick_enter_page(mmu_t mmu, vm_page_t m) > void > moea_quick_remove_page(mmu_t mmu, vm_offset_t addr) > { > +} > + > +boolean_t > +moea_page_is_mapped(mmu_t mmu, vm_page_t m) > +{ > + return (!LIST_EMPTY(&(m)->md.mdpg_pvoh)); > } > > /* > > Modified: head/sys/powerpc/aim/mmu_oea64.c > ============================================================================== > --- head/sys/powerpc/aim/mmu_oea64.c Mon May 11 01:20:40 2020 (r360886) > +++ head/sys/powerpc/aim/mmu_oea64.c Mon May 11 02:33:37 2020 (r360887) > @@ -120,8 +120,7 @@ uintptr_t moea64_get_unique_vsid(void); > * > */ > > -#define PV_LOCK_PER_DOM (PA_LOCK_COUNT * 3) > -#define PV_LOCK_COUNT (PV_LOCK_PER_DOM * MAXMEMDOM) > +#define PV_LOCK_COUNT PA_LOCK_COUNT > static struct mtx_padalign pv_lock[PV_LOCK_COUNT]; > > /* > @@ -130,8 +129,7 @@ static struct mtx_padalign pv_lock[PV_LOCK_COUNT]; > * index at (N << 45). > */ > #ifdef __powerpc64__ > -#define PV_LOCK_IDX(pa) (pa_index(pa) % PV_LOCK_PER_DOM + \ > - (((pa) >> 45) % MAXMEMDOM) * PV_LOCK_PER_DOM) > +#define PV_LOCK_IDX(pa) ((pa_index(pa) * (((pa) >> 45) + 1)) % PV_LOCK_COUNT) > #else > #define PV_LOCK_IDX(pa) (pa_index(pa) % PV_LOCK_COUNT) > #endif > @@ -305,6 +303,7 @@ void moea64_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size > void moea64_scan_init(mmu_t mmu); > vm_offset_t moea64_quick_enter_page(mmu_t mmu, vm_page_t m); > void moea64_quick_remove_page(mmu_t mmu, vm_offset_t addr); > +boolean_t moea64_page_is_mapped(mmu_t mmu, vm_page_t m); > static int moea64_map_user_ptr(mmu_t mmu, pmap_t pm, > volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); > static int moea64_decode_kernel_ptr(mmu_t mmu, vm_offset_t addr, > @@ -353,6 +352,7 @@ static mmu_method_t moea64_methods[] = { > MMUMETHOD(mmu_page_set_memattr, moea64_page_set_memattr), > MMUMETHOD(mmu_quick_enter_page, moea64_quick_enter_page), > MMUMETHOD(mmu_quick_remove_page, moea64_quick_remove_page), > + MMUMETHOD(mmu_page_is_mapped, moea64_page_is_mapped), > #ifdef __powerpc64__ > MMUMETHOD(mmu_page_array_startup, moea64_page_array_startup), > #endif > @@ -1423,6 +1423,12 @@ moea64_quick_remove_page(mmu_t mmu, vm_offset_t addr) > ("moea64_quick_remove_page: invalid address")); > mtx_unlock(PCPU_PTR(aim.qmap_lock)); > sched_unpin(); > +} > + > +boolean_t > +moea64_page_is_mapped(mmu_t mmu, vm_page_t m) > +{ > + return (!LIST_EMPTY(&(m)->md.mdpg_pvoh)); > } > > /* > > Added: head/sys/powerpc/aim/mmu_radix.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/powerpc/aim/mmu_radix.c Mon May 11 02:33:37 2020 (r360887) > @@ -0,0 +1,6507 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2018 Matthew Macy > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > + > + > +#include > +__FBSDID("$FreeBSD$"); > + > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#ifdef INVARIANTS > +#include > +#endif > + > +#define PPC_BITLSHIFT(bit) (sizeof(long)*NBBY - 1 - (bit)) > +#define PPC_BIT(bit) (1UL << PPC_BITLSHIFT(bit)) > +#define PPC_BITLSHIFT_VAL(val, bit) ((val) << PPC_BITLSHIFT(bit)) > + > +#include "opt_ddb.h" > +#ifdef DDB > +static void pmap_pte_walk(pml1_entry_t *l1, vm_offset_t va); > +#endif > + > +#define PG_W RPTE_WIRED > +#define PG_V RPTE_VALID > +#define PG_MANAGED RPTE_MANAGED > +#define PG_PROMOTED RPTE_PROMOTED > +#define PG_M RPTE_C > +#define PG_A RPTE_R > +#define PG_X RPTE_EAA_X > +#define PG_RW RPTE_EAA_W > +#define PG_PTE_CACHE RPTE_ATTR_MASK > + > +#define RPTE_SHIFT 9 > +#define NLS_MASK ((1UL<<5)-1) > +#define RPTE_ENTRIES (1UL< +#define RPTE_MASK (RPTE_ENTRIES-1) > + > +#define NLB_SHIFT 0 > +#define NLB_MASK (((1UL<<52)-1) << 8) > + > +extern int nkpt; > +extern caddr_t crashdumpmap; > + > +#define RIC_FLUSH_TLB 0 > +#define RIC_FLUSH_PWC 1 > +#define RIC_FLUSH_ALL 2 > + > +#define POWER9_TLB_SETS_RADIX 128 /* # sets in POWER9 TLB Radix mode */ > + > +#define PPC_INST_TLBIE 0x7c000264 > +#define PPC_INST_TLBIEL 0x7c000224 > +#define PPC_INST_SLBIA 0x7c0003e4 > + > +#define ___PPC_RA(a) (((a) & 0x1f) << 16) > +#define ___PPC_RB(b) (((b) & 0x1f) << 11) > +#define ___PPC_RS(s) (((s) & 0x1f) << 21) > +#define ___PPC_RT(t) ___PPC_RS(t) > +#define ___PPC_R(r) (((r) & 0x1) << 16) > +#define ___PPC_PRS(prs) (((prs) & 0x1) << 17) > +#define ___PPC_RIC(ric) (((ric) & 0x3) << 18) > + > +#define PPC_SLBIA(IH) __XSTRING(.long PPC_INST_SLBIA | \ > + ((IH & 0x7) << 21)) > +#define PPC_TLBIE_5(rb,rs,ric,prs,r) \ > + __XSTRING(.long PPC_INST_TLBIE | \ > + ___PPC_RB(rb) | ___PPC_RS(rs) | \ > + ___PPC_RIC(ric) | ___PPC_PRS(prs) | \ > + ___PPC_R(r)) > + > +#define PPC_TLBIEL(rb,rs,ric,prs,r) \ > + __XSTRING(.long PPC_INST_TLBIEL | \ > + ___PPC_RB(rb) | ___PPC_RS(rs) | \ > + ___PPC_RIC(ric) | ___PPC_PRS(prs) | \ > + ___PPC_R(r)) > + > +#define PPC_INVALIDATE_ERAT PPC_SLBIA(7) > + > +static __inline void > +ttusync(void) > +{ > + __asm __volatile("eieio; tlbsync; ptesync" ::: "memory"); > +} > + > +#define TLBIEL_INVAL_SEL_MASK 0xc00 /* invalidation selector */ > +#define TLBIEL_INVAL_PAGE 0x000 /* invalidate a single page */ > +#define TLBIEL_INVAL_SET_PID 0x400 /* invalidate a set for the current PID */ > +#define TLBIEL_INVAL_SET_LPID 0x800 /* invalidate a set for current LPID */ > +#define TLBIEL_INVAL_SET 0xc00 /* invalidate a set for all LPIDs */ > + > +#define TLBIE_ACTUAL_PAGE_MASK 0xe0 > +#define TLBIE_ACTUAL_PAGE_4K 0x00 > +#define TLBIE_ACTUAL_PAGE_64K 0xa0 > +#define TLBIE_ACTUAL_PAGE_2M 0x20 > +#define TLBIE_ACTUAL_PAGE_1G 0x40 > + > +#define TLBIE_PRS_PARTITION_SCOPE 0x0 > +#define TLBIE_PRS_PROCESS_SCOPE 0x1 > + > +#define TLBIE_RIC_INVALIDATE_TLB 0x0 /* Invalidate just TLB */ > +#define TLBIE_RIC_INVALIDATE_PWC 0x1 /* Invalidate just PWC */ > +#define TLBIE_RIC_INVALIDATE_ALL 0x2 /* Invalidate TLB, PWC, > + * cached {proc, part}tab entries > + */ > +#define TLBIE_RIC_INVALIDATE_SEQ 0x3 /* HPT - only: > + * Invalidate a range of translations > + */ > + > +static __inline void > +radix_tlbie(uint8_t ric, uint8_t prs, uint16_t is, uint32_t pid, uint32_t lpid, > + vm_offset_t va, uint16_t ap) > +{ > + uint64_t rb, rs; > + > + MPASS((va & PAGE_MASK) == 0); > + > + rs = ((uint64_t)pid << 32) | lpid; > + rb = va | is | ap; > + __asm __volatile(PPC_TLBIE_5(%0, %1, %2, %3, 1) : : > + "r" (rb), "r" (rs), "i" (ric), "i" (prs)); > +} > + > +static __inline void > +radix_tlbie_invlpg_user_4k(uint32_t pid, vm_offset_t va) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_PAGE, pid, 0, va, TLBIE_ACTUAL_PAGE_4K); > +} > + > +static __inline void > +radix_tlbie_invlpg_user_2m(uint32_t pid, vm_offset_t va) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_PAGE, pid, 0, va, TLBIE_ACTUAL_PAGE_2M); > +} > + > +static __inline void > +radix_tlbie_invlpwc_user(uint32_t pid) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_PWC, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_SET_PID, pid, 0, 0, 0); > +} > + > +static __inline void > +radix_tlbie_flush_user(uint32_t pid) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_ALL, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_SET_PID, pid, 0, 0, 0); > +} > + > +static __inline void > +radix_tlbie_invlpg_kernel_4k(vm_offset_t va) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_PAGE, 0, 0, va, TLBIE_ACTUAL_PAGE_4K); > +} > + > +static __inline void > +radix_tlbie_invlpg_kernel_2m(vm_offset_t va) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_PAGE, 0, 0, va, TLBIE_ACTUAL_PAGE_2M); > +} > + > +/* 1GB pages aren't currently supported. */ > +static __inline __unused void > +radix_tlbie_invlpg_kernel_1g(vm_offset_t va) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_PAGE, 0, 0, va, TLBIE_ACTUAL_PAGE_1G); > +} > + > +static __inline void > +radix_tlbie_invlpwc_kernel(void) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_PWC, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_SET_LPID, 0, 0, 0, 0); > +} > + > +static __inline void > +radix_tlbie_flush_kernel(void) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_ALL, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_SET_LPID, 0, 0, 0, 0); > +} > + > +static __inline vm_pindex_t > +pmap_l3e_pindex(vm_offset_t va) > +{ > + return ((va & PG_FRAME) >> L3_PAGE_SIZE_SHIFT); > +} > + > +static __inline vm_pindex_t > +pmap_pml3e_index(vm_offset_t va) > +{ > + > + return ((va >> L3_PAGE_SIZE_SHIFT) & RPTE_MASK); > +} > + > +static __inline vm_pindex_t > +pmap_pml2e_index(vm_offset_t va) > +{ > + return ((va >> L2_PAGE_SIZE_SHIFT) & RPTE_MASK); > +} > + > +static __inline vm_pindex_t > +pmap_pml1e_index(vm_offset_t va) > +{ > + return ((va & PG_FRAME) >> L1_PAGE_SIZE_SHIFT); > +} > + > +/* Return various clipped indexes for a given VA */ > +static __inline vm_pindex_t > +pmap_pte_index(vm_offset_t va) > +{ > + > + return ((va >> PAGE_SHIFT) & RPTE_MASK); > +} > + > +/* Return a pointer to the PT slot that corresponds to a VA */ > +static __inline pt_entry_t * > +pmap_l3e_to_pte(pt_entry_t *l3e, vm_offset_t va) > +{ > + pt_entry_t *pte; > + vm_paddr_t ptepa; > + > + ptepa = (*l3e & NLB_MASK); > + pte = (pt_entry_t *)PHYS_TO_DMAP(ptepa); > + return (&pte[pmap_pte_index(va)]); > +} > + > +/* Return a pointer to the PD slot that corresponds to a VA */ > +static __inline pt_entry_t * > +pmap_l2e_to_l3e(pt_entry_t *l2e, vm_offset_t va) > +{ > + pt_entry_t *l3e; > + vm_paddr_t l3pa; > + > + l3pa = (*l2e & NLB_MASK); > + l3e = (pml3_entry_t *)PHYS_TO_DMAP(l3pa); > + return (&l3e[pmap_pml3e_index(va)]); > +} > + > +/* Return a pointer to the PD slot that corresponds to a VA */ > +static __inline pt_entry_t * > +pmap_l1e_to_l2e(pt_entry_t *l1e, vm_offset_t va) > +{ > + pt_entry_t *l2e; > + vm_paddr_t l2pa; > + > + l2pa = (*l1e & NLB_MASK); > + > + l2e = (pml2_entry_t *)PHYS_TO_DMAP(l2pa); > + return (&l2e[pmap_pml2e_index(va)]); > +} > + > +static __inline pml1_entry_t * > +pmap_pml1e(pmap_t pmap, vm_offset_t va) > +{ > + > + return (&pmap->pm_pml1[pmap_pml1e_index(va)]); > +} > + > +static pt_entry_t * > +pmap_pml2e(pmap_t pmap, vm_offset_t va) > +{ > + pt_entry_t *l1e; > + > + l1e = pmap_pml1e(pmap, va); > + if (l1e == NULL || (*l1e & RPTE_VALID) == 0) > + return (NULL); > + return (pmap_l1e_to_l2e(l1e, va)); > +} > + > +static __inline pt_entry_t * > +pmap_pml3e(pmap_t pmap, vm_offset_t va) > +{ > + pt_entry_t *l2e; > + > + l2e = pmap_pml2e(pmap, va); > + if (l2e == NULL || (*l2e & RPTE_VALID) == 0) > + return (NULL); > + return (pmap_l2e_to_l3e(l2e, va)); > +} > + > +static __inline pt_entry_t * > +pmap_pte(pmap_t pmap, vm_offset_t va) > +{ > + pt_entry_t *l3e; > + > + l3e = pmap_pml3e(pmap, va); > + if (l3e == NULL || (*l3e & RPTE_VALID) == 0) > + return (NULL); > + return (pmap_l3e_to_pte(l3e, va)); > +} > + > +int nkpt = 64; > +SYSCTL_INT(_machdep, OID_AUTO, nkpt, CTLFLAG_RD, &nkpt, 0, > + "Number of kernel page table pages allocated on bootup"); > + > +vm_paddr_t dmaplimit; > + > +SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); > + > +static int pg_ps_enabled = 1; > +SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, > + &pg_ps_enabled, 0, "Are large page mappings enabled?"); > +#ifdef INVARIANTS > +#define VERBOSE_PMAP 0 > +#define VERBOSE_PROTECT 0 > +static int pmap_logging; > +SYSCTL_INT(_vm_pmap, OID_AUTO, pmap_logging, CTLFLAG_RWTUN, > + &pmap_logging, 0, "verbose debug logging"); > +#endif > + > +static u_int64_t KPTphys; /* phys addr of kernel level 1 */ > + > +//static vm_paddr_t KERNend; /* phys addr of end of bootstrap data */ > + > +static vm_offset_t qframe = 0; > +static struct mtx qframe_mtx; > +static epoch_t pmap_epoch; > + > +void mmu_radix_activate(mmu_t mmu, struct thread *); > +void mmu_radix_advise(mmu_t mmu, pmap_t, vm_offset_t, vm_offset_t, int); > +void mmu_radix_align_superpage(mmu_t mmu, vm_object_t, vm_ooffset_t, vm_offset_t *, > + vm_size_t); > +void mmu_radix_clear_modify(mmu_t, vm_page_t); > +void mmu_radix_copy(mmu_t, pmap_t, pmap_t, vm_offset_t, vm_size_t, vm_offset_t); > +int mmu_radix_map_user_ptr(mmu_t mmu, pmap_t pm, > + volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); > +int mmu_radix_decode_kernel_ptr(mmu_t, vm_offset_t, int *, vm_offset_t *); > +int mmu_radix_enter(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t, u_int, int8_t); > +void mmu_radix_enter_object(mmu_t, pmap_t, vm_offset_t, vm_offset_t, vm_page_t, > + vm_prot_t); > +void mmu_radix_enter_quick(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t); > +vm_paddr_t mmu_radix_extract(mmu_t, pmap_t pmap, vm_offset_t va); > +vm_page_t mmu_radix_extract_and_hold(mmu_t, pmap_t, vm_offset_t, vm_prot_t); > +void mmu_radix_kenter(mmu_t, vm_offset_t, vm_paddr_t); > +vm_paddr_t mmu_radix_kextract(mmu_t, vm_offset_t); > +void mmu_radix_kremove(mmu_t, vm_offset_t); > +boolean_t mmu_radix_is_modified(mmu_t, vm_page_t); > +boolean_t mmu_radix_is_prefaultable(mmu_t, pmap_t, vm_offset_t); > +boolean_t mmu_radix_is_referenced(mmu_t, vm_page_t); > +void mmu_radix_object_init_pt(mmu_t, pmap_t, vm_offset_t, vm_object_t, > + vm_pindex_t, vm_size_t); > +boolean_t mmu_radix_page_exists_quick(mmu_t, pmap_t, vm_page_t); > +void mmu_radix_page_init(mmu_t, vm_page_t); > +boolean_t mmu_radix_page_is_mapped(mmu_t, vm_page_t m); > +void mmu_radix_page_set_memattr(mmu_t, vm_page_t, vm_memattr_t); > +int mmu_radix_page_wired_mappings(mmu_t, vm_page_t); > +void mmu_radix_pinit(mmu_t, pmap_t); > +void mmu_radix_protect(mmu_t, pmap_t, vm_offset_t, vm_offset_t, vm_prot_t); > +boolean_t mmu_radix_ps_enabled(mmu_t, pmap_t); > +void mmu_radix_qenter(mmu_t, vm_offset_t, vm_page_t *, int); > +void mmu_radix_qremove(mmu_t, vm_offset_t, int); > +vm_offset_t mmu_radix_quick_enter_page(mmu_t, vm_page_t); > +void mmu_radix_quick_remove_page(mmu_t, vm_offset_t); > +boolean_t mmu_radix_ts_referenced(mmu_t, vm_page_t); > +void mmu_radix_release(mmu_t, pmap_t); > +void mmu_radix_remove(mmu_t, pmap_t, vm_offset_t, vm_offset_t); > +void mmu_radix_remove_all(mmu_t, vm_page_t); > +void mmu_radix_remove_pages(mmu_t, pmap_t); > +void mmu_radix_remove_write(mmu_t, vm_page_t); > +void mmu_radix_unwire(mmu_t, pmap_t, vm_offset_t, vm_offset_t); > +void mmu_radix_zero_page(mmu_t, vm_page_t); > +void mmu_radix_zero_page_area(mmu_t, vm_page_t, int, int); > +int mmu_radix_change_attr(mmu_t, vm_offset_t, vm_size_t, vm_memattr_t); > +void mmu_radix_page_array_startup(mmu_t mmu, long pages); > + > +#include "mmu_oea64.h" > +#include "mmu_if.h" > +#include "moea64_if.h" > + > +/* > + * Kernel MMU interface > + */ > + > +static void mmu_radix_bootstrap(mmu_t mmup, > + vm_offset_t kernelstart, vm_offset_t kernelend); > + > +static void mmu_radix_copy_page(mmu_t, vm_page_t, vm_page_t); > +static void mmu_radix_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offset_t a_offset, > + vm_page_t *mb, vm_offset_t b_offset, int xfersize); > +static void mmu_radix_growkernel(mmu_t, vm_offset_t); > +static void mmu_radix_init(mmu_t); > +static int mmu_radix_mincore(mmu_t, pmap_t, vm_offset_t, vm_paddr_t *); > +static vm_offset_t mmu_radix_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); > +static void mmu_radix_pinit0(mmu_t, pmap_t); > + > +static void *mmu_radix_mapdev(mmu_t, vm_paddr_t, vm_size_t); > +static void *mmu_radix_mapdev_attr(mmu_t, vm_paddr_t, vm_size_t, vm_memattr_t); > +static void mmu_radix_unmapdev(mmu_t, vm_offset_t, vm_size_t); > +static void mmu_radix_kenter_attr(mmu_t, vm_offset_t, vm_paddr_t, vm_memattr_t ma); > +static boolean_t mmu_radix_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); > +static void mmu_radix_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t sz, > + void **va); > +static void mmu_radix_scan_init(mmu_t mmu); > +static void mmu_radix_cpu_bootstrap(mmu_t, int ap); > + > +static mmu_method_t mmu_radix_methods[] = { > + MMUMETHOD(mmu_bootstrap, mmu_radix_bootstrap), > + MMUMETHOD(mmu_copy_page, mmu_radix_copy_page), > + MMUMETHOD(mmu_copy_pages, mmu_radix_copy_pages), > + MMUMETHOD(mmu_cpu_bootstrap, mmu_radix_cpu_bootstrap), > + MMUMETHOD(mmu_growkernel, mmu_radix_growkernel), > + MMUMETHOD(mmu_init, mmu_radix_init), > + MMUMETHOD(mmu_map, mmu_radix_map), > + MMUMETHOD(mmu_mincore, mmu_radix_mincore), > + MMUMETHOD(mmu_pinit, mmu_radix_pinit), > + MMUMETHOD(mmu_pinit0, mmu_radix_pinit0), > + > + MMUMETHOD(mmu_mapdev, mmu_radix_mapdev), > + MMUMETHOD(mmu_mapdev_attr, mmu_radix_mapdev_attr), > + MMUMETHOD(mmu_unmapdev, mmu_radix_unmapdev), > + MMUMETHOD(mmu_kenter_attr, mmu_radix_kenter_attr), > + MMUMETHOD(mmu_dev_direct_mapped,mmu_radix_dev_direct_mapped), > + MMUMETHOD(mmu_scan_init, mmu_radix_scan_init), > + MMUMETHOD(mmu_dumpsys_map, mmu_radix_dumpsys_map), > + MMUMETHOD(mmu_page_is_mapped, mmu_radix_page_is_mapped), > + MMUMETHOD(mmu_ps_enabled, mmu_radix_ps_enabled), > + MMUMETHOD(mmu_object_init_pt, mmu_radix_object_init_pt), > + MMUMETHOD(mmu_protect, mmu_radix_protect), > + /* pmap dispatcher interface */ > + MMUMETHOD(mmu_clear_modify, mmu_radix_clear_modify), > + MMUMETHOD(mmu_copy, mmu_radix_copy), > + MMUMETHOD(mmu_enter, mmu_radix_enter), > + MMUMETHOD(mmu_enter_object, mmu_radix_enter_object), > + MMUMETHOD(mmu_enter_quick, mmu_radix_enter_quick), > + MMUMETHOD(mmu_extract, mmu_radix_extract), > + MMUMETHOD(mmu_extract_and_hold, mmu_radix_extract_and_hold), > + MMUMETHOD(mmu_is_modified, mmu_radix_is_modified), > + MMUMETHOD(mmu_is_prefaultable, mmu_radix_is_prefaultable), > + MMUMETHOD(mmu_is_referenced, mmu_radix_is_referenced), > + MMUMETHOD(mmu_ts_referenced, mmu_radix_ts_referenced), > + MMUMETHOD(mmu_page_exists_quick,mmu_radix_page_exists_quick), > + MMUMETHOD(mmu_page_init, mmu_radix_page_init), > + MMUMETHOD(mmu_page_wired_mappings, mmu_radix_page_wired_mappings), > + MMUMETHOD(mmu_qenter, mmu_radix_qenter), > + MMUMETHOD(mmu_qremove, mmu_radix_qremove), > + MMUMETHOD(mmu_release, mmu_radix_release), > + MMUMETHOD(mmu_remove, mmu_radix_remove), > + MMUMETHOD(mmu_remove_all, mmu_radix_remove_all), > + MMUMETHOD(mmu_remove_write, mmu_radix_remove_write), > + MMUMETHOD(mmu_unwire, mmu_radix_unwire), > + MMUMETHOD(mmu_zero_page, mmu_radix_zero_page), > + MMUMETHOD(mmu_zero_page_area, mmu_radix_zero_page_area), > + MMUMETHOD(mmu_activate, mmu_radix_activate), > + MMUMETHOD(mmu_quick_enter_page, mmu_radix_quick_enter_page), > + MMUMETHOD(mmu_quick_remove_page, mmu_radix_quick_remove_page), > + MMUMETHOD(mmu_page_set_memattr, mmu_radix_page_set_memattr), > + MMUMETHOD(mmu_page_array_startup, mmu_radix_page_array_startup), > + > + /* Internal interfaces */ > + MMUMETHOD(mmu_kenter, mmu_radix_kenter), > + MMUMETHOD(mmu_kextract, mmu_radix_kextract), > + MMUMETHOD(mmu_kremove, mmu_radix_kremove), > + MMUMETHOD(mmu_change_attr, mmu_radix_change_attr), > + MMUMETHOD(mmu_map_user_ptr, mmu_radix_map_user_ptr), > + MMUMETHOD(mmu_decode_kernel_ptr, mmu_radix_decode_kernel_ptr), > + { 0, 0 } > +}; > + > +MMU_DEF(mmu_radix, MMU_TYPE_RADIX, mmu_radix_methods, 0); > + > +#define METHODVOID(m) mmu_radix_ ## m(mmu_t mmup) > + > +static boolean_t pmap_demote_l3e_locked(pmap_t pmap, pml3_entry_t *l3e, vm_offset_t va, > + struct rwlock **lockp); > +static boolean_t pmap_demote_l3e(pmap_t pmap, pml3_entry_t *pde, vm_offset_t va); > +static int pmap_unuse_pt(pmap_t, vm_offset_t, pml3_entry_t, struct spglist *); > +static int pmap_remove_l3e(pmap_t pmap, pml3_entry_t *pdq, vm_offset_t sva, > + struct spglist *free, struct rwlock **lockp); > +static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva, > + pml3_entry_t ptepde, struct spglist *free, struct rwlock **lockp); > +static vm_page_t pmap_remove_pt_page(pmap_t pmap, vm_offset_t va); > +static bool pmap_remove_page(pmap_t pmap, vm_offset_t va, pml3_entry_t *pde, > + struct spglist *free); > +static bool pmap_remove_ptes(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, > + pml3_entry_t *l3e, struct spglist *free, struct rwlock **lockp); > + > +static bool pmap_pv_insert_l3e(pmap_t pmap, vm_offset_t va, pml3_entry_t l3e, > + u_int flags, struct rwlock **lockp); > +#if VM_NRESERVLEVEL > 0 > +static void pmap_pv_promote_l3e(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, > + struct rwlock **lockp); > +#endif > +static void pmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_offset_t va); > +static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); > +static vm_page_t mmu_radix_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, > + vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp, bool *invalidate); > + > +static bool pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, > + vm_prot_t prot, struct rwlock **lockp); > +static int pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry_t newpde, > + u_int flags, vm_page_t m, struct rwlock **lockp); > + > +static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp); > +static void free_pv_chunk(struct pv_chunk *pc); > +static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp); > +static vm_page_t pmap_allocl3e(pmap_t pmap, vm_offset_t va, > + struct rwlock **lockp); > +static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, > + struct rwlock **lockp); > +static void _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, > + struct spglist *free); > +static boolean_t pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free); > + > +static void pmap_invalidate_page(pmap_t pmap, vm_offset_t start); > +static void pmap_invalidate_all(pmap_t pmap); > +static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode, bool flush); > + > +/* > + * Internal flags for pmap_enter()'s helper functions. > + */ > +#define PMAP_ENTER_NORECLAIM 0x1000000 /* Don't reclaim PV entries. */ > +#define PMAP_ENTER_NOREPLACE 0x2000000 /* Don't replace mappings. */ > + > +#define UNIMPLEMENTED() panic("%s not implemented", __func__) > +#define UNTESTED() panic("%s not yet tested", __func__) > + > + > + > +/* Number of supported PID bits */ > +static unsigned int isa3_pid_bits; > + > +/* PID to start allocating from */ > +static unsigned int isa3_base_pid; > + > +#define PROCTAB_SIZE_SHIFT (isa3_pid_bits + 4) > +#define PROCTAB_ENTRIES (1ul << isa3_pid_bits) > + > + > +/* > + * Map of physical memory regions. > + */ > +static struct mem_region *regions, *pregions; > +static struct numa_mem_region *numa_pregions; > +static u_int phys_avail_count; > +static int regions_sz, pregions_sz, numa_pregions_sz; > +static struct pate *isa3_parttab; > +static struct prte *isa3_proctab; > +static vmem_t *asid_arena; > + > +extern void bs_remap_earlyboot(void); > + > +#define RADIX_PGD_SIZE_SHIFT 16 > +#define RADIX_PGD_SIZE (1UL << RADIX_PGD_SIZE_SHIFT) > + > +#define RADIX_PGD_INDEX_SHIFT (RADIX_PGD_SIZE_SHIFT-3) > +#define NL2EPG (PAGE_SIZE/sizeof(pml2_entry_t)) > +#define NL3EPG (PAGE_SIZE/sizeof(pml3_entry_t)) > + > +#define NUPML1E (RADIX_PGD_SIZE/sizeof(uint64_t)) /* number of userland PML1 pages */ > +#define NUPDPE (NUPML1E * NL2EPG)/* number of userland PDP pages */ > +#define NUPDE (NUPDPE * NL3EPG) /* number of userland PD entries */ > + > +/* POWER9 only permits a 64k partition table size. */ > +#define PARTTAB_SIZE_SHIFT 16 > +#define PARTTAB_SIZE (1UL << PARTTAB_SIZE_SHIFT) > + > +#define PARTTAB_HR (1UL << 63) /* host uses radix */ > +#define PARTTAB_GR (1UL << 63) /* guest uses radix must match host */ > + > +/* TLB flush actions. Used as argument to tlbiel_all() */ > +enum { > + TLB_INVAL_SCOPE_LPID = 0, /* invalidate TLBs for current LPID */ > + TLB_INVAL_SCOPE_GLOBAL = 1, /* invalidate all TLBs */ > +}; > + > +#define NPV_LIST_LOCKS MAXCPU > +static int pmap_initialized; > +static vm_paddr_t proctab0pa; > +static vm_paddr_t parttab_phys; > +CTASSERT(sizeof(struct pv_chunk) == PAGE_SIZE); > + > +/* > + * Data for the pv entry allocation mechanism. > + * Updates to pv_invl_gen are protected by the pv_list_locks[] > + * elements, but reads are not. > + */ > +static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks); > +static struct mtx __exclusive_cache_line pv_chunks_mutex; > +static struct rwlock __exclusive_cache_line pv_list_locks[NPV_LIST_LOCKS]; > +static struct md_page *pv_table; > +static struct md_page pv_dummy; > + > +#ifdef PV_STATS > +#define PV_STAT(x) do { x ; } while (0) > +#else > +#define PV_STAT(x) do { } while (0) > +#endif > + > +#define pa_radix_index(pa) ((pa) >> L3_PAGE_SIZE_SHIFT) > +#define pa_to_pvh(pa) (&pv_table[pa_radix_index(pa)]) > + > +#define PHYS_TO_PV_LIST_LOCK(pa) \ > + (&pv_list_locks[pa_radix_index(pa) % NPV_LIST_LOCKS]) > + > +#define CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa) do { \ > + struct rwlock **_lockp = (lockp); \ > + struct rwlock *_new_lock; \ > + \ > + _new_lock = PHYS_TO_PV_LIST_LOCK(pa); \ > + if (_new_lock != *_lockp) { \ > + if (*_lockp != NULL) \ > + rw_wunlock(*_lockp); \ > + *_lockp = _new_lock; \ > + rw_wlock(*_lockp); \ > + } \ > +} while (0) > + > +#define CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m) \ > + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, VM_PAGE_TO_PHYS(m)) > + > +#define RELEASE_PV_LIST_LOCK(lockp) do { \ > + struct rwlock **_lockp = (lockp); \ > + \ > + if (*_lockp != NULL) { \ > + rw_wunlock(*_lockp); \ > + *_lockp = NULL; \ > + } \ > +} while (0) > + > +#define VM_PAGE_TO_PV_LIST_LOCK(m) \ > + PHYS_TO_PV_LIST_LOCK(VM_PAGE_TO_PHYS(m)) > + > +/* > + * We support 52 bits, hence: > + * bits 52 - 31 = 21, 0b10101 > + * RTS encoding details > + * bits 0 - 3 of rts -> bits 6 - 8 unsigned long > + * bits 4 - 5 of rts -> bits 62 - 63 of unsigned long > + */ > +#define RTS_SIZE ((0x2UL << 61) | (0x5UL << 5)) > + > + > +static int powernv_enabled = 1; > + > +static inline void > +tlbiel_radix_set_isa300(uint32_t set, uint32_t is, > + uint32_t pid, uint32_t ric, uint32_t prs) > +{ > + uint64_t rb; > + uint64_t rs; > + > + rb = PPC_BITLSHIFT_VAL(set, 51) | PPC_BITLSHIFT_VAL(is, 53); > + rs = PPC_BITLSHIFT_VAL((uint64_t)pid, 31); > + > + __asm __volatile(PPC_TLBIEL(%0, %1, %2, %3, 1) > + : : "r"(rb), "r"(rs), "i"(ric), "i"(prs) > + : "memory"); > +} > + > +static void > +tlbiel_flush_isa3(uint32_t num_sets, uint32_t is) > +{ > + uint32_t set; > + > + __asm __volatile("ptesync": : :"memory"); > + > + /* > + * Flush the first set of the TLB, and the entire Page Walk Cache > + * and partition table entries. Then flush the remaining sets of the > + * TLB. > + */ > + tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 0); > + for (set = 1; set < num_sets; set++) > + tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, 0); > + > + /* Do the same for process scoped entries. */ > + tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 1); > + for (set = 1; set < num_sets; set++) > + tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, 1); > + > + __asm __volatile("ptesync": : :"memory"); > +} > + > +static void > +mmu_radix_tlbiel_flush(int scope) > +{ > + int is; > + > + MPASS(scope == TLB_INVAL_SCOPE_LPID || > + scope == TLB_INVAL_SCOPE_GLOBAL); > + is = scope + 2; > + > + tlbiel_flush_isa3(POWER9_TLB_SETS_RADIX, is); > + __asm __volatile(PPC_INVALIDATE_ERAT "; isync" : : :"memory"); > +} > + > +static void > +mmu_radix_init_amor(void) > +{ > + /* > + * In HV mode, we init AMOR (Authority Mask Override Register) so that > + * the hypervisor and guest can setup IAMR (Instruction Authority Mask > + * Register), enable key 0 and set it to 1. > + * > + * AMOR = 0b1100 .... 0000 (Mask for key 0 is 11) > + */ > + mtspr(SPR_AMOR, (3ul << 62)); > +} > + > +static void > +mmu_radix_init_iamr(void) > +{ > + /* > + * Radix always uses key0 of the IAMR to determine if an access is > + * allowed. We set bit 0 (IBM bit 1) of key0, to prevent instruction > + * fetch. > + */ > + mtspr(SPR_IAMR, (1ul << 62)); > +} > + > +static void > +mmu_radix_pid_set(pmap_t pmap) > +{ > + > + mtspr(SPR_PID, pmap->pm_pid); > + isync(); > +} > + > +/* Quick sort callout for comparing physical addresses. */ > +static int > +pa_cmp(const void *a, const void *b) > +{ > + const vm_paddr_t *pa = a, *pb = b; > + > + if (*pa < *pb) > + return (-1); > + else if (*pa > *pb) > + return (1); > + else > + return (0); > +} > + > +#define pte_load_store(ptep, pte) atomic_swap_long(ptep, pte) > +#define pte_load_clear(ptep) atomic_swap_long(ptep, 0) > +#define pte_store(ptep, pte) do { \ > + MPASS((pte) & (RPTE_EAA_R | RPTE_EAA_W | RPTE_EAA_X)); \ > + *(u_long *)(ptep) = (u_long)((pte) | PG_V | RPTE_LEAF); \ > +} while (0) > +/* > + * NB: should only be used for adding directories - not for direct mappings > + */ > +#define pde_store(ptep, pa) do { \ > + *(u_long *)(ptep) = (u_long)(pa|RPTE_VALID|RPTE_SHIFT); \ > +} while (0) > + > +#define pte_clear(ptep) do { \ > + *(u_long *)(ptep) = (u_long)(0); \ > +} while (0) > + > +#define PMAP_PDE_SUPERPAGE (1 << 8) /* supports 2MB superpages */ > + > +/* > + * Promotion to a 2MB (PDE) page mapping requires that the corresponding 4KB > + * (PTE) page mappings have identical settings for the following fields: > + */ > +#define PG_PTE_PROMOTE (PG_X | PG_MANAGED | PG_W | PG_PTE_CACHE | \ > + PG_M | PG_A | RPTE_EAA_MASK | PG_V) > + > + > +static void > +pmap_epoch_init(void *arg __unused) > +{ > + pmap_epoch = epoch_alloc("pmap", EPOCH_PREEMPT | EPOCH_LOCKED); > +} > +SYSINIT(epoch, SI_SUB_EPOCH + 1, SI_ORDER_ANY, pmap_epoch_init, NULL); > + > +static bool > +pmap_not_in_di(void) > +{ > + > + return (curthread->td_md.md_invl_gen.gen == 0); > +} > + > +#define PMAP_ASSERT_NOT_IN_DI() \ > + KASSERT(pmap_not_in_di(), ("DI already started")) > + > +static void > +pmap_delayed_invl_started(epoch_tracker_t et) > +{ > + epoch_enter_preempt(pmap_epoch, et); > + curthread->td_md.md_invl_gen.gen = 1; > +} > + > +static void > +pmap_delayed_invl_finished(epoch_tracker_t et) > +{ > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Mon May 11 20:52:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B33222EBE13; Mon, 11 May 2020 20:52:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LY5w4Mb9z47yl; Mon, 11 May 2020 20:52:20 +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 911302479D; Mon, 11 May 2020 20:52:20 +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 04BKqKIt022258; Mon, 11 May 2020 20:52:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKqJXv020744; Mon, 11 May 2020 20:52:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112052.04BKqJXv020744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 20:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360923 - in head: share/man/man9 sys/conf sys/modules/crypto sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man9 sys/conf sys/modules/crypto sys/opencrypto X-SVN-Commit-Revision: 360923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:52:20 -0000 Author: jhb Date: Mon May 11 20:52:18 2020 New Revision: 360923 URL: https://svnweb.freebsd.org/changeset/base/360923 Log: Remove support for the cast128 encryption algorithm. It no longer has any in-tree consumers. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24768 Deleted: head/sys/opencrypto/cast.c head/sys/opencrypto/cast.h head/sys/opencrypto/castsb.h head/sys/opencrypto/xform_cast5.c Modified: head/share/man/man9/crypto.9 head/sys/conf/files head/sys/modules/crypto/Makefile head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 20:41:27 2020 (r360922) +++ head/share/man/man9/crypto.9 Mon May 11 20:52:18 2020 (r360923) @@ -134,7 +134,6 @@ The following encryption algorithms are supported: .It Dv CRYPTO_ARC4 .It Dv CRYPTO_BLF_CBC .It Dv CRYPTO_CAMELLIA_CBC -.It Dv CRYPTO_CAST_CBC .It Dv CRYPTO_CHACHA20 .It Dv CRYPTO_DES_CBC .It Dv CRYPTO_3DES_CBC Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 11 20:41:27 2020 (r360922) +++ head/sys/conf/files Mon May 11 20:52:18 2020 (r360923) @@ -4797,7 +4797,6 @@ dev/mlx5/mlx5_en/mlx5_en_port_buffer.c optional mlx5e compile-with "${OFED_C}" # crypto support -opencrypto/cast.c optional crypto | ipsec | ipsec_support opencrypto/criov.c optional crypto | ipsec | ipsec_support opencrypto/crypto.c optional crypto | ipsec | ipsec_support opencrypto/cryptodev.c optional cryptodev Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Mon May 11 20:41:27 2020 (r360922) +++ head/sys/modules/crypto/Makefile Mon May 11 20:52:18 2020 (r360923) @@ -22,7 +22,7 @@ LIBSODIUM=${SRCTOP}/sys/contrib/libsodium/src/libsodiu KMOD = crypto SRCS = crypto.c cryptodev_if.c SRCS += criov.c cryptosoft.c xform.c -SRCS += cast.c cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c +SRCS += cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c SRCS += skipjack.c bf_enc.c bf_ecb.c bf_skey.c SRCS += camellia.c camellia-api.c SRCS += des_ecb.c des_enc.c des_setkey.c Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon May 11 20:41:27 2020 (r360922) +++ head/sys/opencrypto/crypto.c Mon May 11 20:52:18 2020 (r360923) @@ -604,8 +604,6 @@ crypto_cipher(const struct crypto_session_params *csp) return (&enc_xform_3des); case CRYPTO_BLF_CBC: return (&enc_xform_blf); - case CRYPTO_CAST_CBC: - return (&enc_xform_cast5); case CRYPTO_SKIPJACK_CBC: return (&enc_xform_skipjack); case CRYPTO_RIJNDAEL128_CBC: @@ -691,7 +689,6 @@ static enum alg_type { [CRYPTO_DES_CBC] = ALG_CIPHER, [CRYPTO_3DES_CBC] = ALG_CIPHER, [CRYPTO_BLF_CBC] = ALG_CIPHER, - [CRYPTO_CAST_CBC] = ALG_CIPHER, [CRYPTO_SKIPJACK_CBC] = ALG_CIPHER, [CRYPTO_MD5_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST, Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Mon May 11 20:41:27 2020 (r360922) +++ head/sys/opencrypto/cryptodev.h Mon May 11 20:52:18 2020 (r360923) @@ -119,7 +119,6 @@ #define DES3_BLOCK_LEN 8 #define BLOWFISH_BLOCK_LEN 8 #define SKIPJACK_BLOCK_LEN 8 -#define CAST128_BLOCK_LEN 8 #define RIJNDAEL128_BLOCK_LEN 16 #define AES_BLOCK_LEN 16 #define AES_ICM_BLOCK_LEN 1 @@ -145,8 +144,6 @@ #define TRIPLE_DES_MAX_KEY TRIPLE_DES_MIN_KEY #define BLOWFISH_MIN_KEY 5 #define BLOWFISH_MAX_KEY 56 /* 448 bits, max key */ -#define CAST_MIN_KEY 5 -#define CAST_MAX_KEY 16 #define SKIPJACK_MIN_KEY 10 #define SKIPJACK_MAX_KEY SKIPJACK_MIN_KEY #define RIJNDAEL_MIN_KEY 16 Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Mon May 11 20:41:27 2020 (r360922) +++ head/sys/opencrypto/cryptosoft.c Mon May 11 20:52:18 2020 (r360923) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/opencrypto/xform.c ============================================================================== --- head/sys/opencrypto/xform.c Mon May 11 20:41:27 2020 (r360922) +++ head/sys/opencrypto/xform.c Mon May 11 20:52:18 2020 (r360923) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -94,7 +93,6 @@ struct enc_xform enc_xform_arc4 = { #include "xform_des1.c" #include "xform_des3.c" #include "xform_blf.c" -#include "xform_cast5.c" #include "xform_skipjack.c" #include "xform_rijndael.c" #include "xform_aes_icm.c" Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Mon May 11 20:41:27 2020 (r360922) +++ head/sys/opencrypto/xform_enc.h Mon May 11 20:52:18 2020 (r360923) @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -74,7 +73,6 @@ extern struct enc_xform enc_xform_null; extern struct enc_xform enc_xform_des; extern struct enc_xform enc_xform_3des; extern struct enc_xform enc_xform_blf; -extern struct enc_xform enc_xform_cast5; extern struct enc_xform enc_xform_skipjack; extern struct enc_xform enc_xform_rijndael128; extern struct enc_xform enc_xform_aes_icm; From owner-svn-src-head@freebsd.org Mon May 11 20:53:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDD432EBEA6; Mon, 11 May 2020 20:53:15 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LY6z1P4Gz488m; Mon, 11 May 2020 20:53:15 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-qt1-x842.google.com with SMTP id j2so8979105qtr.12; Mon, 11 May 2020 13:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SUjCHLgQgqVdREWizdR8DVZDyL2u7APRfvftlb7Cygk=; b=XugszPjA8W95YdgFu3fxNW490nfmn7dYTItb6gyARWTKymgwCPyNSYZf9N8eK56tyU Q1Mtz/vYbA/jAZ3WjVu4WTN4XiUeXvJUGGxU/v5QQ2RgFdn/z7th9pa1v9KDidlp7xW8 lHjNspPMMQ8uqV/HtJFqT/6bX4JQ2JZuKuirLrR/LWK9G2dqzB1DpBKObvgx2D2tswIw /tOKhy8aIGxABCtn//YmtngcbAT4Rlr/InYxy9BeJav1JSDhbP4tcirBXg8lPLR+tu/S ckqGCKWIU49FhOnX/hHNkTNMU8MFp6IABtyEzpmF9XOFvTuVM4RH+J01m7oXIR9R6jqV Il+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=SUjCHLgQgqVdREWizdR8DVZDyL2u7APRfvftlb7Cygk=; b=BpD/TodCekt4WNo/86vnBz2L4YMhGHjsyOLDE6yq45pDWu8PE/a4DwQPe7X8xsfsLC k5zlVfRt2N7hnG75poFqeSGH5kSlzkcBXDd2iBT14i8OBIQdwi4lUnAYkTSRwxR3A401 IiIkSmpHzSmpmwS2zQATbR28UU3ZKJm2SDrwrW/TRTkjWJXox48UTNaZ1rsiisxZdDVl aVC5Xdh4aIXs4aa1qgaYzY2HHyTRbTwJGZuUwdSwisx2sradRwAjwwBuJ33dvdKKLVWS rRWe1vamB/ie+qLXvgtCi4juU9kgVOR/vgfzZbeVFy2I+UU2TKFH3ss73fgqqQ/TK379 zteQ== X-Gm-Message-State: AGi0PuYdxDuIqqlralSeHJnYVTSTA7oMz4FUGqfGQdZG93Znc/P0778B mgbE0C6UW0vPuuQw3e5k4lWLCcUaEL4= X-Google-Smtp-Source: APiQypIdtgx7RS7FGxuHi2ctAoxjKm7TfRn9p58KtQteQq/KUXcPrpgKzL2lMoemYuTkWCaaAf489w== X-Received: by 2002:ac8:3252:: with SMTP id y18mr17018174qta.131.1589230393919; Mon, 11 May 2020 13:53:13 -0700 (PDT) Received: from titan.knownspace (173-19-125-130.client.mchsi.com. [173.19.125.130]) by smtp.gmail.com with ESMTPSA id s56sm2595506qtk.45.2020.05.11.13.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2020 13:53:13 -0700 (PDT) Sender: Justin Hibbits Date: Mon, 11 May 2020 15:53:10 -0500 From: Justin Hibbits To: Kevin Bowling Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360887 - in head/sys: conf powerpc/aim powerpc/booke powerpc/include powerpc/powerpc vm Message-ID: <20200511155310.08c2f1cf@titan.knownspace> In-Reply-To: References: <202005110233.04B2XcpD033576@repo.freebsd.org> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; powerpc64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49LY6z1P4Gz488m X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=XugszPjA; dmarc=none; spf=pass (mx1.freebsd.org: domain of chmeeedalf@gmail.com designates 2607:f8b0:4864:20::842 as permitted sender) smtp.mailfrom=chmeeedalf@gmail.com X-Spamd-Result: default: False [-2.35 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.16)[ip: (0.02), ipnet: 2607:f8b0::/32(-0.33), asn: 15169(-0.43), country: US(-0.05)]; FORGED_SENDER(0.30)[jhibbits@freebsd.org,chmeeedalf@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[130.125.19.173.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[jhibbits@freebsd.org,chmeeedalf@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:53:15 -0000 On Mon, 11 May 2020 13:43:58 -0700 Kevin Bowling wrote: > Were there any major changes you can summarize from the P9BSD > integration, and any TODO list (perhaps wiki for this question)? The committed version lacks minidumps, which luporl@ had implemented in OEA64 a few months ago, so I still have to pull that in. Also, Radix pmap is currently disabled by default, enabled with 'radix_mmu=1' boot arg, because it's extremely unstable in anything but the most mundane cases (can pass buildworld, but a lot of ports trigger machine checks), so that all needs fixed. The rest of the TODO list from POWER9BSD consists of: * IFUNCify pmap and its ancillary functions (copy*()) * Bring in the soft-interrupt-disable feature Someone (Alfredo?) is working on IFUNCifying pmap, but nobody's yet done the soft interrupt disabling. I have a patch to implement it, but last time I tested it, it fell over quite quickly, so I must've missed something. I think that's it. - Justin > > On Sun, May 10, 2020 at 7:33 PM Justin Hibbits > wrote: > > > > Author: jhibbits > > Date: Mon May 11 02:33:37 2020 > > New Revision: 360887 > > URL: https://svnweb.freebsd.org/changeset/base/360887 > > > > Log: > > powerpc64: Implement Radix MMU for POWER9 CPUs > > > > Summary: > > POWER9 supports two MMU formats: traditional hashed page tables, > > and Radix page tables, similar to what's presesnt on most other > > architectures. The PowerISA also specifies a process table -- a > > table of page table pointers-- which on the POWER9 is only > > available with the Radix MMU, so we can take advantage of it with > > the Radix MMU driver. > > > > Written by Matt Macy. > > > > Differential Revision: https://reviews.freebsd.org/D19516 > > > > Added: > > head/sys/powerpc/aim/mmu_radix.c (contents, props changed) > > Modified: > > head/sys/conf/files.powerpc > > head/sys/powerpc/aim/aim_machdep.c > > head/sys/powerpc/aim/mmu_oea.c > > head/sys/powerpc/aim/mmu_oea64.c > > head/sys/powerpc/booke/pmap.c > > head/sys/powerpc/include/cpufunc.h > > head/sys/powerpc/include/mmuvar.h > > head/sys/powerpc/include/param.h > > head/sys/powerpc/include/pmap.h > > head/sys/powerpc/include/proc.h > > head/sys/powerpc/include/pte.h > > head/sys/powerpc/include/spr.h > > head/sys/powerpc/include/sr.h > > head/sys/powerpc/include/vmparam.h > > head/sys/powerpc/powerpc/machdep.c > > head/sys/powerpc/powerpc/mmu_if.m > > head/sys/powerpc/powerpc/pmap_dispatch.c > > head/sys/powerpc/powerpc/trap.c > > head/sys/vm/vm_fault.c > > > > Modified: head/sys/conf/files.powerpc > > ============================================================================== > > --- head/sys/conf/files.powerpc Mon May 11 01:20:40 2020 > > (r360886) +++ head/sys/conf/files.powerpc Mon May 11 02:33:37 2020 > > (r360887) @@ -135,6 +135,7 @@ powerpc/aim/locore.S > > optional aim no-obj powerpc/aim/aim_machdep.c > > optional aim powerpc/aim/mmu_oea.c optional > > aim powerpc powerpc/aim/mmu_oea64.c optional > > aim +powerpc/aim/mmu_radix.c optional aim > > powerpc64 powerpc/aim/moea64_if.m optional aim > > powerpc/aim/moea64_native.c optional aim > > powerpc/aim/mp_cpudep.c optional aim > > > > Modified: head/sys/powerpc/aim/aim_machdep.c > > ============================================================================== > > --- head/sys/powerpc/aim/aim_machdep.c Mon May 11 01:20:40 2020 > > (r360886) +++ head/sys/powerpc/aim/aim_machdep.c Mon May 11 > > 02:33:37 2020 (r360887) @@ -136,6 +136,8 @@ > > __FBSDID("$FreeBSD$"); struct bat battable[16]; > > #endif > > > > +int radix_mmu = 0; > > + > > #ifndef __powerpc64__ > > /* Bits for running on 64-bit systems in 32-bit mode. */ > > extern void *testppc64, *testppc64size; > > @@ -451,7 +453,14 @@ aim_cpu_init(vm_offset_t toc) > > * in case the platform module had a better idea of what we > > * should do. > > */ > > - if (cpu_features & PPC_FEATURE_64) > > + if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { > > + radix_mmu = 0; > > + TUNABLE_INT_FETCH("radix_mmu", &radix_mmu); > > + if (radix_mmu) > > + pmap_mmu_install(MMU_TYPE_RADIX, > > BUS_PROBE_GENERIC); > > + else > > + pmap_mmu_install(MMU_TYPE_G5, > > BUS_PROBE_GENERIC); > > + } else if (cpu_features & PPC_FEATURE_64) > > pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); > > else > > pmap_mmu_install(MMU_TYPE_OEA, BUS_PROBE_GENERIC); > > > > Modified: head/sys/powerpc/aim/mmu_oea.c > > ============================================================================== > > --- head/sys/powerpc/aim/mmu_oea.c Mon May 11 01:20:40 2020 > > (r360886) +++ head/sys/powerpc/aim/mmu_oea.c Mon May 11 > > 02:33:37 2020 (r360887) @@ -322,6 +322,7 @@ void > > moea_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t void > > moea_scan_init(mmu_t mmu); vm_offset_t moea_quick_enter_page(mmu_t > > mmu, vm_page_t m); void moea_quick_remove_page(mmu_t mmu, > > vm_offset_t addr); +boolean_t moea_page_is_mapped(mmu_t mmu, > > vm_page_t m); static int moea_map_user_ptr(mmu_t mmu, pmap_t pm, > > volatile const void *uaddr, void **kaddr, size_t ulen, size_t > > *klen); static int moea_decode_kernel_ptr(mmu_t mmu, vm_offset_t > > addr, @@ -364,6 +365,7 @@ static mmu_method_t moea_methods[] = { > > MMUMETHOD(mmu_page_set_memattr, moea_page_set_memattr), > > MMUMETHOD(mmu_quick_enter_page, moea_quick_enter_page), > > MMUMETHOD(mmu_quick_remove_page, moea_quick_remove_page), > > + MMUMETHOD(mmu_page_is_mapped, moea_page_is_mapped), > > > > /* Internal interfaces */ > > MMUMETHOD(mmu_bootstrap, moea_bootstrap), > > @@ -1102,6 +1104,12 @@ moea_quick_enter_page(mmu_t mmu, vm_page_t m) > > void > > moea_quick_remove_page(mmu_t mmu, vm_offset_t addr) > > { > > +} > > + > > +boolean_t > > +moea_page_is_mapped(mmu_t mmu, vm_page_t m) > > +{ > > + return (!LIST_EMPTY(&(m)->md.mdpg_pvoh)); > > } > > > > /* > > > > Modified: head/sys/powerpc/aim/mmu_oea64.c > > ============================================================================== > > --- head/sys/powerpc/aim/mmu_oea64.c Mon May 11 01:20:40 2020 > > (r360886) +++ head/sys/powerpc/aim/mmu_oea64.c Mon May 11 > > 02:33:37 2020 (r360887) @@ -120,8 +120,7 @@ uintptr_t > > moea64_get_unique_vsid(void); * > > */ > > > > -#define PV_LOCK_PER_DOM (PA_LOCK_COUNT * 3) > > -#define PV_LOCK_COUNT (PV_LOCK_PER_DOM * MAXMEMDOM) > > +#define PV_LOCK_COUNT PA_LOCK_COUNT > > static struct mtx_padalign pv_lock[PV_LOCK_COUNT]; > > > > /* > > @@ -130,8 +129,7 @@ static struct mtx_padalign > > pv_lock[PV_LOCK_COUNT]; > > * index at (N << 45). > > */ > > #ifdef __powerpc64__ > > -#define PV_LOCK_IDX(pa) (pa_index(pa) % PV_LOCK_PER_DOM + \ > > - (((pa) >> 45) % MAXMEMDOM) * > > PV_LOCK_PER_DOM) +#define PV_LOCK_IDX(pa) ((pa_index(pa) * > > (((pa) >> 45) + 1)) % PV_LOCK_COUNT) #else > > #define PV_LOCK_IDX(pa) (pa_index(pa) % PV_LOCK_COUNT) > > #endif > > @@ -305,6 +303,7 @@ void moea64_dumpsys_map(mmu_t mmu, vm_paddr_t > > pa, size void moea64_scan_init(mmu_t mmu); > > vm_offset_t moea64_quick_enter_page(mmu_t mmu, vm_page_t m); > > void moea64_quick_remove_page(mmu_t mmu, vm_offset_t addr); > > +boolean_t moea64_page_is_mapped(mmu_t mmu, vm_page_t m); > > static int moea64_map_user_ptr(mmu_t mmu, pmap_t pm, > > volatile const void *uaddr, void **kaddr, size_t ulen, size_t > > *klen); static int moea64_decode_kernel_ptr(mmu_t mmu, vm_offset_t > > addr, @@ -353,6 +352,7 @@ static mmu_method_t moea64_methods[] = { > > MMUMETHOD(mmu_page_set_memattr, moea64_page_set_memattr), > > MMUMETHOD(mmu_quick_enter_page, moea64_quick_enter_page), > > MMUMETHOD(mmu_quick_remove_page, moea64_quick_remove_page), > > + MMUMETHOD(mmu_page_is_mapped, moea64_page_is_mapped), > > #ifdef __powerpc64__ > > MMUMETHOD(mmu_page_array_startup, > > moea64_page_array_startup), #endif > > @@ -1423,6 +1423,12 @@ moea64_quick_remove_page(mmu_t mmu, > > vm_offset_t addr) ("moea64_quick_remove_page: invalid address")); > > mtx_unlock(PCPU_PTR(aim.qmap_lock)); > > sched_unpin(); > > +} > > + > > +boolean_t > > +moea64_page_is_mapped(mmu_t mmu, vm_page_t m) > > +{ > > + return (!LIST_EMPTY(&(m)->md.mdpg_pvoh)); > > } > > > > /* > > > > Added: head/sys/powerpc/aim/mmu_radix.c > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/powerpc/aim/mmu_radix.c Mon May 11 02:33:37 2020 > > (r360887) @@ -0,0 +1,6507 @@ > > +/*- > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > + * > > + * Copyright (c) 2018 Matthew Macy > > + * > > + * Redistribution and use in source and binary forms, with or > > without > > + * modification, are permitted provided that the following > > conditions > > + * are met: > > + * > > + * 1. Redistributions of source code must retain the above > > copyright > > + * notice, this list of conditions and the following disclaimer. > > + * 2. Redistributions in binary form must reproduce the above > > copyright > > + * notice, this list of conditions and the following disclaimer > > in the > > + * documentation and/or other materials provided with the > > distribution. > > + * > > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY > > EXPRESS OR > > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED > > WARRANTIES > > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE > > DISCLAIMED. > > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES > > (INCLUDING, BUT > > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; > > LOSS OF USE, > > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND > > ON ANY > > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR > > TORT > > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF > > THE USE OF > > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH > > DAMAGE. > > + */ > > + > > + > > +#include > > +__FBSDID("$FreeBSD$"); > > + > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > + > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#ifdef INVARIANTS > > +#include > > +#endif > > + > > +#define PPC_BITLSHIFT(bit) (sizeof(long)*NBBY - 1 - (bit)) > > +#define PPC_BIT(bit) (1UL << PPC_BITLSHIFT(bit)) > > +#define PPC_BITLSHIFT_VAL(val, bit) ((val) << PPC_BITLSHIFT(bit)) > > + > > +#include "opt_ddb.h" > > +#ifdef DDB > > +static void pmap_pte_walk(pml1_entry_t *l1, vm_offset_t va); > > +#endif > > + > > +#define PG_W RPTE_WIRED > > +#define PG_V RPTE_VALID > > +#define PG_MANAGED RPTE_MANAGED > > +#define PG_PROMOTED RPTE_PROMOTED > > +#define PG_M RPTE_C > > +#define PG_A RPTE_R > > +#define PG_X RPTE_EAA_X > > +#define PG_RW RPTE_EAA_W > > +#define PG_PTE_CACHE RPTE_ATTR_MASK > > + > > +#define RPTE_SHIFT 9 > > +#define NLS_MASK ((1UL<<5)-1) > > +#define RPTE_ENTRIES (1UL< > +#define RPTE_MASK (RPTE_ENTRIES-1) > > + > > +#define NLB_SHIFT 0 > > +#define NLB_MASK (((1UL<<52)-1) << 8) > > + > > +extern int nkpt; > > +extern caddr_t crashdumpmap; > > + > > +#define RIC_FLUSH_TLB 0 > > +#define RIC_FLUSH_PWC 1 > > +#define RIC_FLUSH_ALL 2 > > + > > +#define POWER9_TLB_SETS_RADIX 128 /* # sets in POWER9 TLB > > Radix mode */ + > > +#define PPC_INST_TLBIE 0x7c000264 > > +#define PPC_INST_TLBIEL 0x7c000224 > > +#define PPC_INST_SLBIA 0x7c0003e4 > > + > > +#define ___PPC_RA(a) (((a) & 0x1f) << 16) > > +#define ___PPC_RB(b) (((b) & 0x1f) << 11) > > +#define ___PPC_RS(s) (((s) & 0x1f) << 21) > > +#define ___PPC_RT(t) ___PPC_RS(t) > > +#define ___PPC_R(r) (((r) & 0x1) << 16) > > +#define ___PPC_PRS(prs) (((prs) & 0x1) << 17) > > +#define ___PPC_RIC(ric) (((ric) & 0x3) << 18) > > + > > +#define PPC_SLBIA(IH) __XSTRING(.long PPC_INST_SLBIA | \ > > + ((IH & 0x7) << 21)) > > +#define PPC_TLBIE_5(rb,rs,ric,prs,r) > > \ > > + __XSTRING(.long PPC_INST_TLBIE | \ > > + ___PPC_RB(rb) | ___PPC_RS(rs) | \ > > + ___PPC_RIC(ric) | ___PPC_PRS(prs) | \ > > + ___PPC_R(r)) > > + > > +#define PPC_TLBIEL(rb,rs,ric,prs,r) \ > > + __XSTRING(.long PPC_INST_TLBIEL | \ > > + ___PPC_RB(rb) | ___PPC_RS(rs) | \ > > + ___PPC_RIC(ric) | ___PPC_PRS(prs) | \ > > + ___PPC_R(r)) > > + > > +#define PPC_INVALIDATE_ERAT PPC_SLBIA(7) > > + > > +static __inline void > > +ttusync(void) > > +{ > > + __asm __volatile("eieio; tlbsync; ptesync" ::: "memory"); > > +} > > + > > +#define TLBIEL_INVAL_SEL_MASK 0xc00 /* invalidation selector */ > > +#define TLBIEL_INVAL_PAGE 0x000 /* invalidate a single page > > */ +#define TLBIEL_INVAL_SET_PID 0x400 /* invalidate a set for > > the current PID */ +#define TLBIEL_INVAL_SET_LPID 0x800 /* > > invalidate a set for current LPID */ +#define TLBIEL_INVAL_SET > > 0xc00 /* invalidate a set for all LPIDs */ + > > +#define TLBIE_ACTUAL_PAGE_MASK 0xe0 > > +#define TLBIE_ACTUAL_PAGE_4K 0x00 > > +#define TLBIE_ACTUAL_PAGE_64K 0xa0 > > +#define TLBIE_ACTUAL_PAGE_2M 0x20 > > +#define TLBIE_ACTUAL_PAGE_1G 0x40 > > + > > +#define TLBIE_PRS_PARTITION_SCOPE 0x0 > > +#define TLBIE_PRS_PROCESS_SCOPE 0x1 > > + > > +#define TLBIE_RIC_INVALIDATE_TLB 0x0 /* Invalidate just > > TLB */ +#define TLBIE_RIC_INVALIDATE_PWC 0x1 /* > > Invalidate just PWC */ +#define TLBIE_RIC_INVALIDATE_ALL 0x2 > > /* Invalidate TLB, PWC, > > + * cached {proc, > > part}tab entries > > + */ > > +#define TLBIE_RIC_INVALIDATE_SEQ 0x3 /* HPT - only: > > + * Invalidate a > > range of translations > > + */ > > + > > +static __inline void > > +radix_tlbie(uint8_t ric, uint8_t prs, uint16_t is, uint32_t pid, > > uint32_t lpid, > > + vm_offset_t va, uint16_t ap) > > +{ > > + uint64_t rb, rs; > > + > > + MPASS((va & PAGE_MASK) == 0); > > + > > + rs = ((uint64_t)pid << 32) | lpid; > > + rb = va | is | ap; > > + __asm __volatile(PPC_TLBIE_5(%0, %1, %2, %3, 1) : : > > + "r" (rb), "r" (rs), "i" (ric), "i" (prs)); > > +} > > + > > +static __inline void > > +radix_tlbie_invlpg_user_4k(uint32_t pid, vm_offset_t va) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_PAGE, pid, 0, va, > > TLBIE_ACTUAL_PAGE_4K); +} > > + > > +static __inline void > > +radix_tlbie_invlpg_user_2m(uint32_t pid, vm_offset_t va) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_PAGE, pid, 0, va, > > TLBIE_ACTUAL_PAGE_2M); +} > > + > > +static __inline void > > +radix_tlbie_invlpwc_user(uint32_t pid) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_PWC, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_SET_PID, pid, 0, 0, 0); > > +} > > + > > +static __inline void > > +radix_tlbie_flush_user(uint32_t pid) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_ALL, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_SET_PID, pid, 0, 0, 0); > > +} > > + > > +static __inline void > > +radix_tlbie_invlpg_kernel_4k(vm_offset_t va) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_PAGE, 0, 0, va, TLBIE_ACTUAL_PAGE_4K); > > +} > > + > > +static __inline void > > +radix_tlbie_invlpg_kernel_2m(vm_offset_t va) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_PAGE, 0, 0, va, TLBIE_ACTUAL_PAGE_2M); > > +} > > + > > +/* 1GB pages aren't currently supported. */ > > +static __inline __unused void > > +radix_tlbie_invlpg_kernel_1g(vm_offset_t va) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_PAGE, 0, 0, va, TLBIE_ACTUAL_PAGE_1G); > > +} > > + > > +static __inline void > > +radix_tlbie_invlpwc_kernel(void) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_PWC, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_SET_LPID, 0, 0, 0, 0); > > +} > > + > > +static __inline void > > +radix_tlbie_flush_kernel(void) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_ALL, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_SET_LPID, 0, 0, 0, 0); > > +} > > + > > +static __inline vm_pindex_t > > +pmap_l3e_pindex(vm_offset_t va) > > +{ > > + return ((va & PG_FRAME) >> L3_PAGE_SIZE_SHIFT); > > +} > > + > > +static __inline vm_pindex_t > > +pmap_pml3e_index(vm_offset_t va) > > +{ > > + > > + return ((va >> L3_PAGE_SIZE_SHIFT) & RPTE_MASK); > > +} > > + > > +static __inline vm_pindex_t > > +pmap_pml2e_index(vm_offset_t va) > > +{ > > + return ((va >> L2_PAGE_SIZE_SHIFT) & RPTE_MASK); > > +} > > + > > +static __inline vm_pindex_t > > +pmap_pml1e_index(vm_offset_t va) > > +{ > > + return ((va & PG_FRAME) >> L1_PAGE_SIZE_SHIFT); > > +} > > + > > +/* Return various clipped indexes for a given VA */ > > +static __inline vm_pindex_t > > +pmap_pte_index(vm_offset_t va) > > +{ > > + > > + return ((va >> PAGE_SHIFT) & RPTE_MASK); > > +} > > + > > +/* Return a pointer to the PT slot that corresponds to a VA */ > > +static __inline pt_entry_t * > > +pmap_l3e_to_pte(pt_entry_t *l3e, vm_offset_t va) > > +{ > > + pt_entry_t *pte; > > + vm_paddr_t ptepa; > > + > > + ptepa = (*l3e & NLB_MASK); > > + pte = (pt_entry_t *)PHYS_TO_DMAP(ptepa); > > + return (&pte[pmap_pte_index(va)]); > > +} > > + > > +/* Return a pointer to the PD slot that corresponds to a VA */ > > +static __inline pt_entry_t * > > +pmap_l2e_to_l3e(pt_entry_t *l2e, vm_offset_t va) > > +{ > > + pt_entry_t *l3e; > > + vm_paddr_t l3pa; > > + > > + l3pa = (*l2e & NLB_MASK); > > + l3e = (pml3_entry_t *)PHYS_TO_DMAP(l3pa); > > + return (&l3e[pmap_pml3e_index(va)]); > > +} > > + > > +/* Return a pointer to the PD slot that corresponds to a VA */ > > +static __inline pt_entry_t * > > +pmap_l1e_to_l2e(pt_entry_t *l1e, vm_offset_t va) > > +{ > > + pt_entry_t *l2e; > > + vm_paddr_t l2pa; > > + > > + l2pa = (*l1e & NLB_MASK); > > + > > + l2e = (pml2_entry_t *)PHYS_TO_DMAP(l2pa); > > + return (&l2e[pmap_pml2e_index(va)]); > > +} > > + > > +static __inline pml1_entry_t * > > +pmap_pml1e(pmap_t pmap, vm_offset_t va) > > +{ > > + > > + return (&pmap->pm_pml1[pmap_pml1e_index(va)]); > > +} > > + > > +static pt_entry_t * > > +pmap_pml2e(pmap_t pmap, vm_offset_t va) > > +{ > > + pt_entry_t *l1e; > > + > > + l1e = pmap_pml1e(pmap, va); > > + if (l1e == NULL || (*l1e & RPTE_VALID) == 0) > > + return (NULL); > > + return (pmap_l1e_to_l2e(l1e, va)); > > +} > > + > > +static __inline pt_entry_t * > > +pmap_pml3e(pmap_t pmap, vm_offset_t va) > > +{ > > + pt_entry_t *l2e; > > + > > + l2e = pmap_pml2e(pmap, va); > > + if (l2e == NULL || (*l2e & RPTE_VALID) == 0) > > + return (NULL); > > + return (pmap_l2e_to_l3e(l2e, va)); > > +} > > + > > +static __inline pt_entry_t * > > +pmap_pte(pmap_t pmap, vm_offset_t va) > > +{ > > + pt_entry_t *l3e; > > + > > + l3e = pmap_pml3e(pmap, va); > > + if (l3e == NULL || (*l3e & RPTE_VALID) == 0) > > + return (NULL); > > + return (pmap_l3e_to_pte(l3e, va)); > > +} > > + > > +int nkpt = 64; > > +SYSCTL_INT(_machdep, OID_AUTO, nkpt, CTLFLAG_RD, &nkpt, 0, > > + "Number of kernel page table pages allocated on bootup"); > > + > > +vm_paddr_t dmaplimit; > > + > > +SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap > > parameters"); + > > +static int pg_ps_enabled = 1; > > +SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | > > CTLFLAG_NOFETCH, > > + &pg_ps_enabled, 0, "Are large page mappings enabled?"); > > +#ifdef INVARIANTS > > +#define VERBOSE_PMAP 0 > > +#define VERBOSE_PROTECT 0 > > +static int pmap_logging; > > +SYSCTL_INT(_vm_pmap, OID_AUTO, pmap_logging, CTLFLAG_RWTUN, > > + &pmap_logging, 0, "verbose debug logging"); > > +#endif > > + > > +static u_int64_t KPTphys; /* phys addr of kernel > > level 1 */ + > > +//static vm_paddr_t KERNend; /* phys addr of end of > > bootstrap data */ + > > +static vm_offset_t qframe = 0; > > +static struct mtx qframe_mtx; > > +static epoch_t pmap_epoch; > > + > > +void mmu_radix_activate(mmu_t mmu, struct thread *); > > +void mmu_radix_advise(mmu_t mmu, pmap_t, vm_offset_t, vm_offset_t, > > int); +void mmu_radix_align_superpage(mmu_t mmu, vm_object_t, > > vm_ooffset_t, vm_offset_t *, > > + vm_size_t); > > +void mmu_radix_clear_modify(mmu_t, vm_page_t); > > +void mmu_radix_copy(mmu_t, pmap_t, pmap_t, vm_offset_t, vm_size_t, > > vm_offset_t); +int mmu_radix_map_user_ptr(mmu_t mmu, pmap_t pm, > > + volatile const void *uaddr, void **kaddr, size_t ulen, size_t > > *klen); +int mmu_radix_decode_kernel_ptr(mmu_t, vm_offset_t, int *, > > vm_offset_t *); +int mmu_radix_enter(mmu_t, pmap_t, vm_offset_t, > > vm_page_t, vm_prot_t, u_int, int8_t); +void > > mmu_radix_enter_object(mmu_t, pmap_t, vm_offset_t, vm_offset_t, > > vm_page_t, > > + vm_prot_t); > > +void mmu_radix_enter_quick(mmu_t, pmap_t, vm_offset_t, vm_page_t, > > vm_prot_t); +vm_paddr_t mmu_radix_extract(mmu_t, pmap_t pmap, > > vm_offset_t va); +vm_page_t mmu_radix_extract_and_hold(mmu_t, > > pmap_t, vm_offset_t, vm_prot_t); +void mmu_radix_kenter(mmu_t, > > vm_offset_t, vm_paddr_t); +vm_paddr_t mmu_radix_kextract(mmu_t, > > vm_offset_t); +void mmu_radix_kremove(mmu_t, vm_offset_t); > > +boolean_t mmu_radix_is_modified(mmu_t, vm_page_t); > > +boolean_t mmu_radix_is_prefaultable(mmu_t, pmap_t, vm_offset_t); > > +boolean_t mmu_radix_is_referenced(mmu_t, vm_page_t); > > +void mmu_radix_object_init_pt(mmu_t, pmap_t, vm_offset_t, > > vm_object_t, > > + vm_pindex_t, vm_size_t); > > +boolean_t mmu_radix_page_exists_quick(mmu_t, pmap_t, vm_page_t); > > +void mmu_radix_page_init(mmu_t, vm_page_t); > > +boolean_t mmu_radix_page_is_mapped(mmu_t, vm_page_t m); > > +void mmu_radix_page_set_memattr(mmu_t, vm_page_t, vm_memattr_t); > > +int mmu_radix_page_wired_mappings(mmu_t, vm_page_t); > > +void mmu_radix_pinit(mmu_t, pmap_t); > > +void mmu_radix_protect(mmu_t, pmap_t, vm_offset_t, vm_offset_t, > > vm_prot_t); +boolean_t mmu_radix_ps_enabled(mmu_t, pmap_t); > > +void mmu_radix_qenter(mmu_t, vm_offset_t, vm_page_t *, int); > > +void mmu_radix_qremove(mmu_t, vm_offset_t, int); > > +vm_offset_t mmu_radix_quick_enter_page(mmu_t, vm_page_t); > > +void mmu_radix_quick_remove_page(mmu_t, vm_offset_t); > > +boolean_t mmu_radix_ts_referenced(mmu_t, vm_page_t); > > +void mmu_radix_release(mmu_t, pmap_t); > > +void mmu_radix_remove(mmu_t, pmap_t, vm_offset_t, vm_offset_t); > > +void mmu_radix_remove_all(mmu_t, vm_page_t); > > +void mmu_radix_remove_pages(mmu_t, pmap_t); > > +void mmu_radix_remove_write(mmu_t, vm_page_t); > > +void mmu_radix_unwire(mmu_t, pmap_t, vm_offset_t, vm_offset_t); > > +void mmu_radix_zero_page(mmu_t, vm_page_t); > > +void mmu_radix_zero_page_area(mmu_t, vm_page_t, int, int); > > +int mmu_radix_change_attr(mmu_t, vm_offset_t, vm_size_t, > > vm_memattr_t); +void mmu_radix_page_array_startup(mmu_t mmu, long > > pages); + > > +#include "mmu_oea64.h" > > +#include "mmu_if.h" > > +#include "moea64_if.h" > > + > > +/* > > + * Kernel MMU interface > > + */ > > + > > +static void mmu_radix_bootstrap(mmu_t mmup, > > + vm_offset_t kernelstart, vm_offset_t kernelend); > > + > > +static void mmu_radix_copy_page(mmu_t, vm_page_t, vm_page_t); > > +static void mmu_radix_copy_pages(mmu_t mmu, vm_page_t *ma, > > vm_offset_t a_offset, > > + vm_page_t *mb, vm_offset_t b_offset, int xfersize); > > +static void mmu_radix_growkernel(mmu_t, vm_offset_t); > > +static void mmu_radix_init(mmu_t); > > +static int mmu_radix_mincore(mmu_t, pmap_t, vm_offset_t, > > vm_paddr_t *); +static vm_offset_t mmu_radix_map(mmu_t, vm_offset_t > > *, vm_paddr_t, vm_paddr_t, int); +static void > > mmu_radix_pinit0(mmu_t, pmap_t); + > > +static void *mmu_radix_mapdev(mmu_t, vm_paddr_t, vm_size_t); > > +static void *mmu_radix_mapdev_attr(mmu_t, vm_paddr_t, vm_size_t, > > vm_memattr_t); +static void mmu_radix_unmapdev(mmu_t, vm_offset_t, > > vm_size_t); +static void mmu_radix_kenter_attr(mmu_t, vm_offset_t, > > vm_paddr_t, vm_memattr_t ma); +static boolean_t > > mmu_radix_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); +static > > void mmu_radix_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t sz, > > + void **va); > > +static void mmu_radix_scan_init(mmu_t mmu); > > +static void mmu_radix_cpu_bootstrap(mmu_t, int ap); > > + > > +static mmu_method_t mmu_radix_methods[] = { > > + MMUMETHOD(mmu_bootstrap, mmu_radix_bootstrap), > > + MMUMETHOD(mmu_copy_page, mmu_radix_copy_page), > > + MMUMETHOD(mmu_copy_pages, mmu_radix_copy_pages), > > + MMUMETHOD(mmu_cpu_bootstrap, mmu_radix_cpu_bootstrap), > > + MMUMETHOD(mmu_growkernel, mmu_radix_growkernel), > > + MMUMETHOD(mmu_init, mmu_radix_init), > > + MMUMETHOD(mmu_map, mmu_radix_map), > > + MMUMETHOD(mmu_mincore, mmu_radix_mincore), > > + MMUMETHOD(mmu_pinit, mmu_radix_pinit), > > + MMUMETHOD(mmu_pinit0, mmu_radix_pinit0), > > + > > + MMUMETHOD(mmu_mapdev, mmu_radix_mapdev), > > + MMUMETHOD(mmu_mapdev_attr, mmu_radix_mapdev_attr), > > + MMUMETHOD(mmu_unmapdev, mmu_radix_unmapdev), > > + MMUMETHOD(mmu_kenter_attr, mmu_radix_kenter_attr), > > + > > MMUMETHOD(mmu_dev_direct_mapped,mmu_radix_dev_direct_mapped), > > + MMUMETHOD(mmu_scan_init, mmu_radix_scan_init), > > + MMUMETHOD(mmu_dumpsys_map, mmu_radix_dumpsys_map), > > + MMUMETHOD(mmu_page_is_mapped, mmu_radix_page_is_mapped), > > + MMUMETHOD(mmu_ps_enabled, mmu_radix_ps_enabled), > > + MMUMETHOD(mmu_object_init_pt, mmu_radix_object_init_pt), > > + MMUMETHOD(mmu_protect, mmu_radix_protect), > > + /* pmap dispatcher interface */ > > + MMUMETHOD(mmu_clear_modify, mmu_radix_clear_modify), > > + MMUMETHOD(mmu_copy, mmu_radix_copy), > > + MMUMETHOD(mmu_enter, mmu_radix_enter), > > + MMUMETHOD(mmu_enter_object, mmu_radix_enter_object), > > + MMUMETHOD(mmu_enter_quick, mmu_radix_enter_quick), > > + MMUMETHOD(mmu_extract, mmu_radix_extract), > > + MMUMETHOD(mmu_extract_and_hold, mmu_radix_extract_and_hold), > > + MMUMETHOD(mmu_is_modified, mmu_radix_is_modified), > > + MMUMETHOD(mmu_is_prefaultable, mmu_radix_is_prefaultable), > > + MMUMETHOD(mmu_is_referenced, mmu_radix_is_referenced), > > + MMUMETHOD(mmu_ts_referenced, mmu_radix_ts_referenced), > > + > > MMUMETHOD(mmu_page_exists_quick,mmu_radix_page_exists_quick), > > + MMUMETHOD(mmu_page_init, mmu_radix_page_init), > > + MMUMETHOD(mmu_page_wired_mappings, > > mmu_radix_page_wired_mappings), > > + MMUMETHOD(mmu_qenter, mmu_radix_qenter), > > + MMUMETHOD(mmu_qremove, mmu_radix_qremove), > > + MMUMETHOD(mmu_release, mmu_radix_release), > > + MMUMETHOD(mmu_remove, mmu_radix_remove), > > + MMUMETHOD(mmu_remove_all, mmu_radix_remove_all), > > + MMUMETHOD(mmu_remove_write, mmu_radix_remove_write), > > + MMUMETHOD(mmu_unwire, mmu_radix_unwire), > > + MMUMETHOD(mmu_zero_page, mmu_radix_zero_page), > > + MMUMETHOD(mmu_zero_page_area, mmu_radix_zero_page_area), > > + MMUMETHOD(mmu_activate, mmu_radix_activate), > > + MMUMETHOD(mmu_quick_enter_page, mmu_radix_quick_enter_page), > > + MMUMETHOD(mmu_quick_remove_page, > > mmu_radix_quick_remove_page), > > + MMUMETHOD(mmu_page_set_memattr, mmu_radix_page_set_memattr), > > + MMUMETHOD(mmu_page_array_startup, > > mmu_radix_page_array_startup), + > > + /* Internal interfaces */ > > + MMUMETHOD(mmu_kenter, mmu_radix_kenter), > > + MMUMETHOD(mmu_kextract, mmu_radix_kextract), > > + MMUMETHOD(mmu_kremove, mmu_radix_kremove), > > + MMUMETHOD(mmu_change_attr, mmu_radix_change_attr), > > + MMUMETHOD(mmu_map_user_ptr, mmu_radix_map_user_ptr), > > + MMUMETHOD(mmu_decode_kernel_ptr, > > mmu_radix_decode_kernel_ptr), > > + { 0, 0 } > > +}; > > + > > +MMU_DEF(mmu_radix, MMU_TYPE_RADIX, mmu_radix_methods, 0); > > + > > +#define METHODVOID(m) mmu_radix_ ## m(mmu_t mmup) > > + > > +static boolean_t pmap_demote_l3e_locked(pmap_t pmap, pml3_entry_t > > *l3e, vm_offset_t va, > > + struct rwlock **lockp); > > +static boolean_t pmap_demote_l3e(pmap_t pmap, pml3_entry_t *pde, > > vm_offset_t va); +static int pmap_unuse_pt(pmap_t, vm_offset_t, > > pml3_entry_t, struct spglist *); +static int pmap_remove_l3e(pmap_t > > pmap, pml3_entry_t *pdq, vm_offset_t sva, > > + struct spglist *free, struct rwlock **lockp); > > +static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, > > vm_offset_t sva, > > + pml3_entry_t ptepde, struct spglist *free, struct rwlock > > **lockp); +static vm_page_t pmap_remove_pt_page(pmap_t pmap, > > vm_offset_t va); +static bool pmap_remove_page(pmap_t pmap, > > vm_offset_t va, pml3_entry_t *pde, > > + struct spglist *free); > > +static bool pmap_remove_ptes(pmap_t pmap, vm_offset_t sva, > > vm_offset_t eva, > > + pml3_entry_t *l3e, struct spglist *free, struct rwlock > > **lockp); + > > +static bool pmap_pv_insert_l3e(pmap_t pmap, vm_offset_t va, > > pml3_entry_t l3e, > > + u_int flags, struct rwlock **lockp); > > +#if VM_NRESERVLEVEL > 0 > > +static void pmap_pv_promote_l3e(pmap_t pmap, vm_offset_t va, > > vm_paddr_t pa, > > + struct rwlock **lockp); > > +#endif > > +static void pmap_pvh_free(struct md_page *pvh, pmap_t pmap, > > vm_offset_t va); +static int pmap_insert_pt_page(pmap_t pmap, > > vm_page_t mpte); +static vm_page_t > > mmu_radix_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t > > m, > > + vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp, bool > > *invalidate); + > > +static bool pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, > > vm_page_t m, > > + vm_prot_t prot, struct rwlock **lockp); > > +static int pmap_enter_l3e(pmap_t pmap, vm_offset_t va, > > pml3_entry_t newpde, > > + u_int flags, vm_page_t m, struct rwlock **lockp); > > + > > +static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct > > rwlock **lockp); +static void free_pv_chunk(struct pv_chunk *pc); > > +static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t > > ptepindex, struct rwlock **lockp); +static vm_page_t > > pmap_allocl3e(pmap_t pmap, vm_offset_t va, > > + struct rwlock **lockp); > > +static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, > > + struct rwlock **lockp); > > +static void _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, > > vm_page_t m, > > + struct spglist *free); > > +static boolean_t pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, > > vm_page_t m, struct spglist *free); + > > +static void pmap_invalidate_page(pmap_t pmap, vm_offset_t start); > > +static void pmap_invalidate_all(pmap_t pmap); > > +static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, > > int mode, bool flush); + > > +/* > > + * Internal flags for pmap_enter()'s helper functions. > > + */ > > +#define PMAP_ENTER_NORECLAIM 0x1000000 /* Don't > > reclaim PV entries. */ +#define PMAP_ENTER_NOREPLACE > > 0x2000000 /* Don't replace mappings. */ + > > +#define UNIMPLEMENTED() panic("%s not implemented", __func__) > > +#define UNTESTED() panic("%s not yet tested", __func__) > > + > > + > > + > > +/* Number of supported PID bits */ > > +static unsigned int isa3_pid_bits; > > + > > +/* PID to start allocating from */ > > +static unsigned int isa3_base_pid; > > + > > +#define PROCTAB_SIZE_SHIFT (isa3_pid_bits + 4) > > +#define PROCTAB_ENTRIES (1ul << isa3_pid_bits) > > + > > + > > +/* > > + * Map of physical memory regions. > > + */ > > +static struct mem_region *regions, *pregions; > > +static struct numa_mem_region *numa_pregions; > > +static u_int phys_avail_count; > > +static int regions_sz, pregions_sz, numa_pregions_sz; > > +static struct pate *isa3_parttab; > > +static struct prte *isa3_proctab; > > +static vmem_t *asid_arena; > > + > > +extern void bs_remap_earlyboot(void); > > + > > +#define RADIX_PGD_SIZE_SHIFT 16 > > +#define RADIX_PGD_SIZE (1UL << RADIX_PGD_SIZE_SHIFT) > > + > > +#define RADIX_PGD_INDEX_SHIFT (RADIX_PGD_SIZE_SHIFT-3) > > +#define NL2EPG (PAGE_SIZE/sizeof(pml2_entry_t)) > > +#define NL3EPG (PAGE_SIZE/sizeof(pml3_entry_t)) > > + > > +#define NUPML1E (RADIX_PGD_SIZE/sizeof(uint64_t)) > > /* number of userland PML1 pages */ +#define NUPDPE > > (NUPML1E * NL2EPG)/* number of userland PDP pages */ +#define > > NUPDE (NUPDPE * NL3EPG) /* number of userland > > PD entries */ + +/* POWER9 only permits a 64k partition table size. > > */ +#define PARTTAB_SIZE_SHIFT 16 > > +#define PARTTAB_SIZE (1UL << PARTTAB_SIZE_SHIFT) > > + > > +#define PARTTAB_HR (1UL << 63) /* host uses radix */ > > +#define PARTTAB_GR (1UL << 63) /* guest uses radix > > must match host */ + > > +/* TLB flush actions. Used as argument to tlbiel_all() */ > > +enum { > > + TLB_INVAL_SCOPE_LPID = 0, /* invalidate TLBs for > > current LPID */ > > + TLB_INVAL_SCOPE_GLOBAL = 1, /* invalidate all TLBs */ > > +}; > > + > > +#define NPV_LIST_LOCKS MAXCPU > > +static int pmap_initialized; > > +static vm_paddr_t proctab0pa; > > +static vm_paddr_t parttab_phys; > > +CTASSERT(sizeof(struct pv_chunk) == PAGE_SIZE); > > + > > +/* > > + * Data for the pv entry allocation mechanism. > > + * Updates to pv_invl_gen are protected by the pv_list_locks[] > > + * elements, but reads are not. > > + */ > > +static TAILQ_HEAD(pch, pv_chunk) pv_chunks = > > TAILQ_HEAD_INITIALIZER(pv_chunks); +static struct mtx > > __exclusive_cache_line pv_chunks_mutex; +static struct rwlock > > __exclusive_cache_line pv_list_locks[NPV_LIST_LOCKS]; +static > > struct md_page *pv_table; +static struct md_page pv_dummy; > > + > > +#ifdef PV_STATS > > +#define PV_STAT(x) do { x ; } while (0) > > +#else > > +#define PV_STAT(x) do { } while (0) > > +#endif > > + > > +#define pa_radix_index(pa) ((pa) >> L3_PAGE_SIZE_SHIFT) > > +#define pa_to_pvh(pa) (&pv_table[pa_radix_index(pa)]) > > + > > +#define PHYS_TO_PV_LIST_LOCK(pa) \ > > + (&pv_list_locks[pa_radix_index(pa) % > > NPV_LIST_LOCKS]) + > > +#define CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa) do { \ > > + struct rwlock **_lockp = (lockp); \ > > + struct rwlock *_new_lock; \ > > + \ > > + _new_lock = PHYS_TO_PV_LIST_LOCK(pa); \ > > + if (_new_lock != *_lockp) { \ > > + if (*_lockp != NULL) \ > > + rw_wunlock(*_lockp); \ > > + *_lockp = _new_lock; \ > > + rw_wlock(*_lockp); \ > > + } \ > > +} while (0) > > + > > +#define CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m) \ > > + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, VM_PAGE_TO_PHYS(m)) > > + > > +#define RELEASE_PV_LIST_LOCK(lockp) do { \ > > + struct rwlock **_lockp = (lockp); \ > > + \ > > + if (*_lockp != NULL) { \ > > + rw_wunlock(*_lockp); \ > > + *_lockp = NULL; \ > > + } \ > > +} while (0) > > + > > +#define VM_PAGE_TO_PV_LIST_LOCK(m) \ > > + PHYS_TO_PV_LIST_LOCK(VM_PAGE_TO_PHYS(m)) > > + > > +/* > > + * We support 52 bits, hence: > > + * bits 52 - 31 = 21, 0b10101 > > + * RTS encoding details > > + * bits 0 - 3 of rts -> bits 6 - 8 unsigned long > > + * bits 4 - 5 of rts -> bits 62 - 63 of unsigned long > > + */ > > +#define RTS_SIZE ((0x2UL << 61) | (0x5UL << 5)) > > + > > + > > +static int powernv_enabled = 1; > > + > > +static inline void > > +tlbiel_radix_set_isa300(uint32_t set, uint32_t is, > > + uint32_t pid, uint32_t ric, uint32_t prs) > > +{ > > + uint64_t rb; > > + uint64_t rs; > > + > > + rb = PPC_BITLSHIFT_VAL(set, 51) | PPC_BITLSHIFT_VAL(is, 53); > > + rs = PPC_BITLSHIFT_VAL((uint64_t)pid, 31); > > + > > + __asm __volatile(PPC_TLBIEL(%0, %1, %2, %3, 1) > > + : : "r"(rb), "r"(rs), "i"(ric), "i"(prs) > > + : "memory"); > > +} > > + > > +static void > > +tlbiel_flush_isa3(uint32_t num_sets, uint32_t is) > > +{ > > + uint32_t set; > > + > > + __asm __volatile("ptesync": : :"memory"); > > + > > + /* > > + * Flush the first set of the TLB, and the entire Page Walk > > Cache > > + * and partition table entries. Then flush the remaining > > sets of the > > + * TLB. > > + */ > > + tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 0); > > + for (set = 1; set < num_sets; set++) > > + tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, > > 0); + > > + /* Do the same for process scoped entries. */ > > + tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 1); > > + for (set = 1; set < num_sets; set++) > > + tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, > > 1); + > > + __asm __volatile("ptesync": : :"memory"); > > +} > > + > > +static void > > +mmu_radix_tlbiel_flush(int scope) > > +{ > > + int is; > > + > > + MPASS(scope == TLB_INVAL_SCOPE_LPID || > > + scope == TLB_INVAL_SCOPE_GLOBAL); > > + is = scope + 2; > > + > > + tlbiel_flush_isa3(POWER9_TLB_SETS_RADIX, is); > > + __asm __volatile(PPC_INVALIDATE_ERAT "; isync" : : > > :"memory"); +} > > + > > +static void > > +mmu_radix_init_amor(void) > > +{ > > + /* > > + * In HV mode, we init AMOR (Authority Mask Override > > Register) so that > > + * the hypervisor and guest can setup IAMR (Instruction > > Authority Mask > > + * Register), enable key 0 and set it to 1. > > + * > > + * AMOR = 0b1100 .... 0000 (Mask for key 0 is 11) > > + */ > > + mtspr(SPR_AMOR, (3ul << 62)); > > +} > > + > > +static void > > +mmu_radix_init_iamr(void) > > +{ > > + /* > > + * Radix always uses key0 of the IAMR to determine if an > > access is > > + * allowed. We set bit 0 (IBM bit 1) of key0, to prevent > > instruction > > + * fetch. > > + */ > > + mtspr(SPR_IAMR, (1ul << 62)); > > +} > > + > > +static void > > +mmu_radix_pid_set(pmap_t pmap) > > +{ > > + > > + mtspr(SPR_PID, pmap->pm_pid); > > + isync(); > > +} > > + > > +/* Quick sort callout for comparing physical addresses. */ > > +static int > > +pa_cmp(const void *a, const void *b) > > +{ > > + const vm_paddr_t *pa = a, *pb = b; > > + > > + if (*pa < *pb) > > + return (-1); > > + else if (*pa > *pb) > > + return (1); > > + else > > + return (0); > > +} > > + > > +#define pte_load_store(ptep, pte) > > atomic_swap_long(ptep, pte) +#define pte_load_clear(ptep) > > atomic_swap_long(ptep, 0) +#define pte_store(ptep, > > pte) do { \ > > + MPASS((pte) & (RPTE_EAA_R | RPTE_EAA_W | RPTE_EAA_X)); \ > > + *(u_long *)(ptep) = (u_long)((pte) | PG_V | RPTE_LEAF); \ > > +} while (0) > > +/* > > + * NB: should only be used for adding directories - not for direct > > mappings > > + */ > > +#define pde_store(ptep, pa) do { > > \ > > + *(u_long *)(ptep) = (u_long)(pa|RPTE_VALID|RPTE_SHIFT); \ > > +} while (0) > > + > > +#define pte_clear(ptep) do { > > \ > > + *(u_long *)(ptep) = (u_long)(0); \ > > +} while (0) > > + > > +#define PMAP_PDE_SUPERPAGE (1 << 8) /* supports > > 2MB superpages */ + > > +/* > > + * Promotion to a 2MB (PDE) page mapping requires that the > > corresponding 4KB > > + * (PTE) page mappings have identical settings for the following > > fields: > > + */ > > +#define PG_PTE_PROMOTE (PG_X | PG_MANAGED | PG_W | > > PG_PTE_CACHE | \ > > + PG_M | PG_A | RPTE_EAA_MASK | PG_V) > > + > > + > > +static void > > +pmap_epoch_init(void *arg __unused) > > +{ > > + pmap_epoch = epoch_alloc("pmap", EPOCH_PREEMPT | > > EPOCH_LOCKED); +} > > +SYSINIT(epoch, SI_SUB_EPOCH + 1, SI_ORDER_ANY, pmap_epoch_init, > > NULL); + > > +static bool > > +pmap_not_in_di(void) > > +{ > > + > > + return (curthread->td_md.md_invl_gen.gen == 0); > > +} > > + > > +#define PMAP_ASSERT_NOT_IN_DI() \ > > + KASSERT(pmap_not_in_di(), ("DI already started")) > > + > > +static void > > +pmap_delayed_invl_started(epoch_tracker_t et) > > +{ > > + epoch_enter_preempt(pmap_epoch, et); > > + curthread->td_md.md_invl_gen.gen = 1; > > +} > > + > > +static void > > +pmap_delayed_invl_finished(epoch_tracker_t et) > > +{ > > > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to > > "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Mon May 11 20:55:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 451682EBFA5; Mon, 11 May 2020 20:55:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LY9110v2z48Lk; Mon, 11 May 2020 20:55:01 +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 1D7EF247D0; Mon, 11 May 2020 20:55:01 +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 04BKt0aK022472; Mon, 11 May 2020 20:55:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKsxS3022425; Mon, 11 May 2020 20:54:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112054.04BKsxS3022425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 20:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360924 - in head: share/man/man9 sys/conf sys/modules/crypto sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man9 sys/conf sys/modules/crypto sys/opencrypto X-SVN-Commit-Revision: 360924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:55:01 -0000 Author: jhb Date: Mon May 11 20:54:59 2020 New Revision: 360924 URL: https://svnweb.freebsd.org/changeset/base/360924 Log: Remove support for the skipjack encryption algorithm. This was removed from IPsec in r286100 and no longer has any in-tree consumers. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24769 Deleted: head/sys/opencrypto/skipjack.c head/sys/opencrypto/skipjack.h head/sys/opencrypto/xform_skipjack.c Modified: head/share/man/man9/crypto.9 head/sys/conf/files head/sys/modules/crypto/Makefile head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 20:52:18 2020 (r360923) +++ head/share/man/man9/crypto.9 Mon May 11 20:54:59 2020 (r360924) @@ -138,7 +138,6 @@ The following encryption algorithms are supported: .It Dv CRYPTO_DES_CBC .It Dv CRYPTO_3DES_CBC .It Dv CRYPTO_NULL_CBC -.It Dv CRYPTO_SKIPJACK_CBC .El .Pp The following authenticated encryption with additional data (AEAD) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 11 20:52:18 2020 (r360923) +++ head/sys/conf/files Mon May 11 20:54:59 2020 (r360924) @@ -4806,7 +4806,6 @@ opencrypto/cryptodeflate.c optional crypto | ipsec | i opencrypto/gmac.c optional crypto | ipsec | ipsec_support opencrypto/gfmult.c optional crypto | ipsec | ipsec_support opencrypto/rmd160.c optional crypto | ipsec | ipsec_support -opencrypto/skipjack.c optional crypto | ipsec | ipsec_support opencrypto/xform.c optional crypto | ipsec | ipsec_support opencrypto/xform_poly1305.c optional crypto \ compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include -I$S/crypto/libsodium" Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Mon May 11 20:52:18 2020 (r360923) +++ head/sys/modules/crypto/Makefile Mon May 11 20:54:59 2020 (r360924) @@ -23,7 +23,7 @@ KMOD = crypto SRCS = crypto.c cryptodev_if.c SRCS += criov.c cryptosoft.c xform.c SRCS += cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c -SRCS += skipjack.c bf_enc.c bf_ecb.c bf_skey.c +SRCS += bf_enc.c bf_ecb.c bf_skey.c SRCS += camellia.c camellia-api.c SRCS += des_ecb.c des_enc.c des_setkey.c SRCS += sha1.c sha256c.c sha512c.c Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon May 11 20:52:18 2020 (r360923) +++ head/sys/opencrypto/crypto.c Mon May 11 20:54:59 2020 (r360924) @@ -604,8 +604,6 @@ crypto_cipher(const struct crypto_session_params *csp) return (&enc_xform_3des); case CRYPTO_BLF_CBC: return (&enc_xform_blf); - case CRYPTO_SKIPJACK_CBC: - return (&enc_xform_skipjack); case CRYPTO_RIJNDAEL128_CBC: return (&enc_xform_rijndael128); case CRYPTO_AES_XTS: @@ -689,7 +687,6 @@ static enum alg_type { [CRYPTO_DES_CBC] = ALG_CIPHER, [CRYPTO_3DES_CBC] = ALG_CIPHER, [CRYPTO_BLF_CBC] = ALG_CIPHER, - [CRYPTO_SKIPJACK_CBC] = ALG_CIPHER, [CRYPTO_MD5_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_RIPEMD160_HMAC] = ALG_KEYED_DIGEST, Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Mon May 11 20:52:18 2020 (r360923) +++ head/sys/opencrypto/cryptodev.h Mon May 11 20:54:59 2020 (r360924) @@ -118,7 +118,6 @@ #define DES_BLOCK_LEN 8 #define DES3_BLOCK_LEN 8 #define BLOWFISH_BLOCK_LEN 8 -#define SKIPJACK_BLOCK_LEN 8 #define RIJNDAEL128_BLOCK_LEN 16 #define AES_BLOCK_LEN 16 #define AES_ICM_BLOCK_LEN 1 @@ -144,8 +143,6 @@ #define TRIPLE_DES_MAX_KEY TRIPLE_DES_MIN_KEY #define BLOWFISH_MIN_KEY 5 #define BLOWFISH_MAX_KEY 56 /* 448 bits, max key */ -#define SKIPJACK_MIN_KEY 10 -#define SKIPJACK_MAX_KEY SKIPJACK_MIN_KEY #define RIJNDAEL_MIN_KEY 16 #define RIJNDAEL_MAX_KEY 32 #define AES_MIN_KEY RIJNDAEL_MIN_KEY Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Mon May 11 20:52:18 2020 (r360923) +++ head/sys/opencrypto/cryptosoft.c Mon May 11 20:54:59 2020 (r360924) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/opencrypto/xform.c ============================================================================== --- head/sys/opencrypto/xform.c Mon May 11 20:52:18 2020 (r360923) +++ head/sys/opencrypto/xform.c Mon May 11 20:54:59 2020 (r360924) @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include @@ -93,7 +92,6 @@ struct enc_xform enc_xform_arc4 = { #include "xform_des1.c" #include "xform_des3.c" #include "xform_blf.c" -#include "xform_skipjack.c" #include "xform_rijndael.c" #include "xform_aes_icm.c" #include "xform_aes_xts.c" Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Mon May 11 20:52:18 2020 (r360923) +++ head/sys/opencrypto/xform_enc.h Mon May 11 20:54:59 2020 (r360924) @@ -37,7 +37,6 @@ #include #include #include -#include #include #include @@ -73,7 +72,6 @@ extern struct enc_xform enc_xform_null; extern struct enc_xform enc_xform_des; extern struct enc_xform enc_xform_3des; extern struct enc_xform enc_xform_blf; -extern struct enc_xform enc_xform_skipjack; extern struct enc_xform enc_xform_rijndael128; extern struct enc_xform enc_xform_aes_icm; extern struct enc_xform enc_xform_aes_nist_gcm; From owner-svn-src-head@freebsd.org Mon May 11 20:55:06 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B10E92EBFCA; Mon, 11 May 2020 20:55:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LY9600Ncz48Ny; Mon, 11 May 2020 20:55:06 +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 DAE3D247D1; Mon, 11 May 2020 20:55:05 +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 04BKt5Hr022521; Mon, 11 May 2020 20:55:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKt5Xh022518; Mon, 11 May 2020 20:55:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005112055.04BKt5Xh022518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 11 May 2020 20:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360925 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 360925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:55:07 -0000 Author: hselasky Date: Mon May 11 20:55:04 2020 New Revision: 360925 URL: https://svnweb.freebsd.org/changeset/base/360925 Log: Refresh the USB device strings when a USB device is re-enumerated. Submitted by: Horse Ma MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_hub.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Mon May 11 20:54:59 2020 (r360924) +++ head/sys/dev/usb/usb_device.c Mon May 11 20:55:04 2020 (r360925) @@ -103,7 +103,6 @@ static void usb_suspend_resume_sub(struct usb_device * uint8_t); static usb_proc_callback_t usbd_clear_stall_proc; static usb_error_t usb_config_parse(struct usb_device *, uint8_t, uint8_t); -static void usbd_set_device_strings(struct usb_device *); #if USB_HAVE_DEVCTL static void usb_notify_addq(const char *type, struct usb_device *); #endif @@ -1652,6 +1651,85 @@ usbd_clear_stall_proc(struct usb_proc_msg *_pm) } /*------------------------------------------------------------------------* + * usb_get_langid + * + * This function tries to figure out the USB string language to use. + *------------------------------------------------------------------------*/ +void +usb_get_langid(struct usb_device *udev) +{ + uint8_t *scratch_ptr; + uint8_t do_unlock; + int err; + + /* + * Workaround for buggy USB devices. + * + * It appears that some string-less USB chips will crash and + * disappear if any attempts are made to read any string + * descriptors. + * + * Try to detect such chips by checking the strings in the USB + * device descriptor. If no strings are present there we + * simply disable all USB strings. + */ + + /* Protect scratch area */ + do_unlock = usbd_ctrl_lock(udev); + + scratch_ptr = udev->scratch.data; + + if (udev->flags.no_strings) { + err = USB_ERR_INVAL; + } else if (udev->ddesc.iManufacturer || + udev->ddesc.iProduct || + udev->ddesc.iSerialNumber) { + /* read out the language ID string */ + err = usbd_req_get_string_desc(udev, NULL, + (char *)scratch_ptr, 4, 0, USB_LANGUAGE_TABLE); + } else { + err = USB_ERR_INVAL; + } + + if (err || (scratch_ptr[0] < 4)) { + udev->flags.no_strings = 1; + } else { + uint16_t langid; + uint16_t pref; + uint16_t mask; + uint8_t x; + + /* load preferred value and mask */ + pref = usb_lang_id; + mask = usb_lang_mask; + + /* align length correctly */ + scratch_ptr[0] &= ~1U; + + /* fix compiler warning */ + langid = 0; + + /* search for preferred language */ + for (x = 2; x < scratch_ptr[0]; x += 2) { + langid = UGETW(scratch_ptr + x); + if ((langid & mask) == pref) + break; + } + if (x >= scratch_ptr[0]) { + /* pick the first language as the default */ + DPRINTFN(1, "Using first language\n"); + langid = UGETW(scratch_ptr + 2); + } + + DPRINTFN(1, "Language selected: 0x%04x\n", langid); + udev->langid = langid; + } + + if (do_unlock) + usbd_ctrl_unlock(udev); +} + +/*------------------------------------------------------------------------* * usb_alloc_device * * This function allocates a new USB device. This function is called @@ -1672,13 +1750,11 @@ usb_alloc_device(device_t parent_dev, struct usb_bus * struct usb_device *udev; struct usb_device *adev; struct usb_device *hub; - uint8_t *scratch_ptr; usb_error_t err; uint8_t device_index; uint8_t config_index; uint8_t config_quirk; uint8_t set_config_failed; - uint8_t do_unlock; DPRINTF("parent_dev=%p, bus=%p, parent_hub=%p, depth=%u, " "port_index=%u, port_no=%u, speed=%u, usb_mode=%u\n", @@ -1888,76 +1964,13 @@ usb_alloc_device(device_t parent_dev, struct usb_bus * if (usb_test_quirk(&uaa, UQ_NO_STRINGS)) { udev->flags.no_strings = 1; } - /* - * Workaround for buggy USB devices. - * - * It appears that some string-less USB chips will crash and - * disappear if any attempts are made to read any string - * descriptors. - * - * Try to detect such chips by checking the strings in the USB - * device descriptor. If no strings are present there we - * simply disable all USB strings. - */ - /* Protect scratch area */ - do_unlock = usbd_ctrl_lock(udev); + usb_get_langid(udev); - scratch_ptr = udev->scratch.data; - - if (udev->flags.no_strings) { - err = USB_ERR_INVAL; - } else if (udev->ddesc.iManufacturer || - udev->ddesc.iProduct || - udev->ddesc.iSerialNumber) { - /* read out the language ID string */ - err = usbd_req_get_string_desc(udev, NULL, - (char *)scratch_ptr, 4, 0, USB_LANGUAGE_TABLE); - } else { - err = USB_ERR_INVAL; - } - - if (err || (scratch_ptr[0] < 4)) { - udev->flags.no_strings = 1; - } else { - uint16_t langid; - uint16_t pref; - uint16_t mask; - uint8_t x; - - /* load preferred value and mask */ - pref = usb_lang_id; - mask = usb_lang_mask; - - /* align length correctly */ - scratch_ptr[0] &= ~1U; - - /* fix compiler warning */ - langid = 0; - - /* search for preferred language */ - for (x = 2; (x < scratch_ptr[0]); x += 2) { - langid = UGETW(scratch_ptr + x); - if ((langid & mask) == pref) - break; - } - if (x >= scratch_ptr[0]) { - /* pick the first language as the default */ - DPRINTFN(1, "Using first language\n"); - langid = UGETW(scratch_ptr + 2); - } - - DPRINTFN(1, "Language selected: 0x%04x\n", langid); - udev->langid = langid; - } - - if (do_unlock) - usbd_ctrl_unlock(udev); - /* assume 100mA bus powered for now. Changed when configured. */ udev->power = USB_MIN_POWER; /* fetch the vendor and product strings from the device */ - usbd_set_device_strings(udev); + usb_set_device_strings(udev); if (udev->flags.usb_mode == USB_MODE_DEVICE) { /* USB device mode setup is complete */ @@ -2477,8 +2490,8 @@ struct usb_knowndev { #include "usbdevs_data.h" #endif /* USB_VERBOSE */ -static void -usbd_set_device_strings(struct usb_device *udev) +void +usb_set_device_strings(struct usb_device *udev) { struct usb_device_descriptor *udd = &udev->ddesc; #ifdef USB_VERBOSE @@ -2498,6 +2511,16 @@ usbd_set_device_strings(struct usb_device *udev) vendor_id = UGETW(udd->idVendor); product_id = UGETW(udd->idProduct); + + /* cleanup old strings, if any */ + free(udev->serial, M_USB); + free(udev->manufacturer, M_USB); + free(udev->product, M_USB); + + /* zero the string pointers */ + udev->serial = NULL; + udev->manufacturer = NULL; + udev->product = NULL; /* get serial number string */ usbd_req_get_string_any(udev, NULL, temp_ptr, temp_size, Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Mon May 11 20:54:59 2020 (r360924) +++ head/sys/dev/usb/usb_device.h Mon May 11 20:55:04 2020 (r360925) @@ -328,6 +328,9 @@ struct usb_endpoint *usb_endpoint_foreach(struct usb_d void usb_set_device_state(struct usb_device *, enum usb_dev_state); enum usb_dev_state usb_get_device_state(struct usb_device *); +void usb_set_device_strings(struct usb_device *); +void usb_get_langid(struct usb_device *); + uint8_t usbd_enum_lock(struct usb_device *); #if USB_HAVE_UGEN uint8_t usbd_enum_lock_sig(struct usb_device *); Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Mon May 11 20:54:59 2020 (r360924) +++ head/sys/dev/usb/usb_hub.c Mon May 11 20:55:04 2020 (r360925) @@ -441,8 +441,14 @@ uhub_explore_handle_re_enumerate(struct usb_device *ch } else { err = usbd_req_re_enumerate(child, NULL); } - if (err == 0) + if (err == 0) { + /* refresh device strings */ + usb_get_langid(child); + usb_set_device_strings(child); + + /* set default configuration */ err = usbd_set_config_index(child, 0); + } if (err == 0) { err = usb_probe_and_attach(child, USB_IFACE_INDEX_ANY); @@ -1689,6 +1695,7 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch struct usb_hub *hub; struct usb_interface *iface; struct hub_result res; + uint8_t do_unlock; if (!device_is_attached(parent)) { if (buflen) @@ -1710,6 +1717,9 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch } iface = usbd_get_iface(res.udev, res.iface_index); if (iface && iface->idesc) { + /* Make sure device information is not changed during the print. */ + do_unlock = usbd_ctrl_lock(res.udev); + snprintf(buf, buflen, "vendor=0x%04x product=0x%04x " "devclass=0x%02x devsubclass=0x%02x " "devproto=0x%02x " @@ -1731,6 +1741,9 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch iface->idesc->bInterfaceProtocol, iface->pnpinfo ? " " : "", iface->pnpinfo ? iface->pnpinfo : ""); + + if (do_unlock) + usbd_ctrl_unlock(res.udev); } else { if (buflen) { buf[0] = '\0'; From owner-svn-src-head@freebsd.org Mon May 11 20:57:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9BDB2EC224; Mon, 11 May 2020 20:57:37 +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 49LYD13JDRz48pV; Mon, 11 May 2020 20:57:37 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id YFUSjOf66YYpxYFUUjwScZ; Mon, 11 May 2020 14:57:35 -0600 X-Authority-Analysis: v=2.3 cv=OubUNx3t c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=sTwFKg_x9MkA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=yeeXC68TTCNqTyCijrwA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo: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 ESMTP id 1B88B4B6; Mon, 11 May 2020 13:57:32 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id 04BKvVRe052308; Mon, 11 May 2020 13:57:31 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id 04BKvVgY052305; Mon, 11 May 2020 13:57:31 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202005112057.04BKvVgY052305@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Michael Reifenberger cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360919 - head/usr.bin/systat In-reply-to: <202005112034.04BKYq1J009950@repo.freebsd.org> References: <202005112034.04BKYq1J009950@repo.freebsd.org> Comments: In-reply-to Michael Reifenberger message dated "Mon, 11 May 2020 20:34:52 -0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 11 May 2020 13:57:31 -0700 X-CMAE-Envelope: MS4wfGQtLerRVxd+LYjrypsk2W9IMHtlBitfruYKcxc/FhxfB6oy8hcwPyo4Hp3E6YU6hc4oabzvheWGgil5iInElhzHd0V7IzFQfT+Q6zrIW0HktRv8acnk rWCnw6XpLqrFJLYs7o+s86dRl546sVMUeQgaULciWbt4x5mw0IrWcfHjIbfZ2PY37Tden3PxQbc7jIJ4U4UFsU1EQYf3+cNSaMBtC7SWU3QS/Wp3zys5Gn2H y9iLYfbpWUTNZnhI+4gijMu4eNBoqFOEvrggEl7Ar1ZGs8BX+YvFArAZ63HAtE7c X-Rspamd-Queue-Id: 49LYD13JDRz48pV X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:57:37 -0000 In message <202005112034.04BKYq1J009950@repo.freebsd.org>, Michael Reifenberger writes: > Author: mr > Date: Mon May 11 20:34:52 2020 > New Revision: 360919 > URL: https://svnweb.freebsd.org/changeset/base/360919 > > Log: > Patch systat -zarc to display cumulative rate and round down large numbers > by SI units > > PR: 237664 > Submitted by: ota@j.email.ne.jp > MFC after: 2 weeks > > Modified: > head/usr.bin/systat/Makefile > head/usr.bin/systat/extern.h > head/usr.bin/systat/main.c > head/usr.bin/systat/zarc.c > > Modified: head/usr.bin/systat/Makefile > ============================================================================= > = > --- head/usr.bin/systat/Makefile Mon May 11 20:30:28 2020 (r36091 > 8) > +++ head/usr.bin/systat/Makefile Mon May 11 20:34:52 2020 (r36091 > 9) > @@ -4,7 +4,7 @@ > .include > > PROG= systat > -SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c \ > +SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c syspu > t.c \ The build fails here because it cannot fine sysput.c. > netcmds.c netstat.c pigs.c swap.c icmp.c \ > mode.c ip.c sctp.c tcp.c zarc.c \ > vmstat.c convtbl.c ifcmds.c ifstat.c > -- 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-head@freebsd.org Mon May 11 21:05:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 579032EC793; Mon, 11 May 2020 21:05:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LYNY1hnJz49xd; Mon, 11 May 2020 21:05:01 +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 1CAFC24A33; Mon, 11 May 2020 21:05:01 +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 04BL50UF028451; Mon, 11 May 2020 21:05:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BL4xI9028430; Mon, 11 May 2020 21:04:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112104.04BL4xI9028430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 21:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360927 - in head: share/man/man9 sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man9 sys/opencrypto X-SVN-Commit-Revision: 360927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:05:01 -0000 Author: jhb Date: Mon May 11 21:04:59 2020 New Revision: 360927 URL: https://svnweb.freebsd.org/changeset/base/360927 Log: Remove support for keyed MD5 and SHA1 authentication hashes. They no longer have any in-tree consumers. Note that these are a different from MD5-HMAC and SHA1-HMAC and were only used with IPsec. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24770 Modified: head/share/man/man9/crypto.9 head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform_auth.h head/sys/opencrypto/xform_md5.c head/sys/opencrypto/xform_sha1.c Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 20:58:27 2020 (r360926) +++ head/share/man/man9/crypto.9 Mon May 11 21:04:59 2020 (r360927) @@ -107,14 +107,12 @@ The following authentication algorithms are supported: .It Dv CRYPTO_BLAKE2B .It Dv CRYPTO_BLAKE2S .It Dv CRYPTO_MD5_HMAC -.It Dv CRYPTO_MD5_KPDK .It Dv CRYPTO_NULL_HMAC .It Dv CRYPTO_POLY1305 .It Dv CRYPTO_RIPEMD160 .It Dv CRYPTO_RIPEMD160_HMAC .It Dv CRYPTO_SHA1 .It Dv CRYPTO_SHA1_HMAC -.It Dv CRYPTO_SHA1_KPDK .It Dv CRYPTO_SHA2_224 .It Dv CRYPTO_SHA2_224_HMAC .It Dv CRYPTO_SHA2_256 Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon May 11 20:58:27 2020 (r360926) +++ head/sys/opencrypto/crypto.c Mon May 11 21:04:59 2020 (r360927) @@ -546,10 +546,6 @@ crypto_auth_hash(const struct crypto_session_params *c return (&auth_hash_null); case CRYPTO_RIPEMD160_HMAC: return (&auth_hash_hmac_ripemd_160); - case CRYPTO_MD5_KPDK: - return (&auth_hash_key_md5); - case CRYPTO_SHA1_KPDK: - return (&auth_hash_key_sha1); case CRYPTO_SHA1: return (&auth_hash_sha1); case CRYPTO_SHA2_224: @@ -690,8 +686,6 @@ static enum alg_type { [CRYPTO_MD5_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_RIPEMD160_HMAC] = ALG_KEYED_DIGEST, - [CRYPTO_MD5_KPDK] = ALG_KEYED_DIGEST, - [CRYPTO_SHA1_KPDK] = ALG_KEYED_DIGEST, [CRYPTO_AES_CBC] = ALG_CIPHER, [CRYPTO_ARC4] = ALG_CIPHER, [CRYPTO_SHA1] = ALG_DIGEST, Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Mon May 11 20:58:27 2020 (r360926) +++ head/sys/opencrypto/cryptodev.h Mon May 11 21:04:59 2020 (r360927) @@ -81,8 +81,6 @@ #define SHA2_256_HASH_LEN 32 #define SHA2_384_HASH_LEN 48 #define SHA2_512_HASH_LEN 64 -#define MD5_KPDK_HASH_LEN 16 -#define SHA1_KPDK_HASH_LEN 20 #define AES_GMAC_HASH_LEN 16 #define POLY1305_HASH_LEN 16 #define AES_CBC_MAC_HASH_LEN 16 Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Mon May 11 20:58:27 2020 (r360926) +++ head/sys/opencrypto/cryptosoft.c Mon May 11 21:04:59 2020 (r360927) @@ -64,7 +64,6 @@ struct swcr_auth { void *sw_octx; struct auth_hash *sw_axf; uint16_t sw_mlen; - uint16_t sw_octx_len; }; struct swcr_encdec { @@ -349,27 +348,6 @@ swcr_authprepare(struct auth_hash *axf, struct swcr_au hmac_init_ipad(axf, key, klen, sw->sw_ictx); hmac_init_opad(axf, key, klen, sw->sw_octx); break; - case CRYPTO_MD5_KPDK: - case CRYPTO_SHA1_KPDK: - { - /* - * We need a buffer that can hold an md5 and a sha1 result - * just to throw it away. - * What we do here is the initial part of: - * ALGO( key, keyfill, .. ) - * adding the key to sw_ictx and abusing Final() to get the - * "keyfill" padding. - * In addition we abuse the sw_octx to save the key to have - * it to be able to append it at the end in swcr_authcompute(). - */ - u_char buf[SHA1_RESULTLEN]; - - bcopy(key, sw->sw_octx, klen); - axf->Init(sw->sw_ictx); - axf->Update(sw->sw_ictx, key, klen); - axf->Final(buf, sw->sw_ictx); - break; - } case CRYPTO_POLY1305: case CRYPTO_BLAKE2B: case CRYPTO_BLAKE2S: @@ -442,23 +420,6 @@ swcr_authcompute(struct swcr_session *ses, struct cryp axf->Final(aalg, &ctx); break; - case CRYPTO_MD5_KPDK: - case CRYPTO_SHA1_KPDK: - /* If we have no key saved, return error. */ - if (sw->sw_octx == NULL) - return EINVAL; - - /* - * Add the trailing copy of the key (see comment in - * swcr_authprepare()) after the data: - * ALGO( .., key, algofill ) - * and let Final() do the proper, natural "algofill" - * padding. - */ - axf->Update(&ctx, sw->sw_octx, sw->sw_octx_len); - axf->Final(aalg, &ctx); - break; - case CRYPTO_BLAKE2B: case CRYPTO_BLAKE2S: case CRYPTO_NULL_HMAC: @@ -947,8 +908,7 @@ swcr_setup_auth(struct swcr_session *ses, case CRYPTO_SHA2_512_HMAC: case CRYPTO_NULL_HMAC: case CRYPTO_RIPEMD160_HMAC: - swa->sw_octx_len = axf->ctxsize; - swa->sw_octx = malloc(swa->sw_octx_len, M_CRYPTO_DATA, + swa->sw_octx = malloc(axf->ctxsize, M_CRYPTO_DATA, M_NOWAIT); if (swa->sw_octx == NULL) return (ENOBUFS); @@ -961,23 +921,6 @@ swcr_setup_auth(struct swcr_session *ses, if (csp->csp_mode == CSP_MODE_DIGEST) ses->swcr_process = swcr_authcompute; break; - case CRYPTO_MD5_KPDK: - case CRYPTO_SHA1_KPDK: - swa->sw_octx_len = csp->csp_auth_klen; - swa->sw_octx = malloc(swa->sw_octx_len, M_CRYPTO_DATA, - M_NOWAIT); - if (swa->sw_octx == NULL) - return (ENOBUFS); - - /* Store the key so we can "append" it to the payload */ - if (csp->csp_auth_key != NULL) { - swcr_authprepare(axf, swa, csp->csp_auth_key, - csp->csp_auth_klen); - } - - if (csp->csp_mode == CSP_MODE_DIGEST) - ses->swcr_process = swcr_authcompute; - break; case CRYPTO_SHA1: case CRYPTO_SHA2_224: case CRYPTO_SHA2_256: @@ -1151,8 +1094,6 @@ swcr_auth_supported(const struct crypto_session_params case CRYPTO_SHA2_512_HMAC: case CRYPTO_NULL_HMAC: case CRYPTO_RIPEMD160_HMAC: - case CRYPTO_MD5_KPDK: - case CRYPTO_SHA1_KPDK: break; case CRYPTO_AES_NIST_GMAC: switch (csp->csp_auth_klen * 8) { @@ -1399,7 +1340,7 @@ swcr_freesession(device_t dev, crypto_session_t cses) free(swa->sw_ictx, M_CRYPTO_DATA); } if (swa->sw_octx != NULL) { - explicit_bzero(swa->sw_octx, swa->sw_octx_len); + explicit_bzero(swa->sw_octx, axf->ctxsize); free(swa->sw_octx, M_CRYPTO_DATA); } } Modified: head/sys/opencrypto/xform_auth.h ============================================================================== --- head/sys/opencrypto/xform_auth.h Mon May 11 20:58:27 2020 (r360926) +++ head/sys/opencrypto/xform_auth.h Mon May 11 21:04:59 2020 (r360927) @@ -66,8 +66,6 @@ struct auth_hash { }; extern struct auth_hash auth_hash_null; -extern struct auth_hash auth_hash_key_md5; -extern struct auth_hash auth_hash_key_sha1; extern struct auth_hash auth_hash_hmac_md5; extern struct auth_hash auth_hash_hmac_sha1; extern struct auth_hash auth_hash_hmac_ripemd_160; Modified: head/sys/opencrypto/xform_md5.c ============================================================================== --- head/sys/opencrypto/xform_md5.c Mon May 11 20:58:27 2020 (r360926) +++ head/sys/opencrypto/xform_md5.c Mon May 11 21:04:59 2020 (r360927) @@ -68,18 +68,6 @@ struct auth_hash auth_hash_hmac_md5 = { .Final = (void (*) (u_int8_t *, void *)) MD5Final, }; -struct auth_hash auth_hash_key_md5 = { - .type = CRYPTO_MD5_KPDK, - .name = "Keyed MD5", - .keysize = 0, - .hashsize = MD5_KPDK_HASH_LEN, - .ctxsize = sizeof(MD5_CTX), - .blocksize = 0, - .Init = (void (*)(void *)) MD5Init, - .Update = MD5Update_int, - .Final = (void (*)(u_int8_t *, void *)) MD5Final, -}; - /* * And now for auth. */ Modified: head/sys/opencrypto/xform_sha1.c ============================================================================== --- head/sys/opencrypto/xform_sha1.c Mon May 11 20:58:27 2020 (r360926) +++ head/sys/opencrypto/xform_sha1.c Mon May 11 21:04:59 2020 (r360927) @@ -82,18 +82,6 @@ struct auth_hash auth_hash_hmac_sha1 = { .Final = SHA1Final_int, }; -struct auth_hash auth_hash_key_sha1 = { - .type = CRYPTO_SHA1_KPDK, - .name = "Keyed SHA1", - .keysize = 0, - .hashsize = SHA1_KPDK_HASH_LEN, - .ctxsize = sizeof(SHA1_CTX), - .blocksize = 0, - .Init = SHA1Init_int, - .Update = SHA1Update_int, - .Final = SHA1Final_int, -}; - /* * And now for auth. */ From owner-svn-src-head@freebsd.org Mon May 11 21:17:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 265C12ECD27; Mon, 11 May 2020 21:17:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LYfb09rgz4Brf; Mon, 11 May 2020 21:17:11 +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 00C5C24C4D; Mon, 11 May 2020 21:17:11 +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 04BLHA9p035160; Mon, 11 May 2020 21:17:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BLH9CZ035151; Mon, 11 May 2020 21:17:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112117.04BLH9CZ035151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 21:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360928 - in head: share/man/man4 share/man/man9 sys/dev/hifn sys/mips/nlm/dev/sec sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man4 share/man/man9 sys/dev/hifn sys/mips/nlm/dev/sec sys/opencrypto X-SVN-Commit-Revision: 360928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:17:11 -0000 Author: jhb Date: Mon May 11 21:17:08 2020 New Revision: 360928 URL: https://svnweb.freebsd.org/changeset/base/360928 Log: Remove support for the ARC4 algorithm from OCF. There are no longer any in-kernel consumers. The software implementation was also a non-functional stub. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24771 Modified: head/share/man/man4/hifn.4 head/share/man/man9/crypto.9 head/sys/dev/hifn/hifn7751.c head/sys/mips/nlm/dev/sec/nlmsec.c head/sys/mips/nlm/dev/sec/nlmseclib.c head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/xform.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man4/hifn.4 ============================================================================== --- head/share/man/man4/hifn.4 Mon May 11 21:04:59 2020 (r360927) +++ head/share/man/man4/hifn.4 Mon May 11 21:17:08 2020 (r360928) @@ -57,7 +57,7 @@ driver supports various cards containing the Hifn 7751 The .Nm driver registers itself to accelerate DES, Triple-DES, -AES (7955 and 7956 only), ARC4, +AES (7955 and 7956 only), MD5-HMAC, SHA1, and SHA1-HMAC operations for .Xr ipsec 4 and Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 21:04:59 2020 (r360927) +++ head/share/man/man9/crypto.9 Mon May 11 21:17:08 2020 (r360928) @@ -129,7 +129,6 @@ The following encryption algorithms are supported: .It Dv CRYPTO_AES_CBC .It Dv CRYPTO_AES_ICM .It Dv CRYPTO_AES_XTS -.It Dv CRYPTO_ARC4 .It Dv CRYPTO_BLF_CBC .It Dv CRYPTO_CAMELLIA_CBC .It Dv CRYPTO_CHACHA20 Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Mon May 11 21:04:59 2020 (r360927) +++ head/sys/dev/hifn/hifn7751.c Mon May 11 21:17:08 2020 (r360928) @@ -1546,7 +1546,7 @@ hifn_write_command(struct hifn_command *cmd, u_int8_t hifn_base_command_t *base_cmd; hifn_mac_command_t *mac_cmd; hifn_crypt_command_t *cry_cmd; - int using_mac, using_crypt, len, ivlen; + int using_mac, using_crypt, ivlen; u_int32_t dlen, slen; crp = cmd->crp; @@ -1612,19 +1612,6 @@ hifn_write_command(struct hifn_command *cmd, u_int8_t bcopy(cmd->ck, buf_pos, HIFN_DES_KEY_LENGTH); buf_pos += HIFN_DES_KEY_LENGTH; break; - case HIFN_CRYPT_CMD_ALG_RC4: - len = 256; - do { - int clen; - - clen = MIN(cmd->cklen, len); - bcopy(cmd->ck, buf_pos, clen); - len -= clen; - buf_pos += clen; - } while (len > 0); - bzero(buf_pos, 4); - buf_pos += 4; - break; case HIFN_CRYPT_CMD_ALG_AES: /* * AES keys are variable 128, 192 and @@ -2342,7 +2329,6 @@ hifn_cipher_supported(struct hifn_softc *sc, case HIFN_PUSTAT_ENA_2: switch (csp->csp_cipher_alg) { case CRYPTO_3DES_CBC: - case CRYPTO_ARC4: break; case CRYPTO_AES_CBC: if ((sc->sc_flags & HIFN_HAS_AES) == 0) @@ -2462,9 +2448,6 @@ hifn_process(device_t dev, struct cryptop *crp, int hi cmd->base_masks |= HIFN_BASE_CMD_DECODE; cmd->base_masks |= HIFN_BASE_CMD_CRYPT; switch (csp->csp_cipher_alg) { - case CRYPTO_ARC4: - cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_RC4; - break; case CRYPTO_DES_CBC: cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_DES | HIFN_CRYPT_CMD_MODE_CBC | @@ -2484,8 +2467,7 @@ hifn_process(device_t dev, struct cryptop *crp, int hi err = EINVAL; goto errout; } - if (csp->csp_cipher_alg != CRYPTO_ARC4) - crypto_read_iv(crp, cmd->iv); + crypto_read_iv(crp, cmd->iv); if (crp->crp_cipher_key != NULL) cmd->ck = crp->crp_cipher_key; Modified: head/sys/mips/nlm/dev/sec/nlmsec.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 11 21:04:59 2020 (r360927) +++ head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 11 21:17:08 2020 (r360928) @@ -400,10 +400,6 @@ xlp_sec_cipher_supported(const struct crypto_session_p if (csp->csp_ivlen != XLP_SEC_AES_IV_LENGTH) return (false); break; - case CRYPTO_ARC4: - if (csp->csp_ivlen != XLP_SEC_ARC4_IV_LENGTH) - return (false); - break; default: return (false); } @@ -468,10 +464,8 @@ xlp_copyiv(struct xlp_sec_softc *sc, struct xlp_sec_co crp = cmd->crp; - if (csp->csp_cipher_alg != CRYPTO_ARC4) { - if (crp->crp_flags & CRYPTO_F_IV_SEPARATE) - memcpy(cmd->iv, crp->crp_iv, csp->csp_ivlen); - } + if (crp->crp_flags & CRYPTO_F_IV_SEPARATE) + memcpy(cmd->iv, crp->crp_iv, csp->csp_ivlen); } static int Modified: head/sys/mips/nlm/dev/sec/nlmseclib.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmseclib.c Mon May 11 21:04:59 2020 (r360927) +++ head/sys/mips/nlm/dev/sec/nlmseclib.c Mon May 11 21:17:08 2020 (r360928) @@ -311,11 +311,6 @@ nlm_get_cipher_param(struct xlp_sec_command *cmd, cmd->ciphermode = NLM_CIPHER_MODE_CBC; cmd->ivlen = XLP_SEC_AES_IV_LENGTH; break; - case CRYPTO_ARC4: - cmd->cipheralg = NLM_CIPHER_ARC4; - cmd->ciphermode = NLM_CIPHER_MODE_ECB; - cmd->ivlen = XLP_SEC_ARC4_IV_LENGTH; - break; default: /* Not supported */ return (-1); Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon May 11 21:04:59 2020 (r360927) +++ head/sys/opencrypto/crypto.c Mon May 11 21:17:08 2020 (r360928) @@ -687,7 +687,6 @@ static enum alg_type { [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_RIPEMD160_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_AES_CBC] = ALG_CIPHER, - [CRYPTO_ARC4] = ALG_CIPHER, [CRYPTO_SHA1] = ALG_DIGEST, [CRYPTO_NULL_HMAC] = ALG_DIGEST, [CRYPTO_NULL_CBC] = ALG_CIPHER, @@ -793,10 +792,8 @@ check_csp(const struct crypto_session_params *csp) if (csp->csp_cipher_alg != CRYPTO_NULL_CBC) { if (csp->csp_cipher_klen == 0) return (false); - if (csp->csp_cipher_alg != CRYPTO_ARC4) { - if (csp->csp_ivlen == 0) - return (false); - } + if (csp->csp_ivlen == 0) + return (false); } if (csp->csp_ivlen >= EALG_MAX_BLOCK_LEN) return (false); @@ -860,10 +857,8 @@ check_csp(const struct crypto_session_params *csp) if (csp->csp_cipher_alg != CRYPTO_NULL_CBC) { if (csp->csp_cipher_klen == 0) return (false); - if (csp->csp_cipher_alg != CRYPTO_ARC4) { - if (csp->csp_ivlen == 0) - return (false); - } + if (csp->csp_ivlen == 0) + return (false); } if (csp->csp_ivlen >= EALG_MAX_BLOCK_LEN) return (false); Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Mon May 11 21:04:59 2020 (r360927) +++ head/sys/opencrypto/cryptodev.h Mon May 11 21:17:08 2020 (r360928) @@ -119,14 +119,12 @@ #define RIJNDAEL128_BLOCK_LEN 16 #define AES_BLOCK_LEN 16 #define AES_ICM_BLOCK_LEN 1 -#define ARC4_BLOCK_LEN 1 #define CAMELLIA_BLOCK_LEN 16 #define CHACHA20_NATIVE_BLOCK_LEN 64 #define EALG_MAX_BLOCK_LEN CHACHA20_NATIVE_BLOCK_LEN /* Keep this updated */ /* IV Lengths */ -#define ARC4_IV_LEN 1 #define AES_GCM_IV_LEN 12 #define AES_CCM_IV_LEN 12 #define AES_XTS_IV_LEN 8 @@ -147,8 +145,6 @@ #define AES_MAX_KEY RIJNDAEL_MAX_KEY #define AES_XTS_MIN_KEY (2 * AES_MIN_KEY) #define AES_XTS_MAX_KEY (2 * AES_MAX_KEY) -#define ARC4_MIN_KEY 1 -#define ARC4_MAX_KEY 32 #define CAMELLIA_MIN_KEY 8 #define CAMELLIA_MAX_KEY 32 Modified: head/sys/opencrypto/xform.c ============================================================================== --- head/sys/opencrypto/xform.c Mon May 11 21:04:59 2020 (r360927) +++ head/sys/opencrypto/xform.c Mon May 11 21:17:08 2020 (r360928) @@ -75,18 +75,6 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_XDATA, "xform", "xform data buffers"); -/* Encryption instances */ -struct enc_xform enc_xform_arc4 = { - CRYPTO_ARC4, "ARC4", - ARC4_BLOCK_LEN, ARC4_IV_LEN, ARC4_MIN_KEY, ARC4_MAX_KEY, - NULL, - NULL, - NULL, - NULL, - NULL, -}; - - /* Include the encryption algorithms */ #include "xform_null.c" #include "xform_des1.c" Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Mon May 11 21:04:59 2020 (r360927) +++ head/sys/opencrypto/xform_enc.h Mon May 11 21:17:08 2020 (r360928) @@ -77,7 +77,6 @@ extern struct enc_xform enc_xform_aes_icm; extern struct enc_xform enc_xform_aes_nist_gcm; extern struct enc_xform enc_xform_aes_nist_gmac; extern struct enc_xform enc_xform_aes_xts; -extern struct enc_xform enc_xform_arc4; extern struct enc_xform enc_xform_camellia; extern struct enc_xform enc_xform_chacha20; extern struct enc_xform enc_xform_ccm; From owner-svn-src-head@freebsd.org Mon May 11 21:22:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B11512ECFB1; Mon, 11 May 2020 21:22:16 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LYmS4KY3z4CR3; Mon, 11 May 2020 21:22:16 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 768FB24E43; Mon, 11 May 2020 21:22:16 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BLMGlW040794; Mon, 11 May 2020 21:22:16 GMT (envelope-from mr@FreeBSD.org) Received: (from mr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BLMGqC040793; Mon, 11 May 2020 21:22:16 GMT (envelope-from mr@FreeBSD.org) Message-Id: <202005112122.04BLMGqC040793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mr set sender to mr@FreeBSD.org using -f From: Michael Reifenberger Date: Mon, 11 May 2020 21:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360929 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: mr X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 360929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:22:16 -0000 Author: mr Date: Mon May 11 21:22:16 2020 New Revision: 360929 URL: https://svnweb.freebsd.org/changeset/base/360929 Log: Add missing sysput.c PR: 237664 Submitted by: ota@j.email.ne.jp Reported by: imb, cy Added: head/usr.bin/systat/sysput.c (contents, props changed) Added: head/usr.bin/systat/sysput.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/systat/sysput.c Mon May 11 21:22:16 2020 (r360929) @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 2019 Yoshihiro Ota + * + * 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. + * + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include + +#include "systat.h" +#include "extern.h" + +void +sysputstrs(WINDOW *wnd, int row, int col, int width) +{ + static char str40[] = "****************************************"; + + mvwaddstr(wnd, row, col, str40 + sizeof(str40) - width - 1); +} + +void +sysputuint64(WINDOW *wnd, int row, int col, int width, uint64_t val, int flags) +{ + char unit, *ptr, *start, wrtbuf[width + width + 1]; + int len; + + unit = 0; + start = wrtbuf; + flags |= HN_NOSPACE; + + if (val > INT64_MAX) + goto error; + else + len = humanize_number(&wrtbuf[width], width + 1, val, "", + HN_AUTOSCALE, flags); + if (len < 0) + goto error; + else if (len < width) + memset(wrtbuf + len, ' ', width - len); + start += len; + + mvwaddstr(wnd, row, col, start); + return; + +error: + sysputstrs(wnd, row, col, width); +} From owner-svn-src-head@freebsd.org Mon May 11 21:23:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9E7F2ED22A; Mon, 11 May 2020 21:23:22 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LYnk4T1Lz4CjX; Mon, 11 May 2020 21:23:22 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94D6324E65; Mon, 11 May 2020 21:23:22 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BLNMDn041052; Mon, 11 May 2020 21:23:22 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BLNMsD041051; Mon, 11 May 2020 21:23:22 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <202005112123.04BLNMsD041051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Mon, 11 May 2020 21:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360930 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 360930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:23:22 -0000 Author: gallatin Date: Mon May 11 21:23:22 2020 New Revision: 360930 URL: https://svnweb.freebsd.org/changeset/base/360930 Log: Fix the build Back out the IPv6 portion of r360903, as the stamp_tag param is apparently not supported in upstream FreeBSD. Sponsored by: Netflix Pointy hat to: gallatin Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Mon May 11 21:22:16 2020 (r360929) +++ head/sys/netinet6/ip6_output.c Mon May 11 21:23:22 2020 (r360930) @@ -353,10 +353,6 @@ ip6_output_send(struct inpcb *inp, struct ifnet *ifp, error = EAGAIN; goto done; } - /* - * Always stamp tags that include NIC ktls. - */ - stamp_tag = true; } #endif #ifdef RATELIMIT From owner-svn-src-head@freebsd.org Mon May 11 21:24:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB51E2ED2D3; Mon, 11 May 2020 21:24:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LYpc3kLrz4Crh; Mon, 11 May 2020 21:24:08 +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 7B22724E6B; Mon, 11 May 2020 21:24:08 +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 04BLO870041142; Mon, 11 May 2020 21:24:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BLO5lf041128; Mon, 11 May 2020 21:24:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112124.04BLO5lf041128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 21:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360931 - in head: share/man/man9 sys/conf sys/crypto/blowfish sys/crypto/blowfish/arch/i386 sys/modules/crypto sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man9 sys/conf sys/crypto/blowfish sys/crypto/blowfish/arch/i386 sys/modules/crypto sys/opencrypto X-SVN-Commit-Revision: 360931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:24:08 -0000 Author: jhb Date: Mon May 11 21:24:05 2020 New Revision: 360931 URL: https://svnweb.freebsd.org/changeset/base/360931 Log: Remove support for the Blowfish algorithm from OCF. It no longer has any in-kernel consumers. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24772 Deleted: head/sys/crypto/blowfish/arch/i386/bf_enc.S head/sys/crypto/blowfish/arch/i386/bf_enc_586.S head/sys/crypto/blowfish/arch/i386/bf_enc_686.S head/sys/crypto/blowfish/bf_ecb.c head/sys/crypto/blowfish/bf_enc.c head/sys/crypto/blowfish/bf_locl.h head/sys/crypto/blowfish/bf_pi.h head/sys/crypto/blowfish/bf_skey.c head/sys/crypto/blowfish/blowfish.h head/sys/opencrypto/xform_blf.c Modified: head/share/man/man9/crypto.9 head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.arm head/sys/conf/files.arm64 head/sys/conf/files.i386 head/sys/conf/files.mips head/sys/conf/files.powerpc head/sys/conf/files.riscv head/sys/modules/crypto/Makefile head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 21:23:22 2020 (r360930) +++ head/share/man/man9/crypto.9 Mon May 11 21:24:05 2020 (r360931) @@ -129,7 +129,6 @@ The following encryption algorithms are supported: .It Dv CRYPTO_AES_CBC .It Dv CRYPTO_AES_ICM .It Dv CRYPTO_AES_XTS -.It Dv CRYPTO_BLF_CBC .It Dv CRYPTO_CAMELLIA_CBC .It Dv CRYPTO_CHACHA20 .It Dv CRYPTO_DES_CBC Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files Mon May 11 21:24:05 2020 (r360931) @@ -680,8 +680,6 @@ contrib/libb2/blake2s-ref.c optional crypto | ipsec | compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual -DSUFFIX=_ref -Wno-unused-function" crypto/blake2/blake2-sw.c optional crypto | ipsec | ipsec_support \ compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual" -crypto/blowfish/bf_ecb.c optional ipsec | ipsec_support -crypto/blowfish/bf_skey.c optional crypto | ipsec | ipsec_support crypto/camellia/camellia.c optional crypto | ipsec | ipsec_support crypto/camellia/camellia-api.c optional crypto | ipsec | ipsec_support crypto/chacha20/chacha.c standard Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files.amd64 Mon May 11 21:24:05 2020 (r360931) @@ -136,7 +136,6 @@ amd64/pci/pci_cfgreg.c optional pci cddl/dev/dtrace/amd64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/amd64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" crypto/aesni/aeskeys_amd64.S optional aesni -crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support crypto/des/des_enc.c optional crypto | ipsec | \ ipsec_support | netsmb dev/acpi_support/acpi_wmi_if.m standard Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files.arm Mon May 11 21:24:05 2020 (r360931) @@ -91,7 +91,6 @@ cddl/compat/opensolaris/kern/opensolaris_atomic.c opti cddl/dev/dtrace/arm/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/arm/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/arm/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" -crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb dev/cpufreq/cpufreq_dt.c optional cpufreq fdt dev/dwc/if_dwc.c optional dwc Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files.arm64 Mon May 11 21:24:05 2020 (r360931) @@ -221,7 +221,6 @@ armv8_crypto_wrap.o optional armv8crypto \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} -I$S/crypto/armv8/ ${WERROR} ${NO_WCAST_QUAL} ${PROF} -march=armv8-a+crypto ${.IMPSRC}" \ no-implicit-rule \ clean "armv8_crypto_wrap.o" -crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb dev/acpica/acpi_bus_if.m optional acpi dev/acpica/acpi_if.m optional acpi Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files.i386 Mon May 11 21:24:05 2020 (r360931) @@ -75,10 +75,6 @@ compat/linux/linux_util.c optional compat_linux compat/linux/linux_vdso.c optional compat_linux compat/linux/linux.c optional compat_linux compat/ndis/winx32_wrap.S optional ndisapi pci -bf_enc.o optional crypto | ipsec | ipsec_support \ - dependency "$S/crypto/blowfish/arch/i386/bf_enc.S $S/crypto/blowfish/arch/i386/bf_enc_586.S $S/crypto/blowfish/arch/i386/bf_enc_686.S" \ - compile-with "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \ - no-implicit-rule crypto/aesni/aeskeys_i386.S optional aesni crypto/des/arch/i386/des_enc.S optional crypto | ipsec | ipsec_support | netsmb dev/agp/agp_ali.c optional agp Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files.mips Mon May 11 21:24:05 2020 (r360931) @@ -82,8 +82,6 @@ mips/mips/sc_machdep.c optional sc dev/uart/uart_cpu_fdt.c optional uart fdt # crypto support -- use generic -crypto/blowfish/bf_enc.c optional crypto | ipsec | \ - ipsec_support crypto/des/des_enc.c optional crypto | ipsec | \ ipsec_support | netsmb Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files.powerpc Mon May 11 21:24:05 2020 (r360931) @@ -14,7 +14,6 @@ cddl/compat/opensolaris/kern/opensolaris_atomic.c op cddl/dev/dtrace/powerpc/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/powerpc/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/powerpc/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" -crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb dev/aacraid/aacraid_endian.c optional aacraid dev/adb/adb_bus.c optional adb Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files.riscv Mon May 11 21:24:05 2020 (r360931) @@ -2,7 +2,6 @@ cddl/dev/dtrace/riscv/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/riscv/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/riscv/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" -crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb dev/ofw/ofw_cpu.c optional fdt dev/ofw/ofwpci.c optional pci fdt Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Mon May 11 21:23:22 2020 (r360930) +++ head/sys/modules/crypto/Makefile Mon May 11 21:24:05 2020 (r360931) @@ -4,7 +4,6 @@ LIBSODIUM=${SRCTOP}/sys/contrib/libsodium/src/libsodiu .PATH: ${SRCTOP}/sys/opencrypto .PATH: ${SRCTOP}/sys/crypto -.PATH: ${SRCTOP}/sys/crypto/blowfish .PATH: ${SRCTOP}/sys/crypto/camellia .PATH: ${SRCTOP}/sys/crypto/des .PATH: ${SRCTOP}/sys/crypto/rijndael @@ -23,7 +22,6 @@ KMOD = crypto SRCS = crypto.c cryptodev_if.c SRCS += criov.c cryptosoft.c xform.c SRCS += cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c -SRCS += bf_enc.c bf_ecb.c bf_skey.c SRCS += camellia.c camellia-api.c SRCS += des_ecb.c des_enc.c des_setkey.c SRCS += sha1.c sha256c.c sha512c.c Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon May 11 21:23:22 2020 (r360930) +++ head/sys/opencrypto/crypto.c Mon May 11 21:24:05 2020 (r360931) @@ -598,8 +598,6 @@ crypto_cipher(const struct crypto_session_params *csp) return (&enc_xform_des); case CRYPTO_3DES_CBC: return (&enc_xform_3des); - case CRYPTO_BLF_CBC: - return (&enc_xform_blf); case CRYPTO_RIJNDAEL128_CBC: return (&enc_xform_rijndael128); case CRYPTO_AES_XTS: @@ -682,7 +680,6 @@ static enum alg_type { } alg_types[] = { [CRYPTO_DES_CBC] = ALG_CIPHER, [CRYPTO_3DES_CBC] = ALG_CIPHER, - [CRYPTO_BLF_CBC] = ALG_CIPHER, [CRYPTO_MD5_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_RIPEMD160_HMAC] = ALG_KEYED_DIGEST, Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Mon May 11 21:23:22 2020 (r360930) +++ head/sys/opencrypto/cryptodev.h Mon May 11 21:24:05 2020 (r360931) @@ -115,7 +115,6 @@ #define NULL_BLOCK_LEN 4 /* IPsec to maintain alignment */ #define DES_BLOCK_LEN 8 #define DES3_BLOCK_LEN 8 -#define BLOWFISH_BLOCK_LEN 8 #define RIJNDAEL128_BLOCK_LEN 16 #define AES_BLOCK_LEN 16 #define AES_ICM_BLOCK_LEN 1 @@ -137,8 +136,6 @@ #define DES_MAX_KEY DES_MIN_KEY #define TRIPLE_DES_MIN_KEY 24 #define TRIPLE_DES_MAX_KEY TRIPLE_DES_MIN_KEY -#define BLOWFISH_MIN_KEY 5 -#define BLOWFISH_MAX_KEY 56 /* 448 bits, max key */ #define RIJNDAEL_MIN_KEY 16 #define RIJNDAEL_MAX_KEY 32 #define AES_MIN_KEY RIJNDAEL_MIN_KEY Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Mon May 11 21:23:22 2020 (r360930) +++ head/sys/opencrypto/cryptosoft.c Mon May 11 21:24:05 2020 (r360931) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/opencrypto/xform.c ============================================================================== --- head/sys/opencrypto/xform.c Mon May 11 21:23:22 2020 (r360930) +++ head/sys/opencrypto/xform.c Mon May 11 21:24:05 2020 (r360931) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -79,7 +78,6 @@ MALLOC_DEFINE(M_XDATA, "xform", "xform data buffers"); #include "xform_null.c" #include "xform_des1.c" #include "xform_des3.c" -#include "xform_blf.c" #include "xform_rijndael.c" #include "xform_aes_icm.c" #include "xform_aes_xts.c" Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Mon May 11 21:23:22 2020 (r360930) +++ head/sys/opencrypto/xform_enc.h Mon May 11 21:24:05 2020 (r360931) @@ -33,7 +33,6 @@ #include #include -#include #include #include #include From owner-svn-src-head@freebsd.org Mon May 11 21:34:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B21062EDA5D; Mon, 11 May 2020 21:34: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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LZ2d4XgXz4Dym; Mon, 11 May 2020 21:34: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 96CDF25055; Mon, 11 May 2020 21:34: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 04BLYXMK047478; Mon, 11 May 2020 21:34:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BLYUpx047459; Mon, 11 May 2020 21:34:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112134.04BLYUpx047459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 21:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360933 - in head: share/man/man4 share/man/man9 sys/conf sys/dev/cesa sys/dev/hifn sys/dev/safe sys/dev/sec sys/mips/cavium/cryptocteon sys/mips/nlm/dev/sec sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man4 share/man/man9 sys/conf sys/dev/cesa sys/dev/hifn sys/dev/safe sys/dev/sec sys/mips/cavium/cryptocteon sys/mips/nlm/dev/sec sys/opencrypto X-SVN-Commit-Revision: 360933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:34:33 -0000 Author: jhb Date: Mon May 11 21:34:29 2020 New Revision: 360933 URL: https://svnweb.freebsd.org/changeset/base/360933 Log: Remove support for DES and Triple DES from OCF. It no longer has any in-kernel consumers via OCF. smbfs still uses single DES directly, so sys/crypto/des remains for that use case. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24773 Deleted: head/sys/opencrypto/xform_des1.c head/sys/opencrypto/xform_des3.c Modified: head/share/man/man4/hifn.4 head/share/man/man4/safe.4 head/share/man/man9/crypto.9 head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.arm head/sys/conf/files.arm64 head/sys/conf/files.i386 head/sys/conf/files.mips head/sys/conf/files.powerpc head/sys/conf/files.riscv head/sys/dev/cesa/cesa.c head/sys/dev/hifn/hifn7751.c head/sys/dev/safe/safe.c head/sys/dev/sec/sec.c head/sys/mips/cavium/cryptocteon/cavium_crypto.c head/sys/mips/cavium/cryptocteon/cryptocteon.c head/sys/mips/cavium/cryptocteon/cryptocteonvar.h head/sys/mips/nlm/dev/sec/nlmsec.c head/sys/mips/nlm/dev/sec/nlmseclib.c head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/xform.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man4/hifn.4 ============================================================================== --- head/share/man/man4/hifn.4 Mon May 11 21:24:22 2020 (r360932) +++ head/share/man/man4/hifn.4 Mon May 11 21:34:29 2020 (r360933) @@ -56,7 +56,7 @@ driver supports various cards containing the Hifn 7751 .Pp The .Nm -driver registers itself to accelerate DES, Triple-DES, +driver registers itself to accelerate AES (7955 and 7956 only), MD5-HMAC, SHA1, and SHA1-HMAC operations for .Xr ipsec 4 Modified: head/share/man/man4/safe.4 ============================================================================== --- head/share/man/man4/safe.4 Mon May 11 21:24:22 2020 (r360932) +++ head/share/man/man4/safe.4 Mon May 11 21:34:29 2020 (r360933) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd April 1, 2006 +.Dd May 11, 2020 .Dt SAFE 4 .Os .Sh NAME @@ -60,7 +60,7 @@ driver supports cards containing SafeNet crypto accele .Pp The .Nm -driver registers itself to accelerate DES, Triple-DES, AES, MD5-HMAC, +driver registers itself to accelerate AES, MD5-HMAC, SHA1-HMAC, and NULL operations for .Xr ipsec 4 and Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 21:24:22 2020 (r360932) +++ head/share/man/man9/crypto.9 Mon May 11 21:34:29 2020 (r360933) @@ -131,8 +131,6 @@ The following encryption algorithms are supported: .It Dv CRYPTO_AES_XTS .It Dv CRYPTO_CAMELLIA_CBC .It Dv CRYPTO_CHACHA20 -.It Dv CRYPTO_DES_CBC -.It Dv CRYPTO_3DES_CBC .It Dv CRYPTO_NULL_CBC .El .Pp Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files Mon May 11 21:34:29 2020 (r360933) @@ -684,8 +684,8 @@ crypto/camellia/camellia.c optional crypto | ipsec | i crypto/camellia/camellia-api.c optional crypto | ipsec | ipsec_support crypto/chacha20/chacha.c standard crypto/chacha20/chacha-sw.c optional crypto | ipsec | ipsec_support -crypto/des/des_ecb.c optional crypto | ipsec | ipsec_support | netsmb -crypto/des/des_setkey.c optional crypto | ipsec | ipsec_support | netsmb +crypto/des/des_ecb.c optional netsmb +crypto/des/des_setkey.c optional netsmb crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi crypto/rijndael/rijndael-alg-fst.c optional crypto | ekcd | geom_bde | \ ipsec | ipsec_support | !random_loadable | wlan_ccmp Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files.amd64 Mon May 11 21:34:29 2020 (r360933) @@ -136,8 +136,7 @@ amd64/pci/pci_cfgreg.c optional pci cddl/dev/dtrace/amd64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/amd64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" crypto/aesni/aeskeys_amd64.S optional aesni -crypto/des/des_enc.c optional crypto | ipsec | \ - ipsec_support | netsmb +crypto/des/des_enc.c optional netsmb dev/acpi_support/acpi_wmi_if.m standard dev/agp/agp_amd64.c optional agp dev/agp/agp_i810.c optional agp Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files.arm Mon May 11 21:34:29 2020 (r360933) @@ -91,7 +91,7 @@ cddl/compat/opensolaris/kern/opensolaris_atomic.c opti cddl/dev/dtrace/arm/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/arm/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/arm/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" -crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb +crypto/des/des_enc.c optional netsmb dev/cpufreq/cpufreq_dt.c optional cpufreq fdt dev/dwc/if_dwc.c optional dwc dev/dwc/if_dwc_if.m optional dwc Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files.arm64 Mon May 11 21:34:29 2020 (r360933) @@ -221,7 +221,7 @@ armv8_crypto_wrap.o optional armv8crypto \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} -I$S/crypto/armv8/ ${WERROR} ${NO_WCAST_QUAL} ${PROF} -march=armv8-a+crypto ${.IMPSRC}" \ no-implicit-rule \ clean "armv8_crypto_wrap.o" -crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb +crypto/des/des_enc.c optional netsmb dev/acpica/acpi_bus_if.m optional acpi dev/acpica/acpi_if.m optional acpi dev/acpica/acpi_pci_link.c optional acpi pci Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files.i386 Mon May 11 21:34:29 2020 (r360933) @@ -76,7 +76,7 @@ compat/linux/linux_vdso.c optional compat_linux compat/linux/linux.c optional compat_linux compat/ndis/winx32_wrap.S optional ndisapi pci crypto/aesni/aeskeys_i386.S optional aesni -crypto/des/arch/i386/des_enc.S optional crypto | ipsec | ipsec_support | netsmb +crypto/des/arch/i386/des_enc.S optional netsmb dev/agp/agp_ali.c optional agp dev/agp/agp_amd.c optional agp dev/agp/agp_amd64.c optional agp Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files.mips Mon May 11 21:34:29 2020 (r360933) @@ -82,8 +82,7 @@ mips/mips/sc_machdep.c optional sc dev/uart/uart_cpu_fdt.c optional uart fdt # crypto support -- use generic -crypto/des/des_enc.c optional crypto | ipsec | \ - ipsec_support | netsmb +crypto/des/des_enc.c optional netsmb # AP common nvram interface MIPS specific, but maybe should be more generic dev/nvram2env/nvram2env_mips.c optional nvram2env Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files.powerpc Mon May 11 21:34:29 2020 (r360933) @@ -14,7 +14,7 @@ cddl/compat/opensolaris/kern/opensolaris_atomic.c op cddl/dev/dtrace/powerpc/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/powerpc/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/powerpc/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" -crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb +crypto/des/des_enc.c optional netsmb dev/aacraid/aacraid_endian.c optional aacraid dev/adb/adb_bus.c optional adb dev/adb/adb_kbd.c optional adb Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files.riscv Mon May 11 21:34:29 2020 (r360933) @@ -2,7 +2,7 @@ cddl/dev/dtrace/riscv/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/riscv/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/riscv/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" -crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb +crypto/des/des_enc.c optional netsmb dev/ofw/ofw_cpu.c optional fdt dev/ofw/ofwpci.c optional pci fdt dev/pci/pci_host_generic.c optional pci Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Mon May 11 21:24:22 2020 (r360932) +++ head/sys/dev/cesa/cesa.c Mon May 11 21:34:29 2020 (r360933) @@ -1577,14 +1577,6 @@ cesa_cipher_supported(const struct crypto_session_para if (csp->csp_ivlen != AES_BLOCK_LEN) return (false); break; - case CRYPTO_DES_CBC: - if (csp->csp_ivlen != DES_BLOCK_LEN) - return (false); - break; - case CRYPTO_3DES_CBC: - if (csp->csp_ivlen != DES3_BLOCK_LEN) - return (false); - break; default: return (false); } @@ -1672,15 +1664,6 @@ cesa_newsession(device_t dev, crypto_session_t cses, case CRYPTO_AES_CBC: cs->cs_config |= CESA_CSHD_AES | CESA_CSHD_CBC; cs->cs_ivlen = AES_BLOCK_LEN; - break; - case CRYPTO_DES_CBC: - cs->cs_config |= CESA_CSHD_DES | CESA_CSHD_CBC; - cs->cs_ivlen = DES_BLOCK_LEN; - break; - case CRYPTO_3DES_CBC: - cs->cs_config |= CESA_CSHD_3DES | CESA_CSHD_3DES_EDE | - CESA_CSHD_CBC; - cs->cs_ivlen = DES3_BLOCK_LEN; break; } Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Mon May 11 21:24:22 2020 (r360932) +++ head/sys/dev/hifn/hifn7751.c Mon May 11 21:34:29 2020 (r360933) @@ -1604,14 +1604,6 @@ hifn_write_command(struct hifn_command *cmd, u_int8_t if (using_crypt && cmd->cry_masks & HIFN_CRYPT_CMD_NEW_KEY) { switch (cmd->cry_masks & HIFN_CRYPT_CMD_ALG_MASK) { - case HIFN_CRYPT_CMD_ALG_3DES: - bcopy(cmd->ck, buf_pos, HIFN_3DES_KEY_LENGTH); - buf_pos += HIFN_3DES_KEY_LENGTH; - break; - case HIFN_CRYPT_CMD_ALG_DES: - bcopy(cmd->ck, buf_pos, HIFN_DES_KEY_LENGTH); - buf_pos += HIFN_DES_KEY_LENGTH; - break; case HIFN_CRYPT_CMD_ALG_AES: /* * AES keys are variable 128, 192 and @@ -2328,8 +2320,6 @@ hifn_cipher_supported(struct hifn_softc *sc, switch (sc->sc_ena) { case HIFN_PUSTAT_ENA_2: switch (csp->csp_cipher_alg) { - case CRYPTO_3DES_CBC: - break; case CRYPTO_AES_CBC: if ((sc->sc_flags & HIFN_HAS_AES) == 0) return (false); @@ -2343,13 +2333,6 @@ hifn_cipher_supported(struct hifn_softc *sc, } return (true); } - /*FALLTHROUGH*/ - case HIFN_PUSTAT_ENA_1: - switch (csp->csp_cipher_alg) { - case CRYPTO_DES_CBC: - return (true); - } - break; } return (false); } @@ -2448,16 +2431,6 @@ hifn_process(device_t dev, struct cryptop *crp, int hi cmd->base_masks |= HIFN_BASE_CMD_DECODE; cmd->base_masks |= HIFN_BASE_CMD_CRYPT; switch (csp->csp_cipher_alg) { - case CRYPTO_DES_CBC: - cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_DES | - HIFN_CRYPT_CMD_MODE_CBC | - HIFN_CRYPT_CMD_NEW_IV; - break; - case CRYPTO_3DES_CBC: - cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_3DES | - HIFN_CRYPT_CMD_MODE_CBC | - HIFN_CRYPT_CMD_NEW_IV; - break; case CRYPTO_AES_CBC: cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_AES | HIFN_CRYPT_CMD_MODE_CBC | Modified: head/sys/dev/safe/safe.c ============================================================================== --- head/sys/dev/safe/safe.c Mon May 11 21:24:22 2020 (r360932) +++ head/sys/dev/safe/safe.c Mon May 11 21:34:29 2020 (r360933) @@ -694,20 +694,6 @@ safe_cipher_supported(struct safe_softc *sc, { switch (csp->csp_cipher_alg) { - case CRYPTO_DES_CBC: - case CRYPTO_3DES_CBC: - if ((sc->sc_devinfo & SAFE_DEVINFO_DES) == 0) - return (false); - if (csp->csp_ivlen != 8) - return (false); - if (csp->csp_cipher_alg == CRYPTO_DES_CBC) { - if (csp->csp_cipher_klen != 8) - return (false); - } else { - if (csp->csp_cipher_klen != 24) - return (false); - } - break; case CRYPTO_AES_CBC: if ((sc->sc_devinfo & SAFE_DEVINFO_AES) == 0) return (false); @@ -866,14 +852,6 @@ safe_process(device_t dev, struct cryptop *crp, int hi safe_setup_enckey(ses, crp->crp_cipher_key); switch (csp->csp_cipher_alg) { - case CRYPTO_DES_CBC: - cmd0 |= SAFE_SA_CMD0_DES; - cmd1 |= SAFE_SA_CMD1_CBC; - break; - case CRYPTO_3DES_CBC: - cmd0 |= SAFE_SA_CMD0_3DES; - cmd1 |= SAFE_SA_CMD1_CBC; - break; case CRYPTO_AES_CBC: cmd0 |= SAFE_SA_CMD0_AES; cmd1 |= SAFE_SA_CMD1_CBC; Modified: head/sys/dev/sec/sec.c ============================================================================== --- head/sys/dev/sec/sec.c Mon May 11 21:24:22 2020 (r360932) +++ head/sys/dev/sec/sec.c Mon May 11 21:34:29 2020 (r360933) @@ -106,12 +106,6 @@ static int sec_aesu_make_desc(struct sec_softc *sc, const struct crypto_session_params *csp, struct sec_desc *desc, struct cryptop *crp); -/* DEU */ -static bool sec_deu_newsession(const struct crypto_session_params *csp); -static int sec_deu_make_desc(struct sec_softc *sc, - const struct crypto_session_params *csp, struct sec_desc *desc, - struct cryptop *crp); - /* MDEU */ static bool sec_mdeu_can_handle(u_int alg); static int sec_mdeu_config(const struct crypto_session_params *csp, @@ -154,10 +148,6 @@ static struct sec_eu_methods sec_eus[] = { sec_aesu_make_desc, }, { - sec_deu_newsession, - sec_deu_make_desc, - }, - { sec_mdeu_newsession, sec_mdeu_make_desc, }, @@ -1147,12 +1137,6 @@ sec_cipher_supported(const struct crypto_session_param if (csp->csp_ivlen != AES_BLOCK_LEN) return (false); break; - case CRYPTO_DES_CBC: - case CRYPTO_3DES_CBC: - /* DEU */ - if (csp->csp_ivlen != DES_BLOCK_LEN) - return (false); - break; default: return (false); } @@ -1462,55 +1446,6 @@ sec_aesu_make_desc(struct sec_softc *sc, if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { hd->shd_mode0 |= SEC_AESU_MODE_ED; - hd->shd_dir = 0; - } else - hd->shd_dir = 1; - - if (csp->csp_mode == CSP_MODE_ETA) - error = sec_build_common_s_desc(sc, desc, csp, crp); - else - error = sec_build_common_ns_desc(sc, desc, csp, crp); - - return (error); -} - -/* DEU */ - -static bool -sec_deu_newsession(const struct crypto_session_params *csp) -{ - - switch (csp->csp_cipher_alg) { - case CRYPTO_DES_CBC: - case CRYPTO_3DES_CBC: - return (true); - default: - return (false); - } -} - -static int -sec_deu_make_desc(struct sec_softc *sc, const struct crypto_session_params *csp, - struct sec_desc *desc, struct cryptop *crp) -{ - struct sec_hw_desc *hd = desc->sd_desc; - int error; - - hd->shd_eu_sel0 = SEC_EU_DEU; - hd->shd_mode0 = SEC_DEU_MODE_CBC; - - switch (csp->csp_cipher_alg) { - case CRYPTO_3DES_CBC: - hd->shd_mode0 |= SEC_DEU_MODE_TS; - break; - case CRYPTO_DES_CBC: - break; - default: - return (EINVAL); - } - - if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { - hd->shd_mode0 |= SEC_DEU_MODE_ED; hd->shd_dir = 0; } else hd->shd_dir = 1; Modified: head/sys/mips/cavium/cryptocteon/cavium_crypto.c ============================================================================== --- head/sys/mips/cavium/cryptocteon/cavium_crypto.c Mon May 11 21:24:22 2020 (r360932) +++ head/sys/mips/cavium/cryptocteon/cavium_crypto.c Mon May 11 21:34:29 2020 (r360933) @@ -90,12 +90,10 @@ __FBSDID("$FreeBSD$"); } while (0) #define ESP_HEADER_LENGTH 8 -#define DES_CBC_IV_LENGTH 8 #define AES_CBC_IV_LENGTH 16 #define ESP_HMAC_LEN 12 #define ESP_HEADER_LENGTH 8 -#define DES_CBC_IV_LENGTH 8 /****************************************************************************/ @@ -320,125 +318,6 @@ octo_calc_hash(uint8_t auth, unsigned char *key, uint6 } /****************************************************************************/ -/* DES functions */ - -int -octo_des_cbc_encrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - uint64_t *data; - int data_i, data_l; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - - /* load 3DES Key */ - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - if (od->octo_encklen == 24) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - } else if (od->octo_encklen == 8) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - - CVMX_MT_3DES_IV(* (uint64_t *) ivp); - - while (crypt_off > 0) { - IOV_CONSUME(iov, data, data_i, data_l); - crypt_off -= 8; - } - - while (crypt_len > 0) { - CVMX_MT_3DES_ENC_CBC(*data); - CVMX_MF_3DES_RESULT(*data); - IOV_CONSUME(iov, data, data_i, data_l); - crypt_len -= 8; - } - - return 0; -} - - -int -octo_des_cbc_decrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - uint64_t *data; - int data_i, data_l; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - /* load 3DES Key */ - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - if (od->octo_encklen == 24) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - } else if (od->octo_encklen == 8) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - - CVMX_MT_3DES_IV(* (uint64_t *) ivp); - - while (crypt_off > 0) { - IOV_CONSUME(iov, data, data_i, data_l); - crypt_off -= 8; - } - - while (crypt_len > 0) { - CVMX_MT_3DES_DEC_CBC(*data); - CVMX_MF_3DES_RESULT(*data); - IOV_CONSUME(iov, data, data_i, data_l); - crypt_len -= 8; - } - - return 0; -} - -/****************************************************************************/ /* AES functions */ int @@ -773,593 +652,6 @@ octo_null_sha1_encrypt( data++; CVMX_MF_HSH_IV(tmp1, 1); *(uint32_t *)data = (uint32_t) (tmp1 >> 32); - - return 0; -} - -/****************************************************************************/ -/* DES MD5 */ - -int -octo_des_cbc_md5_encrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - int next = 0; - union { - uint32_t data32[2]; - uint64_t data64[1]; - } mydata; - uint64_t *data = &mydata.data64[0]; - uint32_t *data32; - uint64_t tmp1, tmp2; - int data_i, data_l, alen = auth_len; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x3) || (crypt_off + crypt_len > iovlen) || - (crypt_len & 0x7) || - (auth_len & 0x7) || - (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data32, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - /* load 3DES Key */ - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - if (od->octo_encklen == 24) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - } else if (od->octo_encklen == 8) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - - CVMX_MT_3DES_IV(* (uint64_t *) ivp); - - /* Load MD5 IV */ - CVMX_MT_HSH_IV(od->octo_hminner[0], 0); - CVMX_MT_HSH_IV(od->octo_hminner[1], 1); - - while (crypt_off > 0 && auth_off > 0) { - IOV_CONSUME(iov, data32, data_i, data_l); - crypt_off -= 4; - auth_off -= 4; - } - - while (crypt_len > 0 || auth_len > 0) { - uint32_t *first = data32; - mydata.data32[0] = *first; - IOV_CONSUME(iov, data32, data_i, data_l); - mydata.data32[1] = *data32; - if (crypt_off <= 0) { - if (crypt_len > 0) { - CVMX_MT_3DES_ENC_CBC(*data); - CVMX_MF_3DES_RESULT(*data); - crypt_len -= 8; - } - } else - crypt_off -= 8; - if (auth_off <= 0) { - if (auth_len > 0) { - CVM_LOAD_MD5_UNIT(*data, next); - auth_len -= 8; - } - } else - auth_off -= 8; - *first = mydata.data32[0]; - *data32 = mydata.data32[1]; - IOV_CONSUME(iov, data32, data_i, data_l); - } - - /* finish the hash */ - CVMX_PREFETCH0(od->octo_hmouter); -#if 0 - if (__predict_false(inplen)) { - uint64_t tmp = 0; - uint8_t *p = (uint8_t *) & tmp; - p[inplen] = 0x80; - do { - inplen--; - p[inplen] = ((uint8_t *) data)[inplen]; - } while (inplen); - CVM_LOAD_MD5_UNIT(tmp, next); - } else { - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); - } -#else - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); -#endif - - /* Finish Inner hash */ - while (next != 7) { - CVM_LOAD_MD5_UNIT(((uint64_t) 0x0ULL), next); - } - CVMX_ES64(tmp1, ((alen + 64) << 3)); - CVM_LOAD_MD5_UNIT(tmp1, next); - - /* Get the inner hash of HMAC */ - CVMX_MF_HSH_IV(tmp1, 0); - CVMX_MF_HSH_IV(tmp2, 1); - - /* Initialize hash unit */ - CVMX_MT_HSH_IV(od->octo_hmouter[0], 0); - CVMX_MT_HSH_IV(od->octo_hmouter[1], 1); - - CVMX_MT_HSH_DAT(tmp1, 0); - CVMX_MT_HSH_DAT(tmp2, 1); - CVMX_MT_HSH_DAT(0x8000000000000000ULL, 2); - CVMX_MT_HSH_DATZ(3); - CVMX_MT_HSH_DATZ(4); - CVMX_MT_HSH_DATZ(5); - CVMX_MT_HSH_DATZ(6); - CVMX_ES64(tmp1, ((64 + 16) << 3)); - CVMX_MT_HSH_STARTMD5(tmp1); - - /* save the HMAC */ - data32 = (uint32_t *)icv; - CVMX_MF_HSH_IV(tmp1, 0); - *data32 = (uint32_t) (tmp1 >> 32); - data32++; - *data32 = (uint32_t) tmp1; - data32++; - CVMX_MF_HSH_IV(tmp1, 1); - *data32 = (uint32_t) (tmp1 >> 32); - - return 0; -} - -int -octo_des_cbc_md5_decrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - int next = 0; - union { - uint32_t data32[2]; - uint64_t data64[1]; - } mydata; - uint64_t *data = &mydata.data64[0]; - uint32_t *data32; - uint64_t tmp1, tmp2; - int data_i, data_l, alen = auth_len; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x3) || (crypt_off + crypt_len > iovlen) || - (crypt_len & 0x7) || - (auth_len & 0x7) || - (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data32, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - /* load 3DES Key */ - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - if (od->octo_encklen == 24) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - } else if (od->octo_encklen == 8) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - - CVMX_MT_3DES_IV(* (uint64_t *) ivp); - - /* Load MD5 IV */ - CVMX_MT_HSH_IV(od->octo_hminner[0], 0); - CVMX_MT_HSH_IV(od->octo_hminner[1], 1); - - while (crypt_off > 0 && auth_off > 0) { - IOV_CONSUME(iov, data32, data_i, data_l); - crypt_off -= 4; - auth_off -= 4; - } - - while (crypt_len > 0 || auth_len > 0) { - uint32_t *first = data32; - mydata.data32[0] = *first; - IOV_CONSUME(iov, data32, data_i, data_l); - mydata.data32[1] = *data32; - if (auth_off <= 0) { - if (auth_len > 0) { - CVM_LOAD_MD5_UNIT(*data, next); - auth_len -= 8; - } - } else - auth_off -= 8; - if (crypt_off <= 0) { - if (crypt_len > 0) { - CVMX_MT_3DES_DEC_CBC(*data); - CVMX_MF_3DES_RESULT(*data); - crypt_len -= 8; - } - } else - crypt_off -= 8; - *first = mydata.data32[0]; - *data32 = mydata.data32[1]; - IOV_CONSUME(iov, data32, data_i, data_l); - } - - /* finish the hash */ - CVMX_PREFETCH0(od->octo_hmouter); -#if 0 - if (__predict_false(inplen)) { - uint64_t tmp = 0; - uint8_t *p = (uint8_t *) & tmp; - p[inplen] = 0x80; - do { - inplen--; - p[inplen] = ((uint8_t *) data)[inplen]; - } while (inplen); - CVM_LOAD_MD5_UNIT(tmp, next); - } else { - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); - } -#else - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); -#endif - - /* Finish Inner hash */ - while (next != 7) { - CVM_LOAD_MD5_UNIT(((uint64_t) 0x0ULL), next); - } - CVMX_ES64(tmp1, ((alen + 64) << 3)); - CVM_LOAD_MD5_UNIT(tmp1, next); - - /* Get the inner hash of HMAC */ - CVMX_MF_HSH_IV(tmp1, 0); - CVMX_MF_HSH_IV(tmp2, 1); - - /* Initialize hash unit */ - CVMX_MT_HSH_IV(od->octo_hmouter[0], 0); - CVMX_MT_HSH_IV(od->octo_hmouter[1], 1); - - CVMX_MT_HSH_DAT(tmp1, 0); - CVMX_MT_HSH_DAT(tmp2, 1); - CVMX_MT_HSH_DAT(0x8000000000000000ULL, 2); - CVMX_MT_HSH_DATZ(3); - CVMX_MT_HSH_DATZ(4); - CVMX_MT_HSH_DATZ(5); - CVMX_MT_HSH_DATZ(6); - CVMX_ES64(tmp1, ((64 + 16) << 3)); - CVMX_MT_HSH_STARTMD5(tmp1); - - /* save the HMAC */ - data32 = (uint32_t *)icv; - CVMX_MF_HSH_IV(tmp1, 0); - *data32 = (uint32_t) (tmp1 >> 32); - data32++; - *data32 = (uint32_t) tmp1; - data32++; - CVMX_MF_HSH_IV(tmp1, 1); - *data32 = (uint32_t) (tmp1 >> 32); - - return 0; -} - -/****************************************************************************/ -/* DES SHA */ - -int -octo_des_cbc_sha1_encrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - int next = 0; - union { - uint32_t data32[2]; - uint64_t data64[1]; - } mydata; - uint64_t *data = &mydata.data64[0]; - uint32_t *data32; - uint64_t tmp1, tmp2, tmp3; - int data_i, data_l, alen = auth_len; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x3) || (crypt_off + crypt_len > iovlen) || - (crypt_len & 0x7) || - (auth_len & 0x7) || - (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data32, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - /* load 3DES Key */ - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - if (od->octo_encklen == 24) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - } else if (od->octo_encklen == 8) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - - CVMX_MT_3DES_IV(* (uint64_t *) ivp); - - /* Load SHA1 IV */ - CVMX_MT_HSH_IV(od->octo_hminner[0], 0); - CVMX_MT_HSH_IV(od->octo_hminner[1], 1); - CVMX_MT_HSH_IV(od->octo_hminner[2], 2); - - while (crypt_off > 0 && auth_off > 0) { - IOV_CONSUME(iov, data32, data_i, data_l); - crypt_off -= 4; - auth_off -= 4; - } - - while (crypt_len > 0 || auth_len > 0) { - uint32_t *first = data32; - mydata.data32[0] = *first; - IOV_CONSUME(iov, data32, data_i, data_l); - mydata.data32[1] = *data32; - if (crypt_off <= 0) { - if (crypt_len > 0) { - CVMX_MT_3DES_ENC_CBC(*data); - CVMX_MF_3DES_RESULT(*data); - crypt_len -= 8; - } - } else - crypt_off -= 8; - if (auth_off <= 0) { - if (auth_len > 0) { - CVM_LOAD_SHA_UNIT(*data, next); - auth_len -= 8; - } - } else - auth_off -= 8; - *first = mydata.data32[0]; - *data32 = mydata.data32[1]; - IOV_CONSUME(iov, data32, data_i, data_l); - } - - /* finish the hash */ - CVMX_PREFETCH0(od->octo_hmouter); -#if 0 - if (__predict_false(inplen)) { - uint64_t tmp = 0; - uint8_t *p = (uint8_t *) & tmp; - p[inplen] = 0x80; - do { - inplen--; - p[inplen] = ((uint8_t *) data)[inplen]; - } while (inplen); - CVM_LOAD_SHA_UNIT(tmp, next); - } else { - CVM_LOAD_SHA_UNIT(0x8000000000000000ULL, next); - } -#else - CVM_LOAD_SHA_UNIT(0x8000000000000000ULL, next); -#endif - - /* Finish Inner hash */ - while (next != 7) { - CVM_LOAD_SHA_UNIT(((uint64_t) 0x0ULL), next); - } - CVM_LOAD_SHA_UNIT((uint64_t) ((alen + 64) << 3), next); - - /* Get the inner hash of HMAC */ - CVMX_MF_HSH_IV(tmp1, 0); - CVMX_MF_HSH_IV(tmp2, 1); - tmp3 = 0; - CVMX_MF_HSH_IV(tmp3, 2); - - /* Initialize hash unit */ - CVMX_MT_HSH_IV(od->octo_hmouter[0], 0); - CVMX_MT_HSH_IV(od->octo_hmouter[1], 1); - CVMX_MT_HSH_IV(od->octo_hmouter[2], 2); - - CVMX_MT_HSH_DAT(tmp1, 0); - CVMX_MT_HSH_DAT(tmp2, 1); - tmp3 |= 0x0000000080000000; - CVMX_MT_HSH_DAT(tmp3, 2); - CVMX_MT_HSH_DATZ(3); - CVMX_MT_HSH_DATZ(4); - CVMX_MT_HSH_DATZ(5); - CVMX_MT_HSH_DATZ(6); - CVMX_MT_HSH_STARTSHA((uint64_t) ((64 + 20) << 3)); - - /* save the HMAC */ - data32 = (uint32_t *)icv; - CVMX_MF_HSH_IV(tmp1, 0); - *data32 = (uint32_t) (tmp1 >> 32); - data32++; - *data32 = (uint32_t) tmp1; - data32++; - CVMX_MF_HSH_IV(tmp1, 1); - *data32 = (uint32_t) (tmp1 >> 32); - - return 0; -} - -int -octo_des_cbc_sha1_decrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - int next = 0; - union { - uint32_t data32[2]; - uint64_t data64[1]; - } mydata; - uint64_t *data = &mydata.data64[0]; - uint32_t *data32; - uint64_t tmp1, tmp2, tmp3; - int data_i, data_l, alen = auth_len; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x3) || (crypt_off + crypt_len > iovlen) || - (crypt_len & 0x7) || - (auth_len & 0x7) || - (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data32, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - /* load 3DES Key */ - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - if (od->octo_encklen == 24) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - } else if (od->octo_encklen == 8) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - - CVMX_MT_3DES_IV(* (uint64_t *) ivp); - - /* Load SHA1 IV */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon May 11 21:39:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E80132EDB31; Mon, 11 May 2020 21:39: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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LZ7p5rpGz4FCD; Mon, 11 May 2020 21:39: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 C3F032507D; Mon, 11 May 2020 21:39: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 04BLd238047739; Mon, 11 May 2020 21:39:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BLd2jr047738; Mon, 11 May 2020 21:39:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112139.04BLd2jr047738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 21:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360934 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 360934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:39:03 -0000 Author: jhb Date: Mon May 11 21:39:02 2020 New Revision: 360934 URL: https://svnweb.freebsd.org/changeset/base/360934 Log: kgssapi no longer supports RC4, so don't list it as a build dependency. Reviewed by: cem Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24774 Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 11 21:34:29 2020 (r360933) +++ head/sys/conf/files Mon May 11 21:39:02 2020 (r360934) @@ -686,7 +686,7 @@ crypto/chacha20/chacha.c standard crypto/chacha20/chacha-sw.c optional crypto | ipsec | ipsec_support crypto/des/des_ecb.c optional netsmb crypto/des/des_setkey.c optional netsmb -crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi +crypto/rc4/rc4.c optional netgraph_mppc_encryption crypto/rijndael/rijndael-alg-fst.c optional crypto | ekcd | geom_bde | \ ipsec | ipsec_support | !random_loadable | wlan_ccmp crypto/rijndael/rijndael-api-fst.c optional ekcd | geom_bde | !random_loadable From owner-svn-src-head@freebsd.org Mon May 11 21:42:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E07322EDD4C; Mon, 11 May 2020 21:42:19 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LZCb5fjXz4Fcr; Mon, 11 May 2020 21:42:19 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD40725255; Mon, 11 May 2020 21:42:19 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BLgJYj052525; Mon, 11 May 2020 21:42:19 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BLgJNB052524; Mon, 11 May 2020 21:42:19 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202005112142.04BLgJNB052524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 11 May 2020 21:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360935 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 360935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:42:19 -0000 Author: kp Date: Mon May 11 21:42:19 2020 New Revision: 360935 URL: https://svnweb.freebsd.org/changeset/base/360935 Log: opencrypto: Add missing ioctl exit SDTs The opencrypto ioctl code has very useful probe points at the various exit points. These allow us to figure out exactly why a request failed. However, a few paths did not have these probe points. Add them here. Reviewed by: jhb Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Mon May 11 21:39:02 2020 (r360934) +++ head/sys/opencrypto/cryptodev.c Mon May 11 21:42:19 2020 (r360935) @@ -465,6 +465,8 @@ cryptof_ioctl( /* Should always be paired with GCM. */ if (sop->cipher != CRYPTO_AES_NIST_GCM_16) { CRYPTDEB("GMAC without GCM"); + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); return (EINVAL); } break; @@ -539,8 +541,10 @@ cryptof_ioctl( return (EINVAL); } - if (txform == NULL && thash == NULL) + if (txform == NULL && thash == NULL) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); + } memset(&csp, 0, sizeof(csp)); @@ -550,13 +554,18 @@ cryptof_ioctl( case CRYPTO_AES_128_NIST_GMAC: case CRYPTO_AES_192_NIST_GMAC: case CRYPTO_AES_256_NIST_GMAC: - if (sop->keylen != sop->mackeylen) + if (sop->keylen != sop->mackeylen) { + SDT_PROBE1(opencrypto, dev, ioctl, + error, __LINE__); return (EINVAL); + } break; #endif case 0: break; default: + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); return (EINVAL); } csp.csp_mode = CSP_MODE_AEAD; @@ -564,14 +573,19 @@ cryptof_ioctl( switch (sop->mac) { #ifdef COMPAT_FREEBSD12 case CRYPTO_AES_CCM_CBC_MAC: - if (sop->keylen != sop->mackeylen) + if (sop->keylen != sop->mackeylen) { + SDT_PROBE1(opencrypto, dev, ioctl, + error, __LINE__); return (EINVAL); + } thash = NULL; break; #endif case 0: break; default: + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); return (EINVAL); } csp.csp_mode = CSP_MODE_AEAD; From owner-svn-src-head@freebsd.org Mon May 11 22:08:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D28352EE60F; Mon, 11 May 2020 22:08: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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LZnS5Y6rz4Grx; Mon, 11 May 2020 22:08: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 B4FEB25646; Mon, 11 May 2020 22:08: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 04BM8CX4065868; Mon, 11 May 2020 22:08:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BM880f065840; Mon, 11 May 2020 22:08:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112208.04BM880f065840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 22:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360936 - in head: share/man/man4 share/man/man9 sys/crypto/via sys/dev/cesa sys/dev/glxsb sys/dev/hifn sys/dev/safe sys/dev/sec sys/mips/cavium/cryptocteon sys/mips/nlm/dev/sec sys/ope... X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man4 share/man/man9 sys/crypto/via sys/dev/cesa sys/dev/glxsb sys/dev/hifn sys/dev/safe sys/dev/sec sys/mips/cavium/cryptocteon sys/mips/nlm/dev/sec sys/opencrypto X-SVN-Commit-Revision: 360936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:08:12 -0000 Author: jhb Date: Mon May 11 22:08:08 2020 New Revision: 360936 URL: https://svnweb.freebsd.org/changeset/base/360936 Log: Remove MD5 HMAC from OCF. There are no in-kernel consumers. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24775 Deleted: head/sys/opencrypto/xform_md5.c Modified: head/share/man/man4/hifn.4 head/share/man/man4/safe.4 head/share/man/man9/crypto.9 head/sys/crypto/via/padlock_hash.c head/sys/dev/cesa/cesa.c head/sys/dev/glxsb/glxsb.c head/sys/dev/hifn/hifn7751.c head/sys/dev/safe/safe.c head/sys/dev/sec/sec.c head/sys/mips/cavium/cryptocteon/cavium_crypto.c head/sys/mips/cavium/cryptocteon/cryptocteon.c head/sys/mips/cavium/cryptocteon/cryptocteonvar.h head/sys/mips/nlm/dev/sec/nlmsec.c head/sys/mips/nlm/dev/sec/nlmseclib.c head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform.c head/sys/opencrypto/xform.h head/sys/opencrypto/xform_auth.h Modified: head/share/man/man4/hifn.4 ============================================================================== --- head/share/man/man4/hifn.4 Mon May 11 21:42:19 2020 (r360935) +++ head/share/man/man4/hifn.4 Mon May 11 22:08:08 2020 (r360936) @@ -58,7 +58,7 @@ The .Nm driver registers itself to accelerate AES (7955 and 7956 only), -MD5-HMAC, SHA1, and SHA1-HMAC operations for +SHA1, and SHA1-HMAC operations for .Xr ipsec 4 and .Xr crypto 4 . Modified: head/share/man/man4/safe.4 ============================================================================== --- head/share/man/man4/safe.4 Mon May 11 21:42:19 2020 (r360935) +++ head/share/man/man4/safe.4 Mon May 11 22:08:08 2020 (r360936) @@ -60,7 +60,7 @@ driver supports cards containing SafeNet crypto accele .Pp The .Nm -driver registers itself to accelerate AES, MD5-HMAC, +driver registers itself to accelerate AES, SHA1-HMAC, and NULL operations for .Xr ipsec 4 and Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 21:42:19 2020 (r360935) +++ head/share/man/man9/crypto.9 Mon May 11 22:08:08 2020 (r360936) @@ -106,7 +106,6 @@ The following authentication algorithms are supported: .It Dv CRYPTO_AES_NIST_GMAC .It Dv CRYPTO_BLAKE2B .It Dv CRYPTO_BLAKE2S -.It Dv CRYPTO_MD5_HMAC .It Dv CRYPTO_NULL_HMAC .It Dv CRYPTO_POLY1305 .It Dv CRYPTO_RIPEMD160 Modified: head/sys/crypto/via/padlock_hash.c ============================================================================== --- head/sys/crypto/via/padlock_hash.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/crypto/via/padlock_hash.c Mon May 11 22:08:08 2020 (r360936) @@ -321,9 +321,6 @@ padlock_hash_lookup(int alg) case CRYPTO_NULL_HMAC: axf = &auth_hash_null; break; - case CRYPTO_MD5_HMAC: - axf = &auth_hash_hmac_md5; - break; case CRYPTO_SHA1_HMAC: if ((via_feature_xcrypt & VIA_HAS_SHA) != 0) axf = &padlock_hmac_sha1; Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/dev/cesa/cesa.c Mon May 11 22:08:08 2020 (r360936) @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -434,14 +433,6 @@ cesa_set_mkey(struct cesa_session *cs, int alg, const hout = (uint32_t *)cs->cs_hiv_out; switch (alg) { - case CRYPTO_MD5_HMAC: - hmac_init_ipad(&auth_hash_hmac_md5, mkey, mklen, &auth_ctx); - memcpy(hin, auth_ctx.md5ctx.state, - sizeof(auth_ctx.md5ctx.state)); - hmac_init_opad(&auth_hash_hmac_md5, mkey, mklen, &auth_ctx); - memcpy(hout, auth_ctx.md5ctx.state, - sizeof(auth_ctx.md5ctx.state)); - break; case CRYPTO_SHA1_HMAC: hmac_init_ipad(&auth_hash_hmac_sha1, mkey, mklen, &auth_ctx); memcpy(hin, auth_ctx.sha1ctx.h.b32, @@ -1599,7 +1590,6 @@ cesa_auth_supported(struct cesa_softc *sc, sc->sc_soc_id == MV_DEV_88F6810)) return (false); /* FALLTHROUGH */ - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: break; @@ -1668,14 +1658,6 @@ cesa_newsession(device_t dev, crypto_session_t cses, } switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - cs->cs_mblen = MD5_BLOCK_LEN; - cs->cs_hlen = (csp->csp_auth_mlen == 0) ? MD5_HASH_LEN : - csp->csp_auth_mlen; - cs->cs_config |= CESA_CSHD_MD5_HMAC; - if (cs->cs_hlen == CESA_HMAC_TRUNC_LEN) - cs->cs_config |= CESA_CSHD_96_BIT_HMAC; - break; case CRYPTO_SHA1: cs->cs_mblen = 1; cs->cs_hlen = (csp->csp_auth_mlen == 0) ? SHA1_HASH_LEN : Modified: head/sys/dev/glxsb/glxsb.c ============================================================================== --- head/sys/dev/glxsb/glxsb.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/dev/glxsb/glxsb.c Mon May 11 22:08:08 2020 (r360936) @@ -497,7 +497,6 @@ glxsb_crypto_probesession(device_t dev, const struct c case CSP_MODE_ETA: switch (csp->csp_auth_alg) { case CRYPTO_NULL_HMAC: - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: case CRYPTO_RIPEMD160_HMAC: case CRYPTO_SHA2_256_HMAC: Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/dev/hifn/hifn7751.c Mon May 11 22:08:08 2020 (r360936) @@ -2296,7 +2296,6 @@ hifn_auth_supported(struct hifn_softc *sc, switch (csp->csp_auth_alg) { case CRYPTO_SHA1: break; - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: if (csp->csp_auth_klen > HIFN_MAC_KEY_LENGTH) return (false); @@ -2478,11 +2477,6 @@ hifn_process(device_t dev, struct cryptop *crp, int hi cmd->base_masks |= HIFN_BASE_CMD_MAC; switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - cmd->mac_masks |= HIFN_MAC_CMD_ALG_MD5 | - HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HMAC | - HIFN_MAC_CMD_POS_IPSEC | HIFN_MAC_CMD_TRUNC; - break; case CRYPTO_SHA1: cmd->mac_masks |= HIFN_MAC_CMD_ALG_SHA1 | HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HASH | @@ -2495,8 +2489,7 @@ hifn_process(device_t dev, struct cryptop *crp, int hi break; } - if (csp->csp_auth_alg == CRYPTO_SHA1_HMAC || - csp->csp_auth_alg == CRYPTO_MD5_HMAC) { + if (csp->csp_auth_alg == CRYPTO_SHA1_HMAC) { cmd->mac_masks |= HIFN_MAC_CMD_NEW_KEY; if (crp->crp_auth_key != NULL) mackey = crp->crp_auth_key; Modified: head/sys/dev/safe/safe.c ============================================================================== --- head/sys/dev/safe/safe.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/dev/safe/safe.c Mon May 11 22:08:08 2020 (r360936) @@ -638,28 +638,17 @@ static void safe_setup_mackey(struct safe_session *ses, int algo, const uint8_t *key, int klen) { - MD5_CTX md5ctx; SHA1_CTX sha1ctx; int i; - if (algo == CRYPTO_MD5_HMAC) { - hmac_init_ipad(&auth_hash_hmac_md5, key, klen, &md5ctx); - bcopy(md5ctx.state, ses->ses_hminner, sizeof(md5ctx.state)); + hmac_init_ipad(&auth_hash_hmac_sha1, key, klen, &sha1ctx); + bcopy(sha1ctx.h.b32, ses->ses_hminner, sizeof(sha1ctx.h.b32)); - hmac_init_opad(&auth_hash_hmac_md5, key, klen, &md5ctx); - bcopy(md5ctx.state, ses->ses_hmouter, sizeof(md5ctx.state)); + hmac_init_opad(&auth_hash_hmac_sha1, key, klen, &sha1ctx); + bcopy(sha1ctx.h.b32, ses->ses_hmouter, sizeof(sha1ctx.h.b32)); - explicit_bzero(&md5ctx, sizeof(md5ctx)); - } else { - hmac_init_ipad(&auth_hash_hmac_sha1, key, klen, &sha1ctx); - bcopy(sha1ctx.h.b32, ses->ses_hminner, sizeof(sha1ctx.h.b32)); + explicit_bzero(&sha1ctx, sizeof(sha1ctx)); - hmac_init_opad(&auth_hash_hmac_sha1, key, klen, &sha1ctx); - bcopy(sha1ctx.h.b32, ses->ses_hmouter, sizeof(sha1ctx.h.b32)); - - explicit_bzero(&sha1ctx, sizeof(sha1ctx)); - } - /* PE is little-endian, insure proper byte order */ for (i = 0; i < N(ses->ses_hminner); i++) { ses->ses_hminner[i] = htole32(ses->ses_hminner[i]); @@ -674,10 +663,6 @@ safe_auth_supported(struct safe_softc *sc, { switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - if ((sc->sc_devinfo & SAFE_DEVINFO_MD5) == 0) - return (false); - break; case CRYPTO_SHA1_HMAC: if ((sc->sc_devinfo & SAFE_DEVINFO_SHA1) == 0) return (false); @@ -755,10 +740,7 @@ safe_newsession(device_t dev, crypto_session_t cses, if (csp->csp_auth_alg != 0) { ses->ses_mlen = csp->csp_auth_mlen; if (ses->ses_mlen == 0) { - if (csp->csp_auth_alg == CRYPTO_MD5_HMAC) - ses->ses_mlen = MD5_HASH_LEN; - else - ses->ses_mlen = SHA1_HASH_LEN; + ses->ses_mlen = SHA1_HASH_LEN; } if (csp->csp_auth_key != NULL) { @@ -907,10 +889,6 @@ safe_process(device_t dev, struct cryptop *crp, int hi } switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - cmd0 |= SAFE_SA_CMD0_MD5; - cmd1 |= SAFE_SA_CMD1_HMAC; /* NB: enable HMAC */ - break; case CRYPTO_SHA1_HMAC: cmd0 |= SAFE_SA_CMD0_SHA1; cmd1 |= SAFE_SA_CMD1_HMAC; /* NB: enable HMAC */ Modified: head/sys/dev/sec/sec.c ============================================================================== --- head/sys/dev/sec/sec.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/dev/sec/sec.c Mon May 11 22:08:08 2020 (r360936) @@ -1158,7 +1158,6 @@ sec_auth_supported(struct sec_softc *sc, if (sc->sc_version < 3) return (false); /* FALLTHROUGH */ - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_256_HMAC: if (csp->csp_auth_klen > SEC_MAX_KEY_LEN) @@ -1465,7 +1464,6 @@ sec_mdeu_can_handle(u_int alg) { switch (alg) { case CRYPTO_SHA1: - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_256_HMAC: case CRYPTO_SHA2_384_HMAC: @@ -1485,12 +1483,6 @@ sec_mdeu_config(const struct crypto_session_params *cs *eu = SEC_EU_NONE; switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - *mode |= SEC_MDEU_MODE_HMAC; - *eu = SEC_EU_MDEU_A; - *mode |= SEC_MDEU_MODE_MD5; - *hashlen = MD5_HASH_LEN; - break; case CRYPTO_SHA1_HMAC: *mode |= SEC_MDEU_MODE_HMAC; /* FALLTHROUGH */ Modified: head/sys/mips/cavium/cryptocteon/cavium_crypto.c ============================================================================== --- head/sys/mips/cavium/cryptocteon/cavium_crypto.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/mips/cavium/cryptocteon/cavium_crypto.c Mon May 11 22:08:08 2020 (r360936) @@ -458,104 +458,6 @@ octo_aes_cbc_decrypt( } /****************************************************************************/ -/* MD5 */ - -int -octo_null_md5_encrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - int next = 0; - uint64_t *data; - uint64_t tmp1, tmp2; - int data_i, data_l, alen = auth_len; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || - (auth_off & 0x7) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data, data_i, data_l); - - /* Load MD5 IV */ - CVMX_MT_HSH_IV(od->octo_hminner[0], 0); - CVMX_MT_HSH_IV(od->octo_hminner[1], 1); - - while (auth_off > 0) { - IOV_CONSUME(iov, data, data_i, data_l); - auth_off -= 8; - } - - while (auth_len > 0) { - CVM_LOAD_MD5_UNIT(*data, next); - auth_len -= 8; - IOV_CONSUME(iov, data, data_i, data_l); - } - - /* finish the hash */ - CVMX_PREFETCH0(od->octo_hmouter); -#if 0 - if (__predict_false(inplen)) { - uint64_t tmp = 0; - uint8_t *p = (uint8_t *) & tmp; - p[inplen] = 0x80; - do { - inplen--; - p[inplen] = ((uint8_t *) data)[inplen]; - } while (inplen); - CVM_LOAD_MD5_UNIT(tmp, next); - } else { - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); - } -#else - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); -#endif - - /* Finish Inner hash */ - while (next != 7) { - CVM_LOAD_MD5_UNIT(((uint64_t) 0x0ULL), next); - } - CVMX_ES64(tmp1, ((alen + 64) << 3)); - CVM_LOAD_MD5_UNIT(tmp1, next); - - /* Get the inner hash of HMAC */ - CVMX_MF_HSH_IV(tmp1, 0); - CVMX_MF_HSH_IV(tmp2, 1); - - /* Initialize hash unit */ - CVMX_MT_HSH_IV(od->octo_hmouter[0], 0); - CVMX_MT_HSH_IV(od->octo_hmouter[1], 1); - - CVMX_MT_HSH_DAT(tmp1, 0); - CVMX_MT_HSH_DAT(tmp2, 1); - CVMX_MT_HSH_DAT(0x8000000000000000ULL, 2); - CVMX_MT_HSH_DATZ(3); - CVMX_MT_HSH_DATZ(4); - CVMX_MT_HSH_DATZ(5); - CVMX_MT_HSH_DATZ(6); - CVMX_ES64(tmp1, ((64 + 16) << 3)); - CVMX_MT_HSH_STARTMD5(tmp1); - - /* save the HMAC */ - data = (uint64_t *)icv; - CVMX_MF_HSH_IV(*data, 0); - data++; - CVMX_MF_HSH_IV(tmp1, 1); - *(uint32_t *)data = (uint32_t) (tmp1 >> 32); - - return 0; -} - -/****************************************************************************/ /* SHA1 */ int @@ -652,351 +554,6 @@ octo_null_sha1_encrypt( data++; CVMX_MF_HSH_IV(tmp1, 1); *(uint32_t *)data = (uint32_t) (tmp1 >> 32); - - return 0; -} - -/****************************************************************************/ -/* AES MD5 */ - -int -octo_aes_cbc_md5_encrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - int next = 0; - union { - uint32_t data32[2]; - uint64_t data64[1]; - } mydata[2]; - uint64_t *pdata = &mydata[0].data64[0]; - uint64_t *data = &mydata[1].data64[0]; - uint32_t *data32; - uint64_t tmp1, tmp2; - int data_i, data_l, alen = auth_len; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x3) || (crypt_off + crypt_len > iovlen) || - (crypt_len & 0x7) || - (auth_len & 0x7) || - (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data32, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - /* load AES Key */ - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - - if (od->octo_encklen == 16) { - CVMX_MT_AES_KEY(0x0, 2); - CVMX_MT_AES_KEY(0x0, 3); - } else if (od->octo_encklen == 24) { - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - CVMX_MT_AES_KEY(0x0, 3); - } else if (od->octo_encklen == 32) { - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[3], 3); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - CVMX_MT_AES_KEYLENGTH(od->octo_encklen / 8 - 1); - - CVMX_MT_AES_IV(((uint64_t *) ivp)[0], 0); - CVMX_MT_AES_IV(((uint64_t *) ivp)[1], 1); - - /* Load MD5 IV */ - CVMX_MT_HSH_IV(od->octo_hminner[0], 0); - CVMX_MT_HSH_IV(od->octo_hminner[1], 1); - - while (crypt_off > 0 && auth_off > 0) { - IOV_CONSUME(iov, data32, data_i, data_l); - crypt_off -= 4; - auth_off -= 4; - } - - while (crypt_len > 0 || auth_len > 0) { - uint32_t *pdata32[3]; - - pdata32[0] = data32; - mydata[0].data32[0] = *data32; - IOV_CONSUME(iov, data32, data_i, data_l); - - pdata32[1] = data32; - mydata[0].data32[1] = *data32; - IOV_CONSUME(iov, data32, data_i, data_l); - - pdata32[2] = data32; - mydata[1].data32[0] = *data32; - IOV_CONSUME(iov, data32, data_i, data_l); - - mydata[1].data32[1] = *data32; - - - if (crypt_off <= 0) { - if (crypt_len > 0) { - CVMX_MT_AES_ENC_CBC0(*pdata); - CVMX_MT_AES_ENC_CBC1(*data); - CVMX_MF_AES_RESULT(*pdata, 0); - CVMX_MF_AES_RESULT(*data, 1); - crypt_len -= 16; - } - } else - crypt_off -= 16; - - if (auth_off <= 0) { - if (auth_len > 0) { - CVM_LOAD_MD5_UNIT(*pdata, next); - CVM_LOAD_MD5_UNIT(*data, next); - auth_len -= 16; - } - } else - auth_off -= 16; - - *pdata32[0] = mydata[0].data32[0]; - *pdata32[1] = mydata[0].data32[1]; - *pdata32[2] = mydata[1].data32[0]; - *data32 = mydata[1].data32[1]; - - IOV_CONSUME(iov, data32, data_i, data_l); - } - - /* finish the hash */ - CVMX_PREFETCH0(od->octo_hmouter); -#if 0 - if (__predict_false(inplen)) { - uint64_t tmp = 0; - uint8_t *p = (uint8_t *) & tmp; - p[inplen] = 0x80; - do { - inplen--; - p[inplen] = ((uint8_t *) data)[inplen]; - } while (inplen); - CVM_LOAD_MD5_UNIT(tmp, next); - } else { - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); - } -#else - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); -#endif - - /* Finish Inner hash */ - while (next != 7) { - CVM_LOAD_MD5_UNIT(((uint64_t) 0x0ULL), next); - } - CVMX_ES64(tmp1, ((alen + 64) << 3)); - CVM_LOAD_MD5_UNIT(tmp1, next); - - /* Get the inner hash of HMAC */ - CVMX_MF_HSH_IV(tmp1, 0); - CVMX_MF_HSH_IV(tmp2, 1); - - /* Initialize hash unit */ - CVMX_MT_HSH_IV(od->octo_hmouter[0], 0); - CVMX_MT_HSH_IV(od->octo_hmouter[1], 1); - - CVMX_MT_HSH_DAT(tmp1, 0); - CVMX_MT_HSH_DAT(tmp2, 1); - CVMX_MT_HSH_DAT(0x8000000000000000ULL, 2); - CVMX_MT_HSH_DATZ(3); - CVMX_MT_HSH_DATZ(4); - CVMX_MT_HSH_DATZ(5); - CVMX_MT_HSH_DATZ(6); - CVMX_ES64(tmp1, ((64 + 16) << 3)); - CVMX_MT_HSH_STARTMD5(tmp1); - - /* save the HMAC */ - data32 = (uint32_t *)icv; - CVMX_MF_HSH_IV(tmp1, 0); - *data32 = (uint32_t) (tmp1 >> 32); - data32++; - *data32 = (uint32_t) tmp1; - data32++; - CVMX_MF_HSH_IV(tmp1, 1); - *data32 = (uint32_t) (tmp1 >> 32); - - return 0; -} - -int -octo_aes_cbc_md5_decrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - int next = 0; - union { - uint32_t data32[2]; - uint64_t data64[1]; - } mydata[2]; - uint64_t *pdata = &mydata[0].data64[0]; - uint64_t *data = &mydata[1].data64[0]; - uint32_t *data32; - uint64_t tmp1, tmp2; - int data_i, data_l, alen = auth_len; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x3) || (crypt_off + crypt_len > iovlen) || - (crypt_len & 0x7) || - (auth_len & 0x7) || - (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data32, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - /* load AES Key */ - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - - if (od->octo_encklen == 16) { - CVMX_MT_AES_KEY(0x0, 2); - CVMX_MT_AES_KEY(0x0, 3); - } else if (od->octo_encklen == 24) { - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - CVMX_MT_AES_KEY(0x0, 3); - } else if (od->octo_encklen == 32) { - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[3], 3); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - CVMX_MT_AES_KEYLENGTH(od->octo_encklen / 8 - 1); - - CVMX_MT_AES_IV(((uint64_t *) ivp)[0], 0); - CVMX_MT_AES_IV(((uint64_t *) ivp)[1], 1); - - /* Load MD5 IV */ - CVMX_MT_HSH_IV(od->octo_hminner[0], 0); - CVMX_MT_HSH_IV(od->octo_hminner[1], 1); - - while (crypt_off > 0 && auth_off > 0) { - IOV_CONSUME(iov, data32, data_i, data_l); - crypt_off -= 4; - auth_off -= 4; - } - - while (crypt_len > 0 || auth_len > 0) { - uint32_t *pdata32[3]; - - pdata32[0] = data32; - mydata[0].data32[0] = *data32; - IOV_CONSUME(iov, data32, data_i, data_l); - pdata32[1] = data32; - mydata[0].data32[1] = *data32; - IOV_CONSUME(iov, data32, data_i, data_l); - pdata32[2] = data32; - mydata[1].data32[0] = *data32; - IOV_CONSUME(iov, data32, data_i, data_l); - mydata[1].data32[1] = *data32; - - if (auth_off <= 0) { - if (auth_len > 0) { - CVM_LOAD_MD5_UNIT(*pdata, next); - CVM_LOAD_MD5_UNIT(*data, next); - auth_len -= 16; - } - } else - auth_off -= 16; - - if (crypt_off <= 0) { - if (crypt_len > 0) { - CVMX_MT_AES_DEC_CBC0(*pdata); - CVMX_MT_AES_DEC_CBC1(*data); - CVMX_MF_AES_RESULT(*pdata, 0); - CVMX_MF_AES_RESULT(*data, 1); - crypt_len -= 16; - } - } else - crypt_off -= 16; - - *pdata32[0] = mydata[0].data32[0]; - *pdata32[1] = mydata[0].data32[1]; - *pdata32[2] = mydata[1].data32[0]; - *data32 = mydata[1].data32[1]; - - IOV_CONSUME(iov, data32, data_i, data_l); - } - - /* finish the hash */ - CVMX_PREFETCH0(od->octo_hmouter); -#if 0 - if (__predict_false(inplen)) { - uint64_t tmp = 0; - uint8_t *p = (uint8_t *) & tmp; - p[inplen] = 0x80; - do { - inplen--; - p[inplen] = ((uint8_t *) data)[inplen]; - } while (inplen); - CVM_LOAD_MD5_UNIT(tmp, next); - } else { - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); - } -#else - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); -#endif - - /* Finish Inner hash */ - while (next != 7) { - CVM_LOAD_MD5_UNIT(((uint64_t) 0x0ULL), next); - } - CVMX_ES64(tmp1, ((alen + 64) << 3)); - CVM_LOAD_MD5_UNIT(tmp1, next); - - /* Get the inner hash of HMAC */ - CVMX_MF_HSH_IV(tmp1, 0); - CVMX_MF_HSH_IV(tmp2, 1); - - /* Initialize hash unit */ - CVMX_MT_HSH_IV(od->octo_hmouter[0], 0); - CVMX_MT_HSH_IV(od->octo_hmouter[1], 1); - - CVMX_MT_HSH_DAT(tmp1, 0); - CVMX_MT_HSH_DAT(tmp2, 1); - CVMX_MT_HSH_DAT(0x8000000000000000ULL, 2); - CVMX_MT_HSH_DATZ(3); - CVMX_MT_HSH_DATZ(4); - CVMX_MT_HSH_DATZ(5); - CVMX_MT_HSH_DATZ(6); - CVMX_ES64(tmp1, ((64 + 16) << 3)); - CVMX_MT_HSH_STARTMD5(tmp1); - - /* save the HMAC */ - data32 = (uint32_t *)icv; - CVMX_MF_HSH_IV(tmp1, 0); - *data32 = (uint32_t) (tmp1 >> 32); - data32++; - *data32 = (uint32_t) tmp1; - data32++; - CVMX_MF_HSH_IV(tmp1, 1); - *data32 = (uint32_t) (tmp1 >> 32); return 0; } Modified: head/sys/mips/cavium/cryptocteon/cryptocteon.c ============================================================================== --- head/sys/mips/cavium/cryptocteon/cryptocteon.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/mips/cavium/cryptocteon/cryptocteon.c Mon May 11 22:08:08 2020 (r360936) @@ -101,9 +101,6 @@ cryptocteon_auth_supported(const struct crypto_session u_int hash_len; switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - hash_len = MD5_HASH_LEN; - break; case CRYPTO_SHA1_HMAC: hash_len = SHA1_HASH_LEN; break; @@ -197,9 +194,6 @@ cryptocteon_newsession(device_t dev, crypto_session_t ocd->octo_mlen = csp->csp_auth_mlen; if (csp->csp_auth_mlen == 0) { switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - ocd->octo_mlen = MD5_HASH_LEN; - break; case CRYPTO_SHA1_HMAC: ocd->octo_mlen = SHA1_HASH_LEN; break; @@ -209,10 +203,6 @@ cryptocteon_newsession(device_t dev, crypto_session_t switch (csp->csp_mode) { case CSP_MODE_DIGEST: switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - ocd->octo_encrypt = octo_null_md5_encrypt; - ocd->octo_decrypt = octo_null_md5_encrypt; - break; case CRYPTO_SHA1_HMAC: ocd->octo_encrypt = octo_null_sha1_encrypt; ocd->octo_decrypt = octo_null_sha1_encrypt; @@ -231,10 +221,6 @@ cryptocteon_newsession(device_t dev, crypto_session_t switch (csp->csp_cipher_alg) { case CRYPTO_AES_CBC: switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - ocd->octo_encrypt = octo_aes_cbc_md5_encrypt; - ocd->octo_decrypt = octo_aes_cbc_md5_decrypt; - break; case CRYPTO_SHA1_HMAC: ocd->octo_encrypt = octo_aes_cbc_sha1_encrypt; ocd->octo_decrypt = octo_aes_cbc_sha1_decrypt; Modified: head/sys/mips/cavium/cryptocteon/cryptocteonvar.h ============================================================================== --- head/sys/mips/cavium/cryptocteon/cryptocteonvar.h Mon May 11 21:42:19 2020 (r360935) +++ head/sys/mips/cavium/cryptocteon/cryptocteonvar.h Mon May 11 22:08:08 2020 (r360936) @@ -64,15 +64,12 @@ extern int cryptocteon_debug; void octo_calc_hash(uint8_t, unsigned char *, uint64_t *, uint64_t *); /* XXX Actually just hashing functions, not encryption. */ -octo_encrypt_t octo_null_md5_encrypt; octo_encrypt_t octo_null_sha1_encrypt; octo_encrypt_t octo_aes_cbc_encrypt; -octo_encrypt_t octo_aes_cbc_md5_encrypt; octo_encrypt_t octo_aes_cbc_sha1_encrypt; octo_decrypt_t octo_aes_cbc_decrypt; -octo_decrypt_t octo_aes_cbc_md5_decrypt; octo_decrypt_t octo_aes_cbc_sha1_decrypt; #endif /* !_MIPS_CAVIUM_CRYPTOCTEON_CRYPTOCTEONVAR_H_ */ Modified: head/sys/mips/nlm/dev/sec/nlmsec.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 11 22:08:08 2020 (r360936) @@ -377,7 +377,6 @@ xlp_sec_auth_supported(const struct crypto_session_par switch (csp->csp_auth_alg) { case CRYPTO_SHA1: - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: break; default: Modified: head/sys/mips/nlm/dev/sec/nlmseclib.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmseclib.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/mips/nlm/dev/sec/nlmseclib.c Mon May 11 22:08:08 2020 (r360936) @@ -253,10 +253,6 @@ nlm_get_digest_param(struct xlp_sec_command *cmd, cmd->hashalg = NLM_HASH_SHA; cmd->hashmode = NLM_HASH_MODE_SHA1; break; - case CRYPTO_MD5_HMAC: - cmd->hashalg = NLM_HASH_MD5; - cmd->hashmode = NLM_HASH_MODE_SHA1; - break; case CRYPTO_SHA1_HMAC: cmd->hashalg = NLM_HASH_SHA; cmd->hashmode = NLM_HASH_MODE_SHA1; Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/opencrypto/crypto.c Mon May 11 22:08:08 2020 (r360936) @@ -530,8 +530,6 @@ crypto_auth_hash(const struct crypto_session_params *c { switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - return (&auth_hash_hmac_md5); case CRYPTO_SHA1_HMAC: return (&auth_hash_hmac_sha1); case CRYPTO_SHA2_224_HMAC: @@ -674,7 +672,6 @@ static enum alg_type { ALG_COMPRESSION, ALG_AEAD } alg_types[] = { - [CRYPTO_MD5_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_RIPEMD160_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_AES_CBC] = ALG_CIPHER, Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Mon May 11 21:42:19 2020 (r360935) +++ head/sys/opencrypto/cryptodev.h Mon May 11 22:08:08 2020 (r360936) @@ -74,7 +74,6 @@ /* Hash values */ #define NULL_HASH_LEN 16 -#define MD5_HASH_LEN 16 #define SHA1_HASH_LEN 20 #define RIPEMD160_HASH_LEN 20 #define SHA2_224_HASH_LEN 28 @@ -87,7 +86,6 @@ /* Maximum hash algorithm result length */ #define HASH_MAX_LEN SHA2_512_HASH_LEN /* Keep this updated */ -#define MD5_BLOCK_LEN 64 #define SHA1_BLOCK_LEN 64 #define RIPEMD160_BLOCK_LEN 64 #define SHA2_224_BLOCK_LEN 64 @@ -210,7 +208,7 @@ /* NB: deprecated */ struct session_op { u_int32_t cipher; /* ie. CRYPTO_AES_CBC */ - u_int32_t mac; /* ie. CRYPTO_MD5_HMAC */ + u_int32_t mac; /* ie. CRYPTO_SHA2_256_HMAC */ u_int32_t keylen; /* cipher key */ c_caddr_t key; @@ -227,7 +225,7 @@ struct session_op { */ struct session2_op { u_int32_t cipher; /* ie. CRYPTO_AES_CBC */ - u_int32_t mac; /* ie. CRYPTO_MD5_HMAC */ + u_int32_t mac; /* ie. CRYPTO_SHA2_256_HMAC */ u_int32_t keylen; /* cipher key */ c_caddr_t key; Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/opencrypto/cryptosoft.c Mon May 11 22:08:08 2020 (r360936) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -336,7 +335,6 @@ swcr_authprepare(struct auth_hash *axf, struct swcr_au { switch (axf->type) { - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_224_HMAC: case CRYPTO_SHA2_256_HMAC: @@ -403,7 +401,6 @@ swcr_authcompute(struct swcr_session *ses, struct cryp axf->Final(aalg, &ctx); break; - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_224_HMAC: case CRYPTO_SHA2_256_HMAC: @@ -899,7 +896,6 @@ swcr_setup_auth(struct swcr_session *ses, return (ENOBUFS); switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_224_HMAC: case CRYPTO_SHA2_256_HMAC: @@ -1085,7 +1081,6 @@ swcr_auth_supported(const struct crypto_session_params if (axf == NULL) return (false); switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_224_HMAC: case CRYPTO_SHA2_256_HMAC: Modified: head/sys/opencrypto/xform.c ============================================================================== --- head/sys/opencrypto/xform.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/opencrypto/xform.c Mon May 11 22:08:08 2020 (r360936) @@ -66,8 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include @@ -82,7 +80,6 @@ MALLOC_DEFINE(M_XDATA, "xform", "xform data buffers"); /* Include the authentication and hashing algorithms */ #include "xform_gmac.c" -#include "xform_md5.c" #include "xform_rmd160.c" #include "xform_sha1.c" #include "xform_sha2.c" Modified: head/sys/opencrypto/xform.h ============================================================================== --- head/sys/opencrypto/xform.h Mon May 11 21:42:19 2020 (r360935) +++ head/sys/opencrypto/xform.h Mon May 11 22:08:08 2020 (r360936) @@ -31,7 +31,6 @@ #ifndef _CRYPTO_XFORM_H_ #define _CRYPTO_XFORM_H_ -#include #include #include #include Modified: head/sys/opencrypto/xform_auth.h ============================================================================== --- head/sys/opencrypto/xform_auth.h Mon May 11 21:42:19 2020 (r360935) +++ head/sys/opencrypto/xform_auth.h Mon May 11 22:08:08 2020 (r360936) @@ -34,7 +34,6 @@ #include #include -#include #include #include #include @@ -66,7 +65,6 @@ struct auth_hash { }; extern struct auth_hash auth_hash_null; -extern struct auth_hash auth_hash_hmac_md5; extern struct auth_hash auth_hash_hmac_sha1; extern struct auth_hash auth_hash_hmac_ripemd_160; extern struct auth_hash auth_hash_hmac_sha2_224; @@ -89,7 +87,6 @@ extern struct auth_hash auth_hash_ccm_cbc_mac_192; extern struct auth_hash auth_hash_ccm_cbc_mac_256; union authctx { - MD5_CTX md5ctx; SHA1_CTX sha1ctx; RMD160_CTX rmd160ctx; SHA224_CTX sha224ctx; From owner-svn-src-head@freebsd.org Mon May 11 22:15:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1C322EE854; Mon, 11 May 2020 22:15:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LZyB3pcyz4HKr; Mon, 11 May 2020 22:15:46 +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 7DFC525826; Mon, 11 May 2020 22:15:46 +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 04BMFkKT071809; Mon, 11 May 2020 22:15:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMFkh8071808; Mon, 11 May 2020 22:15:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112215.04BMFkh8071808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 22:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360937 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 360937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:15:46 -0000 Author: jhb Date: Mon May 11 22:15:46 2020 New Revision: 360937 URL: https://svnweb.freebsd.org/changeset/base/360937 Log: Document removal of deprecated algorithms from OCF. Sponsored by: Chelsio Communications Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Mon May 11 22:08:08 2020 (r360936) +++ head/RELNOTES Mon May 11 22:15:46 2020 (r360937) @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r360920,r360923,r360924,r360927,r360928,r360931,r360933,r360936: + Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5, + MD5-KPDK, MD5-HMAC, SHA1-KPDK, and Skipjack algorithms from + the kernel open cryptographic framework (OCF). + r360562: Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5-HMAC, and Skipjack algorithms from /dev/crypto. From owner-svn-src-head@freebsd.org Mon May 11 22:19:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0CF62EEC4C; Mon, 11 May 2020 22:19:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (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 49Lb2K4Fwkz4HvC; Mon, 11 May 2020 22:19:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id YGlZjPKVLYYpxYGlbjwiNZ; Mon, 11 May 2020 16:19:20 -0600 X-Authority-Analysis: v=2.3 cv=OubUNx3t c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=sTwFKg_x9MkA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=N7pfFusovxdZa5IrGW0A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo: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 ESMTP id BF783596; Mon, 11 May 2020 15:19:15 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id 04BMJFVS081757; Mon, 11 May 2020 15:19:15 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id 04BMJFRZ081754; Mon, 11 May 2020 15:19:15 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202005112219.04BMJFRZ081754@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: John Baldwin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360937 - head In-reply-to: <202005112215.04BMFkh8071808@repo.freebsd.org> References: <202005112215.04BMFkh8071808@repo.freebsd.org> Comments: In-reply-to John Baldwin message dated "Mon, 11 May 2020 22:15:46 -0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 11 May 2020 15:19:15 -0700 X-CMAE-Envelope: MS4wfAKOcCr8AkYy+IPSlP6jTs1rMFHxI6fvbS0033SlE4W9c0Ocrqff6+TJM+yBw1M7ZISTzNWgFL97cocYz8EiX7ThJVQoWN2KpgwCLpUCtXVzHVTkR5qo PpWCQ4eGxbS2Ice6HyXzSoMF6JdImilMl5LFPr5NYRqHuZ/6VpcIRGbQHFrKJXVvL2qwfVO+xZo6Ei0hwsLbbTb3brih6TjdlkB50QpRoqgKHvCckFeIYVuw DoRXvU4bueoQW+8GhGvXbrg+F6wJVTj/JDJRf2PZL0aDo5D63+EK0GxxlCUmCFyS X-Rspamd-Queue-Id: 49Lb2K4Fwkz4HvC X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:19:22 -0000 In message <202005112215.04BMFkh8071808@repo.freebsd.org>, John Baldwin writes: > Author: jhb > Date: Mon May 11 22:15:46 2020 > New Revision: 360937 > URL: https://svnweb.freebsd.org/changeset/base/360937 > > Log: > Document removal of deprecated algorithms from OCF. > > Sponsored by: Chelsio Communications > > Modified: > head/RELNOTES > > Modified: head/RELNOTES > ============================================================================= > = > --- head/RELNOTES Mon May 11 22:08:08 2020 (r360936) > +++ head/RELNOTES Mon May 11 22:15:46 2020 (r360937) > @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. > > Changes to this file should not be MFCed. > > +r360920,r360923,r360924,r360927,r360928,r360931,r360933,r360936: > + Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5, > + MD5-KPDK, MD5-HMAC, SHA1-KPDK, and Skipjack algorithms from > + the kernel open cryptographic framework (OCF). > + > r360562: > Remove support for ARC4, Blowfish, Cast, DES, Triple DES, > MD5-HMAC, and Skipjack algorithms from /dev/crypto. > Do we need a __FreeBSD_version bump? -- 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-head@freebsd.org Mon May 11 22:26:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71FAD2EEE75; Mon, 11 May 2020 22:26:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LbBm2JGsz4JL8; Mon, 11 May 2020 22:26:40 +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 4559B25A2E; Mon, 11 May 2020 22:26:40 +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 04BMQeWT078283; Mon, 11 May 2020 22:26:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMQe70078282; Mon, 11 May 2020 22:26:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112226.04BMQe70078282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 22:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360939 - in head: sbin/sunlabel share/man/man4/man4.sparc64 sys/arm/mv/discovery sys/arm/mv/kirkwood sys/arm/mv/orion sys/arm/ralink sys/cddl/contrib/opensolaris/common/atomic/aarch64 ... X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: sbin/sunlabel share/man/man4/man4.sparc64 sys/arm/mv/discovery sys/arm/mv/kirkwood sys/arm/mv/orion sys/arm/ralink sys/cddl/contrib/opensolaris/common/atomic/aarch64 sys/cddl/contrib/opensola... X-SVN-Commit-Revision: 360939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:26:40 -0000 Author: jhb Date: Mon May 11 22:26:39 2020 New Revision: 360939 URL: https://svnweb.freebsd.org/changeset/base/360939 Log: Remove various empty directories. Some of these I orphaned today, others were emptied by earlier commits to head. Deleted: head/sbin/sunlabel/ head/share/man/man4/man4.sparc64/ head/sys/arm/mv/discovery/ head/sys/arm/mv/kirkwood/ head/sys/arm/mv/orion/ head/sys/arm/ralink/ head/sys/cddl/contrib/opensolaris/common/atomic/aarch64/ head/sys/cddl/contrib/opensolaris/common/atomic/amd64/ head/sys/cddl/contrib/opensolaris/common/atomic/powerpc64/ head/sys/cddl/contrib/opensolaris/common/atomic/sparc64/ head/sys/crypto/blowfish/ head/sys/dev/auxio/ head/sys/dev/bktr/ head/sys/dev/sound/sbus/ head/sys/dev/ubsec/ head/sys/modules/auxio/ head/sys/modules/bktr/ head/sys/modules/epic/ head/sys/modules/sound/driver/audiocs/ head/sys/modules/ubsec/ head/sys/modules/vpo/ head/usr.bin/elf2aout/ head/usr.sbin/eeprom/ From owner-svn-src-head@freebsd.org Mon May 11 22:38:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29C782D8C0A; Mon, 11 May 2020 22:38:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LbSS6t3lz4JyM; Mon, 11 May 2020 22:38: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 C8E5925BFD; Mon, 11 May 2020 22:38: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 04BMcWaT084431; Mon, 11 May 2020 22:38:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMcWBV084430; Mon, 11 May 2020 22:38:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005112238.04BMcWBV084430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 11 May 2020 22:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360940 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 360940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:38:33 -0000 Author: kib Date: Mon May 11 22:38:32 2020 New Revision: 360940 URL: https://svnweb.freebsd.org/changeset/base/360940 Log: sigfastblock: fix delivery of the pending signals in single-threaded processes. If single-threaded process receives a signal during critical section established by sigfastblock(2) word, unblock did not caused signal delivery because sigfastblock(SIGFASTBLOCK_UNBLOCK) failed to request ast handling of the pending signals. Set TDF_ASTPENDING | TDF_NEEDSIGCHK on unblock or when kernel forces end of sigfastblock critical section, to cause syscall exit to recheck and deliver any signal pending. Reported by: corydoras@ridiculousfish.com PR: 246385 Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Mon May 11 22:26:39 2020 (r360939) +++ head/sys/kern/kern_sig.c Mon May 11 22:38:32 2020 (r360940) @@ -3976,6 +3976,22 @@ sigfastblock_fetch_sig(struct thread *td, bool sendsig return (true); } +static void +sigfastblock_resched(struct thread *td, bool resched) +{ + struct proc *p; + + if (resched) { + p = td->td_proc; + PROC_LOCK(p); + reschedule_signals(p, td->td_sigmask, 0); + PROC_UNLOCK(p); + } + thread_lock(td); + td->td_flags |= TDF_ASTPENDING | TDF_NEEDSIGCHK; + thread_unlock(td); +} + int sys_sigfastblock(struct thread *td, struct sigfastblock_args *uap) { @@ -4046,11 +4062,8 @@ sys_sigfastblock(struct thread *td, struct sigfastbloc * signals to current thread. But notify others about * fake unblock. */ - if (error == 0 && p->p_numthreads != 1) { - PROC_LOCK(p); - reschedule_signals(p, td->td_sigmask, 0); - PROC_UNLOCK(p); - } + sigfastblock_resched(td, error == 0 && p->p_numthreads != 1); + break; case SIGFASTBLOCK_UNSETPTR: @@ -4079,7 +4092,6 @@ sys_sigfastblock(struct thread *td, struct sigfastbloc void sigfastblock_clear(struct thread *td) { - struct proc *p; bool resched; if ((td->td_pflags & TDP_SIGFASTBLOCK) == 0) @@ -4088,12 +4100,7 @@ sigfastblock_clear(struct thread *td) resched = (td->td_pflags & TDP_SIGFASTPENDING) != 0 || SIGPENDING(td); td->td_pflags &= ~(TDP_SIGFASTBLOCK | TDP_SIGFASTPENDING); - if (resched) { - p = td->td_proc; - PROC_LOCK(p); - reschedule_signals(p, td->td_sigmask, 0); - PROC_UNLOCK(p); - } + sigfastblock_resched(td, resched); } void From owner-svn-src-head@freebsd.org Mon May 11 22:39:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B815B2D8D51; Mon, 11 May 2020 22:39:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LbV14QdYz4K8C; Mon, 11 May 2020 22:39:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9327A25C07; Mon, 11 May 2020 22:39:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BMdrAc084553; Mon, 11 May 2020 22:39:53 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMdrq9084552; Mon, 11 May 2020 22:39:53 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005112239.04BMdrq9084552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 11 May 2020 22:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360941 - head/sys/geom/mirror X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/geom/mirror X-SVN-Commit-Revision: 360941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:39:53 -0000 Author: cem Date: Mon May 11 22:39:53 2020 New Revision: 360941 URL: https://svnweb.freebsd.org/changeset/base/360941 Log: geom(4) mirror: Do not panic on gmirror(8) insert, resize Geom_mirror initialization occurs in spurts and the present of a non-destroyed g_mirror softc does not always indicate that the geom has launched (i.e., has an sc_provider). Some gmirror(8) commands (via g_mirror_ctl) depend on a g_mirror's sc_provider (insert and resize). For those commands, g_mirror_ctl is modified to sleep-poll in an interruptible way until the target geom is either launched or destroyed. Reviewed by: markj Tested by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24780 Modified: head/sys/geom/mirror/g_mirror_ctl.c Modified: head/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- head/sys/geom/mirror/g_mirror_ctl.c Mon May 11 22:38:32 2020 (r360940) +++ head/sys/geom/mirror/g_mirror_ctl.c Mon May 11 22:39:53 2020 (r360941) @@ -44,6 +44,10 @@ __FBSDID("$FreeBSD$"); #include #include +/* + * Configure, Rebuild, Remove, Deactivate, Forget, and Stop operations do not + * seem to depend on any particular g_mirror initialization state. + */ static struct g_mirror_softc * g_mirror_find_device(struct g_class *mp, const char *name) { @@ -61,6 +65,10 @@ g_mirror_find_device(struct g_class *mp, const char *n strcmp(sc->sc_name, name) == 0) { g_topology_unlock(); sx_xlock(&sc->sc_lock); + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { + sx_xunlock(&sc->sc_lock); + return (NULL); + } return (sc); } } @@ -68,6 +76,55 @@ g_mirror_find_device(struct g_class *mp, const char *n return (NULL); } +/* Insert and Resize operations depend on a launched GEOM (sc_provider). */ +#define GMFL_VALID_FLAGS (M_WAITOK | M_NOWAIT) +static struct g_mirror_softc * +g_mirror_find_launched_device(struct g_class *mp, const char *name, int flags) +{ + struct g_mirror_softc *sc; + int error; + + KASSERT((flags & ~GMFL_VALID_FLAGS) == 0 && + flags != GMFL_VALID_FLAGS && flags != 0, + ("%s: Invalid flags %x\n", __func__, (unsigned)flags)); +#undef GMFL_VALID_FLAGS + + while (true) { + sc = g_mirror_find_device(mp, name); + if (sc == NULL) + return (NULL); + if (sc->sc_provider != NULL) + return (sc); + if (flags & M_NOWAIT) { + sx_xunlock(&sc->sc_lock); + return (NULL); + } + + /* + * This is a dumb hack. G_mirror does not expose any real + * wakeup API for observing state changes, and even if it did, + * its "RUNNING" state does not actually reflect all softc + * elements being initialized. + * + * Revamping g_mirror to have a 3rd, ACTUALLY_RUNNING state and + * updating all assertions and sc_state checks is a large work + * and would be easy to introduce regressions. + * + * Revamping g_mirror to have a wakeup for state changes would + * be difficult if one wanted to capture more than just + * sc_state and sc_provider. + * + * For now, just dummy sleep-poll until sc_provider shows up, + * the user cancels, or the g_mirror is destroyed. + */ + error = sx_sleep(&sc, &sc->sc_lock, PRIBIO | PCATCH | PDROP, + "GM:launched", 1); + if (error != 0 && error != EWOULDBLOCK) + return (NULL); + } + __unreachable(); +} + static struct g_mirror_disk * g_mirror_find_disk(struct g_mirror_softc *sc, const char *name) { @@ -605,7 +662,7 @@ g_mirror_ctl_insert(struct gctl_req *req, struct g_cla gctl_error(req, "No 'arg%u' argument.", 0); return; } - sc = g_mirror_find_device(mp, name); + sc = g_mirror_find_launched_device(mp, name, M_WAITOK); if (sc == NULL) { gctl_error(req, "No such device: %s.", name); return; @@ -847,7 +904,7 @@ g_mirror_ctl_resize(struct gctl_req *req, struct g_cla gctl_error(req, "Invalid '%s' argument.", "size"); return; } - sc = g_mirror_find_device(mp, name); + sc = g_mirror_find_launched_device(mp, name, M_WAITOK); if (sc == NULL) { gctl_error(req, "No such device: %s.", name); return; From owner-svn-src-head@freebsd.org Mon May 11 22:47:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E8F52D96B2; Mon, 11 May 2020 22:47:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Lbfd2kDXz4KnQ; Mon, 11 May 2020 22:47:21 +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 543AB25DF6; Mon, 11 May 2020 22:47:21 +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 04BMlL0m090300; Mon, 11 May 2020 22:47:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMlLX5090299; Mon, 11 May 2020 22:47:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005112247.04BMlLX5090299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 11 May 2020 22:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360942 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 360942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:47:21 -0000 Author: tuexen Date: Mon May 11 22:47:20 2020 New Revision: 360942 URL: https://svnweb.freebsd.org/changeset/base/360942 Log: Fix a copy and paste error introduced in r360878. Reported-by: syzbot+a0863e972771f2f0d4b3@syzkaller.appspotmail.com Reported-by: syzbot+4481757e967ba83c445a@syzkaller.appspotmail.com MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon May 11 22:39:53 2020 (r360941) +++ head/sys/netinet/sctp_input.c Mon May 11 22:47:20 2020 (r360942) @@ -5225,7 +5225,7 @@ process_control_chunks: auth_skipped = 0; } /* Restart the timer if we have pending data */ - TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { + TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { if (chk->whoTo != NULL) { break; } From owner-svn-src-head@freebsd.org Mon May 11 22:48:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B2C02D972C; Mon, 11 May 2020 22:48:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LbgP1cLSz4Kvj; Mon, 11 May 2020 22:48:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3290225DF7; Mon, 11 May 2020 22:48:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BMm1KJ090369; Mon, 11 May 2020 22:48:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMm1Ap090368; Mon, 11 May 2020 22:48:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005112248.04BMm1Ap090368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 11 May 2020 22:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360943 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 360943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:48:01 -0000 Author: cem Date: Mon May 11 22:48:00 2020 New Revision: 360943 URL: https://svnweb.freebsd.org/changeset/base/360943 Log: copystr(9): Move to deprecate [1/2] Unlike the other copy*() functions, it does not serve to copy from one address space to another or protect against potential faults. It's just an older incarnation of the now-more-common strlcpy(). Reviewed by: jhb MFC after: i² days Differential Revision: yes (see 2/2) Modified: head/share/man/man9/copy.9 Modified: head/share/man/man9/copy.9 ============================================================================== --- head/share/man/man9/copy.9 Mon May 11 22:47:20 2020 (r360942) +++ head/share/man/man9/copy.9 Mon May 11 22:48:00 2020 (r360943) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 15, 2017 +.Dd May 11, 2020 .Dt COPY 9 .Os .Sh NAME @@ -45,7 +45,7 @@ .Nm copyout_nofault , .Nm copystr , .Nm copyinstr -.Nd kernel copy functions +.Nd heterogenous address space copy functions .Sh SYNOPSIS .In sys/types.h .In sys/systm.h @@ -57,18 +57,21 @@ .Fn copyout "const void *kaddr" "void *uaddr" "size_t len" .Ft int .Fn copyout_nofault "const void *kaddr" "void *uaddr" "size_t len" -.Ft int +.Ft int __deprecated .Fn copystr "const void *kfaddr" "void *kdaddr" "size_t len" "size_t *done" .Ft int .Fn copyinstr "const void *uaddr" "void *kaddr" "size_t len" "size_t *done" .Sh DESCRIPTION The .Nm -functions are designed to copy contiguous data from one address +functions are designed to copy contiguous data from one address space to another. -All but +.Pp .Fn copystr -copy data from user-space to kernel-space or vice-versa. +is deprecated and should be replaced with +.Xr strlcpy 9 . +It will be removed from +.Fx 13 . .Pp The .Fn copyin From owner-svn-src-head@freebsd.org Mon May 11 22:51:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 284FD2D9970; Mon, 11 May 2020 22:51:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LblH0JW5z4LNR; Mon, 11 May 2020 22:51:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-164.local (unknown [IPv6:2601:648:8203:2990:e804:1989:c6ed:be50]) (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 5179B181ED; Mon, 11 May 2020 22:51:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r360937 - head To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005112215.04BMFkh8071808@repo.freebsd.org> <202005112219.04BMJFRZ081754@slippy.cwsent.com> 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: <7584e240-6f27-ae72-8447-86d77ec1541f@FreeBSD.org> Date: Mon, 11 May 2020 15:51:20 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202005112219.04BMJFRZ081754@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:51:23 -0000 On 5/11/20 3:19 PM, Cy Schubert wrote: > In message <202005112215.04BMFkh8071808@repo.freebsd.org>, John Baldwin > writes: >> Author: jhb >> Date: Mon May 11 22:15:46 2020 >> New Revision: 360937 >> URL: https://svnweb.freebsd.org/changeset/base/360937 >> >> Log: >> Document removal of deprecated algorithms from OCF. >> >> Sponsored by: Chelsio Communications >> >> Modified: >> head/RELNOTES >> >> Modified: head/RELNOTES >> ============================================================================= >> = >> --- head/RELNOTES Mon May 11 22:08:08 2020 (r360936) >> +++ head/RELNOTES Mon May 11 22:15:46 2020 (r360937) >> @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. >> >> Changes to this file should not be MFCed. >> >> +r360920,r360923,r360924,r360927,r360928,r360931,r360933,r360936: >> + Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5, >> + MD5-KPDK, MD5-HMAC, SHA1-KPDK, and Skipjack algorithms from >> + the kernel open cryptographic framework (OCF). >> + >> r360562: >> Remove support for ARC4, Blowfish, Cast, DES, Triple DES, >> MD5-HMAC, and Skipjack algorithms from /dev/crypto. >> > > Do we need a __FreeBSD_version bump? We shouldn't. I did not remove any of the CRYPTO_* constants that list algorithms since OpenSSL assumes some of them exist unconditionally. OpenSSL's /dev/crypto engine could use some love (it doesn't support AES-GCM on FreeBSD for example), but I've also found that using the engine isn't really beneficial. Doing crypto in the kernel via KTLS seems to perform better for hardware accelerators than the /dev/crypto interface. -- John Baldwin From owner-svn-src-head@freebsd.org Mon May 11 22:57:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3705B2D9FB7; Mon, 11 May 2020 22:57:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LbtD0jx6z4LqD; Mon, 11 May 2020 22:57:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13BE725FE7; Mon, 11 May 2020 22:57:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BMvNw9096454; Mon, 11 May 2020 22:57:23 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMvMx2096445; Mon, 11 May 2020 22:57:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005112257.04BMvMx2096445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 11 May 2020 22:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360944 - in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/coccinelle X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/coccinelle X-SVN-Commit-Revision: 360944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:57:24 -0000 Author: cem Date: Mon May 11 22:57:21 2020 New Revision: 360944 URL: https://svnweb.freebsd.org/changeset/base/360944 Log: copystr(9): Move to deprecate [2/2] Unlike the other copy*() functions, it does not serve to copy from one address space to another or protect against potential faults. It's just an older incarnation of the now-more-common strlcpy(). Add a coccinelle script to tools/ which can be used to mechanically convert existing instances where replacement with strlcpy is trivial. In the two cases which matched, fuse_vfsops.c and union_vfsops.c, the code was further refactored manually to simplify. Replace the declaration of copystr() in systm.h with a small macro wrapper around strlcpy. Remove N redundant MI implementations of copystr. For MIPS, this entailed inlining the assembler copystr into the only consumer, copyinstr, and making the latter a leaf function. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D24672 Added: head/tools/coccinelle/ head/tools/coccinelle/copystr9.cocci (contents, props changed) Deleted: head/sys/arm64/arm64/copystr.c head/sys/powerpc/powerpc/copystr.c head/sys/riscv/riscv/copystr.c Modified: head/sys/amd64/amd64/support.S head/sys/arm/arm/copystr.S head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/unionfs/union_vfsops.c head/sys/i386/i386/support.s head/sys/kern/subr_csan.c head/sys/mips/mips/support.S head/sys/sys/systm.h Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Mon May 11 22:48:00 2020 (r360943) +++ head/sys/amd64/amd64/support.S Mon May 11 22:57:21 2020 (r360944) @@ -1417,43 +1417,6 @@ copyinstr_toolong: jmp cpystrflt_x /* - * copystr(from, to, maxlen, int *lencopied) - * %rdi, %rsi, %rdx, %rcx - */ -ENTRY(copystr) - PUSH_FRAME_POINTER - movq %rdx,%r8 /* %r8 = maxlen */ - - incq %rdx -1: - decq %rdx - jz 4f - movb (%rdi),%al - movb %al,(%rsi) - incq %rsi - incq %rdi - testb %al,%al - jnz 1b - - /* Success -- 0 byte reached */ - decq %rdx - xorl %eax,%eax -2: - testq %rcx,%rcx - jz 3f - /* set *lencopied and return %rax */ - subq %rdx,%r8 - movq %r8,(%rcx) -3: - POP_FRAME_POINTER - ret -4: - /* rdx is zero -- return ENAMETOOLONG */ - movl $ENAMETOOLONG,%eax - jmp 2b -END(copystr) - -/* * Handling of special amd64 registers and descriptor tables etc */ /* void lgdt(struct region_descriptor *rdp); */ Modified: head/sys/arm/arm/copystr.S ============================================================================== --- head/sys/arm/arm/copystr.S Mon May 11 22:48:00 2020 (r360943) +++ head/sys/arm/arm/copystr.S Mon May 11 22:57:21 2020 (r360944) @@ -60,39 +60,6 @@ __FBSDID("$FreeBSD$"); ldr tmp, .Lpcb #endif -/* - * r0 - from - * r1 - to - * r2 - maxlens - * r3 - lencopied - * - * Copy string from r0 to r1 - */ -ENTRY(copystr) - stmfd sp!, {r4-r5} /* stack is 8 byte aligned */ - teq r2, #0x00000000 - mov r5, #0x00000000 - moveq r0, #ENAMETOOLONG - beq 2f - -1: ldrb r4, [r0], #0x0001 - add r5, r5, #0x00000001 - teq r4, #0x00000000 - strb r4, [r1], #0x0001 - teqne r5, r2 - bne 1b - - teq r4, #0x00000000 - moveq r0, #0x00000000 - movne r0, #ENAMETOOLONG - -2: teq r3, #0x00000000 - strne r5, [r3] - - ldmfd sp!, {r4-r5} /* stack is 8 byte aligned */ - RET -END(copystr) - #define SAVE_REGS stmfd sp!, {r4-r6} #define RESTORE_REGS ldmfd sp!, {r4-r6} Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Mon May 11 22:48:00 2020 (r360943) +++ head/sys/fs/fuse/fuse_vfsops.c Mon May 11 22:57:21 2020 (r360944) @@ -303,8 +303,6 @@ fuse_vfsop_mount(struct mount *mp) int daemon_timeout; int fd; - size_t len; - struct cdev *fdev; struct fuse_data *data = NULL; struct thread *td; @@ -432,8 +430,8 @@ fuse_vfsop_mount(struct mount *mp) strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN); } - copystr(fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &len); - bzero(mp->mnt_stat.f_mntfromname + len, MNAMELEN - len); + memset(mp->mnt_stat.f_mntfromname, 0, MNAMELEN); + strlcpy(mp->mnt_stat.f_mntfromname, fspec, MNAMELEN); mp->mnt_iosize_max = MAXPHYS; /* Now handshaking with daemon */ Modified: head/sys/fs/unionfs/union_vfsops.c ============================================================================== --- head/sys/fs/unionfs/union_vfsops.c Mon May 11 22:48:00 2020 (r360943) +++ head/sys/fs/unionfs/union_vfsops.c Mon May 11 22:57:21 2020 (r360944) @@ -83,7 +83,6 @@ unionfs_domount(struct mount *mp) char *tmp; char *ep; int len; - size_t done; int below; uid_t uid; gid_t gid; @@ -304,12 +303,8 @@ unionfs_domount(struct mount *mp) */ vfs_getnewfsid(mp); - len = MNAMELEN - 1; - tmp = mp->mnt_stat.f_mntfromname; - copystr((below ? ":" : ":"), tmp, len, &done); - len -= done - 1; - tmp += done - 1; - copystr(target, tmp, len, NULL); + snprintf(mp->mnt_stat.f_mntfromname, MNAMELEN, "<%s>:%s", + below ? "below" : "above", target); UNIONFSDEBUG("unionfs_mount: from %s, on %s\n", mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname); Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Mon May 11 22:48:00 2020 (r360943) +++ head/sys/i386/i386/support.s Mon May 11 22:57:21 2020 (r360944) @@ -233,47 +233,6 @@ ENTRY(memcpy) ret END(memcpy) -/* - * copystr(from, to, maxlen, int *lencopied) - MP SAFE - */ -ENTRY(copystr) - pushl %esi - pushl %edi - - movl 12(%esp),%esi /* %esi = from */ - movl 16(%esp),%edi /* %edi = to */ - movl 20(%esp),%edx /* %edx = maxlen */ - incl %edx -1: - decl %edx - jz 4f - lodsb - stosb - orb %al,%al - jnz 1b - - /* Success -- 0 byte reached */ - decl %edx - xorl %eax,%eax - jmp 6f -4: - /* edx is zero -- return ENAMETOOLONG */ - movl $ENAMETOOLONG,%eax - -6: - /* set *lencopied and return %eax */ - movl 20(%esp),%ecx - subl %edx,%ecx - movl 24(%esp),%edx - testl %edx,%edx - jz 7f - movl %ecx,(%edx) -7: - popl %edi - popl %esi - ret -END(copystr) - ENTRY(bcmp) pushl %edi pushl %esi Modified: head/sys/kern/subr_csan.c ============================================================================== --- head/sys/kern/subr_csan.c Mon May 11 22:48:00 2020 (r360943) +++ head/sys/kern/subr_csan.c Mon May 11 22:57:21 2020 (r360944) @@ -350,19 +350,11 @@ kcsan_strlen(const char *str) return (s - str); } -#undef copystr #undef copyin #undef copyin_nofault #undef copyinstr #undef copyout #undef copyout_nofault - -int -kcsan_copystr(const void *kfaddr, void *kdaddr, size_t len, size_t *done) -{ - kcsan_access((uintptr_t)kdaddr, len, true, false, __RET_ADDR); - return copystr(kfaddr, kdaddr, len, done); -} int kcsan_copyin(const void *uaddr, void *kaddr, size_t len) Modified: head/sys/mips/mips/support.S ============================================================================== --- head/sys/mips/mips/support.S Mon May 11 22:48:00 2020 (r360943) +++ head/sys/mips/mips/support.S Mon May 11 22:57:21 2020 (r360944) @@ -105,12 +105,22 @@ .text /* - * int copystr(void *kfaddr, void *kdaddr, size_t maxlen, size_t *lencopied) - * Copy a NIL-terminated string, at most maxlen characters long. Return the - * number of characters copied (including the NIL) in *lencopied. If the - * string is too long, return ENAMETOOLONG; else return 0. + * Copy a null terminated string from the user address space into + * the kernel address space. + * + * copyinstr(fromaddr, toaddr, maxlength, &lencopied) + * caddr_t fromaddr; + * caddr_t toaddr; + * u_int maxlength; + * u_int *lencopied; */ -LEAF(copystr) +LEAF(copyinstr) + PTR_LA v0, __copyinstr_err + blt a0, zero, __copyinstr_err # make sure address is in user space + GET_CPU_PCPU(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S v0, U_PCB_ONFAULT(v1) + move t0, a2 beq a2, zero, 4f 1: @@ -128,37 +138,14 @@ LEAF(copystr) PTR_SUBU a2, t0, a2 # if the 4th arg was non-NULL PTR_S a2, 0(a3) 3: - j ra # v0 is 0 or ENAMETOOLONG + + PTR_S zero, U_PCB_ONFAULT(v1) + j ra nop -END(copystr) - -/* - * Copy a null terminated string from the user address space into - * the kernel address space. - * - * copyinstr(fromaddr, toaddr, maxlength, &lencopied) - * caddr_t fromaddr; - * caddr_t toaddr; - * u_int maxlength; - * u_int *lencopied; - */ -NESTED(copyinstr, CALLFRAME_SIZ, ra) - PTR_SUBU sp, sp, CALLFRAME_SIZ - .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) - PTR_LA v0, copyerr - blt a0, zero, _C_LABEL(copyerr) # make sure address is in user space - REG_S ra, CALLFRAME_RA(sp) - GET_CPU_PCPU(v1) - PTR_L v1, PC_CURPCB(v1) - jal _C_LABEL(copystr) - PTR_S v0, U_PCB_ONFAULT(v1) - REG_L ra, CALLFRAME_RA(sp) - GET_CPU_PCPU(v1) - PTR_L v1, PC_CURPCB(v1) - PTR_S zero, U_PCB_ONFAULT(v1) - j ra - PTR_ADDU sp, sp, CALLFRAME_SIZ +__copyinstr_err: + j ra + li v0, EFAULT END(copyinstr) /* Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Mon May 11 22:48:00 2020 (r360943) +++ head/sys/sys/systm.h Mon May 11 22:57:21 2020 (r360944) @@ -362,9 +362,17 @@ void *memcpy_early(void * _Nonnull to, const void * _N void *memmove_early(void * _Nonnull dest, const void * _Nonnull src, size_t n); #define bcopy_early(from, to, len) memmove_early((to), (from), (len)) -int copystr(const void * _Nonnull __restrict kfaddr, - void * _Nonnull __restrict kdaddr, size_t len, - size_t * __restrict lencopied); +#define copystr(src, dst, len, outlen) ({ \ + size_t __r, __len, *__outlen; \ + \ + __len = (len); \ + __outlen = (outlen); \ + __r = strlcpy((dst), (src), __len); \ + if (__outlen != NULL) \ + *__outlen = ((__r >= __len) ? __len : __r); \ + ((__r >= __len) ? ENAMETOOLONG : 0); \ +}) + int copyinstr(const void * __restrict udaddr, void * _Nonnull __restrict kaddr, size_t len, size_t * __restrict lencopied); @@ -378,11 +386,9 @@ int copyout_nofault(const void * _Nonnull __restrict k void * __restrict udaddr, size_t len); #ifdef KCSAN -int kcsan_copystr(const void *, void *, size_t, size_t *); int kcsan_copyin(const void *, void *, size_t); int kcsan_copyinstr(const void *, void *, size_t, size_t *); int kcsan_copyout(const void *, void *, size_t); -#define copystr(kf, k, l, lc) kcsan_copystr((kf), (k), (l), (lc)) #define copyin(u, k, l) kcsan_copyin((u), (k), (l)) #define copyinstr(u, k, l, lc) kcsan_copyinstr((u), (k), (l), (lc)) #define copyout(k, u, l) kcsan_copyout((k), (u), (l)) Added: head/tools/coccinelle/copystr9.cocci ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/coccinelle/copystr9.cocci Mon May 11 22:57:21 2020 (r360944) @@ -0,0 +1,39 @@ +@ nostorederror_nostoredlen @ + expression __src, __dst, __len; + statement S1; +@@ + + S1 +-copystr(__src, __dst, __len, NULL); ++strlcpy(__dst, __src, __len); + +@ ifcondition_nostoredlen @ + expression __src, __dst, __len; + statement S1; +@@ + if ( +( +-copystr(__src, __dst, __len, NULL) == ENAMETOOLONG +| +-copystr(__src, __dst, __len, NULL) != 0 +| +-copystr(__src, __dst, __len, NULL) +) ++strlcpy(__dst, __src, __len) >= __len + ) S1 + +@ nostorederror_storedlen1 @ + expression __src, __dst, __len; + identifier __done; + statement S1; +@@ + S1 +( +-copystr(__src, __dst, __len, &__done); ++__done = strlcpy(__dst, __src, __len); ++__done = MIN(__done, __len); +| +-copystr(__src, __dst, __len, __done); ++ *__done = strlcpy(__dst, __src, __len); ++ *__done = MIN(*__done, __len); +) From owner-svn-src-head@freebsd.org Tue May 12 00:42:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AFC72DC5C6; Tue, 12 May 2020 00:42:17 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LfCD71JPz4SHL; Tue, 12 May 2020 00:42:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBEDD27383; Tue, 12 May 2020 00:42:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C0gGBL067018; Tue, 12 May 2020 00:42:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C0gGM6067016; Tue, 12 May 2020 00:42:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005120042.04C0gGM6067016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 12 May 2020 00:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360946 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 360946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 00:42:17 -0000 Author: cem Date: Tue May 12 00:42:16 2020 New Revision: 360946 URL: https://svnweb.freebsd.org/changeset/base/360946 Log: Remove deleted files from the build Fix build break introduced in r360944. Reported by: kevans Modified: head/sys/conf/files.arm64 head/sys/conf/files.powerpc head/sys/conf/files.riscv Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue May 12 00:36:37 2020 (r360945) +++ head/sys/conf/files.arm64 Tue May 12 00:42:16 2020 (r360946) @@ -133,7 +133,6 @@ arm64/arm64/busdma_machdep.c standard arm64/arm64/bzero.S standard arm64/arm64/clock.c standard arm64/arm64/copyinout.S standard -arm64/arm64/copystr.c standard arm64/arm64/cpu_errata.c standard arm64/arm64/cpufunc_asm.S standard arm64/arm64/db_disasm.c optional ddb Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue May 12 00:36:37 2020 (r360945) +++ head/sys/conf/files.powerpc Tue May 12 00:42:16 2020 (r360946) @@ -241,7 +241,6 @@ powerpc/powerpc/bus_machdep.c standard powerpc/powerpc/busdma_machdep.c standard powerpc/powerpc/clock.c standard powerpc/powerpc/copyinout.c standard -powerpc/powerpc/copystr.c standard powerpc/powerpc/cpu.c standard powerpc/powerpc/cpu_subr64.S optional powerpc64 powerpc/powerpc/db_disasm.c optional ddb Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Tue May 12 00:36:37 2020 (r360945) +++ head/sys/conf/files.riscv Tue May 12 00:42:16 2020 (r360946) @@ -37,7 +37,6 @@ riscv/riscv/busdma_bounce.c standard riscv/riscv/busdma_machdep.c standard riscv/riscv/clock.c standard riscv/riscv/copyinout.S standard -riscv/riscv/copystr.c standard riscv/riscv/cpufunc_asm.S standard riscv/riscv/db_disasm.c optional ddb riscv/riscv/db_interface.c optional ddb From owner-svn-src-head@freebsd.org Tue May 12 01:04:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B23EB2DCF18; Tue, 12 May 2020 01:04:50 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LfjG4GGbz4TQW; Tue, 12 May 2020 01:04:50 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D59327882; Tue, 12 May 2020 01:04:50 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C14o7H079509; Tue, 12 May 2020 01:04:50 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C14oe1079508; Tue, 12 May 2020 01:04:50 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202005120104.04C14oe1079508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 12 May 2020 01:04:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360948 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 360948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 01:04:50 -0000 Author: bdragon Date: Tue May 12 01:04:50 2020 New Revision: 360948 URL: https://svnweb.freebsd.org/changeset/base/360948 Log: [PowerPC64] Minor correctness fix in rstcode. TRAP_ENTRY(0) should be TRAP_GENTRAP(0) here. However, in practice, it doesn't matter, as the only time TRAP_ENTRY and TRAP_GENTRAP can differ is when bridge mode is active, which is impossible on the 64 bit kernel. Fix it anyway in case we ever need to add a trap preamble on PPC64. Modified: head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Tue May 12 01:01:48 2020 (r360947) +++ head/sys/powerpc/aim/trap_subr64.S Tue May 12 01:04:50 2020 (r360948) @@ -318,7 +318,7 @@ CNAME(rstcode): * It is software reset when 46:47 = 0b00 */ /* 0x00 */ - ld %r2,TRAP_ENTRY(0) /* Real-mode &generictrap */ + ld %r2,TRAP_GENTRAP(0) /* Real-mode &generictrap */ mfsrr1 %r9 /* Load SRR1 into r9 */ andis. %r9,%r9,0x3 /* Logic AND with 46:47 bits */ From owner-svn-src-head@freebsd.org Tue May 12 01:36:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFB242DE07A; Tue, 12 May 2020 01:36:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LgQ84d7gz4W69; Tue, 12 May 2020 01:36:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99CFB27E89; Tue, 12 May 2020 01:36:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C1amlF097851; Tue, 12 May 2020 01:36:48 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C1am6u097850; Tue, 12 May 2020 01:36:48 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005120136.04C1am6u097850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 12 May 2020 01:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360950 - head/tools/tools/ath/ath_ee_9300_print X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/tools/ath/ath_ee_9300_print X-SVN-Commit-Revision: 360950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 01:36:48 -0000 Author: adrian Date: Tue May 12 01:36:48 2020 New Revision: 360950 URL: https://svnweb.freebsd.org/changeset/base/360950 Log: [ar9300] Update the ar9300 eeprom dump utility to include target power and CTL. This lets me easily see what the EEPROM target power and regulatory compliance table limits are. (Yeah, should've done this in 2013..) Modified: head/tools/tools/ath/ath_ee_9300_print/main.c Modified: head/tools/tools/ath/ath_ee_9300_print/main.c ============================================================================== --- head/tools/tools/ath/ath_ee_9300_print/main.c Tue May 12 01:23:05 2020 (r360949) +++ head/tools/tools/ath/ath_ee_9300_print/main.c Tue May 12 01:36:48 2020 (r360950) @@ -37,6 +37,34 @@ struct ath_hal; #include "ar9300/ar9300eep.h" +static const char * +eeprom_9300_ctl_idx_to_mode(uint8_t idx) +{ + switch (idx & 0xf) { + /* 2G CTLs */ + case 1: return "CCK"; + case 2: return "OFDM"; + case 5: return "HT20"; + case 7: return "HT40"; + /* 5G CTLs */ + case 0: return "OFDM"; + case 6: return "HT20"; + case 8: return "HT40"; + default: return ""; + } +} + +static const char * +eeprom_9300_ctl_idx_to_regdomain(uint8_t idx) +{ + switch (idx & 0xf0) { + case 0x10: return "FCC"; + case 0x30: return "ETSI"; + case 0x40: return "JP"; + } +} + + static void eeprom_9300_hdr_print(const uint16_t *buf) { @@ -156,6 +184,246 @@ eeprom_9300_modal_print(const OSPREY_MODAL_EEP_HEADER } static void +eeprom_9300_print_2g_target_cck(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_2G_CCK_TARGET_POWERS; i++) { + printf("| Freq %u CCK: pow2x 1/5L %u 5S %u 11L %u 11S %u\n", + FBIN2FREQ(ee->cal_target_freqbin_cck[i], 1), + ee->cal_target_power_cck[i].t_pow2x[LEGACY_TARGET_RATE_1L_5L], + ee->cal_target_power_cck[i].t_pow2x[LEGACY_TARGET_RATE_5S], + ee->cal_target_power_cck[i].t_pow2x[LEGACY_TARGET_RATE_11L], + ee->cal_target_power_cck[i].t_pow2x[LEGACY_TARGET_RATE_11S]); + } +} + +static void +eeprom_9300_print_2g_target_ofdm(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_2G_20_TARGET_POWERS; i++) { + printf("| Freq %u OFDM: pow2x 6/12/18/24M %u 36M %u 48M %u 54M %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g[i], 1), + ee->cal_target_power_2g[i].t_pow2x[LEGACY_TARGET_RATE_6_24], + ee->cal_target_power_2g[i].t_pow2x[LEGACY_TARGET_RATE_36], + ee->cal_target_power_2g[i].t_pow2x[LEGACY_TARGET_RATE_48], + ee->cal_target_power_2g[i].t_pow2x[LEGACY_TARGET_RATE_54]); + } +} + +static void +eeprom_9300_print_2g_target_ht20(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_2G_20_TARGET_POWERS; i++) { + printf("| Freq %u HT20 MCS0-7 pow2x %u %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_4], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_5], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_6], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_7]); + printf("| Freq %u HT20 MCS8-15 pow2x %u %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_12], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_13], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_14], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_15]); + printf("| Freq %u HT20 MCS16-23 pow2x %u %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_20], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_21], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_22], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_23]); + } +} + +static void +eeprom_9300_print_2g_target_ht40(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_2G_40_TARGET_POWERS; i++) { + printf("| Freq %u HT40 MCS0-7 pow2x %u %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g_ht40[i], 1), + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_4], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_5], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_6], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_7]); + printf("| Freq %u HT40 MCS8-15 pow2x %u %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g_ht40[i], 1), + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_12], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_13], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_14], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_15]); + printf("| Freq %u HT40 MCS16-23 pow2x %u %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g_ht40[i], 1), + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_20], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_21], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_22], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_23]); + } +} + +static void +eeprom_9300_print_2g_ctls(const ar9300_eeprom_t *ee) +{ + int i, j; + + for (i = 0; i < OSPREY_NUM_CTLS_2G; i++) { + printf("| CTL index 0x%.02x (%s %s)\n", + ee->ctl_index_2g[i], + eeprom_9300_ctl_idx_to_regdomain(ee->ctl_index_2g[i]), + eeprom_9300_ctl_idx_to_mode(ee->ctl_index_2g[i])); + for (j = 0; j < OSPREY_NUM_BAND_EDGES_2G; j++) { + printf("| Freq %u pow2x %u flags 0x%x\n", + FBIN2FREQ(ee->ctl_freqbin_2G[i][j], 1), + ee->ctl_power_data_2g[i].ctl_edges[j].t_power, + ee->ctl_power_data_2g[i].ctl_edges[j].flag); + } + printf("\n"); + } +} + +static void +eeprom_9300_print_5g_target_ofdm(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_5G_20_TARGET_POWERS; i++) { + printf("| Freq %u OFDM: pow2x 6/12/18/24M %u 36M %u 48M %u 54M %u\n", + FBIN2FREQ(ee->cal_target_freqbin_5g[i], 0), + ee->cal_target_power_5g[i].t_pow2x[LEGACY_TARGET_RATE_6_24], + ee->cal_target_power_5g[i].t_pow2x[LEGACY_TARGET_RATE_36], + ee->cal_target_power_5g[i].t_pow2x[LEGACY_TARGET_RATE_48], + ee->cal_target_power_5g[i].t_pow2x[LEGACY_TARGET_RATE_54]); + } +} + +static void +eeprom_9300_print_5g_target_ht20(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_5G_20_TARGET_POWERS; i++) { + printf("| Freq %u HT20 MCS0-7 pow2x %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_5g_ht20[i], 0), + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_4], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_5], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_6], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_7]); + printf("| Freq %u HT20 MCS8-15 pow2x %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_5g_ht20[i], 0), + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_12], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_13], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_14], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_15]); + printf("| Freq %u HT20 MCS16-23 pow2x %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_5g_ht20[i], 0), + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_20], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_21], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_22], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_23]); + } +} + +static void +eeprom_9300_print_5g_target_ht40(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_5G_40_TARGET_POWERS; i++) { + printf("| Freq %u HT40 MCS0-7 pow2x %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_5g_ht40[i], 0), + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_4], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_5], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_6], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_7]); + printf("| Freq %u HT40 MCS8-15 pow2x %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_5g_ht40[i], 0), + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_12], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_13], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_14], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_15]); + printf("| Freq %u HT40 MCS16-23 pow2x %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_5g_ht40[i], 0), + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_20], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_21], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_22], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_23]); + } +} + +static void +eeprom_9300_print_5g_ctls(const ar9300_eeprom_t *ee) +{ + int i, j; + + for (i = 0; i < OSPREY_NUM_CTLS_5G; i++) { + printf("| CTL index 0x%.02x (%s %s)\n", ee->ctl_index_5g[i], + eeprom_9300_ctl_idx_to_regdomain(ee->ctl_index_5g[i]), + eeprom_9300_ctl_idx_to_mode(ee->ctl_index_5g[i])); + for (j = 0; j < OSPREY_NUM_BAND_EDGES_5G; j++) { + printf("| Freq %u pow2x %u Flags 0x%x\n", + FBIN2FREQ(ee->ctl_freqbin_5G[i][j], 0), + ee->ctl_power_data_5g[i].ctl_edges[j].t_power, + ee->ctl_power_data_5g[i].ctl_edges[j].flag); + } + printf("\n"); + } +} + +static void load_eeprom_dump(const char *file, uint16_t *buf) { unsigned int r[8]; @@ -222,9 +490,19 @@ main(int argc, char *argv[]) printf("\n2GHz modal:\n"); eeprom_9300_modal_print(&ee->modal_header_2g); + // TODO: open-loop calibration + eeprom_9300_print_2g_target_cck(ee); + eeprom_9300_print_2g_target_ofdm(ee); + eeprom_9300_print_2g_target_ht20(ee); + eeprom_9300_print_2g_target_ht40(ee); + eeprom_9300_print_2g_ctls(ee); printf("\n5GHz modal:\n"); eeprom_9300_modal_print(&ee->modal_header_5g); + eeprom_9300_print_5g_target_ofdm(ee); + eeprom_9300_print_5g_target_ht20(ee); + eeprom_9300_print_5g_target_ht40(ee); + eeprom_9300_print_5g_ctls(ee); free(eep); exit(0); From owner-svn-src-head@freebsd.org Tue May 12 01:40:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3A6D2DE1F8; Tue, 12 May 2020 01:40:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LgVm3xbrz4WHw; Tue, 12 May 2020 01:40:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8209E27EAB; Tue, 12 May 2020 01:40:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C1emho098097; Tue, 12 May 2020 01:40:48 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C1em5s098096; Tue, 12 May 2020 01:40:48 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005120140.04C1em5s098096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 12 May 2020 01:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360951 - head/tools/tools/ath/ath_ee_9300_print X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/tools/ath/ath_ee_9300_print X-SVN-Commit-Revision: 360951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 01:40:48 -0000 Author: adrian Date: Tue May 12 01:40:48 2020 New Revision: 360951 URL: https://svnweb.freebsd.org/changeset/base/360951 Log: [ar9300] Fix up this tool after test compiling it with LLVM. Le oops. Modified: head/tools/tools/ath/ath_ee_9300_print/main.c Modified: head/tools/tools/ath/ath_ee_9300_print/main.c ============================================================================== --- head/tools/tools/ath/ath_ee_9300_print/main.c Tue May 12 01:36:48 2020 (r360950) +++ head/tools/tools/ath/ath_ee_9300_print/main.c Tue May 12 01:40:48 2020 (r360951) @@ -61,10 +61,10 @@ eeprom_9300_ctl_idx_to_regdomain(uint8_t idx) case 0x10: return "FCC"; case 0x30: return "ETSI"; case 0x40: return "JP"; + default: return ""; } } - static void eeprom_9300_hdr_print(const uint16_t *buf) { @@ -219,7 +219,7 @@ eeprom_9300_print_2g_target_ht20(const ar9300_eeprom_t int i; for (i = 0; i < OSPREY_NUM_2G_20_TARGET_POWERS; i++) { - printf("| Freq %u HT20 MCS0-7 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT20 MCS0-7 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], @@ -229,7 +229,7 @@ eeprom_9300_print_2g_target_ht20(const ar9300_eeprom_t ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_5], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_6], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_7]); - printf("| Freq %u HT20 MCS8-15 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT20 MCS8-15 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], @@ -239,7 +239,7 @@ eeprom_9300_print_2g_target_ht20(const ar9300_eeprom_t ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_13], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_14], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_15]); - printf("| Freq %u HT20 MCS16-23 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT20 MCS16-23 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], @@ -258,7 +258,7 @@ eeprom_9300_print_2g_target_ht40(const ar9300_eeprom_t int i; for (i = 0; i < OSPREY_NUM_2G_40_TARGET_POWERS; i++) { - printf("| Freq %u HT40 MCS0-7 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT40 MCS0-7 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht40[i], 1), ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], @@ -268,7 +268,7 @@ eeprom_9300_print_2g_target_ht40(const ar9300_eeprom_t ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_5], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_6], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_7]); - printf("| Freq %u HT40 MCS8-15 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT40 MCS8-15 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht40[i], 1), ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], @@ -278,7 +278,7 @@ eeprom_9300_print_2g_target_ht40(const ar9300_eeprom_t ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_13], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_14], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_15]); - printf("| Freq %u HT40 MCS16-23 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT40 MCS16-23 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht40[i], 1), ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], From owner-svn-src-head@freebsd.org Tue May 12 01:47:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C0112DE640; Tue, 12 May 2020 01:47:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LgfZ0S9Rz4WqC; Tue, 12 May 2020 01:47:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ADE5A8; Tue, 12 May 2020 01:47:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C1lX8V004311; Tue, 12 May 2020 01:47:33 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C1lXdV004310; Tue, 12 May 2020 01:47:33 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005120147.04C1lXdV004310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 12 May 2020 01:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360952 - head/lib/libz X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/lib/libz X-SVN-Commit-Revision: 360952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 01:47:34 -0000 Author: delphij Date: Tue May 12 01:47:33 2020 New Revision: 360952 URL: https://svnweb.freebsd.org/changeset/base/360952 Log: Generate zlib.pc from source. Reviewed by: bapt MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24806 Deleted: head/lib/libz/zlib.pc Modified: head/lib/libz/Makefile Modified: head/lib/libz/Makefile ============================================================================== --- head/lib/libz/Makefile Tue May 12 01:40:48 2020 (r360951) +++ head/lib/libz/Makefile Tue May 12 01:47:33 2020 (r360952) @@ -53,6 +53,17 @@ INCS= zconf.h zlib.h .PATH: ${ZLIBSRC}/test +ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' ${ZLIBSRC}/zlib.h + +zlib.pc: zlib.pc.in + sed -e 's,@prefix@,/usr,g ; \ + s,@exec_prefix@,$${prefix},g ; \ + s,@libdir@,$${exec_prefix}/lib,g ; \ + s,@sharedlibdir@,$${libdir},g ; \ + s,@includedir@,$${prefix}/include,g ; \ + s,@VERSION@,${ZLIB_VERSION},g ;' \ + ${.ALLSRC} > ${.TARGET} + minigzip: all minigzip.o $(CC) -o minigzip minigzip.o -L. -lz From owner-svn-src-head@freebsd.org Tue May 12 02:20:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A25F2DF524; Tue, 12 May 2020 02:20:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LhNX2hyPz4YQj; Tue, 12 May 2020 02:20:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57F586D7; Tue, 12 May 2020 02:20:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C2KStY022685; Tue, 12 May 2020 02:20:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C2KRWW022682; Tue, 12 May 2020 02:20:27 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005120220.04C2KRWW022682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 12 May 2020 02:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360953 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath/ath_hal X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath/ath_hal X-SVN-Commit-Revision: 360953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 02:20:28 -0000 Author: adrian Date: Tue May 12 02:20:27 2020 New Revision: 360953 URL: https://svnweb.freebsd.org/changeset/base/360953 Log: [ath_hal] [ath_hal_ar9300] Fix endian macros to work in and out of kernel tree. Yes, people shouldn't use bitfields in C for structure parsing. If someone ever wants a cleanup task then it'd be great to remove them from this vendor code and other places in the ar9285/ar9287 HALs. Alas, here we are. AH_BYTE_ORDER wasn't defined and neither were the two values it could be. So when compiling ath_ee_print_9300 it'd default to the big endian struct layout and get a WHOLE lot of stuff wrong. So: * move AH_BYTE_ORDER into ath_hal/ah.h where it can be used by everyone. * ensure that AH_BYTE_ORDER is actually defined before using it! This should work on both big and little endian platforms. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Tue May 12 01:47:33 2020 (r360952) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Tue May 12 02:20:27 2020 (r360953) @@ -19,18 +19,14 @@ #include "ar9300_freebsd_inc.h" -#define AH_BIG_ENDIAN 4321 -#define AH_LITTLE_ENDIAN 1234 - -#if _BYTE_ORDER == _BIG_ENDIAN -#define AH_BYTE_ORDER AH_BIG_ENDIAN -#else -#define AH_BYTE_ORDER AH_LITTLE_ENDIAN -#endif - /* XXX doesn't belong here */ #define AR_EEPROM_MODAL_SPURS 5 +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + /* * (a) this should be N(a), * (b) FreeBSD does define nitems, @@ -43,9 +39,7 @@ #include "ah_devid.h" #include "ar9300eep.h" /* For Eeprom definitions */ - #define AR9300_MAGIC 0x19741014 - /* MAC register values */ Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Tue May 12 01:47:33 2020 (r360952) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Tue May 12 02:20:27 2020 (r360953) @@ -18,13 +18,17 @@ #define _ATH_AR9300_EEP_H_ #include "opt_ah.h" - #include "ah.h" #if defined(WIN32) || defined(WIN64) #pragma pack (push, ar9300, 1) #endif +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + /* FreeBSD extras - should be in ah_eeprom.h ? */ #define AR_EEPROM_EEPCAP_COMPRESS_DIS 0x0001 #define AR_EEPROM_EEPCAP_AES_DIS 0x0002 @@ -345,11 +349,13 @@ typedef struct CalCtlEdgePwr { u_int8_t flag :2, t_power :6; } __packed CAL_CTL_EDGE_PWR; -#else +#elif AH_BYTE_ORDER == AH_LITTLE_ENDIAN typedef struct CalCtlEdgePwr { u_int8_t t_power :6, flag :2; } __packed CAL_CTL_EDGE_PWR; +#else +#error AH_BYTE_ORDER undefined! #endif typedef struct ospCalCtlData_5G { Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Tue May 12 01:47:33 2020 (r360952) +++ head/sys/dev/ath/ath_hal/ah.h Tue May 12 02:20:27 2020 (r360953) @@ -33,6 +33,18 @@ #include "ah_osdep.h" /* + * Endianness macros; used by various structures and code. + */ +#define AH_BIG_ENDIAN 4321 +#define AH_LITTLE_ENDIAN 1234 + +#if _BYTE_ORDER == _BIG_ENDIAN +#define AH_BYTE_ORDER AH_BIG_ENDIAN +#else +#define AH_BYTE_ORDER AH_LITTLE_ENDIAN +#endif + +/* * The maximum number of TX/RX chains supported. * This is intended to be used by various statistics gathering operations * (NF, RSSI, EVM). From owner-svn-src-head@freebsd.org Tue May 12 02:23:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7FAE2DF810; Tue, 12 May 2020 02:23:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LhRj3zNCz4YqZ; Tue, 12 May 2020 02:23:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83C438B1; Tue, 12 May 2020 02:23:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C2ND2K028396; Tue, 12 May 2020 02:23:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C2NB3K028384; Tue, 12 May 2020 02:23:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005120223.04C2NB3K028384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 12 May 2020 02:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360954 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Commit-Revision: 360954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 02:23:13 -0000 Author: adrian Date: Tue May 12 02:23:11 2020 New Revision: 360954 URL: https://svnweb.freebsd.org/changeset/base/360954 Log: [ath_hal_ar9300] Ensure AH_BYTE_ORDER is defined before used. Same deal here - ensure endian bits are set here first! Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_osprey_k31.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_wasp_2.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb112.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb113.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h Tue May 12 02:23:11 2020 (r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300templateAP121_h__ #define __ar9300templateAP121_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_ap121= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h Tue May 12 02:23:11 2020 (r360954) @@ -26,6 +26,11 @@ #ifndef __ar9300templateAphrodite_h__ #define __ar9300templateAphrodite_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_aphrodite= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h Tue May 12 02:23:11 2020 (r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300template_cus157_h__ #define __ar9300template_cus157_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t Ar9300Template_cus157= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.h Tue May 12 02:23:11 2020 (r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300templateGeneric_h__ #define __ar9300templateGeneric_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_generic= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h Tue May 12 02:23:11 2020 (r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300templateHB112_h__ #define __ar9300templateHB112_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_hb112= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h Tue May 12 02:23:11 2020 (r360954) @@ -26,6 +26,11 @@ #ifndef __ar9300templateHB116_h__ #define __ar9300templateHB116_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_hb116= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_osprey_k31.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_osprey_k31.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_osprey_k31.h Tue May 12 02:23:11 2020 (r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300templateOsprey_k31_h__ #define __ar9300templateOsprey_k31_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_osprey_k31= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_wasp_2.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_wasp_2.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_wasp_2.h Tue May 12 02:23:11 2020 (r360954) @@ -24,6 +24,12 @@ #ifndef __ar9300template_wasp_2_h__ #define __ar9300template_wasp_2_h__ + +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_wasp_2= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb112.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb112.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb112.h Tue May 12 02:23:11 2020 (r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300templateXB112_h__ #define __ar9300templateXB112_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_xb112= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb113.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb113.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb113.h Tue May 12 02:23:11 2020 (r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300templateXB113_h__ #define __ar9300templateXB113_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_xb113= { From owner-svn-src-head@freebsd.org Tue May 12 03:18:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3F482E0DB9; Tue, 12 May 2020 03:18:17 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LjgF5Jpwz4cdj; Tue, 12 May 2020 03:18:17 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pj1-x102f.google.com with SMTP id e6so8701036pjt.4; Mon, 11 May 2020 20:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Q5LRHiKwKw7FAbakmo7vETJ1hq3WsR9W3SH3qlMORKk=; b=jpn8NzJDcce1b2bYXV1PbTpOCoH/8tM8LvOnzMqzSl8sAyJJ9uGGqSuPuis9Oz/VsL hDbO/GrY9j+5l6wmuBN+u55ZQV5XmVFplgHiN0prQXJ6XFswZCebk0xr+nb1gvn1NKGl oLNn4O9/dGILZ+RvS24Dsx1hxO6ErE4IykaGIeO/7GdbrW6pjtswAfqcHKWeQcSrffMl UZDrvWD/LuKhIlJn0Jk6+me0Lugsula5/VpP87N8tFpP9WVkor1cIh/brLVx8XBWm4mp EAJZoH5JUg/ZNGa33xlJvXu7vnlEbVwljzpaytZtCtst+hiBynJUWS8OWBka+wQ7zCuw 4TRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Q5LRHiKwKw7FAbakmo7vETJ1hq3WsR9W3SH3qlMORKk=; b=dF8qS5bZKvF/RkLmPKShHTAx0iMHMwCEua2bG1hDZ+c6fikH1+ONwqJhTTBkMVmKR7 UfcCgZ2XigEccxPPCO/JVGCfhPTui8Ai4lHZta5B4jypyCd1K0tlj+JNYZVAKGrK1bbT ebqmWLgWv+/kfVMHItpxz3vudxlxAhB0/0b9HzM2jtYDkAqfgoIiBwOHXXBz6498Dmj+ hAxu2n7Ps3lVqf1Qv5cEtt+4CpogKnStT0j8hWWVh2jIDocByq0bmiIV+XO+Adv0/YSi zTzDbkcZ5JC7iQmuPsN0uGhdWKCzSXBS/e+xDXYApDUsrMNfxUMT1WICTZWec2CCMQXY W9zg== X-Gm-Message-State: AGi0PuZvFS7SCHUsO0F4YQF5iNNC123D1jQqglnTq/JkZkRJY+5/4SYy NxFnLrAyqPUea1Kqi17dDZWat9oYAZk= X-Google-Smtp-Source: APiQypJV61XSTFdij5vetXZnq8ZUItXJJpLyyBsEK4CWaTqRnWNZMvYscp+zZlgm42Gnq4sdrGnrwg== X-Received: by 2002:a17:90a:a50b:: with SMTP id a11mr26008341pjq.143.1589253496041; Mon, 11 May 2020 20:18:16 -0700 (PDT) Received: from [192.168.20.26] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id v133sm10493201pfc.113.2020.05.11.20.18.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2020 20:18:15 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r360905 - in head/tests/sys/netpfil: common pf From: Enji Cooper In-Reply-To: <202005111907.04BJ7XQs051443@repo.freebsd.org> Date: Mon, 11 May 2020 20:18:15 -0700 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <38FB0E56-E339-4446-9239-25F27DBCA27D@gmail.com> References: <202005111907.04BJ7XQs051443@repo.freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49LjgF5Jpwz4cdj X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 03:18:17 -0000 > On May 11, 2020, at 12:07 PM, Mark Johnston wrote: >=20 > Author: markj > Date: Mon May 11 19:07:33 2020 > New Revision: 360905 > URL: https://svnweb.freebsd.org/changeset/base/360905 >=20 > Log: > Remove the svn:executable property from some pf test files. >=20 > The test makefiles will handle setting mode bits during install. = Also, > Phabricator gets upset when uploading an executable plain-text file > without a shebang. Awesome =E2=80=94 thanks for doing this! Cheers, -Enji= From owner-svn-src-head@freebsd.org Tue May 12 03:28:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B00E52E0FF7; Tue, 12 May 2020 03:28:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (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 49Ljv62QGJz4d4V; Tue, 12 May 2020 03:28:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id YLanjuuffng7KYLapjQhfI; Mon, 11 May 2020 21:28:31 -0600 X-Authority-Analysis: v=2.3 cv=ecemg4MH c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=sTwFKg_x9MkA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=UQqzRo2VMZOa0133vbQA:9 a=IB-5xOalOEsgZyZU:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=UDnyf2zBuKT2w-IlGP_r:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTP id B5BE8D3B; Mon, 11 May 2020 20:28:28 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id 04C3SRid081100; Mon, 11 May 2020 20:28:27 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id 04C3SR2X081094; Mon, 11 May 2020 20:28:27 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202005120328.04C3SR2X081094@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Conrad Meyer cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360944 - in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/coccinelle In-reply-to: <202005112257.04BMvMx2096445@repo.freebsd.org> References: <202005112257.04BMvMx2096445@repo.freebsd.org> Comments: In-reply-to Conrad Meyer message dated "Mon, 11 May 2020 22:57:22 -0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 11 May 2020 20:28:27 -0700 X-CMAE-Envelope: MS4wfOArhZV3RjvfOR5gjmvxBRl8CQC50U3RcSvcjuz11JeXVn1RoWhTs7xSn5wyXgru0ug9RF7saD6gXDrJtcTW5s5SgUvhAIiwPgsxtlGv978AHOAk1K/S lMJb0M7AcvCuyccPT3FegOvZbpt+7ru2R2ApL47pnZKJpVoPbLBKGm3q7HbdsI+XLQj2l6QN6hI9MTg6Kh//5VJDzBFf36VfmOtn3A6vhfHtKrWJEggNVIyZ 9l1lT7B/3xBrKhQnVn/kJfc3vTSJ1YMTO1O2BGt88DJqLvxglV/Y3SXjAkRi0du+ X-Rspamd-Queue-Id: 49Ljv62QGJz4d4V X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 03:28:34 -0000 In message <202005112257.04BMvMx2096445@repo.freebsd.org>, Conrad Meyer writes: > Author: cem > Date: Mon May 11 22:57:21 2020 > New Revision: 360944 > URL: https://svnweb.freebsd.org/changeset/base/360944 > > Log: > copystr(9): Move to deprecate [2/2] > > Unlike the other copy*() functions, it does not serve to copy from one > address space to another or protect against potential faults. It's just > an older incarnation of the now-more-common strlcpy(). > > Add a coccinelle script to tools/ which can be used to mechanically > convert existing instances where replacement with strlcpy is trivial. > In the two cases which matched, fuse_vfsops.c and union_vfsops.c, the > code was further refactored manually to simplify. > > Replace the declaration of copystr() in systm.h with a small macro > wrapper around strlcpy. > > Remove N redundant MI implementations of copystr. For MIPS, this > entailed inlining the assembler copystr into the only consumer, > copyinstr, and making the latter a leaf function. > > Reviewed by: jhb > Differential Revision: https://reviews.freebsd.org/D24672 > > Added: > head/tools/coccinelle/ > head/tools/coccinelle/copystr9.cocci (contents, props changed) > Deleted: > head/sys/arm64/arm64/copystr.c > head/sys/powerpc/powerpc/copystr.c > head/sys/riscv/riscv/copystr.c > Modified: > head/sys/amd64/amd64/support.S > head/sys/arm/arm/copystr.S > head/sys/fs/fuse/fuse_vfsops.c > head/sys/fs/unionfs/union_vfsops.c > head/sys/i386/i386/support.s > head/sys/kern/subr_csan.c > head/sys/mips/mips/support.S > head/sys/sys/systm.h > Hi Conrad, This is causing a failure to boot with geom_mirror: GEOM_MIRROR: Device mirror/gm0 launched (2/2). GEOM_MIRROR: Device mirror/gm1 launched (2/2). GEOM_MIRROR: Device mirror/gm2 launched (2/2). GEOM_MIRROR: Device mirror/gm3 launched (2/2). mountroot: waiting for device /dev/mirror/gm0a... Mounting from ufs:/dev/mirror/gm0a failed with error 2; retrying for 3 more seconds exec /sbin/init: error 20 exec /sbin/init.bak: error 20 exec /rescue/init: error 20 init: not found in path /sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init panic: no init cpuid = 1 time = 1589225852 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe004df51ba0 vpanic() at vpanic+0x182/frame 0xfffffe004df51bf0 panic() at panic+0x43/frame 0xfffffe004df51c50 start_init() at start_init+0x23c/frame 0xfffffe004df51cf0 fork_exit() at fork_exit+0x7e/frame 0xfffffe004df51d30 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004df51d30 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- Uptime: 9s acpi0: reset failed - timeout Automatic reboot in 15 seconds - press a key on the console to abort --> Press a key on the console to reboot, --> or switch off the system now. Rebooting... cpu_reset: Restarting BSP cpu_reset_proxy: Stopped CPU 1 Anticipating you might ask if r360941 is the problem. It is not. Reverting this r360944 (not r360941) resolves the boot problem. System is amd64. -- 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-head@freebsd.org Tue May 12 04:27:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C9DA2E213F; Tue, 12 May 2020 04:27:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LlC75llBz3C52; Tue, 12 May 2020 04:27:31 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f66.google.com with SMTP id j4so9456785otr.11; Mon, 11 May 2020 21:27:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=Y8wmSmT7IzBn/yA6y4+odeva8sHFRlfa0jeKDf4Qfmg=; b=Phbe/CQahev7bSphM/lXoNXVu8qwvoMPyzRw2jreEBDPJPh2nqTyj65GO32kq1TlgU FePWzyQjkb0q/aGj9NPbbSkq5O9OV1Z+WKt9LdUdo3DdJ8y64psKdqrwN3VoFEi2503p cNHT4kL//EFmR8XxXqHbkA9yWAt93tpvO7M/8DcOOOPHYZ8WZKJ9Q7z9UNzZNNSUhLfn Xt4FA/OO0drPBArzzzCN1IAYVL47+GuK+aF1iUkbGuBSuKsiv8HJ1S9Zd+kbFBBrrXF+ BbKRbh6QBHNO5HqvnUVJ/dE0LCXSStr7/eSo067NMifXqyVVkb6U+YhOkmiXPkNo32qA CQKw== X-Gm-Message-State: AGi0PuYjdbSktXo7ul14SWjJBoIVem2UlxC5R5X8mitErhlq+fSD7QKk zVToPphYTI/QQulB/ob5h2kk/QQs X-Google-Smtp-Source: APiQypInXSBG0jkZNpRdlTrgfl6u7arW+JA+/tgWszzfrDKZOjHslWzEvQzqkaxCQDJ9JZ/Esr+y+g== X-Received: by 2002:a9d:7a6:: with SMTP id 35mr13822451oto.201.1589257650038; Mon, 11 May 2020 21:27:30 -0700 (PDT) Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com. [209.85.167.170]) by smtp.gmail.com with ESMTPSA id m16sm3333907oop.40.2020.05.11.21.27.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2020 21:27:29 -0700 (PDT) Received: by mail-oi1-f170.google.com with SMTP id c12so16152930oic.1; Mon, 11 May 2020 21:27:29 -0700 (PDT) X-Received: by 2002:aca:4ac3:: with SMTP id x186mr13398030oia.81.1589257649452; Mon, 11 May 2020 21:27:29 -0700 (PDT) MIME-Version: 1.0 References: <202005112257.04BMvMx2096445@repo.freebsd.org> <202005120328.04C3SR2X081094@slippy.cwsent.com> In-Reply-To: <202005120328.04C3SR2X081094@slippy.cwsent.com> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 11 May 2020 21:27:18 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r360944 - in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/coccinelle To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 49LlC75llBz3C52 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.210.66 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-2.18 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MIME_TRACE(0.00)[0:+,1:+,2:~]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.210.85.209.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_GOOD(0.00)[66.210.85.209.rep.mailspike.net : 127.0.0.18]; HAS_REPLYTO(0.00)[cem@freebsd.org]; IP_SCORE(-0.18)[ip: (-0.03), ipnet: 209.85.128.0/17(-0.39), asn: 15169(-0.42), country: US(-0.05)]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 04:27:32 -0000 Thanks Cy. I=E2=80=99ll revert it when I=E2=80=99m back at a computer. Best, Conrad On Mon, May 11, 2020 at 20:28 Cy Schubert wrote= : > In message <202005112257.04BMvMx2096445@repo.freebsd.org>, Conrad Meyer > writes: > > Author: cem > > Date: Mon May 11 22:57:21 2020 > > New Revision: 360944 > > URL: https://svnweb.freebsd.org/changeset/base/360944 > > > > Log: > > copystr(9): Move to deprecate [2/2] > > > > Unlike the other copy*() functions, it does not serve to copy from on= e > > address space to another or protect against potential faults. It's > just > > an older incarnation of the now-more-common strlcpy(). > > > > Add a coccinelle script to tools/ which can be used to mechanically > > convert existing instances where replacement with strlcpy is trivial. > > In the two cases which matched, fuse_vfsops.c and union_vfsops.c, the > > code was further refactored manually to simplify. > > > > Replace the declaration of copystr() in systm.h with a small macro > > wrapper around strlcpy. > > > > Remove N redundant MI implementations of copystr. For MIPS, this > > entailed inlining the assembler copystr into the only consumer, > > copyinstr, and making the latter a leaf function. > > > > Reviewed by: jhb > > Differential Revision: https://reviews.freebsd.org/D24672 > > > > Added: > > head/tools/coccinelle/ > > head/tools/coccinelle/copystr9.cocci (contents, props changed) > > Deleted: > > head/sys/arm64/arm64/copystr.c > > head/sys/powerpc/powerpc/copystr.c > > head/sys/riscv/riscv/copystr.c > > Modified: > > head/sys/amd64/amd64/support.S > > head/sys/arm/arm/copystr.S > > head/sys/fs/fuse/fuse_vfsops.c > > head/sys/fs/unionfs/union_vfsops.c > > head/sys/i386/i386/support.s > > head/sys/kern/subr_csan.c > > head/sys/mips/mips/support.S > > head/sys/sys/systm.h > > > > Hi Conrad, > > This is causing a failure to boot with geom_mirror: > > GEOM_MIRROR: Device mirror/gm0 launched (2/2). > GEOM_MIRROR: Device mirror/gm1 launched (2/2). > GEOM_MIRROR: Device mirror/gm2 launched (2/2). > GEOM_MIRROR: Device mirror/gm3 launched (2/2). > mountroot: waiting for device /dev/mirror/gm0a... > Mounting from ufs:/dev/mirror/gm0a failed with error 2; retrying for 3 > more > seconds > exec /sbin/init: error 20 > exec /sbin/init.bak: error 20 > exec /rescue/init: error 20 > init: not found in path /sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/ini= t > panic: no init > cpuid =3D 1 > time =3D 1589225852 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe004df51ba0 > vpanic() at vpanic+0x182/frame 0xfffffe004df51bf0 > panic() at panic+0x43/frame 0xfffffe004df51c50 > start_init() at start_init+0x23c/frame 0xfffffe004df51cf0 > fork_exit() at fork_exit+0x7e/frame 0xfffffe004df51d30 > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004df51d30 > --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- > Uptime: 9s > acpi0: reset failed - timeout > Automatic reboot in 15 seconds - press a key on the console to abort > --> Press a key on the console to reboot, > --> or switch off the system now. > Rebooting... > cpu_reset: Restarting BSP > cpu_reset_proxy: Stopped CPU 1 > > > Anticipating you might ask if r360941 is the problem. It is not. Revertin= g > this r360944 (not r360941) resolves the boot problem. System is amd64. > > > -- > 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-head@freebsd.org Tue May 12 04:34:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4732C2E237B; Tue, 12 May 2020 04:34:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LlMB1SzNz3CTS; Tue, 12 May 2020 04:34:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D7B22295; Tue, 12 May 2020 04:34:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C4YULn008567; Tue, 12 May 2020 04:34:30 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C4YRMD008553; Tue, 12 May 2020 04:34:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005120434.04C4YRMD008553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 12 May 2020 04:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360955 - in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/conf sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/conf sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/coccinelle X-SVN-Commit-Revision: 360955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 04:34:30 -0000 Author: cem Date: Tue May 12 04:34:26 2020 New Revision: 360955 URL: https://svnweb.freebsd.org/changeset/base/360955 Log: Revert r360944 and r360946 until reported issues can be resolved Reported by: cy Added: head/sys/arm64/arm64/copystr.c - copied unchanged from r360943, head/sys/arm64/arm64/copystr.c head/sys/powerpc/powerpc/copystr.c - copied unchanged from r360943, head/sys/powerpc/powerpc/copystr.c head/sys/riscv/riscv/copystr.c - copied unchanged from r360943, head/sys/riscv/riscv/copystr.c Deleted: head/tools/coccinelle/ Modified: head/sys/amd64/amd64/support.S head/sys/arm/arm/copystr.S head/sys/conf/files.arm64 head/sys/conf/files.powerpc head/sys/conf/files.riscv head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/unionfs/union_vfsops.c head/sys/i386/i386/support.s head/sys/kern/subr_csan.c head/sys/mips/mips/support.S head/sys/sys/systm.h Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Tue May 12 02:23:11 2020 (r360954) +++ head/sys/amd64/amd64/support.S Tue May 12 04:34:26 2020 (r360955) @@ -1417,6 +1417,43 @@ copyinstr_toolong: jmp cpystrflt_x /* + * copystr(from, to, maxlen, int *lencopied) + * %rdi, %rsi, %rdx, %rcx + */ +ENTRY(copystr) + PUSH_FRAME_POINTER + movq %rdx,%r8 /* %r8 = maxlen */ + + incq %rdx +1: + decq %rdx + jz 4f + movb (%rdi),%al + movb %al,(%rsi) + incq %rsi + incq %rdi + testb %al,%al + jnz 1b + + /* Success -- 0 byte reached */ + decq %rdx + xorl %eax,%eax +2: + testq %rcx,%rcx + jz 3f + /* set *lencopied and return %rax */ + subq %rdx,%r8 + movq %r8,(%rcx) +3: + POP_FRAME_POINTER + ret +4: + /* rdx is zero -- return ENAMETOOLONG */ + movl $ENAMETOOLONG,%eax + jmp 2b +END(copystr) + +/* * Handling of special amd64 registers and descriptor tables etc */ /* void lgdt(struct region_descriptor *rdp); */ Modified: head/sys/arm/arm/copystr.S ============================================================================== --- head/sys/arm/arm/copystr.S Tue May 12 02:23:11 2020 (r360954) +++ head/sys/arm/arm/copystr.S Tue May 12 04:34:26 2020 (r360955) @@ -60,6 +60,39 @@ __FBSDID("$FreeBSD$"); ldr tmp, .Lpcb #endif +/* + * r0 - from + * r1 - to + * r2 - maxlens + * r3 - lencopied + * + * Copy string from r0 to r1 + */ +ENTRY(copystr) + stmfd sp!, {r4-r5} /* stack is 8 byte aligned */ + teq r2, #0x00000000 + mov r5, #0x00000000 + moveq r0, #ENAMETOOLONG + beq 2f + +1: ldrb r4, [r0], #0x0001 + add r5, r5, #0x00000001 + teq r4, #0x00000000 + strb r4, [r1], #0x0001 + teqne r5, r2 + bne 1b + + teq r4, #0x00000000 + moveq r0, #0x00000000 + movne r0, #ENAMETOOLONG + +2: teq r3, #0x00000000 + strne r5, [r3] + + ldmfd sp!, {r4-r5} /* stack is 8 byte aligned */ + RET +END(copystr) + #define SAVE_REGS stmfd sp!, {r4-r6} #define RESTORE_REGS ldmfd sp!, {r4-r6} Copied: head/sys/arm64/arm64/copystr.c (from r360943, head/sys/arm64/arm64/copystr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/copystr.c Tue May 12 04:34:26 2020 (r360955, copy of r360943, head/sys/arm64/arm64/copystr.c) @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * 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 + +int +(copystr)(const void * __restrict kfaddr, void * __restrict kdaddr, size_t len, + size_t * __restrict lencopied) +{ + const char *src; + size_t pos; + char *dst; + int error; + + error = ENAMETOOLONG; + src = kfaddr; + dst = kdaddr; + for (pos = 0; pos < len; pos++) { + dst[pos] = src[pos]; + if (src[pos] == '\0') { + /* Increment pos to hold the number of bytes copied */ + pos++; + error = 0; + break; + } + } + + if (lencopied != NULL) + *lencopied = pos; + + return (error); +} + Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue May 12 02:23:11 2020 (r360954) +++ head/sys/conf/files.arm64 Tue May 12 04:34:26 2020 (r360955) @@ -133,6 +133,7 @@ arm64/arm64/busdma_machdep.c standard arm64/arm64/bzero.S standard arm64/arm64/clock.c standard arm64/arm64/copyinout.S standard +arm64/arm64/copystr.c standard arm64/arm64/cpu_errata.c standard arm64/arm64/cpufunc_asm.S standard arm64/arm64/db_disasm.c optional ddb Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue May 12 02:23:11 2020 (r360954) +++ head/sys/conf/files.powerpc Tue May 12 04:34:26 2020 (r360955) @@ -241,6 +241,7 @@ powerpc/powerpc/bus_machdep.c standard powerpc/powerpc/busdma_machdep.c standard powerpc/powerpc/clock.c standard powerpc/powerpc/copyinout.c standard +powerpc/powerpc/copystr.c standard powerpc/powerpc/cpu.c standard powerpc/powerpc/cpu_subr64.S optional powerpc64 powerpc/powerpc/db_disasm.c optional ddb Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Tue May 12 02:23:11 2020 (r360954) +++ head/sys/conf/files.riscv Tue May 12 04:34:26 2020 (r360955) @@ -37,6 +37,7 @@ riscv/riscv/busdma_bounce.c standard riscv/riscv/busdma_machdep.c standard riscv/riscv/clock.c standard riscv/riscv/copyinout.S standard +riscv/riscv/copystr.c standard riscv/riscv/cpufunc_asm.S standard riscv/riscv/db_disasm.c optional ddb riscv/riscv/db_interface.c optional ddb Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Tue May 12 02:23:11 2020 (r360954) +++ head/sys/fs/fuse/fuse_vfsops.c Tue May 12 04:34:26 2020 (r360955) @@ -303,6 +303,8 @@ fuse_vfsop_mount(struct mount *mp) int daemon_timeout; int fd; + size_t len; + struct cdev *fdev; struct fuse_data *data = NULL; struct thread *td; @@ -430,8 +432,8 @@ fuse_vfsop_mount(struct mount *mp) strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN); } - memset(mp->mnt_stat.f_mntfromname, 0, MNAMELEN); - strlcpy(mp->mnt_stat.f_mntfromname, fspec, MNAMELEN); + copystr(fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &len); + bzero(mp->mnt_stat.f_mntfromname + len, MNAMELEN - len); mp->mnt_iosize_max = MAXPHYS; /* Now handshaking with daemon */ Modified: head/sys/fs/unionfs/union_vfsops.c ============================================================================== --- head/sys/fs/unionfs/union_vfsops.c Tue May 12 02:23:11 2020 (r360954) +++ head/sys/fs/unionfs/union_vfsops.c Tue May 12 04:34:26 2020 (r360955) @@ -83,6 +83,7 @@ unionfs_domount(struct mount *mp) char *tmp; char *ep; int len; + size_t done; int below; uid_t uid; gid_t gid; @@ -303,8 +304,12 @@ unionfs_domount(struct mount *mp) */ vfs_getnewfsid(mp); - snprintf(mp->mnt_stat.f_mntfromname, MNAMELEN, "<%s>:%s", - below ? "below" : "above", target); + len = MNAMELEN - 1; + tmp = mp->mnt_stat.f_mntfromname; + copystr((below ? ":" : ":"), tmp, len, &done); + len -= done - 1; + tmp += done - 1; + copystr(target, tmp, len, NULL); UNIONFSDEBUG("unionfs_mount: from %s, on %s\n", mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname); Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Tue May 12 02:23:11 2020 (r360954) +++ head/sys/i386/i386/support.s Tue May 12 04:34:26 2020 (r360955) @@ -233,6 +233,47 @@ ENTRY(memcpy) ret END(memcpy) +/* + * copystr(from, to, maxlen, int *lencopied) - MP SAFE + */ +ENTRY(copystr) + pushl %esi + pushl %edi + + movl 12(%esp),%esi /* %esi = from */ + movl 16(%esp),%edi /* %edi = to */ + movl 20(%esp),%edx /* %edx = maxlen */ + incl %edx +1: + decl %edx + jz 4f + lodsb + stosb + orb %al,%al + jnz 1b + + /* Success -- 0 byte reached */ + decl %edx + xorl %eax,%eax + jmp 6f +4: + /* edx is zero -- return ENAMETOOLONG */ + movl $ENAMETOOLONG,%eax + +6: + /* set *lencopied and return %eax */ + movl 20(%esp),%ecx + subl %edx,%ecx + movl 24(%esp),%edx + testl %edx,%edx + jz 7f + movl %ecx,(%edx) +7: + popl %edi + popl %esi + ret +END(copystr) + ENTRY(bcmp) pushl %edi pushl %esi Modified: head/sys/kern/subr_csan.c ============================================================================== --- head/sys/kern/subr_csan.c Tue May 12 02:23:11 2020 (r360954) +++ head/sys/kern/subr_csan.c Tue May 12 04:34:26 2020 (r360955) @@ -350,11 +350,19 @@ kcsan_strlen(const char *str) return (s - str); } +#undef copystr #undef copyin #undef copyin_nofault #undef copyinstr #undef copyout #undef copyout_nofault + +int +kcsan_copystr(const void *kfaddr, void *kdaddr, size_t len, size_t *done) +{ + kcsan_access((uintptr_t)kdaddr, len, true, false, __RET_ADDR); + return copystr(kfaddr, kdaddr, len, done); +} int kcsan_copyin(const void *uaddr, void *kaddr, size_t len) Modified: head/sys/mips/mips/support.S ============================================================================== --- head/sys/mips/mips/support.S Tue May 12 02:23:11 2020 (r360954) +++ head/sys/mips/mips/support.S Tue May 12 04:34:26 2020 (r360955) @@ -105,22 +105,12 @@ .text /* - * Copy a null terminated string from the user address space into - * the kernel address space. - * - * copyinstr(fromaddr, toaddr, maxlength, &lencopied) - * caddr_t fromaddr; - * caddr_t toaddr; - * u_int maxlength; - * u_int *lencopied; + * int copystr(void *kfaddr, void *kdaddr, size_t maxlen, size_t *lencopied) + * Copy a NIL-terminated string, at most maxlen characters long. Return the + * number of characters copied (including the NIL) in *lencopied. If the + * string is too long, return ENAMETOOLONG; else return 0. */ -LEAF(copyinstr) - PTR_LA v0, __copyinstr_err - blt a0, zero, __copyinstr_err # make sure address is in user space - GET_CPU_PCPU(v1) - PTR_L v1, PC_CURPCB(v1) - PTR_S v0, U_PCB_ONFAULT(v1) - +LEAF(copystr) move t0, a2 beq a2, zero, 4f 1: @@ -138,14 +128,37 @@ LEAF(copyinstr) PTR_SUBU a2, t0, a2 # if the 4th arg was non-NULL PTR_S a2, 0(a3) 3: - - PTR_S zero, U_PCB_ONFAULT(v1) - j ra + j ra # v0 is 0 or ENAMETOOLONG nop +END(copystr) -__copyinstr_err: - j ra - li v0, EFAULT + +/* + * Copy a null terminated string from the user address space into + * the kernel address space. + * + * copyinstr(fromaddr, toaddr, maxlength, &lencopied) + * caddr_t fromaddr; + * caddr_t toaddr; + * u_int maxlength; + * u_int *lencopied; + */ +NESTED(copyinstr, CALLFRAME_SIZ, ra) + PTR_SUBU sp, sp, CALLFRAME_SIZ + .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) + PTR_LA v0, copyerr + blt a0, zero, _C_LABEL(copyerr) # make sure address is in user space + REG_S ra, CALLFRAME_RA(sp) + GET_CPU_PCPU(v1) + PTR_L v1, PC_CURPCB(v1) + jal _C_LABEL(copystr) + PTR_S v0, U_PCB_ONFAULT(v1) + REG_L ra, CALLFRAME_RA(sp) + GET_CPU_PCPU(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S zero, U_PCB_ONFAULT(v1) + j ra + PTR_ADDU sp, sp, CALLFRAME_SIZ END(copyinstr) /* Copied: head/sys/powerpc/powerpc/copystr.c (from r360943, head/sys/powerpc/powerpc/copystr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powerpc/copystr.c Tue May 12 04:34:26 2020 (r360955, copy of r360943, head/sys/powerpc/powerpc/copystr.c) @@ -0,0 +1,70 @@ +/*- + * SPDX-License-Identifier: BSD-4-Clause + * + * Copyright (C) 1995 Wolfgang Solfrank. + * Copyright (C) 1995 TooLs GmbH. + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $NetBSD: copystr.c,v 1.3 2000/06/08 06:47:17 kleink Exp $ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +/* + * Emulate copyinstr. + */ +int +copystr(kfaddr, kdaddr, len, done) + const void *kfaddr; + void *kdaddr; + size_t len; + size_t *done; +{ + const u_char *kfp = kfaddr; + u_char *kdp = kdaddr; + size_t l; + int rv; + + rv = ENAMETOOLONG; + for (l = 0; len-- > 0; l++) { + if (!(*kdp++ = *kfp++)) { + l++; + rv = 0; + break; + } + } + if (done != NULL) { + *done = l; + } + return rv; +} Copied: head/sys/riscv/riscv/copystr.c (from r360943, head/sys/riscv/riscv/copystr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/riscv/copystr.c Tue May 12 04:34:26 2020 (r360955, copy of r360943, head/sys/riscv/riscv/copystr.c) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * 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 + +int +copystr(const void * __restrict kfaddr, void * __restrict kdaddr, size_t len, + size_t * __restrict lencopied) +{ + const char *src; + size_t pos; + char *dst; + int error; + + error = ENAMETOOLONG; + src = kfaddr; + dst = kdaddr; + for (pos = 0; pos < len; pos++) { + dst[pos] = src[pos]; + if (src[pos] == '\0') { + /* Increment pos to hold the number of bytes copied */ + pos++; + error = 0; + break; + } + } + + if (lencopied != NULL) + *lencopied = pos; + + return (error); +} Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Tue May 12 02:23:11 2020 (r360954) +++ head/sys/sys/systm.h Tue May 12 04:34:26 2020 (r360955) @@ -362,17 +362,9 @@ void *memcpy_early(void * _Nonnull to, const void * _N void *memmove_early(void * _Nonnull dest, const void * _Nonnull src, size_t n); #define bcopy_early(from, to, len) memmove_early((to), (from), (len)) -#define copystr(src, dst, len, outlen) ({ \ - size_t __r, __len, *__outlen; \ - \ - __len = (len); \ - __outlen = (outlen); \ - __r = strlcpy((dst), (src), __len); \ - if (__outlen != NULL) \ - *__outlen = ((__r >= __len) ? __len : __r); \ - ((__r >= __len) ? ENAMETOOLONG : 0); \ -}) - +int copystr(const void * _Nonnull __restrict kfaddr, + void * _Nonnull __restrict kdaddr, size_t len, + size_t * __restrict lencopied); int copyinstr(const void * __restrict udaddr, void * _Nonnull __restrict kaddr, size_t len, size_t * __restrict lencopied); @@ -386,9 +378,11 @@ int copyout_nofault(const void * _Nonnull __restrict k void * __restrict udaddr, size_t len); #ifdef KCSAN +int kcsan_copystr(const void *, void *, size_t, size_t *); int kcsan_copyin(const void *, void *, size_t); int kcsan_copyinstr(const void *, void *, size_t, size_t *); int kcsan_copyout(const void *, void *, size_t); +#define copystr(kf, k, l, lc) kcsan_copystr((kf), (k), (l), (lc)) #define copyin(u, k, l) kcsan_copyin((u), (k), (l)) #define copyinstr(u, k, l, lc) kcsan_copyinstr((u), (k), (l), (lc)) #define copyout(k, u, l) kcsan_copyout((k), (u), (l)) From owner-svn-src-head@freebsd.org Tue May 12 05:37:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA5E12E31A5; Tue, 12 May 2020 05:37:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (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 49Lmm23M2jz3FlN; Tue, 12 May 2020 05:37:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id YNbijTEgUYYpxYNbkjxcIR; Mon, 11 May 2020 23:37:36 -0600 X-Authority-Analysis: v=2.3 cv=OubUNx3t c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=sTwFKg_x9MkA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=SLG1KRGDAAAA:8 a=0FNk9USiAAAA:8 a=Ds8RGfT2AAAA:8 a=1WEEPM5Zuh6txHN7wJAA:9 a=Kw--y-6izCXFQWhw:21 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=-TBaU1e9WpdkKBzYXnwo:22 a=TF7iPsq83L4KsoDyi5cH:22 a=0afPCejbyZHll-xH3H2j:22 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=jd6J4Gguk5HxikPWLKER:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id F0B3CF1; Mon, 11 May 2020 22:37:33 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id 04C5bXrE008286; Mon, 11 May 2020 22:37:33 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id 04C5bX7x008216; Mon, 11 May 2020 22:37:33 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202005120537.04C5bX7x008216@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: cem@freebsd.org cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360944 - in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/coccinelle In-reply-to: References: <202005112257.04BMvMx2096445@repo.freebsd.org> <202005120328.04C3SR2X081094@slippy.cwsent.com> Comments: In-reply-to Conrad Meyer message dated "Mon, 11 May 2020 21:27:18 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 11 May 2020 22:37:33 -0700 X-CMAE-Envelope: MS4wfJJ/sxlwDHVMzWnCrVx6DGNBE0Tz6VPYQ248WNTZeTTkq0KX9PJRG7bgb0Vft7eO3dz9xLmiKti3NoOqKmqLcydWRto4gNVptYyZEy98hpSsivqLCSpg FNfL2fVWDXJ3ydxHjtaTiIlPUz4WCZvO1jCv/2z3q74dXp9RFip46K56flBEhj1SciZFSsVldt0fIWpCNWKfELuR+yy9yYAwbgOx5LzhI1zjfy9jFUIYOs+X gRaC9FyMg9StEkyxQWvtlES51DjzTg1WtMFbyR3H220w6TAYiooHb1dvsVJe1N1+ X-Rspamd-Queue-Id: 49Lmm23M2jz3FlN X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 05:37:38 -0000 Thank you Conrad. -- 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 , Conrad Meyer writes: > --000000000000a6fe4405a56be1bb > Content-Type: text/plain; charset="UTF-8" > Content-Transfer-Encoding: quoted-printable > > Thanks Cy. I=E2=80=99ll revert it when I=E2=80=99m back at a computer. > > Best, > Conrad > > On Mon, May 11, 2020 at 20:28 Cy Schubert wrote= > : > > > In message <202005112257.04BMvMx2096445@repo.freebsd.org>, Conrad Meyer > > writes: > > > Author: cem > > > Date: Mon May 11 22:57:21 2020 > > > New Revision: 360944 > > > URL: https://svnweb.freebsd.org/changeset/base/360944 > > > > > > Log: > > > copystr(9): Move to deprecate [2/2] > > > > > > Unlike the other copy*() functions, it does not serve to copy from on= > e > > > address space to another or protect against potential faults. It's > > just > > > an older incarnation of the now-more-common strlcpy(). > > > > > > Add a coccinelle script to tools/ which can be used to mechanically > > > convert existing instances where replacement with strlcpy is trivial. > > > In the two cases which matched, fuse_vfsops.c and union_vfsops.c, the > > > code was further refactored manually to simplify. > > > > > > Replace the declaration of copystr() in systm.h with a small macro > > > wrapper around strlcpy. > > > > > > Remove N redundant MI implementations of copystr. For MIPS, this > > > entailed inlining the assembler copystr into the only consumer, > > > copyinstr, and making the latter a leaf function. > > > > > > Reviewed by: jhb > > > Differential Revision: https://reviews.freebsd.org/D24672 > > > > > > Added: > > > head/tools/coccinelle/ > > > head/tools/coccinelle/copystr9.cocci (contents, props changed) > > > Deleted: > > > head/sys/arm64/arm64/copystr.c > > > head/sys/powerpc/powerpc/copystr.c > > > head/sys/riscv/riscv/copystr.c > > > Modified: > > > head/sys/amd64/amd64/support.S > > > head/sys/arm/arm/copystr.S > > > head/sys/fs/fuse/fuse_vfsops.c > > > head/sys/fs/unionfs/union_vfsops.c > > > head/sys/i386/i386/support.s > > > head/sys/kern/subr_csan.c > > > head/sys/mips/mips/support.S > > > head/sys/sys/systm.h > > > > > > > Hi Conrad, > > > > This is causing a failure to boot with geom_mirror: > > > > GEOM_MIRROR: Device mirror/gm0 launched (2/2). > > GEOM_MIRROR: Device mirror/gm1 launched (2/2). > > GEOM_MIRROR: Device mirror/gm2 launched (2/2). > > GEOM_MIRROR: Device mirror/gm3 launched (2/2). > > mountroot: waiting for device /dev/mirror/gm0a... > > Mounting from ufs:/dev/mirror/gm0a failed with error 2; retrying for 3 > > more > > seconds > > exec /sbin/init: error 20 > > exec /sbin/init.bak: error 20 > > exec /rescue/init: error 20 > > init: not found in path /sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/ini= > t > > panic: no init > > cpuid =3D 1 > > time =3D 1589225852 > > KDB: stack backtrace: > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > > 0xfffffe004df51ba0 > > vpanic() at vpanic+0x182/frame 0xfffffe004df51bf0 > > panic() at panic+0x43/frame 0xfffffe004df51c50 > > start_init() at start_init+0x23c/frame 0xfffffe004df51cf0 > > fork_exit() at fork_exit+0x7e/frame 0xfffffe004df51d30 > > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004df51d30 > > --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- > > Uptime: 9s > > acpi0: reset failed - timeout > > Automatic reboot in 15 seconds - press a key on the console to abort > > --> Press a key on the console to reboot, > > --> or switch off the system now. > > Rebooting... > > cpu_reset: Restarting BSP > > cpu_reset_proxy: Stopped CPU 1 > > > > > > Anticipating you might ask if r360941 is the problem. It is not. Revertin= > g > > this r360944 (not r360941) resolves the boot problem. System is amd64. > > > > > > -- > > 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. > > > > > > > > --000000000000a6fe4405a56be1bb > Content-Type: text/html; charset="UTF-8" > Content-Transfer-Encoding: quoted-printable > >
Thanks Cy. I=E2=80=99ll revert it when I=E2=80=99m b= > ack at a computer.

>Best,
Conrad=C2=A0

l_quote">
On Mon, May 11, 2020 at 20:2= > 8 Cy Schubert <Cy.Schubert@= > cschubert.com> wrote:
le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In mes= > sage < rget=3D"_blank">202005112257.04BMvMx2096445@repo.freebsd.org>, Conra= > d Meyer
> writes:
> > Author: cem
> > Date: Mon May 11 22:57:21 2020
> > New Revision: 360944
> > URL: =3D"noreferrer" target=3D"_blank">https://svnweb.freebsd.org/changeset/base= > /360944
> >
> > Log:
> >=C2=A0 =C2=A0copystr(9): Move to deprecate [2/2]
> >=C2=A0 =C2=A0
> >=C2=A0 =C2=A0Unlike the other copy*() functions, it does not serve to c= > opy from one
> >=C2=A0 =C2=A0address space to another or protect against potential faul= > ts.=C2=A0 It's just
> >=C2=A0 =C2=A0an older incarnation of the now-more-common strlcpy().
> >=C2=A0 =C2=A0
> >=C2=A0 =C2=A0Add a coccinelle script to tools/ which can be used to mec= > hanically
> >=C2=A0 =C2=A0convert existing instances where replacement with strlcpy = > is trivial.
> >=C2=A0 =C2=A0In the two cases which matched, fuse_vfsops.c and union_vf= > sops.c, the
> >=C2=A0 =C2=A0code was further refactored manually to simplify.
> >=C2=A0 =C2=A0
> >=C2=A0 =C2=A0Replace the declaration of copystr() in systm.h with a sma= > ll macro
> >=C2=A0 =C2=A0wrapper around strlcpy.
> >=C2=A0 =C2=A0
> >=C2=A0 =C2=A0Remove N redundant MI implementations of copystr.=C2=A0 Fo= > r MIPS, this
> >=C2=A0 =C2=A0entailed inlining the assembler copystr into the only cons= > umer,
> >=C2=A0 =C2=A0copyinstr, and making the latter a leaf function.
> >=C2=A0 =C2=A0
> >=C2=A0 =C2=A0Reviewed by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 jhb
> >=C2=A0 =C2=A0Differential Revision:=C2=A0 =C2=A0 =C2=A0 s://reviews.freebsd.org/D24672" rel=3D"noreferrer" target=3D"_blank">https:= > //reviews.freebsd.org/D24672
> >
> > Added:
> >=C2=A0 =C2=A0head/tools/coccinelle/
> >=C2=A0 =C2=A0head/tools/coccinelle/copystr9.cocci=C2=A0 =C2=A0(contents= > , props changed)
> > Deleted:
> >=C2=A0 =C2=A0head/sys/arm64/arm64/copystr.c
> >=C2=A0 =C2=A0head/sys/powerpc/powerpc/copystr.c
> >=C2=A0 =C2=A0head/sys/riscv/riscv/copystr.c
> > Modified:
> >=C2=A0 =C2=A0head/sys/amd64/amd64/support.S
> >=C2=A0 =C2=A0head/sys/arm/arm/copystr.S
> >=C2=A0 =C2=A0head/sys/fs/fuse/fuse_vfsops.c
> >=C2=A0 =C2=A0head/sys/fs/unionfs/union_vfsops.c
> >=C2=A0 =C2=A0head/sys/i386/i386/support.s
> >=C2=A0 =C2=A0head/sys/kern/subr_csan.c
> >=C2=A0 =C2=A0head/sys/mips/mips/support.S
> >=C2=A0 =C2=A0head/sys/sys/systm.h
> >
>
> Hi Conrad,
>
> This is causing a failure to boot with geom_mirror:
>
> GEOM_MIRROR: Device mirror/gm0 launched (2/2).
> GEOM_MIRROR: Device mirror/gm1 launched (2/2).
> GEOM_MIRROR: Device mirror/gm2 launched (2/2).
> GEOM_MIRROR: Device mirror/gm3 launched (2/2).
> mountroot: waiting for device /dev/mirror/gm0a...
> Mounting from ufs:/dev/mirror/gm0a failed with error 2; retrying for 3 more= >
> seconds
> exec /sbin/init: error 20
> exec /sbin/init.bak: error 20
> exec /rescue/init: error 20
> init: not found in path /sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init<= > br> > panic: no init
> cpuid =3D 1
> time =3D 1589225852
> KDB: stack backtrace:
> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame
> 0xfffffe004df51ba0
> vpanic() at vpanic+0x182/frame 0xfffffe004df51bf0
> panic() at panic+0x43/frame 0xfffffe004df51c50
> start_init() at start_init+0x23c/frame 0xfffffe004df51cf0
> fork_exit() at fork_exit+0x7e/frame 0xfffffe004df51d30
> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004df51d30
> --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 ---
> Uptime: 9s
> acpi0: reset failed - timeout
> Automatic reboot in 15 seconds - press a key on the console to abort
> --> Press a key on the console to reboot,
> --> or switch off the system now.
> Rebooting...
> cpu_reset: Restarting BSP
> cpu_reset_proxy: Stopped CPU 1
>
>
> Anticipating you might ask if r360941 is the problem. It is not. Reverting = >
> this r360944 (not r360941) resolves the boot problem. System is amd64.
>
>
> --
> Cheers,
> Cy Schubert < nk">Cy.Schubert@cschubert.com>
> FreeBSD UNIX:=C2=A0 <cy@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 =3D"https://FreeBSD.org" rel=3D"noreferrer" target=3D"_blank">https://FreeB= > SD.org
> NTP:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0< e.org" target=3D"_blank">cy@nwtime.org>=C2=A0 =C2=A0 Web:=C2=A0 ref=3D"https://nwtime.org" rel=3D"noreferrer" target=3D"_blank">https://nwt= > ime.org
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 The need of the many outweighs the greed of the= > few.
>
>
>
> > --000000000000a6fe4405a56be1bb-- From owner-svn-src-head@freebsd.org Tue May 12 09:04:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C0F92E7501; Tue, 12 May 2020 09:04:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LsMF6bZNz3wYG; Tue, 12 May 2020 09:04:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D930A58D8; Tue, 12 May 2020 09:04:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C94v78074016; Tue, 12 May 2020 09:04:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C94veg074015; Tue, 12 May 2020 09:04:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005120904.04C94veg074015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 12 May 2020 09:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360956 - head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 360956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 09:04:58 -0000 Author: avg Date: Tue May 12 09:04:57 2020 New Revision: 360956 URL: https://svnweb.freebsd.org/changeset/base/360956 Log: zfs allow/unallow should work with numeric uid/gid And that should work even (especially) if there is no matching user or group name. This change allows to see and modify delegations for deleted groups and users. The change is originally by Xin Li. illumos report: https://www.illumos.org/issues/6037 OpenZFS (ZoL) PR: https://github.com/openzfs/zfs/pull/10280 Obtained from: delphij MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue May 12 04:34:26 2020 (r360955) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue May 12 09:04:57 2020 (r360956) @@ -4696,6 +4696,14 @@ parse_fs_perm(fs_perm_t *fsperm, nvlist_t *nvl) (void) strlcpy( node->who_perm.who_ug_name, nice_name, 256); + else { + /* User or group unknown */ + (void) snprintf( + node->who_perm.who_ug_name, + sizeof ( + node->who_perm.who_ug_name), + "(unknown: %d)", rid); + } } uu_avl_insert(avl, node, idx); @@ -5194,9 +5202,9 @@ construct_fsacl_list(boolean_t un, struct allow_opts * if (p != NULL) rid = p->pw_uid; - else { + else if (*endch != '\0') { (void) snprintf(errbuf, 256, gettext( - "invalid user %s"), curr); + "invalid user %s\n"), curr); allow_usage(un, B_TRUE, errbuf); } } else if (opts->group) { @@ -5208,9 +5216,9 @@ construct_fsacl_list(boolean_t un, struct allow_opts * if (g != NULL) rid = g->gr_gid; - else { + else if (*endch != '\0') { (void) snprintf(errbuf, 256, gettext( - "invalid group %s"), curr); + "invalid group %s\n"), curr); allow_usage(un, B_TRUE, errbuf); } } else { @@ -5236,7 +5244,7 @@ construct_fsacl_list(boolean_t un, struct allow_opts * rid = g->gr_gid; } else { (void) snprintf(errbuf, 256, gettext( - "invalid user/group %s"), curr); + "invalid user/group %s\n"), curr); allow_usage(un, B_TRUE, errbuf); } } From owner-svn-src-head@freebsd.org Tue May 12 09:31:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79BFD2E8089; Tue, 12 May 2020 09:31:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LsyF2gGYz3yLY; Tue, 12 May 2020 09:31:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56D205E43; Tue, 12 May 2020 09:31:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C9VnAH090636; Tue, 12 May 2020 09:31:49 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C9Vn72090635; Tue, 12 May 2020 09:31:49 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005120931.04C9Vn72090635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 12 May 2020 09:31:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360957 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 360957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 09:31:49 -0000 Author: avg Date: Tue May 12 09:31:48 2020 New Revision: 360957 URL: https://svnweb.freebsd.org/changeset/base/360957 Log: amd64/pmap: unbreak !NUMA case for fictitious pages A fictitious page can have a physical address beyond the end of the RAM. In the NUMA case there is some special code to handle such pages, but in the other case the pages are handled the same as normal pages. So, we cannot assert that the physical address is within RAM addresses. Suggested by: kib Reviewed by: kib X-MFC note: NUMA support has not been MFC-ed Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue May 12 09:04:57 2020 (r360956) +++ head/sys/amd64/amd64/pmap.c Tue May 12 09:31:48 2020 (r360957) @@ -323,12 +323,12 @@ pmap_pku_mask_bit(pmap_t pmap) #endif #undef pa_index +#ifdef NUMA #define pa_index(pa) ({ \ KASSERT((pa) <= vm_phys_segs[vm_phys_nsegs - 1].end, \ ("address %lx beyond the last segment", (pa))); \ (pa) >> PDRSHIFT; \ }) -#ifdef NUMA #define pa_to_pmdp(pa) (&pv_table[pa_index(pa)]) #define pa_to_pvh(pa) (&(pa_to_pmdp(pa)->pv_page)) #define PHYS_TO_PV_LIST_LOCK(pa) ({ \ @@ -340,6 +340,7 @@ pmap_pku_mask_bit(pmap_t pmap) _lock; \ }) #else +#define pa_index(pa) ((pa) >> PDRSHIFT) #define pa_to_pvh(pa) (&pv_table[pa_index(pa)]) #define NPV_LIST_LOCKS MAXCPU From owner-svn-src-head@freebsd.org Tue May 12 09:46:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 183702E8A9A; Tue, 12 May 2020 09:46:16 +0000 (UTC) (envelope-from ypankov@fastmail.com) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (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 49LtGv6H8Fz40b6; Tue, 12 May 2020 09:46:15 +0000 (UTC) (envelope-from ypankov@fastmail.com) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id BC4EF6BE; Tue, 12 May 2020 05:46:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 12 May 2020 05:46:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=c XyCfI5TS/6XSfDDxtgBAuiWs0kvlVt4zCJ6R740SIU=; b=X80SXPf36mNh5ulGo QvBbLchX8+Xgjo/M4deu+WeL3tiAfsi6ugiU9MnAFxRKTz+NCfX1OziLG7iLpn7H a+/9OQjzy6umsIqPdIGB/6y4Dq4KQGXvdYBAsQbqB8pNzRobFgKTPl12I40mgoAj JRJcw94FqNAgHD9cbLOWE0NMB2fZHm59AJ5x7sp+8VMbMNZMsGyR40b2f5L15Nlj eGXcLzJm7kkd9qmW+dH1knCzC4W8wiu0KC+6isdhh9WUl4Ixw9Ga1NRsx9aN60aO kxm8G+93kRmusFT4f4+Ur7RdQS3Voou9AU/dWHhYHoC2kxFcbHjxjWbDHVwxUWLn aI5TQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=cXyCfI5TS/6XSfDDxtgBAuiWs0kvlVt4zCJ6R740S IU=; b=ijTse5/A4wdmOMAiPoklDFR/oWlgn90H7K1yNQcRLd1V104y1+oyHNLOV nuHShrwYZzqDZ7ac5qzhZtNpE/FZpCEoqQNXez0KWm91xV5fjFy1usUTsLyn7OPD 9Uxfichab1IzJraYiN7RNh9uOHxUBd4xmBOIl5b0iKsIRLyJPX7Gru2IhBV7H2Qr ATNCv5TZ+U8slHVu5vUWHSTiteopE9qmfnG+lp+xcnjvnx+J5W8sO8gc2kX+57f/ m5vidc24zeOHLNz+dK/DbWSO3PuaRPZ8L4OOM+bXgfwW4aMUcXZeDXZULU6WqN83 nt2nA36ftzNJH9dQTU6oYOMXDbAsw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrledvgddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthejre dttdefjeenucfhrhhomhepjghurhhiucfrrghnkhhovhcuoeihphgrnhhkohhvsehfrghs thhmrghilhdrtghomheqnecuggftrfgrthhtvghrnheptdfgheehudeutdetteefjedvge dtvdelleejgfdvhfeujeejkeetjeeivdevleefnecuffhomhgrihhnpehfrhgvvggsshgu rdhorhhgpdhilhhluhhmohhsrdhorhhgpdhgihhthhhusgdrtghomhenucfkphepudejke drfeegrddutdefrdduhedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomhephihprghnkhhovhesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Received: from [192.168.1.6] (unknown [178.34.103.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 644BE30662BF; Tue, 12 May 2020 05:46:12 -0400 (EDT) Subject: Re: svn commit: r360956 - head/cddl/contrib/opensolaris/cmd/zfs To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005120904.04C94veg074015@repo.freebsd.org> From: Yuri Pankov Message-ID: <87ca8d3e-f26f-42bb-e913-3f8e017d0844@fastmail.com> Date: Tue, 12 May 2020 12:46:09 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <202005120904.04C94veg074015@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49LtGv6H8Fz40b6 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 09:46:16 -0000 Andriy Gapon wrote: > Author: avg > Date: Tue May 12 09:04:57 2020 > New Revision: 360956 > URL: https://svnweb.freebsd.org/changeset/base/360956 > > Log: > zfs allow/unallow should work with numeric uid/gid > > And that should work even (especially) if there is no matching user or > group name. This change allows to see and modify delegations for > deleted groups and users. > > The change is originally by Xin Li. > illumos report: https://www.illumos.org/issues/6037 > OpenZFS (ZoL) PR: https://github.com/openzfs/zfs/pull/10280 > > Obtained from: delphij > MFC after: 2 weeks Also, PR: 200663. From owner-svn-src-head@freebsd.org Tue May 12 11:18:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB0352EAD4C; Tue, 12 May 2020 11:18:15 +0000 (UTC) (envelope-from afedorov@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LwK34W73z45Dj; Tue, 12 May 2020 11:18:15 +0000 (UTC) (envelope-from afedorov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95F0E71B2; Tue, 12 May 2020 11:18:15 +0000 (UTC) (envelope-from afedorov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CBIFk2054573; Tue, 12 May 2020 11:18:15 GMT (envelope-from afedorov@FreeBSD.org) Received: (from afedorov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CBIFnn054571; Tue, 12 May 2020 11:18:15 GMT (envelope-from afedorov@FreeBSD.org) Message-Id: <202005121118.04CBIFnn054571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: afedorov set sender to afedorov@FreeBSD.org using -f From: Aleksandr Fedorov Date: Tue, 12 May 2020 11:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360958 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: afedorov X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 360958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 11:18:15 -0000 Author: afedorov Date: Tue May 12 11:18:14 2020 New Revision: 360958 URL: https://svnweb.freebsd.org/changeset/base/360958 Log: Add a new bhyve network backend that allow to connect the VM to the netgraph(4) network. The backend uses the socket API with the PF_NETGRAPH protocol family, which is provided by the ng_socket(4). To use the new backend, provide the following bhyve option: -s X:Y:Z,[virtio-net|e1000],netgraph,socket=[ng_socket name],path=[destination node],hook=[our socket src hook],peerhook=[dst node hook] Reviewed by: vmaffione, lutz_donnerhacke.de Approved by: vmaffione (mentor) Sponsored by: vstack.com Differential Revision: https://reviews.freebsd.org/D24620 Modified: head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/net_backends.c Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Tue May 12 09:31:48 2020 (r360957) +++ head/usr.sbin/bhyve/Makefile Tue May 12 11:18:14 2020 (r360958) @@ -90,6 +90,10 @@ CFLAGS+=-DINET .if ${MK_INET6_SUPPORT} != "no" CFLAGS+=-DINET6 .endif +.if ${MK_NETGRAPH_SUPPORT} != "no" +CFLAGS+=-DNETGRAPH +LIBADD+= netgraph +.endif .if ${MK_OPENSSL} == "no" CFLAGS+=-DNO_OPENSSL .else Modified: head/usr.sbin/bhyve/net_backends.c ============================================================================== --- head/usr.sbin/bhyve/net_backends.c Tue May 12 09:31:48 2020 (r360957) +++ head/usr.sbin/bhyve/net_backends.c Tue May 12 11:18:14 2020 (r360958) @@ -69,6 +69,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef NETGRAPH +#include +#include +#include +#endif #include "debug.h" #include "iov.h" @@ -382,6 +387,194 @@ static struct net_backend vmnet_backend = { DATA_SET(net_backend_set, tap_backend); DATA_SET(net_backend_set, vmnet_backend); + +#ifdef NETGRAPH + +/* + * Netgraph backend + */ + +#define NG_SBUF_MAX_SIZE (4 * 1024 * 1024) + +static int +ng_init(struct net_backend *be, const char *devname, + const char *opts, net_be_rxeof_t cb, void *param) +{ + struct tap_priv *p = (struct tap_priv *)be->opaque; + struct ngm_connect ngc; + char *ngopts, *tofree; + char nodename[NG_NODESIZ]; + int sbsz; + int ctrl_sock; + int flags; + int path_provided; + int peerhook_provided; + int socket_provided; + unsigned long maxsbsz; + size_t msbsz; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif + + if (cb == NULL) { + WPRINTF(("Netgraph backend requires non-NULL callback")); + return (-1); + } + + be->fd = -1; + + memset(&ngc, 0, sizeof(ngc)); + + strncpy(ngc.ourhook, "vmlink", NG_HOOKSIZ - 1); + + tofree = ngopts = strdup(opts); + + if (ngopts == NULL) { + WPRINTF(("strdup error")); + return (-1); + } + + socket_provided = 0; + path_provided = 0; + peerhook_provided = 0; + + (void)strsep(&ngopts, ","); + + while (ngopts != NULL) { + char *value = ngopts; + char *key; + + key = strsep(&value, "="); + if (value == NULL) + break; + ngopts = value; + (void) strsep(&ngopts, ","); + + if (strcmp(key, "socket") == 0) { + strncpy(nodename, value, NG_NODESIZ - 1); + socket_provided = 1; + } else if (strcmp(key, "path") == 0) { + strncpy(ngc.path, value, NG_PATHSIZ - 1); + path_provided = 1; + } else if (strcmp(key, "hook") == 0) { + strncpy(ngc.ourhook, value, NG_HOOKSIZ - 1); + } else if (strcmp(key, "peerhook") == 0) { + strncpy(ngc.peerhook, value, NG_HOOKSIZ - 1); + peerhook_provided = 1; + } + } + + free(tofree); + + if (!path_provided) { + WPRINTF(("path must be provided")); + return (-1); + } + + if (!peerhook_provided) { + WPRINTF(("peer hook must be provided")); + return (-1); + } + + if (NgMkSockNode(socket_provided ? nodename : NULL, + &ctrl_sock, &be->fd) < 0) { + WPRINTF(("can't get Netgraph sockets")); + return (-1); + } + + if (NgSendMsg(ctrl_sock, ".", + NGM_GENERIC_COOKIE, + NGM_CONNECT, &ngc, sizeof(ngc)) < 0) { + WPRINTF(("can't connect to node")); + close(ctrl_sock); + goto error; + } + + close(ctrl_sock); + + flags = fcntl(be->fd, F_GETFL); + + if (flags < 0) { + WPRINTF(("can't get socket flags")); + goto error; + } + + if (fcntl(be->fd, F_SETFL, flags | O_NONBLOCK) < 0) { + WPRINTF(("can't set O_NONBLOCK flag")); + goto error; + } + + /* + * The default ng_socket(4) buffer's size is too low. + * Calculate the minimum value between NG_SBUF_MAX_SIZE + * and kern.ipc.maxsockbuf. + */ + msbsz = sizeof(maxsbsz); + if (sysctlbyname("kern.ipc.maxsockbuf", &maxsbsz, &msbsz, + NULL, 0) < 0) { + WPRINTF(("can't get 'kern.ipc.maxsockbuf' value")); + goto error; + } + + /* + * We can't set the socket buffer size to kern.ipc.maxsockbuf value, + * as it takes into account the mbuf(9) overhead. + */ + maxsbsz = maxsbsz * MCLBYTES / (MSIZE + MCLBYTES); + + sbsz = MIN(NG_SBUF_MAX_SIZE, maxsbsz); + + if (setsockopt(be->fd, SOL_SOCKET, SO_SNDBUF, &sbsz, + sizeof(sbsz)) < 0) { + WPRINTF(("can't set TX buffer size")); + goto error; + } + + if (setsockopt(be->fd, SOL_SOCKET, SO_RCVBUF, &sbsz, + sizeof(sbsz)) < 0) { + WPRINTF(("can't set RX buffer size")); + goto error; + } + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); + if (caph_rights_limit(be->fd, &rights) == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + + memset(p->bbuf, 0, sizeof(p->bbuf)); + p->bbuflen = 0; + + p->mevp = mevent_add_disabled(be->fd, EVF_READ, cb, param); + if (p->mevp == NULL) { + WPRINTF(("Could not register event")); + goto error; + } + + return (0); + +error: + tap_cleanup(be); + return (-1); +} + +static struct net_backend ng_backend = { + .prefix = "netgraph", + .priv_size = sizeof(struct tap_priv), + .init = ng_init, + .cleanup = tap_cleanup, + .send = tap_send, + .peek_recvlen = tap_peek_recvlen, + .recv = tap_recv, + .recv_enable = tap_recv_enable, + .recv_disable = tap_recv_disable, + .get_cap = tap_get_cap, + .set_cap = tap_set_cap, +}; + +DATA_SET(net_backend_set, ng_backend); + +#endif /* NETGRAPH */ /* * The netmap backend From owner-svn-src-head@freebsd.org Tue May 12 13:23:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 491512EEF6E; Tue, 12 May 2020 13:23:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Lz5W1ZVNz4FqR; Tue, 12 May 2020 13:23:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30E8B8A31; Tue, 12 May 2020 13:23:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CDNRWv033959; Tue, 12 May 2020 13:23:27 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CDNP5w033951; Tue, 12 May 2020 13:23:25 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005121323.04CDNP5w033951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Tue, 12 May 2020 13:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360960 - in head/sys/fs: nfs nfsclient nfsserver X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient nfsserver X-SVN-Commit-Revision: 360960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 13:23:27 -0000 Author: freqlabs Date: Tue May 12 13:23:25 2020 New Revision: 360960 URL: https://svnweb.freebsd.org/changeset/base/360960 Log: nfs: Remove APPLESTATIC macro It is no longer useful. Reviewed by: rmacklem Approved by: mav (mentor) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24811 Modified: head/sys/fs/nfs/nfs_commonacl.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c head/sys/fs/nfsserver/nfs_nfsdcache.c head/sys/fs/nfsserver/nfs_nfsdserv.c head/sys/fs/nfsserver/nfs_nfsdsocket.c head/sys/fs/nfsserver/nfs_nfsdstate.c head/sys/fs/nfsserver/nfs_nfsdsubs.c Modified: head/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- head/sys/fs/nfs/nfs_commonacl.c Tue May 12 12:29:39 2020 (r360959) +++ head/sys/fs/nfs/nfs_commonacl.c Tue May 12 13:23:25 2020 (r360960) @@ -40,7 +40,7 @@ static int nfsrv_acemasktoperm(u_int32_t acetype, u_in /* * Handle xdr for an ace. */ -APPLESTATIC int +int nfsrv_dissectace(struct nfsrv_descript *nd, struct acl_entry *acep, int *aceerrp, int *acesizep, NFSPROC_T *p) { @@ -388,7 +388,7 @@ nfsrv_buildace(struct nfsrv_descript *nd, u_char *name /* * Build an NFSv4 ACL. */ -APPLESTATIC int +int nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *aclp, enum vtype type, NFSPROC_T *p) { @@ -451,7 +451,7 @@ nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *ac * Compare two NFSv4 acls. * Return 0 if they are the same, 1 if not the same. */ -APPLESTATIC int +int nfsrv_compareacl(NFSACL_T *aclp1, NFSACL_T *aclp2) { int i; Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Tue May 12 12:29:39 2020 (r360959) +++ head/sys/fs/nfs/nfs_commonsubs.c Tue May 12 13:23:25 2020 (r360960) @@ -314,7 +314,7 @@ static int nfs_bigrequest[NFSV42_NPROCS] = { * Start building a request. Mostly just put the first file handle in * place. */ -APPLESTATIC void +void nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp, u_int8_t *nfhp, int fhlen, u_int32_t **opcntpp, struct nfsclsession *sep, int vers, int minorvers) @@ -453,7 +453,7 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, /* * Put a state Id in the mbuf list. */ -APPLESTATIC void +void nfsm_stateidtom(struct nfsrv_descript *nd, nfsv4stateid_t *stateidp, int flag) { nfsv4stateid_t *st; @@ -689,7 +689,7 @@ out: * This is used by the macro NFSM_DISSECT for tough * cases. */ -APPLESTATIC void * +void * nfsm_dissct(struct nfsrv_descript *nd, int siz, int how) { struct mbuf *mp2; @@ -755,7 +755,7 @@ nfsm_dissct(struct nfsrv_descript *nd, int siz, int ho * here than check for offs > 0 for all calls to nfsm_advance. * If left == -1, it should be calculated here. */ -APPLESTATIC int +int nfsm_advance(struct nfsrv_descript *nd, int offs, int left) { int error = 0; @@ -803,7 +803,7 @@ out: * Copy a string into mbuf(s). * Return the number of bytes output, including XDR overheads. */ -APPLESTATIC int +int nfsm_strtom(struct nfsrv_descript *nd, const char *cp, int siz) { struct mbuf *m2; @@ -860,7 +860,7 @@ nfsm_strtom(struct nfsrv_descript *nd, const char *cp, /* * Called once to initialize data structures... */ -APPLESTATIC void +void newnfs_init(void) { static int nfs_inited = 0; @@ -890,7 +890,7 @@ newnfs_init(void) * set_true == 1 if there should be an newnfs_true prepended on the file handle. * Return the number of bytes output, including XDR overhead. */ -APPLESTATIC int +int nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, int size, int set_true) { u_int32_t *tl; @@ -933,7 +933,7 @@ nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, i * The AF_INET family is handled as a special case so that address mbufs * don't need to be saved to store "struct in_addr", which is only 4 bytes. */ -APPLESTATIC int +int nfsaddr_match(int family, union nethostaddr *haddr, NFSSOCKADDR_T nam) { #ifdef INET @@ -970,7 +970,7 @@ nfsaddr_match(int family, union nethostaddr *haddr, NF /* * Similar to the above, but takes to NFSSOCKADDR_T args. */ -APPLESTATIC int +int nfsaddr2_match(NFSSOCKADDR_T nam1, NFSSOCKADDR_T nam2) { struct sockaddr_in *addr1, *addr2; @@ -1007,7 +1007,7 @@ nfsaddr2_match(NFSSOCKADDR_T nam1, NFSSOCKADDR_T nam2) /* * Trim trailing data off the mbuf list being built. */ -APPLESTATIC void +void newnfs_trimtrailing(nd, mb, bpos) struct nfsrv_descript *nd; struct mbuf *mb; @@ -1026,7 +1026,7 @@ newnfs_trimtrailing(nd, mb, bpos) /* * Dissect a file handle on the client. */ -APPLESTATIC int +int nfsm_getfh(struct nfsrv_descript *nd, struct nfsfh **nfhpp) { u_int32_t *tl; @@ -1061,7 +1061,7 @@ nfsmout: * Break down the nfsv4 acl. * If the aclp == NULL or won't fit in an acl, just discard the acl info. */ -APPLESTATIC int +int nfsrv_dissectacl(struct nfsrv_descript *nd, NFSACL_T *aclp, int *aclerrp, int *aclsizep, __unused NFSPROC_T *p) { @@ -1127,7 +1127,7 @@ nfsmout: * Returns EBADRPC for a parsing error, 0 otherwise. * If the clearinvalid flag is set, clear the bits not supported. */ -APPLESTATIC int +int nfsrv_getattrbits(struct nfsrv_descript *nd, nfsattrbit_t *attrbitp, int *cntp, int *retnotsupp) { @@ -1173,7 +1173,7 @@ nfsmout: * and 0 otherwise. * Returns EBADRPC if it can't be parsed, 0 otherwise. */ -APPLESTATIC int +int nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nap, struct nfsfh **nfhpp, fhandle_t *fhp, int fhsize, struct nfsv3_pathconf *pc, struct statfs *sbp, struct nfsstatfs *sfp, @@ -2217,7 +2217,7 @@ nfsmout: * and the mp argument indicates to check for a forced dismount, iff not * NULL. */ -APPLESTATIC int +int nfsv4_lock(struct nfsv4lock *lp, int iwantlock, int *isleptp, void *mutex, struct mount *mp) { @@ -2264,7 +2264,7 @@ nfsv4_lock(struct nfsv4lock *lp, int iwantlock, int *i * The second argument is set to 1 to indicate the nfslock_usecnt should be * incremented, as well. */ -APPLESTATIC void +void nfsv4_unlock(struct nfsv4lock *lp, int incref) { @@ -2277,7 +2277,7 @@ nfsv4_unlock(struct nfsv4lock *lp, int incref) /* * Release a reference cnt. */ -APPLESTATIC void +void nfsv4_relref(struct nfsv4lock *lp) { @@ -2297,7 +2297,7 @@ nfsv4_relref(struct nfsv4lock *lp) * If the mp argument is not NULL, check for NFSCL_FORCEDISM() being set and * return without getting a refcnt for that case. */ -APPLESTATIC void +void nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void *mutex, struct mount *mp) { @@ -2327,7 +2327,7 @@ nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void * Get a reference as above, but return failure instead of sleeping if * an exclusive lock is held. */ -APPLESTATIC int +int nfsv4_getref_nonblock(struct nfsv4lock *lp) { @@ -2341,7 +2341,7 @@ nfsv4_getref_nonblock(struct nfsv4lock *lp) /* * Test for a lock. Return 1 if locked, 0 otherwise. */ -APPLESTATIC int +int nfsv4_testlock(struct nfsv4lock *lp) { @@ -2369,7 +2369,7 @@ nfsv4_wanted(struct nfsv4lock *lp) * Return EBADRPC if there is an mbuf error, * 0 otherwise. */ -APPLESTATIC int +int nfsrv_mtostr(struct nfsrv_descript *nd, char *str, int siz) { char *cp; @@ -2420,7 +2420,7 @@ out: /* * Fill in the attributes as marked by the bitmap (V4). */ -APPLESTATIC int +int nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, NFSACL_T *saclp, struct vattr *vap, fhandle_t *fhp, int rderror, nfsattrbit_t *attrbitp, struct ucred *cred, NFSPROC_T *p, int isdgram, @@ -3000,7 +3000,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount * Put the attribute bits onto an mbuf list. * Return the number of bytes of output generated. */ -APPLESTATIC int +int nfsrv_putattrbit(struct nfsrv_descript *nd, nfsattrbit_t *attrbitp) { u_int32_t *tl; @@ -3025,7 +3025,7 @@ nfsrv_putattrbit(struct nfsrv_descript *nd, nfsattrbit * (malloc a larger one, as required) * retlenp - pointer to length to be returned */ -APPLESTATIC void +void nfsv4_uidtostr(uid_t uid, u_char **cpp, int *retlenp) { int i; @@ -3182,7 +3182,7 @@ tryagain: * string is made up entirely of digits, just convert the string to * a number. */ -APPLESTATIC int +int nfsv4_strtouid(struct nfsrv_descript *nd, u_char *str, int len, uid_t *uidp) { int i; @@ -3284,7 +3284,7 @@ out: * (malloc a larger one, as required) * retlenp - pointer to length to be returned */ -APPLESTATIC void +void nfsv4_gidtostr(gid_t gid, u_char **cpp, int *retlenp) { int i; @@ -3396,7 +3396,7 @@ tryagain: * string is made up entirely of digits, just convert the string to * a number. */ -APPLESTATIC int +int nfsv4_strtogid(struct nfsrv_descript *nd, u_char *str, int len, gid_t *gidp) { int i; @@ -3521,7 +3521,7 @@ nfsrv_cmpmixedcase(u_char *cp, u_char *cp2, int len) /* * Set the port for the nfsuserd. */ -APPLESTATIC int +int nfsrv_nfsuserdport(struct nfsuserd_args *nargs, NFSPROC_T *p) { struct nfssockreq *rp; @@ -3604,7 +3604,7 @@ out: /* * Delete the nfsuserd port. */ -APPLESTATIC void +void nfsrv_nfsuserddelport(void) { @@ -3691,7 +3691,7 @@ out: * This function is called from the nfssvc(2) system call, to update the * kernel user/group name list(s) for the V4 owner and ownergroup attributes. */ -APPLESTATIC int +int nfssvc_idname(struct nfsd_idargs *nidp) { struct nfsusrgrp *nusrp, *usrp, *newusrp; @@ -4084,7 +4084,7 @@ nfsrv_removeuser(struct nfsusrgrp *usrp, int isuser) * running, since it doesn't do any locking. * This function is meant to be used when the nfscommon module is unloaded. */ -APPLESTATIC void +void nfsrv_cleanusergroup(void) { struct nfsrv_lughash *hp, *hp2; @@ -4131,7 +4131,7 @@ nfsrv_cleanusergroup(void) * This function scans a byte string and checks for UTF-8 compliance. * It returns 0 if it conforms and NFSERR_INVAL if not. */ -APPLESTATIC int +int nfsrv_checkutf8(u_int8_t *cp, int len) { u_int32_t val = 0x0; @@ -4384,7 +4384,7 @@ nfsrv_refstrbigenough(int siz, u_char **cpp, u_char ** /* * Initialize the reply header data structures. */ -APPLESTATIC void +void nfsrvd_rephead(struct nfsrv_descript *nd) { struct mbuf *mreq; @@ -4449,7 +4449,7 @@ newnfs_sndunlock(int *flagp) NFSUNLOCKSOCK(); } -APPLESTATIC int +int nfsv4_getipaddr(struct nfsrv_descript *nd, struct sockaddr_in *sin, struct sockaddr_in6 *sin6, sa_family_t *saf, int *isudp) { @@ -4630,7 +4630,7 @@ nfsv4_seqsess_cacherep(uint32_t slotid, struct nfsslot /* * Generate the xdr for an NFSv4.1 Sequence Operation. */ -APPLESTATIC void +void nfsv4_setsequence(struct nfsmount *nmp, struct nfsrv_descript *nd, struct nfsclsession *sep, int dont_replycache) { @@ -4738,7 +4738,7 @@ nfsv4_sequencelookup(struct nfsmount *nmp, struct nfsc /* * Free a session slot. */ -APPLESTATIC void +void nfsv4_freeslot(struct nfsclsession *sep, int slot) { uint64_t bitval; Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Tue May 12 12:29:39 2020 (r360959) +++ head/sys/fs/nfs/nfsport.h Tue May 12 13:23:25 2020 (r360960) @@ -103,11 +103,6 @@ #include #include -/* - * For Darwin, these functions should be "static" when built in a kext. - * (This is always defined as nil otherwise.) - */ -#define APPLESTATIC #include #include #include Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 12 12:29:39 2020 (r360959) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 12 13:23:25 2020 (r360960) @@ -55,7 +55,7 @@ static nfsuint64 nfs_nullcookie = {{ 0, 0 }}; * copies a uio scatter/gather list to an mbuf chain. * NOTE: can ony handle iovcnt == 1 */ -APPLESTATIC void +void nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) { char *uiocp; @@ -206,7 +206,7 @@ nfsm_uiombuflist(struct uio *uiop, int siz, struct mbu * Load vnode attributes from the xdr file attributes. * Returns EBADRPC if they can't be parsed, 0 otherwise. */ -APPLESTATIC int +int nfsm_loadattr(struct nfsrv_descript *nd, struct nfsvattr *nap) { struct nfs_fattr *fp; @@ -273,7 +273,7 @@ nfsmout: * This function finds the directory cookie that corresponds to the * logical byte offset given. */ -APPLESTATIC nfsuint64 * +nfsuint64 * nfscl_getcookie(struct nfsnode *np, off_t off, int add) { struct nfsdmap *dp, *dp2; @@ -325,7 +325,7 @@ nfscl_getcookie(struct nfsnode *np, off_t off, int add * the file handle and the file's attributes. * For V4, it assumes that Getfh and Getattr Op's results are here. */ -APPLESTATIC int +int nfscl_mtofh(struct nfsrv_descript *nd, struct nfsfh **nfhpp, struct nfsvattr *nap, int *attrflagp) { @@ -386,7 +386,7 @@ nfsmout: /* * Initialize the owner/delegation sleep lock. */ -APPLESTATIC void +void nfscl_lockinit(struct nfsv4lock *lckp) { @@ -398,7 +398,7 @@ nfscl_lockinit(struct nfsv4lock *lckp) * Get an exclusive lock. (Not needed for OpenBSD4, since there is only one * thread for each posix process in the kernel.) */ -APPLESTATIC void +void nfscl_lockexcl(struct nfsv4lock *lckp, void *mutex) { int igotlock; @@ -411,7 +411,7 @@ nfscl_lockexcl(struct nfsv4lock *lckp, void *mutex) /* * Release an exclusive lock. */ -APPLESTATIC void +void nfscl_lockunlock(struct nfsv4lock *lckp) { @@ -421,7 +421,7 @@ nfscl_lockunlock(struct nfsv4lock *lckp) /* * Called to derefernce a lock on a stateid (delegation or open owner). */ -APPLESTATIC void +void nfscl_lockderef(struct nfsv4lock *lckp) { Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Tue May 12 12:29:39 2020 (r360959) +++ head/sys/fs/nfsclient/nfs_clport.c Tue May 12 13:23:25 2020 (r360960) @@ -1108,7 +1108,7 @@ nfscl_checksattr(struct vattr *vap, struct nfsvattr *n * error should only be returned for the Open, Create and Setattr Ops. * As such, most calls can just pass in 0 for those arguments. */ -APPLESTATIC int +int nfscl_maperr(struct thread *td, int error, uid_t uid, gid_t gid) { struct proc *p; Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Tue May 12 12:29:39 2020 (r360959) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Tue May 12 13:23:25 2020 (r360960) @@ -226,7 +226,7 @@ int nfs_pnfsio(task_fn_t *, void *); /* * nfs null call from vfs. */ -APPLESTATIC int +int nfsrpc_null(vnode_t vp, struct ucred *cred, NFSPROC_T *p) { int error; @@ -245,7 +245,7 @@ nfsrpc_null(vnode_t vp, struct ucred *cred, NFSPROC_T * For nfs version 3 and 4, use the access rpc to check accessibility. If file * modes are changed on the server, accesses might still fail later. */ -APPLESTATIC int +int nfsrpc_access(vnode_t vp, int acmode, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp) { @@ -288,7 +288,7 @@ nfsrpc_access(vnode_t vp, int acmode, struct ucred *cr /* * The actual rpc, separated out for Darwin. */ -APPLESTATIC int +int nfsrpc_accessrpc(vnode_t vp, u_int32_t mode, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, u_int32_t *rmodep, void *stuff) @@ -349,7 +349,7 @@ nfsmout: /* * nfs open rpc */ -APPLESTATIC int +int nfsrpc_open(vnode_t vp, int amode, struct ucred *cred, NFSPROC_T *p) { struct nfsclopen *op; @@ -481,7 +481,7 @@ else printf(" fhl=0\n"); /* * the actual open rpc */ -APPLESTATIC int +int nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen, u_int8_t *newfhp, int newfhlen, u_int32_t mode, struct nfsclopen *op, u_int8_t *name, int namelen, struct nfscldeleg **dpp, @@ -684,7 +684,7 @@ nfsmout: /* * open downgrade rpc */ -APPLESTATIC int +int nfsrpc_opendowngrade(vnode_t vp, u_int32_t mode, struct nfsclopen *op, struct ucred *cred, NFSPROC_T *p) { @@ -727,7 +727,7 @@ nfsmout: /* * V4 Close operation. */ -APPLESTATIC int +int nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) { struct nfsclclient *clp; @@ -749,7 +749,7 @@ nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) /* * Close the open. */ -APPLESTATIC void +void nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p) { struct nfsrv_descript nfsd, *nd = &nfsd; @@ -846,7 +846,7 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen /* * The actual Close RPC. */ -APPLESTATIC int +int nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsmount *nmp, struct nfsclopen *op, struct ucred *cred, NFSPROC_T *p, int syscred) @@ -885,7 +885,7 @@ nfsmout: /* * V4 Open Confirm RPC. */ -APPLESTATIC int +int nfsrpc_openconfirm(vnode_t vp, u_int8_t *nfhp, int fhlen, struct nfsclopen *op, struct ucred *cred, NFSPROC_T *p) { @@ -928,7 +928,7 @@ nfsmout: * Do the setclientid and setclientid confirm RPCs. Called from nfs_statfs() * when a mount has just occurred and when the server replies NFSERR_EXPIRED. */ -APPLESTATIC int +int nfsrpc_setclient(struct nfsmount *nmp, struct nfsclclient *clp, int reclaim, bool *retokp, struct ucred *cred, NFSPROC_T *p) { @@ -1184,7 +1184,7 @@ nfsmout: /* * nfs getattr call. */ -APPLESTATIC int +int nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, void *stuff) { @@ -1211,7 +1211,7 @@ nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC /* * nfs getattr call with non-vnode arguemnts. */ -APPLESTATIC int +int nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp, int fhlen, int syscred, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, u_int64_t *xidp, uint32_t *leasep) @@ -1251,7 +1251,7 @@ nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp /* * Do an nfs setattr operation. */ -APPLESTATIC int +int nfsrpc_setattr(vnode_t vp, struct vattr *vap, NFSACL_T *aclp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *rnap, int *attrflagp, void *stuff) @@ -1378,7 +1378,7 @@ nfsrpc_setattrrpc(vnode_t vp, struct vattr *vap, /* * nfs lookup rpc */ -APPLESTATIC int +int nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nap, struct nfsfh **nfhpp, int *attrflagp, int *dattrflagp, void *stuff) @@ -1481,7 +1481,7 @@ nfsmout: /* * Do a readlink rpc. */ -APPLESTATIC int +int nfsrpc_readlink(vnode_t vp, struct uio *uiop, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -1537,7 +1537,7 @@ nfsmout: /* * Read operation. */ -APPLESTATIC int +int nfsrpc_read(vnode_t vp, struct uio *uiop, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -1695,7 +1695,7 @@ nfsmout: * the recovery thread could get stuck waiting for the buffer and recovery * will then deadlock. */ -APPLESTATIC int +int nfsrpc_write(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff, int called_from_strategy) @@ -1960,7 +1960,7 @@ nfsmout: * For NFS v2 this is a kludge. Use a create rpc but with the IFMT bits of the * mode set to specify the file type and the size field for rdev. */ -APPLESTATIC int +int nfsrpc_mknod(vnode_t dvp, char *name, int namelen, struct vattr *vap, u_int32_t rdev, enum vtype vtyp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, @@ -2040,7 +2040,7 @@ nfsmout: * Mostly just call the approriate routine. (I separated out v4, so that * error recovery wouldn't be as difficult.) */ -APPLESTATIC int +int nfsrpc_create(vnode_t dvp, char *name, int namelen, struct vattr *vap, nfsquad_t cverf, int fmode, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, @@ -2407,7 +2407,7 @@ nfsmout: /* * Nfs remove rpc */ -APPLESTATIC int +int nfsrpc_remove(vnode_t dvp, char *name, int namelen, vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, int *dattrflagp, void *dstuff) @@ -2484,7 +2484,7 @@ nfsmout: /* * Do an nfs rename rpc. */ -APPLESTATIC int +int nfsrpc_rename(vnode_t fdvp, vnode_t fvp, char *fnameptr, int fnamelen, vnode_t tdvp, vnode_t tvp, char *tnameptr, int tnamelen, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *fnap, struct nfsvattr *tnap, @@ -2642,7 +2642,7 @@ nfsmout: /* * nfs hard link create rpc */ -APPLESTATIC int +int nfsrpc_link(vnode_t dvp, vnode_t vp, char *name, int namelen, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nap, int *attrflagp, int *dattrflagp, void *dstuff) @@ -2705,7 +2705,7 @@ nfsmout: /* * nfs symbolic link create rpc */ -APPLESTATIC int +int nfsrpc_symlink(vnode_t dvp, char *name, int namelen, const char *target, struct vattr *vap, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, int *attrflagp, @@ -2766,7 +2766,7 @@ nfsrpc_symlink(vnode_t dvp, char *name, int namelen, c /* * nfs make dir rpc */ -APPLESTATIC int +int nfsrpc_mkdir(vnode_t dvp, char *name, int namelen, struct vattr *vap, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, int *attrflagp, @@ -2848,7 +2848,7 @@ nfsmout: /* * nfs remove directory call */ -APPLESTATIC int +int nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, int *dattrflagp, void *dstuff) { @@ -2904,7 +2904,7 @@ nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, str * and returns the one for the next entry after this directory block in * there, as well. */ -APPLESTATIC int +int nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, int *eofp, void *stuff) @@ -3351,7 +3351,7 @@ nfsmout: * (Also used for NFS V4 when mount flag set.) * (ditto above w.r.t. multiple of DIRBLKSIZ, etc.) */ -APPLESTATIC int +int nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, int *eofp, void *stuff) @@ -3860,7 +3860,7 @@ nfsmout: /* * Nfs commit rpc */ -APPLESTATIC int +int nfsrpc_commit(vnode_t vp, u_quad_t offset, int cnt, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -3911,7 +3911,7 @@ nfsmout: * NFS byte range lock rpc. * (Mostly just calls one of the three lower level RPC routines.) */ -APPLESTATIC int +int nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl, int reclaim, struct ucred *cred, NFSPROC_T *p, void *id, int flags) { @@ -4078,7 +4078,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct /* * The lower level routine for the LockT case. */ -APPLESTATIC int +int nfsrpc_lockt(struct nfsrv_descript *nd, vnode_t vp, struct nfsclclient *clp, u_int64_t off, u_int64_t len, struct flock *fl, struct ucred *cred, NFSPROC_T *p, void *id, int flags) @@ -4203,7 +4203,7 @@ nfsmout: /* * The actual Lock RPC. */ -APPLESTATIC int +int nfsrpc_lock(struct nfsrv_descript *nd, struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen, struct nfscllockowner *lp, int newone, int reclaim, u_int64_t off, u_int64_t len, short type, struct ucred *cred, @@ -4292,7 +4292,7 @@ nfsmout: * nfs statfs rpc * (always called with the vp for the mount point) */ -APPLESTATIC int +int nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struct nfsfsinfo *fsp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) @@ -4371,7 +4371,7 @@ nfsmout: /* * nfs pathconf rpc */ -APPLESTATIC int +int nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) @@ -4432,7 +4432,7 @@ nfsmout: /* * nfs version 3 fsinfo rpc call */ -APPLESTATIC int +int nfsrpc_fsinfo(vnode_t vp, struct nfsfsinfo *fsp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -4471,7 +4471,7 @@ nfsmout: /* * This function performs the Renew RPC. */ -APPLESTATIC int +int nfsrpc_renew(struct nfsclclient *clp, struct nfsclds *dsp, struct ucred *cred, NFSPROC_T *p) { @@ -4525,7 +4525,7 @@ nfsrpc_renew(struct nfsclclient *clp, struct nfsclds * /* * This function performs the Releaselockowner RPC. */ -APPLESTATIC int +int nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllockowner *lp, uint8_t *fh, int fhlen, struct ucred *cred, NFSPROC_T *p) { @@ -4564,7 +4564,7 @@ nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllo /* * This function performs the Compound to get the mount pt FH. */ -APPLESTATIC int +int nfsrpc_getdirpath(struct nfsmount *nmp, u_char *dirpath, struct ucred *cred, NFSPROC_T *p) { @@ -4633,7 +4633,7 @@ nfsmout: /* * This function performs the Delegreturn RPC. */ -APPLESTATIC int +int nfsrpc_delegreturn(struct nfscldeleg *dp, struct ucred *cred, struct nfsmount *nmp, NFSPROC_T *p, int syscred) { @@ -4666,7 +4666,7 @@ nfsrpc_delegreturn(struct nfscldeleg *dp, struct ucred /* * nfs getacl call. */ -APPLESTATIC int +int nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct acl *aclp, void *stuff) { @@ -4696,7 +4696,7 @@ nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_ /* * nfs setacl call. */ -APPLESTATIC int +int nfsrpc_setacl(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct acl *aclp, void *stuff) { @@ -6829,7 +6829,7 @@ nfsio_commitds(vnode_t vp, uint64_t offset, int cnt, s /* * NFS Advise rpc */ -APPLESTATIC int +int nfsrpc_advise(vnode_t vp, off_t offset, uint64_t cnt, int advise, struct ucred *cred, NFSPROC_T *p) { @@ -6970,7 +6970,7 @@ nfsio_adviseds(vnode_t vp, uint64_t offset, int cnt, i /* * Do the Allocate operation, retrying for recovery. */ -APPLESTATIC int +int nfsrpc_allocate(vnode_t vp, off_t off, off_t len, struct nfsvattr *nap, int *attrflagp, struct ucred *cred, NFSPROC_T *p, void *stuff) { @@ -8077,7 +8077,7 @@ out: /* * nfs copy_file_range operation. */ -APPLESTATIC int +int nfsrpc_copy_file_range(vnode_t invp, off_t *inoffp, vnode_t outvp, off_t *outoffp, size_t *lenp, unsigned int flags, int *inattrflagp, struct nfsvattr *innap, int *outattrflagp, struct nfsvattr *outnap, @@ -8271,7 +8271,7 @@ nfsmout: /* * Seek operation. */ -APPLESTATIC int +int nfsrpc_seek(vnode_t vp, off_t *offp, bool *eofp, int content, struct ucred *cred, struct nfsvattr *nap, int *attrflagp) { @@ -8365,7 +8365,7 @@ nfsmout: /* * The getextattr RPC. */ -APPLESTATIC int +int nfsrpc_getextattr(vnode_t vp, const char *name, struct uio *uiop, ssize_t *lenp, struct nfsvattr *nap, int *attrflagp, struct ucred *cred, NFSPROC_T *p) { @@ -8436,7 +8436,7 @@ nfsmout: /* * The setextattr RPC. */ -APPLESTATIC int +int nfsrpc_setextattr(vnode_t vp, const char *name, struct uio *uiop, struct nfsvattr *nap, int *attrflagp, struct ucred *cred, NFSPROC_T *p) { @@ -8484,7 +8484,7 @@ nfsmout: /* * The removeextattr RPC. */ -APPLESTATIC int +int nfsrpc_rmextattr(vnode_t vp, const char *name, struct nfsvattr *nap, int *attrflagp, struct ucred *cred, NFSPROC_T *p) { @@ -8522,7 +8522,7 @@ nfsmout: /* * The listextattr RPC. */ -APPLESTATIC int +int nfsrpc_listextattr(vnode_t vp, uint64_t *cookiep, struct uio *uiop, size_t *lenp, bool *eofp, struct nfsvattr *nap, int *attrflagp, struct ucred *cred, NFSPROC_T *p) Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Tue May 12 12:29:39 2020 (r360959) +++ head/sys/fs/nfsclient/nfs_clstate.c Tue May 12 13:23:25 2020 (r360960) @@ -209,7 +209,7 @@ static short *nfscl_cberrmap[] = { * Called for an open operation. * If the nfhp argument is NULL, just get an openowner. */ -APPLESTATIC int +int nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t amode, int usedeleg, struct ucred *cred, NFSPROC_T *p, struct nfsclowner **owpp, struct nfsclopen **opp, int *newonep, int *retp, int lockit) @@ -425,7 +425,7 @@ nfscl_newopen(struct nfsclclient *clp, struct nfscldel /* * Called to find/add a delegation to a client. */ -APPLESTATIC int +int nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, int fhlen, struct ucred *cred, NFSPROC_T *p, struct nfscldeleg **dpp) { @@ -496,7 +496,7 @@ nfscl_finddeleg(struct nfsclclient *clp, u_int8_t *fhp * found, return either a lockowner stateid or the open stateid. * If no Open is found, just return error and the special stateid of all zeros. */ -APPLESTATIC int +int nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, int fords, struct ucred *cred, NFSPROC_T *p, nfsv4stateid_t *stateidp, void **lckpp) @@ -720,7 +720,7 @@ nfscl_getopen(struct nfsclownerhead *ohp, u_int8_t *nf * Release use of an open owner. Called when open operations are done * with the open owner. */ -APPLESTATIC void +void nfscl_ownerrelease(struct nfsmount *nmp, struct nfsclowner *owp, __unused int error, __unused int candelete, int unlocked) { @@ -741,7 +741,7 @@ nfscl_ownerrelease(struct nfsmount *nmp, struct nfsclo /* * Release use of an open structure under an open owner. */ -APPLESTATIC void +void nfscl_openrelease(struct nfsmount *nmp, struct nfsclopen *op, int error, int candelete) { @@ -775,7 +775,7 @@ nfscl_openrelease(struct nfsmount *nmp, struct nfsclop * thread if this creates a new clp. * It always clpp with a reference count on it, unless returning an error. */ -APPLESTATIC int +int nfscl_getcl(struct mount *mp, struct ucred *cred, NFSPROC_T *p, int start_renewthread, struct nfsclclient **clpp) { @@ -938,7 +938,7 @@ nfscl_getcl(struct mount *mp, struct ucred *cred, NFSP /* * Get a reference to a clientid and return it, if valid. */ -APPLESTATIC struct nfsclclient * +struct nfsclclient * nfscl_findcl(struct nfsmount *nmp) { struct nfsclclient *clp; @@ -965,7 +965,7 @@ nfscl_clrelease(struct nfsclclient *clp) /* * External call for nfscl_clrelease. */ -APPLESTATIC void +void nfscl_clientrelease(struct nfsclclient *clp) { @@ -980,7 +980,7 @@ nfscl_clientrelease(struct nfsclclient *clp) /* * Called when wanting to lock a byte region. */ -APPLESTATIC int +int nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len, short type, struct ucred *cred, NFSPROC_T *p, struct nfsclclient *rclp, int recovery, void *id, int flags, u_int8_t *rownp, u_int8_t *ropenownp, @@ -1180,7 +1180,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t /* * Called to unlock a byte range, for LockU. */ -APPLESTATIC int +int nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t len, __unused struct ucred *cred, NFSPROC_T *p, int callcnt, struct nfsclclient *clp, void *id, int flags, @@ -1292,7 +1292,7 @@ nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t /* * Release all lockowners marked in progess for this process and file. */ -APPLESTATIC void +void nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p, void *id, int flags) { @@ -1330,7 +1330,7 @@ nfscl_releasealllocks(struct nfsclclient *clp, vnode_t * is required before a LockU. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue May 12 14:01:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EEFF2F07E8; Tue, 12 May 2020 14:01:13 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Lzx46h7nz4HVj; Tue, 12 May 2020 14:01:12 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C886C915A; Tue, 12 May 2020 14:01:12 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CE1CdZ053554; Tue, 12 May 2020 14:01:12 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CE1CwB053553; Tue, 12 May 2020 14:01:12 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <202005121401.04CE1CwB053553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Tue, 12 May 2020 14:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360961 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 360961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 14:01:13 -0000 Author: gallatin Date: Tue May 12 14:01:12 2020 New Revision: 360961 URL: https://svnweb.freebsd.org/changeset/base/360961 Log: IPv6: sync IP_NO_SND_TAG_RL support from IPv4 The IP_NO_SND_TAG_RL flag to ip{,6}_output() means that the packets being sent should bypass hardware rate limiting. This is typically used by modern TCP stacks for rexmits. This support was added to IPv4 in r352657, but never added to IPv6, even though rack and bbr call ip6_output() with this flag. Reviewed by: rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D24822 Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Tue May 12 13:23:25 2020 (r360960) +++ head/sys/netinet6/ip6_output.c Tue May 12 14:01:12 2020 (r360961) @@ -322,7 +322,8 @@ ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int h static int ip6_output_send(struct inpcb *inp, struct ifnet *ifp, struct ifnet *origifp, - struct mbuf *m, struct sockaddr_in6 *dst, struct route_in6 *ro) + struct mbuf *m, struct sockaddr_in6 *dst, struct route_in6 *ro, + bool stamp_tag) { #ifdef KERN_TLS struct ktls_session *tls = NULL; @@ -353,6 +354,10 @@ ip6_output_send(struct inpcb *inp, struct ifnet *ifp, error = EAGAIN; goto done; } + /* + * Always stamp tags that include NIC ktls. + */ + stamp_tag = true; } #endif #ifdef RATELIMIT @@ -366,7 +371,7 @@ ip6_output_send(struct inpcb *inp, struct ifnet *ifp, mst = inp->inp_snd_tag; } #endif - if (mst != NULL) { + if (stamp_tag && mst != NULL) { KASSERT(m->m_pkthdr.rcvif == NULL, ("trying to add a send tag to a forwarded packet")); if (mst->ifp != ifp) { @@ -1165,7 +1170,8 @@ passout: m->m_pkthdr.len); ifa_free(&ia6->ia_ifa); } - error = ip6_output_send(inp, ifp, origifp, m, dst, ro); + error = ip6_output_send(inp, ifp, origifp, m, dst, ro, + (flags & IP_NO_SND_TAG_RL) ? false : true); goto done; } @@ -1256,7 +1262,8 @@ sendorfree: counter_u64_add(ia->ia_ifa.ifa_obytes, m->m_pkthdr.len); } - error = ip6_output_send(inp, ifp, origifp, m, dst, ro); + error = ip6_output_send(inp, ifp, origifp, m, dst, ro, + true); } else m_freem(m); } From owner-svn-src-head@freebsd.org Tue May 12 15:22:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82FD82F2298; Tue, 12 May 2020 15:22:46 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M1lB3CMTz4Mmm; Tue, 12 May 2020 15:22:46 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 690ABA14C; Tue, 12 May 2020 15:22:46 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CFMkA7007706; Tue, 12 May 2020 15:22:46 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CFMfuo007680; Tue, 12 May 2020 15:22:41 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <202005121522.04CFMfuo007680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 12 May 2020 15:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360964 - in head: lib/libclang_rt lib/libthr lib/msun libexec/rtld-elf libexec/tftpd/tests share/mk stand stand/arm/uboot stand/efi stand/efi/boot1 stand/efi/loader stand/i386/boot2 st... X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in head: lib/libclang_rt lib/libthr lib/msun libexec/rtld-elf libexec/tftpd/tests share/mk stand stand/arm/uboot stand/efi stand/efi/boot1 stand/efi/loader stand/i386/boot2 stand/i386/isoboot stand/li... X-SVN-Commit-Revision: 360964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 15:22:46 -0000 Author: vangyzen Date: Tue May 12 15:22:40 2020 New Revision: 360964 URL: https://svnweb.freebsd.org/changeset/base/360964 Log: Remove tests for obsolete compilers in the build system Assume gcc is at least 6.4, the oldest xtoolchain in the ports tree. Assume clang is at least 6, which was in 11.2-RELEASE. Drop conditions for older compilers. Reviewed by: imp (earlier version), emaste, jhb MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24802 Modified: head/lib/libclang_rt/Makefile.inc head/lib/libthr/Makefile head/lib/msun/Makefile head/libexec/rtld-elf/Makefile head/libexec/tftpd/tests/Makefile head/share/mk/bsd.compiler.mk head/share/mk/bsd.sys.mk head/stand/arm/uboot/Makefile head/stand/defs.mk head/stand/efi/Makefile head/stand/efi/boot1/Makefile head/stand/efi/loader/Makefile head/stand/i386/boot2/Makefile head/stand/i386/isoboot/Makefile head/stand/libsa/Makefile head/sys/conf/Makefile.arm head/sys/conf/Makefile.powerpc head/sys/conf/kern.mk head/sys/conf/kern.post.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk head/sys/modules/Makefile head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/trpt/Makefile head/usr.sbin/zic/zic/Makefile Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Tue May 12 14:47:38 2020 (r360963) +++ head/lib/libclang_rt/Makefile.inc Tue May 12 15:22:40 2020 (r360964) @@ -32,7 +32,7 @@ CFLAGS+= ${PICFLAG} CFLAGS+= -fno-builtin CFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti -.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 30700 +.if ${COMPILER_TYPE} == clang CFLAGS+= -fno-sanitize=safe-stack .endif CFLAGS+= -fno-stack-protector Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/lib/libthr/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -29,10 +29,7 @@ CFLAGS+=-Winline CFLAGS.thr_stack.c+= -Wno-cast-align CFLAGS.rtld_malloc.c+= -Wno-cast-align -.include -.if !(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 40300) CFLAGS.thr_symbols.c+= -Wno-missing-variable-declarations -.endif .ifndef NO_THREAD_UNWIND_STACK CFLAGS+=-fexceptions Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/lib/msun/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -108,13 +108,13 @@ COMMON_SRCS+= catrigl.c \ s_nextafterl.c s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c \ s_scalbnl.c s_sinl.c s_sincosl.c \ s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c -# Work around this warning from gcc 6: +# Work around this warning from gcc: # lib/msun/ld80/e_powl.c:275:1: error: floating constant exceeds range of # 'long double' [-Werror=overflow] # if( y >= LDBL_MAX ) # See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=130067 .include -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60000 +.if ${COMPILER_TYPE} == "gcc" CFLAGS.e_powl.c+= -Wno-error=overflow .endif .endif Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/libexec/rtld-elf/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -90,8 +90,4 @@ ${PROG_FULL}: ${VERSION_MAP} # GCC warns about redeclarations even though they have __exported # and are therefore not identical to the ones from the system headers. CFLAGS+= -Wno-redundant-decls -.if ${COMPILER_VERSION} < 40300 -# Silence -Wshadow false positives in ancient GCC -CFLAGS+= -Wno-shadow -.endif .endif Modified: head/libexec/tftpd/tests/Makefile ============================================================================== --- head/libexec/tftpd/tests/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/libexec/tftpd/tests/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -2,11 +2,8 @@ .include -# Skip on GCC 4.2, because it lacks __COUNTER__ -.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40300 ATF_TESTS_C= functional TEST_METADATA.functional+= timeout=15 -.endif LIBADD= util WARNS?= 6 Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Tue May 12 14:47:38 2020 (r360963) +++ head/share/mk/bsd.compiler.mk Tue May 12 15:22:40 2020 (r360964) @@ -205,20 +205,12 @@ ${X_}COMPILER_FREEBSD_VERSION= unknown ${X_}COMPILER_RESOURCE_DIR!= ${${cc}:N${CCACHE_BIN}} -print-resource-dir 2>/dev/null || echo unknown .endif -${X_}COMPILER_FEATURES= -.if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 30300) || \ - (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800) -${X_}COMPILER_FEATURES+= c++11 -.endif -.if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 30400) || \ - (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 50000) -${X_}COMPILER_FEATURES+= c++14 -.endif -.if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 50000) || \ +${X_}COMPILER_FEATURES= c++11 c++14 +.if ${${X_}COMPILER_TYPE} == "clang" || \ (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 70000) ${X_}COMPILER_FEATURES+= c++17 .endif -.if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 60000 +.if ${${X_}COMPILER_TYPE} == "clang" ${X_}COMPILER_FEATURES+= retpoline .endif Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue May 12 14:47:38 2020 (r360963) +++ head/share/mk/bsd.sys.mk Tue May 12 15:22:40 2020 (r360964) @@ -6,8 +6,7 @@ # Enable various levels of compiler warning checks. These may be # overridden (e.g. if using a non-gcc compiler) by defining MK_WARNS=no. -# for 4.2.1 GCC: http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Warning-Options.html -# for current GCC: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html +# for GCC: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html # for clang: https://clang.llvm.org/docs/DiagnosticsReference.html .include @@ -29,15 +28,6 @@ CFLAGS+= -std=${CSTD} CXXFLAGS+= -std=${CXXSTD} .endif -# -# Turn off -Werror for gcc 4.2.1. The compiler is on the glide path out of the -# system, and any warnings specific to it are no longer relevant as there are -# too many false positives. -# -.if ${COMPILER_VERSION} < 50000 -NO_WERROR.gcc= yes -.endif - # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS+= -pedantic .if defined(WARNS) @@ -81,19 +71,13 @@ CWARNFLAGS+= -Wno-pointer-sign # is set to low values, these have to be disabled explicitly. .if ${WARNS} <= 6 CWARNFLAGS.clang+= -Wno-empty-body -Wno-string-plus-int -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30400 CWARNFLAGS.clang+= -Wno-unused-const-variable -.endif .endif # WARNS <= 6 .if ${WARNS} <= 3 CWARNFLAGS.clang+= -Wno-tautological-compare -Wno-unused-value\ -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30600 CWARNFLAGS.clang+= -Wno-unused-local-typedef -.endif -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 40000 CWARNFLAGS.clang+= -Wno-address-of-packed-member -.endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 90100 CWARNFLAGS.gcc+= -Wno-address-of-packed-member .endif @@ -113,7 +97,7 @@ CWARNFLAGS.clang+= -Wno-array-bounds .endif # NO_WARRAY_BOUNDS .if defined(NO_WMISLEADING_INDENTATION) && \ ((${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 100000) || \ - (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100)) + ${COMPILER_TYPE} == "gcc") CWARNFLAGS+= -Wno-misleading-indentation .endif # NO_WMISLEADING_INDENTATION .endif # WARNS @@ -137,8 +121,10 @@ CWARNFLAGS+= -Werror CWARNFLAGS+= -Wno-format .endif # NO_WFORMAT || NO_WFORMAT.${COMPILER_TYPE} -# GCC 5.2.0 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50200 +# GCC +# We should clean up warnings produced with these flags. +# They were originally added as a quick hack to enable gcc5/6. +.if ${COMPILER_TYPE} == "gcc" CWARNFLAGS+= -Wno-error=address \ -Wno-error=array-bounds \ -Wno-error=attributes \ @@ -150,23 +136,18 @@ CWARNFLAGS+= -Wno-error=address \ -Wno-error=extra \ -Wno-error=inline \ -Wno-error=logical-not-parentheses \ + -Wno-error=nonnull-compare \ + -Wno-error=shift-negative-value \ -Wno-error=strict-aliasing \ + -Wno-error=tautological-compare \ -Wno-error=uninitialized \ -Wno-error=unused-but-set-variable \ + -Wno-error=unused-const-variable \ -Wno-error=unused-function \ -Wno-error=unused-value -.endif -# GCC 6.1.0 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100 -CWARNFLAGS+= -Wno-error=nonnull-compare \ - -Wno-error=shift-negative-value \ - -Wno-error=tautological-compare \ - -Wno-error=unused-const-variable -.endif - # GCC 7.1.0 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 70100 +.if ${COMPILER_VERSION} >= 70100 CWARNFLAGS+= -Wno-error=bool-operation \ -Wno-error=deprecated \ -Wno-error=expansion-to-defined \ @@ -182,7 +163,7 @@ CWARNFLAGS+= -Wno-error=bool-operation \ .endif # GCC 8.1.0 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 80100 +.if ${COMPILER_VERSION} >= 80100 CWARNFLAGS+= -Wno-error=aggressive-loop-optimizations \ -Wno-error=cast-function-type \ -Wno-error=catch-value \ @@ -191,9 +172,10 @@ CWARNFLAGS+= -Wno-error=aggressive-loop-optimizations -Wno-error=sizeof-pointer-memaccess \ -Wno-error=stringop-truncation .endif +.endif # gcc # How to handle FreeBSD custom printf format specifiers. -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30600 +.if ${COMPILER_TYPE} == "clang" FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__ .else FORMAT_EXTENSIONS= -fformat-extensions @@ -223,11 +205,7 @@ CFLAGS+=-nobuiltininc -idirafter ${COMPILER_RESOURCE_D CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\ -mllvm -simplifycfg-dup-ret -.if ${COMPILER_VERSION} >= 30500 && ${COMPILER_VERSION} < 30700 -CLANG_OPT_SMALL+= -mllvm -enable-gvn=false -.else CLANG_OPT_SMALL+= -mllvm -enable-load-pre=false -.endif CFLAGS.clang+= -Qunused-arguments # The libc++ headers use c++11 extensions. These are normally silenced because # they are treated as system headers, but we explicitly disable that warning @@ -238,14 +216,8 @@ CXXFLAGS.clang+= -Wno-c++11-extensions .if ${MK_SSP} != "no" && \ ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" -.if (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30500) || \ - (${COMPILER_TYPE} == "gcc" && \ - (${COMPILER_VERSION} == 40201 || ${COMPILER_VERSION} >= 40900)) # Don't use -Wstack-protector as it breaks world with -Werror. SSP_CFLAGS?= -fstack-protector-strong -.else -SSP_CFLAGS?= -fstack-protector -.endif CFLAGS+= ${SSP_CFLAGS} .endif # SSP && !ARM && !MIPS Modified: head/stand/arm/uboot/Makefile ============================================================================== --- head/stand/arm/uboot/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/arm/uboot/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -24,7 +24,7 @@ UBLDR_LOADADDR?= 0x1000000 # Architecture-specific loader code SRCS= start.S conf.c self_reloc.c vers.c -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 +.if ${COMPILER_TYPE} == "gcc" CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Tue May 12 14:47:38 2020 (r360963) +++ head/stand/defs.mk Tue May 12 15:22:40 2020 (r360964) @@ -143,11 +143,7 @@ CFLAGS+= -fPIC -mno-red-zone # Do not generate movt/movw, because the relocation fixup for them does not # translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). # Also, the fpu is not available in a standalone environment. -.if ${COMPILER_VERSION} < 30800 -CFLAGS.clang+= -mllvm -arm-use-movt=0 -.else CFLAGS.clang+= -mno-movt -.endif CFLAGS.clang+= -mfpu=none CFLAGS+= -fPIC .endif Modified: head/stand/efi/Makefile ============================================================================== --- head/stand/efi/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/efi/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -4,16 +4,10 @@ NO_OBJ=t .include -# In-tree GCC does not support __attribute__((ms_abi)), but gcc newer -# than 4.5 supports it. -.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 - SUBDIR.${MK_FDT}+= fdt SUBDIR.yes+= libefi boot1 gptboot SUBDIR.${MK_FORTH}+= loader_4th SUBDIR.${MK_LOADER_LUA}+= loader_lua SUBDIR.yes+= loader_simp - -.endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 .include Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/efi/boot1/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -42,10 +42,6 @@ CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/contrib/opensol CFLAGS+= -DEFI_ZFS_BOOT .endif -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 -CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized -.endif - CFLAGS+= -I${EFIINC} CFLAGS+= -I${EFIINCMD} CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include Modified: head/stand/efi/loader/Makefile ============================================================================== --- head/stand/efi/loader/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/efi/loader/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -31,10 +31,6 @@ CFLAGS+= -DEFI_ZFS_BOOT HAVE_ZFS= yes .endif -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 -CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized -.endif - # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead Modified: head/stand/i386/boot2/Makefile ============================================================================== --- head/stand/i386/boot2/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/i386/boot2/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -37,9 +37,6 @@ CFLAGS+=-fomit-frame-pointer \ CFLAGS.gcc+= -Os \ -fno-asynchronous-unwind-tables \ --param max-inline-insns-single=100 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201 -CFLAGS.gcc+= -mno-align-long-strings -.endif CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} Modified: head/stand/i386/isoboot/Makefile ============================================================================== --- head/stand/i386/isoboot/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/i386/isoboot/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -32,9 +32,6 @@ CFLAGS+=-DBOOTPROG=\"isoboot\" \ -Winline -Wno-pointer-sign CFLAGS.gcc+= --param max-inline-insns-single=100 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201 -CFLAGS.gcc+= -Wno-uninitialized -.endif CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} LD_FLAGS+=${LD_FLAGS_BIN} Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/libsa/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -46,11 +46,7 @@ SRCS+= subr_boot.c # Do not generate movt/movw, because the relocation fixup for them does not # translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). # Also, the fpu is not available in a standalone environment. -.if ${COMPILER_VERSION} < 30800 -CFLAGS.clang+= -mllvm -arm-use-movt=0 -.else CFLAGS.clang+= -mno-movt -.endif CFLAGS.clang+= -mfpu=none .PATH: ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins/arm/ Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/Makefile.arm Tue May 12 15:22:40 2020 (r360964) @@ -44,10 +44,6 @@ CFLAGS.clang += -mfpu=none .if !empty(DDB_ENABLED) CFLAGS += -funwind-tables -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 30500 -# clang < 3.5.0 requires us to tell it to emit assembly with unwind information -CFLAGS += -mllvm -arm-enable-ehabi -.endif .endif # "makeoptions KERNVIRTADDR=" is now optional, supply the default value. Modified: head/sys/conf/Makefile.powerpc ============================================================================== --- head/sys/conf/Makefile.powerpc Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/Makefile.powerpc Tue May 12 15:22:40 2020 (r360964) @@ -51,7 +51,7 @@ DPAAWARNFLAGS += \ -Wno-error=incompatible-pointer-types-discards-qualifiers \ -Wno-error=non-literal-null-conversion \ -Wno-error=enum-conversion -.elif "${COMPILER_TYPE}" == "gcc" && ${COMPILER_VERSION} >= 50200 +.elif "${COMPILER_TYPE}" == "gcc" DPAAWARNFLAGS += \ -Wno-error=redundant-decls \ -Wno-error=int-in-bool-context Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kern.mk Tue May 12 15:22:40 2020 (r360964) @@ -31,19 +31,14 @@ NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-po CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \ -Wno-error-parentheses-equality -Wno-error-unused-function \ -Wno-error-pointer-sign -.if ${COMPILER_VERSION} >= 30700 CWARNEXTRA+= -Wno-error-shift-negative-value -.endif -.if ${COMPILER_VERSION} >= 40000 CWARNEXTRA+= -Wno-address-of-packed-member -.endif .if ${COMPILER_VERSION} >= 100000 NO_WMISLEADING_INDENTATION= -Wno-misleading-indentation .endif -.endif +.endif # clang .if ${COMPILER_TYPE} == "gcc" -.if ${COMPILER_VERSION} >= 40800 # Catch-all for all the things that are in our tree, but for which we're # not yet ready for this compiler. NO_WUNUSED_BUT_SET_VARIABLE = -Wno-unused-but-set-variable @@ -55,15 +50,13 @@ CWARNEXTRA?= -Wno-error=address \ -Wno-error=enum-compare \ -Wno-error=inline \ -Wno-error=maybe-uninitialized \ + -Wno-error=misleading-indentation \ + -Wno-error=nonnull-compare \ -Wno-error=overflow \ -Wno-error=sequence-point \ - -Wno-unused-but-set-variable -.if ${COMPILER_VERSION} >= 60100 -CWARNEXTRA+= -Wno-error=misleading-indentation \ - -Wno-error=nonnull-compare \ -Wno-error=shift-overflow \ - -Wno-error=tautological-compare -.endif + -Wno-error=tautological-compare \ + -Wno-unused-but-set-variable .if ${COMPILER_VERSION} >= 70100 CWARNEXTRA+= -Wno-error=stringop-overflow .endif @@ -76,15 +69,7 @@ CWARNEXTRA+= -Wno-error=packed-not-aligned .if ${COMPILER_VERSION} >= 90100 CWARNEXTRA+= -Wno-address-of-packed-member .endif -.else -# For gcc 4.2, eliminate the too-often-wrong warnings about uninitialized vars. -CWARNEXTRA?= -Wno-uninitialized -# GCC 4.2 doesn't have -Wno-error=cast-qual, so just disable the warning for -# the few files that are already known to generate cast-qual warnings. -NO_WCAST_QUAL= -Wno-cast-qual -NO_WNONNULL= -Wno-nonnull -.endif -.endif +.endif # gcc # This warning is utter nonsense CWARNFLAGS+= -Wno-format-zero-length @@ -93,7 +78,7 @@ CWARNFLAGS+= -Wno-format-zero-length # to be disabled. WARNING: format checking is disabled in this case. .if ${MK_FORMAT_EXTENSIONS} == "no" FORMAT_EXTENSIONS= -Wno-format -.elif ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30600 +.elif ${COMPILER_TYPE} == "clang" FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__ .else FORMAT_EXTENSIONS= -fformat-extensions @@ -201,12 +186,7 @@ CFLAGS.gcc+= -mno-spe # DDB happy. ELFv2, if available, has some other efficiency benefits. # .if ${MACHINE_ARCH} == "powerpc64" -.if ${COMPILER_VERSION} >= 40900 -CFLAGS.gcc+= -mabi=elfv2 -.else -CFLAGS.gcc+= -mcall-aixdesc -.endif -CFLAGS.clang+= -mabi=elfv2 +CFLAGS+= -mabi=elfv2 .endif # Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kern.post.mk Tue May 12 15:22:40 2020 (r360964) @@ -345,10 +345,7 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .depend: .PRECIOUS ${SRCS} -.if ${COMPILER_TYPE} == "clang" || \ - (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60000) _MAP_DEBUG_PREFIX= yes -.endif _ILINKS= machine .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kern.pre.mk Tue May 12 15:22:40 2020 (r360964) @@ -93,11 +93,7 @@ CFLAGS.gcc+= -fms-extensions .if defined(CFLAGS_ARCH_PARAMS) CFLAGS.gcc+=${CFLAGS_ARCH_PARAMS} .endif -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 50000 -WERROR?= -Wno-error -.else WERROR?= -Werror -.endif # The following should be removed no earlier than LLVM11 being imported into the # tree, to ensure we don't regress the build. LLVM11 and GCC10 will switch the # default over to -fno-common, making this redundant. Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kmod.mk Tue May 12 15:22:40 2020 (r360964) @@ -88,11 +88,7 @@ __KLD_SHARED=no .if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing) CFLAGS+= -fno-strict-aliasing .endif -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 50000 -WERROR?= -Wno-error -.else WERROR?= -Werror -.endif LINUXKPI_GENSRCS+= \ bus_if.h \ @@ -160,11 +156,7 @@ CFLAGS+= -fPIC # Temporary workaround for PR 196407, which contains the fascinating details. # Don't allow clang to use fpu instructions or registers in kernel modules. .if ${MACHINE_CPUARCH} == arm -.if ${COMPILER_VERSION} < 30800 -CFLAGS.clang+= -mllvm -arm-use-movt=0 -.else CFLAGS.clang+= -mno-movt -.endif CFLAGS.clang+= -mfpu=none CFLAGS+= -funwind-tables .endif @@ -283,10 +275,7 @@ ${FULLPROG}: ${OBJS} ${OBJCOPY} --strip-debug ${.TARGET} .endif -.if ${COMPILER_TYPE} == "clang" || \ - (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60000) _MAP_DEBUG_PREFIX= yes -.endif _ILINKS=machine .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/sys/modules/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -620,9 +620,7 @@ _aac= aac _aacraid= aacraid _acpi= acpi .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) -.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201 _aesni= aesni -.endif .endif _amd_ecc_inject=amd_ecc_inject _amdsbwd= amdsbwd Modified: head/usr.sbin/acpi/acpidb/Makefile ============================================================================== --- head/usr.sbin/acpi/acpidb/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/usr.sbin/acpi/acpidb/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -87,6 +87,6 @@ LIBADD= pthread # integer to pointer, which is a GNU extension. # # Turn off the warning, because this is in contributed code. -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 60000 +.if ${COMPILER_TYPE} == "clang" CWARNFLAGS+= -Wno-null-pointer-arithmetic .endif Modified: head/usr.sbin/trpt/Makefile ============================================================================== --- head/usr.sbin/trpt/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/usr.sbin/trpt/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -8,18 +8,12 @@ MAN= trpt.8 BINGRP= kmem BINMODE= 2555 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 50000 -WARNS?= 4 -.endif - .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif .include -.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 50000 # Several included system headers tickle this warning in ways that are # difficult to work around in this program. CFLAGS+= -Wno-missing-variable-declarations -.endif Modified: head/usr.sbin/zic/zic/Makefile ============================================================================== --- head/usr.sbin/zic/zic/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/usr.sbin/zic/zic/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -15,7 +15,7 @@ CFLAGS+= -I${.CURDIR:H} -I${SRCTOP}/contrib/tzcode/std WARNS?= 2 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50300 +.if ${COMPILER_TYPE} == "gcc" CWARNFLAGS+= -Wno-error=strict-overflow .endif From owner-svn-src-head@freebsd.org Tue May 12 16:10:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECEE32F34BB; Tue, 12 May 2020 16:10:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M2nr62k0z4QX0; Tue, 12 May 2020 16:10:08 +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 CA784A917; Tue, 12 May 2020 16:10:08 +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 04CGA88X033416; Tue, 12 May 2020 16:10:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGA8sE033413; Tue, 12 May 2020 16:10:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005121610.04CGA8sE033413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 12 May 2020 16:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360966 - in head: share/man/man4 sys/dev/rtwn/usb sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/rtwn/usb sys/dev/usb X-SVN-Commit-Revision: 360966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:10:09 -0000 Author: markj Date: Tue May 12 16:10:07 2020 New Revision: 360966 URL: https://svnweb.freebsd.org/changeset/base/360966 Log: rtwn: Add a USB ID for the TP-Link TL-WN727N. PR: 246417 Submitted by: Viktor G. MFC after: 1 week Modified: head/share/man/man4/rtwn_usb.4 head/sys/dev/rtwn/usb/rtwn_usb_attach.h head/sys/dev/usb/usbdevs Modified: head/share/man/man4/rtwn_usb.4 ============================================================================== --- head/share/man/man4/rtwn_usb.4 Tue May 12 16:05:21 2020 (r360965) +++ head/share/man/man4/rtwn_usb.4 Tue May 12 16:10:07 2020 (r360966) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd May 9, 2020 +.Dd May 12, 2020 .Dt RTWN_USB 4 .Os .Sh NAME @@ -103,6 +103,7 @@ based USB wireless network adapters, including: .It "TP-Link TL-WN722N v2" Ta RTL8188EU Ta USB 2.0 .It "TP-LINK TL-WN723N v3" Ta RTL8188EU Ta USB 2.0 .It "TP-LINK TL-WN725N v2" Ta RTL8188EU Ta USB 2.0 +.It "TP-LINK TL-WN727N v5" Ta RTL8188EU Ta USB 2.0 .It "TP-LINK TL-WN821N v4" Ta RTL8192CU Ta USB 2.0 .It "TP-LINK TL-WN821N v5" Ta RTL8192EU Ta USB 2.0 .It "TP-LINK TL-WN822N v4" Ta RTL8192EU Ta USB 2.0 Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_attach.h Tue May 12 16:05:21 2020 (r360965) +++ head/sys/dev/rtwn/usb/rtwn_usb_attach.h Tue May 12 16:10:07 2020 (r360966) @@ -120,6 +120,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8188EU_DEV(DLINK, DWA125D1), RTWN_RTL8188EU_DEV(ELECOM, WDC150SU2M), RTWN_RTL8188EU_DEV(TPLINK, WN722NV2), + RTWN_RTL8188EU_DEV(TPLINK, WN727NV5), RTWN_RTL8188EU_DEV(REALTEK, RTL8188ETV), RTWN_RTL8188EU_DEV(REALTEK, RTL8188EU), #undef RTWN_RTL8188EU_DEV Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue May 12 16:05:21 2020 (r360965) +++ head/sys/dev/usb/usbdevs Tue May 12 16:10:07 2020 (r360966) @@ -4664,6 +4664,7 @@ product TPLINK WN821NV5 0x0107 TL-WN821N v5 product TPLINK WN822NV4 0x0108 TL-WN822N v4 product TPLINK WN823NV2 0x0109 TL-WN823N v2 product TPLINK WN722NV2 0x010c TL-WN722N v2 +product TPLINK WN727NV5 0x0111 TL-WN727N v5 product TPLINK T4UV2 0x010d Archer T4U ver 2 product TPLINK T4UHV1 0x0103 Archer T4UH ver 1 product TPLINK T4UHV2 0x010e Archer T4UH ver 2 From owner-svn-src-head@freebsd.org Tue May 12 16:33:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55BBB2F3C3F; Tue, 12 May 2020 16:33:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M3JJ6tg1z4Rk8; Tue, 12 May 2020 16:33: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 E77ECAED1; Tue, 12 May 2020 16:33: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 04CGX41K051217; Tue, 12 May 2020 16:33:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGX4Bf051216; Tue, 12 May 2020 16:33:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005121633.04CGX4Bf051216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 May 2020 16:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360967 - head/sys/netinet/libalias X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/netinet/libalias X-SVN-Commit-Revision: 360967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:33:05 -0000 Author: emaste Date: Tue May 12 16:33:04 2020 New Revision: 360967 URL: https://svnweb.freebsd.org/changeset/base/360967 Log: libalias: validate packet lengths before accessing headers admbugs: 956 Submitted by: ae Reported by: Lucas Leong (@_wmliang_) of Trend Micro Zero Day Initiative Reported by: Vishnu working with Trend Micro Zero Day Initiative Security: FreeBSD-SA-20:12.libalias Modified: head/sys/netinet/libalias/alias.c Modified: head/sys/netinet/libalias/alias.c ============================================================================== --- head/sys/netinet/libalias/alias.c Tue May 12 16:10:07 2020 (r360966) +++ head/sys/netinet/libalias/alias.c Tue May 12 16:33:04 2020 (r360967) @@ -442,10 +442,15 @@ fragment contained in ICMP data section */ static int IcmpAliasIn(struct libalias *la, struct ip *pip) { - int iresult; struct icmp *ic; + int dlen, iresult; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < ICMP_MINLEN) + return (PKT_ALIAS_IGNORED); + /* Return if proxy-only mode is enabled */ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) return (PKT_ALIAS_OK); @@ -464,6 +469,9 @@ IcmpAliasIn(struct libalias *la, struct ip *pip) case ICMP_SOURCEQUENCH: case ICMP_TIMXCEED: case ICMP_PARAMPROB: + if (dlen < ICMP_ADVLENMIN || + dlen < ICMP_ADVLEN(ic)) + return (PKT_ALIAS_IGNORED); iresult = IcmpAliasIn2(la, pip); break; case ICMP_ECHO: @@ -732,10 +740,17 @@ UdpAliasIn(struct libalias *la, struct ip *pip) { struct udphdr *ud; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, ud->uh_sport, ud->uh_dport, @@ -824,12 +839,19 @@ UdpAliasOut(struct libalias *la, struct ip *pip, int m u_short dest_port; u_short proxy_server_port; int proxy_type; - int error; + int dlen, error; LIBALIAS_LOCK_ASSERT(la); /* Return if proxy-only mode is enabled and not proxyrule found.*/ + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); + proxy_type = ProxyCheck(la, &proxy_server_address, &proxy_server_port, pip->ip_src, pip->ip_dst, ud->uh_dport, pip->ip_p); @@ -922,8 +944,13 @@ TcpAliasIn(struct libalias *la, struct ip *pip) { struct tcphdr *tc; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, @@ -1042,7 +1069,7 @@ TcpAliasIn(struct libalias *la, struct ip *pip) static int TcpAliasOut(struct libalias *la, struct ip *pip, int maxpacketsize, int create) { - int proxy_type, error; + int dlen, proxy_type, error; u_short dest_port; u_short proxy_server_port; struct in_addr dest_address; @@ -1051,6 +1078,10 @@ TcpAliasOut(struct libalias *la, struct ip *pip, int m struct alias_link *lnk; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); if (create) From owner-svn-src-head@freebsd.org Tue May 12 16:38:29 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EF852F3E5C; Tue, 12 May 2020 16:38:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M3QY3F6Jz4S0T; Tue, 12 May 2020 16:38:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69D8FAED6; Tue, 12 May 2020 16:38:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CGcTkN051541; Tue, 12 May 2020 16:38:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGcTJ5051540; Tue, 12 May 2020 16:38:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005121638.04CGcTJ5051540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 May 2020 16:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360968 - head/sys/netinet/libalias X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/netinet/libalias X-SVN-Commit-Revision: 360968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:38:29 -0000 Author: emaste Date: Tue May 12 16:38:28 2020 New Revision: 360968 URL: https://svnweb.freebsd.org/changeset/base/360968 Log: libalias: fix potential memory disclosure from ftp module admbugs: 956 Submitted by: markj Reported by: Vishnu Dev TJ working with Trend Micro Zero Day Initiative Security: FreeBSD-SA-20:13.libalias Security: CVE-2020-7455 Security: ZDI-CAN-10849 Modified: head/sys/netinet/libalias/alias_ftp.c Modified: head/sys/netinet/libalias/alias_ftp.c ============================================================================== --- head/sys/netinet/libalias/alias_ftp.c Tue May 12 16:33:04 2020 (r360967) +++ head/sys/netinet/libalias/alias_ftp.c Tue May 12 16:38:28 2020 (r360968) @@ -754,7 +754,8 @@ NewFtpMessage(struct libalias *la, struct ip *pip, { u_short new_len; - new_len = htons(hlen + slen); + new_len = htons(hlen + + MIN(slen, maxpacketsize - hlen)); DifferentialChecksum(&pip->ip_sum, &new_len, &pip->ip_len, From owner-svn-src-head@freebsd.org Tue May 12 17:00:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8FF52F4CC3; Tue, 12 May 2020 17:00:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M3wH5pTZz4VgS; Tue, 12 May 2020 17:00:47 +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 C2310B306; Tue, 12 May 2020 17:00:47 +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 04CH0lcP064344; Tue, 12 May 2020 17:00:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CH0lQC064343; Tue, 12 May 2020 17:00:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005121700.04CH0lQC064343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 12 May 2020 17:00:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360979 - head/lib/librtld_db X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/librtld_db X-SVN-Commit-Revision: 360979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 17:00:48 -0000 Author: markj Date: Tue May 12 17:00:47 2020 New Revision: 360979 URL: https://svnweb.freebsd.org/changeset/base/360979 Log: librtld_db: Fix shlib mapping offsets. kve_offset gives the offset into the backing file, which is not what we want since different segments may map the same page. Use the base of the mapping to determine the offset exported by librtld_db instead. PR: 244732 Reported by: Jenkins, Nicolò Mazzucato MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/lib/librtld_db/rtld_db.c Modified: head/lib/librtld_db/rtld_db.c ============================================================================== --- head/lib/librtld_db/rtld_db.c Tue May 12 17:00:23 2020 (r360978) +++ head/lib/librtld_db/rtld_db.c Tue May 12 17:00:47 2020 (r360979) @@ -160,9 +160,12 @@ rd_err_e rd_loadobj_iter(rd_agent_t *rdap, rl_iter_f *cb, void *clnt_data) { struct kinfo_vmentry *kves, *kve; + const char *path; + uint64_t fileid; rd_loadobj_t rdl; rd_err_e ret; - int cnt, i, lastvn; + uintptr_t base; + int cnt, i; DPRINTF("%s\n", __func__); @@ -171,27 +174,38 @@ rd_loadobj_iter(rd_agent_t *rdap, rl_iter_f *cb, void return (RD_ERR); } + base = 0; + fileid = 0; + path = NULL; ret = RD_OK; - lastvn = 0; for (i = 0; i < cnt; i++) { - kve = kves + i; - if (kve->kve_type == KVME_TYPE_VNODE) - lastvn = i; + kve = &kves[i]; + /* + * Cache the base offset of the file mapping. The kve_offset + * field gives the file offset of a particular mapping into the + * file, but we want the mapping offset relative to the base + * mapping. + */ + if (kve->kve_type == KVME_TYPE_VNODE && + kve->kve_vn_fileid != fileid) { + base = kve->kve_start; + fileid = kve->kve_vn_fileid; + path = kve->kve_path; + } memset(&rdl, 0, sizeof(rdl)); /* * Map the kinfo_vmentry struct to the rd_loadobj structure. */ rdl.rdl_saddr = kve->kve_start; rdl.rdl_eaddr = kve->kve_end; - rdl.rdl_offset = kve->kve_offset; + rdl.rdl_offset = kve->kve_start - base; if (kve->kve_protection & KVME_PROT_READ) rdl.rdl_prot |= RD_RDL_R; if (kve->kve_protection & KVME_PROT_WRITE) rdl.rdl_prot |= RD_RDL_W; if (kve->kve_protection & KVME_PROT_EXEC) rdl.rdl_prot |= RD_RDL_X; - strlcpy(rdl.rdl_path, kves[lastvn].kve_path, - sizeof(rdl.rdl_path)); + strlcpy(rdl.rdl_path, path, sizeof(rdl.rdl_path)); if ((*cb)(&rdl, clnt_data) != 0) { ret = RD_ERR; break; From owner-svn-src-head@freebsd.org Tue May 12 17:05:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 505A62F4F8D; Tue, 12 May 2020 17:05:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M42D1RBJz4W70; Tue, 12 May 2020 17:05:56 +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 2C8B7B4BE; Tue, 12 May 2020 17:05:56 +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 04CH5utO070289; Tue, 12 May 2020 17:05:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CH5u4P070288; Tue, 12 May 2020 17:05:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005121705.04CH5u4P070288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 12 May 2020 17:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360980 - head/lib/libproc/tests X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libproc/tests X-SVN-Commit-Revision: 360980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 17:05:56 -0000 Author: markj Date: Tue May 12 17:05:55 2020 New Revision: 360980 URL: https://svnweb.freebsd.org/changeset/base/360980 Log: Re-enable proc_test:symbol_lookup after r360979. PR: 244732 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/lib/libproc/tests/proc_test.c Modified: head/lib/libproc/tests/proc_test.c ============================================================================== --- head/lib/libproc/tests/proc_test.c Tue May 12 17:00:47 2020 (r360979) +++ head/lib/libproc/tests/proc_test.c Tue May 12 17:05:55 2020 (r360980) @@ -270,9 +270,6 @@ ATF_TC_BODY(symbol_lookup, tc) u_long saved; int error; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/244732"); - phdl = start_prog(tc, false); error = proc_name2sym(phdl, target_prog_file, "main", &main_sym, NULL); From owner-svn-src-head@freebsd.org Tue May 12 17:18:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E5912F52B5; Tue, 12 May 2020 17:18:45 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M4K12kRlz4Wln; Tue, 12 May 2020 17:18:45 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58B65B6A5; Tue, 12 May 2020 17:18:45 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CHIjMB076603; Tue, 12 May 2020 17:18:45 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CHIjRh076602; Tue, 12 May 2020 17:18:45 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <202005121718.04CHIjRh076602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Tue, 12 May 2020 17:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360982 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 360982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 17:18:45 -0000 Author: gallatin Date: Tue May 12 17:18:44 2020 New Revision: 360982 URL: https://svnweb.freebsd.org/changeset/base/360982 Log: IPv6: Fix a panic in the nd6 code with unmapped mbufs. If the neighbor entry for an IPv6 TCP session using unmapped mbufs times out, IPv6 will send an icmp6 dest. unreachable message. In doing this, it will try to do a software checksum on the reflected packet. If this is a TCP session using unmapped mbufs, then there will be a kernel panic. To fix this, just free packets with unmapped mbufs, rather than sending the icmp. Reviewed by: np, rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D24821 Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Tue May 12 17:07:28 2020 (r360981) +++ head/sys/netinet6/nd6.c Tue May 12 17:18:44 2020 (r360982) @@ -821,9 +821,27 @@ nd6_llinfo_timer(void *arg) clear_llinfo_pqueue(ln); } nd6_free(&ln, 0); - if (m != NULL) - icmp6_error2(m, ICMP6_DST_UNREACH, - ICMP6_DST_UNREACH_ADDR, 0, ifp); + if (m != NULL) { + struct mbuf *n = m; + + /* + * if there are any ummapped mbufs, we + * must free them, rather than using + * them for an ICMP, as they cannot be + * checksummed. + */ + while ((n = n->m_next) != NULL) { + if (n->m_flags & M_EXTPG) + break; + } + if (n != NULL) { + m_freem(m); + m = NULL; + } else { + icmp6_error2(m, ICMP6_DST_UNREACH, + ICMP6_DST_UNREACH_ADDR, 0, ifp); + } + } } break; case ND6_LLINFO_REACHABLE: From owner-svn-src-head@freebsd.org Tue May 12 18:12:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B234F2F6D12; Tue, 12 May 2020 18:12: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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M5Vr4GGDz4bLx; Tue, 12 May 2020 18:12: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 73EEAC3F9; Tue, 12 May 2020 18:12: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 04CICKiT013441; Tue, 12 May 2020 18:12:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CICKdo013440; Tue, 12 May 2020 18:12:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005121812.04CICKdo013440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 12 May 2020 18:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360983 - head/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 360983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 18:12:20 -0000 Author: kib Date: Tue May 12 18:12:20 2020 New Revision: 360983 URL: https://svnweb.freebsd.org/changeset/base/360983 Log: Clear namespace pollution in include/malloc_np.h Do not include stdbool.h, it makes the header incompatible with some third-party code that typedefs bool manually. Remove inclusion of strings.h, which typically conflicts with the use of symbol 'index'. Separate inclusion of sys/cdefs.h is not needed because sys/types.h already handles that. Exp-run by: antoine (PR 245366) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24297 Modified: head/include/malloc_np.h Modified: head/include/malloc_np.h ============================================================================== --- head/include/malloc_np.h Tue May 12 17:18:44 2020 (r360982) +++ head/include/malloc_np.h Tue May 12 18:12:20 2020 (r360983) @@ -33,29 +33,33 @@ #ifndef _MALLOC_NP_H_ #define _MALLOC_NP_H_ -#include + #include -#include -#include +#ifdef __cplusplus +#define __MyBool bool +#else +#define __MyBool _Bool +#endif + __BEGIN_DECLS typedef struct extent_hooks_s extent_hooks_t; -typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, bool *, - bool *, unsigned); -typedef bool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, bool, +typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, + __MyBool *, __MyBool *, unsigned); +typedef __MyBool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, __MyBool, unsigned); -typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, bool, +typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, __MyBool, unsigned); -typedef bool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t, size_t, - unsigned); -typedef bool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t, +typedef __MyBool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t, size_t, unsigned); -typedef bool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t, +typedef __MyBool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t, + size_t, unsigned); +typedef __MyBool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t, unsigned); -typedef bool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t, - bool, unsigned); -typedef bool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t, - bool, unsigned); +typedef __MyBool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t, + __MyBool, unsigned); +typedef __MyBool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t, + __MyBool, unsigned); struct extent_hooks_s { extent_alloc_t *alloc; extent_dalloc_t *dalloc; @@ -119,5 +123,7 @@ void __dallocx(void *ptr, int flags); void __sdallocx(void *ptr, size_t size, int flags); size_t __nallocx(size_t size, int flags); __END_DECLS + +#undef __MyBool #endif /* _MALLOC_NP_H_ */ From owner-svn-src-head@freebsd.org Tue May 12 18:17:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A11322F6FB8; Tue, 12 May 2020 18:17:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M5dL3sHQz4brZ; Tue, 12 May 2020 18:17:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FCE9C455; Tue, 12 May 2020 18:17:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CIHw49013918; Tue, 12 May 2020 18:17:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CIHwxa013917; Tue, 12 May 2020 18:17:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005121817.04CIHwxa013917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 12 May 2020 18:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360984 - head/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 360984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 18:17:58 -0000 Author: kib Date: Tue May 12 18:17:57 2020 New Revision: 360984 URL: https://svnweb.freebsd.org/changeset/base/360984 Log: Make include/malloc.h usable again. Lot of third-party Linux code uses #include , expecting to find the malloc extensions there. Instead of trying to fight them, accept that attempt to deprecate the header causes more troubles than solves potential portability issues, and provide our jemalloc extensions. PR: 155429 Reviewed by: imp, jhibbits, dab, hselasky, philip, emaste, jilles Exp-run by: antoine (PR 245366) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D24297 Modified: head/include/malloc.h Modified: head/include/malloc.h ============================================================================== --- head/include/malloc.h Tue May 12 18:12:20 2020 (r360983) +++ head/include/malloc.h Tue May 12 18:17:57 2020 (r360984) @@ -1,6 +1,6 @@ -/* $FreeBSD$ */ -#if __STDC__ -#error " has been replaced by " -#else +/*- + * This file is in the public domain. + * $FreeBSD$ + */ #include -#endif +#include From owner-svn-src-head@freebsd.org Tue May 12 18:35:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B27CC2F759C; Tue, 12 May 2020 18:35:04 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M6144f2kz4crn; Tue, 12 May 2020 18:35:04 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (c-98-207-126-143.hsd1.ca.comcast.net [98.207.126.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id D865B298A2; Tue, 12 May 2020 18:35:03 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.37.20051002 Date: Tue, 12 May 2020 11:34:59 -0700 Subject: Re: svn commit: r360964 - in head: lib/libclang_rt lib/libthr lib/msun libexec/rtld-elf libexec/tftpd/tests share/mk stand stand/arm/uboot stand/efi stand/efi/boot1 stand/efi/loader stand/i386/boot2 st... From: Ravi Pokala To: Eric van Gyzen , , , Message-ID: Thread-Topic: svn commit: r360964 - in head: lib/libclang_rt lib/libthr lib/msun libexec/rtld-elf libexec/tftpd/tests share/mk stand stand/arm/uboot stand/efi stand/efi/boot1 stand/efi/loader stand/i386/boot2 st... References: <202005121522.04CFMfuo007680@repo.freebsd.org> In-Reply-To: <202005121522.04CFMfuo007680@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 18:35:04 -0000 This feels like it deserves an UPDATING (and possibly a RELNOTES) entry. -Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Eric van Gyzen Date: 2020-05-12, Tuesday at 08:22 To: , , Subject: svn commit: r360964 - in head: lib/libclang_rt lib/libthr lib/msun= libexec/rtld-elf libexec/tftpd/tests share/mk stand stand/arm/uboot stand/e= fi stand/efi/boot1 stand/efi/loader stand/i386/boot2 st... Author: vangyzen Date: Tue May 12 15:22:40 2020 New Revision: 360964 URL: https://svnweb.freebsd.org/changeset/base/360964 Log: Remove tests for obsolete compilers in the build system Assume gcc is at least 6.4, the oldest xtoolchain in the ports tree. Assume clang is at least 6, which was in 11.2-RELEASE. Drop conditio= ns for older compilers. Reviewed by: imp (earlier version), emaste, jhb MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24802 Modified: head/lib/libclang_rt/Makefile.inc head/lib/libthr/Makefile head/lib/msun/Makefile head/libexec/rtld-elf/Makefile head/libexec/tftpd/tests/Makefile head/share/mk/bsd.compiler.mk head/share/mk/bsd.sys.mk head/stand/arm/uboot/Makefile head/stand/defs.mk head/stand/efi/Makefile head/stand/efi/boot1/Makefile head/stand/efi/loader/Makefile head/stand/i386/boot2/Makefile head/stand/i386/isoboot/Makefile head/stand/libsa/Makefile head/sys/conf/Makefile.arm head/sys/conf/Makefile.powerpc head/sys/conf/kern.mk head/sys/conf/kern.post.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk head/sys/modules/Makefile head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/trpt/Makefile head/usr.sbin/zic/zic/Makefile Modified: head/lib/libclang_rt/Makefile.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/lib/libclang_rt/Makefile.inc Tue May 12 14:47:38 2020 (r360963= ) +++ head/lib/libclang_rt/Makefile.inc Tue May 12 15:22:40 2020 (r360964= ) @@ -32,7 +32,7 @@ CFLAGS+=3D ${PICFLAG} CFLAGS+=3D -fno-builtin CFLAGS+=3D -fno-exceptions CXXFLAGS+=3D -fno-rtti -.if ${COMPILER_TYPE} =3D=3D clang && ${COMPILER_VERSION} >=3D 30700 +.if ${COMPILER_TYPE} =3D=3D clang CFLAGS+=3D -fno-sanitize=3Dsafe-stack .endif CFLAGS+=3D -fno-stack-protector Modified: head/lib/libthr/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/lib/libthr/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/lib/libthr/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -29,10 +29,7 @@ CFLAGS+=3D-Winline CFLAGS.thr_stack.c+=3D -Wno-cast-align CFLAGS.rtld_malloc.c+=3D -Wno-cast-align -.include -.if !(${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 40300) CFLAGS.thr_symbols.c+=3D -Wno-missing-variable-declarations -.endif .ifndef NO_THREAD_UNWIND_STACK CFLAGS+=3D-fexceptions Modified: head/lib/msun/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/lib/msun/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/lib/msun/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -108,13 +108,13 @@ COMMON_SRCS+=3D catrigl.c \ s_nextafterl.c s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c \ s_scalbnl.c s_sinl.c s_sincosl.c \ s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c -# Work around this warning from gcc 6: +# Work around this warning from gcc: # lib/msun/ld80/e_powl.c:275:1: error: floating constant exceeds r= ange of # 'long double' [-Werror=3Doverflow] # if( y >=3D LDBL_MAX ) # See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D130067 .include -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 60000 +.if ${COMPILER_TYPE} =3D=3D "gcc" CFLAGS.e_powl.c+=3D -Wno-error=3Doverflow .endif .endif Modified: head/libexec/rtld-elf/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/libexec/rtld-elf/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/libexec/rtld-elf/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -90,8 +90,4 @@ ${PROG_FULL}: ${VERSION_MAP} # GCC warns about redeclarations even though they have __exported # and are therefore not identical to the ones from the system headers. CFLAGS+=3D -Wno-redundant-decls -.if ${COMPILER_VERSION} < 40300 -# Silence -Wshadow false positives in ancient GCC -CFLAGS+=3D -Wno-shadow -.endif .endif Modified: head/libexec/tftpd/tests/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/libexec/tftpd/tests/Makefile Tue May 12 14:47:38 2020 (r360963= ) +++ head/libexec/tftpd/tests/Makefile Tue May 12 15:22:40 2020 (r360964= ) @@ -2,11 +2,8 @@ .include -# Skip on GCC 4.2, because it lacks __COUNTER__ -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D 40300 ATF_TESTS_C=3D functional TEST_METADATA.functional+=3D timeout=3D15 -.endif LIBADD=3D util WARNS?=3D 6 Modified: head/share/mk/bsd.compiler.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/share/mk/bsd.compiler.mk Tue May 12 14:47:38 2020 (r360963) +++ head/share/mk/bsd.compiler.mk Tue May 12 15:22:40 2020 (r360964) @@ -205,20 +205,12 @@ ${X_}COMPILER_FREEBSD_VERSION=3D unknown ${X_}COMPILER_RESOURCE_DIR!=3D ${${cc}:N${CCACHE_BIN}} -print-resource-d= ir 2>/dev/null || echo unknown .endif -${X_}COMPILER_FEATURES=3D -.if (${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERSION} >=3D 3= 0300) || \ - (${${X_}COMPILER_TYPE} =3D=3D "gcc" && ${${X_}COMPILER_VERSION} >=3D 40800) -${X_}COMPILER_FEATURES+=3D c++11 -.endif -.if (${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERSION} >=3D 3= 0400) || \ - (${${X_}COMPILER_TYPE} =3D=3D "gcc" && ${${X_}COMPILER_VERSION} >=3D 50000) -${X_}COMPILER_FEATURES+=3D c++14 -.endif -.if (${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERSION} >=3D 5= 0000) || \ +${X_}COMPILER_FEATURES=3D c++11 c++14 +.if ${${X_}COMPILER_TYPE} =3D=3D "clang" || \ (${${X_}COMPILER_TYPE} =3D=3D "gcc" && ${${X_}COMPILER_VERSION} >=3D 70000) ${X_}COMPILER_FEATURES+=3D c++17 .endif -.if ${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERSION} >=3D 60= 000 +.if ${${X_}COMPILER_TYPE} =3D=3D "clang" ${X_}COMPILER_FEATURES+=3D retpoline .endif Modified: head/share/mk/bsd.sys.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/share/mk/bsd.sys.mk Tue May 12 14:47:38 2020 (r360963) +++ head/share/mk/bsd.sys.mk Tue May 12 15:22:40 2020 (r360964) @@ -6,8 +6,7 @@ # Enable various levels of compiler warning checks. These may be # overridden (e.g. if using a non-gcc compiler) by defining MK_WARNS=3Dn= o. -# for 4.2.1 GCC: http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Warning= -Options.html -# for current GCC: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.= html +# for GCC: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html # for clang: https://clang.llvm.org/docs/DiagnosticsReference.html .include @@ -29,15 +28,6 @@ CFLAGS+=3D -std=3D${CSTD} CXXFLAGS+=3D -std=3D${CXXSTD} .endif -# -# Turn off -Werror for gcc 4.2.1. The compiler is on the glide path ou= t of the -# system, and any warnings specific to it are no longer relevant as th= ere are -# too many false positives. -# -.if ${COMPILER_VERSION} < 50000 -NO_WERROR.gcc=3D yes -.endif - # -pedantic is problematic because it also imposes namespace restricti= ons #CFLAGS+=3D -pedantic .if defined(WARNS) @@ -81,19 +71,13 @@ CWARNFLAGS+=3D -Wno-pointer-sign # is set to low values, these have to be disabled explicitly. .if ${WARNS} <=3D 6 CWARNFLAGS.clang+=3D -Wno-empty-body -Wno-string-plus-int -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 30400 CWARNFLAGS.clang+=3D -Wno-unused-const-variable -.endif .endif # WARNS <=3D 6 .if ${WARNS} <=3D 3 CWARNFLAGS.clang+=3D -Wno-tautological-compare -Wno-unused-value\ -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 30600 CWARNFLAGS.clang+=3D -Wno-unused-local-typedef -.endif -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 40000 CWARNFLAGS.clang+=3D -Wno-address-of-packed-member -.endif .if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 90100 CWARNFLAGS.gcc+=3D -Wno-address-of-packed-member .endif @@ -113,7 +97,7 @@ CWARNFLAGS.clang+=3D -Wno-array-bounds .endif # NO_WARRAY_BOUNDS .if defined(NO_WMISLEADING_INDENTATION) && \ ((${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 100000) ||= \ - (${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 60100)) + ${COMPILER_TYPE} =3D=3D "gcc") CWARNFLAGS+=3D -Wno-misleading-indentation .endif # NO_WMISLEADING_INDENTATION .endif # WARNS @@ -137,8 +121,10 @@ CWARNFLAGS+=3D -Werror CWARNFLAGS+=3D -Wno-format .endif # NO_WFORMAT || NO_WFORMAT.${COMPILER_TYPE} -# GCC 5.2.0 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 50200 +# GCC +# We should clean up warnings produced with these flags. +# They were originally added as a quick hack to enable gcc5/6. +.if ${COMPILER_TYPE} =3D=3D "gcc" CWARNFLAGS+=3D -Wno-error=3Daddress \ -Wno-error=3Darray-bounds \ -Wno-error=3Dattributes \ @@ -150,23 +136,18 @@ CWARNFLAGS+=3D -Wno-error=3Daddress \ -Wno-error=3Dextra \ -Wno-error=3Dinline \ -Wno-error=3Dlogical-not-parentheses \ + -Wno-error=3Dnonnull-compare \ + -Wno-error=3Dshift-negative-value \ -Wno-error=3Dstrict-aliasing \ + -Wno-error=3Dtautological-compare \ -Wno-error=3Duninitialized \ -Wno-error=3Dunused-but-set-variable \ + -Wno-error=3Dunused-const-variable \ -Wno-error=3Dunused-function \ -Wno-error=3Dunused-value -.endif -# GCC 6.1.0 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 60100 -CWARNFLAGS+=3D -Wno-error=3Dnonnull-compare \ - -Wno-error=3Dshift-negative-value \ - -Wno-error=3Dtautological-compare \ - -Wno-error=3Dunused-const-variable -.endif - # GCC 7.1.0 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 70100 +.if ${COMPILER_VERSION} >=3D 70100 CWARNFLAGS+=3D -Wno-error=3Dbool-operation \ -Wno-error=3Ddeprecated \ -Wno-error=3Dexpansion-to-defined \ @@ -182,7 +163,7 @@ CWARNFLAGS+=3D -Wno-error=3Dbool-operation \ .endif # GCC 8.1.0 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 80100 +.if ${COMPILER_VERSION} >=3D 80100 CWARNFLAGS+=3D -Wno-error=3Daggressive-loop-optimizations \ -Wno-error=3Dcast-function-type \ -Wno-error=3Dcatch-value \ @@ -191,9 +172,10 @@ CWARNFLAGS+=3D -Wno-error=3Daggressive-loop-optimizati= ons -Wno-error=3Dsizeof-pointer-memaccess \ -Wno-error=3Dstringop-truncation .endif +.endif # gcc # How to handle FreeBSD custom printf format specifiers. -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 30600 +.if ${COMPILER_TYPE} =3D=3D "clang" FORMAT_EXTENSIONS=3D -D__printf__=3D__freebsd_kprintf__ .else FORMAT_EXTENSIONS=3D -fformat-extensions @@ -223,11 +205,7 @@ CFLAGS+=3D-nobuiltininc -idirafter ${COMPILER_RESOUR= CE_D CLANG_OPT_SMALL=3D -mstack-alignment=3D8 -mllvm -inline-threshold=3D3\ -mllvm -simplifycfg-dup-ret -.if ${COMPILER_VERSION} >=3D 30500 && ${COMPILER_VERSION} < 30700 -CLANG_OPT_SMALL+=3D -mllvm -enable-gvn=3Dfalse -.else CLANG_OPT_SMALL+=3D -mllvm -enable-load-pre=3Dfalse -.endif CFLAGS.clang+=3D -Qunused-arguments # The libc++ headers use c++11 extensions. These are normally silence= d because # they are treated as system headers, but we explicitly disable that w= arning @@ -238,14 +216,8 @@ CXXFLAGS.clang+=3D -Wno-c++11-extensions .if ${MK_SSP} !=3D "no" && \ ${MACHINE_CPUARCH} !=3D "arm" && ${MACHINE_CPUARCH} !=3D "mips" -.if (${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 30500) || \ - (${COMPILER_TYPE} =3D=3D "gcc" && \ - (${COMPILER_VERSION} =3D=3D 40201 || ${COMPILER_VERSION} >=3D 40900)) # Don't use -Wstack-protector as it breaks world with -Werror. SSP_CFLAGS?=3D -fstack-protector-strong -.else -SSP_CFLAGS?=3D -fstack-protector -.endif CFLAGS+=3D ${SSP_CFLAGS} .endif # SSP && !ARM && !MIPS Modified: head/stand/arm/uboot/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/stand/arm/uboot/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/arm/uboot/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -24,7 +24,7 @@ UBLDR_LOADADDR?=3D 0x1000000 # Architecture-specific loader code SRCS=3D start.S conf.c self_reloc.c vers.c -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} > 40201 +.if ${COMPILER_TYPE} =3D=3D "gcc" CWARNFLAGS.self_reloc.c+=3D -Wno-error=3Dmaybe-uninitialized .endif Modified: head/stand/defs.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/stand/defs.mk Tue May 12 14:47:38 2020 (r360963) +++ head/stand/defs.mk Tue May 12 15:22:40 2020 (r360964) @@ -143,11 +143,7 @@ CFLAGS+=3D -fPIC -mno-red-zone # Do not generate movt/movw, because the relocation fixup for them doe= s not # translate to the -Bsymbolic -pie format required by self_reloc() in = loader(8). # Also, the fpu is not available in a standalone environment. -.if ${COMPILER_VERSION} < 30800 -CFLAGS.clang+=3D -mllvm -arm-use-movt=3D0 -.else CFLAGS.clang+=3D -mno-movt -.endif CFLAGS.clang+=3D -mfpu=3Dnone CFLAGS+=3D -fPIC .endif Modified: head/stand/efi/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/stand/efi/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/efi/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -4,16 +4,10 @@ NO_OBJ=3Dt .include -# In-tree GCC does not support __attribute__((ms_abi)), but gcc newer -# than 4.5 supports it. -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D 40500 - SUBDIR.${MK_FDT}+=3D fdt SUBDIR.yes+=3D libefi boot1 gptboot SUBDIR.${MK_FORTH}+=3D loader_4th SUBDIR.${MK_LOADER_LUA}+=3D loader_lua SUBDIR.yes+=3D loader_simp - -.endif # ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D 40500 .include Modified: head/stand/efi/boot1/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/stand/efi/boot1/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/efi/boot1/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -42,10 +42,6 @@ CFLAGS.zfs_module.c+=3D -I${SYSDIR}/cddl/contrib/opens= ol CFLAGS+=3D -DEFI_ZFS_BOOT .endif -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} > 40201 -CWARNFLAGS.self_reloc.c+=3D -Wno-error=3Dmaybe-uninitialized -.endif - CFLAGS+=3D -I${EFIINC} CFLAGS+=3D -I${EFIINCMD} CFLAGS+=3D -I${SYSDIR}/contrib/dev/acpica/include Modified: head/stand/efi/loader/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/stand/efi/loader/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/efi/loader/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -31,10 +31,6 @@ CFLAGS+=3D -DEFI_ZFS_BOOT HAVE_ZFS=3D yes .endif -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} > 40201 -CWARNFLAGS.self_reloc.c+=3D -Wno-error=3Dmaybe-uninitialized -.endif - # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead Modified: head/stand/i386/boot2/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/stand/i386/boot2/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/i386/boot2/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -37,9 +37,6 @@ CFLAGS+=3D-fomit-frame-pointer \ CFLAGS.gcc+=3D -Os \ -fno-asynchronous-unwind-tables \ --param max-inline-insns-single=3D100 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} <=3D 40201 -CFLAGS.gcc+=3D -mno-align-long-strings -.endif CFLAGS.clang+=3D -Oz ${CLANG_OPT_SMALL} Modified: head/stand/i386/isoboot/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/stand/i386/isoboot/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/i386/isoboot/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -32,9 +32,6 @@ CFLAGS+=3D-DBOOTPROG=3D\"isoboot\" \ -Winline -Wno-pointer-sign CFLAGS.gcc+=3D --param max-inline-insns-single=3D100 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} <=3D 40201 -CFLAGS.gcc+=3D -Wno-uninitialized -.endif CFLAGS.clang+=3D -Oz ${CLANG_OPT_SMALL} LD_FLAGS+=3D${LD_FLAGS_BIN} Modified: head/stand/libsa/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/stand/libsa/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/libsa/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -46,11 +46,7 @@ SRCS+=3D subr_boot.c # Do not generate movt/movw, because the relocation fixup for them doe= s not # translate to the -Bsymbolic -pie format required by self_reloc() in = loader(8). # Also, the fpu is not available in a standalone environment. -.if ${COMPILER_VERSION} < 30800 -CFLAGS.clang+=3D -mllvm -arm-use-movt=3D0 -.else CFLAGS.clang+=3D -mno-movt -.endif CFLAGS.clang+=3D -mfpu=3Dnone .PATH: ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins/arm/ Modified: head/sys/conf/Makefile.arm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/conf/Makefile.arm Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/Makefile.arm Tue May 12 15:22:40 2020 (r360964) @@ -44,10 +44,6 @@ CFLAGS.clang +=3D -mfpu=3Dnone .if !empty(DDB_ENABLED) CFLAGS +=3D -funwind-tables -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} < 30500 -# clang < 3.5.0 requires us to tell it to emit assembly with unwind in= formation -CFLAGS +=3D -mllvm -arm-enable-ehabi -.endif .endif # "makeoptions KERNVIRTADDR=3D" is now optional, supply the default valu= e. Modified: head/sys/conf/Makefile.powerpc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/conf/Makefile.powerpc Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/Makefile.powerpc Tue May 12 15:22:40 2020 (r360964) @@ -51,7 +51,7 @@ DPAAWARNFLAGS +=3D \ -Wno-error=3Dincompatible-pointer-types-discards-qualifiers \ -Wno-error=3Dnon-literal-null-conversion \ -Wno-error=3Denum-conversion -.elif "${COMPILER_TYPE}" =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 50200 +.elif "${COMPILER_TYPE}" =3D=3D "gcc" DPAAWARNFLAGS +=3D \ -Wno-error=3Dredundant-decls \ -Wno-error=3Dint-in-bool-context Modified: head/sys/conf/kern.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/conf/kern.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kern.mk Tue May 12 15:22:40 2020 (r360964) @@ -31,19 +31,14 @@ NO_WTAUTOLOGICAL_POINTER_COMPARE=3D -Wno-tautological= -po CWARNEXTRA?=3D -Wno-error-tautological-compare -Wno-error-empty-body \ -Wno-error-parentheses-equality -Wno-error-unused-function \ -Wno-error-pointer-sign -.if ${COMPILER_VERSION} >=3D 30700 CWARNEXTRA+=3D -Wno-error-shift-negative-value -.endif -.if ${COMPILER_VERSION} >=3D 40000 CWARNEXTRA+=3D -Wno-address-of-packed-member -.endif .if ${COMPILER_VERSION} >=3D 100000 NO_WMISLEADING_INDENTATION=3D -Wno-misleading-indentation .endif -.endif +.endif # clang .if ${COMPILER_TYPE} =3D=3D "gcc" -.if ${COMPILER_VERSION} >=3D 40800 # Catch-all for all the things that are in our tree, but for which we'= re # not yet ready for this compiler. NO_WUNUSED_BUT_SET_VARIABLE =3D -Wno-unused-but-set-variable @@ -55,15 +50,13 @@ CWARNEXTRA?=3D -Wno-error=3Daddress \ -Wno-error=3Denum-compare \ -Wno-error=3Dinline \ -Wno-error=3Dmaybe-uninitialized \ + -Wno-error=3Dmisleading-indentation \ + -Wno-error=3Dnonnull-compare \ -Wno-error=3Doverflow \ -Wno-error=3Dsequence-point \ - -Wno-unused-but-set-variable -.if ${COMPILER_VERSION} >=3D 60100 -CWARNEXTRA+=3D -Wno-error=3Dmisleading-indentation \ - -Wno-error=3Dnonnull-compare \ -Wno-error=3Dshift-overflow \ - -Wno-error=3Dtautological-compare -.endif + -Wno-error=3Dtautological-compare \ + -Wno-unused-but-set-variable .if ${COMPILER_VERSION} >=3D 70100 CWARNEXTRA+=3D -Wno-error=3Dstringop-overflow .endif @@ -76,15 +69,7 @@ CWARNEXTRA+=3D -Wno-error=3Dpacked-not-aligned .if ${COMPILER_VERSION} >=3D 90100 CWARNEXTRA+=3D -Wno-address-of-packed-member .endif -.else -# For gcc 4.2, eliminate the too-often-wrong warnings about uninitiali= zed vars. -CWARNEXTRA?=3D -Wno-uninitialized -# GCC 4.2 doesn't have -Wno-error=3Dcast-qual, so just disable the warni= ng for -# the few files that are already known to generate cast-qual warnings. -NO_WCAST_QUAL=3D -Wno-cast-qual -NO_WNONNULL=3D -Wno-nonnull -.endif -.endif +.endif # gcc # This warning is utter nonsense CWARNFLAGS+=3D -Wno-format-zero-length @@ -93,7 +78,7 @@ CWARNFLAGS+=3D -Wno-format-zero-length # to be disabled. WARNING: format checking is disabled in this case. .if ${MK_FORMAT_EXTENSIONS} =3D=3D "no" FORMAT_EXTENSIONS=3D -Wno-format -.elif ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 30600 +.elif ${COMPILER_TYPE} =3D=3D "clang" FORMAT_EXTENSIONS=3D -D__printf__=3D__freebsd_kprintf__ .else FORMAT_EXTENSIONS=3D -fformat-extensions @@ -201,12 +186,7 @@ CFLAGS.gcc+=3D -mno-spe # DDB happy. ELFv2, if available, has some other efficiency benefits. # .if ${MACHINE_ARCH} =3D=3D "powerpc64" -.if ${COMPILER_VERSION} >=3D 40900 -CFLAGS.gcc+=3D -mabi=3Delfv2 -.else -CFLAGS.gcc+=3D -mcall-aixdesc -.endif -CFLAGS.clang+=3D -mabi=3Delfv2 +CFLAGS+=3D -mabi=3Delfv2 .endif # Modified: head/sys/conf/kern.post.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/conf/kern.post.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kern.post.mk Tue May 12 15:22:40 2020 (r360964) @@ -345,10 +345,7 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .depend: .PRECIOUS ${SRCS} -.if ${COMPILER_TYPE} =3D=3D "clang" || \ - (${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 60000) _MAP_DEBUG_PREFIX=3D yes -.endif _ILINKS=3D machine .if ${MACHINE} !=3D ${MACHINE_CPUARCH} && ${MACHINE} !=3D "arm64" Modified: head/sys/conf/kern.pre.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/conf/kern.pre.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kern.pre.mk Tue May 12 15:22:40 2020 (r360964) @@ -93,11 +93,7 @@ CFLAGS.gcc+=3D -fms-extensions .if defined(CFLAGS_ARCH_PARAMS) CFLAGS.gcc+=3D${CFLAGS_ARCH_PARAMS} .endif -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 50000 -WERROR?=3D -Wno-error -.else WERROR?=3D -Werror -.endif # The following should be removed no earlier than LLVM11 being importe= d into the # tree, to ensure we don't regress the build. LLVM11 and GCC10 will s= witch the # default over to -fno-common, making this redundant. Modified: head/sys/conf/kmod.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/conf/kmod.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kmod.mk Tue May 12 15:22:40 2020 (r360964) @@ -88,11 +88,7 @@ __KLD_SHARED=3Dno .if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing) CFLAGS+=3D -fno-strict-aliasing .endif -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 50000 -WERROR?=3D -Wno-error -.else WERROR?=3D -Werror -.endif LINUXKPI_GENSRCS+=3D \ bus_if.h \ @@ -160,11 +156,7 @@ CFLAGS+=3D -fPIC # Temporary workaround for PR 196407, which contains the fascinating d= etails. # Don't allow clang to use fpu instructions or registers in kernel mod= ules. .if ${MACHINE_CPUARCH} =3D=3D arm -.if ${COMPILER_VERSION} < 30800 -CFLAGS.clang+=3D -mllvm -arm-use-movt=3D0 -.else CFLAGS.clang+=3D -mno-movt -.endif CFLAGS.clang+=3D -mfpu=3Dnone CFLAGS+=3D -funwind-tables .endif @@ -283,10 +275,7 @@ ${FULLPROG}: ${OBJS} ${OBJCOPY} --strip-debug ${.TARGET} .endif -.if ${COMPILER_TYPE} =3D=3D "clang" || \ - (${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 60000) _MAP_DEBUG_PREFIX=3D yes -.endif _ILINKS=3Dmachine .if ${MACHINE_CPUARCH} =3D=3D "i386" || ${MACHINE_CPUARCH} =3D=3D "amd64" Modified: head/sys/modules/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/sys/modules/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/sys/modules/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -620,9 +620,7 @@ _aac=3D aac _aacraid=3D aacraid _acpi=3D acpi .if ${MK_CRYPT} !=3D "no" || defined(ALL_MODULES) -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} > 40201 _aesni=3D aesni -.endif .endif _amd_ecc_inject=3Damd_ecc_inject _amdsbwd=3D amdsbwd Modified: head/usr.sbin/acpi/acpidb/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/usr.sbin/acpi/acpidb/Makefile Tue May 12 14:47:38 2020 (r36096= 3) +++ head/usr.sbin/acpi/acpidb/Makefile Tue May 12 15:22:40 2020 (r36096= 4) @@ -87,6 +87,6 @@ LIBADD=3D pthread # integer to pointer, which is a GNU extension. # # Turn off the warning, because this is in contributed code. -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 60000 +.if ${COMPILER_TYPE} =3D=3D "clang" CWARNFLAGS+=3D -Wno-null-pointer-arithmetic .endif Modified: head/usr.sbin/trpt/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/usr.sbin/trpt/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/usr.sbin/trpt/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -8,18 +8,12 @@ MAN=3D trpt.8 BINGRP=3D kmem BINMODE=3D 2555 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 50000 -WARNS?=3D 4 -.endif - .if ${MK_INET6_SUPPORT} !=3D "no" CFLAGS+=3D -DINET6 .endif .include -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D 50000 # Several included system headers tickle this warning in ways that are # difficult to work around in this program. CFLAGS+=3D -Wno-missing-variable-declarations -.endif Modified: head/usr.sbin/zic/zic/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/usr.sbin/zic/zic/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/usr.sbin/zic/zic/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -15,7 +15,7 @@ CFLAGS+=3D -I${.CURDIR:H} -I${SRCTOP}/contrib/tzcode/st= d WARNS?=3D 2 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 50300 +.if ${COMPILER_TYPE} =3D=3D "gcc" CWARNFLAGS+=3D -Wno-error=3Dstrict-overflow .endif From owner-svn-src-head@freebsd.org Tue May 12 18:39:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBD422F76CD; Tue, 12 May 2020 18:39:30 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M66B5LjSz4dBx; Tue, 12 May 2020 18:39:30 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f174.google.com with SMTP id c12so18136362oic.1; Tue, 12 May 2020 11:39:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=voC8zsRwwPTD/XFCEk2l/IZWi9YPkIXrh1QpTg+AqN0=; b=RSv/0PwHZ8fdxLAbeEEdcBAncrTpO5c0YoWSm90Jj7By1rG00xTRkvkBHbv0B2dc1t LsNKYfiVv/IrTAhG0mHhheFoCYYhlSLpuybiYRciTgEOGrpncpf1FBaLaytbkW1UKyH7 kMPr+HV3093PYKFEHIG0pUaE3/AcojhLXSDoyNucj8RgCKVwDceN9HobKgI5WzLxF2xf mpjnpHxtm5CthyhK6HXO7q1V8lr9llIOudMCyUYTyWbDcxOx656iF92MlU47FcztnQg3 42EsalXTk9iGkkDEblDhVEXGKU1oj5YKauWeNu+O7r4aWIN5FJY1jIJYFkQ9bblHIZzx VBKg== X-Gm-Message-State: AGi0PuaNYQIBxj43rPKaMBuy7L68SoqVN1NDBKO8X5n3s8Ht5wbEQAKt 9tX4kA0lcCIcyYzCPc72wUEGpKKn X-Google-Smtp-Source: APiQypIwPmW5K4bs0eU12+gj4vJglY2Z8q6JuFAGJ3Jdrmr8MkJZ2jIYSO9ehvTNbG14YIlnLnTIHg== X-Received: by 2002:aca:b5d5:: with SMTP id e204mr24819250oif.108.1589308768896; Tue, 12 May 2020 11:39:28 -0700 (PDT) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com. [209.85.167.182]) by smtp.gmail.com with ESMTPSA id g94sm3626183otg.74.2020.05.12.11.39.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 May 2020 11:39:28 -0700 (PDT) Received: by mail-oi1-f182.google.com with SMTP id i13so19132184oie.9; Tue, 12 May 2020 11:39:28 -0700 (PDT) X-Received: by 2002:aca:4ac3:: with SMTP id x186mr15767812oia.81.1589308768349; Tue, 12 May 2020 11:39:28 -0700 (PDT) MIME-Version: 1.0 References: <202005121812.04CICKdo013440@repo.freebsd.org> In-Reply-To: <202005121812.04CICKdo013440@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 12 May 2020 11:39:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r360983 - head/include To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49M66B5LjSz4dBx X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 18:39:31 -0000 Why not just use _Bool and leave the compatibility definition only for C++ (#define _Bool bool)? On Tue, May 12, 2020 at 11:12 AM Konstantin Belousov wrote: > > Author: kib > Date: Tue May 12 18:12:20 2020 > New Revision: 360983 > URL: https://svnweb.freebsd.org/changeset/base/360983 > > Log: > Clear namespace pollution in include/malloc_np.h > > Do not include stdbool.h, it makes the header incompatible with some > third-party code that typedefs bool manually. > Remove inclusion of strings.h, which typically conflicts with the use > of symbol 'index'. > Separate inclusion of sys/cdefs.h is not needed because sys/types.h > already handles that. > > Exp-run by: antoine (PR 245366) > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D24297 > > Modified: > head/include/malloc_np.h > > Modified: head/include/malloc_np.h > ============================================================================== > --- head/include/malloc_np.h Tue May 12 17:18:44 2020 (r360982) > +++ head/include/malloc_np.h Tue May 12 18:12:20 2020 (r360983) > @@ -33,29 +33,33 @@ > > #ifndef _MALLOC_NP_H_ > #define _MALLOC_NP_H_ > -#include > + > #include > -#include > -#include > > +#ifdef __cplusplus > +#define __MyBool bool > +#else > +#define __MyBool _Bool > +#endif > + > __BEGIN_DECLS > typedef struct extent_hooks_s extent_hooks_t; > -typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, bool *, > - bool *, unsigned); > -typedef bool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, bool, > +typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, > + __MyBool *, __MyBool *, unsigned); > +typedef __MyBool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, __MyBool, > unsigned); > -typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, bool, > +typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, __MyBool, > unsigned); > -typedef bool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t, size_t, > - unsigned); > -typedef bool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t, > +typedef __MyBool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t, > size_t, unsigned); > -typedef bool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t, > +typedef __MyBool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t, > + size_t, unsigned); > +typedef __MyBool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t, > unsigned); > -typedef bool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t, > - bool, unsigned); > -typedef bool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t, > - bool, unsigned); > +typedef __MyBool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t, > + __MyBool, unsigned); > +typedef __MyBool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t, > + __MyBool, unsigned); > struct extent_hooks_s { > extent_alloc_t *alloc; > extent_dalloc_t *dalloc; > @@ -119,5 +123,7 @@ void __dallocx(void *ptr, int flags); > void __sdallocx(void *ptr, size_t size, int flags); > size_t __nallocx(size_t size, int flags); > __END_DECLS > + > +#undef __MyBool > > #endif /* _MALLOC_NP_H_ */ From owner-svn-src-head@freebsd.org Tue May 12 18:58:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C0522F7E50; Tue, 12 May 2020 18:58:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49M6WZ2NTPz4fb6; Tue, 12 May 2020 18:58:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04CIvs0O079571 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 12 May 2020 21:57:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04CIvs0O079571 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04CIvsxM079570; Tue, 12 May 2020 21:57:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 12 May 2020 21:57:54 +0300 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r360983 - head/include Message-ID: <20200512185754.GL68906@kib.kiev.ua> References: <202005121812.04CICKdo013440@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 49M6WZ2NTPz4fb6 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 18:58:02 -0000 On Tue, May 12, 2020 at 11:39:17AM -0700, Conrad Meyer wrote: > Why not just use _Bool and leave the compatibility definition only for > C++ (#define _Bool bool)? There was such version in interim, see https://reviews.freebsd.org/D24297?vs=on&id=70906#toc Exp-run reported issues with this variant, please look at the bug trail yourself. From owner-svn-src-head@freebsd.org Tue May 12 21:00:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BD192DBFA8; Tue, 12 May 2020 21:00:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M9DZ0t1nz3yNL; Tue, 12 May 2020 21:00:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1936BE3FE; Tue, 12 May 2020 21:00:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CL0DMA013051; Tue, 12 May 2020 21:00:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CL0D4i013050; Tue, 12 May 2020 21:00:13 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202005122100.04CL0D4i013050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 12 May 2020 21:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360990 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 360990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 21:00:14 -0000 Author: andrew Date: Tue May 12 21:00:13 2020 New Revision: 360990 URL: https://svnweb.freebsd.org/changeset/base/360990 Log: Fix the name reported when the core supports a 64-bit CCIDX Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Tue May 12 20:05:34 2020 (r360989) +++ head/sys/arm64/arm64/identcpu.c Tue May 12 21:00:13 2020 (r360990) @@ -601,7 +601,7 @@ static struct mrs_field_value id_aa64mmfr2_nv[] = { static struct mrs_field_value id_aa64mmfr2_ccidx[] = { MRS_FIELD_VALUE(ID_AA64MMFR2_CCIDX_32, "32bit CCIDX"), - MRS_FIELD_VALUE(ID_AA64MMFR2_CCIDX_64, "32bit CCIDX"), + MRS_FIELD_VALUE(ID_AA64MMFR2_CCIDX_64, "64bit CCIDX"), MRS_FIELD_VALUE_END, }; From owner-svn-src-head@freebsd.org Tue May 12 21:59:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48AFA2DD489; Tue, 12 May 2020 21:59:23 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MBXq1FKLz42NN; Tue, 12 May 2020 21:59:23 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21985EFFF; Tue, 12 May 2020 21:59:23 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CLxMow049214; Tue, 12 May 2020 21:59:22 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CLxMZZ049210; Tue, 12 May 2020 21:59:22 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <202005122159.04CLxMZZ049210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 12 May 2020 21:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360992 - head/bin/sh/tests/parser X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh/tests/parser X-SVN-Commit-Revision: 360992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 21:59:23 -0000 Author: jilles Date: Tue May 12 21:59:21 2020 New Revision: 360992 URL: https://svnweb.freebsd.org/changeset/base/360992 Log: sh/tests: Test some obscure cases with aliasing keywords Added: head/bin/sh/tests/parser/alias19.0 (contents, props changed) head/bin/sh/tests/parser/alias19.0.stdout (contents, props changed) head/bin/sh/tests/parser/alias20.0 (contents, props changed) head/bin/sh/tests/parser/alias20.0.stdout (contents, props changed) Modified: head/bin/sh/tests/parser/Makefile Modified: head/bin/sh/tests/parser/Makefile ============================================================================== --- head/bin/sh/tests/parser/Makefile Tue May 12 21:51:56 2020 (r360991) +++ head/bin/sh/tests/parser/Makefile Tue May 12 21:59:21 2020 (r360992) @@ -25,6 +25,8 @@ ${PACKAGE}FILES+= alias15.0 alias15.0.stdout ${PACKAGE}FILES+= alias16.0 ${PACKAGE}FILES+= alias17.0 ${PACKAGE}FILES+= alias18.0 +${PACKAGE}FILES+= alias19.0 alias19.0.stdout +${PACKAGE}FILES+= alias20.0 alias20.0.stdout ${PACKAGE}FILES+= and-pipe-not.0 ${PACKAGE}FILES+= case1.0 ${PACKAGE}FILES+= case2.0 Added: head/bin/sh/tests/parser/alias19.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parser/alias19.0 Tue May 12 21:59:21 2020 (r360992) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +alias begin={ end=} +begin +cat < Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B174F2DE6C4; Tue, 12 May 2020 22:16:10 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49MBw95W5rz43jv; Tue, 12 May 2020 22:16:09 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 8AA773C0199; Tue, 12 May 2020 22:16:03 +0000 (UTC) Date: Tue, 12 May 2020 22:16:03 +0000 From: Brooks Davis To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r360833 - head Message-ID: <20200512221603.GB60902@spindle.one-eyed-alien.net> References: <202005090201.04921Tpf028388@repo.freebsd.org> <20200511181027.GA60902@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vGgW1X5XWziG23Ko" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 49MBw95W5rz43jv X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-6.53 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; IP_SCORE(-3.63)[ip: (-9.55), ipnet: 199.48.128.0/22(-4.77), asn: 36236(-3.79), country: US(-0.05)]; TO_DN_ALL(0.00)[]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 22:16:10 -0000 --vGgW1X5XWziG23Ko Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 11, 2020 at 01:45:14PM -0500, Kyle Evans wrote: > On Mon, May 11, 2020 at 1:10 PM Brooks Davis wrote: > > > > On Sat, May 09, 2020 at 02:01:29AM +0000, Kyle Evans wrote: > > > Author: kevans > > > Date: Sat May 9 02:01:29 2020 > > > New Revision: 360833 > > > URL: https://svnweb.freebsd.org/changeset/base/360833 > > > > > > Log: > > > installworld: attempt a certctl rehash at the tail end > > > > > > This can be run as root or normal user with no problem; if they had= n't > > > twisted the WITHOUT_CAROOT knob, we'll attempt to use the host cert= ctl to > > > rehash the DESTDIR. This would allow one to build systems WITHOUT_O= PENSSL + > > > WITH_CAROOT with a populated /etc/ssl that they can then use with an > > > appropriate *ssl from somewhere else. > > > > > > Cross-builds are fine because this will always use the host certctl= , or just > > > nag if it's missing and it wasn't a WITHOUT_CAROOT build. > > > > > > MFC after: 1 week > > > Differential Revision: https://reviews.freebsd.org/D24641 > > > > > > Modified: > > > head/Makefile.inc1 > > > > > > Modified: head/Makefile.inc1 > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/Makefile.inc1 Sat May 9 01:48:08 2020 (r36083= 2) > > > +++ head/Makefile.inc1 Sat May 9 02:01:29 2020 (r36083= 3) > > > @@ -1403,6 +1403,16 @@ distributeworld installworld stageworld: _inst= allcheck > > > ${DESTDIR}/${DISTDIR}/${dist}.debug.meta > > > .endfor > > > .endif > > > +.elif make(installworld) && ${MK_CAROOT} !=3D "no" > > > + # We could make certctl a bootstrap tool, but it requires OpenS= SL and > > > + # friends, which we likely don't want. We'll rehash on a best-= effort > > > + # basis, otherwise we'll just mention that we're not doing it t= o raise > > > + # awareness. > > > + @if which certctl>/dev/null; then \ > > > + certctl rehash \ > > > > Does this update METALOG with the added links? > > > > It seems a little weird to rely on DESTDIR from the environment. > > > > In general I'm not enthusiastic about additions to installworld that do > > anything other than copying files, creating links, etc in simple ways. >=20 > I will happily back this out if I can get some qualified eyes to > review/improve it. It does not update METALOG, and it probably should. > Agreed on DESTDIR. As for point #3, I guess we can continue spreading > `certctl rehash` all over the tree in various points that may need it; > the release(7) scripts will need to be done if we don't do it here at > a minimum, and I haven't put much thought into it beyond that. I'm not in a rush to back this out given that it's solving a real problem, but lets talk about improvements. I kind of feel like this belongs in distribution (which I think would deal with release scripts) or in etcupdate/mergemaster, but I'm not sure either of those are correct. I'd be happy to review changes to update the METALOG (I guess we'd extend certctl with an option to do that?) I think that's the most important things because we really should be routinely validating that DESTDIR only contains things in the METALOG. A quick and dirty fix for the DESTDIR weirdness might be adding "env DESTDIR=3D${DESTDIR}" so it's explicit. > The close-to-infuriating part of the caroot project has been that it's > incredibly hard to get almost anyone else (with some obvious > exceptions) to do more than informal discussion on the matter; actual > review, in particular, is difficult to obtain. Thanks for doing all this work! I'm afraid the whole thing gives me third-rail vibes (not the idea or the implementation, but the potential for things to go wrong) so I've veered away from the larger reviews. :( -- Brooks --vGgW1X5XWziG23Ko Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJeuyAiAAoJEKzQXbSebgfAg4gH/0IcLmkOGVKkuwDyKYJs3cs2 M6NCZQBX2WGXy2+/pJzS9DhxXIT1c5IAKUbUZT9MADF5PmWSastgVI07iBj9JIgP 1JdQv7cJi2+f00a+dFWejmaJVvLrHAgwPbY1AXnbMBckb1UGn3CIxSccbs8LiuQ7 oYAKzO0Gr5l9kcqtCET90uJAEESk1Li8QE4SlvPQbO2weIXJYqDAeC6wVJt2kkAq 6M6dmHcF20BpmteCq1Lg17aGtk6AEAGl2GZ/xR0Gx0UgEP89/ydhL5w/tl7qFpl0 lDEUMcS0YlNJUQuf45Em+i+NbRoday9dnT9jc0NRyzDnlSb4FlKY6FQL/NuaRaQ= =Opt9 -----END PGP SIGNATURE----- --vGgW1X5XWziG23Ko-- From owner-svn-src-head@freebsd.org Tue May 12 22:44:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5E2C2DFD03; Tue, 12 May 2020 22:44:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MCYH4sCcz4BYT; Tue, 12 May 2020 22:44:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1C36F9AE; Tue, 12 May 2020 22:44:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CMipZX086959; Tue, 12 May 2020 22:44:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CMipP3086958; Tue, 12 May 2020 22:44:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202005122244.04CMipP3086958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 12 May 2020 22:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360993 - head/usr.bin/uname X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/uname X-SVN-Commit-Revision: 360993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 22:44:51 -0000 Author: imp Date: Tue May 12 22:44:51 2020 New Revision: 360993 URL: https://svnweb.freebsd.org/changeset/base/360993 Log: Refine the history of uname. It appeared in 4.4BSD. It was not in v7 unix. It was one of the additions in PWB, and appeared in System III and later commercial versions of Unix. The different args to uname weren't aded until System III. Add a quick note to note the late entry into the BSD fork of Unix since PWB otherwise implies a pre-fork date. Modified: head/usr.bin/uname/uname.1 Modified: head/usr.bin/uname/uname.1 ============================================================================== --- head/usr.bin/uname/uname.1 Tue May 12 21:59:21 2020 (r360992) +++ head/usr.bin/uname/uname.1 Tue May 12 22:44:51 2020 (r360993) @@ -146,7 +146,11 @@ specification. .Sh HISTORY The .Nm -command appeared in PWB UNIX. +command appeared in PWB UNIX 1.0, however +.Bx 4.4 +was the first Berkeley release with the +.Nm +command. .Pp The .Fl K From owner-svn-src-head@freebsd.org Tue May 12 23:46:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BAF32E113F; Tue, 12 May 2020 23:46:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MDws28Z9z4FL3; Tue, 12 May 2020 23:46:53 +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 4010B18508; Tue, 12 May 2020 23:46:53 +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 04CNkrJo024073; Tue, 12 May 2020 23:46:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CNkr6c024072; Tue, 12 May 2020 23:46:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202005122346.04CNkr6c024072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 12 May 2020 23:46:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360995 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 360995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 23:46:53 -0000 Author: imp Date: Tue May 12 23:46:52 2020 New Revision: 360995 URL: https://svnweb.freebsd.org/changeset/base/360995 Log: Kill trailing newline while I'm here... Modified: head/sys/net/route/route_ddb.c Modified: head/sys/net/route/route_ddb.c ============================================================================== --- head/sys/net/route/route_ddb.c Tue May 12 23:33:03 2020 (r360994) +++ head/sys/net/route/route_ddb.c Tue May 12 23:46:52 2020 (r360995) @@ -268,4 +268,3 @@ usage: " Currently accepts only IPv4 and IPv6 addresses\n"); db_skip_to_eol(); } - From owner-svn-src-head@freebsd.org Wed May 13 00:05:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6428E2E190D; Wed, 13 May 2020 00:05:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MFL11ymGz4GHF; Wed, 13 May 2020 00:05:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EB3A188E3; Wed, 13 May 2020 00:05:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04D05D5i036474; Wed, 13 May 2020 00:05:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D05CO8036468; Wed, 13 May 2020 00:05:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005130005.04D05CO8036468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 13 May 2020 00:05:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360998 - in head/sys/dev/ath: . ath_rate/amrr ath_rate/onoe ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: in head/sys/dev/ath: . ath_rate/amrr ath_rate/onoe ath_rate/sample X-SVN-Commit-Revision: 360998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 00:05:13 -0000 Author: adrian Date: Wed May 13 00:05:11 2020 New Revision: 360998 URL: https://svnweb.freebsd.org/changeset/base/360998 Log: [ath] [ath_rate] Add some extra data into the rate control lookup. Right now (well, since I did this in 2011/2012) the rate control code makes some super bad choices for 11n aggregates/rates, and it tracks statistics even more questionably. It's been long enough and I'm now trying to use it again daily, so let's start by: * telling the rate control code if it's an aggregate or not; * being clearer about the TID - yes it can be extracted from the ath_buf but this way it can be overridden by the caller without changing the TID itself. (This is for doing experiments with voice/video QoS at some point..) * Return an optional field to limit how long the aggregate is in microseconds. Right now the rate control code supplies a rate table and the ath aggr form code will look at the rate table and limit the aggregate size to 4ms at the slowest rate. Yeah, this is pretty terrible. * Add some more TODO comments around handling txpower, rate and handling filtered frames status so if I continue to have spoons for this I can go poke at it. Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c head/sys/dev/ath/ath_rate/onoe/onoe.c head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athrate.h Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c ============================================================================== --- head/sys/dev/ath/ath_rate/amrr/amrr.c Wed May 13 00:03:39 2020 (r360997) +++ head/sys/dev/ath/ath_rate/amrr/amrr.c Wed May 13 00:05:11 2020 (r360998) @@ -104,8 +104,8 @@ ath_rate_node_cleanup(struct ath_softc *sc, struct ath void ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, - int shortPreamble, size_t frameLen, - u_int8_t *rix, int *try0, u_int8_t *txrate) + int shortPreamble, size_t frameLen, int tid, bool is_aggr, + u_int8_t *rix, int *try0, u_int8_t *txrate, int *maxdur) { struct amrr_node *amn = ATH_NODE_AMRR(an); @@ -115,6 +115,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod *txrate = amn->amn_tx_rate0sp; else *txrate = amn->amn_tx_rate0; + maxdur = -1; } /* Modified: head/sys/dev/ath/ath_rate/onoe/onoe.c ============================================================================== --- head/sys/dev/ath/ath_rate/onoe/onoe.c Wed May 13 00:03:39 2020 (r360997) +++ head/sys/dev/ath/ath_rate/onoe/onoe.c Wed May 13 00:05:11 2020 (r360998) @@ -112,8 +112,8 @@ ath_rate_node_cleanup(struct ath_softc *sc, struct ath void ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, - int shortPreamble, size_t frameLen, - u_int8_t *rix, int *try0, u_int8_t *txrate) + int shortPreamble, size_t frameLen, int tid, bool is_aggr, + u_int8_t *rix, int *try0, u_int8_t *txrate, int *maxdur) { struct onoe_node *on = ATH_NODE_ONOE(an); @@ -123,6 +123,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod *txrate = on->on_tx_rate0sp; else *txrate = on->on_tx_rate0; + *maxdur = -1; } /* Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Wed May 13 00:03:39 2020 (r360997) +++ head/sys/dev/ath/ath_rate/sample/sample.c Wed May 13 00:05:11 2020 (r360998) @@ -482,8 +482,9 @@ ath_rate_pick_seed_rate_ht(struct ath_softc *sc, struc void ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, - int shortPreamble, size_t frameLen, - u_int8_t *rix0, int *try0, u_int8_t *txrate) + int shortPreamble, size_t frameLen, int tid, + bool is_aggr, u_int8_t *rix0, int *try0, + u_int8_t *txrate, int *maxdur) { #define DOT11RATE(ix) (rt->info[ix].dot11Rate & IEEE80211_RATE_VAL) #define MCS(ix) (rt->info[ix].dot11Rate | IEEE80211_RATE_MCS) @@ -497,6 +498,10 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod unsigned average_tx_time; ath_rate_update_static_rix(sc, &an->an_node); + + /* For now don't take TID, is_aggr into account */ + /* Also for now don't calculate a max duration; that'll come later */ + *maxdur = -1; if (sn->currates != sc->sc_currates) { device_printf(sc->sc_dev, "%s: currates != sc_currates!\n", Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed May 13 00:03:39 2020 (r360997) +++ head/sys/dev/ath/if_ath.c Wed May 13 00:05:11 2020 (r360998) @@ -4312,6 +4312,11 @@ ath_tx_update_ratectrl(struct ath_softc *sc, struct ie an = ATH_NODE(ni); ATH_NODE_UNLOCK_ASSERT(an); + /* + * XXX TODO: teach the rate control about TXERR_FILT and + * see about handling it (eg see how many attempts were + * made before it got filtered and account for that.) + */ if ((ts->ts_status & HAL_TXERR_FILT) == 0) { ATH_NODE_LOCK(an); ath_rate_tx_complete(sc, an, rc, ts, frmlen, nframes, nbad); @@ -4355,6 +4360,9 @@ ath_tx_process_buf_completion(struct ath_softc *sc, st /* * XXX assume this isn't an aggregate * frame. + * + * XXX TODO: also do this for filtered frames? + * Once rate control knows about them? */ ath_tx_update_ratectrl(sc, ni, bf->bf_state.bfs_rc, ts, Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Wed May 13 00:03:39 2020 (r360997) +++ head/sys/dev/ath/if_ath_tx.c Wed May 13 00:05:11 2020 (r360998) @@ -1376,10 +1376,12 @@ ath_tx_setds(struct ath_softc *sc, struct ath_buf *bf) * as they may depend upon the rate chosen. */ static void -ath_tx_do_ratelookup(struct ath_softc *sc, struct ath_buf *bf) +ath_tx_do_ratelookup(struct ath_softc *sc, struct ath_buf *bf, int tid, + bool is_aggr) { uint8_t rate, rix; int try0; + int maxdur; // Note: Unused for now if (! bf->bf_state.bfs_doratelookup) return; @@ -1389,7 +1391,7 @@ ath_tx_do_ratelookup(struct ath_softc *sc, struct ath_ ATH_NODE_LOCK(ATH_NODE(bf->bf_node)); ath_rate_findrate(sc, ATH_NODE(bf->bf_node), bf->bf_state.bfs_shpream, - bf->bf_state.bfs_pktlen, &rix, &try0, &rate); + bf->bf_state.bfs_pktlen, tid, is_aggr, &rix, &try0, &rate, &maxdur); /* In case MRR is disabled, make sure rc[0] is setup correctly */ bf->bf_state.bfs_rc[0].rix = rix; @@ -1519,7 +1521,7 @@ ath_tx_xmit_normal(struct ath_softc *sc, struct ath_tx bf->bf_state.bfs_txflags |= HAL_TXDESC_CLRDMASK; /* Setup the descriptor before handoff */ - ath_tx_do_ratelookup(sc, bf); + ath_tx_do_ratelookup(sc, bf, tid->tid, false); ath_tx_calc_duration(sc, bf); ath_tx_calc_protection(sc, bf); ath_tx_set_rtscts(sc, bf); @@ -3094,7 +3096,7 @@ ath_tx_xmit_aggr(struct ath_softc *sc, struct ath_node ath_tx_update_clrdmask(sc, tid, bf); /* Direct dispatch to hardware */ - ath_tx_do_ratelookup(sc, bf); + ath_tx_do_ratelookup(sc, bf, tid->tid, false); ath_tx_calc_duration(sc, bf); ath_tx_calc_protection(sc, bf); ath_tx_set_rtscts(sc, bf); @@ -4689,6 +4691,8 @@ ath_tx_comp_aggr_error(struct ath_softc *sc, struct at * * XXX use the length in the first frame in the series; * XXX just so things are consistent for now. + * + * XXX TODO: need to signal this is a large frame no matter what... */ ath_tx_update_ratectrl(sc, ni, bf_first->bf_state.bfs_rc, &bf_first->bf_status.ds_txstat, @@ -5088,9 +5092,11 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath * Now we know how many frames were bad, call the rate * control code. */ - if (fail == 0) + if (fail == 0) { + /* XXX TODO: what's pktlen here? */ ath_tx_update_ratectrl(sc, ni, rc, &ts, pktlen, nframes, nbad); + } /* * send bar if we dropped any frames @@ -5429,7 +5435,7 @@ ath_tx_tid_hw_queue_aggr(struct ath_softc *sc, struct /* Update CLRDMASK just before this frame is queued */ ath_tx_update_clrdmask(sc, tid, bf); - ath_tx_do_ratelookup(sc, bf); + ath_tx_do_ratelookup(sc, bf, tid->tid, false); ath_tx_calc_duration(sc, bf); ath_tx_calc_protection(sc, bf); ath_tx_set_rtscts(sc, bf); @@ -5453,7 +5459,7 @@ ath_tx_tid_hw_queue_aggr(struct ath_softc *sc, struct * really "do" aggregate lookups, so it only considers * the size of the first frame. */ - ath_tx_do_ratelookup(sc, bf); + ath_tx_do_ratelookup(sc, bf, tid->tid, true); bf->bf_state.bfs_rc[3].rix = 0; bf->bf_state.bfs_rc[3].tries = 0; @@ -5644,7 +5650,7 @@ ath_tx_tid_hw_queue_norm(struct ath_softc *sc, struct ath_tx_update_clrdmask(sc, tid, bf); /* Program descriptors + rate control */ - ath_tx_do_ratelookup(sc, bf); + ath_tx_do_ratelookup(sc, bf, tid->tid, false); ath_tx_calc_duration(sc, bf); ath_tx_calc_protection(sc, bf); ath_tx_set_rtscts(sc, bf); Modified: head/sys/dev/ath/if_athrate.h ============================================================================== --- head/sys/dev/ath/if_athrate.h Wed May 13 00:03:39 2020 (r360997) +++ head/sys/dev/ath/if_athrate.h Wed May 13 00:05:11 2020 (r360998) @@ -132,10 +132,15 @@ void ath_rate_getxtxrates(struct ath_softc *sc, struct * is to be setup then try0 should contain a value other than ATH_TXMATRY * and ath_rate_setupxtxdesc will be called after deciding if the frame * can be transmitted with multi-rate retry. + * + * maxdur is an optional return value (or -1 if not set) that defines + * the maximum frame duration in microseconds. This allows the rate + * control selection to override the maximum duration (normally 4ms) + * that the packet aggregation logic makes. */ void ath_rate_findrate(struct ath_softc *, struct ath_node *, - int shortPreamble, size_t frameLen, - u_int8_t *rix, int *try0, u_int8_t *txrate); + int shortPreamble, size_t frameLen, int tid, bool is_aggr, + u_int8_t *rix, int *try0, u_int8_t *txrate, int *maxdur); /* * Setup any extended (multi-rate) descriptor state for a data packet. * The rate index returned by ath_rate_findrate is passed back in. From owner-svn-src-head@freebsd.org Wed May 13 00:18:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D32422E1E9F; Wed, 13 May 2020 00:18:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MFdc5GG8z4H2F; Wed, 13 May 2020 00:18:44 +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 AFEE118B39; Wed, 13 May 2020 00:18:44 +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 04D0IiXh043026; Wed, 13 May 2020 00:18:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D0Iipa043025; Wed, 13 May 2020 00:18:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202005130018.04D0Iipa043025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 May 2020 00:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360999 - head/sys/cam/ata X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/ata X-SVN-Commit-Revision: 360999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 00:18:44 -0000 Author: imp Date: Wed May 13 00:18:44 2020 New Revision: 360999 URL: https://svnweb.freebsd.org/changeset/base/360999 Log: Make the ata probe* and xpt* routines aprobe* and axpt* respectively. Often, in traiging core files, one only has a traceback of where a panic occurred. We have probe* and xpt* routines that live in both the scsi and ata layers with identical names. To make one or the other stand out, prefix all the probe and xpt routines in ata with an 'a'. I've left the scsi ones alone since they were there first and are more numerous. I also rejected using #define to do this as being too confusing. I chose this method because the CAM name for the probe device was already 'aprobe'. Normally, this doesn't matter because file scope protects one from interfering with the other. However, due to the indirect nature of CAM's state machine, you don't know if the following traceback is SCSI or ATA: xpt_done probedone xpt_done_process xpt_done_td fork_exit nvme and mmc already have unique names. MFC: 1 week Differential revision: https://reviews.freebsd.org/D24825 Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Wed May 13 00:05:11 2020 (r360998) +++ head/sys/cam/ata/ata_xpt.c Wed May 13 00:18:44 2020 (r360999) @@ -71,16 +71,16 @@ struct ata_quirk_entry { u_int maxtags; }; -static periph_init_t probe_periph_init; +static periph_init_t aprobe_periph_init; -static struct periph_driver probe_driver = +static struct periph_driver aprobe_driver = { - probe_periph_init, "aprobe", - TAILQ_HEAD_INITIALIZER(probe_driver.units), /* generation */ 0, + aprobe_periph_init, "aprobe", + TAILQ_HEAD_INITIALIZER(aprobe_driver.units), /* generation */ 0, CAM_PERIPH_DRV_EARLY }; -PERIPHDRIVER_DECLARE(aprobe, probe_driver); +PERIPHDRIVER_DECLARE(aprobe, aprobe_driver); typedef enum { PROBE_RESET, @@ -100,7 +100,7 @@ typedef enum { PROBE_IDENTIFY_SAFTE, PROBE_DONE, PROBE_INVALID -} probe_action; +} aprobe_action; static char *probe_action_text[] = { "PROBE_RESET", @@ -134,13 +134,13 @@ do { \ typedef enum { PROBE_NO_ANNOUNCE = 0x04 -} probe_flags; +} aprobe_flags; typedef struct { TAILQ_HEAD(, ccb_hdr) request_ccbs; struct ata_params ident_data; - probe_action action; - probe_flags flags; + aprobe_action action; + aprobe_flags flags; uint32_t pm_pid; uint32_t pm_prv; int restart; @@ -162,19 +162,18 @@ static struct ata_quirk_entry ata_quirk_table[] = }, }; -static cam_status proberegister(struct cam_periph *periph, - void *arg); -static void probeschedule(struct cam_periph *probe_periph); -static void probestart(struct cam_periph *periph, union ccb *start_ccb); -static void proberequestdefaultnegotiation(struct cam_periph *periph); -static void probedone(struct cam_periph *periph, union ccb *done_ccb); -static void probecleanup(struct cam_periph *periph); +static cam_status aproberegister(struct cam_periph *periph, void *arg); +static void aprobeschedule(struct cam_periph *probe_periph); +static void aprobestart(struct cam_periph *periph, union ccb *start_ccb); +static void aproberequestdefaultnegotiation(struct cam_periph *periph); +static void aprobedone(struct cam_periph *periph, union ccb *done_ccb); +static void aprobecleanup(struct cam_periph *periph); static void ata_find_quirk(struct cam_ed *device); static void ata_scan_bus(struct cam_periph *periph, union ccb *ccb); static void ata_scan_lun(struct cam_periph *periph, struct cam_path *path, cam_flags flags, union ccb *ccb); -static void xptscandone(struct cam_periph *periph, union ccb *done_ccb); +static void axptscandone(struct cam_periph *periph, union ccb *done_ccb); static struct cam_ed * ata_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id); @@ -271,12 +270,12 @@ CAM_XPT_PROTO(ata_proto_satapm); CAM_XPT_PROTO(ata_proto_semb); static void -probe_periph_init() +aprobe_periph_init() { } static cam_status -proberegister(struct cam_periph *periph, void *arg) +aproberegister(struct cam_periph *periph, void *arg) { union ccb *request_ccb; /* CCB representing the probe request */ probe_softc *softc; @@ -307,12 +306,12 @@ proberegister(struct cam_periph *periph, void *arg) CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); ata_device_transport(periph->path); - probeschedule(periph); + aprobeschedule(periph); return(CAM_REQ_CMP); } static void -probeschedule(struct cam_periph *periph) +aprobeschedule(struct cam_periph *periph) { union ccb *ccb; probe_softc *softc; @@ -336,7 +335,7 @@ probeschedule(struct cam_periph *periph) } static void -probestart(struct cam_periph *periph, union ccb *start_ccb) +aprobestart(struct cam_periph *periph, union ccb *start_ccb) { struct ccb_trans_settings cts; struct ccb_ataio *ataio; @@ -346,7 +345,7 @@ probestart(struct cam_periph *periph, union ccb *start struct ata_params *ident_buf; u_int oif; - CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probestart\n")); + CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("aprobestart\n")); softc = (probe_softc *)periph->softc; path = start_ccb->ccb_h.path; @@ -367,7 +366,7 @@ probestart(struct cam_periph *periph, union ccb *start case PROBE_RESET: cam_fill_ataio(ataio, 0, - probedone, + aprobedone, /*flags*/CAM_DIR_NONE, 0, /*data_ptr*/NULL, @@ -378,7 +377,7 @@ probestart(struct cam_periph *periph, union ccb *start case PROBE_IDENTIFY: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, /*flags*/CAM_DIR_IN, 0, /*data_ptr*/(u_int8_t *)&softc->ident_data, @@ -394,7 +393,7 @@ probestart(struct cam_periph *periph, union ccb *start xpt_print(path, "Spinning up device\n"); cam_fill_ataio(ataio, 1, - probedone, + aprobedone, /*flags*/CAM_DIR_NONE | CAM_HIGH_POWER, 0, /*data_ptr*/NULL, @@ -469,7 +468,7 @@ negotiate: xpt_async(AC_GETDEV_CHANGED, path, NULL); cam_fill_ataio(ataio, 1, - probedone, + aprobedone, /*flags*/CAM_DIR_NONE, 0, /*data_ptr*/NULL, @@ -481,7 +480,7 @@ negotiate: case PROBE_SETPM: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, CAM_DIR_NONE, 0, NULL, @@ -494,7 +493,7 @@ negotiate: case PROBE_SETAPST: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, CAM_DIR_NONE, 0, NULL, @@ -507,7 +506,7 @@ negotiate: case PROBE_SETDMAAA: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, CAM_DIR_NONE, 0, NULL, @@ -528,7 +527,7 @@ negotiate: xpt_async(AC_GETDEV_CHANGED, path, NULL); cam_fill_ataio(ataio, 1, - probedone, + aprobedone, CAM_DIR_NONE, 0, NULL, @@ -591,7 +590,7 @@ negotiate: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, CAM_DIR_NONE, 0, NULL, @@ -659,7 +658,7 @@ negotiate: inquiry_len = roundup2(inquiry_len, 2); scsi_inquiry(csio, /*retries*/1, - probedone, + aprobedone, MSG_SIMPLE_Q_TAG, (u_int8_t *)inq_buf, inquiry_len, @@ -672,7 +671,7 @@ negotiate: case PROBE_PM_PID: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, /*flags*/CAM_DIR_NONE, 0, /*data_ptr*/NULL, @@ -683,7 +682,7 @@ negotiate: case PROBE_PM_PRV: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, /*flags*/CAM_DIR_NONE, 0, /*data_ptr*/NULL, @@ -694,7 +693,7 @@ negotiate: case PROBE_IDENTIFY_SES: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, /*flags*/CAM_DIR_IN, 0, /*data_ptr*/(u_int8_t *)&softc->ident_data, @@ -706,7 +705,7 @@ negotiate: case PROBE_IDENTIFY_SAFTE: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, /*flags*/CAM_DIR_IN, 0, /*data_ptr*/(u_int8_t *)&softc->ident_data, @@ -716,14 +715,14 @@ negotiate: sizeof(softc->ident_data) / 4); break; default: - panic("probestart: invalid action state 0x%x\n", softc->action); + panic("aprobestart: invalid action state 0x%x\n", softc->action); } start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE; xpt_action(start_ccb); } static void -proberequestdefaultnegotiation(struct cam_periph *periph) +aproberequestdefaultnegotiation(struct cam_periph *periph) { struct ccb_trans_settings cts; @@ -740,7 +739,7 @@ proberequestdefaultnegotiation(struct cam_periph *peri } static void -probedone(struct cam_periph *periph, union ccb *done_ccb) +aprobedone(struct cam_periph *periph, union ccb *done_ccb) { struct ccb_trans_settings cts; struct ata_params *ident_buf; @@ -755,7 +754,7 @@ probedone(struct cam_periph *periph, union ccb *done_c {0, SVPD_DEVICE_ID, 0, 12, SVPD_ID_CODESET_BINARY, SVPD_ID_TYPE_NAA, 0, 8}; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probedone\n")); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("aprobedone\n")); softc = (probe_softc *)periph->softc; path = done_ccb->ccb_h.path; @@ -1017,7 +1016,7 @@ noerror: } ata_device_transport(path); if (changed == 2) - proberequestdefaultnegotiation(periph); + aproberequestdefaultnegotiation(periph); PROBE_SET_ACTION(softc, PROBE_SETMODE); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); @@ -1228,7 +1227,7 @@ notsata: path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; ata_device_transport(path); if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) - proberequestdefaultnegotiation(periph); + aproberequestdefaultnegotiation(periph); /* Set supported bits. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); @@ -1317,7 +1316,7 @@ notsata: } ata_device_transport(path); if (changed) - proberequestdefaultnegotiation(periph); + aproberequestdefaultnegotiation(periph); if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; @@ -1329,13 +1328,13 @@ notsata: PROBE_SET_ACTION(softc, PROBE_DONE); break; default: - panic("probedone: invalid action state 0x%x\n", softc->action); + panic("aprobedone: invalid action state 0x%x\n", softc->action); } done: if (softc->restart) { softc->restart = 0; xpt_release_ccb(done_ccb); - probeschedule(periph); + aprobeschedule(periph); goto out; } xpt_release_ccb(done_ccb); @@ -1353,7 +1352,7 @@ done: } static void -probecleanup(struct cam_periph *periph) +aprobecleanup(struct cam_periph *periph) { free(periph->softc, M_CAMXPT); } @@ -1594,7 +1593,7 @@ ata_scan_lun(struct cam_periph *periph, struct cam_pat return; } xpt_setup_ccb(&request_ccb->ccb_h, new_path, CAM_PRIORITY_XPT); - request_ccb->ccb_h.cbfcnp = xptscandone; + request_ccb->ccb_h.cbfcnp = axptscandone; request_ccb->ccb_h.flags |= CAM_UNLOCKED; request_ccb->ccb_h.func_code = XPT_SCAN_LUN; request_ccb->crcn.flags = flags; @@ -1616,8 +1615,8 @@ ata_scan_lun(struct cam_periph *periph, struct cam_pat xpt_done(request_ccb); } } else { - status = cam_periph_alloc(proberegister, NULL, probecleanup, - probestart, "aprobe", + status = cam_periph_alloc(aproberegister, NULL, aprobecleanup, + aprobestart, "aprobe", CAM_PERIPH_BIO, request_ccb->ccb_h.path, NULL, 0, request_ccb); @@ -1634,7 +1633,7 @@ ata_scan_lun(struct cam_periph *periph, struct cam_pat } static void -xptscandone(struct cam_periph *periph, union ccb *done_ccb) +axptscandone(struct cam_periph *periph, union ccb *done_ccb) { xpt_free_path(done_ccb->ccb_h.path); From owner-svn-src-head@freebsd.org Wed May 13 02:01:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 701EE2E42E2; Wed, 13 May 2020 02:01:45 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MHwT2KJrz4MKN; Wed, 13 May 2020 02:01:45 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (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 3EE9B2CD97; Wed, 13 May 2020 02:01:45 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f181.google.com with SMTP id s186so14030912qkd.4; Tue, 12 May 2020 19:01:45 -0700 (PDT) X-Gm-Message-State: AGi0PuY4Q8PnFfceu8I/0M1BwYg0ZTRqeXA/tzoFDCquAIkC9zsEOm67 eh0aC2fFBsZO1Pt8wLtQCrDqthkYAtyZammq1Sk= X-Google-Smtp-Source: APiQypIWhNvpyOSpd+c2OiSLNe2+pxjbNJxX+nShO6w9swqF5gQ0oqG+US9PczP9in9JmwG0v7ZGEQ56cioxvpTcFYI= X-Received: by 2002:a37:6658:: with SMTP id a85mr23655178qkc.493.1589335304304; Tue, 12 May 2020 19:01:44 -0700 (PDT) MIME-Version: 1.0 References: <202005090201.04921Tpf028388@repo.freebsd.org> <20200511181027.GA60902@spindle.one-eyed-alien.net> <20200512221603.GB60902@spindle.one-eyed-alien.net> In-Reply-To: <20200512221603.GB60902@spindle.one-eyed-alien.net> From: Kyle Evans Date: Tue, 12 May 2020 21:01:33 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r360833 - head To: Brooks Davis Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 02:01:45 -0000 On Tue, May 12, 2020 at 5:16 PM Brooks Davis wrote: > > On Mon, May 11, 2020 at 01:45:14PM -0500, Kyle Evans wrote: > > On Mon, May 11, 2020 at 1:10 PM Brooks Davis wrote: > > > > > > On Sat, May 09, 2020 at 02:01:29AM +0000, Kyle Evans wrote: > > > > Author: kevans > > > > Date: Sat May 9 02:01:29 2020 > > > > New Revision: 360833 > > > > URL: https://svnweb.freebsd.org/changeset/base/360833 > > > > > > > > Log: > > > > installworld: attempt a certctl rehash at the tail end > > > > > > > > This can be run as root or normal user with no problem; if they hadn't > > > > twisted the WITHOUT_CAROOT knob, we'll attempt to use the host certctl to > > > > rehash the DESTDIR. This would allow one to build systems WITHOUT_OPENSSL + > > > > WITH_CAROOT with a populated /etc/ssl that they can then use with an > > > > appropriate *ssl from somewhere else. > > > > > > > > Cross-builds are fine because this will always use the host certctl, or just > > > > nag if it's missing and it wasn't a WITHOUT_CAROOT build. > > > > > > > > MFC after: 1 week > > > > Differential Revision: https://reviews.freebsd.org/D24641 > > > > > > > > Modified: > > > > head/Makefile.inc1 > > > > > > > > Modified: head/Makefile.inc1 > > > > ============================================================================== > > > > --- head/Makefile.inc1 Sat May 9 01:48:08 2020 (r360832) > > > > +++ head/Makefile.inc1 Sat May 9 02:01:29 2020 (r360833) > > > > @@ -1403,6 +1403,16 @@ distributeworld installworld stageworld: _installcheck > > > > ${DESTDIR}/${DISTDIR}/${dist}.debug.meta > > > > .endfor > > > > .endif > > > > +.elif make(installworld) && ${MK_CAROOT} != "no" > > > > + # We could make certctl a bootstrap tool, but it requires OpenSSL and > > > > + # friends, which we likely don't want. We'll rehash on a best-effort > > > > + # basis, otherwise we'll just mention that we're not doing it to raise > > > > + # awareness. > > > > + @if which certctl>/dev/null; then \ > > > > + certctl rehash \ > > > > > > Does this update METALOG with the added links? > > > > > > It seems a little weird to rely on DESTDIR from the environment. > > > > > > In general I'm not enthusiastic about additions to installworld that do > > > anything other than copying files, creating links, etc in simple ways. > > > > I will happily back this out if I can get some qualified eyes to > > review/improve it. It does not update METALOG, and it probably should. > > Agreed on DESTDIR. As for point #3, I guess we can continue spreading > > `certctl rehash` all over the tree in various points that may need it; > > the release(7) scripts will need to be done if we don't do it here at > > a minimum, and I haven't put much thought into it beyond that. > > I'm not in a rush to back this out given that it's solving a real > problem, but lets talk about improvements. > > I kind of feel like this belongs in distribution (which I think would > deal with release scripts) or in etcupdate/mergemaster, but I'm not > sure either of those are correct. I'd be happy to review changes to > update the METALOG (I guess we'd extend certctl with an option to do > that?) I think that's the most important things because we really > should be routinely validating that DESTDIR only contains things in the > METALOG. A quick and dirty fix for the DESTDIR weirdness might be adding > "env DESTDIR=${DESTDIR}" so it's explicit. > Got it- not an egregious enough violation to promptly back out, but we will work towards a better solution. For the larger picture, distribution is probably the correct spot for this; we currently rehash at the following points: - mergemaster/etcupdate - freebsd-update - post-install of the caroot pkg (pkgbase) This leaves two primary final blind spots, which this commit was attempting to resolve: 1.) Install media (including VM images) 2.) Initial installs (e.g. from bsdinstall) #1 could be solved by directly adding it to the release(7) scripts and #2 could be solved by having bsdinstall do it at config time, but there seem to be multiple potential points that could instead hit both (with a single stone) while also making covering the array of other images that re@ produces (e.g. AWS images) and perhaps other points that we've not immediately considered. To this end, distribution or installworld are probably equally sufficient, but I'm incredibly unfamiliar with the former. My understanding from glancing at it over the years is that it may be executed into a tempdir and merged with mergemaster/etcupdate, or directly into the new root if we're looking at a new install that doesn't have potential local changes to merge in. Part of the problem that I see in my head is probably solved by just having a var that mergemaster/etcupdate can pass in to distribution to not bother with the rehash. We want to keep the mergemaster/etcupdate rehash because if they're running then the target's certainly not been rehashed. OTOH, we probably don't want to rehash multiple times in that pipeline- from a certctl standpoint, it's completely harmless, but it's not the most effective use of system resources and probably looks a bit bad. > > The close-to-infuriating part of the caroot project has been that it's > > incredibly hard to get almost anyone else (with some obvious > > exceptions) to do more than informal discussion on the matter; actual > > review, in particular, is difficult to obtain. > > Thanks for doing all this work! I'm afraid the whole thing gives me > third-rail vibes (not the idea or the implementation, but the potential > for things to go wrong) so I've veered away from the larger reviews. :( > Thanks! I'm effectively diffused now... apologies for the suboptimal tone of my previous message, I do want to work towards a solution that we can all be happy with. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Wed May 13 02:17:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E31362E48CB; Wed, 13 May 2020 02:17:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MJGb5WqZz4N74; Wed, 13 May 2020 02:17:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8C931A23F; Wed, 13 May 2020 02:17:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04D2HR3S016241; Wed, 13 May 2020 02:17:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D2HRvV016240; Wed, 13 May 2020 02:17:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005130217.04D2HRvV016240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 13 May 2020 02:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361000 - head/usr.sbin/inetd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/inetd X-SVN-Commit-Revision: 361000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 02:17:28 -0000 Author: kevans Date: Wed May 13 02:17:27 2020 New Revision: 361000 URL: https://svnweb.freebsd.org/changeset/base/361000 Log: inetd(8): Provide HTTP proxy example using netcat One of the fortunes that are included in freebsd-tips talks about how the superserver can be used to proxy connections with netcat, but there are no examples provided. This commit adds an example with comment explaining what it does. Submitted by: debdrup MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24800 Modified: head/usr.sbin/inetd/inetd.8 Modified: head/usr.sbin/inetd/inetd.8 ============================================================================== --- head/usr.sbin/inetd/inetd.8 Wed May 13 00:18:44 2020 (r360999) +++ head/usr.sbin/inetd/inetd.8 Wed May 13 02:17:27 2020 (r361000) @@ -28,7 +28,7 @@ .\" from: @(#)inetd.8 8.3 (Berkeley) 4/13/94 .\" $FreeBSD$ .\" -.Dd January 12, 2008 +.Dd May 12, 2020 .Dt INETD 8 .Os .Sh NAME @@ -800,6 +800,8 @@ shell stream tcp46 nowait root /usr/libexec/ tcpmux/+date stream tcp nowait guest /bin/date date tcpmux/phonebook stream tcp nowait guest /usr/local/bin/phonebook phonebook rstatd/1-3 dgram rpc/udp wait root /usr/libexec/rpc.rstatd rpc.rstatd +# Use netcat as a one-shot HTTP proxy with nc (from freebsd-tips fortune) +http stream tcp nowait nobody /usr/bin/nc nc -N dest-ip 80 /var/run/echo stream unix nowait root internal #@ ipsec ah/require chargen stream tcp nowait root internal @@ -914,6 +916,7 @@ in the database. .El .Sh SEE ALSO +.Xr nc 1 , .Xr ipsec_set_policy 3 , .Xr hosts_access 5 , .Xr hosts_options 5 , From owner-svn-src-head@freebsd.org Wed May 13 04:41:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 667EA2E6BE8; Wed, 13 May 2020 04:41:08 +0000 (UTC) (envelope-from freebsd@bdragon.rtk0.net) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (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 49MMSN1zS8z4TbJ; Wed, 13 May 2020 04:41:08 +0000 (UTC) (envelope-from freebsd@bdragon.rtk0.net) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 79DB85C0134; Wed, 13 May 2020 00:41:07 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute1.internal (MEProxy); Wed, 13 May 2020 00:41:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=BPTcqfk3EzWdYQPbD2MF97z0lhhio83hs7iAS7rDk q8=; b=N4faSzJQ7xNZRpZqEAvK9Nbkn47g/pqfIVlZL8JFSdoN615l6potugnqN Pjwn6ZBVUP4kBCElX+aKky1+q+jZLE+ii6ZkokU/TTjdT5TYcqUdQV3dN4DSEMYe tYCHSPvkYJbwVmBPoOeQJ5bwJcnN3FWLcReIVt5QXIAHXxbA3J2yahVj7/dAG7q/ gxX4eGUtD5d/ICgnsnRm766outuElt1F7/zsQ+tfVQAkZSCtHazrXRjrP+syov+V NjtlzB9DpIhGr7FU9oOC9rGcQvVKUduuV+gBTw4oSwB9+cclg8WzAuEEaixFjtuO 7R0qGrI/zP774Bmb5o6fGCNfI9++A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrleefgdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepfdeurhgr nhguohhnuceuvghrghhrvghnfdcuoehfrhgvvggsshgusegsughrrghgohhnrdhrthhktd drnhgvtheqnecuggftrfgrthhtvghrnhepudejudejgeehgfdvteeijeffteeugffhjedu udeugfefleelffehgeffudejtdfhnecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgpd gtohhmphhilhgvrhdrmhhkpdhshihsrdhmkhdpphhrvgdrmhhkpdhofihnrdhmkhdpghhn uhdrohhrghdplhhlvhhmrdhorhhgpdhinhhithdrmhhkpdhsuhgsughirhdrmhhkpdhprh hoghdrmhhknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepfhhrvggvsghsugessggurhgrghhonhdrrhhtkhdtrdhnvght X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id C0E87C200A4; Wed, 13 May 2020 00:41:06 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-dev0-413-g750b809-fmstable-20200507v1 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <202005121522.04CFMfuo007680@repo.freebsd.org> Date: Tue, 12 May 2020 23:40:46 -0500 From: "Brandon Bergren" To: "Ravi Pokala" , "Eric van Gyzen" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: =?UTF-8?Q?Re:_svn_commit:_r360964_-_in_head:_lib/libclang=5Frt_lib/libth?= =?UTF-8?Q?r_lib/msun_libexec/rtld-elf_libexec/tftpd/tests_share/mk_stan?= =?UTF-8?Q?d_stand/arm/uboot_stand/efi_stand/efi/boot1_stand/efi/loader_?= =?UTF-8?Q?stand/i386/boot2_st...?= Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 49MMSN1zS8z4TbJ X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 04:41:08 -0000 Why is this marked for MFC? FreeBSD 12 uses base GCC 4.2.1 on some platf= orms. On Tue, May 12, 2020, at 1:34 PM, Ravi Pokala wrote: > This feels like it deserves an UPDATING (and possibly a RELNOTES) entr= y. >=20 > -Ravi (rpokala@) >=20 > =EF=BB=BF-----Original Message----- > From: on behalf of Eric van Gyzen=20= > > Date: 2020-05-12, Tuesday at 08:22 > To: , ,=20 > > Subject: svn commit: r360964 - in head: lib/libclang_rt lib/libthr=20 > lib/msun libexec/rtld-elf libexec/tftpd/tests share/mk stand=20 > stand/arm/uboot stand/efi stand/efi/boot1 stand/efi/loader=20 > stand/i386/boot2 st... >=20 > Author: vangyzen > Date: Tue May 12 15:22:40 2020 > New Revision: 360964 > URL: https://svnweb.freebsd.org/changeset/base/360964 >=20 > Log: > Remove tests for obsolete compilers in the build system >=20 > Assume gcc is at least 6.4, the oldest xtoolchain in the ports t= ree. > Assume clang is at least 6, which was in 11.2-RELEASE. Drop con= ditions > for older compilers. >=20 > Reviewed by: imp (earlier version), emaste, jhb > MFC after: 2 weeks > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D24802 >=20 > Modified: > head/lib/libclang_rt/Makefile.inc > head/lib/libthr/Makefile > head/lib/msun/Makefile > head/libexec/rtld-elf/Makefile > head/libexec/tftpd/tests/Makefile > head/share/mk/bsd.compiler.mk > head/share/mk/bsd.sys.mk > head/stand/arm/uboot/Makefile > head/stand/defs.mk > head/stand/efi/Makefile > head/stand/efi/boot1/Makefile > head/stand/efi/loader/Makefile > head/stand/i386/boot2/Makefile > head/stand/i386/isoboot/Makefile > head/stand/libsa/Makefile > head/sys/conf/Makefile.arm > head/sys/conf/Makefile.powerpc > head/sys/conf/kern.mk > head/sys/conf/kern.post.mk > head/sys/conf/kern.pre.mk > head/sys/conf/kmod.mk > head/sys/modules/Makefile > head/usr.sbin/acpi/acpidb/Makefile > head/usr.sbin/trpt/Makefile > head/usr.sbin/zic/zic/Makefile >=20 > Modified: head/lib/libclang_rt/Makefile.inc > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/lib/libclang_rt/Makefile.inc Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/lib/libclang_rt/Makefile.inc Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -32,7 +32,7 @@ CFLAGS+=3D ${PICFLAG} > CFLAGS+=3D -fno-builtin > CFLAGS+=3D -fno-exceptions > CXXFLAGS+=3D -fno-rtti > -.if ${COMPILER_TYPE} =3D=3D clang && ${COMPILER_VERSION} >=3D 307= 00 > +.if ${COMPILER_TYPE} =3D=3D clang > CFLAGS+=3D -fno-sanitize=3Dsafe-stack > .endif > CFLAGS+=3D -fno-stack-protector >=20 > Modified: head/lib/libthr/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/lib/libthr/Makefile Tue May 12 14:47:38 2020 (r360963) > +++ head/lib/libthr/Makefile Tue May 12 15:22:40 2020 (r360964) > @@ -29,10 +29,7 @@ CFLAGS+=3D-Winline >=20 > CFLAGS.thr_stack.c+=3D -Wno-cast-align > CFLAGS.rtld_malloc.c+=3D -Wno-cast-align > -.include > -.if !(${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 4030= 0) > CFLAGS.thr_symbols.c+=3D -Wno-missing-variable-declarations > -.endif >=20 > .ifndef NO_THREAD_UNWIND_STACK > CFLAGS+=3D-fexceptions >=20 > Modified: head/lib/msun/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/lib/msun/Makefile Tue May 12 14:47:38 2020 (r360963) > +++ head/lib/msun/Makefile Tue May 12 15:22:40 2020 (r360964) > @@ -108,13 +108,13 @@ COMMON_SRCS+=3D catrigl.c \ > s_nextafterl.c s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c \= > s_scalbnl.c s_sinl.c s_sincosl.c \ > s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c > -# Work around this warning from gcc 6: > +# Work around this warning from gcc: > # lib/msun/ld80/e_powl.c:275:1: error: floating constant=20 > exceeds range of > # 'long double' [-Werror=3Doverflow] > # if( y >=3D LDBL_MAX ) > # See also:=20 > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D130067 > .include > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 600= 00 > +.if ${COMPILER_TYPE} =3D=3D "gcc" > CFLAGS.e_powl.c+=3D -Wno-error=3Doverflow > .endif > .endif >=20 > Modified: head/libexec/rtld-elf/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/libexec/rtld-elf/Makefile Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/libexec/rtld-elf/Makefile Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -90,8 +90,4 @@ ${PROG_FULL}: ${VERSION_MAP} > # GCC warns about redeclarations even though they have __exported= > # and are therefore not identical to the ones from the system=20 > headers. > CFLAGS+=3D -Wno-redundant-decls > -.if ${COMPILER_VERSION} < 40300 > -# Silence -Wshadow false positives in ancient GCC > -CFLAGS+=3D -Wno-shadow > -.endif > .endif >=20 > Modified: head/libexec/tftpd/tests/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/libexec/tftpd/tests/Makefile Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/libexec/tftpd/tests/Makefile Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -2,11 +2,8 @@ >=20 > .include >=20 > -# Skip on GCC 4.2, because it lacks __COUNTER__ > -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D 40300= > ATF_TESTS_C=3D functional > TEST_METADATA.functional+=3D timeout=3D15 > -.endif >=20 > LIBADD=3D util > WARNS?=3D 6 >=20 > Modified: head/share/mk/bsd.compiler.mk > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/share/mk/bsd.compiler.mk Tue May 12 14:47:38 2020 (r36096= 3) > +++ head/share/mk/bsd.compiler.mk Tue May 12 15:22:40 2020 (r36096= 4) > @@ -205,20 +205,12 @@ ${X_}COMPILER_FREEBSD_VERSION=3D unknown > ${X_}COMPILER_RESOURCE_DIR!=3D ${${cc}:N${CCACHE_BIN}}=20 > -print-resource-dir 2>/dev/null || echo unknown > .endif >=20 > -${X_}COMPILER_FEATURES=3D > -.if (${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERS= ION}=20 > >=3D 30300) || \ > - (${${X_}COMPILER_TYPE} =3D=3D "gcc" && ${${X_}COMPILER_VERSION} = >=3D=20 > 40800) > -${X_}COMPILER_FEATURES+=3D c++11 > -.endif > -.if (${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERS= ION}=20 > >=3D 30400) || \ > - (${${X_}COMPILER_TYPE} =3D=3D "gcc" && ${${X_}COMPILER_VERSION} = >=3D=20 > 50000) > -${X_}COMPILER_FEATURES+=3D c++14 > -.endif > -.if (${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERS= ION}=20 > >=3D 50000) || \ > +${X_}COMPILER_FEATURES=3D c++11 c++14 > +.if ${${X_}COMPILER_TYPE} =3D=3D "clang" || \ > (${${X_}COMPILER_TYPE} =3D=3D "gcc" && ${${X_}COMPILER_VERSION} = >=3D=20 > 70000) > ${X_}COMPILER_FEATURES+=3D c++17 > .endif > -.if ${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERSI= ON}=20 > >=3D 60000 > +.if ${${X_}COMPILER_TYPE} =3D=3D "clang" > ${X_}COMPILER_FEATURES+=3D retpoline > .endif >=20 >=20 > Modified: head/share/mk/bsd.sys.mk > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/share/mk/bsd.sys.mk Tue May 12 14:47:38 2020 (r360963) > +++ head/share/mk/bsd.sys.mk Tue May 12 15:22:40 2020 (r360964) > @@ -6,8 +6,7 @@ > # Enable various levels of compiler warning checks. These may be= > # overridden (e.g. if using a non-gcc compiler) by defining=20 > MK_WARNS=3Dno. >=20 > -# for 4.2.1 GCC: =20 > http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Warning-Options.html > -# for current GCC:=20 > https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html > +# for GCC: =20 > https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html > # for clang: https://clang.llvm.org/docs/DiagnosticsReference.htm= l >=20 > .include > @@ -29,15 +28,6 @@ CFLAGS+=3D -std=3D${CSTD} > CXXFLAGS+=3D -std=3D${CXXSTD} > .endif >=20 > -# > -# Turn off -Werror for gcc 4.2.1. The compiler is on the glide=20= > path out of the > -# system, and any warnings specific to it are no longer relevant=20= > as there are > -# too many false positives. > -# > -.if ${COMPILER_VERSION} < 50000 > -NO_WERROR.gcc=3D yes > -.endif > - > # -pedantic is problematic because it also imposes namespace=20 > restrictions > #CFLAGS+=3D -pedantic > .if defined(WARNS) > @@ -81,19 +71,13 @@ CWARNFLAGS+=3D -Wno-pointer-sign > # is set to low values, these have to be disabled explicitly. > .if ${WARNS} <=3D 6 > CWARNFLAGS.clang+=3D -Wno-empty-body -Wno-string-plus-int > -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 3= 0400 > CWARNFLAGS.clang+=3D -Wno-unused-const-variable > -.endif > .endif # WARNS <=3D 6 > .if ${WARNS} <=3D 3 > CWARNFLAGS.clang+=3D -Wno-tautological-compare -Wno-unused-value\= > -Wno-parentheses-equality -Wno-unused-function=20 > -Wno-enum-conversion > -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 3= 0600 > CWARNFLAGS.clang+=3D -Wno-unused-local-typedef > -.endif > -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 4= 0000 > CWARNFLAGS.clang+=3D -Wno-address-of-packed-member > -.endif > .if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 901= 00 > CWARNFLAGS.gcc+=3D -Wno-address-of-packed-member > .endif > @@ -113,7 +97,7 @@ CWARNFLAGS.clang+=3D -Wno-array-bounds > .endif # NO_WARRAY_BOUNDS > .if defined(NO_WMISLEADING_INDENTATION) && \ > ((${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D= =20 > 100000) || \ > - (${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 6= 0100)) > + ${COMPILER_TYPE} =3D=3D "gcc") > CWARNFLAGS+=3D -Wno-misleading-indentation > .endif # NO_WMISLEADING_INDENTATION > .endif # WARNS > @@ -137,8 +121,10 @@ CWARNFLAGS+=3D -Werror > CWARNFLAGS+=3D -Wno-format > .endif # NO_WFORMAT || NO_WFORMAT.${COMPILER_TYPE} >=20 > -# GCC 5.2.0 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 502= 00 > +# GCC > +# We should clean up warnings produced with these flags. > +# They were originally added as a quick hack to enable gcc5/6. > +.if ${COMPILER_TYPE} =3D=3D "gcc" > CWARNFLAGS+=3D -Wno-error=3Daddress \ > -Wno-error=3Darray-bounds \ > -Wno-error=3Dattributes \ > @@ -150,23 +136,18 @@ CWARNFLAGS+=3D -Wno-error=3Daddress \ > -Wno-error=3Dextra \ > -Wno-error=3Dinline \ > -Wno-error=3Dlogical-not-parentheses \ > + -Wno-error=3Dnonnull-compare \ > + -Wno-error=3Dshift-negative-value \ > -Wno-error=3Dstrict-aliasing \ > + -Wno-error=3Dtautological-compare \ > -Wno-error=3Duninitialized \ > -Wno-error=3Dunused-but-set-variable \ > + -Wno-error=3Dunused-const-variable \ > -Wno-error=3Dunused-function \ > -Wno-error=3Dunused-value > -.endif >=20 > -# GCC 6.1.0 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 601= 00 > -CWARNFLAGS+=3D -Wno-error=3Dnonnull-compare \ > - -Wno-error=3Dshift-negative-value \ > - -Wno-error=3Dtautological-compare \ > - -Wno-error=3Dunused-const-variable > -.endif > - > # GCC 7.1.0 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 701= 00 > +.if ${COMPILER_VERSION} >=3D 70100 > CWARNFLAGS+=3D -Wno-error=3Dbool-operation \ > -Wno-error=3Ddeprecated \ > -Wno-error=3Dexpansion-to-defined \ > @@ -182,7 +163,7 @@ CWARNFLAGS+=3D -Wno-error=3Dbool-operation \ > .endif >=20 > # GCC 8.1.0 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 801= 00 > +.if ${COMPILER_VERSION} >=3D 80100 > CWARNFLAGS+=3D -Wno-error=3Daggressive-loop-optimizations \ > -Wno-error=3Dcast-function-type \ > -Wno-error=3Dcatch-value \ > @@ -191,9 +172,10 @@ CWARNFLAGS+=3D -Wno-error=3Daggressive-loop-o= ptimizations > -Wno-error=3Dsizeof-pointer-memaccess \ > -Wno-error=3Dstringop-truncation > .endif > +.endif # gcc >=20 > # How to handle FreeBSD custom printf format specifiers. > -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 3= 0600 > +.if ${COMPILER_TYPE} =3D=3D "clang" > FORMAT_EXTENSIONS=3D -D__printf__=3D__freebsd_kprintf__ > .else > FORMAT_EXTENSIONS=3D -fformat-extensions > @@ -223,11 +205,7 @@ CFLAGS+=3D-nobuiltininc -idirafter ${COMPILER= _RESOURCE_D >=20 > CLANG_OPT_SMALL=3D -mstack-alignment=3D8 -mllvm -inline-threshold= =3D3\ > -mllvm -simplifycfg-dup-ret > -.if ${COMPILER_VERSION} >=3D 30500 && ${COMPILER_VERSION} < 30700= > -CLANG_OPT_SMALL+=3D -mllvm -enable-gvn=3Dfalse > -.else > CLANG_OPT_SMALL+=3D -mllvm -enable-load-pre=3Dfalse > -.endif > CFLAGS.clang+=3D -Qunused-arguments > # The libc++ headers use c++11 extensions. These are normally=20= > silenced because > # they are treated as system headers, but we explicitly disable=20= > that warning > @@ -238,14 +216,8 @@ CXXFLAGS.clang+=3D -Wno-c++11-extensions >=20 > .if ${MK_SSP} !=3D "no" && \ > ${MACHINE_CPUARCH} !=3D "arm" && ${MACHINE_CPUARCH} !=3D "mip= s" > -.if (${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D = 30500) || \ > - (${COMPILER_TYPE} =3D=3D "gcc" && \ > - (${COMPILER_VERSION} =3D=3D 40201 || ${COMPILER_VERSION} >=3D= 40900)) > # Don't use -Wstack-protector as it breaks world with -Werror. > SSP_CFLAGS?=3D -fstack-protector-strong > -.else > -SSP_CFLAGS?=3D -fstack-protector > -.endif > CFLAGS+=3D ${SSP_CFLAGS} > .endif # SSP && !ARM && !MIPS >=20 >=20 > Modified: head/stand/arm/uboot/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/arm/uboot/Makefile Tue May 12 14:47:38 2020 (r36096= 3) > +++ head/stand/arm/uboot/Makefile Tue May 12 15:22:40 2020 (r36096= 4) > @@ -24,7 +24,7 @@ UBLDR_LOADADDR?=3D 0x1000000 > # Architecture-specific loader code > SRCS=3D start.S conf.c self_reloc.c vers.c >=20 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} > 40201 > +.if ${COMPILER_TYPE} =3D=3D "gcc" > CWARNFLAGS.self_reloc.c+=3D -Wno-error=3Dmaybe-uninitialized > .endif >=20 >=20 > Modified: head/stand/defs.mk > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/defs.mk Tue May 12 14:47:38 2020 (r360963) > +++ head/stand/defs.mk Tue May 12 15:22:40 2020 (r360964) > @@ -143,11 +143,7 @@ CFLAGS+=3D -fPIC -mno-red-zone > # Do not generate movt/movw, because the relocation fixup for the= m=20 > does not > # translate to the -Bsymbolic -pie format required by self_reloc(= )=20 > in loader(8). > # Also, the fpu is not available in a standalone environment. > -.if ${COMPILER_VERSION} < 30800 > -CFLAGS.clang+=3D -mllvm -arm-use-movt=3D0 > -.else > CFLAGS.clang+=3D -mno-movt > -.endif > CFLAGS.clang+=3D -mfpu=3Dnone > CFLAGS+=3D -fPIC > .endif >=20 > Modified: head/stand/efi/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/efi/Makefile Tue May 12 14:47:38 2020 (r360963) > +++ head/stand/efi/Makefile Tue May 12 15:22:40 2020 (r360964) > @@ -4,16 +4,10 @@ NO_OBJ=3Dt >=20 > .include >=20 > -# In-tree GCC does not support __attribute__((ms_abi)), but gcc n= ewer > -# than 4.5 supports it. > -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D 40500= > - > SUBDIR.${MK_FDT}+=3D fdt > SUBDIR.yes+=3D libefi boot1 gptboot > SUBDIR.${MK_FORTH}+=3D loader_4th > SUBDIR.${MK_LOADER_LUA}+=3D loader_lua > SUBDIR.yes+=3D loader_simp > - > -.endif # ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D = 40500 >=20 > .include >=20 > Modified: head/stand/efi/boot1/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/efi/boot1/Makefile Tue May 12 14:47:38 2020 (r36096= 3) > +++ head/stand/efi/boot1/Makefile Tue May 12 15:22:40 2020 (r36096= 4) > @@ -42,10 +42,6 @@=20 > CFLAGS.zfs_module.c+=3D -I${SYSDIR}/cddl/contrib/opensol > CFLAGS+=3D -DEFI_ZFS_BOOT > .endif >=20 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} > 40201 > -CWARNFLAGS.self_reloc.c+=3D -Wno-error=3Dmaybe-uninitialized > -.endif > - > CFLAGS+=3D -I${EFIINC} > CFLAGS+=3D -I${EFIINCMD} > CFLAGS+=3D -I${SYSDIR}/contrib/dev/acpica/include >=20 > Modified: head/stand/efi/loader/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/efi/loader/Makefile Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/stand/efi/loader/Makefile Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -31,10 +31,6 @@ CFLAGS+=3D -DEFI_ZFS_BOOT > HAVE_ZFS=3D yes > .endif >=20 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} > 40201 > -CWARNFLAGS.self_reloc.c+=3D -Wno-error=3Dmaybe-uninitialized > -.endif > - > # We implement a slightly non-standard %S in that it always takes= a > # CHAR16 that's common in UEFI-land instead of a wchar_t. This on= ly > # seems to matter on arm64 where wchar_t defaults to an int inste= ad >=20 > Modified: head/stand/i386/boot2/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/i386/boot2/Makefile Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/stand/i386/boot2/Makefile Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -37,9 +37,6 @@ CFLAGS+=3D-fomit-frame-pointer \ > CFLAGS.gcc+=3D -Os \ > -fno-asynchronous-unwind-tables \ > --param max-inline-insns-single=3D100 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} <=3D 402= 01 > -CFLAGS.gcc+=3D -mno-align-long-strings > -.endif >=20 > CFLAGS.clang+=3D -Oz ${CLANG_OPT_SMALL} >=20 >=20 > Modified: head/stand/i386/isoboot/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/i386/isoboot/Makefile Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/stand/i386/isoboot/Makefile Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -32,9 +32,6 @@ CFLAGS+=3D-DBOOTPROG=3D\"isoboot\" \ > -Winline -Wno-pointer-sign >=20 > CFLAGS.gcc+=3D --param max-inline-insns-single=3D100 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} <=3D 402= 01 > -CFLAGS.gcc+=3D -Wno-uninitialized > -.endif > CFLAGS.clang+=3D -Oz ${CLANG_OPT_SMALL} >=20 > LD_FLAGS+=3D${LD_FLAGS_BIN} >=20 > Modified: head/stand/libsa/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/libsa/Makefile Tue May 12 14:47:38 2020 (r360963) > +++ head/stand/libsa/Makefile Tue May 12 15:22:40 2020 (r360964) > @@ -46,11 +46,7 @@ SRCS+=3D subr_boot.c > # Do not generate movt/movw, because the relocation fixup for the= m=20 > does not > # translate to the -Bsymbolic -pie format required by self_reloc(= )=20 > in loader(8). > # Also, the fpu is not available in a standalone environment. > -.if ${COMPILER_VERSION} < 30800 > -CFLAGS.clang+=3D -mllvm -arm-use-movt=3D0 > -.else > CFLAGS.clang+=3D -mno-movt > -.endif > CFLAGS.clang+=3D -mfpu=3Dnone >=20 > .PATH: ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins/ar= m/ >=20 > Modified: head/sys/conf/Makefile.arm > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/conf/Makefile.arm Tue May 12 14:47:38 2020 (r360963) > +++ head/sys/conf/Makefile.arm Tue May 12 15:22:40 2020 (r360964) > @@ -44,10 +44,6 @@ CFLAGS.clang +=3D -mfpu=3Dnone >=20 > .if !empty(DDB_ENABLED) > CFLAGS +=3D -funwind-tables > -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} < 3050= 0 > -# clang < 3.5.0 requires us to tell it to emit assembly with=20 > unwind information > -CFLAGS +=3D -mllvm -arm-enable-ehabi > -.endif > .endif >=20 > # "makeoptions KERNVIRTADDR=3D" is now optional, supply the defau= lt value. >=20 > Modified: head/sys/conf/Makefile.powerpc > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/conf/Makefile.powerpc Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/sys/conf/Makefile.powerpc Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -51,7 +51,7 @@ DPAAWARNFLAGS +=3D \ > -Wno-error=3Dincompatible-pointer-types-discards-qualifie= rs \ > -Wno-error=3Dnon-literal-null-conversion \ > -Wno-error=3Denum-conversion > -.elif "${COMPILER_TYPE}" =3D=3D "gcc" && ${COMPILER_VERSION} >=3D= 50200 > +.elif "${COMPILER_TYPE}" =3D=3D "gcc" > DPAAWARNFLAGS +=3D \ > -Wno-error=3Dredundant-decls \ > -Wno-error=3Dint-in-bool-context >=20 > Modified: head/sys/conf/kern.mk > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/conf/kern.mk Tue May 12 14:47:38 2020 (r360963) > +++ head/sys/conf/kern.mk Tue May 12 15:22:40 2020 (r360964) > @@ -31,19 +31,14 @@ NO_WTAUTOLOGICAL_POINTER_COMPARE=3D=20 > -Wno-tautological-po > CWARNEXTRA?=3D -Wno-error-tautological-compare -Wno-error-empty-b= ody=20 > \ > -Wno-error-parentheses-equality -Wno-error-unused-function \ > -Wno-error-pointer-sign > -.if ${COMPILER_VERSION} >=3D 30700 > CWARNEXTRA+=3D -Wno-error-shift-negative-value > -.endif > -.if ${COMPILER_VERSION} >=3D 40000 > CWARNEXTRA+=3D -Wno-address-of-packed-member > -.endif > .if ${COMPILER_VERSION} >=3D 100000 > NO_WMISLEADING_INDENTATION=3D -Wno-misleading-indentation > .endif > -.endif > +.endif # clang >=20 > .if ${COMPILER_TYPE} =3D=3D "gcc" > -.if ${COMPILER_VERSION} >=3D 40800 > # Catch-all for all the things that are in our tree, but for whic= h=20 > we're > # not yet ready for this compiler. > NO_WUNUSED_BUT_SET_VARIABLE =3D -Wno-unused-but-set-variable > @@ -55,15 +50,13 @@ CWARNEXTRA?=3D -Wno-error=3Daddress \ > -Wno-error=3Denum-compare \ > -Wno-error=3Dinline \ > -Wno-error=3Dmaybe-uninitialized \ > + -Wno-error=3Dmisleading-indentation \ > + -Wno-error=3Dnonnull-compare \ > -Wno-error=3Doverflow \ > -Wno-error=3Dsequence-point \ > - -Wno-unused-but-set-variable > -.if ${COMPILER_VERSION} >=3D 60100 > -CWARNEXTRA+=3D -Wno-error=3Dmisleading-indentation \ > - -Wno-error=3Dnonnull-compare \ > -Wno-error=3Dshift-overflow \ > - -Wno-error=3Dtautological-compare > -.endif > + -Wno-error=3Dtautological-compare \ > + -Wno-unused-but-set-variable > .if ${COMPILER_VERSION} >=3D 70100 > CWARNEXTRA+=3D -Wno-error=3Dstringop-overflow > .endif > @@ -76,15 +69,7 @@ CWARNEXTRA+=3D -Wno-error=3Dpacked-not-aligned > .if ${COMPILER_VERSION} >=3D 90100 > CWARNEXTRA+=3D -Wno-address-of-packed-member > .endif > -.else > -# For gcc 4.2, eliminate the too-often-wrong warnings about=20 > uninitialized vars. > -CWARNEXTRA?=3D -Wno-uninitialized > -# GCC 4.2 doesn't have -Wno-error=3Dcast-qual, so just disable th= e=20 > warning for > -# the few files that are already known to generate cast-qual=20 > warnings. > -NO_WCAST_QUAL=3D -Wno-cast-qual > -NO_WNONNULL=3D -Wno-nonnull > -.endif > -.endif > +.endif # gcc >=20 > # This warning is utter nonsense > CWARNFLAGS+=3D -Wno-format-zero-length > @@ -93,7 +78,7 @@ CWARNFLAGS+=3D -Wno-format-zero-length > # to be disabled. WARNING: format checking is disabled in this c= ase. > .if ${MK_FORMAT_EXTENSIONS} =3D=3D "no" > FORMAT_EXTENSIONS=3D -Wno-format > -.elif ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D= 30600 > +.elif ${COMPILER_TYPE} =3D=3D "clang" > FORMAT_EXTENSIONS=3D -D__printf__=3D__freebsd_kprintf__ > .else > FORMAT_EXTENSIONS=3D -fformat-extensions > @@ -201,12 +186,7 @@ CFLAGS.gcc+=3D -mno-spe > # DDB happy. ELFv2, if available, has some other efficiency benef= its. > # > .if ${MACHINE_ARCH} =3D=3D "powerpc64" > -.if ${COMPILER_VERSION} >=3D 40900 > -CFLAGS.gcc+=3D -mabi=3Delfv2 > -.else > -CFLAGS.gcc+=3D -mcall-aixdesc > -.endif > -CFLAGS.clang+=3D -mabi=3Delfv2 > +CFLAGS+=3D -mabi=3Delfv2 > .endif >=20 > # >=20 > Modified: head/sys/conf/kern.post.mk > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/conf/kern.post.mk Tue May 12 14:47:38 2020 (r360963) > +++ head/sys/conf/kern.post.mk Tue May 12 15:22:40 2020 (r360964) > @@ -345,10 +345,7 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} >=20 > .depend: .PRECIOUS ${SRCS} >=20 > -.if ${COMPILER_TYPE} =3D=3D "clang" || \ > - (${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 60= 000) > _MAP_DEBUG_PREFIX=3D yes > -.endif >=20 > _ILINKS=3D machine > .if ${MACHINE} !=3D ${MACHINE_CPUARCH} && ${MACHINE} !=3D "arm64"= >=20 > Modified: head/sys/conf/kern.pre.mk > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/conf/kern.pre.mk Tue May 12 14:47:38 2020 (r360963) > +++ head/sys/conf/kern.pre.mk Tue May 12 15:22:40 2020 (r360964) > @@ -93,11 +93,7 @@ CFLAGS.gcc+=3D -fms-extensions > .if defined(CFLAGS_ARCH_PARAMS) > CFLAGS.gcc+=3D${CFLAGS_ARCH_PARAMS} > .endif > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 50000 > -WERROR?=3D -Wno-error > -.else > WERROR?=3D -Werror > -.endif > # The following should be removed no earlier than LLVM11 being=20= > imported into the > # tree, to ensure we don't regress the build. LLVM11 and GCC10=20= > will switch the > # default over to -fno-common, making this redundant. >=20 > Modified: head/sys/conf/kmod.mk > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/conf/kmod.mk Tue May 12 14:47:38 2020 (r360963) > +++ head/sys/conf/kmod.mk Tue May 12 15:22:40 2020 (r360964) > @@ -88,11 +88,7 @@ __KLD_SHARED=3Dno > .if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing= ) > CFLAGS+=3D -fno-strict-aliasing > .endif > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 50000 > -WERROR?=3D -Wno-error > -.else > WERROR?=3D -Werror > -.endif >=20 > LINUXKPI_GENSRCS+=3D \ > bus_if.h \ > @@ -160,11 +156,7 @@ CFLAGS+=3D -fPIC > # Temporary workaround for PR 196407, which contains the=20 > fascinating details. > # Don't allow clang to use fpu instructions or registers in kerne= l=20 > modules. > .if ${MACHINE_CPUARCH} =3D=3D arm > -.if ${COMPILER_VERSION} < 30800 > -CFLAGS.clang+=3D -mllvm -arm-use-movt=3D0 > -.else > CFLAGS.clang+=3D -mno-movt > -.endif > CFLAGS.clang+=3D -mfpu=3Dnone > CFLAGS+=3D -funwind-tables > .endif > @@ -283,10 +275,7 @@ ${FULLPROG}: ${OBJS} > ${OBJCOPY} --strip-debug ${.TARGET} > .endif >=20 > -.if ${COMPILER_TYPE} =3D=3D "clang" || \ > - (${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 60= 000) > _MAP_DEBUG_PREFIX=3D yes > -.endif >=20 > _ILINKS=3Dmachine > .if ${MACHINE_CPUARCH} =3D=3D "i386" || ${MACHINE_CPUARCH} =3D=3D= "amd64" >=20 > Modified: head/sys/modules/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/modules/Makefile Tue May 12 14:47:38 2020 (r360963) > +++ head/sys/modules/Makefile Tue May 12 15:22:40 2020 (r360964) > @@ -620,9 +620,7 @@ _aac=3D aac > _aacraid=3D aacraid > _acpi=3D acpi > .if ${MK_CRYPT} !=3D "no" || defined(ALL_MODULES) > -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} > 40201 > _aesni=3D aesni > -.endif > .endif > _amd_ecc_inject=3Damd_ecc_inject > _amdsbwd=3D amdsbwd >=20 > Modified: head/usr.sbin/acpi/acpidb/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/usr.sbin/acpi/acpidb/Makefile Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/usr.sbin/acpi/acpidb/Makefile Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -87,6 +87,6 @@ LIBADD=3D pthread > # integer to pointer, which is a GNU extension. > # > # Turn off the warning, because this is in contributed code. > -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 6= 0000 > +.if ${COMPILER_TYPE} =3D=3D "clang" > CWARNFLAGS+=3D -Wno-null-pointer-arithmetic > .endif >=20 > Modified: head/usr.sbin/trpt/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/usr.sbin/trpt/Makefile Tue May 12 14:47:38 2020 (r360963)= > +++ head/usr.sbin/trpt/Makefile Tue May 12 15:22:40 2020 (r360964)= > @@ -8,18 +8,12 @@ MAN=3D trpt.8 > BINGRP=3D kmem > BINMODE=3D 2555 >=20 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 50000 > -WARNS?=3D 4 > -.endif > - > .if ${MK_INET6_SUPPORT} !=3D "no" > CFLAGS+=3D -DINET6 > .endif >=20 > .include >=20 > -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D 50000= > # Several included system headers tickle this warning in ways tha= t are > # difficult to work around in this program. > CFLAGS+=3D -Wno-missing-variable-declarations > -.endif >=20 > Modified: head/usr.sbin/zic/zic/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/usr.sbin/zic/zic/Makefile Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/usr.sbin/zic/zic/Makefile Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -15,7 +15,7 @@ CFLAGS+=3D -I${.CURDIR:H}=20 > -I${SRCTOP}/contrib/tzcode/std >=20 > WARNS?=3D 2 >=20 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 503= 00 > +.if ${COMPILER_TYPE} =3D=3D "gcc" > CWARNFLAGS+=3D -Wno-error=3Dstrict-overflow > .endif >=20 >=20 >=20 > --=20 Brandon Bergren Technical Generalist From owner-svn-src-head@freebsd.org Wed May 13 04:52:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16BB32E701C for ; Wed, 13 May 2020 04:52:15 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic306-21.consmr.mail.gq1.yahoo.com (sonic306-21.consmr.mail.gq1.yahoo.com [98.137.68.84]) (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 49MMj94FXFz4VB3 for ; Wed, 13 May 2020 04:52:13 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: hxTqXNoVM1krm1NdDyZZ5_3FVc.XfgWwVGVJChm5FDiLq78IW._fK0th4eou6bD C_sOD87eZ8lB9WxU5zMAC7Ib20OlNIX4OL0rUy0iDBYhLFyhSWQ_NCIwSUX9rWUloiLUw.otrXAY vur3B0W59dLxVCWw3JHHANWx9lr2RrpgnDWNWLzNwWJ3uOI1yU5r__vW7Hk1J4DER20UwUatIqFc 1OrlQgiHHn2RfY8v6EIgakn4w8lNc1ALP7MCYBikUyDeabWfXaAczmOjsKdAGFz8y0t8X3yFoFbt K1unfDk_oxmk3RR6it7hJv2lVi5vxv12sxgMYMtBLaMFAJeohreEifp.fPrnhOiLVncqMhe7uBfj O5WofNmJt3Ziw6YHx35ID7qA8sPlU3ybxFaOKetRvupxsm..eYw0fQCTZIw8TskhinvHnKoGYh65 .sCktndbEbgb7s9W74N9GxUoAq22HJfyUnRMZ1KwR1779vbgJdyi2ZC3fr1tjOIyUYFZ0Agu98kg Nqtjd9lVTW8r2YH5f3FDY9fk8eytxbot_PRGRNTIg8oEPgiOU8g8RXBBJGcKbvM06LDFYBzIp26K HmO.PukWZii2LWUMEcluMrUVIeIUzyiZsSAAAy7AE.2Jr81tEfFe9d9nByF9RkQxPjjrMh6P9Idp Ks2ypfMnemHfjvwlQCMXgd9AH6dEPt0OigpFHh.RwP.yr4dk4xKiPmrtWJEaqNGU_KzRSzfsMlqs DjpjnvcJOlJ1qmL_agoI2vEmmftvG0Nm7ba8fHO3zB25s4YptFRwIT.zxG6u.sYGLbQ6nt.f7NQG BcEIJFiODbB1i7OeYI0Ycjv4Sdai.RNTsCLpCH_xP3_KpozdQCCFyCRdIkAqvv7MC6y4uC8tTIOL FmX7mI5BTb2tYQWZmvxLDLPf2QiTaOVSxNT08ZtcfmE7vGqM16k9.yHHoEEs04Vvmexq4VyOe802 z9H5Kv3w2TJ9_O6jcqrtvaHUrVLeckceTFsAvKG1EnPxp7rqQBoi3YQ4sl4bQbzmK6oasZL8x39X o00IHDHmSIh9AytfQEEYFW_Y9f5Vj8QtHMgK.mxlsbr1rn7ROb6ODpTWlt1WfPPSdjyGHTwBi9vz ZbYMOBYmOsWYRDlvlPqldOPD9jyaFfWqVjD2CwDm819GrCPHNUoaIi5wBljd2iBgLhqkARRwZ.uN VdYQ4fzuAupTQL8vsabWhs.XDOZHVinXrkV2ZoF797d1cdTPV6KwbIYsvN0yWqU2KHTwnBozqLdF TCkggOM7q55tN12BAhS9KRI6JS.F8HQx_cYO10Lgfh2bJpLLEZLIm_.04HGUYraB.eGQwapP4jWp VBipvEN4jfkDYSBBZnVNKV2CQpS0bVNzunzTsw_35z5poEW9LEDrThIWHdAeXpHLZ05LM7DbHyhk i42GiepvWtj.IrrYNTKN5jDkTYBLQFQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.gq1.yahoo.com with HTTP; Wed, 13 May 2020 04:52:10 +0000 Received: by smtp422.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 43ddc5f4b8c93e8a5b6a17dbda3e0423; Wed, 13 May 2020 04:52:09 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r360233 - in head: contrib/jemalloc . . . : This partially breaks a 2-socket 32-bit powerpc (old PowerMac G4) based on head -r360311 From: Mark Millard In-Reply-To: Date: Tue, 12 May 2020 21:52:06 -0700 Cc: Brandon Bergren , Justin Hibbits Content-Transfer-Encoding: quoted-printable Message-Id: <9562EEE4-62EF-4164-91C0-948CC0432984@yahoo.com> References: <8479DD58-44F6-446A-9CA5-D01F0F7C1B38@yahoo.com> <17ACDA02-D7EF-4F26-874A-BB3E935CD072@yahoo.com> <695E6836-F860-4557-B7DE-CC1EDB347F18@yahoo.com> <121B9B09-141B-4DC3-918B-1E7CFB99E779@yahoo.com> <8AAB0462-3FA8-490C-8D8D-7C15B1C9E2DE@yahoo.com> <18E62746-80DB-4195-977D-4FF32D0129EE@yahoo.com> To: "vangyzen@freebsd.org" , svn-src-head@freebsd.org, FreeBSD Current , FreeBSD Hackers , FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49MMj94FXFz4VB3 X-Spamd-Bar: / X-Spamd-Result: default: False [-0.97 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.57)[-0.570,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (4.89), ipnet: 98.137.64.0/21(0.83), asn: 36647(0.66), country: US(-0.05)]; NEURAL_SPAM_MEDIUM(0.10)[0.097,0]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[84.68.137.98.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[84.68.137.98.rep.mailspike.net : 127.0.0.17]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 04:52:15 -0000 [Yet another new kind of experiment. But this looks like I can cause problems in fairly sort order on demand now. Finally! And with that I've much better evidence for kernel vs. user-space process for making the zeroed memory appear in, for example, nfsd.] I've managed to get: : = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:258:= Failed assertion: "slab =3D=3D extent_slab_get(extent)" : = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:258:= Failed assertion: "slab =3D=3D extent_slab_get(extent)" and eventually: [1] Segmentation fault (core dumped) stress -m 2 --vm-bytes 1700M from a user program (stress) while another machine was attempted an nfs mount during the stress activity: # mount -onoatime,soft ...:/ /mnt && umount /mnt && rpcinfo -s ... [tcp] ...:/: RPCPROG_MNT: RPC: Timed out (To get failure I may have to run the commands multiple times. Timing details against stress's activity seem to matter.) That failure lead to: # ls -ldT /*.core* -rw------- 1 root wheel 3899392 May 12 19:52:26 2020 /mountd.core # ls -ldT *.core* -rw------- 1 root wheel 2682880 May 12 20:00:26 2020 stress.core (Note which of nfsd, mountd, or rpcbind need not be fully repeatable. stress.core seems to be written twice, probably because of the -m 2 in use.) The context that let me do this was to first (on the 2 socket G4 with a full 2048 MiBYte RAM configuration): stress -m 2 --vm-bytes 1700M & Note that the stress command keeps the memory busy and causes paging to the swap/page space. I've not tried to make it just fit without paging or just barely paging or such. The original context did not involve paging or low RAM, so I do not expect paging to be required but can be involved. The stress program backtrace is different: 4827 return (tls_get_addr_slow(dtvp, index, offset)); 4828 } (gdb) bt -full #0 0x41831b04 in tls_get_addr_common (dtvp=3D0x4186c010, index=3D2, = offset=3D4294937444) at /usr/src/libexec/rtld-elf/rtld.c:4824 dtv =3D 0x0 #1 0x4182bfcc in __tls_get_addr (ti=3D) at = /usr/src/libexec/rtld-elf/powerpc/reloc.c:848 tp =3D p =3D #2 0x41a83464 in __get_locale () at = /usr/src/lib/libc/locale/xlocale_private.h:199 No locals. #3 fprintf (fp=3D0x41b355f8, fmt=3D0x1804cbc "%s: FAIL: [%lli] (%d) ") = at /usr/src/lib/libc/stdio/fprintf.c:57 ap =3D {{gpr =3D 2 '\002', fpr =3D 0 '\000', reserved =3D 20731, = overflow_arg_area =3D 0xffffdb78, reg_save_area =3D 0xffffdae8}} ret =3D #4 0x01802348 in main (argc=3D, argv=3D) = at stress.c:415 status =3D ret =3D 6 do_dryrun =3D 0 retval =3D 0 children =3D 1 do_backoff =3D do_hdd_bytes =3D do_hdd =3D do_vm_keep =3D 0 do_vm_hang =3D -1 do_vm_stride =3D 4096 do_vm_bytes =3D 1782579200 do_vm =3D 108174317627375616 do_io =3D do_cpu =3D do_timeout =3D 108176117243859333 starttime =3D 1589338322 i =3D forks =3D pid =3D 6140 stoptime =3D runtime =3D Apparently the asserts did not stop the code and it ran until a failure occurred (via dtv=3D0x0). Stress uses a mutex stored on a page that gets the "turns into zeros" problem, preventing the mprotect(ADDR,1,1) type of test because stress will write on the page. (I've not tried to find a minimal form of stress run.) The the same sort of globals are again zeroed, such as: (gdb) print/x __je_sz_size2index_tab $1 =3D {0x0 } Another attempt lost rpcbind instead instead of mountd: # ls -ldT /*.core -rw------- 1 root wheel 3899392 May 12 19:52:26 2020 /mountd.core -rw------- 1 root wheel 3170304 May 12 20:03:00 2020 /rpcbind.core I again find that when I use gdb 3 times to: attach ??? x/x __je_sz_size2index_tab print (int)mprotext(ADDRESS,1,1) quit for each of rpcbind, mountd, and nfsd master that those processes no longer fail during the mount/umount/rpcinfo (or are far less likely to). But it turns out that later when I "service nfsd stop" nfsd does get the zeroed Memory based assert and core dumps. (I'd done a bunch of the mount/umount/ rpcinfo sequences before the stop.) That the failure is during SIGUSR1 based shutdown, leads me to wonder if killing off some child process(es) is involved in the problem. There was *no* evidence of a signal for an attempt to write the page from the user process. It appears that the kernel is doing something that changes what the process sees --instead of the user-space programs stomping on its own memory content. I've no clue how to track down the kernel activity that changes what the process sees on some page(s) of memory. (Prior testing with a debug kernel did not report problems, despite getting an example failure. So that seems insufficient.) At least a procedure is now known that does not involved waiting hours or days. The procedure (adjusted for how much RAM is present and number of cpus/cores?) could be appropriate to run in other contexts than the 32-bit powerpc G4. Part of the context likely should be not using MALLOC_PRODUCTION --so problems would be detected sooner via the asserts in jemalloc. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Wed May 13 06:24:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7B952EAD7E; Wed, 13 May 2020 06:24:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MPm65NLtz4ZZ5; Wed, 13 May 2020 06:24:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF73A1D1B5; Wed, 13 May 2020 06:24:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04D6OsMo069192; Wed, 13 May 2020 06:24:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D6OsLF069191; Wed, 13 May 2020 06:24:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005130624.04D6OsLF069191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 13 May 2020 06:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361001 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 361001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 06:24:54 -0000 Author: avg Date: Wed May 13 06:24:54 2020 New Revision: 361001 URL: https://svnweb.freebsd.org/changeset/base/361001 Log: sound/hda: newer AMD devices still require the same PCIe snoop So, replicate the ATI vendor snoop configuration for the AMD vendor. I think that this should fix a number of cases where users currently have to resort to polling or disabling MSI. MFC after: 1 week Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed May 13 02:17:27 2020 (r361000) +++ head/sys/dev/sound/pci/hda/hdac.c Wed May 13 06:24:54 2020 (r361001) @@ -197,6 +197,7 @@ static const struct { } hdac_pcie_snoop[] = { { INTEL_VENDORID, 0x00, 0x00, 0x00 }, { ATI_VENDORID, 0x42, 0xf8, 0x02 }, + { AMD_VENDORID, 0x42, 0xf8, 0x02 }, { NVIDIA_VENDORID, 0x4e, 0xf0, 0x0f }, }; From owner-svn-src-head@freebsd.org Wed May 13 06:26:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 659E32EAE0E; Wed, 13 May 2020 06:26:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MPnz24Svz4Zhw; Wed, 13 May 2020 06:26:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 423EB1D1B6; Wed, 13 May 2020 06:26:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04D6QVTS069316; Wed, 13 May 2020 06:26:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D6QVWh069315; Wed, 13 May 2020 06:26:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005130626.04D6QVWh069315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 13 May 2020 06:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361002 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 361002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 06:26:31 -0000 Author: avg Date: Wed May 13 06:26:30 2020 New Revision: 361002 URL: https://svnweb.freebsd.org/changeset/base/361002 Log: snd_hda: fix typos related to quirks set via 'config' tunable One wrong quirk bit, one wrong variable name. MFC after: 1 week Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed May 13 06:24:54 2020 (r361001) +++ head/sys/dev/sound/pci/hda/hdac.c Wed May 13 06:26:30 2020 (r361002) @@ -65,7 +65,7 @@ static const struct { const char *key; uint32_t value; } hdac_quirks_tab[] = { - { "64bit", HDAC_QUIRK_DMAPOS }, + { "64bit", HDAC_QUIRK_64BIT }, { "dmapos", HDAC_QUIRK_DMAPOS }, { "msi", HDAC_QUIRK_MSI }, }; @@ -279,10 +279,10 @@ hdac_config_fetch(struct hdac_softc *sc, uint32_t *on, ); if (inv == 0) { *on |= hdac_quirks_tab[k].value; - *on &= ~hdac_quirks_tab[k].value; + *off &= ~hdac_quirks_tab[k].value; } else if (inv != 0) { *off |= hdac_quirks_tab[k].value; - *off &= ~hdac_quirks_tab[k].value; + *on &= ~hdac_quirks_tab[k].value; } break; } From owner-svn-src-head@freebsd.org Wed May 13 07:29:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7CFD52EC836 for ; Wed, 13 May 2020 07:29:15 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic306-19.consmr.mail.gq1.yahoo.com (sonic306-19.consmr.mail.gq1.yahoo.com [98.137.68.82]) (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 49MRBL1px4z4fRF for ; Wed, 13 May 2020 07:29:14 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 8E92OWQVM1kjx.V0psqp37JR0A6OiadqLBqZxQTMpzvpvQd1SkZB.qC7qV8g7ol 8gaY51lNKSWHU4BNFKBk3YJb3lfPFUbLWRZizXuHFUqmTspoEWdZvTJU2eRbEWyfSgNYzCh2iBTF DTfgsd6xX8KaxR8yel7fDrqmtXOZGSSIHWKpxzkh2YkzQutzyxBoqAcnGL7IzB_hsVmhZxgb1169 bATqjm8K0dz636t3ZfeodD4qSzT34FaSQuPO1N_e3CMNLby9XF5.8spuXMqMkhFHtuwhzTqkgSjJ QKzBUqswkTIRElp1gRjwRZf4p.aa_ycWsbVKHCEI5rw7qOOce4pUuPBUd6UMF.N6WV6jForvheAY LRYzxp_88bf_2LKZr9I_NXZpewnBWkj4pcpdZOV0tuliy8RlS1vm4V5hZrU724sq9u4c1Gs59pKS G313r_3uCAnRVhKCH6TsGOx6MVovfSySqDj3AcBRn1f.oKotJggpaLJQ6I1RO2yRBkXoW0B4VVoN Y38XsFDWo3uB8qSXg5Ml10dTQuP9s_EGw5vXC_LoxloopBgnPo2F1IAT0VkyeZoJV6IISecLX1QF tWkiImhP4H0SQeQ0HzeaWbOhuplX8QwBy915kkdNKo_wDaT9KNmO9ac1vrm2qhZLGYqj5w3M2tsY KdolnuE_iVdIvqFkpl2mC6lezmTAkKR0TvVneUChgYdes9UHz0v3D9MDfJ2dYt5OVFdoXcDk0_M1 6QwavDlXXvIY5SmYBlCgn1NImFsG6poFajjyrIrK6N4ocBolHCcfirzT5hk.Sc2j6sd8DlyAfLOR qjTMvD0Bdvb02QeA7S6zW8UgGsF.jz8i5Z9xqzqDOC9FS0CCt73Ui1eiN.zmruUTo7rer_WDWtNI 73wtd339a66u4H9tjkagzG3laydaw72wyz9950mW9pOABNj3jq2ohaR2mliHtgemrUnCPsRPEE6. 9wTebdW224Taq7ObWJ55Se1AsgSqH2IAwqDSp3bCwJ2D3vS7nV.C9699ilm9jXQ3YeZTnr5e898. VZ4s_2KQ1XRFcsoZg9r6pRDjprtuxCLt1UbB_T.aKzIla7EPZwVGoZ7S8ZRfv9PxEulXh096qcD4 wgPeDCi_3rTxfPR8AxoTVe68nQmIlk3CcqagKTIt8L8eUwHn5fZ.8a0Y1Yxa4gyLSI51bCNxpicQ Uj3gF1LYfB.O3eqaG2bQOBNFDWAIPyNtI3WIjtiR4VmCoTm9H63kyCNc0LDhPU0uGjwF1Mq8aOQ. Uu0EgnIRqcyb9mb4n3R2Ggr7pPBa6KT9.cUwHwmkrffdDp5a.LTsPc6GieVm5B5QhN3ibcFgZM9h BE3mvXu0UUiRyzsXS6ytAADOIvvS8gtf9ExIw_jXWeSCbeCHrS.upSmanMQkoyioF5fy5IEKMnHw mLDtAYnez5Ll3Bn0QhdwMJMXiYkC2Xr2Ln7It8l7fXHW_Ll61rrrPHaP6jP514H_FPw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.gq1.yahoo.com with HTTP; Wed, 13 May 2020 07:29:12 +0000 Received: by smtp412.mail.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 8bcb3d014077aa2d68dc334f30fdedbe; Wed, 13 May 2020 07:29:08 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r360233 - in head: contrib/jemalloc . . . : This partially breaks a 2-socket 32-bit powerpc (old PowerMac G4) based on head -r360311 From: Mark Millard In-Reply-To: <9562EEE4-62EF-4164-91C0-948CC0432984@yahoo.com> Date: Wed, 13 May 2020 00:29:07 -0700 Cc: Brandon Bergren , Justin Hibbits Content-Transfer-Encoding: quoted-printable Message-Id: <9B68839B-AEC8-43EE-B3B6-B696A4A57DAE@yahoo.com> References: <8479DD58-44F6-446A-9CA5-D01F0F7C1B38@yahoo.com> <17ACDA02-D7EF-4F26-874A-BB3E935CD072@yahoo.com> <695E6836-F860-4557-B7DE-CC1EDB347F18@yahoo.com> <121B9B09-141B-4DC3-918B-1E7CFB99E779@yahoo.com> <8AAB0462-3FA8-490C-8D8D-7C15B1C9E2DE@yahoo.com> <18E62746-80DB-4195-977D-4FF32D0129EE@yahoo.com> <9562EEE4-62EF-4164-91C0-948CC0432984@yahoo.com> To: "vangyzen@freebsd.org" , svn-src-head@freebsd.org, FreeBSD Current , FreeBSD Hackers , FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49MRBL1px4z4fRF X-Spamd-Bar: - X-Spamd-Result: default: False [-1.10 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.21)[-0.208,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.40)[-0.395,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (5.37), ipnet: 98.137.64.0/21(0.83), asn: 36647(0.66), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[82.68.137.98.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[82.68.137.98.rep.mailspike.net : 127.0.0.17]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 07:29:15 -0000 [stress alone is sufficient to have jemalloc asserts fail in stress, no need for a multi-socket G4 either. No need to involve nfsd, mountd, rpcbind or the like. This is not a claim that I know all the problems to be the same, just that a jemalloc reported failure in this simpler context happens and zeroed pages are involved.] Reminder: head -r360311 based context. First I show a single CPU/core PowerMac G4 context failing in stress. (I actually did this later, but it is the simpler context.) I simply moved the media from the 2-socket G4 to this slower, single-cpu/core one. cpu0: Motorola PowerPC 7400 revision 2.9, 466.42 MHz cpu0: Features 9c000000 cpu0: HID0 8094c0a4 real memory =3D 1577857024 (1504 MB) avail memory =3D 1527508992 (1456 MB) # stress -m 1 --vm-bytes 1792M stress: info: [1024] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd : = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:258:= Failed assertion: "slab =3D=3D extent_slab_get(extent)" stress: FAIL: [1024] (415) <-- worker 1025 got signal 6 stress: WARN: [1024] (417) now reaping child worker processes stress: FAIL: [1024] (451) failed run completed in 243s (Note: 1792 is the biggest it allowed with M.) The following still pages in and out and fails: # stress -m 1 --vm-bytes 1290M stress: info: [1163] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd : = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:258:= Failed assertion: "slab =3D=3D extent_slab_get(extent)" . . . By contrast, the following had no problem for as long as I let it run --and did not page in or out: # stress -m 1 --vm-bytes 1280M stress: info: [1181] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd The 2 socket PowerMac G4 context with 2048 MiByte of RAM . . . stress -m 1 --vm-bytes 1792M did not (quickly?) fail or page. 1792 is as large as it would allow with M. The following also did not (quickly?) fail (and were not paging): stress -m 2 --vm-bytes 896M stress -m 4 --vm-bytes 448M stress -m 8 --vm-bytes 224M (Only 1 example was run at a time.) But the following all did quickly fail (and were paging): stress -m 8 --vm-bytes 225M stress -m 4 --vm-bytes 449M stress -m 2 --vm-bytes 897M (Only 1 example was run at a time.) I'll note that when I exited an su process I ended up with a: : = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:200: Failed = assertion: "ret =3D=3D sz_index2size_compute(index)" Abort trap (core dumped) and a matching su.core file. It appears that stress's activity leads to other processes also seeing examples of the zeroed-page(s) problem (probably su had paged some or had been fully swapped out): (gdb) bt #0 thr_kill () at thr_kill.S:4 #1 0x503821d0 in __raise (s=3D6) at /usr/src/lib/libc/gen/raise.c:52 #2 0x502e1d20 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 #3 0x502d6144 in sz_index2size_lookup (index=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:200 #4 sz_index2size (index=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:207 #5 ifree (tsd=3D0x5008b018, ptr=3D0x50041460, tcache=3D0x5008b138, = slow_path=3D) at jemalloc_jemalloc.c:2583 #6 0x502d5cec in __je_free_default (ptr=3D0x50041460) at = jemalloc_jemalloc.c:2784 #7 0x502d62d4 in __free (ptr=3D0x50041460) at jemalloc_jemalloc.c:2852 #8 0x501050cc in openpam_destroy_chain (chain=3D0x50041480) at = /usr/src/contrib/openpam/lib/libpam/openpam_load.c:113 #9 0x50105094 in openpam_destroy_chain (chain=3D0x500413c0) at = /usr/src/contrib/openpam/lib/libpam/openpam_load.c:111 #10 0x50105094 in openpam_destroy_chain (chain=3D0x50041320) at = /usr/src/contrib/openpam/lib/libpam/openpam_load.c:111 #11 0x50105094 in openpam_destroy_chain (chain=3D0x50041220) at = /usr/src/contrib/openpam/lib/libpam/openpam_load.c:111 #12 0x50105094 in openpam_destroy_chain (chain=3D0x50041120) at = /usr/src/contrib/openpam/lib/libpam/openpam_load.c:111 #13 0x50105094 in openpam_destroy_chain (chain=3D0x50041100) at = /usr/src/contrib/openpam/lib/libpam/openpam_load.c:111 #14 0x50105014 in openpam_clear_chains (policy=3D0x50600004) at = /usr/src/contrib/openpam/lib/libpam/openpam_load.c:130 #15 0x50101230 in pam_end (pamh=3D0x50600000, status=3D) = at /usr/src/contrib/openpam/lib/libpam/pam_end.c:83 #16 0x1001225c in main (argc=3D, argv=3D0x0) at = /usr/src/usr.bin/su/su.c:477 (gdb) print/x __je_sz_size2index_tab $1 =3D {0x0 } Notes: Given that the original problem did not involve paging to the swap partition, may be just making it to the Laundry list or some such is sufficient, something that is also involved when the swap space is partially in use (according to top). Or sitting in the inactive list for a long time, if that has some special status. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Wed May 13 07:47:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57FD72EDB69; Wed, 13 May 2020 07:47:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MRbx1hSPz3D8b; Wed, 13 May 2020 07:47:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30CDA1E175; Wed, 13 May 2020 07:47:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04D7lvKL018761; Wed, 13 May 2020 07:47:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D7lv67018760; Wed, 13 May 2020 07:47:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005130747.04D7lv67018760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 13 May 2020 07:47:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361006 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 07:47:57 -0000 Author: avg Date: Wed May 13 07:47:56 2020 New Revision: 361006 URL: https://svnweb.freebsd.org/changeset/base/361006 Log: linuxkpi: print stack trace in WARN_ON macros Reviewed by: hselasky, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24779 Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Wed May 13 06:47:54 2020 (r361005) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Wed May 13 07:47:56 2020 (r361006) @@ -107,6 +107,7 @@ if (__ret) { \ printf("WARNING %s failed at %s:%d\n", \ __stringify(cond), __FILE__, __LINE__); \ + linux_dump_stack(); \ } \ unlikely(__ret); \ }) @@ -120,6 +121,7 @@ __warn_on_once = 1; \ printf("WARNING %s failed at %s:%d\n", \ __stringify(cond), __FILE__, __LINE__); \ + linux_dump_stack(); \ } \ unlikely(__ret); \ }) From owner-svn-src-head@freebsd.org Wed May 13 07:49:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 174542EDBE7; Wed, 13 May 2020 07:49:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MRdN6sS0z3DJj; Wed, 13 May 2020 07:49:12 +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 E68361E176; Wed, 13 May 2020 07:49:12 +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 04D7nCbD018865; Wed, 13 May 2020 07:49:12 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D7nCss018864; Wed, 13 May 2020 07:49:12 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005130749.04D7nCss018864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 13 May 2020 07:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361007 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 07:49:13 -0000 Author: manu Date: Wed May 13 07:49:12 2020 New Revision: 361007 URL: https://svnweb.freebsd.org/changeset/base/361007 Log: linuxkpi: Add EBADRQC to errno.h This is used in the amdgpu driver from Linux 5.2 Sponsored-by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24807 Modified: head/sys/compat/linuxkpi/common/include/linux/errno.h Modified: head/sys/compat/linuxkpi/common/include/linux/errno.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/errno.h Wed May 13 07:47:56 2020 (r361006) +++ head/sys/compat/linuxkpi/common/include/linux/errno.h Wed May 13 07:49:12 2020 (r361007) @@ -33,6 +33,8 @@ #include +#define EBADRQC 56 /* Bad request code */ + #define ECHRNG EDOM #define ETIME ETIMEDOUT #define ECOMM ESTALE From owner-svn-src-head@freebsd.org Wed May 13 08:43:29 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5E352EEE7A for ; Wed, 13 May 2020 08:43:29 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic312-23.consmr.mail.gq1.yahoo.com (sonic312-23.consmr.mail.gq1.yahoo.com [98.137.69.204]) (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 49MSr01lJlz3HXv for ; Wed, 13 May 2020 08:43:27 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: JcuqEyYVM1n16L7Heovzfmq3h815crg5hv6fPDYHSgs3lYKXCy8a1eN2_Mi220S gJc9X_k0O.CEoYEzkCzEDyKdhOrnJ90g85NRM_h9r.V7TrP7YUa7_LisQE.o4zZFwsNHaYO1gbUe CPkdim9V713ydBMaSqY7lDePBz_6PK4aN6Dakwf1RvuxlrJkIbzhYRkfEhJ40Thq.k7mxGDYMAuC TUD0C_CccVPYBmqWUBAAFINIUylfbjOtovyxsdNy4jsNfTJR7QbdI0be0K5NVKyQs2CJ3CSHLPtd Q2VkYoRYn9YnxBl_W26auilF9PAT7u3V1.BD.RvpedUqHbUngsTDqpp6Kocv6FV1P01ehsYwMu9h McNzQLqg68Ku9ensOfg2wL3m4Tm0LOsQzsnCWd4mfRqMxmUztNzaJ7OJMqBaMju0KJbwScRkYTdo ZYtFigJWxSQgs.HXwV6PxC3Owya9UuzySnTRdqQURm60ZA0y2fRCl8vH7D0ebMcTtot5kvOineU0 gjHZocjZDLRbgj6hfQYB3ESVfFUNPLW1v0LD4ltC_u6QydxZJ.6hvq6xZMYpQeMpqoVvB22LnhLY Q1GOYNCvpY.7ZpWHA529itWO7J3bV3lMTwe7jTV7OErQTasHp5bZFD2AYhRtoqlJ4gxEL0tyzE.3 MepGbWH0.IYZMaUlXMksZnuOBJdvWywdWprjstKQrnpTaR2fBb2.FQZ5Qt1CsKi6b5E8B5aITvv4 WnZnghA9tDeYeVaC5pkC.8OJ5MDCWMnhSGcKTOi8oI7W7_iAK2daAYfyE5TNk9zaI7dVRIsku5D3 9seL1Z_92ReB1PfYtMUfzfnScbt5h2BsbTSk7FkVDbCzcThtsZBh9j37lrlpP.3XjYjY_GPD9sCC vh2dmeWa4b.OLsXVBj1uU9CqkBgcQHiHM0ZluYF.2fNABtcCuxE4Wv7nAQD5Ghwxloucdbl4636b nTK2vlvE1j3Fdg5RPLVjqMW5Vr9wPawK46HV9G.QPf1C2joZ32_z9mOjdqJ5KiQdXkc3M7TvnDh6 SX_yPgjAjLydeDx8bVty6mX3c93i5wHLcVI8uVEezaIt8IYafcepOq8v9tc5umKY2Or0Pr0tKVhc ifaE6Degc4s9L8Sb.rLOlgG7ofUk2_a6rz1sRQAyRL7AKeqRtJqLbBknf_Z1Ts1JfzRwSanh56Pz ygElbWOpjUF6PvFATIdsO21haNucI25G1nNCLXrxcnv0z3JIC1UTLRviMdWNjETbjakv_OMMnObC Ibp6JFKTbqLAMi3T0gTKfytgjV1OAzAeJmRGYfrmv8pFyNvF.wNwExAsL4kl80ogHXitYrb42M0a Yq2SiEkHQx3UTSEPVCEAtKmoS5nBcpr8G.PNFOgK.5gCtMGsrGpiG20bgDDurGxnCbOO0.4uIQEK u_IqjEFJp5StoiUGIaKG1gOXI9mldbmQ- Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.gq1.yahoo.com with HTTP; Wed, 13 May 2020 08:43:26 +0000 Received: by smtp429.mail.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 31a8d8875d7f20b3e1c3e41b2146484f; Wed, 13 May 2020 08:43:24 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r360233 - in head: contrib/jemalloc . . . : This partially breaks a 2-socket 32-bit powerpc (old PowerMac G4) based on head -r360311 From: Mark Millard In-Reply-To: <9B68839B-AEC8-43EE-B3B6-B696A4A57DAE@yahoo.com> Date: Wed, 13 May 2020 01:43:23 -0700 Cc: Brandon Bergren , Justin Hibbits Content-Transfer-Encoding: quoted-printable Message-Id: <359C9C7D-4106-42B5-AAB5-08EF995B8100@yahoo.com> References: <8479DD58-44F6-446A-9CA5-D01F0F7C1B38@yahoo.com> <17ACDA02-D7EF-4F26-874A-BB3E935CD072@yahoo.com> <695E6836-F860-4557-B7DE-CC1EDB347F18@yahoo.com> <121B9B09-141B-4DC3-918B-1E7CFB99E779@yahoo.com> <8AAB0462-3FA8-490C-8D8D-7C15B1C9E2DE@yahoo.com> <18E62746-80DB-4195-977D-4FF32D0129EE@yahoo.com> <9562EEE4-62EF-4164-91C0-948CC0432984@yahoo.com> <9B68839B-AEC8-43EE-B3B6-B696A4A57DAE@yahoo.com> To: "vangyzen@freebsd.org" , svn-src-head@freebsd.org, FreeBSD Current , FreeBSD Hackers , FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49MSr01lJlz3HXv X-Spamd-Bar: - X-Spamd-Result: default: False [-1.04 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.18)[-0.176,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.36)[-0.364,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (5.09), ipnet: 98.137.64.0/21(0.83), asn: 36647(0.66), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[204.69.137.98.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[204.69.137.98.rep.mailspike.net : 127.0.0.17]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 08:43:30 -0000 [I'm adding a reference to an old arm64/aarch64 bug that had pages turning to zero, in case this 32-bit powerpc issue is somewhat analogous.] On 2020-May-13, at 00:29, Mark Millard wrote: > [stress alone is sufficient to have jemalloc asserts fail > in stress, no need for a multi-socket G4 either. No need > to involve nfsd, mountd, rpcbind or the like. This is not > a claim that I know all the problems to be the same, just > that a jemalloc reported failure in this simpler context > happens and zeroed pages are involved.] >=20 > Reminder: head -r360311 based context. >=20 >=20 > First I show a single CPU/core PowerMac G4 context failing > in stress. (I actually did this later, but it is the > simpler context.) I simply moved the media from the > 2-socket G4 to this slower, single-cpu/core one. >=20 > cpu0: Motorola PowerPC 7400 revision 2.9, 466.42 MHz > cpu0: Features 9c000000 > cpu0: HID0 8094c0a4 > real memory =3D 1577857024 (1504 MB) > avail memory =3D 1527508992 (1456 MB) >=20 > # stress -m 1 --vm-bytes 1792M > stress: info: [1024] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd > : = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:258:= Failed assertion: "slab =3D=3D extent_slab_get(extent)" > stress: FAIL: [1024] (415) <-- worker 1025 got signal 6 > stress: WARN: [1024] (417) now reaping child worker processes > stress: FAIL: [1024] (451) failed run completed in 243s >=20 > (Note: 1792 is the biggest it allowed with M.) >=20 > The following still pages in and out and fails: >=20 > # stress -m 1 --vm-bytes 1290M > stress: info: [1163] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd > : = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:258:= Failed assertion: "slab =3D=3D extent_slab_get(extent)" > . . . >=20 > By contrast, the following had no problem for as > long as I let it run --and did not page in or out: >=20 > # stress -m 1 --vm-bytes 1280M > stress: info: [1181] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd >=20 >=20 >=20 >=20 > The 2 socket PowerMac G4 context with 2048 MiByte of RAM . . . >=20 > stress -m 1 --vm-bytes 1792M >=20 > did not (quickly?) fail or page. 1792 > is as large as it would allow with M. >=20 > The following also did not (quickly?) fail > (and were not paging): >=20 > stress -m 2 --vm-bytes 896M > stress -m 4 --vm-bytes 448M > stress -m 8 --vm-bytes 224M >=20 > (Only 1 example was run at a time.) >=20 > But the following all did quickly fail (and were > paging): >=20 > stress -m 8 --vm-bytes 225M > stress -m 4 --vm-bytes 449M > stress -m 2 --vm-bytes 897M >=20 > (Only 1 example was run at a time.) >=20 > I'll note that when I exited an su process > I ended up with a: >=20 > : = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:200: Failed = assertion: "ret =3D=3D sz_index2size_compute(index)" > Abort trap (core dumped) >=20 > and a matching su.core file. It appears > that stress's activity leads to other > processes also seeing examples of the > zeroed-page(s) problem (probably su had > paged some or had been fully swapped > out): >=20 > (gdb) bt > #0 thr_kill () at thr_kill.S:4 > #1 0x503821d0 in __raise (s=3D6) at /usr/src/lib/libc/gen/raise.c:52 > #2 0x502e1d20 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 > #3 0x502d6144 in sz_index2size_lookup (index=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:200 > #4 sz_index2size (index=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:207 > #5 ifree (tsd=3D0x5008b018, ptr=3D0x50041460, tcache=3D0x5008b138, = slow_path=3D) at jemalloc_jemalloc.c:2583 > #6 0x502d5cec in __je_free_default (ptr=3D0x50041460) at = jemalloc_jemalloc.c:2784 > #7 0x502d62d4 in __free (ptr=3D0x50041460) at = jemalloc_jemalloc.c:2852 > #8 0x501050cc in openpam_destroy_chain (chain=3D0x50041480) at = /usr/src/contrib/openpam/lib/libpam/openpam_load.c:113 > #9 0x50105094 in openpam_destroy_chain (chain=3D0x500413c0) at = /usr/src/contrib/openpam/lib/libpam/openpam_load.c:111 > #10 0x50105094 in openpam_destroy_chain (chain=3D0x50041320) at = /usr/src/contrib/openpam/lib/libpam/openpam_load.c:111 > #11 0x50105094 in openpam_destroy_chain (chain=3D0x50041220) at = /usr/src/contrib/openpam/lib/libpam/openpam_load.c:111 > #12 0x50105094 in openpam_destroy_chain (chain=3D0x50041120) at = /usr/src/contrib/openpam/lib/libpam/openpam_load.c:111 > #13 0x50105094 in openpam_destroy_chain (chain=3D0x50041100) at = /usr/src/contrib/openpam/lib/libpam/openpam_load.c:111 > #14 0x50105014 in openpam_clear_chains (policy=3D0x50600004) at = /usr/src/contrib/openpam/lib/libpam/openpam_load.c:130 > #15 0x50101230 in pam_end (pamh=3D0x50600000, status=3D) at /usr/src/contrib/openpam/lib/libpam/pam_end.c:83 > #16 0x1001225c in main (argc=3D, argv=3D0x0) at = /usr/src/usr.bin/su/su.c:477 >=20 > (gdb) print/x __je_sz_size2index_tab > $1 =3D {0x0 } >=20 >=20 > Notes: >=20 > Given that the original problem did not involve > paging to the swap partition, may be just making > it to the Laundry list or some such is sufficient, > something that is also involved when the swap > space is partially in use (according to top). Or > sitting in the inactive list for a long time, if > that has some special status. >=20 The following is was a fix for a "pages magically turn into zeros" problem on amd64/aarch64. The original 32-bit powerpc context did not seem a match to me --but the stress test behavior that I've just observed seems closer from an external-test point of view: swapping is involved. My be this will suggest something to someone that knows what they are doing. (Note: dsl-only.net closed down, so the E-mail address reference is no longer valid.) Author: kib Date: Mon Apr 10 15:32:26 2017 New Revision: 316679 URL:=20 https://svnweb.freebsd.org/changeset/base/316679 Log: Do not lose dirty bits for removing PROT_WRITE on arm64. Arm64 pmap interprets accessed writable ptes as modified, since ARMv8.0 does not track Dirty Bit Modifier in hardware. If writable bit is removed, page must be marked as dirty for MI VM. This change is most important for COW, where fork caused losing content of the dirty pages which were not yet scanned by pagedaemon. Reviewed by: alc, andrew Reported and tested by: Mark Millard PR: 217138, 217239 Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- head/sys/arm64/arm64/pmap.c Mon Apr 10 12:35:58 2017 = (r316678) +++ head/sys/arm64/arm64/pmap.c Mon Apr 10 15:32:26 2017 = (r316679) @@ -2481,6 +2481,11 @@ pmap_protect(pmap_t pmap, vm_offset_t sv sva +=3D L3_SIZE) { l3 =3D pmap_load(l3p); if (pmap_l3_valid(l3)) { + if ((l3 & ATTR_SW_MANAGED) && + pmap_page_dirty(l3)) { + vm_page_dirty(PHYS_TO_VM_PAGE(l3 = & + ~ATTR_MASK)); + } pmap_set(l3p, ATTR_AP(ATTR_AP_RO)); PTE_SYNC(l3p); /* XXX: Use pmap_invalidate_range */ =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Wed May 13 14:36:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BD882F7D1E; Wed, 13 May 2020 14:36:45 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49Mcgc1spqz47FM; Wed, 13 May 2020 14:36:43 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from [IPv6:2600:380:6868:efb0:fcf9:9563:f260:7e53] (unknown [IPv6:2600:380:6868:efb0:fcf9:9563:f260:7e53]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 2B50B564A6; Wed, 13 May 2020 09:36:37 -0500 (CDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Eric van Gyzen Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r360964 - in head: lib/libclang_rt lib/libthr lib/msun libexec/rtld-elf libexec/tftpd/tests share/mk stand stand/arm/uboot stand/efi stand/efi/boot1 stand/efi/loader stand/i386/boot2 st... Date: Wed, 13 May 2020 09:36:34 -0500 Message-Id: <07A37747-B865-4487-8D20-ED1B03ECCDF9@vangyzen.net> References: Cc: Ravi Pokala , Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: To: Brandon Bergren X-Mailer: iPhone Mail (17E262) X-Rspamd-Queue-Id: 49Mcgc1spqz47FM X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of eric@vangyzen.net designates 199.48.133.146 as permitted sender) smtp.mailfrom=eric@vangyzen.net X-Spamd-Result: default: False [-4.87 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[vangyzen.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(-3.07)[ip: (-7.91), ipnet: 199.48.132.0/22(-3.60), asn: 36236(-3.79), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:36236, ipnet:199.48.132.0/22, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 14:36:45 -0000 > =EF=BB=BFWhy is this marked for MFC? FreeBSD 12 uses base GCC 4.2.1 on som= e platforms. You=E2=80=99re right, this won=E2=80=99t be MFC=E2=80=99d. My client is con= figured to add the MFC by default, and I failed to remove it. Eric= From owner-svn-src-head@freebsd.org Wed May 13 15:56:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E48032F9A18; Wed, 13 May 2020 15:56:37 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MfRm6J8hz4Cjp; Wed, 13 May 2020 15:56:36 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-qk1-x741.google.com with SMTP id y22so5219351qki.3; Wed, 13 May 2020 08:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AorPKGANpreDu+Uw1/aaP88YkeF7NB6uV/b4eKDQVhM=; b=k/Jk0ssqncUGxCMPu4IbpADHW9LkIeL34iOrXY+5Biyx5dpZcFFQQkDlVmdZuQMiwK gm2hU67eOn95FWgA4URmJNUVXu2wtwxVKtn7NqBnRCUilvHTScxG+02l7bYRY0L3iXC0 Ndsl+We+OBBmD9hxfKVys770l/BPGIO5hctvOtgealtnLeAx6j2TQ+DHYw9mLSTR9lRV 2lHaGpvNpCtirWL+3/ksD8C4ZaPhGJUUmEAlUM56sASYB0x/0dQNJnd/9KXaATB4Na74 q3rAxUB9AsevB+DoWb2pVV/ceJg18ha99k+l+XmtjNAJUBP7U0IskDMbNteNFb1LeQkR XzSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AorPKGANpreDu+Uw1/aaP88YkeF7NB6uV/b4eKDQVhM=; b=gY2LTAaP49eLwPgVK7iDhYp4M2ijXpY2lg5L3pQkIRtdybExHSLGl3GuyCUEDucUhv gS1vzJdntkFHIpcdn5DzF9wV3umCshMoCzp+y9Bss4bawwLOs30ud0SwDVH0Xy5WuWT0 3ZpmjpbFfiOouzFFtC6BGh2ybrMNCVE/a9aB2AMmfpU/7p8Vooxev+jIRjoK92xh3hp9 IGSYFUrY8iXpHRbaqN8kUfHZq/f9hurJ+vA2gO37piNMW1SML07AJwuOKjstAlf3ZC4w NgMY9GMOg9Ght7mD98aJbr9Ls4GD8gVlBaSmJ0r0qZGopzkG4RHFe7XLAlaZIyLf6f+C F1WA== X-Gm-Message-State: AOAM531fgmCnqeK/NQYPeWTHoglY8cKGB3SjPucJgndPq6KdzcPQKgsm 09hSGpocpwl3D2MJncxrl5I= X-Google-Smtp-Source: ABdhPJy32QdNkjYh2lRrNzio3NWbm85r3Q1aP+/yT6mGNVhkcHOzzmYpla1TZNMld0yrVLw0/eRKNA== X-Received: by 2002:a37:a687:: with SMTP id p129mr343629qke.45.1589385395999; Wed, 13 May 2020 08:56:35 -0700 (PDT) Received: from titan.knownspace (173-19-125-130.client.mchsi.com. [173.19.125.130]) by smtp.gmail.com with ESMTPSA id v78sm133399qkb.62.2020.05.13.08.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 08:56:35 -0700 (PDT) Date: Wed, 13 May 2020 10:56:32 -0500 From: Justin Hibbits To: Mark Millard Cc: "vangyzen@freebsd.org" , svn-src-head@freebsd.org, FreeBSD Current , FreeBSD Hackers , FreeBSD PowerPC ML , Brandon Bergren Subject: Re: svn commit: r360233 - in head: contrib/jemalloc . . . : This partially breaks a 2-socket 32-bit powerpc (old PowerMac G4) based on head -r360311 Message-ID: <20200513105632.06db9e21@titan.knownspace> In-Reply-To: <359C9C7D-4106-42B5-AAB5-08EF995B8100@yahoo.com> References: <8479DD58-44F6-446A-9CA5-D01F0F7C1B38@yahoo.com> <17ACDA02-D7EF-4F26-874A-BB3E935CD072@yahoo.com> <695E6836-F860-4557-B7DE-CC1EDB347F18@yahoo.com> <121B9B09-141B-4DC3-918B-1E7CFB99E779@yahoo.com> <8AAB0462-3FA8-490C-8D8D-7C15B1C9E2DE@yahoo.com> <18E62746-80DB-4195-977D-4FF32D0129EE@yahoo.com> <9562EEE4-62EF-4164-91C0-948CC0432984@yahoo.com> <9B68839B-AEC8-43EE-B3B6-B696A4A57DAE@yahoo.com> <359C9C7D-4106-42B5-AAB5-08EF995B8100@yahoo.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; powerpc64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49MfRm6J8hz4Cjp X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=k/Jk0ssq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of chmeeedalf@gmail.com designates 2607:f8b0:4864:20::741 as permitted sender) smtp.mailfrom=chmeeedalf@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCPT_COUNT_SEVEN(0.00)[7]; FREEMAIL_TO(0.00)[yahoo.com]; RECEIVED_SPAMHAUS_PBL(0.00)[130.125.19.173.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; IP_SCORE(0.00)[ip: (0.01), ipnet: 2607:f8b0::/32(-0.33), asn: 15169(-0.42), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[1.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 15:56:38 -0000 Hi Mark, On Wed, 13 May 2020 01:43:23 -0700 Mark Millard wrote: > [I'm adding a reference to an old arm64/aarch64 bug that had > pages turning to zero, in case this 32-bit powerpc issue is > somewhat analogous.] > > On 2020-May-13, at 00:29, Mark Millard wrote: > > > [stress alone is sufficient to have jemalloc asserts fail > > in stress, no need for a multi-socket G4 either. No need > > to involve nfsd, mountd, rpcbind or the like. This is not > > a claim that I know all the problems to be the same, just > > that a jemalloc reported failure in this simpler context > > happens and zeroed pages are involved.] > > > > Reminder: head -r360311 based context. > > > > > > First I show a single CPU/core PowerMac G4 context failing > > in stress. (I actually did this later, but it is the > > simpler context.) I simply moved the media from the > > 2-socket G4 to this slower, single-cpu/core one. > > > > cpu0: Motorola PowerPC 7400 revision 2.9, 466.42 MHz > > cpu0: Features 9c000000 > > cpu0: HID0 8094c0a4 > > real memory = 1577857024 (1504 MB) > > avail memory = 1527508992 (1456 MB) > > > > # stress -m 1 --vm-bytes 1792M > > stress: info: [1024] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd > > : > > /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:258: > > Failed assertion: "slab == extent_slab_get(extent)" stress: FAIL: > > [1024] (415) <-- worker 1025 got signal 6 stress: WARN: [1024] > > (417) now reaping child worker processes stress: FAIL: [1024] (451) > > failed run completed in 243s > > > > (Note: 1792 is the biggest it allowed with M.) > > > > The following still pages in and out and fails: > > > > # stress -m 1 --vm-bytes 1290M > > stress: info: [1163] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd > > : > > /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:258: > > Failed assertion: "slab == extent_slab_get(extent)" . . . > > > > By contrast, the following had no problem for as > > long as I let it run --and did not page in or out: > > > > # stress -m 1 --vm-bytes 1280M > > stress: info: [1181] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd > > ... > The following is was a fix for a "pages magically > turn into zeros" problem on amd64/aarch64. The > original 32-bit powerpc context did not seem a > match to me --but the stress test behavior that > I've just observed seems closer from an > external-test point of view: swapping is involved. > > My be this will suggest something to someone that > knows what they are doing. > > (Note: dsl-only.net closed down, so the E-mail > address reference is no longer valid.) > > Author: kib > Date: Mon Apr 10 15:32:26 2017 > New Revision: 316679 > URL: > https://svnweb.freebsd.org/changeset/base/316679 > > > Log: > Do not lose dirty bits for removing PROT_WRITE on arm64. > > Arm64 pmap interprets accessed writable ptes as modified, since > ARMv8.0 does not track Dirty Bit Modifier in hardware. If writable > bit is removed, page must be marked as dirty for MI VM. > > This change is most important for COW, where fork caused losing > content of the dirty pages which were not yet scanned by pagedaemon. > > Reviewed by: alc, andrew > Reported and tested by: Mark Millard > PR: 217138, 217239 > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > > Modified: > head/sys/arm64/arm64/pmap.c > > Modified: head/sys/arm64/arm64/pmap.c > ============================================================================== > --- head/sys/arm64/arm64/pmap.c Mon Apr 10 12:35:58 > 2017 (r316678) +++ head/sys/arm64/arm64/pmap.c Mon Apr > 10 15:32:26 2017 (r316679) @@ -2481,6 +2481,11 @@ > pmap_protect(pmap_t pmap, vm_offset_t sv sva += L3_SIZE) { > l3 = pmap_load(l3p); > if (pmap_l3_valid(l3)) { > + if ((l3 & ATTR_SW_MANAGED) && > + pmap_page_dirty(l3)) { > + > vm_page_dirty(PHYS_TO_VM_PAGE(l3 & > + ~ATTR_MASK)); > + } > pmap_set(l3p, ATTR_AP(ATTR_AP_RO)); > PTE_SYNC(l3p); > /* XXX: Use pmap_invalidate_range */ > > > === > Mark Millard > marklmi at yahoo.com > ( dsl-only.net went > away in early 2018-Mar) > Thanks for this reference. I took a quick look at the 3 pmap implementations we have (haven't check the new radix pmap yet), and it looks like only mmu_oea.c (32-bit AIM pmap, for G3 and G4) is missing vm_page_dirty() calls in its pmap_protect() implementation, analogous to the change you posted right above. Given this, I think it's safe to say that this missing piece is necessary. We'll work on a fix for this; looking at moea64_protect(), there may be additional work needed to support this as well, so it may take a few days. - Justin From owner-svn-src-head@freebsd.org Wed May 13 16:36:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EBA32FA783; Wed, 13 May 2020 16:36:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MgL26cHxz4G09; Wed, 13 May 2020 16:36:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D979E244E3; Wed, 13 May 2020 16:36:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DGag1T043344; Wed, 13 May 2020 16:36:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DGag7V043343; Wed, 13 May 2020 16:36:42 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005131636.04DGag7V043343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 13 May 2020 16:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361009 - head/tools/tools/ath/athratestats X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/tools/ath/athratestats X-SVN-Commit-Revision: 361009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 16:36:43 -0000 Author: adrian Date: Wed May 13 16:36:42 2020 New Revision: 361009 URL: https://svnweb.freebsd.org/changeset/base/361009 Log: [ath] Prepare for .. more sample rate control entries This is in preparation for me bumping how many size buckets are used for ath_rate_sample statistics. * Bump buffer size to 64k * Don't waste 4 lines per bucket size, condense it to two * Alternate colours; my logic made everything after the first two just be black. Oops. Modified: head/tools/tools/ath/athratestats/main.c Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Wed May 13 12:33:51 2020 (r361008) +++ head/tools/tools/ath/athratestats/main.c Wed May 13 16:36:42 2020 (r361009) @@ -64,7 +64,7 @@ static int do_loop = 0; * This needs to be big enough to fit the two TLVs, the rate table * and the rate statistics table for a single node. */ -#define STATS_BUF_SIZE 8192 +#define STATS_BUF_SIZE 65536 #define PRINTMSG(...) do { \ if (do_loop == 0) \ @@ -122,24 +122,23 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r (long long) sn->ratemask); for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { - PRINTATTR_ON(COLOR_PAIR(y+4) | A_BOLD); + PRINTATTR_ON(COLOR_PAIR(4 + (y % 2)) | A_BOLD); PRINTMSG("[%4u] cur rate %d %s since switch: " - "packets %d ticks %u\n", + "packets %d ticks %u ", bin_to_size(y), dot11rate(rt, sn->current_rix[y]), dot11str(rt, sn->current_rix[y]), sn->packets_since_switch[y], sn->ticks_since_switch[y]); - PRINTMSG("[%4u] last sample (%d %s) cur sample (%d %s) " + PRINTMSG("last sample (%d %s) cur sample (%d %s) " "packets sent %d\n", - bin_to_size(y), dot11rate(rt, sn->last_sample_rix[y]), dot11str(rt, sn->last_sample_rix[y]), dot11rate(rt, sn->current_sample_rix[y]), dot11str(rt, sn->current_sample_rix[y]), sn->packets_sent[y]); - PRINTATTR_OFF(COLOR_PAIR(y+4) | A_BOLD); + PRINTATTR_OFF(COLOR_PAIR(4 + (y % 2)) | A_BOLD); PRINTATTR_ON(COLOR_PAIR(3) | A_BOLD); PRINTMSG("[%4u] packets since sample %d sample tt %u\n", @@ -147,7 +146,6 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r sn->packets_since_sample[y], sn->sample_tt[y]); PRINTATTR_OFF(COLOR_PAIR(3) | A_BOLD); - PRINTMSG("\n"); } PRINTMSG(" TX Rate TXTOTAL:TXOK EWMA T/ F" " avg last xmit\n"); From owner-svn-src-head@freebsd.org Wed May 13 17:20:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F022A2FB400; Wed, 13 May 2020 17:20:51 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MhJz67j3z4J4F; Wed, 13 May 2020 17:20:51 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDF2424C80; Wed, 13 May 2020 17:20:51 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DHKpSb067876; Wed, 13 May 2020 17:20:51 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DHKpZ0067875; Wed, 13 May 2020 17:20:51 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202005131720.04DHKpZ0067875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Wed, 13 May 2020 17:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361010 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 361010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 17:20:52 -0000 Author: jrtc27 Date: Wed May 13 17:20:51 2020 New Revision: 361010 URL: https://svnweb.freebsd.org/changeset/base/361010 Log: riscv: Fix pmap_protect for superpages When protecting a superpage, we would previously fall through to the non-superpage case and read the contents of the superpage as PTEs, potentially modifying them and trying to look up underlying VM pages that don't exist if they happen to look like PTEs we would care about. This led to nginx causing an unexpected page fault in pmap_protect that panic'ed the kernel. Instead, if we see a superpage, we are done for this range and should continue to the next. Reviewed by: markj, jhb (mentor) Approved by: markj, jhb (mentor) Differential Revision: https://reviews.freebsd.org/D24827 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Wed May 13 16:36:42 2020 (r361009) +++ head/sys/riscv/riscv/pmap.c Wed May 13 17:20:51 2020 (r361010) @@ -2329,6 +2329,7 @@ retryl2: if (!atomic_fcmpset_long(l2, &l2e, l2e & ~mask)) goto retryl2; anychanged = true; + continue; } else { if (!pv_lists_locked) { pv_lists_locked = true; From owner-svn-src-head@freebsd.org Wed May 13 18:07:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 593AC2FBFCE; Wed, 13 May 2020 18:07:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MjLz1XPSz4MCk; Wed, 13 May 2020 18:07:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B65F255F0; Wed, 13 May 2020 18:07:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DI7dJD000444; Wed, 13 May 2020 18:07:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DI7bHG000437; Wed, 13 May 2020 18:07:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005131807.04DI7bHG000437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 13 May 2020 18:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361011 - in head/sys: ddb dev/amdtemp dev/nvdimm dev/ow net sys vm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: ddb dev/amdtemp dev/nvdimm dev/ow net sys vm X-SVN-Commit-Revision: 361011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 18:07:39 -0000 Author: kevans Date: Wed May 13 18:07:37 2020 New Revision: 361011 URL: https://svnweb.freebsd.org/changeset/base/361011 Log: kernel: provide panicky version of __unreachable __builtin_unreachable doesn't raise any compile-time warnings/errors on its own, so problems with its usage can't be easily detected. While it would be nice for this situation to change and compilers to at least add a warning for trivial cases where local state means the instruction can't be reached, this isn't the case at the moment and likely will not happen. This commit adds an __assert_unreachable, whose intent is incredibly clear: it asserts that this instruction is unreachable. On INVARIANTS builds, it's a panic(), and on non-INVARIANTS it expands to __unreachable(). Existing users of __unreachable() are converted to __assert_unreachable, to improve debuggability if this assumption is violated. Reviewed by: mjg Differential Revision: https://reviews.freebsd.org/D23793 Modified: head/sys/ddb/db_expr.c head/sys/dev/amdtemp/amdtemp.c head/sys/dev/nvdimm/nvdimm.c head/sys/dev/ow/ow.c head/sys/net/mppcc.c head/sys/sys/systm.h head/sys/vm/vm_radix.c Modified: head/sys/ddb/db_expr.c ============================================================================== --- head/sys/ddb/db_expr.c Wed May 13 17:20:51 2020 (r361010) +++ head/sys/ddb/db_expr.c Wed May 13 18:07:37 2020 (r361011) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -229,7 +230,7 @@ db_add_expr(db_expr_t *valuep) lhs |= rhs; break; default: - __unreachable(); + __assert_unreachable(); } t = db_read_token(); } @@ -313,7 +314,7 @@ db_logical_relation_expr( lhs = (lhs <= rhs); break; default: - __unreachable(); + __assert_unreachable(); } t = db_read_token(); } Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Wed May 13 17:20:51 2020 (r361010) +++ head/sys/dev/amdtemp/amdtemp.c Wed May 13 18:07:37 2020 (r361011) @@ -666,7 +666,7 @@ amdtemp_gettemp0f(device_t dev, amdsensor_t sensor) temp |= AMDTEMP_TTSR_SELCORE; break; default: - __unreachable(); + __assert_unreachable(); } pci_write_config(dev, AMDTEMP_THERMTP_STAT, temp, 1); @@ -766,7 +766,7 @@ amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) ("sensor %d: not valid", (int)sensor)); return (amdtemp_decode_fam10h_to_17h(sc->sc_offset, val, true)); default: - __unreachable(); + __assert_unreachable(); } } Modified: head/sys/dev/nvdimm/nvdimm.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm.c Wed May 13 17:20:51 2020 (r361010) +++ head/sys/dev/nvdimm/nvdimm.c Wed May 13 18:07:37 2020 (r361011) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include +#include #include #include #include @@ -236,7 +237,7 @@ read_label(struct nvdimm_dev *nv, int num) return (0); } } - __unreachable(); + __assert_unreachable(); } static int Modified: head/sys/dev/ow/ow.c ============================================================================== --- head/sys/dev/ow/ow.c Wed May 13 17:20:51 2020 (r361010) +++ head/sys/dev/ow/ow.c Wed May 13 18:07:37 2020 (r361011) @@ -507,7 +507,7 @@ again: return (EIO); goto again; default: /* NOTREACHED */ - __unreachable(); + __assert_unreachable(); } if (dir) { OWLL_WRITE_ONE(lldev, &timing_regular); Modified: head/sys/net/mppcc.c ============================================================================== --- head/sys/net/mppcc.c Wed May 13 17:20:51 2020 (r361010) +++ head/sys/net/mppcc.c Wed May 13 18:07:37 2020 (r361011) @@ -232,7 +232,7 @@ int MPPC_Compress(u_char **src, u_char **dst, u_long * } else if (off < 8192) { /* 16-bit offset; 320 <= offset < 8192 */ putbits16(*dst, 0xc000|(off-320), 16, &olen, &l); } else { /* NOTREACHED */ - __unreachable(); + __assert_unreachable(); rtn &= ~MPPC_OK; return (rtn); } Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed May 13 17:20:51 2020 (r361010) +++ head/sys/sys/systm.h Wed May 13 18:07:37 2020 (r361011) @@ -117,6 +117,9 @@ void kassert_panic(const char *fmt, ...) __printflike VNASSERT(exp, vp, ("condition %s not met at %s:%d (%s)", \ _exp, __FILE__, __LINE__, __func__)); \ } while (0) +#define __assert_unreachable() \ + panic("executing segment marked as unreachable at %s:%d (%s)\n", \ + __FILE__, __LINE__, __func__) #else #define KASSERT(exp,msg) do { \ } while (0) @@ -125,6 +128,7 @@ void kassert_panic(const char *fmt, ...) __printflike } while (0) #define VNPASS(exp, vp) do { \ } while (0) +#define __assert_unreachable() __unreachable() #endif #ifndef CTASSERT /* Allow lint to override */ Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Wed May 13 17:20:51 2020 (r361010) +++ head/sys/vm/vm_radix.c Wed May 13 18:07:37 2020 (r361011) @@ -209,7 +209,7 @@ vm_radix_node_load(smrnode_t *p, enum vm_radix_access case SMR: return (smr_entered_load(p, vm_radix_smr)); } - __unreachable(); + __assert_unreachable(); } static __inline void From owner-svn-src-head@freebsd.org Wed May 13 18:35:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F1B82FCBFE; Wed, 13 May 2020 18:35:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Mjyb2qLGz4P9N; Wed, 13 May 2020 18:35:03 +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 5C29125BA4; Wed, 13 May 2020 18:35:03 +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 04DIZ3iS018937; Wed, 13 May 2020 18:35:03 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DIZ3ST018936; Wed, 13 May 2020 18:35:03 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005131835.04DIZ3ST018936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 13 May 2020 18:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361013 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 361013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 18:35:03 -0000 Author: jhb Date: Wed May 13 18:35:02 2020 New Revision: 361013 URL: https://svnweb.freebsd.org/changeset/base/361013 Log: Remove unused header for DES. The NFS port doesn't use any of the DES functions. Modified: head/sys/fs/nfs/nfsport.h Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Wed May 13 18:09:03 2020 (r361012) +++ head/sys/fs/nfs/nfsport.h Wed May 13 18:35:02 2020 (r361013) @@ -98,7 +98,6 @@ #include #include #include -#include #include #include #include From owner-svn-src-head@freebsd.org Wed May 13 18:36:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F6342FCC69; Wed, 13 May 2020 18:36: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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Mjzk3lCHz4PHm; Wed, 13 May 2020 18:36: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 7BC2025BA7; Wed, 13 May 2020 18:36: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 04DIa2jX019023; Wed, 13 May 2020 18:36:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DIa2YL019022; Wed, 13 May 2020 18:36:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005131836.04DIa2YL019022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 13 May 2020 18:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361014 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 361014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 18:36:02 -0000 Author: jhb Date: Wed May 13 18:36:02 2020 New Revision: 361014 URL: https://svnweb.freebsd.org/changeset/base/361014 Log: Trim a few more things I missed from xform_enc.h. An extern declaration for the now-removed Blowfish encryption transform, and an include of the DES header. Modified: head/sys/opencrypto/xform_enc.h Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Wed May 13 18:35:02 2020 (r361013) +++ head/sys/opencrypto/xform_enc.h Wed May 13 18:36:02 2020 (r361014) @@ -33,7 +33,6 @@ #include #include -#include #include #include #include @@ -68,7 +67,6 @@ struct enc_xform { extern struct enc_xform enc_xform_null; -extern struct enc_xform enc_xform_blf; extern struct enc_xform enc_xform_rijndael128; extern struct enc_xform enc_xform_aes_icm; extern struct enc_xform enc_xform_aes_nist_gcm; From owner-svn-src-head@freebsd.org Wed May 13 19:17:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F3832FD50A; Wed, 13 May 2020 19:17:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Mkvb1lxSz4R48; Wed, 13 May 2020 19:17:31 +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 32EA726374; Wed, 13 May 2020 19:17:31 +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 04DJHVbf043639; Wed, 13 May 2020 19:17:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DJHTok043628; Wed, 13 May 2020 19:17:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202005131917.04DJHTok043628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 May 2020 19:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361015 - in head/sys/geom: . eli mountver nop part uzip X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/geom: . eli mountver nop part uzip X-SVN-Commit-Revision: 361015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 19:17:31 -0000 Author: imp Date: Wed May 13 19:17:28 2020 New Revision: 361015 URL: https://svnweb.freebsd.org/changeset/base/361015 Log: Reimplement aliases in geom The alias needs to be part of the provider instead of the geom to work properly. To bind the DEV geom, we need to look at the provider's names and aliases and create the dev entries from there. If this lives in the GEOM, then it won't propigate down the tree properly. Remove it from geom, add it provider. Update geli, gmountver, gnop, gpart, and guzip to use it, which handles the bulk of the uses in FreeBSD. I think this is all the providers that create a new name based on their parent's name. Modified: head/sys/geom/eli/g_eli.c head/sys/geom/geom.h head/sys/geom/geom_dev.c head/sys/geom/geom_disk.c head/sys/geom/geom_dump.c head/sys/geom/geom_subr.c head/sys/geom/mountver/g_mountver.c head/sys/geom/nop/g_nop.c head/sys/geom/part/g_part.c head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/eli/g_eli.c Wed May 13 19:17:28 2020 (r361015) @@ -843,6 +843,7 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_geom *gp; struct g_provider *pp; struct g_consumer *cp; + struct g_geom_alias *gap; u_int i, threads; int dcw, error; @@ -971,6 +972,8 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, pp = g_new_providerf(gp, "%s%s", bpp->name, G_ELI_SUFFIX); pp->mediasize = sc->sc_mediasize; pp->sectorsize = sc->sc_sectorsize; + LIST_FOREACH(gap, &bpp->aliases, ga_next) + g_provider_add_alias(pp, "%s%s", gap->ga_alias, G_ELI_SUFFIX); g_error_provider(pp, 0); Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/geom.h Wed May 13 19:17:28 2020 (r361015) @@ -122,15 +122,6 @@ struct g_class { LIST_HEAD(,g_geom) geom; }; -/* - * The g_geom_alias is a list node for aliases for the geom name - * for device node creation. - */ -struct g_geom_alias { - LIST_ENTRY(g_geom_alias) ga_next; - const char *ga_alias; -}; - #define G_VERSION_00 0x19950323 #define G_VERSION_01 0x20041207 /* add fflag to g_ioctl_t */ #define G_VERSION G_VERSION_01 @@ -163,7 +154,6 @@ struct g_geom { #define G_GEOM_VOLATILE_BIO 0x02 #define G_GEOM_IN_ACCESS 0x04 #define G_GEOM_ACCESS_WAIT 0x08 - LIST_HEAD(,g_geom_alias) aliases; }; /* @@ -203,6 +193,15 @@ struct g_consumer { }; /* + * The g_geom_alias is a list node for aliases for the provider name for device + * node creation. + */ +struct g_geom_alias { + LIST_ENTRY(g_geom_alias) ga_next; + const char *ga_alias; +}; + +/* * A g_provider is a "logical disk". */ struct g_provider { @@ -226,6 +225,7 @@ struct g_provider { #define G_PF_ACCEPT_UNMAPPED 0x8 #define G_PF_DIRECT_SEND 0x10 #define G_PF_DIRECT_RECEIVE 0x20 + LIST_HEAD(,g_geom_alias) aliases; /* Two fields for the implementing class to use */ void *private; @@ -280,7 +280,6 @@ void g_destroy_provider(struct g_provider *pp); void g_detach(struct g_consumer *cp); void g_error_provider(struct g_provider *pp, int error); struct g_provider *g_provider_by_name(char const *arg); -void g_geom_add_alias(struct g_geom *gp, const char *alias); int g_getattr__(const char *attr, struct g_consumer *cp, void *var, int len); #define g_getattr(a, c, v) g_getattr__((a), (c), (v), sizeof *(v)) int g_handleattr(struct bio *bp, const char *attribute, const void *val, @@ -293,6 +292,8 @@ struct g_consumer * g_new_consumer(struct g_geom *gp); struct g_geom * g_new_geomf(struct g_class *mp, const char *fmt, ...) __printflike(2, 3); struct g_provider * g_new_providerf(struct g_geom *gp, const char *fmt, ...) + __printflike(2, 3); +void g_provider_add_alias(struct g_provider *pp, const char *fmt, ...) __printflike(2, 3); void g_resize_provider(struct g_provider *pp, off_t size); int g_retaste(struct g_class *mp); Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/geom_dev.c Wed May 13 19:17:28 2020 (r361015) @@ -383,7 +383,7 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, /* * Now add all the aliases for this drive */ - LIST_FOREACH(gap, &pp->geom->aliases, ga_next) { + LIST_FOREACH(gap, &pp->aliases, ga_next) { error = make_dev_alias_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, &adev, dev, "%s", gap->ga_alias); if (error) { Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/geom_disk.c Wed May 13 19:17:28 2020 (r361015) @@ -718,11 +718,9 @@ g_disk_create(void *arg, int flag) sc->d_devstat = dp->d_devstat; gp = g_new_geomf(&g_disk_class, "%s%d", dp->d_name, dp->d_unit); gp->softc = sc; - LIST_FOREACH(dap, &dp->d_aliases, da_next) { - snprintf(tmpstr, sizeof(tmpstr), "%s%d", dap->da_alias, dp->d_unit); - g_geom_add_alias(gp, tmpstr); - } pp = g_new_providerf(gp, "%s", gp->name); + LIST_FOREACH(dap, &dp->d_aliases, da_next) + g_provider_add_alias(pp, "%s%d", dap->da_alias, dp->d_unit); devstat_remove_entry(pp->stat); pp->stat = NULL; dp->d_devstat->id = pp; Modified: head/sys/geom/geom_dump.c ============================================================================== --- head/sys/geom/geom_dump.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/geom_dump.c Wed May 13 19:17:28 2020 (r361015) @@ -211,6 +211,7 @@ g_conf_consumer(struct sbuf *sb, struct g_consumer *cp static void g_conf_provider(struct sbuf *sb, struct g_provider *pp) { + struct g_geom_alias *gap; sbuf_printf(sb, "\t\n", pp); sbuf_printf(sb, "\t \n", pp->geom); @@ -219,6 +220,11 @@ g_conf_provider(struct sbuf *sb, struct g_provider *pp sbuf_cat(sb, "\t "); g_conf_cat_escaped(sb, pp->name); sbuf_cat(sb, "\n"); + LIST_FOREACH(gap, &pp->aliases, ga_next) { + sbuf_cat(sb, "\t "); + g_conf_cat_escaped(sb, gap->ga_alias); + sbuf_cat(sb, "\n"); + } sbuf_printf(sb, "\t %jd\n", (intmax_t)pp->mediasize); sbuf_printf(sb, "\t %u\n", pp->sectorsize); @@ -242,7 +248,6 @@ g_conf_geom(struct sbuf *sb, struct g_geom *gp, struct { struct g_consumer *cp2; struct g_provider *pp2; - struct g_geom_alias *gap; sbuf_printf(sb, " \n", gp); sbuf_printf(sb, " \n", gp->class); @@ -267,11 +272,6 @@ g_conf_geom(struct sbuf *sb, struct g_geom *gp, struct if (pp != NULL && pp != pp2) continue; g_conf_provider(sb, pp2); - } - LIST_FOREACH(gap, &gp->aliases, ga_next) { - sbuf_cat(sb, " \n"); - g_conf_cat_escaped(sb, gap->ga_alias); - sbuf_cat(sb, " \n"); } sbuf_cat(sb, " \n"); } Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/geom_subr.c Wed May 13 19:17:28 2020 (r361015) @@ -391,7 +391,6 @@ g_new_geomf(struct g_class *mp, const char *fmt, ...) gp->rank = 1; LIST_INIT(&gp->consumer); LIST_INIT(&gp->provider); - LIST_INIT(&gp->aliases); LIST_INSERT_HEAD(&mp->geom, gp, geom); TAILQ_INSERT_HEAD(&geoms, gp, geoms); strcpy(gp->name, sbuf_data(sb)); @@ -412,7 +411,6 @@ g_new_geomf(struct g_class *mp, const char *fmt, ...) void g_destroy_geom(struct g_geom *gp) { - struct g_geom_alias *gap, *gaptmp; g_topology_assert(); G_VALID_GEOM(gp); @@ -426,8 +424,6 @@ g_destroy_geom(struct g_geom *gp) g_cancel_event(gp); LIST_REMOVE(gp, geom); TAILQ_REMOVE(&geoms, gp, geoms); - LIST_FOREACH_SAFE(gap, &gp->aliases, ga_next, gaptmp) - g_free(gap); g_free(gp->name); g_free(gp); } @@ -631,6 +627,7 @@ g_new_providerf(struct g_geom *gp, const char *fmt, .. strcpy(pp->name, sbuf_data(sb)); sbuf_delete(sb); LIST_INIT(&pp->consumers); + LIST_INIT(&pp->aliases); pp->error = ENXIO; pp->geom = gp; pp->stat = devstat_new_entry(pp, -1, 0, DEVSTAT_ALL_SUPPORTED, @@ -641,6 +638,28 @@ g_new_providerf(struct g_geom *gp, const char *fmt, .. } void +g_provider_add_alias(struct g_provider *pp, const char *fmt, ...) +{ + struct sbuf *sb; + struct g_geom_alias *gap; + va_list ap; + + /* + * Generate the alias string and save it in the list. + */ + sb = sbuf_new_auto(); + va_start(ap, fmt); + sbuf_vprintf(sb, fmt, ap); + va_end(ap); + sbuf_finish(sb); + gap = g_malloc(sizeof(*gap) + sbuf_len(sb) + 1, M_WAITOK | M_ZERO); + memcpy((char *)(gap + 1), sbuf_data(sb), sbuf_len(sb)); + sbuf_delete(sb); + gap->ga_alias = (const char *)(gap + 1); + LIST_INSERT_HEAD(&pp->aliases, gap, ga_next); +} + +void g_error_provider(struct g_provider *pp, int error) { @@ -768,6 +787,7 @@ void g_destroy_provider(struct g_provider *pp) { struct g_geom *gp; + struct g_geom_alias *gap, *gaptmp; g_topology_assert(); G_VALID_PROVIDER(pp); @@ -786,7 +806,8 @@ g_destroy_provider(struct g_provider *pp) */ if (gp->providergone != NULL) gp->providergone(pp); - + LIST_FOREACH_SAFE(gap, &pp->aliases, ga_next, gaptmp) + g_free(gap); g_free(pp); if ((gp->flags & G_GEOM_WITHER)) g_do_wither(); @@ -1314,18 +1335,6 @@ g_compare_names(const char *namea, const char *nameb) if (strcmp(namea + deva, nameb + devb) == 0) return (1); return (0); -} - -void -g_geom_add_alias(struct g_geom *gp, const char *alias) -{ - struct g_geom_alias *gap; - - gap = (struct g_geom_alias *)g_malloc( - sizeof(struct g_geom_alias) + strlen(alias) + 1, M_WAITOK); - strcpy((char *)(gap + 1), alias); - gap->ga_alias = (const char *)(gap + 1); - LIST_INSERT_HEAD(&gp->aliases, gap, ga_next); } #if defined(DIAGNOSTIC) || defined(DDB) Modified: head/sys/geom/mountver/g_mountver.c ============================================================================== --- head/sys/geom/mountver/g_mountver.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/mountver/g_mountver.c Wed May 13 19:17:28 2020 (r361015) @@ -276,6 +276,7 @@ g_mountver_create(struct gctl_req *req, struct g_class struct g_geom *gp; struct g_provider *newpp; struct g_consumer *cp; + struct g_geom_alias *gap; char name[64]; int error; int identsize = DISK_IDENT_SIZE; @@ -309,6 +310,8 @@ g_mountver_create(struct gctl_req *req, struct g_class newpp->mediasize = pp->mediasize; newpp->sectorsize = pp->sectorsize; newpp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE; + LIST_FOREACH(gap, &pp->aliases, ga_next) + g_provider_add_alias(newpp, "%s%s", gap->ga_alias, G_MOUNTVER_SUFFIX); if ((pp->flags & G_PF_ACCEPT_UNMAPPED) != 0) { G_MOUNTVER_DEBUG(0, "Unmapped supported for %s.", gp->name); Modified: head/sys/geom/nop/g_nop.c ============================================================================== --- head/sys/geom/nop/g_nop.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/nop/g_nop.c Wed May 13 19:17:28 2020 (r361015) @@ -346,6 +346,7 @@ g_nop_create(struct gctl_req *req, struct g_class *mp, struct g_geom *gp; struct g_provider *newpp; struct g_consumer *cp; + struct g_geom_alias *gap; char name[64]; int error, n; off_t explicitsize; @@ -458,6 +459,8 @@ g_nop_create(struct gctl_req *req, struct g_class *mp, newpp->sectorsize = secsize; newpp->stripesize = stripesize; newpp->stripeoffset = stripeoffset; + LIST_FOREACH(gap, &pp->aliases, ga_next) + g_provider_add_alias(newpp, "%s%s", gap->ga_alias, G_NOP_SUFFIX); cp = g_new_consumer(gp); cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/part/g_part.c Wed May 13 19:17:28 2020 (r361015) @@ -481,24 +481,25 @@ g_part_new_provider(struct g_geom *gp, struct g_part_t entry->gpe_offset = offset; if (entry->gpe_pp == NULL) { + sb = sbuf_new_auto(); + G_PART_FULLNAME(table, entry, sb, gp->name); + sbuf_finish(sb); + entry->gpe_pp = g_new_providerf(gp, "%s", sbuf_data(sb)); + sbuf_delete(sb); /* - * Add aliases to the geom before we create the provider so that - * geom_dev can taste it with all the aliases in place so all - * the aliased dev_t instances get created for each partition - * (eg foo5p7 gets created for bar5p7 when foo is an alias of bar). + * If our parent provider had any aliases, then copy them to our + * provider so when geom DEV tastes things later, they will be + * there for it to create the aliases with those name used in + * place of the geom's name we use to create the provider. The + * kobj interface that generates names makes this awkward. */ - LIST_FOREACH(gap, &table->gpt_gp->aliases, ga_next) { + LIST_FOREACH(gap, &pp->aliases, ga_next) { sb = sbuf_new_auto(); G_PART_FULLNAME(table, entry, sb, gap->ga_alias); sbuf_finish(sb); - g_geom_add_alias(gp, sbuf_data(sb)); + g_provider_add_alias(entry->gpe_pp, "%s", sbuf_data(sb)); sbuf_delete(sb); } - sb = sbuf_new_auto(); - G_PART_FULLNAME(table, entry, sb, gp->name); - sbuf_finish(sb); - entry->gpe_pp = g_new_providerf(gp, "%s", sbuf_data(sb)); - sbuf_delete(sb); entry->gpe_pp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE; entry->gpe_pp->private = entry; /* Close the circle. */ } @@ -1968,7 +1969,6 @@ g_part_taste(struct g_class *mp, struct g_provider *pp struct g_part_entry *entry; struct g_part_table *table; struct root_hold_token *rht; - struct g_geom_alias *gap; int attr, depth; int error; @@ -1985,8 +1985,6 @@ g_part_taste(struct g_class *mp, struct g_provider *pp * to the provider. */ gp = g_new_geomf(mp, "%s", pp->name); - LIST_FOREACH(gap, &pp->geom->aliases, ga_next) - g_geom_add_alias(gp, gap->ga_alias); cp = g_new_consumer(gp); cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/uzip/g_uzip.c Wed May 13 19:17:28 2020 (r361015) @@ -677,6 +677,7 @@ g_uzip_taste(struct g_class *mp, struct g_provider *pp struct g_geom *gp; struct g_provider *pp2; struct g_uzip_softc *sc; + struct g_geom_alias *gap; enum { G_UZIP = 1, G_ULZMA, @@ -910,6 +911,8 @@ g_uzip_taste(struct g_class *mp, struct g_provider *pp pp2->mediasize = (off_t)sc->nblocks * sc->blksz; pp2->stripesize = pp->stripesize; pp2->stripeoffset = pp->stripeoffset; + LIST_FOREACH(gap, &pp->aliases, ga_next) + g_provider_add_alias(pp2, GUZ_DEV_NAME("%s"), gap->ga_alias); g_error_provider(pp2, 0); g_access(cp, -1, 0, 0); From owner-svn-src-head@freebsd.org Wed May 13 19:17:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B18E72FD525; Wed, 13 May 2020 19:17:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Mkvh1qYMz4R6P; Wed, 13 May 2020 19:17:36 +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 CB85A26375; Wed, 13 May 2020 19:17:35 +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 04DJHZ5F043692; Wed, 13 May 2020 19:17:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DJHZGP043691; Wed, 13 May 2020 19:17:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202005131917.04DJHZGP043691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 May 2020 19:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361016 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 361016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 19:17:36 -0000 Author: imp Date: Wed May 13 19:17:35 2020 New Revision: 361016 URL: https://svnweb.freebsd.org/changeset/base/361016 Log: Add nvd alias back to nda now that it actually works. Modified: head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Wed May 13 19:17:28 2020 (r361015) +++ head/sys/cam/nvme/nvme_da.c Wed May 13 19:17:35 2020 (r361016) @@ -950,7 +950,7 @@ ndaregister(struct cam_periph *periph, void *arg) /* * Add alias for older nvd drives to ease transition. */ - /* disk_add_alias(disk, "nvd"); Have reports of this causing problems */ + disk_add_alias(disk, "nvd"); /* * Acquire a reference to the periph before we register with GEOM. From owner-svn-src-head@freebsd.org Wed May 13 19:29:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9066B2FDBE4; Wed, 13 May 2020 19:29:15 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Ml9721RNz4S5K; Wed, 13 May 2020 19:29:15 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 404D326554; Wed, 13 May 2020 19:29:15 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DJTFuA049605; Wed, 13 May 2020 19:29:15 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DJTFPF049604; Wed, 13 May 2020 19:29:15 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005131929.04DJTFPF049604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 13 May 2020 19:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361017 - head/tests/sys/net X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/net X-SVN-Commit-Revision: 361017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 19:29:15 -0000 Author: lwhsu Date: Wed May 13 19:29:14 2020 New Revision: 361017 URL: https://svnweb.freebsd.org/changeset/base/361017 Log: Temporarily skip sys.net.if_clone_test.epair_stress This case timed out so often PR: 246443 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/net/if_clone_test.sh Modified: head/tests/sys/net/if_clone_test.sh ============================================================================== --- head/tests/sys/net/if_clone_test.sh Wed May 13 19:17:35 2020 (r361016) +++ head/tests/sys/net/if_clone_test.sh Wed May 13 19:29:14 2020 (r361017) @@ -47,6 +47,7 @@ epair_stress_head() } epair_stress_body() { + atf_skip "https://bugs.freebsd.org/246443" do_stress "epair" } epair_stress_cleanup() From owner-svn-src-head@freebsd.org Wed May 13 20:36:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75A9C2FF058; Wed, 13 May 2020 20:36:39 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Mmfv2bDVz4X3N; Wed, 13 May 2020 20:36:39 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52D63272A7; Wed, 13 May 2020 20:36:39 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DKadV3093538; Wed, 13 May 2020 20:36:39 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DKadt8093537; Wed, 13 May 2020 20:36:39 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005132036.04DKadt8093537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 13 May 2020 20:36:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361018 - head/tests/sys/net X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/net X-SVN-Commit-Revision: 361018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 20:36:39 -0000 Author: lwhsu Date: Wed May 13 20:36:38 2020 New Revision: 361018 URL: https://svnweb.freebsd.org/changeset/base/361018 Log: Temporarily skip sys.net.if_bridge_test.stp in CI as it always times out PR: 244229 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/net/if_bridge_test.sh Modified: head/tests/sys/net/if_bridge_test.sh ============================================================================== --- head/tests/sys/net/if_bridge_test.sh Wed May 13 19:29:14 2020 (r361017) +++ head/tests/sys/net/if_bridge_test.sh Wed May 13 20:36:38 2020 (r361018) @@ -77,6 +77,10 @@ stp_head() stp_body() { + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/246448" + fi + vnet_init epair_one=$(vnet_mkepair) From owner-svn-src-head@freebsd.org Wed May 13 20:37:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E40962FF147; Wed, 13 May 2020 20:37:49 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MmhD3y84z4XRg; Wed, 13 May 2020 20:37:48 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED91C272AF; Wed, 13 May 2020 20:37:46 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DKbkha093999; Wed, 13 May 2020 20:37:46 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DKbkv6093998; Wed, 13 May 2020 20:37:46 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005132037.04DKbkv6093998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 13 May 2020 20:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361019 - head/tests/sys/net X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/net X-SVN-Commit-Revision: 361019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 20:37:50 -0000 Author: lwhsu Date: Wed May 13 20:37:46 2020 New Revision: 361019 URL: https://svnweb.freebsd.org/changeset/base/361019 Log: Only skip sys.net.if_clone_test.epair_stress in CI env PR: 246443 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/net/if_clone_test.sh Modified: head/tests/sys/net/if_clone_test.sh ============================================================================== --- head/tests/sys/net/if_clone_test.sh Wed May 13 20:36:38 2020 (r361018) +++ head/tests/sys/net/if_clone_test.sh Wed May 13 20:37:46 2020 (r361019) @@ -47,7 +47,9 @@ epair_stress_head() } epair_stress_body() { - atf_skip "https://bugs.freebsd.org/246443" + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/246443" + fi do_stress "epair" } epair_stress_cleanup() From owner-svn-src-head@freebsd.org Wed May 13 20:42:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4AAF62FF667; Wed, 13 May 2020 20:42:12 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Mmn663Pmz4ZHq; Wed, 13 May 2020 20:42:01 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f180.google.com with SMTP id i16so380523ybq.9; Wed, 13 May 2020 13:42:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=XGG5QNRGx7MPa8SXBu2cyV4FJqkMyeSAEANLTNIXTZw=; b=Lk3ovF8bjNb0bsX2QEebcp+UhqHtiscfBUS0Kti3SNwpX6JUvQNpkGXzqEAYYuhyeS /ANoklRVh2Xm7Vo9EuCRmTpkFgwz+/xPLquttssOO0khbkmno+j1ynB6v/HS9MK4jTKY bbz9CGJg36jsVbvh9Q9j7kUwtQ0BuBDvW26BjkfWZveT0a4JGuW1Z+QGoFn8Ic79FNtt 3aCn9+or7is0BfZ5xGd0fky8f/whmnBZlodVQrj2T4GUVH5uOvKpP5tham7vzKJnUTbI ZksHgW08Om+oGkzr3Lc6AbjQtREGmsa0dNRaVB2cXOa1dS0zg8YnZu39V1jWuel4Yf/E 4xZA== X-Gm-Message-State: AOAM530/EGQL20TQtQmCTAvZAqRhO9Lv7OMDQLJ1O+ksaBtxg4nz4mRK 4FnL6LVQ3tcOZwua0rKYhH9ff0kJG0ub9POUOayeOeb0 X-Google-Smtp-Source: ABdhPJzQUQKdXZYN6pA51sEUKCvlKQAMP4+HIiBbhdUslap4h1tTZpgVagMPinlLITBlRqbH/ZL4KnaRF+C5DLD+Agw= X-Received: by 2002:a25:b841:: with SMTP id b1mr1544267ybm.492.1589402517281; Wed, 13 May 2020 13:41:57 -0700 (PDT) MIME-Version: 1.0 References: <202005132036.04DKadt8093537@repo.freebsd.org> In-Reply-To: <202005132036.04DKadt8093537@repo.freebsd.org> From: Li-Wen Hsu Date: Thu, 14 May 2020 04:41:46 +0800 Message-ID: Subject: Re: svn commit: r361018 - head/tests/sys/net To: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49Mmn663Pmz4ZHq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lwhsufreebsd@gmail.com designates 209.85.219.180 as permitted sender) smtp.mailfrom=lwhsufreebsd@gmail.com X-Spamd-Result: default: False [-4.03 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-2.03)[ip: (-9.29), ipnet: 209.85.128.0/17(-0.39), asn: 15169(-0.42), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[180.219.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[180.219.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 20:42:12 -0000 On Thu, May 14, 2020 at 4:36 AM Li-Wen Hsu wrote: > > Author: lwhsu > Date: Wed May 13 20:36:38 2020 > New Revision: 361018 > URL: https://svnweb.freebsd.org/changeset/base/361018 > > Log: > Temporarily skip sys.net.if_bridge_test.stp in CI as it always times out > > PR: 244229 The correct PR should be https://bugs.freebsd.org/246448 From owner-svn-src-head@freebsd.org Thu May 14 03:01:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B2AE2E2A9D; Thu, 14 May 2020 03:01:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MxBr30kHz3G37; Thu, 14 May 2020 03:01:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6240D4145; Thu, 14 May 2020 03:01:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04E31OLU035456; Thu, 14 May 2020 03:01:24 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E31Oh6035455; Thu, 14 May 2020 03:01:24 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005140301.04E31Oh6035455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 14 May 2020 03:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361021 - in head: sys/kern usr.sbin/extattr/tests X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sys/kern usr.sbin/extattr/tests X-SVN-Commit-Revision: 361021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 03:01:24 -0000 Author: cem Date: Thu May 14 03:01:23 2020 New Revision: 361021 URL: https://svnweb.freebsd.org/changeset/base/361021 Log: vfs_extattr: Allow extattr names up to the full max Extattr names are allowed to be 255 bytes -- not 254 bytes plus trailing NUL. Provide a 256 buffer so that copyinstr() has room for the trailing NUL. Re-enable test for maximal name lengths. PR: 208965 Reported by: asomers Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D24584 Modified: head/sys/kern/vfs_extattr.c head/usr.sbin/extattr/tests/extattr_test.sh Modified: head/sys/kern/vfs_extattr.c ============================================================================== --- head/sys/kern/vfs_extattr.c Wed May 13 21:16:02 2020 (r361020) +++ head/sys/kern/vfs_extattr.c Thu May 14 03:01:23 2020 (r361021) @@ -82,7 +82,7 @@ sys_extattrctl(struct thread *td, struct extattrctl_ar struct vnode *filename_vp; struct nameidata nd; struct mount *mp, *mp_writable; - char attrname[EXTATTR_MAXNAMELEN]; + char attrname[EXTATTR_MAXNAMELEN + 1]; int error; AUDIT_ARG_CMD(uap->cmd); @@ -92,7 +92,7 @@ sys_extattrctl(struct thread *td, struct extattrctl_ar * invoke the VFS call so as to pass in NULL there if needed. */ if (uap->attrname != NULL) { - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, + error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL); if (error) return (error); @@ -231,13 +231,13 @@ int sys_extattr_set_fd(struct thread *td, struct extattr_set_fd_args *uap) { struct file *fp; - char attrname[EXTATTR_MAXNAMELEN]; + char attrname[EXTATTR_MAXNAMELEN + 1]; cap_rights_t rights; int error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); + error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); @@ -293,11 +293,11 @@ kern_extattr_set_path(struct thread *td, const char *p const char *uattrname, void *data, size_t nbytes, int follow) { struct nameidata nd; - char attrname[EXTATTR_MAXNAMELEN]; + char attrname[EXTATTR_MAXNAMELEN + 1]; int error; AUDIT_ARG_VALUE(attrnamespace); - error = copyinstr(uattrname, attrname, EXTATTR_MAXNAMELEN, NULL); + error = copyinstr(uattrname, attrname, sizeof(attrname), NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); @@ -398,13 +398,13 @@ int sys_extattr_get_fd(struct thread *td, struct extattr_get_fd_args *uap) { struct file *fp; - char attrname[EXTATTR_MAXNAMELEN]; + char attrname[EXTATTR_MAXNAMELEN + 1]; cap_rights_t rights; int error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); + error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); @@ -458,11 +458,11 @@ kern_extattr_get_path(struct thread *td, const char *p const char *uattrname, void *data, size_t nbytes, int follow) { struct nameidata nd; - char attrname[EXTATTR_MAXNAMELEN]; + char attrname[EXTATTR_MAXNAMELEN + 1]; int error; AUDIT_ARG_VALUE(attrnamespace); - error = copyinstr(uattrname, attrname, EXTATTR_MAXNAMELEN, NULL); + error = copyinstr(uattrname, attrname, sizeof(attrname), NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); @@ -533,13 +533,13 @@ int sys_extattr_delete_fd(struct thread *td, struct extattr_delete_fd_args *uap) { struct file *fp; - char attrname[EXTATTR_MAXNAMELEN]; + char attrname[EXTATTR_MAXNAMELEN + 1]; cap_rights_t rights; int error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); + error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); @@ -590,11 +590,11 @@ kern_extattr_delete_path(struct thread *td, const char const char *uattrname, int follow) { struct nameidata nd; - char attrname[EXTATTR_MAXNAMELEN]; + char attrname[EXTATTR_MAXNAMELEN + 1]; int error; AUDIT_ARG_VALUE(attrnamespace); - error = copyinstr(uattrname, attrname, EXTATTR_MAXNAMELEN, NULL); + error = copyinstr(uattrname, attrname, sizeof(attrname), NULL); if (error) return(error); AUDIT_ARG_TEXT(attrname); Modified: head/usr.sbin/extattr/tests/extattr_test.sh ============================================================================== --- head/usr.sbin/extattr/tests/extattr_test.sh Wed May 13 21:16:02 2020 (r361020) +++ head/usr.sbin/extattr/tests/extattr_test.sh Thu May 14 03:01:23 2020 (r361021) @@ -75,9 +75,6 @@ long_name_body() { atf_skip "Filesystem not reporting NAME_MAX; skipping testcase" fi - # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208965 - atf_expect_fail "BUG 208965 extattr(2) doesn't allow maxlen attr names" - ATTRNAME=`jot -b X -s "" $NAME_MAX 0` touch foo atf_check -s exit:0 -o empty setextattr user $ATTRNAME myvalue foo From owner-svn-src-head@freebsd.org Thu May 14 03:25:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2DEA2E375F; Thu, 14 May 2020 03:25:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MxkJ5FjSz3HQd; Thu, 14 May 2020 03:25: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 AF89845D1; Thu, 14 May 2020 03:25: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 04E3PCTV050251; Thu, 14 May 2020 03:25:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E3PCwA050250; Thu, 14 May 2020 03:25:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005140325.04E3PCwA050250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 14 May 2020 03:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361022 - head/usr.sbin/certctl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/certctl X-SVN-Commit-Revision: 361022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 03:25:12 -0000 Author: kevans Date: Thu May 14 03:25:12 2020 New Revision: 361022 URL: https://svnweb.freebsd.org/changeset/base/361022 Log: certctl(8): don't completely nuke $CERTDESTDIR It's been reported/noted that a well-timed `certctl rehash` will completely obliterate $CERTDESTDIR, which may get used by ports or system administrators. While we can't guarantee the certctl semantics when other non-certctl-controlled bits live here, we should make some amount of effort to play nice. Pruning all existing links, which we'll subsequently rebuild as needed, is sufficient for our needs. This can still be destructive, but it's perhaps less likely to cause issues. I also note that we should probably be pruning /etc/ssl/blacklisted upon rehash as well. Reported by: cem's dovecot server MFC after: 3 days Modified: head/usr.sbin/certctl/certctl.sh Modified: head/usr.sbin/certctl/certctl.sh ============================================================================== --- head/usr.sbin/certctl/certctl.sh Thu May 14 03:01:23 2020 (r361021) +++ head/usr.sbin/certctl/certctl.sh Thu May 14 03:25:12 2020 (r361022) @@ -142,9 +142,11 @@ do_list() cmd_rehash() { - [ $NOOP -eq 0 ] && rm -rf "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$BLACKLISTDESTDIR" + if [ $NOOP -eq 0 ]; then + [ -e "$CERTDESTDIR" ] && find "$CERTDESTDIR" -type link -delete + mkdir -p "$CERTDESTDIR" + mkdir -p "$BLACKLISTDESTDIR" + fi do_scan create_blacklisted "$BLACKLISTPATH" do_scan create_trusted_link "$TRUSTPATH" From owner-svn-src-head@freebsd.org Thu May 14 03:30:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A98F2E3817; Thu, 14 May 2020 03:30:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MxrN37YFz3HZF; Thu, 14 May 2020 03:30:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66DE845DD; Thu, 14 May 2020 03:30:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04E3USPr050539; Thu, 14 May 2020 03:30:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E3USMB050538; Thu, 14 May 2020 03:30:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005140330.04E3USMB050538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 14 May 2020 03:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361023 - head/usr.sbin/certctl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/certctl X-SVN-Commit-Revision: 361023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 03:30:28 -0000 Author: kevans Date: Thu May 14 03:30:27 2020 New Revision: 361023 URL: https://svnweb.freebsd.org/changeset/base/361023 Log: certctl: follow-up to r361022, prune blacklist as well Otherwise, removals from the blacklist may not get processed as they should. While we're here, restructure these to not bother with mkdir(1) if we've already tested them to exist. MFC after: 3 days Modified: head/usr.sbin/certctl/certctl.sh Modified: head/usr.sbin/certctl/certctl.sh ============================================================================== --- head/usr.sbin/certctl/certctl.sh Thu May 14 03:25:12 2020 (r361022) +++ head/usr.sbin/certctl/certctl.sh Thu May 14 03:30:27 2020 (r361023) @@ -143,9 +143,16 @@ cmd_rehash() { if [ $NOOP -eq 0 ]; then - [ -e "$CERTDESTDIR" ] && find "$CERTDESTDIR" -type link -delete - mkdir -p "$CERTDESTDIR" - mkdir -p "$BLACKLISTDESTDIR" + if [ -e "$CERTDESTDIR" ]; then + find "$CERTDESTDIR" -type link -delete + else + mkdir -p "$CERTDESTDIR" + fi + if [ -e "$BLACKLISTDESTDIR" ]; then + find "$BLACKLISTDESTDIR" -type link -delete + else + mkdir -p "$BLACKLISTDESTDIR" + fi fi do_scan create_blacklisted "$BLACKLISTPATH" From owner-svn-src-head@freebsd.org Thu May 14 04:00:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 226222E415B; Thu, 14 May 2020 04:00:36 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MyW76z0Vz3K07; Thu, 14 May 2020 04:00:35 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA6E14B9D; Thu, 14 May 2020 04:00:35 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04E40Zh4071153; Thu, 14 May 2020 04:00:35 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E40Zeb071152; Thu, 14 May 2020 04:00:35 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202005140400.04E40Zeb071152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Thu, 14 May 2020 04:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361024 - head/lib/csu/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/lib/csu/powerpc X-SVN-Commit-Revision: 361024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 04:00:36 -0000 Author: bdragon Date: Thu May 14 04:00:35 2020 New Revision: 361024 URL: https://svnweb.freebsd.org/changeset/base/361024 Log: [PowerPC] Fix wrong instructions in _savegpr_X. We were accidentally using stfd instead of stw in our SAVEGPR macro. This has almost certainly been causing crashes when compiling with -Os. Reviewed by: jhibbits (in irc) MFC after: 3 days Sponsored by: Tag1 Consulting, Inc. Modified: head/lib/csu/powerpc/crtsavres.S Modified: head/lib/csu/powerpc/crtsavres.S ============================================================================== --- head/lib/csu/powerpc/crtsavres.S Thu May 14 03:30:27 2020 (r361023) +++ head/lib/csu/powerpc/crtsavres.S Thu May 14 04:00:35 2020 (r361024) @@ -93,7 +93,7 @@ RESTFPR(31) blr #define SAVEGPR(r) _CRTENTRY(__CONCAT(_savegpr_,r)) \ - stfd r,(-128 + r*4)(11) + stw r,(-128 + r * 4)(11) SAVEGPR(14) SAVEGPR(15) @@ -165,7 +165,7 @@ RESTFPR_X(31) blr #define RESTGPR_X(r) _CRTENTRY(__CONCAT(__CONCAT(_restgpr_,r),_x)) \ - lwz r,(-128 + r*4)(11) + lwz r,(-128 + r * 4)(11) RESTGPR_X(14) RESTGPR_X(15) From owner-svn-src-head@freebsd.org Thu May 14 05:01:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F8E42E55CE; Thu, 14 May 2020 05:01:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MzsC2L2Yz3MS4; Thu, 14 May 2020 05:01:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 314A656E3; Thu, 14 May 2020 05:01:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04E51JbX005384; Thu, 14 May 2020 05:01:19 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E51Jn1005383; Thu, 14 May 2020 05:01:19 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005140501.04E51Jn1005383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 14 May 2020 05:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361025 - head/tools/tools/ath/athratestats X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/tools/ath/athratestats X-SVN-Commit-Revision: 361025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 05:01:19 -0000 Author: adrian Date: Thu May 14 05:01:18 2020 New Revision: 361025 URL: https://svnweb.freebsd.org/changeset/base/361025 Log: [ath] Extend the colours to 4, not 2. There's 8 bins in the upcoming changeset to ath/ath_rate, so I need more colours. Yeah, I know. Modified: head/tools/tools/ath/athratestats/main.c Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Thu May 14 04:00:35 2020 (r361024) +++ head/tools/tools/ath/athratestats/main.c Thu May 14 05:01:18 2020 (r361025) @@ -122,7 +122,7 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r (long long) sn->ratemask); for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { - PRINTATTR_ON(COLOR_PAIR(4 + (y % 2)) | A_BOLD); + PRINTATTR_ON(COLOR_PAIR(2 + (y % 4)) | A_BOLD); PRINTMSG("[%4u] cur rate %d %s since switch: " "packets %d ticks %u ", bin_to_size(y), @@ -132,17 +132,16 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r sn->ticks_since_switch[y]); PRINTMSG("last sample (%d %s) cur sample (%d %s) " - "packets sent %d\n", + "packets sent %d ", dot11rate(rt, sn->last_sample_rix[y]), dot11str(rt, sn->last_sample_rix[y]), dot11rate(rt, sn->current_sample_rix[y]), dot11str(rt, sn->current_sample_rix[y]), sn->packets_sent[y]); - PRINTATTR_OFF(COLOR_PAIR(4 + (y % 2)) | A_BOLD); + PRINTATTR_OFF(COLOR_PAIR(2 + (y % 4)) | A_BOLD); - PRINTATTR_ON(COLOR_PAIR(3) | A_BOLD); - PRINTMSG("[%4u] packets since sample %d sample tt %u\n", - bin_to_size(y), + PRINTATTR_ON(COLOR_PAIR(1) | A_BOLD); + PRINTMSG("packets since sample %d sample tt %u\n", sn->packets_since_sample[y], sn->sample_tt[y]); PRINTATTR_OFF(COLOR_PAIR(3) | A_BOLD); @@ -156,9 +155,9 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r if (sn->stats[y][rix].total_packets == 0) continue; if (rix == sn->current_rix[y]) - PRINTATTR_ON(COLOR_PAIR(y+4) | A_BOLD); + PRINTATTR_ON(COLOR_PAIR(2 + (y % 4)) | A_BOLD); else if (rix == sn->last_sample_rix[y]) - PRINTATTR_ON(COLOR_PAIR(3) | A_BOLD); + PRINTATTR_ON(COLOR_PAIR(1) | A_BOLD); #if 0 else if (sn->stats[y][rix].ewma_pct / 10 < 50) PRINTATTR_ON(COLOR_PAIR(2) | A_BOLD); @@ -179,9 +178,9 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r sn->stats[y][rix].average_tx_time, sn->stats[y][rix].last_tx); if (rix == sn->current_rix[y]) - PRINTATTR_OFF(COLOR_PAIR(y+4) | A_BOLD); + PRINTATTR_OFF(COLOR_PAIR(2 + (y % 4)) | A_BOLD); else if (rix == sn->last_sample_rix[y]) - PRINTATTR_OFF(COLOR_PAIR(3) | A_BOLD); + PRINTATTR_OFF(COLOR_PAIR(1) | A_BOLD); #if 0 else if (sn->stats[y][rix].ewma_pct / 10 < 50) PRINTATTR_OFF(COLOR_PAIR(2) | A_BOLD); From owner-svn-src-head@freebsd.org Thu May 14 09:18:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 838142EA592; Thu, 14 May 2020 09:18:51 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49N5ZM2vf5z45YZ; Thu, 14 May 2020 09:18:51 +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 5EE4C8892; Thu, 14 May 2020 09:18:51 +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 04E9IpCL065285; Thu, 14 May 2020 09:18:51 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E9Ip5B065283; Thu, 14 May 2020 09:18:51 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005140918.04E9Ip5B065283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Thu, 14 May 2020 09:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361028 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 361028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 09:18:51 -0000 Author: bcr (doc committer) Date: Thu May 14 09:18:50 2020 New Revision: 361028 URL: https://svnweb.freebsd.org/changeset/base/361028 Log: Add new stats(7) man page and hook it up to the build. This man page contains stat utilities that are available in the base system. This is a better approach than looking them up via "apropos stat" or similar commands. Thanks to Daniel Ebdrup Jensen for writing the original page and incorporating the feedback given. Submitted by: Daniel Ebdrup Jensen Reviewed by: 0mp, allanjude, brueffer, bcr Approved by: bcr MFC after: 3 days Relnotes: yes (new stats(7) man page) Differential Revision: https://reviews.freebsd.org/D24417 Added: head/share/man/man7/stats.7 (contents, props changed) Modified: head/share/man/man7/Makefile Modified: head/share/man/man7/Makefile ============================================================================== --- head/share/man/man7/Makefile Thu May 14 06:07:23 2020 (r361027) +++ head/share/man/man7/Makefile Thu May 14 09:18:50 2020 (r361028) @@ -26,6 +26,7 @@ MAN= arch.7 \ sdoc.7 \ security.7 \ sprog.7 \ + stats.7 \ stdint.7 \ sticky.7 \ tests.7 \ Added: head/share/man/man7/stats.7 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man7/stats.7 Thu May 14 09:18:50 2020 (r361028) @@ -0,0 +1,120 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2020 Daniel Ebdrup Jensen +.\" +.\" 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 May 14, 2020 +.Dt STATS 7 +.Os +.Sh NAME +.Nm stats +.Nd information about various and sundry statistics utilities +.Sh DESCRIPTION +The +.Fx +userland in part contains a series of utilities which can be used +to ascertain system state at runtime and optionally from core files. +.Sh COMMANDS +The following commands +.Pq sorted alphabetically +are currently included in the base system, with more appearing periodically. +.Bl -tag -width "zpool iostat" +.It Nm btsockstat +Show Bluetooth socket information +.It Nm ctlstat +CAM Target Layer statistics utility +.It Nm fstat +Identify active files +.It Nm gstat +Print statistics about GEOM disks +.It Nm ibstat +Display information from the InfiniBand driver +.It Nm ifmcstat +Dump multicast group management statistics per interface +.It Nm iostat +Report kernel subsystem I/O statistics +.It Nm ipfstat +Display IPF packet filter statistics and filter list +.It Nm kldstat +Display status of dynamic kernel linker +.It Nm lockstat +Report kernel lock and profiling statistics +.It Nm mailstats +Display mail statistics +.It Nm netstat +Show network status and statistics +.It Nm nfsstat +Display NFS statistics +.It Nm plockstat +Trace pthread lock statistics using DTrace +.It Nm pmcstat +Performance measurement with performance monitoring hardware +.It Nm procstat +Get detailed process information +.It Nm pstat +Display system data structures +.It Nm sockstat +List open sockets +.It Nm stat +Display file status +.It Nm systat +Display system statistics +.It Nm vmstat +Report virtual memory statistics +.It Nm zpool iostat +Report ZFS I/O statistics +.Sh SEE ALSO +.Xr intro 1 , +.Xr intro 7 , +.Xr intro 8 , +.Xr btsockstat 1 , +.Xr ctlstat 8 , +.Xr fstat 1 , +.Xr gstat 8 , +.Xr ibstat 8 , +.Xr ifmcstat 8 , +.Xr iostat 8 , +.Xr ipfstat 8 , +.Xr kldstat 8 , +.Xr lockstat 1 , +.Xr mailstats 8 , +.Xr netstat 1 , +.Xr plockstat 1 , +.Xr pmcstat 8 , +.Xr procstat 1 , +.Xr pstat 8 , +.Xr sockstat 1, +.Xr stat 1 , +.Xr systat 1 , +.Xr vmstat 8 , +.Xr zpool-iostat 8 , +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 13.0 . +.Sh AUTHORS +.An Daniel Ebdrup Jensen Aq Mt debdrup@FreeBSD.org From owner-svn-src-head@freebsd.org Thu May 14 15:49:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17A512F530D; Thu, 14 May 2020 15:49:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NGFF6vtzz4Tbs; Thu, 14 May 2020 15:49:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E84ECD614; Thu, 14 May 2020 15:49:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EFnbQb005366; Thu, 14 May 2020 15:49:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EFnb1b005365; Thu, 14 May 2020 15:49:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005141549.04EFnb1b005365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 14 May 2020 15:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361031 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 361031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 15:49:38 -0000 Author: markj Date: Thu May 14 15:49:37 2020 New Revision: 361031 URL: https://svnweb.freebsd.org/changeset/base/361031 Log: Assert that page table traversal functions don't operate on superpages. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24828 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu May 14 12:52:08 2020 (r361030) +++ head/sys/amd64/amd64/pmap.c Thu May 14 15:49:37 2020 (r361031) @@ -1317,6 +1317,8 @@ pmap_pdpe_to_pde(pdp_entry_t *pdpe, vm_offset_t va) { pd_entry_t *pde; + KASSERT((*pdpe & PG_PS) == 0, + ("%s: pdpe %#lx is a leaf", __func__, *pdpe)); pde = (pd_entry_t *)PHYS_TO_DMAP(*pdpe & PG_FRAME); return (&pde[pmap_pde_index(va)]); } @@ -1341,6 +1343,8 @@ pmap_pde_to_pte(pd_entry_t *pde, vm_offset_t va) { pt_entry_t *pte; + KASSERT((*pde & PG_PS) == 0, + ("%s: pde %#lx is a leaf", __func__, *pde)); pte = (pt_entry_t *)PHYS_TO_DMAP(*pde & PG_FRAME); return (&pte[pmap_pte_index(va)]); } From owner-svn-src-head@freebsd.org Thu May 14 16:06:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5E5D2F5C0E; Thu, 14 May 2020 16:06:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NGdB4ssVz4VgW; Thu, 14 May 2020 16:06:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88B52D9D5; Thu, 14 May 2020 16:06:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EG6s5P017231; Thu, 14 May 2020 16:06:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EG6sMi017229; Thu, 14 May 2020 16:06:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005141606.04EG6sMi017229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 14 May 2020 16:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361032 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 361032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 16:06:54 -0000 Author: markj Date: Thu May 14 16:06:54 2020 New Revision: 361032 URL: https://svnweb.freebsd.org/changeset/base/361032 Log: Allocate UMA per-CPU counters earlier. Otherwise anything counted before SI_SUB_VM_CONF is discarded. However, it is useful to be able to see stats from allocations done early during boot. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24756 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu May 14 15:49:37 2020 (r361031) +++ head/sys/vm/uma_core.c Thu May 14 16:06:54 2020 (r361032) @@ -192,6 +192,7 @@ SYSCTL_ULONG(_vm, OID_AUTO, uma_kmem_total, CTLFLAG_RD static enum { BOOT_COLD, BOOT_KVA, + BOOT_PCPU, BOOT_RUNNING, BOOT_SHUTDOWN, } booted = BOOT_COLD; @@ -304,7 +305,6 @@ static int hash_alloc(struct uma_hash *, u_int); static int hash_expand(struct uma_hash *, struct uma_hash *); static void hash_free(struct uma_hash *hash); static void uma_timeout(void *); -static void uma_startup3(void); static void uma_shutdown(void); static void *zone_alloc_item(uma_zone_t, void *, int, int); static void zone_free_item(uma_zone_t, void *, void *, enum zfreeskip); @@ -360,8 +360,6 @@ SYSCTL_COUNTER_U64(_vm_debug, OID_AUTO, skipped, CTLFL &uma_skip_cnt, "memory items skipped, not debugged"); #endif -SYSINIT(uma_startup3, SI_SUB_VM_CONF, SI_ORDER_SECOND, uma_startup3, NULL); - SYSCTL_NODE(_vm, OID_AUTO, uma, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Universal Memory Allocator"); @@ -2658,9 +2656,10 @@ zone_ctor(void *mem, int size, void *udata, int flags) (UMA_ZONE_INHERIT | UMA_ZFLAG_INHERIT)); out: - if (__predict_true(booted >= BOOT_RUNNING)) { + if (booted >= BOOT_PCPU) { zone_alloc_counters(zone, NULL); - zone_alloc_sysctl(zone, NULL); + if (booted >= BOOT_RUNNING) + zone_alloc_sysctl(zone, NULL); } else { zone->uz_allocs = EARLY_COUNTER; zone->uz_frees = EARLY_COUNTER; @@ -2904,10 +2903,23 @@ uma_startup2(void) } /* + * Allocate counters as early as possible so that boot-time allocations are + * accounted more precisely. + */ +static void +uma_startup_pcpu(void *arg __unused) +{ + + zone_foreach_unlocked(zone_alloc_counters, NULL); + booted = BOOT_PCPU; +} +SYSINIT(uma_startup_pcpu, SI_SUB_COUNTER, SI_ORDER_ANY, uma_startup_pcpu, NULL); + +/* * Finish our initialization steps. */ static void -uma_startup3(void) +uma_startup3(void *arg __unused) { #ifdef INVARIANTS @@ -2915,7 +2927,6 @@ uma_startup3(void) uma_dbg_cnt = counter_u64_alloc(M_WAITOK); uma_skip_cnt = counter_u64_alloc(M_WAITOK); #endif - zone_foreach_unlocked(zone_alloc_counters, NULL); zone_foreach_unlocked(zone_alloc_sysctl, NULL); callout_init(&uma_callout, 1); callout_reset(&uma_callout, UMA_TIMEOUT * hz, uma_timeout, NULL); @@ -2924,6 +2935,7 @@ uma_startup3(void) EVENTHANDLER_REGISTER(shutdown_post_sync, uma_shutdown, NULL, EVENTHANDLER_PRI_FIRST); } +SYSINIT(uma_startup3, SI_SUB_VM_CONF, SI_ORDER_SECOND, uma_startup3, NULL); static void uma_shutdown(void) From owner-svn-src-head@freebsd.org Thu May 14 16:07:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C12762F5C70; Thu, 14 May 2020 16:07:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NGdr4jMCz4VpK; Thu, 14 May 2020 16:07:28 +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 9C57CD9DA; Thu, 14 May 2020 16:07:28 +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 04EG7Sme017312; Thu, 14 May 2020 16:07:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EG7RnJ017305; Thu, 14 May 2020 16:07:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005141607.04EG7RnJ017305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 14 May 2020 16:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361033 - in head/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica X-SVN-Commit-Revision: 361033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 16:07:28 -0000 Author: markj Date: Thu May 14 16:07:27 2020 New Revision: 361033 URL: https://svnweb.freebsd.org/changeset/base/361033 Log: Call acpi_pxm_set_proximity_info() slightly earlier on x86. This function is responsible for setting pc_domain in each pcpu structure. Call it from the main function that starts APs, rather than a separate SYSINIT. This makes it easier to close the window where UMA's per-CPU slab allocator may be called while pc_domain is uninitialized. In particular, the allocator uses pc_domain to allocate domain-local pages, so allocations before this point end up using domain 0 for everything. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24757 Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/arm64/arm64/mp_machdep.c head/sys/dev/acpica/acpi_pxm.c head/sys/dev/acpica/acpivar.h head/sys/i386/i386/mp_machdep.c head/sys/x86/acpica/srat.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Thu May 14 16:06:54 2020 (r361032) +++ head/sys/amd64/amd64/mp_machdep.c Thu May 14 16:07:27 2020 (r361033) @@ -264,8 +264,9 @@ cpu_mp_start(void) init_ops.start_all_aps(); set_interrupt_apic_ids(); -} + acpi_pxm_set_cpu_locality(); +} /* * AP CPU's call this to initialize themselves. Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Thu May 14 16:06:54 2020 (r361032) +++ head/sys/arm64/arm64/mp_machdep.c Thu May 14 16:07:27 2020 (r361033) @@ -535,9 +535,7 @@ cpu_init_acpi(void) acpi_unmap_table(madt); #if MAXMEMDOM > 1 - /* set proximity info */ acpi_pxm_set_cpu_locality(); - acpi_pxm_free(); #endif } #endif Modified: head/sys/dev/acpica/acpi_pxm.c ============================================================================== --- head/sys/dev/acpica/acpi_pxm.c Thu May 14 16:06:54 2020 (r361032) +++ head/sys/dev/acpica/acpi_pxm.c Thu May 14 16:07:27 2020 (r361033) @@ -628,7 +628,8 @@ srat_walk_table(acpi_subtable_handler *handler, void * } /* - * Setup per-CPU domain IDs from information saved in 'cpus'. + * Set up per-CPU domain IDs from information saved in 'cpus' and tear down data + * structures allocated by acpi_pxm_init(). */ void acpi_pxm_set_cpu_locality(void) @@ -651,6 +652,10 @@ acpi_pxm_set_cpu_locality(void) printf("SRAT: CPU %u has memory domain %d\n", i, pc->pc_domain); } + /* XXXMJ the page is leaked. */ + pmap_unmapbios((vm_offset_t)cpus, sizeof(*cpus) * max_cpus); + srat_physaddr = 0; + cpus = NULL; } int @@ -662,20 +667,6 @@ acpi_pxm_get_cpu_locality(int apic_id) if (cpu == NULL) panic("SRAT: CPU with ID %u is not known", apic_id); return (cpu->domain); -} - -/* - * Free data structures allocated during acpi_pxm_init. - */ -void -acpi_pxm_free(void) -{ - - if (srat_physaddr == 0) - return; - pmap_unmapbios((vm_offset_t)cpus, sizeof(*cpus) * max_cpus); - srat_physaddr = 0; - cpus = NULL; } /* Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Thu May 14 16:06:54 2020 (r361032) +++ head/sys/dev/acpica/acpivar.h Thu May 14 16:07:27 2020 (r361033) @@ -540,7 +540,6 @@ void acpi_pxm_parse_tables(void); void acpi_pxm_set_mem_locality(void); void acpi_pxm_set_cpu_locality(void); int acpi_pxm_get_cpu_locality(int apic_id); -void acpi_pxm_free(void); /* * Map a PXM to a VM domain. Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Thu May 14 16:06:54 2020 (r361032) +++ head/sys/i386/i386/mp_machdep.c Thu May 14 16:07:27 2020 (r361033) @@ -198,6 +198,8 @@ cpu_mp_start(void) start_all_aps(); set_interrupt_apic_ids(); + + acpi_pxm_set_cpu_locality(); } /* Modified: head/sys/x86/acpica/srat.c ============================================================================== --- head/sys/x86/acpica/srat.c Thu May 14 16:06:54 2020 (r361032) +++ head/sys/x86/acpica/srat.c Thu May 14 16:07:27 2020 (r361033) @@ -56,13 +56,4 @@ parse_acpi_tables(void *dummy) SYSINIT(parse_acpi_tables, SI_SUB_VM - 1, SI_ORDER_FIRST, parse_acpi_tables, NULL); -static void -srat_set_cpus(void *dummy) -{ - - acpi_pxm_set_cpu_locality(); - acpi_pxm_free(); -} -SYSINIT(srat_set_cpus, SI_SUB_CPU, SI_ORDER_ANY, srat_set_cpus, NULL); - #endif /* MAXMEMDOM > 1 */ From owner-svn-src-head@freebsd.org Thu May 14 17:19:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24C2A2F73C8; Thu, 14 May 2020 17:19:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NJDX08x1z4ZKv; Thu, 14 May 2020 17:19:08 +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 009AFE76E; Thu, 14 May 2020 17:19:08 +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 04EHJ7cq060766; Thu, 14 May 2020 17:19:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EHJ7JF060765; Thu, 14 May 2020 17:19:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005141719.04EHJ7JF060765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 14 May 2020 17:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361034 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 361034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 17:19:08 -0000 Author: emaste Date: Thu May 14 17:19:07 2020 New Revision: 361034 URL: https://svnweb.freebsd.org/changeset/base/361034 Log: ObsoleteFiles.inc: use date (not xxxx) for ubsec removal Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu May 14 16:07:27 2020 (r361033) +++ head/ObsoleteFiles.inc Thu May 14 17:19:07 2020 (r361034) @@ -36,7 +36,7 @@ # xargs -n1 | sort | uniq -d; # done -# 2020xxxx: Remove ubsec(4) +# 20200511: Remove ubsec(4) OLD_FILES+=usr/share/man/man4/ubsec.4.gz # 20200506: GNU objdump 2.17.50 retired From owner-svn-src-head@freebsd.org Thu May 14 17:49:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E05192F7D4D; Thu, 14 May 2020 17:49:07 +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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NJv75cNjz4c1p; Thu, 14 May 2020 17:49:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-164.local (unknown [IPv6:2601:648:8203:2990:59ea:1632:b928:42c4]) (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 4D548FF01; Thu, 14 May 2020 17:49:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361034 - head To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005141719.04EHJ7JF060765@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: <67e768d9-f2a5-cfa5-d674-4c33e3fb7696@FreeBSD.org> Date: Thu, 14 May 2020 10:49:05 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202005141719.04EHJ7JF060765@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 17:49:07 -0000 On 5/14/20 10:19 AM, Ed Maste wrote: > Author: emaste > Date: Thu May 14 17:19:07 2020 > New Revision: 361034 > URL: https://svnweb.freebsd.org/changeset/base/361034 > > Log: > ObsoleteFiles.inc: use date (not xxxx) for ubsec removal > > Modified: > head/ObsoleteFiles.inc Oops, sorry. I meant to fix that up before commit. :-/ (I use xxxx as the date while it is in the branch) -- John Baldwin From owner-svn-src-head@freebsd.org Thu May 14 17:52:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 807B12F7FE1; Thu, 14 May 2020 17:52:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NJz22p3Nz4cZ4; Thu, 14 May 2020 17:52:30 +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 5B211EF6B; Thu, 14 May 2020 17:52:30 +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 04EHqU9Q084822; Thu, 14 May 2020 17:52:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EHqUVB084821; Thu, 14 May 2020 17:52:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005141752.04EHqUVB084821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 14 May 2020 17:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361036 - head/usr.sbin/inetd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/inetd X-SVN-Commit-Revision: 361036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 17:52:30 -0000 Author: kevans Date: Thu May 14 17:52:29 2020 New Revision: 361036 URL: https://svnweb.freebsd.org/changeset/base/361036 Log: inetd(8): Add comments to all examples Submitted by: debdrup (with some minor changes by kevans) Reviewed by: bcr (manpages) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24818 Modified: head/usr.sbin/inetd/inetd.8 Modified: head/usr.sbin/inetd/inetd.8 ============================================================================== --- head/usr.sbin/inetd/inetd.8 Thu May 14 17:47:55 2020 (r361035) +++ head/usr.sbin/inetd/inetd.8 Thu May 14 17:52:29 2020 (r361036) @@ -28,7 +28,7 @@ .\" from: @(#)inetd.8 8.3 (Berkeley) 4/13/94 .\" $FreeBSD$ .\" -.Dd May 12, 2020 +.Dd May 14, 2020 .Dt INETD 8 .Os .Sh NAME @@ -793,16 +793,30 @@ the pid of the currently running .Sh "EXAMPLES" Here are several example service entries for the various types of services: .Bd -literal +# The first four launch the relevant daemon when a connection on a port +# as defined by /etc/services is opened. ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l ntalk dgram udp wait root /usr/libexec/ntalkd ntalkd telnet stream tcp6 nowait root /usr/libexec/telnetd telnetd shell stream tcp46 nowait root /usr/libexec/rshd rshd + +# Let the system respond to date requests via tcpmux tcpmux/+date stream tcp nowait guest /bin/date date + +# Let people access the system phonebook via tcpmux tcpmux/phonebook stream tcp nowait guest /usr/local/bin/phonebook phonebook + +# Make kernel statistics accessible rstatd/1-3 dgram rpc/udp wait root /usr/libexec/rpc.rstatd rpc.rstatd + # Use netcat as a one-shot HTTP proxy with nc (from freebsd-tips fortune) http stream tcp nowait nobody /usr/bin/nc nc -N dest-ip 80 -/var/run/echo stream unix nowait root internal + +# Set up a unix socket at /var/run/echo that echo's back whatever is written +# to it. +/var/run/echo stream unix nowait root internal + +# Run chargen for IPsec Authentication Headers #@ ipsec ah/require chargen stream tcp nowait root internal #@ From owner-svn-src-head@freebsd.org Thu May 14 17:54:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37E662D8C4C; Thu, 14 May 2020 17:54:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NK0x0pJsz4ctW; Thu, 14 May 2020 17:54:09 +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 16928EF8C; Thu, 14 May 2020 17:54:09 +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 04EHs8bv085120; Thu, 14 May 2020 17:54:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EHs842085119; Thu, 14 May 2020 17:54:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005141754.04EHs842085119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 14 May 2020 17:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361037 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 361037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 17:54:09 -0000 Author: kib Date: Thu May 14 17:54:08 2020 New Revision: 361037 URL: https://svnweb.freebsd.org/changeset/base/361037 Log: Fix spurious ENOTCONN from closed unix domain socket other' side. Sometimes, when doing read(2) over unix domain socket, for which the other side socket was closed, read(2) returns -1/ENOTCONN instead of EOF AKA zero-size read. This is because soreceive_generic() does not lock socket when testing the so_state SS_ISCONNECTED|SS_ISCONNECTING flags. It could end up that we do not observe so->so_rcv.sb_state bit SBS_CANTRCVMORE, and then miss SS_ flags. Change the test to check that the socket was never connected before returning ENOTCONN, by adding all state bits for connected. Reported and tested by: pho In collaboration with: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24819 Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu May 14 17:52:29 2020 (r361036) +++ head/sys/kern/uipc_socket.c Thu May 14 17:54:08 2020 (r361037) @@ -1969,8 +1969,9 @@ restart: m = so->so_rcv.sb_mb; goto dontblock; } - if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 && - (so->so_proto->pr_flags & PR_CONNREQUIRED)) { + if ((so->so_state & (SS_ISCONNECTING | SS_ISCONNECTED | + SS_ISDISCONNECTING | SS_ISDISCONNECTED)) == 0 && + (so->so_proto->pr_flags & PR_CONNREQUIRED) != 0) { SOCKBUF_UNLOCK(&so->so_rcv); error = ENOTCONN; goto release; From owner-svn-src-head@freebsd.org Thu May 14 17:56:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 393C92D91EE; Thu, 14 May 2020 17:56:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NK3x0pBnz4d94; Thu, 14 May 2020 17:56:45 +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 15662EF90; Thu, 14 May 2020 17:56:45 +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 04EHuiWi085353; Thu, 14 May 2020 17:56:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EHui2j085352; Thu, 14 May 2020 17:56:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005141756.04EHui2j085352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 14 May 2020 17:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361039 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 361039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 17:56:45 -0000 Author: markj Date: Thu May 14 17:56:44 2020 New Revision: 361039 URL: https://svnweb.freebsd.org/changeset/base/361039 Log: Fix the i386 build after r361033. Reported by: Jenkins Modified: head/sys/i386/i386/mp_machdep.c Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Thu May 14 17:56:43 2020 (r361038) +++ head/sys/i386/i386/mp_machdep.c Thu May 14 17:56:44 2020 (r361039) @@ -83,6 +83,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #define WARMBOOT_TARGET 0 #define WARMBOOT_OFF (PMAP_MAP_LOW + 0x0467) #define WARMBOOT_SEG (PMAP_MAP_LOW + 0x0469) @@ -199,7 +202,9 @@ cpu_mp_start(void) set_interrupt_apic_ids(); +#if MAXMEMDOM > 1 acpi_pxm_set_cpu_locality(); +#endif } /* From owner-svn-src-head@freebsd.org Thu May 14 19:57:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 615852DD0CC; Thu, 14 May 2020 19:57:53 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NMlj21Nhz3L9T; Thu, 14 May 2020 19:57:53 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27D1118756; Thu, 14 May 2020 19:57:53 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EJvrqX059991; Thu, 14 May 2020 19:57:53 GMT (envelope-from jceel@FreeBSD.org) Received: (from jceel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EJvrdP059990; Thu, 14 May 2020 19:57:53 GMT (envelope-from jceel@FreeBSD.org) Message-Id: <202005141957.04EJvrdP059990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jceel set sender to jceel@FreeBSD.org using -f From: Jakub Wojciech Klama Date: Thu, 14 May 2020 19:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361054 - head/contrib/lib9p X-SVN-Group: head X-SVN-Commit-Author: jceel X-SVN-Commit-Paths: head/contrib/lib9p X-SVN-Commit-Revision: 361054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 19:57:53 -0000 Author: jceel Date: Thu May 14 19:57:52 2020 New Revision: 361054 URL: https://svnweb.freebsd.org/changeset/base/361054 Log: Import lib9p 7ddb1164407da19b9b1afb83df83ae65a71a9a66. Approved by: trasz MFC after: 1 month Sponsored by: Conclusive Engineering (development), vStack.com (funding) Added: head/contrib/lib9p/ - copied from r361050, vendor/lib9p/dist/ From owner-svn-src-head@freebsd.org Thu May 14 20:17:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 017902DDB85; Thu, 14 May 2020 20:17:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NN9x6CLHz3MXk; Thu, 14 May 2020 20:17:09 +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 D04EC18B35; Thu, 14 May 2020 20:17:09 +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 04EKH9aZ071967; Thu, 14 May 2020 20:17:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EKH9pQ071966; Thu, 14 May 2020 20:17:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005142017.04EKH9pQ071966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 14 May 2020 20:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361056 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 361056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 20:17:10 -0000 Author: kib Date: Thu May 14 20:17:09 2020 New Revision: 361056 URL: https://svnweb.freebsd.org/changeset/base/361056 Log: Fix r361037. Reorder flag manipulations and use barrier to ensure that the program order is followed by compiler and CPU, for unlocked reader of so_state. In collaboration with: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24842 Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu May 14 20:07:02 2020 (r361055) +++ head/sys/kern/uipc_socket.c Thu May 14 20:17:09 2020 (r361056) @@ -4016,8 +4016,17 @@ soisdisconnected(struct socket *so) { SOCK_LOCK(so); - so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); + + /* + * There is at least one reader of so_state that does not + * acquire socket lock, namely soreceive_generic(). Ensure + * that it never sees all flags that track connection status + * cleared, by ordering the update with a barrier semantic of + * our release thread fence. + */ so->so_state |= SS_ISDISCONNECTED; + atomic_thread_fence_rel(); + so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); if (!SOLISTENING(so)) { SOCK_UNLOCK(so); From owner-svn-src-head@freebsd.org Thu May 14 21:02:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0B5E2DFB46; Thu, 14 May 2020 21:02:25 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49NPB870ffz3wZG; Thu, 14 May 2020 21:02:24 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 767513C0199; Thu, 14 May 2020 21:02:24 +0000 (UTC) Date: Thu, 14 May 2020 21:02:24 +0000 From: Brooks Davis To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r360833 - head Message-ID: <20200514210224.GE60902@spindle.one-eyed-alien.net> References: <202005090201.04921Tpf028388@repo.freebsd.org> <20200511181027.GA60902@spindle.one-eyed-alien.net> <20200512221603.GB60902@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VUDLurXRWRKrGuMn" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 49NPB870ffz3wZG X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-6.53 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; IP_SCORE(-3.63)[ip: (-9.56), ipnet: 199.48.128.0/22(-4.77), asn: 36236(-3.79), country: US(-0.05)]; TO_DN_ALL(0.00)[]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 21:02:25 -0000 --VUDLurXRWRKrGuMn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 12, 2020 at 09:01:33PM -0500, Kyle Evans wrote: > On Tue, May 12, 2020 at 5:16 PM Brooks Davis wrote: > > > > On Mon, May 11, 2020 at 01:45:14PM -0500, Kyle Evans wrote: > > > On Mon, May 11, 2020 at 1:10 PM Brooks Davis wro= te: > > > > > > > > On Sat, May 09, 2020 at 02:01:29AM +0000, Kyle Evans wrote: > > > > > Author: kevans > > > > > Date: Sat May 9 02:01:29 2020 > > > > > New Revision: 360833 > > > > > URL: https://svnweb.freebsd.org/changeset/base/360833 > > > > > > > > > > Log: > > > > > installworld: attempt a certctl rehash at the tail end > > > > > > > > > > This can be run as root or normal user with no problem; if they= hadn't > > > > > twisted the WITHOUT_CAROOT knob, we'll attempt to use the host = certctl to > > > > > rehash the DESTDIR. This would allow one to build systems WITHO= UT_OPENSSL + > > > > > WITH_CAROOT with a populated /etc/ssl that they can then use wi= th an > > > > > appropriate *ssl from somewhere else. > > > > > > > > > > Cross-builds are fine because this will always use the host cer= tctl, or just > > > > > nag if it's missing and it wasn't a WITHOUT_CAROOT build. > > > > > > > > > > MFC after: 1 week > > > > > Differential Revision: https://reviews.freebsd.org/D24641 > > > > > > > > > > Modified: > > > > > head/Makefile.inc1 > > > > > > > > > > Modified: head/Makefile.inc1 > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=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/Makefile.inc1 Sat May 9 01:48:08 2020 (r3= 60832) > > > > > +++ head/Makefile.inc1 Sat May 9 02:01:29 2020 (r3= 60833) > > > > > @@ -1403,6 +1403,16 @@ distributeworld installworld stageworld: _= installcheck > > > > > ${DESTDIR}/${DISTDIR}/${dist}.debug.meta > > > > > .endfor > > > > > .endif > > > > > +.elif make(installworld) && ${MK_CAROOT} !=3D "no" > > > > > + # We could make certctl a bootstrap tool, but it requires O= penSSL and > > > > > + # friends, which we likely don't want. We'll rehash on a b= est-effort > > > > > + # basis, otherwise we'll just mention that we're not doing = it to raise > > > > > + # awareness. > > > > > + @if which certctl>/dev/null; then \ > > > > > + certctl rehash \ > > > > > > > > Does this update METALOG with the added links? > > > > > > > > It seems a little weird to rely on DESTDIR from the environment. > > > > > > > > In general I'm not enthusiastic about additions to installworld tha= t do > > > > anything other than copying files, creating links, etc in simple wa= ys. > > > > > > I will happily back this out if I can get some qualified eyes to > > > review/improve it. It does not update METALOG, and it probably should. > > > Agreed on DESTDIR. As for point #3, I guess we can continue spreading > > > `certctl rehash` all over the tree in various points that may need it; > > > the release(7) scripts will need to be done if we don't do it here at > > > a minimum, and I haven't put much thought into it beyond that. > > > > I'm not in a rush to back this out given that it's solving a real > > problem, but lets talk about improvements. > > > > I kind of feel like this belongs in distribution (which I think would > > deal with release scripts) or in etcupdate/mergemaster, but I'm not > > sure either of those are correct. I'd be happy to review changes to > > update the METALOG (I guess we'd extend certctl with an option to do > > that?) I think that's the most important things because we really > > should be routinely validating that DESTDIR only contains things in the > > METALOG. A quick and dirty fix for the DESTDIR weirdness might be addi= ng > > "env DESTDIR=3D${DESTDIR}" so it's explicit. > > >=20 > Got it- not an egregious enough violation to promptly back out, but we > will work towards a better solution. >=20 > For the larger picture, distribution is probably the correct spot for > this; we currently rehash at the following points: >=20 > - mergemaster/etcupdate > - freebsd-update > - post-install of the caroot pkg (pkgbase) >=20 > This leaves two primary final blind spots, which this commit was > attempting to resolve: >=20 > 1.) Install media (including VM images) > 2.) Initial installs (e.g. from bsdinstall) >=20 > #1 could be solved by directly adding it to the release(7) scripts and > #2 could be solved by having bsdinstall do it at config time, but > there seem to be multiple potential points that could instead hit both > (with a single stone) while also making covering the array of other > images that re@ produces (e.g. AWS images) and perhaps other points > that we've not immediately considered. >=20 > To this end, distribution or installworld are probably equally > sufficient, but I'm incredibly unfamiliar with the former. My > understanding from glancing at it over the years is that it may be > executed into a tempdir and merged with mergemaster/etcupdate, or > directly into the new root if we're looking at a new install that > doesn't have potential local changes to merge in. My understanding of distribution is that it's the things that don't make sense to update automatically (e.g. config files that have to be merged. For #1 above distribution clearly solves the problem. For #2 I kind of think this is the installers job. > Part of the problem that I see in my head is probably solved by just > having a var that mergemaster/etcupdate can pass in to distribution to > not bother with the rehash. We want to keep the mergemaster/etcupdate > rehash because if they're running then the target's certainly not been > rehashed. OTOH, we probably don't want to rehash multiple times in > that pipeline- from a certctl standpoint, it's completely harmless, > but it's not the most effective use of system resources and probably > looks a bit bad. In some ways I wonder if we actually want a three phase split: installworld (programs, fixed data, etc), distribution (config bits), and regen (generate files based on the -- possibly altered -- contents of config files, etc. If we could split out the regen into (e.g.) an installed shell script or set of scripts then we could call that from the installer, etc. That might provide a generic solution. So far this isn't a well thought out idea, but maybe there's something here? Presumably we'd need to bolt a compatibility shim onto distribution to start out given how much blowback I got for breaking some nonsensical orderings of the top-level targets when adding METALOG support. -- Brooks --VUDLurXRWRKrGuMn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJevbHfAAoJEKzQXbSebgfAXz4IAKJe/GUr4dMARu12mHKUuHmG bM4tktcHFy3McgwyHlHg6nZluFKx33USbA6jrK8kAu+hLOzyULmL9UgfmAIi7Wf8 VGJRJJcK99kfsPxFzEKFOpJvcOhN6pTOdJbisfXEvgFtRXJAhdLtqcM8pWk9Nwow J9O5N3Zy8BStmKiXuCXLBMdxWJSXkVHVRqH3KiouIAVEowlVua1+oySg4V3E6unL mCQBpXLc/nA6Dkv4FDtaYfOfUdZssY0IVXtOFZ+mPCS7GUkJTAxlz6GRuALYm6He 1iHAdg6qSB80X0pJxfn8syN5Ysco+vX3i7cLU95r6AUpLliwrzB/3BjMFylpWM0= =QAcX -----END PGP SIGNATURE----- --VUDLurXRWRKrGuMn-- From owner-svn-src-head@freebsd.org Thu May 14 21:12:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A65842DFFD4; Thu, 14 May 2020 21:12:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NPPP3lxzz3xBS; Thu, 14 May 2020 21:12:09 +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 7C0C519650; Thu, 14 May 2020 21:12:09 +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 04ELC9HP008509; Thu, 14 May 2020 21:12:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04ELC85X008504; Thu, 14 May 2020 21:12:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005142112.04ELC85X008504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 14 May 2020 21:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361060 - in head: include lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: include lib/libc/gen X-SVN-Commit-Revision: 361060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 21:12:09 -0000 Author: kib Date: Thu May 14 21:12:08 2020 New Revision: 361060 URL: https://svnweb.freebsd.org/changeset/base/361060 Log: Add memalign(3), mostly for glibc compatibility. Reviewed by: emaste, imp (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D24307 Added: head/lib/libc/gen/memalign.c (contents, props changed) Modified: head/include/malloc_np.h head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map Modified: head/include/malloc_np.h ============================================================================== --- head/include/malloc_np.h Thu May 14 20:43:59 2020 (r361059) +++ head/include/malloc_np.h Thu May 14 21:12:08 2020 (r361060) @@ -122,6 +122,9 @@ size_t __sallocx(const void *ptr, int flags); void __dallocx(void *ptr, int flags); void __sdallocx(void *ptr, size_t size, int flags); size_t __nallocx(size_t size, int flags); + +void *memalign(size_t, size_t) __malloc_like __alloc_align(1) + __alloc_size(2); __END_DECLS #undef __MyBool Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Thu May 14 20:43:59 2020 (r361059) +++ head/lib/libc/gen/Makefile.inc Thu May 14 21:12:08 2020 (r361060) @@ -98,6 +98,7 @@ SRCS+= __getosreldate.c \ libc_dlopen.c \ lockf.c \ lrand48.c \ + memalign.c \ mrand48.c \ nftw.c \ nftw-compat11.c \ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Thu May 14 20:43:59 2020 (r361059) +++ head/lib/libc/gen/Symbol.map Thu May 14 21:12:08 2020 (r361060) @@ -423,6 +423,7 @@ FBSD_1.5 { }; FBSD_1.6 { + memalign; sigandset; sigisemptyset; sigorset; Added: head/lib/libc/gen/memalign.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/memalign.c Thu May 14 21:12:08 2020 (r361060) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * 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 + +void * +memalign(size_t align, size_t size) +{ + return (aligned_alloc(align, roundup(size, align))); +} From owner-svn-src-head@freebsd.org Thu May 14 22:18:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE5DC2E1F29; Thu, 14 May 2020 22:18:12 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NQsc608pz41gS; Thu, 14 May 2020 22:18:12 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEDEB1A1F0; Thu, 14 May 2020 22:18:12 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EMIC0v045507; Thu, 14 May 2020 22:18:12 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EMICgT045505; Thu, 14 May 2020 22:18:12 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202005142218.04EMICgT045505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Thu, 14 May 2020 22:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361064 - head/sys/amd64/vmm X-SVN-Group: head X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: head/sys/amd64/vmm X-SVN-Commit-Revision: 361064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 22:18:13 -0000 Author: grehan Date: Thu May 14 22:18:12 2020 New Revision: 361064 URL: https://svnweb.freebsd.org/changeset/base/361064 Log: Hide host CPUID 0x15 TSC/Crystal ratio/freq info from guest In recent Linux (5.3+) and OpenBSD (6.6+) kernels, and with hosts that support CPUID 0x15, the local APIC frequency is determined directly from the reported crystal clock to avoid calibration against the 8254 timer. However, the local APIC frequency implemented by bhyve is 128MHz, where most h/w systems report frequencies around 25MHz. This shows up on OpenBSD guests as repeated keystrokes on the emulated PS2 keyboard when using VNC, since the kernel's timers are now much shorter. Fix by reporting all-zeroes for CPUID 0x15. This allows guests to fall back to using the 8254 to calibrate the local APIC frequency. Future work could be to compute values returned for 0x15 that would match the host TSC and bhyve local APIC frequency, though all dependencies on this would need to be examined (for example, Linux will start using 0x16 for some hosts). PR: 246321 Reported by: Jason Tubnor (and tested) Reviewed by: jhb Approved by: jhb, bz (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24837 Modified: head/sys/amd64/vmm/x86.c head/sys/amd64/vmm/x86.h Modified: head/sys/amd64/vmm/x86.c ============================================================================== --- head/sys/amd64/vmm/x86.c Thu May 14 21:59:23 2020 (r361063) +++ head/sys/amd64/vmm/x86.c Thu May 14 22:18:12 2020 (r361064) @@ -560,6 +560,18 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, } break; + case CPUID_0000_0015: + /* + * Don't report CPU TSC/Crystal ratio and clock + * values since guests may use these to derive the + * local APIC frequency.. + */ + regs[0] = 0; + regs[1] = 0; + regs[2] = 0; + regs[3] = 0; + break; + case 0x40000000: regs[0] = CPUID_VM_HIGH; bcopy(bhyve_id, ®s[1], 4); Modified: head/sys/amd64/vmm/x86.h ============================================================================== --- head/sys/amd64/vmm/x86.h Thu May 14 21:59:23 2020 (r361063) +++ head/sys/amd64/vmm/x86.h Thu May 14 22:18:12 2020 (r361064) @@ -41,6 +41,7 @@ #define CPUID_0000_000A (0xA) #define CPUID_0000_000B (0xB) #define CPUID_0000_000D (0xD) +#define CPUID_0000_0015 (0x15) #define CPUID_8000_0000 (0x80000000) #define CPUID_8000_0001 (0x80000001) #define CPUID_8000_0002 (0x80000002) From owner-svn-src-head@freebsd.org Thu May 14 22:20:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58D922E21B9; Thu, 14 May 2020 22:20:05 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NQvn1VX4z421m; Thu, 14 May 2020 22:20:04 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f180.google.com with SMTP id b15so441164ilq.12; Thu, 14 May 2020 15:20:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Qw5qxaMeg4bbS/7V5LrYkLbTbDspHbz1opxAllIMvfA=; b=kCy3mRkxkNiRN2DE/pI3zpzRaIxkcZlUAGPaKoE+JjjHaHcwg5s+t+85li6IXeOLsa ZimCwB1YZhb7eA095SHzCnaFwp+ZFvux7kuO8xW0wPEZWwJtdrEydm8ATUqJkwXccjvO DOPOplI4KjVBZVFpXcxr85aUNx1jPt02rk8oCcr5QGBRTbScyP41Qhu9IdAs2b/6yQpF 1wn9q5R0j+wMm7Ssqm2mp15oXuWoxejZfMq1G1jD1pZK8lUuW+yk9Ro0ZgxrrQIW98Zp izq69i+mDo/+DrnevOwPpeHaOrqLzrSViukwg7npGWzr/bnjxHCF5Bvyl93RYK8qaxSx cvwA== X-Gm-Message-State: AOAM531pTR1ZIpGeox7rQmkJ3FGc+ru0imB7sofvG+6WXilT9kSr0boB a5HQxilao08cJotwdTAQa0lWeWmxJlk3U3/2PXPaCJzZpjY= X-Google-Smtp-Source: ABdhPJyMLBzs41wZWtgzpIxhnZytYw4a1GnK+mbZax821OKxl0GqvZlXMLY+MjrhGA26iZ5zGLC/8OR5PEzB9tqw10I= X-Received: by 2002:a92:cd01:: with SMTP id z1mr382910iln.182.1589494803570; Thu, 14 May 2020 15:20:03 -0700 (PDT) MIME-Version: 1.0 References: <202005141719.04EHJ7JF060765@repo.freebsd.org> <67e768d9-f2a5-cfa5-d674-4c33e3fb7696@FreeBSD.org> In-Reply-To: <67e768d9-f2a5-cfa5-d674-4c33e3fb7696@FreeBSD.org> From: Ed Maste Date: Thu, 14 May 2020 18:19:51 -0400 Message-ID: Subject: Re: svn commit: r361034 - head To: John Baldwin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49NQvn1VX4z421m X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.98 / 15.00]; NEURAL_HAM_MEDIUM(-0.98)[-0.985,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 22:20:05 -0000 On Thu, 14 May 2020 at 13:49, John Baldwin wrote: > > Oops, sorry. I meant to fix that up before commit. :-/ No worries. > (I use xxxx as the date while it is in the branch) I usually do too; I spotted this due to a merge conflict with my WIP that touches ObsoleteFiles.inc (D24790, retiring cuseeme from libalias). From owner-svn-src-head@freebsd.org Thu May 14 22:32:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E54AC2E26D8; Thu, 14 May 2020 22:32:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49NRBF3rtnz42l1; Thu, 14 May 2020 22:32:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04EMWTZj007272 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 15 May 2020 01:32:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04EMWTZj007272 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04EMWTMP007271; Fri, 15 May 2020 01:32:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 15 May 2020 01:32:29 +0300 From: Konstantin Belousov To: Peter Grehan Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361064 - head/sys/amd64/vmm Message-ID: <20200514223229.GA46537@kib.kiev.ua> References: <202005142218.04EMICgT045505@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005142218.04EMICgT045505@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: 49NRBF3rtnz42l1 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.93 / 15.00]; NEURAL_HAM_MEDIUM(-0.93)[-0.931,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 22:32:38 -0000 On Thu, May 14, 2020 at 10:18:12PM +0000, Peter Grehan wrote: > Author: grehan > Date: Thu May 14 22:18:12 2020 > New Revision: 361064 > URL: https://svnweb.freebsd.org/changeset/base/361064 > > Log: > Hide host CPUID 0x15 TSC/Crystal ratio/freq info from guest > > In recent Linux (5.3+) and OpenBSD (6.6+) kernels, and with hosts that > support CPUID 0x15, the local APIC frequency is determined directly > from the reported crystal clock to avoid calibration against the 8254 > timer. > > However, the local APIC frequency implemented by bhyve is 128MHz, where > most h/w systems report frequencies around 25MHz. This shows up on > OpenBSD guests as repeated keystrokes on the emulated PS2 keyboard > when using VNC, since the kernel's timers are now much shorter. > > Fix by reporting all-zeroes for CPUID 0x15. This allows guests to fall > back to using the 8254 to calibrate the local APIC frequency. > > Future work could be to compute values returned for 0x15 that would > match the host TSC and bhyve local APIC frequency, though all dependencies > on this would need to be examined (for example, Linux will start using > 0x16 for some hosts). FreeBSD uses 0x15 (and 0x16 if there is no 0x15) as well. We recheck against 8254 and decide that there is no ISA timer if calibration differs too much from CPUID numbers. From owner-svn-src-head@freebsd.org Thu May 14 23:20:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D16082E3B14; Thu, 14 May 2020 23:20:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NSG23Hglz44r5; Thu, 14 May 2020 23:20:58 +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 6C1E31AD98; Thu, 14 May 2020 23:20:58 +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 04ENKw82082662; Thu, 14 May 2020 23:20:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04ENKw7u082661; Thu, 14 May 2020 23:20:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005142320.04ENKw7u082661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 14 May 2020 23:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361065 - head/tests/sys/netpfil/pf/ioctl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tests/sys/netpfil/pf/ioctl X-SVN-Commit-Revision: 361065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 23:20:58 -0000 Author: kevans Date: Thu May 14 23:20:58 2020 New Revision: 361065 URL: https://svnweb.freebsd.org/changeset/base/361065 Log: pf tests: fix up a couple WARNS= 6 nits common_init_tbl is only used within this single CU, so it should be marked static. WARNS=6 also complained about the var defined by `ATF_TC_WITH_CLEANUP(getastats);` being unused, which turns out to be because it's not been hooked up in ATF_TP_ADD_TCS. kp@ did not immediately recall any reason for this, and the case passes on my local system, so hook it up. Note that I've not yet set WARNS= 6 here. Investigation is underway to see if we can feasibly default WARNS to 6 for src builds to catch directories too deep to inherit a WARNS from the top-level subdirectories' Makefile.inc. Those particular WARNS settings will be subsequently removed as they become redundant with a more-global default. MFC after: 1 week Modified: head/tests/sys/netpfil/pf/ioctl/validation.c Modified: head/tests/sys/netpfil/pf/ioctl/validation.c ============================================================================== --- head/tests/sys/netpfil/pf/ioctl/validation.c Thu May 14 22:18:12 2020 (r361064) +++ head/tests/sys/netpfil/pf/ioctl/validation.c Thu May 14 23:20:58 2020 (r361065) @@ -51,7 +51,7 @@ static int dev; #define COMMON_CLEANUP() \ close(dev); -void +static void common_init_tbl(struct pfr_table *tbl) { bzero(tbl, sizeof(struct pfr_table)); @@ -795,6 +795,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, addtables); ATF_TP_ADD_TC(tp, deltables); ATF_TP_ADD_TC(tp, gettables); + ATF_TP_ADD_TC(tp, getastats); ATF_TP_ADD_TC(tp, gettstats); ATF_TP_ADD_TC(tp, clrtstats); ATF_TP_ADD_TC(tp, settflags); From owner-svn-src-head@freebsd.org Thu May 14 23:38:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5465F2E3F34; Thu, 14 May 2020 23:38:13 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NSdx1XJSz45ZH; Thu, 14 May 2020 23:38:13 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15F681B13B; Thu, 14 May 2020 23:38:13 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04ENcCOu094164; Thu, 14 May 2020 23:38:12 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04ENcCN5094159; Thu, 14 May 2020 23:38:12 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005142338.04ENcCN5094159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Thu, 14 May 2020 23:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361066 - head/usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/usr.sbin/jail X-SVN-Commit-Revision: 361066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 23:38:13 -0000 Author: freqlabs Date: Thu May 14 23:38:11 2020 New Revision: 361066 URL: https://svnweb.freebsd.org/changeset/base/361066 Log: jail: Add exec.prepare and exec.release command hooks This change introduces new jail command hooks that run before and after any other actions. The exec.prepare hook can be used for example to invoke a script that checks if the jail's root exists, creating it if it does not. Since arbitrary variables in jail.conf can be passed to the command, it can be pretty useful for templating jails. An example use case for exec.release would be to remove the filesystem of an ephemeral jail. The names "prepare" and "release" are borrowed from the names of similar hooks in libvirt. Reviewed by: jamie, manpages, mmacy Approved by: mmacy (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24829 Modified: head/usr.sbin/jail/command.c head/usr.sbin/jail/config.c head/usr.sbin/jail/jail.8 head/usr.sbin/jail/jail.c head/usr.sbin/jail/jailp.h Modified: head/usr.sbin/jail/command.c ============================================================================== --- head/usr.sbin/jail/command.c Thu May 14 23:20:58 2020 (r361065) +++ head/usr.sbin/jail/command.c Thu May 14 23:38:11 2020 (r361066) @@ -148,7 +148,8 @@ next_command(struct cfjail *j) if (j->comstring == NULL || j->comstring->len == 0 || (create_failed && (comparam == IP_EXEC_PRESTART || comparam == IP_EXEC_CREATED || comparam == IP_EXEC_START || - comparam == IP_COMMAND || comparam == IP_EXEC_POSTSTART))) + comparam == IP_COMMAND || comparam == IP_EXEC_POSTSTART || + comparam == IP_EXEC_PREPARE))) continue; switch (run_command(j)) { case -1: Modified: head/usr.sbin/jail/config.c ============================================================================== --- head/usr.sbin/jail/config.c Thu May 14 23:20:58 2020 (r361065) +++ head/usr.sbin/jail/config.c Thu May 14 23:38:11 2020 (r361066) @@ -71,8 +71,10 @@ static const struct ipspec intparams[] = { [IP_EXEC_JAIL_USER] = {"exec.jail_user", PF_INTERNAL}, [IP_EXEC_POSTSTART] = {"exec.poststart", PF_INTERNAL}, [IP_EXEC_POSTSTOP] = {"exec.poststop", PF_INTERNAL}, + [IP_EXEC_PREPARE] = {"exec.prepare", PF_INTERNAL}, [IP_EXEC_PRESTART] = {"exec.prestart", PF_INTERNAL}, [IP_EXEC_PRESTOP] = {"exec.prestop", PF_INTERNAL}, + [IP_EXEC_RELEASE] = {"exec.release", PF_INTERNAL}, [IP_EXEC_CREATED] = {"exec.created", PF_INTERNAL}, [IP_EXEC_START] = {"exec.start", PF_INTERNAL}, [IP_EXEC_STOP] = {"exec.stop", PF_INTERNAL}, Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Thu May 14 23:20:58 2020 (r361065) +++ head/usr.sbin/jail/jail.8 Thu May 14 23:38:11 2020 (r361066) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 17, 2020 +.Dd May 14, 2020 .Dt JAIL 8 .Os .Sh NAME @@ -726,6 +726,11 @@ not be created or removed, as appropriate. .Pp The pseudo-parameters are: .Bl -tag -width indent +.It Va exec.prepare +Command(s) to run in the system environment to prepare a jail for creation. +These commands are executed before assigning IP addresses and mounting +filesystems, so they may be used to create a new jail filesystem if it does +not already exist. .It Va exec.prestart Command(s) to run in the system environment before a jail is created. .It Va exec.created @@ -760,6 +765,11 @@ A typical command to run is .Dq sh /etc/rc.shutdown jail . .It Va exec.poststop Command(s) to run in the system environment after a jail is removed. +.It Va exec.release +Command(s) to run in the system environment after all other actions are done. +These commands are executed after unmounting filesystems and removing IP +addresses, so they may be used to remove a jail filesystem if it is no longer +needed. .It Va exec.clean Run commands in a clean environment. The environment is discarded except for Modified: head/usr.sbin/jail/jail.c ============================================================================== --- head/usr.sbin/jail/jail.c Thu May 14 23:20:58 2020 (r361065) +++ head/usr.sbin/jail/jail.c Thu May 14 23:38:11 2020 (r361066) @@ -87,6 +87,7 @@ static struct permspec perm_sysctl[] = { static const enum intparam startcommands[] = { IP__NULL, + IP_EXEC_PREPARE, #ifdef INET IP__IP4_IFADDR, #endif @@ -126,6 +127,7 @@ static const enum intparam stopcommands[] = { #ifdef INET IP__IP4_IFADDR, #endif + IP_EXEC_RELEASE, IP__NULL }; Modified: head/usr.sbin/jail/jailp.h ============================================================================== --- head/usr.sbin/jail/jailp.h Thu May 14 23:20:58 2020 (r361065) +++ head/usr.sbin/jail/jailp.h Thu May 14 23:38:11 2020 (r361066) @@ -87,8 +87,10 @@ enum intparam { IP_EXEC_JAIL_USER, /* Run jailed commands as this user */ IP_EXEC_POSTSTART, /* Commands run outside jail after creating */ IP_EXEC_POSTSTOP, /* Commands run outside jail after removing */ + IP_EXEC_PREPARE, /* Commands run outside jail before addrs and mounting */ IP_EXEC_PRESTART, /* Commands run outside jail before creating */ IP_EXEC_PRESTOP, /* Commands run outside jail before removing */ + IP_EXEC_RELEASE, /* Commands run outside jail after addrs and unmounted */ IP_EXEC_CREATED, /* Commands run outside jail right after it was started */ IP_EXEC_START, /* Commands run inside jail on creation */ IP_EXEC_STOP, /* Commands run inside jail on removal */ From owner-svn-src-head@freebsd.org Fri May 15 03:54:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1431B2E90B8; Fri, 15 May 2020 03:54:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NZKY6S7fz4Jfn; Fri, 15 May 2020 03:54:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8A2A1E294; Fri, 15 May 2020 03:54:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04F3sPi3054994; Fri, 15 May 2020 03:54:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04F3sPs3054993; Fri, 15 May 2020 03:54:25 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005150354.04F3sPs3054993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 15 May 2020 03:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361071 - head X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 361071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 03:54:26 -0000 Author: cem Date: Fri May 15 03:54:25 2020 New Revision: 361071 URL: https://svnweb.freebsd.org/changeset/base/361071 Log: ObsoleteFiles: pdwait4.2.gz A belated follow-up to r320058. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 15 01:01:02 2020 (r361070) +++ head/ObsoleteFiles.inc Fri May 15 03:54:25 2020 (r361071) @@ -3174,6 +3174,8 @@ OLD_DIRS+=usr/lib/clang/4.0.0/lib/freebsd OLD_DIRS+=usr/lib/clang/4.0.0/lib OLD_DIRS+=usr/lib/clang/4.0.0 OLD_FILES+=usr/bin/llvm-pdbdump +# 20170717: Remove documentation of vaporware +OLD_FILES+=usr/share/man/man2/pdwait4.2.gz # 20170610: chown-f_test replaced by chown_test OLD_FILES+=usr/tests/usr.sbin/chown/chown-f_test # 20170609: drop obsolete manpage link (if_rtwn.ko -> rtwn.ko) From owner-svn-src-head@freebsd.org Fri May 15 10:17:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 529DB2F117F; Fri, 15 May 2020 10:17:59 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Nkr50HKLz4d15; Fri, 15 May 2020 10:17:56 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-wr1-f47.google.com with SMTP id l17so2893413wrr.4; Fri, 15 May 2020 03:17:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=RuYqFJr1KEFdgAzVkAXhe4fZe/TfXGDRm6UtCGk4/mc=; b=Eer7OBc9mRPZ1akMnKt+z+OfLaC/S5ifD0J8Ab47yxWRA/op5KpUvfiGxBpWbeBe23 QTO/pzAE/MYSGgelC5RCXL3aQii/k/3zFQ0h8CW3xCZMrG7Laottl1njQ6sZ8cEmoTFE TYTZhvZNTE9YtKPQJHschTCcFnmlbONxDxCXMC39FRUK7WJYNaRlEiRhn3jdTgmTBsST IMeMXargehNYvHlhlFNoZjxHREC6anwNh4suIQiEtPbU4KbcVIds1d0GHfe4zkX24Bvg rM2okdQ09k1rcD0rhcjCs/4unjvY5TGNyhn+1ZLw7lONLqFpXliiDXpQjgYLDSD4dA5e Es2Q== X-Gm-Message-State: AOAM532nuAurdOuNtbleQK5yvh/Ainl4fAYOm6lrt7FFTRamFgA9f/yb RCESlXAJXOJ4NVy/eqvNopJ53mCY X-Google-Smtp-Source: ABdhPJwWStjT7kFJkN0OM0l59DGZBp9IuY6mU7oaVjtY/ycfb5u0sDp2lR0kjP+zdbkugtpfrk61fA== X-Received: by 2002:adf:ec85:: with SMTP id z5mr3759467wrn.153.1589537875136; Fri, 15 May 2020 03:17:55 -0700 (PDT) Received: from ?IPv6:2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8? ([2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8]) by smtp.gmail.com with ESMTPSA id a15sm2857651wrw.56.2020.05.15.03.17.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 May 2020 03:17:54 -0700 (PDT) Subject: Re: svn commit: r361066 - head/usr.sbin/jail To: Ryan Moeller , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005142338.04ENcCN5094159@repo.freebsd.org> From: Mateusz Piotrowski <0mp@FreeBSD.org> Message-ID: Date: Fri, 15 May 2020 12:18:23 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <202005142338.04ENcCN5094159@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 49Nkr50HKLz4d15 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mpp302@gmail.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=mpp302@gmail.com X-Spamd-Result: default: False [-2.23 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.25)[ip: (-0.41), ipnet: 209.85.128.0/17(-0.39), asn: 15169(-0.42), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[47.221.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-0.98)[-0.981,0]; FORGED_SENDER(0.30)[0mp@FreeBSD.org,mpp302@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[47.221.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[0mp@FreeBSD.org,mpp302@gmail.com] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 10:17:59 -0000 On 5/15/20 1:38 AM, Ryan Moeller wrote: > Author: freqlabs > Date: Thu May 14 23:38:11 2020 > New Revision: 361066 > URL: https://svnweb.freebsd.org/changeset/base/361066 > > Log: > jail: Add exec.prepare and exec.release command hooks > > This change introduces new jail command hooks that run before and after any > other actions. Should it go into RELNOTES? From owner-svn-src-head@freebsd.org Fri May 15 11:03:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E64932F1FCE; Fri, 15 May 2020 11:03:27 +0000 (UTC) (envelope-from afedorov@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Nlrb5bQwz4gLD; Fri, 15 May 2020 11:03:27 +0000 (UTC) (envelope-from afedorov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB34823332; Fri, 15 May 2020 11:03:27 +0000 (UTC) (envelope-from afedorov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FB3RtB018330; Fri, 15 May 2020 11:03:27 GMT (envelope-from afedorov@FreeBSD.org) Received: (from afedorov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FB3R9s018329; Fri, 15 May 2020 11:03:27 GMT (envelope-from afedorov@FreeBSD.org) Message-Id: <202005151103.04FB3R9s018329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: afedorov set sender to afedorov@FreeBSD.org using -f From: Aleksandr Fedorov Date: Fri, 15 May 2020 11:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361072 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: afedorov X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 361072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 11:03:28 -0000 Author: afedorov Date: Fri May 15 11:03:27 2020 New Revision: 361072 URL: https://svnweb.freebsd.org/changeset/base/361072 Log: bhyve: Fix processing of netgraph backend options. After r360820, additional parameters are passed through the argument 'opts', and the name of the backend through the argument 'devname'. So, there is no need to skip the backend name from the 'opts' argument. Modified: head/usr.sbin/bhyve/net_backends.c Modified: head/usr.sbin/bhyve/net_backends.c ============================================================================== --- head/usr.sbin/bhyve/net_backends.c Fri May 15 03:54:25 2020 (r361071) +++ head/usr.sbin/bhyve/net_backends.c Fri May 15 11:03:27 2020 (r361072) @@ -438,8 +438,6 @@ ng_init(struct net_backend *be, const char *devname, path_provided = 0; peerhook_provided = 0; - (void)strsep(&ngopts, ","); - while (ngopts != NULL) { char *value = ngopts; char *key; From owner-svn-src-head@freebsd.org Fri May 15 11:58:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96AA42F315C; Fri, 15 May 2020 11:58:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Nn3Z3WW1z3FG4; Fri, 15 May 2020 11:58: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 7419823C8F; Fri, 15 May 2020 11:58: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 04FBw2Cg048486; Fri, 15 May 2020 11:58:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FBw1vw048483; Fri, 15 May 2020 11:58:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005151158.04FBw1vw048483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 15 May 2020 11:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361073 - in head: include lib/libc/gen libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: include lib/libc/gen libexec/rtld-elf X-SVN-Commit-Revision: 361073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 11:58:02 -0000 Author: kib Date: Fri May 15 11:58:01 2020 New Revision: 361073 URL: https://svnweb.freebsd.org/changeset/base/361073 Log: Implement RTLD_DEEPBIND. PR: 246462 Tested by: Martin Birgmeier Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24841 Modified: head/include/dlfcn.h head/lib/libc/gen/dlopen.3 head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Modified: head/include/dlfcn.h ============================================================================== --- head/include/dlfcn.h Fri May 15 11:03:27 2020 (r361072) +++ head/include/dlfcn.h Fri May 15 11:58:01 2020 (r361073) @@ -47,6 +47,8 @@ #define RTLD_TRACE 0x200 /* Trace loaded objects and exit. */ #define RTLD_NODELETE 0x01000 /* Do not remove members. */ #define RTLD_NOLOAD 0x02000 /* Do not load if not already loaded. */ +#define RTLD_DEEPBIND 0x04000 /* Put symbols from the dso ahead of + the global list */ /* * Request arguments for dlinfo(). Modified: head/lib/libc/gen/dlopen.3 ============================================================================== --- head/lib/libc/gen/dlopen.3 Fri May 15 11:03:27 2020 (r361072) +++ head/lib/libc/gen/dlopen.3 Fri May 15 11:58:01 2020 (r361073) @@ -32,7 +32,7 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd January 2, 2019 +.Dd May 14, 2020 .Dt DLOPEN 3 .Os .Sh NAME @@ -162,6 +162,9 @@ the process address space, otherwise is returned. Other mode flags may be specified, which will be applied for promotion for the found object. +.It Dv RTLD_DEEPBIND +Symbols from the loaded library are put before global symbols when +resolving symbolic references originated from the library. .El .Pp If Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri May 15 11:03:27 2020 (r361072) +++ head/libexec/rtld-elf/rtld.c Fri May 15 11:58:01 2020 (r361073) @@ -3366,6 +3366,8 @@ rtld_dlopen(const char *name, int fd, int mode) lo_flags |= RTLD_LO_NODELETE; if (mode & RTLD_NOLOAD) lo_flags |= RTLD_LO_NOLOAD; + if (mode & RTLD_DEEPBIND) + lo_flags |= RTLD_LO_DEEPBIND; if (ld_tracing != NULL) lo_flags |= RTLD_LO_TRACE | RTLD_LO_IGNSTLS; @@ -3417,6 +3419,8 @@ dlopen_object(const char *name, int fd, Obj_Entry *ref if (globallist_next(old_obj_tail) != NULL) { /* We loaded something new. */ assert(globallist_next(old_obj_tail) == obj); + if ((lo_flags & RTLD_LO_DEEPBIND) != 0) + obj->symbolic = true; result = 0; if ((lo_flags & (RTLD_LO_EARLY | RTLD_LO_IGNSTLS)) == 0 && obj->static_tls && !allocate_tls_offset(obj)) { Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Fri May 15 11:03:27 2020 (r361072) +++ head/libexec/rtld-elf/rtld.h Fri May 15 11:58:01 2020 (r361073) @@ -309,6 +309,7 @@ TAILQ_HEAD(obj_entry_q, Struct_Obj_Entry); #define RTLD_LO_EARLY 0x20 /* Do not call ctors, postpone it to the initialization during the image start. */ #define RTLD_LO_IGNSTLS 0x40 /* Do not allocate static TLS */ +#define RTLD_LO_DEEPBIND 0x80 /* Force symbolic for this object */ /* * Symbol cache entry used during relocation to avoid multiple lookups From owner-svn-src-head@freebsd.org Fri May 15 12:04:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E3BD2F40DB; Fri, 15 May 2020 12:04:40 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NnCD2KMXz3GF1; Fri, 15 May 2020 12:04:40 +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 4AF5723E92; Fri, 15 May 2020 12:04:40 +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 04FC4eXx054437; Fri, 15 May 2020 12:04:40 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FC4e0X054436; Fri, 15 May 2020 12:04:40 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005151204.04FC4e0X054436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Fri, 15 May 2020 12:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361074 - head/lib/libnetgraph X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/lib/libnetgraph X-SVN-Commit-Revision: 361074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 12:04:40 -0000 Author: bcr (doc committer) Date: Fri May 15 12:04:39 2020 New Revision: 361074 URL: https://svnweb.freebsd.org/changeset/base/361074 Log: Fix SYNPOSIS section to point to the proper include directive. netgraph(3) points to #include , which is kernel only. The man page refers to the user-space part of the netgraph module, which is located in . Submitted by: lutz_donnerhacke.de Approved by: bcr Differential Revision: https://reviews.freebsd.org/D23814 Modified: head/lib/libnetgraph/netgraph.3 Modified: head/lib/libnetgraph/netgraph.3 ============================================================================== --- head/lib/libnetgraph/netgraph.3 Fri May 15 11:58:01 2020 (r361073) +++ head/lib/libnetgraph/netgraph.3 Fri May 15 12:04:39 2020 (r361074) @@ -35,7 +35,7 @@ .\" $FreeBSD$ .\" $Whistle: netgraph.3,v 1.7 1999/01/25 07:14:06 archie Exp $ .\" -.Dd November 25, 2013 +.Dd May 15, 2020 .Dt NETGRAPH 3 .Os .Sh NAME @@ -57,7 +57,7 @@ .Sh LIBRARY .Lb libnetgraph .Sh SYNOPSIS -.In netgraph/netgraph.h +.In netgraph.h .Ft int .Fn NgMkSockNode "const char *name" "int *csp" "int *dsp" .Ft int From owner-svn-src-head@freebsd.org Fri May 15 12:47:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D73E52F4B02; Fri, 15 May 2020 12:47:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Np8q5LdPz3J6W; Fri, 15 May 2020 12:47:39 +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 AE725246A8; Fri, 15 May 2020 12:47:39 +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 04FCldRs079422; Fri, 15 May 2020 12:47:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FCldp6079421; Fri, 15 May 2020 12:47:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005151247.04FCldp6079421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 15 May 2020 12:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361075 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 361075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 12:47:39 -0000 Author: hselasky Date: Fri May 15 12:47:39 2020 New Revision: 361075 URL: https://svnweb.freebsd.org/changeset/base/361075 Log: Assign process group of the TTY under the "proctree_lock". This fixes a race where concurrent calls to doenterpgrp() and leavepgrp() while TIOCSCTTY is executing may result in tp->t_pgrp changing value so that tty_rel_pgrp() misses clearing it to NULL. For more details refer to the use of pgdelete() in the kernel. No functional change intended. Panic backtrace: __mtx_lock_sleep() # page fault due to using destroyed mutex tty_signal_pgrp() tty_ioctl() ptsdev_ioctl() kern_ioctl() sys_ioctl() amd64_syscall() MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Fri May 15 12:04:39 2020 (r361074) +++ head/sys/kern/tty.c Fri May 15 12:47:39 2020 (r361075) @@ -1818,7 +1818,6 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da tp->t_session = p->p_session; tp->t_session->s_ttyp = tp; tp->t_sessioncnt++; - sx_xunlock(&proctree_lock); /* Assign foreground process group. */ tp->t_pgrp = p->p_pgrp; @@ -1826,6 +1825,7 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da p->p_flag |= P_CONTROLT; PROC_UNLOCK(p); + sx_xunlock(&proctree_lock); return (0); } case TIOCSPGRP: { From owner-svn-src-head@freebsd.org Fri May 15 13:33:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C80402F5F64; Fri, 15 May 2020 13:33:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NqB53x3Bz3M7L; Fri, 15 May 2020 13:33:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8202E25006; Fri, 15 May 2020 13:33:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FDXnTO010139; Fri, 15 May 2020 13:33:49 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FDXnYo010138; Fri, 15 May 2020 13:33:49 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202005151333.04FDXnYo010138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 15 May 2020 13:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361076 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 361076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 13:33:49 -0000 Author: andrew Date: Fri May 15 13:33:48 2020 New Revision: 361076 URL: https://svnweb.freebsd.org/changeset/base/361076 Log: Remove arm64_idcache_wbinv_range as it's unused. Sponsored by: Innovate UK Modified: head/sys/arm64/arm64/cpufunc_asm.S head/sys/arm64/include/cpufunc.h Modified: head/sys/arm64/arm64/cpufunc_asm.S ============================================================================== --- head/sys/arm64/arm64/cpufunc_asm.S Fri May 15 12:47:39 2020 (r361075) +++ head/sys/arm64/arm64/cpufunc_asm.S Fri May 15 13:33:48 2020 (r361076) @@ -133,14 +133,6 @@ ENTRY(arm64_dcache_inv_range) END(arm64_dcache_inv_range) /* - * void arm64_idcache_wbinv_range(vm_offset_t, vm_size_t) - */ -ENTRY(arm64_idcache_wbinv_range) - cache_handle_range dcop = civac, ic = 1, icop = ivau - ret -END(arm64_idcache_wbinv_range) - -/* * void arm64_icache_sync_range(vm_offset_t, vm_size_t) */ ENTRY(arm64_icache_sync_range) Modified: head/sys/arm64/include/cpufunc.h ============================================================================== --- head/sys/arm64/include/cpufunc.h Fri May 15 12:47:39 2020 (r361075) +++ head/sys/arm64/include/cpufunc.h Fri May 15 13:33:48 2020 (r361076) @@ -216,7 +216,6 @@ extern int64_t dczva_line_size; #define cpu_dcache_inv_range(a, s) arm64_dcache_inv_range((a), (s)) #define cpu_dcache_wb_range(a, s) arm64_dcache_wb_range((a), (s)) -#define cpu_idcache_wbinv_range(a, s) arm64_idcache_wbinv_range((a), (s)) #define cpu_icache_sync_range(a, s) arm64_icache_sync_range((a), (s)) #define cpu_icache_sync_range_checked(a, s) arm64_icache_sync_range_checked((a), (s)) @@ -224,7 +223,6 @@ void arm64_nullop(void); void arm64_tlb_flushID(void); void arm64_icache_sync_range(vm_offset_t, vm_size_t); int arm64_icache_sync_range_checked(vm_offset_t, vm_size_t); -void arm64_idcache_wbinv_range(vm_offset_t, vm_size_t); void arm64_dcache_wbinv_range(vm_offset_t, vm_size_t); void arm64_dcache_inv_range(vm_offset_t, vm_size_t); void arm64_dcache_wb_range(vm_offset_t, vm_size_t); From owner-svn-src-head@freebsd.org Fri May 15 13:50:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E1502F624A; Fri, 15 May 2020 13:50:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NqXw3jMzz3Mgc; Fri, 15 May 2020 13:50:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A7D12521B; Fri, 15 May 2020 13:50:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FDo80E016322; Fri, 15 May 2020 13:50:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FDo82Y016321; Fri, 15 May 2020 13:50:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005151350.04FDo82Y016321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 15 May 2020 13:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361077 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 361077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 13:50:08 -0000 Author: kib Date: Fri May 15 13:50:08 2020 New Revision: 361077 URL: https://svnweb.freebsd.org/changeset/base/361077 Log: Implement RTLD_DEEPBIND. PR: 246462 Tested by: Martin Birgmeier Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24841 Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Fri May 15 13:33:48 2020 (r361076) +++ head/sys/kern/kern_mib.c Fri May 15 13:50:08 2020 (r361077) @@ -238,8 +238,9 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) if (req->flags & SCTL_MASK32) { /* - * Recreate the "pagesizes" array with 32-bit elements. Truncate - * any page size greater than UINT32_MAX to zero. + * Recreate the "pagesizes" array with 32-bit elements. + * Truncate any page size greater than UINT32_MAX to zero, + * which assumes that page sizes are powers of two. */ for (i = 0; i < MAXPAGESIZES; i++) pagesizes32[i] = (uint32_t)pagesizes[i]; From owner-svn-src-head@freebsd.org Fri May 15 13:52:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0424D2F6499; Fri, 15 May 2020 13:52:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Nqbq6L0Bz3N5g; Fri, 15 May 2020 13:52:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4AF3253FC; Fri, 15 May 2020 13:52:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FDqdVC022464; Fri, 15 May 2020 13:52:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FDqd0G022463; Fri, 15 May 2020 13:52:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005151352.04FDqd0G022463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 15 May 2020 13:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361078 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 361078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 13:52:40 -0000 Author: kib Date: Fri May 15 13:52:39 2020 New Revision: 361078 URL: https://svnweb.freebsd.org/changeset/base/361078 Log: Revert r361077 to recommit with proper message. Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Fri May 15 13:50:08 2020 (r361077) +++ head/sys/kern/kern_mib.c Fri May 15 13:52:39 2020 (r361078) @@ -238,9 +238,8 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) if (req->flags & SCTL_MASK32) { /* - * Recreate the "pagesizes" array with 32-bit elements. - * Truncate any page size greater than UINT32_MAX to zero, - * which assumes that page sizes are powers of two. + * Recreate the "pagesizes" array with 32-bit elements. Truncate + * any page size greater than UINT32_MAX to zero. */ for (i = 0; i < MAXPAGESIZES; i++) pagesizes32[i] = (uint32_t)pagesizes[i]; From owner-svn-src-head@freebsd.org Fri May 15 13:53:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 869332F64F8; Fri, 15 May 2020 13:53:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NqcR2z7xz3ND0; Fri, 15 May 2020 13:53:11 +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 61332253FD; Fri, 15 May 2020 13:53:11 +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 04FDrBTK022534; Fri, 15 May 2020 13:53:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FDrBst022533; Fri, 15 May 2020 13:53:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005151353.04FDrBst022533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 15 May 2020 13:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361079 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 361079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 13:53:11 -0000 Author: kib Date: Fri May 15 13:53:10 2020 New Revision: 361079 URL: https://svnweb.freebsd.org/changeset/base/361079 Log: Improve comment for compat32 handling of sysctl hw.pagesizes. Explain why truncation works as intended. Reformat. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Fri May 15 13:52:39 2020 (r361078) +++ head/sys/kern/kern_mib.c Fri May 15 13:53:10 2020 (r361079) @@ -238,8 +238,9 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) if (req->flags & SCTL_MASK32) { /* - * Recreate the "pagesizes" array with 32-bit elements. Truncate - * any page size greater than UINT32_MAX to zero. + * Recreate the "pagesizes" array with 32-bit elements. + * Truncate any page size greater than UINT32_MAX to zero, + * which assumes that page sizes are powers of two. */ for (i = 0; i < MAXPAGESIZES; i++) pagesizes32[i] = (uint32_t)pagesizes[i]; From owner-svn-src-head@freebsd.org Fri May 15 14:00:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1BED2F6607; Fri, 15 May 2020 14:00:13 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NqmY668cz3NQB; Fri, 15 May 2020 14:00:13 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C88482541C; Fri, 15 May 2020 14:00:13 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FE0DLa022992; Fri, 15 May 2020 14:00:13 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FE0DKe022989; Fri, 15 May 2020 14:00:13 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <202005151400.04FE0DKe022989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Fri, 15 May 2020 14:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361080 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 361080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 14:00:14 -0000 Author: rrs Date: Fri May 15 14:00:12 2020 New Revision: 361080 URL: https://svnweb.freebsd.org/changeset/base/361080 Log: This fixes several skyzaller issues found with the help of Michael Tuexen. There was some accounting errors with TCPFO for bbr and also for both rack and bbr there was a FO case where we should be jumping to the just_return_nolock label to exit instead of returning 0. This of course caused no timer to be running and thus the stuck sessions. Reported by: Michael Tuexen and Skyzaller Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D24852 Modified: head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_stacks/rack_bbr_common.c Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Fri May 15 13:53:10 2020 (r361079) +++ head/sys/netinet/tcp_stacks/bbr.c Fri May 15 14:00:12 2020 (r361080) @@ -4975,6 +4975,15 @@ bbr_remxt_tmr(struct tcpcb *tp) rsm->r_flags &= ~(BBR_ACKED | BBR_SACK_PASSED | BBR_WAS_SACKPASS); bbr_log_type_rsmclear(bbr, cts, rsm, old_flags, __LINE__); } else { + if ((tp->t_state < TCPS_ESTABLISHED) && + (rsm->r_start == tp->snd_una)) { + /* + * Special case for TCP FO. Where + * we sent more data beyond the snd_max. + * We don't mark that as lost and stop here. + */ + break; + } if ((rsm->r_flags & BBR_MARKED_LOST) == 0) { bbr->r_ctl.rc_lost += rsm->r_end - rsm->r_start; bbr->r_ctl.rc_lost_bytes += rsm->r_end - rsm->r_start; @@ -12315,7 +12324,8 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeva (tp->t_state == TCPS_SYN_SENT)) && SEQ_GT(tp->snd_max, tp->snd_una) && /* initial SYN or SYN|ACK sent */ (tp->t_rxtshift == 0)) { /* not a retransmit */ - return (0); + len = 0; + goto just_return_nolock; } /* * Before sending anything check for a state update. For hpts @@ -14286,6 +14296,7 @@ nomore: (hw_tls == 0) && (len > 0) && ((flags & TH_RST) == 0) && + ((flags & TH_SYN) == 0) && (IN_RECOVERY(tp->t_flags) == 0) && (bbr->rc_in_persist == 0) && (tot_len < bbr->r_ctl.rc_pace_max_segs)) { Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Fri May 15 13:53:10 2020 (r361079) +++ head/sys/netinet/tcp_stacks/rack.c Fri May 15 14:00:12 2020 (r361080) @@ -3873,6 +3873,7 @@ skip_measurement: * the next send will trigger us picking up the missing data. */ if (rack->r_ctl.rc_first_appl && + TCPS_HAVEESTABLISHED(tp->t_state) && rack->r_ctl.rc_app_limited_cnt && (SEQ_GT(rack->r_ctl.rc_first_appl->r_start, th_ack)) && ((rack->r_ctl.rc_first_appl->r_start - th_ack) > @@ -11741,6 +11742,13 @@ rack_start_gp_measurement(struct tcpcb *tp, struct tcp struct rack_sendmap *my_rsm = NULL; struct rack_sendmap fe; + if (tp->t_state < TCPS_ESTABLISHED) { + /* + * We don't start any measurements if we are + * not at least established. + */ + return; + } tp->t_flags |= TF_GPUTINPROG; rack->r_ctl.rc_gp_lowrtt = 0xffffffff; rack->r_ctl.rc_gp_high_rwnd = rack->rc_tp->snd_wnd; @@ -12109,8 +12117,10 @@ rack_output(struct tcpcb *tp) ((tp->t_state == TCPS_SYN_RECEIVED) || (tp->t_state == TCPS_SYN_SENT)) && SEQ_GT(tp->snd_max, tp->snd_una) && /* initial SYN or SYN|ACK sent */ - (tp->t_rxtshift == 0)) /* not a retransmit */ - return (0); + (tp->t_rxtshift == 0)) { /* not a retransmit */ + cwnd_to_use = rack->r_ctl.cwnd_to_use = tp->snd_cwnd; + goto just_return_nolock; + } /* * Determine length of data that should be transmitted, and flags * that will be used. If there is some data or critical controls Modified: head/sys/netinet/tcp_stacks/rack_bbr_common.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack_bbr_common.c Fri May 15 13:53:10 2020 (r361079) +++ head/sys/netinet/tcp_stacks/rack_bbr_common.c Fri May 15 14:00:12 2020 (r361080) @@ -466,7 +466,14 @@ ctf_do_queued_segments(struct socket *so, struct tcpcb uint32_t ctf_outstanding(struct tcpcb *tp) { - return(tp->snd_max - tp->snd_una); + uint32_t bytes_out; + + bytes_out = tp->snd_max - tp->snd_una; + if (tp->t_state < TCPS_ESTABLISHED) + bytes_out++; + if (tp->t_flags & TF_SENTFIN) + bytes_out++; + return (bytes_out); } uint32_t From owner-svn-src-head@freebsd.org Fri May 15 14:06:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AB742F67DF; Fri, 15 May 2020 14:06:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Nqvx6FzQz3P4D; Fri, 15 May 2020 14:06:37 +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 D20E32561A; Fri, 15 May 2020 14:06:37 +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 04FE6bth028618; Fri, 15 May 2020 14:06:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FE6bmZ028617; Fri, 15 May 2020 14:06:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005151406.04FE6bmZ028617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 15 May 2020 14:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361081 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 14:06:38 -0000 Author: tuexen Date: Fri May 15 14:06:37 2020 New Revision: 361081 URL: https://svnweb.freebsd.org/changeset/base/361081 Log: Allow only IPv4 addresses in sendto() for TCP on AF_INET sockets. This problem was found by looking at syzkaller reproducers for some other problems. Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D24831 Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Fri May 15 14:00:12 2020 (r361080) +++ head/sys/netinet/tcp_usrreq.c Fri May 15 14:06:37 2020 (r361081) @@ -1037,6 +1037,12 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf error = EINVAL; goto out; } + if ((inp->inp_vflag & INP_IPV6PROTO) == 0) { + if (m != NULL) + m_freem(m); + error = EAFNOSUPPORT; + goto out; + } if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { if (m) m_freem(m); From owner-svn-src-head@freebsd.org Fri May 15 14:21:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26C042F6B4B; Fri, 15 May 2020 14:21:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NrFH32gFz3Psk; Fri, 15 May 2020 14:21:39 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x744.google.com with SMTP id i5so2622697qkl.12; Fri, 15 May 2020 07:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YvNwUr4qNxmPVFMz3uTeKdGgV0OhdbkZ81zs3yq3Scc=; b=iCSkGIiHD3vwfwGu848l5g5t7LIvlygIVwn0yZtm3JPYkIKJ/o/wDs89HVBN+7s2v4 d2QVgtxIJKnlxL1j6aIi6652e/ZyIvMeGUx8RDj4ujhsj0CGxkVjm1GL9QJdtzPuvX/S STXg3uGS1IhuhohAHoJEBoiYD/rokcef0RzZRhBzS58r+y5u8Nk+6s+k+EZzmREh4kHA +hl7ddS/+AsadwWobAI8PTABYwE23o+F4km49VGzgJm2aYNz2ieex3i+E6fALY2tSHHi v13elYUeWVmangFJcJlT1QFJMuYqHBxYVIJHe5WOyYUTcVKoea31y+BOj450xjZSuPk0 NfAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=YvNwUr4qNxmPVFMz3uTeKdGgV0OhdbkZ81zs3yq3Scc=; b=BYYGWFcPWxrg8SO9j5IwXB7W0AkCPEN6y5pV7qeYHy9m+tgK+yJ6pXTabqh9Q5t9wj TpDIqHJlJr2s75KCmMs6GdlwcOZTO8ZVHvv4Laoyr4lKoij+ERxonHE6nKyxofD/awVl 3pLyn8K2l3AOJ1vM+6wYK5e0j3YWanMJA1N7FoyhQT24XJOWwwAWFpHHnnM5jkDAm7YH +QNmP1jZyRtCBH3vwnfe/UbR1izzmtPTjofVJ6jDj5+TPG+vW7mpXf5gm8U4j5uVOsrq Q9QprOu4XmNf00MwzhUUpINnr9Jo7wKkizfLwE8jplVYJy9XH8kIEs5Px95tMUGKVyr9 9iBQ== X-Gm-Message-State: AOAM531oGN1H0bbirobDLANpD5Jof+Q16n7yOnKmJj/wpD239cQtFM9x VkPRyArO5xG3s3d5KvKmmhX0F5pm X-Google-Smtp-Source: ABdhPJwumQeycvuXRGUiycoHx/X6zapNggho1qYz6pVYnlT6Sfs1u4QarOtofFHJa6IrIRYDw8zDcg== X-Received: by 2002:a37:8187:: with SMTP id c129mr3548213qkd.211.1589552494781; Fri, 15 May 2020 07:21:34 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id n206sm1684103qke.20.2020.05.15.07.21.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 07:21:34 -0700 (PDT) Sender: Mark Johnston Date: Fri, 15 May 2020 10:21:29 -0400 From: Mark Johnston To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360918 - in head: . share/man/man4 sys/conf sys/dev/random sys/dev/ubsec sys/modules sys/modules/ubsec sys/sys Message-ID: <20200515142129.GA24650@raichu> References: <202005112030.04BKUTBt004140@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005112030.04BKUTBt004140@repo.freebsd.org> X-Rspamd-Queue-Id: 49NrFH32gFz3Psk X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=iCSkGIiH; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::744 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.83 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.98)[-0.976,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.16)[ip: (0.01), ipnet: 2607:f8b0::/32(-0.33), asn: 15169(-0.42), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[103.87.144.184.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 14:21:41 -0000 On Mon, May 11, 2020 at 08:30:29PM +0000, John Baldwin wrote: > Author: jhb > Date: Mon May 11 20:30:28 2020 > New Revision: 360918 > URL: https://svnweb.freebsd.org/changeset/base/360918 > > Log: > Remove ubsec(4). > > This driver was previously marked for deprecation in r360710. We still have tools/tools/crypto/ubsecstats.c. Is there a reason to keep it, or was it an oversight? > > Approved by: csprng (cem, gordon, delphij) > Relnotes: yes > Sponsored by: Chelsio Communications > Differential Revision: https://reviews.freebsd.org/D24766 > > Deleted: > head/share/man/man4/ubsec.4 > head/sys/dev/ubsec/ubsec.c > head/sys/dev/ubsec/ubsecreg.h > head/sys/dev/ubsec/ubsecvar.h > head/sys/modules/ubsec/Makefile > Modified: > head/ObsoleteFiles.inc > head/share/man/man4/Makefile > head/share/man/man4/crypto.4 > head/share/man/man4/rndtest.4 > head/sys/conf/NOTES > head/sys/conf/files > head/sys/conf/options > head/sys/dev/random/random_harvestq.c > head/sys/modules/Makefile > head/sys/sys/random.h From owner-svn-src-head@freebsd.org Fri May 15 14:51:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E98AE2F7693; Fri, 15 May 2020 14:51:16 +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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NrvS5xhJz3wkY; Fri, 15 May 2020 14:51:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-164.local (unknown [IPv6:2601:648:8203:2990:6cc8:51a1:64e1:939f]) (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 5E9C91B3D6; Fri, 15 May 2020 14:51:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r360918 - in head: . share/man/man4 sys/conf sys/dev/random sys/dev/ubsec sys/modules sys/modules/ubsec sys/sys To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005112030.04BKUTBt004140@repo.freebsd.org> <20200515142129.GA24650@raichu> 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: <55c533a9-0ceb-d880-b543-7b709fede496@FreeBSD.org> Date: Fri, 15 May 2020 07:51:14 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200515142129.GA24650@raichu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 14:51:17 -0000 On 5/15/20 7:21 AM, Mark Johnston wrote: > On Mon, May 11, 2020 at 08:30:29PM +0000, John Baldwin wrote: >> Author: jhb >> Date: Mon May 11 20:30:28 2020 >> New Revision: 360918 >> URL: https://svnweb.freebsd.org/changeset/base/360918 >> >> Log: >> Remove ubsec(4). >> >> This driver was previously marked for deprecation in r360710. > > We still have tools/tools/crypto/ubsecstats.c. Is there a reason to > keep it, or was it an oversight? Ah, oversight. (Did not cast a wide-enough grep) -- John Baldwin From owner-svn-src-head@freebsd.org Fri May 15 15:54:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F13612F8E2E; Fri, 15 May 2020 15:54:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NtJJ5nCnz427J; Fri, 15 May 2020 15:54:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A80B826C87; Fri, 15 May 2020 15:54:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FFsOX7096943; Fri, 15 May 2020 15:54:24 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FFsMvb096933; Fri, 15 May 2020 15:54:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005151554.04FFsMvb096933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 15 May 2020 15:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361082 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm usr.sbin/bhyve X-SVN-Commit-Revision: 361082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 15:54:25 -0000 Author: cem Date: Fri May 15 15:54:22 2020 New Revision: 361082 URL: https://svnweb.freebsd.org/changeset/base/361082 Log: vmm(4), bhyve(8): Expose kernel-emulated special devices to userspace Expose the special kernel LAPIC, IOAPIC, and HPET devices to userspace for use in, e.g., fallback instruction emulation (when userspace has a newer instruction decode/emulation layer than the kernel vmm(4)). Plumb the ioctl through libvmmapi and register the memory ranges in bhyve(8). Reviewed by: grehan Differential Revision: https://reviews.freebsd.org/D24525 Added: head/usr.sbin/bhyve/kernemu_dev.c (contents, props changed) head/usr.sbin/bhyve/kernemu_dev.h (contents, props changed) Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/vmm_dev.c head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/bhyverun.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Fri May 15 14:06:37 2020 (r361081) +++ head/lib/libvmmapi/vmmapi.c Fri May 15 15:54:22 2020 (r361082) @@ -799,6 +799,25 @@ vm_ioapic_pincount(struct vmctx *ctx, int *pincount) } int +vm_readwrite_kernemu_device(struct vmctx *ctx, int vcpu, vm_paddr_t gpa, + bool write, int size, uint64_t *value) +{ + struct vm_readwrite_kernemu_device irp = { + .vcpuid = vcpu, + .access_width = fls(size) - 1, + .gpa = gpa, + .value = write ? *value : ~0ul, + }; + long cmd = (write ? VM_SET_KERNEMU_DEV : VM_GET_KERNEMU_DEV); + int rc; + + rc = ioctl(ctx->fd, cmd, &irp); + if (rc == 0 && !write) + *value = irp.value; + return (rc); +} + +int vm_isa_assert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) { struct vm_isa_irq isa_irq; @@ -1615,6 +1634,7 @@ vm_get_ioctls(size_t *len) VM_MMAP_GETNEXT, VM_SET_REGISTER, VM_GET_REGISTER, VM_SET_SEGMENT_DESCRIPTOR, VM_GET_SEGMENT_DESCRIPTOR, VM_SET_REGISTER_SET, VM_GET_REGISTER_SET, + VM_SET_KERNEMU_DEV, VM_GET_KERNEMU_DEV, VM_INJECT_EXCEPTION, VM_LAPIC_IRQ, VM_LAPIC_LOCAL_IRQ, VM_LAPIC_MSI, VM_IOAPIC_ASSERT_IRQ, VM_IOAPIC_DEASSERT_IRQ, VM_IOAPIC_PULSE_IRQ, VM_IOAPIC_PINCOUNT, VM_ISA_ASSERT_IRQ, Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Fri May 15 14:06:37 2020 (r361081) +++ head/lib/libvmmapi/vmmapi.h Fri May 15 15:54:22 2020 (r361082) @@ -35,6 +35,8 @@ #include #include +#include + /* * API version for out-of-tree consumers like grub-bhyve for making compile * time decisions. @@ -156,6 +158,8 @@ int vm_ioapic_assert_irq(struct vmctx *ctx, int irq); int vm_ioapic_deassert_irq(struct vmctx *ctx, int irq); int vm_ioapic_pulse_irq(struct vmctx *ctx, int irq); int vm_ioapic_pincount(struct vmctx *ctx, int *pincount); +int vm_readwrite_kernemu_device(struct vmctx *ctx, int vcpu, + vm_paddr_t gpa, bool write, int size, uint64_t *value); int vm_isa_assert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_isa_deassert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Fri May 15 14:06:37 2020 (r361081) +++ head/sys/amd64/include/vmm_dev.h Fri May 15 15:54:22 2020 (r361082) @@ -235,6 +235,15 @@ struct vm_cpu_topology { uint16_t maxcpus; }; +struct vm_readwrite_kernemu_device { + int vcpuid; + unsigned access_width : 3; + unsigned _unused : 29; + uint64_t gpa; + uint64_t value; +}; +_Static_assert(sizeof(struct vm_readwrite_kernemu_device) == 24, "ABI"); + enum { /* general routines */ IOCNUM_ABIVERS = 0, @@ -262,6 +271,8 @@ enum { IOCNUM_GET_SEGMENT_DESCRIPTOR = 23, IOCNUM_SET_REGISTER_SET = 24, IOCNUM_GET_REGISTER_SET = 25, + IOCNUM_GET_KERNEMU_DEV = 26, + IOCNUM_SET_KERNEMU_DEV = 27, /* interrupt injection */ IOCNUM_GET_INTINFO = 28, @@ -347,6 +358,12 @@ enum { _IOW('v', IOCNUM_SET_REGISTER_SET, struct vm_register_set) #define VM_GET_REGISTER_SET \ _IOWR('v', IOCNUM_GET_REGISTER_SET, struct vm_register_set) +#define VM_SET_KERNEMU_DEV \ + _IOW('v', IOCNUM_SET_KERNEMU_DEV, \ + struct vm_readwrite_kernemu_device) +#define VM_GET_KERNEMU_DEV \ + _IOWR('v', IOCNUM_GET_KERNEMU_DEV, \ + struct vm_readwrite_kernemu_device) #define VM_INJECT_EXCEPTION \ _IOW('v', IOCNUM_INJECT_EXCEPTION, struct vm_exception) #define VM_LAPIC_IRQ \ Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Fri May 15 14:06:37 2020 (r361081) +++ head/sys/amd64/vmm/vmm_dev.c Fri May 15 15:54:22 2020 (r361082) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "vmm_lapic.h" #include "vmm_stat.h" @@ -382,6 +383,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da struct vm_rtc_data *rtcdata; struct vm_memmap *mm; struct vm_cpu_topology *topology; + struct vm_readwrite_kernemu_device *kernemu; uint64_t *regvals; int *regnums; #ifdef BHYVE_SNAPSHOT @@ -561,6 +563,41 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da case VM_IOAPIC_PINCOUNT: *(int *)data = vioapic_pincount(sc->vm); break; + case VM_SET_KERNEMU_DEV: + case VM_GET_KERNEMU_DEV: { + mem_region_write_t mwrite; + mem_region_read_t mread; + bool arg; + + kernemu = (void *)data; + + if (kernemu->access_width > 0) + size = (1u << kernemu->access_width); + else + size = 1; + + if (kernemu->gpa >= DEFAULT_APIC_BASE && kernemu->gpa < DEFAULT_APIC_BASE + PAGE_SIZE) { + mread = lapic_mmio_read; + mwrite = lapic_mmio_write; + } else if (kernemu->gpa >= VIOAPIC_BASE && kernemu->gpa < VIOAPIC_BASE + VIOAPIC_SIZE) { + mread = vioapic_mmio_read; + mwrite = vioapic_mmio_write; + } else if (kernemu->gpa >= VHPET_BASE && kernemu->gpa < VHPET_BASE + VHPET_SIZE) { + mread = vhpet_mmio_read; + mwrite = vhpet_mmio_write; + } else { + error = EINVAL; + break; + } + + if (cmd == VM_SET_KERNEMU_DEV) + error = mwrite(sc->vm, kernemu->vcpuid, kernemu->gpa, + kernemu->value, size, &arg); + else + error = mread(sc->vm, kernemu->vcpuid, kernemu->gpa, + &kernemu->value, size, &arg); + break; + } case VM_ISA_ASSERT_IRQ: isa_irq = (struct vm_isa_irq *)data; error = vatpic_assert_irq(sc->vm, isa_irq->atpic_irq); Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Fri May 15 14:06:37 2020 (r361081) +++ head/usr.sbin/bhyve/Makefile Fri May 15 15:54:22 2020 (r361082) @@ -31,6 +31,7 @@ SRCS= \ hda_codec.c \ inout.c \ ioapic.c \ + kernemu_dev.c \ mem.c \ mevent.c \ mptbl.c \ @@ -75,6 +76,8 @@ SRCS= \ .if ${MK_BHYVE_SNAPSHOT} != "no" SRCS+= snapshot.c .endif + +CFLAGS.kernemu_dev.c+= -I${SRCTOP}/sys/amd64 .PATH: ${BHYVE_SYSDIR}/sys/amd64/vmm SRCS+= vmm_instruction_emul.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Fri May 15 14:06:37 2020 (r361081) +++ head/usr.sbin/bhyve/bhyverun.c Fri May 15 15:54:22 2020 (r361082) @@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$"); #include "fwctl.h" #include "gdb.h" #include "ioapic.h" +#include "kernemu_dev.h" #include "mem.h" #include "mevent.h" #include "mptbl.h" @@ -1268,6 +1269,7 @@ main(int argc, char *argv[]) init_mem(); init_inout(); + kernemu_dev_init(); init_bootrom(ctx); atkbdc_init(ctx); pci_irq_init(ctx); Added: head/usr.sbin/bhyve/kernemu_dev.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/kernemu_dev.c Fri May 15 15:54:22 2020 (r361082) @@ -0,0 +1,98 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2020 Conrad Meyer . 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 +struct vm; +struct vm_hpet_cap; +#include +#include + +#include +#include +#include + +#include "kernemu_dev.h" +#include "mem.h" + +static int +apic_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr, int size, + uint64_t *val, void *arg1 __unused, long arg2 __unused) +{ + if (vm_readwrite_kernemu_device(ctx, vcpu, addr, (dir == MEM_F_WRITE), + size, val) != 0) + return (errno); + return (0); +} + +static struct mem_range lapic_mmio = { + .name = "kern-lapic-mmio", + .base = DEFAULT_APIC_BASE, + .size = PAGE_SIZE, + .flags = MEM_F_RW | MEM_F_IMMUTABLE, + .handler = apic_handler, + +}; +static struct mem_range ioapic_mmio = { + .name = "kern-ioapic-mmio", + .base = VIOAPIC_BASE, + .size = VIOAPIC_SIZE, + .flags = MEM_F_RW | MEM_F_IMMUTABLE, + .handler = apic_handler, +}; +static struct mem_range hpet_mmio = { + .name = "kern-hpet-mmio", + .base = VHPET_BASE, + .size = VHPET_SIZE, + .flags = MEM_F_RW | MEM_F_IMMUTABLE, + .handler = apic_handler, +}; + +void +kernemu_dev_init(void) +{ + int rc; + + rc = register_mem(&lapic_mmio); + if (rc != 0) + errc(4, rc, "register_mem: LAPIC (0x%08x)", + (unsigned)lapic_mmio.base); + rc = register_mem(&ioapic_mmio); + if (rc != 0) + errc(4, rc, "register_mem: IOAPIC (0x%08x)", + (unsigned)ioapic_mmio.base); + rc = register_mem(&hpet_mmio); + if (rc != 0) + errc(4, rc, "register_mem: HPET (0x%08x)", + (unsigned)hpet_mmio.base); +} Added: head/usr.sbin/bhyve/kernemu_dev.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/kernemu_dev.h Fri May 15 15:54:22 2020 (r361082) @@ -0,0 +1,32 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2020 Conrad Meyer . 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$ + */ + +#pragma once + +void kernemu_dev_init(void); From owner-svn-src-head@freebsd.org Fri May 15 15:55:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79EB22F8E8B; Fri, 15 May 2020 15:55:03 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NtK32M2Nz42Gg; Fri, 15 May 2020 15:55:03 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from Ryans-MBP.attlocal.net (unknown [IPv6:2600:1700:358a:c660:904d:8f18:1bde:14ec]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: freqlabs/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 16F3A1C0E2; Fri, 15 May 2020 15:55:02 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Subject: Re: svn commit: r361066 - head/usr.sbin/jail To: Mateusz Piotrowski <0mp@FreeBSD.org>, Ryan Moeller , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005142338.04ENcCN5094159@repo.freebsd.org> From: Ryan Moeller Message-ID: <0c6939cc-7f8a-d2fd-9da1-63eb641815e3@FreeBSD.org> Date: Fri, 15 May 2020 11:55:02 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 15:55:03 -0000 On 5/15/20 6:18 AM, Mateusz Piotrowski wrote: > On 5/15/20 1:38 AM, Ryan Moeller wrote: >> Author: freqlabs >> Date: Thu May 14 23:38:11 2020 >> New Revision: 361066 >> URL: https://svnweb.freebsd.org/changeset/base/361066 >> >> Log: >> jail: Add exec.prepare and exec.release command hooks >> >> This change introduces new jail command hooks that run before and after any >> other actions. > Should it go into RELNOTES? I'm not sure what all the criteria are for relnotes. The committer's guide makes it seem like relnotes is for breaking changes, which this is not. -Ryan From owner-svn-src-head@freebsd.org Fri May 15 17:37:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D717F2FB7B2; Fri, 15 May 2020 17:37:09 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NwZs5Qk8z4B7H; Fri, 15 May 2020 17:37:09 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF8FD27FD9; Fri, 15 May 2020 17:37:09 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FHb9v1063656; Fri, 15 May 2020 17:37:09 GMT (envelope-from mr@FreeBSD.org) Received: (from mr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FHb81Q063652; Fri, 15 May 2020 17:37:08 GMT (envelope-from mr@FreeBSD.org) Message-Id: <202005151737.04FHb81Q063652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mr set sender to mr@FreeBSD.org using -f From: Michael Reifenberger Date: Fri, 15 May 2020 17:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361084 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: mr X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 361084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 17:37:10 -0000 Author: mr Date: Fri May 15 17:37:08 2020 New Revision: 361084 URL: https://svnweb.freebsd.org/changeset/base/361084 Log: Introduce sysputpage() to display large page size with human readable format. Using UI units allows to fit larger numbers in columns. Stop calling v_page_size - this is a value that doesn't change at runtime. Renamed WINDOW *wnd to *wd to avoid conflict with global *wnd variable. Use bit-shift to convert page size to byte. PR: 246458 Submitted by: ota@j.email.ne.jp MFC after: 2 weeks Differential Revision: D24834 Modified: head/usr.bin/systat/extern.h head/usr.bin/systat/fetch.c head/usr.bin/systat/sysput.c head/usr.bin/systat/vmstat.c Modified: head/usr.bin/systat/extern.h ============================================================================== --- head/usr.bin/systat/extern.h Fri May 15 16:14:50 2020 (r361083) +++ head/usr.bin/systat/extern.h Fri May 15 17:37:08 2020 (r361084) @@ -165,8 +165,11 @@ void showtcp(void); void status(void); void suspend(int); char *sysctl_dynread(const char *, size_t *); +void sysputpage(WINDOW* , int, int, int, uint64_t, int); +void sysputspaces(WINDOW* , int, int, int); void sysputstrs(WINDOW* , int, int, int); void sysputuint64(WINDOW* , int, int, int, uint64_t, int); +void sysputwuint64(WINDOW* , int, int, int, uint64_t, int); #define SYSTAT_CMD(name) \ void close ## name(WINDOW *); \ Modified: head/usr.bin/systat/fetch.c ============================================================================== --- head/usr.bin/systat/fetch.c Fri May 15 16:14:50 2020 (r361083) +++ head/usr.bin/systat/fetch.c Fri May 15 17:37:08 2020 (r361084) @@ -60,9 +60,11 @@ kvm_ckread(void *a, void *b, int l) return (1); } -void getsysctl(const char *name, void *ptr, size_t len) +void +getsysctl(const char *name, void *ptr, size_t len) { size_t nlen = len; + if (sysctlbyname(name, ptr, &nlen, NULL, 0) != 0) { error("sysctl(%s...) failed: %s", name, strerror(errno)); Modified: head/usr.bin/systat/sysput.c ============================================================================== --- head/usr.bin/systat/sysput.c Fri May 15 16:14:50 2020 (r361083) +++ head/usr.bin/systat/sysput.c Fri May 15 17:37:08 2020 (r361084) @@ -41,15 +41,23 @@ __FBSDID("$FreeBSD$"); #include "extern.h" void -sysputstrs(WINDOW *wnd, int row, int col, int width) +sysputspaces(WINDOW *wd, int row, int col, int width) { + static char str40[] = " "; + + mvwaddstr(wd, row, col, str40 + sizeof(str40) - width - 1); +} + +void +sysputstrs(WINDOW *wd, int row, int col, int width) +{ static char str40[] = "****************************************"; mvwaddstr(wnd, row, col, str40 + sizeof(str40) - width - 1); } void -sysputuint64(WINDOW *wnd, int row, int col, int width, uint64_t val, int flags) +sysputuint64(WINDOW *wd, int row, int col, int width, uint64_t val, int flags) { char unit, *ptr, *start, wrtbuf[width + width + 1]; int len; @@ -69,9 +77,42 @@ sysputuint64(WINDOW *wnd, int row, int col, int width, memset(wrtbuf + len, ' ', width - len); start += len; - mvwaddstr(wnd, row, col, start); + mvwaddstr(wd, row, col, start); return; error: - sysputstrs(wnd, row, col, width); + sysputstrs(wd, row, col, width); +} + +void +sysputwuint64(WINDOW *wd, int row, int col, int width, uint64_t val, int flags) +{ + if(val == 0) + sysputspaces(wd, row, col, width); + else + sysputuint64(wd, row, col, width, val, flags); +} + +static int +calc_page_shift() +{ + u_int page_size; + int shifts; + + shifts = 0; + GETSYSCTL("vm.stats.vm.v_page_size", page_size); + for(; page_size > 1; page_size >>= 1) + shifts++; + return shifts; +} + +void +sysputpage(WINDOW *wd, int row, int col, int width, uint64_t pages, int flags) +{ + static int shifts = 0; + + if (shifts == 0) + shifts = calc_page_shift(); + pages <<= shifts; + sysputuint64(wd, row, col, width, pages, flags); } Modified: head/usr.bin/systat/vmstat.c ============================================================================== --- head/usr.bin/systat/vmstat.c Fri May 15 16:14:50 2020 (r361083) +++ head/usr.bin/systat/vmstat.c Fri May 15 17:37:08 2020 (r361084) @@ -104,7 +104,6 @@ static struct Info { /* * Distribution of page usages. */ - u_int v_page_size; /* page size in bytes */ u_int v_free_count; /* number of pages free */ u_int v_wire_count; /* number of pages wired down */ u_int v_active_count; /* number of pages active */ @@ -173,15 +172,15 @@ closekre(WINDOW *w) #define STATCOL 0 #define MEMROW 2 /* uses 4 rows and 45 cols */ #define MEMCOL 0 -#define PAGEROW 2 /* uses 4 rows and 30 cols */ +#define PAGEROW 1 /* uses 4 rows and 30 cols */ #define PAGECOL 47 -#define INTSROW 6 /* uses all rows to bottom and 16 cols */ +#define INTSROW 5 /* uses all rows to bottom and 16 cols */ #define INTSCOL 64 #define PROCSROW 6 /* uses 3 rows and 19 cols */ #define PROCSCOL 0 #define GENSTATROW 7 /* uses 2 rows and 29 cols */ #define GENSTATCOL 21 -#define VMSTATROW 7 /* uses 17 rows and 12-14 cols */ +#define VMSTATROW 5 /* uses 17 rows and 12-14 cols */ #define VMSTATCOL 49 /* actually 50-51 for some fields */ #define GRAPHROW 10 /* uses 3 rows and 49-51 cols */ #define GRAPHCOL 0 @@ -304,7 +303,7 @@ labelkre(void) clear(); mvprintw(STATROW, STATCOL + 6, "users Load"); mvprintw(STATROW + 1, STATCOL + 3, "Mem usage: %%Phy %%Kmem"); - mvprintw(MEMROW, MEMCOL, "Mem: KB REAL VIRTUAL"); + mvprintw(MEMROW, MEMCOL, "Mem: REAL VIRTUAL"); mvprintw(MEMROW + 1, MEMCOL, " Tot Share Tot Share"); mvprintw(MEMROW + 2, MEMCOL, "Act"); mvprintw(MEMROW + 3, MEMCOL, "All"); @@ -373,7 +372,7 @@ labelkre(void) #define PUTRATE(fld, l, c, w) \ do { \ Y(fld); \ - putint((int)((float)s.fld/etime + 0.5), l, c, w); \ + sysputwuint64(wnd, l, c, w, (s.fld/etime + 0.5), 0); \ } while (0) #define MAXFAIL 5 @@ -454,21 +453,20 @@ showkre(void) putfloat(avenrun[1], STATROW, STATCOL + 26, 5, 2, 0); putfloat(avenrun[2], STATROW, STATCOL + 32, 5, 2, 0); mvaddstr(STATROW, STATCOL + 55, buf); -#define pgtokb(pg) ((pg) * (s.v_page_size / 1024)) putfloat(100.0 * (v_page_count - total.t_free) / v_page_count, STATROW + 1, STATCOL + 15, 2, 0, 1); putfloat(100.0 * s.v_kmem_map_size / kmem_size, STATROW + 1, STATCOL + 22, 2, 0, 1); - putuint64(pgtokb(total.t_arm), MEMROW + 2, MEMCOL + 4, 7); - putuint64(pgtokb(total.t_armshr), MEMROW + 2, MEMCOL + 12, 7); - putuint64(pgtokb(total.t_avm), MEMROW + 2, MEMCOL + 20, 8); - putuint64(pgtokb(total.t_avmshr), MEMROW + 2, MEMCOL + 29, 8); - putuint64(pgtokb(total.t_rm), MEMROW + 3, MEMCOL + 4, 7); - putuint64(pgtokb(total.t_rmshr), MEMROW + 3, MEMCOL + 12, 7); - putuint64(pgtokb(total.t_vm), MEMROW + 3, MEMCOL + 20, 8); - putuint64(pgtokb(total.t_vmshr), MEMROW + 3, MEMCOL + 29, 8); - putuint64(pgtokb(total.t_free), MEMROW + 2, MEMCOL + 38, 7); + sysputpage(wnd, MEMROW + 2, MEMCOL + 4, 7, total.t_arm, 0); + sysputpage(wnd, MEMROW + 2, MEMCOL + 12, 7, total.t_armshr, 0); + sysputpage(wnd, MEMROW + 2, MEMCOL + 20, 8, total.t_avm, 0); + sysputpage(wnd, MEMROW + 2, MEMCOL + 29, 8, total.t_avmshr, 0); + sysputpage(wnd, MEMROW + 3, MEMCOL + 4, 7, total.t_rm, 0); + sysputpage(wnd, MEMROW + 3, MEMCOL + 12, 7, total.t_rmshr, 0); + sysputpage(wnd, MEMROW + 3, MEMCOL + 20, 8, total.t_vm, 0); + sysputpage(wnd, MEMROW + 3, MEMCOL + 29, 8, total.t_vmshr, 0); + sysputpage(wnd, MEMROW + 2, MEMCOL + 38, 7, total.t_free, 0); putint(total.t_rq - 1, PROCSROW + 2, PROCSCOL, 3); putint(total.t_pw, PROCSROW + 2, PROCSCOL + 4, 3); putint(total.t_dw, PROCSROW + 2, PROCSCOL + 8, 3); @@ -487,13 +485,13 @@ showkre(void) PUTRATE(v_pdwakeups, VMSTATROW + 9, VMSTATCOL, 8); PUTRATE(v_pdpages, VMSTATROW + 10, VMSTATCOL, 8); PUTRATE(v_intrans, VMSTATROW + 11, VMSTATCOL, 8); - putuint64(pgtokb(s.v_wire_count), VMSTATROW + 12, VMSTATCOL, 8); - putuint64(pgtokb(s.v_active_count), VMSTATROW + 13, VMSTATCOL, 8); - putuint64(pgtokb(s.v_inactive_count), VMSTATROW + 14, VMSTATCOL, 8); - putuint64(pgtokb(s.v_laundry_count), VMSTATROW + 15, VMSTATCOL, 8); - putuint64(pgtokb(s.v_free_count), VMSTATROW + 16, VMSTATCOL, 8); + sysputpage(wnd, VMSTATROW + 12, VMSTATCOL + 2, 8 - 2, s.v_wire_count, 0); + sysputpage(wnd, VMSTATROW + 13, VMSTATCOL + 2, 8 - 2, s.v_active_count, 0); + sysputpage(wnd, VMSTATROW + 14, VMSTATCOL + 2, 8 - 2, s.v_inactive_count, 0); + sysputpage(wnd, VMSTATROW + 15, VMSTATCOL + 2, 8 - 2, s.v_laundry_count, 0); + sysputpage(wnd, VMSTATROW + 16, VMSTATCOL + 2, 8 - 2, s.v_free_count, 0); if (LINES - 1 > VMSTATROW + 17) - putuint64(s.bufspace / 1024, VMSTATROW + 17, VMSTATCOL, 8); + sysputuint64(wnd, VMSTATROW + 17, VMSTATCOL + 2, 8 - 2, s.bufspace, 0); PUTRATE(v_vnodein, PAGEROW + 2, PAGECOL + 6, 5); PUTRATE(v_vnodeout, PAGEROW + 2, PAGECOL + 12, 5); PUTRATE(v_swapin, PAGEROW + 2, PAGECOL + 19, 5); @@ -773,7 +771,6 @@ getinfo(struct Info *ls) GETSYSCTL("vm.stats.vm.v_dfree", ls->v_dfree); GETSYSCTL("vm.stats.vm.v_pfree", ls->v_pfree); GETSYSCTL("vm.stats.vm.v_tfree", ls->v_tfree); - GETSYSCTL("vm.stats.vm.v_page_size", ls->v_page_size); GETSYSCTL("vm.stats.vm.v_free_count", ls->v_free_count); GETSYSCTL("vm.stats.vm.v_wire_count", ls->v_wire_count); GETSYSCTL("vm.stats.vm.v_active_count", ls->v_active_count); From owner-svn-src-head@freebsd.org Fri May 15 18:51:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D4A12FD655; Fri, 15 May 2020 18:51:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NyDT6zc0z4HLw; Fri, 15 May 2020 18:51:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA926F1C; Fri, 15 May 2020 18:51:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FIpL1r010433; Fri, 15 May 2020 18:51:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FIpKgJ010425; Fri, 15 May 2020 18:51:20 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005151851.04FIpKgJ010425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 15 May 2020 18:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361085 - in head/sys/dev/ath: . ath_hal/ar5416 ath_rate/amrr ath_rate/onoe ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: in head/sys/dev/ath: . ath_hal/ar5416 ath_rate/amrr ath_rate/onoe ath_rate/sample X-SVN-Commit-Revision: 361085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 18:51:22 -0000 Author: adrian Date: Fri May 15 18:51:20 2020 New Revision: 361085 URL: https://svnweb.freebsd.org/changeset/base/361085 Log: [ath] [ath_rate] Extend ath_rate_sample to better handle 11n rates and aggregates. My initial rate control code was .. suboptimal. I wanted to at least get MCS rates sent, but it didn't do anywhere near enough to handle low signal level links or remotely keep accurate statistics. So, 8 years later, here's what I should've done back then. * Firstly, I wasn't at all tracking packet sizes other than the two buckets (250 and 1600 bytes.) So, extend it to include 4096, 8192, 16384, 32768 and 65536. I may go add 2048 at some point if I find it's useful. This is important for a few reasons. First, when forming A-MPDU or AMSDU aggregates the frame sizes are larger, and thus the TX time calculation is woefully, increasingly wrong. Secondly, the behaviour of 802.11 channels isn't some fixed thing, both due to channel conditions and radios themselves. Notably, there was some observations done a few years ago on 11n chipsets which noticed longer aggregates showed an increase in failed A-MPDU sub-frame reception as you got further along in the transmit time. It could be due to a variety of things - transmitter linearity, channel conditions changing, frequency/phase drift, etc - but the observation was to potentially form shorter aggregates to improve BER. * .. and then modify the ath TX path to report the length of the aggregate sent, so as the statistics kept would line up with the correct bucket. * Then on the rate control look-up side - i was also only using the first frame length for an A-MPDU rate control lookup which isn't good enough here. So, add a new method that walks the TID software queue for that node to find out what the likely length of data available is. It isn't ALL of the data in the queue because we'll only ever send enough data to fit inside the block-ack window, so limit how many bytes we return to roughly what ath_tx_form_aggr() would do. * .. and cache that in the first ath_buf in the aggregate so it and the eventual AMPDU length can be returned to the rate control code. * THEN, modify the rate control code to look at them both when deciding which bucket to attribute the sent frame on. I'm erring on the side of caution and using the size bucket that the lookup is based on. Ok, so now the rate lookups and statistics are "more correct". However, MCS rates are not the same as 11abg rates in that they're not a monotonically incrementing set of faster rates and you can't assume that just because a given MCS rate fails, the next higher one wouldn't work better or be a lower average tx time. So, I had to do a bunch of surgery to the best rate and sample rate math. This is the bit that's a WIP. * First, simplify the statistics updates (update_stats()) to do a single pass on all rates. * Next, make sure that each rate average tx time is updated based on /its/ failure/success. Eg if you sent a frame with { MCS15, MCS12, MCS8 } and MCS8 succeeded, MCS15 and MCS 12 would have their average tx time updated for /their/ part of the transmission, not the whole transmission. * Next, EWMA wasn't being fully calculated based on the /failures/ in each of the rate attempts. So, if MCS15, MCS12 failed above but MCS8 didn't, then ensure that the statistics noted that /all/ subframes failed at those rates, rather than the eventual set of transmitted/sent frames. This ensures the EWMA /and/ average TX time are updated correctly. * When picking a sample rate and initial rate, probe rates aroud the current MCS but limit it to MCS0..7 /for all spatial streams/, rather than doing crazy things like hitting MCS7 and then probing MCS8 - MCS8 is basically MCS0 but two spatial streams. It's a /lot/ slower than MCS7. Also, the reverse is true - if we're at MCS8 then don't probe MCS7 as part of it, it's not likely to succeed. * Fix bugs in pick_best_rate() where I was /immediately/ choosing the highest MCS rate if there weren't any frames yet transmitted. I was defaulting to 25% EWMA and .. then each comparison would accept the higher rate. Just skip those; sampling will fill in the details. So, this seems to work a lot better. It's not perfect; I'm still seeing a lot of instability around higher MCS rates because there are bursts of loss/retransmissions that aren't /too/ bad. But i'll keep iterating over this and tidying up my hacks. Ok, so why this still something I'm poking at? rather than porting minstrel_ht? ath_rate_sample tries to minimise airtime, not maximise throughput. I have extended it with an EWMA based on sub-frame success/failures - high MCS rates that have partially successful receptions still show super short average frame times, but a /lot/ of retransmits have to happen for that to work. So for MCS rates I also track this EWMA and ensure that the rates I'm choosing don't have super crappy packet failures. I don't mind not getting lower peak throughput versus minstrel_ht; instead I want to see if I can make "minimise airtime" work well. Tested: * AR9380, STA mode * AR9344, STA mode * AR9580, STA/AP mode Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c head/sys/dev/ath/ath_rate/amrr/amrr.c head/sys/dev/ath/ath_rate/onoe/onoe.c head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/ath_rate/sample/sample.h head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_ath_tx_ht.c head/sys/dev/ath/if_athrate.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar2133.c Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/ath_hal/ar5416/ar2133.c Fri May 15 18:51:20 2020 (r361085) @@ -419,6 +419,7 @@ ar2133GetChannelMaxMinPower(struct ath_hal *ah, return(AH_FALSE); } #else + // XXX TODO: actually go implement for 11n chips! *maxPow = *minPow = 0; return AH_FALSE; #endif Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c ============================================================================== --- head/sys/dev/ath/ath_rate/amrr/amrr.c Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/ath_rate/amrr/amrr.c Fri May 15 18:51:20 2020 (r361085) @@ -104,8 +104,9 @@ ath_rate_node_cleanup(struct ath_softc *sc, struct ath void ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, - int shortPreamble, size_t frameLen, int tid, bool is_aggr, - u_int8_t *rix, int *try0, u_int8_t *txrate, int *maxdur) + int shortPreamble, size_t frameLen, int tid, int is_aggr, + u_int8_t *rix, int *try0, u_int8_t *txrate, int *maxdur, + int *maxpktlen) { struct amrr_node *amn = ATH_NODE_AMRR(an); @@ -116,6 +117,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod else *txrate = amn->amn_tx_rate0; maxdur = -1; + maxpktlen = -1; } /* @@ -160,7 +162,7 @@ ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath void ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, const struct ath_rc_series *rc, const struct ath_tx_status *ts, - int frame_size, int nframes, int nbad) + int frame_size, int rc_framesize, int nframes, int nbad) { struct amrr_node *amn = ATH_NODE_AMRR(an); int sr = ts->ts_shortretry; Modified: head/sys/dev/ath/ath_rate/onoe/onoe.c ============================================================================== --- head/sys/dev/ath/ath_rate/onoe/onoe.c Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/ath_rate/onoe/onoe.c Fri May 15 18:51:20 2020 (r361085) @@ -112,8 +112,9 @@ ath_rate_node_cleanup(struct ath_softc *sc, struct ath void ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, - int shortPreamble, size_t frameLen, int tid, bool is_aggr, - u_int8_t *rix, int *try0, u_int8_t *txrate, int *maxdur) + int shortPreamble, size_t frameLen, int tid, int is_aggr, + u_int8_t *rix, int *try0, u_int8_t *txrate, int *maxdur, + int *maxpktlen) { struct onoe_node *on = ATH_NODE_ONOE(an); @@ -124,6 +125,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod else *txrate = on->on_tx_rate0; *maxdur = -1; + *maxpktlen = -1; } /* @@ -167,7 +169,7 @@ ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath void ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, const struct ath_rc_series *rc, const struct ath_tx_status *ts, - int frame_size, int nframes, int nbad) + int frame_size, int rc_framesize, int nframes, int nbad) { struct onoe_node *on = ATH_NODE_ONOE(an); Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/ath_rate/sample/sample.c Fri May 15 18:51:20 2020 (r361085) @@ -107,6 +107,117 @@ __FBSDID("$FreeBSD$"); * a few different packet sizes independently for each link. */ +/* XXX TODO: move this into ath_hal/net80211 so it can be shared */ + +#define MCS_HT20 0 +#define MCS_HT20_SGI 1 +#define MCS_HT40 2 +#define MCS_HT40_SGI 3 + +/* + * This is currently a copy/paste from the 11n tx code. + * + * It's used to determine the maximum frame length allowed for the + * given rate. For now this ignores SGI/LGI and will assume long-GI. + * This only matters for lower rates that can't fill a full 64k A-MPDU. + * + * (But it's also important because right now rate control doesn't set + * flags like SGI/LGI, STBC, LDPC, TX power, etc.) + * + * When selecting a set of rates the rate control code will iterate + * over the HT20/HT40 max frame length and tell the caller the maximum + * length (@ LGI.) It will also choose a bucket that's the minimum + * of this value and the provided aggregate length. That way the + * rate selection will closely match what the eventual formed aggregate + * will be rather than "not at all". + */ + +static int ath_rate_sample_max_4ms_framelen[4][32] = { + [MCS_HT20] = { + 3212, 6432, 9648, 12864, 19300, 25736, 28952, 32172, + 6424, 12852, 19280, 25708, 38568, 51424, 57852, 64280, + 9628, 19260, 28896, 38528, 57792, 65532, 65532, 65532, + 12828, 25656, 38488, 51320, 65532, 65532, 65532, 65532, + }, + [MCS_HT20_SGI] = { + 3572, 7144, 10720, 14296, 21444, 28596, 32172, 35744, + 7140, 14284, 21428, 28568, 42856, 57144, 64288, 65532, + 10700, 21408, 32112, 42816, 64228, 65532, 65532, 65532, + 14256, 28516, 42780, 57040, 65532, 65532, 65532, 65532, + }, + [MCS_HT40] = { + 6680, 13360, 20044, 26724, 40092, 53456, 60140, 65532, + 13348, 26700, 40052, 53400, 65532, 65532, 65532, 65532, + 20004, 40008, 60016, 65532, 65532, 65532, 65532, 65532, + 26644, 53292, 65532, 65532, 65532, 65532, 65532, 65532, + }, + [MCS_HT40_SGI] = { + 7420, 14844, 22272, 29696, 44544, 59396, 65532, 65532, + 14832, 29668, 44504, 59340, 65532, 65532, 65532, 65532, + 22232, 44464, 65532, 65532, 65532, 65532, 65532, 65532, + 29616, 59232, 65532, 65532, 65532, 65532, 65532, 65532, + } +}; + +/* + * Given the (potentially MRR) transmit schedule, calculate the maximum + * allowed packet size for forming aggregates based on the lowest + * MCS rate in the transmit schedule. + * + * Returns -1 if it's a legacy rate or no MRR. + */ +static int +ath_rate_sample_find_min_pktlength(struct ath_softc *sc, + struct ath_node *an, uint8_t rix0) +{ +#define MCS_IDX(ix) (rt->info[ix].dot11Rate) + const HAL_RATE_TABLE *rt = sc->sc_currates; + struct sample_node *sn = ATH_NODE_SAMPLE(an); + const struct txschedule *sched = &sn->sched[rix0]; + int max_pkt_length = 65530; // ATH_AGGR_MAXSIZE + // Note: this may not be true in all cases; need to check? + int is_ht40 = (an->an_node.ni_chw == 40); + // Note: not great, but good enough.. + int idx = is_ht40 ? MCS_HT40 : MCS_HT20; + + if (rt->info[rix0].phy != IEEE80211_T_HT) { + return -1; + } + + if (! sc->sc_mrretry) { + return -1; + } + + KASSERT(rix0 == sched->r0, ("rix0 (%x) != sched->r0 (%x)!\n", + rix0, sched->r0)); + + /* + * Update based on sched->r{0,1,2,3} if sched->t{0,1,2,3} + * is not zero. + * + * Note: assuming all four PHYs are HT! + */ + if (sched->t0 != 0) { + max_pkt_length = MIN(max_pkt_length, + ath_rate_sample_max_4ms_framelen[idx][MCS_IDX(sched->r0)]); + } + if (sched->t1 != 0) { + max_pkt_length = MIN(max_pkt_length, + ath_rate_sample_max_4ms_framelen[idx][MCS_IDX(sched->r1)]); + } + if (sched->t2 != 0) { + max_pkt_length = MIN(max_pkt_length, + ath_rate_sample_max_4ms_framelen[idx][MCS_IDX(sched->r2)]); + } + if (sched->t3 != 0) { + max_pkt_length = MIN(max_pkt_length, + ath_rate_sample_max_4ms_framelen[idx][MCS_IDX(sched->r3)]); + } + + return max_pkt_length; +#undef MCS +} + static void ath_rate_ctl_reset(struct ath_softc *, struct ieee80211_node *); static __inline int @@ -125,6 +236,22 @@ size_to_bin(int size) return 2; #endif #if NUM_PACKET_SIZE_BINS > 4 + if (size <= packet_size_bins[3]) + return 3; +#endif +#if NUM_PACKET_SIZE_BINS > 5 + if (size <= packet_size_bins[4]) + return 4; +#endif +#if NUM_PACKET_SIZE_BINS > 6 + if (size <= packet_size_bins[5]) + return 5; +#endif +#if NUM_PACKET_SIZE_BINS > 7 + if (size <= packet_size_bins[6]) + return 6; +#endif +#if NUM_PACKET_SIZE_BINS > 8 #error "add support for more packet sizes" #endif return NUM_PACKET_SIZE_BINS-1; @@ -167,12 +294,12 @@ pick_best_rate(struct ath_node *an, const HAL_RATE_TAB int size_bin, int require_acked_before) { struct sample_node *sn = ATH_NODE_SAMPLE(an); - int best_rate_rix, best_rate_tt, best_rate_pct; + int best_rate_rix, best_rate_tt, best_rate_pct; uint64_t mask; int rix, tt, pct; - best_rate_rix = 0; - best_rate_tt = 0; + best_rate_rix = 0; + best_rate_tt = 0; best_rate_pct = 0; for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { if ((mask & 1) == 0) /* not a supported rate */ @@ -194,8 +321,7 @@ pick_best_rate(struct ath_node *an, const HAL_RATE_TAB if (sn->stats[size_bin][rix].total_packets > 0) { pct = sn->stats[size_bin][rix].ewma_pct; } else { - /* XXX for now, assume 95% ok */ - pct = 95; + pct = -1; /* No percent yet to compare against! */ } /* don't use a bit-rate that has been failing */ @@ -203,18 +329,36 @@ pick_best_rate(struct ath_node *an, const HAL_RATE_TAB continue; /* - * For HT, Don't use a bit rate that is much more - * lossy than the best. + * For HT, Don't use a bit rate that is more + * lossy than the best. Give a bit of leeway. * - * XXX this isn't optimal; it's just designed to - * eliminate rates that are going to be obviously - * worse. + * Don't consider best rates that we haven't seen + * packets for yet; let sampling start inflence that. */ if (an->an_node.ni_flags & IEEE80211_NODE_HT) { + if (pct == -1) + continue; +#if 0 + IEEE80211_NOTE(an->an_node.ni_vap, + IEEE80211_MSG_RATECTL, + &an->an_node, + "%s: size %d comparing best rate 0x%x pkts/ewma/tt (%ju/%d/%d) " + "to 0x%x pkts/ewma/tt (%ju/%d/%d)", + __func__, + bin_to_size(size_bin), + rt->info[best_rate_rix].dot11Rate, + sn->stats[size_bin][best_rate_rix].total_packets, + best_rate_pct, + best_rate_tt, + rt->info[rix].dot11Rate, + sn->stats[size_bin][rix].total_packets, + pct, + tt); +#endif if (best_rate_pct > (pct + 50)) continue; } - +#if 1 /* * For non-MCS rates, use the current average txtime for * comparison. @@ -228,19 +372,19 @@ pick_best_rate(struct ath_node *an, const HAL_RATE_TAB } /* - * Since 2 stream rates have slightly higher TX times, + * Since 2 and 3 stream rates have slightly higher TX times, * allow a little bit of leeway. This should later * be abstracted out and properly handled. */ if (an->an_node.ni_flags & IEEE80211_NODE_HT) { - if (best_rate_tt == 0 || (tt * 8 <= best_rate_tt * 10)) { + if (best_rate_tt == 0 || ((tt * 10) <= (best_rate_tt * 10))) { best_rate_tt = tt; best_rate_rix = rix; best_rate_pct = pct; } } - } - return (best_rate_tt ? best_rate_rix : -1); + } + return (best_rate_tt ? best_rate_rix : -1); } /* @@ -260,7 +404,7 @@ pick_sample_rate(struct sample_softc *ssc , struct ath current_rix = sn->current_rix[size_bin]; if (current_rix < 0) { /* no successes yet, send at the lowest bit-rate */ - /* XXX should return MCS0 if HT */ + /* XXX TODO should return MCS0 if HT */ return 0; } @@ -316,10 +460,22 @@ pick_sample_rate(struct sample_softc *ssc , struct ath /* * For HT, only sample a few rates on either side of the * current rix; there's quite likely a lot of them. + * + * This is limited to testing rate indexes on either side of + * this MCS, but for all spatial streams. + * + * Otherwise we'll (a) never really sample higher MCS + * rates if we're stuck low, and we'll make weird moves + * like sample MCS8 if we're using MCS7. */ if (an->an_node.ni_flags & IEEE80211_NODE_HT) { - if (rix < (current_rix - 3) || - rix > (current_rix + 3)) { + uint8_t current_mcs, rix_mcs; + + current_mcs = MCS(current_rix) & 0x7; + rix_mcs = MCS(rix) & 0x7; + + if (rix_mcs < (current_mcs - 2) || + rix_mcs > (current_mcs + 2)) { mask &= ~((uint64_t) 1<stats[size_bin][rix].successive_failures == 0) { break; } @@ -483,8 +639,8 @@ ath_rate_pick_seed_rate_ht(struct ath_softc *sc, struc void ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, int shortPreamble, size_t frameLen, int tid, - bool is_aggr, u_int8_t *rix0, int *try0, - u_int8_t *txrate, int *maxdur) + int is_aggr, u_int8_t *rix0, int *try0, + u_int8_t *txrate, int *maxdur, int *maxpktlen) { #define DOT11RATE(ix) (rt->info[ix].dot11Rate & IEEE80211_RATE_VAL) #define MCS(ix) (rt->info[ix].dot11Rate | IEEE80211_RATE_MCS) @@ -493,9 +649,10 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod struct sample_softc *ssc = ATH_SOFTC_SAMPLE(sc); struct ieee80211com *ic = &sc->sc_ic; const HAL_RATE_TABLE *rt = sc->sc_currates; - const int size_bin = size_to_bin(frameLen); + int size_bin = size_to_bin(frameLen); int rix, mrr, best_rix, change_rates; unsigned average_tx_time; + int max_pkt_len; ath_rate_update_static_rix(sc, &an->an_node); @@ -503,6 +660,11 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod /* Also for now don't calculate a max duration; that'll come later */ *maxdur = -1; + /* + * For now just set it to the frame length; we'll optimise it later. + */ + *maxpktlen = frameLen; + if (sn->currates != sc->sc_currates) { device_printf(sc->sc_dev, "%s: currates != sc_currates!\n", __func__); @@ -519,15 +681,34 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod mrr = sc->sc_mrretry; /* XXX check HT protmode too */ + /* XXX turn into a cap; 11n MACs support MRR+RTSCTS */ if (mrr && (ic->ic_flags & IEEE80211_F_USEPROT && !sc->sc_mrrprot)) mrr = 0; best_rix = pick_best_rate(an, rt, size_bin, !mrr); + + /* + * At this point we've chosen the best rix, so now we + * need to potentially update our maximum packet length + * and size_bin if we're doing 11n rates. + */ + max_pkt_len = ath_rate_sample_find_min_pktlength(sc, an, best_rix); + if (max_pkt_len > 0) { +#if 0 + device_printf(sc->sc_dev, + "Limiting maxpktlen from %d to %d bytes\n", + (int) frameLen, max_pkt_len); +#endif + *maxpktlen = frameLen = MIN(frameLen, max_pkt_len); + size_bin = size_to_bin(frameLen); + } + if (best_rix >= 0) { average_tx_time = sn->stats[size_bin][best_rix].average_tx_time; } else { average_tx_time = 0; } + /* * Limit the time measuring the performance of other tx * rates to sample_rate% of the total transmission time. @@ -586,9 +767,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod int cur_rix = sn->current_rix[size_bin]; int cur_att = sn->stats[size_bin][cur_rix].average_tx_time; /* - * If the node is HT, upgrade it if the MCS rate is - * higher and the average tx time is within 20% of - * the current rate. It can fail a little. + * If the node is HT, upgrade it if the MCS rate without + * the stream is higher and the average tx time is + * within 10% of the current rate. It can fail a little. * * This is likely not optimal! */ @@ -596,13 +777,20 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod printf("cur rix/att %x/%d, best rix/att %x/%d\n", MCS(cur_rix), cur_att, MCS(best_rix), average_tx_time); #endif - if ((MCS(best_rix) > MCS(cur_rix)) && - (average_tx_time * 8) <= (cur_att * 10)) { +#if 0 + if (((MCS(best_rix) & 0x7) > (MCS(cur_rix) & 0x7)) && + (average_tx_time * 10) <= (cur_att * 10)) { +#else + if ((average_tx_time * 10) <= (cur_att * 10)) { +#endif IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, - "%s: HT: best_rix 0x%d > cur_rix 0x%x, average_tx_time %d, cur_att %d", - __func__, - MCS(best_rix), MCS(cur_rix), average_tx_time, cur_att); + "%s: HT: size %d best_rix 0x%x > " + " cur_rix 0x%x, average_tx_time %d," + " cur_att %d", + __func__, bin_to_size(size_bin), + MCS(best_rix), MCS(cur_rix), + average_tx_time, cur_att); change_rates = 1; } } @@ -614,15 +802,19 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, -"%s: size %d switch rate %d (%d/%d) -> %d (%d/%d) after %d packets mrr %d", +"%s: size %d switch rate %d %s (%d/%d) EWMA %d -> %d %s (%d/%d) EWMA %d after %d packets mrr %d", __func__, bin_to_size(size_bin), - RATE(sn->current_rix[size_bin]), + dot11rate(rt, sn->current_rix[size_bin]), + dot11rate_label(rt, sn->current_rix[size_bin]), sn->stats[size_bin][sn->current_rix[size_bin]].average_tx_time, sn->stats[size_bin][sn->current_rix[size_bin]].perfect_tx_time, - RATE(best_rix), + sn->stats[size_bin][sn->current_rix[size_bin]].ewma_pct, + dot11rate(rt, best_rix), + dot11rate_label(rt, best_rix), sn->stats[size_bin][best_rix].average_tx_time, sn->stats[size_bin][best_rix].perfect_tx_time, + sn->stats[size_bin][best_rix].ewma_pct, sn->packets_since_switch[size_bin], mrr); } @@ -659,6 +851,7 @@ done: *txrate = rt->info[rix].rateCode | (shortPreamble ? rt->info[rix].shortPreamble : 0); sn->packets_sent[size_bin]++; + #undef DOT11RATE #undef MCS #undef RATE @@ -720,9 +913,6 @@ static void update_stats(struct ath_softc *sc, struct ath_node *an, int frame_size, int rix0, int tries0, - int rix1, int tries1, - int rix2, int tries2, - int rix3, int tries3, int short_tries, int tries, int status, int nframes, int nbad) { @@ -739,33 +929,20 @@ update_stats(struct ath_softc *sc, struct ath_node *an if (!IS_RATE_DEFINED(sn, rix0)) return; + + /* + * If status is FAIL then we treat all frames as bad. + * This better accurately tracks EWMA and average TX time + * because even if the eventual transmission succeeded, + * transmission at this rate did not. + */ + if (status != 0) + nbad = nframes; + tt = calc_usecs_unicast_packet(sc, size, rix0, short_tries, MIN(tries0, tries) - 1, is_ht40); tries_so_far = tries0; - if (tries1 && tries_so_far < tries) { - if (!IS_RATE_DEFINED(sn, rix1)) - return; - tt += calc_usecs_unicast_packet(sc, size, rix1, short_tries, - MIN(tries1 + tries_so_far, tries) - tries_so_far - 1, is_ht40); - tries_so_far += tries1; - } - - if (tries2 && tries_so_far < tries) { - if (!IS_RATE_DEFINED(sn, rix2)) - return; - tt += calc_usecs_unicast_packet(sc, size, rix2, short_tries, - MIN(tries2 + tries_so_far, tries) - tries_so_far - 1, is_ht40); - tries_so_far += tries2; - } - - if (tries3 && tries_so_far < tries) { - if (!IS_RATE_DEFINED(sn, rix3)) - return; - tt += calc_usecs_unicast_packet(sc, size, rix3, short_tries, - MIN(tries3 + tries_so_far, tries) - tries_so_far - 1, is_ht40); - } - if (sn->stats[size_bin][rix0].total_packets < ssc->smoothing_minpackets) { /* just average the first few packets */ int avg_tx = sn->stats[size_bin][rix0].average_tx_time; @@ -777,34 +954,9 @@ update_stats(struct ath_softc *sc, struct ath_node *an ((sn->stats[size_bin][rix0].average_tx_time * ssc->smoothing_rate) + (tt * (100 - ssc->smoothing_rate))) / 100; } - - /* - * XXX Don't mark the higher bit rates as also having failed; as this - * unfortunately stops those rates from being tasted when trying to - * TX. This happens with 11n aggregation. - * - * This is valid for higher CCK rates, higher OFDM rates, and higher - * HT rates within the current number of streams (eg MCS0..7, 8..15, - * etc.) - */ + if (nframes == nbad) { -#if 0 - int y; -#endif sn->stats[size_bin][rix0].successive_failures += nbad; -#if 0 - for (y = size_bin+1; y < NUM_PACKET_SIZE_BINS; y++) { - /* - * Also say larger packets failed since we - * assume if a small packet fails at a - * bit-rate then a larger one will also. - */ - sn->stats[y][rix0].successive_failures += nbad; - sn->stats[y][rix0].last_tx = ticks; - sn->stats[y][rix0].tries += tries; - sn->stats[y][rix0].total_packets += nframes; - } -#endif } else { sn->stats[size_bin][rix0].packets_acked += (nframes - nbad); sn->stats[size_bin][rix0].successive_failures = 0; @@ -833,20 +985,31 @@ update_stats(struct ath_softc *sc, struct ath_node *an (pct * (100 - ssc->smoothing_rate))) / 100; } + /* + * Only update the sample time for the initial sample rix. + * We've updated the statistics on each of the other retries + * fine, but we should only update the sample_tt with what + * was actually sampled. + * + * However, to aide in debugging, log all the failures for + * each of the buckets + */ + IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, + &an->an_node, + "%s: size %d %s %s rate %d %s tries (%d/%d) tt %d " + "avg_tt (%d/%d) nfrm %d nbad %d", + __func__, + size, + status ? "FAIL" : "OK", + rix0 == sn->current_sample_rix[size_bin] ? "sample" : "mrr", + dot11rate(rt, rix0), + dot11rate_label(rt, rix0), + short_tries, tries, tt, + sn->stats[size_bin][rix0].average_tx_time, + sn->stats[size_bin][rix0].perfect_tx_time, + nframes, nbad); if (rix0 == sn->current_sample_rix[size_bin]) { - IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, - &an->an_node, -"%s: size %d %s sample rate %d %s tries (%d/%d) tt %d avg_tt (%d/%d) nfrm %d nbad %d", - __func__, - size, - status ? "FAIL" : "OK", - dot11rate(rt, rix0), - dot11rate_label(rt, rix0), - short_tries, tries, tt, - sn->stats[size_bin][rix0].average_tx_time, - sn->stats[size_bin][rix0].perfect_tx_time, - nframes, nbad); sn->sample_tt[size_bin] = tt; sn->current_sample_rix[size_bin] = -1; } @@ -864,7 +1027,7 @@ badrate(struct ath_softc *sc, int series, int hwrate, void ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, const struct ath_rc_series *rc, const struct ath_tx_status *ts, - int frame_size, int nframes, int nbad) + int frame_size, int rc_framesize, int nframes, int nbad) { struct ieee80211com *ic = &sc->sc_ic; struct sample_node *sn = ATH_NODE_SAMPLE(an); @@ -884,7 +1047,41 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ if (frame_size == 0) /* NB: should not happen */ frame_size = 1500; + if (rc_framesize == 0) /* NB: should not happen */ + rc_framesize = 1500; + /* + * There are still some places where what rate control set as + * a limit but the hardware decided, for some reason, to transmit + * at a smaller size that fell into a different bucket. + * + * The eternal question here is - which size_bin should it go in? + * The one that was requested, or the one that was transmitted? + * + * Here's the problem - if we use the one that was transmitted, + * we may continue to hit corner cases where we make a rate + * selection using a higher bin but only update the smaller bin; + * thus never really "adapting". + * + * If however we update the larger bin, we're not accurately + * representing the channel state at that frame/aggregate size. + * However if we keep hitting the larger request but completing + * a smaller size, we at least updates based on what the + * request was /for/. + * + * I'm going to err on the side of caution and choose the + * latter. + */ + if (size_to_bin(frame_size) != size_to_bin(rc_framesize)) { +#if 0 + device_printf(sc->sc_dev, + "%s: completed but frame size buckets mismatch " + "(completed %d tx'ed %d)\n", + __func__, frame_size, rc_framesize); +#endif + frame_size = rc_framesize; + } + if (sn->ratemask == 0) { IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, @@ -921,9 +1118,6 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ short_tries, long_tries, nframes, nbad); update_stats(sc, an, frame_size, final_rix, long_tries, - 0, 0, - 0, 0, - 0, 0, short_tries, long_tries, status, nframes, nbad); @@ -962,18 +1156,13 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ } /* - * NB: series > 0 are not penalized for failure - * based on the try counts under the assumption - * that losses are often bursty and since we - * sample higher rates 1 try at a time doing so - * may unfairly penalize them. + * This used to not penalise other tries because loss + * can be bursty, but it's then not accurately keeping + * the avg TX time and EWMA updated. */ if (rc[0].tries) { update_stats(sc, an, frame_size, rc[0].rix, rc[0].tries, - rc[1].rix, rc[1].tries, - rc[2].rix, rc[2].tries, - rc[3].rix, rc[3].tries, short_tries, long_tries, long_tries > rc[0].tries, nframes, nbad); @@ -983,11 +1172,8 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ if (rc[1].tries && finalTSIdx > 0) { update_stats(sc, an, frame_size, rc[1].rix, rc[1].tries, - rc[2].rix, rc[2].tries, - rc[3].rix, rc[3].tries, - 0, 0, short_tries, long_tries, - status, + long_tries > rc[1].tries, nframes, nbad); long_tries -= rc[1].tries; } @@ -995,11 +1181,8 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ if (rc[2].tries && finalTSIdx > 1) { update_stats(sc, an, frame_size, rc[2].rix, rc[2].tries, - rc[3].rix, rc[3].tries, - 0, 0, - 0, 0, short_tries, long_tries, - status, + long_tries > rc[2].tries, nframes, nbad); long_tries -= rc[2].tries; } @@ -1007,11 +1190,8 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ if (rc[3].tries && finalTSIdx > 2) { update_stats(sc, an, frame_size, rc[3].rix, rc[3].tries, - 0, 0, - 0, 0, - 0, 0, short_tries, long_tries, - status, + long_tries > rc[3].tries, nframes, nbad); } } Modified: head/sys/dev/ath/ath_rate/sample/sample.h ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.h Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/ath_rate/sample/sample.h Fri May 15 18:51:20 2020 (r361085) @@ -76,12 +76,11 @@ struct txschedule { }; /* - * for now, we track performance for three different packet - * size buckets + * We track performance for eight different packet size buckets. */ -#define NUM_PACKET_SIZE_BINS 2 +#define NUM_PACKET_SIZE_BINS 7 -static const int packet_size_bins[NUM_PACKET_SIZE_BINS] = { 250, 1600 }; +static const int packet_size_bins[NUM_PACKET_SIZE_BINS] = { 250, 1600, 4096, 8192, 16384, 32768, 65536 }; static inline int bin_to_size(int index) Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/if_ath.c Fri May 15 18:51:20 2020 (r361085) @@ -4301,7 +4301,7 @@ ath_tx_default_comp(struct ath_softc *sc, struct ath_b void ath_tx_update_ratectrl(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_rc_series *rc, struct ath_tx_status *ts, int frmlen, - int nframes, int nbad) + int rc_framelen, int nframes, int nbad) { struct ath_node *an; @@ -4317,9 +4317,11 @@ ath_tx_update_ratectrl(struct ath_softc *sc, struct ie * see about handling it (eg see how many attempts were * made before it got filtered and account for that.) */ + if ((ts->ts_status & HAL_TXERR_FILT) == 0) { ATH_NODE_LOCK(an); - ath_rate_tx_complete(sc, an, rc, ts, frmlen, nframes, nbad); + ath_rate_tx_complete(sc, an, rc, ts, frmlen, rc_framelen, + nframes, nbad); ATH_NODE_UNLOCK(an); } } @@ -4366,7 +4368,9 @@ ath_tx_process_buf_completion(struct ath_softc *sc, st */ ath_tx_update_ratectrl(sc, ni, bf->bf_state.bfs_rc, ts, - bf->bf_state.bfs_pktlen, 1, + bf->bf_state.bfs_pktlen, + bf->bf_state.bfs_pktlen, + 1, (ts->ts_status == 0 ? 0 : 1)); } ath_tx_default_comp(sc, bf, 0); Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/if_ath_misc.h Fri May 15 18:51:20 2020 (r361085) @@ -63,7 +63,8 @@ extern void ath_tx_default_comp(struct ath_softc *sc, int fail); extern void ath_tx_update_ratectrl(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_rc_series *rc, - struct ath_tx_status *ts, int frmlen, int nframes, int nbad); + struct ath_tx_status *ts, int frmlen, int rc_framelen, + int nframes, int nbad); extern int ath_hal_gethangstate(struct ath_hal *ah, uint32_t mask, uint32_t *hangs); Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/if_ath_tx.c Fri May 15 18:51:20 2020 (r361085) @@ -363,7 +363,7 @@ ath_tx_dmasetup(struct ath_softc *sc, struct ath_buf * */ static void ath_tx_chaindesclist(struct ath_softc *sc, struct ath_desc *ds0, - struct ath_buf *bf, int is_aggr, int is_first_subframe, + struct ath_buf *bf, bool is_aggr, int is_first_subframe, int is_last_subframe) { struct ath_hal *ah = sc->sc_ah; @@ -1377,11 +1377,12 @@ ath_tx_setds(struct ath_softc *sc, struct ath_buf *bf) */ static void ath_tx_do_ratelookup(struct ath_softc *sc, struct ath_buf *bf, int tid, - bool is_aggr) + int pktlen, int is_aggr) { uint8_t rate, rix; int try0; int maxdur; // Note: Unused for now + int maxpktlen; if (! bf->bf_state.bfs_doratelookup) return; @@ -1391,7 +1392,7 @@ ath_tx_do_ratelookup(struct ath_softc *sc, struct ath_ ATH_NODE_LOCK(ATH_NODE(bf->bf_node)); ath_rate_findrate(sc, ATH_NODE(bf->bf_node), bf->bf_state.bfs_shpream, - bf->bf_state.bfs_pktlen, tid, is_aggr, &rix, &try0, &rate, &maxdur); + pktlen, tid, is_aggr, &rix, &try0, &rate, &maxdur, &maxpktlen); /* In case MRR is disabled, make sure rc[0] is setup correctly */ bf->bf_state.bfs_rc[0].rix = rix; @@ -1407,6 +1408,7 @@ ath_tx_do_ratelookup(struct ath_softc *sc, struct ath_ sc->sc_lastdatarix = rix; /* for fast frames */ bf->bf_state.bfs_try0 = try0; bf->bf_state.bfs_txrate0 = rate; + bf->bf_state.bfs_rc_maxpktlen = maxpktlen; } /* @@ -1521,7 +1523,7 @@ ath_tx_xmit_normal(struct ath_softc *sc, struct ath_tx bf->bf_state.bfs_txflags |= HAL_TXDESC_CLRDMASK; /* Setup the descriptor before handoff */ - ath_tx_do_ratelookup(sc, bf, tid->tid, false); + ath_tx_do_ratelookup(sc, bf, tid->tid, bf->bf_state.bfs_pktlen, false); ath_tx_calc_duration(sc, bf); ath_tx_calc_protection(sc, bf); ath_tx_set_rtscts(sc, bf); @@ -3096,7 +3098,8 @@ ath_tx_xmit_aggr(struct ath_softc *sc, struct ath_node ath_tx_update_clrdmask(sc, tid, bf); /* Direct dispatch to hardware */ - ath_tx_do_ratelookup(sc, bf, tid->tid, false); + ath_tx_do_ratelookup(sc, bf, tid->tid, bf->bf_state.bfs_pktlen, + false); ath_tx_calc_duration(sc, bf); ath_tx_calc_protection(sc, bf); ath_tx_set_rtscts(sc, bf); @@ -4259,7 +4262,9 @@ ath_tx_normal_comp(struct ath_softc *sc, struct ath_bu */ if (fail == 0 && ((bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) == 0)) ath_tx_update_ratectrl(sc, ni, bf->bf_state.bfs_rc, - ts, bf->bf_state.bfs_pktlen, + ts, + bf->bf_state.bfs_pktlen, + bf->bf_state.bfs_pktlen, 1, (ts->ts_status == 0) ? 0 : 1); ath_tx_default_comp(sc, bf, fail); @@ -4688,15 +4693,11 @@ ath_tx_comp_aggr_error(struct ath_softc *sc, struct at /* * Update rate control - all frames have failed. - * - * XXX use the length in the first frame in the series; - * XXX just so things are consistent for now. - * - * XXX TODO: need to signal this is a large frame no matter what... */ ath_tx_update_ratectrl(sc, ni, bf_first->bf_state.bfs_rc, &bf_first->bf_status.ds_txstat, - bf_first->bf_state.bfs_pktlen, + bf_first->bf_state.bfs_al, + bf_first->bf_state.bfs_rc_maxpktlen, bf_first->bf_state.bfs_nframes, bf_first->bf_state.bfs_nframes); ATH_TX_LOCK(sc); @@ -4845,6 +4846,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath int drops = 0; int nframes = 0, nbad = 0, nf; int pktlen; + int agglen, rc_agglen; /* XXX there's too much on the stack? */ struct ath_rc_series rc[ATH_RC_NUM]; int txseq; @@ -4857,6 +4859,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath * has been completed and freed. */ ts = bf_first->bf_status.ds_txstat; + agglen = bf_first->bf_state.bfs_al; + rc_agglen = bf_first->bf_state.bfs_rc_maxpktlen; TAILQ_INIT(&bf_q); TAILQ_INIT(&bf_cq); @@ -5093,9 +5097,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath * control code. */ if (fail == 0) { - /* XXX TODO: what's pktlen here? */ - ath_tx_update_ratectrl(sc, ni, rc, &ts, pktlen, nframes, - nbad); + ath_tx_update_ratectrl(sc, ni, rc, &ts, agglen, rc_agglen, + nframes, nbad); } /* @@ -5187,6 +5190,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc *sc, struct a ath_tx_update_ratectrl(sc, ni, bf->bf_state.bfs_rc, &bf->bf_status.ds_txstat, bf->bf_state.bfs_pktlen, + bf->bf_state.bfs_pktlen, 1, (ts.ts_status == 0) ? 0 : 1); /* @@ -5359,6 +5363,66 @@ ath_tx_aggr_comp(struct ath_softc *sc, struct ath_buf } /* + * Grab the software queue depth that we COULD transmit. + * + * This includes checks if it's in the BAW, whether it's a frame + * that is supposed to be in the BAW. Other checks could be done; + * but for now let's try and avoid doing the whole of ath_tx_form_aggr() + * here. + */ +static int +ath_tx_tid_swq_depth_bytes(struct ath_softc *sc, struct ath_node *an, + struct ath_tid *tid) +{ + struct ath_buf *bf; + struct ieee80211_tx_ampdu *tap; + int nbytes = 0; + + ATH_TX_LOCK_ASSERT(sc); + + tap = ath_tx_get_tx_tid(an, tid->tid); + + /* + * Iterate over each buffer and sum the pkt_len. + * Bail if we exceed ATH_AGGR_MAXSIZE bytes; we won't + * ever queue more than that in a single frame. + */ + TAILQ_FOREACH(bf, &tid->tid_q, bf_list) { + + /* + * TODO: I'm not sure if we're going to hit cases where + * no frames get sent because the list is empty. + */ + + /* Check if it's in the BAW */ + if (tap != NULL && (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, + SEQNO(bf->bf_state.bfs_seqno)))) { + break; + } + + /* Check if it's even supposed to be in the BAW */ + if (! bf->bf_state.bfs_dobaw) { + break; + } + + nbytes += bf->bf_state.bfs_pktlen; + if (nbytes >= ATH_AGGR_MAXSIZE) + break; + + /* + * Check if we're likely going to leak a frame + * as part of a PSPOLL. Break out at this point; + * we're only going to send a single frame anyway. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri May 15 19:24:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3C522FE464; Fri, 15 May 2020 19:24:52 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49Nyz82qgTz4Kc3; Fri, 15 May 2020 19:24:52 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 04FJOoKR087850; Fri, 15 May 2020 12:24:50 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04FJOoQM087849; Fri, 15 May 2020 12:24:50 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005151924.04FJOoQM087849@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361066 - head/usr.sbin/jail In-Reply-To: <0c6939cc-7f8a-d2fd-9da1-63eb641815e3@FreeBSD.org> To: Ryan Moeller Date: Fri, 15 May 2020 12:24:50 -0700 (PDT) CC: Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49Nyz82qgTz4Kc3 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.97 / 15.00]; NEURAL_HAM_MEDIUM(-0.97)[-0.969,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 19:24:52 -0000 > On 5/15/20 6:18 AM, Mateusz Piotrowski wrote: > > > On 5/15/20 1:38 AM, Ryan Moeller wrote: > >> Author: freqlabs > >> Date: Thu May 14 23:38:11 2020 > >> New Revision: 361066 > >> URL: https://svnweb.freebsd.org/changeset/base/361066 > >> > >> Log: > >> jail: Add exec.prepare and exec.release command hooks > >> > >> This change introduces new jail command hooks that run before and after any > >> other actions. > > Should it go into RELNOTES? > I'm not sure what all the criteria are for relnotes. > The committer's guide makes it seem like relnotes is for breaking > changes, which this is not. Please could you point at which specific language in the commiters guide makes you believe that the RELNOTES are for breaking changes? RELNOTES should be for all changes that have user visible impact of any type. > -Ryan -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri May 15 20:03:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CFB22FF606; Fri, 15 May 2020 20:03:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Nzr93Hzgz4P5f; Fri, 15 May 2020 20:03:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C53C1ECA; Fri, 15 May 2020 20:03:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FK3rJm059932; Fri, 15 May 2020 20:03:53 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FK3rGT059931; Fri, 15 May 2020 20:03:53 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005152003.04FK3rGT059931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 15 May 2020 20:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361087 - head/sys/dev/ath/ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath/ath_rate/sample X-SVN-Commit-Revision: 361087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 20:03:53 -0000 Author: adrian Date: Fri May 15 20:03:53 2020 New Revision: 361087 URL: https://svnweb.freebsd.org/changeset/base/361087 Log: [ath] [ath_rate_sample] le oops, trim out an #if 1 that I didn't fully delete. Cool, so now I know it's about 3 weeks between starting on freebsd coding and breaking the build again. Queue dunce cap. Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Fri May 15 20:01:30 2020 (r361086) +++ head/sys/dev/ath/ath_rate/sample/sample.c Fri May 15 20:03:53 2020 (r361087) @@ -358,7 +358,6 @@ pick_best_rate(struct ath_node *an, const HAL_RATE_TAB if (best_rate_pct > (pct + 50)) continue; } -#if 1 /* * For non-MCS rates, use the current average txtime for * comparison. From owner-svn-src-head@freebsd.org Fri May 15 20:12:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC3DB2FFA5A; Fri, 15 May 2020 20:12:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P0234cjbz4PqB; Fri, 15 May 2020 20:12:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from Ryans-MBP.attlocal.net (unknown [IPv6:2600:1700:358a:c660:904d:8f18:1bde:14ec]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: freqlabs/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 561C61DFF2; Fri, 15 May 2020 20:12:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Subject: Re: svn commit: r361066 - head/usr.sbin/jail To: rgrimes@freebsd.org, Ryan Moeller Cc: Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005151924.04FJOoQM087849@gndrsh.dnsmgr.net> From: Ryan Moeller Message-ID: Date: Fri, 15 May 2020 16:12:26 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <202005151924.04FJOoQM087849@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 20:12:27 -0000 On 5/15/20 3:24 PM, Rodney W. Grimes wrote: >> On 5/15/20 6:18 AM, Mateusz Piotrowski wrote: >> >>> On 5/15/20 1:38 AM, Ryan Moeller wrote: >>>> Author: freqlabs >>>> Date: Thu May 14 23:38:11 2020 >>>> New Revision: 361066 >>>> URL: https://svnweb.freebsd.org/changeset/base/361066 >>>> >>>> Log: >>>> jail: Add exec.prepare and exec.release command hooks >>>> >>>> This change introduces new jail command hooks that run before and after any >>>> other actions. >>> Should it go into RELNOTES? >> I'm not sure what all the criteria are for relnotes. >> The committer's guide makes it seem like relnotes is for breaking >> changes, which this is not. > Please could you point at which specific language in the commiters > guide makes you believe that the RELNOTES are for breaking changes? Every mention of "release notes" in the document is in the context of deprecating, removing, or breaking things, with one exception: > Relnotes:    If the change is a candidate for inclusion in the release notes for the next release from the branch, set to yes. > > RELNOTES should be for all changes that have user visible impact > of any type. > >> -Ryan From owner-svn-src-head@freebsd.org Fri May 15 20:17:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F5D72FFC2F; Fri, 15 May 2020 20:17:26 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49P07p2PGyz4Q7n; Fri, 15 May 2020 20:17:26 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 04FKHOoH088161; Fri, 15 May 2020 13:17:24 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04FKHOcg088160; Fri, 15 May 2020 13:17:24 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005152017.04FKHOcg088160@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361066 - head/usr.sbin/jail In-Reply-To: To: Ryan Moeller Date: Fri, 15 May 2020 13:17:24 -0700 (PDT) CC: rgrimes@freebsd.org, Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49P07p2PGyz4Q7n X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.96 / 15.00]; NEURAL_HAM_MEDIUM(-0.96)[-0.964,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 20:17:26 -0000 > On 5/15/20 3:24 PM, Rodney W. Grimes wrote: > > >> On 5/15/20 6:18 AM, Mateusz Piotrowski wrote: > >> > >>> On 5/15/20 1:38 AM, Ryan Moeller wrote: > >>>> Author: freqlabs > >>>> Date: Thu May 14 23:38:11 2020 > >>>> New Revision: 361066 > >>>> URL: https://svnweb.freebsd.org/changeset/base/361066 > >>>> > >>>> Log: > >>>> jail: Add exec.prepare and exec.release command hooks > >>>> > >>>> This change introduces new jail command hooks that run before and after any > >>>> other actions. > >>> Should it go into RELNOTES? > >> I'm not sure what all the criteria are for relnotes. > >> The committer's guide makes it seem like relnotes is for breaking > >> changes, which this is not. > > Please could you point at which specific language in the commiters > > guide makes you believe that the RELNOTES are for breaking changes? > > Every mention of "release notes" in the document is in the context of > deprecating, removing, > or breaking things, with one exception: Fair, there should be a section on "new features and enhnacements" which is laking. However if one reads a release notes from a shipping version it becomes clear that the actual majority of the text in it is "new stuff." > > Relnotes:??? If the change is a candidate for inclusion in the > release notes for the next release from the branch, set to yes. > > > > RELNOTES should be for all changes that have user visible impact > > of any type. > > > >> -Ryan > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri May 15 20:24:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6BA32FFEBD; Fri, 15 May 2020 20:24:08 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P0HX4LxJz4QXb; Fri, 15 May 2020 20:24:08 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 907F122A5; Fri, 15 May 2020 20:24:08 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FKO8Xg072456; Fri, 15 May 2020 20:24:08 GMT (envelope-from csjp@FreeBSD.org) Received: (from csjp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FKO80W072455; Fri, 15 May 2020 20:24:08 GMT (envelope-from csjp@FreeBSD.org) Message-Id: <202005152024.04FKO80W072455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: csjp set sender to csjp@FreeBSD.org using -f From: "Christian S.J. Peron" Date: Fri, 15 May 2020 20:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361089 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: csjp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 361089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 20:24:08 -0000 Author: csjp Date: Fri May 15 20:24:08 2020 New Revision: 361089 URL: https://svnweb.freebsd.org/changeset/base/361089 Log: Remove references to pdwait4(2). This syscall was never implemented and its presence just creates confusion. Discussed with: cem MFC after: 1 week Modified: head/share/man/man4/procdesc.4 Modified: head/share/man/man4/procdesc.4 ============================================================================== --- head/share/man/man4/procdesc.4 Fri May 15 20:03:57 2020 (r361088) +++ head/share/man/man4/procdesc.4 Fri May 15 20:24:08 2020 (r361089) @@ -1,3 +1,4 @@ +W .\" .\" Copyright (c) 2013 Robert N. M. Watson .\" All rights reserved. @@ -40,16 +41,14 @@ is a file-descriptor-oriented interface to process signalling and control, which supplements historic .Ux -.Xr fork 2 , -.Xr kill 2 , +.Xr fork 2 and -.Xr wait4 2 +.Xr kill 2 , primitives with new system calls such as -.Xr pdfork 2 , -.Xr pdkill 2 , +.Xr pdfork 2 and -.Xr pdwait4 2 . +.Xr pdkill 2 , .Nm is designed for use with .Xr capsicum 4 , @@ -65,7 +64,6 @@ Given a process descriptor, it is possible to query it .Xr pdfork 2 , .Xr pdgetpid 2 , .Xr pdkill 2 , -.Xr pdwait4 2 , .Xr kqueue 2 , .Xr wait4 2 , .Xr capsicum 4 From owner-svn-src-head@freebsd.org Fri May 15 20:26:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF3642D806C; Fri, 15 May 2020 20:26:25 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P0L94qPGz4QpG; Fri, 15 May 2020 20:26:25 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from Ryans-MBP.attlocal.net (unknown [IPv6:2600:1700:358a:c660:904d:8f18:1bde:14ec]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: freqlabs/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 587321E122; Fri, 15 May 2020 20:26:25 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Subject: Re: svn commit: r361066 - head/usr.sbin/jail To: rgrimes@freebsd.org, Ryan Moeller Cc: Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005152017.04FKHOcg088160@gndrsh.dnsmgr.net> From: Ryan Moeller Message-ID: Date: Fri, 15 May 2020 16:26:24 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <202005152017.04FKHOcg088160@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 20:26:25 -0000 On 5/15/20 4:17 PM, Rodney W. Grimes wrote: >> On 5/15/20 3:24 PM, Rodney W. Grimes wrote: >> >>>> On 5/15/20 6:18 AM, Mateusz Piotrowski wrote: >>>> >>>>> On 5/15/20 1:38 AM, Ryan Moeller wrote: >>>>>> Author: freqlabs >>>>>> Date: Thu May 14 23:38:11 2020 >>>>>> New Revision: 361066 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/361066 >>>>>> >>>>>> Log: >>>>>> jail: Add exec.prepare and exec.release command hooks >>>>>> >>>>>> This change introduces new jail command hooks that run before and after any >>>>>> other actions. >>>>> Should it go into RELNOTES? >>>> I'm not sure what all the criteria are for relnotes. >>>> The committer's guide makes it seem like relnotes is for breaking >>>> changes, which this is not. >>> Please could you point at which specific language in the commiters >>> guide makes you believe that the RELNOTES are for breaking changes? >> Every mention of "release notes" in the document is in the context of >> deprecating, removing, >> or breaking things, with one exception: > Fair, there should be a section on "new features and enhnacements" > which is laking. However if one reads a release notes from a shipping > version it becomes clear that the actual majority of the text in it is > "new stuff." Now that I know better, how do I retcon this and other potentially relnoteworthy enhancements I've made? :) >> > Relnotes:??? If the change is a candidate for inclusion in the >> release notes for the next release from the branch, set to yes. >>> RELNOTES should be for all changes that have user visible impact >>> of any type. >>> >>>> -Ryan From owner-svn-src-head@freebsd.org Fri May 15 20:29:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58DCF2D8BBB; Fri, 15 May 2020 20:29:42 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P0Py1SWzz4Qyr; Fri, 15 May 2020 20:29:42 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D63722C2; Fri, 15 May 2020 20:29:42 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FKTgna072738; Fri, 15 May 2020 20:29:42 GMT (envelope-from csjp@FreeBSD.org) Received: (from csjp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FKTg2I072737; Fri, 15 May 2020 20:29:42 GMT (envelope-from csjp@FreeBSD.org) Message-Id: <202005152029.04FKTg2I072737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: csjp set sender to csjp@FreeBSD.org using -f From: "Christian S.J. Peron" Date: Fri, 15 May 2020 20:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361090 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: csjp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 361090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 20:29:42 -0000 Author: csjp Date: Fri May 15 20:29:41 2020 New Revision: 361090 URL: https://svnweb.freebsd.org/changeset/base/361090 Log: Bump revision date to today. MFC after: 1 week Modified: head/share/man/man4/procdesc.4 Modified: head/share/man/man4/procdesc.4 ============================================================================== --- head/share/man/man4/procdesc.4 Fri May 15 20:24:08 2020 (r361089) +++ head/share/man/man4/procdesc.4 Fri May 15 20:29:41 2020 (r361090) @@ -30,7 +30,7 @@ W .\" .\" $FreeBSD$ .\" -.Dd October 14, 2018 +.Dd May 15, 2020 .Dt PROCDESC 4 .Os .Sh NAME From owner-svn-src-head@freebsd.org Fri May 15 21:42:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2FCC2DAEC4; Fri, 15 May 2020 21:42:28 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49P21w24mlz4Vrn; Fri, 15 May 2020 21:42:27 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 04FLgP0g088518; Fri, 15 May 2020 14:42:25 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04FLgPA2088517; Fri, 15 May 2020 14:42:25 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005152142.04FLgPA2088517@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361066 - head/usr.sbin/jail In-Reply-To: To: Ryan Moeller Date: Fri, 15 May 2020 14:42:25 -0700 (PDT) CC: rgrimes@freebsd.org, Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49P21w24mlz4Vrn X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.96 / 15.00]; NEURAL_HAM_MEDIUM(-0.96)[-0.964,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 21:42:28 -0000 > > On 5/15/20 4:17 PM, Rodney W. Grimes wrote: > >> On 5/15/20 3:24 PM, Rodney W. Grimes wrote: > >> > >>>> On 5/15/20 6:18 AM, Mateusz Piotrowski wrote: > >>>> > >>>>> On 5/15/20 1:38 AM, Ryan Moeller wrote: > >>>>>> Author: freqlabs > >>>>>> Date: Thu May 14 23:38:11 2020 > >>>>>> New Revision: 361066 > >>>>>> URL: https://svnweb.freebsd.org/changeset/base/361066 > >>>>>> > >>>>>> Log: > >>>>>> jail: Add exec.prepare and exec.release command hooks > >>>>>> > >>>>>> This change introduces new jail command hooks that run before and after any > >>>>>> other actions. > >>>>> Should it go into RELNOTES? > >>>> I'm not sure what all the criteria are for relnotes. > >>>> The committer's guide makes it seem like relnotes is for breaking > >>>> changes, which this is not. > >>> Please could you point at which specific language in the commiters > >>> guide makes you believe that the RELNOTES are for breaking changes? > >> Every mention of "release notes" in the document is in the context of > >> deprecating, removing, > >> or breaking things, with one exception: > > Fair, there should be a section on "new features and enhnacements" > > which is laking. However if one reads a release notes from a shipping > > version it becomes clear that the actual majority of the text in it is > > "new stuff." > > Now that I know better, how do I retcon this and other potentially > relnoteworthy enhancements I've made? :) There is a top level file in the src tree called RELNOTES that you can use to ad an entry to describing the change and the revision number. > >> > Relnotes:??? If the change is a candidate for inclusion in the > >> release notes for the next release from the branch, set to yes. > >>> RELNOTES should be for all changes that have user visible impact > >>> of any type. > >>> > >>>> -Ryan > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri May 15 22:55:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1D0D2DC8C3; Fri, 15 May 2020 22:55:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P3f85fpdz4ZM3; Fri, 15 May 2020 22:55:28 +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 BD671417E; Fri, 15 May 2020 22:55:28 +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 04FMtSO2064174; Fri, 15 May 2020 22:55:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FMtSEc064173; Fri, 15 May 2020 22:55:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005152255.04FMtSEc064173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 15 May 2020 22:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361091 - head/tools/tools/crypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tools/tools/crypto X-SVN-Commit-Revision: 361091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 22:55:28 -0000 Author: jhb Date: Fri May 15 22:55:28 2020 New Revision: 361091 URL: https://svnweb.freebsd.org/changeset/base/361091 Log: Remove the ubsecstats tool since ubsec(4) has been removed. Reported by: markj Deleted: head/tools/tools/crypto/ubsecstats.c Modified: head/tools/tools/crypto/Makefile Modified: head/tools/tools/crypto/Makefile ============================================================================== --- head/tools/tools/crypto/Makefile Fri May 15 20:29:41 2020 (r361090) +++ head/tools/tools/crypto/Makefile Fri May 15 22:55:28 2020 (r361091) @@ -27,7 +27,7 @@ # PROGS= cryptocheck cryptotest cryptokeytest cryptostats \ - ubsecstats hifnstats ipsecstats safestats + hifnstats ipsecstats safestats MAN= BINDIR?= /usr/local/bin @@ -38,7 +38,6 @@ LIBADD.cryptocheck+= crypto util LIBADD.cryptokeytest+= crypto # cryptostats: dump statistics kept by the core crypto code -# ubsecstats: print statistics kept by the Broadcom driver # hifnstats: print statistics kept by the HIFN driver # safestats: statistics kept by the SafeNet driver # ipsecstats: print statistics kept by fast ipsec From owner-svn-src-head@freebsd.org Fri May 15 22:55:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C6E12DC923; Fri, 15 May 2020 22:55:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P3fZ1mJ7z4ZT3; Fri, 15 May 2020 22:55:50 +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 1F507417F; Fri, 15 May 2020 22:55:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FMtoaB064233; Fri, 15 May 2020 22:55:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FMtoJQ064232; Fri, 15 May 2020 22:55:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005152255.04FMtoJQ064232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 15 May 2020 22:55:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361092 - head/tools/kerneldoc/subsys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tools/kerneldoc/subsys X-SVN-Commit-Revision: 361092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 22:55:50 -0000 Author: jhb Date: Fri May 15 22:55:49 2020 New Revision: 361092 URL: https://svnweb.freebsd.org/changeset/base/361092 Log: Remove Doxyfile for sys/dev/ubsec since it has been removed. Deleted: head/tools/kerneldoc/subsys/Doxyfile-dev_ubsec From owner-svn-src-head@freebsd.org Fri May 15 22:56:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98CBB2DC9AB; Fri, 15 May 2020 22:56:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P3gv3ZCYz4Zbg; Fri, 15 May 2020 22:56:59 +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 75CEB4180; Fri, 15 May 2020 22:56:59 +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 04FMuxQp064327; Fri, 15 May 2020 22:56:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FMuxMw064326; Fri, 15 May 2020 22:56:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005152256.04FMuxMw064326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 15 May 2020 22:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361093 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 361093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 22:56:59 -0000 Author: jhb Date: Fri May 15 22:56:59 2020 New Revision: 361093 URL: https://svnweb.freebsd.org/changeset/base/361093 Log: Don't remove ubsec(4) manual page for WITHOUT_USB=yes. In head this manpage has been removed entirely, but ubsec(4) is a PCI device and not a USB device. MFC after: 1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri May 15 22:55:49 2020 (r361092) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri May 15 22:56:59 2020 (r361093) @@ -9648,7 +9648,6 @@ OLD_FILES+=usr/share/man/man4/uark.4.gz OLD_FILES+=usr/share/man/man4/uart.4.gz OLD_FILES+=usr/share/man/man4/uath.4.gz OLD_FILES+=usr/share/man/man4/ubsa.4.gz -OLD_FILES+=usr/share/man/man4/ubsec.4.gz OLD_FILES+=usr/share/man/man4/ubser.4.gz OLD_FILES+=usr/share/man/man4/ubtbcmfw.4.gz OLD_FILES+=usr/share/man/man4/uchcom.4.gz From owner-svn-src-head@freebsd.org Fri May 15 23:44:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D3E82DDA4A; Fri, 15 May 2020 23:44:53 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P4l939rXz4cn7; Fri, 15 May 2020 23:44:53 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63A194AB2; Fri, 15 May 2020 23:44:53 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FNirTf094472; Fri, 15 May 2020 23:44:53 GMT (envelope-from csjp@FreeBSD.org) Received: (from csjp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FNir8F094471; Fri, 15 May 2020 23:44:53 GMT (envelope-from csjp@FreeBSD.org) Message-Id: <202005152344.04FNir8F094471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: csjp set sender to csjp@FreeBSD.org using -f From: "Christian S.J. Peron" Date: Fri, 15 May 2020 23:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361094 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: csjp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 361094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 23:44:53 -0000 Author: csjp Date: Fri May 15 23:44:52 2020 New Revision: 361094 URL: https://svnweb.freebsd.org/changeset/base/361094 Log: Fix typo that snuck in Reported by: Jose Luis Duran MFC after: 1 week Modified: head/share/man/man4/procdesc.4 Modified: head/share/man/man4/procdesc.4 ============================================================================== --- head/share/man/man4/procdesc.4 Fri May 15 22:56:59 2020 (r361093) +++ head/share/man/man4/procdesc.4 Fri May 15 23:44:52 2020 (r361094) @@ -1,4 +1,3 @@ -W .\" .\" Copyright (c) 2013 Robert N. M. Watson .\" All rights reserved. From owner-svn-src-head@freebsd.org Sat May 16 00:28:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 523FE2DE6E1; Sat, 16 May 2020 00:28:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P5j91XCRz4fmQ; Sat, 16 May 2020 00:28:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F60F5241; Sat, 16 May 2020 00:28:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G0SDF7020157; Sat, 16 May 2020 00:28:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G0SChO020155; Sat, 16 May 2020 00:28:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005160028.04G0SChO020155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 16 May 2020 00:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361095 - in head/sys: net netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: net netpfil/pf X-SVN-Commit-Revision: 361095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 00:28:13 -0000 Author: markj Date: Sat May 16 00:28:12 2020 New Revision: 361095 URL: https://svnweb.freebsd.org/changeset/base/361095 Log: pf: Add a new zone for per-table entry counters. Right now we optionally allocate 8 counters per table entry, so in addition to memory consumed by counters, we require 8 pointers worth of space in each entry even when counters are not allocated (the default). Instead, define a UMA zone that returns contiguous per-CPU counter arrays for use in table entries. On amd64 this reduces sizeof(struct pfr_kentry) from 216 to 160. The smaller size also results in better slab efficiency, so memory usage for large tables is reduced by about 28%. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24843 Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf_table.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Fri May 15 23:44:52 2020 (r361094) +++ head/sys/net/pfvar.h Sat May 16 00:28:12 2020 (r361095) @@ -1000,6 +1000,8 @@ struct pfr_addr { enum { PFR_DIR_IN, PFR_DIR_OUT, PFR_DIR_MAX }; enum { PFR_OP_BLOCK, PFR_OP_PASS, PFR_OP_ADDR_MAX, PFR_OP_TABLE_MAX }; +enum { PFR_TYPE_PACKETS, PFR_TYPE_BYTES, PFR_TYPE_MAX }; +#define PFR_NUM_COUNTERS (PFR_DIR_MAX * PFR_OP_ADDR_MAX * PFR_TYPE_MAX) #define PFR_OP_XPASS PFR_OP_ADDR_MAX struct pfr_astats { @@ -1045,10 +1047,12 @@ union sockaddr_union { #endif /* _SOCKADDR_UNION_DEFINED */ struct pfr_kcounters { - counter_u64_t pfrkc_packets[PFR_DIR_MAX][PFR_OP_ADDR_MAX]; - counter_u64_t pfrkc_bytes[PFR_DIR_MAX][PFR_OP_ADDR_MAX]; + counter_u64_t pfrkc_counters; long pfrkc_tzero; }; +#define pfr_kentry_counter(kc, dir, op, t) \ + ((kc)->pfrkc_counters + \ + (dir) * PFR_OP_ADDR_MAX * PFR_TYPE_MAX + (op) * PFR_TYPE_MAX + (t)) SLIST_HEAD(pfr_kentryworkq, pfr_kentry); struct pfr_kentry { Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Fri May 15 23:44:52 2020 (r361094) +++ head/sys/netpfil/pf/pf_table.c Sat May 16 00:28:12 2020 (r361095) @@ -127,6 +127,8 @@ struct pfr_walktree { static MALLOC_DEFINE(M_PFTABLE, "pf_table", "pf(4) tables structures"); VNET_DEFINE_STATIC(uma_zone_t, pfr_kentry_z); #define V_pfr_kentry_z VNET(pfr_kentry_z) +VNET_DEFINE_STATIC(uma_zone_t, pfr_kentry_counter_z); +#define V_pfr_kentry_counter_z VNET(pfr_kentry_counter_z) static struct pf_addr pfr_ffaddr = { .addr32 = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff } @@ -144,12 +146,8 @@ static void pfr_mark_addrs(struct pfr_ktable *); static struct pfr_kentry *pfr_lookup_addr(struct pfr_ktable *, struct pfr_addr *, int); -static bool pfr_create_kentry_counter(struct pfr_kentry *, int, - int); static struct pfr_kentry *pfr_create_kentry(struct pfr_addr *, bool); static void pfr_destroy_kentries(struct pfr_kentryworkq *); -static void pfr_destroy_kentry_counter(struct pfr_kcounters *, - int, int); static void pfr_destroy_kentry(struct pfr_kentry *); static void pfr_insert_kentries(struct pfr_ktable *, struct pfr_kentryworkq *, long); @@ -205,6 +203,9 @@ void pfr_initialize(void) { + V_pfr_kentry_counter_z = uma_zcreate("pf table entry counters", + PFR_NUM_COUNTERS * sizeof(uint64_t), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, UMA_ZONE_PCPU); V_pfr_kentry_z = uma_zcreate("pf table entries", sizeof(struct pfr_kentry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); @@ -217,6 +218,7 @@ pfr_cleanup(void) { uma_zdestroy(V_pfr_kentry_z); + uma_zdestroy(V_pfr_kentry_counter_z); } int @@ -785,27 +787,11 @@ pfr_lookup_addr(struct pfr_ktable *kt, struct pfr_addr return (ke); } -static bool -pfr_create_kentry_counter(struct pfr_kentry *ke, int pfr_dir, int pfr_op) -{ - counter_u64_t c; - - c = counter_u64_alloc(M_NOWAIT); - if (c == NULL) - return (false); - ke->pfrke_counters.pfrkc_packets[pfr_dir][pfr_op] = c; - c = counter_u64_alloc(M_NOWAIT); - if (c == NULL) - return (false); - ke->pfrke_counters.pfrkc_bytes[pfr_dir][pfr_op] = c; - return (true); -} - static struct pfr_kentry * pfr_create_kentry(struct pfr_addr *ad, bool counters) { struct pfr_kentry *ke; - int pfr_dir, pfr_op; + counter_u64_t c; ke = uma_zalloc(V_pfr_kentry_z, M_NOWAIT | M_ZERO); if (ke == NULL) @@ -819,15 +805,14 @@ pfr_create_kentry(struct pfr_addr *ad, bool counters) ke->pfrke_net = ad->pfra_net; ke->pfrke_not = ad->pfra_not; ke->pfrke_counters.pfrkc_tzero = 0; - if (counters) - for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir++) - for (pfr_op = 0; pfr_op < PFR_OP_ADDR_MAX; pfr_op++) { - if (!pfr_create_kentry_counter(ke, pfr_dir, - pfr_op)) { - pfr_destroy_kentry(ke); - return (NULL); - } - } + if (counters) { + c = uma_zalloc_pcpu(V_pfr_kentry_counter_z, M_NOWAIT | M_ZERO); + if (c == NULL) { + pfr_destroy_kentry(ke); + return (NULL); + } + ke->pfrke_counters.pfrkc_counters = c; + } return (ke); } @@ -843,26 +828,12 @@ pfr_destroy_kentries(struct pfr_kentryworkq *workq) } static void -pfr_destroy_kentry_counter(struct pfr_kcounters *kc, int pfr_dir, int pfr_op) +pfr_destroy_kentry(struct pfr_kentry *ke) { counter_u64_t c; - if ((c = kc->pfrkc_packets[pfr_dir][pfr_op]) != NULL) - counter_u64_free(c); - if ((c = kc->pfrkc_bytes[pfr_dir][pfr_op]) != NULL) - counter_u64_free(c); -} - -static void -pfr_destroy_kentry(struct pfr_kentry *ke) -{ - int pfr_dir, pfr_op; - - for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir ++) - for (pfr_op = 0; pfr_op < PFR_OP_ADDR_MAX; pfr_op ++) - pfr_destroy_kentry_counter(&ke->pfrke_counters, - pfr_dir, pfr_op); - + if ((c = ke->pfrke_counters.pfrkc_counters) != NULL) + uma_zfree_pcpu(V_pfr_kentry_counter_z, c); uma_zfree(V_pfr_kentry_z, ke); } @@ -935,28 +906,19 @@ pfr_clean_node_mask(struct pfr_ktable *kt, } static void -pfr_clear_kentry_counters(struct pfr_kentry *p, int pfr_dir, int pfr_op) -{ - counter_u64_zero(p->pfrke_counters.pfrkc_packets[pfr_dir][pfr_op]); - counter_u64_zero(p->pfrke_counters.pfrkc_bytes[pfr_dir][pfr_op]); -} - -static void pfr_clstats_kentries(struct pfr_ktable *kt, struct pfr_kentryworkq *workq, long tzero, int negchange) { struct pfr_kentry *p; - int pfr_dir, pfr_op; + int i; SLIST_FOREACH(p, workq, pfrke_workq) { if (negchange) p->pfrke_not = !p->pfrke_not; if ((kt->pfrkt_flags & PFR_TFLAG_COUNTERS) != 0) - for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir++) - for (pfr_op = 0; pfr_op < PFR_OP_ADDR_MAX; - pfr_op++) - pfr_clear_kentry_counters(p, pfr_dir, - pfr_op); + for (i = 0; i < PFR_NUM_COUNTERS; i++) + counter_u64_zero( + p->pfrke_counters.pfrkc_counters + i); p->pfrke_counters.pfrkc_tzero = tzero; } } @@ -1077,12 +1039,12 @@ pfr_copyout_astats(struct pfr_astats *as, const struct return; } - for (dir = 0; dir < PFR_DIR_MAX; dir ++) { + for (dir = 0; dir < PFR_DIR_MAX; dir++) { for (op = 0; op < PFR_OP_ADDR_MAX; op ++) { - as->pfras_packets[dir][op] = - counter_u64_fetch(kc->pfrkc_packets[dir][op]); - as->pfras_bytes[dir][op] = - counter_u64_fetch(kc->pfrkc_bytes[dir][op]); + as->pfras_packets[dir][op] = counter_u64_fetch( + pfr_kentry_counter(kc, dir, op, PFR_TYPE_PACKETS)); + as->pfras_bytes[dir][op] = counter_u64_fetch( + pfr_kentry_counter(kc, dir, op, PFR_TYPE_BYTES)); } } } @@ -2147,10 +2109,10 @@ pfr_update_stats(struct pfr_ktable *kt, struct pf_addr counter_u64_add(kt->pfrkt_bytes[dir_out][op_pass], len); if (ke != NULL && op_pass != PFR_OP_XPASS && (kt->pfrkt_flags & PFR_TFLAG_COUNTERS)) { - counter_u64_add(ke->pfrke_counters. - pfrkc_packets[dir_out][op_pass], 1); - counter_u64_add(ke->pfrke_counters. - pfrkc_bytes[dir_out][op_pass], len); + counter_u64_add(pfr_kentry_counter(&ke->pfrke_counters, + dir_out, op_pass, PFR_TYPE_PACKETS), 1); + counter_u64_add(pfr_kentry_counter(&ke->pfrke_counters, + dir_out, op_pass, PFR_TYPE_BYTES), len); } } From owner-svn-src-head@freebsd.org Sat May 16 01:50:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE4BC2DFD7F; Sat, 16 May 2020 01:50:28 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P7X44RR8z3FLP; Sat, 16 May 2020 01:50:28 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F18860F9; Sat, 16 May 2020 01:50:28 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G1oSBf069144; Sat, 16 May 2020 01:50:28 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G1oS3J069143; Sat, 16 May 2020 01:50:28 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202005160150.04G1oS3J069143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sat, 16 May 2020 01:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361097 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 361097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 01:50:28 -0000 Author: cperciva Date: Sat May 16 01:50:28 2020 New Revision: 361097 URL: https://svnweb.freebsd.org/changeset/base/361097 Log: Send Lid status notification via devd from acpi_lid_status_update. Some laptops don't send ACPI "lid status changed" notifications upon opening the lid if the system was currently suspended. In r358219 this was partially fixed, updating the "lid_status" variable upon resume even if there is no "status changed" notification from ACPI. Unfortunately the fix in r358219 did not include notifying userland via devd; this causes problems on systems using upowerd (e.g. KDE), since upowerd remembers the most recent devd notification about the lid status rather than querying the sysctl to get the current status. This showed up as two symptoms when KDE's "When laptop lid closed: Sleep" option is set: 1. 50% of the time, closing the lid would not trigger S3 sleep. 2. 50% of the time, plugging/unplugging AC power would trigger S3 sleep. PR: 246477 MFC after: 3 days Modified: head/sys/dev/acpica/acpi_lid.c Modified: head/sys/dev/acpica/acpi_lid.c ============================================================================== --- head/sys/dev/acpica/acpi_lid.c Sat May 16 00:28:49 2020 (r361096) +++ head/sys/dev/acpica/acpi_lid.c Sat May 16 01:50:28 2020 (r361097) @@ -114,6 +114,9 @@ acpi_lid_status_update(struct acpi_lid_softc *sc) /* range check value */ sc->lid_status = lid_status ? 1 : 0; + /* Send notification via devd */ + acpi_UserNotify("Lid", sc->lid_handle, sc->lid_status); + #ifdef EVDEV_SUPPORT /* Notify evdev about lid status */ evdev_push_sw(sc->lid_evdev, SW_LID, lid_status ? 0 : 1); From owner-svn-src-head@freebsd.org Sat May 16 01:56:06 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D75C72DFFD5; Sat, 16 May 2020 01:56:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P7fZ54VHz3FlW; Sat, 16 May 2020 01:56:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A50B062C9; Sat, 16 May 2020 01:56:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G1u6jt074864; Sat, 16 May 2020 01:56:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G1u6DB074863; Sat, 16 May 2020 01:56:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005160156.04G1u6DB074863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 16 May 2020 01:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361098 - head/sys/dev/ath/ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath/ath_rate/sample X-SVN-Commit-Revision: 361098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 01:56:06 -0000 Author: adrian Date: Sat May 16 01:56:06 2020 New Revision: 361098 URL: https://svnweb.freebsd.org/changeset/base/361098 Log: [ath_rate_sample] Fix logic for determining whether to bump up an MCS rate. * Fix formatting, cause reasons; * Put back the "and the chosen rate is within 90% of the current rate" logic; * Ensure the best rate and the current rate aren't the same; this ... * ... fixes the packets_since_switch[] tracking to actually conut how many frames since the rate switched, so now I know how stable stuff is; and * Ensure that MCS can go up to a higher MCS at this or any other spatial stream. My previous quick hack attempt was doing > rather than >= so you had to go to both a higher root MCS rate (0..7) and spatial stream. Eg, you couldn't go from MCS0 (1ss) to MCS8 (2ss) this way. The best rate and switching rate logic still have a bunch more work to do because they're still quite touchy when it comes to average tx time but at least now it's choosing higher rates correctly when it wants to try a higher rate. Tested: * AR9380, STA mode Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Sat May 16 01:50:28 2020 (r361097) +++ head/sys/dev/ath/ath_rate/sample/sample.c Sat May 16 01:56:06 2020 (r361098) @@ -712,10 +712,13 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod * Limit the time measuring the performance of other tx * rates to sample_rate% of the total transmission time. */ - if (sn->sample_tt[size_bin] < average_tx_time * (sn->packets_since_sample[size_bin]*ssc->sample_rate/100)) { + if (sn->sample_tt[size_bin] < + average_tx_time * + (sn->packets_since_sample[size_bin]*ssc->sample_rate/100)) { rix = pick_sample_rate(ssc, an, rt, size_bin); IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, - &an->an_node, "att %d sample_tt %d size %u sample rate %d %s current rate %d %s", + &an->an_node, "att %d sample_tt %d size %u " + "sample rate %d %s current rate %d %s", average_tx_time, sn->sample_tt[size_bin], bin_to_size(size_bin), @@ -776,12 +779,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod printf("cur rix/att %x/%d, best rix/att %x/%d\n", MCS(cur_rix), cur_att, MCS(best_rix), average_tx_time); #endif -#if 0 - if (((MCS(best_rix) & 0x7) > (MCS(cur_rix) & 0x7)) && - (average_tx_time * 10) <= (cur_att * 10)) { -#else - if ((average_tx_time * 10) <= (cur_att * 10)) { -#endif + if ((best_rix != cur_rix) && + ((MCS(best_rix) & 0x7) >= (MCS(cur_rix) & 0x7)) && + (average_tx_time * 9) <= (cur_att * 10)) { IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, "%s: HT: size %d best_rix 0x%x > " @@ -823,7 +823,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod /* * Set the visible txrate for this node. */ - an->an_node.ni_txrate = (rt->info[best_rix].phy == IEEE80211_T_HT) ? MCS(best_rix) : DOT11RATE(best_rix); + an->an_node.ni_txrate = + (rt->info[best_rix].phy == IEEE80211_T_HT) ? + MCS(best_rix) : DOT11RATE(best_rix); } rix = sn->current_rix[size_bin]; sn->packets_since_switch[size_bin]++; From owner-svn-src-head@freebsd.org Sat May 16 02:29:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D2362E0DD0; Sat, 16 May 2020 02:29:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P8Nm2gglz3HGk; Sat, 16 May 2020 02:29:12 +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 56FBC6894; Sat, 16 May 2020 02:29:12 +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 04G2TCGp093673; Sat, 16 May 2020 02:29:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G2TBSd093667; Sat, 16 May 2020 02:29:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005160229.04G2TBSd093667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 16 May 2020 02:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361099 - in head: . lib/libalias/libalias lib/libalias/modules/cuseeme sys/modules/libalias/modules sys/modules/libalias/modules/cuseeme sys/netinet/libalias targets/pseudo/userland/li... X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . lib/libalias/libalias lib/libalias/modules/cuseeme sys/modules/libalias/modules sys/modules/libalias/modules/cuseeme sys/netinet/libalias targets/pseudo/userland/lib tools/build/mk X-SVN-Commit-Revision: 361099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 02:29:12 -0000 Author: emaste Date: Sat May 16 02:29:10 2020 New Revision: 361099 URL: https://svnweb.freebsd.org/changeset/base/361099 Log: libalias: retire cuseeme support The CU-SeeMe videoconferencing client and associated protocol is at this point a historical artifact; there is no need to retain support for this protocol today. Reviewed by: philip, markj, allanjude Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24790 Deleted: head/lib/libalias/modules/cuseeme/ head/sys/modules/libalias/modules/cuseeme/ head/sys/netinet/libalias/alias_cuseeme.c Modified: head/ObsoleteFiles.inc head/lib/libalias/libalias/libalias.conf head/sys/modules/libalias/modules/modules.inc head/sys/netinet/libalias/libalias.3 head/targets/pseudo/userland/lib/Makefile.depend head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat May 16 01:56:06 2020 (r361098) +++ head/ObsoleteFiles.inc Sat May 16 02:29:10 2020 (r361099) @@ -36,6 +36,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20200515: libalias cuseeme protocol support retired +OLD_LIBS+=lib/libalias_cuseeme.so +OLD_FILES+=usr/lib/libalias_cuseeme.a +OLD_FILES+=usr/lib/libalias_cuseeme_p.a + # 20200511: Remove ubsec(4) OLD_FILES+=usr/share/man/man4/ubsec.4.gz Modified: head/lib/libalias/libalias/libalias.conf ============================================================================== --- head/lib/libalias/libalias/libalias.conf Sat May 16 01:56:06 2020 (r361098) +++ head/lib/libalias/libalias/libalias.conf Sat May 16 02:29:10 2020 (r361099) @@ -1,5 +1,4 @@ # $FreeBSD$ -/lib/libalias_cuseeme.so /lib/libalias_ftp.so /lib/libalias_irc.so /lib/libalias_nbt.so Modified: head/sys/modules/libalias/modules/modules.inc ============================================================================== --- head/sys/modules/libalias/modules/modules.inc Sat May 16 01:56:06 2020 (r361098) +++ head/sys/modules/libalias/modules/modules.inc Sat May 16 02:29:10 2020 (r361099) @@ -1,7 +1,6 @@ # $FreeBSD$ MODULES = -MODULES += cuseeme MODULES += dummy MODULES += ftp MODULES += irc Modified: head/sys/netinet/libalias/libalias.3 ============================================================================== --- head/sys/netinet/libalias/libalias.3 Sat May 16 01:56:06 2020 (r361098) +++ head/sys/netinet/libalias/libalias.3 Sat May 16 02:29:10 2020 (r361099) @@ -1051,7 +1051,6 @@ There is a configuration file, .Pa /etc/libalias.conf , with the following contents (by default): .Bd -literal -offset indent -/usr/lib/libalias_cuseeme.so /usr/lib/libalias_ftp.so /usr/lib/libalias_irc.so /usr/lib/libalias_nbt.so Modified: head/targets/pseudo/userland/lib/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/lib/Makefile.depend Sat May 16 01:56:06 2020 (r361098) +++ head/targets/pseudo/userland/lib/Makefile.depend Sat May 16 02:29:10 2020 (r361099) @@ -26,7 +26,6 @@ DIRDEPS = \ lib/geom/virstor \ lib/lib80211 \ lib/libalias/libalias \ - lib/libalias/modules/cuseeme \ lib/libalias/modules/dummy \ lib/libalias/modules/ftp \ lib/libalias/modules/irc \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat May 16 01:56:06 2020 (r361098) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat May 16 02:29:10 2020 (r361099) @@ -7531,7 +7531,6 @@ OLD_FILES+=usr/share/man/man8/pppctl.8.gz .if ${MK_PROFILE} == no OLD_FILES+=usr/lib/lib80211_p.a OLD_FILES+=usr/lib/libBlocksRuntime_p.a -OLD_FILES+=usr/lib/libalias_cuseeme_p.a OLD_FILES+=usr/lib/libalias_dummy_p.a OLD_FILES+=usr/lib/libalias_ftp_p.a OLD_FILES+=usr/lib/libalias_irc_p.a From owner-svn-src-head@freebsd.org Sat May 16 03:33:29 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6713D2E3021; Sat, 16 May 2020 03:33:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P9px29sLz3LmK; Sat, 16 May 2020 03:33:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4601A767C; Sat, 16 May 2020 03:33:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G3XT3P037709; Sat, 16 May 2020 03:33:29 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G3XTht037708; Sat, 16 May 2020 03:33:29 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005160333.04G3XTht037708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 16 May 2020 03:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361102 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 361102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 03:33:29 -0000 Author: jhibbits Date: Sat May 16 03:33:28 2020 New Revision: 361102 URL: https://svnweb.freebsd.org/changeset/base/361102 Log: powerpc/qoriq: Add more devices to config for desktop usage The most likely users of the QORIQ64 config nowadays are users of AmigaOne X5000 systems, which are desktops. They need a framebuffer and keyboard/mouse, so add these to the config so it works by default once drm-current-kmod is installed. Modified: head/sys/powerpc/conf/QORIQ64 Modified: head/sys/powerpc/conf/QORIQ64 ============================================================================== --- head/sys/powerpc/conf/QORIQ64 Sat May 16 02:43:27 2020 (r361101) +++ head/sys/powerpc/conf/QORIQ64 Sat May 16 03:33:28 2020 (r361102) @@ -113,3 +113,10 @@ device ehci device umass device usb device vlan + +# Desktop related +device vt +device fbd +options KBD_INSTALL_CDEV +device ukbd +device ums From owner-svn-src-head@freebsd.org Sat May 16 03:45:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96B672E34EE; Sat, 16 May 2020 03:45:16 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PB4X3XhXz3MJb; Sat, 16 May 2020 03:45:16 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74D207875; Sat, 16 May 2020 03:45:16 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G3jGX0044103; Sat, 16 May 2020 03:45:16 GMT (envelope-from csjp@FreeBSD.org) Received: (from csjp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G3jGgj044101; Sat, 16 May 2020 03:45:16 GMT (envelope-from csjp@FreeBSD.org) Message-Id: <202005160345.04G3jGgj044101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: csjp set sender to csjp@FreeBSD.org using -f From: "Christian S.J. Peron" Date: Sat, 16 May 2020 03:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361103 - in head/sys: kern security/audit X-SVN-Group: head X-SVN-Commit-Author: csjp X-SVN-Commit-Paths: in head/sys: kern security/audit X-SVN-Commit-Revision: 361103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 03:45:16 -0000 Author: csjp Date: Sat May 16 03:45:15 2020 New Revision: 361103 URL: https://svnweb.freebsd.org/changeset/base/361103 Log: Add BSM record conversion for a number of syscalls: - thr_kill(2) and thr_exit(2) generally (no argument auditing here. - A set of syscalls for the process descriptor family, specifically: pdfork(2), pdgetpid(2) and pdkill(2) For these syscalls, audit the file descriptor. In the case of pdfork(2) a pointer to an integer (file descriptor) is passed in as an argument. We audit the post initialized file descriptor (not the random garbage that would have been passed in). We will also audit the child process which was created from the fork operation (similar to what is done for the fork(2) syscall). pdkill(2) we audit the signal value and fd, and finally pdgetpid(2) just the file descriptor: - Following is a sample of the produced audit trails: header,111,11,pdfork(2),0,Sat May 16 03:07:50 2020, + 394 msec argument,0,0x39d,child PID argument,2,0x2,flags argument,1,0x8,fd subject,root,root,0,root,0,924,0,0,0.0.0.0 return,success,925 header,79,11,pdgetpid(2),0,Sat May 16 03:07:50 2020, + 394 msec argument,1,0x8,fd subject,root,root,0,root,0,924,0,0,0.0.0.0 return,success,0 trailer,79 header,135,11,pdkill(2),0,Sat May 16 03:07:50 2020, + 395 msec argument,1,0x8,fd argument,2,0xf,signal process_ex,root,root,0,root,0,925,0,0,0.0.0.0 subject,root,root,0,root,0,924,0,0,0.0.0.0 return,success,0 trailer,135 MFC after: 1 week Modified: head/sys/kern/kern_fork.c head/sys/security/audit/audit_bsm.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sat May 16 03:33:28 2020 (r361102) +++ head/sys/kern/kern_fork.c Sat May 16 03:45:15 2020 (r361103) @@ -128,6 +128,7 @@ sys_pdfork(struct thread *td, struct pdfork_args *uap) fr.fr_pidp = &pid; fr.fr_pd_fd = &fd; fr.fr_pd_flags = uap->flags; + AUDIT_ARG_FFLAGS(uap->flags); /* * It is necessary to return fd by reference because 0 is a valid file * descriptor number, and the child needs to be able to distinguish @@ -909,6 +910,7 @@ fork1(struct thread *td, struct fork_req *fr) fr->fr_pd_flags, fr->fr_pd_fcaps); if (error != 0) goto fail2; + AUDIT_ARG_FD(*fr->fr_pd_fd); } mem_charged = 0; Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Sat May 16 03:33:28 2020 (r361102) +++ head/sys/security/audit/audit_bsm.c Sat May 16 03:45:15 2020 (r361103) @@ -1317,6 +1317,38 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_rec UPATH1_VNODE1_TOKENS; break; + case AUE_PDKILL: + if (ARG_IS_VALID(kar, ARG_FD)) { + tok = au_to_arg32(1, "fd", ar->ar_arg_fd); + kau_write(rec, tok); + } + if (ARG_IS_VALID(kar, ARG_SIGNUM)) { + tok = au_to_arg32(2, "signal", ar->ar_arg_signum); + kau_write(rec, tok); + } + PROCESS_PID_TOKENS(1); + break; + case AUE_PDFORK: + if (ARG_IS_VALID(kar, ARG_PID)) { + tok = au_to_arg32(0, "child PID", ar->ar_arg_pid); + kau_write(rec, tok); + } + if (ARG_IS_VALID(kar, ARG_FFLAGS)) { + tok = au_to_arg32(2, "flags", ar->ar_arg_fflags); + kau_write(rec, tok); + } + if (ARG_IS_VALID(kar, ARG_FD)) { + tok = au_to_arg32(1, "fd", ar->ar_arg_fd); + kau_write(rec, tok); + } + break; + case AUE_PDGETPID: + if (ARG_IS_VALID(kar, ARG_FD)) { + tok = au_to_arg32(1, "fd", ar->ar_arg_fd); + kau_write(rec, tok); + } + break; + case AUE_PROCCTL: if (ARG_IS_VALID(kar, ARG_VALUE)) { tok = au_to_arg32(1, "idtype", ar->ar_arg_value); @@ -1747,6 +1779,8 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_rec break; case AUE_THR_NEW: + case AUE_THR_KILL: + case AUE_THR_EXIT: break; case AUE_NULL: From owner-svn-src-head@freebsd.org Sat May 16 03:52:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E70E2E381B; Sat, 16 May 2020 03:52:30 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PBDt3nYrz3Mkt; Sat, 16 May 2020 03:52:30 +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 7BE3C7A50; Sat, 16 May 2020 03:52:30 +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 04G3qUtL050083; Sat, 16 May 2020 03:52:30 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G3qUSx050082; Sat, 16 May 2020 03:52:30 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005160352.04G3qUSx050082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 16 May 2020 03:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361104 - head/contrib/elftoolchain/libelf X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/contrib/elftoolchain/libelf X-SVN-Commit-Revision: 361104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 03:52:30 -0000 Author: jhibbits Date: Sat May 16 03:52:30 2020 New Revision: 361104 URL: https://svnweb.freebsd.org/changeset/base/361104 Log: elftoolchain: Add powerpc64 definition to elftoolchain config powerpc is already in place, but powerpc64 is needed separately. Modified: head/contrib/elftoolchain/libelf/_libelf_config.h Modified: head/contrib/elftoolchain/libelf/_libelf_config.h ============================================================================== --- head/contrib/elftoolchain/libelf/_libelf_config.h Sat May 16 03:45:15 2020 (r361103) +++ head/contrib/elftoolchain/libelf/_libelf_config.h Sat May 16 03:52:30 2020 (r361104) @@ -91,6 +91,12 @@ #endif #define LIBELF_CLASS ELFCLASS32 +#elif defined(__powerpc64__) + +#define LIBELF_ARCH EM_PPC64 +#define LIBELF_BYTEORDER ELFDATA2MSB +#define LIBELF_CLASS ELFCLASS64 + #elif defined(__powerpc__) #define LIBELF_ARCH EM_PPC From owner-svn-src-head@freebsd.org Sat May 16 04:52:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84C782E5044; Sat, 16 May 2020 04:52:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PCZ62tbDz3Qpm; Sat, 16 May 2020 04:52:30 +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 5E50F8676; Sat, 16 May 2020 04:52:30 +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 04G4qU1t088210; Sat, 16 May 2020 04:52:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G4qUoN088209; Sat, 16 May 2020 04:52:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005160452.04G4qUoN088209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 16 May 2020 04:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361105 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 361105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 04:52:30 -0000 Author: kevans Date: Sat May 16 04:52:29 2020 New Revision: 361105 URL: https://svnweb.freebsd.org/changeset/base/361105 Log: procctl(2): correct a minor cut-n-pasto This is clearly describing PROC_PROTMAX_FORCE_DISABLE, rather than PROC_ASL_FORCE_DISABLE. Submitted by: sigsys@gmail.com Modified: head/lib/libc/sys/procctl.2 Modified: head/lib/libc/sys/procctl.2 ============================================================================== --- head/lib/libc/sys/procctl.2 Sat May 16 03:52:30 2020 (r361104) +++ head/lib/libc/sys/procctl.2 Sat May 16 04:52:29 2020 (r361105) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 25, 2020 +.Dd May 16, 2020 .Dt PROCCTL 2 .Os .Sh NAME @@ -128,7 +128,7 @@ Enables implicit PROT_MAX application, even if it is disabled system-wide by the sysctl .Va vm.imply_prot_max . The image flag might still prevent the enablement. -.It Dv PROC_ASLR_FORCE_DISABLE +.It Dv PROC_PROTMAX_FORCE_DISABLE Request that implicit application of PROT_MAX be disabled. Same notes as for .Dv PROC_PROTMAX_FORCE_ENABLE From owner-svn-src-head@freebsd.org Sat May 16 05:07:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DFCC2E556D; Sat, 16 May 2020 05:07:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PCvk6xx5z3wjX; Sat, 16 May 2020 05:07:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9D31887E; Sat, 16 May 2020 05:07:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G57kic094404; Sat, 16 May 2020 05:07:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G57k31094400; Sat, 16 May 2020 05:07:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005160507.04G57k31094400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 16 May 2020 05:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361106 - in head/sys/dev/ath: . ath_rate/amrr ath_rate/onoe ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: in head/sys/dev/ath: . ath_rate/amrr ath_rate/onoe ath_rate/sample X-SVN-Commit-Revision: 361106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 05:07:47 -0000 Author: adrian Date: Sat May 16 05:07:45 2020 New Revision: 361106 URL: https://svnweb.freebsd.org/changeset/base/361106 Log: [ath_rate_sample] Limit the tx schedules for A-MPDU ; don't take short retries into account and remove the requirement that the MCS rate is "higher" if we're considering a new rate. Ok, another fun one. * In order for reliable non-software retried higher MCS rates, the TX schedules (inconsistently!) use hard-coded lower rates at the end of the schedule. Now, hard-coded is a problem because (a) it means that aggregate formation is limited by the SLOWEST rate, so I never formed large AMDU frames for 3 stream rates, and (b) if the AP disables lower rates as base rates, it complains about "unknown rix" every frame you transmit at that rate. So, for now just disable the third and fourth schedule entry for AMPDUs. Now I'm forming 32k and 64k aggregates for the higher density MCS rates much more reliably. It would be much nicer if the rate schedule stuff wasn't fixed but instead I'd just populate ath_rc_series[] when I fetch the rates. This is all a holdover of ye olde pre-11n stuff and I really just need to nuke it. But for now, ye hack. * The check for "is this MCS rate better" based on MCS itself is just garbage. It meant things like going MCS0->7 would be fine, and say 0->8->16 is fine, (as they're equivalent encoding but 1,2,3 spatial streams), BUT it meant going something like MCS7->11 would fail even though it's likely that MCS11 would just be better, both for EWMA/BER and throughput. So for now just use the average tx time. The "right" way for this comparison would be to compare PHY bitrates rather than MCS / rate indexes, but I'm not yet there. The bit rates ARE available in the PHY index, but honestly I have a lot of other cleaning up to here before I think about that. * Don't include the RTS/CTS retry count (and thus time) into the average tx time caluation. It just makes temporarily failures make the rate look bad by QUITE A LOT, as RTS/CTS exchanges are (a) long, and (b) mostly irrelevant to the actual rate being tried. If we keep hitting RTS/CTS failures then there's something ELSE wrong on the channel, not our selected rate. Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c head/sys/dev/ath/ath_rate/onoe/onoe.c head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athrate.h Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c ============================================================================== --- head/sys/dev/ath/ath_rate/amrr/amrr.c Sat May 16 04:52:29 2020 (r361105) +++ head/sys/dev/ath/ath_rate/amrr/amrr.c Sat May 16 05:07:45 2020 (r361106) @@ -128,7 +128,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod */ void ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an, - uint8_t rix0, struct ath_rc_series *rc) + uint8_t rix0, int is_aggr, struct ath_rc_series *rc) { struct amrr_node *amn = ATH_NODE_AMRR(an); Modified: head/sys/dev/ath/ath_rate/onoe/onoe.c ============================================================================== --- head/sys/dev/ath/ath_rate/onoe/onoe.c Sat May 16 04:52:29 2020 (r361105) +++ head/sys/dev/ath/ath_rate/onoe/onoe.c Sat May 16 05:07:45 2020 (r361106) @@ -136,7 +136,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod */ void ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an, - uint8_t rix0, struct ath_rc_series *rc) + uint8_t rix0, int is_aggr, struct ath_rc_series *rc) { struct onoe_node *on = ATH_NODE_ONOE(an); Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Sat May 16 04:52:29 2020 (r361105) +++ head/sys/dev/ath/ath_rate/sample/sample.c Sat May 16 05:07:45 2020 (r361106) @@ -168,7 +168,7 @@ static int ath_rate_sample_max_4ms_framelen[4][32] = { */ static int ath_rate_sample_find_min_pktlength(struct ath_softc *sc, - struct ath_node *an, uint8_t rix0) + struct ath_node *an, uint8_t rix0, int is_aggr) { #define MCS_IDX(ix) (rt->info[ix].dot11Rate) const HAL_RATE_TABLE *rt = sc->sc_currates; @@ -196,6 +196,24 @@ ath_rate_sample_find_min_pktlength(struct ath_softc *s * is not zero. * * Note: assuming all four PHYs are HT! + * + * XXX TODO: right now I hardcode here and in getxtxrates() that + * rates 2 and 3 in the tx schedule are ignored. This is important + * for forming larger aggregates because right now (a) the tx schedule + * per rate is fixed, and (b) reliable packet transmission at those + * higher rates kinda needs a lower MCS rate in there somewhere. + * However, this means we can only form shorter aggregates. + * If we've negotiated aggregation then we can actually just + * rely on software retransmit rather than having things fall + * back to like MCS0/1 in hardware, and rate control will hopefully + * do the right thing. + * + * Once the whole rate schedule is passed into ath_rate_findrate(), + * the ath_rc_series is populated ,the fixed tx schedule stuff + * is removed AND getxtxrates() is removed then we can remove this + * check as it can just NOT populate t2/t3. It also means + * probing can actually use rix0 for probeing and rix1 for the + * current best rate.. */ if (sched->t0 != 0) { max_pkt_length = MIN(max_pkt_length, @@ -205,11 +223,11 @@ ath_rate_sample_find_min_pktlength(struct ath_softc *s max_pkt_length = MIN(max_pkt_length, ath_rate_sample_max_4ms_framelen[idx][MCS_IDX(sched->r1)]); } - if (sched->t2 != 0) { + if (sched->t2 != 0 && (! is_aggr)) { max_pkt_length = MIN(max_pkt_length, ath_rate_sample_max_4ms_framelen[idx][MCS_IDX(sched->r2)]); } - if (sched->t3 != 0) { + if (sched->t3 != 0 && (! is_aggr)) { max_pkt_length = MIN(max_pkt_length, ath_rate_sample_max_4ms_framelen[idx][MCS_IDX(sched->r3)]); } @@ -691,7 +709,8 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod * need to potentially update our maximum packet length * and size_bin if we're doing 11n rates. */ - max_pkt_len = ath_rate_sample_find_min_pktlength(sc, an, best_rix); + max_pkt_len = ath_rate_sample_find_min_pktlength(sc, an, best_rix, + is_aggr); if (max_pkt_len > 0) { #if 0 device_printf(sc->sc_dev, @@ -769,9 +788,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod int cur_rix = sn->current_rix[size_bin]; int cur_att = sn->stats[size_bin][cur_rix].average_tx_time; /* - * If the node is HT, upgrade it if the MCS rate without - * the stream is higher and the average tx time is - * within 10% of the current rate. It can fail a little. + * If the node is HT, it if the rate isn't the + * same and the average tx time is within 10% + * of the current rate. It can fail a little. * * This is likely not optimal! */ @@ -780,7 +799,6 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod MCS(cur_rix), cur_att, MCS(best_rix), average_tx_time); #endif if ((best_rix != cur_rix) && - ((MCS(best_rix) & 0x7) >= (MCS(cur_rix) & 0x7)) && (average_tx_time * 9) <= (cur_att * 10)) { IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, @@ -864,7 +882,7 @@ done: */ void ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an, - uint8_t rix0, struct ath_rc_series *rc) + uint8_t rix0, int is_aggr, struct ath_rc_series *rc) { struct sample_node *sn = ATH_NODE_SAMPLE(an); const struct txschedule *sched = &sn->sched[rix0]; @@ -881,8 +899,13 @@ ath_rate_getxtxrates(struct ath_softc *sc, struct ath_ rc[0].tries = sched->t0; rc[1].tries = sched->t1; - rc[2].tries = sched->t2; - rc[3].tries = sched->t3; + + if (is_aggr) { + rc[2].tries = rc[3].tries = 0; + } else { + rc[2].tries = sched->t2; + rc[3].tries = sched->t3; + } } void @@ -940,8 +963,14 @@ update_stats(struct ath_softc *sc, struct ath_node *an if (status != 0) nbad = nframes; - tt = calc_usecs_unicast_packet(sc, size, rix0, short_tries, - MIN(tries0, tries) - 1, is_ht40); + /* + * Ignore short tries count as contributing to failure. + * Right now there's no way to know if it's part of any + * given rate attempt, and outside of the RTS/CTS management + * rate, it doesn't /really/ help. + */ + tt = calc_usecs_unicast_packet(sc, size, rix0, + 0 /* short_tries */, MIN(tries0, tries) - 1, is_ht40); tries_so_far = tries0; if (sn->stats[size_bin][rix0].total_packets < ssc->smoothing_minpackets) { Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sat May 16 04:52:29 2020 (r361105) +++ head/sys/dev/ath/if_ath_tx.c Sat May 16 05:07:45 2020 (r361106) @@ -1401,7 +1401,7 @@ ath_tx_do_ratelookup(struct ath_softc *sc, struct ath_ if (bf->bf_state.bfs_ismrr && try0 != ATH_TXMAXTRY) ath_rate_getxtxrates(sc, ATH_NODE(bf->bf_node), rix, - bf->bf_state.bfs_rc); + is_aggr, bf->bf_state.bfs_rc); ATH_NODE_UNLOCK(ATH_NODE(bf->bf_node)); sc->sc_txrix = rix; /* for LED blinking */ Modified: head/sys/dev/ath/if_athrate.h ============================================================================== --- head/sys/dev/ath/if_athrate.h Sat May 16 04:52:29 2020 (r361105) +++ head/sys/dev/ath/if_athrate.h Sat May 16 05:07:45 2020 (r361106) @@ -125,7 +125,7 @@ void ath_rate_newassoc(struct ath_softc *, struct ath_ * Return the four TX rate index and try counts for the current data packet. */ void ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an, - uint8_t rix0, struct ath_rc_series *rc); + uint8_t rix0, int is_aggr, struct ath_rc_series *rc); /* * Return the transmit info for a data packet. If multi-rate state From owner-svn-src-head@freebsd.org Sat May 16 06:09:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E1402E6C72; Sat, 16 May 2020 06:09:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PFGs1sJVz40Ht; Sat, 16 May 2020 06:09:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B2D29421; Sat, 16 May 2020 06:09:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G69P6r033044; Sat, 16 May 2020 06:09:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G69PIW033043; Sat, 16 May 2020 06:09:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005160609.04G69PIW033043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 16 May 2020 06:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361107 - head/tools/tools/ath/athratestats X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/tools/ath/athratestats X-SVN-Commit-Revision: 361107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 06:09:25 -0000 Author: adrian Date: Sat May 16 06:09:24 2020 New Revision: 361107 URL: https://svnweb.freebsd.org/changeset/base/361107 Log: [ath] ok ok, fix the indenting now that I have 5 column packet sizes. Now things line up nicely again. There's a lot of them, and I don't have a long enough screen right now, but they at least line up right. Modified: head/tools/tools/ath/athratestats/main.c Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Sat May 16 05:07:45 2020 (r361106) +++ head/tools/tools/ath/athratestats/main.c Sat May 16 06:09:24 2020 (r361107) @@ -146,7 +146,7 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r sn->sample_tt[y]); PRINTATTR_OFF(COLOR_PAIR(3) | A_BOLD); } - PRINTMSG(" TX Rate TXTOTAL:TXOK EWMA T/ F" + PRINTMSG(" TX Rate TXTOTAL:TXOK EWMA T/ F" " avg last xmit\n"); for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { if ((mask & 1) == 0) @@ -164,7 +164,7 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r else if (sn->stats[y][rix].ewma_pct / 10 < 75) PRINTATTR_ON(COLOR_PAIR(1) | A_BOLD); #endif - PRINTMSG("[%2u %s:%4u] %8ju:%-8ju " + PRINTMSG("[%2u %s:%5u] %8ju:%-8ju " "(%3d.%1d%%) %8ju/%4d %5uuS %u\n", dot11rate(rt, rix), dot11str(rt, rix), From owner-svn-src-head@freebsd.org Sat May 16 14:27:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D4F42F3E47; Sat, 16 May 2020 14:27:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PSKz0dP6z4YyB; Sat, 16 May 2020 14:27:51 +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 0BF2CF49F; Sat, 16 May 2020 14:27:51 +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 04GERo0c051746; Sat, 16 May 2020 14:27:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GERoM1051745; Sat, 16 May 2020 14:27:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005161427.04GERoM1051745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 16 May 2020 14:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361110 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 14:27:51 -0000 Author: hselasky Date: Sat May 16 14:27:50 2020 New Revision: 361110 URL: https://svnweb.freebsd.org/changeset/base/361110 Log: Implement synchronize_srcu_expedited() in the LinuxKPI. Differential Revision: https://reviews.freebsd.org/D24798 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/srcu.h Modified: head/sys/compat/linuxkpi/common/include/linux/srcu.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/srcu.h Sat May 16 09:40:17 2020 (r361109) +++ head/sys/compat/linuxkpi/common/include/linux/srcu.h Sat May 16 14:27:50 2020 (r361110) @@ -49,4 +49,8 @@ extern void srcu_barrier(struct srcu_struct *); extern int init_srcu_struct(struct srcu_struct *); extern void cleanup_srcu_struct(struct srcu_struct *); +#define synchronize_srcu_expedited(srcu) do { \ + synchronize_srcu(srcu); \ +} while (0) + #endif /* _LINUX_SRCU_H_ */ From owner-svn-src-head@freebsd.org Sat May 16 14:33:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 970FE2F4027; Sat, 16 May 2020 14:33:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PSS63Vs0z4ZL0; Sat, 16 May 2020 14:33:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73993F66B; Sat, 16 May 2020 14:33:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04GEXAdQ057418; Sat, 16 May 2020 14:33:10 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GEX9dU057412; Sat, 16 May 2020 14:33:09 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005161433.04GEX9dU057412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 16 May 2020 14:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361111 - in head/sys/cam: . ata mmc nvme scsi X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/cam: . ata mmc nvme scsi X-SVN-Commit-Revision: 361111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 14:33:10 -0000 Author: cem Date: Sat May 16 14:33:08 2020 New Revision: 361111 URL: https://svnweb.freebsd.org/changeset/base/361111 Log: cam: ANSIfy 0-argument function definitions No functional change. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D24854 Modified: head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_xpt.c head/sys/cam/mmc/mmc_xpt.c head/sys/cam/nvme/nvme_xpt.c head/sys/cam/scsi/scsi_targ_bh.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Sat May 16 14:27:50 2020 (r361110) +++ head/sys/cam/ata/ata_xpt.c Sat May 16 14:33:08 2020 (r361111) @@ -270,7 +270,7 @@ CAM_XPT_PROTO(ata_proto_satapm); CAM_XPT_PROTO(ata_proto_semb); static void -aprobe_periph_init() +aprobe_periph_init(void) { } Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sat May 16 14:27:50 2020 (r361110) +++ head/sys/cam/cam_xpt.c Sat May 16 14:33:08 2020 (r361111) @@ -354,7 +354,7 @@ device_is_queued(struct cam_ed *device) } static void -xpt_periph_init() +xpt_periph_init(void) { make_dev(&xpt_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0600, "xpt0"); } @@ -4669,7 +4669,7 @@ xpt_done_direct(union ccb *done_ccb) } union ccb * -xpt_alloc_ccb() +xpt_alloc_ccb(void) { union ccb *new_ccb; @@ -4678,7 +4678,7 @@ xpt_alloc_ccb() } union ccb * -xpt_alloc_ccb_nowait() +xpt_alloc_ccb_nowait(void) { union ccb *new_ccb; Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Sat May 16 14:27:50 2020 (r361110) +++ head/sys/cam/mmc/mmc_xpt.c Sat May 16 14:33:08 2020 (r361111) @@ -467,7 +467,7 @@ PERIPHDRIVER_DECLARE(mmcprobe, probe_driver); #define CARD_ID_FREQUENCY 400000 /* Spec requires 400kHz max during ID phase. */ static void -probe_periph_init() +probe_periph_init(void) { } Modified: head/sys/cam/nvme/nvme_xpt.c ============================================================================== --- head/sys/cam/nvme/nvme_xpt.c Sat May 16 14:27:50 2020 (r361110) +++ head/sys/cam/nvme/nvme_xpt.c Sat May 16 14:33:08 2020 (r361111) @@ -192,9 +192,8 @@ static struct xpt_proto nvme_proto = { CAM_XPT_PROTO(nvme_proto); static void -nvme_probe_periph_init() +nvme_probe_periph_init(void) { - } static cam_status Modified: head/sys/cam/scsi/scsi_targ_bh.c ============================================================================== --- head/sys/cam/scsi/scsi_targ_bh.c Sat May 16 14:27:50 2020 (r361110) +++ head/sys/cam/scsi/scsi_targ_bh.c Sat May 16 14:33:08 2020 (r361111) @@ -737,7 +737,7 @@ targbherror(union ccb *ccb, u_int32_t cam_flags, u_int #endif static struct targbh_cmd_desc* -targbhallocdescr() +targbhallocdescr(void) { struct targbh_cmd_desc* descr; Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Sat May 16 14:27:50 2020 (r361110) +++ head/sys/cam/scsi/scsi_xpt.c Sat May 16 14:33:08 2020 (r361111) @@ -649,7 +649,7 @@ static struct xpt_proto scsi_proto = { CAM_XPT_PROTO(scsi_proto); static void -probe_periph_init() +probe_periph_init(void) { } From owner-svn-src-head@freebsd.org Sat May 16 16:29:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 483B32F68E9; Sat, 16 May 2020 16:29:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PW2D19T4z3DCs; Sat, 16 May 2020 16:29:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AC9A18B38; Sat, 16 May 2020 16:29:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04GGTNME029037; Sat, 16 May 2020 16:29:23 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GGTN3r029034; Sat, 16 May 2020 16:29:23 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <202005161629.04GGTN3r029034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 16 May 2020 16:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361112 - in head/bin/sh: . tests/execution X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: in head/bin/sh: . tests/execution X-SVN-Commit-Revision: 361112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 16:29:24 -0000 Author: jilles Date: Sat May 16 16:29:23 2020 New Revision: 361112 URL: https://svnweb.freebsd.org/changeset/base/361112 Log: sh: Fix double INTON with vfork The shell maintains a count of the number of times SIGINT processing has been disabled via INTOFF, so SIGINT processing resumes when all disables have enabled again (INTON). If an error occurs in a vfork() child, the processing of the error enables SIGINT processing again, and the INTON in vforkexecshell() causes the count to become negative. As a result, a later INTOFF may not actually disable SIGINT processing. This might cause memory corruption if a SIGINT arrives at an inopportune time. As of r360452, it causes the shell to abort when it would unsafely allocate or free memory in certain ways. Note that various places such as errors in non-special builtins unconditionally reset the count to 0, so the problem might still not always be visible. PR: 246497 Reported by: jbeich MFC after: 2 weeks Added: head/bin/sh/tests/execution/unknown2.0 (contents, props changed) Modified: head/bin/sh/jobs.c head/bin/sh/tests/execution/Makefile Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sat May 16 14:33:08 2020 (r361111) +++ head/bin/sh/jobs.c Sat May 16 16:29:23 2020 (r361112) @@ -1008,9 +1008,11 @@ vforkexecshell(struct job *jp, char **argv, char **env pid_t pid; struct jmploc jmploc; struct jmploc *savehandler; + int inton; TRACE(("vforkexecshell(%%%td, %s, %p) called\n", jp - jobtab, argv[0], (void *)pip)); + inton = is_int_on(); INTOFF; flushall(); savehandler = handler; @@ -1045,7 +1047,7 @@ vforkexecshell(struct job *jp, char **argv, char **env setcurjob(jp); #endif } - INTON; + SETINTON(inton); TRACE(("In parent shell: child = %d\n", (int)pid)); return pid; } Modified: head/bin/sh/tests/execution/Makefile ============================================================================== --- head/bin/sh/tests/execution/Makefile Sat May 16 14:33:08 2020 (r361111) +++ head/bin/sh/tests/execution/Makefile Sat May 16 16:29:23 2020 (r361112) @@ -64,6 +64,7 @@ ${PACKAGE}FILES+= subshell2.0 ${PACKAGE}FILES+= subshell3.0 ${PACKAGE}FILES+= subshell4.0 ${PACKAGE}FILES+= unknown1.0 +${PACKAGE}FILES+= unknown2.0 ${PACKAGE}FILES+= var-assign1.0 .include Added: head/bin/sh/tests/execution/unknown2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/unknown2.0 Sat May 16 16:29:23 2020 (r361112) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +{ + : $(/var/empty/nosuchtool) + : $(:) +} 2>/dev/null From owner-svn-src-head@freebsd.org Sat May 16 17:05:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98EF92F7500; Sat, 16 May 2020 17:05:44 +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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PWr83ZsGz3G21; Sat, 16 May 2020 17:05:44 +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 73A46192B1; Sat, 16 May 2020 17:05:44 +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 04GH5iP4053310; Sat, 16 May 2020 17:05:44 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GH5iWE053309; Sat, 16 May 2020 17:05:44 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <202005161705.04GH5iWE053309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Sat, 16 May 2020 17:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361113 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 361113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 17:05:44 -0000 Author: kaktus Date: Sat May 16 17:05:44 2020 New Revision: 361113 URL: https://svnweb.freebsd.org/changeset/base/361113 Log: sysctl: fix setting net.isr.dispatch during early boot Fix another collateral damage of r357614: netisr is initialised way before malloc() is available hence it can't use sysctl_handle_string() that allocates temporary buffer. Handle that internally in sysctl_netisr_dispatch_policy(). PR: 246114 Reported by: delphij Reviewed by: kib Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D24858 Modified: head/sys/net/netisr.c Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Sat May 16 16:29:23 2020 (r361112) +++ head/sys/net/netisr.c Sat May 16 17:05:44 2020 (r361113) @@ -345,19 +345,34 @@ static int sysctl_netisr_dispatch_policy(SYSCTL_HANDLER_ARGS) { char tmp[NETISR_DISPATCH_POLICY_MAXSTR]; + size_t len; u_int dispatch_policy; int error; netisr_dispatch_policy_to_str(netisr_dispatch_policy, tmp, sizeof(tmp)); - error = sysctl_handle_string(oidp, tmp, sizeof(tmp), req); - if (error == 0 && req->newptr != NULL) { - error = netisr_dispatch_policy_from_str(tmp, - &dispatch_policy); - if (error == 0 && dispatch_policy == NETISR_DISPATCH_DEFAULT) - error = EINVAL; - if (error == 0) - netisr_dispatch_policy = dispatch_policy; + /* + * netisr is initialised very early during the boot when malloc isn't + * available yet so we can't use sysctl_handle_string() to process + * any non-default value that was potentially set via loader. + */ + if (req->newptr != NULL) { + len = req->newlen - req->newidx; + if (len >= NETISR_DISPATCH_POLICY_MAXSTR) + return (EINVAL); + error = SYSCTL_IN(req, tmp, len); + if (error == 0) { + tmp[len] = '\0'; + error = netisr_dispatch_policy_from_str(tmp, + &dispatch_policy); + if (error == 0 && + dispatch_policy == NETISR_DISPATCH_DEFAULT) + error = EINVAL; + if (error == 0) + netisr_dispatch_policy = dispatch_policy; + } + } else { + error = sysctl_handle_string(oidp, tmp, sizeof(tmp), req); } return (error); } From owner-svn-src-head@freebsd.org Sat May 16 18:37:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 42A332F9C34; Sat, 16 May 2020 18:37:49 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PYtP14Nnz3Mh2; Sat, 16 May 2020 18:37:49 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FFBB1A441; Sat, 16 May 2020 18:37:49 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04GIbn5w010122; Sat, 16 May 2020 18:37:49 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GIbnC6010121; Sat, 16 May 2020 18:37:49 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202005161837.04GIbnC6010121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sat, 16 May 2020 18:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361114 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 361114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 18:37:49 -0000 Author: cperciva Date: Sat May 16 18:37:48 2020 New Revision: 361114 URL: https://svnweb.freebsd.org/changeset/base/361114 Log: Move the devmatch rc.d script before netif in the boot process. Prior to this change, using lagg to aggregate wired and wireless networks was broken in the (relatively common) case where wifi drivers + firmware are loaded by devmatch, since the interface didn't exist at the time when the lagg interface was being created. Suggested by: imp MFC after: 3 days Modified: head/libexec/rc/rc.d/devmatch Modified: head/libexec/rc/rc.d/devmatch ============================================================================== --- head/libexec/rc/rc.d/devmatch Sat May 16 17:05:44 2020 (r361113) +++ head/libexec/rc/rc.d/devmatch Sat May 16 18:37:48 2020 (r361114) @@ -27,6 +27,7 @@ # # PROVIDE: devmatch # REQUIRE: kldxref +# BEFORE: netif # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-head@freebsd.org Sat May 16 18:38:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 999042F9CA4 for ; Sat, 16 May 2020 18:38:57 +0000 (UTC) (envelope-from 010001721ec82f87-46b057c6-3303-4b55-817c-634fdceb53ea-000000@amazonses.com) Received: from a8-56.smtp-out.amazonses.com (a8-56.smtp-out.amazonses.com [54.240.8.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49PYvh4yBQz3Mpw for ; Sat, 16 May 2020 18:38:56 +0000 (UTC) (envelope-from 010001721ec82f87-46b057c6-3303-4b55-817c-634fdceb53ea-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1589654335; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=pPCQ0SDr5WyCBwNg5Sl97BhytqFTdZm8+TJgpUnR0iM=; b=l/x0xczKZLNll/hmLkT80VStaCxo3yN3zHco/5S48vUI4V074nfpYoug8Lj5aTWi Kg6BJSkIadUJoXBYgvof1s32VK2mcZ+nR7fL7zCxyTTD4lzSYvyG9i28EEvZdR0uVZZ yqpUK3haNDOhNtkOg4hj9SF/gOjpZrodvRpqas0g= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1589654335; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=pPCQ0SDr5WyCBwNg5Sl97BhytqFTdZm8+TJgpUnR0iM=; b=XZbERbYO+95hZbfXJM5zm7IYhDS8hifFTMA1WuM39J46eJp711UH2HqqD+eqYBGJ M1jJH183Mf8XI3g6F5XsbguMrg1PfjkoGJQ3gXe+Zt0rfpv/ePIPTDHqYlmMskpP5uA z7XnBTIJmcwbzfkQZRogA0r9C0gQJNNouZ7uPQpE= Subject: Re: svn commit: r361114 - head/libexec/rc/rc.d To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005161837.04GIbnC6010121@repo.freebsd.org> From: Colin Percival Autocrypt: addr=cperciva@tarsnap.com; prefer-encrypt=mutual; keydata= mQGhBElrAAcRBACDfDys4ZtK+ErCJ1HAzYeteKpm3OEsvT/49AjUTLihkF79HhIKrCQU+1KC zv7BwHCMLb6hq30As9L7iFKG7n5QFLFC4Te/VcITUnWHMG/c3ViLOfJGvi+9/nOEHaM1dVJY D6tEp5yM1nHmVQpo9932j4KGuGFR0LhOK5IHXOSfGwCgxSFDPdgxe2OEjWxjGgY+oV3EafcD +JROXCTjlcQiG/OguQH4Vks3mhHfFnEppLxTkDuYgHZQiUtpcT9ssH5khgqoTyMar05OUdAj ZIhNbWDh4LgTj+7ZmvLhXT5Zxw8LX9d7T36aTB8XDQSenDqEtinMWOb0TCBBLbsB8EFG1WTT ESbZci9jJS5yhtktuZoY/eM8uXMD/3k4FWFO80VRRkELSp+XSy/VlSQjyi/rhl2nQq/oOA9F oJbDaB0yq9VNhxP+uFBzBWSqeIX0t1ZWLtNfVFr4TRP5hihI5ICrg/0OpqgisKsU2NFe9xyO hyJLYmfD8ebpDJ/9k30C7Iju9pVrwLm1QgS4S2fqJRcR+U4WbjvP7CgStCVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+iGEEExECACEFAklrALYCGwMHCwkIBwMCAQQV AggDBBYCAwECHgECF4AACgkQOM7KaQxqam6/igCgn+z2k3V5ggNppmWrZstt1U2lugsAoL7L wS9V9yLtil3oWmHtwpUqYruEuQINBElrAAcQCAD3ZLMIsP4CIDoJORg+YY0lqLVBgcnF7pFb 4Uy2+KvdWofN+DKH61rZLjgXXkNE9M4EQC1B4lGttBP8IY2gs41y3AUogGdyFbidq99rCBz7 LTsgARHwFxZoaHmXyiZLEU1QZuMqwPZV1mCviRhN5E3rRqYNXVcrnXAAuhBpvNyj/ntHvcDN 2/m+ochiuBYueU4kX3lHya7sOj+mTsndcWmQ9soOUyr8O0r/BG088bMn4qqtUw4dl5/pglXk jbl7uOOPinKf0WVd2r6M0wLPJCD4NPHrCWRLLLAjwfjrtoSRvXxDbXhCdgGBa72+K8eYLzVs hgq7tJOoBWzjVK6XRxR7AAMGB/9Mo3iJ2DxqDecd02KCB5BsFDICbJGhPltU7FwrtbC7djSb XUrwsEVLHi4st4cbdGNCWCrp0BRezXZKohKnNAPFOTK++ZfgeKxrV2sJod+Q9RILF86tQ4XF 7A7Yme5hy92t/WgiU4vc/fWbgP8gV/19f8nunaT2E9NSa70mZFjZNu4iuwThoUUO5CV3Wo0Y UISsnRK8XD1+LR3A2qVyLiFRwh/miC1hgLFCTGCQ3GLxZeZzIpYSlGdQJ0L5lixW5ZQD9r1I 8i/8zhE6qRFAM0upUMI3Gt1Oq2w03DiXrZU0Fu/R8Rm8rlnkQKA+95mRTUq1xL5P5NZIi4gJ Z569OPMFiEkEGBECAAkFAklrAAcCGwwACgkQOM7KaQxqam41igCfbaldnFTu5uAdrnrghESv EI3CAo8AoLkNMks1pThl2BJNRm4CtTK9xZeH Message-ID: <010001721ec82f87-46b057c6-3303-4b55-817c-634fdceb53ea-000000@email.amazonses.com> Date: Sat, 16 May 2020 18:38:55 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <202005161837.04GIbnC6010121@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2020.05.16-54.240.8.56 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-Rspamd-Queue-Id: 49PYvh4yBQz3Mpw X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tarsnap.com header.s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn header.b=l/x0xczK; dkim=pass header.d=amazonses.com header.s=224i4yxa5dv7c2xz3womw6peuasteono header.b=XZbERbYO; dmarc=none; spf=pass (mx1.freebsd.org: domain of 010001721ec82f87-46b057c6-3303-4b55-817c-634fdceb53ea-000000@amazonses.com designates 54.240.8.56 as permitted sender) smtp.mailfrom=010001721ec82f87-46b057c6-3303-4b55-817c-634fdceb53ea-000000@amazonses.com X-Spamd-Result: default: False [-1.80 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[tarsnap.com:s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn,amazonses.com:s=224i4yxa5dv7c2xz3womw6peuasteono]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:54.240.0.0/18:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[tarsnap.com]; RWL_MAILSPIKE_GOOD(0.00)[56.8.240.54.rep.mailspike.net : 127.0.0.18]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[tarsnap.com:+,amazonses.com:+]; RCVD_IN_DNSWL_NONE(0.00)[56.8.240.54.list.dnswl.org : 127.0.15.0]; FORGED_SENDER(0.30)[cperciva@tarsnap.com,010001721ec82f87-46b057c6-3303-4b55-817c-634fdceb53ea-000000@amazonses.com]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-2.10)[ip: (-2.85), ipnet: 54.240.8.0/21(-4.60), asn: 14618(-3.01), country: US(-0.05)]; ASN(0.00)[asn:14618, ipnet:54.240.8.0/21, country:US]; FROM_NEQ_ENVFROM(0.00)[cperciva@tarsnap.com,010001721ec82f87-46b057c6-3303-4b55-817c-634fdceb53ea-000000@amazonses.com]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 18:38:57 -0000 On 2020-05-16 11:37, Colin Percival wrote: > Author: cperciva > Date: Sat May 16 18:37:48 2020 > New Revision: 361114 > URL: https://svnweb.freebsd.org/changeset/base/361114 > > Log: > Move the devmatch rc.d script before netif in the boot process. > > Prior to this change, using lagg to aggregate wired and wireless networks > was broken in the (relatively common) case where wifi drivers + firmware > are loaded by devmatch, since the interface didn't exist at the time when > the lagg interface was being created. > > Suggested by: imp > MFC after: 3 days PR: 246506 -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Sat May 16 18:49:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 206BC2FA268; Sat, 16 May 2020 18:49:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PZ8206Jyz3Nbk; Sat, 16 May 2020 18:49:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F33871A632; Sat, 16 May 2020 18:49:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04GInbnl016441; Sat, 16 May 2020 18:49:37 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GInbMg016440; Sat, 16 May 2020 18:49:37 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005161849.04GInbMg016440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 16 May 2020 18:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361115 - head/tools/tools/ath/athratestats X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/tools/ath/athratestats X-SVN-Commit-Revision: 361115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 18:49:38 -0000 Author: adrian Date: Sat May 16 18:49:37 2020 New Revision: 361115 URL: https://svnweb.freebsd.org/changeset/base/361115 Log: [ath] Flip athratestats to use two columns for now. Yeah I have too many rates on the screen now... Modified: head/tools/tools/ath/athratestats/main.c Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Sat May 16 18:37:48 2020 (r361114) +++ head/tools/tools/ath/athratestats/main.c Sat May 16 18:49:37 2020 (r361115) @@ -147,8 +147,11 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r PRINTATTR_OFF(COLOR_PAIR(3) | A_BOLD); } PRINTMSG(" TX Rate TXTOTAL:TXOK EWMA T/ F" + " avg last xmit "); + PRINTMSG(" TX Rate TXTOTAL:TXOK EWMA T/ F" " avg last xmit\n"); for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { + int c = 0; if ((mask & 1) == 0) continue; for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { @@ -165,7 +168,7 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r PRINTATTR_ON(COLOR_PAIR(1) | A_BOLD); #endif PRINTMSG("[%2u %s:%5u] %8ju:%-8ju " - "(%3d.%1d%%) %8ju/%4d %5uuS %u\n", + "(%3d.%1d%%) %8ju/%4d %5uuS %u ", dot11rate(rt, rix), dot11str(rt, rix), bin_to_size(y), @@ -187,7 +190,14 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r else if (sn->stats[y][rix].ewma_pct / 10 < 75) PRINTATTR_OFF(COLOR_PAIR(1) | A_BOLD); #endif + c++; + if (c == 2) { + PRINTMSG("\n"); + c = 0; + } } + if (c != 0) + PRINTMSG("\n"); } } From owner-svn-src-head@freebsd.org Sat May 16 19:26:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1150C2FB50C; Sat, 16 May 2020 19:26:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PZyl6kyYz3Qy4; Sat, 16 May 2020 19:26:39 +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 E29FC1AE16; Sat, 16 May 2020 19:26:39 +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 04GJQdar040844; Sat, 16 May 2020 19:26:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GJQdav040843; Sat, 16 May 2020 19:26:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005161926.04GJQdav040843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 16 May 2020 19:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361116 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 19:26:40 -0000 Author: tuexen Date: Sat May 16 19:26:39 2020 New Revision: 361116 URL: https://svnweb.freebsd.org/changeset/base/361116 Log: Ensure that an stcb is not dereferenced when it is about to be freed. This issue was found by SYZKALLER. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_indata.h Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat May 16 18:49:37 2020 (r361115) +++ head/sys/netinet/sctp_indata.c Sat May 16 19:26:39 2020 (r361116) @@ -164,6 +164,9 @@ sctp_build_readq_entry(struct sctp_tcb *stcb, read_queue_e->data = dm; read_queue_e->stcb = stcb; read_queue_e->port_from = stcb->rport; + if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { + read_queue_e->do_not_ref_stcb = 1; + } failed_build: return (read_queue_e); } @@ -775,6 +778,7 @@ sctp_build_readq_entry_from_ctl(struct sctp_queued_to_ atomic_add_int(&nc->whoFrom->ref_count, 1); nc->stcb = control->stcb; nc->port_from = control->port_from; + nc->do_not_ref_stcb = control->do_not_ref_stcb; } static void Modified: head/sys/netinet/sctp_indata.h ============================================================================== --- head/sys/netinet/sctp_indata.h Sat May 16 18:49:37 2020 (r361115) +++ head/sys/netinet/sctp_indata.h Sat May 16 19:26:39 2020 (r361116) @@ -68,6 +68,9 @@ sctp_build_readq_entry(struct sctp_tcb *stcb, (_ctl)->data = dm; \ (_ctl)->stcb = (in_it); \ (_ctl)->port_from = (in_it)->rport; \ + if ((in_it)->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { \ + (_ctl)->do_not_ref_stcb = 1; \ + }\ } \ } while (0) From owner-svn-src-head@freebsd.org Sat May 16 19:38:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6673E2FB829; Sat, 16 May 2020 19:38:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PbDz27B8z3wdV; Sat, 16 May 2020 19:38:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29E171B00B; Sat, 16 May 2020 19:38:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04GJcxkB047016; Sat, 16 May 2020 19:38:59 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GJcxnA047015; Sat, 16 May 2020 19:38:59 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <202005161938.04GJcxnA047015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 16 May 2020 19:38:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361117 - head/bin/sh/tests/execution X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh/tests/execution X-SVN-Commit-Revision: 361117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 19:38:59 -0000 Author: jilles Date: Sat May 16 19:38:58 2020 New Revision: 361117 URL: https://svnweb.freebsd.org/changeset/base/361117 Log: sh/tests: Fix keywords on newly added test Modified: Directory Properties: head/bin/sh/tests/execution/unknown2.0 (props changed) From owner-svn-src-head@freebsd.org Sat May 16 21:59:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4ECF12FEFD1; Sat, 16 May 2020 21:59:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PfML1LPbz45Dp; Sat, 16 May 2020 21:59:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 295241CB16; Sat, 16 May 2020 21:59:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04GLxgQ9033461; Sat, 16 May 2020 21:59:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GLxgto033460; Sat, 16 May 2020 21:59:42 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005162159.04GLxgto033460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 16 May 2020 21:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361118 - head/sys/dev/ath/ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath/ath_rate/sample X-SVN-Commit-Revision: 361118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 21:59:42 -0000 Author: adrian Date: Sat May 16 21:59:41 2020 New Revision: 361118 URL: https://svnweb.freebsd.org/changeset/base/361118 Log: [ath_rate_sample] Fix correct status when completing frames with short failures. My preivous logic was a bit wrong. This caused transmissions that failed due to a mix of short and long retries to count intermediate rates as OK if the LONG retry count indicated some retries had made it to this intermediate rate, but the SHORT retry count was the one that caused the whole transmit to fail. Now status is passed in again - and this is the status for the whole transmission - and then update_stats() does some quick math to see if the current transmission series hit its long retry count or not before updating things as a success or failure. Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Sat May 16 19:38:58 2020 (r361117) +++ head/sys/dev/ath/ath_rate/sample/sample.c Sat May 16 21:59:41 2020 (r361118) @@ -933,6 +933,18 @@ ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath s3code, sched->t3); /* series 3 */ } +/* + * Update the current statistics. + * + * Note that status is for the FINAL transmit status, not this + * particular attempt. So, check if tries > tries0 and if so + * assume this status failed. + * + * This is important because some failures are due to both + * short AND long retries; if the final issue was a short + * retry failure then we still want to account for the + * bad long retry attempts. + */ static void update_stats(struct ath_softc *sc, struct ath_node *an, int frame_size, @@ -947,7 +959,7 @@ update_stats(struct ath_softc *sc, struct ath_node *an #endif const int size_bin = size_to_bin(frame_size); const int size = bin_to_size(size_bin); - int tt, tries_so_far; + int tt; int is_ht40 = (an->an_node.ni_chw == 40); int pct; @@ -955,6 +967,15 @@ update_stats(struct ath_softc *sc, struct ath_node *an return; /* + * Treat long retries as us exceeding retries, even + * if the eventual attempt at some other MRR schedule + * succeeded. + */ + if (tries > tries0) { + status = HAL_TXERR_XRETRY; + } + + /* * If status is FAIL then we treat all frames as bad. * This better accurately tracks EWMA and average TX time * because even if the eventual transmission succeeded, @@ -971,7 +992,6 @@ update_stats(struct ath_softc *sc, struct ath_node *an */ tt = calc_usecs_unicast_packet(sc, size, rix0, 0 /* short_tries */, MIN(tries0, tries) - 1, is_ht40); - tries_so_far = tries0; if (sn->stats[size_bin][rix0].total_packets < ssc->smoothing_minpackets) { /* just average the first few packets */ @@ -1194,7 +1214,7 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ update_stats(sc, an, frame_size, rc[0].rix, rc[0].tries, short_tries, long_tries, - long_tries > rc[0].tries, + status, nframes, nbad); long_tries -= rc[0].tries; } @@ -1203,7 +1223,7 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ update_stats(sc, an, frame_size, rc[1].rix, rc[1].tries, short_tries, long_tries, - long_tries > rc[1].tries, + status, nframes, nbad); long_tries -= rc[1].tries; } @@ -1212,7 +1232,7 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ update_stats(sc, an, frame_size, rc[2].rix, rc[2].tries, short_tries, long_tries, - long_tries > rc[2].tries, + status, nframes, nbad); long_tries -= rc[2].tries; } @@ -1221,7 +1241,7 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ update_stats(sc, an, frame_size, rc[3].rix, rc[3].tries, short_tries, long_tries, - long_tries > rc[3].tries, + status, nframes, nbad); } }