From owner-svn-src-head@freebsd.org Sun May 3 00:03: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 DC0D62C92C1; Sun, 3 May 2020 00:03:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49F5mq5Wssz3Myd; Sun, 3 May 2020 00:03:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8D4D1EBE; Sun, 3 May 2020 00:03:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04303dMf091017; Sun, 3 May 2020 00:03:39 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04303dfH091016; Sun, 3 May 2020 00:03:39 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202005030003.04303dfH091016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 3 May 2020 00:03:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360577 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 360577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 00:03:39 -0000 Author: glebius Date: Sun May 3 00:03:39 2020 New Revision: 360577 URL: https://svnweb.freebsd.org/changeset/base/360577 Log: Make MBUF_EXT_PGS_ASSERT_SANITY() a macro, so that it prints file:line. While here, stop using struct mbuf_ext_pgs. Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D24598 Modified: head/sys/kern/kern_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sat May 2 23:58:20 2020 (r360576) +++ head/sys/kern/kern_mbuf.c Sun May 3 00:03:39 2020 (r360577) @@ -1145,40 +1145,6 @@ mb_alloc_ext_pgs(int how, m_ext_free_t ext_free) return (m); } -#ifdef INVARIANT_SUPPORT -void -mb_ext_pgs_check(struct mbuf *m) -{ - struct mbuf_ext_pgs *ext_pgs = &m->m_ext_pgs; - - /* - * NB: This expects a non-empty buffer (npgs > 0 and - * last_pg_len > 0). - */ - KASSERT(ext_pgs->npgs > 0, - ("ext_pgs with no valid pages: %p", ext_pgs)); - KASSERT(ext_pgs->npgs <= nitems(m->m_epg_pa), - ("ext_pgs with too many pages: %p", ext_pgs)); - KASSERT(ext_pgs->nrdy <= ext_pgs->npgs, - ("ext_pgs with too many ready pages: %p", ext_pgs)); - KASSERT(ext_pgs->first_pg_off < PAGE_SIZE, - ("ext_pgs with too large page offset: %p", ext_pgs)); - KASSERT(ext_pgs->last_pg_len > 0, - ("ext_pgs with zero last page length: %p", ext_pgs)); - KASSERT(ext_pgs->last_pg_len <= PAGE_SIZE, - ("ext_pgs with too large last page length: %p", ext_pgs)); - if (ext_pgs->npgs == 1) { - KASSERT(ext_pgs->first_pg_off + ext_pgs->last_pg_len <= - PAGE_SIZE, ("ext_pgs with single page too large: %p", - ext_pgs)); - } - KASSERT(ext_pgs->hdr_len <= sizeof(m->m_epg_hdr), - ("ext_pgs with too large header length: %p", ext_pgs)); - KASSERT(ext_pgs->trail_len <= sizeof(m->m_epg_trail), - ("ext_pgs with too large header length: %p", ext_pgs)); -} -#endif - /* * Clean up after mbufs with M_EXT storage attached to them if the * reference count hits 1. Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sat May 2 23:58:20 2020 (r360576) +++ head/sys/sys/mbuf.h Sun May 3 00:03:39 2020 (r360577) @@ -401,13 +401,36 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgof } } -#ifdef INVARIANT_SUPPORT -void mb_ext_pgs_check(struct mbuf *m); -#endif #ifdef INVARIANTS -#define MBUF_EXT_PGS_ASSERT_SANITY(m) mb_ext_pgs_check((m)) +#define MCHECK(ex, msg) KASSERT((ex), \ + ("Multi page mbuf %p with " #msg " at %s:%d", \ + m, __FILE__, __LINE__)) +/* + * NB: This expects a non-empty buffer (npgs > 0 and + * last_pg_len > 0). + */ +#define MBUF_EXT_PGS_ASSERT_SANITY(m) do { \ + MCHECK(m->m_ext_pgs.npgs > 0, "no valid pages"); \ + MCHECK(m->m_ext_pgs.npgs <= nitems(m->m_epg_pa), \ + "too many pages"); \ + MCHECK(m->m_ext_pgs.nrdy <= m->m_ext_pgs.npgs, \ + "too many ready pages"); \ + MCHECK(m->m_ext_pgs.first_pg_off < PAGE_SIZE, \ + "too large page offset"); \ + MCHECK(m->m_ext_pgs.last_pg_len > 0, "zero last page length"); \ + MCHECK(m->m_ext_pgs.last_pg_len <= PAGE_SIZE, \ + "too large last page length"); \ + if (m->m_ext_pgs.npgs == 1) \ + MCHECK(m->m_ext_pgs.first_pg_off + \ + m->m_ext_pgs.last_pg_len <= PAGE_SIZE, \ + "single page too large"); \ + MCHECK(m->m_ext_pgs.hdr_len <= sizeof(m->m_epg_hdr), \ + "too large header length"); \ + MCHECK(m->m_ext_pgs.trail_len <= sizeof(m->m_epg_trail), \ + "too large header length"); \ +} while (0) #else -#define MBUF_EXT_PGS_ASSERT_SANITY(m) +#define MBUF_EXT_PGS_ASSERT_SANITY(m) do {} while (0); #endif #endif From owner-svn-src-head@freebsd.org Sun May 3 00:08: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 134712C966B; Sun, 3 May 2020 00:08:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49F5t06Lq4z3NQ4; Sun, 3 May 2020 00:08:08 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C41C1ECC; Sun, 3 May 2020 00:08:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 043087A9091506; Sun, 3 May 2020 00:08:07 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 043086At091502; Sun, 3 May 2020 00:08:06 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202005030008.043086At091502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 3 May 2020 00:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360578 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 360578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 00:08:10 -0000 Author: glebius Date: Sun May 3 00:08:05 2020 New Revision: 360578 URL: https://svnweb.freebsd.org/changeset/base/360578 Log: Step 2.5: Stop using 'struct mbuf_ext_pgs' in the kernel itself. Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D24598 Modified: head/sys/kern/kern_mbuf.c head/sys/kern/kern_sendfile.c head/sys/kern/uipc_ktls.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_sockbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sun May 3 00:03:39 2020 (r360577) +++ head/sys/kern/kern_mbuf.c Sun May 3 00:08:05 2020 (r360578) @@ -934,7 +934,6 @@ mb_unmapped_free_mext(struct mbuf *m) static struct mbuf * _mb_unmapped_to_ext(struct mbuf *m) { - struct mbuf_ext_pgs *ext_pgs; struct mbuf *m_new, *top, *prev, *mref; struct sf_buf *sf; vm_page_t pg; @@ -943,9 +942,8 @@ _mb_unmapped_to_ext(struct mbuf *m) u_int ref_inc = 0; MBUF_EXT_PGS_ASSERT(m); - ext_pgs = &m->m_ext_pgs; len = m->m_len; - KASSERT(ext_pgs->tls == NULL, ("%s: can't convert TLS mbuf %p", + KASSERT(m->m_ext_pgs.tls == NULL, ("%s: can't convert TLS mbuf %p", __func__, m)); /* See if this is the mbuf that holds the embedded refcount. */ @@ -963,11 +961,11 @@ _mb_unmapped_to_ext(struct mbuf *m) off = mtod(m, vm_offset_t); top = NULL; - if (ext_pgs->hdr_len != 0) { - if (off >= ext_pgs->hdr_len) { - off -= ext_pgs->hdr_len; + if (m->m_ext_pgs.hdr_len != 0) { + if (off >= m->m_ext_pgs.hdr_len) { + off -= m->m_ext_pgs.hdr_len; } else { - seglen = ext_pgs->hdr_len - off; + seglen = m->m_ext_pgs.hdr_len - off; segoff = off; seglen = min(seglen, len); off = 0; @@ -981,8 +979,8 @@ _mb_unmapped_to_ext(struct mbuf *m) seglen); } } - pgoff = ext_pgs->first_pg_off; - for (i = 0; i < ext_pgs->npgs && len > 0; i++) { + pgoff = m->m_ext_pgs.first_pg_off; + for (i = 0; i < m->m_ext_pgs.npgs && len > 0; i++) { pglen = m_epg_pagelen(m, i, pgoff); if (off >= pglen) { off -= pglen; @@ -1018,9 +1016,9 @@ _mb_unmapped_to_ext(struct mbuf *m) pgoff = 0; }; if (len != 0) { - KASSERT((off + len) <= ext_pgs->trail_len, + KASSERT((off + len) <= m->m_ext_pgs.trail_len, ("off + len > trail (%d + %d > %d)", off, len, - ext_pgs->trail_len)); + m->m_ext_pgs.trail_len)); m_new = m_get(M_NOWAIT, MT_DATA); if (m_new == NULL) goto fail; @@ -1119,22 +1117,20 @@ struct mbuf * mb_alloc_ext_pgs(int how, m_ext_free_t ext_free) { struct mbuf *m; - struct mbuf_ext_pgs *ext_pgs; m = m_get(how, MT_DATA); if (m == NULL) return (NULL); - ext_pgs = &m->m_ext_pgs; - ext_pgs->npgs = 0; - ext_pgs->nrdy = 0; - ext_pgs->first_pg_off = 0; - ext_pgs->last_pg_len = 0; - ext_pgs->flags = 0; - ext_pgs->hdr_len = 0; - ext_pgs->trail_len = 0; - ext_pgs->tls = NULL; - ext_pgs->so = NULL; + m->m_ext_pgs.npgs = 0; + m->m_ext_pgs.nrdy = 0; + m->m_ext_pgs.first_pg_off = 0; + m->m_ext_pgs.last_pg_len = 0; + m->m_ext_pgs.flags = 0; + m->m_ext_pgs.hdr_len = 0; + m->m_ext_pgs.trail_len = 0; + m->m_ext_pgs.tls = NULL; + m->m_ext_pgs.so = NULL; m->m_data = NULL; m->m_flags |= (M_EXT | M_RDONLY | M_NOMAP); m->m_ext.ext_type = EXT_PGS; Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Sun May 3 00:03:39 2020 (r360577) +++ head/sys/kern/kern_sendfile.c Sun May 3 00:08:05 2020 (r360578) @@ -188,7 +188,6 @@ sendfile_free_mext(struct mbuf *m) static void sendfile_free_mext_pg(struct mbuf *m) { - struct mbuf_ext_pgs *ext_pgs; vm_page_t pg; int flags, i; bool cache_last; @@ -197,11 +196,10 @@ sendfile_free_mext_pg(struct mbuf *m) ("%s: m %p !M_EXT or !EXT_PGS", __func__, m)); cache_last = m->m_ext.ext_flags & EXT_FLAG_CACHE_LAST; - ext_pgs = &m->m_ext_pgs; flags = (m->m_ext.ext_flags & EXT_FLAG_NOCACHE) != 0 ? VPR_TRYFREE : 0; - for (i = 0; i < ext_pgs->npgs; i++) { - if (cache_last && i == ext_pgs->npgs - 1) + for (i = 0; i < m->m_ext_pgs.npgs; i++) { + if (cache_last && i == m->m_ext_pgs.npgs - 1) flags = 0; pg = PHYS_TO_VM_PAGE(m->m_epg_pa[i]); vm_page_release(pg, flags); @@ -692,7 +690,6 @@ vn_sendfile(struct file *fp, int sockfd, struct uio *h #ifdef KERN_TLS struct ktls_session *tls; #endif - struct mbuf_ext_pgs *ext_pgs; struct mbuf *m, *mh, *mhtail; struct sf_buf *sf; struct shmfd *shmfd; @@ -1029,7 +1026,6 @@ retry_space: sfs->count++; mtx_unlock(&sfs->mtx); } - ext_pgs = &m0->m_ext_pgs; ext_pgs_idx = 0; /* Append to mbuf chain. */ @@ -1038,18 +1034,18 @@ retry_space: else m = m0; mtail = m0; - ext_pgs->first_pg_off = + m0->m_ext_pgs.first_pg_off = vmoff(i, off) & PAGE_MASK; } if (nios) { mtail->m_flags |= M_NOTREADY; - ext_pgs->nrdy++; + m0->m_ext_pgs.nrdy++; } m0->m_epg_pa[ext_pgs_idx] = VM_PAGE_TO_PHYS(pga); - ext_pgs->npgs++; + m0->m_ext_pgs.npgs++; xfs = xfsize(i, npages, off, space); - ext_pgs->last_pg_len = xfs; + m0->m_ext_pgs.last_pg_len = xfs; MBUF_EXT_PGS_ASSERT_SANITY(m0); mtail->m_len += xfs; mtail->m_ext.ext_size += PAGE_SIZE; Modified: head/sys/kern/uipc_ktls.c ============================================================================== --- head/sys/kern/uipc_ktls.c Sun May 3 00:03:39 2020 (r360577) +++ head/sys/kern/uipc_ktls.c Sun May 3 00:08:05 2020 (r360578) @@ -1287,14 +1287,12 @@ ktls_destroy(struct ktls_session *tls) void ktls_seq(struct sockbuf *sb, struct mbuf *m) { - struct mbuf_ext_pgs *pgs; for (; m != NULL; m = m->m_next) { KASSERT((m->m_flags & M_NOMAP) != 0, ("ktls_seq: mapped mbuf %p", m)); - pgs = &m->m_ext_pgs; - pgs->seqno = sb->sb_tls_seqno; + m->m_ext_pgs.seqno = sb->sb_tls_seqno; sb->sb_tls_seqno++; } } @@ -1318,7 +1316,6 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, { struct tls_record_layer *tlshdr; struct mbuf *m; - struct mbuf_ext_pgs *pgs; uint64_t *noncep; uint16_t tls_len; int maxlen; @@ -1341,13 +1338,12 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, ("ktls_frame: mapped mbuf %p (top = %p)\n", m, top)); tls_len = m->m_len; - pgs = &m->m_ext_pgs; /* Save a reference to the session. */ - pgs->tls = ktls_hold(tls); + m->m_ext_pgs.tls = ktls_hold(tls); - pgs->hdr_len = tls->params.tls_hlen; - pgs->trail_len = tls->params.tls_tlen; + m->m_ext_pgs.hdr_len = tls->params.tls_hlen; + m->m_ext_pgs.trail_len = tls->params.tls_tlen; if (tls->params.cipher_algorithm == CRYPTO_AES_CBC) { int bs, delta; @@ -1369,9 +1365,9 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, */ bs = tls->params.tls_bs; delta = (tls_len + tls->params.tls_tlen) & (bs - 1); - pgs->trail_len -= delta; + m->m_ext_pgs.trail_len -= delta; } - m->m_len += pgs->hdr_len + pgs->trail_len; + m->m_len += m->m_ext_pgs.hdr_len + m->m_ext_pgs.trail_len; /* Populate the TLS header. */ tlshdr = (void *)m->m_epg_hdr; @@ -1386,7 +1382,7 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, tlshdr->tls_vminor = TLS_MINOR_VER_TWO; tlshdr->tls_type = TLS_RLTYPE_APP; /* save the real record type for later */ - pgs->record_type = record_type; + m->m_ext_pgs.record_type = record_type; m->m_epg_trail[0] = record_type; } else { tlshdr->tls_vminor = tls->params.tls_vminor; @@ -1423,8 +1419,8 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, */ if (tls->mode == TCP_TLS_MODE_SW) { m->m_flags |= M_NOTREADY; - pgs->nrdy = pgs->npgs; - *enq_cnt += pgs->npgs; + m->m_ext_pgs.nrdy = m->m_ext_pgs.npgs; + *enq_cnt += m->m_ext_pgs.npgs; } } } @@ -1432,15 +1428,12 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, void ktls_enqueue_to_free(struct mbuf *m) { - struct mbuf_ext_pgs *pgs; struct ktls_wq *wq; bool running; - pgs = &m->m_ext_pgs; - /* Mark it for freeing. */ - pgs->flags |= EPG_FLAG_2FREE; - wq = &ktls_wq[pgs->tls->wq_index]; + m->m_ext_pgs.flags |= EPG_FLAG_2FREE; + wq = &ktls_wq[m->m_ext_pgs.tls->wq_index]; mtx_lock(&wq->mtx); STAILQ_INSERT_TAIL(&wq->head, m, m_ext_pgs.stailq); running = wq->running; @@ -1452,7 +1445,6 @@ ktls_enqueue_to_free(struct mbuf *m) void ktls_enqueue(struct mbuf *m, struct socket *so, int page_count) { - struct mbuf_ext_pgs *pgs; struct ktls_wq *wq; bool running; @@ -1461,19 +1453,17 @@ ktls_enqueue(struct mbuf *m, struct socket *so, int pa ("ktls_enqueue: %p not unready & nomap mbuf\n", m)); KASSERT(page_count != 0, ("enqueueing TLS mbuf with zero page count")); - pgs = &m->m_ext_pgs; + KASSERT(m->m_ext_pgs.tls->mode == TCP_TLS_MODE_SW, ("!SW TLS mbuf")); - KASSERT(pgs->tls->mode == TCP_TLS_MODE_SW, ("!SW TLS mbuf")); + m->m_ext_pgs.enc_cnt = page_count; - pgs->enc_cnt = page_count; - /* * Save a pointer to the socket. The caller is responsible * for taking an additional reference via soref(). */ - pgs->so = so; + m->m_ext_pgs.so = so; - wq = &ktls_wq[pgs->tls->wq_index]; + wq = &ktls_wq[m->m_ext_pgs.tls->wq_index]; mtx_lock(&wq->mtx); STAILQ_INSERT_TAIL(&wq->head, m, m_ext_pgs.stailq); running = wq->running; @@ -1489,7 +1479,6 @@ ktls_encrypt(struct mbuf *top) struct ktls_session *tls; struct socket *so; struct mbuf *m; - struct mbuf_ext_pgs *pgs; vm_paddr_t parray[1 + btoc(TLS_MAX_MSG_SIZE_V10_2)]; struct iovec src_iov[1 + btoc(TLS_MAX_MSG_SIZE_V10_2)]; struct iovec dst_iov[1 + btoc(TLS_MAX_MSG_SIZE_V10_2)]; @@ -1526,15 +1515,13 @@ ktls_encrypt(struct mbuf *top) */ error = 0; for (m = top; npages != total_pages; m = m->m_next) { - pgs = &m->m_ext_pgs; - - KASSERT(pgs->tls == tls, + KASSERT(m->m_ext_pgs.tls == tls, ("different TLS sessions in a single mbuf chain: %p vs %p", - tls, pgs->tls)); + tls, m->m_ext_pgs.tls)); KASSERT((m->m_flags & (M_NOMAP | M_NOTREADY)) == (M_NOMAP | M_NOTREADY), ("%p not unready & nomap mbuf (top = %p)\n", m, top)); - KASSERT(npages + pgs->npgs <= total_pages, + KASSERT(npages + m->m_ext_pgs.npgs <= total_pages, ("page count mismatch: top %p, total_pages %d, m %p", top, total_pages, m)); @@ -1546,10 +1533,10 @@ ktls_encrypt(struct mbuf *top) * (from sendfile), anonymous wired pages are * allocated and assigned to the destination iovec. */ - is_anon = (pgs->flags & EPG_FLAG_ANON) != 0; + is_anon = (m->m_ext_pgs.flags & EPG_FLAG_ANON) != 0; - off = pgs->first_pg_off; - for (i = 0; i < pgs->npgs; i++, off = 0) { + off = m->m_ext_pgs.first_pg_off; + for (i = 0; i < m->m_ext_pgs.npgs; i++, off = 0) { len = m_epg_pagelen(m, i, off); src_iov[i].iov_len = len; src_iov[i].iov_base = @@ -1578,8 +1565,8 @@ retry_page: error = (*tls->sw_encrypt)(tls, (const struct tls_record_layer *)m->m_epg_hdr, - m->m_epg_trail, src_iov, dst_iov, i, pgs->seqno, - pgs->record_type); + m->m_epg_trail, src_iov, dst_iov, i, m->m_ext_pgs.seqno, + m->m_ext_pgs.record_type); if (error) { counter_u64_add(ktls_offload_failed_crypto, 1); break; @@ -1595,14 +1582,14 @@ retry_page: m->m_ext.ext_free(m); /* Replace them with the new pages. */ - for (i = 0; i < pgs->npgs; i++) + for (i = 0; i < m->m_ext_pgs.npgs; i++) m->m_epg_pa[i] = parray[i]; /* Use the basic free routine. */ m->m_ext.ext_free = mb_free_mext_pgs; /* Pages are now writable. */ - pgs->flags |= EPG_FLAG_ANON; + m->m_ext_pgs.flags |= EPG_FLAG_ANON; } /* @@ -1612,7 +1599,7 @@ retry_page: * yet-to-be-encrypted records having an associated * session. */ - pgs->tls = NULL; + m->m_ext_pgs.tls = NULL; ktls_free(tls); } Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sun May 3 00:03:39 2020 (r360577) +++ head/sys/kern/uipc_mbuf.c Sun May 3 00:08:05 2020 (r360578) @@ -1427,7 +1427,6 @@ nospace: static int frags_per_mbuf(struct mbuf *m) { - struct mbuf_ext_pgs *ext_pgs; int frags; if ((m->m_flags & M_NOMAP) == 0) @@ -1440,12 +1439,11 @@ frags_per_mbuf(struct mbuf *m) * XXX: This overestimates the number of fragments by assuming * all the backing physical pages are disjoint. */ - ext_pgs = &m->m_ext_pgs; frags = 0; - if (ext_pgs->hdr_len != 0) + if (m->m_ext_pgs.hdr_len != 0) frags++; - frags += ext_pgs->npgs; - if (ext_pgs->trail_len != 0) + frags += m->m_ext_pgs.npgs; + if (m->m_ext_pgs.trail_len != 0) frags++; return (frags); @@ -1628,12 +1626,10 @@ nospace: void mb_free_mext_pgs(struct mbuf *m) { - struct mbuf_ext_pgs *ext_pgs; vm_page_t pg; MBUF_EXT_PGS_ASSERT(m); - ext_pgs = &m->m_ext_pgs; - for (int i = 0; i < ext_pgs->npgs; i++) { + for (int i = 0; i < m->m_ext_pgs.npgs; i++) { pg = PHYS_TO_VM_PAGE(m->m_epg_pa[i]); vm_page_unwire_noq(pg); vm_page_free(pg); @@ -1644,7 +1640,6 @@ static struct mbuf * m_uiotombuf_nomap(struct uio *uio, int how, int len, int maxseg, int flags) { struct mbuf *m, *mb, *prev; - struct mbuf_ext_pgs *pgs; vm_page_t pg_array[MBUF_PEXT_MAX_PGS]; int error, length, i, needed; ssize_t total; @@ -1677,8 +1672,7 @@ m_uiotombuf_nomap(struct uio *uio, int how, int len, i else prev->m_next = mb; prev = mb; - pgs = &mb->m_ext_pgs; - pgs->flags = EPG_FLAG_ANON; + mb->m_ext_pgs.flags = EPG_FLAG_ANON; needed = length = MIN(maxseg, total); for (i = 0; needed > 0; i++, needed -= PAGE_SIZE) { retry_page: @@ -1693,16 +1687,16 @@ retry_page: } pg_array[i]->flags &= ~PG_ZERO; mb->m_epg_pa[i] = VM_PAGE_TO_PHYS(pg_array[i]); - pgs->npgs++; + mb->m_ext_pgs.npgs++; } - pgs->last_pg_len = length - PAGE_SIZE * (pgs->npgs - 1); + mb->m_ext_pgs.last_pg_len = length - PAGE_SIZE * (mb->m_ext_pgs.npgs - 1); MBUF_EXT_PGS_ASSERT_SANITY(mb); total -= length; error = uiomove_fromphys(pg_array, 0, length, uio); if (error != 0) goto failed; mb->m_len = length; - mb->m_ext.ext_size += PAGE_SIZE * pgs->npgs; + mb->m_ext.ext_size += PAGE_SIZE * mb->m_ext_pgs.npgs; if (flags & M_PKTHDR) m->m_pkthdr.len += length; } @@ -1778,23 +1772,21 @@ m_uiotombuf(struct uio *uio, int how, int len, int ali int m_unmappedtouio(const struct mbuf *m, int m_off, struct uio *uio, int len) { - struct mbuf_ext_pgs *ext_pgs; vm_page_t pg; int error, i, off, pglen, pgoff, seglen, segoff; MBUF_EXT_PGS_ASSERT(m); - ext_pgs = __DECONST(void *, &m->m_ext_pgs); error = 0; /* Skip over any data removed from the front. */ off = mtod(m, vm_offset_t); off += m_off; - if (ext_pgs->hdr_len != 0) { - if (off >= ext_pgs->hdr_len) { - off -= ext_pgs->hdr_len; + if (m->m_ext_pgs.hdr_len != 0) { + if (off >= m->m_ext_pgs.hdr_len) { + off -= m->m_ext_pgs.hdr_len; } else { - seglen = ext_pgs->hdr_len - off; + seglen = m->m_ext_pgs.hdr_len - off; segoff = off; seglen = min(seglen, len); off = 0; @@ -1803,8 +1795,8 @@ m_unmappedtouio(const struct mbuf *m, int m_off, struc &m->m_epg_hdr[segoff]), seglen, uio); } } - pgoff = ext_pgs->first_pg_off; - for (i = 0; i < ext_pgs->npgs && error == 0 && len > 0; i++) { + pgoff = m->m_ext_pgs.first_pg_off; + for (i = 0; i < m->m_ext_pgs.npgs && error == 0 && len > 0; i++) { pglen = m_epg_pagelen(m, i, pgoff); if (off >= pglen) { off -= pglen; @@ -1821,9 +1813,9 @@ m_unmappedtouio(const struct mbuf *m, int m_off, struc pgoff = 0; }; if (len != 0 && error == 0) { - KASSERT((off + len) <= ext_pgs->trail_len, + KASSERT((off + len) <= m->m_ext_pgs.trail_len, ("off + len > trail (%d + %d > %d, m_off = %d)", off, len, - ext_pgs->trail_len, m_off)); + m->m_ext_pgs.trail_len, m_off)); error = uiomove(__DECONST(void *, &m->m_epg_trail[off]), len, uio); } Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Sun May 3 00:03:39 2020 (r360577) +++ head/sys/kern/uipc_sockbuf.c Sun May 3 00:08:05 2020 (r360578) @@ -128,21 +128,18 @@ sbready_compress(struct sockbuf *sb, struct mbuf *m0, (n->m_flags & M_NOMAP) && !mbuf_has_tls_session(m) && !mbuf_has_tls_session(n)) { - struct mbuf_ext_pgs *mpgs, *npgs; int hdr_len, trail_len; - mpgs = &m->m_ext_pgs; - npgs = &n->m_ext_pgs; - hdr_len = npgs->hdr_len; - trail_len = mpgs->trail_len; + hdr_len = n->m_ext_pgs.hdr_len; + trail_len = m->m_ext_pgs.trail_len; if (trail_len != 0 && hdr_len != 0 && trail_len + hdr_len <= MBUF_PEXT_TRAIL_LEN) { /* copy n's header to m's trailer */ memcpy(&m->m_epg_trail[trail_len], n->m_epg_hdr, hdr_len); - mpgs->trail_len += hdr_len; + m->m_ext_pgs.trail_len += hdr_len; m->m_len += hdr_len; - npgs->hdr_len = 0; + n->m_ext_pgs.hdr_len = 0; n->m_len -= hdr_len; } } From owner-svn-src-head@freebsd.org Sun May 3 00:13:00 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 590212C9ACB; Sun, 3 May 2020 00:13:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49F5zc1zrbz3NvL; Sun, 3 May 2020 00:13:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EF55209F; Sun, 3 May 2020 00:13:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0430D0ZA097269; Sun, 3 May 2020 00:13:00 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0430Culh097246; Sun, 3 May 2020 00:12:56 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202005030012.0430Culh097246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 3 May 2020 00:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360579 - in head/sys: dev/cxgbe dev/cxgbe/crypto dev/cxgbe/tom dev/mlx5/mlx5_en kern netinet netinet6 sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: dev/cxgbe dev/cxgbe/crypto dev/cxgbe/tom dev/mlx5/mlx5_en kern netinet netinet6 sys X-SVN-Commit-Revision: 360579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 00:13:00 -0000 Author: glebius Date: Sun May 3 00:12:56 2020 New Revision: 360579 URL: https://svnweb.freebsd.org/changeset/base/360579 Log: Step 3: anonymize struct mbuf_ext_pgs and move all its fields into mbuf within m_epg namespace. All edits except the 'struct mbuf' declaration and mb_dupcl() were done mechanically with sed: s/->m_ext_pgs.nrdy/->m_epg_nrdy/g s/->m_ext_pgs.hdr_len/->m_epg_hdrlen/g s/->m_ext_pgs.trail_len/->m_epg_trllen/g s/->m_ext_pgs.first_pg_off/->m_epg_1st_off/g s/->m_ext_pgs.last_pg_len/->m_epg_last_len/g s/->m_ext_pgs.flags/->m_epg_flags/g s/->m_ext_pgs.record_type/->m_epg_record_type/g s/->m_ext_pgs.enc_cnt/->m_epg_enc_cnt/g s/->m_ext_pgs.tls/->m_epg_tls/g s/->m_ext_pgs.so/->m_epg_so/g s/->m_ext_pgs.seqno/->m_epg_seqno/g s/->m_ext_pgs.stailq/->m_epg_stailq/g Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D24598 Modified: head/sys/dev/cxgbe/crypto/t4_kern_tls.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_tls.c head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c head/sys/kern/kern_mbuf.c head/sys/kern/kern_sendfile.c head/sys/kern/subr_bus_dma.c head/sys/kern/subr_sglist.c head/sys/kern/uipc_ktls.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_sockbuf.c head/sys/netinet/ip_output.c head/sys/netinet/tcp_output.c head/sys/netinet6/ip6_output.c head/sys/sys/mbuf.h Modified: head/sys/dev/cxgbe/crypto/t4_kern_tls.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_kern_tls.c Sun May 3 00:08:05 2020 (r360578) +++ head/sys/dev/cxgbe/crypto/t4_kern_tls.c Sun May 3 00:12:56 2020 (r360579) @@ -922,8 +922,8 @@ ktls_tcp_payload_length(struct tlspcb *tlsp, struct mb * trim the length to avoid sending any of the trailer. There * is no way to send a partial trailer currently. */ - if (mlen > TLS_HEADER_LENGTH + plen - m_tls->m_ext_pgs.trail_len) - mlen = TLS_HEADER_LENGTH + plen - m_tls->m_ext_pgs.trail_len; + if (mlen > TLS_HEADER_LENGTH + plen - m_tls->m_epg_trllen) + mlen = TLS_HEADER_LENGTH + plen - m_tls->m_epg_trllen; /* @@ -964,7 +964,7 @@ ktls_payload_offset(struct tlspcb *tlsp, struct mbuf * mlen = mtod(m_tls, vm_offset_t) + m_tls->m_len; MPASS(mlen < TLS_HEADER_LENGTH + plen); #endif - if (mtod(m_tls, vm_offset_t) <= m_tls->m_ext_pgs.hdr_len) + if (mtod(m_tls, vm_offset_t) <= m_tls->m_epg_hdrlen) return (0); if (tlsp->enc_mode == SCMD_CIPH_MODE_AES_GCM) { /* @@ -975,8 +975,8 @@ ktls_payload_offset(struct tlspcb *tlsp, struct mbuf * * the offset at the last byte of the record payload * to send the last cipher block. */ - offset = min(mtod(m_tls, vm_offset_t) - m_tls->m_ext_pgs.hdr_len, - (plen - TLS_HEADER_LENGTH - m_tls->m_ext_pgs.trail_len) - 1); + offset = min(mtod(m_tls, vm_offset_t) - m_tls->m_epg_hdrlen, + (plen - TLS_HEADER_LENGTH - m_tls->m_epg_trllen) - 1); return (rounddown(offset, AES_BLOCK_LEN)); } return (0); @@ -1009,7 +1009,7 @@ ktls_wr_len(struct tlspcb *tlsp, struct mbuf *m, struc * excluding header and trailer. */ tlen = ktls_tcp_payload_length(tlsp, m_tls); - if (tlen <= m_tls->m_ext_pgs.hdr_len) { + if (tlen <= m_tls->m_epg_hdrlen) { /* * For requests that only want to send the TLS header, * send a tunnelled packet as immediate data. @@ -1035,7 +1035,7 @@ ktls_wr_len(struct tlspcb *tlsp, struct mbuf *m, struc } hdr = (void *)m_tls->m_epg_hdr; - plen = TLS_HEADER_LENGTH + ntohs(hdr->tls_length) - m_tls->m_ext_pgs.trail_len; + plen = TLS_HEADER_LENGTH + ntohs(hdr->tls_length) - m_tls->m_epg_trllen; if (tlen < plen) { plen = tlen; offset = ktls_payload_offset(tlsp, m_tls); @@ -1052,14 +1052,14 @@ ktls_wr_len(struct tlspcb *tlsp, struct mbuf *m, struc */ imm_len = 0; if (offset == 0) - imm_len += m_tls->m_ext_pgs.hdr_len; + imm_len += m_tls->m_epg_hdrlen; if (plen == tlen) imm_len += AES_BLOCK_LEN; wr_len += roundup2(imm_len, 16); /* TLS record payload via DSGL. */ - *nsegsp = sglist_count_mbuf_epg(m_tls, m_tls->m_ext_pgs.hdr_len + offset, - plen - (m_tls->m_ext_pgs.hdr_len + offset)); + *nsegsp = sglist_count_mbuf_epg(m_tls, m_tls->m_epg_hdrlen + offset, + plen - (m_tls->m_epg_hdrlen + offset)); wr_len += ktls_sgl_size(*nsegsp); wr_len = roundup2(wr_len, 16); @@ -1595,18 +1595,18 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq /* Locate the TLS header. */ MBUF_EXT_PGS_ASSERT(m_tls); hdr = (void *)m_tls->m_epg_hdr; - plen = TLS_HEADER_LENGTH + ntohs(hdr->tls_length) - m_tls->m_ext_pgs.trail_len; + plen = TLS_HEADER_LENGTH + ntohs(hdr->tls_length) - m_tls->m_epg_trllen; /* Determine how much of the TLS record to send. */ tlen = ktls_tcp_payload_length(tlsp, m_tls); - if (tlen <= m_tls->m_ext_pgs.hdr_len) { + if (tlen <= m_tls->m_epg_hdrlen) { /* * For requests that only want to send the TLS header, * send a tunnelled packet as immediate data. */ #ifdef VERBOSE_TRACES CTR3(KTR_CXGBE, "%s: tid %d header-only TLS record %u", - __func__, tlsp->tid, (u_int)m_tls->m_ext_pgs.seqno); + __func__, tlsp->tid, (u_int)m_tls->m_epg_seqno); #endif return (ktls_write_tunnel_packet(txq, dst, m, m_tls, available, tcp_seqno, pidx)); @@ -1616,7 +1616,7 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq offset = ktls_payload_offset(tlsp, m_tls); #ifdef VERBOSE_TRACES CTR4(KTR_CXGBE, "%s: tid %d short TLS record %u with offset %u", - __func__, tlsp->tid, (u_int)m_tls->m_ext_pgs.seqno, offset); + __func__, tlsp->tid, (u_int)m_tls->m_epg_seqno, offset); #endif if (m_tls->m_next == NULL && (tcp->th_flags & TH_FIN) != 0) { txq->kern_tls_fin_short++; @@ -1671,10 +1671,10 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq */ tx_max_offset = mtod(m_tls, vm_offset_t); if (tx_max_offset > TLS_HEADER_LENGTH + ntohs(hdr->tls_length) - - m_tls->m_ext_pgs.trail_len) { + m_tls->m_epg_trllen) { /* Always send the full trailer. */ tx_max_offset = TLS_HEADER_LENGTH + ntohs(hdr->tls_length) - - m_tls->m_ext_pgs.trail_len; + m_tls->m_epg_trllen; } if (tlsp->enc_mode == SCMD_CIPH_MODE_AES_CBC && tx_max_offset > TLS_HEADER_LENGTH) { @@ -1789,15 +1789,15 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq /* Recalculate 'nsegs' if cached value is not available. */ if (nsegs == 0) - nsegs = sglist_count_mbuf_epg(m_tls, m_tls->m_ext_pgs.hdr_len + - offset, plen - (m_tls->m_ext_pgs.hdr_len + offset)); + nsegs = sglist_count_mbuf_epg(m_tls, m_tls->m_epg_hdrlen + + offset, plen - (m_tls->m_epg_hdrlen + offset)); /* Calculate the size of the TLS work request. */ twr_len = ktls_base_wr_size(tlsp); imm_len = 0; if (offset == 0) - imm_len += m_tls->m_ext_pgs.hdr_len; + imm_len += m_tls->m_epg_hdrlen; if (plen == tlen) imm_len += AES_BLOCK_LEN; twr_len += roundup2(imm_len, 16); @@ -1913,13 +1913,13 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq cipher_stop = 0; sec_pdu->pldlen = htobe32(16 + plen - - (m_tls->m_ext_pgs.hdr_len + offset)); + (m_tls->m_epg_hdrlen + offset)); /* These two flits are actually a CPL_TLS_TX_SCMD_FMT. */ sec_pdu->seqno_numivs = tlsp->scmd0_short.seqno_numivs; sec_pdu->ivgen_hdrlen = htobe32( tlsp->scmd0_short.ivgen_hdrlen | - V_SCMD_HDR_LEN(offset == 0 ? m_tls->m_ext_pgs.hdr_len : 0)); + V_SCMD_HDR_LEN(offset == 0 ? m_tls->m_epg_hdrlen : 0)); txq->kern_tls_short++; } else { @@ -1932,7 +1932,7 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq aad_start = 1; aad_stop = TLS_HEADER_LENGTH; iv_offset = TLS_HEADER_LENGTH + 1; - cipher_start = m_tls->m_ext_pgs.hdr_len + 1; + cipher_start = m_tls->m_epg_hdrlen + 1; if (tlsp->enc_mode == SCMD_CIPH_MODE_AES_GCM) { cipher_stop = 0; auth_start = cipher_start; @@ -1971,7 +1971,7 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq V_CPL_TX_SEC_PDU_AUTHSTOP(auth_stop) | V_CPL_TX_SEC_PDU_AUTHINSERT(auth_insert)); - sec_pdu->scmd1 = htobe64(m_tls->m_ext_pgs.seqno); + sec_pdu->scmd1 = htobe64(m_tls->m_epg_seqno); /* Key context */ out = (void *)(sec_pdu + 1); @@ -2011,8 +2011,8 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq tx_data->rsvd = htobe32(tcp_seqno); } else { tx_data->len = htobe32(V_TX_DATA_MSS(mss) | - V_TX_LENGTH(tlen - (m_tls->m_ext_pgs.hdr_len + offset))); - tx_data->rsvd = htobe32(tcp_seqno + m_tls->m_ext_pgs.hdr_len + offset); + V_TX_LENGTH(tlen - (m_tls->m_epg_hdrlen + offset))); + tx_data->rsvd = htobe32(tcp_seqno + m_tls->m_epg_hdrlen + offset); } tx_data->flags = htobe32(F_TX_BYPASS); if (last_wr && tcp->th_flags & TH_PUSH) @@ -2021,8 +2021,8 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq /* Populate the TLS header */ out = (void *)(tx_data + 1); if (offset == 0) { - memcpy(out, m_tls->m_epg_hdr, m_tls->m_ext_pgs.hdr_len); - out += m_tls->m_ext_pgs.hdr_len; + memcpy(out, m_tls->m_epg_hdr, m_tls->m_epg_hdrlen); + out += m_tls->m_epg_hdrlen; } /* AES IV for a short record. */ @@ -2057,8 +2057,8 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq /* SGL for record payload */ sglist_reset(txq->gl); - if (sglist_append_mbuf_epg(txq->gl, m_tls, m_tls->m_ext_pgs.hdr_len + offset, - plen - (m_tls->m_ext_pgs.hdr_len + offset)) != 0) { + if (sglist_append_mbuf_epg(txq->gl, m_tls, m_tls->m_epg_hdrlen + offset, + plen - (m_tls->m_epg_hdrlen + offset)) != 0) { #ifdef INVARIANTS panic("%s: failed to append sglist", __func__); #endif @@ -2080,7 +2080,7 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq txq->kern_tls_waste += mtod(m_tls, vm_offset_t); else txq->kern_tls_waste += mtod(m_tls, vm_offset_t) - - (m_tls->m_ext_pgs.hdr_len + offset); + (m_tls->m_epg_hdrlen + offset); } txsd = &txq->sdesc[pidx]; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sun May 3 00:08:05 2020 (r360578) +++ head/sys/dev/cxgbe/t4_sge.c Sun May 3 00:12:56 2020 (r360579) @@ -2423,11 +2423,11 @@ count_mbuf_ext_pgs(struct mbuf *m, int skip, vm_paddr_ off += skip; len -= skip; - if (m->m_ext_pgs.hdr_len != 0) { - if (off >= m->m_ext_pgs.hdr_len) { - off -= m->m_ext_pgs.hdr_len; + if (m->m_epg_hdrlen != 0) { + if (off >= m->m_epg_hdrlen) { + off -= m->m_epg_hdrlen; } else { - seglen = m->m_ext_pgs.hdr_len - off; + seglen = m->m_epg_hdrlen - off; segoff = off; seglen = min(seglen, len); off = 0; @@ -2439,8 +2439,8 @@ count_mbuf_ext_pgs(struct mbuf *m, int skip, vm_paddr_ *nextaddr = paddr + seglen; } } - pgoff = m->m_ext_pgs.first_pg_off; - for (i = 0; i < m->m_ext_pgs.npgs && len > 0; i++) { + pgoff = m->m_epg_1st_off; + for (i = 0; i < m->m_epg_npgs && len > 0; i++) { pglen = m_epg_pagelen(m, i, pgoff); if (off >= pglen) { off -= pglen; @@ -2459,7 +2459,7 @@ count_mbuf_ext_pgs(struct mbuf *m, int skip, vm_paddr_ pgoff = 0; }; if (len != 0) { - seglen = min(len, m->m_ext_pgs.trail_len - off); + seglen = min(len, m->m_epg_trllen - off); len -= seglen; paddr = pmap_kextract((vm_offset_t)&m->m_epg_trail[off]); if (*nextaddr != paddr) Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Sun May 3 00:08:05 2020 (r360578) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Sun May 3 00:12:56 2020 (r360579) @@ -733,7 +733,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep if (m->m_flags & M_NOMAP) { #ifdef KERN_TLS - if (m->m_ext_pgs.tls != NULL) { + if (m->m_epg_tls != NULL) { toep->flags |= TPF_KTLS; if (plen == 0) { SOCKBUF_UNLOCK(sb); @@ -1934,7 +1934,7 @@ aiotx_free_pgs(struct mbuf *m) m->m_len, jobtotid(job)); #endif - for (int i = 0; i < m->m_ext_pgs.npgs; i++) { + for (int i = 0; i < m->m_epg_npgs; i++) { pg = PHYS_TO_VM_PAGE(m->m_epg_pa[i]); vm_page_unwire(pg, PQ_ACTIVE); } @@ -1989,15 +1989,15 @@ alloc_aiotx_mbuf(struct kaiocb *job, int len) break; } - m->m_ext_pgs.first_pg_off = pgoff; - m->m_ext_pgs.npgs = npages; + m->m_epg_1st_off = pgoff; + m->m_epg_npgs = npages; if (npages == 1) { KASSERT(mlen + pgoff <= PAGE_SIZE, ("%s: single page is too large (off %d len %d)", __func__, pgoff, mlen)); - m->m_ext_pgs.last_pg_len = mlen; + m->m_epg_last_len = mlen; } else { - m->m_ext_pgs.last_pg_len = mlen - (PAGE_SIZE - pgoff) - + m->m_epg_last_len = mlen - (PAGE_SIZE - pgoff) - (npages - 2) * PAGE_SIZE; } for (i = 0; i < npages; i++) Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Sun May 3 00:08:05 2020 (r360578) +++ head/sys/dev/cxgbe/tom/t4_tls.c Sun May 3 00:12:56 2020 (r360579) @@ -1628,10 +1628,10 @@ count_ext_pgs_segs(struct mbuf *m) vm_paddr_t nextpa; u_int i, nsegs; - MPASS(m->m_ext_pgs.npgs > 0); + MPASS(m->m_epg_npgs > 0); nsegs = 1; nextpa = m->m_epg_pa[0] + PAGE_SIZE; - for (i = 1; i < m->m_ext_pgs.npgs; i++) { + for (i = 1; i < m->m_epg_npgs; i++) { if (nextpa != m->m_epg_pa[i]) nsegs++; nextpa = m->m_epg_pa[i] + PAGE_SIZE; @@ -1653,11 +1653,11 @@ write_ktlstx_sgl(void *dst, struct mbuf *m, int nsegs) V_ULPTX_NSGE(nsegs)); /* Figure out the first S/G length. */ - pa = m->m_epg_pa[0] + m->m_ext_pgs.first_pg_off; + pa = m->m_epg_pa[0] + m->m_epg_1st_off; usgl->addr0 = htobe64(pa); - len = m_epg_pagelen(m, 0, m->m_ext_pgs.first_pg_off); + len = m_epg_pagelen(m, 0, m->m_epg_1st_off); pa += len; - for (i = 1; i < m->m_ext_pgs.npgs; i++) { + for (i = 1; i < m->m_epg_npgs; i++) { if (m->m_epg_pa[i] != pa) break; len += m_epg_pagelen(m, i, 0); @@ -1669,7 +1669,7 @@ write_ktlstx_sgl(void *dst, struct mbuf *m, int nsegs) #endif j = -1; - for (; i < m->m_ext_pgs.npgs; i++) { + for (; i < m->m_epg_npgs; i++) { if (j == -1 || m->m_epg_pa[i] != pa) { if (j >= 0) usgl->sge[j / 2].len[j & 1] = htobe32(len); @@ -1798,7 +1798,7 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, KASSERT(m->m_flags & M_NOMAP, ("%s: mbuf %p is not NOMAP", __func__, m)); - KASSERT(m->m_ext_pgs.tls != NULL, + KASSERT(m->m_epg_tls != NULL, ("%s: mbuf %p doesn't have TLS session", __func__, m)); /* Calculate WR length. */ @@ -1867,19 +1867,19 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, thdr = (struct tls_hdr *)&m->m_epg_hdr; #ifdef VERBOSE_TRACES CTR5(KTR_CXGBE, "%s: tid %d TLS record %ju type %d len %#x", - __func__, toep->tid, m->m_ext_pgs.seqno, thdr->type, + __func__, toep->tid, m->m_epg_seqno, thdr->type, m->m_len); #endif txwr = wrtod(wr); cpl = (struct cpl_tx_tls_sfo *)(txwr + 1); memset(txwr, 0, roundup2(wr_len, 16)); credits = howmany(wr_len, 16); - expn_size = m->m_ext_pgs.hdr_len + - m->m_ext_pgs.trail_len; + expn_size = m->m_epg_hdrlen + + m->m_epg_trllen; tls_size = m->m_len - expn_size; write_tlstx_wr(txwr, toep, 0, tls_size, expn_size, 1, credits, shove, 1); - toep->tls.tx_seq_no = m->m_ext_pgs.seqno; + toep->tls.tx_seq_no = m->m_epg_seqno; write_tlstx_cpl(cpl, toep, thdr, tls_size, 1); tls_copy_tx_key(toep, cpl + 1); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Sun May 3 00:08:05 2020 (r360578) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Sun May 3 00:12:56 2020 (r360579) @@ -684,7 +684,7 @@ mlx5e_sq_tls_populate(struct mbuf *mb, uint64_t *pseq) for (; mb != NULL; mb = mb->m_next) { if (!(mb->m_flags & M_NOMAP)) continue; - *pseq = mb->m_ext_pgs.seqno; + *pseq = mb->m_epg_seqno; return (1); } return (0); Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sun May 3 00:08:05 2020 (r360578) +++ head/sys/kern/kern_mbuf.c Sun May 3 00:12:56 2020 (r360579) @@ -833,8 +833,8 @@ mb_free_notready(struct mbuf *m, int count) for (i = 0; i < count && m != NULL; i++) { if ((m->m_flags & M_EXT) != 0 && m->m_ext.ext_type == EXT_PGS) { - m->m_ext_pgs.nrdy--; - if (m->m_ext_pgs.nrdy != 0) + m->m_epg_nrdy--; + if (m->m_epg_nrdy != 0) continue; } m = m_free(m); @@ -943,7 +943,7 @@ _mb_unmapped_to_ext(struct mbuf *m) MBUF_EXT_PGS_ASSERT(m); len = m->m_len; - KASSERT(m->m_ext_pgs.tls == NULL, ("%s: can't convert TLS mbuf %p", + KASSERT(m->m_epg_tls == NULL, ("%s: can't convert TLS mbuf %p", __func__, m)); /* See if this is the mbuf that holds the embedded refcount. */ @@ -961,11 +961,11 @@ _mb_unmapped_to_ext(struct mbuf *m) off = mtod(m, vm_offset_t); top = NULL; - if (m->m_ext_pgs.hdr_len != 0) { - if (off >= m->m_ext_pgs.hdr_len) { - off -= m->m_ext_pgs.hdr_len; + if (m->m_epg_hdrlen != 0) { + if (off >= m->m_epg_hdrlen) { + off -= m->m_epg_hdrlen; } else { - seglen = m->m_ext_pgs.hdr_len - off; + seglen = m->m_epg_hdrlen - off; segoff = off; seglen = min(seglen, len); off = 0; @@ -979,8 +979,8 @@ _mb_unmapped_to_ext(struct mbuf *m) seglen); } } - pgoff = m->m_ext_pgs.first_pg_off; - for (i = 0; i < m->m_ext_pgs.npgs && len > 0; i++) { + pgoff = m->m_epg_1st_off; + for (i = 0; i < m->m_epg_npgs && len > 0; i++) { pglen = m_epg_pagelen(m, i, pgoff); if (off >= pglen) { off -= pglen; @@ -1016,9 +1016,9 @@ _mb_unmapped_to_ext(struct mbuf *m) pgoff = 0; }; if (len != 0) { - KASSERT((off + len) <= m->m_ext_pgs.trail_len, + KASSERT((off + len) <= m->m_epg_trllen, ("off + len > trail (%d + %d > %d)", off, len, - m->m_ext_pgs.trail_len)); + m->m_epg_trllen)); m_new = m_get(M_NOWAIT, MT_DATA); if (m_new == NULL) goto fail; @@ -1122,15 +1122,15 @@ mb_alloc_ext_pgs(int how, m_ext_free_t ext_free) if (m == NULL) return (NULL); - m->m_ext_pgs.npgs = 0; - m->m_ext_pgs.nrdy = 0; - m->m_ext_pgs.first_pg_off = 0; - m->m_ext_pgs.last_pg_len = 0; - m->m_ext_pgs.flags = 0; - m->m_ext_pgs.hdr_len = 0; - m->m_ext_pgs.trail_len = 0; - m->m_ext_pgs.tls = NULL; - m->m_ext_pgs.so = NULL; + m->m_epg_npgs = 0; + m->m_epg_nrdy = 0; + m->m_epg_1st_off = 0; + m->m_epg_last_len = 0; + m->m_epg_flags = 0; + m->m_epg_hdrlen = 0; + m->m_epg_trllen = 0; + m->m_epg_tls = NULL; + m->m_epg_so = NULL; m->m_data = NULL; m->m_flags |= (M_EXT | M_RDONLY | M_NOMAP); m->m_ext.ext_type = EXT_PGS; @@ -1215,7 +1215,7 @@ mb_free_ext(struct mbuf *m) ("%s: ext_free not set", __func__)); mref->m_ext.ext_free(mref); #ifdef KERN_TLS - tls = mref->m_ext_pgs.tls; + tls = mref->m_epg_tls; if (tls != NULL && !refcount_release_if_not_last(&tls->refcount)) ktls_enqueue_to_free(mref); Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Sun May 3 00:08:05 2020 (r360578) +++ head/sys/kern/kern_sendfile.c Sun May 3 00:12:56 2020 (r360579) @@ -198,8 +198,8 @@ sendfile_free_mext_pg(struct mbuf *m) cache_last = m->m_ext.ext_flags & EXT_FLAG_CACHE_LAST; flags = (m->m_ext.ext_flags & EXT_FLAG_NOCACHE) != 0 ? VPR_TRYFREE : 0; - for (i = 0; i < m->m_ext_pgs.npgs; i++) { - if (cache_last && i == m->m_ext_pgs.npgs - 1) + for (i = 0; i < m->m_epg_npgs; i++) { + if (cache_last && i == m->m_epg_npgs - 1) flags = 0; pg = PHYS_TO_VM_PAGE(m->m_epg_pa[i]); vm_page_release(pg, flags); @@ -365,7 +365,7 @@ sendfile_iodone(void *arg, vm_page_t *pa, int count, i #if defined(KERN_TLS) && defined(INVARIANTS) if ((sfio->m->m_flags & M_EXT) != 0 && sfio->m->m_ext.ext_type == EXT_PGS) - KASSERT(sfio->tls == sfio->m->m_ext_pgs.tls, + KASSERT(sfio->tls == sfio->m->m_epg_tls, ("TLS session mismatch")); else KASSERT(sfio->tls == NULL, @@ -1034,18 +1034,18 @@ retry_space: else m = m0; mtail = m0; - m0->m_ext_pgs.first_pg_off = + m0->m_epg_1st_off = vmoff(i, off) & PAGE_MASK; } if (nios) { mtail->m_flags |= M_NOTREADY; - m0->m_ext_pgs.nrdy++; + m0->m_epg_nrdy++; } m0->m_epg_pa[ext_pgs_idx] = VM_PAGE_TO_PHYS(pga); - m0->m_ext_pgs.npgs++; + m0->m_epg_npgs++; xfs = xfsize(i, npages, off, space); - m0->m_ext_pgs.last_pg_len = xfs; + m0->m_epg_last_len = xfs; MBUF_EXT_PGS_ASSERT_SANITY(m0); mtail->m_len += xfs; mtail->m_ext.ext_size += PAGE_SIZE; Modified: head/sys/kern/subr_bus_dma.c ============================================================================== --- head/sys/kern/subr_bus_dma.c Sun May 3 00:08:05 2020 (r360578) +++ head/sys/kern/subr_bus_dma.c Sun May 3 00:12:56 2020 (r360579) @@ -129,11 +129,11 @@ _bus_dmamap_load_mbuf_epg(bus_dma_tag_t dmat, bus_dmam /* Skip over any data removed from the front. */ off = mtod(m, vm_offset_t); - if (m->m_ext_pgs.hdr_len != 0) { - if (off >= m->m_ext_pgs.hdr_len) { - off -= m->m_ext_pgs.hdr_len; + if (m->m_epg_hdrlen != 0) { + if (off >= m->m_epg_hdrlen) { + off -= m->m_epg_hdrlen; } else { - seglen = m->m_ext_pgs.hdr_len - off; + seglen = m->m_epg_hdrlen - off; segoff = off; seglen = min(seglen, len); off = 0; @@ -143,8 +143,8 @@ _bus_dmamap_load_mbuf_epg(bus_dma_tag_t dmat, bus_dmam flags, segs, nsegs); } } - pgoff = m->m_ext_pgs.first_pg_off; - for (i = 0; i < m->m_ext_pgs.npgs && error == 0 && len > 0; i++) { + pgoff = m->m_epg_1st_off; + for (i = 0; i < m->m_epg_npgs && error == 0 && len > 0; i++) { pglen = m_epg_pagelen(m, i, pgoff); if (off >= pglen) { off -= pglen; @@ -161,9 +161,9 @@ _bus_dmamap_load_mbuf_epg(bus_dma_tag_t dmat, bus_dmam pgoff = 0; }; if (len != 0 && error == 0) { - KASSERT((off + len) <= m->m_ext_pgs.trail_len, + KASSERT((off + len) <= m->m_epg_trllen, ("off + len > trail (%d + %d > %d)", off, len, - m->m_ext_pgs.trail_len)); + m->m_epg_trllen)); error = _bus_dmamap_load_buffer(dmat, map, &m->m_epg_trail[off], len, kernel_pmap, flags, segs, nsegs); Modified: head/sys/kern/subr_sglist.c ============================================================================== --- head/sys/kern/subr_sglist.c Sun May 3 00:08:05 2020 (r360578) +++ head/sys/kern/subr_sglist.c Sun May 3 00:12:56 2020 (r360579) @@ -233,11 +233,11 @@ sglist_count_mbuf_epg(struct mbuf *m, size_t off, size return (0); nsegs = 0; - if (m->m_ext_pgs.hdr_len != 0) { - if (off >= m->m_ext_pgs.hdr_len) { - off -= m->m_ext_pgs.hdr_len; + if (m->m_epg_hdrlen != 0) { + if (off >= m->m_epg_hdrlen) { + off -= m->m_epg_hdrlen; } else { - seglen = m->m_ext_pgs.hdr_len - off; + seglen = m->m_epg_hdrlen - off; segoff = off; seglen = MIN(seglen, len); off = 0; @@ -247,8 +247,8 @@ sglist_count_mbuf_epg(struct mbuf *m, size_t off, size } } nextaddr = 0; - pgoff = m->m_ext_pgs.first_pg_off; - for (i = 0; i < m->m_ext_pgs.npgs && len > 0; i++) { + pgoff = m->m_epg_1st_off; + for (i = 0; i < m->m_epg_npgs && len > 0; i++) { pglen = m_epg_pagelen(m, i, pgoff); if (off >= pglen) { off -= pglen; @@ -267,7 +267,7 @@ sglist_count_mbuf_epg(struct mbuf *m, size_t off, size pgoff = 0; }; if (len != 0) { - seglen = MIN(len, m->m_ext_pgs.trail_len - off); + seglen = MIN(len, m->m_epg_trllen - off); len -= seglen; nsegs += sglist_count(&m->m_epg_trail[off], seglen); } @@ -391,11 +391,11 @@ sglist_append_mbuf_epg(struct sglist *sg, struct mbuf MBUF_EXT_PGS_ASSERT(m); error = 0; - if (m->m_ext_pgs.hdr_len != 0) { - if (off >= m->m_ext_pgs.hdr_len) { - off -= m->m_ext_pgs.hdr_len; + if (m->m_epg_hdrlen != 0) { + if (off >= m->m_epg_hdrlen) { + off -= m->m_epg_hdrlen; } else { - seglen = m->m_ext_pgs.hdr_len - off; + seglen = m->m_epg_hdrlen - off; segoff = off; seglen = MIN(seglen, len); off = 0; @@ -404,8 +404,8 @@ sglist_append_mbuf_epg(struct sglist *sg, struct mbuf &m->m_epg_hdr[segoff], seglen); } } - pgoff = m->m_ext_pgs.first_pg_off; - for (i = 0; i < m->m_ext_pgs.npgs && error == 0 && len > 0; i++) { + pgoff = m->m_epg_1st_off; + for (i = 0; i < m->m_epg_npgs && error == 0 && len > 0; i++) { pglen = m_epg_pagelen(m, i, pgoff); if (off >= pglen) { off -= pglen; @@ -422,7 +422,7 @@ sglist_append_mbuf_epg(struct sglist *sg, struct mbuf pgoff = 0; }; if (error == 0 && len > 0) { - seglen = MIN(len, m->m_ext_pgs.trail_len - off); + seglen = MIN(len, m->m_epg_trllen - off); len -= seglen; error = sglist_append(sg, &m->m_epg_trail[off], seglen); Modified: head/sys/kern/uipc_ktls.c ============================================================================== --- head/sys/kern/uipc_ktls.c Sun May 3 00:08:05 2020 (r360578) +++ head/sys/kern/uipc_ktls.c Sun May 3 00:12:56 2020 (r360579) @@ -1292,7 +1292,7 @@ ktls_seq(struct sockbuf *sb, struct mbuf *m) KASSERT((m->m_flags & M_NOMAP) != 0, ("ktls_seq: mapped mbuf %p", m)); - m->m_ext_pgs.seqno = sb->sb_tls_seqno; + m->m_epg_seqno = sb->sb_tls_seqno; sb->sb_tls_seqno++; } } @@ -1340,10 +1340,10 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, tls_len = m->m_len; /* Save a reference to the session. */ - m->m_ext_pgs.tls = ktls_hold(tls); + m->m_epg_tls = ktls_hold(tls); - m->m_ext_pgs.hdr_len = tls->params.tls_hlen; - m->m_ext_pgs.trail_len = tls->params.tls_tlen; + m->m_epg_hdrlen = tls->params.tls_hlen; + m->m_epg_trllen = tls->params.tls_tlen; if (tls->params.cipher_algorithm == CRYPTO_AES_CBC) { int bs, delta; @@ -1365,9 +1365,9 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, */ bs = tls->params.tls_bs; delta = (tls_len + tls->params.tls_tlen) & (bs - 1); - m->m_ext_pgs.trail_len -= delta; + m->m_epg_trllen -= delta; } - m->m_len += m->m_ext_pgs.hdr_len + m->m_ext_pgs.trail_len; + m->m_len += m->m_epg_hdrlen + m->m_epg_trllen; /* Populate the TLS header. */ tlshdr = (void *)m->m_epg_hdr; @@ -1382,7 +1382,7 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, tlshdr->tls_vminor = TLS_MINOR_VER_TWO; tlshdr->tls_type = TLS_RLTYPE_APP; /* save the real record type for later */ - m->m_ext_pgs.record_type = record_type; + m->m_epg_record_type = record_type; m->m_epg_trail[0] = record_type; } else { tlshdr->tls_vminor = tls->params.tls_vminor; @@ -1419,8 +1419,8 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, */ if (tls->mode == TCP_TLS_MODE_SW) { m->m_flags |= M_NOTREADY; - m->m_ext_pgs.nrdy = m->m_ext_pgs.npgs; - *enq_cnt += m->m_ext_pgs.npgs; + m->m_epg_nrdy = m->m_epg_npgs; + *enq_cnt += m->m_epg_npgs; } } } @@ -1432,10 +1432,10 @@ ktls_enqueue_to_free(struct mbuf *m) bool running; /* Mark it for freeing. */ - m->m_ext_pgs.flags |= EPG_FLAG_2FREE; - wq = &ktls_wq[m->m_ext_pgs.tls->wq_index]; + m->m_epg_flags |= EPG_FLAG_2FREE; + wq = &ktls_wq[m->m_epg_tls->wq_index]; mtx_lock(&wq->mtx); - STAILQ_INSERT_TAIL(&wq->head, m, m_ext_pgs.stailq); + STAILQ_INSERT_TAIL(&wq->head, m, m_epg_stailq); running = wq->running; mtx_unlock(&wq->mtx); if (!running) @@ -1453,19 +1453,19 @@ ktls_enqueue(struct mbuf *m, struct socket *so, int pa ("ktls_enqueue: %p not unready & nomap mbuf\n", m)); KASSERT(page_count != 0, ("enqueueing TLS mbuf with zero page count")); - KASSERT(m->m_ext_pgs.tls->mode == TCP_TLS_MODE_SW, ("!SW TLS mbuf")); + KASSERT(m->m_epg_tls->mode == TCP_TLS_MODE_SW, ("!SW TLS mbuf")); - m->m_ext_pgs.enc_cnt = page_count; + m->m_epg_enc_cnt = page_count; /* * Save a pointer to the socket. The caller is responsible * for taking an additional reference via soref(). */ - m->m_ext_pgs.so = so; + m->m_epg_so = so; - wq = &ktls_wq[m->m_ext_pgs.tls->wq_index]; + wq = &ktls_wq[m->m_epg_tls->wq_index]; mtx_lock(&wq->mtx); - STAILQ_INSERT_TAIL(&wq->head, m, m_ext_pgs.stailq); + STAILQ_INSERT_TAIL(&wq->head, m, m_epg_stailq); running = wq->running; mtx_unlock(&wq->mtx); if (!running) @@ -1486,14 +1486,14 @@ ktls_encrypt(struct mbuf *top) int error, i, len, npages, off, total_pages; bool is_anon; - so = top->m_ext_pgs.so; - tls = top->m_ext_pgs.tls; + so = top->m_epg_so; + tls = top->m_epg_tls; KASSERT(tls != NULL, ("tls = NULL, top = %p\n", top)); KASSERT(so != NULL, ("so = NULL, top = %p\n", top)); #ifdef INVARIANTS - top->m_ext_pgs.so = NULL; + top->m_epg_so = NULL; #endif - total_pages = top->m_ext_pgs.enc_cnt; + total_pages = top->m_epg_enc_cnt; npages = 0; /* @@ -1515,13 +1515,13 @@ ktls_encrypt(struct mbuf *top) */ error = 0; for (m = top; npages != total_pages; m = m->m_next) { - KASSERT(m->m_ext_pgs.tls == tls, + KASSERT(m->m_epg_tls == tls, ("different TLS sessions in a single mbuf chain: %p vs %p", - tls, m->m_ext_pgs.tls)); + tls, m->m_epg_tls)); KASSERT((m->m_flags & (M_NOMAP | M_NOTREADY)) == (M_NOMAP | M_NOTREADY), ("%p not unready & nomap mbuf (top = %p)\n", m, top)); - KASSERT(npages + m->m_ext_pgs.npgs <= total_pages, + KASSERT(npages + m->m_epg_npgs <= total_pages, ("page count mismatch: top %p, total_pages %d, m %p", top, total_pages, m)); @@ -1533,10 +1533,10 @@ ktls_encrypt(struct mbuf *top) * (from sendfile), anonymous wired pages are * allocated and assigned to the destination iovec. */ - is_anon = (m->m_ext_pgs.flags & EPG_FLAG_ANON) != 0; + is_anon = (m->m_epg_flags & EPG_FLAG_ANON) != 0; - off = m->m_ext_pgs.first_pg_off; - for (i = 0; i < m->m_ext_pgs.npgs; i++, off = 0) { + off = m->m_epg_1st_off; + for (i = 0; i < m->m_epg_npgs; i++, off = 0) { len = m_epg_pagelen(m, i, off); src_iov[i].iov_len = len; src_iov[i].iov_base = @@ -1565,8 +1565,8 @@ retry_page: error = (*tls->sw_encrypt)(tls, (const struct tls_record_layer *)m->m_epg_hdr, - m->m_epg_trail, src_iov, dst_iov, i, m->m_ext_pgs.seqno, - m->m_ext_pgs.record_type); + m->m_epg_trail, src_iov, dst_iov, i, m->m_epg_seqno, + m->m_epg_record_type); if (error) { counter_u64_add(ktls_offload_failed_crypto, 1); break; @@ -1582,14 +1582,14 @@ retry_page: m->m_ext.ext_free(m); /* Replace them with the new pages. */ - for (i = 0; i < m->m_ext_pgs.npgs; i++) + for (i = 0; i < m->m_epg_npgs; i++) m->m_epg_pa[i] = parray[i]; /* Use the basic free routine. */ m->m_ext.ext_free = mb_free_mext_pgs; /* Pages are now writable. */ - m->m_ext_pgs.flags |= EPG_FLAG_ANON; + m->m_epg_flags |= EPG_FLAG_ANON; } /* @@ -1599,7 +1599,7 @@ retry_page: * yet-to-be-encrypted records having an associated * session. */ - m->m_ext_pgs.tls = NULL; + m->m_epg_tls = NULL; ktls_free(tls); } @@ -1639,9 +1639,9 @@ ktls_work_thread(void *ctx) STAILQ_CONCAT(&local_head, &wq->head); mtx_unlock(&wq->mtx); - STAILQ_FOREACH_SAFE(m, &local_head, m_ext_pgs.stailq, n) { - if (m->m_ext_pgs.flags & EPG_FLAG_2FREE) { - ktls_free(m->m_ext_pgs.tls); + STAILQ_FOREACH_SAFE(m, &local_head, m_epg_stailq, n) { + if (m->m_epg_flags & EPG_FLAG_2FREE) { + ktls_free(m->m_epg_tls); uma_zfree(zone_mbuf, m); } else { ktls_encrypt(m); Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sun May 3 00:08:05 2020 (r360578) +++ head/sys/kern/uipc_mbuf.c Sun May 3 00:12:56 2020 (r360579) @@ -208,9 +208,9 @@ mb_dupcl(struct mbuf *n, struct mbuf *m) */ switch (m->m_ext.ext_type) { case EXT_PGS: - bcopy(&m->m_ext, &n->m_ext, m_epg_copylen); - bcopy(&m->m_ext_pgs, &n->m_ext_pgs, - sizeof(struct mbuf_ext_pgs)); + bcopy(&m->m_epg_startcopy, &n->m_epg_startcopy, + __rangeof(struct mbuf, m_epg_startcopy, m_epg_endcopy)); + bcopy(&m->m_ext, &n->m_ext, m_epg_ext_copylen); break; case EXT_EXTREF: bcopy(&m->m_ext, &n->m_ext, sizeof(struct m_ext)); @@ -1440,10 +1440,10 @@ frags_per_mbuf(struct mbuf *m) * all the backing physical pages are disjoint. */ frags = 0; - if (m->m_ext_pgs.hdr_len != 0) + if (m->m_epg_hdrlen != 0) frags++; - frags += m->m_ext_pgs.npgs; - if (m->m_ext_pgs.trail_len != 0) + frags += m->m_epg_npgs; + if (m->m_epg_trllen != 0) frags++; return (frags); @@ -1629,7 +1629,7 @@ mb_free_mext_pgs(struct mbuf *m) vm_page_t pg; MBUF_EXT_PGS_ASSERT(m); - for (int i = 0; i < m->m_ext_pgs.npgs; i++) { + for (int i = 0; i < m->m_epg_npgs; i++) { pg = PHYS_TO_VM_PAGE(m->m_epg_pa[i]); vm_page_unwire_noq(pg); vm_page_free(pg); @@ -1672,7 +1672,7 @@ m_uiotombuf_nomap(struct uio *uio, int how, int len, i else prev->m_next = mb; prev = mb; - mb->m_ext_pgs.flags = EPG_FLAG_ANON; + mb->m_epg_flags = EPG_FLAG_ANON; needed = length = MIN(maxseg, total); for (i = 0; needed > 0; i++, needed -= PAGE_SIZE) { retry_page: @@ -1687,16 +1687,16 @@ retry_page: } pg_array[i]->flags &= ~PG_ZERO; mb->m_epg_pa[i] = VM_PAGE_TO_PHYS(pg_array[i]); - mb->m_ext_pgs.npgs++; + mb->m_epg_npgs++; } - mb->m_ext_pgs.last_pg_len = length - PAGE_SIZE * (mb->m_ext_pgs.npgs - 1); + mb->m_epg_last_len = length - PAGE_SIZE * (mb->m_epg_npgs - 1); MBUF_EXT_PGS_ASSERT_SANITY(mb); total -= length; error = uiomove_fromphys(pg_array, 0, length, uio); if (error != 0) goto failed; mb->m_len = length; - mb->m_ext.ext_size += PAGE_SIZE * mb->m_ext_pgs.npgs; + mb->m_ext.ext_size += PAGE_SIZE * mb->m_epg_npgs; if (flags & M_PKTHDR) m->m_pkthdr.len += length; } @@ -1782,11 +1782,11 @@ m_unmappedtouio(const struct mbuf *m, int m_off, struc off = mtod(m, vm_offset_t); off += m_off; - if (m->m_ext_pgs.hdr_len != 0) { - if (off >= m->m_ext_pgs.hdr_len) { - off -= m->m_ext_pgs.hdr_len; + if (m->m_epg_hdrlen != 0) { + if (off >= m->m_epg_hdrlen) { + off -= m->m_epg_hdrlen; } else { - seglen = m->m_ext_pgs.hdr_len - off; + seglen = m->m_epg_hdrlen - off; segoff = off; seglen = min(seglen, len); off = 0; @@ -1795,8 +1795,8 @@ m_unmappedtouio(const struct mbuf *m, int m_off, struc &m->m_epg_hdr[segoff]), seglen, uio); } } - pgoff = m->m_ext_pgs.first_pg_off; - for (i = 0; i < m->m_ext_pgs.npgs && error == 0 && len > 0; i++) { + pgoff = m->m_epg_1st_off; + for (i = 0; i < m->m_epg_npgs && error == 0 && len > 0; i++) { pglen = m_epg_pagelen(m, i, pgoff); if (off >= pglen) { off -= pglen; @@ -1813,9 +1813,9 @@ m_unmappedtouio(const struct mbuf *m, int m_off, struc pgoff = 0; }; if (len != 0 && error == 0) { - KASSERT((off + len) <= m->m_ext_pgs.trail_len, + KASSERT((off + len) <= m->m_epg_trllen, ("off + len > trail (%d + %d > %d, m_off = %d)", off, len, - m->m_ext_pgs.trail_len, m_off)); + m->m_epg_trllen, m_off)); error = uiomove(__DECONST(void *, &m->m_epg_trail[off]), len, uio); } Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Sun May 3 00:08:05 2020 (r360578) +++ head/sys/kern/uipc_sockbuf.c Sun May 3 00:12:56 2020 (r360579) @@ -130,16 +130,16 @@ sbready_compress(struct sockbuf *sb, struct mbuf *m0, !mbuf_has_tls_session(n)) { int hdr_len, trail_len; - hdr_len = n->m_ext_pgs.hdr_len; - trail_len = m->m_ext_pgs.trail_len; + hdr_len = n->m_epg_hdrlen; + trail_len = m->m_epg_trllen; if (trail_len != 0 && hdr_len != 0 && trail_len + hdr_len <= MBUF_PEXT_TRAIL_LEN) { /* copy n's header to m's trailer */ memcpy(&m->m_epg_trail[trail_len], n->m_epg_hdr, hdr_len); - m->m_ext_pgs.trail_len += hdr_len; + m->m_epg_trllen += hdr_len; m->m_len += hdr_len; - n->m_ext_pgs.hdr_len = 0; + n->m_epg_hdrlen = 0; n->m_len -= hdr_len; } } @@ -211,13 +211,13 @@ sbready(struct sockbuf *sb, struct mbuf *m0, int count ("%s: m %p !M_NOTREADY", __func__, m)); if ((m->m_flags & M_EXT) != 0 && m->m_ext.ext_type == EXT_PGS) { - if (count < m->m_ext_pgs.nrdy) { - m->m_ext_pgs.nrdy -= count; + if (count < m->m_epg_nrdy) { + m->m_epg_nrdy -= count; count = 0; break; } - count -= m->m_ext_pgs.nrdy; - m->m_ext_pgs.nrdy = 0; + count -= m->m_epg_nrdy; + m->m_epg_nrdy = 0; } else count--; Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Sun May 3 00:08:05 2020 (r360578) +++ head/sys/netinet/ip_output.c Sun May 3 00:12:56 2020 (r360579) @@ -230,7 +230,7 @@ ip_output_send(struct inpcb *inp, struct ifnet *ifp, s * dropping the mbuf's reference) in if_output. */ if (m->m_next != NULL && mbuf_has_tls_session(m->m_next)) { - tls = ktls_hold(m->m_next->m_ext_pgs.tls); + tls = ktls_hold(m->m_next->m_epg_tls); mst = tls->snd_tag; /* Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Sun May 3 00:08:05 2020 (r360578) +++ head/sys/netinet/tcp_output.c Sun May 3 00:12:56 2020 (r360579) @@ -1912,7 +1912,7 @@ tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *ple pkthdrlen = NULL; #ifdef KERN_TLS if (hw_tls && (m->m_flags & M_NOMAP)) - tls = m->m_ext_pgs.tls; + tls = m->m_epg_tls; else tls = NULL; start = m; @@ -1929,7 +1929,7 @@ tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *ple #ifdef KERN_TLS if (hw_tls) { if (m->m_flags & M_NOMAP) - ntls = m->m_ext_pgs.tls; + ntls = m->m_epg_tls; else ntls = NULL; Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sun May 3 00:08:05 2020 (r360578) +++ head/sys/netinet6/ip6_output.c Sun May 3 00:12:56 2020 (r360579) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun May 3 00:21: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 67DBB2C9F59; Sun, 3 May 2020 00:21:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49F69712Wvz3PJ3; Sun, 3 May 2020 00:21:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 048FB20E0; Sun, 3 May 2020 00:21:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0430LFTp098741; Sun, 3 May 2020 00:21:15 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0430LBwu098725; Sun, 3 May 2020 00:21:11 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202005030021.0430LBwu098725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 3 May 2020 00:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360581 - in head/sys: dev/cxgbe dev/cxgbe/crypto dev/cxgbe/tom dev/mlx5/mlx5_en kern netinet sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: dev/cxgbe dev/cxgbe/crypto dev/cxgbe/tom dev/mlx5/mlx5_en kern netinet sys X-SVN-Commit-Revision: 360581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 00:21:15 -0000 Author: glebius Date: Sun May 3 00:21:11 2020 New Revision: 360581 URL: https://svnweb.freebsd.org/changeset/base/360581 Log: Step 4.1: mechanically rename M_NOMAP to M_EXTPG Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D24598 Modified: head/sys/dev/cxgbe/crypto/t4_kern_tls.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_tls.c head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c head/sys/kern/kern_mbuf.c head/sys/kern/kern_sendfile.c head/sys/kern/subr_bus_dma.c head/sys/kern/subr_sglist.c head/sys/kern/uipc_ktls.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_socket.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_pcap.c head/sys/sys/mbuf.h Modified: head/sys/dev/cxgbe/crypto/t4_kern_tls.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_kern_tls.c Sun May 3 00:15:18 2020 (r360580) +++ head/sys/dev/cxgbe/crypto/t4_kern_tls.c Sun May 3 00:21:11 2020 (r360581) @@ -1208,7 +1208,7 @@ t6_ktls_parse_pkt(struct mbuf *m, int *nsegsp, int *le /* Assume all headers are in 'm' for now. */ MPASS(m->m_next != NULL); - MPASS(m->m_next->m_flags & M_NOMAP); + MPASS(m->m_next->m_flags & M_EXTPG); tot_len = 0; @@ -1218,7 +1218,7 @@ t6_ktls_parse_pkt(struct mbuf *m, int *nsegsp, int *le */ *nsegsp = 0; for (m_tls = m->m_next; m_tls != NULL; m_tls = m_tls->m_next) { - MPASS(m_tls->m_flags & M_NOMAP); + MPASS(m_tls->m_flags & M_EXTPG); wr_len = ktls_wr_len(tlsp, m, m_tls, &nsegs); #ifdef VERBOSE_TRACES @@ -2265,7 +2265,7 @@ t6_ktls_write_wr(struct sge_txq *txq, void *dst, struc * for that record. */ for (m_tls = m->m_next; m_tls != NULL; m_tls = m_tls->m_next) { - MPASS(m_tls->m_flags & M_NOMAP); + MPASS(m_tls->m_flags & M_EXTPG); /* * Determine the initial TCP sequence number for this Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sun May 3 00:15:18 2020 (r360580) +++ head/sys/dev/cxgbe/t4_sge.c Sun May 3 00:21:11 2020 (r360581) @@ -2497,7 +2497,7 @@ count_mbuf_nsegs(struct mbuf *m, int skip, uint8_t *cf skip -= len; continue; } - if ((m->m_flags & M_NOMAP) != 0) { + if ((m->m_flags & M_EXTPG) != 0) { *cflags |= MC_NOMAP; nsegs += count_mbuf_ext_pgs(m, skip, &nextaddr); skip = 0; @@ -5836,7 +5836,7 @@ write_ethofld_wr(struct cxgbe_rate_tag *cst, struct fw immhdrs -= m0->m_len; continue; } - if (m0->m_flags & M_NOMAP) + if (m0->m_flags & M_EXTPG) sglist_append_mbuf_epg(&sg, m0, mtod(m0, vm_offset_t), m0->m_len); else Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Sun May 3 00:15:18 2020 (r360580) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Sun May 3 00:21:11 2020 (r360581) @@ -610,7 +610,7 @@ write_tx_sgl(void *dst, struct mbuf *start, struct mbu i = -1; for (m = start; m != stop; m = m->m_next) { - if (m->m_flags & M_NOMAP) + if (m->m_flags & M_EXTPG) rc = sglist_append_mbuf_epg(&sg, m, mtod(m, vm_offset_t), m->m_len); else @@ -731,7 +731,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep for (m = sndptr; m != NULL; m = m->m_next) { int n; - if (m->m_flags & M_NOMAP) { + if (m->m_flags & M_EXTPG) { #ifdef KERN_TLS if (m->m_epg_tls != NULL) { toep->flags |= TPF_KTLS; @@ -772,7 +772,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep break; } - if (m->m_flags & M_NOMAP) + if (m->m_flags & M_EXTPG) nomap_mbuf_seen = true; if (max_nsegs_1mbuf < n) max_nsegs_1mbuf = n; Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Sun May 3 00:15:18 2020 (r360580) +++ head/sys/dev/cxgbe/tom/t4_tls.c Sun May 3 00:21:11 2020 (r360581) @@ -1796,7 +1796,7 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, return; } - KASSERT(m->m_flags & M_NOMAP, ("%s: mbuf %p is not NOMAP", + KASSERT(m->m_flags & M_EXTPG, ("%s: mbuf %p is not NOMAP", __func__, m)); KASSERT(m->m_epg_tls != NULL, ("%s: mbuf %p doesn't have TLS session", __func__, m)); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Sun May 3 00:15:18 2020 (r360580) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Sun May 3 00:21:11 2020 (r360581) @@ -624,7 +624,7 @@ sbtls_recover_record(struct mbuf *mb, int wait, uint32 /* check format of incoming mbuf */ if (mb->m_next == NULL || - (mb->m_next->m_flags & (M_NOMAP | M_EXT)) != (M_NOMAP | M_EXT)) { + (mb->m_next->m_flags & (M_EXTPG | M_EXT)) != (M_EXTPG | M_EXT)) { top = NULL; goto done; } @@ -682,7 +682,7 @@ mlx5e_sq_tls_populate(struct mbuf *mb, uint64_t *pseq) { for (; mb != NULL; mb = mb->m_next) { - if (!(mb->m_flags & M_NOMAP)) + if (!(mb->m_flags & M_EXTPG)) continue; *pseq = mb->m_epg_seqno; return (1); Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sun May 3 00:15:18 2020 (r360580) +++ head/sys/kern/kern_mbuf.c Sun May 3 00:21:11 2020 (r360581) @@ -882,7 +882,7 @@ mb_unmapped_compress(struct mbuf *m) m->m_ext.ext_free(m); /* Turn 'm' into a "normal" mbuf. */ - m->m_flags &= ~(M_EXT | M_RDONLY | M_NOMAP); + m->m_flags &= ~(M_EXT | M_RDONLY | M_EXTPG); m->m_data = m->m_dat; /* Copy data back into m. */ @@ -1071,7 +1071,7 @@ mb_unmapped_to_ext(struct mbuf *top) for (m = top; m != NULL; m = next) { /* m might be freed, so cache the next pointer. */ next = m->m_next; - if (m->m_flags & M_NOMAP) { + if (m->m_flags & M_EXTPG) { if (prev != NULL) { /* * Remove 'm' from the new chain so @@ -1132,7 +1132,7 @@ mb_alloc_ext_pgs(int how, m_ext_free_t ext_free) m->m_epg_tls = NULL; m->m_epg_so = NULL; m->m_data = NULL; - m->m_flags |= (M_EXT | M_RDONLY | M_NOMAP); + m->m_flags |= (M_EXT | M_RDONLY | M_EXTPG); m->m_ext.ext_type = EXT_PGS; m->m_ext.ext_flags = EXT_FLAG_EMBREF; m->m_ext.ext_count = 1; Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Sun May 3 00:15:18 2020 (r360580) +++ head/sys/kern/kern_sendfile.c Sun May 3 00:21:11 2020 (r360581) @@ -845,7 +845,7 @@ retry_space: #ifdef KERN_TLS if (tls != NULL) mh = m_uiotombuf(hdr_uio, M_WAITOK, space, - tls->params.max_frame_len, M_NOMAP); + tls->params.max_frame_len, M_EXTPG); else #endif mh = m_uiotombuf(hdr_uio, M_WAITOK, Modified: head/sys/kern/subr_bus_dma.c ============================================================================== --- head/sys/kern/subr_bus_dma.c Sun May 3 00:15:18 2020 (r360580) +++ head/sys/kern/subr_bus_dma.c Sun May 3 00:21:11 2020 (r360581) @@ -184,7 +184,7 @@ _bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmama error = 0; for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { - if ((m->m_flags & M_NOMAP) != 0) + if ((m->m_flags & M_EXTPG) != 0) error = _bus_dmamap_load_mbuf_epg(dmat, map, m, segs, nsegs, flags); else Modified: head/sys/kern/subr_sglist.c ============================================================================== --- head/sys/kern/subr_sglist.c Sun May 3 00:15:18 2020 (r360580) +++ head/sys/kern/subr_sglist.c Sun May 3 00:21:11 2020 (r360581) @@ -451,7 +451,7 @@ sglist_append_mbuf(struct sglist *sg, struct mbuf *m0) SGLIST_SAVE(sg, save); for (m = m0; m != NULL; m = m->m_next) { if (m->m_len > 0) { - if ((m->m_flags & M_NOMAP) != 0) + if ((m->m_flags & M_EXTPG) != 0) error = sglist_append_mbuf_epg(sg, m, mtod(m, vm_offset_t), m->m_len); else Modified: head/sys/kern/uipc_ktls.c ============================================================================== --- head/sys/kern/uipc_ktls.c Sun May 3 00:15:18 2020 (r360580) +++ head/sys/kern/uipc_ktls.c Sun May 3 00:21:11 2020 (r360581) @@ -1289,7 +1289,7 @@ ktls_seq(struct sockbuf *sb, struct mbuf *m) { for (; m != NULL; m = m->m_next) { - KASSERT((m->m_flags & M_NOMAP) != 0, + KASSERT((m->m_flags & M_EXTPG) != 0, ("ktls_seq: mapped mbuf %p", m)); m->m_epg_seqno = sb->sb_tls_seqno; @@ -1334,7 +1334,7 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, * TLS frames require unmapped mbufs to store session * info. */ - KASSERT((m->m_flags & M_NOMAP) != 0, + KASSERT((m->m_flags & M_EXTPG) != 0, ("ktls_frame: mapped mbuf %p (top = %p)\n", m, top)); tls_len = m->m_len; @@ -1448,8 +1448,8 @@ ktls_enqueue(struct mbuf *m, struct socket *so, int pa struct ktls_wq *wq; bool running; - KASSERT(((m->m_flags & (M_NOMAP | M_NOTREADY)) == - (M_NOMAP | M_NOTREADY)), + KASSERT(((m->m_flags & (M_EXTPG | M_NOTREADY)) == + (M_EXTPG | M_NOTREADY)), ("ktls_enqueue: %p not unready & nomap mbuf\n", m)); KASSERT(page_count != 0, ("enqueueing TLS mbuf with zero page count")); @@ -1518,8 +1518,8 @@ ktls_encrypt(struct mbuf *top) KASSERT(m->m_epg_tls == tls, ("different TLS sessions in a single mbuf chain: %p vs %p", tls, m->m_epg_tls)); - KASSERT((m->m_flags & (M_NOMAP | M_NOTREADY)) == - (M_NOMAP | M_NOTREADY), + KASSERT((m->m_flags & (M_EXTPG | M_NOTREADY)) == + (M_EXTPG | M_NOTREADY), ("%p not unready & nomap mbuf (top = %p)\n", m, top)); KASSERT(npages + m->m_epg_npgs <= total_pages, ("page count mismatch: top %p, total_pages %d, m %p", top, Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sun May 3 00:15:18 2020 (r360580) +++ head/sys/kern/uipc_mbuf.c Sun May 3 00:21:11 2020 (r360581) @@ -220,7 +220,7 @@ mb_dupcl(struct mbuf *n, struct mbuf *m) } n->m_flags |= M_EXT; - n->m_flags |= m->m_flags & (M_RDONLY | M_NOMAP); + n->m_flags |= m->m_flags & (M_RDONLY | M_EXTPG); /* See if this is the mbuf that holds the embedded refcount. */ if (m->m_ext.ext_flags & EXT_FLAG_EMBREF) { @@ -265,7 +265,7 @@ m_demote(struct mbuf *m0, int all, int flags) if (m->m_flags & M_PKTHDR) m_demote_pkthdr(m); m->m_flags = m->m_flags & (M_EXT | M_RDONLY | M_NOFREE | - M_NOMAP | flags); + M_EXTPG | flags); } } @@ -396,7 +396,7 @@ m_move_pkthdr(struct mbuf *to, struct mbuf *from) m_tag_delete_chain(to, NULL); #endif to->m_flags = (from->m_flags & M_COPYFLAGS) | - (to->m_flags & (M_EXT | M_NOMAP)); + (to->m_flags & (M_EXT | M_EXTPG)); if ((to->m_flags & M_EXT) == 0) to->m_data = to->m_pktdat; to->m_pkthdr = from->m_pkthdr; /* especially tags */ @@ -435,7 +435,7 @@ m_dup_pkthdr(struct mbuf *to, const struct mbuf *from, m_tag_delete_chain(to, NULL); #endif to->m_flags = (from->m_flags & M_COPYFLAGS) | - (to->m_flags & (M_EXT | M_NOMAP)); + (to->m_flags & (M_EXT | M_EXTPG)); if ((to->m_flags & M_EXT) == 0) to->m_data = to->m_pktdat; to->m_pkthdr = from->m_pkthdr; @@ -645,7 +645,7 @@ m_copydata(const struct mbuf *m, int off, int len, cad while (len > 0) { KASSERT(m != NULL, ("m_copydata, length > size of mbuf chain")); count = min(m->m_len - off, len); - if ((m->m_flags & M_NOMAP) != 0) + if ((m->m_flags & M_EXTPG) != 0) m_copyfromunmapped(m, off, count, cp); else bcopy(mtod(m, caddr_t) + off, cp, count); @@ -743,7 +743,7 @@ m_cat(struct mbuf *m, struct mbuf *n) m = m->m_next; while (n) { if (!M_WRITABLE(m) || - (n->m_flags & M_NOMAP) != 0 || + (n->m_flags & M_EXTPG) != 0 || M_TRAILINGSPACE(m) < n->m_len) { /* just join the two chains */ m->m_next = n; @@ -861,7 +861,7 @@ m_pullup(struct mbuf *n, int len) int count; int space; - KASSERT((n->m_flags & M_NOMAP) == 0, + KASSERT((n->m_flags & M_EXTPG) == 0, ("%s: unmapped mbuf %p", __func__, n)); /* @@ -1429,7 +1429,7 @@ frags_per_mbuf(struct mbuf *m) { int frags; - if ((m->m_flags & M_NOMAP) == 0) + if ((m->m_flags & M_EXTPG) == 0) return (1); /* @@ -1718,7 +1718,7 @@ m_uiotombuf(struct uio *uio, int how, int len, int ali ssize_t total; int progress = 0; - if (flags & M_NOMAP) + if (flags & M_EXTPG) return (m_uiotombuf_nomap(uio, how, len, align, flags)); /* @@ -1840,7 +1840,7 @@ m_mbuftouio(struct uio *uio, const struct mbuf *m, int for (; m != NULL; m = m->m_next) { length = min(m->m_len, total - progress); - if ((m->m_flags & M_NOMAP) != 0) + if ((m->m_flags & M_EXTPG) != 0) error = m_unmappedtouio(m, 0, uio, length); else error = uiomove(mtod(m, void *), length, uio); Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Sun May 3 00:15:18 2020 (r360580) +++ head/sys/kern/uipc_sockbuf.c Sun May 3 00:21:11 2020 (r360581) @@ -124,8 +124,8 @@ sbready_compress(struct sockbuf *sb, struct mbuf *m0, #ifdef KERN_TLS /* Try to coalesce adjacent ktls mbuf hdr/trailers. */ if ((n != NULL) && (n != end) && (m->m_flags & M_EOR) == 0 && - (m->m_flags & M_NOMAP) && - (n->m_flags & M_NOMAP) && + (m->m_flags & M_EXTPG) && + (n->m_flags & M_EXTPG) && !mbuf_has_tls_session(m) && !mbuf_has_tls_session(n)) { int hdr_len, trail_len; @@ -146,7 +146,7 @@ sbready_compress(struct sockbuf *sb, struct mbuf *m0, #endif /* Compress small unmapped mbufs into plain mbufs. */ - if ((m->m_flags & M_NOMAP) && m->m_len <= MLEN && + if ((m->m_flags & M_EXTPG) && m->m_len <= MLEN && !mbuf_has_tls_session(m)) { MPASS(m->m_flags & M_EXT); ext_size = m->m_ext.ext_size; @@ -158,7 +158,7 @@ sbready_compress(struct sockbuf *sb, struct mbuf *m0, while ((n != NULL) && (n != end) && (m->m_flags & M_EOR) == 0 && M_WRITABLE(m) && - (m->m_flags & M_NOMAP) == 0 && + (m->m_flags & M_EXTPG) == 0 && !mbuf_has_tls_session(n) && !mbuf_has_tls_session(m) && n->m_len <= MCLBYTES / 4 && /* XXX: Don't copy too much */ @@ -1172,7 +1172,7 @@ sbcompress(struct sockbuf *sb, struct mbuf *m, struct M_WRITABLE(n) && ((sb->sb_flags & SB_NOCOALESCE) == 0) && !(m->m_flags & M_NOTREADY) && - !(n->m_flags & (M_NOTREADY | M_NOMAP)) && + !(n->m_flags & (M_NOTREADY | M_EXTPG)) && !mbuf_has_tls_session(m) && !mbuf_has_tls_session(n) && m->m_len <= MCLBYTES / 4 && /* XXX: Don't copy too much */ @@ -1189,7 +1189,7 @@ sbcompress(struct sockbuf *sb, struct mbuf *m, struct m = m_free(m); continue; } - if (m->m_len <= MLEN && (m->m_flags & M_NOMAP) && + if (m->m_len <= MLEN && (m->m_flags & M_EXTPG) && (m->m_flags & M_NOTREADY) == 0 && !mbuf_has_tls_session(m)) (void)mb_unmapped_compress(m); Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sun May 3 00:15:18 2020 (r360580) +++ head/sys/kern/uipc_socket.c Sun May 3 00:21:11 2020 (r360581) @@ -1691,7 +1691,7 @@ restart: if (tls != NULL) { top = m_uiotombuf(uio, M_WAITOK, space, tls->params.max_frame_len, - M_NOMAP | + M_EXTPG | ((flags & MSG_EOR) ? M_EOR : 0)); if (top != NULL) { ktls_frame(top, tls, @@ -2159,7 +2159,7 @@ dontblock: SBLASTRECORDCHK(&so->so_rcv); SBLASTMBUFCHK(&so->so_rcv); SOCKBUF_UNLOCK(&so->so_rcv); - if ((m->m_flags & M_NOMAP) != 0) + if ((m->m_flags & M_EXTPG) != 0) error = m_unmappedtouio(m, moff, uio, (int)len); else error = uiomove(mtod(m, char *) + moff, Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Sun May 3 00:15:18 2020 (r360580) +++ head/sys/netinet/tcp_output.c Sun May 3 00:21:11 2020 (r360581) @@ -1911,7 +1911,7 @@ tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *ple top = NULL; pkthdrlen = NULL; #ifdef KERN_TLS - if (hw_tls && (m->m_flags & M_NOMAP)) + if (hw_tls && (m->m_flags & M_EXTPG)) tls = m->m_epg_tls; else tls = NULL; @@ -1928,7 +1928,7 @@ tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *ple } #ifdef KERN_TLS if (hw_tls) { - if (m->m_flags & M_NOMAP) + if (m->m_flags & M_EXTPG) ntls = m->m_epg_tls; else ntls = NULL; @@ -1961,14 +1961,14 @@ tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *ple mlen = min(len, m->m_len - off); if (seglimit) { /* - * For M_NOMAP mbufs, add 3 segments + * For M_EXTPG mbufs, add 3 segments * + 1 in case we are crossing page boundaries * + 2 in case the TLS hdr/trailer are used * It is cheaper to just add the segments * than it is to take the cache miss to look * at the mbuf ext_pgs state in detail. */ - if (m->m_flags & M_NOMAP) { + if (m->m_flags & M_EXTPG) { fragsize = min(segsize, PAGE_SIZE); frags = 3; } else { Modified: head/sys/netinet/tcp_pcap.c ============================================================================== --- head/sys/netinet/tcp_pcap.c Sun May 3 00:15:18 2020 (r360580) +++ head/sys/netinet/tcp_pcap.c Sun May 3 00:21:11 2020 (r360581) @@ -384,7 +384,7 @@ tcp_pcap_add(struct tcphdr *th, struct mbuf *m, struct __func__, n->m_flags)); n->m_data = n->m_dat + M_LEADINGSPACE_NOWRITE(m); n->m_len = m->m_len; - if (m->m_flags & M_NOMAP) + if (m->m_flags & M_EXTPG) m_copydata(m, 0, m->m_len, n->m_data); else bcopy(M_START(m), n->m_dat, Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sun May 3 00:15:18 2020 (r360580) +++ head/sys/sys/mbuf.h Sun May 3 00:21:11 2020 (r360581) @@ -450,7 +450,7 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgof #define M_MCAST 0x00000020 /* send/received as link-level multicast */ #define M_PROMISC 0x00000040 /* packet was not for us */ #define M_VLANTAG 0x00000080 /* ether_vtag is valid */ -#define M_NOMAP 0x00000100 /* mbuf data is unmapped */ +#define M_EXTPG 0x00000100 /* has array of unmapped pages and TLS */ #define M_NOFREE 0x00000200 /* do not free mbuf, embedded in cluster */ #define M_TSTMP 0x00000400 /* rcv_tstmp field is valid */ #define M_TSTMP_HPREC 0x00000800 /* rcv_tstmp is high-prec, typically @@ -491,7 +491,7 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgof */ #define M_FLAG_BITS \ "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_BCAST\6M_MCAST" \ - "\7M_PROMISC\10M_VLANTAG\11M_NOMAP\12M_NOFREE\13M_TSTMP\14M_TSTMP_HPREC\15M_TSTMP_LRO" + "\7M_PROMISC\10M_VLANTAG\11M_EXTPG\12M_NOFREE\13M_TSTMP\14M_TSTMP_HPREC\15M_TSTMP_LRO" #define M_FLAG_PROTOBITS \ "\16M_PROTO1\17M_PROTO2\20M_PROTO3\21M_PROTO4" \ "\22M_PROTO5\23M_PROTO6\24M_PROTO7\25M_PROTO8\26M_PROTO9" \ @@ -1038,7 +1038,7 @@ m_extrefcnt(struct mbuf *m) * be both the local data payload, or an external buffer area, depending on * whether M_EXT is set). */ -#define M_WRITABLE(m) (((m)->m_flags & (M_RDONLY | M_NOMAP)) == 0 && \ +#define M_WRITABLE(m) (((m)->m_flags & (M_RDONLY | M_EXTPG)) == 0 && \ (!(((m)->m_flags & M_EXT)) || \ (m_extrefcnt(m) == 1))) @@ -1061,7 +1061,7 @@ m_extrefcnt(struct mbuf *m) * handling external storage, packet-header mbufs, and regular data mbufs. */ #define M_START(m) \ - (((m)->m_flags & M_NOMAP) ? NULL : \ + (((m)->m_flags & M_EXTPG) ? NULL : \ ((m)->m_flags & M_EXT) ? (m)->m_ext.ext_buf : \ ((m)->m_flags & M_PKTHDR) ? &(m)->m_pktdat[0] : \ &(m)->m_dat[0]) @@ -1559,7 +1559,7 @@ static inline bool mbuf_has_tls_session(struct mbuf *m) { - if (m->m_flags & M_NOMAP) { + if (m->m_flags & M_EXTPG) { MBUF_EXT_PGS_ASSERT(m); if (m->m_epg_tls != NULL) { return (true); From owner-svn-src-head@freebsd.org Sun May 3 00:27: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 1C47D2CA1BF; Sun, 3 May 2020 00:27:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49F6Jb6cKJz3Pvd; Sun, 3 May 2020 00:27:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9C952282; Sun, 3 May 2020 00:27:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0430RhOu004409; Sun, 3 May 2020 00:27:43 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0430RgIW004401; Sun, 3 May 2020 00:27:42 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202005030027.0430RgIW004401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 3 May 2020 00:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360582 - in head/sys: dev/cxgbe dev/cxgbe/crypto dev/cxgbe/tom kern sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: dev/cxgbe dev/cxgbe/crypto dev/cxgbe/tom kern sys X-SVN-Commit-Revision: 360582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 00:27:44 -0000 Author: glebius Date: Sun May 3 00:27:41 2020 New Revision: 360582 URL: https://svnweb.freebsd.org/changeset/base/360582 Log: Mechanically rename MBUF_EXT_PGS_ASSERT() to M_ASSERTEXTPG() to match classical M_ASSERTPKTHDR. Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D24598 Modified: head/sys/dev/cxgbe/crypto/t4_kern_tls.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/kern/kern_mbuf.c head/sys/kern/subr_bus_dma.c head/sys/kern/subr_sglist.c head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/dev/cxgbe/crypto/t4_kern_tls.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_kern_tls.c Sun May 3 00:21:11 2020 (r360581) +++ head/sys/dev/cxgbe/crypto/t4_kern_tls.c Sun May 3 00:27:41 2020 (r360582) @@ -903,7 +903,7 @@ ktls_tcp_payload_length(struct tlspcb *tlsp, struct mb struct tls_record_layer *hdr; u_int plen, mlen; - MBUF_EXT_PGS_ASSERT(m_tls); + M_ASSERTEXTPG(m_tls); hdr = (void *)m_tls->m_epg_hdr; plen = ntohs(hdr->tls_length); @@ -957,7 +957,7 @@ ktls_payload_offset(struct tlspcb *tlsp, struct mbuf * u_int mlen; #endif - MBUF_EXT_PGS_ASSERT(m_tls); + M_ASSERTEXTPG(m_tls); hdr = (void *)m_tls->m_epg_hdr; plen = ntohs(hdr->tls_length); #ifdef INVARIANTS @@ -1002,7 +1002,7 @@ ktls_wr_len(struct tlspcb *tlsp, struct mbuf *m, struc struct tls_record_layer *hdr; u_int imm_len, offset, plen, wr_len, tlen; - MBUF_EXT_PGS_ASSERT(m_tls); + M_ASSERTEXTPG(m_tls); /* * Determine the size of the TLS record payload to send @@ -1466,7 +1466,7 @@ ktls_write_tunnel_packet(struct sge_txq *txq, void *ds M_ASSERTPKTHDR(m); /* Locate the template TLS header. */ - MBUF_EXT_PGS_ASSERT(m_tls); + M_ASSERTEXTPG(m_tls); /* This should always be the last TLS record in a chain. */ MPASS(m_tls->m_next == NULL); @@ -1593,7 +1593,7 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq using_scratch = (eq->sidx - pidx < SGE_MAX_WR_LEN / EQ_ESIZE); /* Locate the TLS header. */ - MBUF_EXT_PGS_ASSERT(m_tls); + M_ASSERTEXTPG(m_tls); hdr = (void *)m_tls->m_epg_hdr; plen = TLS_HEADER_LENGTH + ntohs(hdr->tls_length) - m_tls->m_epg_trllen; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sun May 3 00:21:11 2020 (r360581) +++ head/sys/dev/cxgbe/t4_sge.c Sun May 3 00:27:41 2020 (r360582) @@ -2417,7 +2417,7 @@ count_mbuf_ext_pgs(struct mbuf *m, int skip, vm_paddr_ int i, len, off, pglen, pgoff, seglen, segoff; int nsegs = 0; - MBUF_EXT_PGS_ASSERT(m); + M_ASSERTEXTPG(m); off = mtod(m, vm_offset_t); len = m->m_len; off += skip; Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Sun May 3 00:21:11 2020 (r360581) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Sun May 3 00:27:41 2020 (r360582) @@ -1927,7 +1927,7 @@ aiotx_free_pgs(struct mbuf *m) struct kaiocb *job; vm_page_t pg; - MBUF_EXT_PGS_ASSERT(m); + M_ASSERTEXTPG(m); job = m->m_ext.ext_arg1; #ifdef VERBOSE_TRACES CTR3(KTR_CXGBE, "%s: completed %d bytes for tid %d", __func__, Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sun May 3 00:21:11 2020 (r360581) +++ head/sys/kern/kern_mbuf.c Sun May 3 00:27:41 2020 (r360582) @@ -941,7 +941,7 @@ _mb_unmapped_to_ext(struct mbuf *m) volatile u_int *refcnt; u_int ref_inc = 0; - MBUF_EXT_PGS_ASSERT(m); + M_ASSERTEXTPG(m); len = m->m_len; KASSERT(m->m_epg_tls == NULL, ("%s: can't convert TLS mbuf %p", __func__, m)); Modified: head/sys/kern/subr_bus_dma.c ============================================================================== --- head/sys/kern/subr_bus_dma.c Sun May 3 00:21:11 2020 (r360581) +++ head/sys/kern/subr_bus_dma.c Sun May 3 00:27:41 2020 (r360582) @@ -121,7 +121,7 @@ _bus_dmamap_load_mbuf_epg(bus_dma_tag_t dmat, bus_dmam { int error, i, off, len, pglen, pgoff, seglen, segoff; - MBUF_EXT_PGS_ASSERT(m); + M_ASSERTEXTPG(m); len = m->m_len; error = 0; Modified: head/sys/kern/subr_sglist.c ============================================================================== --- head/sys/kern/subr_sglist.c Sun May 3 00:21:11 2020 (r360581) +++ head/sys/kern/subr_sglist.c Sun May 3 00:27:41 2020 (r360582) @@ -388,7 +388,7 @@ sglist_append_mbuf_epg(struct sglist *sg, struct mbuf vm_paddr_t paddr; int error, i, pglen, pgoff; - MBUF_EXT_PGS_ASSERT(m); + M_ASSERTEXTPG(m); error = 0; if (m->m_epg_hdrlen != 0) { Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sun May 3 00:21:11 2020 (r360581) +++ head/sys/kern/uipc_mbuf.c Sun May 3 00:27:41 2020 (r360582) @@ -1628,7 +1628,7 @@ mb_free_mext_pgs(struct mbuf *m) { vm_page_t pg; - MBUF_EXT_PGS_ASSERT(m); + M_ASSERTEXTPG(m); for (int i = 0; i < m->m_epg_npgs; i++) { pg = PHYS_TO_VM_PAGE(m->m_epg_pa[i]); vm_page_unwire_noq(pg); @@ -1775,7 +1775,7 @@ m_unmappedtouio(const struct mbuf *m, int m_off, struc vm_page_t pg; int error, i, off, pglen, pgoff, seglen, segoff; - MBUF_EXT_PGS_ASSERT(m); + M_ASSERTEXTPG(m); error = 0; /* Skip over any data removed from the front. */ Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sun May 3 00:21:11 2020 (r360581) +++ head/sys/sys/mbuf.h Sun May 3 00:27:41 2020 (r360582) @@ -608,11 +608,6 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgof "\24EXT_FLAG_VENDOR4\25EXT_FLAG_EXP1\26EXT_FLAG_EXP2\27EXT_FLAG_EXP3" \ "\30EXT_FLAG_EXP4" -#define MBUF_EXT_PGS_ASSERT(m) \ - KASSERT((((m)->m_flags & M_EXT) != 0) && \ - ((m)->m_ext.ext_type == EXT_PGS), \ - ("%s: m %p !M_EXT or !EXT_PGS", __func__, m)) - /* * Flags indicating checksum, segmentation and other offload work to be * done, or already done, by hardware or lower layers. It is split into @@ -1047,6 +1042,11 @@ m_extrefcnt(struct mbuf *m) KASSERT((m) != NULL && (m)->m_flags & M_PKTHDR, \ ("%s: no mbuf packet header!", __func__)) +/* Check if mbuf is multipage. */ +#define M_ASSERTEXTPG(m) \ + KASSERT(((m)->m_flags & (M_EXT|M_EXTPG)) == (M_EXT|M_EXTPG), \ + ("%s: m %p is not multipage!", __func__, m)) + /* * Ensure that the supplied mbuf is a valid, non-free mbuf. * @@ -1560,7 +1560,6 @@ mbuf_has_tls_session(struct mbuf *m) { if (m->m_flags & M_EXTPG) { - MBUF_EXT_PGS_ASSERT(m); if (m->m_epg_tls != NULL) { return (true); } From owner-svn-src-head@freebsd.org Sun May 3 00:37:18 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 6CEE52CA4EA; Sun, 3 May 2020 00:37:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49F6Wf2fv9z3QLl; Sun, 3 May 2020 00:37:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CC1F247E; Sun, 3 May 2020 00:37:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0430bIDL010366; Sun, 3 May 2020 00:37:18 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0430bGDX010355; Sun, 3 May 2020 00:37:16 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202005030037.0430bGDX010355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 3 May 2020 00:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360583 - in head/sys: kern netinet sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern netinet sys X-SVN-Commit-Revision: 360583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 00:37:18 -0000 Author: glebius Date: Sun May 3 00:37:16 2020 New Revision: 360583 URL: https://svnweb.freebsd.org/changeset/base/360583 Log: Step 4.2: start divorce of M_EXT and M_EXTPG They have more differencies than similarities. For now there is lots of code that would check for M_EXT only and work correctly on M_EXTPG buffers, so still carry M_EXT bit together with M_EXTPG. However, prepare some code for explicit check for M_EXTPG. Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D24598 Modified: head/sys/kern/kern_mbuf.c head/sys/kern/kern_sendfile.c head/sys/kern/subr_sglist.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_sockbuf.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_pcap.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sun May 3 00:27:41 2020 (r360582) +++ head/sys/kern/kern_mbuf.c Sun May 3 00:37:16 2020 (r360583) @@ -115,7 +115,7 @@ int nmbjumbop; /* limits number of page size jumbo c int nmbjumbo9; /* limits number of 9k jumbo clusters */ int nmbjumbo16; /* limits number of 16k jumbo clusters */ -bool mb_use_ext_pgs; /* use EXT_PGS mbufs for sendfile & TLS */ +bool mb_use_ext_pgs; /* use M_EXTPG mbufs for sendfile & TLS */ SYSCTL_BOOL(_kern_ipc, OID_AUTO, mb_use_ext_pgs, CTLFLAG_RWTUN, &mb_use_ext_pgs, 0, "Use unmapped mbufs for sendfile(2) and TLS offload"); @@ -822,7 +822,7 @@ mb_reclaim(uma_zone_t zone __unused, int pending __unu /* * Free "count" units of I/O from an mbuf chain. They could be held - * in EXT_PGS or just as a normal mbuf. This code is intended to be + * in M_EXTPG or just as a normal mbuf. This code is intended to be * called in an error path (I/O error, closed connection, etc). */ void @@ -831,8 +831,7 @@ mb_free_notready(struct mbuf *m, int count) int i; for (i = 0; i < count && m != NULL; i++) { - if ((m->m_flags & M_EXT) != 0 && - m->m_ext.ext_type == EXT_PGS) { + if ((m->m_flags & M_EXTPG) != 0) { m->m_epg_nrdy--; if (m->m_epg_nrdy != 0) continue; @@ -860,9 +859,8 @@ mb_unmapped_compress(struct mbuf *m) * a packet header, it would only be able to hold MHLEN bytes * and m_data would have to be initialized differently. */ - KASSERT((m->m_flags & M_PKTHDR) == 0 && (m->m_flags & M_EXT) && - m->m_ext.ext_type == EXT_PGS, - ("%s: m %p !M_EXT or !EXT_PGS or M_PKTHDR", __func__, m)); + KASSERT((m->m_flags & M_PKTHDR) == 0 && (m->m_flags & M_EXTPG), + ("%s: m %p !M_EXTPG or M_PKTHDR", __func__, m)); KASSERT(m->m_len <= MLEN, ("m_len too large %p", m)); if (m->m_ext.ext_flags & EXT_FLAG_EMBREF) { @@ -902,12 +900,12 @@ mb_unmapped_compress(struct mbuf *m) * unmapped data is stored in an mbuf with an EXT_SFBUF external * cluster. These mbufs use an sf_buf to provide a valid KVA for the * associated physical page. They also hold a reference on the - * original EXT_PGS mbuf to ensure the physical page doesn't go away. + * original M_EXTPG mbuf to ensure the physical page doesn't go away. * Finally, any TLS trailer data is stored in a regular mbuf. * * mb_unmapped_free_mext() is the ext_free handler for the EXT_SFBUF * mbufs. It frees the associated sf_buf and releases its reference - * on the original EXT_PGS mbuf. + * on the original M_EXTPG mbuf. * * _mb_unmapped_to_ext() is a helper function that converts a single * unmapped mbuf into a chain of mbufs. @@ -926,9 +924,9 @@ mb_unmapped_free_mext(struct mbuf *m) sf = m->m_ext.ext_arg1; sf_buf_free(sf); - /* Drop the reference on the backing EXT_PGS mbuf. */ + /* Drop the reference on the backing M_EXTPG mbuf. */ old_m = m->m_ext.ext_arg2; - mb_free_ext(old_m); + mb_free_extpg(old_m); } static struct mbuf * @@ -1109,7 +1107,7 @@ mb_unmapped_to_ext(struct mbuf *top) } /* - * Allocate an empty EXT_PGS mbuf. The ext_free routine is + * Allocate an empty M_EXTPG mbuf. The ext_free routine is * responsible for freeing any pages backing this mbuf when it is * freed. */ @@ -1133,7 +1131,6 @@ mb_alloc_ext_pgs(int how, m_ext_free_t ext_free) m->m_epg_so = NULL; m->m_data = NULL; m->m_flags |= (M_EXT | M_RDONLY | M_EXTPG); - m->m_ext.ext_type = EXT_PGS; m->m_ext.ext_flags = EXT_FLAG_EMBREF; m->m_ext.ext_count = 1; m->m_ext.ext_size = 0; @@ -1206,24 +1203,6 @@ mb_free_ext(struct mbuf *m) uma_zfree(zone_jumbo16, m->m_ext.ext_buf); uma_zfree(zone_mbuf, mref); break; - case EXT_PGS: { -#ifdef KERN_TLS - struct ktls_session *tls; -#endif - - KASSERT(mref->m_ext.ext_free != NULL, - ("%s: ext_free not set", __func__)); - mref->m_ext.ext_free(mref); -#ifdef KERN_TLS - tls = mref->m_epg_tls; - if (tls != NULL && - !refcount_release_if_not_last(&tls->refcount)) - ktls_enqueue_to_free(mref); - else -#endif - uma_zfree(zone_mbuf, mref); - break; - } case EXT_SFBUF: case EXT_NET_DRV: case EXT_MOD_TYPE: @@ -1249,6 +1228,48 @@ mb_free_ext(struct mbuf *m) } if (freembuf && m != mref) + uma_zfree(zone_mbuf, m); +} + +/* + * Clean up after mbufs with M_EXTPG storage attached to them if the + * reference count hits 1. + */ +void +mb_free_extpg(struct mbuf *m) +{ + volatile u_int *refcnt; + struct mbuf *mref; + + M_ASSERTEXTPG(m); + + /* See if this is the mbuf that holds the embedded refcount. */ + if (m->m_ext.ext_flags & EXT_FLAG_EMBREF) { + refcnt = &m->m_ext.ext_count; + mref = m; + } else { + KASSERT(m->m_ext.ext_cnt != NULL, + ("%s: no refcounting pointer on %p", __func__, m)); + refcnt = m->m_ext.ext_cnt; + mref = __containerof(refcnt, struct mbuf, m_ext.ext_count); + } + + /* Free attached storage if this mbuf is the only reference to it. */ + if (*refcnt == 1 || atomic_fetchadd_int(refcnt, -1) == 1) { + KASSERT(mref->m_ext.ext_free != NULL, + ("%s: ext_free not set", __func__)); + + mref->m_ext.ext_free(mref); +#ifdef KERN_TLS + if (mref->m_epg_tls != NULL && + !refcount_release_if_not_last(&mref->m_epg_tls->refcount)) + ktls_enqueue_to_free(mref); + else +#endif + uma_zfree(zone_mbuf, mref); + } + + if (m != mref) uma_zfree(zone_mbuf, m); } Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Sun May 3 00:27:41 2020 (r360582) +++ head/sys/kern/kern_sendfile.c Sun May 3 00:37:16 2020 (r360583) @@ -192,8 +192,7 @@ sendfile_free_mext_pg(struct mbuf *m) int flags, i; bool cache_last; - KASSERT(m->m_flags & M_EXT && m->m_ext.ext_type == EXT_PGS, - ("%s: m %p !M_EXT or !EXT_PGS", __func__, m)); + M_ASSERTEXTPG(m); cache_last = m->m_ext.ext_flags & EXT_FLAG_CACHE_LAST; flags = (m->m_ext.ext_flags & EXT_FLAG_NOCACHE) != 0 ? VPR_TRYFREE : 0; @@ -363,8 +362,7 @@ sendfile_iodone(void *arg, vm_page_t *pa, int count, i } #if defined(KERN_TLS) && defined(INVARIANTS) - if ((sfio->m->m_flags & M_EXT) != 0 && - sfio->m->m_ext.ext_type == EXT_PGS) + if ((sfio->m->m_flags & M_EXTPG) != 0) KASSERT(sfio->tls == sfio->m->m_epg_tls, ("TLS session mismatch")); else @@ -1015,13 +1013,7 @@ retry_space: if (sfs != NULL) { m0->m_ext.ext_flags |= EXT_FLAG_SYNC; - if (m0->m_ext.ext_type == - EXT_PGS) - m0->m_ext.ext_arg1 = - sfs; - else - m0->m_ext.ext_arg2 = - sfs; + m0->m_ext.ext_arg1 = sfs; mtx_lock(&sfs->mtx); sfs->count++; mtx_unlock(&sfs->mtx); @@ -1096,10 +1088,6 @@ retry_space: m0->m_ext.ext_flags |= EXT_FLAG_NOCACHE; if (sfs != NULL) { m0->m_ext.ext_flags |= EXT_FLAG_SYNC; - if (m0->m_ext.ext_type == EXT_PGS) - m0->m_ext.ext_arg1 = sfs; - else - m0->m_ext.ext_arg2 = sfs; m0->m_ext.ext_arg2 = sfs; mtx_lock(&sfs->mtx); sfs->count++; Modified: head/sys/kern/subr_sglist.c ============================================================================== --- head/sys/kern/subr_sglist.c Sun May 3 00:27:41 2020 (r360582) +++ head/sys/kern/subr_sglist.c Sun May 3 00:37:16 2020 (r360583) @@ -220,7 +220,7 @@ sglist_count_vmpages(vm_page_t *m, size_t pgoff, size_ /* * Determine the number of scatter/gather list elements needed to - * describe an EXT_PGS buffer. + * describe an M_EXTPG mbuf. */ int sglist_count_mbuf_epg(struct mbuf *m, size_t off, size_t len) Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sun May 3 00:27:41 2020 (r360582) +++ head/sys/kern/uipc_mbuf.c Sun May 3 00:37:16 2020 (r360583) @@ -191,8 +191,10 @@ mb_dupcl(struct mbuf *n, struct mbuf *m) { volatile u_int *refcnt; - KASSERT(m->m_flags & M_EXT, ("%s: M_EXT not set on %p", __func__, m)); - KASSERT(!(n->m_flags & M_EXT), ("%s: M_EXT set on %p", __func__, n)); + KASSERT(m->m_flags & (M_EXT|M_EXTPG), + ("%s: M_EXT|M_EXTPG not set on %p", __func__, m)); + KASSERT(!(n->m_flags & (M_EXT|M_EXTPG)), + ("%s: M_EXT|M_EXTPG set on %p", __func__, n)); /* * Cache access optimization. @@ -200,27 +202,22 @@ mb_dupcl(struct mbuf *n, struct mbuf *m) * o Regular M_EXT storage doesn't need full copy of m_ext, since * the holder of the 'ext_count' is responsible to carry the free * routine and its arguments. - * o EXT_PGS data is split between main part of mbuf and m_ext, the + * o M_EXTPG data is split between main part of mbuf and m_ext, the * main part is copied in full, the m_ext part is similar to M_EXT. * o EXT_EXTREF, where 'ext_cnt' doesn't point into mbuf at all, is * special - it needs full copy of m_ext into each mbuf, since any * copy could end up as the last to free. */ - switch (m->m_ext.ext_type) { - case EXT_PGS: + if (m->m_flags & M_EXTPG) { bcopy(&m->m_epg_startcopy, &n->m_epg_startcopy, __rangeof(struct mbuf, m_epg_startcopy, m_epg_endcopy)); bcopy(&m->m_ext, &n->m_ext, m_epg_ext_copylen); - break; - case EXT_EXTREF: + } else if (m->m_ext.ext_type == EXT_EXTREF) bcopy(&m->m_ext, &n->m_ext, sizeof(struct m_ext)); - break; - default: + else bcopy(&m->m_ext, &n->m_ext, m_ext_copylen); - } - n->m_flags |= M_EXT; - n->m_flags |= m->m_flags & (M_RDONLY | M_EXTPG); + n->m_flags |= m->m_flags & (M_RDONLY | M_EXT | M_EXTPG); /* See if this is the mbuf that holds the embedded refcount. */ if (m->m_ext.ext_flags & EXT_FLAG_EMBREF) { @@ -525,7 +522,7 @@ m_copym(struct mbuf *m, int off0, int len, int wait) copyhdr = 0; } n->m_len = min(len, m->m_len - off); - if (m->m_flags & M_EXT) { + if (m->m_flags & (M_EXT|M_EXTPG)) { n->m_data = m->m_data + off; mb_dupcl(n, m); } else @@ -567,7 +564,7 @@ m_copypacket(struct mbuf *m, int how) if (!m_dup_pkthdr(n, m, how)) goto nospace; n->m_len = m->m_len; - if (m->m_flags & M_EXT) { + if (m->m_flags & (M_EXT|M_EXTPG)) { n->m_data = m->m_data; mb_dupcl(n, m); } else { @@ -585,7 +582,7 @@ m_copypacket(struct mbuf *m, int how) n = n->m_next; n->m_len = m->m_len; - if (m->m_flags & M_EXT) { + if (m->m_flags & (M_EXT|M_EXTPG)) { n->m_data = m->m_data; mb_dupcl(n, m); } else { @@ -1003,7 +1000,7 @@ m_split(struct mbuf *m0, int len0, int wait) n->m_pkthdr.rcvif = m0->m_pkthdr.rcvif; n->m_pkthdr.len = m0->m_pkthdr.len - len0; m0->m_pkthdr.len = len0; - if (m->m_flags & M_EXT) + if (m->m_flags & (M_EXT|M_EXTPG)) goto extpacket; if (remain > MHLEN) { /* m can't be the lead packet */ @@ -1029,7 +1026,7 @@ m_split(struct mbuf *m0, int len0, int wait) M_ALIGN(n, remain); } extpacket: - if (m->m_flags & M_EXT) { + if (m->m_flags & (M_EXT|M_EXTPG)) { n->m_data = m->m_data + len; mb_dupcl(n, m); } else { Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Sun May 3 00:27:41 2020 (r360582) +++ head/sys/kern/uipc_sockbuf.c Sun May 3 00:37:16 2020 (r360583) @@ -148,7 +148,6 @@ sbready_compress(struct sockbuf *sb, struct mbuf *m0, /* Compress small unmapped mbufs into plain mbufs. */ if ((m->m_flags & M_EXTPG) && m->m_len <= MLEN && !mbuf_has_tls_session(m)) { - MPASS(m->m_flags & M_EXT); ext_size = m->m_ext.ext_size; if (mb_unmapped_compress(m) == 0) { sb->sb_mbcnt -= ext_size; @@ -190,8 +189,8 @@ sbready_compress(struct sockbuf *sb, struct mbuf *m0, /* * Mark ready "count" units of I/O starting with "m". Most mbufs - * count as a single unit of I/O except for EXT_PGS-backed mbufs which - * can be backed by multiple pages. + * count as a single unit of I/O except for M_EXTPG mbufs which + * are backed by multiple pages. */ int sbready(struct sockbuf *sb, struct mbuf *m0, int count) @@ -209,8 +208,7 @@ sbready(struct sockbuf *sb, struct mbuf *m0, int count while (count > 0) { KASSERT(m->m_flags & M_NOTREADY, ("%s: m %p !M_NOTREADY", __func__, m)); - if ((m->m_flags & M_EXT) != 0 && - m->m_ext.ext_type == EXT_PGS) { + if ((m->m_flags & M_EXTPG) != 0) { if (count < m->m_epg_nrdy) { m->m_epg_nrdy -= count; count = 0; Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Sun May 3 00:27:41 2020 (r360582) +++ head/sys/netinet/tcp_output.c Sun May 3 00:37:16 2020 (r360583) @@ -2023,7 +2023,7 @@ tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *ple } n->m_len = mlen; len_cp += n->m_len; - if (m->m_flags & M_EXT) { + if (m->m_flags & (M_EXT|M_EXTPG)) { n->m_data = m->m_data + off; mb_dupcl(n, m); } else Modified: head/sys/netinet/tcp_pcap.c ============================================================================== --- head/sys/netinet/tcp_pcap.c Sun May 3 00:27:41 2020 (r360582) +++ head/sys/netinet/tcp_pcap.c Sun May 3 00:37:16 2020 (r360583) @@ -308,10 +308,13 @@ tcp_pcap_add(struct tcphdr *th, struct mbuf *m, struct * last reference, go through the normal * free-ing process. */ - if (mhead->m_flags & M_EXT) { + if (mhead->m_flags & M_EXTPG) { + /* Don't mess around with these. */ + tcp_pcap_m_freem(mhead); + continue; + } else if (mhead->m_flags & M_EXT) { switch (mhead->m_ext.ext_type) { case EXT_SFBUF: - case EXT_PGS: /* Don't mess around with these. */ tcp_pcap_m_freem(mhead); continue; @@ -339,8 +342,7 @@ tcp_pcap_add(struct tcphdr *th, struct mbuf *m, struct tcp_pcap_alloc_reuse_ext++; break; } - } - else { + } else { tcp_pcap_alloc_reuse_mbuf++; } @@ -366,7 +368,8 @@ tcp_pcap_add(struct tcphdr *th, struct mbuf *m, struct * In cases where that isn't possible, settle for what we can * get. */ - if ((m->m_flags & M_EXT) && tcp_pcap_take_cluster_reference()) { + if ((m->m_flags & (M_EXT|M_EXTPG)) && + tcp_pcap_take_cluster_reference()) { n->m_data = m->m_data; n->m_len = m->m_len; mb_dupcl(n, m); Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sun May 3 00:27:41 2020 (r360582) +++ head/sys/sys/mbuf.h Sun May 3 00:37:16 2020 (r360583) @@ -563,7 +563,6 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgof #define EXT_PACKET 6 /* mbuf+cluster from packet zone */ #define EXT_MBUF 7 /* external mbuf reference */ #define EXT_RXRING 8 /* data in NIC receive ring */ -#define EXT_PGS 9 /* array of unmapped pages */ #define EXT_VENDOR1 224 /* for vendor-internal use */ #define EXT_VENDOR2 225 /* for vendor-internal use */ @@ -739,6 +738,7 @@ extern uma_zone_t zone_extpgs; void mb_dupcl(struct mbuf *, struct mbuf *); void mb_free_ext(struct mbuf *); +void mb_free_extpg(struct mbuf *); void mb_free_mext_pgs(struct mbuf *); struct mbuf *mb_alloc_ext_pgs(int, m_ext_free_t); int mb_unmapped_compress(struct mbuf *m); @@ -1044,7 +1044,7 @@ m_extrefcnt(struct mbuf *m) /* Check if mbuf is multipage. */ #define M_ASSERTEXTPG(m) \ - KASSERT(((m)->m_flags & (M_EXT|M_EXTPG)) == (M_EXT|M_EXTPG), \ + KASSERT(((m)->m_flags & (M_EXTPG|M_PKTHDR)) == M_EXTPG, \ ("%s: m %p is not multipage!", __func__, m)) /* @@ -1387,7 +1387,9 @@ m_free(struct mbuf *m) m_tag_delete_chain(m, NULL); if (m->m_flags & M_PKTHDR && m->m_pkthdr.csum_flags & CSUM_SND_TAG) m_snd_tag_rele(m->m_pkthdr.snd_tag); - if (m->m_flags & M_EXT) + if (m->m_flags & M_EXTPG) + mb_free_extpg(m); + else if (m->m_flags & M_EXT) mb_free_ext(m); else if ((m->m_flags & M_NOFREE) == 0) uma_zfree(zone_mbuf, m); From owner-svn-src-head@freebsd.org Sun May 3 01:47: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 5267F2CD2A7 for ; Sun, 3 May 2020 01:47:03 +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 49F84460Ppz41Q6 for ; Sun, 3 May 2020 01:47:00 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: Je91.JsVM1ltv_HQv7RPo8lTpTRycFoqzySPqqjE0TqqPJDSgl2wrD6oF6S1XVs d1qDmWaJAJehOqk8oe.7Ipt.G7QV8bj.otr9HeKeoxY2i5BWR4tTNwKYEVkkvLLomHdk27efm6Pn R00XHn8DwOcJpZsJ.K63G8ou5VoF5N840cQH2ECzAu18TZoFJFO3yZBfIdd23ZkPtQk9U98ePpvo Rdewpte3qUgIQoRa7ibTgDLHZtmiCjkRn45qZHjVRPFo65PUvXl1xZxuRpV7fohA9OIuaw6gqIa. RzT7hvdDspYdvyLSm2pG.0POTWCOJh7JtGSSX6scZrgppN1K1HWhjmMQGOrS8makSIKlyFFo7Gyx G8ACMe0g2kmOofKxrsYEPrBPqu6e_bXh8L7WsXYRwzxlYkQvxgejllkIkG8icHcLEkAhZ2fJ21jY IwEoZBmPhGealeVUAciF68JwoODAXlT5eMujt6urX.ptkVKQGYcaMsKzlhE4Aopu6oTMXAWsCKrn RNtox1Of1er_ZrrMhwJujCSbC48QrR6cal7pPri0tYqaEclSot_R.ndWW5.UlfIShYhdlb0hfqkJ zxM1DDhm4_3CA5bKElKA29U9353rr9ocAZE0hm2DEEWSTQllqJ3cCtcKjeoOr0E8UFwi6x4VIpV4 NS7Nb_563U_i9oEJE7ucID4iR2xxtKa_2UH_8a82ghVwjHJ9tdJnJRZ3xdCM6LekhPYq73d7wNbZ Fd__aMIl021gr6mVGd90tMjS5iu.yz.6B0EYbg065Bax3qFoKebJqDVixns.yM9APzXBcJv2.1bN Us2D6BahOo_CxHox.K7QbC.VU7jJUA0FVvVpYn3tIW3Bs4Ihtf7VHULYqni9KFTirOFbsRVM9Tz6 RjNvJO_8RIZXK2ucjENimeYuleDtYo6g0YcDWQBWvsFD6SUDhXX36dqA.J88kFY_etlq9t2AIJly FSwRZl02XU3ZscxsQLI1cH218SEN4S0rxYZp7hZV4alwjcU5YZ6uAPCSD4_e6MEXPQLZN6nBZC6y sqgfH1_H22IYxg7JDYi6AM0Tk1lcg8nKLE0g9AqOM9KYda17o4etBzK_AmwvWzcU2.lRXvtzrLjD vreHvtRlU3Estnhwm1EC96Jx1PGCOcDoBb5ahcHt7xB9h1uREAQKbA.D6iE1Rh.d5yHtHuGr20xw eKsnCfOmv_im7NjHv_7KT0PBl1EFj_bRLqhFmH.3Ypwei7v1tlZBTw7HxVrzU.eyR72_J.de5DLb EcTawSkW5s5UbhYSyhggiFdFE4U4jY8P1wG0sECxjDA3g7GwLf0acgyS36BDTRwv4SiNEd7QIl4j 7eASqnwbMs6RYDXdeY8_Hr10Cyw9EdS6gszJpJY.EVt3A4YlwotCB._0TC1UgLUKTjrPdKR153_L sgW7Fkw9v30nrOIIO0jUTZJTakaPjkvjpOS3ctPXxXB6ZhS.N5nt33jqzor0- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.gq1.yahoo.com with HTTP; Sun, 3 May 2020 01:46:58 +0000 Received: by smtp427.mail.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID bd44885a1276e2c9781055283e56c150; Sun, 03 May 2020 01:46:55 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 Message-Id: Date: Sat, 2 May 2020 18:46:54 -0700 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) References: X-Rspamd-Queue-Id: 49F84460Ppz41Q6 X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.28 / 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)[]; RCPT_COUNT_FIVE(0.00)[5]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; 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.87)[-0.873,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.91)[-0.909,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (5.87), 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)[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.29 Precedence: list List-Id: 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, 03 May 2020 01:47:03 -0000 [I'm only claiming the new jemalloc is involved and that reverting avoids the problem.] I've been reporting to some lists problems with: dhclient sendmail rpcbind mountd nfsd getting SIGSEGV (signal 11) crashes and some core dumps on the old 2-socket (1 core per socket) 32-bit PowerMac G4 running head -r360311. Mika=C3=ABl Urankar sent a note suggesting that I try testing reverting head -r360233 for my head -r360311 context. He got it right . . . Context: The problem was noticed by an inability to have other machines do a: mount -onoatime,soft OLDPOWERMAC-LOCAL-IP:/... /mnt sort of operation and to have succeed. By contrast, on the old PowerMac G4 I could initiate mounts against other machines just fine. I do not see any such problems on any of (all based on head -r360311): powerpc64 (old PowerMac G5 2-sockets with 2 cores each) armv7 (OrangePi+ 2ed) aarch64 (Rock64, RPi4, RPi3, OverDrive 1000, Macchiatobin Double Shot) amd64 (ThreadRipper 1950X) So I expect something 32-bit powerpc specific is somehow involved, even if jemalloc is only using whatever it is. (A kyua run with a debug kernel did not find other unexpected signal 11 sources on the 32-bit PowerMac compared to past kyua runs, at least that I noticed. There were a few lock order reversals that I do not know if they are expected or known-safe or not. I've reported those reversals to the lists as well.) Recent experiments based on the suggestion: Doing the buildworld, buildkernel and installing just the new kernel and rebooting made no difference. But then installing the new world and rebooting did make things work again: I no longer get core files for the likes of (old cores from before the update): # find / -name "*.core" -print /var/spool/clientmqueue/sendmail.core /rpcbind.core /mountd.core /nfsd.core Nor do I see the various notices for sendmail signal 11's that did not leave behind a core file --or for dhclient (no core file left behind). And I can mount the old PowerMac's drive from other machines just fine. Other notes: I do not actively use sendmail but it was left to do its default things, partially to test if such default things are working. Unfortunately, PowerMacs have a problematical status under FreeBSD and my context has my historical experiments with avoiding various problems. =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 Sun May 3 03:44: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 D76942D20C1; Sun, 3 May 2020 03:44:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49FBgN5L6Rz492h; Sun, 3 May 2020 03:44:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B28494D2C; Sun, 3 May 2020 03:44:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0433iGq2030903; Sun, 3 May 2020 03:44:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0433iGiu030902; Sun, 3 May 2020 03:44:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005030344.0433iGiu030902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 3 May 2020 03:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360594 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 360594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 03:44:16 -0000 Author: emaste Date: Sun May 3 03:44:16 2020 New Revision: 360594 URL: https://svnweb.freebsd.org/changeset/base/360594 Log: ipfw: whitespace fix in SCTP_ABORT_ASSOCIATION case statement comment Submitted by: Neel Chauhan Reviewed by: rgrimes, tuexen MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24602 Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Sun May 3 03:35:10 2020 (r360593) +++ head/sys/netpfil/ipfw/ip_fw2.c Sun May 3 03:44:16 2020 (r360594) @@ -937,7 +937,7 @@ send_reject6(struct ip_fw_args *args, int code, u_int * If the packet contains an ABORT chunk, don't * reply. * XXX: We should search through all chunks, - * but don't do to avoid attacks. + * but do not do that to avoid attacks. */ v_tag = 0; break; @@ -1055,7 +1055,7 @@ send_reject(struct ip_fw_args *args, int code, int ipl * If the packet contains an ABORT chunk, don't * reply. * XXX: We should search through all chunks, - * but don't do to avoid attacks. + * but do not do that to avoid attacks. */ v_tag = 0; break; From owner-svn-src-head@freebsd.org Sun May 3 04:22: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 AF95B2D326C; Sun, 3 May 2020 04:22:27 +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 49FCWR43NFz4CYJ; Sun, 3 May 2020 04:22:27 +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 864DB54D1; Sun, 3 May 2020 04:22:27 +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 0434MR73055620; Sun, 3 May 2020 04:22:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0434MRLN055619; Sun, 3 May 2020 04:22:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202005030422.0434MRLN055619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 May 2020 04:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360600 - 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: 360600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 04:22:27 -0000 Author: imp Date: Sun May 3 04:22:27 2020 New Revision: 360600 URL: https://svnweb.freebsd.org/changeset/base/360600 Log: We need to hold the periph lock when we release the ccb (and when we run it). Make sure that we do. Simplify the flow a bit, and fix a comment since we do need to do these things. Noticed by: cperciva (not sure why my invariants kernel didn't trigger) Modified: head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Sun May 3 04:03:05 2020 (r360599) +++ head/sys/cam/nvme/nvme_da.c Sun May 3 04:22:27 2020 (r360600) @@ -426,26 +426,26 @@ ndaioctl(struct disk *dp, u_long cmd, void *data, int */ memset(&mapinfo, 0, sizeof(mapinfo)); error = cam_periph_mapmem(ccb, &mapinfo, maxmap); - if (error) { - xpt_release_ccb(ccb); - return (error); - } + if (error) + goto out; /* - * Lock the periph and run the command. XXX do we need - * to lock the periph? + * Lock the periph and run the command. */ cam_periph_lock(periph); - cam_periph_runccb(ccb, NULL, CAM_RETRY_SELTO, SF_RETRY_UA | SF_NO_PRINT, - NULL); - cam_periph_unlock(periph); + cam_periph_runccb(ccb, NULL, CAM_RETRY_SELTO, + SF_RETRY_UA | SF_NO_PRINT, NULL); /* * Tear down mapping and return status. */ + cam_periph_unlock(periph); cam_periph_unmapmem(ccb, &mapinfo); error = (ccb->ccb_h.status == CAM_REQ_CMP) ? 0 : EIO; +out: + cam_periph_lock(periph); xpt_release_ccb(ccb); + cam_periph_unlock(periph); return (error); } default: From owner-svn-src-head@freebsd.org Sun May 3 05:26: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 3A6802D4612; Sun, 3 May 2020 05:26:07 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) (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 49FDwv0kqQz4GLt; Sun, 3 May 2020 05:26:06 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pf1-x443.google.com with SMTP id p25so3850329pfn.11; Sat, 02 May 2020 22:26:06 -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:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=Eb9Fw5lCHEI51TZkU7x1GQrPYrXU/QLGPABfUlpTaNA=; b=sIUWTQcbCm7i39Zqk79RSu3Z2a7Qq3fdGjU1o3868tsgGhc8w+Uqg2uAzhQ44npk4W 7foiKIVn2N8GNEden3W+PODZAlIfg60B6PMtfAP1TjCDmmZsmVIV2wk13FC5SybGFuSF LfV3Ssh9q+ge75Bfjc2izVHKv3qwQ+KocmlMzoPtTUzDTesedh275s2oozgEko6q8lYn O7EJYak/HBaDM5iAyqRUv8qksJlgwsSlmEcmlReVXg+LNKF2Rhu+9nRds5g1wCcYCBC6 sHmEANkNPyjJdcxF7XaRhUSEfEZd9jco3V+vR8wk9RWIzJebSUv6TngGFIvJi0yUjiE3 wxNg== 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 :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=Eb9Fw5lCHEI51TZkU7x1GQrPYrXU/QLGPABfUlpTaNA=; b=iE85baQiCubbShyb9nf/pTF7R1UbTHzkXYCl2QAyysWm6vN5uW6b1vcmdnkpM95mWT Pi/xeQsAsHxuP8Okiyc+1UK6hIYEOp9GOfPI+jBtdbySocwfDWVNNkumM/1X4Wj/VB3p aebw+KEMZpbYciaQMDnli0OAyj0AUfgXu/OFwetfy7Yo0rNG+SuroFvQS4jFGm44JYK4 B4yMSdgUZeG4lqI9p1m/VGa+1Fc6wBfqFMKuKw2XeIaoNovtxi9wgweCk77t82+N4xZV RVo3POwlGZD71Uq/D/uz2alOGdFuoH8UAs+O2UelyX0nB90TaokkgBTfSY62ugYT4Ppw xeKQ== X-Gm-Message-State: AGi0PuajFteChuSyP25nyrsvULf24KB83Cl8tke0EzktLmk1RHwmngm1 pnYM3chJIAyZndz3AYpAVycyEwzH X-Google-Smtp-Source: APiQypIZRkIQOOJTWQm/r7JOklFb7f+qjb8MQG55F0VSBK6pKdnkWQL4y9mk+/ar7LFuyPyplLnEhA== X-Received: by 2002:a63:1705:: with SMTP id x5mr11572208pgl.12.1588483564165; Sat, 02 May 2020 22:26:04 -0700 (PDT) Received: from x270 ([2601:641:c000:b500::1353]) by smtp.gmail.com with ESMTPSA id b24sm5790323pfi.4.2020.05.02.22.26.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 May 2020 22:26:03 -0700 (PDT) Date: Sat, 2 May 2020 22:25:42 -0700 From: Navdeep Parhar To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360581 - in head/sys: dev/cxgbe dev/cxgbe/crypto dev/cxgbe/tom dev/mlx5/mlx5_en kern netinet sys Message-ID: <20200503052542.GA18955@x270> Mail-Followup-To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005030021.0430LBwu098725@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005030021.0430LBwu098725@repo.freebsd.org> X-Rspamd-Queue-Id: 49FDwv0kqQz4GLt 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.29 Precedence: list List-Id: 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, 03 May 2020 05:26:07 -0000 On Sun, May 03, 2020 at 12:21:11AM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Sun May 3 00:21:11 2020 > New Revision: 360581 > URL: https://svnweb.freebsd.org/changeset/base/360581 > > Log: > Step 4.1: mechanically rename M_NOMAP to M_EXTPG Hello Gleb, This looks incomplete. mbuf.9 still refers to M_NOMAP. ifnet cap is still IFCAP_NOMAP and shown as NOMAP by ifconfig, and ifconfig still uses (-)nomap to enable/disable the capability. This looks a bit gratuitous to me but if you're going to do it then at least use the same name consistently throughout the tree. Regards, Navdeep > > Reviewed by: gallatin > Differential Revision: https://reviews.freebsd.org/D24598 > > Modified: > head/sys/dev/cxgbe/crypto/t4_kern_tls.c > head/sys/dev/cxgbe/t4_sge.c > head/sys/dev/cxgbe/tom/t4_cpl_io.c > head/sys/dev/cxgbe/tom/t4_tls.c > head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c > head/sys/kern/kern_mbuf.c > head/sys/kern/kern_sendfile.c > head/sys/kern/subr_bus_dma.c > head/sys/kern/subr_sglist.c > head/sys/kern/uipc_ktls.c > head/sys/kern/uipc_mbuf.c > head/sys/kern/uipc_sockbuf.c > head/sys/kern/uipc_socket.c > head/sys/netinet/tcp_output.c > head/sys/netinet/tcp_pcap.c > head/sys/sys/mbuf.h > > Modified: head/sys/dev/cxgbe/crypto/t4_kern_tls.c > ============================================================================== > --- head/sys/dev/cxgbe/crypto/t4_kern_tls.c Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/dev/cxgbe/crypto/t4_kern_tls.c Sun May 3 00:21:11 2020 (r360581) > @@ -1208,7 +1208,7 @@ t6_ktls_parse_pkt(struct mbuf *m, int *nsegsp, int *le > > /* Assume all headers are in 'm' for now. */ > MPASS(m->m_next != NULL); > - MPASS(m->m_next->m_flags & M_NOMAP); > + MPASS(m->m_next->m_flags & M_EXTPG); > > tot_len = 0; > > @@ -1218,7 +1218,7 @@ t6_ktls_parse_pkt(struct mbuf *m, int *nsegsp, int *le > */ > *nsegsp = 0; > for (m_tls = m->m_next; m_tls != NULL; m_tls = m_tls->m_next) { > - MPASS(m_tls->m_flags & M_NOMAP); > + MPASS(m_tls->m_flags & M_EXTPG); > > wr_len = ktls_wr_len(tlsp, m, m_tls, &nsegs); > #ifdef VERBOSE_TRACES > @@ -2265,7 +2265,7 @@ t6_ktls_write_wr(struct sge_txq *txq, void *dst, struc > * for that record. > */ > for (m_tls = m->m_next; m_tls != NULL; m_tls = m_tls->m_next) { > - MPASS(m_tls->m_flags & M_NOMAP); > + MPASS(m_tls->m_flags & M_EXTPG); > > /* > * Determine the initial TCP sequence number for this > > Modified: head/sys/dev/cxgbe/t4_sge.c > ============================================================================== > --- head/sys/dev/cxgbe/t4_sge.c Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/dev/cxgbe/t4_sge.c Sun May 3 00:21:11 2020 (r360581) > @@ -2497,7 +2497,7 @@ count_mbuf_nsegs(struct mbuf *m, int skip, uint8_t *cf > skip -= len; > continue; > } > - if ((m->m_flags & M_NOMAP) != 0) { > + if ((m->m_flags & M_EXTPG) != 0) { > *cflags |= MC_NOMAP; > nsegs += count_mbuf_ext_pgs(m, skip, &nextaddr); > skip = 0; > @@ -5836,7 +5836,7 @@ write_ethofld_wr(struct cxgbe_rate_tag *cst, struct fw > immhdrs -= m0->m_len; > continue; > } > - if (m0->m_flags & M_NOMAP) > + if (m0->m_flags & M_EXTPG) > sglist_append_mbuf_epg(&sg, m0, > mtod(m0, vm_offset_t), m0->m_len); > else > > Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c > ============================================================================== > --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Sun May 3 00:21:11 2020 (r360581) > @@ -610,7 +610,7 @@ write_tx_sgl(void *dst, struct mbuf *start, struct mbu > > i = -1; > for (m = start; m != stop; m = m->m_next) { > - if (m->m_flags & M_NOMAP) > + if (m->m_flags & M_EXTPG) > rc = sglist_append_mbuf_epg(&sg, m, > mtod(m, vm_offset_t), m->m_len); > else > @@ -731,7 +731,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep > for (m = sndptr; m != NULL; m = m->m_next) { > int n; > > - if (m->m_flags & M_NOMAP) { > + if (m->m_flags & M_EXTPG) { > #ifdef KERN_TLS > if (m->m_epg_tls != NULL) { > toep->flags |= TPF_KTLS; > @@ -772,7 +772,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep > break; > } > > - if (m->m_flags & M_NOMAP) > + if (m->m_flags & M_EXTPG) > nomap_mbuf_seen = true; > if (max_nsegs_1mbuf < n) > max_nsegs_1mbuf = n; > > Modified: head/sys/dev/cxgbe/tom/t4_tls.c > ============================================================================== > --- head/sys/dev/cxgbe/tom/t4_tls.c Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/dev/cxgbe/tom/t4_tls.c Sun May 3 00:21:11 2020 (r360581) > @@ -1796,7 +1796,7 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, > return; > } > > - KASSERT(m->m_flags & M_NOMAP, ("%s: mbuf %p is not NOMAP", > + KASSERT(m->m_flags & M_EXTPG, ("%s: mbuf %p is not NOMAP", > __func__, m)); > KASSERT(m->m_epg_tls != NULL, > ("%s: mbuf %p doesn't have TLS session", __func__, m)); > > Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c > ============================================================================== > --- head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Sun May 3 00:21:11 2020 (r360581) > @@ -624,7 +624,7 @@ sbtls_recover_record(struct mbuf *mb, int wait, uint32 > > /* check format of incoming mbuf */ > if (mb->m_next == NULL || > - (mb->m_next->m_flags & (M_NOMAP | M_EXT)) != (M_NOMAP | M_EXT)) { > + (mb->m_next->m_flags & (M_EXTPG | M_EXT)) != (M_EXTPG | M_EXT)) { > top = NULL; > goto done; > } > @@ -682,7 +682,7 @@ mlx5e_sq_tls_populate(struct mbuf *mb, uint64_t *pseq) > { > > for (; mb != NULL; mb = mb->m_next) { > - if (!(mb->m_flags & M_NOMAP)) > + if (!(mb->m_flags & M_EXTPG)) > continue; > *pseq = mb->m_epg_seqno; > return (1); > > Modified: head/sys/kern/kern_mbuf.c > ============================================================================== > --- head/sys/kern/kern_mbuf.c Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/kern/kern_mbuf.c Sun May 3 00:21:11 2020 (r360581) > @@ -882,7 +882,7 @@ mb_unmapped_compress(struct mbuf *m) > m->m_ext.ext_free(m); > > /* Turn 'm' into a "normal" mbuf. */ > - m->m_flags &= ~(M_EXT | M_RDONLY | M_NOMAP); > + m->m_flags &= ~(M_EXT | M_RDONLY | M_EXTPG); > m->m_data = m->m_dat; > > /* Copy data back into m. */ > @@ -1071,7 +1071,7 @@ mb_unmapped_to_ext(struct mbuf *top) > for (m = top; m != NULL; m = next) { > /* m might be freed, so cache the next pointer. */ > next = m->m_next; > - if (m->m_flags & M_NOMAP) { > + if (m->m_flags & M_EXTPG) { > if (prev != NULL) { > /* > * Remove 'm' from the new chain so > @@ -1132,7 +1132,7 @@ mb_alloc_ext_pgs(int how, m_ext_free_t ext_free) > m->m_epg_tls = NULL; > m->m_epg_so = NULL; > m->m_data = NULL; > - m->m_flags |= (M_EXT | M_RDONLY | M_NOMAP); > + m->m_flags |= (M_EXT | M_RDONLY | M_EXTPG); > m->m_ext.ext_type = EXT_PGS; > m->m_ext.ext_flags = EXT_FLAG_EMBREF; > m->m_ext.ext_count = 1; > > Modified: head/sys/kern/kern_sendfile.c > ============================================================================== > --- head/sys/kern/kern_sendfile.c Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/kern/kern_sendfile.c Sun May 3 00:21:11 2020 (r360581) > @@ -845,7 +845,7 @@ retry_space: > #ifdef KERN_TLS > if (tls != NULL) > mh = m_uiotombuf(hdr_uio, M_WAITOK, space, > - tls->params.max_frame_len, M_NOMAP); > + tls->params.max_frame_len, M_EXTPG); > else > #endif > mh = m_uiotombuf(hdr_uio, M_WAITOK, > > Modified: head/sys/kern/subr_bus_dma.c > ============================================================================== > --- head/sys/kern/subr_bus_dma.c Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/kern/subr_bus_dma.c Sun May 3 00:21:11 2020 (r360581) > @@ -184,7 +184,7 @@ _bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmama > error = 0; > for (m = m0; m != NULL && error == 0; m = m->m_next) { > if (m->m_len > 0) { > - if ((m->m_flags & M_NOMAP) != 0) > + if ((m->m_flags & M_EXTPG) != 0) > error = _bus_dmamap_load_mbuf_epg(dmat, > map, m, segs, nsegs, flags); > else > > Modified: head/sys/kern/subr_sglist.c > ============================================================================== > --- head/sys/kern/subr_sglist.c Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/kern/subr_sglist.c Sun May 3 00:21:11 2020 (r360581) > @@ -451,7 +451,7 @@ sglist_append_mbuf(struct sglist *sg, struct mbuf *m0) > SGLIST_SAVE(sg, save); > for (m = m0; m != NULL; m = m->m_next) { > if (m->m_len > 0) { > - if ((m->m_flags & M_NOMAP) != 0) > + if ((m->m_flags & M_EXTPG) != 0) > error = sglist_append_mbuf_epg(sg, m, > mtod(m, vm_offset_t), m->m_len); > else > > Modified: head/sys/kern/uipc_ktls.c > ============================================================================== > --- head/sys/kern/uipc_ktls.c Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/kern/uipc_ktls.c Sun May 3 00:21:11 2020 (r360581) > @@ -1289,7 +1289,7 @@ ktls_seq(struct sockbuf *sb, struct mbuf *m) > { > > for (; m != NULL; m = m->m_next) { > - KASSERT((m->m_flags & M_NOMAP) != 0, > + KASSERT((m->m_flags & M_EXTPG) != 0, > ("ktls_seq: mapped mbuf %p", m)); > > m->m_epg_seqno = sb->sb_tls_seqno; > @@ -1334,7 +1334,7 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, > * TLS frames require unmapped mbufs to store session > * info. > */ > - KASSERT((m->m_flags & M_NOMAP) != 0, > + KASSERT((m->m_flags & M_EXTPG) != 0, > ("ktls_frame: mapped mbuf %p (top = %p)\n", m, top)); > > tls_len = m->m_len; > @@ -1448,8 +1448,8 @@ ktls_enqueue(struct mbuf *m, struct socket *so, int pa > struct ktls_wq *wq; > bool running; > > - KASSERT(((m->m_flags & (M_NOMAP | M_NOTREADY)) == > - (M_NOMAP | M_NOTREADY)), > + KASSERT(((m->m_flags & (M_EXTPG | M_NOTREADY)) == > + (M_EXTPG | M_NOTREADY)), > ("ktls_enqueue: %p not unready & nomap mbuf\n", m)); > KASSERT(page_count != 0, ("enqueueing TLS mbuf with zero page count")); > > @@ -1518,8 +1518,8 @@ ktls_encrypt(struct mbuf *top) > KASSERT(m->m_epg_tls == tls, > ("different TLS sessions in a single mbuf chain: %p vs %p", > tls, m->m_epg_tls)); > - KASSERT((m->m_flags & (M_NOMAP | M_NOTREADY)) == > - (M_NOMAP | M_NOTREADY), > + KASSERT((m->m_flags & (M_EXTPG | M_NOTREADY)) == > + (M_EXTPG | M_NOTREADY), > ("%p not unready & nomap mbuf (top = %p)\n", m, top)); > KASSERT(npages + m->m_epg_npgs <= total_pages, > ("page count mismatch: top %p, total_pages %d, m %p", top, > > Modified: head/sys/kern/uipc_mbuf.c > ============================================================================== > --- head/sys/kern/uipc_mbuf.c Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/kern/uipc_mbuf.c Sun May 3 00:21:11 2020 (r360581) > @@ -220,7 +220,7 @@ mb_dupcl(struct mbuf *n, struct mbuf *m) > } > > n->m_flags |= M_EXT; > - n->m_flags |= m->m_flags & (M_RDONLY | M_NOMAP); > + n->m_flags |= m->m_flags & (M_RDONLY | M_EXTPG); > > /* See if this is the mbuf that holds the embedded refcount. */ > if (m->m_ext.ext_flags & EXT_FLAG_EMBREF) { > @@ -265,7 +265,7 @@ m_demote(struct mbuf *m0, int all, int flags) > if (m->m_flags & M_PKTHDR) > m_demote_pkthdr(m); > m->m_flags = m->m_flags & (M_EXT | M_RDONLY | M_NOFREE | > - M_NOMAP | flags); > + M_EXTPG | flags); > } > } > > @@ -396,7 +396,7 @@ m_move_pkthdr(struct mbuf *to, struct mbuf *from) > m_tag_delete_chain(to, NULL); > #endif > to->m_flags = (from->m_flags & M_COPYFLAGS) | > - (to->m_flags & (M_EXT | M_NOMAP)); > + (to->m_flags & (M_EXT | M_EXTPG)); > if ((to->m_flags & M_EXT) == 0) > to->m_data = to->m_pktdat; > to->m_pkthdr = from->m_pkthdr; /* especially tags */ > @@ -435,7 +435,7 @@ m_dup_pkthdr(struct mbuf *to, const struct mbuf *from, > m_tag_delete_chain(to, NULL); > #endif > to->m_flags = (from->m_flags & M_COPYFLAGS) | > - (to->m_flags & (M_EXT | M_NOMAP)); > + (to->m_flags & (M_EXT | M_EXTPG)); > if ((to->m_flags & M_EXT) == 0) > to->m_data = to->m_pktdat; > to->m_pkthdr = from->m_pkthdr; > @@ -645,7 +645,7 @@ m_copydata(const struct mbuf *m, int off, int len, cad > while (len > 0) { > KASSERT(m != NULL, ("m_copydata, length > size of mbuf chain")); > count = min(m->m_len - off, len); > - if ((m->m_flags & M_NOMAP) != 0) > + if ((m->m_flags & M_EXTPG) != 0) > m_copyfromunmapped(m, off, count, cp); > else > bcopy(mtod(m, caddr_t) + off, cp, count); > @@ -743,7 +743,7 @@ m_cat(struct mbuf *m, struct mbuf *n) > m = m->m_next; > while (n) { > if (!M_WRITABLE(m) || > - (n->m_flags & M_NOMAP) != 0 || > + (n->m_flags & M_EXTPG) != 0 || > M_TRAILINGSPACE(m) < n->m_len) { > /* just join the two chains */ > m->m_next = n; > @@ -861,7 +861,7 @@ m_pullup(struct mbuf *n, int len) > int count; > int space; > > - KASSERT((n->m_flags & M_NOMAP) == 0, > + KASSERT((n->m_flags & M_EXTPG) == 0, > ("%s: unmapped mbuf %p", __func__, n)); > > /* > @@ -1429,7 +1429,7 @@ frags_per_mbuf(struct mbuf *m) > { > int frags; > > - if ((m->m_flags & M_NOMAP) == 0) > + if ((m->m_flags & M_EXTPG) == 0) > return (1); > > /* > @@ -1718,7 +1718,7 @@ m_uiotombuf(struct uio *uio, int how, int len, int ali > ssize_t total; > int progress = 0; > > - if (flags & M_NOMAP) > + if (flags & M_EXTPG) > return (m_uiotombuf_nomap(uio, how, len, align, flags)); > > /* > @@ -1840,7 +1840,7 @@ m_mbuftouio(struct uio *uio, const struct mbuf *m, int > for (; m != NULL; m = m->m_next) { > length = min(m->m_len, total - progress); > > - if ((m->m_flags & M_NOMAP) != 0) > + if ((m->m_flags & M_EXTPG) != 0) > error = m_unmappedtouio(m, 0, uio, length); > else > error = uiomove(mtod(m, void *), length, uio); > > Modified: head/sys/kern/uipc_sockbuf.c > ============================================================================== > --- head/sys/kern/uipc_sockbuf.c Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/kern/uipc_sockbuf.c Sun May 3 00:21:11 2020 (r360581) > @@ -124,8 +124,8 @@ sbready_compress(struct sockbuf *sb, struct mbuf *m0, > #ifdef KERN_TLS > /* Try to coalesce adjacent ktls mbuf hdr/trailers. */ > if ((n != NULL) && (n != end) && (m->m_flags & M_EOR) == 0 && > - (m->m_flags & M_NOMAP) && > - (n->m_flags & M_NOMAP) && > + (m->m_flags & M_EXTPG) && > + (n->m_flags & M_EXTPG) && > !mbuf_has_tls_session(m) && > !mbuf_has_tls_session(n)) { > int hdr_len, trail_len; > @@ -146,7 +146,7 @@ sbready_compress(struct sockbuf *sb, struct mbuf *m0, > #endif > > /* Compress small unmapped mbufs into plain mbufs. */ > - if ((m->m_flags & M_NOMAP) && m->m_len <= MLEN && > + if ((m->m_flags & M_EXTPG) && m->m_len <= MLEN && > !mbuf_has_tls_session(m)) { > MPASS(m->m_flags & M_EXT); > ext_size = m->m_ext.ext_size; > @@ -158,7 +158,7 @@ sbready_compress(struct sockbuf *sb, struct mbuf *m0, > > while ((n != NULL) && (n != end) && (m->m_flags & M_EOR) == 0 && > M_WRITABLE(m) && > - (m->m_flags & M_NOMAP) == 0 && > + (m->m_flags & M_EXTPG) == 0 && > !mbuf_has_tls_session(n) && > !mbuf_has_tls_session(m) && > n->m_len <= MCLBYTES / 4 && /* XXX: Don't copy too much */ > @@ -1172,7 +1172,7 @@ sbcompress(struct sockbuf *sb, struct mbuf *m, struct > M_WRITABLE(n) && > ((sb->sb_flags & SB_NOCOALESCE) == 0) && > !(m->m_flags & M_NOTREADY) && > - !(n->m_flags & (M_NOTREADY | M_NOMAP)) && > + !(n->m_flags & (M_NOTREADY | M_EXTPG)) && > !mbuf_has_tls_session(m) && > !mbuf_has_tls_session(n) && > m->m_len <= MCLBYTES / 4 && /* XXX: Don't copy too much */ > @@ -1189,7 +1189,7 @@ sbcompress(struct sockbuf *sb, struct mbuf *m, struct > m = m_free(m); > continue; > } > - if (m->m_len <= MLEN && (m->m_flags & M_NOMAP) && > + if (m->m_len <= MLEN && (m->m_flags & M_EXTPG) && > (m->m_flags & M_NOTREADY) == 0 && > !mbuf_has_tls_session(m)) > (void)mb_unmapped_compress(m); > > Modified: head/sys/kern/uipc_socket.c > ============================================================================== > --- head/sys/kern/uipc_socket.c Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/kern/uipc_socket.c Sun May 3 00:21:11 2020 (r360581) > @@ -1691,7 +1691,7 @@ restart: > if (tls != NULL) { > top = m_uiotombuf(uio, M_WAITOK, space, > tls->params.max_frame_len, > - M_NOMAP | > + M_EXTPG | > ((flags & MSG_EOR) ? M_EOR : 0)); > if (top != NULL) { > ktls_frame(top, tls, > @@ -2159,7 +2159,7 @@ dontblock: > SBLASTRECORDCHK(&so->so_rcv); > SBLASTMBUFCHK(&so->so_rcv); > SOCKBUF_UNLOCK(&so->so_rcv); > - if ((m->m_flags & M_NOMAP) != 0) > + if ((m->m_flags & M_EXTPG) != 0) > error = m_unmappedtouio(m, moff, uio, (int)len); > else > error = uiomove(mtod(m, char *) + moff, > > Modified: head/sys/netinet/tcp_output.c > ============================================================================== > --- head/sys/netinet/tcp_output.c Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/netinet/tcp_output.c Sun May 3 00:21:11 2020 (r360581) > @@ -1911,7 +1911,7 @@ tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *ple > top = NULL; > pkthdrlen = NULL; > #ifdef KERN_TLS > - if (hw_tls && (m->m_flags & M_NOMAP)) > + if (hw_tls && (m->m_flags & M_EXTPG)) > tls = m->m_epg_tls; > else > tls = NULL; > @@ -1928,7 +1928,7 @@ tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *ple > } > #ifdef KERN_TLS > if (hw_tls) { > - if (m->m_flags & M_NOMAP) > + if (m->m_flags & M_EXTPG) > ntls = m->m_epg_tls; > else > ntls = NULL; > @@ -1961,14 +1961,14 @@ tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *ple > mlen = min(len, m->m_len - off); > if (seglimit) { > /* > - * For M_NOMAP mbufs, add 3 segments > + * For M_EXTPG mbufs, add 3 segments > * + 1 in case we are crossing page boundaries > * + 2 in case the TLS hdr/trailer are used > * It is cheaper to just add the segments > * than it is to take the cache miss to look > * at the mbuf ext_pgs state in detail. > */ > - if (m->m_flags & M_NOMAP) { > + if (m->m_flags & M_EXTPG) { > fragsize = min(segsize, PAGE_SIZE); > frags = 3; > } else { > > Modified: head/sys/netinet/tcp_pcap.c > ============================================================================== > --- head/sys/netinet/tcp_pcap.c Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/netinet/tcp_pcap.c Sun May 3 00:21:11 2020 (r360581) > @@ -384,7 +384,7 @@ tcp_pcap_add(struct tcphdr *th, struct mbuf *m, struct > __func__, n->m_flags)); > n->m_data = n->m_dat + M_LEADINGSPACE_NOWRITE(m); > n->m_len = m->m_len; > - if (m->m_flags & M_NOMAP) > + if (m->m_flags & M_EXTPG) > m_copydata(m, 0, m->m_len, n->m_data); > else > bcopy(M_START(m), n->m_dat, > > Modified: head/sys/sys/mbuf.h > ============================================================================== > --- head/sys/sys/mbuf.h Sun May 3 00:15:18 2020 (r360580) > +++ head/sys/sys/mbuf.h Sun May 3 00:21:11 2020 (r360581) > @@ -450,7 +450,7 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgof > #define M_MCAST 0x00000020 /* send/received as link-level multicast */ > #define M_PROMISC 0x00000040 /* packet was not for us */ > #define M_VLANTAG 0x00000080 /* ether_vtag is valid */ > -#define M_NOMAP 0x00000100 /* mbuf data is unmapped */ > +#define M_EXTPG 0x00000100 /* has array of unmapped pages and TLS */ > #define M_NOFREE 0x00000200 /* do not free mbuf, embedded in cluster */ > #define M_TSTMP 0x00000400 /* rcv_tstmp field is valid */ > #define M_TSTMP_HPREC 0x00000800 /* rcv_tstmp is high-prec, typically > @@ -491,7 +491,7 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgof > */ > #define M_FLAG_BITS \ > "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_BCAST\6M_MCAST" \ > - "\7M_PROMISC\10M_VLANTAG\11M_NOMAP\12M_NOFREE\13M_TSTMP\14M_TSTMP_HPREC\15M_TSTMP_LRO" > + "\7M_PROMISC\10M_VLANTAG\11M_EXTPG\12M_NOFREE\13M_TSTMP\14M_TSTMP_HPREC\15M_TSTMP_LRO" > #define M_FLAG_PROTOBITS \ > "\16M_PROTO1\17M_PROTO2\20M_PROTO3\21M_PROTO4" \ > "\22M_PROTO5\23M_PROTO6\24M_PROTO7\25M_PROTO8\26M_PROTO9" \ > @@ -1038,7 +1038,7 @@ m_extrefcnt(struct mbuf *m) > * be both the local data payload, or an external buffer area, depending on > * whether M_EXT is set). > */ > -#define M_WRITABLE(m) (((m)->m_flags & (M_RDONLY | M_NOMAP)) == 0 && \ > +#define M_WRITABLE(m) (((m)->m_flags & (M_RDONLY | M_EXTPG)) == 0 && \ > (!(((m)->m_flags & M_EXT)) || \ > (m_extrefcnt(m) == 1))) > > @@ -1061,7 +1061,7 @@ m_extrefcnt(struct mbuf *m) > * handling external storage, packet-header mbufs, and regular data mbufs. > */ > #define M_START(m) \ > - (((m)->m_flags & M_NOMAP) ? NULL : \ > + (((m)->m_flags & M_EXTPG) ? NULL : \ > ((m)->m_flags & M_EXT) ? (m)->m_ext.ext_buf : \ > ((m)->m_flags & M_PKTHDR) ? &(m)->m_pktdat[0] : \ > &(m)->m_dat[0]) > @@ -1559,7 +1559,7 @@ static inline bool > mbuf_has_tls_session(struct mbuf *m) > { > > - if (m->m_flags & M_NOMAP) { > + if (m->m_flags & M_EXTPG) { > MBUF_EXT_PGS_ASSERT(m); > if (m->m_epg_tls != NULL) { > return (true); From owner-svn-src-head@freebsd.org Sun May 3 08:26: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 E598F2D7A78 for ; Sun, 3 May 2020 08:26:19 +0000 (UTC) (envelope-from nonameless@ukr.net) Received: from frv196.fwdcdn.com (frv196.fwdcdn.com [212.42.77.196]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "*.ukr.net", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49FJwp1Gv9z4Pqw for ; Sun, 3 May 2020 08:26:17 +0000 (UTC) (envelope-from nonameless@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=ffe; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id: References:In-Reply-To:Cc:To:Subject:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=cTqMXKxtjm3PrzRBzX+3tC1Nj0fVsf476tQZl60eRbs=; b=eiiVOJyeHu7/9m/xGHdz42AJoT k8yIWEQZ6XyDhUbWwLYxE2tjppmkM8UqQMmXLVkJp2l0sxApeuiT+AMW0CJ5TGkWUBKyqhcLxIPyD 1+DRyDzOx/0gnxb8GbtzfJUAJiT0PyJXZI9Op7NYQIQ2hyvhITTxAR96zlhSaINlUPzg=; Received: from [10.10.80.12] (helo=frv55.fwdcdn.com) by frv196.fwdcdn.com with smtp ID 1jV9wv-000OLd-MJ for svn-src-head@freebsd.org; Sun, 03 May 2020 11:26:09 +0300 Date: Sun, 03 May 2020 11:26:09 +0300 From: nonameless@ukr.net Subject: Re[2]: svn commit: r360233 - in head: contrib/jemalloc . . . : This partially breaks a 2-socket 32-bit powerpc (old PowerMac G4) based on head -r360311 To: Mark Millard Cc: =?us-ascii?q?vangyzen=40freebsd=2Eorg?= , svn-src-head@freebsd.org, FreeBSD Current , FreeBSD Hackers , FreeBSD PowerPC ML Received: from nonameless@ukr.net by frv55.fwdcdn.com; Sun, 03 May 2020 11:26:09 +0300 In-Reply-To: References: X-Reply-Action: reply Message-Id: <1588493689.54538000.et1xl2l8@frv55.fwdcdn.com> X-Mailer: mail.ukr.net 5.0 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: binary X-Rspamd-Queue-Id: 49FJwp1Gv9z4Pqw X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ukr.net header.s=ffe header.b=eiiVOJye; dmarc=pass (policy=none) header.from=ukr.net; spf=pass (mx1.freebsd.org: domain of nonameless@ukr.net designates 212.42.77.196 as permitted sender) smtp.mailfrom=nonameless@ukr.net X-Spamd-Result: default: False [-2.80 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[ukr.net:s=ffe]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; IP_SCORE(0.00)[ipnet: 212.42.77.0/24(-4.88), asn: 8856(-3.91), country: UA(0.07)]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[ukr.net]; R_SPF_ALLOW(-0.20)[+ip4:212.42.77.0/24]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE_FREEMAIL(0.00)[]; CC_EXCESS_QP(1.20)[]; RCPT_COUNT_FIVE(0.00)[6]; DWL_DNSWL_LOW(-1.00)[ukr.net.dwl.dnswl.org : 127.0.5.1]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[ukr.net:+]; DMARC_POLICY_ALLOW(-0.50)[ukr.net,none]; FROM_NO_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; FREEMAIL_TO(0.00)[yahoo.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[ukr.net]; ASN(0.00)[asn:8856, ipnet:212.42.77.0/24, country:UA]; RCVD_TLS_LAST(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 08:26:20 -0000 --- Original message --- From: "Mark Millard"  Date: 3 May 2020, 04:47:14 > [I'm only claiming the new jemalloc is involved and that > reverting avoids the problem.] > > I've been reporting to some lists problems with: > > dhclient > sendmail > rpcbind > mountd > nfsd > > getting SIGSEGV (signal 11) crashes and some core > dumps on the old 2-socket (1 core per socket) 32-bit > PowerMac G4 running head -r360311. > > Mikaël Urankar sent a note suggesting that I try > testing reverting head -r360233 for my head -r360311 > context. He got it right . . . > > > Context: > > The problem was noticed by an inability to have > other machines do a: > > mount -onoatime,soft OLDPOWERMAC-LOCAL-IP:/... /mnt > > sort of operation and to have succeed. By contrast, on > the old PowerMac G4 I could initiate mounts against > other machines just fine. > > I do not see any such problems on any of (all based > on head -r360311): > > powerpc64 (old PowerMac G5 2-sockets with 2 cores each) > armv7 (OrangePi+ 2ed) > aarch64 (Rock64, RPi4, RPi3, > OverDrive 1000, > Macchiatobin Double Shot) > amd64 (ThreadRipper 1950X) > > So I expect something 32-bit powerpc specific > is somehow involved, even if jemalloc is only > using whatever it is. > > (A kyua run with a debug kernel did not find other > unexpected signal 11 sources on the 32-bit PowerMac > compared to past kyua runs, at least that I noticed. > There were a few lock order reversals that I do not > know if they are expected or known-safe or not. > I've reported those reversals to the lists as well.) > > > Recent experiments based on the suggestion: > > Doing the buildworld, buildkernel and installing just > the new kernel and rebooting made no difference. > > But then installing the new world and rebooting did > make things work again: I no longer get core files > for the likes of (old cores from before the update): > > # find / -name "*.core" -print > /var/spool/clientmqueue/sendmail.core > /rpcbind.core > /mountd.core > /nfsd.core > > Nor do I see the various notices for sendmail > signal 11's that did not leave behind a core file > --or for dhclient (no core file left behind). > And I can mount the old PowerMac's drive from > other machines just fine. > > > Other notes: > > I do not actively use sendmail but it was left > to do its default things, partially to test if > such default things are working. Unfortunately, > PowerMacs have a problematical status under > FreeBSD and my context has my historical > experiments with avoiding various problems. > > === > Mark Millard > marklmi at yahoo.com > ( dsl-only.net went > away in early 2018-Mar) > Hi Mark, It should be fixed, but not by reverting to old version. We can't stuck on old version because of ancient hardware. I think upstream is not interested in support such hardware. So, it have to patched locally. Thanks. From owner-svn-src-head@freebsd.org Sun May 3 09:54: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 9D4FE2D9691; Sun, 3 May 2020 09:54:21 +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 49FLtP3Xcsz4TwQ; Sun, 3 May 2020 09:54:21 +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 707F092DF; Sun, 3 May 2020 09:54:21 +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 0439sLYg059685; Sun, 3 May 2020 09:54:21 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0439sKLa059680; Sun, 3 May 2020 09:54:20 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005030954.0439sKLa059680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sun, 3 May 2020 09:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360602 - in head/share/man: man7 man8 X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: in head/share/man: man7 man8 X-SVN-Commit-Revision: 360602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 09:54:21 -0000 Author: bcr (doc committer) Date: Sun May 3 09:54:19 2020 New Revision: 360602 URL: https://svnweb.freebsd.org/changeset/base/360602 Log: Add HISTORY sections to build(7), crypto(7), ffs(7), growfs(7), and diskless(8). Submitted by: Gordon Bergling gbergling_gmail.com Approved by: bcr Differential Revision: https://reviews.freebsd.org/D24271 Modified: head/share/man/man7/build.7 head/share/man/man7/crypto.7 head/share/man/man7/ffs.7 head/share/man/man7/growfs.7 head/share/man/man8/diskless.8 Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Sun May 3 08:13:44 2020 (r360601) +++ head/share/man/man7/build.7 Sun May 3 09:54:19 2020 (r360602) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2020 +.Dd May 3, 2020 .Dt BUILD 7 .Os .Sh NAME @@ -833,6 +833,11 @@ cd /usr/src make TARGET_ARCH=armv6 buildworld buildkernel make TARGET_ARCH=armv6 DESTDIR=/clients/arm installworld installkernel .Ed +.Sh HISTORY +The +.Nm +manpage first appeared in +.Fx 4.3 . .Sh SEE ALSO .Xr cc 1 , .Xr install 1 , Modified: head/share/man/man7/crypto.7 ============================================================================== --- head/share/man/man7/crypto.7 Sun May 3 08:13:44 2020 (r360601) +++ head/share/man/man7/crypto.7 Sun May 3 09:54:19 2020 (r360602) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2020 +.Dd May 3, 2020 .Dt CRYPTO 7 .Os .Sh NAME @@ -112,6 +112,11 @@ as defined in NIST SP 800-38E. NOTE: The ciphertext stealing part is not implemented which is why this cipher is listed as having a block size of 16 instead of 1. .El +.Sh HISTORY +The +.Nm +manpage first appeared in +.Fx 10.1 . .Sh SEE ALSO .Xr crypto 4 , .Xr crypto 9 Modified: head/share/man/man7/ffs.7 ============================================================================== --- head/share/man/man7/ffs.7 Sun May 3 08:13:44 2020 (r360601) +++ head/share/man/man7/ffs.7 Sun May 3 09:54:19 2020 (r360602) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 25, 2019 +.Dd May 3, 2020 .Dt FFS 7 .Os .Sh NAME @@ -288,6 +288,11 @@ Enable support for the rearrangement of blocks to be contiguous. .Pq Default: 1 . .El +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 4.5 . .Sh SEE ALSO .Xr quota 1 , .Xr acl 3 , Modified: head/share/man/man7/growfs.7 ============================================================================== --- head/share/man/man7/growfs.7 Sun May 3 08:13:44 2020 (r360601) +++ head/share/man/man7/growfs.7 Sun May 3 09:54:19 2020 (r360602) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2014 +.Dd May 3, 2020 .Dt GROWFS 7 .Os .Sh NAME @@ -57,6 +57,11 @@ should be mounted prior to running the script. .Pa /etc/rc.conf .Sh EXIT STATUS .Ex -std +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 10.1 . .Sh SEE ALSO .Xr rc.conf 5 .Sh AUTHORS Modified: head/share/man/man8/diskless.8 ============================================================================== --- head/share/man/man8/diskless.8 Sun May 3 08:13:44 2020 (r360601) +++ head/share/man/man8/diskless.8 Sun May 3 09:54:19 2020 (r360602) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2018 +.Dd May 3, 2020 .Dt DISKLESS 8 .Os .Sh NAME @@ -453,6 +453,11 @@ Be warned that using unencrypted to mount root and user partitions may expose information such as encryption keys. +.Sh HISTORY +The +.Nm +environment first appeared in +.Fx 2.2.5 . .Sh SEE ALSO .Xr ethers 5 , .Xr exports 5 , From owner-svn-src-head@freebsd.org Sun May 3 10:16: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 7EAA82D9BDE; Sun, 3 May 2020 10:16:01 +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 49FMMP2q29z4VjS; Sun, 3 May 2020 10:16:01 +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 5BC9B96E3; Sun, 3 May 2020 10:16:01 +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 043AG14f071882; Sun, 3 May 2020 10:16:01 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 043AFwu4071860; Sun, 3 May 2020 10:15:58 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005031015.043AFwu4071860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sun, 3 May 2020 10:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360603 - in head/share/man: man3 man5 man7 man9 X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: in head/share/man: man3 man5 man7 man9 X-SVN-Commit-Revision: 360603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 10:16:01 -0000 Author: bcr (doc committer) Date: Sun May 3 10:15:58 2020 New Revision: 360603 URL: https://svnweb.freebsd.org/changeset/base/360603 Log: Fix various, mostly minor errors in man pages like: - Abbreviated month name in .Dd - position of HISTORY section - alphabetical ordering within SEE ALSO section - adding .Ed before .Sh DESCRIPTION - remove trailing whitespaces - Line break after a sentence stop - Use BSD OS macros instead of hardcoded strings No .Dd bumps as there was no actual content change made in any of these pages. Submitted by: Gordon Bergling gbergling_gmail.com Approved by: bcr Differential Revision: https://reviews.freebsd.org/D24591 Modified: head/share/man/man3/bitstring.3 head/share/man/man3/sigevent.3 head/share/man/man3/timeradd.3 head/share/man/man5/cd9660.5 head/share/man/man5/elf.5 head/share/man/man5/fstab.5 head/share/man/man7/arch.7 head/share/man/man9/DECLARE_MODULE.9 head/share/man/man9/atomic.9 head/share/man/man9/bhnd.9 head/share/man/man9/bus_dma.9 head/share/man/man9/dpcpu.9 head/share/man/man9/getenv.9 head/share/man/man9/iflib.9 head/share/man/man9/kern_testfrwk.9 head/share/man/man9/ofw_graph.9 Modified: head/share/man/man3/bitstring.3 ============================================================================== --- head/share/man/man3/bitstring.3 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man3/bitstring.3 Sun May 3 10:15:58 2020 (r360603) @@ -58,7 +58,7 @@ .\" @(#)bitstring.3 8.1 (Berkeley) 7/19/93 .\" $FreeBSD$ .\" -.Dd Nov 18, 2019 +.Dd November 18, 2019 .Dt BITSTRING 3 .Os .Sh NAME Modified: head/share/man/man3/sigevent.3 ============================================================================== --- head/share/man/man3/sigevent.3 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man3/sigevent.3 Sun May 3 10:15:58 2020 (r360603) @@ -119,13 +119,13 @@ notifications must link against the .Xr mq_notify 2 , .Xr timer_create 2 , .Xr siginfo 3 -.Sh HISTORY -The -.Va sigevent -structure first appeared in -.Fx 3.3 . .Sh STANDARDS The .Vt struct sigevent type conforms to .St -p1003.1-2004 . +.Sh HISTORY +The +.Va sigevent +structure first appeared in +.Fx 3.3 . Modified: head/share/man/man3/timeradd.3 ============================================================================== --- head/share/man/man3/timeradd.3 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man3/timeradd.3 Sun May 3 10:15:58 2020 (r360603) @@ -146,8 +146,8 @@ using the comparison operator given in .Fa CMP , and return the result of that comparison. .Sh SEE ALSO -.Xr gettimeofday 2 , -.Xr clock_gettime 2 +.Xr clock_gettime 2 , +.Xr gettimeofday 2 .Sh HISTORY The .Fn timeradd Modified: head/share/man/man5/cd9660.5 ============================================================================== --- head/share/man/man5/cd9660.5 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man5/cd9660.5 Sun May 3 10:15:58 2020 (r360603) @@ -42,6 +42,7 @@ module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent cd9660_load="YES" +.Ed .Sh DESCRIPTION The .Nm Modified: head/share/man/man5/elf.5 ============================================================================== --- head/share/man/man5/elf.5 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man5/elf.5 Sun May 3 10:15:58 2020 (r360603) @@ -1323,7 +1323,7 @@ Request that address randomization (ASLR) not be perfo See .Xr security 7 . .It NT_FREEBSD_FCTL_PROTMAX_DISABLE Pq Value: 0x02 -Request that +Request that .Xr mmap 2 calls not set PROT_MAX to the initial value of the .Fa prot Modified: head/share/man/man5/fstab.5 ============================================================================== --- head/share/man/man5/fstab.5 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man5/fstab.5 Sun May 3 10:15:58 2020 (r360603) @@ -254,7 +254,7 @@ To delay .Nm swapon for a device until after .Nm savecore -has copied the crash dump to another location, use the +has copied the crash dump to another location, use the .Dq late option. For vnode-backed swap spaces, Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man7/arch.7 Sun May 3 10:15:58 2020 (r360603) @@ -450,7 +450,9 @@ is defined to be mips for all the flavors of mips that since we support them all with a shared set of sources. While amd64 and i386 are closely related, MACHINE_CPUARCH is not x86 for them. -The FreeBSD source base supports amd64 and i386 with two +The +.Fx +source base supports amd64 and i386 with two distinct source bases living in subdirectories named amd64 and i386 (though behind the scenes there's some sharing that fits into this framework). Modified: head/share/man/man9/DECLARE_MODULE.9 ============================================================================== --- head/share/man/man9/DECLARE_MODULE.9 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man9/DECLARE_MODULE.9 Sun May 3 10:15:58 2020 (r360603) @@ -66,10 +66,11 @@ This declaration should be used by modules which depen the stable kernel KBI (such as ABI emulators or hypervisors that rely on internal kernel structures). .Fn DECLARE_MODULE -will behave like +will behave like .Fn DECLARE_MODULE_TIED -when compiled with modules built with the kernel. This allows locks and -other synchronization primitives to be inlined safely. +when compiled with modules built with the kernel. +This allows locks and other synchronization primitives +to be inlined safely. .Pp The arguments are: .Bl -tag -width indent Modified: head/share/man/man9/atomic.9 ============================================================================== --- head/share/man/man9/atomic.9 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man9/atomic.9 Sun May 3 10:15:58 2020 (r360603) @@ -272,7 +272,9 @@ In C11, a release fence by one thread synchronizes wit another thread when an atomic load that is prior to the acquire fence (by program order) reads the value written by an atomic store that is subsequent to the release fence. -In constrast, in FreeBSD, because of the atomicity of ordinary, naturally +In constrast, in +.Fx , +because of the atomicity of ordinary, naturally aligned loads and stores, fences can also be synchronized by ordinary loads and stores. This simplifies the implementation and use of some synchronization Modified: head/share/man/man9/bhnd.9 ============================================================================== --- head/share/man/man9/bhnd.9 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man9/bhnd.9 Sun May 3 10:15:58 2020 (r360603) @@ -857,9 +857,9 @@ The arguments are as follows: .It Fa dev The device requesting ownership of the resources. .It Fa rs -A standard bus resource specification. If all requested resources, are -successfully allocated, this will be updated with the allocated resource -identifiers. +A standard bus resource specification. +If all requested resources, are successfully allocated, +this will be updated with the allocated resource identifiers. .It Fa res If all requested resources are successfully allocated, this will be populated with the allocated Modified: head/share/man/man9/bus_dma.9 ============================================================================== --- head/share/man/man9/bus_dma.9 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man9/bus_dma.9 Sun May 3 10:15:58 2020 (r360603) @@ -685,7 +685,7 @@ on success. .It Fn bus_dma_template_init "*template" "parent" Initializes a .Fa bus_dma_template_t -structure and associates it with an optional +structure and associates it with an optional .Fa parent . The .Fa parent Modified: head/share/man/man9/dpcpu.9 ============================================================================== --- head/share/man/man9/dpcpu.9 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man9/dpcpu.9 Sun May 3 10:15:58 2020 (r360603) @@ -162,4 +162,4 @@ was first introduced by in .Fx 8.0 . This manual page was written by -.An Robert N. M. Watson. +.An Robert N. M. Watson . Modified: head/share/man/man9/getenv.9 ============================================================================== --- head/share/man/man9/getenv.9 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man9/getenv.9 Sun May 3 10:15:58 2020 (r360603) @@ -185,7 +185,7 @@ function stores a copy of the kernel environment varia in the buffer described by .Fa data and -.Fa size. +.Fa size . If the variable does not exist, zero is returned. If the variable exists, Modified: head/share/man/man9/iflib.9 ============================================================================== --- head/share/man/man9/iflib.9 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man9/iflib.9 Sun May 3 10:15:58 2020 (r360603) @@ -7,7 +7,8 @@ .Nd Network Interface Driver Framework .Sh DESCRIPTION .Nm -is a framework for writing network interface drivers for FreeBSD. +is a framework for writing network interface drivers for +.Fx . It is designed to remove a large amount of the boilerplate that is often needed for modern network interface devices, allowing driver authors to focus on the specific code needed for their hardware. @@ -39,4 +40,3 @@ based drivers. .Xr ifnet 9 .Sh AUTHORS .An Benno Rice Aq Mt benno@FreeBSD.org - Modified: head/share/man/man9/kern_testfrwk.9 ============================================================================== --- head/share/man/man9/kern_testfrwk.9 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man9/kern_testfrwk.9 Sun May 3 10:15:58 2020 (r360603) @@ -36,7 +36,9 @@ kld_load kern_testfrwk .\" out and replaced. -CEM So what is this sys/tests directory in the kernel all about? .Pp -Have you ever wanted to test a part of the FreeBSD kernel in some way and you +Have you ever wanted to test a part of the +.Fx +kernel in some way and you had no real way from user-land to make what you want to occur happen? Say an error path or situation where locking occurs in a particular manner that happens only once in a blue moon? Modified: head/share/man/man9/ofw_graph.9 ============================================================================== --- head/share/man/man9/ofw_graph.9 Sun May 3 09:54:19 2020 (r360602) +++ head/share/man/man9/ofw_graph.9 Sun May 3 10:15:58 2020 (r360603) @@ -60,7 +60,8 @@ It will first check node named .Fa port@idx and then fallback on checking the .Fa ports -child for a child node matching the id. If no ports matching +child for a child node matching the id. +If no ports matching .Fa idx is found the function return 0. .Pp @@ -72,8 +73,8 @@ return the endpoint with id .Fa idx . It will first check if there is a single child named .Fa endpoint -and returns it if there is. If there is multiple endpoints it will check -the +and returns it if there is. +If there is multiple endpoints it will check the .Fa reg property and returns the correct .Fa phandle_t @@ -91,10 +92,11 @@ phandle or 0 if none. .Fn ofw_graph_get_device_by_port_ep returns the device associated with the port and endpoint or .Fa NULL -if none. The device driver should have called +if none. +The device driver should have called .Fn OF_device_register_xref before. -.Fn +.Fn .Sh HISTORY The .Nm ofw_graph From owner-svn-src-head@freebsd.org Sun May 3 10:35: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 4F64A2DA133; Sun, 3 May 2020 10:35:37 +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 49FMp112K5z4WhS; Sun, 3 May 2020 10:35:37 +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 1EC609AC1; Sun, 3 May 2020 10:35:37 +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 043AZa98084160; Sun, 3 May 2020 10:35:37 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 043AZaVv084159; Sun, 3 May 2020 10:35:36 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005031035.043AZaVv084159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sun, 3 May 2020 10:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360604 - 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: 360604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 10:35:37 -0000 Author: bcr (doc committer) Date: Sun May 3 10:35:36 2020 New Revision: 360604 URL: https://svnweb.freebsd.org/changeset/base/360604 Log: Add references for the most important man7 pages worth reading to intro(7). Submitted by: Gordon Bergling gbergling_gmail.com Approved by: bcr Differential Revision: https://reviews.freebsd.org/D24649 Modified: head/share/man/man7/intro.7 Modified: head/share/man/man7/intro.7 ============================================================================== --- head/share/man/man7/intro.7 Sun May 3 10:15:58 2020 (r360603) +++ head/share/man/man7/intro.7 Sun May 3 10:35:36 2020 (r360604) @@ -28,7 +28,7 @@ .\" @(#)intro.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd May 3, 2020 .Dt INTRO 7 .Os .Sh NAME @@ -36,6 +36,44 @@ .Nd miscellaneous information pages .Sh DESCRIPTION This section contains miscellaneous documentation. +.Bl -tag -width "mdoc.samples(7)" -offset indent +.It Xr ascii 7 +map of ASCII character set +.It Xr c 7 +the C programming language +.It Xr environ 7 +user environment +.It Xr firewall 7 +simple firewalls under +.Fx +.It Xr hier 7 +file system hierarchy in +.Fx +.It Xr hostname 7 +host name resolution description +.It Xr release 7 +layout of +.Fx +releases and snapshots +.It Xr ports 7 +introduction to the ports infrastructure of +.Fx +.It Xr security 7 +security features available in +.Fx +.It Xr tuning 7 +general advice on tuning +.Fx +.El +.Sh SEE ALSO +.Xr man 1 , +.Xr intro 2 , +.Xr intro 3 , +.Xr intro 4 , +.Xr intro 5 , +.Xr intro 6 , +.Xr intro 8 , +.Xr intro 9 .Sh HISTORY The .Nm From owner-svn-src-head@freebsd.org Sun May 3 14:38: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 E1A072DF059 for ; Sun, 3 May 2020 14:38:14 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic316-54.consmr.mail.gq1.yahoo.com (sonic316-54.consmr.mail.gq1.yahoo.com [98.137.69.30]) (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 49FT9x2Vqfz3Gyx for ; Sun, 3 May 2020 14:38:13 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: GK_At_sVM1nO4_VNufUJRQiRbBHFzGzYXYgVFH083iNk.b.MLZwLCxzQqnnsUNa x_8tvuR148QZ_3Kho53XjSXrKURYdHi6Mepaq0aR7AicR9ZXqrywG9b5VYoZ3p53tjxMKaaPOop0 pvyQ13wozBpoV6BHbme6jU2kelDLsAfqNTMNrWmCLTOFt2EGGIBHBW5hfOC_PN7MuUz0_k9THFAT y6nD1dJ2WZTwHhhXYmheWp7ZRs7pC4ujL0V2OF4_oDk.EvN3u_0qz8MLcU7DYY3tgGURYU7TR5Lg 4Dboz27fxBNRunL70Mv7hTI8MKCqk5oEWYh6PRlYLRDSlfJd.BEGjqPjVBtqHTPf5YZtGInMUolY ERAlV4mcsW.aY9RPf0kHlzjFuIabM2DDPVKlKinsgES2721ZQK9CNodqY8PoF_ZpPVKqjZPHHeVD EufxgxQ.uN.wJeLiOKddrQU_bJ2ALPk3Zn2Ctrd9hk0dPEWqfSlEH3GUcNZciLJ_v1JzOeaGs1b5 J1LNxKNc.vdqOAvNAOO3p9yfHTDhb1pax4SihajEkIys2VqoTL4E83jyVMLqxznBSCVKoLR0MCjP nKP1PhCNcjmj7P2EN7GMGUVq84IzaT2BjwIw_tCL9_4H1L.0k6uAblCxzNw8M2cA9tNK7nq8LtG8 fZTTJg0asx0TtwrpMKs1GzifRDtcRw41L5h2QarqElv4O.WCHXZBXu0Op9VTjJ5pmsHd4aUFEk6H HvUZZcqdKARb9Si2zlMfUyHEd0EH3qHjxCn.fVSYSvca4wpO2vInGnPl3dug7GaiCbhEvmOv4HLo iaNvd6QI2UiyFq0Ude4r4pYClsi2qiFh.usFs_8LDm9CvByvWx5.cPxMY.5VLn9U5kHKqpCtwwrE 3UacgmEl3rIqvX1THtMGWhZT2R1xplGqEvD2H8bS0wtPcyZaiAbuIy6LkGNM.58fn9HDPz4m8vQi xSNZ98UUCqjbrj5WiDIncS3de0AqzHNnQXgcqKYzq_CzJWTogxu0SiPnixGzfEQM.LMFfdcuePiH crHr1ZgP.cRnv9is1apmTGeHkuPs7l9xwhXErNydjgmq.7ebx7UbhQmDGC65uSyZeIKl9PqbQ5RU rhLSjTHbrBMJ3yMtfVAJTm1hN4Yh1LCTpazzGQa3Fhg8_bX281zBoMF9qqo.4eteSvXS5QE_hqci 0jRR3FVq.ammdhNbrjwZ55KrDaLmjcx729KoBqKZROcwXwlDD8qHcGtu8wkcpLuuXDJsGhrWm3dt v4.VXuUtkE.loMX9ZCBtIi0iI2TS8FoqXb3S8.IvI4o69lKXSZsMWG2tNtAgA2xoxfc6StW1dKSX hw0cRa6jpj8IJrdck2.YqCM9DyPZudBQg5oWBjX5Dtw02Mq0_nJspvLkRxCWyR2ffeIlDQm0SGZy I3Ka4EANwc7jutC3H4dTtDuVpAMuFJA30XpUzkCgoqE_c69mBuCy95GmkL7h6 Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.gq1.yahoo.com with HTTP; Sun, 3 May 2020 14:38:11 +0000 Received: by smtp425.mail.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 152cb9da62572901c7e41056e9bc8777; Sun, 03 May 2020 14:38:07 +0000 (UTC) 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: 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: <1588493689.54538000.et1xl2l8@frv55.fwdcdn.com> Date: Sun, 3 May 2020 07:38:06 -0700 Cc: svn-src-head@freebsd.org, FreeBSD Current , FreeBSD Hackers , FreeBSD PowerPC ML Content-Transfer-Encoding: quoted-printable Message-Id: <922FBA7C-039D-4852-AC8F-E85A221C2559@yahoo.com> References: <1588493689.54538000.et1xl2l8@frv55.fwdcdn.com> To: nonameless@ukr.net X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49FT9x2Vqfz3Gyx X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.40 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FREEMAIL_TO(0.00)[ukr.net]; 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(-0.93)[-0.935,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.97)[-0.967,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (3.91), 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)[30.69.137.98.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[30.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.29 Precedence: list List-Id: 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, 03 May 2020 14:38:15 -0000 On 2020-May-3, at 01:26, nonameless at ukr.net wrote: > --- Original message --- > From: "Mark Millard" > Date: 3 May 2020, 04:47:14 >=20 >=20 >=20 >> [I'm only claiming the new jemalloc is involved and that >> reverting avoids the problem.] >>=20 >> I've been reporting to some lists problems with: >>=20 >> dhclient >> sendmail >> rpcbind >> mountd >> nfsd >>=20 >> getting SIGSEGV (signal 11) crashes and some core >> dumps on the old 2-socket (1 core per socket) 32-bit >> PowerMac G4 running head -r360311. >>=20 >> Mika=C3=ABl Urankar sent a note suggesting that I try >> testing reverting head -r360233 for my head -r360311 >> context. He got it right . . . >>=20 >>=20 >> Context: >>=20 >> The problem was noticed by an inability to have >> other machines do a: >>=20 >> mount -onoatime,soft OLDPOWERMAC-LOCAL-IP:/... /mnt >>=20 >> sort of operation and to have succeed. By contrast, on >> the old PowerMac G4 I could initiate mounts against >> other machines just fine. >>=20 >> I do not see any such problems on any of (all based >> on head -r360311): >>=20 >> powerpc64 (old PowerMac G5 2-sockets with 2 cores each) >> armv7 (OrangePi+ 2ed) >> aarch64 (Rock64, RPi4, RPi3, >> OverDrive 1000, >> Macchiatobin Double Shot) >> amd64 (ThreadRipper 1950X) >>=20 >> So I expect something 32-bit powerpc specific >> is somehow involved, even if jemalloc is only >> using whatever it is. >>=20 >> (A kyua run with a debug kernel did not find other >> unexpected signal 11 sources on the 32-bit PowerMac >> compared to past kyua runs, at least that I noticed. >> There were a few lock order reversals that I do not >> know if they are expected or known-safe or not. >> I've reported those reversals to the lists as well.) >>=20 >>=20 >> Recent experiments based on the suggestion: >>=20 >> Doing the buildworld, buildkernel and installing just >> the new kernel and rebooting made no difference. >>=20 >> But then installing the new world and rebooting did >> make things work again: I no longer get core files >> for the likes of (old cores from before the update): >>=20 >> # find / -name "*.core" -print >> /var/spool/clientmqueue/sendmail.core >> /rpcbind.core >> /mountd.core >> /nfsd.core >>=20 >> Nor do I see the various notices for sendmail >> signal 11's that did not leave behind a core file >> --or for dhclient (no core file left behind). >> And I can mount the old PowerMac's drive from >> other machines just fine. >>=20 >>=20 >> Other notes: >>=20 >> I do not actively use sendmail but it was left >> to do its default things, partially to test if >> such default things are working. Unfortunately, >> PowerMacs have a problematical status under >> FreeBSD and my context has my historical >> experiments with avoiding various problems. >>=20 >> =3D=3D=3D >> Mark Millard >> marklmi at yahoo.com >> ( dsl-only.net went >> away in early 2018-Mar) >>=20 >=20 > Hi Mark, >=20 > It should be fixed, but not by reverting to old version. We can't = stuck on old version because of ancient hardware. I think upstream is = not interested in support such hardware. So, it have to patched locally. Observing and reporting the reverting result is an initial part of problem isolation. I made no request for FreeBSD to give up on using the updated jemalloc. (Unfortunately, I'm not sure what a good next step of problem isolation might be for the dual-socket PowerMac G4 context.) Other than reverting, no patch is known for the issue at this point. More problem isolation is needed first. While I do not have access, https://wiki.freebsd.org/powerpc lists more modern 32-bit powerpc hardware as supported: MPC85XX evaluation boards and AmigaOne A1222 (powerpcspe). (The AmigaOne A1222 seems to be dual-ore/single-socket.) So folks with access to one of those may want to see if they also see the problem(s) with head -r360233 or later. Another interesting context to test could be single-socket with just one core. (I might be able to do that on another old PowerMac, booting the same media after moving the media.) If I understand right, the most common 32-bit powerpc tier 2 hardware platforms may still be old PowerMac's. They are considered supported and "mature", instead of just "stable". See https://wiki.freebsd.org/powerpc . However, the reality is that there are various problems for old PowerMacs (32-bit and 64-bit, at least when there is more than one socket present). The wiki page does not hint at such. (I'm not sure about single socket/multi-core PowerMacs: no access to such.) It is certainly possible for some problem to happen that would lead to dropping the supported-status for some or all old 32-bit PowerMacs, even as tier 2. But that has not happened yet and I'd have no say in such a choice. =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 Sun May 3 15:38: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 D8E6D2E05A1 for ; Sun, 3 May 2020 15:38:05 +0000 (UTC) (envelope-from nonameless@ukr.net) Received: from frv196.fwdcdn.com (frv196.fwdcdn.com [212.42.77.196]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "*.ukr.net", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49FVW04V7Tz3Ktq for ; Sun, 3 May 2020 15:38:04 +0000 (UTC) (envelope-from nonameless@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=ffe; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id: References:In-Reply-To:Cc:To:Subject:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=tt42P0Zvr9+bApZvWbmXDXeXrA2RJyFe70eK+5ctp9o=; b=TFeKlFmSnuzfx5sN4ShdwhRQlR FV6a8zSPK4MCmPgnS5lw9I2butpPo1GW8pQopLG6DLCvErOd9ZelUf6trmgY9xhBAvy+V9nBwe4xV 9cEUqNZc1Lg93JqeRRGaiB2iLebjCW9E3b8WQrHpfHkgf+fgcTtViVYVcxUATlkyfGX8=; Received: from [10.10.80.12] (helo=frv55.fwdcdn.com) by frv196.fwdcdn.com with smtp ID 1jVGgr-000FQa-9f for svn-src-head@freebsd.org; Sun, 03 May 2020 18:38:01 +0300 Date: Sun, 03 May 2020 18:38:01 +0300 From: nonameless@ukr.net Subject: Re[2]: svn commit: r360233 - in head: contrib/jemalloc . . . : This partially breaks a 2-socket 32-bit powerpc (old PowerMac G4) based on head -r360311 To: Mark Millard Cc: svn-src-head@freebsd.org, FreeBSD Current , FreeBSD Hackers , FreeBSD PowerPC ML Received: from nonameless@ukr.net by frv55.fwdcdn.com; Sun, 03 May 2020 18:38:01 +0300 In-Reply-To: <922FBA7C-039D-4852-AC8F-E85A221C2559@yahoo.com> References: <1588493689.54538000.et1xl2l8@frv55.fwdcdn.com> <922FBA7C-039D-4852-AC8F-E85A221C2559@yahoo.com> X-Reply-Action: reply Message-Id: <1588519871.700235000.j9rwguqu@frv55.fwdcdn.com> X-Mailer: mail.ukr.net 5.0 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: binary X-Rspamd-Queue-Id: 49FVW04V7Tz3Ktq X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ukr.net header.s=ffe header.b=TFeKlFmS; dmarc=pass (policy=none) header.from=ukr.net; spf=pass (mx1.freebsd.org: domain of nonameless@ukr.net designates 212.42.77.196 as permitted sender) smtp.mailfrom=nonameless@ukr.net X-Spamd-Result: default: False [-4.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[ukr.net:s=ffe]; IP_SCORE(0.00)[ipnet: 212.42.77.0/24(-4.88), asn: 8856(-3.91), country: UA(0.07)]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[ukr.net]; R_SPF_ALLOW(-0.20)[+ip4:212.42.77.0/24:c]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE_FREEMAIL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; DWL_DNSWL_LOW(-1.00)[ukr.net.dwl.dnswl.org : 127.0.5.1]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[ukr.net:+]; DMARC_POLICY_ALLOW(-0.50)[ukr.net,none]; FROM_NO_DN(0.00)[]; FREEMAIL_TO(0.00)[yahoo.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[ukr.net]; ASN(0.00)[asn:8856, ipnet:212.42.77.0/24, country:UA]; RCVD_TLS_LAST(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 15:38:05 -0000 --- Original message --- From: "Mark Millard"  Date: 3 May 2020, 17:38:14 > > > On 2020-May-3, at 01:26, nonameless at ukr.net wrote: > > > > > > --- Original message --- > > From: "Mark Millard" > > Date: 3 May 2020, 04:47:14 > > > > > > > >> [I'm only claiming the new jemalloc is involved and that > >> reverting avoids the problem.] > >> > >> I've been reporting to some lists problems with: > >> > >> dhclient > >> sendmail > >> rpcbind > >> mountd > >> nfsd > >> > >> getting SIGSEGV (signal 11) crashes and some core > >> dumps on the old 2-socket (1 core per socket) 32-bit > >> PowerMac G4 running head -r360311">360311. > >> > >> Mikaël Urankar sent a note suggesting that I try > >> testing reverting head -r360233">360233 for my head -r360311">360311 > >> context. He got it right . . . > >> > >> > >> Context: > >> > >> The problem was noticed by an inability to have > >> other machines do a: > >> > >> mount -onoatime,soft OLDPOWERMAC-LOCAL-IP:/... /mnt > >> > >> sort of operation and to have succeed. By contrast, on > >> the old PowerMac G4 I could initiate mounts against > >> other machines just fine. > >> > >> I do not see any such problems on any of (all based > >> on head -r360311): > >> > >> powerpc64 (old PowerMac G5 2-sockets with 2 cores each) > >> armv7 (OrangePi+ 2ed) > >> aarch64 (Rock64, RPi4, RPi3, > >> OverDrive 1000">1000, > >> Macchiatobin Double Shot) > >> amd64 (ThreadRipper 1950X) > >> > >> So I expect something 32-bit powerpc specific > >> is somehow involved, even if jemalloc is only > >> using whatever it is. > >> > >> (A kyua run with a debug kernel did not find other > >> unexpected signal 11 sources on the 32-bit PowerMac > >> compared to past kyua runs, at least that I noticed. > >> There were a few lock order reversals that I do not > >> know if they are expected or known-safe or not. > >> I've reported those reversals to the lists as well.) > >> > >> > >> Recent experiments based on the suggestion: > >> > >> Doing the buildworld, buildkernel and installing just > >> the new kernel and rebooting made no difference. > >> > >> But then installing the new world and rebooting did > >> make things work again: I no longer get core files > >> for the likes of (old cores from before the update): > >> > >> # find / -name "*.core" -print > >> /var/spool/clientmqueue/sendmail.core > >> /rpcbind.core > >> /mountd.core > >> /nfsd.core > >> > >> Nor do I see the various notices for sendmail > >> signal 11's that did not leave behind a core file > >> --or for dhclient (no core file left behind). > >> And I can mount the old PowerMac's drive from > >> other machines just fine. > >> > >> > >> Other notes: > >> > >> I do not actively use sendmail but it was left > >> to do its default things, partially to test if > >> such default things are working. Unfortunately, > >> PowerMacs have a problematical status under > >> FreeBSD and my context has my historical > >> experiments with avoiding various problems. > >> > >> === > >> Mark Millard > >> marklmi at yahoo.com > >> ( dsl-only.net went > >> away in early 2018">2018-Mar) > >> > > > > Hi Mark, > > > > It should be fixed, but not by reverting to old version. We can't stuck on old version because of ancient hardware. I think upstream is not interested in support such hardware. So, it have to patched locally. > > Observing and reporting the reverting result is an initial > part of problem isolation. I made no request for FreeBSD > to give up on using the updated jemalloc. (Unfortunately, > I'm not sure what a good next step of problem isolation > might be for the dual-socket PowerMac G4 context.) > > Other than reverting, no patch is known for the issue at > this point. More problem isolation is needed first. > > While I do not have access, https://wiki.freebsd.org/powerpc > lists more modern 32-bit powerpc hardware as supported: > MPC85XX evaluation boards and AmigaOne A1222 (powerpcspe). > (The AmigaOne A1222 seems to be dual-ore/single-socket.) > > So folks with access to one of those may want to see > if they also see the problem(s) with head -r360233 or > later. > > Another interesting context to test could be single-socket > with just one core. (I might be able to do that on another > old PowerMac, booting the same media after moving the > media.) > > If I understand right, the most common 32-bit powerpc > tier 2 hardware platforms may still be old PowerMac's. > They are considered supported and "mature", instead of > just "stable". See https://wiki.freebsd.org/powerpc . > However, the reality is that there are various problems > for old PowerMacs (32-bit and 64-bit, at least when > there is more than one socket present). The wiki page > does not hint at such. (I'm not sure about > single socket/multi-core PowerMacs: no access to > such.) > > It is certainly possible for some problem to happen > that would lead to dropping the supported-status > for some or all old 32-bit PowerMacs, even as tier 2. > But that has not happened yet and I'd have no say in > such a choice. > > === > Mark Millard > marklmi at yahoo.com > ( dsl-only.net went > away in early 2018-Mar) > Just don't want to see again previous situation when jemalloc was committed, then reverted and was forgotten for six months. From owner-svn-src-head@freebsd.org Sun May 3 16:09: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 B088E2E190F; Sun, 3 May 2020 16:09:35 +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 49FWCM4Hwsz3Nd3; Sun, 3 May 2020 16:09:35 +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 8E61CDA14; Sun, 3 May 2020 16:09:35 +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 043G9ZGV089445; Sun, 3 May 2020 16:09:35 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 043G9ZbT089444; Sun, 3 May 2020 16:09:35 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202005031609.043G9ZbT089444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 3 May 2020 16:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360609 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 360609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 16:09:35 -0000 Author: kp Date: Sun May 3 16:09:35 2020 New Revision: 360609 URL: https://svnweb.freebsd.org/changeset/base/360609 Log: pf: Improve DIOCADDRULE validation We expect the addrwrap.p.dyn value to be set to NULL (and assert such), but do not verify it on input. Reported-by: syzbot+936a89182e7d8f927de1@syzkaller.appspotmail.com Reviewed by: melifaro (previous version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24538 Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Sun May 3 16:06:23 2020 (r360608) +++ head/sys/netpfil/pf/pf_ioctl.c Sun May 3 16:09:35 2020 (r360609) @@ -1556,6 +1556,11 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, in error = EINVAL; break; } + if (pr->rule.src.addr.p.dyn != NULL || + pr->rule.dst.addr.p.dyn != NULL) { + error = EINVAL; + break; + } #ifndef INET if (pr->rule.af == AF_INET) { error = EAFNOSUPPORT; From owner-svn-src-head@freebsd.org Sun May 3 16:14: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 1A67D2E1BA8; Sun, 3 May 2020 16:14:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49FWKW7175z3P7S; Sun, 3 May 2020 16:14:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBE8FDBE4; Sun, 3 May 2020 16:14:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 043GEtWu095698; Sun, 3 May 2020 16:14:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 043GEtmP095697; Sun, 3 May 2020 16:14:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202005031614.043GEtmP095697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 3 May 2020 16:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360610 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 360610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 16:14:56 -0000 Author: mav Date: Sun May 3 16:14:55 2020 New Revision: 360610 URL: https://svnweb.freebsd.org/changeset/base/360610 Log: Add session locking in cfiscsi_ioctl_handoff(). While there, remove ifdef around cs_target check in cfiscsi_ioctl_list(). I am not sure why this ifdef was added, but without this check code will crash below on NULL dereference. Submitted by: Aleksandr Fedorov MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24587 Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Sun May 3 16:09:35 2020 (r360609) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Sun May 3 16:14:55 2020 (r360610) @@ -1582,8 +1582,10 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *ci) mtx_lock(&softc->lock); if (ct->ct_online == 0) { mtx_unlock(&softc->lock); + CFISCSI_SESSION_LOCK(cs); cs->cs_handoff_in_progress = false; cfiscsi_session_terminate(cs); + CFISCSI_SESSION_UNLOCK(cs); cfiscsi_target_release(ct); ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), @@ -1629,8 +1631,10 @@ restart: #endif error = icl_conn_handoff(cs->cs_conn, cihp->socket); if (error != 0) { + CFISCSI_SESSION_LOCK(cs); cs->cs_handoff_in_progress = false; cfiscsi_session_terminate(cs); + CFISCSI_SESSION_UNLOCK(cs); ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), "%s: icl_conn_handoff failed with error %d", @@ -1692,10 +1696,8 @@ cfiscsi_ioctl_list(struct ctl_iscsi *ci) sbuf_printf(sb, "\n"); mtx_lock(&softc->lock); TAILQ_FOREACH(cs, &softc->sessions, cs_next) { -#ifdef ICL_KERNEL_PROXY if (cs->cs_target == NULL) continue; -#endif error = sbuf_printf(sb, "" "%s" "%s" From owner-svn-src-head@freebsd.org Sun May 3 18:08: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 892292E4475 for ; Sun, 3 May 2020 18:08:36 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-20.consmr.mail.gq1.yahoo.com (sonic313-20.consmr.mail.gq1.yahoo.com [98.137.65.83]) (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 49FYrf4GxNz41sb for ; Sun, 3 May 2020 18:08:34 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 1oX6N4AVM1kMEt_vPxuFXH9vEhh1wYomaWReYDYjULLXvDflLYHJiezPy_PUB3r JgJ0FHTSFm9MJZ9RL7pKFvscGotD95w45Lba1uwxAPX0Wz4YlbPdRn76Vrzg2lrQF51vIBEM7Iia NtbtlW_Brm6UT1HX7GAtvzWR80EFMGGGz2IxTYxbUKsbNO2ZRCU.f7yLKWTl_GZx2MjtpW4oU77B UiaQwBSwN7TgKBWI0FcwPinkrOZioD.XUQS24i_ACCIdPVccgJUNR8vCHdhGTVTHM.9.DUcXfGX8 U1EBvDfBOBt8hVIgi7KdHHjVU8qK53uLEnnQeqx0Wc7aZ7Bu3ZQZjJUKo253ddI0xW08i6kp0MVt rXUeUXRHukehLn.2svajv90uPVWzeBV4.FRx1_ym85CCzZGUJ3QOLJUH_NNylGBkZfa5eP2VV9EE APhM0cZ8o8GNrHPvulT6lqSZLjWRLoKAIEAVt6fhyiKTQhN6lDc57o6AOVSbvrQdNbXKdqfA8smm OzCws63s9R_LMSjL7q6Yn8WYHxI5pWPfxFSR6TKRNJkocJ6cEttlSIJn.haWkabQCA5pBCI3_Ss7 oeipxHzpQJnl6cSKFNyxWUSbw8TQXnp1B8oqfofzH3MaISfml7ksJqzW.zPuOOrtgYESFCO2kw2V giR6umdL5MEF4fVQWZvBBsZRxDDh5RPFWK.fOKr51txJw1oHcK8j.1.KmcsQ.bxdHtIPV6RQK5vV 0bv9z_3qG_CEdWLIIswO34W.T22RRVUEvT0NCKEX5nFvLXJtHBh7Ij9055ZqSnK71IUTgL5MdgBv 7LLCwL598HOfs27rntQDl5lRfmSFULqFuKYrOie4.iAehxD0l9Gb76eM4v2rkPUt6wQNxn_HvY0v vEoIFxL9sJK.bU5Cop21fIF48lhB0c9eeIe6T2rTGPAY_Rya22MA6FxI7zMURQe7iH73fWgog9Od dWh1E8H3HvlCjHqf_QmDXGaznD2j1n6H5zpMarpY_eIk97qicL.UfrSYXGksHBsHxEL4NOCJXPMZ 4i.qz.tdb0MG1zZf38.LFrGUmHJlDFnr_O2Mt6abokrw9_v.jIuqIyoFGUJK8wxmr_kAh9yqbja2 fH3uW9lcyP_JkGP3STEX0NSBUiQKuyGxVk_kt7Msz7307g2Pn2yA3fG0XROxErkhR2X8HIMrIPM0 u9x9LaIXJz6.EHoNO.QTcl4Zf52KxOklCmQO3cNV1zJTmH5E3ldU_1QdQ8wKM7PSY4kSoYOQGpWV M4NVExzZ6bpbUXH1bLcgyl2aRFzL._Bcp1A9nJ5R_H.HuZPrxw82zeVlbpm6jGsJjpjgu158aKYY hgVzf3kpsPO1ZCcnQDyt7PAX.R1Y6WzJA6ThHJYtKSA3r5ISa_p..VDrk6zTkQM.GWvpzHCbjlU1 eNJ3xXdJdnvZlnifZo2xn.vGythTSa3G1APVLxceufCV1EwU56ZaikDdf6WDJj9RHmsc- Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.gq1.yahoo.com with HTTP; Sun, 3 May 2020 18:08:32 +0000 Received: by smtp422.mail.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 233fcb4833509f60a9288f2901074f87; Sun, 03 May 2020 18:08:28 +0000 (UTC) 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: 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, 3 May 2020 11:08:27 -0700 Cc: Brandon Bergren Content-Transfer-Encoding: quoted-printable Message-Id: <8479DD58-44F6-446A-9CA5-D01F0F7C1B38@yahoo.com> References: 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: 49FYrf4GxNz41sb X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.49 / 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)[]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; 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.99)[-0.989,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (1.71), ipnet: 98.137.64.0/21(0.82), 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)[83.65.137.98.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[83.65.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.29 Precedence: list List-Id: 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, 03 May 2020 18:08:36 -0000 [At around 4AM local time dhcient got a signal 11, despite the jemalloc revert. The other exmaples have not happened.] On 2020-May-2, at 18:46, Mark Millard wrote: > [I'm only claiming the new jemalloc is involved and that > reverting avoids the problem.] >=20 > I've been reporting to some lists problems with: >=20 > dhclient > sendmail > rpcbind > mountd > nfsd >=20 > getting SIGSEGV (signal 11) crashes and some core > dumps on the old 2-socket (1 core per socket) 32-bit > PowerMac G4 running head -r360311. >=20 > Mika=C3=ABl Urankar sent a note suggesting that I try > testing reverting head -r360233 for my head -r360311 > context. He got it right . . . >=20 >=20 > Context: >=20 > The problem was noticed by an inability to have > other machines do a: >=20 > mount -onoatime,soft OLDPOWERMAC-LOCAL-IP:/... /mnt >=20 > sort of operation and to have succeed. By contrast, on > the old PowerMac G4 I could initiate mounts against > other machines just fine. >=20 > I do not see any such problems on any of (all based > on head -r360311): >=20 > powerpc64 (old PowerMac G5 2-sockets with 2 cores each) > armv7 (OrangePi+ 2ed) > aarch64 (Rock64, RPi4, RPi3, > OverDrive 1000, > Macchiatobin Double Shot) > amd64 (ThreadRipper 1950X) >=20 > So I expect something 32-bit powerpc specific > is somehow involved, even if jemalloc is only > using whatever it is. >=20 > (A kyua run with a debug kernel did not find other > unexpected signal 11 sources on the 32-bit PowerMac > compared to past kyua runs, at least that I noticed. > There were a few lock order reversals that I do not > know if they are expected or known-safe or not. > I've reported those reversals to the lists as well.) >=20 >=20 > Recent experiments based on the suggestion: >=20 > Doing the buildworld, buildkernel and installing just > the new kernel and rebooting made no difference. >=20 > But then installing the new world and rebooting did > make things work again: I no longer get core files > for the likes of (old cores from before the update): >=20 > # find / -name "*.core" -print > /var/spool/clientmqueue/sendmail.core > /rpcbind.core > /mountd.core > /nfsd.core >=20 > Nor do I see the various notices for sendmail > signal 11's that did not leave behind a core file > --or for dhclient (no core file left behind). > And I can mount the old PowerMac's drive from > other machines just fine. >=20 >=20 > Other notes: >=20 > I do not actively use sendmail but it was left > to do its default things, partially to test if > such default things are working. Unfortunately, > PowerMacs have a problematical status under > FreeBSD and my context has my historical > experiments with avoiding various problems. Looking, I see that I got a: pid 572 (dhclient), jid 0, uid 0: exited on signal 11 (core dumped) notice under the reverted build. No instances of the other examples. This is the first that a dhclient example has produced a .core file. gdb indicates 0x5180936c for r7 in: lwz r8,36(r7) as leading to the failure. This was in arena_dalloc_bin_locked_impl (where arena_slab_reg_dalloc and bitmap_unset were apparently inlined). The chain for the example seems to be: fork_privchld -> dispatch_imsg -> jemalloc For reference . . . # gdb dhclient /dhclient.core=20 GNU gdb (GDB) 9.1 [GDB v9.1 for FreeBSD] Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later = . . . Reading symbols from dhclient... Reading symbols from /usr/lib/debug//sbin/dhclient.debug... [New LWP 100089] Core was generated by `dhclient: gem0 [priv]'. Program terminated with signal SIGSEGV, Segmentation fault. #0 bitmap_unset (bitmap=3D0x50407164, binfo=3D, = bit=3D167842154) at = /usr/powerpc32_src/contrib/jemalloc/include/jemalloc/internal/bitmap.h:341= 341 = /usr/powerpc32_src/contrib/jemalloc/include/jemalloc/internal/bitmap.h: = No such file or directory. (gdb) bt -full #0 bitmap_unset (bitmap=3D0x50407164, binfo=3D, = bit=3D167842154) at = /usr/powerpc32_src/contrib/jemalloc/include/jemalloc/internal/bitmap.h:341= goff =3D gp =3D 0x51809390 propagate =3D g =3D i =3D #1 arena_slab_reg_dalloc (slab=3D0x50407140, slab_data=3D0x50407164, = ptr=3D0x50088b50) at jemalloc_arena.c:273 bin_info =3D binind =3D 0 regind =3D 167842154 #2 arena_dalloc_bin_locked_impl (tsdn=3D0x5009f018, arena=3D, slab=3D, ptr=3D, junked=3D) at jemalloc_arena.c:1540 slab_data =3D binind =3D bin_info =3D bin =3D nfree =3D #3 0x502916a8 in __je_arena_dalloc_bin_junked_locked (tsdn=3D, arena=3D, extent=3D, ptr=3D) at jemalloc_arena.c:1559 No locals. #4 0x50250d2c in __je_tcache_bin_flush_small (tsd=3D0x5009f018, = tcache=3D, tbin=3D0x5009f1c0, binind=3D, = rem=3D24) at jemalloc_tcache.c:149 ptr =3D i =3D 0 extent =3D 0x50407140 bin_arena =3D 0x50400380 bin =3D ndeferred =3D 0 merged_stats =3D arena =3D 0x50400380 nflush =3D 75 __vla_expr0 =3D item_extent =3D 0xffffd1f0 #5 0x502508a0 in __je_tcache_event_hard (tsd=3D, = tcache=3D0x5009f108) at jemalloc_tcache.c:54 tbin_info =3D binind =3D 7 tbin =3D 0x5009f1c0 #6 0x5029a684 in __free (ptr=3D0x500530c0) at = /usr/powerpc32_src/contrib/jemalloc/include/jemalloc/internal/rtree.h:374 tcache =3D 0x5009f108 tsd =3D log_var =3D log_var =3D #7 0x10025994 in dispatch_imsg (ifix=3D, fd=3D10) at = /usr/powerpc32_src/sbin/dhclient/privsep.c:215 hdr =3D {code =3D IMSG_SCRIPT_WRITE_PARAMS, len =3D 3225} lease =3D {next =3D 0x0, expiry =3D 1588504529, renewal =3D = 1588504229, rebind =3D 1588504454, address =3D {len =3D 4, iabuf =3D = "\300\250\001i", '\000' }, nextserver =3D {len =3D 4,=20= iabuf =3D '\000' }, server_name =3D 0x0, = filename =3D 0x0, medium =3D 0x0, is_static =3D 0, is_bootp =3D 0, = options =3D {{len =3D 0, data =3D 0x0}, {len =3D 4,=20 data =3D 0x500530c8 "\377\377\377"}, {len =3D 0, data =3D = 0x0}, {len =3D 4, data =3D 0x500530d0 "\300\250\001\001"}, {len =3D 0, = data =3D 0x0}, {len =3D 0, data =3D 0x0}, {len =3D 4,=20 data =3D 0x500530d8 "\300\250\001\001"}, {len =3D 0, data = =3D 0x0}, {len =3D 0, data =3D 0x0}, {len =3D 0, data =3D 0x0}, {len =3D = 0, data =3D 0x0}, {len =3D 0, data =3D 0x0}, {len =3D 0, data =3D 0x0}, = { len =3D 0, data =3D 0x0}, {len =3D 0, data =3D 0x0}, {len = =3D 20, data =3D 0x50055200 "hsd1.or.comcast.net."}, {len =3D 0, data =3D = 0x0} , {len =3D 4, data =3D 0x500530e0 ""}, {len =3D = 0,=20 data =3D 0x0}, {len =3D 1, data =3D 0x500530e8 "\005"}, = {len =3D 4, data =3D 0x500530f0 "\300\250\001\001"}, {len =3D 0, data =3D = 0x0} }} medium_len =3D medium =3D totlen =3D 3225 filename_len =3D filename =3D 0x0 ret =3D buf =3D mtu =3D servername_len =3D servername =3D 0x0 reason_len =3D reason =3D --Type for more, q to quit, c to continue without paging-- prefix_len =3D prefix =3D 0x500530c0 "new_" i =3D 0 optlen =3D 0 #8 0x100189f4 in fork_privchld (fd=3D10, fd2=3D) at = /usr/powerpc32_src/sbin/dhclient/dhclient.c:2847 pfd =3D {{fd =3D 10, events =3D 1, revents =3D 1}} nfds =3D #9 0x10017a80 in main (argc=3D, argv=3D) = at /usr/powerpc32_src/sbin/dhclient/dhclient.c:505 pipe_fd =3D {10, 11} rights =3D {cr_rights =3D {1342801412, 18446706484155777024}} immediate_daemon =3D 0 i =3D 0 ch =3D otherpid =3D 8 pw =3D 0x5039b9d8 fd =3D capmode =3D (gdb) disass Dump of assembler code for function arena_dalloc_bin_locked_impl: 0x502916b8 <+0>: mflr r0 0x502916bc <+4>: stw r0,4(r1) 0x502916c0 <+8>: stwu r1,-48(r1) 0x502916c4 <+12>: stw r30,40(r1) 0x502916c8 <+16>: stw r24,16(r1) 0x502916cc <+20>: stw r25,20(r1) 0x502916d0 <+24>: stw r26,24(r1) 0x502916d4 <+28>: stw r27,28(r1) 0x502916d8 <+32>: stw r28,32(r1) 0x502916dc <+36>: stw r29,36(r1) 0x502916e0 <+40>: bl 0x502916e4 = 0x502916e4 <+44>: mr r27,r3 0x502916e8 <+48>: mflr r30 0x502916ec <+52>: addis r30,r30,14 0x502916f0 <+56>: addi r30,r30,7788 0x502916f4 <+60>: mr r28,r4 0x502916f8 <+64>: lwz r4,5856(r30) 0x502916fc <+68>: lwz r3,4(r5) 0x50291700 <+72>: mr r29,r5 0x50291704 <+76>: andi. r5,r7,1 0x50291708 <+80>: mr r26,r6 0x5029170c <+84>: lbz r4,0(r4) 0x50291710 <+88>: rlwinm r5,r3,14,25,31 0x50291714 <+92>: mulli r24,r5,224 0x50291718 <+96>: mulli r25,r5,44 0x5029171c <+100>: cmpwi cr1,r4,0 0x50291720 <+104>: cror 4*cr5+lt,4*cr1+eq,gt 0x50291724 <+108>: bge cr5,0x50291a2c = 0x50291728 <+112>: lwz r4,0(r29) 0x5029172c <+116>: lwz r6,6036(r30) 0x50291730 <+120>: lwz r7,8(r29) 0x50291734 <+124>: rlwinm r8,r5,2,0,29 0x50291738 <+128>: li r9,1 0x5029173c <+132>: add r24,r28,r24 0x50291740 <+136>: lwzx r6,r6,r8 0x50291744 <+140>: subf r7,r7,r26 0x50291748 <+144>: mulhwu r6,r6,r7 0x5029174c <+148>: rlwinm r7,r6,29,3,29 0x50291750 <+152>: add r7,r29,r7 =3D> 0x50291754 <+156>: lwz r8,36(r7) 0x50291758 <+160>: clrlwi r10,r6,27 0x5029175c <+164>: slw r9,r9,r10 0x50291760 <+168>: xor r9,r9,r8 0x50291764 <+172>: cmplwi r8,0 0x50291768 <+176>: stw r9,36(r7) 0x5029176c <+180>: bne 0x502917e4 = 0x50291770 <+184>: lwz r7,4408(r30) 0x50291774 <+188>: mulli r8,r5,44 0x50291778 <+192>: add r5,r7,r8 0x5029177c <+196>: lwz r5,16(r5) 0x50291780 <+200>: cmplwi r5,2 0x50291784 <+204>: blt 0x502917e4 = msr cr 0x42480c00 1112017920 lr 0x502916e4 0x502916e4 = ctr 0x5005d114 1342558484 xer 0x0 0 fpscr 0x0 0 vscr vrsave =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 Sun May 3 18:10: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 94C622E47A6; Sun, 3 May 2020 18:10:54 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49FYvL3VpBz42H1; Sun, 3 May 2020 18:10:54 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73A95F2A4; Sun, 3 May 2020 18:10:54 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 043IAsI8067054; Sun, 3 May 2020 18:10:54 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 043IAs7Y067053; Sun, 3 May 2020 18:10:54 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005031810.043IAs7Y067053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 3 May 2020 18:10:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360613 - head/tests/sys/geom/class/gate X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/geom/class/gate X-SVN-Commit-Revision: 360613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 03 May 2020 18:10:54 -0000 Author: asomers Date: Sun May 3 18:10:54 2020 New Revision: 360613 URL: https://svnweb.freebsd.org/changeset/base/360613 Log: Fix intermittent cleanup failures in the ggated test MFC after: 2 weeks Modified: head/tests/sys/geom/class/gate/ggate_test.sh Modified: head/tests/sys/geom/class/gate/ggate_test.sh ============================================================================== --- head/tests/sys/geom/class/gate/ggate_test.sh Sun May 3 17:50:24 2020 (r360612) +++ head/tests/sys/geom/class/gate/ggate_test.sh Sun May 3 18:10:54 2020 (r360613) @@ -198,7 +198,11 @@ common_cleanup() if [ -f "md.devs" ]; then while read test_md; do - mdconfig -d -u $test_md 2>/dev/null + # ggatec destroy doesn't release the provider + # synchronously, so we may need to retry destroying it. + while ! mdconfig -d -u $test_md; do + sleep 0.1 + done done < md.devs rm md.devs fi From owner-svn-src-head@freebsd.org Sun May 3 21:24: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 544532B9EC7; Sun, 3 May 2020 21:24:51 +0000 (UTC) (envelope-from rpokala@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 49FfC71V5Xz4KxN; Sun, 3 May 2020 21:24:51 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (unknown [IPv6:2601:641:300:6e9f:a9c4:67f9:9b4b:a223]) (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 985DEAA9; Sun, 3 May 2020 21:24:50 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.36.20041300 Date: Sun, 03 May 2020 14:24:47 -0700 Subject: Re: svn commit: r360453 - head From: Ravi Pokala To: Bryan Drewery , , , Message-ID: Thread-Topic: svn commit: r360453 - head References: <202004290218.03T2IdZM091899@repo.freebsd.org> In-Reply-To: <202004290218.03T2IdZM091899@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.29 Precedence: list List-Id: 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, 03 May 2020 21:24:51 -0000 Interesting. This change purports to fix a problem with r360443, but I had = no trouble with that change (make tinderbox WITH_META_MODE=3DYES), while this = change results in an early fatal error: make[2]: "Makefile" line 718: "Target architecture for amd64/conf/GENER= IC unknown. config(8) likely too old." I'm running kernel and world r360270. Thoughts? Thanks, Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Bryan Drewery Date: 2020-04-28, Tuesday at 19:18 To: , , Subject: svn commit: r360453 - head Author: bdrewery Date: Wed Apr 29 02:18:39 2020 New Revision: 360453 URL: https://svnweb.freebsd.org/changeset/base/360453 Log: Use universe-toolchain config(8) This is a temporary hack to aid with config(8) changing in r360443. It will not work for all cases. env PATH is used because universe-toolchain is only built when worlds are built, and then only if clang is needed, so it may not exist. universe-toolchain needs to be expanded to always be built, inspected= to remove non-cross-build-safe tools, used for buildworld/buildkernel, and potentially incremental build support. Sponsored by: Dell EMC Modified: head/Makefile Modified: head/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/Makefile Tue Apr 28 20:34:27 2020 (r360452) +++ head/Makefile Wed Apr 29 02:18:39 2020 (r360453) @@ -711,6 +711,7 @@ KERNCONFS!=3D cd ${KERNSRCDIR}/${TARGET}/conf && \ universe_kernconfs: universe_kernels_prologue .PHONY .for kernel in ${KERNCONFS} TARGET_ARCH_${kernel}!=3D cd ${KERNSRCDIR}/${TARGET}/conf && \ + env PATH=3D${HOST_OBJTOP}/tmp/legacy/bin:${PATH:Q} \ config -m ${KERNSRCDIR}/${TARGET}/conf/${kernel} 2> /dev/null | \ grep -v WARNING: | cut -f 2 .if empty(TARGET_ARCH_${kernel}) From owner-svn-src-head@freebsd.org Sun May 3 21:32: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 DF6A62BA1DF for ; Sun, 3 May 2020 21:32:41 +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 49FfN849rgz4LRm for ; Sun, 3 May 2020 21:32:40 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: KnuII7sVM1nfAwvNbPtHtam40Uu8y6WCL4Z47wcV3hlZx0ZkXFkRJEK_ULFEmhU jrMOQc60Mr8XZKuajjcE0dqxRsQ.D0kEZy..Gmsxc5moHHHqV2s0C7L2AsTdRg7B0LQqK.511ONo IeMhZBvN1WbypwXPg4xQk8O2ZRbdMWqToHSWR9GRc3QPnLzih5xK7PR461Tf2yFrPMYC0QtwoN71 ZPP1HlMjSF7RUOSczLZhoEULqHuAxcYpF9RhwmWV4f4HDAPsCMH0NIJh370QSXAX6R6RieThPXLf ElFXInU86S3gyxVJVUyeNvv.PZQdpcJjQYO6FUwIg6DqdjEvxCNZpckGlmUOi9jbaOuCrIMknfk2 Z_sYORL8iSmhLPGpN_NHeTWknpmtPhWyqn40_9yGbrKrkSFMH5k53v0MGTrtcTIvN6S9EeMxvNPG e_MEPNfC1XAWDzG89UTh8l42xljp.wgoObTmMBespduGvoWGOVGDt8iu.epn74aCCLmq5Ld7zzm8 teytPIdS2V4cvhc0w2kUbrKYtbQdkW6GX0IzN.w3cI0LMunf9l8nZEdV6M8BJZn8mAtvm9QdoSmJ smV6YmEZxlVfPyKfiMx2pEERTXpKqOSeJCQjgDb1h_XnngBJ6G2ijO4AfxLUCJPJLhj52KTfDIxy HXGsFhZR57EaR0GC9DH6fUmfjs6Tdqw1iQKW6IbpOAV2pgq08EkxvxHOwOfkmmaajl8HNO31ldes Y2yPsWYPY08Hg5aFK3qeEsnF5MWWQhHqLr6WDxoziG_j7KR9T8_iVh2XgOYg2HteIT0XVtN.VpTW M6aTftNwBOGWsyDqhxOrYiEDanoO1D45fGEEUi5Ka9iGCtKAVDeYYA4phffIxmNBwpkFdBEJ9b4K QHp5Rb.C9HMnq7m7N1Ws__bPVDBHkPvHnVgxh67ZWYZr8a7HynVkZh6mm0kfl1HNH0WXFnlwERkx uZHDL2vVj3STIr36P5bEZ4cE.HKv9QSRS7i7RouW.UXehDJUBuoA9B7nVK1HU4.tWudtjKp49YNX bC_DyAqdbI1iZd9VZL8NmGP6V._Q2TSuzisY1CtTvnXby0VBhn1OEpHL_qIVKpBy.v3YM915ncA8 JhSKid05LjD.RZV_S_x.lJRqGT3hh7ULAhCJHZxa.mCDkEXjJK6RizZgoCyMUTuBhohnBa7mSZSD _PXv7_A6NiOprGs2pPx.Fet8XwH61i_vQqS3Iv0rXIhcTo3NFIdK4guEoNB6ZcSIeuzanv2XtIT8 48Gwhk5a9imkhIh4Q_EeHGSu6Ll1.kkAfZEjKYcxxAU4x.wZGgt2Wfq4IKNPE2ZzXQJY.R9V1_dM uTFKAWEsXj9zUjKD0Mjo5bwCl4MUJXZicVpR1AAKxqDwsTULRYCtyZAyx1A08Wxyja3YbOtPJCl. 2GKcTXrYvnvLcJSxBeCj15eEWNhZVRZQiCXW01CQIEOEsalzueEbqsgAhNKPY8W8meOUPJg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.gq1.yahoo.com with HTTP; Sun, 3 May 2020 21:32:37 +0000 Received: by smtp421.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 0baeaae5442914f50439d86f6563f26f; Sun, 03 May 2020 21:32:36 +0000 (UTC) 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: 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: <8479DD58-44F6-446A-9CA5-D01F0F7C1B38@yahoo.com> Date: Sun, 3 May 2020 14:32:34 -0700 Cc: Brandon Bergren Content-Transfer-Encoding: quoted-printable Message-Id: <17ACDA02-D7EF-4F26-874A-BB3E935CD072@yahoo.com> References: <8479DD58-44F6-446A-9CA5-D01F0F7C1B38@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: 49FfN849rgz4LRm X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.31 / 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)[]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; 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(-0.89)[-0.887,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.92)[-0.922,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (5.59), ipnet: 98.137.64.0/21(0.82), 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)[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.29 Precedence: list List-Id: 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, 03 May 2020 21:32:41 -0000 [The bit argument ot bitmap_unset seems to be way too large.] On 2020-May-3, at 11:08, Mark Millard wrote: > [At around 4AM local time dhcient got a signal 11, > despite the jemalloc revert. The other exmaples > have not happened.] >=20 > On 2020-May-2, at 18:46, Mark Millard wrote: >=20 >> [I'm only claiming the new jemalloc is involved and that >> reverting avoids the problem.] >>=20 >> I've been reporting to some lists problems with: >>=20 >> dhclient >> sendmail >> rpcbind >> mountd >> nfsd >>=20 >> getting SIGSEGV (signal 11) crashes and some core >> dumps on the old 2-socket (1 core per socket) 32-bit >> PowerMac G4 running head -r360311. >>=20 >> Mika=C3=ABl Urankar sent a note suggesting that I try >> testing reverting head -r360233 for my head -r360311 >> context. He got it right . . . >>=20 >>=20 >> Context: >>=20 >> The problem was noticed by an inability to have >> other machines do a: >>=20 >> mount -onoatime,soft OLDPOWERMAC-LOCAL-IP:/... /mnt >>=20 >> sort of operation and to have succeed. By contrast, on >> the old PowerMac G4 I could initiate mounts against >> other machines just fine. >>=20 >> I do not see any such problems on any of (all based >> on head -r360311): >>=20 >> powerpc64 (old PowerMac G5 2-sockets with 2 cores each) >> armv7 (OrangePi+ 2ed) >> aarch64 (Rock64, RPi4, RPi3, >> OverDrive 1000, >> Macchiatobin Double Shot) >> amd64 (ThreadRipper 1950X) >>=20 >> So I expect something 32-bit powerpc specific >> is somehow involved, even if jemalloc is only >> using whatever it is. >>=20 >> (A kyua run with a debug kernel did not find other >> unexpected signal 11 sources on the 32-bit PowerMac >> compared to past kyua runs, at least that I noticed. >> There were a few lock order reversals that I do not >> know if they are expected or known-safe or not. >> I've reported those reversals to the lists as well.) >>=20 >>=20 >> Recent experiments based on the suggestion: >>=20 >> Doing the buildworld, buildkernel and installing just >> the new kernel and rebooting made no difference. >>=20 >> But then installing the new world and rebooting did >> make things work again: I no longer get core files >> for the likes of (old cores from before the update): >>=20 >> # find / -name "*.core" -print >> /var/spool/clientmqueue/sendmail.core >> /rpcbind.core >> /mountd.core >> /nfsd.core >>=20 >> Nor do I see the various notices for sendmail >> signal 11's that did not leave behind a core file >> --or for dhclient (no core file left behind). >> And I can mount the old PowerMac's drive from >> other machines just fine. >>=20 >>=20 >> Other notes: >>=20 >> I do not actively use sendmail but it was left >> to do its default things, partially to test if >> such default things are working. Unfortunately, >> PowerMacs have a problematical status under >> FreeBSD and my context has my historical >> experiments with avoiding various problems. >=20 > Looking, I see that I got a: >=20 > pid 572 (dhclient), jid 0, uid 0: exited on signal 11 (core dumped) >=20 > notice under the reverted build. No instances > of the other examples. This is the first that a > dhclient example has produced a .core file. >=20 > gdb indicates 0x5180936c for r7 in: >=20 > lwz r8,36(r7) >=20 > as leading to the failure. This was in > arena_dalloc_bin_locked_impl (where > arena_slab_reg_dalloc and bitmap_unset > were apparently inlined). >=20 > The chain for the example seems to be: > fork_privchld -> dispatch_imsg -> jemalloc >=20 > For reference . . . >=20 > # gdb dhclient /dhclient.core=20 > GNU gdb (GDB) 9.1 [GDB v9.1 for FreeBSD] > Copyright (C) 2020 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later = > . . . > Reading symbols from dhclient... > Reading symbols from /usr/lib/debug//sbin/dhclient.debug... > [New LWP 100089] > Core was generated by `dhclient: gem0 [priv]'. > Program terminated with signal SIGSEGV, Segmentation fault. > #0 bitmap_unset (bitmap=3D0x50407164, binfo=3D, = bit=3D167842154) at = /usr/powerpc32_src/contrib/jemalloc/include/jemalloc/internal/bitmap.h:341= > 341 = /usr/powerpc32_src/contrib/jemalloc/include/jemalloc/internal/bitmap.h: = No such file or directory. > (gdb) bt -full > #0 bitmap_unset (bitmap=3D0x50407164, binfo=3D, = bit=3D167842154) at = /usr/powerpc32_src/contrib/jemalloc/include/jemalloc/internal/bitmap.h:341= > goff =3D > gp =3D 0x51809390 > propagate =3D > g =3D > i =3D > #1 arena_slab_reg_dalloc (slab=3D0x50407140, slab_data=3D0x50407164, = ptr=3D0x50088b50) at jemalloc_arena.c:273 > bin_info =3D > binind =3D 0 > regind =3D 167842154 > #2 arena_dalloc_bin_locked_impl (tsdn=3D0x5009f018, arena=3D, slab=3D, ptr=3D, junked=3D) at jemalloc_arena.c:1540 > slab_data =3D > binind =3D > bin_info =3D > bin =3D > nfree =3D > #3 0x502916a8 in __je_arena_dalloc_bin_junked_locked (tsdn=3D, arena=3D, extent=3D, ptr=3D) at jemalloc_arena.c:1559 > No locals. > #4 0x50250d2c in __je_tcache_bin_flush_small (tsd=3D0x5009f018, = tcache=3D, tbin=3D0x5009f1c0, binind=3D, = rem=3D24) at jemalloc_tcache.c:149 > ptr =3D > i =3D 0 > extent =3D 0x50407140 > bin_arena =3D 0x50400380 > bin =3D > ndeferred =3D 0 > merged_stats =3D > arena =3D 0x50400380 > nflush =3D 75 > __vla_expr0 =3D > item_extent =3D 0xffffd1f0 > #5 0x502508a0 in __je_tcache_event_hard (tsd=3D, = tcache=3D0x5009f108) at jemalloc_tcache.c:54 > tbin_info =3D > binind =3D 7 > tbin =3D 0x5009f1c0 > #6 0x5029a684 in __free (ptr=3D0x500530c0) at = /usr/powerpc32_src/contrib/jemalloc/include/jemalloc/internal/rtree.h:374 > tcache =3D 0x5009f108 > tsd =3D > log_var =3D > log_var =3D > #7 0x10025994 in dispatch_imsg (ifix=3D, fd=3D10) at = /usr/powerpc32_src/sbin/dhclient/privsep.c:215 > hdr =3D {code =3D IMSG_SCRIPT_WRITE_PARAMS, len =3D 3225} > lease =3D {next =3D 0x0, expiry =3D 1588504529, renewal =3D = 1588504229, rebind =3D 1588504454, address =3D {len =3D 4, iabuf =3D = "\300\250\001i", '\000' }, nextserver =3D {len =3D 4,=20= > iabuf =3D '\000' }, server_name =3D 0x0, = filename =3D 0x0, medium =3D 0x0, is_static =3D 0, is_bootp =3D 0, = options =3D {{len =3D 0, data =3D 0x0}, {len =3D 4,=20 > data =3D 0x500530c8 "\377\377\377"}, {len =3D 0, data =3D = 0x0}, {len =3D 4, data =3D 0x500530d0 "\300\250\001\001"}, {len =3D 0, = data =3D 0x0}, {len =3D 0, data =3D 0x0}, {len =3D 4,=20 > data =3D 0x500530d8 "\300\250\001\001"}, {len =3D 0, data = =3D 0x0}, {len =3D 0, data =3D 0x0}, {len =3D 0, data =3D 0x0}, {len =3D = 0, data =3D 0x0}, {len =3D 0, data =3D 0x0}, {len =3D 0, data =3D 0x0}, = { > len =3D 0, data =3D 0x0}, {len =3D 0, data =3D 0x0}, {len = =3D 20, data =3D 0x50055200 "hsd1.or.comcast.net."}, {len =3D 0, data =3D = 0x0} , {len =3D 4, data =3D 0x500530e0 ""}, {len =3D = 0,=20 > data =3D 0x0}, {len =3D 1, data =3D 0x500530e8 "\005"}, = {len =3D 4, data =3D 0x500530f0 "\300\250\001\001"}, {len =3D 0, data =3D = 0x0} }} > medium_len =3D > medium =3D > totlen =3D 3225 > filename_len =3D > filename =3D 0x0 > ret =3D > buf =3D > mtu =3D > servername_len =3D > servername =3D 0x0 > reason_len =3D > reason =3D > --Type for more, q to quit, c to continue without paging-- > prefix_len =3D > prefix =3D 0x500530c0 "new_" > i =3D 0 > optlen =3D 0 > #8 0x100189f4 in fork_privchld (fd=3D10, fd2=3D) at = /usr/powerpc32_src/sbin/dhclient/dhclient.c:2847 > pfd =3D {{fd =3D 10, events =3D 1, revents =3D 1}} > nfds =3D > #9 0x10017a80 in main (argc=3D, argv=3D) at /usr/powerpc32_src/sbin/dhclient/dhclient.c:505 > pipe_fd =3D {10, 11} > rights =3D {cr_rights =3D {1342801412, 18446706484155777024}} > immediate_daemon =3D 0 > i =3D 0 > ch =3D > otherpid =3D 8 > pw =3D 0x5039b9d8 > fd =3D > capmode =3D >=20 > (gdb) disass > Dump of assembler code for function arena_dalloc_bin_locked_impl: > 0x502916b8 <+0>: mflr r0 > 0x502916bc <+4>: stw r0,4(r1) > 0x502916c0 <+8>: stwu r1,-48(r1) > 0x502916c4 <+12>: stw r30,40(r1) > 0x502916c8 <+16>: stw r24,16(r1) > 0x502916cc <+20>: stw r25,20(r1) > 0x502916d0 <+24>: stw r26,24(r1) > 0x502916d4 <+28>: stw r27,28(r1) > 0x502916d8 <+32>: stw r28,32(r1) > 0x502916dc <+36>: stw r29,36(r1) > 0x502916e0 <+40>: bl 0x502916e4 = > 0x502916e4 <+44>: mr r27,r3 > 0x502916e8 <+48>: mflr r30 > 0x502916ec <+52>: addis r30,r30,14 > 0x502916f0 <+56>: addi r30,r30,7788 > 0x502916f4 <+60>: mr r28,r4 > 0x502916f8 <+64>: lwz r4,5856(r30) > 0x502916fc <+68>: lwz r3,4(r5) > 0x50291700 <+72>: mr r29,r5 > 0x50291704 <+76>: andi. r5,r7,1 > 0x50291708 <+80>: mr r26,r6 > 0x5029170c <+84>: lbz r4,0(r4) > 0x50291710 <+88>: rlwinm r5,r3,14,25,31 > 0x50291714 <+92>: mulli r24,r5,224 > 0x50291718 <+96>: mulli r25,r5,44 > 0x5029171c <+100>: cmpwi cr1,r4,0 > 0x50291720 <+104>: cror 4*cr5+lt,4*cr1+eq,gt > 0x50291724 <+108>: bge cr5,0x50291a2c = > 0x50291728 <+112>: lwz r4,0(r29) > 0x5029172c <+116>: lwz r6,6036(r30) > 0x50291730 <+120>: lwz r7,8(r29) > 0x50291734 <+124>: rlwinm r8,r5,2,0,29 > 0x50291738 <+128>: li r9,1 > 0x5029173c <+132>: add r24,r28,r24 > 0x50291740 <+136>: lwzx r6,r6,r8 > 0x50291744 <+140>: subf r7,r7,r26 > 0x50291748 <+144>: mulhwu r6,r6,r7 > 0x5029174c <+148>: rlwinm r7,r6,29,3,29 > 0x50291750 <+152>: add r7,r29,r7 > =3D> 0x50291754 <+156>: lwz r8,36(r7) > 0x50291758 <+160>: clrlwi r10,r6,27 > 0x5029175c <+164>: slw r9,r9,r10 > 0x50291760 <+168>: xor r9,r9,r8 > 0x50291764 <+172>: cmplwi r8,0 > 0x50291768 <+176>: stw r9,36(r7) > 0x5029176c <+180>: bne 0x502917e4 = > 0x50291770 <+184>: lwz r7,4408(r30) > 0x50291774 <+188>: mulli r8,r5,44 > 0x50291778 <+192>: add r5,r7,r8 > 0x5029177c <+196>: lwz r5,16(r5) > 0x50291780 <+200>: cmplwi r5,2 > 0x50291784 <+204>: blt 0x502917e4 = . . . >=20 > (gdb) info reg > r0 0x502916a8 1344870056 > r1 0xffffd1a0 4294955424 > r2 0x500a6018 1342857240 > r3 0x0 0 > r4 0x0 0 > r5 0x0 0 > r6 0xa01116a 167842154 > r7 0x5180936c 1367380844 > r8 0x0 0 > r9 0x1 1 > r10 0x1e 30 > r11 0x5005d114 1342558484 > r12 0x84000c00 2214595584 > r13 0x0 0 > r14 0xffffd1f0 4294955504 > r15 0xfffffffc 4294967292 > r16 0x4a 74 > r17 0x4b 75 > r18 0x0 0 > r19 0x504009a0 1346374048 > r20 0x0 0 > r21 0xffffd1f0 4294955504 > r22 0x620 1568 > r23 0x50400380 1346372480 > r24 0x50400380 1346372480 > r25 0x0 0 > r26 0x50088b50 1342737232 > r27 0x5009f018 1342828568 > r28 0x50400380 1346372480 > r29 0x50407140 1346400576 > r30 0x50373550 1345795408 > r31 0xffffd310 4294955792 > pc 0x50291754 0x50291754 = > msr > cr 0x42480c00 1112017920 > lr 0x502916e4 0x502916e4 = > ctr 0x5005d114 1342558484 > xer 0x0 0 > fpscr 0x0 0 > vscr > vrsave bitmap_unset (bitmap=3D0x50407164, binfo=3D, = bit=3D167842154) explains calculating: gp =3D 0x51809390 via bitmap+(bit/4/8): (gdb) print/x 0x50407164 +167842154/4/8=20 $16 =3D 0x51809390 The last potential bit/4/8 value to be able to access memory (without spanning a hole) is: (gdb) print *(bitmap+582566) $13 =3D 0 (gdb) print/x (bitmap+582566) $14 =3D 0x5063fffc So it looks like arena_slab_reg_dalloc produced an invalid bit value. Looking at that code shows that regind hold the parameter value that matches: static void arena_slab_reg_dalloc(extent_t *slab, arena_slab_data_t *slab_data, void = *ptr) { szind_t binind =3D extent_szind_get(slab); const bin_info_t *bin_info =3D &bin_infos[binind]; size_t regind =3D arena_slab_regind(slab, binind, ptr); =20 assert(extent_nfree_get(slab) < bin_info->nregs); /* Freeing an unallocated pointer can cause assertion failure. = */ assert(bitmap_get(slab_data->bitmap, &bin_info->bitmap_info, = regind)); bitmap_unset(slab_data->bitmap, &bin_info->bitmap_info, regind); extent_nfree_inc(slab); } The backtrace showed binind=3D=3D0 for arena_slab_reg_dalloc. That leaves: arena_slab_regind(slab, binind, ptr) as producing the odd value. size_t arena_slab_regind(extent_t *slab, szind_t binind, const void *ptr) { size_t diff, regind; /* Freeing a pointer outside the slab can cause assertion = failure. */ assert((uintptr_t)ptr >=3D (uintptr_t)extent_addr_get(slab)); assert((uintptr_t)ptr < (uintptr_t)extent_past_get(slab)); /* Freeing an interior pointer can cause assertion failure. */ assert(((uintptr_t)ptr - (uintptr_t)extent_addr_get(slab)) % (uintptr_t)bin_infos[binind].reg_size =3D=3D 0); diff =3D (size_t)((uintptr_t)ptr - = (uintptr_t)extent_addr_get(slab)); /* Avoid doing division with a variable divisor. */ regind =3D div_compute(&arena_binind_div_info[binind], diff); assert(regind < bin_infos[binind].nregs); return regind; } ptr =3D=3D 0x50088b50 slab =3D=3D 0x50407140 static inline void * extent_addr_get(const extent_t *extent) { assert(extent->e_addr =3D=3D PAGE_ADDR2BASE(extent->e_addr) || !extent_slab_get(extent)); return extent->e_addr; } (gdb) print *slab $17 =3D {e_bits =3D 0, e_addr =3D 0x0, {e_size_esn =3D 0, e_bsize =3D = 0}, ql_link =3D {qre_next =3D 0x0, qre_prev =3D 0x0}, ph_link =3D = {phn_prev =3D 0x0, phn_next =3D 0x0, phn_lchild =3D 0x0}, {e_slab_data =3D= {bitmap =3D { 0 }}, e_prof_tctx =3D {repr =3D 0x0}}} That looks wrong: all fields are zero, which is not likely to be the description of a slab. But I'll continue to be sure I get the reported value of bit. So extent_addr_get(slab)=3D=3Dslab->e_addr and slab->e_addr=3D=3D0x0 and diff=3D=3Dptr . (gdb) print/x arena_binind_div_info[binind] $19 =3D {magic =3D 0x20000000} static inline size_t div_compute(div_info_t *div_info, size_t n) { assert(n <=3D (uint32_t)-1); /* * This generates, e.g. mov; imul; shr on x86-64. On a 32-bit = machine, * the compilers I tried were all smart enough to turn this into = the * appropriate "get the high 32 bits of the result of a = multiply" (e.g. * mul; mov edx eax; on x86, umull on arm, etc.). */ size_t i =3D ((uint64_t)n * (uint64_t)div_info->magic) >> 32; #ifdef JEMALLOC_DEBUG assert(i * div_info->d =3D=3D n); #endif return i; } (gdb) print/x ((unsigned long long)0x50088b50 * (unsigned long = long)0x20000000) >> 32 $21 =3D 0xa01116a (gdb) print ((unsigned long long)0x50088b50 * (unsigned long = long)0x20000000) >> 32 $22 =3D 167842154 (As reported.) So returning to *slab being all zero . . . The slab value in the call chain seems to trace back to=3D __je_tcache_bin_flush_small code: bin_t *bin =3D &bin_arena->bins[binind]; . . . malloc_mutex_lock(tsd_tsdn(tsd), &bin->lock); . . . for (unsigned i =3D 0; i < nflush; i++) { void *ptr =3D *(tbin->avail - 1 - i); extent =3D item_extent[i]; assert(ptr !=3D NULL && extent !=3D NULL); if (extent_arena_get(extent) =3D=3D bin_arena) { = arena_dalloc_bin_junked_locked(tsd_tsdn(tsd), bin_arena, extent, ptr); . . . malloc_mutex_unlock(tsd_tsdn(tsd), &bin->lock); (So ptr's value here is later slab's value in the call chain.) The backtrace shows binind =3D 7 via __je_tcache_event_hard . (Not the same as the earlier binind.) #4 0x50250d2c in __je_tcache_bin_flush_small (tsd=3D0x5009f018, = tcache=3D, tbin=3D0x5009f1c0, binind=3D, = rem=3D24) at jemalloc_tcache.c:149 ptr =3D i =3D 0 extent =3D 0x50407140 bin_arena =3D 0x50400380 bin =3D ndeferred =3D 0 merged_stats =3D arena =3D 0x50400380 nflush =3D 75 __vla_expr0 =3D item_extent =3D 0xffffd1f0 (gdb) print/x bin_arena->bins[7] $44 =3D {lock =3D {{{prof_data =3D {tot_wait_time =3D {ns =3D 0x0}, = max_wait_time =3D {ns =3D 0x0}, n_wait_times =3D 0x0, n_spin_acquired =3D = 0x0, max_n_thds =3D 0x0, n_waiting_thds =3D {repr =3D 0x0},=20 n_owner_switches =3D 0x0, prev_owner =3D 0x0, n_lock_ops =3D = 0x0}, lock =3D 0x0, postponed_next =3D 0x504021d0}, witness =3D {name =3D = 0x0, rank =3D 0x0, comp =3D 0x0, opaque =3D 0x0, link =3D {qre_next =3D = 0x0,=20 qre_prev =3D 0x0}}, lock_order =3D 0x0}}, slabcur =3D = 0x50407140, slabs_nonfull =3D {ph_root =3D 0x0}, slabs_full =3D = {qlh_first =3D 0x0}, stats =3D {nmalloc =3D 0x64, ndalloc =3D 0x0, = nrequests =3D 0x1,=20 curregs =3D 0x64, nfills =3D 0x1, nflushes =3D 0x1, nslabs =3D 0x1, = reslabs =3D 0x0, curslabs =3D 0x1, mutex_data =3D {tot_wait_time =3D {ns = =3D 0x0}, max_wait_time =3D {ns =3D 0x0}, n_wait_times =3D 0x0,=20 n_spin_acquired =3D 0x0, max_n_thds =3D 0x0, n_waiting_thds =3D = {repr =3D 0x0}, n_owner_switches =3D 0x0, prev_owner =3D 0x0, n_lock_ops = =3D 0x0}}} That indicates: bin_arena->bins[7]->lock =3D 0x0 . Expected? Single threaded context? (gdb) print *item_extent[0] $27 =3D {e_bits =3D 0, e_addr =3D 0x0, {e_size_esn =3D 0, e_bsize =3D = 0}, ql_link =3D {qre_next =3D 0x0, qre_prev =3D 0x0}, ph_link =3D = {phn_prev =3D 0x0, phn_next =3D 0x0, phn_lchild =3D 0x0}, {e_slab_data =3D= {bitmap =3D { 0 }}, e_prof_tctx =3D {repr =3D 0x0}}} Other *item_extent[INDEX] that I tried got the same: all zeros. This is what contributed to the huge bit value. item_extent[] is based on the declaration: VARIABLE_ARRAY(extent_t *, item_extent, nflush); and: /* Declare a variable-length array. */ #if __STDC_VERSION__ < 199901L # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef JEMALLOC_HAS_ALLOCA_H # include # else # include # endif # endif # define VARIABLE_ARRAY(type, name, count) \ type *name =3D alloca(sizeof(type) * (count)) #else # define VARIABLE_ARRAY(type, name, count) type name[(count)] #endif WARNING: C11 turned VLAs into a conditional feature (__STDC_NO_VLA__). Only C99 has it as required. Thus the above definition of VARIABLE_ARRAY is incomplete or limited to C99 and before relative the the language vintages. Looking around, the stack frames seem to span the space okay: (gdb) print/x &item_extent[75] $32 =3D 0xffffd31c (gdb) print/x &item_extent[0] $33 =3D 0xffffd1f0 r1 0xffffd1a0 4294955424 r14 0xffffd1f0 4294955504 r15 0xfffffffc 4294967292 r21 0xffffd1f0 4294955504 (gdb) print/x *(void**)0xffffd1a0 $36 =3D 0xffffd1d0 (gdb) print/x *(void**)0xffffd1d0 $37 =3D 0xffffd1e0 (gdb) print/x *(void**)0xffffd1e0 $38 =3D 0xffffd440 (gdb) print/x *(void**)0xffffd440 $39 =3D 0xffffd460 And I've run out of ideas for what else to look at (for now). (It is not like I understand jemalloc.) (Last I knew, 32-bit powerpc did not have red-zone stack-space criteria to leave room for signals to use.) =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 Sun May 3 23:10: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 B7DD62BC7F8; Sun, 3 May 2020 23:10:20 +0000 (UTC) (envelope-from rpokala@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 49FhXr4GMRz4QVm; Sun, 3 May 2020 23:10:20 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (unknown [IPv6:2601:641:300:6e9f:48ba:ae4d:c5aa:fe3e]) (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 EB00716C2; Sun, 3 May 2020 23:10:19 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.36.20041300 Date: Sun, 03 May 2020 16:10:16 -0700 Subject: Re: svn commit: r360453 - head From: Ravi Pokala To: Ravi Pokala , Bryan Drewery , , , Message-ID: <1F3E0402-D5EB-4FB5-AB57-B965DE83E702@panasas.com> Thread-Topic: svn commit: r360453 - head References: <202004290218.03T2IdZM091899@repo.freebsd.org> In-Reply-To: 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.29 Precedence: list List-Id: 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, 03 May 2020 23:10:20 -0000 -----Original Message----- From: on behalf of Ravi Pokala Date: 2020-05-03, Sunday at 14:24 To: Bryan Drewery , , , Subject: Re: svn commit: r360453 - head Interesting. This change purports to fix a problem with r360443, but I = had no trouble with that change (make tinderbox WITH_META_MODE=3DYES), while t= his change results in an early fatal error: make[2]: "Makefile" line 718: "Target architecture for amd64/conf/G= ENERIC unknown. config(8) likely too old." I'm running kernel and world r360270. Interesting; I was unable to build at HOL; was able to able to buildworld a= nd kernel at r360443, rebooted into that, synced to HOL, and now able to bui= ld again. -Ravi Thoughts? Thanks, Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Bryan Drewery Date: 2020-04-28, Tuesday at 19:18 To: , , Subject: svn commit: r360453 - head Author: bdrewery Date: Wed Apr 29 02:18:39 2020 New Revision: 360453 URL: https://svnweb.freebsd.org/changeset/base/360453 Log: Use universe-toolchain config(8) This is a temporary hack to aid with config(8) changing in r36044= 3. It will not work for all cases. env PATH is used because universe-toolchain is only built when wo= rlds are built, and then only if clang is needed, so it may not exist. universe-toolchain needs to be expanded to always be built, inspe= cted to remove non-cross-build-safe tools, used for buildworld/buildkerne= l, and potentially incremental build support. Sponsored by: Dell EMC Modified: head/Makefile Modified: head/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/Makefile Tue Apr 28 20:34:27 2020 (r360452) +++ head/Makefile Wed Apr 29 02:18:39 2020 (r360453) @@ -711,6 +711,7 @@ KERNCONFS!=3D cd ${KERNSRCDIR}/${TARGET}/conf && = \ universe_kernconfs: universe_kernels_prologue .PHONY .for kernel in ${KERNCONFS} TARGET_ARCH_${kernel}!=3D cd ${KERNSRCDIR}/${TARGET}/conf && \ + env PATH=3D${HOST_OBJTOP}/tmp/legacy/bin:${PATH:Q} \ config -m ${KERNSRCDIR}/${TARGET}/conf/${kernel} 2> /dev/null | \ grep -v WARNING: | cut -f 2 .if empty(TARGET_ARCH_${kernel}) From owner-svn-src-head@freebsd.org Mon May 4 03:35: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 2F7202C1D2B for ; Mon, 4 May 2020 03:35:43 +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 49FpR15xNkz4cPb for ; Mon, 4 May 2020 03:35:41 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: k6zKPnsVM1lfrCrcQF5bRJOn.HgrqX3l23eRyTPe6AXTqAVsXKJfcIN2SvJg6B1 .gd0V6_dWoAb2J8tqbCnwFDSEA4ImyXhxngCs1rXaSKMZ2WzXGD_Dqs4XkBx_2FdRFgeapuLD2po _CHP_7yMQtdP2LcldiJi38IMpt3sizYgGYxHy_N80uNHkFZGPy0BtBPquQdrahF7MpFKSbkCIuTR zGGM_aVcAzN9rJPDhVrNahUo2t5t_b4yW.MtwOQs2g7n02PYy_5_8Ce2fsPXfxNwUzLOR1.SNlL_ v6nSyHHpOVrmYrEfINqvIbGvQkuE79j2Wjx8A6dj5BjMwfH2n3Cy7s17fiT8uL.LjFJJQDQrTadm 1f4MMCeTy4sNMk0d3gMRk40QiKuLZqxZJelae8EQKaCp2bkV9dj1DIkVCwuIW45IkKHI0eJ86DHR tOfJdnAYRLOo8HFEyVFVCbWkclyuUhkdCRw2jaqATVSAWGpPqkZ4PCSth0MPp3dz2WcOZx8HpnBL .mnbB3XOmsxT4Uzxonxeyjo3SVWIbGIZCJlWFOCn1IC2L3bKlwF3oR.Kgd1vLA8bgNoNXzIU3Dv. D8QoJSUBtqB04dKkh_CB0JxF.9bxR3Xlms_rfK4H0BncktRy1tsXFUl0ho5tAhBFD5xbjPbTqSWV RlweHPHL4iBAhLzUn7K7v7sUC581yJpSuFb34jXAD0dZDN88DARLrNKSzgtxVBSzTOq1ntfsapz5 _lBFo_ATpkeSl_drJUbxlolZV_hTcA24UgesCS1E_HtKtAPe_agj1Rdl_lWPAR_xcVuARdVVAT3s JCvMJVveQGxPicWOizbuWEfB9vPtLFemI2IBGJcsByOQEAI6kw8vkqXwKPUVAj9yBC8iGTN.xv.n wrdlx3pmlBCrvWLk4xjjob652Oxo_Itsgw0W1kBSYW9g4jg0z1IGEgkVzpUYD0.OaiLOWX4T1OLc DACqxfd_U4mzMztoJ2SuJdGI.0Of3sTE4nAAFwsm7HwJ4PCQqJatkl_QbUtGUpaRzMtc_X8FTGlz og50slZw8QHRSn3AA0B.xo0haFGCgGnLne.OSv8c9EOrLZsAbPiDSc0DyHgAhBAYLMrZ8av_w518 QMm27jfMrceXW_Jfwbk0rsp2dqo5MqCb5BFc3iahwzTfN.KX8X_oz9e3a.ljxCBGxpYnaMtWE6dc H4NS.X0jMO8bMuAsfeVEAjcBLzuADQkEpUUEQHIWz_8np2fzNP7hFUse3Sp9QvMcfeCETBmyZ2Lr VpJZ_9DqiM4qz5UpBrKP0lIUUQo68haPsVQcKZJ6nxkTXYzpd1NShMjgIRDjgWFsSwpCWcyeuoe_ W5ecdYjRuV9TEUIGVTx56COQMnpOFPOU9Qm_zs5Uz1iqoXOnWf6cDJIT.ymcBd308Oz7Vbm73cRh OwAy.cHJQ64lLPNBWgnTh3Bpfgf9izg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.gq1.yahoo.com with HTTP; Mon, 4 May 2020 03:35:39 +0000 Received: by smtp415.mail.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 0f1626b2cc68caa9d0a40fce7235f8f4; Mon, 04 May 2020 03:35:37 +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: <17ACDA02-D7EF-4F26-874A-BB3E935CD072@yahoo.com> Date: Sun, 3 May 2020 20:35:35 -0700 Cc: Brandon Bergren Content-Transfer-Encoding: quoted-printable Message-Id: <695E6836-F860-4557-B7DE-CC1EDB347F18@yahoo.com> References: <8479DD58-44F6-446A-9CA5-D01F0F7C1B38@yahoo.com> <17ACDA02-D7EF-4F26-874A-BB3E935CD072@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: 49FpR15xNkz4cPb 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)[]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; 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(-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.25), ipnet: 98.137.64.0/21(0.82), 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.29 Precedence: list List-Id: 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, 04 May 2020 03:35:43 -0000 This note just reports things from looking at 2 .core files (mountd and rpcbind) from the new jemalloc context's failures. May be someone that knows more can get something out of it. I've not included any of the prior message history. For mountd: Core was generated by `/usr/sbin/mountd -r'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x50235df0 in cache_bin_dalloc_easy (bin=3D, = bin_info=3D, ptr=3D0x50049160) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/cache_bin.h:121 warning: Source file is more recent than executable. 121 if (unlikely(bin->ncached =3D=3D bin_info->ncached_max)) = { It turns out that bin_info traces back to: cache_bin_t *bin =3D tcache_small_bin_get(tcache, = alloc_ctx.szind); cache_bin_info_t *bin_info =3D = &tcache_bin_info[alloc_ctx.szind]; if (!cache_bin_dalloc_easy(bin, bin_info, ptr)) { return false; } based on: #define tcache_bin_info JEMALLOC_N(tcache_bin_info) and: # define JEMALLOC_N(n) __je_##n But gdb reports: (gdb) print __je_tcache_bin_info $3 =3D (cache_bin_info_t *) 0x0 (gdb) print alloc_ctx $1 =3D {szind =3D 0, slab =3D } so bin_info =3D NULL and bin_info->ncached_max would fail (and does). By contrast, bin->ncached seems to be from: (gdb) print *(cache_bin_t*)0x50094018 $6 =3D {low_water =3D 65536, ncached =3D 1, tstats =3D {nrequests =3D = 4796680610075595179}, avail =3D 0x0} For rpcbind: Core was generated by `/usr/sbin/rpcbind'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x50243fec in rendezvous_request (xprt=3D, = msg=3D) at /usr/src/lib/libc/rpc/svc_vc.c:323 323 newxprt->xp_raddr =3D *(struct sockaddr_in = *)newxprt->xp_rtaddr.buf; (gdb) print *newxprt $5 =3D {xp_fd =3D 14, xp_port =3D 0, xp_ops =3D 0x50329e1c, xp_addrlen =3D= 0, xp_raddr =3D {sin_len =3D 0 '\000', sin_family =3D 0 '\000', = sin_port =3D 0, sin_addr =3D {s_addr =3D 0},=20 sin_zero =3D "\000\000\000\000P1O\374"}, xp_ops2 =3D 0x50329e34, = xp_tp =3D 0x0, xp_netid =3D 0x50047310 "unix", xp_ltaddr =3D {maxlen =3D = 1345322064, len =3D 1970170232, buf =3D 0x2020}, xp_rtaddr =3D { maxlen =3D 268500992, len =3D 16, buf =3D 0x0}, xp_verf =3D = {oa_flavor =3D 0, oa_base =3D 0x202d2020 , oa_length =3D 538976364}, xp_p1 =3D 0x6f6f7000,=20 xp_p2 =3D 0x0, xp_p3 =3D 0x202d2020, xp_type =3D 538976288} so newxprt->xp_rtaddr.buf =3D=3D 0x0 . But taht is very odd . . . /* * make a new transporter (re-uses xprt) */ newxprt =3D makefd_xprt(sock, r->sendsize, r->recvsize); newxprt->xp_rtaddr.buf =3D mem_alloc(len); if (newxprt->xp_rtaddr.buf =3D=3D NULL) return (FALSE); memcpy(newxprt->xp_rtaddr.buf, &addr, len); newxprt->xp_rtaddr.len =3D len; #ifdef PORTMAP if (addr.ss_family =3D=3D AF_INET || addr.ss_family =3D=3D = AF_LOCAL) { newxprt->xp_raddr =3D *(struct sockaddr_in = *)newxprt->xp_rtaddr.buf; newxprt->xp_addrlen =3D sizeof (struct sockaddr_in); } #endif /* PORTMAP */ Or, in machine code terms: 0x50243f90 <+260>: mr r28,r3 0x50243f94 <+264>: lwz r4,0(r24) 0x50243f98 <+268>: lwz r5,4(r24) 0x50243f9c <+272>: mr r3,r28 0x50243fa0 <+276>: bl 0x5024308c 0x50243fa4 <+280>: lwz r27,36(r1) 0x50243fa8 <+284>: mr r29,r3 0x50243fac <+288>: li r3,1 0x50243fb0 <+292>: mr r4,r27 0x50243fb4 <+296>: bl 0x502e3214 <00000000.plt_pic32.calloc> 0x50243fb8 <+300>: cmplwi r3,0 0x50243fbc <+304>: stw r3,64(r29) 0x50243fc0 <+308>: beq 0x50244160 Note: getting here means that newxprt->xp_rtaddr.buf ws not NULL . Also the value was stored to 64(r29). 0x50243fc4 <+312>: addi r4,r1,296 0x50243fc8 <+316>: mr r5,r27 0x50243fcc <+320>: bl 0x502e3264 <00000000.plt_pic32.memcpy> Note: getting here means that memcpy was able to store where ewxprt->xp_rtaddr.buf indicated (as the r3 value). 0x50243fd0 <+324>: lbz r3,297(r1) 0x50243fd4 <+328>: stw r27,60(r29) 0x50243fd8 <+332>: addi r3,r3,-1 0x50243fdc <+336>: clrlwi r3,r3,24 0x50243fe0 <+340>: cmplwi r3,1 0x50243fe4 <+344>: bgt 0x50244014 0x50243fe8 <+348>: lwz r3,64(r29) =3D> 0x50243fec <+352>: lwz r4,0(r3) Note: the failure was above with r3=3D=3D0x0: (gdb) info reg r0 0x50243fb8 1344552888 r1 0xffffb400 4294947840 r2 0x500a1018 1342836760 r3 0x0 0 r4 0xffffb538 4294948152 r5 0x10 16 r6 0x50047328 1342468904 r7 0x0 0 r8 0x50047324 1342468900 r9 0x0 0 r10 0x20 32 r11 0x502d691c 1345153308 r12 0x24200880 606079104 r13 0x0 0 r14 0x0 0 r15 0xffffbc28 4294949928 r16 0x10002848 268445768 r17 0x10040000 268697600 r18 0x2 2 r19 0x0 0 r20 0x1 1 r21 0x5004c044 1342488644 r22 0xffffb63c 4294948412 r23 0x80 128 r24 0x50048010 1342472208 r25 0x14 20 r26 0xffffb630 4294948400 r27 0x10 16 r28 0xe 14 r29 0x500472e0 1342468832 r30 0x5030112c 1345327404 r31 0x10040000 268697600 pc 0x50243fec 0x50243fec msr cr 0x84200080 2216689792 lr 0x50243fd0 0x50243fd0 ctr 0x0 0 xer 0x0 0 fpscr 0x0 0 vscr vrsave Note: The rest of the 2 assignments would have been done by: 0x50243ff0 <+356>: stw r4,16(r29) 0x50243ff4 <+360>: lwz r4,4(r3) 0x50243ff8 <+364>: stw r4,20(r29) 0x50243ffc <+368>: lwz r4,8(r3) 0x50244000 <+372>: stw r4,24(r29) 0x50244004 <+376>: li r4,16 0x50244008 <+380>: lwz r3,12(r3) 0x5024400c <+384>: stw r4,12(r29) 0x50244010 <+388>: stw r3,28(r29) My only guesses for alternatives are: A) A processor context switch where the other processor did not (yet) see the value stored via 64(r29) and so it used an older value. B) Something trashed the memory at 64(r29) after it was updated by the code above. C) r29's value was trashed by something, changing where 64(r29) referenced. D) r3 was trashed between the two back-to-back instructions: 0x50243fe8 <+348>: lwz r3,64(r29) =3D> 0x50243fec <+352>: lwz r4,0(r3) E) ??? I've no clue which. Both .core files seem to have zero's showing up in unexpected places previously non-zero. =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 Mon May 4 05:49: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 2126F2C4E6A; Mon, 4 May 2020 05:49:12 +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 49FsP371bRz3Dmd; Mon, 4 May 2020 05:49:11 +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 E7A811F5B4; Mon, 4 May 2020 05:49:11 +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 0445nBBa005253; Mon, 4 May 2020 05:49:11 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0445nBrl005252; Mon, 4 May 2020 05:49:11 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005040549.0445nBrl005252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 4 May 2020 05:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360619 - head/sbin/swapon X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/swapon X-SVN-Commit-Revision: 360619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 05:49:12 -0000 Author: delphij Date: Mon May 4 05:49:11 2020 New Revision: 360619 URL: https://svnweb.freebsd.org/changeset/base/360619 Log: - Fix logic error in swapoff case: follow same handling of p and linelen in the swapon case. - Use strlcpy instead of strncpy. MFC after: 1 week Modified: head/sbin/swapon/swapon.c Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Sun May 3 23:40:16 2020 (r360618) +++ head/sbin/swapon/swapon.c Mon May 4 05:49:11 2020 (r360619) @@ -548,8 +548,7 @@ swap_on_off_md(const char *name, char *mntops, int doi ret = NULL; goto err; } - strncpy(linebuf, p, linelen); - linebuf[linelen - 1] = '\0'; + strlcpy(linebuf, p, linelen); errno = 0; ul = strtoul(linebuf, &p, 10); if (errno == 0) { @@ -604,14 +603,13 @@ swap_on_off_md(const char *name, char *mntops, int doi goto err; } p = fgetln(sfd, &linelen); - if (p == NULL && - (linelen < 2 || linelen > sizeof(linebuf) - 1)) { + if (p == NULL || + (linelen < 2 || linelen > sizeof(linebuf))) { warn("mdconfig (list) unexpected output"); ret = NULL; goto err; } - strncpy(linebuf, p, linelen); - linebuf[linelen - 1] = '\0'; + strlcpy(linebuf, p, linelen); p = strchr(linebuf, ' '); if (p != NULL) *p = '\0'; From owner-svn-src-head@freebsd.org Mon May 4 07:46: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 9A7D62C7C0E; Mon, 4 May 2020 07:46:57 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.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 49Fw0w2j3Cz3LTl; Mon, 4 May 2020 07:46:56 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f174.google.com with SMTP id v9so2605077ybq.13; Mon, 04 May 2020 00:46: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:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=r0sB2DsINzyUhbQ72qZRJFNijGPAdCr5T6jnk0VEDhA=; b=bfxNteAgiSzDcz22Z6BQp7f0a1kJKyVZW8YUcWrcrYinaIA9fze9VklOTujJ7uLF6D ZuwvRJA1A9UBjHeBPRTaas3MTacKwRtVnaVQS6oVROMR64hGK66tA7RuY9NEmplW4nLk E5XTmvWBc8jLXNPkxQvROZexkug0Wa7Y7Tc6FFtX0mFBQNc1VIVlxroH6kifQ9JNI2Iw M+1R0prP4W1M2i/q4wM7bzsP2McX4U/kzmhlh7yOew4+NfVXKz0zJFDcum4q7s75TRVp MJcASnu/rcNCGDK+mH7GePyvDI3st7RlP60p1WThOm5duUv1jxIYW1Hlf1dtWDXKLvR1 V+zg== X-Gm-Message-State: AGi0PuafH2iUor8VzBYRabCXYXN95vhwSbPjQWmMBZbXzYBlGRLa6E4x dW6aczsuWfHeXtsYUouJb5prs7CfXAG6Ci9YKUckAw== X-Google-Smtp-Source: APiQypKAKU1df3WqOs+XSswqvuIdgz741/f0JAUNUIeI3eda4AJnroNsDbuOhBI+eBIXNflzyrNa05xjKtTQBxujYSQ= X-Received: by 2002:a25:2e0b:: with SMTP id u11mr12623822ybu.451.1588578414947; Mon, 04 May 2020 00:46:54 -0700 (PDT) MIME-Version: 1.0 References: <202005022239.042MdR7Z036054@repo.freebsd.org> In-Reply-To: <202005022239.042MdR7Z036054@repo.freebsd.org> From: Li-Wen Hsu Date: Mon, 4 May 2020 15:46:43 +0800 Message-ID: Subject: Re: svn commit: r360569 - in head/sys: dev/cxgbe dev/cxgbe/crypto dev/cxgbe/tom kern sys To: Gleb Smirnoff Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49Fw0w2j3Cz3LTl 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.174 as permitted sender) smtp.mailfrom=lwhsufreebsd@gmail.com X-Spamd-Result: default: False [-3.74 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; 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:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-1.74)[ip: (-7.83), ipnet: 209.85.128.0/17(-0.40), asn: 15169(-0.43), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[174.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)[174.219.85.209.rep.mailspike.net : 127.0.0.17]; 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)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 07:46:57 -0000 On Sun, May 3, 2020 at 6:39 AM Gleb Smirnoff wrote: > > Author: glebius > Date: Sat May 2 22:39:26 2020 > New Revision: 360569 > URL: https://svnweb.freebsd.org/changeset/base/360569 ... > Modified: head/sys/kern/uipc_mbuf.c > ============================================================================== > --- head/sys/kern/uipc_mbuf.c Sat May 2 20:47:58 2020 (r360568) > +++ head/sys/kern/uipc_mbuf.c Sat May 2 22:39:26 2020 (r360569) > @@ -163,11 +163,11 @@ CTASSERT(offsetof(struct mbuf, m_pktdat) % 8 == 0); > #if defined(__LP64__) > CTASSERT(offsetof(struct mbuf, m_dat) == 32); > CTASSERT(sizeof(struct pkthdr) == 56); > -CTASSERT(sizeof(struct m_ext) == 168); > +CTASSERT(sizeof(struct m_ext) == 160); > #else > CTASSERT(offsetof(struct mbuf, m_dat) == 24); > CTASSERT(sizeof(struct pkthdr) == 48); > -CTASSERT(sizeof(struct m_ext) == 184); > +CTASSERT(sizeof(struct m_ext) == 180); > #endif This assertion is failing on powerpc and powerpcspe, can you check if the constant needs adjustment? Thanks, Li-Wen From owner-svn-src-head@freebsd.org Mon May 4 08:05: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 670122C86E8; Mon, 4 May 2020 08:05:02 +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 49FwPp278Qz3MfN; Mon, 4 May 2020 08:05:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43CA72103A; Mon, 4 May 2020 08:05:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 044852MP090587; Mon, 4 May 2020 08:05:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0448523h090586; Mon, 4 May 2020 08:05:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005040805.0448523h090586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 May 2020 08:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360621 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 360621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 08:05:02 -0000 Author: hselasky Date: Mon May 4 08:05:01 2020 New Revision: 360621 URL: https://svnweb.freebsd.org/changeset/base/360621 Log: Fix warning about sleeping with non-sleepable lock when allocating "current" from linux_cdev_pager_populate() in the LinuxKPI: Backtrace: witness_debugger() witness_warn() uma_zalloc_arg() malloc() linux_alloc_current() linux_cdev_pager_populate() vm_fault() vm_fault_trap() trap_pfault() trap() calltrap() Suggested by: avg@ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 4 07:57:55 2020 (r360620) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 4 08:05:01 2020 (r360621) @@ -525,14 +525,14 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pinde struct vm_area_struct *vmap; int err; - linux_set_current(curthread); - /* get VM area structure */ vmap = linux_cdev_handle_find(vm_obj->handle); MPASS(vmap != NULL); MPASS(vmap->vm_private_data == vm_obj->handle); VM_OBJECT_WUNLOCK(vm_obj); + + linux_set_current(curthread); down_write(&vmap->vm_mm->mmap_sem); if (unlikely(vmap->vm_ops == NULL)) { From owner-svn-src-head@freebsd.org Mon May 4 09:58: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 EA5462CAE0E; Mon, 4 May 2020 09:58:45 +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 49Fyx15vg2z3yLp; Mon, 4 May 2020 09:58:45 +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 AC97F224CA; Mon, 4 May 2020 09:58:45 +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 0449wjdn059312; Mon, 4 May 2020 09:58:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0449wjmh059311; Mon, 4 May 2020 09:58:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005040958.0449wjmh059311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 May 2020 09:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360622 - 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: 360622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 09:58:46 -0000 Author: hselasky Date: Mon May 4 09:58:45 2020 New Revision: 360622 URL: https://svnweb.freebsd.org/changeset/base/360622 Log: Implement more scatter and gather functions in the LinuxKPI. Differential Revision: https://reviews.freebsd.org/D24611 Submitted by: ashafer_badland.io (Austin Shafer) MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Modified: head/sys/compat/linuxkpi/common/include/linux/scatterlist.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 4 08:05:01 2020 (r360621) +++ head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 4 09:58:45 2020 (r360622) @@ -66,6 +66,10 @@ struct sg_page_iter { } internal; }; +struct sg_dma_page_iter { + struct sg_page_iter base; +}; + #define SCATTERLIST_MAX_SEGMENT (-1U & ~(PAGE_SIZE - 1)) #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) @@ -85,6 +89,8 @@ struct sg_page_iter { #define for_each_sg_page(sgl, iter, nents, pgoffset) \ for (_sg_iter_init(sgl, iter, nents, pgoffset); \ (iter)->sg; _sg_iter_next(iter)) +#define for_each_sg_dma_page(sgl, iter, nents, pgoffset) \ + for_each_sg_page(sgl, &(iter)->base, nents, pgoffset) #define for_each_sg(sglist, sg, sgmax, iter) \ for (iter = 0, sg = (sglist); iter < (sgmax); iter++, sg = sg_next(sg)) @@ -404,6 +410,8 @@ sg_page_count(struct scatterlist *sg) { return (PAGE_ALIGN(sg->offset + sg->length) >> PAGE_SHIFT); } +#define sg_dma_page_count(sg) \ + sg_page_count(sg) static inline bool __sg_page_iter_next(struct sg_page_iter *piter) @@ -426,6 +434,8 @@ __sg_page_iter_next(struct sg_page_iter *piter) } return (1); } +#define __sg_page_iter_dma_next(itr) \ + __sg_page_iter_next(&(itr)->base) static inline void _sg_iter_init(struct scatterlist *sgl, struct sg_page_iter *iter, @@ -443,11 +453,20 @@ _sg_iter_init(struct scatterlist *sgl, struct sg_page_ } } -static inline dma_addr_t -sg_page_iter_dma_address(struct sg_page_iter *spi) -{ - return (spi->sg->dma_address + (spi->sg_pgoffset << PAGE_SHIFT)); -} +/* + * sg_page_iter_dma_address() is implemented as a macro because it + * needs to accept two different and identical structure types. This + * allows both old and new code to co-exist. The compile time assert + * adds some safety, that the structure sizes match. + */ +#define sg_page_iter_dma_address(spi) ({ \ + struct sg_page_iter *__spi = (void *)(spi); \ + dma_addr_t __dma_address; \ + CTASSERT(sizeof(*(spi)) == sizeof(*__spi)); \ + __dma_address = __spi->sg->dma_address + \ + (__spi->sg_pgoffset << PAGE_SHIFT); \ + __dma_address; \ +}) static inline struct page * sg_page_iter_page(struct sg_page_iter *piter) From owner-svn-src-head@freebsd.org Mon May 4 10: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 670A22CB431; Mon, 4 May 2020 10:10:08 +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 49FzB826Dkz404x; Mon, 4 May 2020 10:10:08 +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 43904226B2; Mon, 4 May 2020 10:10:08 +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 044AA82F065437; Mon, 4 May 2020 10:10:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044AA8wZ065436; Mon, 4 May 2020 10:10:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005041010.044AA8wZ065436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 May 2020 10:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360623 - 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: 360623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 10:10:08 -0000 Author: hselasky Date: Mon May 4 10:10:07 2020 New Revision: 360623 URL: https://svnweb.freebsd.org/changeset/base/360623 Log: Optimise use of sg_page_count() in __sg_page_iter_next() in the LinuxKPI. No need to compute value twice. No functional change intended. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Modified: head/sys/compat/linuxkpi/common/include/linux/scatterlist.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 4 09:58:45 2020 (r360622) +++ head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 4 10:10:07 2020 (r360623) @@ -416,6 +416,8 @@ sg_page_count(struct scatterlist *sg) static inline bool __sg_page_iter_next(struct sg_page_iter *piter) { + unsigned int pgcount; + if (piter->internal.nents == 0) return (0); if (piter->sg == NULL) @@ -424,8 +426,11 @@ __sg_page_iter_next(struct sg_page_iter *piter) piter->sg_pgoffset += piter->internal.pg_advance; piter->internal.pg_advance = 1; - while (piter->sg_pgoffset >= sg_page_count(piter->sg)) { - piter->sg_pgoffset -= sg_page_count(piter->sg); + while (1) { + pgcount = sg_page_count(piter->sg); + if (likely(piter->sg_pgoffset < pgcount)) + break; + piter->sg_pgoffset -= pgcount; piter->sg = sg_next(piter->sg); if (--piter->internal.nents == 0) return (0); From owner-svn-src-head@freebsd.org Mon May 4 10:59: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 D41F02CC48B; Mon, 4 May 2020 10:59:17 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49G0Gs548Cz42Yc; Mon, 4 May 2020 10:59:17 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A935023000; Mon, 4 May 2020 10:59:17 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 044AxHUP096070; Mon, 4 May 2020 10:59:17 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044AxHOp096069; Mon, 4 May 2020 10:59:17 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202005041059.044AxHOp096069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 4 May 2020 10:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360624 - head/sys/dev/evdev X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/evdev X-SVN-Commit-Revision: 360624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 10:59:17 -0000 Author: wulf Date: Mon May 4 10:59:17 2020 New Revision: 360624 URL: https://svnweb.freebsd.org/changeset/base/360624 Log: [evdev] Add AT translated set1 scancodes for F-unlocked F1-12 keys. "F lock" is a switch between two sets of scancodes for function keys F1-F12 found on some Logitech and Microsoft PS/2 keyboards [1]. When "F lock" is pressed, then F1-F12 act as function keys and produce usual keyscans for these keys. When "F lock" is depressed, F1-F12 produced the same keyscans but prefixed with E0. Some laptops use [2] E0-prefixed F1-F12 scancodes for non-standard keys. [1] https://www.win.tue.nl/~aeb/linux/kbd/scancodes-6.html [2] https://reviews.freebsd.org/D21565 MFC after: 2 weeks Modified: head/sys/dev/evdev/evdev_utils.c Modified: head/sys/dev/evdev/evdev_utils.c ============================================================================== --- head/sys/dev/evdev/evdev_utils.c Mon May 4 10:10:07 2020 (r360623) +++ head/sys/dev/evdev/evdev_utils.c Mon May 4 10:59:17 2020 (r360624) @@ -166,16 +166,16 @@ static uint16_t evdev_at_set1_scancodes[] = { NONE, NONE, KEY_VOLUMEDOWN, NONE, KEY_VOLUMEUP, NONE, KEY_HOMEPAGE, NONE, NONE, KEY_KPSLASH, NONE, KEY_SYSRQ, - KEY_RIGHTALT, NONE, NONE, NONE, - NONE, NONE, NONE, NONE, + KEY_RIGHTALT, NONE, NONE, KEY_F13, + KEY_F14, KEY_F15, KEY_F16, KEY_F17, /* 0x40 - 0x5f. 0xE0 prefixed */ - NONE, NONE, NONE, NONE, - NONE, NONE, KEY_PAUSE, KEY_HOME, + KEY_F18, KEY_F19, KEY_F20, KEY_F21, + KEY_F22, NONE, KEY_PAUSE, KEY_HOME, KEY_UP, KEY_PAGEUP, NONE, KEY_LEFT, NONE, KEY_RIGHT, NONE, KEY_END, KEY_DOWN, KEY_PAGEDOWN, KEY_INSERT, KEY_DELETE, - NONE, NONE, NONE, NONE, - NONE, NONE, NONE, KEY_LEFTMETA, + NONE, NONE, NONE, KEY_F23, + KEY_F24, NONE, NONE, KEY_LEFTMETA, KEY_RIGHTMETA, KEY_MENU, KEY_POWER, KEY_SLEEP, /* 0x60 - 0x7f. 0xE0 prefixed */ NONE, NONE, NONE, KEY_WAKEUP, From owner-svn-src-head@freebsd.org Mon May 4 11:00: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 F24B22CC53D; Mon, 4 May 2020 11:00:24 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49G0J863SRz42k5; Mon, 4 May 2020 11:00:24 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAFE523027; Mon, 4 May 2020 11:00:24 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 044B0OPS096237; Mon, 4 May 2020 11:00:24 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044B0OKj096235; Mon, 4 May 2020 11:00:24 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202005041100.044B0OKj096235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 4 May 2020 11:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360625 - head/sys/dev/evdev X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/evdev X-SVN-Commit-Revision: 360625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 11:00:25 -0000 Author: wulf Date: Mon May 4 11:00:24 2020 New Revision: 360625 URL: https://svnweb.freebsd.org/changeset/base/360625 Log: [evdev] Sync event codes with Linux kernel 5.6 MFC after: 2 weeks Modified: head/sys/dev/evdev/input-event-codes.h head/sys/dev/evdev/input.h Modified: head/sys/dev/evdev/input-event-codes.h ============================================================================== --- head/sys/dev/evdev/input-event-codes.h Mon May 4 10:59:17 2020 (r360624) +++ head/sys/dev/evdev/input-event-codes.h Mon May 4 11:00:24 2020 (r360625) @@ -453,10 +453,12 @@ #define KEY_TITLE 0x171 #define KEY_SUBTITLE 0x172 #define KEY_ANGLE 0x173 -#define KEY_ZOOM 0x174 +#define KEY_FULL_SCREEN 0x174 /* AC View Toggle */ +#define KEY_ZOOM KEY_FULL_SCREEN #define KEY_MODE 0x175 #define KEY_KEYBOARD 0x176 -#define KEY_SCREEN 0x177 +#define KEY_ASPECT_RATIO 0x177 /* HUTRR37: Aspect */ +#define KEY_SCREEN KEY_ASPECT_RATIO #define KEY_PC 0x178 /* Media Select Computer */ #define KEY_TV 0x179 /* Media Select TV */ #define KEY_TV2 0x17a /* Media Select Cable */ @@ -618,6 +620,7 @@ #define KEY_SCREENSAVER 0x245 /* AL Screen Saver */ #define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */ #define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */ +#define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */ #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ @@ -660,7 +663,87 @@ */ #define KEY_DATA 0x277 #define KEY_ONSCREEN_KEYBOARD 0x278 +/* Electronic privacy screen control */ +#define KEY_PRIVACY_SCREEN_TOGGLE 0x279 +/* Select an area of screen to be copied */ +#define KEY_SELECTIVE_SCREENSHOT 0x27a + +/* + * Some keyboards have keys which do not have a defined meaning, these keys + * are intended to be programmed / bound to macros by the user. For most + * keyboards with these macro-keys the key-sequence to inject, or action to + * take, is all handled by software on the host side. So from the kernel's + * point of view these are just normal keys. + * + * The KEY_MACRO# codes below are intended for such keys, which may be labeled + * e.g. G1-G18, or S1 - S30. The KEY_MACRO# codes MUST NOT be used for keys + * where the marking on the key does indicate a defined meaning / purpose. + * + * The KEY_MACRO# codes MUST also NOT be used as fallback for when no existing + * KEY_FOO define matches the marking / purpose. In this case a new KEY_FOO + * define MUST be added. + */ +#define KEY_MACRO1 0x290 +#define KEY_MACRO2 0x291 +#define KEY_MACRO3 0x292 +#define KEY_MACRO4 0x293 +#define KEY_MACRO5 0x294 +#define KEY_MACRO6 0x295 +#define KEY_MACRO7 0x296 +#define KEY_MACRO8 0x297 +#define KEY_MACRO9 0x298 +#define KEY_MACRO10 0x299 +#define KEY_MACRO11 0x29a +#define KEY_MACRO12 0x29b +#define KEY_MACRO13 0x29c +#define KEY_MACRO14 0x29d +#define KEY_MACRO15 0x29e +#define KEY_MACRO16 0x29f +#define KEY_MACRO17 0x2a0 +#define KEY_MACRO18 0x2a1 +#define KEY_MACRO19 0x2a2 +#define KEY_MACRO20 0x2a3 +#define KEY_MACRO21 0x2a4 +#define KEY_MACRO22 0x2a5 +#define KEY_MACRO23 0x2a6 +#define KEY_MACRO24 0x2a7 +#define KEY_MACRO25 0x2a8 +#define KEY_MACRO26 0x2a9 +#define KEY_MACRO27 0x2aa +#define KEY_MACRO28 0x2ab +#define KEY_MACRO29 0x2ac +#define KEY_MACRO30 0x2ad + +/* + * Some keyboards with the macro-keys described above have some extra keys + * for controlling the host-side software responsible for the macro handling: + * -A macro recording start/stop key. Note that not all keyboards which emit + * KEY_MACRO_RECORD_START will also emit KEY_MACRO_RECORD_STOP if + * KEY_MACRO_RECORD_STOP is not advertised, then KEY_MACRO_RECORD_START + * should be interpreted as a recording start/stop toggle; + * -Keys for switching between different macro (pre)sets, either a key for + * cycling through the configured presets or keys to directly select a preset. + */ +#define KEY_MACRO_RECORD_START 0x2b0 +#define KEY_MACRO_RECORD_STOP 0x2b1 +#define KEY_MACRO_PRESET_CYCLE 0x2b2 +#define KEY_MACRO_PRESET1 0x2b3 +#define KEY_MACRO_PRESET2 0x2b4 +#define KEY_MACRO_PRESET3 0x2b5 + +/* + * Some keyboards have a buildin LCD panel where the contents are controlled + * by the host. Often these have a number of keys directly below the LCD + * intended for controlling a menu shown on the LCD. These keys often don't + * have any labeling so we just name them KEY_KBD_LCD_MENU# + */ +#define KEY_KBD_LCD_MENU1 0x2b8 +#define KEY_KBD_LCD_MENU2 0x2b9 +#define KEY_KBD_LCD_MENU3 0x2ba +#define KEY_KBD_LCD_MENU4 0x2bb +#define KEY_KBD_LCD_MENU5 0x2bc + #define BTN_TRIGGER_HAPPY 0x2c0 #define BTN_TRIGGER_HAPPY1 0x2c0 #define BTN_TRIGGER_HAPPY2 0x2c1 @@ -722,6 +805,16 @@ #define REL_DIAL 0x07 #define REL_WHEEL 0x08 #define REL_MISC 0x09 +/* + * 0x0a is reserved and should not be used in input drivers. + * It was used by HID as REL_MISC+1 and userspace needs to detect if + * the next REL_* event is correct or is just REL_MISC + n. + * We define here REL_RESERVED so userspace can rely on it and detect + * the situation described above. + */ +#define REL_RESERVED 0x0a +#define REL_WHEEL_HI_RES 0x0b +#define REL_HWHEEL_HI_RES 0x0c #define REL_MAX 0x0f #define REL_CNT (REL_MAX+1) @@ -757,6 +850,15 @@ #define ABS_VOLUME 0x20 #define ABS_MISC 0x28 + +/* + * 0x2e is reserved and should not be used in input drivers. + * It was used by HID as ABS_MISC+6 and userspace needs to detect if + * the next ABS_* event is correct or is just ABS_MISC + n. + * We define here ABS_RESERVED so userspace can rely on it and detect + * the situation described above. + */ +#define ABS_RESERVED 0x2e #define ABS_MT_SLOT 0x2f /* MT slot being modified */ #define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */ Modified: head/sys/dev/evdev/input.h ============================================================================== --- head/sys/dev/evdev/input.h Mon May 4 10:59:17 2020 (r360624) +++ head/sys/dev/evdev/input.h Mon May 4 11:00:24 2020 (r360625) @@ -148,10 +148,11 @@ struct input_keymap_entry { /* * MT_TOOL types */ -#define MT_TOOL_FINGER 0 -#define MT_TOOL_PEN 1 -#define MT_TOOL_PALM 2 -#define MT_TOOL_MAX 2 +#define MT_TOOL_FINGER 0x00 +#define MT_TOOL_PEN 0x01 +#define MT_TOOL_PALM 0x02 +#define MT_TOOL_DIAL 0x0a +#define MT_TOOL_MAX 0x0f /* * Values describing the status of a force-feedback effect From owner-svn-src-head@freebsd.org Mon May 4 11:23: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 881CD2CD06C; Mon, 4 May 2020 11:23:56 +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 49G0qJ34djz44SQ; Mon, 4 May 2020 11:23:56 +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 64E1F235D1; Mon, 4 May 2020 11:23:56 +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 044BNu3x015132; Mon, 4 May 2020 11:23:56 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044BNuOP015131; Mon, 4 May 2020 11:23:56 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005041123.044BNuOP015131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 4 May 2020 11:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360626 - head/tests/sys/netipsec/tunnel X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/netipsec/tunnel X-SVN-Commit-Revision: 360626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 11:23:56 -0000 Author: lwhsu Date: Mon May 4 11:23:55 2020 New Revision: 360626 URL: https://svnweb.freebsd.org/changeset/base/360626 Log: Revert r360204, sys.netipsec.tunnel.empty.v{4,6} are fixed by r360560 PR: 245832 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/netipsec/tunnel/empty.sh Modified: head/tests/sys/netipsec/tunnel/empty.sh ============================================================================== --- head/tests/sys/netipsec/tunnel/empty.sh Mon May 4 11:00:24 2020 (r360625) +++ head/tests/sys/netipsec/tunnel/empty.sh Mon May 4 11:23:55 2020 (r360626) @@ -11,10 +11,6 @@ v4_head() v4_body() { - if [ "$(atf_config_get ci false)" = "true" ]; then - atf_skip "https://bugs.freebsd.org/245832" - fi - # Can't use filename "null" for this script: PR 223564 ist_test 4 null "" } @@ -33,10 +29,6 @@ v6_head() v6_body() { - if [ "$(atf_config_get ci false)" = "true" ]; then - atf_skip "https://bugs.freebsd.org/245832" - fi - ist_test 6 null "" } From owner-svn-src-head@freebsd.org Mon May 4 14:31: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 824312D1878; Mon, 4 May 2020 14:31:46 +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 49G5023JlJz4Gx8; Mon, 4 May 2020 14:31:46 +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 6A66B25A61; Mon, 4 May 2020 14:31:46 +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 044EVkaQ028486; Mon, 4 May 2020 14:31:46 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044EVjrG028480; Mon, 4 May 2020 14:31:45 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005041431.044EVjrG028480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 4 May 2020 14:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360629 - in head/sys: net net/route netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: net net/route netinet netinet6 X-SVN-Commit-Revision: 360629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 14:31:46 -0000 Author: melifaro Date: Mon May 4 14:31:45 2020 New Revision: 360629 URL: https://svnweb.freebsd.org/changeset/base/360629 Log: Remove now-unused rt_ifp,rt_ifa,rt_gateway,rt_mtu rte fields. After converting routing subsystem customers to use nexthop objects defined in r359823, some fields in struct rtentry became unused. This commit removes rt_ifp, rt_ifa, rt_gateway and rt_mtu from struct rtentry along with the code initializing and updating these fields. Cleanup of the remaining fields will be addressed by D24669. This commit also changes the implementation of the RTM_CHANGE handling. Old implementation tried to perform the whole operation under radix WLOCK, resulting in slow performance and hacks like using RTF_RNH_LOCKED flag. New implementation looks up the route nexthop under radix RLOCK, creates new nexthop and tries to update rte nhop pointer. Only last part is done under WLOCK. In the hypothetical scenarious where multiple rtsock clients repeatedly issue RTM_CHANGE requests for the same route, route may get updated between read and update operation. This is addressed by retrying the operation multiple (3) times before returning failure back to the caller. Differential Revision: https://reviews.freebsd.org/D24666 Modified: head/sys/net/route.c head/sys/net/route/route_var.h head/sys/netinet/in_rmx.c head/sys/netinet6/in6_rmx.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon May 4 12:28:44 2020 (r360628) +++ head/sys/net/route.c Mon May 4 14:31:45 2020 (r360629) @@ -162,14 +162,6 @@ static int del_route(struct rib_head *rnh, struct rt_a static int change_route(struct rib_head *, struct rt_addrinfo *, struct rtentry **); -struct if_mtuinfo -{ - struct ifnet *ifp; - int mtu; -}; - -static int if_updatemtu_cb(struct radix_node *, void *); - /* * handler for net.my_fibnum */ @@ -560,12 +552,6 @@ rtfree(struct rtentry *rt) } #endif /* - * release references on items we hold them on.. - * e.g other routes and ifaddrs. - */ - if (rt->rt_ifa) - ifa_free(rt->rt_ifa); - /* * The key is separatly alloc'd so free it (see rt_setgate()). * This also frees the gateway, as they are always malloc'd * together. @@ -1346,66 +1332,25 @@ rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum) return (error); } -static int -if_updatemtu_cb(struct radix_node *rn, void *arg) -{ - struct rtentry *rt; - struct if_mtuinfo *ifmtu; - - rt = (struct rtentry *)rn; - ifmtu = (struct if_mtuinfo *)arg; - - if (rt->rt_ifp != ifmtu->ifp) - return (0); - - if (rt->rt_mtu >= ifmtu->mtu) { - /* We have to decrease mtu regardless of flags */ - rt->rt_mtu = ifmtu->mtu; - return (0); - } - - /* - * New MTU is bigger. Check if are allowed to alter it - */ - if ((rt->rt_flags & (RTF_FIXEDMTU | RTF_GATEWAY | RTF_HOST)) != 0) { - - /* - * Skip routes with user-supplied MTU and - * non-interface routes - */ - return (0); - } - - /* We are safe to update route MTU */ - rt->rt_mtu = ifmtu->mtu; - - return (0); -} - void rt_updatemtu(struct ifnet *ifp) { - struct if_mtuinfo ifmtu; struct rib_head *rnh; + int mtu; int i, j; - ifmtu.ifp = ifp; - /* * Try to update rt_mtu for all routes using this interface * Unfortunately the only way to do this is to traverse all * routing tables in all fibs/domains. */ for (i = 1; i <= AF_MAX; i++) { - ifmtu.mtu = if_getmtu_family(ifp, i); + mtu = if_getmtu_family(ifp, i); for (j = 0; j < rt_numfibs; j++) { rnh = rt_tables_get_rnh(j, i); if (rnh == NULL) continue; - RIB_WLOCK(rnh); - rnh->rnh_walktree(&rnh->head, if_updatemtu_cb, &ifmtu); - RIB_WUNLOCK(rnh); - nhops_update_ifmtu(rnh, ifp, ifmtu.mtu); + nhops_update_ifmtu(rnh, ifp, mtu); } } } @@ -1550,7 +1495,6 @@ int rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, u_int fibnum) { - struct epoch_tracker et; const struct sockaddr *dst; struct rib_head *rnh; int error; @@ -1599,11 +1543,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, stru error = add_route(rnh, info, ret_nrt); break; case RTM_CHANGE: - NET_EPOCH_ENTER(et); - RIB_WLOCK(rnh); error = change_route(rnh, info, ret_nrt); - RIB_WUNLOCK(rnh); - NET_EPOCH_EXIT(et); break; default: error = EOPNOTSUPP; @@ -1689,8 +1629,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in * examine the ifa and ifa->ifa_ifp if it so desires. */ ifa = info->rti_ifa; - rt->rt_ifa = ifa; - rt->rt_ifp = ifa->ifa_ifp; rt->rt_weight = 1; rt_setmetrics(info, rt); @@ -1703,7 +1641,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in rt_mpath_conflict(rnh, rt, netmask)) { RIB_WUNLOCK(rnh); - ifa_free(rt->rt_ifa); R_Free(rt_key(rt)); nhop_free(nh); uma_zfree(V_rtzone, rt); @@ -1711,7 +1648,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in } #endif - /* XXX mtu manipulation will be done in rnh_addaddr -- itojun */ rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, rt->rt_nodes); if (rn != NULL && rt->rt_expire > 0) @@ -1745,7 +1681,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in * then un-make it (this should be a function) */ if (rn == NULL) { - ifa_free(rt->rt_ifa); R_Free(rt_key(rt)); nhop_free(nh); uma_zfree(V_rtzone, rt); @@ -1820,23 +1755,23 @@ del_route(struct rib_head *rnh, struct rt_addrinfo *in } static int -change_route(struct rib_head *rnh, struct rt_addrinfo *info, +change_route_one(struct rib_head *rnh, struct rt_addrinfo *info, struct rtentry **ret_nrt) { + RIB_RLOCK_TRACKER; struct rtentry *rt = NULL; int error = 0; int free_ifa = 0; - int family, mtu; - struct nhop_object *nh; - struct if_mtuinfo ifmtu; + struct nhop_object *nh, *nh_orig; - RIB_WLOCK_ASSERT(rnh); - + RIB_RLOCK(rnh); rt = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], info->rti_info[RTAX_NETMASK], &rnh->head); - if (rt == NULL) + if (rt == NULL) { + RIB_RUNLOCK(rnh); return (ESRCH); + } #ifdef RADIX_MPATH /* @@ -1845,139 +1780,135 @@ change_route(struct rib_head *rnh, struct rt_addrinfo */ if (rt_mpath_capable(rnh)) { rt = rt_mpath_matchgate(rt, info->rti_info[RTAX_GATEWAY]); - if (rt == NULL) + if (rt == NULL) { + RIB_RUNLOCK(rnh); return (ESRCH); + } } #endif + nh_orig = rt->rt_nhop; + RIB_RUNLOCK(rnh); + + rt = NULL; nh = NULL; - RT_LOCK(rt); - rt_setmetrics(info, rt); - /* * New gateway could require new ifaddr, ifp; * flags may also be different; ifp may be specified * by ll sockaddr when protocol address is ambiguous */ - if (((rt->rt_flags & RTF_GATEWAY) && + if (((nh_orig->nh_flags & NHF_GATEWAY) && info->rti_info[RTAX_GATEWAY] != NULL) || info->rti_info[RTAX_IFP] != NULL || (info->rti_info[RTAX_IFA] != NULL && - !sa_equal(info->rti_info[RTAX_IFA], rt->rt_nhop->nh_ifa->ifa_addr))) { - /* - * XXX: Temporarily set RTF_RNH_LOCKED flag in the rti_flags - * to avoid rlock in the ifa_ifwithroute(). - */ - info->rti_flags |= RTF_RNH_LOCKED; + !sa_equal(info->rti_info[RTAX_IFA], nh_orig->nh_ifa->ifa_addr))) { error = rt_getifa_fib(info, rnh->rib_fibnum); - info->rti_flags &= ~RTF_RNH_LOCKED; if (info->rti_ifa != NULL) free_ifa = 1; - if (error != 0) - goto bad; + if (error != 0) { + if (free_ifa) { + ifa_free(info->rti_ifa); + info->rti_ifa = NULL; + } + + return (error); + } } - error = nhop_create_from_nhop(rnh, rt->rt_nhop, info, &nh); + error = nhop_create_from_nhop(rnh, nh_orig, info, &nh); + if (free_ifa) { + ifa_free(info->rti_ifa); + info->rti_ifa = NULL; + } if (error != 0) - goto bad; + return (error); - /* Check if outgoing interface has changed */ - if (info->rti_ifa != NULL && info->rti_ifa != rt->rt_ifa && - rt->rt_ifa != NULL) { - if (rt->rt_ifa->ifa_rtrequest != NULL) - rt->rt_ifa->ifa_rtrequest(RTM_DELETE, rt, rt->rt_nhop, - info); - ifa_free(rt->rt_ifa); - rt->rt_ifa = NULL; - } - /* Update gateway address */ - if (info->rti_info[RTAX_GATEWAY] != NULL) { - error = rt_setgate(rt, rt_key(rt), info->rti_info[RTAX_GATEWAY]); - if (error != 0) - goto bad; + RIB_WLOCK(rnh); - rt->rt_flags &= ~RTF_GATEWAY; - rt->rt_flags |= (RTF_GATEWAY & info->rti_flags); + /* Lookup rtentry once again and check if nexthop is still the same */ + rt = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], + info->rti_info[RTAX_NETMASK], &rnh->head); + + if (rt == NULL) { + RIB_WUNLOCK(rnh); + nhop_free(nh); + return (ESRCH); } - if (info->rti_ifa != NULL && info->rti_ifa != rt->rt_ifa) { - ifa_ref(info->rti_ifa); - rt->rt_ifa = info->rti_ifa; - rt->rt_ifp = info->rti_ifp; + if (rt->rt_nhop != nh_orig) { + RIB_WUNLOCK(rnh); + nhop_free(nh); + return (EAGAIN); } - /* Allow some flags to be toggled on change. */ - rt->rt_flags &= ~RTF_FMASK; - rt->rt_flags |= info->rti_flags & RTF_FMASK; - if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest != NULL) - rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, nh, info); + /* Proceed with the update */ + RT_LOCK(rt); - /* Alter route MTU if necessary */ - if (rt->rt_ifp != NULL) { - family = info->rti_info[RTAX_DST]->sa_family; - mtu = if_getmtu_family(rt->rt_ifp, family); - /* Set default MTU */ - if (rt->rt_mtu == 0) - rt->rt_mtu = mtu; - if (rt->rt_mtu != mtu) { - /* Check if we really need to update */ - ifmtu.ifp = rt->rt_ifp; - ifmtu.mtu = mtu; - if_updatemtu_cb(rt->rt_nodes, &ifmtu); - } - } + /* Provide notification to the protocols.*/ + if ((nh_orig->nh_ifa != nh->nh_ifa) && nh_orig->nh_ifa->ifa_rtrequest) + nh_orig->nh_ifa->ifa_rtrequest(RTM_DELETE, rt, nh_orig, info); - /* Update nexthop */ - nhop_free(rt->rt_nhop); rt->rt_nhop = nh; - nh = NULL; + rt_setmetrics(info, rt); - /* - * This route change may have modified the route's gateway. In that - * case, any inpcbs that have cached this route need to invalidate their - * llentry cache. - */ - rnh->rnh_gen++; + if ((nh_orig->nh_ifa != nh->nh_ifa) && nh_orig->nh_ifa->ifa_rtrequest) + nh_orig->nh_ifa->ifa_rtrequest(RTM_DELETE, rt, nh_orig, info); - if (ret_nrt) { + if (ret_nrt != NULL) { *ret_nrt = rt; RT_ADDREF(rt); } -bad: + RT_UNLOCK(rt); - if (nh != NULL) - nhop_free(nh); - if (free_ifa != 0) { - ifa_free(info->rti_ifa); - info->rti_ifa = NULL; + + /* Update generation id to reflect rtable change */ + rnh->rnh_gen++; + + RIB_WUNLOCK(rnh); + + nhop_free(nh_orig); + + return (0); +} + +static int +change_route(struct rib_head *rnh, struct rt_addrinfo *info, + struct rtentry **ret_nrt) +{ + struct epoch_tracker et; + int error; + + /* Check if updated gateway exists */ + if ((info->rti_flags & RTF_GATEWAY) && + (info->rti_info[RTAX_GATEWAY] == NULL)) + return (EINVAL); + + NET_EPOCH_ENTER(et); + + /* + * route change is done in multiple steps, with dropping and + * reacquiring lock. In the situations with multiple processes + * changes the same route in can lead to the case when route + * is changed between the steps. Address it by retrying the operation + * multiple times before failing. + */ + for (int i = 0; i < RIB_MAX_RETRIES; i++) { + error = change_route_one(rnh, info, ret_nrt); + if (error != EAGAIN) + break; } + NET_EPOCH_EXIT(et); + return (error); } + static void rt_setmetrics(const struct rt_addrinfo *info, struct rtentry *rt) { - if (info->rti_mflags & RTV_MTU) { - if (info->rti_rmx->rmx_mtu != 0) { - - /* - * MTU was explicitly provided by user. - * Keep it. - */ - rt->rt_flags |= RTF_FIXEDMTU; - } else { - - /* - * User explicitly sets MTU to 0. - * Assume rollback to default. - */ - rt->rt_flags &= ~RTF_FIXEDMTU; - } - rt->rt_mtu = info->rti_rmx->rmx_mtu; - } if (info->rti_mflags & RTV_WEIGHT) rt->rt_weight = info->rti_rmx->rmx_weight; /* Kernel -> userland timebase conversion. */ @@ -1999,7 +1930,7 @@ rt_setgate(struct rtentry *rt, struct sockaddr *dst, s * rt_gateway already points to the right place. * Otherwise, malloc a new block and update the 'dst' address. */ - if (rt->rt_gateway == NULL || glen > SA_SIZE(rt->rt_gateway)) { + if (rt_key(rt) == NULL) { caddr_t new; R_Malloc(new, caddr_t, dlen + glen); @@ -2015,14 +1946,8 @@ rt_setgate(struct rtentry *rt, struct sockaddr *dst, s bcopy(dst, new, dlen); R_Free(rt_key(rt)); /* free old block, if any */ rt_key(rt) = (struct sockaddr *)new; - rt->rt_gateway = (struct sockaddr *)(new + dlen); } - /* - * Copy the new gateway value into the memory chunk. - */ - bcopy(gate, rt->rt_gateway, glen); - return (0); } @@ -2149,8 +2074,8 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi else { rt = RNTORT(rn); /* - * for interface route the - * rt->rt_gateway is sockaddr_dl, so + * for interface route the gateway + * gateway is sockaddr_dl, so * rt_mpath_matchgate must use the * interface address */ @@ -2192,22 +2117,8 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi * notify any listening routing agents of the change */ RT_LOCK(rt); -#ifdef RADIX_MPATH - /* - * in case address alias finds the first address - * e.g. ifconfig bge0 192.0.2.246/24 - * e.g. ifconfig bge0 192.0.2.247/24 - * the address set in the route is 192.0.2.246 - * so we need to replace it with 192.0.2.247 - */ - if (memcmp(rt->rt_ifa->ifa_addr, - ifa->ifa_addr, ifa->ifa_addr->sa_len)) { - ifa_free(rt->rt_ifa); - ifa_ref(ifa); - rt->rt_ifp = ifa->ifa_ifp; - rt->rt_ifa = ifa; - } -#endif + + /* TODO: interface routes/aliases */ RT_ADDREF(rt); RT_UNLOCK(rt); rt_newaddrmsg_fib(cmd, ifa, rt, fibnum); Modified: head/sys/net/route/route_var.h ============================================================================== --- head/sys/net/route/route_var.h Mon May 4 12:28:44 2020 (r360628) +++ head/sys/net/route/route_var.h Mon May 4 14:31:45 2020 (r360629) @@ -74,6 +74,9 @@ struct rib_head { #define RIB_LOCK_ASSERT(rh) rm_assert(&(rh)->rib_lock, RA_LOCKED) #define RIB_WLOCK_ASSERT(rh) rm_assert(&(rh)->rib_lock, RA_WLOCKED) +/* Constants */ +#define RIB_MAX_RETRIES 3 + /* Macro for verifying fields in af-specific 'struct route' structures */ #define CHK_STRUCT_FIELD_GENERIC(_s1, _f1, _s2, _f2) \ _Static_assert(sizeof(((_s1 *)0)->_f1) == sizeof(((_s2 *)0)->_f2), \ @@ -117,14 +120,10 @@ struct rtentry { #define rt_mask(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_mask))) #define rt_key_const(r) (*((const struct sockaddr * const *)(&(r)->rt_nodes->rn_key))) #define rt_mask_const(r) (*((const struct sockaddr * const *)(&(r)->rt_nodes->rn_mask))) - struct sockaddr *rt_gateway; /* value */ - struct ifnet *rt_ifp; /* the answer: interface to use */ - struct ifaddr *rt_ifa; /* the answer: interface address to use */ struct nhop_object *rt_nhop; /* nexthop data */ int rt_flags; /* up/down?, host/net */ int rt_refcnt; /* # held references */ u_int rt_fibnum; /* which FIB */ - u_long rt_mtu; /* MTU for this path */ u_long rt_weight; /* absolute weight */ u_long rt_expire; /* lifetime for route, e.g. redirect */ #define rt_endzero rt_pksent Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Mon May 4 12:28:44 2020 (r360628) +++ head/sys/netinet/in_rmx.c Mon May 4 14:31:45 2020 (r360629) @@ -120,63 +120,6 @@ rib4_preadd(u_int fibnum, const struct sockaddr *addr, return (0); } -/* - * Do what we need to do when inserting a route. - */ -static struct radix_node * -in_addroute(void *v_arg, void *n_arg, struct radix_head *head, - struct radix_node *treenodes) -{ - struct rtentry *rt = (struct rtentry *)treenodes; - struct sockaddr_in *sin = (struct sockaddr_in *)rt_key(rt); - - /* - * A little bit of help for both IP output and input: - * For host routes, we make sure that RTF_BROADCAST - * is set for anything that looks like a broadcast address. - * This way, we can avoid an expensive call to in_broadcast() - * in ip_output() most of the time (because the route passed - * to ip_output() is almost always a host route). - * - * We also do the same for local addresses, with the thought - * that this might one day be used to speed up ip_input(). - * - * We also mark routes to multicast addresses as such, because - * it's easy to do and might be useful (but this is much more - * dubious since it's so easy to inspect the address). - */ - if (rt->rt_flags & RTF_HOST) { - struct epoch_tracker et; - bool bcast; - - NET_EPOCH_ENTER(et); - bcast = in_broadcast(sin->sin_addr, rt->rt_ifp); - NET_EPOCH_EXIT(et); - if (bcast) - rt->rt_flags |= RTF_BROADCAST; - else if (satosin(rt->rt_ifa->ifa_addr)->sin_addr.s_addr == - sin->sin_addr.s_addr) - rt->rt_flags |= RTF_LOCAL; - } - if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) - rt->rt_flags |= RTF_MULTICAST; - - if (rt->rt_ifp != NULL) { - - /* - * Check route MTU: - * inherit interface MTU if not set or - * check if MTU is too large. - */ - if (rt->rt_mtu == 0) { - rt->rt_mtu = rt->rt_ifp->if_mtu; - } else if (rt->rt_mtu > rt->rt_ifp->if_mtu) - rt->rt_mtu = rt->rt_ifp->if_mtu; - } - - return (rn_addroute(v_arg, n_arg, head, treenodes)); -} - static int _in_rt_was_here; /* * Initialize our routing tree. @@ -191,7 +134,6 @@ in_inithead(void **head, int off, u_int fibnum) return (0); rh->rnh_preadd = rib4_preadd; - rh->rnh_addaddr = in_addroute; #ifdef RADIX_MPATH rt_mpath_init_rnh(rh); #endif Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Mon May 4 12:28:44 2020 (r360628) +++ head/sys/netinet6/in6_rmx.c Mon May 4 14:31:45 2020 (r360629) @@ -143,57 +143,6 @@ rib6_preadd(u_int fibnum, const struct sockaddr *addr, } /* - * Do what we need to do when inserting a route. - */ -static struct radix_node * -in6_addroute(void *v_arg, void *n_arg, struct radix_head *head, - struct radix_node *treenodes) -{ - struct rtentry *rt = (struct rtentry *)treenodes; - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)rt_key(rt); - - if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) - rt->rt_flags |= RTF_MULTICAST; - - /* - * A little bit of help for both IPv6 output and input: - * For local addresses, we make sure that RTF_LOCAL is set, - * with the thought that this might one day be used to speed up - * ip_input(). - * - * We also mark routes to multicast addresses as such, because - * it's easy to do and might be useful (but this is much more - * dubious since it's so easy to inspect the address). (This - * is done above.) - * - * XXX - * should elaborate the code. - */ - if (rt->rt_flags & RTF_HOST) { - if (IN6_ARE_ADDR_EQUAL(&satosin6(rt->rt_ifa->ifa_addr) - ->sin6_addr, - &sin6->sin6_addr)) { - rt->rt_flags |= RTF_LOCAL; - } - } - - if (rt->rt_ifp != NULL) { - - /* - * Check route MTU: - * inherit interface MTU if not set or - * check if MTU is too large. - */ - if (rt->rt_mtu == 0) { - rt->rt_mtu = IN6_LINKMTU(rt->rt_ifp); - } else if (rt->rt_mtu > IN6_LINKMTU(rt->rt_ifp)) - rt->rt_mtu = IN6_LINKMTU(rt->rt_ifp); - } - - return (rn_addroute(v_arg, n_arg, head, treenodes)); -} - -/* * Initialize our routing tree. */ @@ -207,7 +156,6 @@ in6_inithead(void **head, int off, u_int fibnum) if (rh == NULL) return (0); - rh->rnh_addaddr = in6_addroute; rh->rnh_preadd = rib6_preadd; #ifdef RADIX_MPATH rt_mpath_init_rnh(rh); From owner-svn-src-head@freebsd.org Mon May 4 15:00: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 8087C2D21D2; Mon, 4 May 2020 15:00:20 +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 49G5d02wYlz4JN8; Mon, 4 May 2020 15:00:20 +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 5F8B325E7E; Mon, 4 May 2020 15:00:20 +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 044F0KU4044260; Mon, 4 May 2020 15:00:20 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044F0KMA044259; Mon, 4 May 2020 15:00:20 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005041500.044F0KMA044259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 4 May 2020 15:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360630 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 360630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 15:00:20 -0000 Author: melifaro Date: Mon May 4 15:00:19 2020 New Revision: 360630 URL: https://svnweb.freebsd.org/changeset/base/360630 Log: Simplify address parsing in DDB show route command. Use db_get_line() to overcome parser limitation. Differential Revision: https://reviews.freebsd.org/D24662 Modified: head/sys/net/route/route_ddb.c Modified: head/sys/net/route/route_ddb.c ============================================================================== --- head/sys/net/route/route_ddb.c Mon May 4 14:31:45 2020 (r360629) +++ head/sys/net/route/route_ddb.c Mon May 4 15:00:19 2020 (r360630) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" +#include #include #include #include @@ -206,239 +207,45 @@ DB_SHOW_COMMAND(routetable, db_show_routetable_cmd) _DB_FUNC(_show, route, db_show_route_cmd, db_show_table, CS_OWN, NULL) { - char buf[INET6_ADDRSTRLEN], *bp; - const void *dst_addrp; - struct sockaddr *dstp; + char abuf[INET6_ADDRSTRLEN], *buf, *end; + void *dst_addrp; struct rtentry *rt; union { struct sockaddr_in dest_sin; struct sockaddr_in6 dest_sin6; } u; - uint16_t hextets[8]; - unsigned i, tets; - int t, af, exp, tokflags; + int af; - /* - * Undecoded address family. No double-colon expansion seen yet. - */ - af = -1; - exp = -1; - /* Assume INET6 to start; we can work back if guess was wrong. */ - tokflags = DRT_WSPACE | DRT_HEX | DRT_HEXADECIMAL; + buf = db_get_line(); - /* - * db_command has lexed 'show route' for us. - */ - t = db_read_token_flags(tokflags); - if (t == tWSPACE) - t = db_read_token_flags(tokflags); + /* Remove whitespaces from both ends */ + end = buf + strlen(buf) - 1; + for (; (end >= buf) && (*end=='\n' || isspace(*end)); end--) + *end = '\0'; + while (isspace(*buf)) + buf++; - /* - * tEOL: Just 'show route' isn't a valid mode. - * tMINUS: It's either '-h' or some invalid option. Regardless, usage. - */ - if (t == tEOL || t == tMINUS) - goto usage; - - db_unread_token(t); - - tets = nitems(hextets); - - /* - * Each loop iteration, we expect to read one octet (v4) or hextet - * (v6), followed by an appropriate field separator ('.' or ':' or - * '::'). - * - * At the start of each loop, we're looking for a number (octet or - * hextet). - * - * INET6 addresses have a special case where they may begin with '::'. - */ - for (i = 0; i < tets; i++) { - t = db_read_token_flags(tokflags); - - if (t == tCOLONCOLON) { - /* INET6 with leading '::' or invalid. */ - if (i != 0) { - db_printf("Parse error: unexpected extra " - "colons.\n"); - goto exit; - } - - af = AF_INET6; - exp = i; - hextets[i] = 0; - continue; - } else if (t == tNUMBER) { - /* - * Lexer separates out '-' as tMINUS, but make the - * assumption explicit here. - */ - MPASS(db_tok_number >= 0); - - if (af == AF_INET && db_tok_number > UINT8_MAX) { - db_printf("Not a valid v4 octet: %ld\n", - (long)db_tok_number); - goto exit; - } - hextets[i] = db_tok_number; - } else if (t == tEOL) { - /* - * We can only detect the end of an IPv6 address in - * compact representation with EOL. - */ - if (af != AF_INET6 || exp < 0) { - db_printf("Parse failed. Got unexpected EOF " - "when the address is not a compact-" - "representation IPv6 address.\n"); - goto exit; - } - break; - } else { - db_printf("Parse failed. Unexpected token %d.\n", t); - goto exit; - } - - /* Next, look for a separator, if appropriate. */ - if (i == tets - 1) - continue; - - t = db_read_token_flags(tokflags); - if (af < 0) { - if (t == tCOLON) { - af = AF_INET6; - continue; - } - if (t == tCOLONCOLON) { - af = AF_INET6; - i++; - hextets[i] = 0; - exp = i; - continue; - } - if (t == tDOT) { - unsigned hn, dn; - - af = AF_INET; - /* Need to fixup the first parsed number. */ - if (hextets[0] > 0x255 || - (hextets[0] & 0xf0) > 0x90 || - (hextets[0] & 0xf) > 9) { - db_printf("Not a valid v4 octet: %x\n", - hextets[0]); - goto exit; - } - - hn = hextets[0]; - dn = (hn >> 8) * 100 + - ((hn >> 4) & 0xf) * 10 + - (hn & 0xf); - - hextets[0] = dn; - - /* Switch to decimal for remaining octets. */ - tokflags &= ~DRT_RADIX_MASK; - tokflags |= DRT_DECIMAL; - - tets = 4; - continue; - } - - db_printf("Parse error. Unexpected token %d.\n", t); - goto exit; - } else if (af == AF_INET) { - if (t == tDOT) - continue; - db_printf("Expected '.' (%d) between octets but got " - "(%d).\n", tDOT, t); - goto exit; - - } else if (af == AF_INET6) { - if (t == tCOLON) - continue; - if (t == tCOLONCOLON) { - if (exp < 0) { - i++; - hextets[i] = 0; - exp = i; - continue; - } - db_printf("Got bogus second '::' in v6 " - "address.\n"); - goto exit; - } - if (t == tEOL) { - /* - * Handle in the earlier part of the loop - * because we need to handle trailing :: too. - */ - db_unread_token(t); - continue; - } - - db_printf("Expected ':' (%d) or '::' (%d) between " - "hextets but got (%d).\n", tCOLON, tCOLONCOLON, t); - goto exit; - } - } - - /* Check for trailing garbage. */ - if (i == tets) { - t = db_read_token_flags(tokflags); - if (t != tEOL) { - db_printf("Got unexpected garbage after address " - "(%d).\n", t); - goto exit; - } - } - - /* - * Need to expand compact INET6 addresses. - * - * Technically '::' for a single ':0:' is MUST NOT but just in case, - * don't bother expanding that form (exp >= 0 && i == tets case). - */ - if (af == AF_INET6 && exp >= 0 && i < tets) { - if (exp + 1 < i) { - memmove(&hextets[exp + 1 + (nitems(hextets) - i)], - &hextets[exp + 1], - (i - (exp + 1)) * sizeof(hextets[0])); - } - memset(&hextets[exp + 1], 0, (nitems(hextets) - i) * - sizeof(hextets[0])); - } - - memset(&u, 0, sizeof(u)); - if (af == AF_INET) { - u.dest_sin.sin_family = AF_INET; - u.dest_sin.sin_len = sizeof(u.dest_sin); - u.dest_sin.sin_addr.s_addr = htonl( - ((uint32_t)hextets[0] << 24) | - ((uint32_t)hextets[1] << 16) | - ((uint32_t)hextets[2] << 8) | - (uint32_t)hextets[3]); - dstp = (void *)&u.dest_sin; - dst_addrp = &u.dest_sin.sin_addr; - } else if (af == AF_INET6) { - u.dest_sin6.sin6_family = AF_INET6; - u.dest_sin6.sin6_len = sizeof(u.dest_sin6); - for (i = 0; i < nitems(hextets); i++) - u.dest_sin6.sin6_addr.s6_addr16[i] = htons(hextets[i]); - dstp = (void *)&u.dest_sin6; + /* Determine AF */ + if (strchr(buf, ':') != NULL) { + af = AF_INET6; + u.dest_sin6.sin6_family = af; + u.dest_sin6.sin6_len = sizeof(struct sockaddr_in6); dst_addrp = &u.dest_sin6.sin6_addr; } else { - MPASS(false); - /* UNREACHABLE */ - /* Appease Clang false positive: */ - dstp = NULL; + af = AF_INET; + u.dest_sin.sin_family = af; + u.dest_sin.sin_len = sizeof(struct sockaddr_in); + dst_addrp = &u.dest_sin.sin_addr; } - bp = inet_ntop(af, dst_addrp, buf, sizeof(buf)); - if (bp != NULL) - db_printf("Looking up route to destination '%s'\n", bp); + if (inet_pton(af, buf, dst_addrp) != 1) + goto usage; + if (inet_ntop(af, dst_addrp, abuf, sizeof(abuf)) != NULL) + db_printf("Looking up route to destination '%s'\n", abuf); + CURVNET_SET(vnet0); - rt = rtalloc1(dstp, 0, RTF_RNH_LOCKED); + rt = rtalloc1((struct sockaddr *)&u, 0, RTF_RNH_LOCKED); CURVNET_RESTORE(); if (rt == NULL) { @@ -452,9 +259,7 @@ _DB_FUNC(_show, route, db_show_route_cmd, db_show_tabl return; usage: db_printf("Usage: 'show route
'\n" - " Currently accepts only dotted-decimal INET or colon-separated\n" - " hextet INET6 addresses.\n"); -exit: + " Currently accepts only IPv4 and IPv6 addresses\n"); db_skip_to_eol(); } From owner-svn-src-head@freebsd.org Mon May 4 15:07: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 EF9F22D24AB; Mon, 4 May 2020 15:07:57 +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 49G5nn648hz4K36; Mon, 4 May 2020 15:07:57 +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 CB974260BC; Mon, 4 May 2020 15:07:57 +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 044F7vpq050633; Mon, 4 May 2020 15:07:57 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044F7vwD050632; Mon, 4 May 2020 15:07:57 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005041507.044F7vwD050632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 4 May 2020 15:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360631 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 360631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 15:07:58 -0000 Author: melifaro Date: Mon May 4 15:07:57 2020 New Revision: 360631 URL: https://svnweb.freebsd.org/changeset/base/360631 Log: Switch DDB show route to direct rnh_matchaddr() call instead of rtalloc1(). Eliminate the last rtalloc1() call to finish transition to the new routing KPI defined in r359823. Differential Revision: https://reviews.freebsd.org/D24663 Modified: head/sys/net/route/route_ddb.c Modified: head/sys/net/route/route_ddb.c ============================================================================== --- head/sys/net/route/route_ddb.c Mon May 4 15:00:19 2020 (r360630) +++ head/sys/net/route/route_ddb.c Mon May 4 15:07:57 2020 (r360631) @@ -208,6 +208,8 @@ DB_SHOW_COMMAND(routetable, db_show_routetable_cmd) _DB_FUNC(_show, route, db_show_route_cmd, db_show_table, CS_OWN, NULL) { char abuf[INET6_ADDRSTRLEN], *buf, *end; + struct rib_head *rh; + struct radix_node *rn; void *dst_addrp; struct rtentry *rt; union { @@ -244,8 +246,15 @@ _DB_FUNC(_show, route, db_show_route_cmd, db_show_tabl if (inet_ntop(af, dst_addrp, abuf, sizeof(abuf)) != NULL) db_printf("Looking up route to destination '%s'\n", abuf); + rt = NULL; CURVNET_SET(vnet0); - rt = rtalloc1((struct sockaddr *)&u, 0, RTF_RNH_LOCKED); + + rh = rt_tables_get_rnh(RT_DEFAULT_FIB, af); + + rn = rh->rnh_matchaddr(&u, &rh->head); + if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) + rt = (struct rtentry *)rn; + CURVNET_RESTORE(); if (rt == NULL) { @@ -254,7 +263,6 @@ _DB_FUNC(_show, route, db_show_route_cmd, db_show_tabl } rt_dumpentry_ddb((void *)rt, NULL); - RTFREE_LOCKED(rt); return; usage: From owner-svn-src-head@freebsd.org Mon May 4 16:03: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 1AAB12D3C3E; Mon, 4 May 2020 16:03:19 +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 49G71f6zzYz4NW0; Mon, 4 May 2020 16:03:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-164.local (unknown [IPv6:2601:648:8203:2990:2990:31cc:8e09:29e9]) (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 82125948B; Mon, 4 May 2020 16:03:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r360574 - in head: share/man/man9 sys/dev/cxgbe sys/dev/cxgbe/crypto sys/dev/cxgbe/tom sys/kern sys/sys To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005022346.042NkUYk078455@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Mon, 4 May 2020 09:03:16 -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: <202005022346.042NkUYk078455@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.29 Precedence: list List-Id: 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, 04 May 2020 16:03:19 -0000 On 5/2/20 4:46 PM, Gleb Smirnoff wrote: > Author: glebius > Date: Sat May 2 23:46:29 2020 > New Revision: 360574 > URL: https://svnweb.freebsd.org/changeset/base/360574 > > Log: > Step 2.2: > o Shrink sglist(9) functions to work with multipage mbufs down from > four functions to two. > o Don't use 'struct mbuf_ext_pgs *' as argument, use struct mbuf. > o Rename to something matching _epg. > > Reviewed by: gallatin > Differential Revision: https://reviews.freebsd.org/D24598 MLINKS in share/man/man9/Makefile need to be updated and old links added to ObsoleteFiles.inc? -- John Baldwin From owner-svn-src-head@freebsd.org Mon May 4 16:50: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 8A9A72D48EF; Mon, 4 May 2020 16:50: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 49G83Z2kRkz4Qvw; Mon, 4 May 2020 16:50: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 545262746F; Mon, 4 May 2020 16:50: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 044Go27H011720; Mon, 4 May 2020 16:50:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044Go2nu011719; Mon, 4 May 2020 16:50:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005041650.044Go2nu011719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 4 May 2020 16:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360634 - head/sbin/setkey X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sbin/setkey X-SVN-Commit-Revision: 360634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 16:50:02 -0000 Author: jhb Date: Mon May 4 16:50:01 2020 New Revision: 360634 URL: https://svnweb.freebsd.org/changeset/base/360634 Log: Add RFC reference for AES-CTR with IPsec. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sbin/setkey/setkey.8 Modified: head/sbin/setkey/setkey.8 ============================================================================== --- head/sbin/setkey/setkey.8 Mon May 4 16:30:36 2020 (r360633) +++ head/sbin/setkey/setkey.8 Mon May 4 16:50:01 2020 (r360634) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 01, 2020 +.Dd May 04, 2020 .Dt SETKEY 8 .Os .\" @@ -613,7 +613,7 @@ parameter: algorithm keylen (bits) comment null 0 to 2048 rfc2410 rijndael-cbc 128/192/256 rfc3602 -aes-ctr 160/224/288 draft-ietf-ipsec-ciph-aes-ctr-03 +aes-ctr 160/224/288 rfc3686 aes-gcm-16 160/224/288 rfc4106 .Ed .Pp From owner-svn-src-head@freebsd.org Mon May 4 17:16: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 5F02D2D5186; Mon, 4 May 2020 17:16:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49G8f71vVZz4STM; Mon, 4 May 2020 17:16:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37D2427A03; Mon, 4 May 2020 17:16:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 044HGVO4030767; Mon, 4 May 2020 17:16:31 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044HGU5p030765; Mon, 4 May 2020 17:16:30 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202005041716.044HGU5p030765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 4 May 2020 17:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360635 - in head/contrib/jemalloc: . include/jemalloc X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/contrib/jemalloc: . include/jemalloc X-SVN-Commit-Revision: 360635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 17:16:31 -0000 Author: brooks Date: Mon May 4 17:16:30 2020 New Revision: 360635 URL: https://svnweb.freebsd.org/changeset/base/360635 Log: Set LG_VADDR to 48 on RISC-V. The Sv48 PTE format is the largest currently defined address space for RISC-V. It makes no sense to define a larger size and doing so (at least for 64-bits) forces rtrees down a slow path. Reviewed by: vangyzen, jhb, mhorne Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24658 Modified: head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Mon May 4 16:50:01 2020 (r360634) +++ head/contrib/jemalloc/FREEBSD-diffs Mon May 4 17:16:30 2020 (r360635) @@ -233,7 +233,7 @@ index 00000000..b752b0e7 +# define LG_SIZEOF_PTR 2 +#endif +#ifdef __riscv -+# define LG_VADDR 64 ++# define LG_VADDR 48 +# define LG_SIZEOF_PTR 3 +#endif + Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Mon May 4 16:50:01 2020 (r360634) +++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Mon May 4 17:16:30 2020 (r360635) @@ -68,7 +68,7 @@ # define LG_SIZEOF_PTR 2 #endif #ifdef __riscv -# define LG_VADDR 64 +# define LG_VADDR 48 # define LG_SIZEOF_PTR 3 #endif From owner-svn-src-head@freebsd.org Mon May 4 18:16: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 533232D6485 for ; Mon, 4 May 2020 18:16:24 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic302-22.consmr.mail.gq1.yahoo.com (sonic302-22.consmr.mail.gq1.yahoo.com [98.137.68.148]) (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 49G9zC3kdTz4XP3 for ; Mon, 4 May 2020 18:16:23 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: LIeyrEgVM1li9ooYhqzhtSDUrWGsBQaCd98bLHYPxzr1tWDaTQiFgQsVdy3sLYQ DuY7YJWnuvRsz8wt20s_q1gEXLVVWUJh4J7L8XXZfRdqA2QEDbPuojhsTo2VCZbDj3ZF.7eI0lfz o9c7ALvAJ6spb7M13DWi.WLosHHwcCt04GW6O8TjA2mlM_1bsBxCcfNWdqTo..lAnYHjPEDBx7HV _2Tx1qIzQ0cOI6GRFvSIsXRo5_nYDcyP4awQVt17mJBdAdz6Yk0vj82E5_JvCI0leB62JA3tm78h 1XD5wQwUZlerLBCGKHqLs7qcDxNr9pv3ZV8LLDFFT.tFMFBhVGs6Rs3O4IpXpFEr1cMiOnFHAhte Da.EZXxSbmsUFkHC0su6tanKGYhKy42h7GJ5OqkojE.nD7H78Vn0GLA93fU7dMt4_RlHcKBG0lxX vz3tNV4s0kGeIQEz53hRxg5yqWEeTuzc6mbNmjjN0.UVqbg3TjZzyLIuXvHvH2xBQgfdsz3VfrqZ vfA26Zu6oKgZ8Ez66yktajslvTCiZNlCGBnDitZ_ZitHlKk5_zk4KzX2BOe1dRzuyLyrkyw6FAeY LGllG7Pcf5JChIynJj6g6ghPqlCEY0JsByIIzUhzRP15Bh51CAgFN41VfGV2XAitDX5YVpBCdIZy Td8B.fb2u0R6Fmwh9b_5JFLJJMZs.gsTKEAx8HwjLQjNHpQodaUV4eEoFq6fqBdsNJaLg8KZ1acV 7yHmFiZiHKItADe.WNn3cFhzQn7gRXafkxT0J75Br5IEJWHBOEqjYCh1HHhqmGg4YAplI9nRFnzc WGIwg69XgJ86bPT6I_kpA4mTgUUa5lcHOGsVwEtKBGkoJXUXVTl9agBtFFtV6uHGuYJsGvCV8bWQ imQUDp3YhDa0AZ2OO3XCkOSGtGJFwOnEnqZnsowIrQRC7PTldWSC9Mh6cKxsLAQktEBdaqf84vX3 DpS6UUYwVDWQWgNJtDyFUiFx1KxQ.7_ZAoSEkO2zk7WahJ6aq_R5QA55BRyhAYOnTMezWiEQINqe X7BU8mdf2zwRz4wP0wew6kBTKybCFZP95mAQQXhlqMUbZkuA9PVCnTQe7z4h8RQ2Pn3KJNgopgR1 IUmbIHXyAgT4r.t3wNabY8D.Bdh7aT99AMohI_UcQplI8D0fDqyDIf8ZAdMKlAQ3sey.uUzqokMw wRQsSJ4FyGIPWpc.7WYefhujclI_4uqWnDhGhlowYfWeMVYP6PaePQZ0q_rOvAAvpvToWbVPcvO_ pL3eiTH.l.HOZk3MvqnPmtNOjJ7lSvxkLpNpI0mhpR3s4xKJ58eeMgODzqBAk2KLkOyWyKpozc6d Uu68LoHo4fJZEtTpZPLGb57.PJZ_nNAKDfvgLeFoXGEQCfGqQ9pEV066Ro2m.tdyKUvItA_N7.pH fbUbXHzl7f9mOfQYNyX1hQt7mvs8Xwcw- Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.gq1.yahoo.com with HTTP; Mon, 4 May 2020 18:16:22 +0000 Received: by smtp412.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID a91220a105656127b80ed8ef3721be0e; Mon, 04 May 2020 18:16:17 +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: <695E6836-F860-4557-B7DE-CC1EDB347F18@yahoo.com> Date: Mon, 4 May 2020 11:16:14 -0700 Cc: Brandon Bergren Content-Transfer-Encoding: quoted-printable Message-Id: References: <8479DD58-44F6-446A-9CA5-D01F0F7C1B38@yahoo.com> <17ACDA02-D7EF-4F26-874A-BB3E935CD072@yahoo.com> <695E6836-F860-4557-B7DE-CC1EDB347F18@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: 49G9zC3kdTz4XP3 X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.43 / 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)[]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; 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(-0.94)[-0.940,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.994,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (3.26), 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)[148.68.137.98.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[148.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.29 Precedence: list List-Id: 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, 04 May 2020 18:16:24 -0000 [This report just shows some material for the sendmail SIGSEGV's, based on truss output.] I've returned to using the modern jemalloc because it seems to show problems more, after having caught the earlier reported dhclient example under the older jemalloc context. (Again: jemalloc may be exposing a problem elsewhere.) I had truss monitor sendmail, including following child processes. A child process start and end normally looks like: 963: 3092.707439595 0.000033895 sigprocmask(SIG_SETMASK,{ SIGCHLD = },0x0) =3D 0 (0x0) 2432: 3092.708024959 0.000000000 963: 3092.708136462 0.000470115 fork() =3D 2432 (0x980) 2432: 3092.708441039 0.000033319 thr_self(0x50120000) =3D 0 (0x0) . . . 2432: 3092.717283761 0.000036008 sigaction(SIGQUIT,{ SIG_IGN SA_RESTART = ss_t },{ SIG_IGN SA_RESTART ss_t }) =3D 0 (0x0) 2432: 3092.717544288 0.000034352 sigprocmask(SIG_SETMASK,{ },0x0) =3D 0 = (0x0) 2432: 3092.717799894 0.000035768 close(0) =3D 0 (0x0) 2432: 3092.718174733 0.000103726 = openat(AT_FDCWD,"/dev/null",O_RDONLY,00) =3D 0 (0x0) 2432: 3092.718480437 0.000052091 = openat(AT_FDCWD,"/dev/null",O_WRONLY,00) =3D 4 (0x4) 2432: 3092.718778028 0.000037856 dup2(4,1) =3D 1 (0x1) 2432: 3092.719003051 0.000034255 dup2(4,2) =3D 2 (0x2) 2432: 3092.719225122 0.000033655 close(4) =3D 0 (0x0) 2432: 3092.719437735 0.000047626 fstat(0,{ mode=3Dcrw-rw-rw- = ,inode=3D22,size=3D0,blksize=3D4096 }) =3D 0 (0x0) 2432: 3092.719679274 0.000037400 fstat(1,{ mode=3Dcrw-rw-rw- = ,inode=3D22,size=3D0,blksize=3D4096 }) =3D 0 (0x0) 2432: 3092.719908859 0.000035816 fstat(2,{ mode=3Dcrw-rw-rw- = ,inode=3D22,size=3D0,blksize=3D4096 }) =3D 0 (0x0) 2432: 3092.720138299 0.000033727 clock_gettime(13,{ = 1588570204.000000000 }) =3D 0 (0x0) 2432: 3092.720658945 0.000035360 getpid() =3D 2432 (0x980) 2432: 3092.720931594 0.000048730 = __sysctl("kern.proc.args.2432",4,0x0,0x0,0x508ae000,49) =3D 0 (0x0) 2432: 3092.721572338 0.000062318 = open(".",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,00) =3D 4 (0x4) 2432: 3092.721962132 0.000037808 fcntl(4,F_ISUNIONSTACK,0x0) =3D 0 = (0x0) 2432: 3092.722323792 0.000098613 = getdirentries(4,"\0\0\0\0\0\t\M-I\M^Q\0\0\0\0\0\0"...,4096,{ 0x0 }) =3D = 144 (0x90) 2432: 3092.722944875 0.000036944 getdirentries(4,0x50859000,4096,{ = 0x200 }) =3D 0 (0x0) 2432: 3092.723294461 0.000045250 close(4) =3D 0 (0x0) 2432: 3092.723576400 0.000041144 clock_gettime(13,{ = 1588570204.000000000 }) =3D 0 (0x0) 2432: 3092.723828718 0.000037928 setitimer(0,{ 0.000000, 0.000000 = },0x0) =3D 0 (0x0) 2432: 3092.724092245 0.000035815 sigprocmask(SIG_UNBLOCK,{ SIGALRM },{ = }) =3D 0 (0x0) 2432: 3092.724591527 0.000038024 getpid() =3D 2432 (0x980) 2432: 3092.724952323 0.000052955 setuid(0x0) ERR#1 'Operation not = permitted' 2432: 3092.727852159 0.000042969 clock_gettime(4,{ 21633.960374942 }) =3D= 0 (0x0) 2432: 3092.728508193 0.000034327 clock_gettime(4,{ 21633.961033929 }) =3D= 0 (0x0) 2432: 3092.729146608 0.000036872 clock_gettime(4,{ 21633.961670903 }) =3D= 0 (0x0) 2432: 3092.729824967 0.000038360 clock_gettime(4,{ 21633.962349071 }) =3D= 0 (0x0) 2432: 3092.732435446 0.001634793 exit(0x0) =20 2432: 3092.732555855 0.001755202 process exit, rval =3D 0 963: 3092.732638865 0.018571063 SIGNAL 20 (SIGCHLD) code=3DCLD_EXITED = pid=3D2432 uid=3D25 status=3D0 963: 3092.732822864 0.018755062 sigsuspend({ }) ERR#4 'Interrupted = system call' 963: 3092.733076525 0.000039968 sigprocmask(SIG_SETMASK,{ SIGCHLD = },0x0) =3D 0 (0x0) 963: 3092.733447788 0.000076601 wait4(-1,{ EXITED,val=3D0 = },WNOHANG,0x0) =3D 2432 (0x980) 963: 3092.733781410 0.000034783 wait4(-1,0xffffbe60,WNOHANG,0x0) = ERR#10 'No child processes' 963: 3092.734065366 0.000037328 sigreturn(0xffffbe90) EJUSTRETURN 963: 3092.734263408 0.000033295 sigprocmask(SIG_BLOCK,0x0,{ }) =3D 0 = (0x0) (No activity in 963 for about 1800 seconds.) But once it starts failing, the SIGSEGV happens just after the: setuid(0x0) ERR#1 'Operation not permitted' For example: . . . 4745: 37293.335510778 0.000035023 clock_gettime(13,{ = 1588604405.000000000 }) =3D 0 (0x0) 4745: 37293.335754863 0.000037593 setitimer(0,{ 0.000000, 0.000000 = },0x0) =3D 0 (0x0) 4745: 37293.336010253 0.000036200 sigprocmask(SIG_UNBLOCK,{ SIGALRM },{ = }) =3D 0 (0x0) 4745: 37293.336488027 0.000033823 getpid() =3D 4745 (0x1289) 4745: 37293.336836797 0.000051995 setuid(0x0) ERR#1 'Operation not = permitted' 4745: 37293.338022675 0.001237873 SIGNAL 11 (SIGSEGV) code=3DSEGV_MAPERR = trapno=3D768 addr=3D0x506a11f0 4745: 37293.339546520 0.002761718 process killed, signal =3D 11 963: 37293.339627249 0.050797919 SIGNAL 20 (SIGCHLD) code=3DCLD_KILLED = pid=3D4745 uid=3D25 status=3D11 963: 37293.339794781 0.050965451 sigsuspend({ }) ERR#4 'Interrupted = system call' 963: 37293.340038313 0.000037544 sigprocmask(SIG_SETMASK,{ SIGCHLD = },0x0) =3D 0 (0x0) 963: 37293.340329951 0.000070215 wait4(-1,{ SIGNALED,sig=3DSIGSEGV = },WNOHANG,0x0) =3D 4745 (0x1289) 963: 37293.340634048 0.000034903 wait4(-1,0xffffbe60,WNOHANG,0x0) = ERR#10 'No child processes' 963: 37293.340901417 0.000037615 sigreturn(0xffffbe90) EJUSTRETURN 963: 37293.341090122 0.000033319 sigprocmask(SIG_BLOCK,0x0,{ }) =3D 0 = (0x0) (Another about 1800 seconds.) So it seems that sendmail's SIGSEGV always happens during the winding down of the child process: getting ready to exit. So far, it seems that once it starts happening, it happens for each child process created after that. =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 Mon May 4 18:21: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 220582D6AD6; Mon, 4 May 2020 18:21:11 +0000 (UTC) (envelope-from gnikl@justmail.de) Received: from mout3.freenet.de (mout3.freenet.de [IPv6:2001:748:100:40::2:5]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (Client CN "*.freenet.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49GB4j6bfXz4YGC; Mon, 4 May 2020 18:21:09 +0000 (UTC) (envelope-from gnikl@justmail.de) Received: from [195.4.92.164] (helo=mjail1.freenet.de) by mout3.freenet.de with esmtpa (ID gnikl@justmail.de) (port 25) (Exim 4.92 #3) id 1jVfiE-0003sF-QT; Mon, 04 May 2020 20:21:06 +0200 Received: from [::1] (port=60568 helo=mjail1.freenet.de) by mjail1.freenet.de with esmtpa (ID gnikl@justmail.de) (Exim 4.92 #3) id 1jVfiE-0006Po-Pr; Mon, 04 May 2020 20:21:06 +0200 Received: from sub3.freenet.de ([195.4.92.122]:53872) by mjail1.freenet.de with esmtpa (ID gnikl@justmail.de) (Exim 4.92 #3) id 1jVffk-0004JT-L5; Mon, 04 May 2020 20:18:32 +0200 Received: from p5b3b3174.dip0.t-ipconnect.de ([91.59.49.116]:49737 helo=localhost) by sub3.freenet.de with esmtpsa (ID gnikl@justmail.de) (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256) (port 465) (Exim 4.92 #3) id 1jVffk-0003Wj-H2; Mon, 04 May 2020 20:18:32 +0200 Date: Mon, 4 May 2020 20:18:29 +0200 From: Gunther Nikl To: David Bright Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360568 - head/sys/dev/nvme Message-ID: <20200504201540.00005dc5@justmail.de> In-Reply-To: <202005022047.042Klwcr068812@repo.freebsd.org> References: <202005022047.042Klwcr068812@repo.freebsd.org> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Originated-At: 91.59.49.116!49737 X-Rspamd-Queue-Id: 49GB4j6bfXz4YGC X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of gnikl@justmail.de has no SPF policy when checking 2001:748:100:40::2:5) smtp.mailfrom=gnikl@justmail.de X-Spamd-Result: default: False [-1.35 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-0.99)[-0.991,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[justmail.de]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-0.99)[-0.993,0]; IP_SCORE(-0.26)[ip: (-0.73), ipnet: 2001:748::/32(-0.27), asn: 5430(-0.29), country: DE(-0.02)]; RCVD_IN_DNSWL_NONE(0.00)[5.0.0.0.2.0.0.0.0.0.0.0.0.0.0.0.0.4.0.0.0.0.1.0.8.4.7.0.1.0.0.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:5430, ipnet:2001:748::/32, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[116.49.59.91.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 18:21:11 -0000 Hello, > Modified: head/sys/dev/nvme/nvme_test.c > ============================================================================== > --- head/sys/dev/nvme/nvme_test.c Sat May 2 20:14:592020 (r360567) > +++ head/sys/dev/nvme/nvme_test.c Sat May 2 20:47:582020 (r360568) > @@ -100,7 +100,7 @@ nvme_ns_bio_test(void *arg) > idx = atomic_fetchadd_int(&io_test->td_idx, 1); > dev = io_test->ns->cdev; > - offset = idx * 2048 * nvme_ns_get_sector_size(io_test->ns); > + offset = idx * 2048ULL * nvme_ns_get_sector_size(io_test->ns); > > while (1) { I have read the differential where a cast was used on the 2048. AFAICT, the "ULL" is only correct if uint64 is a "unsigned long long". On a LP64 system it is normally a simple "unsigned long" and then the correct suffix would be "UL". In that sense the cast was probably more correct. my 2c Gunther From owner-svn-src-head@freebsd.org Mon May 4 20:19: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 332852C1E02; Mon, 4 May 2020 20:19:58 +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 49GDjp0NGmz3GBL; Mon, 4 May 2020 20:19:58 +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 03C3C1D4F; Mon, 4 May 2020 20:19:58 +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 044KJvHB051860; Mon, 4 May 2020 20:19:57 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044KJvsw051859; Mon, 4 May 2020 20:19:57 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <202005042019.044KJvsw051859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Mon, 4 May 2020 20:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360638 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 360638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 20:19:58 -0000 Author: rrs Date: Mon May 4 20:19:57 2020 New Revision: 360638 URL: https://svnweb.freebsd.org/changeset/base/360638 Log: Adjust the fb to have a way to ask the underlying stack if it can support the PRUS option (OOB). And then have the new function call that to validate and give the correct error response if needed to the user (rack and bbr do not support obsoleted OOB data). Sponsoered by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D24574 Modified: head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Mon May 4 18:40:56 2020 (r360637) +++ head/sys/netinet/tcp_usrreq.c Mon May 4 20:19:57 2020 (r360638) @@ -133,6 +133,8 @@ static void tcp_disconnect(struct tcpcb *); static void tcp_usrclosed(struct tcpcb *); static void tcp_fill_info(struct tcpcb *, struct tcp_info *); +static int tcp_pru_options_support(struct tcpcb *tp, int flags); + #ifdef TCPDEBUG #define TCPDEBUG0 int ostate = 0 #define TCPDEBUG1() ostate = tp ? tp->t_state : 0 @@ -979,6 +981,15 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf goto out; } tp = intotcpcb(inp); + if (flags & PRUS_OOB) { + if ((error = tcp_pru_options_support(tp, PRUS_OOB)) != 0) { + if (control) + m_freem(control); + if (m && (flags & PRUS_NOTREADY) == 0) + m_freem(m); + goto out; + } + } TCPDEBUG1(); if (nam != NULL && tp->t_state < TCPS_SYN_SENT) { switch (nam->sa_family) { @@ -1362,6 +1373,24 @@ tcp_usr_close(struct socket *so) NET_EPOCH_EXIT(et); } +static int +tcp_pru_options_support(struct tcpcb *tp, int flags) +{ + /* + * If the specific TCP stack has a pru_options + * specified then it does not always support + * all the PRU_XX options and we must ask it. + * If the function is not specified then all + * of the PRU_XX options are supported. + */ + int ret = 0; + + if (tp->t_fb->tfb_pru_options) { + ret = (*tp->t_fb->tfb_pru_options)(tp, flags); + } + return (ret); +} + /* * Receive out-of-band data. */ @@ -1381,6 +1410,10 @@ tcp_usr_rcvoob(struct socket *so, struct mbuf *m, int goto out; } tp = intotcpcb(inp); + error = tcp_pru_options_support(tp, PRUS_OOB); + if (error) { + goto out; + } TCPDEBUG1(); if ((so->so_oobmark == 0 && (so->so_rcv.sb_state & SBS_RCVATMARK) == 0) || Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Mon May 4 18:40:56 2020 (r360637) +++ head/sys/netinet/tcp_var.h Mon May 4 20:19:57 2020 (r360638) @@ -345,6 +345,7 @@ struct tcp_function_block { void (*tfb_tcp_rexmit_tmr)(struct tcpcb *); int (*tfb_tcp_handoff_ok)(struct tcpcb *); void (*tfb_tcp_mtu_chg)(struct tcpcb *); + int (*tfb_pru_options)(struct tcpcb *, int); volatile uint32_t tfb_refcnt; uint32_t tfb_flags; uint8_t tfb_id; From owner-svn-src-head@freebsd.org Mon May 4 20:28: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 7FB322C20D1; Mon, 4 May 2020 20:28:54 +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 49GDw639wtz3Gkb; Mon, 4 May 2020 20:28:54 +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 67FDC1F4A; Mon, 4 May 2020 20:28:54 +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 044KSsbo057903; Mon, 4 May 2020 20:28:54 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044KSsat057898; Mon, 4 May 2020 20:28:54 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <202005042028.044KSsat057898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Mon, 4 May 2020 20:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360639 - 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: 360639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 20:28:54 -0000 Author: rrs Date: Mon May 4 20:28:53 2020 New Revision: 360639 URL: https://svnweb.freebsd.org/changeset/base/360639 Log: This commit brings things into sync with the advancements that have been made in rack and adds a few fixes in BBR. This also removes any possibility of incorrectly doing OOB data the stacks do not support it. Should fix the skyzaller crashes seen in the past. Still to fix is the BBR issue just reported this weekend with the SYN and on sending a RST. Note that this version of rack can now do pacing as well. Sponsored by:Netflix Inc Differential Revision:https://reviews.freebsd.org/D24576 Modified: head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_stacks/rack_bbr_common.c head/sys/netinet/tcp_stacks/rack_bbr_common.h head/sys/netinet/tcp_stacks/tcp_bbr.h head/sys/netinet/tcp_stacks/tcp_rack.h Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Mon May 4 20:19:57 2020 (r360638) +++ head/sys/netinet/tcp_stacks/bbr.c Mon May 4 20:28:53 2020 (r360639) @@ -1,7 +1,5 @@ /*- - * Copyright (c) 2016-9 - * Netflix Inc. - * All rights reserved. + * Copyright (c) 2016-2020 Netflix, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -72,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1853,28 +1852,6 @@ bbr_init_sysctls(void) &bbr_clear_lost, 0, sysctl_bbr_clear_lost, "IU", "Clear lost counters"); } -static inline int32_t -bbr_progress_timeout_check(struct tcp_bbr *bbr) -{ - if (bbr->rc_tp->t_maxunacktime && bbr->rc_tp->t_acktime && - TSTMP_GT(ticks, bbr->rc_tp->t_acktime)) { - if ((((uint32_t)ticks - bbr->rc_tp->t_acktime)) >= bbr->rc_tp->t_maxunacktime) { - /* - * There is an assumption here that the caller will - * drop the connection, so we increment the - * statistics. - */ - bbr_log_progress_event(bbr, bbr->rc_tp, ticks, PROGRESS_DROP, __LINE__); - BBR_STAT_INC(bbr_progress_drops); -#ifdef NETFLIX_STATS - KMOD_TCPSTAT_INC(tcps_progdrops); -#endif - return (1); - } - } - return (0); -} - static void bbr_counter_destroy(void) { @@ -1884,6 +1861,8 @@ bbr_counter_destroy(void) COUNTER_ARRAY_FREE(bbr_state_lost, BBR_MAX_STAT); COUNTER_ARRAY_FREE(bbr_state_time, BBR_MAX_STAT); COUNTER_ARRAY_FREE(bbr_state_resend, BBR_MAX_STAT); + counter_u64_free(bbr_nohdwr_pacing_enobuf); + counter_u64_free(bbr_hdwr_pacing_enobuf); counter_u64_free(bbr_flows_whdwr_pacing); counter_u64_free(bbr_flows_nohdwr_pacing); @@ -4643,7 +4622,8 @@ bbr_timeout_tlp(struct tcpcb *tp, struct tcp_bbr *bbr, /* Its not time yet */ return (0); } - if (bbr_progress_timeout_check(bbr)) { + if (ctf_progress_timeout_check(tp, true)) { + bbr_log_progress_event(bbr, tp, tick, PROGRESS_DROP, __LINE__); tcp_set_inp_to_drop(bbr->rc_inp, ETIMEDOUT); return (1); } @@ -4815,9 +4795,8 @@ bbr_timeout_delack(struct tcpcb *tp, struct tcp_bbr *b } /* - * Persists timer, here we simply need to setup the - * FORCE-DATA flag the output routine will send - * the one byte send. + * Here we send a KEEP-ALIVE like probe to the + * peer, we do not send data. * * We only return 1, saying don't proceed, if all timers * are stopped (destroyed PCB?). @@ -4845,7 +4824,8 @@ bbr_timeout_persist(struct tcpcb *tp, struct tcp_bbr * /* * Have we exceeded the user specified progress time? */ - if (bbr_progress_timeout_check(bbr)) { + if (ctf_progress_timeout_check(tp, true)) { + bbr_log_progress_event(bbr, tp, tick, PROGRESS_DROP, __LINE__); tcp_set_inp_to_drop(bbr->rc_inp, ETIMEDOUT); goto out; } @@ -4859,6 +4839,7 @@ bbr_timeout_persist(struct tcpcb *tp, struct tcp_bbr * (ticks - tp->t_rcvtime >= tcp_maxpersistidle || ticks - tp->t_rcvtime >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { KMOD_TCPSTAT_INC(tcps_persistdrop); + tcp_log_end_status(tp, TCP_EI_STATUS_PERSIST_MAX); tcp_set_inp_to_drop(bbr->rc_inp, ETIMEDOUT); goto out; } @@ -4875,6 +4856,7 @@ bbr_timeout_persist(struct tcpcb *tp, struct tcp_bbr * if (tp->t_state > TCPS_CLOSE_WAIT && (ticks - tp->t_rcvtime) >= TCPTV_PERSMAX) { KMOD_TCPSTAT_INC(tcps_persistdrop); + tcp_log_end_status(tp, TCP_EI_STATUS_PERSIST_MAX); tcp_set_inp_to_drop(bbr->rc_inp, ETIMEDOUT); goto out; } @@ -4947,6 +4929,7 @@ bbr_timeout_keepalive(struct tcpcb *tp, struct tcp_bbr return (1); dropit: KMOD_TCPSTAT_INC(tcps_keepdrops); + tcp_log_end_status(tp, TCP_EI_STATUS_KEEP_MAX); tcp_set_inp_to_drop(bbr->rc_inp, ETIMEDOUT); return (1); } @@ -5058,8 +5041,9 @@ bbr_timeout_rxt(struct tcpcb *tp, struct tcp_bbr *bbr, * retransmit interval. Back off to a longer retransmit interval * and retransmit one segment. */ - if (bbr_progress_timeout_check(bbr)) { + if (ctf_progress_timeout_check(tp, true)) { retval = 1; + bbr_log_progress_event(bbr, tp, tick, PROGRESS_DROP, __LINE__); tcp_set_inp_to_drop(bbr->rc_inp, ETIMEDOUT); goto out; } @@ -5078,6 +5062,7 @@ bbr_timeout_rxt(struct tcpcb *tp, struct tcp_bbr *bbr, tp->t_rxtshift = TCP_MAXRXTSHIFT; KMOD_TCPSTAT_INC(tcps_timeoutdrop); retval = 1; + tcp_log_end_status(tp, TCP_EI_STATUS_RETRAN); tcp_set_inp_to_drop(bbr->rc_inp, (tp->t_softerror ? (uint16_t) tp->t_softerror : ETIMEDOUT)); goto out; @@ -8050,6 +8035,9 @@ nothing_left: * to reset him. */ *ret_val = 1; + tcp_log_end_status(tp, TCP_EI_STATUS_DATA_A_CLOSE); + /* tcp_close will kill the inp pre-log the Reset */ + tcp_log_end_status(tp, TCP_EI_STATUS_SERVER_RST); tp = tcp_close(tp); ctf_do_dropwithreset(m, tp, th, BANDLIM_UNLIMITED, tlen); BBR_STAT_INC(bbr_dropped_af_data); @@ -8132,7 +8120,6 @@ bbr_exit_persist(struct tcpcb *tp, struct tcp_bbr *bbr idle_time = bbr_calc_time(cts, bbr->r_ctl.rc_went_idle_time); bbr->rc_in_persist = 0; bbr->rc_hit_state_1 = 0; - tp->t_flags &= ~TF_FORCEDATA; bbr->r_ctl.rc_del_time = cts; /* * We invalidate the last ack here since we @@ -8390,66 +8377,12 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, st return (0); } /* - * Process segments with URG. + * We don't support urgent data but + * drag along the up just to make sure + * if there is a stack switch no one + * is surprised. */ - if ((thflags & TH_URG) && th->th_urp && - TCPS_HAVERCVDFIN(tp->t_state) == 0) { - /* - * This is a kludge, but if we receive and accept random - * urgent pointers, we'll crash in soreceive. It's hard to - * imagine someone actually wanting to send this much urgent - * data. - */ - SOCKBUF_LOCK(&so->so_rcv); - if (th->th_urp + sbavail(&so->so_rcv) > sb_max) { - th->th_urp = 0; /* XXX */ - thflags &= ~TH_URG; /* XXX */ - SOCKBUF_UNLOCK(&so->so_rcv); /* XXX */ - goto dodata; /* XXX */ - } - /* - * If this segment advances the known urgent pointer, then - * mark the data stream. This should not happen in - * CLOSE_WAIT, CLOSING, LAST_ACK or TIME_WAIT STATES since a - * FIN has been received from the remote side. In these - * states we ignore the URG. - * - * According to RFC961 (Assigned Protocols), the urgent - * pointer points to the last octet of urgent data. We - * continue, however, to consider it to indicate the first - * octet of data past the urgent section as the original - * spec states (in one of two places). - */ - if (SEQ_GT(th->th_seq + th->th_urp, tp->rcv_up)) { - tp->rcv_up = th->th_seq + th->th_urp; - so->so_oobmark = sbavail(&so->so_rcv) + - (tp->rcv_up - tp->rcv_nxt) - 1; - if (so->so_oobmark == 0) - so->so_rcv.sb_state |= SBS_RCVATMARK; - sohasoutofband(so); - tp->t_oobflags &= ~(TCPOOB_HAVEDATA | TCPOOB_HADDATA); - } - SOCKBUF_UNLOCK(&so->so_rcv); - /* - * Remove out of band data so doesn't get presented to user. - * This can happen independent of advancing the URG pointer, - * but if two URG's are pending at once, some out-of-band - * data may creep in... ick. - */ - if (th->th_urp <= (uint32_t)tlen && - !(so->so_options & SO_OOBINLINE)) { - /* hdr drop is delayed */ - tcp_pulloutofband(so, th, m, drop_hdrlen); - } - } else { - /* - * If no out of band data is expected, pull receive urgent - * pointer along with the receive window. - */ - if (SEQ_GT(tp->rcv_nxt, tp->rcv_up)) - tp->rcv_up = tp->rcv_nxt; - } -dodata: /* XXX */ + tp->rcv_up = tp->rcv_nxt; INP_WLOCK_ASSERT(tp->t_inpcb); /* @@ -8792,7 +8725,7 @@ bbr_do_fastnewdata(struct mbuf *m, struct tcphdr *th, static int bbr_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, int32_t tlen, - uint32_t tiwin, int32_t nxt_pkt) + uint32_t tiwin, int32_t nxt_pkt, uint8_t iptos) { int32_t acked; uint16_t nsegs; @@ -8987,7 +8920,7 @@ bbr_fastack(struct mbuf *m, struct tcphdr *th, struct static int bbr_do_syn_sent(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, int32_t tlen, - uint32_t tiwin, int32_t thflags, int32_t nxt_pkt) + uint32_t tiwin, int32_t thflags, int32_t nxt_pkt, uint8_t iptos) { int32_t todrop; int32_t ourfinisacked = 0; @@ -9010,6 +8943,7 @@ bbr_do_syn_sent(struct mbuf *m, struct tcphdr *th, str if ((thflags & TH_ACK) && (SEQ_LEQ(th->th_ack, tp->iss) || SEQ_GT(th->th_ack, tp->snd_max))) { + tcp_log_end_status(tp, TCP_EI_STATUS_RST_IN_FRONT); ctf_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } @@ -9196,7 +9130,7 @@ bbr_do_syn_sent(struct mbuf *m, struct tcphdr *th, str static int bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, int32_t tlen, - uint32_t tiwin, int32_t thflags, int32_t nxt_pkt) + uint32_t tiwin, int32_t thflags, int32_t nxt_pkt, uint8_t iptos) { int32_t ourfinisacked = 0; int32_t ret_val; @@ -9207,6 +9141,7 @@ bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, str if ((thflags & TH_ACK) && (SEQ_LEQ(th->th_ack, tp->snd_una) || SEQ_GT(th->th_ack, tp->snd_max))) { + tcp_log_end_status(tp, TCP_EI_STATUS_RST_IN_FRONT); ctf_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } @@ -9218,6 +9153,7 @@ bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, str * data), a valid ACK, a FIN, or a RST. */ if ((thflags & (TH_SYN | TH_ACK)) == (TH_SYN | TH_ACK)) { + tcp_log_end_status(tp, TCP_EI_STATUS_RST_IN_FRONT); ctf_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } else if (thflags & TH_SYN) { @@ -9253,6 +9189,7 @@ bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, str * "LAND" DoS attack. */ if (SEQ_LT(th->th_seq, tp->irs)) { + tcp_log_end_status(tp, TCP_EI_STATUS_RST_IN_FRONT); ctf_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } @@ -9405,7 +9342,7 @@ bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, str static int bbr_do_established(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, int32_t tlen, - uint32_t tiwin, int32_t thflags, int32_t nxt_pkt) + uint32_t tiwin, int32_t thflags, int32_t nxt_pkt, uint8_t iptos) { struct tcp_bbr *bbr; int32_t ret_val; @@ -9439,7 +9376,7 @@ bbr_do_established(struct mbuf *m, struct tcphdr *th, __predict_true(th->th_seq == tp->rcv_nxt)) { if (tlen == 0) { if (bbr_fastack(m, th, so, tp, to, drop_hdrlen, tlen, - tiwin, nxt_pkt)) { + tiwin, nxt_pkt, iptos)) { return (0); } } else { @@ -9521,7 +9458,8 @@ bbr_do_established(struct mbuf *m, struct tcphdr *th, return (ret_val); } if (sbavail(&so->so_snd)) { - if (bbr_progress_timeout_check(bbr)) { + if (ctf_progress_timeout_check(tp, true)) { + bbr_log_progress_event(bbr, tp, tick, PROGRESS_DROP, __LINE__); ctf_do_dropwithreset_conn(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } @@ -9539,7 +9477,7 @@ bbr_do_established(struct mbuf *m, struct tcphdr *th, static int bbr_do_close_wait(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, int32_t tlen, - uint32_t tiwin, int32_t thflags, int32_t nxt_pkt) + uint32_t tiwin, int32_t thflags, int32_t nxt_pkt, uint8_t iptos) { struct tcp_bbr *bbr; int32_t ret_val; @@ -9616,7 +9554,8 @@ bbr_do_close_wait(struct mbuf *m, struct tcphdr *th, s return (ret_val); } if (sbavail(&so->so_snd)) { - if (bbr_progress_timeout_check(bbr)) { + if (ctf_progress_timeout_check(tp, true)) { + bbr_log_progress_event(bbr, tp, tick, PROGRESS_DROP, __LINE__); ctf_do_dropwithreset_conn(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } @@ -9632,6 +9571,9 @@ bbr_check_data_after_close(struct mbuf *m, struct tcp_ if (bbr->rc_allow_data_af_clo == 0) { close_now: + tcp_log_end_status(tp, TCP_EI_STATUS_DATA_A_CLOSE); + /* tcp_close will kill the inp pre-log the Reset */ + tcp_log_end_status(tp, TCP_EI_STATUS_SERVER_RST); tp = tcp_close(tp); KMOD_TCPSTAT_INC(tcps_rcvafterclose); ctf_do_dropwithreset(m, tp, th, BANDLIM_UNLIMITED, (*tlen)); @@ -9655,7 +9597,7 @@ close_now: static int bbr_do_fin_wait_1(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, int32_t tlen, - uint32_t tiwin, int32_t thflags, int32_t nxt_pkt) + uint32_t tiwin, int32_t thflags, int32_t nxt_pkt, uint8_t iptos) { int32_t ourfinisacked = 0; int32_t ret_val; @@ -9764,7 +9706,8 @@ bbr_do_fin_wait_1(struct mbuf *m, struct tcphdr *th, s tcp_state_change(tp, TCPS_FIN_WAIT_2); } if (sbavail(&so->so_snd)) { - if (bbr_progress_timeout_check(bbr)) { + if (ctf_progress_timeout_check(tp, true)) { + bbr_log_progress_event(bbr, tp, tick, PROGRESS_DROP, __LINE__); ctf_do_dropwithreset_conn(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } @@ -9781,7 +9724,7 @@ bbr_do_fin_wait_1(struct mbuf *m, struct tcphdr *th, s static int bbr_do_closing(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, int32_t tlen, - uint32_t tiwin, int32_t thflags, int32_t nxt_pkt) + uint32_t tiwin, int32_t thflags, int32_t nxt_pkt, uint8_t iptos) { int32_t ourfinisacked = 0; int32_t ret_val; @@ -9876,7 +9819,8 @@ bbr_do_closing(struct mbuf *m, struct tcphdr *th, stru return (1); } if (sbavail(&so->so_snd)) { - if (bbr_progress_timeout_check(bbr)) { + if (ctf_progress_timeout_check(tp, true)) { + bbr_log_progress_event(bbr, tp, tick, PROGRESS_DROP, __LINE__); ctf_do_dropwithreset_conn(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } @@ -9893,7 +9837,7 @@ bbr_do_closing(struct mbuf *m, struct tcphdr *th, stru static int bbr_do_lastack(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, int32_t tlen, - uint32_t tiwin, int32_t thflags, int32_t nxt_pkt) + uint32_t tiwin, int32_t thflags, int32_t nxt_pkt, uint8_t iptos) { int32_t ourfinisacked = 0; int32_t ret_val; @@ -9988,7 +9932,8 @@ bbr_do_lastack(struct mbuf *m, struct tcphdr *th, stru return (1); } if (sbavail(&so->so_snd)) { - if (bbr_progress_timeout_check(bbr)) { + if (ctf_progress_timeout_check(tp, true)) { + bbr_log_progress_event(bbr, tp, tick, PROGRESS_DROP, __LINE__); ctf_do_dropwithreset_conn(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } @@ -10006,7 +9951,7 @@ bbr_do_lastack(struct mbuf *m, struct tcphdr *th, stru static int bbr_do_fin_wait_2(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, int32_t tlen, - uint32_t tiwin, int32_t thflags, int32_t nxt_pkt) + uint32_t tiwin, int32_t thflags, int32_t nxt_pkt, uint8_t iptos) { int32_t ourfinisacked = 0; int32_t ret_val; @@ -10104,7 +10049,8 @@ bbr_do_fin_wait_2(struct mbuf *m, struct tcphdr *th, s return (ret_val); } if (sbavail(&so->so_snd)) { - if (bbr_progress_timeout_check(bbr)) { + if (ctf_progress_timeout_check(tp, true)) { + bbr_log_progress_event(bbr, tp, tick, PROGRESS_DROP, __LINE__); ctf_do_dropwithreset_conn(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } @@ -11702,6 +11648,8 @@ bbr_do_segment_nounlock(struct mbuf *m, struct tcphdr * always. All other times (timers etc) we must have a rack-state * set (so we assure we have done the checks above for SACK). */ + if (thflags & TH_FIN) + tcp_log_end_status(tp, TCP_EI_STATUS_CLIENT_FIN); if (bbr->r_state != tp->t_state) bbr_set_state(tp, bbr, tiwin); @@ -11740,6 +11688,7 @@ bbr_do_segment_nounlock(struct mbuf *m, struct tcphdr */ if ((tp->t_state == TCPS_SYN_SENT) && (thflags & TH_ACK) && (SEQ_LEQ(th->th_ack, tp->iss) || SEQ_GT(th->th_ack, tp->snd_max))) { + tcp_log_end_status(tp, TCP_EI_STATUS_RST_IN_FRONT); ctf_do_dropwithreset_conn(m, tp, th, BANDLIM_RST_OPENPORT, tlen); return (1); } @@ -11765,7 +11714,7 @@ bbr_do_segment_nounlock(struct mbuf *m, struct tcphdr } retval = (*bbr->r_substate) (m, th, so, tp, &to, drop_hdrlen, - tlen, tiwin, thflags, nxt_pkt); + tlen, tiwin, thflags, nxt_pkt, iptos); #ifdef BBR_INVARIANTS if ((retval == 0) && (tp->t_inpcb == NULL)) { @@ -11969,14 +11918,7 @@ bbr_do_send_accounting(struct tcpcb *tp, struct tcp_bb bbr_do_error_accounting(tp, bbr, rsm, len, error); return; } - if ((tp->t_flags & TF_FORCEDATA) && len == 1) { - /* Window probe */ - KMOD_TCPSTAT_INC(tcps_sndprobe); -#ifdef STATS - stats_voi_update_abs_u32(tp->t_stats, - VOI_TCP_RETXPB, len); -#endif - } else if (rsm) { + if (rsm) { if (rsm->r_flags & BBR_TLP) { /* * TLP should not count in retran count, but in its @@ -12241,7 +12183,6 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeva } /* Mark that we have called bbr_output(). */ if ((bbr->r_timer_override) || - (tp->t_flags & TF_FORCEDATA) || (tp->t_state < TCPS_ESTABLISHED)) { /* Timeouts or early states are exempt */ if (inp->inp_in_hpts) @@ -12578,47 +12519,6 @@ recheck_resend: } SOCKBUF_LOCK(sb); /* - * If in persist timeout with window of 0, send 1 byte. Otherwise, - * if window is small but nonzero and time TF_SENTFIN expired, we - * will send what we can and go to transmit state. - */ - if (tp->t_flags & TF_FORCEDATA) { - if ((sendwin == 0) || (sendwin <= (tp->snd_max - tp->snd_una))) { - /* - * If we still have some data to send, then clear - * the FIN bit. Usually this would happen below - * when it realizes that we aren't sending all the - * data. However, if we have exactly 1 byte of - * unsent data, then it won't clear the FIN bit - * below, and if we are in persist state, we wind up - * sending the packet without recording that we sent - * the FIN bit. - * - * We can't just blindly clear the FIN bit, because - * if we don't have any more data to send then the - * probe will be the FIN itself. - */ - if (sb_offset < sbused(sb)) - flags &= ~TH_FIN; - sendwin = 1; - } else { - if ((bbr->rc_in_persist != 0) && - (tp->snd_wnd >= min((bbr->r_ctl.rc_high_rwnd/2), - bbr_minseg(bbr)))) { - /* Exit persists if there is space */ - bbr_exit_persist(tp, bbr, cts, __LINE__); - } - if (rsm == NULL) { - /* - * If we are dropping persist mode then we - * need to correct sb_offset if not a - * retransmit. - */ - sb_offset = tp->snd_max - tp->snd_una; - } - } - } - /* * If snd_nxt == snd_max and we have transmitted a FIN, the * sb_offset will be > 0 even if so_snd.sb_cc is 0, resulting in a * negative length. This can also occur when TCP opens up its @@ -12674,7 +12574,7 @@ recheck_resend: */ len = 0; } - if ((tp->t_flags & TF_FORCEDATA) && (bbr->rc_in_persist)) { + if (bbr->rc_in_persist) { /* * We are in persists, figure out if * a retransmit is available (maybe the previous @@ -12970,9 +12870,6 @@ recheck_resend: if ((tp->snd_una == tp->snd_max) && len) { /* Nothing outstanding */ goto send; } - if (tp->t_flags & TF_FORCEDATA) { /* typ. timeout case */ - goto send; - } if (len >= tp->max_sndwnd / 2 && tp->max_sndwnd > 0) { goto send; } @@ -13013,7 +12910,7 @@ recheck_resend: goto send; } /* - * Send if we owe the peer an ACK, RST, SYN, or urgent data. ACKNOW + * Send if we owe the peer an ACK, RST, SYN. ACKNOW * is also a catch-all for the retransmit timer timeout case. */ if (tp->t_flags & TF_ACKNOW) { @@ -13022,9 +12919,6 @@ recheck_resend: if (((flags & TH_SYN) && (tp->t_flags & TF_NEEDSYN) == 0)) { goto send; } - if (SEQ_GT(tp->snd_up, tp->snd_una)) { - goto send; - } /* * If our state indicates that FIN should be sent and we have not * yet done so, then we need to send. @@ -13089,7 +12983,6 @@ just_return_nolock: } if (tot_len == 0) counter_u64_add(bbr_out_size[TCP_MSS_ACCT_JUSTRET], 1); - tp->t_flags &= ~TF_FORCEDATA; /* Dont update the time if we did not send */ bbr->r_ctl.rc_last_delay_val = 0; bbr->rc_output_starts_timer = 1; @@ -13586,8 +13479,6 @@ send: KMOD_TCPSTAT_INC(tcps_sndacks); else if (flags & (TH_SYN | TH_FIN | TH_RST)) KMOD_TCPSTAT_INC(tcps_sndctrl); - else if (SEQ_GT(tp->snd_up, tp->snd_una)) - KMOD_TCPSTAT_INC(tcps_sndurg); else KMOD_TCPSTAT_INC(tcps_sndwinup); @@ -13774,17 +13665,11 @@ send: tp->t_flags |= TF_RXWIN0SENT; } else tp->t_flags &= ~TF_RXWIN0SENT; - if (SEQ_GT(tp->snd_up, tp->snd_max)) { - th->th_urp = htons((u_short)(tp->snd_up - tp->snd_max)); - th->th_flags |= TH_URG; - } else - /* - * If no urgent pointer to send, then we pull the urgent - * pointer to the left edge of the send window so that it - * doesn't drift into the send window on sequence number - * wraparound. - */ - tp->snd_up = tp->snd_una; /* drag it along */ + /* + * We don't support urgent data, but drag along + * the pointer in case of a stack switch. + */ + tp->snd_up = tp->snd_una; #if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE) if (to.to_flags & TOF_SIGNATURE) { @@ -14125,8 +14010,7 @@ out: */ return (0); } - if (((tp->t_flags & TF_FORCEDATA) == 0) || - (bbr->rc_in_persist == 0)) { + if (bbr->rc_in_persist == 0) { /* * Advance snd_nxt over sequence space of this segment. */ @@ -14254,7 +14138,6 @@ nomore: tp->t_maxseg = old_maxseg - 40; bbr_log_msgsize_fail(bbr, tp, len, maxseg, mtu, 0, tso, cts); } - tp->t_flags &= ~TF_FORCEDATA; /* * Nuke all other things that can interfere * with slot @@ -14284,7 +14167,6 @@ nomore: } /* FALLTHROUGH */ default: - tp->t_flags &= ~TF_FORCEDATA; slot = (bbr_error_base_paceout + 3) << bbr->oerror_cnt; bbr->rc_output_starts_timer = 1; bbr_start_hpts_timer(bbr, tp, cts, 11, slot, 0); @@ -14399,7 +14281,6 @@ nomore: ((flags & TH_RST) == 0) && (IN_RECOVERY(tp->t_flags) == 0) && (bbr->rc_in_persist == 0) && - ((tp->t_flags & TF_FORCEDATA) == 0) && (tot_len < bbr->r_ctl.rc_pace_max_segs)) { /* * For non-tso we need to goto again until we have sent out @@ -14416,10 +14297,14 @@ nomore: } rsm = NULL; sack_rxmit = 0; - tp->t_flags &= ~(TF_ACKNOW | TF_DELACK | TF_FORCEDATA); + tp->t_flags &= ~(TF_ACKNOW | TF_DELACK); goto again; } skip_again: + if ((error == 0) && (flags & TH_FIN)) + tcp_log_end_status(tp, TCP_EI_STATUS_SERVER_FIN); + if ((error == 0) && (flags & TH_RST)) + tcp_log_end_status(tp, TCP_EI_STATUS_SERVER_RST); if (((flags & (TH_RST | TH_SYN | TH_FIN)) == 0) && tot_len) { /* * Calculate/Re-Calculate the hptsi slot in usecs based on @@ -14429,7 +14314,7 @@ skip_again: if (bbr->rc_no_pacing) slot = 0; } - tp->t_flags &= ~(TF_ACKNOW | TF_DELACK | TF_FORCEDATA); + tp->t_flags &= ~(TF_ACKNOW | TF_DELACK); enobufs: if (bbr->rc_use_google == 0) bbr_check_bbr_for_state(bbr, cts, __LINE__, 0); @@ -15095,6 +14980,13 @@ out: return (error); } +static int +bbr_pru_options(struct tcpcb *tp, int flags) +{ + if (flags & PRUS_OOB) + return (EOPNOTSUPP); + return (0); +} struct tcp_function_block __tcp_bbr = { .tfb_tcp_block_name = __XSTRING(STACKNAME), @@ -15111,7 +15003,8 @@ struct tcp_function_block __tcp_bbr = { .tfb_tcp_timer_stop = bbr_timer_stop, .tfb_tcp_rexmit_tmr = bbr_remxt_tmr, .tfb_tcp_handoff_ok = bbr_handoff_ok, - .tfb_tcp_mtu_chg = bbr_mtu_chg + .tfb_tcp_mtu_chg = bbr_mtu_chg, + .tfb_pru_options = bbr_pru_options, }; static const char *bbr_stack_names[] = { Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Mon May 4 20:19:57 2020 (r360638) +++ head/sys/netinet/tcp_stacks/rack.c Mon May 4 20:28:53 2020 (r360639) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016-9 Netflix, Inc. + * Copyright (c) 2016-2020 Netflix, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,13 +57,16 @@ __FBSDID("$FreeBSD$"); #include #include #include /* Must come after qmath.h and tree.h */ +#else +#include #endif #include -#include #include +#include #include #include #include +#include #include @@ -91,10 +94,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#ifdef NETFLIX_SHARED_CWND +#include +#endif #ifdef TCPDEBUG #include #endif /* TCPDEBUG */ @@ -169,6 +176,8 @@ struct sysctl_oid *rack_sysctl_root; * */ static int32_t rack_tlp_thresh = 1; +static int32_t rack_tlp_limit = 2; /* No more than 2 TLPs w-out new data */ +static int32_t rack_tlp_use_greater = 1; static int32_t rack_reorder_thresh = 2; static int32_t rack_reorder_fade = 60000; /* 0 - never fade, def 60,000 * - 60 seconds */ @@ -177,24 +186,34 @@ static uint32_t rack_highest_sack_thresh_seen = 0; static uint32_t rack_highest_move_thresh_seen = 0; static int32_t rack_pkt_delay = 1; -static int32_t rack_min_pace_time = 0; static int32_t rack_early_recovery = 1; static int32_t rack_send_a_lot_in_prr = 1; static int32_t rack_min_to = 1; /* Number of ms minimum timeout */ static int32_t rack_verbose_logging = 0; static int32_t rack_ignore_data_after_close = 1; -static int32_t use_rack_cheat = 1; +static int32_t rack_enable_shared_cwnd = 0; +static int32_t rack_limits_scwnd = 1; +static int32_t rack_enable_mqueue_for_nonpaced = 0; +static int32_t rack_disable_prr = 0; +static int32_t use_rack_rr = 1; +static int32_t rack_non_rxt_use_cr = 0; /* does a non-rxt in recovery use the configured rate (ss/ca)? */ static int32_t rack_persist_min = 250; /* 250ms */ -static int32_t rack_persist_max = 1000; /* 1 Second */ +static int32_t rack_persist_max = 2000; /* 2 Second */ static int32_t rack_sack_not_required = 0; /* set to one to allow non-sack to use rack */ -static int32_t rack_hw_tls_max_seg = 0; /* 0 means use hw-tls single segment */ - +static int32_t rack_hw_tls_max_seg = 3; /* 3 means use hw-tls single segment */ +static int32_t rack_default_init_window = 0; /* Use system default */ +static int32_t rack_limit_time_with_srtt = 0; +static int32_t rack_hw_pace_adjust = 0; /* * Currently regular tcp has a rto_min of 30ms * the backoff goes 12 times so that ends up * being a total of 122.850 seconds before a * connection is killed. */ +static uint32_t rack_def_data_window = 20; +static uint32_t rack_goal_bdp = 2; +static uint32_t rack_min_srtts = 1; +static uint32_t rack_min_measure_usec = 0; static int32_t rack_tlp_min = 10; static int32_t rack_rto_min = 30; /* 30ms same as main freebsd */ static int32_t rack_rto_max = 4000; /* 4 seconds */ @@ -204,16 +223,78 @@ static int32_t rack_rate_sample_method = USE_RTT_LOW; static int32_t rack_pace_every_seg = 0; static int32_t rack_delayed_ack_time = 200; /* 200ms */ static int32_t rack_slot_reduction = 4; +static int32_t rack_wma_divisor = 8; /* For WMA calculation */ +static int32_t rack_cwnd_block_ends_measure = 0; +static int32_t rack_rwnd_block_ends_measure = 0; + static int32_t rack_lower_cwnd_at_tlp = 0; static int32_t rack_use_proportional_reduce = 0; static int32_t rack_proportional_rate = 10; static int32_t rack_tlp_max_resend = 2; static int32_t rack_limited_retran = 0; static int32_t rack_always_send_oldest = 0; -static int32_t rack_use_sack_filter = 1; static int32_t rack_tlp_threshold_use = TLP_USE_TWO_ONE; -static int32_t rack_per_of_gp = 50; +static uint16_t rack_per_of_gp_ss = 250; /* 250 % slow-start */ +static uint16_t rack_per_of_gp_ca = 200; /* 200 % congestion-avoidance */ +static uint16_t rack_per_of_gp_rec = 200; /* 200 % of bw */ + +/* Probertt */ +static uint16_t rack_per_of_gp_probertt = 60; /* 60% of bw */ +static uint16_t rack_per_of_gp_lowthresh = 40; /* 40% is bottom */ +static uint16_t rack_per_of_gp_probertt_reduce = 10; /* 10% reduction */ +static uint16_t rack_atexit_prtt_hbp = 130; /* Clamp to 130% on exit prtt if highly buffered path */ +static uint16_t rack_atexit_prtt = 130; /* Clamp to 100% on exit prtt if non highly buffered path */ + +static uint32_t rack_max_drain_wait = 2; /* How man gp srtt's before we give up draining */ +static uint32_t rack_must_drain = 1; /* How many GP srtt's we *must* wait */ +static uint32_t rack_probertt_use_min_rtt_entry = 1; /* Use the min to calculate the goal else gp_srtt */ +static uint32_t rack_probertt_use_min_rtt_exit = 0; +static uint32_t rack_probe_rtt_sets_cwnd = 0; +static uint32_t rack_probe_rtt_safety_val = 2000000; /* No more than 2 sec in probe-rtt */ +static uint32_t rack_time_between_probertt = 9600000; /* 9.6 sec in us */ +static uint32_t rack_probertt_gpsrtt_cnt_mul = 0; /* How many srtt periods does probe-rtt last top fraction */ +static uint32_t rack_probertt_gpsrtt_cnt_div = 0; /* How many srtt periods does probe-rtt last bottom fraction */ +static uint32_t rack_min_probertt_hold = 200000; /* Equal to delayed ack time */ +static uint32_t rack_probertt_filter_life = 10000000; +static uint32_t rack_probertt_lower_within = 10; +static uint32_t rack_min_rtt_movement = 250; /* Must move at least 250 useconds to count as a lowering */ +static int32_t rack_pace_one_seg = 0; /* Shall we pace for less than 1.4Meg 1MSS at a time */ +static int32_t rack_probertt_clear_is = 1; +static int32_t rack_max_drain_hbp = 1; /* Extra drain times gpsrtt for highly buffered paths */ +static int32_t rack_hbp_thresh = 3; /* what is the divisor max_rtt/min_rtt to decided a hbp */ + + +/* Part of pacing */ +static int32_t rack_max_per_above = 30; /* When we go to increment stop if above 100+this% */ + +/* Timely information */ +/* Combine these two gives the range of 'no change' to bw */ +/* ie the up/down provide the upper and lower bound */ +static int32_t rack_gp_per_bw_mul_up = 2; /* 2% */ +static int32_t rack_gp_per_bw_mul_down = 4; /* 4% */ +static int32_t rack_gp_rtt_maxmul = 3; /* 3 x maxmin */ +static int32_t rack_gp_rtt_minmul = 1; /* minrtt + (minrtt/mindiv) is lower rtt */ +static int32_t rack_gp_rtt_mindiv = 4; /* minrtt + (minrtt * minmul/mindiv) is lower rtt */ +static int32_t rack_gp_decrease_per = 20; /* 20% decrease in multipler */ +static int32_t rack_gp_increase_per = 2; /* 2% increase in multipler */ +static int32_t rack_per_lower_bound = 50; /* Don't allow to drop below this multiplier */ +static int32_t rack_per_upper_bound_ss = 0; /* Don't allow SS to grow above this */ +static int32_t rack_per_upper_bound_ca = 0; /* Don't allow CA to grow above this */ +static int32_t rack_do_dyn_mul = 0; /* Are the rack gp multipliers dynamic */ +static int32_t rack_gp_no_rec_chg = 1; /* Prohibit recovery from reducing it's multiplier */ +static int32_t rack_timely_dec_clear = 6; /* Do we clear decrement count at a value (6)? */ +static int32_t rack_timely_max_push_rise = 3; /* One round of pushing */ +static int32_t rack_timely_max_push_drop = 3; /* Three round of pushing */ +static int32_t rack_timely_min_segs = 4; /* 4 segment minimum */ +static int32_t rack_use_max_for_nobackoff = 0; +static int32_t rack_timely_int_timely_only = 0; /* do interim timely's only use the timely algo (no b/w changes)? */ +static int32_t rack_timely_no_stopping = 0; +static int32_t rack_down_raise_thresh = 100; +static int32_t rack_req_segs = 1; + +/* Weird delayed ack mode */ +static int32_t rack_use_imac_dack = 0; /* Rack specific counters */ counter_u64_t rack_badfr; counter_u64_t rack_badfr_bytes; @@ -266,6 +347,7 @@ counter_u64_t rack_enter_tlp_calc; counter_u64_t rack_input_idle_reduces; counter_u64_t rack_collapsed_win; counter_u64_t rack_tlp_does_nada; +counter_u64_t rack_try_scwnd; /* Counters for HW TLS */ counter_u64_t rack_tls_rwnd; @@ -312,6 +394,8 @@ rack_ctloutput(struct socket *so, struct sockopt *sopt struct inpcb *inp, struct tcpcb *tp); static int32_t rack_ctor(void *mem, int32_t size, void *arg, int32_t how); static void +rack_set_pace_segments(struct tcpcb *tp, struct tcp_rack *rack, uint32_t line); +static void rack_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, int32_t drop_hdrlen, int32_t tlen, uint8_t iptos); @@ -319,6 +403,15 @@ static void rack_dtor(void *mem, int32_t size, void *a static void rack_earlier_retran(struct tcpcb *tp, struct rack_sendmap *rsm, uint32_t t, uint32_t cts); +static void +rack_log_alt_to_to_cancel(struct tcp_rack *rack, + uint32_t flex1, uint32_t flex2, + uint32_t flex3, uint32_t flex4, + uint32_t flex5, uint32_t flex6, + uint16_t flex7, uint8_t mod); +static void +rack_log_pacing_delay_calc(struct tcp_rack *rack, uint32_t len, uint32_t slot, + uint64_t bw_est, uint64_t bw, uint64_t len_time, int method, int line, struct rack_sendmap *rsm); static struct rack_sendmap * rack_find_high_nonack(struct tcp_rack *rack, struct rack_sendmap *rsm); @@ -328,6 +421,11 @@ static void rack_fini(struct tcpcb *tp, int32_t tcb_is static int rack_get_sockopt(struct socket *so, struct sockopt *sopt, struct inpcb *inp, struct tcpcb *tp, struct tcp_rack *rack); +static void +rack_do_goodput_measurement(struct tcpcb *tp, struct tcp_rack *rack, + tcp_seq th_ack, int line); +static uint32_t +rack_get_pacing_len(struct tcp_rack *rack, uint64_t bw, uint32_t mss); static int32_t rack_handoff_ok(struct tcpcb *tp); static int32_t rack_init(struct tcpcb *tp); static void rack_init_sysctls(void); @@ -337,11 +435,11 @@ rack_log_ack(struct tcpcb *tp, struct tcpopt *to, static void rack_log_output(struct tcpcb *tp, struct tcpopt *to, int32_t len, uint32_t seq_out, uint8_t th_flags, int32_t err, uint32_t ts, - uint8_t pass, struct rack_sendmap *hintrsm); + uint8_t pass, struct rack_sendmap *hintrsm, uint32_t us_cts); static void rack_log_sack_passed(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendmap *rsm); -static void rack_log_to_event(struct tcp_rack *rack, int32_t to_num, int num); +static void rack_log_to_event(struct tcp_rack *rack, int32_t to_num, struct rack_sendmap *rsm); static int32_t rack_output(struct tcpcb *tp); static uint32_t @@ -369,7 +467,7 @@ rack_update_rsm(struct tcpcb *tp, struct tcp_rack *rac struct rack_sendmap *rsm, uint32_t ts); static int rack_update_rtt(struct tcpcb *tp, struct tcp_rack *rack, - struct rack_sendmap *rsm, struct tcpopt *to, uint32_t cts, int32_t ack_type); + struct rack_sendmap *rsm, struct tcpopt *to, uint32_t cts, int32_t ack_type, tcp_seq th_ack); static int32_t tcp_addrack(module_t mod, int32_t type, void *data); static int rack_do_close_wait(struct mbuf *m, struct tcphdr *th, @@ -410,7 +508,8 @@ rack_do_syn_sent(struct mbuf *m, struct tcphdr *th, struct rack_sendmap * tcp_rack_output(struct tcpcb *tp, struct tcp_rack *rack, uint32_t tsused); -static void tcp_rack_xmit_timer(struct tcp_rack *rack, int32_t rtt); +static void tcp_rack_xmit_timer(struct tcp_rack *rack, int32_t rtt, + uint32_t len, uint32_t us_tim, int confidence, struct rack_sendmap *rsm, uint16_t rtrcnt); static void tcp_rack_partialack(struct tcpcb *tp, struct tcphdr *th); @@ -488,6 +587,7 @@ sysctl_rack_clear(SYSCTL_HANDLER_ARGS) counter_u64_zero(rack_enter_tlp_calc); counter_u64_zero(rack_progress_drops); counter_u64_zero(rack_tlp_does_nada); + counter_u64_zero(rack_try_scwnd); counter_u64_zero(rack_collapsed_win); } @@ -502,7 +602,26 @@ rack_init_sysctls(void) { struct sysctl_oid *rack_counters; struct sysctl_oid *rack_attack; + struct sysctl_oid *rack_pacing; + struct sysctl_oid *rack_timely; + struct sysctl_oid *rack_timers; + struct sysctl_oid *rack_tlp; + struct sysctl_oid *rack_misc; + struct sysctl_oid *rack_measure; + struct sysctl_oid *rack_probertt; + rack_attack = SYSCTL_ADD_NODE(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, + "sack_attack", + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Rack Sack Attack Counters and Controls"); + rack_counters = SYSCTL_ADD_NODE(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, + "stats", + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Rack Counters"); SYSCTL_ADD_S32(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_sysctl_root), OID_AUTO, "rate_sample_method", CTLFLAG_RW, @@ -511,166 +630,586 @@ rack_init_sysctls(void) SYSCTL_ADD_S32(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_sysctl_root), OID_AUTO, "hw_tlsmax", CTLFLAG_RW, - &rack_hw_tls_max_seg , 0, - "Do we have a multplier of TLS records we can send as a max (0=1 TLS record)? "); + &rack_hw_tls_max_seg , 3, + "What is the maximum number of full TLS records that will be sent at once"); + /* Probe rtt related controls */ + rack_probertt = SYSCTL_ADD_NODE(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, + "probertt", + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "ProbeRTT related Controls"); + SYSCTL_ADD_U16(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_probertt), + OID_AUTO, "exit_per_hpb", CTLFLAG_RW, + &rack_atexit_prtt_hbp, 130, + "What percentage above goodput do we clamp CA/SS to at exit on high-BDP path 110%"); + SYSCTL_ADD_U16(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_probertt), + OID_AUTO, "exit_per_nonhpb", CTLFLAG_RW, + &rack_atexit_prtt, 130, + "What percentage above goodput do we clamp CA/SS to at exit on a non high-BDP path 100%"); + SYSCTL_ADD_U16(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_probertt), + OID_AUTO, "gp_per_mul", CTLFLAG_RW, + &rack_per_of_gp_probertt, 60, + "What percentage of goodput do we pace at in probertt"); + SYSCTL_ADD_U16(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_probertt), + OID_AUTO, "gp_per_reduce", CTLFLAG_RW, + &rack_per_of_gp_probertt_reduce, 10, + "What percentage of goodput do we reduce every gp_srtt"); + SYSCTL_ADD_U16(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_probertt), + OID_AUTO, "gp_per_low", CTLFLAG_RW, + &rack_per_of_gp_lowthresh, 40, + "What percentage of goodput do we allow the multiplier to fall to"); + SYSCTL_ADD_U32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_probertt), *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon May 4 22:02: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 E3BAA2C4BEC; Mon, 4 May 2020 22:02:49 +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 49GH0T5kKZz3N9c; Mon, 4 May 2020 22:02:49 +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 BFE84329C; Mon, 4 May 2020 22:02:49 +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 044M2nA9021599; Mon, 4 May 2020 22:02:49 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044M2nQE021598; Mon, 4 May 2020 22:02:49 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005042202.044M2nQE021598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 4 May 2020 22:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360641 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 360641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 22:02:50 -0000 Author: tuexen Date: Mon May 4 22:02:49 2020 New Revision: 360641 URL: https://svnweb.freebsd.org/changeset/base/360641 Log: Enter the net epoch before calling the output routine in TCP BBR. This was only triggered when setting the IPPROTO_TCP level socket option TCP_DELACK. This issue was found by runnning an instance of SYZKALLER. Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D24690 Modified: head/sys/netinet/tcp_stacks/bbr.c Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Mon May 4 21:09:35 2020 (r360640) +++ head/sys/netinet/tcp_stacks/bbr.c Mon May 4 22:02:49 2020 (r360641) @@ -14418,6 +14418,7 @@ static int bbr_set_sockopt(struct socket *so, struct sockopt *sopt, struct inpcb *inp, struct tcpcb *tp, struct tcp_bbr *bbr) { + struct epoch_tracker et; int32_t error = 0, optval; switch (sopt->sopt_name) { @@ -14710,7 +14711,9 @@ bbr_set_sockopt(struct socket *so, struct sockopt *sop if (tp->t_flags & TF_DELACK) { tp->t_flags &= ~TF_DELACK; tp->t_flags |= TF_ACKNOW; + NET_EPOCH_ENTER(et); bbr_output(tp); + NET_EPOCH_EXIT(et); } } else error = EINVAL; From owner-svn-src-head@freebsd.org Mon May 4 22:31: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 826572C561A; Mon, 4 May 2020 22:31:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49GHdl2sJ5z3Pcs; Mon, 4 May 2020 22:31:39 +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 5D65C39CE; Mon, 4 May 2020 22:31:39 +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 044MVdmx036919; Mon, 4 May 2020 22:31:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044MVd5f036918; Mon, 4 May 2020 22:31:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005042231.044MVd5f036918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 4 May 2020 22:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360642 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 360642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 22:31:39 -0000 Author: jhb Date: Mon May 4 22:31:38 2020 New Revision: 360642 URL: https://svnweb.freebsd.org/changeset/base/360642 Log: Use a lookup table of algorithm types for alg_is_* helpers. This makes it easier to maintain these functions as algorithms are added or removed. Reviewed by: cem Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24668 Modified: head/sys/opencrypto/crypto.c Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon May 4 22:02:49 2020 (r360641) +++ head/sys/opencrypto/crypto.c Mon May 4 22:31:38 2020 (r360642) @@ -684,85 +684,96 @@ crypto_select_driver(const struct crypto_session_param return best; } +static enum alg_type { + ALG_NONE = 0, + ALG_CIPHER, + ALG_DIGEST, + ALG_KEYED_DIGEST, + ALG_COMPRESSION, + ALG_AEAD +} alg_types[] = { + [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, + [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_MD5] = ALG_DIGEST, + [CRYPTO_SHA1] = ALG_DIGEST, + [CRYPTO_NULL_HMAC] = ALG_DIGEST, + [CRYPTO_NULL_CBC] = ALG_CIPHER, + [CRYPTO_DEFLATE_COMP] = ALG_COMPRESSION, + [CRYPTO_SHA2_256_HMAC] = ALG_KEYED_DIGEST, + [CRYPTO_SHA2_384_HMAC] = ALG_KEYED_DIGEST, + [CRYPTO_SHA2_512_HMAC] = ALG_KEYED_DIGEST, + [CRYPTO_CAMELLIA_CBC] = ALG_CIPHER, + [CRYPTO_AES_XTS] = ALG_CIPHER, + [CRYPTO_AES_ICM] = ALG_CIPHER, + [CRYPTO_AES_NIST_GMAC] = ALG_KEYED_DIGEST, + [CRYPTO_AES_NIST_GCM_16] = ALG_AEAD, + [CRYPTO_BLAKE2B] = ALG_KEYED_DIGEST, + [CRYPTO_BLAKE2S] = ALG_KEYED_DIGEST, + [CRYPTO_CHACHA20] = ALG_CIPHER, + [CRYPTO_SHA2_224_HMAC] = ALG_KEYED_DIGEST, + [CRYPTO_RIPEMD160] = ALG_DIGEST, + [CRYPTO_SHA2_224] = ALG_DIGEST, + [CRYPTO_SHA2_256] = ALG_DIGEST, + [CRYPTO_SHA2_384] = ALG_DIGEST, + [CRYPTO_SHA2_512] = ALG_DIGEST, + [CRYPTO_POLY1305] = ALG_KEYED_DIGEST, + [CRYPTO_AES_CCM_CBC_MAC] = ALG_KEYED_DIGEST, + [CRYPTO_AES_CCM_16] = ALG_AEAD, +}; + +static enum alg_type +alg_type(int alg) +{ + + if (alg < nitems(alg_types)) + return (alg_types[alg]); + return (ALG_NONE); +} + static bool alg_is_compression(int alg) { - if (alg == CRYPTO_DEFLATE_COMP) - return (true); - return (false); + return (alg_type(alg) == ALG_COMPRESSION); } static bool alg_is_cipher(int alg) { - if (alg >= CRYPTO_DES_CBC && alg <= CRYPTO_SKIPJACK_CBC) - return (true); - if (alg >= CRYPTO_AES_CBC && alg <= CRYPTO_ARC4) - return (true); - if (alg == CRYPTO_NULL_CBC) - return (true); - if (alg >= CRYPTO_CAMELLIA_CBC && alg <= CRYPTO_AES_ICM) - return (true); - if (alg == CRYPTO_CHACHA20) - return (true); - return (false); + return (alg_type(alg) == ALG_CIPHER); } static bool alg_is_digest(int alg) { - if (alg >= CRYPTO_MD5_HMAC && alg <= CRYPTO_SHA1_KPDK) - return (true); - if (alg >= CRYPTO_MD5 && alg <= CRYPTO_SHA1) - return (true); - if (alg == CRYPTO_NULL_HMAC) - return (true); - if (alg >= CRYPTO_SHA2_256_HMAC && alg <= CRYPTO_SHA2_512_HMAC) - return (true); - if (alg == CRYPTO_AES_NIST_GMAC) - return (true); - if (alg >= CRYPTO_BLAKE2B && alg <= CRYPTO_BLAKE2S) - return (true); - if (alg >= CRYPTO_SHA2_224_HMAC && alg <= CRYPTO_POLY1305) - return (true); - if (alg == CRYPTO_AES_CCM_CBC_MAC) - return (true); - return (false); + return (alg_type(alg) == ALG_DIGEST || + alg_type(alg) == ALG_KEYED_DIGEST); } static bool alg_is_keyed_digest(int alg) { - if (alg >= CRYPTO_MD5_HMAC && alg <= CRYPTO_SHA1_KPDK) - return (true); - if (alg >= CRYPTO_SHA2_256_HMAC && alg <= CRYPTO_SHA2_512_HMAC) - return (true); - if (alg == CRYPTO_AES_NIST_GMAC) - return (true); - if (alg >= CRYPTO_BLAKE2B && alg <= CRYPTO_BLAKE2S) - return (true); - if (alg == CRYPTO_SHA2_224_HMAC) - return (true); - if (alg == CRYPTO_POLY1305) - return (true); - if (alg == CRYPTO_AES_CCM_CBC_MAC) - return (true); - return (false); + return (alg_type(alg) == ALG_KEYED_DIGEST); } static bool alg_is_aead(int alg) { - if (alg == CRYPTO_AES_NIST_GCM_16) - return (true); - if (alg == CRYPTO_AES_CCM_16) - return (true); - return (false); + return (alg_type(alg) == ALG_AEAD); } /* Various sanity checks on crypto session parameters. */ From owner-svn-src-head@freebsd.org Mon May 4 23:02: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 4E7942C6381; Mon, 4 May 2020 23:02:59 +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 49GJKv1NSFz3wpx; Mon, 4 May 2020 23:02:59 +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 2AB4F40FC; Mon, 4 May 2020 23:02:59 +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 044N2x1G058401; Mon, 4 May 2020 23:02:59 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044N2xUC058400; Mon, 4 May 2020 23:02:59 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <202005042302.044N2xUC058400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Mon, 4 May 2020 23:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360644 - 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: 360644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 23:02:59 -0000 Author: rrs Date: Mon May 4 23:02:58 2020 New Revision: 360644 URL: https://svnweb.freebsd.org/changeset/base/360644 Log: This fixes two issues found by ankitraheja09@gmail.com 1) When BBR retransmits the syn it was messing up the snd_max 2) When we need to send a RST we might not send it when we should Reported by: ankitraheja09@gmail.com Sponsored by: Netflix.com Differential Revision: https://reviews.freebsd.org/D24693 Modified: head/sys/netinet/tcp_stacks/bbr.c Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Mon May 4 22:59:39 2020 (r360643) +++ head/sys/netinet/tcp_stacks/bbr.c Mon May 4 23:02:58 2020 (r360644) @@ -12159,6 +12159,7 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeva recwin = min(max(sbspace(&so->so_rcv), 0), TCP_MAXWIN << tp->rcv_scale); if ((bbr_window_update_needed(tp, so, recwin, maxseg) == 0) && + ((tcp_outflags[tp->t_state] & TH_RST) == 0) && ((sbavail(sb) + ((tcp_outflags[tp->t_state] & TH_FIN) ? 1 : 0)) <= (tp->snd_max - tp->snd_una))) { /* @@ -12916,9 +12917,13 @@ recheck_resend: if (tp->t_flags & TF_ACKNOW) { goto send; } - if (((flags & TH_SYN) && (tp->t_flags & TF_NEEDSYN) == 0)) { + if (flags & TH_RST) { + /* Always send a RST if one is due */ goto send; } + if ((flags & TH_SYN) && (tp->t_flags & TF_NEEDSYN) == 0) { + goto send; + } /* * If our state indicates that FIN should be sent and we have not * yet done so, then we need to send. @@ -14029,7 +14034,11 @@ out: } if (flags & (TH_SYN | TH_FIN) && (rsm == NULL)) { if (flags & TH_SYN) { - tp->snd_max++; + /* + * Smack the snd_max to iss + 1 + * if its a FO we will add len below. + */ + tp->snd_max = tp->iss + 1; } if ((flags & TH_FIN) && ((tp->t_flags & TF_SENTFIN) == 0)) { tp->snd_max++; From owner-svn-src-head@freebsd.org Mon May 4 23:05: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 18F0A2C6546; Mon, 4 May 2020 23:05:12 +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 49GJNR70jlz3x7L; Mon, 4 May 2020 23:05:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB9E34128; Mon, 4 May 2020 23:05:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 044N5BXw058755; Mon, 4 May 2020 23:05:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044N5BA0058754; Mon, 4 May 2020 23:05:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005042305.044N5BA0058754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 4 May 2020 23:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360645 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 360645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 04 May 2020 23:05:12 -0000 Author: tuexen Date: Mon May 4 23:05:11 2020 New Revision: 360645 URL: https://svnweb.freebsd.org/changeset/base/360645 Log: Add net epoch support back, which was taken out by accident in https://svnweb.freebsd.org/changeset/base/360639 Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D24694 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Mon May 4 23:02:58 2020 (r360644) +++ head/sys/netinet/tcp_stacks/rack.c Mon May 4 23:05:11 2020 (r360645) @@ -12012,6 +12012,7 @@ rack_output(struct tcpcb *tp) hw_tls = (so->so_snd.sb_flags & SB_TLS_IFNET) != 0; #endif + NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(inp); #ifdef TCP_OFFLOAD if (tp->t_flags & TF_TOE) @@ -14212,6 +14213,7 @@ static int rack_set_sockopt(struct socket *so, struct sockopt *sopt, struct inpcb *inp, struct tcpcb *tp, struct tcp_rack *rack) { + struct epoch_tracker et; uint64_t val; int32_t error = 0, optval; uint16_t ca, ss; @@ -14719,7 +14721,9 @@ rack_set_sockopt(struct socket *so, struct sockopt *so if (tp->t_flags & TF_DELACK) { tp->t_flags &= ~TF_DELACK; tp->t_flags |= TF_ACKNOW; + NET_EPOCH_ENTER(et); rack_output(tp); + NET_EPOCH_EXIT(et); } break; From owner-svn-src-head@freebsd.org Tue May 5 00:02: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 952D62C7D5A; Tue, 5 May 2020 00:02:07 +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 49GKf73dhNz419b; Tue, 5 May 2020 00:02:07 +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 77D914C4C; Tue, 5 May 2020 00:02:07 +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 0450278X094555; Tue, 5 May 2020 00:02:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04502576094544; Tue, 5 May 2020 00:02:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005050002.04502576094544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 5 May 2020 00:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360648 - in head: lib/libvmmapi share/man/man5 share/mk sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel sys/amd64/vmm/io sys/conf sys/modules/vmm tools/build/opti... X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: lib/libvmmapi share/man/man5 share/mk sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel sys/amd64/vmm/io sys/conf sys/modules/vmm tools/build/options usr.sbin/bhyve usr.sb... X-SVN-Commit-Revision: 360648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 05 May 2020 00:02:07 -0000 Author: jhb Date: Tue May 5 00:02:04 2020 New Revision: 360648 URL: https://svnweb.freebsd.org/changeset/base/360648 Log: Initial support for bhyve save and restore. Save and restore (also known as suspend and resume) permits a snapshot to be taken of a guest's state that can later be resumed. In the current implementation, bhyve(8) creates a UNIX domain socket that is used by bhyvectl(8) to send a request to save a snapshot (and optionally exit after the snapshot has been taken). A snapshot currently consists of two files: the first holds a copy of guest RAM, and the second file holds other guest state such as vCPU register values and device model state. To resume a guest, bhyve(8) must be started with a matching pair of command line arguments to instantiate the same set of device models as well as a pointer to the saved snapshot. While the current implementation is useful for several uses cases, it has a few limitations. The file format for saving the guest state is tied to the ABI of internal bhyve structures and is not self-describing (in that it does not communicate the set of device models present in the system). In addition, the state saved for some device models closely matches the internal data structures which might prove a challenge for compatibility of snapshot files across a range of bhyve versions. The file format also does not currently support versioning of individual chunks of state. As a result, the current file format is not a fixed binary format and future revisions to save and restore will break binary compatiblity of snapshot files. The goal is to move to a more flexible format that adds versioning, etc. and at that point to commit to providing a reasonable level of compatibility. As a result, the current implementation is not enabled by default. It can be enabled via the WITH_BHYVE_SNAPSHOT=yes option for userland builds, and the kernel option BHYVE_SHAPSHOT. Submitted by: Mihai Tiganus, Flavius Anton, Darius Mihai Submitted by: Elena Mihailescu, Mihai Carabas, Sergiu Weisz Relnotes: yes Sponsored by: University Politehnica of Bucharest Sponsored by: Matthew Grooms (student scholarships) Sponsored by: iXsystems Differential Revision: https://reviews.freebsd.org/D19495 Added: head/sys/amd64/include/vmm_snapshot.h (contents, props changed) head/sys/amd64/vmm/vmm_snapshot.c (contents, props changed) head/tools/build/options/WITH_BHYVE_SNAPSHOT (contents, props changed) head/usr.sbin/bhyve/snapshot.c (contents, props changed) head/usr.sbin/bhyve/snapshot.h (contents, props changed) Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/share/man/man5/src.conf.5 head/share/mk/src.opts.mk head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/amd/svm.h head/sys/amd64/vmm/amd/svm_msr.c head/sys/amd64/vmm/amd/vmcb.c head/sys/amd64/vmm/amd/vmcb.h head/sys/amd64/vmm/intel/vmcs.c head/sys/amd64/vmm/intel/vmcs.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/io/vatpic.c head/sys/amd64/vmm/io/vatpic.h head/sys/amd64/vmm/io/vatpit.c head/sys/amd64/vmm/io/vatpit.h head/sys/amd64/vmm/io/vhpet.c head/sys/amd64/vmm/io/vhpet.h head/sys/amd64/vmm/io/vioapic.c head/sys/amd64/vmm/io/vioapic.h head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h head/sys/amd64/vmm/io/vpmtmr.c head/sys/amd64/vmm/io/vpmtmr.h head/sys/amd64/vmm/io/vrtc.c head/sys/amd64/vmm/io/vrtc.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/sys/conf/config.mk head/sys/conf/kern.opts.mk head/sys/conf/options.amd64 head/sys/modules/vmm/Makefile head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/Makefile.depend head/usr.sbin/bhyve/atkbdc.c head/usr.sbin/bhyve/atkbdc.h head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/bhyverun.h head/usr.sbin/bhyve/block_if.c head/usr.sbin/bhyve/block_if.h head/usr.sbin/bhyve/mevent.c head/usr.sbin/bhyve/pci_ahci.c head/usr.sbin/bhyve/pci_e82545.c head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h head/usr.sbin/bhyve/pci_fbuf.c head/usr.sbin/bhyve/pci_lpc.c head/usr.sbin/bhyve/pci_virtio_block.c head/usr.sbin/bhyve/pci_virtio_net.c head/usr.sbin/bhyve/pci_xhci.c head/usr.sbin/bhyve/ps2kbd.c head/usr.sbin/bhyve/ps2kbd.h head/usr.sbin/bhyve/ps2mouse.c head/usr.sbin/bhyve/ps2mouse.h head/usr.sbin/bhyve/uart_emul.c head/usr.sbin/bhyve/uart_emul.h head/usr.sbin/bhyve/usb_emul.h head/usr.sbin/bhyve/usb_mouse.c head/usr.sbin/bhyve/virtio.c head/usr.sbin/bhyve/virtio.h head/usr.sbin/bhyvectl/Makefile head/usr.sbin/bhyvectl/bhyvectl.8 head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Mon May 4 23:53:46 2020 (r360647) +++ head/lib/libvmmapi/vmmapi.c Tue May 5 00:02:04 2020 (r360648) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -53,8 +54,10 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include +#include #include "vmmapi.h" @@ -238,6 +241,17 @@ vm_mmap_memseg(struct vmctx *ctx, vm_paddr_t gpa, int } int +vm_get_guestmem_from_ctx(struct vmctx *ctx, char **guest_baseaddr, + size_t *lowmem_size, size_t *highmem_size) +{ + + *guest_baseaddr = ctx->baseaddr; + *lowmem_size = ctx->lowmem; + *highmem_size = ctx->highmem; + return (0); +} + +int vm_mmap_getnext(struct vmctx *ctx, vm_paddr_t *gpa, int *segid, vm_ooffset_t *segoff, size_t *len, int *prot, int *flags) { @@ -448,6 +462,34 @@ vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t return (NULL); } +vm_paddr_t +vm_rev_map_gpa(struct vmctx *ctx, void *addr) +{ + vm_paddr_t offaddr; + + offaddr = (char *)addr - ctx->baseaddr; + + if (ctx->lowmem > 0) + if (offaddr >= 0 && offaddr <= ctx->lowmem) + return (offaddr); + + if (ctx->highmem > 0) + if (offaddr >= 4*GB && offaddr < 4*GB + ctx->highmem) + return (offaddr); + + return ((vm_paddr_t)-1); +} + +/* TODO: maximum size for vmname */ +int +vm_get_name(struct vmctx *ctx, char *buf, size_t max_len) +{ + + if (strlcpy(buf, ctx->name, max_len) >= max_len) + return (EINVAL); + return (0); +} + size_t vm_get_lowmem_size(struct vmctx *ctx) { @@ -1499,6 +1541,29 @@ vm_restart_instruction(void *arg, int vcpu) struct vmctx *ctx = arg; return (ioctl(ctx->fd, VM_RESTART_INSTRUCTION, &vcpu)); +} + +int +vm_snapshot_req(struct vm_snapshot_meta *meta) +{ + + if (ioctl(meta->ctx->fd, VM_SNAPSHOT_REQ, meta) == -1) { +#ifdef SNAPSHOT_DEBUG + fprintf(stderr, "%s: snapshot failed for %s: %d\r\n", + __func__, meta->dev_name, errno); +#endif + return (-1); + } + return (0); +} + +int +vm_restore_time(struct vmctx *ctx) +{ + int dummy; + + dummy = 0; + return (ioctl(ctx->fd, VM_RESTORE_TIME, &dummy)); } int Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Mon May 4 23:53:46 2020 (r360647) +++ head/lib/libvmmapi/vmmapi.h Tue May 5 00:02:04 2020 (r360648) @@ -33,6 +33,7 @@ #include #include +#include /* * API version for out-of-tree consumers like grub-bhyve for making compile @@ -42,6 +43,7 @@ struct iovec; struct vmctx; +struct vm_snapshot_meta; enum x2apic_state; /* @@ -88,6 +90,10 @@ int vm_get_memseg(struct vmctx *ctx, int ident, size_t */ int vm_mmap_getnext(struct vmctx *ctx, vm_paddr_t *gpa, int *segid, vm_ooffset_t *segoff, size_t *len, int *prot, int *flags); + +int vm_get_guestmem_from_ctx(struct vmctx *ctx, char **guest_baseaddr, + size_t *lowmem_size, size_t *highmem_size); + /* * Create a device memory segment identified by 'segid'. * @@ -110,6 +116,8 @@ void vm_destroy(struct vmctx *ctx); int vm_parse_memsize(const char *optarg, size_t *memsize); int vm_setup_memory(struct vmctx *ctx, size_t len, enum vm_mmap_style s); void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len); +/* inverse operation to vm_map_gpa - extract guest address from host pointer */ +vm_paddr_t vm_rev_map_gpa(struct vmctx *ctx, void *addr); int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_t *pte, int *num); int vm_gla2gpa(struct vmctx *, int vcpuid, struct vm_guest_paging *paging, uint64_t gla, int prot, uint64_t *gpa, int *fault); @@ -120,6 +128,7 @@ uint32_t vm_get_lowmem_limit(struct vmctx *ctx); void vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit); void vm_set_memflags(struct vmctx *ctx, int flags); int vm_get_memflags(struct vmctx *ctx); +int vm_get_name(struct vmctx *ctx, char *buffer, size_t max_len); size_t vm_get_lowmem_size(struct vmctx *ctx); size_t vm_get_highmem_size(struct vmctx *ctx); int vm_set_desc(struct vmctx *ctx, int vcpu, int reg, @@ -237,4 +246,24 @@ int vm_setup_freebsd_registers_i386(struct vmctx *vmct uint32_t eip, uint32_t gdtbase, uint32_t esp); void vm_setup_freebsd_gdt(uint64_t *gdtr); + +/* + * Save and restore + */ + +#define MAX_SNAPSHOT_VMNAME 100 + +enum checkpoint_opcodes { + START_CHECKPOINT = 0, + START_SUSPEND = 1, +}; + +struct checkpoint_op { + unsigned int op; + char snapshot_filename[MAX_SNAPSHOT_VMNAME]; +}; + +int vm_snapshot_req(struct vm_snapshot_meta *meta); +int vm_restore_time(struct vmctx *ctx); + #endif /* _VMMAPI_H_ */ Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Mon May 4 23:53:46 2020 (r360647) +++ head/share/man/man5/src.conf.5 Tue May 5 00:02:04 2020 (r360648) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd April 30, 2020 +.Dd May 4, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -168,6 +168,13 @@ is set explicitly) Set to not build or install .Xr bhyve 8 , associated utilities, and examples. +.Pp +This option only affects amd64/amd64. +.It Va WITH_BHYVE_SNAPSHOT +Set to include support for save and restore (snapshots) in +.Xr bhyve 8 +and +.Xr bhyvectl 8 . .Pp This option only affects amd64/amd64. .It Va WITH_BIND_NOW Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Mon May 4 23:53:46 2020 (r360647) +++ head/share/mk/src.opts.mk Tue May 5 00:02:04 2020 (r360648) @@ -200,6 +200,7 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ BEARSSL \ + BHYVE_SNAPSHOT \ BSD_GREP \ CLANG_EXTRAS \ DTRACE_TESTS \ Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Mon May 4 23:53:46 2020 (r360647) +++ head/sys/amd64/include/vmm.h Tue May 5 00:02:04 2020 (r360648) @@ -34,6 +34,8 @@ #include #include +struct vm_snapshot_meta; + #ifdef _KERNEL SDT_PROVIDER_DECLARE(vmm); #endif @@ -152,6 +154,7 @@ struct vmspace; struct vm_object; struct vm_guest_paging; struct pmap; +enum snapshot_req; struct vm_eventinfo { void *rptr; /* rendezvous cookie */ @@ -180,6 +183,10 @@ typedef struct vmspace * (*vmi_vmspace_alloc)(vm_offse typedef void (*vmi_vmspace_free)(struct vmspace *vmspace); typedef struct vlapic * (*vmi_vlapic_init)(void *vmi, int vcpu); typedef void (*vmi_vlapic_cleanup)(void *vmi, struct vlapic *vlapic); +typedef int (*vmi_snapshot_t)(void *vmi, struct vm_snapshot_meta *meta); +typedef int (*vmi_snapshot_vmcx_t)(void *vmi, struct vm_snapshot_meta *meta, + int vcpu); +typedef int (*vmi_restore_tsc_t)(void *vmi, int vcpuid, uint64_t now); struct vmm_ops { vmm_init_func_t init; /* module wide initialization */ @@ -199,6 +206,11 @@ struct vmm_ops { vmi_vmspace_free vmspace_free; vmi_vlapic_init vlapic_init; vmi_vlapic_cleanup vlapic_cleanup; + + /* checkpoint operations */ + vmi_snapshot_t vmsnapshot; + vmi_snapshot_vmcx_t vmcx_snapshot; + vmi_restore_tsc_t vm_restore_tsc; }; extern struct vmm_ops vmm_ops_intel; @@ -272,7 +284,10 @@ void vm_exit_debug(struct vm *vm, int vcpuid, uint64_t void vm_exit_rendezvous(struct vm *vm, int vcpuid, uint64_t rip); void vm_exit_astpending(struct vm *vm, int vcpuid, uint64_t rip); void vm_exit_reqidle(struct vm *vm, int vcpuid, uint64_t rip); +int vm_snapshot_req(struct vm *vm, struct vm_snapshot_meta *meta); +int vm_restore_time(struct vm *vm); + #ifdef _SYS__CPUSET_H_ /* * Rendezvous all vcpus specified in 'dest' and execute 'func(arg)'. @@ -408,6 +423,15 @@ int vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_ int vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *info); int vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2); + +/* + * Function used to keep track of the guest's TSC offset. The + * offset is used by the virutalization extensions to provide a consistent + * value for the Time Stamp Counter to the guest. + * + * Return value is 0 on success and non-zero on failure. + */ +int vm_set_tsc_offset(struct vm *vm, int vcpu_id, uint64_t offset); enum vm_reg_name vm_segment_name(int seg_encoding); Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Mon May 4 23:53:46 2020 (r360647) +++ head/sys/amd64/include/vmm_dev.h Tue May 5 00:02:04 2020 (r360648) @@ -31,6 +31,8 @@ #ifndef _VMM_DEV_H_ #define _VMM_DEV_H_ +struct vm_snapshot_meta; + #ifdef _KERNEL void vmmdev_init(void); int vmmdev_cleanup(void); @@ -312,6 +314,11 @@ enum { IOCNUM_RTC_WRITE = 101, IOCNUM_RTC_SETTIME = 102, IOCNUM_RTC_GETTIME = 103, + + /* checkpoint */ + IOCNUM_SNAPSHOT_REQ = 113, + + IOCNUM_RESTORE_TIME = 115 }; #define VM_RUN \ @@ -422,4 +429,8 @@ enum { _IOR('v', IOCNUM_RTC_GETTIME, struct vm_rtc_time) #define VM_RESTART_INSTRUCTION \ _IOW('v', IOCNUM_RESTART_INSTRUCTION, int) +#define VM_SNAPSHOT_REQ \ + _IOWR('v', IOCNUM_SNAPSHOT_REQ, struct vm_snapshot_meta) +#define VM_RESTORE_TIME \ + _IOWR('v', IOCNUM_RESTORE_TIME, int) #endif Added: head/sys/amd64/include/vmm_snapshot.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/include/vmm_snapshot.h Tue May 5 00:02:04 2020 (r360648) @@ -0,0 +1,156 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016 Flavius Anton + * Copyright (c) 2016 Mihai Tiganus + * Copyright (c) 2016-2019 Mihai Carabas + * Copyright (c) 2017-2019 Darius Mihai + * Copyright (c) 2017-2019 Elena Mihailescu + * Copyright (c) 2018-2019 Sergiu Weisz + * All rights reserved. + * The bhyve-snapshot feature was developed under sponsorships + * from Matthew Grooms. + * + * 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 NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VMM_SNAPSHOT_ +#define _VMM_SNAPSHOT_ + +#include +#include +#ifndef _KERNEL +#include +#endif + +struct vmctx; + +enum snapshot_req { + STRUCT_VMX, + STRUCT_VIOAPIC, + STRUCT_VM, + STRUCT_VLAPIC, + VM_MEM, + STRUCT_VHPET, + STRUCT_VMCX, + STRUCT_VATPIC, + STRUCT_VATPIT, + STRUCT_VPMTMR, + STRUCT_VRTC, +}; + +struct vm_snapshot_buffer { + /* + * R/O for device-specific functions; + * written by generic snapshot functions. + */ + uint8_t *const buf_start; + const size_t buf_size; + + /* + * R/W for device-specific functions used to keep track of buffer + * current position and remaining size. + */ + uint8_t *buf; + size_t buf_rem; + + /* + * Length of the snapshot is either determined as (buf_size - buf_rem) + * or (buf - buf_start) -- the second variation returns a signed value + * so it may not be appropriate. + * + * Use vm_get_snapshot_size(meta). + */ +}; + +enum vm_snapshot_op { + VM_SNAPSHOT_SAVE, + VM_SNAPSHOT_RESTORE, +}; + +struct vm_snapshot_meta { + struct vmctx *ctx; + void *dev_data; + const char *dev_name; /* identify userspace devices */ + enum snapshot_req dev_req; /* identify kernel structs */ + + struct vm_snapshot_buffer buffer; + + enum vm_snapshot_op op; +}; + + +void vm_snapshot_buf_err(const char *bufname, const enum vm_snapshot_op op); +int vm_snapshot_buf(volatile void *data, size_t data_size, + struct vm_snapshot_meta *meta); +size_t vm_get_snapshot_size(struct vm_snapshot_meta *meta); +int vm_snapshot_guest2host_addr(void **addrp, size_t len, bool restore_null, + struct vm_snapshot_meta *meta); +int vm_snapshot_buf_cmp(volatile void *data, size_t data_size, + struct vm_snapshot_meta *meta); + +#define SNAPSHOT_BUF_OR_LEAVE(DATA, LEN, META, RES, LABEL) \ +do { \ + (RES) = vm_snapshot_buf((DATA), (LEN), (META)); \ + if ((RES) != 0) { \ + vm_snapshot_buf_err(#DATA, (META)->op); \ + goto LABEL; \ + } \ +} while (0) + +#define SNAPSHOT_VAR_OR_LEAVE(DATA, META, RES, LABEL) \ + SNAPSHOT_BUF_OR_LEAVE(&(DATA), sizeof(DATA), (META), (RES), LABEL) + +/* + * Address variables are pointers to guest memory. + * + * When RNULL != 0, do not enforce invalid address checks; instead, make the + * pointer NULL at restore time. + */ +#define SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(ADDR, LEN, RNULL, META, RES, LABEL) \ +do { \ + (RES) = vm_snapshot_guest2host_addr((void **)&(ADDR), (LEN), (RNULL), \ + (META)); \ + if ((RES) != 0) { \ + if ((RES) == EFAULT) \ + fprintf(stderr, "%s: invalid address: %s\r\n", \ + __func__, #ADDR); \ + goto LABEL; \ + } \ +} while (0) + +/* compare the value in the meta buffer with the data */ +#define SNAPSHOT_BUF_CMP_OR_LEAVE(DATA, LEN, META, RES, LABEL) \ +do { \ + (RES) = vm_snapshot_buf_cmp((DATA), (LEN), (META)); \ + if ((RES) != 0) { \ + vm_snapshot_buf_err(#DATA, (META)->op); \ + goto LABEL; \ + } \ +} while (0) + +#define SNAPSHOT_VAR_CMP_OR_LEAVE(DATA, META, RES, LABEL) \ + SNAPSHOT_BUF_CMP_OR_LEAVE(&(DATA), sizeof(DATA), (META), (RES), LABEL) + +#endif Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Mon May 4 23:53:46 2020 (r360647) +++ head/sys/amd64/vmm/amd/svm.c Tue May 5 00:02:04 2020 (r360648) @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_bhyve_snapshot.h" + #include #include #include @@ -50,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "vmm_lapic.h" #include "vmm_stat.h" @@ -276,6 +279,25 @@ svm_restore(void) svm_enable(NULL); } +#ifdef BHYVE_SNAPSHOT +int +svm_set_tsc_offset(struct svm_softc *sc, int vcpu, uint64_t offset) +{ + int error; + struct vmcb_ctrl *ctrl; + + ctrl = svm_get_vmcb_ctrl(sc, vcpu); + ctrl->tsc_offset = offset; + + svm_set_dirty(sc, vcpu, VMCB_CACHE_I); + VCPU_CTR1(sc->vm, vcpu, "tsc offset changed to %#lx", offset); + + error = vm_set_tsc_offset(sc->vm, vcpu, offset); + + return (error); +} +#endif + /* Pentium compatible MSRs */ #define MSR_PENTIUM_START 0 #define MSR_PENTIUM_END 0x1FFF @@ -2203,7 +2225,37 @@ svm_setreg(void *arg, int vcpu, int ident, uint64_t va return (EINVAL); } +#ifdef BHYVE_SNAPSHOT static int +svm_snapshot_reg(void *arg, int vcpu, int ident, + struct vm_snapshot_meta *meta) +{ + int ret; + uint64_t val; + + if (meta->op == VM_SNAPSHOT_SAVE) { + ret = svm_getreg(arg, vcpu, ident, &val); + if (ret != 0) + goto done; + + SNAPSHOT_VAR_OR_LEAVE(val, meta, ret, done); + } else if (meta->op == VM_SNAPSHOT_RESTORE) { + SNAPSHOT_VAR_OR_LEAVE(val, meta, ret, done); + + ret = svm_setreg(arg, vcpu, ident, val); + if (ret != 0) + goto done; + } else { + ret = EINVAL; + goto done; + } + +done: + return (ret); +} +#endif + +static int svm_setcap(void *arg, int vcpu, int type, int val) { struct svm_softc *sc; @@ -2285,6 +2337,306 @@ svm_vlapic_cleanup(void *arg, struct vlapic *vlapic) free(vlapic, M_SVM_VLAPIC); } +#ifdef BHYVE_SNAPSHOT +static int +svm_snapshot_vmi(void *arg, struct vm_snapshot_meta *meta) +{ + /* struct svm_softc is AMD's representation for SVM softc */ + struct svm_softc *sc; + struct svm_vcpu *vcpu; + struct vmcb *vmcb; + uint64_t val; + int i; + int ret; + + sc = arg; + + KASSERT(sc != NULL, ("%s: arg was NULL", __func__)); + + SNAPSHOT_VAR_OR_LEAVE(sc->nptp, meta, ret, done); + + for (i = 0; i < VM_MAXCPU; i++) { + vcpu = &sc->vcpu[i]; + vmcb = &vcpu->vmcb; + + /* VMCB fields for virtual cpu i */ + SNAPSHOT_VAR_OR_LEAVE(vmcb->ctrl.v_tpr, meta, ret, done); + val = vmcb->ctrl.v_tpr; + SNAPSHOT_VAR_OR_LEAVE(val, meta, ret, done); + vmcb->ctrl.v_tpr = val; + + SNAPSHOT_VAR_OR_LEAVE(vmcb->ctrl.asid, meta, ret, done); + val = vmcb->ctrl.np_enable; + SNAPSHOT_VAR_OR_LEAVE(val, meta, ret, done); + vmcb->ctrl.np_enable = val; + + val = vmcb->ctrl.intr_shadow; + SNAPSHOT_VAR_OR_LEAVE(val, meta, ret, done); + vmcb->ctrl.intr_shadow = val; + SNAPSHOT_VAR_OR_LEAVE(vmcb->ctrl.tlb_ctrl, meta, ret, done); + + SNAPSHOT_BUF_OR_LEAVE(vmcb->state.pad1, + sizeof(vmcb->state.pad1), + meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.cpl, meta, ret, done); + SNAPSHOT_BUF_OR_LEAVE(vmcb->state.pad2, + sizeof(vmcb->state.pad2), + meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.efer, meta, ret, done); + SNAPSHOT_BUF_OR_LEAVE(vmcb->state.pad3, + sizeof(vmcb->state.pad3), + meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.cr4, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.cr3, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.cr0, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.dr7, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.dr6, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.rflags, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.rip, meta, ret, done); + SNAPSHOT_BUF_OR_LEAVE(vmcb->state.pad4, + sizeof(vmcb->state.pad4), + meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.rsp, meta, ret, done); + SNAPSHOT_BUF_OR_LEAVE(vmcb->state.pad5, + sizeof(vmcb->state.pad5), + meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.rax, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.star, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.lstar, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.cstar, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.sfmask, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.kernelgsbase, + meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.sysenter_cs, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.sysenter_esp, + meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.sysenter_eip, + meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.cr2, meta, ret, done); + SNAPSHOT_BUF_OR_LEAVE(vmcb->state.pad6, + sizeof(vmcb->state.pad6), + meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.g_pat, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.dbgctl, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.br_from, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.br_to, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.int_from, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vmcb->state.int_to, meta, ret, done); + SNAPSHOT_BUF_OR_LEAVE(vmcb->state.pad7, + sizeof(vmcb->state.pad7), + meta, ret, done); + + /* Snapshot swctx for virtual cpu i */ + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_rbp, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_rbx, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_rcx, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_rdx, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_rdi, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_rsi, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_r8, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_r9, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_r10, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_r11, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_r12, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_r13, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_r14, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_r15, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_dr0, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_dr1, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_dr2, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.sctx_dr3, meta, ret, done); + + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.host_dr0, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.host_dr1, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.host_dr2, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.host_dr3, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.host_dr6, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.host_dr7, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->swctx.host_debugctl, meta, ret, + done); + + /* Restore other svm_vcpu struct fields */ + + /* Restore NEXTRIP field */ + SNAPSHOT_VAR_OR_LEAVE(vcpu->nextrip, meta, ret, done); + + /* Restore lastcpu field */ + SNAPSHOT_VAR_OR_LEAVE(vcpu->lastcpu, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->dirty, meta, ret, done); + + /* Restore EPTGEN field - EPT is Extended Page Tabel */ + SNAPSHOT_VAR_OR_LEAVE(vcpu->eptgen, meta, ret, done); + + SNAPSHOT_VAR_OR_LEAVE(vcpu->asid.gen, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(vcpu->asid.num, meta, ret, done); + + /* Set all caches dirty */ + if (meta->op == VM_SNAPSHOT_RESTORE) { + svm_set_dirty(sc, i, VMCB_CACHE_ASID); + svm_set_dirty(sc, i, VMCB_CACHE_IOPM); + svm_set_dirty(sc, i, VMCB_CACHE_I); + svm_set_dirty(sc, i, VMCB_CACHE_TPR); + svm_set_dirty(sc, i, VMCB_CACHE_CR2); + svm_set_dirty(sc, i, VMCB_CACHE_CR); + svm_set_dirty(sc, i, VMCB_CACHE_DT); + svm_set_dirty(sc, i, VMCB_CACHE_SEG); + svm_set_dirty(sc, i, VMCB_CACHE_NP); + } + } + + if (meta->op == VM_SNAPSHOT_RESTORE) + flush_by_asid(); + +done: + return (ret); +} + +static int +svm_snapshot_vmcx(void *arg, struct vm_snapshot_meta *meta, int vcpu) +{ + struct vmcb *vmcb; + struct svm_softc *sc; + int err, running, hostcpu; + + sc = (struct svm_softc *)arg; + err = 0; + + KASSERT(arg != NULL, ("%s: arg was NULL", __func__)); + vmcb = svm_get_vmcb(sc, vcpu); + + running = vcpu_is_running(sc->vm, vcpu, &hostcpu); + if (running && hostcpu !=curcpu) { + printf("%s: %s%d is running", __func__, vm_name(sc->vm), vcpu); + return (EINVAL); + } + + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_CR0, meta); + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_CR2, meta); + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_CR3, meta); + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_CR4, meta); + + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_DR7, meta); + + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_RAX, meta); + + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_RSP, meta); + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_RIP, meta); + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_RFLAGS, meta); + + /* Guest segments */ + /* ES */ + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_ES, meta); + err += vmcb_snapshot_desc(sc, vcpu, VM_REG_GUEST_ES, meta); + + /* CS */ + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_CS, meta); + err += vmcb_snapshot_desc(sc, vcpu, VM_REG_GUEST_CS, meta); + + /* SS */ + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_SS, meta); + err += vmcb_snapshot_desc(sc, vcpu, VM_REG_GUEST_SS, meta); + + /* DS */ + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_DS, meta); + err += vmcb_snapshot_desc(sc, vcpu, VM_REG_GUEST_DS, meta); + + /* FS */ + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_FS, meta); + err += vmcb_snapshot_desc(sc, vcpu, VM_REG_GUEST_FS, meta); + + /* GS */ + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_GS, meta); + err += vmcb_snapshot_desc(sc, vcpu, VM_REG_GUEST_GS, meta); + + /* TR */ + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_TR, meta); + err += vmcb_snapshot_desc(sc, vcpu, VM_REG_GUEST_TR, meta); + + /* LDTR */ + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_LDTR, meta); + err += vmcb_snapshot_desc(sc, vcpu, VM_REG_GUEST_LDTR, meta); + + /* EFER */ + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_EFER, meta); + + /* IDTR and GDTR */ + err += vmcb_snapshot_desc(sc, vcpu, VM_REG_GUEST_IDTR, meta); + err += vmcb_snapshot_desc(sc, vcpu, VM_REG_GUEST_GDTR, meta); + + /* Specific AMD registers */ + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_SYSENTER_CS, 8), meta); + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_SYSENTER_ESP, 8), meta); + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_SYSENTER_EIP, 8), meta); + + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_NPT_BASE, 8), meta); + + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_CR_INTERCEPT, 4), meta); + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_DR_INTERCEPT, 4), meta); + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_EXC_INTERCEPT, 4), meta); + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_INST1_INTERCEPT, 4), meta); + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_INST2_INTERCEPT, 4), meta); + + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_TLB_CTRL, 4), meta); + + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_EXITINFO1, 8), meta); + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_EXITINFO2, 8), meta); + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_EXITINTINFO, 8), meta); + + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_VIRQ, 8), meta); + + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_GUEST_PAT, 8), meta); + + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_AVIC_BAR, 8), meta); + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_AVIC_PAGE, 8), meta); + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_AVIC_LT, 8), meta); + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_AVIC_PT, 8), meta); + + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_IO_PERM, 8), meta); + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_MSR_PERM, 8), meta); + + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_ASID, 4), meta); + + err += vmcb_snapshot_any(sc, vcpu, + VMCB_ACCESS(VMCB_OFF_EXIT_REASON, 8), meta); + + err += svm_snapshot_reg(sc, vcpu, VM_REG_GUEST_INTR_SHADOW, meta); + + return (err); +} + +static int +svm_restore_tsc(void *arg, int vcpu, uint64_t offset) +{ + int err; + + err = svm_set_tsc_offset(arg, vcpu, offset); + + return (err); +} +#endif + struct vmm_ops vmm_ops_amd = { .init = svm_init, .cleanup = svm_cleanup, @@ -2302,4 +2654,9 @@ struct vmm_ops vmm_ops_amd = { .vmspace_free = svm_npt_free, .vlapic_init = svm_vlapic_init, .vlapic_cleanup = svm_vlapic_cleanup, +#ifdef BHYVE_SNAPSHOT + .vmsnapshot = svm_snapshot_vmi, + .vmcx_snapshot = svm_snapshot_vmcx, + .vm_restore_tsc = svm_restore_tsc, +#endif }; Modified: head/sys/amd64/vmm/amd/svm.h ============================================================================== --- head/sys/amd64/vmm/amd/svm.h Mon May 4 23:53:46 2020 (r360647) +++ head/sys/amd64/vmm/amd/svm.h Tue May 5 00:02:04 2020 (r360648) @@ -32,6 +32,7 @@ #define _SVM_H_ struct pcpu; +struct svm_softc; /* * Guest register state that is saved outside the VMCB. @@ -66,5 +67,8 @@ struct svm_regctx { }; void svm_launch(uint64_t pa, struct svm_regctx *gctx, struct pcpu *pcpu); +#ifdef BHYVE_SNAPSHOT +int svm_set_tsc_offset(struct svm_softc *sc, int vcpu, uint64_t offset); +#endif #endif /* _SVM_H_ */ Modified: head/sys/amd64/vmm/amd/svm_msr.c ============================================================================== --- head/sys/amd64/vmm/amd/svm_msr.c Mon May 4 23:53:46 2020 (r360647) +++ head/sys/amd64/vmm/amd/svm_msr.c Tue May 5 00:02:04 2020 (r360648) @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_bhyve_snapshot.h" + #include #include #include @@ -162,6 +164,11 @@ svm_wrmsr(struct svm_softc *sc, int vcpu, u_int num, u * Ignore writes to microcode update register. */ break; +#ifdef BHYVE_SNAPSHOT + case MSR_TSC: + error = svm_set_tsc_offset(sc, vcpu, val - rdtsc()); + break; +#endif case MSR_EXTFEATURES: break; default: Modified: head/sys/amd64/vmm/amd/vmcb.c ============================================================================== --- head/sys/amd64/vmm/amd/vmcb.c Mon May 4 23:53:46 2020 (r360647) +++ head/sys/amd64/vmm/amd/vmcb.c Tue May 5 00:02:04 2020 (r360648) @@ -29,12 +29,15 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_bhyve_snapshot.h" + #include #include #include #include #include +#include #include "vmm_ktr.h" @@ -452,3 +455,106 @@ vmcb_getdesc(void *arg, int vcpu, int reg, struct seg_ return (0); } + +#ifdef BHYVE_SNAPSHOT +int +vmcb_getany(struct svm_softc *sc, int vcpu, int ident, uint64_t *val) +{ + int error = 0; + + if (vcpu < 0 || vcpu >= VM_MAXCPU) { + error = EINVAL; + goto err; + } + + if (ident >= VM_REG_LAST) { + error = EINVAL; + goto err; + } + + error = vm_get_register(sc->vm, vcpu, ident, val); + +err: + return (error); +} + +int +vmcb_setany(struct svm_softc *sc, int vcpu, int ident, uint64_t val) +{ + int error = 0; + + if (vcpu < 0 || vcpu >= VM_MAXCPU) { + error = EINVAL; + goto err; + } + + if (ident >= VM_REG_LAST) { + error = EINVAL; + goto err; + } + + error = vm_set_register(sc->vm, vcpu, ident, val); + +err: + return (error); +} + +int +vmcb_snapshot_desc(void *arg, int vcpu, int reg, struct vm_snapshot_meta *meta) +{ + int ret; + struct seg_desc desc; + + if (meta->op == VM_SNAPSHOT_SAVE) { + ret = vmcb_getdesc(arg, vcpu, reg, &desc); + if (ret != 0) + goto done; + + SNAPSHOT_VAR_OR_LEAVE(desc.base, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(desc.limit, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(desc.access, meta, ret, done); + } else if (meta->op == VM_SNAPSHOT_RESTORE) { + SNAPSHOT_VAR_OR_LEAVE(desc.base, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(desc.limit, meta, ret, done); + SNAPSHOT_VAR_OR_LEAVE(desc.access, meta, ret, done); + + ret = vmcb_setdesc(arg, vcpu, reg, &desc); + if (ret != 0) + goto done; + } else { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue May 5 00:58: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 6630D2C8B07; Tue, 5 May 2020 00:58:04 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49GLth24NSz43C8; Tue, 5 May 2020 00:58:04 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2841255BA; Tue, 5 May 2020 00:58:04 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0450w4es026288; Tue, 5 May 2020 00:58:04 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0450w3J1026287; Tue, 5 May 2020 00:58:03 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202005050058.0450w3J1026287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 5 May 2020 00:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360650 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 360650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 05 May 2020 00:58:04 -0000 Author: rmacklem Date: Tue May 5 00:58:03 2020 New Revision: 360650 URL: https://svnweb.freebsd.org/changeset/base/360650 Log: Revert r360514, to avoid unnecessary churn of the sources. r360514 prepared the NFS code for changes to handle ext_pgs mbufs on the receive side. However, at this time, KERN_TLS does not pass ext_pgs mbufs up through soreceive(). As such, as this time, only the send/build side of the NFS mbuf code needs to handle ext_pgs mbufs. Revert r360514 since the rather extensive changes required for receive side ext_pgs mbufs are not yet needed. This avoids unnecessary churn of the sources. Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfs_var.h Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Tue May 5 00:08:41 2020 (r360649) +++ head/sys/fs/nfs/nfs_commonsubs.c Tue May 5 00:58:03 2020 (r360650) @@ -229,8 +229,6 @@ static void nfsrv_removeuser(struct nfsusrgrp *usrp, i static int nfsrv_getrefstr(struct nfsrv_descript *, u_char **, u_char **, int *, int *); static void nfsrv_refstrbigenough(int, u_char **, u_char **, int *); -static int nfsm_copyfrommbuf(struct nfsrv_descript *, char *, enum uio_seg, - int); static struct { int op; @@ -703,49 +701,52 @@ nfsm_dissct(struct nfsrv_descript *nd, int siz, int ho caddr_t retp; retp = NULL; - left = mtod(nd->nd_md, char *) + nd->nd_md->m_len - - nd->nd_dpos; + left = mtod(nd->nd_md, caddr_t) + nd->nd_md->m_len - nd->nd_dpos; while (left == 0) { - if (!nfsm_shiftnext(nd, &left)) - return (NULL); + nd->nd_md = nd->nd_md->m_next; + if (nd->nd_md == NULL) + return (retp); + left = nd->nd_md->m_len; + nd->nd_dpos = mtod(nd->nd_md, caddr_t); } if (left >= siz) { retp = nd->nd_dpos; nd->nd_dpos += siz; + } else if (nd->nd_md->m_next == NULL) { + return (retp); } else if (siz > ncl_mbuf_mhlen) { panic("nfs S too big"); } else { - /* Allocate a new mbuf for the "siz" bytes of data. */ MGET(mp2, MT_DATA, how); if (mp2 == NULL) return (NULL); - - /* - * Link the new mp2 mbuf into the list then copy left - * bytes from the mbuf before it and siz - left bytes - * from the mbuf(s) after it. - */ mp2->m_next = nd->nd_md->m_next; nd->nd_md->m_next = mp2; nd->nd_md->m_len -= left; - retp = p = mtod(mp2, char *); - memcpy(p, nd->nd_dpos, left); /* Copy what was left */ + nd->nd_md = mp2; + retp = p = mtod(mp2, caddr_t); + NFSBCOPY(nd->nd_dpos, p, left); /* Copy what was left */ siz2 = siz - left; p += left; - mp2->m_len = siz; - nd->nd_md = mp2->m_next; + mp2 = mp2->m_next; /* Loop around copying up the siz2 bytes */ while (siz2 > 0) { - if (nd->nd_md == NULL) + if (mp2 == NULL) return (NULL); - nfsm_set(nd, 0, false); - xfer = nfsm_copyfrommbuf(nd, p, - UIO_SYSSPACE, siz2); - p += xfer; - siz2 -= xfer; + xfer = (siz2 > mp2->m_len) ? mp2->m_len : siz2; + if (xfer > 0) { + NFSBCOPY(mtod(mp2, caddr_t), p, xfer); + mp2->m_data += xfer; + mp2->m_len -= xfer; + p += xfer; + siz2 -= xfer; + } if (siz2 > 0) - nd->nd_md = nd->nd_md->m_next; + mp2 = mp2->m_next; } + nd->nd_md->m_len = siz; + nd->nd_md = mp2; + nd->nd_dpos = mtod(mp2, caddr_t); } return (retp); } @@ -4824,76 +4825,5 @@ nfsv4_findmirror(struct nfsmount *nmp) } } return (ds); -} - -/* - * Fill in the fields of "struct nfsrv_descript" for a new ext_pgs mbuf. - * The build argument is true for build and false for dissect. - */ -int -nfsm_set(struct nfsrv_descript *nd, u_int offs, bool build) -{ - struct mbuf *m; - int rlen; - - if (build) - m = nd->nd_mb; - else - m = nd->nd_md; - if (build) { - nd->nd_bpos = mtod(m, char *) + offs; - rlen = m->m_len - offs; - } else { - nd->nd_dpos = mtod(m, char *); - rlen = m->m_len; - } - return (rlen); -} - -/* - * Copy up to "len" bytes from the mbuf into "cp" and adjust the - * mbuf accordingly. - * If cp == NULL, do not do the actual copy, but adjust the mbuf. - * Return the number of bytes actually copied. - * Adjust m_data and m_len so that a future calculation of what - * is left using mtod() will work correctly. - */ -static int -nfsm_copyfrommbuf(struct nfsrv_descript *nd, char *cp, enum uio_seg segflg, - int len) -{ - struct mbuf *m; - int xfer; - - m = nd->nd_md; - xfer = mtod(m, char *) + m->m_len - nd->nd_dpos; - xfer = min(xfer, len); - if (xfer > 0) { - if (cp != NULL) { - if (segflg == UIO_SYSSPACE) - memcpy(cp, nd->nd_dpos, xfer); - else - copyout(nd->nd_dpos, cp, xfer); - } - nd->nd_dpos += xfer; - m->m_data += xfer; - m->m_len -= xfer; - } - return (xfer); -} - -/* - * Shift to the next mbuf in the list list and update the nd fields. - * Return true if successful, false otherwise. - */ -bool -nfsm_shiftnext(struct nfsrv_descript *nd, int *leftp) -{ - - nd->nd_md = nd->nd_md->m_next; - if (nd->nd_md == NULL) - return (false); - *leftp = nfsm_set(nd, 0, false); - return (true); } Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Tue May 5 00:08:41 2020 (r360649) +++ head/sys/fs/nfs/nfs_var.h Tue May 5 00:58:03 2020 (r360650) @@ -361,8 +361,6 @@ int nfsv4_sequencelookup(struct nfsmount *, struct nfs void nfsv4_freeslot(struct nfsclsession *, int); struct ucred *nfsrv_getgrpscred(struct ucred *); struct nfsdevice *nfsv4_findmirror(struct nfsmount *); -int nfsm_set(struct nfsrv_descript *, u_int, bool); -bool nfsm_shiftnext(struct nfsrv_descript *, int *); /* nfs_clcomsubs.c */ void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); From owner-svn-src-head@freebsd.org Tue May 5 08:52: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 7B7102DCE89 for ; Tue, 5 May 2020 08:52:35 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-21.consmr.mail.gq1.yahoo.com (sonic313-21.consmr.mail.gq1.yahoo.com [98.137.65.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 49GYQB3lKhz4YRD for ; Tue, 5 May 2020 08:52:34 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 45cOfUYVM1nnpRZ33.aMxVMjSiZ4AG_vYL0FwrHrpO7VaAFhdklIEfC9zGIRjyz GXZjb2NYXPub2F3iVpivu3EyANzT9in3EHE0EHurFD3bDJtif3FKJKKlbmwqDLN6v.YL9SMYk2oM CCCqlLImoAINRo79X1TyeVQ3WJsG313XI_QbmSC_WsPNLnlffP.hc1JFPJzdAkhDf9nQ9zqW3UTV zX_dNJyHukdSh54bOiv5oBk7pJUWUy7l9QXs4a1TO1hlah_gcaBcm3F7fSLoNfG6pV9L9d7k3H0J Pc30MGC5yTV5mvmf9lAQVXE1EZFxNXO_fZZEfOhdjDvCbNJouD1PiIra_5Lsr.eKk7O.5biMCueA jPB3KKLa3yrkQmbgQLvC8Z8.gKgLcMpk3B0UUjWQyzRpWSmm7inACIBlZ2d0tfz4u.4JFVY7R01m AyXrbIq0zmw6Yl7koe3FUTYclzbQsaEjnuPXfNyAqqohr3mGsgkgt1Va72ahPtUBe5UicT32yS8Q uabeMpmz2o73du._KFb0cTyPV9bifh_ZMizkiT13MPusvAidZyPC6kO3SnMiUjhXm.ok7m9Q2h3E oEMUd0cGUflqJao1fBguO1tGoh2PNGjurwlU_7tStIqwtdE0v398.NFSDe4jfBM5m3ajfQeTuujO WaXSI.Qx_oA_VhoTWn6CkeQnb4sB8JyzMloIUqLjT8NSdN8l6C6VEw5hBfECUC8188SBZVX27hXF IXwHfEg_AOeJ_Qo0hJm6ZgRuSNVDd3_cwdq.LeTQoHYJpue9uaAS6PCisVjRSBmDZpdKPaTEghUk Z1AN4EfdyyMBiomrcYxLdRWtJWUDXYWp1kdRUYlyX5g6bUZbch70F_ifnIvLkFnK2I4YkLZP384N FGFKCIzlt75XwafGGiQjYqoirgiPBo4ITrYUplwc_WYn3Zwvzmnhk0wXrO8pJJ4N2I4wI.w1TRBd m70VAweMW.t48tj_xYJgUaEfEFIc7urswFyJ5XvZK6fOD9EuhydE0_hk_Z_jKLA8XRZSE4x.QuH9 k1HgRKCapVZHMC5iNdYMfBYN3QShQ4pDA1kezt0TkJK46tdxCTeE037ZjGBTw_HZqMtIqI.4kEfv JatltgZybgNc4mpkd4hA3BA1LdEqZyYh_MiUUy_Cbymj_HvV228fx5Vfa0JCc_fYXmd0saRizQ5Z Rm4aP.ubUk6hpnEltHOqQnIAkcB4wxxR4v66kWo3sBW93k79n.FYD0oWQL6eJDi7oo2uHzsdAFn. Z_o.tSJPhZRhnq.TbpT2p5pjDCATsjKCzDJE0C0.ew2Dcd4YywaelGVJdsvEWCS3oGISsTdm4rH3 2Lv4ZRYlU1MgsRk3sw5nvy7.nc5lXy0PKI4AS6B8tKHaQQ4FUxWq1iYvyA1mF3B764Mw96Qox.5u H2JqwKyJqY_DUvZqQXoBRYYpAk2UWfNLdSibGbgvuOwR1Gw8lz1wwgRsHD20CF_8- Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.gq1.yahoo.com with HTTP; Tue, 5 May 2020 08:52:33 +0000 Received: by smtp434.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID da1665613de72442d31e291f1d443e23; Tue, 05 May 2020 08:52:29 +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, 5 May 2020 01:52:27 -0700 Cc: Brandon Bergren Content-Transfer-Encoding: quoted-printable Message-Id: <121B9B09-141B-4DC3-918B-1E7CFB99E779@yahoo.com> References: <8479DD58-44F6-446A-9CA5-D01F0F7C1B38@yahoo.com> <17ACDA02-D7EF-4F26-874A-BB3E935CD072@yahoo.com> <695E6836-F860-4557-B7DE-CC1EDB347F18@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: 49GYQB3lKhz4YRD X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.49 / 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)[]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; 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(-0.99)[-0.989,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (1.00), 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)[84.65.137.98.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[84.65.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.30 Precedence: list List-Id: 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, 05 May 2020 08:52:35 -0000 [This report just shows an interesting rpcbind crash: a pointer was filled with part of a string instead, leading to a failed memory access attempt from the junk address produced.] Core was generated by `/usr/sbin/rpcbind'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x5024405c in rendezvous_request (xprt=3D, = msg=3D) at /usr/src/lib/libc/rpc/svc_vc.c:335 335 cd->recvsize =3D r->recvsize; (gdb) list 330 _setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, = &len, sizeof (len)); 331 } 332=09 333 cd =3D (struct cf_conn *)newxprt->xp_p1; 334=09 335 cd->recvsize =3D r->recvsize; 336 cd->sendsize =3D r->sendsize; 337 cd->maxrec =3D r->maxrec; 338=09 339 if (cd->maxrec !=3D 0) { (gdb) print/c *cd Cannot access memory at address 0x2d202020 FYI: . . . 0x50244050 <+452>: bl 0x502e3404 = <00000000.plt_pic32._setsockopt> 0x50244054 <+456>: lwz r27,80(r29) 0x50244058 <+460>: lwz r3,4(r24) =3D> 0x5024405c <+464>: stw r3,436(r27) Note the 80(r29) use. (gdb) info reg r0 0x50244020 1344552992 r1 0xffffb400 4294947840 r2 0x500a1018 1342836760 r3 0x2328 9000 r4 0x32ef559c 854545820 r5 0x0 0 r6 0xffffb360 4294947680 r7 0xffffb364 4294947684 r8 0x5004733c 1342468924 r9 0x0 0 r10 0x20 32 r11 0x50252ea0 1344614048 r12 0x24200ca0 606080160 r13 0x0 0 r14 0x0 0 r15 0xffffbc28 4294949928 r16 0x10002848 268445768 r17 0x10040000 268697600 r18 0x2 2 r19 0x0 0 r20 0x1 1 r21 0x5004c044 1342488644 r22 0xffffb63c 4294948412 r23 0x80 128 r24 0x50048010 1342472208 r25 0x14 20 r26 0xffffb630 4294948400 r27 0x2d202020 757080096 r28 0xf 15 r29 0x50047308 1342468872 r30 0x5030112c 1345327404 r31 0x10040000 268697600 pc 0x5024405c 0x5024405c msr cr 0x842000a0 2216689824 lr 0x50244020 0x50244020 ctr 0x50252ea0 1344614048 xer 0x0 0 fpscr 0x0 0 vscr vrsave (gdb) x/s 0x50047308+72 0x50047350: " - - -\n" So it tried to use "- " as a pointer value. It appears that the r29 value was from: 0x50243f90 <+260>: mr r28,r3 0x50243f94 <+264>: lwz r4,0(r24) 0x50243f98 <+268>: lwz r5,4(r24) 0x50243f9c <+272>: mr r3,r28 0x50243fa0 <+276>: bl 0x5024308c 0x50243fa4 <+280>: lwz r27,36(r1) 0x50243fa8 <+284>: mr r29,r3 The makefd_xprt being used as part of: /* * make a new transporter (re-uses xprt) */ newxprt =3D makefd_xprt(sock, r->sendsize, r->recvsize); newxprt->xp_rtaddr.buf =3D mem_alloc(len); if (newxprt->xp_rtaddr.buf =3D=3D NULL) return (FALSE); memcpy(newxprt->xp_rtaddr.buf, &addr, len); newxprt->xp_rtaddr.len =3D len; #ifdef PORTMAP if (addr.ss_family =3D=3D AF_INET || addr.ss_family =3D=3D = AF_LOCAL) { newxprt->xp_raddr =3D *(struct sockaddr_in = *)newxprt->xp_rtaddr.buf; newxprt->xp_addrlen =3D sizeof (struct sockaddr_in); } #endif /* PORTMAP */ if (__rpc_fd2sockinfo(sock, &si) && si.si_proto =3D=3D = IPPROTO_TCP) { len =3D 1; /* XXX fvdl - is this useful? */ _setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &len, sizeof = (len)); } =20 cd =3D (struct cf_conn *)newxprt->xp_p1; =20 cd->recvsize =3D r->recvsize; cd->sendsize =3D r->sendsize; cd->maxrec =3D r->maxrec; FYI: (gdb) print *r $5 =3D {sendsize =3D 9000, recvsize =3D 9000, maxrec =3D 9000} There is more evidence of strings in pointers in *newxprt (xp_tp, oa_base, xp_p1, xp_p2, xp_p3): (gdb) print *newxprt $7 =3D {xp_fd =3D 15, xp_port =3D 0, xp_ops =3D 0x50329e1c, xp_addrlen =3D= 16, xp_raddr =3D {sin_len =3D 16 '\020', sin_family =3D 1 '\001', = sin_port =3D 0, sin_addr =3D {s_addr =3D 0},=20 sin_zero =3D "\000\000\000\000\000\000\000"}, xp_ops2 =3D = 0x756e6978, xp_tp =3D 0x2020 ,=20 xp_netid =3D 0x10010000 , xp_ltaddr =3D {maxlen =3D 0, len =3D 0, buf =3D 0x0}, = xp_rtaddr =3D {maxlen =3D 539828256, len =3D 16, buf =3D 0x50047330}, = xp_verf =3D { oa_flavor =3D 0, oa_base =3D 0x202d2020 , oa_length =3D 538976288}, xp_p1 =3D 0x2d202020, = xp_p2 =3D 0x20202020, xp_p3 =3D 0x2d0a0079, xp_type =3D 543780384} (gdb) print (char*)(&newxprt->xp_verf.oa_base) $24 =3D 0x50047350 " - - -\n" (gdb) print (char*)(&newxprt->xp_p3)+3 $13 =3D 0x50047363 "y in FreeBSD.\n" (gdb) print (char*)(&newxprt->xp_type) $25 =3D 0x50047364 " in FreeBSD.\n" =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 Tue May 5 09:42: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 A4E462DF12B; Tue, 5 May 2020 09:42:26 +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 49GZWk40w7z4dtD; Tue, 5 May 2020 09:42:26 +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 84C95BEB9; Tue, 5 May 2020 09:42:26 +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 0459gQSa057521; Tue, 5 May 2020 09:42:26 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0459gQj3057520; Tue, 5 May 2020 09:42:26 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202005050942.0459gQj3057520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2020 09:42:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360654 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 360654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 05 May 2020 09:42:26 -0000 Author: andrew Date: Tue May 5 09:42:26 2020 New Revision: 360654 URL: https://svnweb.freebsd.org/changeset/base/360654 Log: As with r352446 align blocks in boot1.efi We need to ensure the buffers are aligned before passing them to ReadBlocks. Assume 512 bytes is enough for now. Reviewed by: imp MFC after: 1 month Sponsored by: Innovate UK Modified: head/stand/efi/boot1/ufs_module.c Modified: head/stand/efi/boot1/ufs_module.c ============================================================================== --- head/stand/efi/boot1/ufs_module.c Tue May 5 04:42:47 2020 (r360653) +++ head/stand/efi/boot1/ufs_module.c Tue May 5 09:42:26 2020 (r360654) @@ -73,12 +73,12 @@ dskread(void *buf, uint64_t lba, int nblk) #include "ufsread.c" -static struct dmadat __dmadat; +static struct dmadat __dmadat __aligned(512); +static char ufs_buffer[BSD_LABEL_BUFFER] __aligned(512); static int init_dev(dev_info_t* dev) { - char buffer[BSD_LABEL_BUFFER]; struct disklabel *dl; uint64_t bs; int ok; @@ -109,14 +109,14 @@ init_dev(dev_info_t* dev) * will retry fsread(0) only if there's a label found with a non-zero * offset. */ - if (dskread(buffer, 0, BSD_LABEL_BUFFER / DEV_BSIZE) != 0) + if (dskread(ufs_buffer, 0, BSD_LABEL_BUFFER / DEV_BSIZE) != 0) return (-1); dl = NULL; bs = devinfo->dev->Media->BlockSize; if (bs != 0 && bs <= BSD_LABEL_BUFFER / 2) - dl = (struct disklabel *)&buffer[bs]; + dl = (struct disklabel *)&ufs_buffer[bs]; if (dl == NULL || dl->d_magic != BSD_MAGIC || dl->d_magic2 != BSD_MAGIC) - dl = (struct disklabel *)&buffer[BSD_LABEL_OFFSET]; + dl = (struct disklabel *)&ufs_buffer[BSD_LABEL_OFFSET]; if (dl->d_magic != BSD_MAGIC || dl->d_magic2 != BSD_MAGIC || dl->d_partitions[0].p_offset == 0) return (-1); From owner-svn-src-head@freebsd.org Tue May 5 10:01: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 5D2982DFB7C; Tue, 5 May 2020 10:01:11 +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 49GZxM1bqjz4gBT; Tue, 5 May 2020 10:01:11 +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 32465C205; Tue, 5 May 2020 10:01:11 +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 045A1BKt065413; Tue, 5 May 2020 10:01:11 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 045A1BEQ065412; Tue, 5 May 2020 10:01:11 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202005051001.045A1BEQ065412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2020 10:01:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360655 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 360655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 05 May 2020 10:01:11 -0000 Author: andrew Date: Tue May 5 10:01:10 2020 New Revision: 360655 URL: https://svnweb.freebsd.org/changeset/base/360655 Log: Fix the EFI_DEBUG case, prio_str is only used when EFI_DEBUG is unset. Sponsored by: Innovate UK Modified: head/stand/efi/boot1/proto.c Modified: head/stand/efi/boot1/proto.c ============================================================================== --- head/stand/efi/boot1/proto.c Tue May 5 09:42:26 2020 (r360654) +++ head/stand/efi/boot1/proto.c Tue May 5 10:01:10 2020 (r360655) @@ -38,12 +38,14 @@ __FBSDID("$FreeBSD$"); static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; +#ifndef EFI_DEBUG static const char *prio_str[] = { "error", "not supported", "good", "better" }; +#endif /* * probe_handle determines if the passed handle represents a logical partition From owner-svn-src-head@freebsd.org Tue May 5 12:14: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 65F742E45CB; Tue, 5 May 2020 12:14:12 +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 49Gdtr1nC0z3P8V; Tue, 5 May 2020 12:14:12 +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 38521DC28; Tue, 5 May 2020 12:14:12 +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 045CEC7L053619; Tue, 5 May 2020 12:14:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 045CEC7n053618; Tue, 5 May 2020 12:14:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005051214.045CEC7n053618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 5 May 2020 12:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360657 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 360657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 05 May 2020 12:14:12 -0000 Author: avg Date: Tue May 5 12:14:11 2020 New Revision: 360657 URL: https://svnweb.freebsd.org/changeset/base/360657 Log: acpi_video: try our best to work on systems without non-essential methods Only _BCL and _BCM methods seem to be essential to the driver's operation. If _BQC is missing then we can assume that the current brightness is whatever we set by the last _BCM invocation. If _DCS or _DGS is missing the we can make assumptions as well. The change is based on a patch suggested by Anthony Jenkins in PR 207086. PR: 207086 Submitted by: Anthony Jenkins handle) & DCS_ACTIVE) == 0) continue; - level = vo_get_brightness(vo->handle); + level = vo_get_brightness(vo); if (level != -1) - vo_set_brightness(vo->handle, level); + vo_set_brightness(vo, level); } ACPI_SERIAL_END(video_output); ACPI_SERIAL_END(video); @@ -419,7 +421,7 @@ acpi_video_power_profile(void *context) ACPI_SERIAL_BEGIN(video_output); STAILQ_FOREACH(vo, &sc->vid_outputs, vo_next) { if (vo->vo_levels != NULL && vo->vo_brightness == -1) - vo_set_brightness(vo->handle, + vo_set_brightness(vo, state == POWER_PROFILE_ECONOMY ? vo->vo_economy : vo->vo_fullpower); } @@ -518,6 +520,8 @@ acpi_video_vo_init(UINT32 adr) vo->handle = NULL; vo->adr = adr; vo->vo_unit.num = n; + vo->vo_hasbqc = -1; + vo->vo_level = -1; vo->vo_brightness = -1; vo->vo_fullpower = -1; /* TODO: override with tunables */ vo->vo_economy = -1; @@ -698,7 +702,7 @@ acpi_video_vo_notify_handler(ACPI_HANDLE handle, UINT3 case VID_NOTIFY_ZERO_BRN: if (vo->vo_levels == NULL) goto out; - level = vo_get_brightness(handle); + level = vo_get_brightness(vo); if (level < 0) goto out; break; @@ -742,7 +746,7 @@ acpi_video_vo_notify_handler(ACPI_HANDLE handle, UINT3 break; } if (new_level != level) { - vo_set_brightness(handle, new_level); + vo_set_brightness(vo, new_level); vo->vo_brightness = new_level; } @@ -807,7 +811,7 @@ acpi_video_vo_bright_sysctl(SYSCTL_HANDLER_ARGS) if (level != -1 && (err = acpi_video_vo_check_level(vo, level))) goto out; vo->vo_brightness = level; - vo_set_brightness(vo->handle, (level == -1) ? preset : level); + vo_set_brightness(vo, (level == -1) ? preset : level); out: ACPI_SERIAL_END(video_output); @@ -848,7 +852,7 @@ acpi_video_vo_presets_sysctl(SYSCTL_HANDLER_ARGS) goto out; if (vo->vo_brightness == -1 && (power_profile_get_state() == arg2)) - vo_set_brightness(vo->handle, level); + vo_set_brightness(vo, level); *preset = level; out: @@ -1018,15 +1022,39 @@ out: } static int -vo_get_brightness(ACPI_HANDLE handle) +vo_get_bqc(struct acpi_video_output *vo, UINT32 *level) { + ACPI_STATUS status; + + switch (vo->vo_hasbqc) { + case 1: + case -1: + status = acpi_GetInteger(vo->handle, "_BQC", level); + if (vo->vo_hasbqc == 1) + break; + vo->vo_hasbqc = status != AE_NOT_FOUND; + if (vo->vo_hasbqc == 1) + break; + /* FALLTHROUGH */ + default: + KASSERT(vo->vo_hasbqc == 0, + ("bad vo_hasbqc state %d", vo->vo_hasbqc)); + *level = vo->vo_level; + status = AE_OK; + } + return (status); +} + +static int +vo_get_brightness(struct acpi_video_output *vo) +{ UINT32 level; ACPI_STATUS status; ACPI_SERIAL_ASSERT(video_output); - status = acpi_GetInteger(handle, "_BQC", &level); + status = vo_get_bqc(vo, &level); if (ACPI_FAILURE(status)) { - printf("can't evaluate %s._BQC - %s\n", acpi_name(handle), + printf("can't evaluate %s._BQC - %s\n", acpi_name(vo->handle), AcpiFormatException(status)); return (-1); } @@ -1037,16 +1065,19 @@ vo_get_brightness(ACPI_HANDLE handle) } static void -vo_set_brightness(ACPI_HANDLE handle, int level) +vo_set_brightness(struct acpi_video_output *vo, int level) { char notify_buf[16]; ACPI_STATUS status; ACPI_SERIAL_ASSERT(video_output); - status = acpi_SetInteger(handle, "_BCM", level); - if (ACPI_FAILURE(status)) + status = acpi_SetInteger(vo->handle, "_BCM", level); + if (ACPI_FAILURE(status)) { printf("can't evaluate %s._BCM - %s\n", - acpi_name(handle), AcpiFormatException(status)); + acpi_name(vo->handle), AcpiFormatException(status)); + } else { + vo->vo_level = level; + } snprintf(notify_buf, sizeof(notify_buf), "notify=%d", level); devctl_notify("ACPI", "Video", "brightness", notify_buf); } @@ -1060,9 +1091,18 @@ vo_get_device_status(ACPI_HANDLE handle) ACPI_SERIAL_ASSERT(video_output); dcs = 0; status = acpi_GetInteger(handle, "_DCS", &dcs); - if (ACPI_FAILURE(status)) - printf("can't evaluate %s._DCS - %s\n", - acpi_name(handle), AcpiFormatException(status)); + if (ACPI_FAILURE(status)) { + /* + * If the method is missing, assume that the device is always + * operational. + */ + if (status != AE_NOT_FOUND) { + printf("can't evaluate %s._DCS - %s\n", + acpi_name(handle), AcpiFormatException(status)); + } else { + dcs = 0xff; + } + } return (dcs); } @@ -1075,9 +1115,18 @@ vo_get_graphics_state(ACPI_HANDLE handle) dgs = 0; status = acpi_GetInteger(handle, "_DGS", &dgs); - if (ACPI_FAILURE(status)) - printf("can't evaluate %s._DGS - %s\n", - acpi_name(handle), AcpiFormatException(status)); + if (ACPI_FAILURE(status)) { + /* + * If the method is missing, assume that the device is always + * operational. + */ + if (status != AE_NOT_FOUND) { + printf("can't evaluate %s._DGS - %s\n", + acpi_name(handle), AcpiFormatException(status)); + } else { + dgs = 0xff; + } + } return (dgs); } @@ -1089,7 +1138,7 @@ vo_set_device_state(ACPI_HANDLE handle, UINT32 state) ACPI_SERIAL_ASSERT(video_output); status = acpi_SetInteger(handle, "_DSS", state); - if (ACPI_FAILURE(status)) + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) printf("can't evaluate %s._DSS - %s\n", - acpi_name(handle), AcpiFormatException(status)); + acpi_name(handle), AcpiFormatException(status)); } From owner-svn-src-head@freebsd.org Tue May 5 15:44: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 A171713A818; Tue, 5 May 2020 15:44:36 +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 49GkYc1Y82z48mG; Tue, 5 May 2020 15:44:35 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id VzkFjVvnmYYpxVzkHjaWuk; Tue, 05 May 2020 09:44:34 -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=KFYbhEvEi3z-stj11P0A:9 a=VU1E-WD-kY0SBYkw:21 a=MmK4iBbd0oKw5cNV: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 ESMTPS id 4F504172E; Tue, 5 May 2020 08:44:31 -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 045FiV8q049669; Tue, 5 May 2020 08:44: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 045FiUHA049666; Tue, 5 May 2020 08:44:30 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202005051544.045FiUHA049666@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: r360648 - in head: lib/libvmmapi share/man/man5 share/mk sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel sys/amd64/vmm/io sys/conf sys/modules/vmm tools/build/opti... In-reply-to: <202005050002.04502576094544@repo.freebsd.org> References: <202005050002.04502576094544@repo.freebsd.org> Comments: In-reply-to John Baldwin message dated "Tue, 05 May 2020 00:02:05 -0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 05 May 2020 08:44:30 -0700 X-CMAE-Envelope: MS4wfKr+WYzZnXkodgqn4KW2m7IxNvx5SzWdk+rb/USrIN0GgG0EfT6IowMhoimsLGjht8thoLiPXOBUvifKcuV8a3HJgr5WJv26xs6KBGCSObQDwkxsmtFX BE1d1einchmwbn4L3a0EX6I9Kyf6b1xPUwGzqZGHmGvqhXFGibJki/ZXcj9qZKKfgwDJTYcHiLN7iMCEZ87u4XaV0dnkzAZY0Zq/73MuDX7lgMKtanubpbLF PvGLEiF7vEonubAwWYe8rtnUVuELEhhVgXqLul/nvdriWapinB6NLTzv3zGM48ZS X-Rspamd-Queue-Id: 49GkYc1Y82z48mG 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.30 Precedence: list List-Id: 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, 05 May 2020 15:44:36 -0000 In message <202005050002.04502576094544@repo.freebsd.org>, John Baldwin writes: > Author: jhb > Date: Tue May 5 00:02:04 2020 > New Revision: 360648 > URL: https://svnweb.freebsd.org/changeset/base/360648 > > Log: > Initial support for bhyve save and restore. > > Save and restore (also known as suspend and resume) permits a snapshot > to be taken of a guest's state that can later be resumed. In the > current implementation, bhyve(8) creates a UNIX domain socket that is > used by bhyvectl(8) to send a request to save a snapshot (and > optionally exit after the snapshot has been taken). A snapshot > currently consists of two files: the first holds a copy of guest RAM, > and the second file holds other guest state such as vCPU register > values and device model state. > > To resume a guest, bhyve(8) must be started with a matching pair of > command line arguments to instantiate the same set of device models as > well as a pointer to the saved snapshot. > > While the current implementation is useful for several uses cases, it > has a few limitations. The file format for saving the guest state is > tied to the ABI of internal bhyve structures and is not > self-describing (in that it does not communicate the set of device > models present in the system). In addition, the state saved for some > device models closely matches the internal data structures which might > prove a challenge for compatibility of snapshot files across a range > of bhyve versions. The file format also does not currently support > versioning of individual chunks of state. As a result, the current > file format is not a fixed binary format and future revisions to save > and restore will break binary compatiblity of snapshot files. The > goal is to move to a more flexible format that adds versioning, > etc. and at that point to commit to providing a reasonable level of > compatibility. As a result, the current implementation is not enabled > by default. It can be enabled via the WITH_BHYVE_SNAPSHOT=yes option > for userland builds, and the kernel option BHYVE_SHAPSHOT. > > Submitted by: Mihai Tiganus, Flavius Anton, Darius Mihai > Submitted by: Elena Mihailescu, Mihai Carabas, Sergiu Weisz > Relnotes: yes > Sponsored by: University Politehnica of Bucharest > Sponsored by: Matthew Grooms (student scholarships) > Sponsored by: iXsystems > Differential Revision: https://reviews.freebsd.org/D19495 Could also be the basis of a vmotion-like function. And possibly a hot-failover facility like VMware has. Vmotion and hot-failover require shared disk but we could use ZFS snapshots instead. -- 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 5 17:06: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 C3B9A13D146; Tue, 5 May 2020 17:06:21 +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 49GmMx4nVmz4FjM; Tue, 5 May 2020 17:06:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-164.local (unknown [IPv6:2601:648:8203:2990:80d2:980f:ce39:ad6c]) (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 316E4149E2; Tue, 5 May 2020 17:06:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r360648 - in head: lib/libvmmapi share/man/man5 share/mk sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel sys/amd64/vmm/io sys/conf sys/modules/vmm tools/build/opti... From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005050002.04502576094544@repo.freebsd.org> Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <0f83ab8d-30fa-79b1-4438-f2422a719e1f@FreeBSD.org> Date: Tue, 5 May 2020 10:06:19 -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: <202005050002.04502576094544@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 05 May 2020 17:06:21 -0000 On 5/4/20 5:02 PM, John Baldwin wrote: > Author: jhb > Date: Tue May 5 00:02:04 2020 > New Revision: 360648 > URL: https://svnweb.freebsd.org/changeset/base/360648 > > Log: > Initial support for bhyve save and restore. This represents a lot of work by the folks at UPB. I merely fixed a few nits. This does need further maturing, but it is easier to do that in the tree at this point than to keep maintaining this patchset out-of-tree. You can find instructions on using this and testing it here: https://github.com/FreeBSD-UPB/freebsd/wiki/Save-and-Restore-a-virtual-machine-using-bhyve Though you will want to build world with WITH_BHYVE_SNAPSHOT=yes and add 'options BHYVE_SNAPSHOT' to your kernel config. My own todo list of small cleanups is below, but a bigger issue is defining a more flexible file format for snapshots that encodes the machine configuration and is not as tied to internal ABIs of device models. That is quite a lift, but one that can be done somewhat incrementally I think. My next set of cleanups: - Remove int arg from VM_RESTORE_TIME ioctl - Remove 'ctx' from vm_snapshot ioctl structure - Add /var/run/bhyve to mtree, remove makedirs, remove checkpoint subdir - block_if.c - Change blockif_flush_bc to return ioctl / fsync return value - Axe bc_paused_cond and just use bc_cond - Use pointer arith for idx in block_if.c - snapshot.c - rewrite strcat_extension to use asprintf - review other bits of this file - remove lseek from vm_mem_read_file? - remove from vmm_snapshot.h? - fix to work with capsicum -- John Baldwin From owner-svn-src-head@freebsd.org Tue May 5 17:52: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 8407913EDBF; Tue, 5 May 2020 17:52:45 +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 49GnPT2tggz4JlY; Tue, 5 May 2020 17:52:45 +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 5E45F19E25; Tue, 5 May 2020 17:52:45 +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 045Hqjie077181; Tue, 5 May 2020 17:52:45 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 045HqjmF077180; Tue, 5 May 2020 17:52:45 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005051752.045HqjmF077180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 5 May 2020 17:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360662 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 360662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 05 May 2020 17:52:45 -0000 Author: tuexen Date: Tue May 5 17:52:44 2020 New Revision: 360662 URL: https://svnweb.freebsd.org/changeset/base/360662 Log: Fix the computation of the numbers of entries of the mapping array to look at when generating a SACK. This was wrong in case of sequence numbers wrap arounds. Thanks to Gwenael FOURRE for reporting the issue for the userland stack: https://github.com/sctplab/usrsctp/issues/462 MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue May 5 17:50:27 2020 (r360661) +++ head/sys/netinet/sctp_output.c Tue May 5 17:52:44 2020 (r360662) @@ -10713,7 +10713,7 @@ sctp_send_sack(struct sctp_tcb *stcb, int so_locked if (highest_tsn > asoc->mapping_array_base_tsn) { siz = (((highest_tsn - asoc->mapping_array_base_tsn) + 1) + 7) / 8; } else { - siz = (((MAX_TSN - highest_tsn) + 1) + highest_tsn + 7) / 8; + siz = (((MAX_TSN - asoc->mapping_array_base_tsn) + 1) + highest_tsn + 7) / 8; } } else { sack = NULL; From owner-svn-src-head@freebsd.org Tue May 5 17:55: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 479C313EEB7; Tue, 5 May 2020 17:55:46 +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 49GnSy1F9sz4Jvl; Tue, 5 May 2020 17:55:46 +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 2105419E2A; Tue, 5 May 2020 17:55:46 +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 045HtjTZ077440; Tue, 5 May 2020 17:55:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 045HtjJ5077439; Tue, 5 May 2020 17:55:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005051755.045HtjJ5077439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 5 May 2020 17:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360663 - head/contrib/libc-pwcache X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/contrib/libc-pwcache X-SVN-Commit-Revision: 360663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 05 May 2020 17:55:46 -0000 Author: cem Date: Tue May 5 17:55:45 2020 New Revision: 360663 URL: https://svnweb.freebsd.org/changeset/base/360663 Log: pwcache.3: Explicitly document OOM condition The pwcache functions allocate memory, and may return NULL pointers if that allocation fails and the corresponding uid or gid was not found in the local password database. Document this behavior. Sponsored by: Dell EMC Isilon Modified: head/contrib/libc-pwcache/pwcache.3 Modified: head/contrib/libc-pwcache/pwcache.3 ============================================================================== --- head/contrib/libc-pwcache/pwcache.3 Tue May 5 17:52:44 2020 (r360662) +++ head/contrib/libc-pwcache/pwcache.3 Tue May 5 17:55:45 2020 (r360663) @@ -56,7 +56,7 @@ .\" .\" @(#)pwcache.3 8.1 (Berkeley) 6/9/93 .\" -.Dd October 19, 2012 +.Dd May 5, 2020 .Dt PWCACHE 3 .Os .Sh NAME @@ -193,6 +193,15 @@ and may be .Dv NULL pointers. +.Sh ERRORS +If insufficient memory is available, +.Fn user_from_uid +and +.Fn group_from_gid +may return NULL pointers. +.Va errno +is set to +.Er ENOMEM . .Sh SEE ALSO .Xr getgrgid 3 , .Xr getgrnam 3 , From owner-svn-src-head@freebsd.org Tue May 5 17:57: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 9916513EF86; Tue, 5 May 2020 17:57:05 +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 49GnVT3bMDz4K3k; Tue, 5 May 2020 17:57:05 +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 76A0B19E2C; Tue, 5 May 2020 17:57:05 +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 045Hv5rR077536; Tue, 5 May 2020 17:57:05 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 045Hv5I6077534; Tue, 5 May 2020 17:57:05 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005051757.045Hv5I6077534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 5 May 2020 17:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360664 - head/lib/libc/string X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/string X-SVN-Commit-Revision: 360664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 05 May 2020 17:57:05 -0000 Author: cem Date: Tue May 5 17:57:04 2020 New Revision: 360664 URL: https://svnweb.freebsd.org/changeset/base/360664 Log: strdup.3: Slightly canonicalize OOM return/error status Attempted to clean up the language around "this is a malloc'd object." May be passed as a parameter to free(3) is a bit obtuse. Sponsored by: Dell EMC Isilon Modified: head/lib/libc/string/strdup.3 Modified: head/lib/libc/string/strdup.3 ============================================================================== --- head/lib/libc/string/strdup.3 Tue May 5 17:55:45 2020 (r360663) +++ head/lib/libc/string/strdup.3 Tue May 5 17:57:04 2020 (r360664) @@ -28,7 +28,7 @@ .\" @(#)strdup.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 6, 2018 +.Dd May 5, 2020 .Dt STRDUP 3 .Os .Sh NAME @@ -51,15 +51,12 @@ allocates sufficient memory for a copy of the string .Fa str , does the copy, and returns a pointer to it. -The pointer may subsequently be used as an -argument to the function -.Xr free 3 . +The memory is allocated with +.Xr malloc 3 +and should be released with +.Xr free 3 +when no longer needed. .Pp -If insufficient memory is available, NULL is returned and -.Va errno -is set to -.Er ENOMEM . -.Pp The .Fn strndup function copies at most @@ -69,6 +66,14 @@ characters from the string always .Dv NUL terminating the copied string. +.Sh RETURN VALUES +If insufficient memory is available, NULL is returned and +.Va errno +is set to +.Er ENOMEM . +Otherwise, the +.Fn strdup +family of functions return a pointer to the copied string. .Sh SEE ALSO .Xr free 3 , .Xr malloc 3 , From owner-svn-src-head@freebsd.org Tue May 5 18:06: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 A221613F7BC; Tue, 5 May 2020 18:06:32 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49GnjN3q4Xz4Kqy; Tue, 5 May 2020 18:06:32 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E40C1A019; Tue, 5 May 2020 18:06:32 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 045I6WvK083930; Tue, 5 May 2020 18:06:32 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 045I6WCC083929; Tue, 5 May 2020 18:06:32 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005051806.045I6WCC083929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 5 May 2020 18:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360665 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 360665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 05 May 2020 18:06:32 -0000 Author: cem Date: Tue May 5 18:06:32 2020 New Revision: 360665 URL: https://svnweb.freebsd.org/changeset/base/360665 Log: ls(1): Fix trivial SEGV due to NULL deref in OOM path Reported by: Anton Rang Sponsored by: Dell EMC Isilon Modified: head/bin/ls/ls.c Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Tue May 5 17:57:04 2020 (r360664) +++ head/bin/ls/ls.c Tue May 5 18:06:32 2020 (r360665) @@ -838,7 +838,21 @@ display(const FTSENT *p, FTSENT *list, int options) group = ngroup; } else { user = user_from_uid(sp->st_uid, 0); + /* + * user_from_uid(..., 0) only returns + * NULL in OOM conditions. We could + * format the uid here, but (1) in + * general ls(1) exits on OOM, and (2) + * there is another allocation/exit + * path directly below, which will + * likely exit anyway. + */ + if (user == NULL) + err(1, "user_from_uid"); group = group_from_gid(sp->st_gid, 0); + /* Ditto. */ + if (group == NULL) + err(1, "group_from_gid"); } if ((ulen = strlen(user)) > maxuser) maxuser = ulen; From owner-svn-src-head@freebsd.org Tue May 5 19:00: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 9F1C42C222A; Tue, 5 May 2020 19:00:26 +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 49GpvZ3jD4z4QFV; Tue, 5 May 2020 19:00:26 +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 7A53F1AAD1; Tue, 5 May 2020 19:00:26 +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 045J0Qiv015456; Tue, 5 May 2020 19:00:26 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 045J0QJS015455; Tue, 5 May 2020 19:00:26 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005051900.045J0QJS015455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Tue, 5 May 2020 19:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360669 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 360669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 05 May 2020 19:00:26 -0000 Author: bcr (doc committer) Date: Tue May 5 19:00:26 2020 New Revision: 360669 URL: https://svnweb.freebsd.org/changeset/base/360669 Log: Fix broken links in the man page by pointing to a source that works or is the new location on the same page. Submitted by: alfix86_gmail.com Approved by: bcr Differential Revision: https://reviews.freebsd.org/D23769 Modified: head/share/man/man4/pcm.4 Modified: head/share/man/man4/pcm.4 ============================================================================== --- head/share/man/man4/pcm.4 Tue May 5 18:49:04 2020 (r360668) +++ head/share/man/man4/pcm.4 Tue May 5 19:00:26 2020 (r360669) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 22, 2012 +.Dd May 5, 2020 .Dt SOUND 4 .Os .Sh NAME @@ -743,8 +743,8 @@ A device node is not created properly. .Xr mixer 8 , .Xr sysctl 8 .Rs -.%T "Cookbook formulae for audio EQ biquad filter coefficients, by Robert Bristow-Johnson" -.%U "http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt" +.%T "Cookbook formulae for audio EQ biquad filter coefficients (Audio-EQ-Cookbook.txt), by Robert Bristow-Johnson" +.%U "https://www.musicdsp.org/en/latest/Filters/197-rbj-audio-eq-cookbook.html" .Re .Rs .%T "Julius O'Smith's Digital Audio Resampling" @@ -752,7 +752,7 @@ A device node is not created properly. .Re .Rs .%T "Polynomial Interpolators for High-Quality Resampling of Oversampled Audio, by Olli Niemitalo" -.%U "http://www.student.oulu.fi/~oniemita/dsp/deip.pdf" +.%U "http://yehar.com/blog/wp-content/uploads/2009/08/deip.pdf" .Re .Rs .%T "The OSS API" From owner-svn-src-head@freebsd.org Tue May 5 19:31: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 16E2E2C340B; Tue, 5 May 2020 19:31:50 +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 49Gqbn6w2Lz4S3M; Tue, 5 May 2020 19:31:49 +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 E87A71B222; Tue, 5 May 2020 19:31:49 +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 045JVnYA038537; Tue, 5 May 2020 19:31:49 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 045JVmvo037853; Tue, 5 May 2020 19:31:48 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005051931.045JVmvo037853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Tue, 5 May 2020 19:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360670 - in head/lib: libc/sys libthr X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: in head/lib: libc/sys libthr X-SVN-Commit-Revision: 360670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 05 May 2020 19:31:50 -0000 Author: bcr (doc committer) Date: Tue May 5 19:31:47 2020 New Revision: 360670 URL: https://svnweb.freebsd.org/changeset/base/360670 Log: Add HISTORY sections to document when this functionality first appeared in FreeBSD. Submitted by: Gordon Bergling gbergling_gmail.com Approved by: bcr Differential Revision: https://reviews.freebsd.org/D24677 Modified: head/lib/libc/sys/thr_exit.2 head/lib/libc/sys/thr_kill.2 head/lib/libc/sys/thr_new.2 head/lib/libc/sys/thr_self.2 head/lib/libc/sys/thr_set_name.2 head/lib/libc/sys/thr_suspend.2 head/lib/libc/sys/thr_wake.2 head/lib/libthr/libthr.3 Modified: head/lib/libc/sys/thr_exit.2 ============================================================================== --- head/lib/libc/sys/thr_exit.2 Tue May 5 19:00:26 2020 (r360669) +++ head/lib/libc/sys/thr_exit.2 Tue May 5 19:31:47 2020 (r360670) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2016 +.Dd May 5, 2020 .Dt THR_EXIT 2 .Os .Sh NAME @@ -88,3 +88,8 @@ to implement .St -p1003.1-2001 .Xr pthread 3 functionality. +.Sh HISTORY +The +.Fn thr_exit +system call first appeared in +.Fx 5.2 . Modified: head/lib/libc/sys/thr_kill.2 ============================================================================== --- head/lib/libc/sys/thr_kill.2 Tue May 5 19:00:26 2020 (r360669) +++ head/lib/libc/sys/thr_kill.2 Tue May 5 19:31:47 2020 (r360670) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2016 +.Dd May 5, 2020 .Dt THR_kill 2 .Os .Sh NAME @@ -131,3 +131,10 @@ to implement .St -p1003.1-2001 .Xr pthread 3 functionality. +.Sh HISTORY +The +.Fn thr_kill +and +.Fn thr_kill2 +system calls first appeared in +.Fx 5.2 . Modified: head/lib/libc/sys/thr_new.2 ============================================================================== --- head/lib/libc/sys/thr_new.2 Tue May 5 19:00:26 2020 (r360669) +++ head/lib/libc/sys/thr_new.2 Tue May 5 19:31:47 2020 (r360670) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2016 +.Dd May 5, 2020 .Dt THR_NEW 2 .Os .Sh NAME @@ -243,3 +243,8 @@ to implement .St -p1003.1-2001 .Xr pthread 3 functionality. +.Sh HISTORY +The +.Fn thr_new +system call first appeared in +.Fx 5.2 . Modified: head/lib/libc/sys/thr_self.2 ============================================================================== --- head/lib/libc/sys/thr_self.2 Tue May 5 19:00:26 2020 (r360669) +++ head/lib/libc/sys/thr_self.2 Tue May 5 19:31:47 2020 (r360670) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2020 +.Dd May 5, 2020 .Dt THR_SELF 2 .Os .Sh NAME @@ -88,3 +88,8 @@ to implement .St -p1003.1-2001 .Xr pthread 3 functionality. +.Sh HISTORY +The +.Fn thr_self +system call first appeared in +.Fx 5.2 . Modified: head/lib/libc/sys/thr_set_name.2 ============================================================================== --- head/lib/libc/sys/thr_set_name.2 Tue May 5 19:00:26 2020 (r360669) +++ head/lib/libc/sys/thr_set_name.2 Tue May 5 19:31:47 2020 (r360670) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2016 +.Dd May 5, 2020 .Dt THR_SET_NAME 2 .Os .Sh NAME @@ -92,3 +92,8 @@ The .Fn thr_set_name system call is non-standard and is used by the .Lb libthr . +.Sh HISTORY +The +.Fn thr_set_name +system call first appeared in +.Fx 5.2 . Modified: head/lib/libc/sys/thr_suspend.2 ============================================================================== --- head/lib/libc/sys/thr_suspend.2 Tue May 5 19:00:26 2020 (r360669) +++ head/lib/libc/sys/thr_suspend.2 Tue May 5 19:31:47 2020 (r360670) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 23, 2016 +.Dd May 5, 2020 .Dt THR_SUSPEND 2 .Os .Sh NAME @@ -128,3 +128,8 @@ The sleep was interrupted by a signal. The .Fn thr_suspend system call is non-standard. +.Sh HISTORY +The +.Fn thr_suspend +system call first appeared in +.Fx 5.2 . Modified: head/lib/libc/sys/thr_wake.2 ============================================================================== --- head/lib/libc/sys/thr_wake.2 Tue May 5 19:00:26 2020 (r360669) +++ head/lib/libc/sys/thr_wake.2 Tue May 5 19:31:47 2020 (r360670) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 23, 2016 +.Dd May 5, 2020 .Dt THR_WAKE 2 .Os .Sh NAME @@ -110,3 +110,8 @@ to implement .St -p1003.1-2001 .Xr pthread 3 functionality. +.Sh HISTORY +The +.Fn thr_suspend +system call first appeared in +.Fx 5.2 . Modified: head/lib/libthr/libthr.3 ============================================================================== --- head/lib/libthr/libthr.3 Tue May 5 19:00:26 2020 (r360669) +++ head/lib/libthr/libthr.3 Tue May 5 19:31:47 2020 (r360670) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 2016 +.Dd May 5, 2020 .Dt LIBTHR 3 .Os .Sh NAME @@ -279,6 +279,11 @@ logs. .Xr pthread_create 3 , .Xr signal 3 , .Xr atomic 9 +.Sh HISTORY +The +.Nm +library first appeared in +.Fx 5.2 . .Sh AUTHORS .An -nosplit The From owner-svn-src-head@freebsd.org Tue May 5 19: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 9BFDF2C41FF; Tue, 5 May 2020 19: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 49Gr5y3gJ9z4TTr; Tue, 5 May 2020 19: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 78E4B1B674; Tue, 5 May 2020 19: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 045JsUAJ051847; Tue, 5 May 2020 19:54:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 045JsUJk051846; Tue, 5 May 2020 19:54:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005051954.045JsUJk051846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 5 May 2020 19:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360671 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 360671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 05 May 2020 19:54:30 -0000 Author: tuexen Date: Tue May 5 19:54:30 2020 New Revision: 360671 URL: https://svnweb.freebsd.org/changeset/base/360671 Log: Avoid underflowing a variable, which would result in taking more data from the stream queues then needed. Thanks to Timo Voelker for finding this bug and providing a fix. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue May 5 19:31:47 2020 (r360670) +++ head/sys/netinet/sctp_output.c Tue May 5 19:54:30 2020 (r360671) @@ -7763,7 +7763,11 @@ sctp_fill_outqueue(struct sctp_tcb *stcb, } strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc); total_moved += moved; - space_left -= moved; + if (space_left >= moved) { + space_left -= moved; + } else { + space_left = 0; + } if (space_left >= SCTP_DATA_CHUNK_OVERHEAD(stcb)) { space_left -= SCTP_DATA_CHUNK_OVERHEAD(stcb); } else { From owner-svn-src-head@freebsd.org Tue May 5 21:50: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 1F8502C6E11; Tue, 5 May 2020 21:50:53 +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 49GthF024nz4bF5; Tue, 5 May 2020 21:50:53 +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 F05941CBA8; Tue, 5 May 2020 21:50:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 045LoqxI020537; Tue, 5 May 2020 21:50:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 045Loqch020536; Tue, 5 May 2020 21:50:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005052150.045Loqch020536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 5 May 2020 21:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360676 - head/usr.bin/elfctl X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/elfctl X-SVN-Commit-Revision: 360676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 05 May 2020 21:50:53 -0000 Author: emaste Date: Tue May 5 21:50:52 2020 New Revision: 360676 URL: https://svnweb.freebsd.org/changeset/base/360676 Log: elfctl: update earliest FreeBSD revision to 12.2 elfctl has been merged to stable/12, and so will appear in FreeBSD 12.2 Reported by: Dewayne Geraghty MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/elfctl/elfctl.1 Modified: head/usr.bin/elfctl/elfctl.1 ============================================================================== --- head/usr.bin/elfctl/elfctl.1 Tue May 5 21:01:43 2020 (r360675) +++ head/usr.bin/elfctl/elfctl.1 Tue May 5 21:50:52 2020 (r360676) @@ -85,7 +85,7 @@ elfctl -e +aslr file .Sh HISTORY .Nm first appeared in -.Fx 13.0 . +.Fx 12.2 . .Sh AUTHORS .Nm was written by From owner-svn-src-head@freebsd.org Wed May 6 00:44: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 0F9532DAFCB; Wed, 6 May 2020 00:44:04 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49GyX36fQ7z3HNx; Wed, 6 May 2020 00:44:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C54D81ED73; Wed, 6 May 2020 00:44:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0460i3qE029961; Wed, 6 May 2020 00:44:03 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0460i3IW029960; Wed, 6 May 2020 00:44:03 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202005060044.0460i3IW029960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 6 May 2020 00:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360678 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 360678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 00:44:04 -0000 Author: rmacklem Date: Wed May 6 00:44:03 2020 New Revision: 360678 URL: https://svnweb.freebsd.org/changeset/base/360678 Log: Delete unused function newnfs_trimleading. The NFS function called newnfs_trimleading() has not been used by the code in long time. To give you a clue, it still had a K&R style function declaration. Delete it, since it is just cruft, as a part of the NFS mbuf handling cleanup in preparation for adding ext_pgs mbuf support. The ext_pgs mbuf support for the build/send side is needed by nfs-over-tls. Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfs_var.h Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Wed May 6 00:25:43 2020 (r360677) +++ head/sys/fs/nfs/nfs_commonsubs.c Wed May 6 00:44:03 2020 (r360678) @@ -1006,53 +1006,6 @@ nfsaddr2_match(NFSSOCKADDR_T nam1, NFSSOCKADDR_T nam2) return (0); } - -/* - * Trim the stuff already dissected off the mbuf list. - */ -APPLESTATIC void -newnfs_trimleading(nd) - struct nfsrv_descript *nd; -{ - struct mbuf *m, *n; - int offs; - - /* - * First, free up leading mbufs. - */ - if (nd->nd_mrep != nd->nd_md) { - m = nd->nd_mrep; - while (m->m_next != nd->nd_md) { - if (m->m_next == NULL) - panic("nfsm trim leading"); - m = m->m_next; - } - m->m_next = NULL; - m_freem(nd->nd_mrep); - } - m = nd->nd_md; - - /* - * Now, adjust this mbuf, based on nd_dpos. - */ - offs = nd->nd_dpos - mtod(m, caddr_t); - if (offs == m->m_len) { - n = m; - m = m->m_next; - if (m == NULL) - panic("nfsm trim leading2"); - n->m_next = NULL; - m_freem(n); - } else if (offs > 0) { - m->m_len -= offs; - m->m_data += offs; - } else if (offs < 0) - panic("nfsm trimleading offs"); - nd->nd_mrep = m; - nd->nd_md = m; - nd->nd_dpos = mtod(m, caddr_t); -} - /* * Trim trailing data off the mbuf list being built. */ Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Wed May 6 00:25:43 2020 (r360677) +++ head/sys/fs/nfs/nfs_var.h Wed May 6 00:44:03 2020 (r360678) @@ -324,7 +324,6 @@ int nfsm_mbufuio(struct nfsrv_descript *, struct uio * int nfsm_fhtom(struct nfsrv_descript *, u_int8_t *, int, int); int nfsm_advance(struct nfsrv_descript *, int, int); void *nfsm_dissct(struct nfsrv_descript *, int, int); -void newnfs_trimleading(struct nfsrv_descript *); void newnfs_trimtrailing(struct nfsrv_descript *, struct mbuf *, caddr_t); void newnfs_copycred(struct nfscred *, struct ucred *); From owner-svn-src-head@freebsd.org Wed May 6 01:08: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 04FE52DB441; Wed, 6 May 2020 01:08: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 49Gz435Dtvz3JFc; Wed, 6 May 2020 01:08:19 +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 AAA801F16C; Wed, 6 May 2020 01:08:19 +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 04618J1i042587; Wed, 6 May 2020 01:08:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04618JLo042586; Wed, 6 May 2020 01:08:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005060108.04618JLo042586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 May 2020 01:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360679 - head/contrib/binutils/gas X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/binutils/gas X-SVN-Commit-Revision: 360679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 01:08:20 -0000 Author: emaste Date: Wed May 6 01:08:19 2020 New Revision: 360679 URL: https://svnweb.freebsd.org/changeset/base/360679 Log: GNU as: print a deprecation warning on program start GNU as 2.17.50 will be removed before FreeBSD 13. Modified: head/contrib/binutils/gas/as.c Modified: head/contrib/binutils/gas/as.c ============================================================================== --- head/contrib/binutils/gas/as.c Wed May 6 00:44:03 2020 (r360678) +++ head/contrib/binutils/gas/as.c Wed May 6 01:08:19 2020 (r360679) @@ -1089,6 +1089,7 @@ main (int argc, char ** argv) expandargv (&argc, &argv); START_PROGRESS (myname, 0); + fprintf (stderr, _("warning: as 2.17.50 is deprecated in FreeBSD and will be removed\n")); #ifndef OBJ_DEFAULT_OUTPUT_FILE_NAME #define OBJ_DEFAULT_OUTPUT_FILE_NAME "a.out" From owner-svn-src-head@freebsd.org Wed May 6 02:21: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 6013D2DC692; Wed, 6 May 2020 02:21:07 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) (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 49H0h23NqGz3Lqq; Wed, 6 May 2020 02:21:06 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f169.google.com with SMTP id r14so170026ybm.12; Tue, 05 May 2020 19:21:06 -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=kLZDfgXfsxyKEouZQ1MUf8zlqFUKA2Y9g9MYX0Xkv0s=; b=rIhqN86fi7DcgyN9sHnathwrzZvm87C6aArvqGa0m874xkutkN5bR5wBtTzUtU7Dqy 0Gby0mwTleiKoEqgAUX3Myjw3K5yUL160htAmnNDirYu+5Spe9z7YbIwW3ezRL06wcem U/BIGW7+PjqgXDfmeNcGTPwDq8MmaFlt7gvNATgqDxejrSMG9VwkqeC7KaBevSbt4LEO jxSLfDDwtDGSL8f2wMs6teqMwXUgqw/kV54XRoyPDPiIrXEpOhYnElEd2lXfs4B9LO/r 0mpg5EgGktYqOJ/1vOJ3K8KEYftJS4pLcP1Z9jc2ex6Q1QIZda0C3wMb49AE7/8DDLFu cntw== X-Gm-Message-State: AGi0Puax2AJWPQfTyTNiHKc2+Z5ds5bLYMkd4JtsF8ko5tnju6PsbHzf OQEZJIMTUDeYBoNE6vDQ5cYr/KTGQzH2/WjbnKjdq0jT X-Google-Smtp-Source: APiQypKEmsJ6yTAJkxTVBTsW1Gu12apy2IHcMqoep7lHNovPsyRcRFKladQeufQtQeys3f5agVXOpD5Tt6msZGP7xsg= X-Received: by 2002:a25:ac91:: with SMTP id x17mr10384846ybi.497.1588731665044; Tue, 05 May 2020 19:21:05 -0700 (PDT) MIME-Version: 1.0 References: <202005050002.04502576094544@repo.freebsd.org> In-Reply-To: <202005050002.04502576094544@repo.freebsd.org> From: Li-Wen Hsu Date: Wed, 6 May 2020 10:20:54 +0800 Message-ID: Subject: Re: svn commit: r360648 - in head: lib/libvmmapi share/man/man5 share/mk sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel sys/amd64/vmm/io sys/conf sys/modules/vmm tools/build/opti... To: John Baldwin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49H0h23NqGz3Lqq 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.169 as permitted sender) smtp.mailfrom=lwhsufreebsd@gmail.com X-Spamd-Result: default: False [-3.94 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[lwhsu@freebsd.org,lwhsufreebsd@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)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-1.94)[ip: (-8.84), 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)[169.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)[169.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]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 02:21:07 -0000 On Tue, May 5, 2020 at 8:02 AM John Baldwin wrote: > > Author: jhb > Date: Tue May 5 00:02:04 2020 > New Revision: 360648 > URL: https://svnweb.freebsd.org/changeset/base/360648 ... > Added: > head/sys/amd64/include/vmm_snapshot.h (contents, props changed) > head/sys/amd64/vmm/vmm_snapshot.c (contents, props changed) > head/tools/build/options/WITH_BHYVE_SNAPSHOT (contents, props changed) > head/usr.sbin/bhyve/snapshot.c (contents, props changed) > head/usr.sbin/bhyve/snapshot.h (contents, props changed) These added files all have "THIS SOFTWARE IS PROVIDED BY NETAPP, INC" in copyright header, but non of the authors look like from NetApp. Is it intended or it's better to have "THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS"? Best, Li-Wen From owner-svn-src-head@freebsd.org Wed May 6 07:48: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 EA8E4139460; Wed, 6 May 2020 07:48:38 +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 49H7xy6Jq3z4FsV; Wed, 6 May 2020 07:48:38 +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 D3D0A23F32; Wed, 6 May 2020 07:48:38 +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 0467mcuh093464; Wed, 6 May 2020 07:48:38 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0467mcQr093460; Wed, 6 May 2020 07:48:38 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005060748.0467mcQr093460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 6 May 2020 07:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360685 - in head/tests/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/tests/sys: netinet netinet6 X-SVN-Commit-Revision: 360685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 07:48:39 -0000 Author: melifaro Date: Wed May 6 07:48:37 2020 New Revision: 360685 URL: https://svnweb.freebsd.org/changeset/base/360685 Log: Add basic routing LPM tests. Differential Revision: https://reviews.freebsd.org/D24684 Added: head/tests/sys/netinet/lpm.sh (contents, props changed) head/tests/sys/netinet6/lpm6.sh (contents, props changed) Modified: head/tests/sys/netinet/Makefile head/tests/sys/netinet6/Makefile Modified: head/tests/sys/netinet/Makefile ============================================================================== --- head/tests/sys/netinet/Makefile Wed May 6 05:41:02 2020 (r360684) +++ head/tests/sys/netinet/Makefile Wed May 6 07:48:37 2020 (r360685) @@ -9,7 +9,7 @@ ATF_TESTS_C= ip_reass_test \ so_reuseport_lb_test \ socket_afinet -ATF_TESTS_SH= carp fibs_test redirect divert forward output +ATF_TESTS_SH= carp fibs_test redirect divert forward output lpm PROGS= udp_dontroute tcp_user_cookie Added: head/tests/sys/netinet/lpm.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet/lpm.sh Wed May 6 07:48:37 2020 (r360685) @@ -0,0 +1,179 @@ +#!/usr/bin/env atf-sh +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2020 Alexander V. Chernikov +# +# 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$ +# + +. $(atf_get_srcdir)/../common/vnet.subr + +setup_networking() +{ + jname="$1" + lo_dst="$2" + epair0="$3" + epair1="$4" + + vnet_mkjail ${jname}a ${epair0}a ${epair1}a + # Setup transit IPv4 networks + jexec ${jname}a ifconfig ${epair0}a up + jexec ${jname}a ifconfig ${epair0}a inet 203.0.113.1/30 + jexec ${jname}a ifconfig ${epair1}a up + jexec ${jname}a ifconfig ${epair1}a inet 203.0.113.5/30 + + vnet_mkjail ${jname}b ${epair0}b ${epair1}b ${lo_dst} + jexec ${jname}b ifconfig ${epair0}b up + jexec ${jname}b ifconfig ${epair0}b inet 203.0.113.2/30 + jexec ${jname}b ifconfig ${epair1}b up + jexec ${jname}b ifconfig ${epair1}b inet 203.0.113.6/30 + jexec ${jname}b ifconfig ${lo_dst} up + +} + +atf_test_case "lpm_test1_success" "cleanup" +lpm_test1_success_head() +{ + + atf_set descr 'Test IPv4 LPM for /30 and /31' + atf_set require.user root +} + +lpm_test1_success_body() +{ + + vnet_init + + jname="v4t-lpm_test1_success" + + lo_dst=$(vnet_mkloopback) + epair0=$(vnet_mkepair) + epair1=$(vnet_mkepair) + + setup_networking ${jname} ${lo_dst} ${epair0} ${epair1} + + jexec ${jname}b ifconfig ${lo_dst} inet 198.51.100.0/32 + jexec ${jname}b ifconfig ${lo_dst} alias 198.51.100.2/32 + + # Add routes + # A -> towards B via epair0a + jexec ${jname}a route add -4 -net 198.51.100.0/30 203.0.113.2 + # A -> towards B via epair1a + jexec ${jname}a route add -4 -net 198.51.100.0/31 203.0.113.6 + + count=20 + valid_message="${count} packets transmitted, ${count} packets received" + + # Check that 198.51.100.0 goes via epair1 + atf_check -o match:"${valid_message}" jexec ${jname}a ping -f -nc${count} 198.51.100.0 + pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` + pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` + if [ ${pkt_1} -le ${count} ]; then + echo "LPM failure: 1: ${pkt_0} 2: ${pkt_1} (should be ${count})" + exit 1 + fi + + # Check that 198.51.100.2 goes via epair0 + atf_check -o match:"${valid_message}" jexec ${jname}a ping -f -nc${count} 198.51.100.2 + pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` + pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` + if [ ${pkt_0} -le ${count} ]; then + echo "LPM failure: 1: ${pkt_0} (should be ${count}) 2: ${pkt_1}" + exit 1 + fi + + echo "RAW BALANCING: 1: ${pkt_0} 2: ${pkt_1}" +} + +lpm_test1_success_cleanup() +{ + vnet_cleanup +} + +atf_test_case "lpm_test2_success" "cleanup" +lpm_test2_success_head() +{ + + atf_set descr 'Test IPv4 LPM for the host routes' + atf_set require.user root +} + +lpm_test2_success_body() +{ + + vnet_init + + jname="v4t-lpm_test2_success" + + lo_dst=$(vnet_mkloopback) + epair0=$(vnet_mkepair) + epair1=$(vnet_mkepair) + + setup_networking ${jname} ${lo_dst} ${epair0} ${epair1} + + jexec ${jname}b ifconfig ${lo_dst} inet 198.51.100.0/32 + jexec ${jname}b ifconfig ${lo_dst} alias 198.51.100.1/32 + + # Add routes + # A -> towards B via epair0a + jexec ${jname}a route add -4 -host 198.51.100.0 203.0.113.2 + # A -> towards B via epair1a + jexec ${jname}a route add -4 -host 198.51.100.1 203.0.113.6 + + count=20 + valid_message="${count} packets transmitted, ${count} packets received" + + # Check that 198.51.100.0 goes via epair0 + atf_check -o match:"${valid_message}" jexec ${jname}a ping -f -nc${count} 198.51.100.0 + pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` + pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` + if [ ${pkt_0} -le ${count} ]; then + echo "LPM failure: 1: ${pkt_0} (should be ${count}) 2: ${pkt_1}" + exit 1 + fi + + # Check that 198.51.100.1 goes via epair1 + atf_check -o match:"${valid_message}" jexec ${jname}a ping -f -nc${count} 198.51.100.1 + pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` + pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` + if [ ${pkt_1} -le ${count} ]; then + echo "LPM failure: 1: ${pkt_0} 2: ${pkt_1} (should be ${count})" + exit 1 + fi + + echo "RAW BALANCING: 1: ${pkt_0} 2: ${pkt_1}" +} + +lpm_test2_success_cleanup() +{ + vnet_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "lpm_test1_success" + atf_add_test_case "lpm_test2_success" +} + Modified: head/tests/sys/netinet6/Makefile ============================================================================== --- head/tests/sys/netinet6/Makefile Wed May 6 05:41:02 2020 (r360684) +++ head/tests/sys/netinet6/Makefile Wed May 6 07:48:37 2020 (r360685) @@ -12,7 +12,8 @@ ATF_TESTS_SH= \ redirect \ divert \ forward6 \ - output6 + output6 \ + lpm6 ${PACKAGE}FILES+= exthdr.py ${PACKAGE}FILES+= mld.py Added: head/tests/sys/netinet6/lpm6.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet6/lpm6.sh Wed May 6 07:48:37 2020 (r360685) @@ -0,0 +1,199 @@ +#!/usr/bin/env atf-sh +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2020 Alexander V. Chernikov +# +# 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$ +# + +. $(atf_get_srcdir)/../common/vnet.subr + +setup_networking() +{ + jname="$1" + lo_dst="$2" + epair0="$3" + epair1="$4" + + vnet_mkjail ${jname}a ${epair0}a ${epair1}a ${lo_src} + # enable link-local IPv6 + jexec ${jname}a ndp -i ${epair0}a -- -disabled + jexec ${jname}a ifconfig ${epair0}a up + jexec ${jname}a ndp -i ${epair1}a -- -disabled + jexec ${jname}a ifconfig ${epair1}a up + jexec ${jname}a ifconfig ${lo_src} up + + vnet_mkjail ${jname}b ${epair0}b ${epair1}b ${lo_dst} + jexec ${jname}b ndp -i ${epair0}b -- -disabled + jexec ${jname}b ifconfig ${epair0}b up + jexec ${jname}b ndp -i ${epair1}b -- -disabled + jexec ${jname}b ifconfig ${epair1}b up + jexec ${jname}b ifconfig ${lo_dst} up + + # wait for DAD to complete + while [ `jexec ${jname}b ifconfig | grep inet6 | grep -c tentative` != "0" ]; do + sleep 0.1 + done + while [ `jexec ${jname}a ifconfig | grep inet6 | grep -c tentative` != "0" ]; do + sleep 0.1 + done +} + + +atf_test_case "lpm6_test1_success" "cleanup" +lpm6_test1_success_head() +{ + + atf_set descr 'Test IPv6 LPM for the host routes' + atf_set require.user root +} + +lpm6_test1_success_body() +{ + + vnet_init + + net_dst="2001:db8:" + + jname="v6t-lpm6_test1_success" + + epair0=$(vnet_mkepair) + epair1=$(vnet_mkepair) + lo_dst=$(vnet_mkloopback) + + setup_networking ${jname} ${lo_dst} ${epair0} ${epair1} + + jexec ${jname}b ifconfig ${lo_dst} inet6 ${net_dst}:2:0/128 + jexec ${jname}b ifconfig ${lo_dst} inet6 ${net_dst}:2:1/128 + + # Add routes + # A -> towards B via epair0a LL + ll=`jexec ${jname}b ifconfig ${epair0}b inet6 | awk '$2~/^fe80:/{print$2}' | awk -F% '{print$1}'` + jexec ${jname}a route add -6 -host ${net_dst}:2:0 ${ll}%${epair0}a + # A -> towards B via epair1a LL + ll=`jexec ${jname}b ifconfig ${epair1}b inet6 | awk '$2~/^fe80:/{print$2}' | awk -F% '{print$1}'` + jexec ${jname}a route add -6 -host ${net_dst}:2:1 ${ll}%${epair1}a + + count=20 + valid_message="${count} packets transmitted, ${count} packets received" + + # Check that ${net_dst}:2:0 goes via epair0 + atf_check -o match:"${valid_message}" jexec ${jname}a ping6 -f -nc${count} ${net_dst}:2:0 + pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` + pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` + if [ ${pkt_0} -le ${count} ]; then + echo "LPM failure: 1: ${pkt_0} (should be ${count}) 2: ${pkt_1}" + exit 1 + fi + + # Check that ${net_dst}:2:1 goes via epair1 + atf_check -o match:"${valid_message}" jexec ${jname}a ping6 -f -nc${count} ${net_dst}:2:1 + pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` + pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` + if [ ${pkt_1} -le ${count} ]; then + echo "LPM failure: 1: ${pkt_0} 2: ${pkt_1} (should be ${count})" + exit 1 + fi + + echo "RAW BALANCING: 1: ${pkt_0} 2: ${pkt_1}" +} + +lpm6_test1_success_cleanup() +{ + vnet_cleanup +} + +atf_test_case "lpm6_test2_success" "cleanup" +lpm6_test2_success_head() +{ + + atf_set descr 'Test IPv6 LPM for /126 and /127' + atf_set require.user root +} + +lpm6_test2_success_body() +{ + + vnet_init + + net_dst="2001:db8:" + + jname="v6t-lpm6_test2_success" + + epair0=$(vnet_mkepair) + epair1=$(vnet_mkepair) + lo_dst=$(vnet_mkloopback) + + setup_networking ${jname} ${lo_dst} ${epair0} ${epair1} + + jexec ${jname}b ifconfig ${lo_dst} inet6 ${net_dst}:2:0/128 + jexec ${jname}b ifconfig ${lo_dst} inet6 ${net_dst}:2:2/128 + + # Add routes + # A -> towards B via epair0a LL + ll=`jexec ${jname}b ifconfig ${epair0}b inet6 | awk '$2~/^fe80:/{print$2}' | awk -F% '{print$1}'` + jexec ${jname}a route add -6 -net ${net_dst}:2:0/126 ${ll}%${epair0}a + # A -> towards B via epair1a LL + ll=`jexec ${jname}b ifconfig ${epair1}b inet6 | awk '$2~/^fe80:/{print$2}' | awk -F% '{print$1}'` + jexec ${jname}a route add -6 -net ${net_dst}:2:0/127 ${ll}%${epair1}a + + count=20 + valid_message="${count} packets transmitted, ${count} packets received" + + # Check that ${net_dst}:2:0 goes via epair1 + atf_check -o match:"${valid_message}" jexec ${jname}a ping6 -f -nc${count} ${net_dst}:2:0 + pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` + pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` + if [ ${pkt_1} -le ${count} ]; then + echo "LPM failure: 1: ${pkt_0} 2: ${pkt_1} (should be ${count})" + exit 1 + fi + + # Check that ${net_dst}:2:2 goes via epair0 + atf_check -o match:"${valid_message}" jexec ${jname}a ping6 -f -nc${count} ${net_dst}:2:2 + pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` + pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` + if [ ${pkt_0} -le ${count} ]; then + echo "LPM failure: 1: ${pkt_0} (should be ${count}) 2: ${pkt_1}" + exit 1 + fi + + echo "RAW BALANCING: 1: ${pkt_0} 2: ${pkt_1}" +} + +lpm6_test2_success_cleanup() +{ + vnet_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "lpm6_test1_success" + atf_add_test_case "lpm6_test2_success" +} + +# end + + From owner-svn-src-head@freebsd.org Wed May 6 13:24: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 3897F2C5099; Wed, 6 May 2020 13:24:46 +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 49HHPp0mm8z4drQ; Wed, 6 May 2020 13:24:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-164.local (unknown [IPv6:2601:648:8203:2990:a844:2fc3:860e:e3e4]) (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 9F32E280D6; Wed, 6 May 2020 13:24:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r360648 - in head: lib/libvmmapi share/man/man5 share/mk sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel sys/amd64/vmm/io sys/conf sys/modules/vmm tools/build/opti... To: Li-Wen Hsu Cc: src-committers , svn-src-all , svn-src-head References: <202005050002.04502576094544@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Wed, 6 May 2020 06:24:44 -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: 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.30 Precedence: list List-Id: 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, 06 May 2020 13:24:46 -0000 On 5/5/20 7:20 PM, Li-Wen Hsu wrote: > On Tue, May 5, 2020 at 8:02 AM John Baldwin wrote: >> >> Author: jhb >> Date: Tue May 5 00:02:04 2020 >> New Revision: 360648 >> URL: https://svnweb.freebsd.org/changeset/base/360648 > ... >> Added: >> head/sys/amd64/include/vmm_snapshot.h (contents, props changed) >> head/sys/amd64/vmm/vmm_snapshot.c (contents, props changed) >> head/tools/build/options/WITH_BHYVE_SNAPSHOT (contents, props changed) >> head/usr.sbin/bhyve/snapshot.c (contents, props changed) >> head/usr.sbin/bhyve/snapshot.h (contents, props changed) > > These added files all have "THIS SOFTWARE IS PROVIDED BY NETAPP, INC" > in copyright header, but non of the authors look like from NetApp. Is > it intended or it's better to have "THIS SOFTWARE IS PROVIDED BY THE > AUTHOR AND CONTRIBUTORS"? They probably should have the latter, I will check this with the authors. -- John Baldwin From owner-svn-src-head@freebsd.org Wed May 6 15:01: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 6AD0F2C6EF3; Wed, 6 May 2020 15:01:07 +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 49HKXz2D8Zz3Fxs; Wed, 6 May 2020 15:01:07 +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 47A521187; Wed, 6 May 2020 15:01:07 +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 046F17FS058617; Wed, 6 May 2020 15:01:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 046F17UK058616; Wed, 6 May 2020 15:01:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005061501.046F17UK058616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 6 May 2020 15:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360690 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 360690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 15:01:07 -0000 Author: markj Date: Wed May 6 15:01:06 2020 New Revision: 360690 URL: https://svnweb.freebsd.org/changeset/base/360690 Log: Simplify arm64's pmap_bootstrap() a bit. locore constructs an L2 page mapping the kernel and preloaded data starting a KERNBASE (the same as VM_MIN_KERNEL_ADDRESS on arm64). initarm() and pmap_bootstrap() use the preloaded metadata to tell it where it can start allocating from. pmap_bootstrap() currently iterates over the L2 page to find the last valid entry, but doesn't do anything with the result. Remove the loop and zap some now-unused local variables. MFC after: 2 weeks Sponsored by: Juniper Networks, Klara Inc. Differential Revision: https://reviews.freebsd.org/D24559 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed May 6 11:40:32 2020 (r360689) +++ head/sys/arm64/arm64/pmap.c Wed May 6 15:01:06 2020 (r360690) @@ -831,9 +831,7 @@ void pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) { - u_int l1_slot, l2_slot; - pt_entry_t *l2; - vm_offset_t va, freemempos; + vm_offset_t freemempos; vm_offset_t dpcpu, msgbufpv; vm_paddr_t start_pa, pa, min_pa; uint64_t kern_delta; @@ -867,7 +865,7 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_ * Find the minimum physical address. physmap is sorted, * but may contain empty ranges. */ - for (i = 0; i < (physmap_idx * 2); i += 2) { + for (i = 0; i < physmap_idx * 2; i += 2) { if (physmap[i] == physmap[i + 1]) continue; if (physmap[i] <= min_pa) @@ -880,38 +878,14 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_ /* Create a direct map region early so we can use it for pa -> va */ freemempos = pmap_bootstrap_dmap(l1pt, min_pa, freemempos); - va = KERNBASE; start_pa = pa = KERNBASE - kern_delta; /* - * Read the page table to find out what is already mapped. - * This assumes we have mapped a block of memory from KERNBASE - * using a single L1 entry. + * Create the l2 tables up to VM_MAX_KERNEL_ADDRESS. We assume that the + * loader allocated the first and only l2 page table page used to map + * the kernel, preloaded files and module metadata. */ - l2 = pmap_early_page_idx(l1pt, KERNBASE, &l1_slot, &l2_slot); - - /* Sanity check the index, KERNBASE should be the first VA */ - KASSERT(l2_slot == 0, ("The L2 index is non-zero")); - - /* Find how many pages we have mapped */ - for (; l2_slot < Ln_ENTRIES; l2_slot++) { - if ((l2[l2_slot] & ATTR_DESCR_MASK) == 0) - break; - - /* Check locore used L2 blocks */ - KASSERT((l2[l2_slot] & ATTR_DESCR_MASK) == L2_BLOCK, - ("Invalid bootstrap L2 table")); - KASSERT((l2[l2_slot] & ~ATTR_MASK) == pa, - ("Incorrect PA in L2 table")); - - va += L2_SIZE; - pa += L2_SIZE; - } - - va = roundup2(va, L1_SIZE); - - /* Create the l2 tables up to VM_MAX_KERNEL_ADDRESS */ - freemempos = pmap_bootstrap_l2(l1pt, va, freemempos); + freemempos = pmap_bootstrap_l2(l1pt, KERNBASE + L1_SIZE, freemempos); /* And the l3 tables for the early devmap */ freemempos = pmap_bootstrap_l3(l1pt, VM_MAX_KERNEL_ADDRESS - (PMAP_MAPDEV_EARLY_SIZE), freemempos); From owner-svn-src-head@freebsd.org Wed May 6 15:10: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 3B1042C7340; Wed, 6 May 2020 15:10:06 +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 49HKlL0rNHz3Glw; Wed, 6 May 2020 15:10:06 +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 13DA31392; Wed, 6 May 2020 15:10:06 +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 046FA5lT064831; Wed, 6 May 2020 15:10:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 046FA5K6064830; Wed, 6 May 2020 15:10:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005061510.046FA5K6064830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 6 May 2020 15:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360691 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 360691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 15:10:06 -0000 Author: markj Date: Wed May 6 15:10:05 2020 New Revision: 360691 URL: https://svnweb.freebsd.org/changeset/base/360691 Log: arm: Don't enable interrupts in init_secondary(). This has the same reasoning as described in r357048. Remove a stray declaration while here. Reported and tested by: trasz MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/arm/mp_machdep.c Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Wed May 6 15:01:06 2020 (r360690) +++ head/sys/arm/arm/mp_machdep.c Wed May 6 15:10:05 2020 (r360691) @@ -138,7 +138,6 @@ cpu_mp_announce(void) } -extern vm_paddr_t pmap_pa; void init_secondary(int cpu) { @@ -202,8 +201,6 @@ init_secondary(int cpu) } mtx_unlock_spin(&ap_boot_mtx); - - enable_interrupts(PSR_I); loop_counter = 0; while (smp_started == 0) { From owner-svn-src-head@freebsd.org Wed May 6 15:24: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 32D4E2D800D; Wed, 6 May 2020 15:24:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49HL400YRvz3JMC; Wed, 6 May 2020 15:24:32 +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 0E597176C; Wed, 6 May 2020 15:24:32 +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 046FOVaI077392; Wed, 6 May 2020 15:24:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 046FOVwl077391; Wed, 6 May 2020 15:24:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005061524.046FOVwl077391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 6 May 2020 15:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360692 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 360692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 15:24:32 -0000 Author: avg Date: Wed May 6 15:24:31 2020 New Revision: 360692 URL: https://svnweb.freebsd.org/changeset/base/360692 Log: usbhid: add several missing usages from Digitizer page This is applicable to HID in general, not just USB HID. Inspired by: wulf MFC after: 1 week Modified: head/sys/dev/usb/usbhid.h Modified: head/sys/dev/usb/usbhid.h ============================================================================== --- head/sys/dev/usb/usbhid.h Wed May 6 15:10:05 2020 (r360691) +++ head/sys/dev/usb/usbhid.h Wed May 6 15:24:31 2020 (r360692) @@ -174,7 +174,10 @@ struct usb_hid_descriptor { #define HUD_CONTACTCOUNT 0x0054 #define HUD_CONTACT_MAX 0x0055 #define HUD_SCAN_TIME 0x0056 +#define HUD_SURFACE_SWITCH 0x0057 +#define HUD_BUTTONS_SWITCH 0x0058 #define HUD_BUTTON_TYPE 0x0059 +#define HUD_LATENCY_MODE 0x0060 /* Usages, Consumer */ #define HUC_AC_PAN 0x0238 From owner-svn-src-head@freebsd.org Wed May 6 18:13: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 01C932DBBD4; Wed, 6 May 2020 18:13:01 +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 49HPpN6FcTz40pH; Wed, 6 May 2020 18:13:00 +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 B876639ED; Wed, 6 May 2020 18:13:00 +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 046ID0nT086447; Wed, 6 May 2020 18:13:00 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 046ID0q6086446; Wed, 6 May 2020 18:13:00 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005061813.046ID0q6086446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 6 May 2020 18:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360697 - head/contrib/llvm-project/llvm/lib/Target/ARM/MCTargetDesc X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm-project/llvm/lib/Target/ARM/MCTargetDesc X-SVN-Commit-Revision: 360697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 18:13:01 -0000 Author: dim Date: Wed May 6 18:13:00 2020 New Revision: 360697 URL: https://svnweb.freebsd.org/changeset/base/360697 Log: In r358396 I merged llvm upstream commit 2e24219d3, which fixed "error: unsupported relocation on symbol" when assembling arm 'adr' pseudo instructions. However, the upstream commit did not take big-endian arm into account. Applying the same changes to the big-endian handling is straightforward, thanks to Andrew Turner and Peter Smith for the hint. This will also be submitted upstream. MFC after: immediately, since this fix is meant for stable/11 Modified: head/contrib/llvm-project/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp Modified: head/contrib/llvm-project/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp Wed May 6 17:44:17 2020 (r360696) +++ head/contrib/llvm-project/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp Wed May 6 18:13:00 2020 (r360697) @@ -116,26 +116,22 @@ const MCFixupKindInfo &ARMAsmBackend::getFixupKindInfo // ARMFixupKinds.h. // // Name Offset (bits) Size (bits) Flags - {"fixup_arm_ldst_pcrel_12", 0, 32, MCFixupKindInfo::FKF_IsPCRel}, + {"fixup_arm_ldst_pcrel_12", 0, 32, IsPCRelConstant}, {"fixup_t2_ldst_pcrel_12", 0, 32, - MCFixupKindInfo::FKF_IsPCRel | - MCFixupKindInfo::FKF_IsAlignedDownTo32Bits}, - {"fixup_arm_pcrel_10_unscaled", 0, 32, MCFixupKindInfo::FKF_IsPCRel}, - {"fixup_arm_pcrel_10", 0, 32, MCFixupKindInfo::FKF_IsPCRel}, + IsPCRelConstant | MCFixupKindInfo::FKF_IsAlignedDownTo32Bits}, + {"fixup_arm_pcrel_10_unscaled", 0, 32, IsPCRelConstant}, + {"fixup_arm_pcrel_10", 0, 32, IsPCRelConstant}, {"fixup_t2_pcrel_10", 0, 32, MCFixupKindInfo::FKF_IsPCRel | MCFixupKindInfo::FKF_IsAlignedDownTo32Bits}, {"fixup_arm_pcrel_9", 0, 32, MCFixupKindInfo::FKF_IsPCRel}, {"fixup_t2_pcrel_9", 0, 32, - MCFixupKindInfo::FKF_IsPCRel | - MCFixupKindInfo::FKF_IsAlignedDownTo32Bits}, + IsPCRelConstant | MCFixupKindInfo::FKF_IsAlignedDownTo32Bits}, {"fixup_thumb_adr_pcrel_10", 8, 8, - MCFixupKindInfo::FKF_IsPCRel | - MCFixupKindInfo::FKF_IsAlignedDownTo32Bits}, - {"fixup_arm_adr_pcrel_12", 0, 32, MCFixupKindInfo::FKF_IsPCRel}, + IsPCRelConstant | MCFixupKindInfo::FKF_IsAlignedDownTo32Bits}, + {"fixup_arm_adr_pcrel_12", 0, 32, IsPCRelConstant}, {"fixup_t2_adr_pcrel_12", 0, 32, - MCFixupKindInfo::FKF_IsPCRel | - MCFixupKindInfo::FKF_IsAlignedDownTo32Bits}, + IsPCRelConstant | MCFixupKindInfo::FKF_IsAlignedDownTo32Bits}, {"fixup_arm_condbranch", 8, 24, MCFixupKindInfo::FKF_IsPCRel}, {"fixup_arm_uncondbranch", 8, 24, MCFixupKindInfo::FKF_IsPCRel}, {"fixup_t2_condbranch", 0, 32, MCFixupKindInfo::FKF_IsPCRel}, From owner-svn-src-head@freebsd.org Wed May 6 18:38: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 7FD022DC62F; Wed, 6 May 2020 18:38:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49HQN12SfDz422F; Wed, 6 May 2020 18:38:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B6613E39; Wed, 6 May 2020 18:38:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 046Icf5W098981; Wed, 6 May 2020 18:38:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 046IcebT098979; Wed, 6 May 2020 18:38:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005061838.046IcebT098979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 May 2020 18:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360698 - in head: . gnu/usr.bin/binutils X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . gnu/usr.bin/binutils X-SVN-Commit-Revision: 360698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 18:38:41 -0000 Author: emaste Date: Wed May 6 18:38:40 2020 New Revision: 360698 URL: https://svnweb.freebsd.org/changeset/base/360698 Log: binutils: disconnect objdump from the build The in-tree binutils is old and will not be updated. It does not support all archs supported by FreeBSD, and for the archs it does support not all CPU features are supported. Other tools have migrated to copyfree alternatives. Although llvm-objdump is nearly a drop-in replacement for GNU objdump it is missing a few options and has some differences in output format. For now just remove GNU objdump; ports and developers can use a contemporary, maintained version from ports or packages. We can revisit installing llvm-objdump as objdump in the future. PR: 212319 [exp-run] Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7338 Modified: head/ObsoleteFiles.inc head/gnu/usr.bin/binutils/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed May 6 18:13:00 2020 (r360697) +++ head/ObsoleteFiles.inc Wed May 6 18:38:40 2020 (r360698) @@ -36,6 +36,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20200506: GNU objdump 2.17.50 retired +OLD_FILES+=usr/bin/objdump +OLD_FILES+=usr/share/man/man1/objdump.1.gz + # 20200418: Make libauditd private OLD_FILES+=usr/lib/libauditd.a OLD_FILES+=usr/lib/libauditd.so Modified: head/gnu/usr.bin/binutils/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/Makefile Wed May 6 18:13:00 2020 (r360697) +++ head/gnu/usr.bin/binutils/Makefile Wed May 6 18:38:40 2020 (r360698) @@ -7,8 +7,6 @@ SUBDIR= libiberty \ libopcodes SUBDIR.${MK_BINUTILS}+= doc -SUBDIR.${MK_BINUTILS}+= libbinutils -SUBDIR.${MK_BINUTILS}+= objdump # GNU as is used on x86 only, for a few files that cannot be assembled by # Clang IAS. Other archs either use Clang IAS for every assembly file, or @@ -17,9 +15,7 @@ SUBDIR.${MK_BINUTILS}+= objdump SUBDIR.${MK_BINUTILS}+= as .endif -SUBDIR_DEPEND_libbinutils=libbfd # for bfdver.h SUBDIR_DEPEND_as=libbfd libiberty libopcodes -SUBDIR_DEPEND_objdump=libbfd libiberty libbinutils libopcodes .if !make(install) SUBDIR_PARALLEL= From owner-svn-src-head@freebsd.org Wed May 6 18:39: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 CA9A22DC6AD; Wed, 6 May 2020 18:39:56 +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 49HQPS4xgdz429W; Wed, 6 May 2020 18:39:56 +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 A504D3E46; Wed, 6 May 2020 18:39:56 +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 046Idukr099095; Wed, 6 May 2020 18:39:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 046IduWN099094; Wed, 6 May 2020 18:39:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005061839.046IduWN099094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 May 2020 18:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360699 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 360699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 18:39:56 -0000 Author: emaste Date: Wed May 6 18:39:55 2020 New Revision: 360699 URL: https://svnweb.freebsd.org/changeset/base/360699 Log: update WITH_/WITHOUT_BINUTILS descriptions for objdump removal Modified: head/tools/build/options/WITHOUT_BINUTILS head/tools/build/options/WITH_BINUTILS Modified: head/tools/build/options/WITHOUT_BINUTILS ============================================================================== --- head/tools/build/options/WITHOUT_BINUTILS Wed May 6 18:38:40 2020 (r360698) +++ head/tools/build/options/WITHOUT_BINUTILS Wed May 6 18:39:55 2020 (r360699) @@ -1,6 +1,5 @@ .\" $FreeBSD$ Do not build or install GNU -.Xr as 1 and -.Xr objdump 1 +.Xr as 1 as part of the normal system build. Modified: head/tools/build/options/WITH_BINUTILS ============================================================================== --- head/tools/build/options/WITH_BINUTILS Wed May 6 18:38:40 2020 (r360698) +++ head/tools/build/options/WITH_BINUTILS Wed May 6 18:39:55 2020 (r360699) @@ -1,7 +1,4 @@ .\" $FreeBSD$ Build and install GNU .Xr as 1 -on i386 and amd64, -and -.Xr objdump 1 as part of the normal system build. From owner-svn-src-head@freebsd.org Wed May 6 18:40: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 0630F2DC791; Wed, 6 May 2020 18:40:53 +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 49HQQX6STpz42Ll; Wed, 6 May 2020 18:40:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D917A3E6B; Wed, 6 May 2020 18:40:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 046Ieq0I099220; Wed, 6 May 2020 18:40:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 046IeqCL099219; Wed, 6 May 2020 18:40:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005061840.046IeqCL099219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 May 2020 18:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360700 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 360700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 18:40:53 -0000 Author: emaste Date: Wed May 6 18:40:52 2020 New Revision: 360700 URL: https://svnweb.freebsd.org/changeset/base/360700 Log: src.opts.mk: with BINUTILS limited to as it is used on i386 and amd64 only Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed May 6 18:39:55 2020 (r360699) +++ head/share/mk/src.opts.mk Wed May 6 18:40:52 2020 (r360700) @@ -62,7 +62,6 @@ __DEFAULT_YES_OPTIONS = \ AUTHPF \ AUTOFS \ BHYVE \ - BINUTILS \ BLACKLIST \ BLUETOOTH \ BOOT \ @@ -292,9 +291,9 @@ __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GDB .endif .if ${__T} == "amd64" || ${__T} == "i386" -__DEFAULT_YES_OPTIONS+=BINUTILS_BOOTSTRAP +__DEFAULT_YES_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP .else -__DEFAULT_NO_OPTIONS+=BINUTILS_BOOTSTRAP +__DEFAULT_NO_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP .endif .if ${__T:Mriscv*} != "" BROKEN_OPTIONS+=OFED From owner-svn-src-head@freebsd.org Wed May 6 18:43: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 8BFF02DC9ED; Wed, 6 May 2020 18:43:28 +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 49HQTX2wfGz42m0; Wed, 6 May 2020 18:43:28 +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 5FA7B4074; Wed, 6 May 2020 18:43:28 +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 046IhST7005123; Wed, 6 May 2020 18:43:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 046IhSfc005122; Wed, 6 May 2020 18:43:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005061843.046IhSfc005122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 May 2020 18:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360701 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 360701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 18:43:28 -0000 Author: emaste Date: Wed May 6 18:43:27 2020 New Revision: 360701 URL: https://svnweb.freebsd.org/changeset/base/360701 Log: src.conf.5: regen after objdump removal Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed May 6 18:40:52 2020 (r360700) +++ head/share/man/man5/src.conf.5 Wed May 6 18:43:27 2020 (r360701) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd May 4, 2020 +.Dd May 6, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -184,23 +184,19 @@ flag set to indicate that the run-time loader should p processing at process startup rather than on demand. .It Va WITHOUT_BINUTILS Do not build or install GNU -.Xr as 1 and -.Xr objdump 1 +.Xr as 1 as part of the normal system build. .Pp This is a default setting on -arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. +arm/armv6, arm/armv7, arm64/aarch64, mips/mips, mips/mips64, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_BINUTILS Build and install GNU .Xr as 1 -on i386 and amd64, -and -.Xr objdump 1 as part of the normal system build. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mips, mips/mips64, powerpc/powerpc and powerpc/powerpc64. +amd64/amd64 and i386/i386. .It Va WITHOUT_BINUTILS_BOOTSTRAP Do not build GNU binutils as part of the bootstrap process. From owner-svn-src-head@freebsd.org Wed May 6 19:10: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 2F26C2DD2F6; Wed, 6 May 2020 19:10:41 +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 49HR4x0Lgzz43wr; Wed, 6 May 2020 19:10:41 +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 072B9447A; Wed, 6 May 2020 19:10:41 +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 046JAeFC017929; Wed, 6 May 2020 19:10:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 046JAeDJ017925; Wed, 6 May 2020 19:10:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005061910.046JAeDJ017925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 6 May 2020 19:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360702 - in head/contrib/llvm-project/clang: include/clang/Driver lib/CodeGen lib/Driver/ToolChains lib/Frontend X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/contrib/llvm-project/clang: include/clang/Driver lib/CodeGen lib/Driver/ToolChains lib/Frontend X-SVN-Commit-Revision: 360702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 19:10:41 -0000 Author: dim Date: Wed May 6 19:10:39 2020 New Revision: 360702 URL: https://svnweb.freebsd.org/changeset/base/360702 Log: Merge commit 4ca2cad94 from llvm git (by Justin Hibbits): [PowerPC] Add clang -msvr4-struct-return for 32-bit ELF Summary: Change the default ABI to be compatible with GCC. For 32-bit ELF targets other than Linux, Clang now returns small structs in registers r3/r4. This affects FreeBSD, NetBSD, OpenBSD. There is no change for 32-bit Linux, where Clang continues to return all structs in memory. Add clang options -maix-struct-return (to return structs in memory) and -msvr4-struct-return (to return structs in registers) to be compatible with gcc. These options are only for PPC32; reject them on PPC64 and other targets. The options are like -fpcc-struct-return and -freg-struct-return for X86_32, and use similar code. To actually return a struct in registers, coerce it to an integer of the same size. LLVM may optimize the code to remove unnecessary accesses to memory, and will return i32 in r3 or i64 in r3:r4. Fixes PR#40736 Patch by George Koehler! Reviewed By: jhibbits, nemanjai Differential Revision: https://reviews.llvm.org/D73290 Requested by: jhibbits MFC after: 3 days Modified: head/contrib/llvm-project/clang/include/clang/Driver/Options.td head/contrib/llvm-project/clang/lib/CodeGen/TargetInfo.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp head/contrib/llvm-project/clang/lib/Frontend/CompilerInvocation.cpp Modified: head/contrib/llvm-project/clang/include/clang/Driver/Options.td ============================================================================== --- head/contrib/llvm-project/clang/include/clang/Driver/Options.td Wed May 6 18:43:27 2020 (r360701) +++ head/contrib/llvm-project/clang/include/clang/Driver/Options.td Wed May 6 19:10:39 2020 (r360702) @@ -2439,6 +2439,12 @@ def mlongcall: Flag<["-"], "mlongcall">, Group; def mno_longcall : Flag<["-"], "mno-longcall">, Group; +def maix_struct_return : Flag<["-"], "maix-struct-return">, + Group, Flags<[CC1Option]>, + HelpText<"Return all structs in memory (PPC32 only)">; +def msvr4_struct_return : Flag<["-"], "msvr4-struct-return">, + Group, Flags<[CC1Option]>, + HelpText<"Return small structs in registers (PPC32 only)">; def mvx : Flag<["-"], "mvx">, Group; def mno_vx : Flag<["-"], "mno-vx">, Group; Modified: head/contrib/llvm-project/clang/lib/CodeGen/TargetInfo.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/CodeGen/TargetInfo.cpp Wed May 6 18:43:27 2020 (r360701) +++ head/contrib/llvm-project/clang/lib/CodeGen/TargetInfo.cpp Wed May 6 19:10:39 2020 (r360702) @@ -4123,22 +4123,39 @@ namespace { /// PPC32_SVR4_ABIInfo - The 32-bit PowerPC ELF (SVR4) ABI information. class PPC32_SVR4_ABIInfo : public DefaultABIInfo { bool IsSoftFloatABI; + bool IsRetSmallStructInRegABI; CharUnits getParamTypeAlignment(QualType Ty) const; public: - PPC32_SVR4_ABIInfo(CodeGen::CodeGenTypes &CGT, bool SoftFloatABI) - : DefaultABIInfo(CGT), IsSoftFloatABI(SoftFloatABI) {} + PPC32_SVR4_ABIInfo(CodeGen::CodeGenTypes &CGT, bool SoftFloatABI, + bool RetSmallStructInRegABI) + : DefaultABIInfo(CGT), IsSoftFloatABI(SoftFloatABI), + IsRetSmallStructInRegABI(RetSmallStructInRegABI) {} + ABIArgInfo classifyReturnType(QualType RetTy) const; + + void computeInfo(CGFunctionInfo &FI) const override { + if (!getCXXABI().classifyReturnType(FI)) + FI.getReturnInfo() = classifyReturnType(FI.getReturnType()); + for (auto &I : FI.arguments()) + I.info = classifyArgumentType(I.type); + } + Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType Ty) const override; }; class PPC32TargetCodeGenInfo : public TargetCodeGenInfo { public: - PPC32TargetCodeGenInfo(CodeGenTypes &CGT, bool SoftFloatABI) - : TargetCodeGenInfo(new PPC32_SVR4_ABIInfo(CGT, SoftFloatABI)) {} + PPC32TargetCodeGenInfo(CodeGenTypes &CGT, bool SoftFloatABI, + bool RetSmallStructInRegABI) + : TargetCodeGenInfo(new PPC32_SVR4_ABIInfo(CGT, SoftFloatABI, + RetSmallStructInRegABI)) {} + static bool isStructReturnInRegABI(const llvm::Triple &Triple, + const CodeGenOptions &Opts); + int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const override { // This is recovered from gcc output. return 1; // r1 is the dedicated stack pointer @@ -4173,6 +4190,34 @@ CharUnits PPC32_SVR4_ABIInfo::getParamTypeAlignment(Qu return CharUnits::fromQuantity(4); } +ABIArgInfo PPC32_SVR4_ABIInfo::classifyReturnType(QualType RetTy) const { + uint64_t Size; + + // -msvr4-struct-return puts small aggregates in GPR3 and GPR4. + if (isAggregateTypeForABI(RetTy) && IsRetSmallStructInRegABI && + (Size = getContext().getTypeSize(RetTy)) <= 64) { + // System V ABI (1995), page 3-22, specified: + // > A structure or union whose size is less than or equal to 8 bytes + // > shall be returned in r3 and r4, as if it were first stored in the + // > 8-byte aligned memory area and then the low addressed word were + // > loaded into r3 and the high-addressed word into r4. Bits beyond + // > the last member of the structure or union are not defined. + // + // GCC for big-endian PPC32 inserts the pad before the first member, + // not "beyond the last member" of the struct. To stay compatible + // with GCC, we coerce the struct to an integer of the same size. + // LLVM will extend it and return i32 in r3, or i64 in r3:r4. + if (Size == 0) + return ABIArgInfo::getIgnore(); + else { + llvm::Type *CoerceTy = llvm::Type::getIntNTy(getVMContext(), Size); + return ABIArgInfo::getDirect(CoerceTy); + } + } + + return DefaultABIInfo::classifyReturnType(RetTy); +} + // TODO: this implementation is now likely redundant with // DefaultABIInfo::EmitVAArg. Address PPC32_SVR4_ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAList, @@ -4328,6 +4373,25 @@ Address PPC32_SVR4_ABIInfo::EmitVAArg(CodeGenFunction return Result; } +bool PPC32TargetCodeGenInfo::isStructReturnInRegABI( + const llvm::Triple &Triple, const CodeGenOptions &Opts) { + assert(Triple.getArch() == llvm::Triple::ppc); + + switch (Opts.getStructReturnConvention()) { + case CodeGenOptions::SRCK_Default: + break; + case CodeGenOptions::SRCK_OnStack: // -maix-struct-return + return false; + case CodeGenOptions::SRCK_InRegs: // -msvr4-struct-return + return true; + } + + if (Triple.isOSBinFormatELF() && !Triple.isOSLinux()) + return true; + + return false; +} + bool PPC32TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const { @@ -9852,10 +9916,14 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeG return SetCGInfo(new ARMTargetCodeGenInfo(Types, Kind)); } - case llvm::Triple::ppc: + case llvm::Triple::ppc: { + bool IsSoftFloat = + CodeGenOpts.FloatABI == "soft" || getTarget().hasFeature("spe"); + bool RetSmallStructInRegABI = + PPC32TargetCodeGenInfo::isStructReturnInRegABI(Triple, CodeGenOpts); return SetCGInfo( - new PPC32TargetCodeGenInfo(Types, CodeGenOpts.FloatABI == "soft" || - getTarget().hasFeature("spe"))); + new PPC32TargetCodeGenInfo(Types, IsSoftFloat, RetSmallStructInRegABI)); + } case llvm::Triple::ppc64: if (Triple.isOSBinFormatELF()) { PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1; Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Wed May 6 18:43:27 2020 (r360701) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Wed May 6 19:10:39 2020 (r360702) @@ -4421,6 +4421,19 @@ void Clang::ConstructJob(Compilation &C, const JobActi CmdArgs.push_back(A->getValue()); } + if (Arg *A = Args.getLastArg(options::OPT_maix_struct_return, + options::OPT_msvr4_struct_return)) { + if (TC.getArch() != llvm::Triple::ppc) { + D.Diag(diag::err_drv_unsupported_opt_for_target) + << A->getSpelling() << RawTriple.str(); + } else if (A->getOption().matches(options::OPT_maix_struct_return)) { + CmdArgs.push_back("-maix-struct-return"); + } else { + assert(A->getOption().matches(options::OPT_msvr4_struct_return)); + CmdArgs.push_back("-msvr4-struct-return"); + } + } + if (Arg *A = Args.getLastArg(options::OPT_fpcc_struct_return, options::OPT_freg_struct_return)) { if (TC.getArch() != llvm::Triple::x86) { Modified: head/contrib/llvm-project/clang/lib/Frontend/CompilerInvocation.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Frontend/CompilerInvocation.cpp Wed May 6 18:43:27 2020 (r360701) +++ head/contrib/llvm-project/clang/lib/Frontend/CompilerInvocation.cpp Wed May 6 19:10:39 2020 (r360702) @@ -1279,11 +1279,18 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, Arg Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Val; } - if (Arg *A = Args.getLastArg(OPT_fpcc_struct_return, OPT_freg_struct_return)) { - if (A->getOption().matches(OPT_fpcc_struct_return)) { + // X86_32 has -fppc-struct-return and -freg-struct-return. + // PPC32 has -maix-struct-return and -msvr4-struct-return. + if (Arg *A = + Args.getLastArg(OPT_fpcc_struct_return, OPT_freg_struct_return, + OPT_maix_struct_return, OPT_msvr4_struct_return)) { + const Option &O = A->getOption(); + if (O.matches(OPT_fpcc_struct_return) || + O.matches(OPT_maix_struct_return)) { Opts.setStructReturnConvention(CodeGenOptions::SRCK_OnStack); } else { - assert(A->getOption().matches(OPT_freg_struct_return)); + assert(O.matches(OPT_freg_struct_return) || + O.matches(OPT_msvr4_struct_return)); Opts.setStructReturnConvention(CodeGenOptions::SRCK_InRegs); } } From owner-svn-src-head@freebsd.org Wed May 6 22:15: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 9311B2E0E65; Wed, 6 May 2020 22:15:10 +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 49HW9p3Qgkz4GYL; Wed, 6 May 2020 22:15:10 +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 70C286855; Wed, 6 May 2020 22:15:10 +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 046MFAQM035542; Wed, 6 May 2020 22:15:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 046MFAPT035541; Wed, 6 May 2020 22:15:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005062215.046MFAPT035541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 6 May 2020 22:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360710 - in head: share/man/man4 sys/dev/ubsec X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/ubsec X-SVN-Commit-Revision: 360710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 22:15:10 -0000 Author: jhb Date: Wed May 6 22:15:09 2020 New Revision: 360710 URL: https://svnweb.freebsd.org/changeset/base/360710 Log: Deprecate ubsec(4) for FreeBSD 13.0. With the removal of in-tree consumers of DES, Triple DES, and MD5-HMAC, the only algorithm this driver still supports is SHA1-HMAC. This is not very useful as a standalone algorithm (IPsec AH-only with SHA1 would be the only user). This driver has also not been kept up to date with the original driver in OpenBSD which supports a few more cards and AES-CBC on newer cards. The newest card currently supported by this driver was released in 2005. Reviewed by: cem MFC after: 1 week Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24691 Modified: head/share/man/man4/ubsec.4 head/sys/dev/ubsec/ubsec.c Modified: head/share/man/man4/ubsec.4 ============================================================================== --- head/share/man/man4/ubsec.4 Wed May 6 22:13:08 2020 (r360709) +++ head/share/man/man4/ubsec.4 Wed May 6 22:15:09 2020 (r360710) @@ -48,6 +48,15 @@ module at boot time, place the following line in .Bd -literal -offset indent ubsec_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +The majority of crypto algorithms supported by this driver are no longer +used by the kernel in +.Fx 13.0 . .Sh DESCRIPTION The .Nm Modified: head/sys/dev/ubsec/ubsec.c ============================================================================== --- head/sys/dev/ubsec/ubsec.c Wed May 6 22:13:08 2020 (r360709) +++ head/sys/dev/ubsec/ubsec.c Wed May 6 22:15:09 2020 (r360710) @@ -472,6 +472,7 @@ skip_rng: crypto_kregister(sc->sc_cid, CRK_MOD_EXP_CRT, 0); #endif } + gone_in_dev(dev, 13, "Does not support modern crypto algorithms"); return (0); bad4: while (!SIMPLEQ_EMPTY(&sc->sc_freequeue)) { From owner-svn-src-head@freebsd.org Wed May 6 23:28: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 0FDC12E2712; Wed, 6 May 2020 23:28:52 +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 49HXpq6glFz4M51; Wed, 6 May 2020 23:28: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 DBA36755D; Wed, 6 May 2020 23:28: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 046NSptc079153; Wed, 6 May 2020 23:28:51 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 046NSp8x079151; Wed, 6 May 2020 23:28:51 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202005062328.046NSp8x079151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Wed, 6 May 2020 23:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360722 - head/sys/dev/virtio/mmio X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: head/sys/dev/virtio/mmio X-SVN-Commit-Revision: 360722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 23:28:52 -0000 Author: jrtc27 Date: Wed May 6 23:28:51 2020 New Revision: 360722 URL: https://svnweb.freebsd.org/changeset/base/360722 Log: virtio_mmio: Support non-transitional version 2 devices The non-legacy virtio MMIO specification drops the use of PFNs and replaces them with physical addresses. Whilst many implementations are so-called transitional devices, also implementing the legacy specification, TinyEMU[1] does not. Device-specific configuration registers have also changed to being little-endian, and must be accessed using a single aligned access for registers up to 32 bits, and two 32-bit aligned accesses for 64-bit registers. [1] https://bellard.org/tinyemu/ Reviewed by: br, brooks (mentor) Approved by: br, brooks (mentor) Differential Revision: https://reviews.freebsd.org/D24681 Modified: head/sys/dev/virtio/mmio/virtio_mmio.c head/sys/dev/virtio/mmio/virtio_mmio.h Modified: head/sys/dev/virtio/mmio/virtio_mmio.c ============================================================================== --- head/sys/dev/virtio/mmio/virtio_mmio.c Wed May 6 23:23:22 2020 (r360721) +++ head/sys/dev/virtio/mmio/virtio_mmio.c Wed May 6 23:28:51 2020 (r360722) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -76,6 +77,8 @@ static int vtmmio_read_ivar(device_t, device_t, int, u static int vtmmio_write_ivar(device_t, device_t, int, uintptr_t); static uint64_t vtmmio_negotiate_features(device_t, uint64_t); static int vtmmio_with_feature(device_t, uint64_t); +static void vtmmio_set_virtqueue(struct vtmmio_softc *sc, + struct virtqueue *vq, uint32_t size); static int vtmmio_alloc_virtqueues(device_t, int, int, struct vq_alloc_info *); static int vtmmio_setup_intr(device_t, enum intr_type); @@ -223,6 +226,16 @@ vtmmio_attach(device_t dev) return (ENXIO); } + sc->vtmmio_version = vtmmio_read_config_4(sc, VIRTIO_MMIO_VERSION); + if (sc->vtmmio_version < 1 || sc->vtmmio_version > 2) { + device_printf(dev, "Unsupported version: %x\n", + sc->vtmmio_version); + bus_release_resource(dev, SYS_RES_MEMORY, 0, + sc->res[0]); + sc->res[0] = NULL; + return (ENXIO); + } + vtmmio_reset(sc); /* Tell the host we've noticed this device. */ @@ -404,6 +417,46 @@ vtmmio_with_feature(device_t dev, uint64_t feature) return ((sc->vtmmio_features & feature) != 0); } +static void +vtmmio_set_virtqueue(struct vtmmio_softc *sc, struct virtqueue *vq, + uint32_t size) +{ + vm_paddr_t paddr; + + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_NUM, size); +#if 0 + device_printf(dev, "virtqueue paddr 0x%08lx\n", + (uint64_t)paddr); +#endif + if (sc->vtmmio_version == 1) { + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_ALIGN, + VIRTIO_MMIO_VRING_ALIGN); + paddr = virtqueue_paddr(vq); + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_PFN, + paddr >> PAGE_SHIFT); + } else { + paddr = virtqueue_desc_paddr(vq); + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_DESC_LOW, + paddr); + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_DESC_HIGH, + paddr >> 32); + + paddr = virtqueue_avail_paddr(vq); + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_AVAIL_LOW, + paddr); + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_AVAIL_HIGH, + paddr >> 32); + + paddr = virtqueue_used_paddr(vq); + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_USED_LOW, + paddr); + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_USED_HIGH, + paddr >> 32); + + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_READY, 1); + } +} + static int vtmmio_alloc_virtqueues(device_t dev, int flags, int nvqs, struct vq_alloc_info *vq_info) @@ -448,15 +501,7 @@ vtmmio_alloc_virtqueues(device_t dev, int flags, int n break; } - vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_NUM, size); - vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_ALIGN, - VIRTIO_MMIO_VRING_ALIGN); -#if 0 - device_printf(dev, "virtqueue paddr 0x%08lx\n", - (uint64_t)virtqueue_paddr(vq)); -#endif - vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_PFN, - virtqueue_paddr(vq) >> PAGE_SHIFT); + vtmmio_set_virtqueue(sc, vq, size); vqx->vtv_vq = *info->vqai_vq = vq; vqx->vtv_no_intr = info->vqai_intr == NULL; @@ -568,10 +613,54 @@ vtmmio_read_dev_config(device_t dev, bus_size_t offset bus_size_t off; uint8_t *d; int size; + uint64_t low32, high32; sc = device_get_softc(dev); off = VIRTIO_MMIO_CONFIG + offset; + /* + * The non-legacy MMIO specification adds the following restriction: + * + * 4.2.2.2: For the device-specific configuration space, the driver + * MUST use 8 bit wide accesses for 8 bit wide fields, 16 bit wide + * and aligned accesses for 16 bit wide fields and 32 bit wide and + * aligned accesses for 32 and 64 bit wide fields. + * + * The endianness also varies between non-legacy and legacy: + * + * 2.4: Note: The device configuration space uses the little-endian + * format for multi-byte fields. + * + * 2.4.3: Note that for legacy interfaces, device configuration space + * is generally the guest’s native endian, rather than PCI’s + * little-endian. The correct endian-ness is documented for each + * device. + */ + if (sc->vtmmio_version > 1) { + switch (length) { + case 1: + *(uint8_t *)dst = vtmmio_read_config_1(sc, off); + break; + case 2: + *(uint16_t *)dst = + le16toh(vtmmio_read_config_2(sc, off)); + break; + case 4: + *(uint32_t *)dst = + le32toh(vtmmio_read_config_4(sc, off)); + break; + case 8: + low32 = le32toh(vtmmio_read_config_4(sc, off)); + high32 = le32toh(vtmmio_read_config_4(sc, off + 4)); + *(uint64_t *)dst = (high32 << 32) | low32; + break; + default: + panic("%s: invalid length %d\n", __func__, length); + } + + return; + } + for (d = dst; length > 0; d += size, off += size, length -= size) { #ifdef ALLOW_WORD_ALIGNED_ACCESS if (length >= 4) { @@ -601,6 +690,37 @@ vtmmio_write_dev_config(device_t dev, bus_size_t offse sc = device_get_softc(dev); off = VIRTIO_MMIO_CONFIG + offset; + /* + * The non-legacy MMIO specification adds size and alignment + * restrctions. It also changes the endianness from native-endian to + * little-endian. See vtmmio_read_dev_config. + */ + if (sc->vtmmio_version > 1) { + switch (length) { + case 1: + vtmmio_write_config_1(sc, off, *(uint8_t *)src); + break; + case 2: + vtmmio_write_config_2(sc, off, + htole16(*(uint16_t *)src)); + break; + case 4: + vtmmio_write_config_4(sc, off, + htole32(*(uint32_t *)src)); + break; + case 8: + vtmmio_write_config_4(sc, off, + htole32(*(uint64_t *)src)); + vtmmio_write_config_4(sc, off + 4, + htole32((*(uint64_t *)src) >> 32)); + break; + default: + panic("%s: invalid length %d\n", __func__, length); + } + + return; + } + for (s = src; length > 0; s += size, off += size, length -= size) { #ifdef ALLOW_WORD_ALIGNED_ACCESS if (length >= 4) { @@ -685,15 +805,7 @@ vtmmio_reinit_virtqueue(struct vtmmio_softc *sc, int i if (error) return (error); - vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_NUM, size); - vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_ALIGN, - VIRTIO_MMIO_VRING_ALIGN); -#if 0 - device_printf(sc->dev, "virtqueue paddr 0x%08lx\n", - (uint64_t)virtqueue_paddr(vq)); -#endif - vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_PFN, - virtqueue_paddr(vq) >> PAGE_SHIFT); + vtmmio_set_virtqueue(sc, vq, size); return (0); } @@ -719,7 +831,10 @@ vtmmio_free_virtqueues(struct vtmmio_softc *sc) vqx = &sc->vtmmio_vqs[idx]; vtmmio_select_virtqueue(sc, idx); - vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_PFN, 0); + if (sc->vtmmio_version == 1) + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_PFN, 0); + else + vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_READY, 0); virtqueue_free(vqx->vtv_vq); vqx->vtv_vq = NULL; Modified: head/sys/dev/virtio/mmio/virtio_mmio.h ============================================================================== --- head/sys/dev/virtio/mmio/virtio_mmio.h Wed May 6 23:23:22 2020 (r360721) +++ head/sys/dev/virtio/mmio/virtio_mmio.h Wed May 6 23:28:51 2020 (r360722) @@ -44,6 +44,7 @@ struct vtmmio_softc { uint64_t vtmmio_features; uint32_t vtmmio_flags; + uint32_t vtmmio_version; /* This "bus" will only ever have one child. */ device_t vtmmio_child_dev; @@ -64,16 +65,24 @@ int vtmmio_attach(device_t); #define VIRTIO_MMIO_HOST_FEATURES_SEL 0x014 #define VIRTIO_MMIO_GUEST_FEATURES 0x020 #define VIRTIO_MMIO_GUEST_FEATURES_SEL 0x024 -#define VIRTIO_MMIO_GUEST_PAGE_SIZE 0x028 +#define VIRTIO_MMIO_GUEST_PAGE_SIZE 0x028 /* version 1 only */ #define VIRTIO_MMIO_QUEUE_SEL 0x030 #define VIRTIO_MMIO_QUEUE_NUM_MAX 0x034 #define VIRTIO_MMIO_QUEUE_NUM 0x038 -#define VIRTIO_MMIO_QUEUE_ALIGN 0x03c -#define VIRTIO_MMIO_QUEUE_PFN 0x040 +#define VIRTIO_MMIO_QUEUE_ALIGN 0x03c /* version 1 only */ +#define VIRTIO_MMIO_QUEUE_PFN 0x040 /* version 1 only */ +#define VIRTIO_MMIO_QUEUE_READY 0x044 /* requires version 2 */ #define VIRTIO_MMIO_QUEUE_NOTIFY 0x050 #define VIRTIO_MMIO_INTERRUPT_STATUS 0x060 #define VIRTIO_MMIO_INTERRUPT_ACK 0x064 #define VIRTIO_MMIO_STATUS 0x070 +#define VIRTIO_MMIO_QUEUE_DESC_LOW 0x080 /* requires version 2 */ +#define VIRTIO_MMIO_QUEUE_DESC_HIGH 0x084 /* requires version 2 */ +#define VIRTIO_MMIO_QUEUE_AVAIL_LOW 0x090 /* requires version 2 */ +#define VIRTIO_MMIO_QUEUE_AVAIL_HIGH 0x094 /* requires version 2 */ +#define VIRTIO_MMIO_QUEUE_USED_LOW 0x0a0 /* requires version 2 */ +#define VIRTIO_MMIO_QUEUE_USED_HIGH 0x0a4 /* requires version 2 */ +#define VIRTIO_MMIO_CONFIG_GENERATION 0x100 /* requires version 2 */ #define VIRTIO_MMIO_CONFIG 0x100 #define VIRTIO_MMIO_INT_VRING (1 << 0) #define VIRTIO_MMIO_INT_CONFIG (1 << 1) From owner-svn-src-head@freebsd.org Wed May 6 23:31: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 37DD32E29D8; Wed, 6 May 2020 23:31:31 +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 49HXsv0pKCz4MSk; Wed, 6 May 2020 23:31:31 +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 13F3275C1; Wed, 6 May 2020 23:31:31 +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 046NVUcX081641; Wed, 6 May 2020 23:31:30 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 046NVUPW081638; Wed, 6 May 2020 23:31:30 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202005062331.046NVUPW081638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Wed, 6 May 2020 23:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360723 - in head/sys/dev/virtio: balloon console random scsi X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: in head/sys/dev/virtio: balloon console random scsi X-SVN-Commit-Revision: 360723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 06 May 2020 23:31:31 -0000 Author: jrtc27 Date: Wed May 6 23:31:30 2020 New Revision: 360723 URL: https://svnweb.freebsd.org/changeset/base/360723 Log: virtio: Support MMIO bus for all devices The bus is independent of the device, so all devices can be attached to either a PCI bus or an MMIO bus. For example, QEMU's virtio-rng-device gives the MMIO variant of virtio-rng-pci, and is now detected. Reviewed by: andrew, br, brooks (mentor) Approved by: andrew, br, brooks (mentor) Differential Revision: https://reviews.freebsd.org/D24730 Modified: head/sys/dev/virtio/balloon/virtio_balloon.c head/sys/dev/virtio/console/virtio_console.c head/sys/dev/virtio/random/virtio_random.c head/sys/dev/virtio/scsi/virtio_scsi.c Modified: head/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.c Wed May 6 23:28:51 2020 (r360722) +++ head/sys/dev/virtio/balloon/virtio_balloon.c Wed May 6 23:31:30 2020 (r360723) @@ -153,6 +153,8 @@ static driver_t vtballoon_driver = { }; static devclass_t vtballoon_devclass; +DRIVER_MODULE(virtio_balloon, virtio_mmio, vtballoon_driver, + vtballoon_devclass, 0, 0); DRIVER_MODULE(virtio_balloon, virtio_pci, vtballoon_driver, vtballoon_devclass, 0, 0); MODULE_VERSION(virtio_balloon, 1); @@ -160,6 +162,7 @@ MODULE_DEPEND(virtio_balloon, virtio, 1, 1, 1); VIRTIO_SIMPLE_PNPTABLE(virtio_balloon, VIRTIO_ID_BALLOON, "VirtIO Balloon Adapter"); +VIRTIO_SIMPLE_PNPINFO(virtio_mmio, virtio_balloon); VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_balloon); static int Modified: head/sys/dev/virtio/console/virtio_console.c ============================================================================== --- head/sys/dev/virtio/console/virtio_console.c Wed May 6 23:28:51 2020 (r360722) +++ head/sys/dev/virtio/console/virtio_console.c Wed May 6 23:31:30 2020 (r360723) @@ -256,6 +256,8 @@ static driver_t vtcon_driver = { }; static devclass_t vtcon_devclass; +DRIVER_MODULE(virtio_console, virtio_mmio, vtcon_driver, vtcon_devclass, + vtcon_modevent, 0); DRIVER_MODULE(virtio_console, virtio_pci, vtcon_driver, vtcon_devclass, vtcon_modevent, 0); MODULE_VERSION(virtio_console, 1); @@ -263,6 +265,7 @@ MODULE_DEPEND(virtio_console, virtio, 1, 1, 1); VIRTIO_SIMPLE_PNPTABLE(virtio_console, VIRTIO_ID_CONSOLE, "VirtIO Console Adapter"); +VIRTIO_SIMPLE_PNPINFO(virtio_mmio, virtio_console); VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_console); static int Modified: head/sys/dev/virtio/random/virtio_random.c ============================================================================== --- head/sys/dev/virtio/random/virtio_random.c Wed May 6 23:28:51 2020 (r360722) +++ head/sys/dev/virtio/random/virtio_random.c Wed May 6 23:31:30 2020 (r360723) @@ -96,6 +96,8 @@ static driver_t vtrnd_driver = { }; static devclass_t vtrnd_devclass; +DRIVER_MODULE(virtio_random, virtio_mmio, vtrnd_driver, vtrnd_devclass, + vtrnd_modevent, 0); DRIVER_MODULE(virtio_random, virtio_pci, vtrnd_driver, vtrnd_devclass, vtrnd_modevent, 0); MODULE_VERSION(virtio_random, 1); @@ -104,6 +106,7 @@ MODULE_DEPEND(virtio_random, random_device, 1, 1, 1); VIRTIO_SIMPLE_PNPTABLE(virtio_random, VIRTIO_ID_ENTROPY, "VirtIO Entropy Adapter"); +VIRTIO_SIMPLE_PNPINFO(virtio_mmio, virtio_random); VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_random); static int Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Wed May 6 23:28:51 2020 (r360722) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Wed May 6 23:31:30 2020 (r360723) @@ -228,6 +228,8 @@ static driver_t vtscsi_driver = { }; static devclass_t vtscsi_devclass; +DRIVER_MODULE(virtio_scsi, virtio_mmio, vtscsi_driver, vtscsi_devclass, + vtscsi_modevent, 0); DRIVER_MODULE(virtio_scsi, virtio_pci, vtscsi_driver, vtscsi_devclass, vtscsi_modevent, 0); MODULE_VERSION(virtio_scsi, 1); @@ -235,6 +237,7 @@ MODULE_DEPEND(virtio_scsi, virtio, 1, 1, 1); MODULE_DEPEND(virtio_scsi, cam, 1, 1, 1); VIRTIO_SIMPLE_PNPTABLE(virtio_scsi, VIRTIO_ID_SCSI, "VirtIO SCSI Adapter"); +VIRTIO_SIMPLE_PNPINFO(virtio_mmio, virtio_scsi); VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_scsi); static int From owner-svn-src-head@freebsd.org Wed May 6 23:58: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 009CE2E3C1F for ; Wed, 6 May 2020 23:58:06 +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 49HYSX446kz4PGv for ; Wed, 6 May 2020 23:58:04 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: .tMrsL8VM1lHXQP1QD1XvZPA.c2.3hOgHOxwWwSCQi09XDVpsXAd5ewGprIy6L1 bNqzZCaCCdY2_oNp9HMnBiRgfiyaGnEKtxgGWZdWmz1RJk4QhDnh23eirM4m3r.Cp94YkOaV0Uj8 O9awIIh7GssVjPFBgOzK3AQ6OyV5Wg009wwsVB8HZ.P7GFFvF4n1LnY7bJKCHIONZhrfVI7iGHZu F.iq.YkK.5wFY7EpOFv81jf30uZoxZqIsAV5jX.cE0iZvNDn8yh3zdcvPYlgOPz.IwEbFJq47R_7 PUY0Pk6QnDPKq9dROHiEr6hcaBs1cYNFzdE2tYQCGa29cOL_HtpRVCntJltJ9jrsQM7MP1I4a55c T0JLEdVJS9qVFJCyE35Kh9e0.9lqI7eaJyZ2f2L9OhRH.ec7k6aIgeuGbwiCl7guWS8wnRpRj1Bg RhurB93CwUj0tnHEpWh2GUP584a_4ds_HCr1fcWc.VHZFRXN2PtSB8s92qMIzthS9Yk4TSKrb_1s e8OQEyHk2zOlSJ_psMp0Gutl6_U2Z.jtnC.izImKdMyBTvCfEdX4xiIJ7U083wCIpxTEqRQ_jXN6 TiLh0Mxers3xJtQkAkAb32eII10xTvJEg_vcNQn5K6hfi_5Lp6URAFx1t6_SU62sXZZ4_uLjyjF2 xZd8KuAxpPmhFtFEBQ0rfy13B4P4e9NHfLz1SRsJpYpf.YPMU8kvglnsVD7UdUjfthU.fL88pXGD LXXFOoWUOAl06Vyr8cMGqWoH9aTSpr7BmGtvWTU7w4Z_U_Ai0CAObR51iPwT4slwjmbRHst.vwac yKC3IZoKuLFui2oYI1fdiBjAk9z.rtaBaLVjT7OR38SE7HJOCxCG_CMcB8Td.AARjZxj7l1S79Ot ciTVOg6xySj5cNq3fQvUXRggsU5AG8U5OmKz6KfS3qUQIzMuzwonRwUSB_dHtsKAyMWcSt5f1nBp 7sZ0T19os.GFqLkSmQbbDXKeKFLO13UtWQHEreoPW_ZDnDL9UnJ0Mba9uTu26E4wVGDqtagV52tQ s8VsNV0VLej2ISum1AMkBZSMdCYz_vBw6IltGJk0puzOyiblXVhn5I8WyWllgE1RileXEhUjbMuK dvP45LHE1ChrPbSXWyRpIBNkqmpKUZco83BwXUaTJmtksHC4DchQ7h4JFZqeWK9WoF5a7MiVYW0s LlJ_Ov54Q9nLSzZFgXTP5iAD4W4KtYIyolYDjkSBhqxotIY2i03RxPNDqJBHnI86Jepp9lyk0a5k b3xxYVEJ0fPg.o0ILqXANdpq2hMVUKAojQZxthATbCyUNEw_0jQY3S6DNBtrTR08nbynZ.gDhXc. XXZdgQwtOlr4EeOT1TxyJROSIIRELaKQSIuL4p4SMSpazgeSKBXhOkprKZi.UJJQD9BprLa7bqOP zxGyZxjAONZf6EQH51EvguF0u2wPsDIJeeRuyCFsz1.EPpmUO6BFN9p2Xw5OLIemj4iwU Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.gq1.yahoo.com with HTTP; Wed, 6 May 2020 23:58:03 +0000 Received: by smtp408.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 275644a7f42f203160b12da5531da6aa; Wed, 06 May 2020 23:57:58 +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: <121B9B09-141B-4DC3-918B-1E7CFB99E779@yahoo.com> Date: Wed, 6 May 2020 16:57:55 -0700 Cc: Brandon Bergren Content-Transfer-Encoding: quoted-printable Message-Id: <8AAB0462-3FA8-490C-8D8D-7C15B1C9E2DE@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> 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: 49HYSX446kz4PGv X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.05 / 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)[]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; 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(-0.65)[-0.648,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.90)[-0.905,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (5.24), 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)[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.30 Precedence: list List-Id: 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, 06 May 2020 23:58:06 -0000 [This explores process crashes that happen during system shutdown, in a context not having MALLOC_PRODUCTION=3D . So assert failures are reported as the stopping points.] It looks like shutdown -p now, shutdown -r now, and the like can lead some processes to assert during their exit attempt, including a sshd failure (that I've not seen before), rpcbind, and nfsd. I show information about the observed asserts for those below. sshd hit an assert, failing slab =3D=3D extent_slab_get(extent) : (gdb) bt=20 #0 thr_kill () at thr_kill.S:4 #1 0x50927170 in __raise (s=3D6) at /usr/src/lib/libc/gen/raise.c:52 #2 0x50886cc0 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 #3 0x508834b0 in arena_dalloc (tsdn=3D, ptr=3D, tcache=3D, alloc_ctx=3D, = slow_path=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:315 #4 idalloctm (tsdn=3D0x500dd040, ptr=3D0x5008a180, tcache=3D0x500dd160, = alloc_ctx=3D, is_internal=3D, = slow_path=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inli= nes_c.h:118 #5 0x5087b0a4 in ifree (tsd=3D0x500dd040, ptr=3D0x5008a180, = tcache=3D0x500dd160, slow_path=3D) at = jemalloc_jemalloc.c:2590 #6 0x5087acac in __je_free_default (ptr=3D0x5008a180) at = jemalloc_jemalloc.c:2784 #7 0x5087b294 in __free (ptr=3D0x5008a180) at jemalloc_jemalloc.c:2852 #8 0x10029464 in server_accept_loop (config_s=3D, = sock_in=3D, sock_out=3D, = newsock=3D) at /usr/src/crypto/openssh/sshd.c:1185 #9 main (ac=3D, av=3D0xffffde3c) at = /usr/src/crypto/openssh/sshd.c:2009 . . . (gdb) up #2 0x50886cc0 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 67 (void)raise(SIGABRT); (gdb) up #3 0x508834b0 in arena_dalloc (tsdn=3D, ptr=3D, tcache=3D, alloc_ctx=3D, = slow_path=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:315 315 assert(slab =3D=3D extent_slab_get(extent)); (gdb) list 310 rtree_ctx =3D tsd_rtree_ctx(tsdn_tsd(tsdn)); 311 extent_t *extent =3D rtree_extent_read(tsdn, = &extents_rtree, 312 rtree_ctx, (uintptr_t)ptr, true); 313 assert(szind =3D=3D extent_szind_get(extent)); 314 assert(szind < SC_NSIZES); 315 assert(slab =3D=3D extent_slab_get(extent)); 316 } 317=09 318 if (likely(slab)) { 319 /* Small allocation. */ More fully: 285 JEMALLOC_ALWAYS_INLINE void 286 arena_dalloc(tsdn_t *tsdn, void *ptr, tcache_t *tcache, 287 alloc_ctx_t *alloc_ctx, bool slow_path) { 288 assert(!tsdn_null(tsdn) || tcache =3D=3D NULL); 289 assert(ptr !=3D NULL); 290=09 291 if (unlikely(tcache =3D=3D NULL)) { 292 arena_dalloc_no_tcache(tsdn, ptr); 293 return; 294 } 295=09 296 szind_t szind; 297 bool slab; 298 rtree_ctx_t *rtree_ctx; 299 if (alloc_ctx !=3D NULL) { 300 szind =3D alloc_ctx->szind; 301 slab =3D alloc_ctx->slab; 302 assert(szind !=3D SC_NSIZES); 303 } else { 304 rtree_ctx =3D tsd_rtree_ctx(tsdn_tsd(tsdn)); 305 rtree_szind_slab_read(tsdn, &extents_rtree, = rtree_ctx, 306 (uintptr_t)ptr, true, &szind, &slab); 307 } 308=09 309 if (config_debug) { 310 rtree_ctx =3D tsd_rtree_ctx(tsdn_tsd(tsdn)); 311 extent_t *extent =3D rtree_extent_read(tsdn, = &extents_rtree, 312 rtree_ctx, (uintptr_t)ptr, true); 313 assert(szind =3D=3D extent_szind_get(extent)); 314 assert(szind < SC_NSIZES); 315 assert(slab =3D=3D extent_slab_get(extent)); 316 } 317=09 318 if (likely(slab)) { 319 /* Small allocation. */ 320 tcache_dalloc_small(tsdn_tsd(tsdn), tcache, ptr, = szind, 321 slow_path); 322 } else { 323 arena_dalloc_large(tsdn, ptr, tcache, szind, = slow_path); 324 } 325 } rpcbind hit an assert, failing ret =3D=3D sz_size2index_compute(size) : (gdb) bt #0 thr_kill () at thr_kill.S:4 #1 0x502f2170 in __raise (s=3D6) at /usr/src/lib/libc/gen/raise.c:52 #2 0x50251d04 in abort () at /usr/src/lib/libc/stdlib/abort.c:79 #3 0x5024f260 in sz_size2index_lookup (size=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:159 #4 sz_size2index (size=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:166 #5 imalloc_body (sopts=3D0xffffb360, dopts=3D0xffffb340, = tsd=3D0x5009a018) at jemalloc_jemalloc.c:2066 #6 0x50244874 in imalloc (sopts=3D0xffffb360, dopts=3D0xffffb340) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:331 #7 0x50244fe8 in __calloc (num=3D1, size=3D96) at = jemalloc_jemalloc.c:2498 #8 0x50265690 in svc_xprt_alloc () at /usr/src/lib/libc/rpc/svc.c:541 #9 0x502635f4 in makefd_xprt (fd=3D14, sendsize=3D9000, recvsize=3D9000) = at /usr/src/lib/libc/rpc/svc_vc.c:250 #10 0x502644b4 in rendezvous_request (xprt=3D0x5004c000, msg=3D) at /usr/src/lib/libc/rpc/svc_vc.c:315 #11 0x50265a98 in svc_getreq_common (fd=3D) at = /usr/src/lib/libc/rpc/svc.c:640 #12 0x50265d1c in svc_getreq_poll (pfdp=3D, pollretval=3D1)= at /usr/src/lib/libc/rpc/svc.c:739 #13 0x10018568 in my_svc_run () at = /usr/src/usr.sbin/rpcbind/rpcb_svc_com.c:1167 #14 0x10014ad8 in main (argc=3D, argv=3D) = at /usr/src/usr.sbin/rpcbind/rpcbind.c:250 (gdb) up 3 #3 0x5024f260 in sz_size2index_lookup (size=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:159 159 assert(ret =3D=3D sz_size2index_compute(size)); (gdb) print ret $1 =3D 0 154 JEMALLOC_ALWAYS_INLINE szind_t 155 sz_size2index_lookup(size_t size) { 156 assert(size <=3D SC_LOOKUP_MAXCLASS); 157 szind_t ret =3D (sz_size2index_tab[(size + (ZU(1) << = SC_LG_TINY_MIN) - 1) 158 >> SC_LG_TINY_MIN]); 159 assert(ret =3D=3D sz_size2index_compute(size)); 160 return ret; 161 } nfsd hit an assert, failing ret =3D=3D sz_size2index_compute(size) (also, but a different caller of sz_size2index): (gdb) bt #0 thr_kill () at thr_kill.S:4 #1 0x502b2170 in __raise (s=3D6) at /usr/src/lib/libc/gen/raise.c:52 #2 0x50211cc0 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 #3 0x50206104 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=3D0x50094018, ptr=3D0x50041028, tcache=3D0x50094138, = slow_path=3D) at jemalloc_jemalloc.c:2583 #6 0x50205cac in __je_free_default (ptr=3D0x50041028) at = jemalloc_jemalloc.c:2784 #7 0x50206294 in __free (ptr=3D0x50041028) at jemalloc_jemalloc.c:2852 #8 0x50287ec8 in ns_src_free (src=3D0x50329004, srclistsize=3D) at /usr/src/lib/libc/net/nsdispatch.c:452 #9 ns_dbt_free (dbt=3D0x50329000) at = /usr/src/lib/libc/net/nsdispatch.c:436 #10 vector_free (vec=3D0x50329000, count=3D, esize=3D12, = free_elem=3D) at /usr/src/lib/libc/net/nsdispatch.c:253 #11 nss_atexit () at /usr/src/lib/libc/net/nsdispatch.c:578 #12 0x5028d958 in __cxa_finalize (dso=3D0x0) at = /usr/src/lib/libc/stdlib/atexit.c:240 #13 0x502117f8 in exit (status=3D0) at = /usr/src/lib/libc/stdlib/exit.c:74 #14 0x10013f9c in child_cleanup (signo=3D) at = /usr/src/usr.sbin/nfsd/nfsd.c:969 #15 #16 0x00000000 in ?? () (gdb) up 3 #3 0x50206104 in sz_index2size_lookup (index=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:200 200 assert(ret =3D=3D sz_index2size_compute(index)); (ret is optimized out.) 197 JEMALLOC_ALWAYS_INLINE size_t 198 sz_index2size_lookup(szind_t index) { 199 size_t ret =3D (size_t)sz_index2size_tab[index]; 200 assert(ret =3D=3D sz_index2size_compute(index)); 201 return ret; 202 } Booting and immediately trying something like: service nfsd stop did not lead to a failure. But may be after a while it would and be less drastic than a reboot or power down. =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 Thu May 7 07:46: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 BCECA13ACA4 for ; Thu, 7 May 2020 07:46:40 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic315-8.consmr.mail.gq1.yahoo.com (sonic315-8.consmr.mail.gq1.yahoo.com [98.137.65.32]) (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 49HlsC2BT6z3FJR for ; Thu, 7 May 2020 07:46:39 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: OPNsNFcVM1lg_qAnMTDQTK3p6D7_v8d4a1hkBTBFATb9D8EdW0fAtSiyXqJ_CmM cC.GFKzJu6vWWOjImpl4nGd10z5jcwXRE4L_Zr3b.DPcoxvN6IhM_G._7lnBVJjz9648dLc9jexF 88y8_cXMAv5Hzl3H3sk14v8aqNLLWqPcjXLWmL_sWASxHG4ypnCqrDY8f9ErNDPy8rMrXjYFm.oV zXp1g3oynvSj3CPH5lvDZSbW_FHh_u5SSBuZAwBwEJPOZKXJ5n6d7fWQnWds0zoPMhLx37njt4RB 2tylxDS5OVSvqRO.LFRvLdQFynLF7QyAfwfpcidUu0Eu9WQkqdsrcFB7VjEeB_.xFFVkjwe.USmE flW3X0xWiZtx9qIUdwx7br59WvcMQzmeg_cWGFm_Y68hz6scsIONmz5l5LuvvYoCi65qNuB3PkQ4 ZxJP0quX2TFsJ7EYkvOSBrVISRtgGRj4yyV_7CIVm7doZz14jL1K04qtx22O26ym4aHszXrgNXVI C9Khdn6yqiWdJFIIjV6Ftz5PpuM_D8KaMqQSHKtDeD1Fd6fbQJXb.YMLHyjFvHEYVvNKMXfhamFM rEUizUep4d4jwJemX6RVG1C1SCbdO3VQlkq3Ege.fTMTHhrbmlEBCWXLJQQ6vQ1_AkheZFBKl5Ja QTVSXsuCnRIgrf4Sfj.pb5UDAjIlHLx2hpVQo.H.xFz3CpHrQU.46Oog8HYvLCZW.qlacrf3V.3P 9fWbk5tD5wYtkkIhtTcMt05EZGZOUyafwcOZnqsT7KsYbvk_lTTJsA5.AOpU7LykWndBZ2iw_YBZ 7Zx7b8c8Hlmdh0Xk0iTih77k2jSBxhDtFptkEGRzzAnx9FbN1TjURg24VkSnHmjFuYaK6kugFAr7 aln_UFbHTq3Z1JzdzISv3qZDhAzS8WCQmau2ctWHqezQvvKcXeOMDsRaYanFPtCYClbeUNd7MBgx 7jurHTue0kNeQl5nCWrUkNFemFYCXwL8jGGg06parSo9RXv2cYNafsr7FXBr1L3L9Dv6rECpnhU7 nWdtoPD6ayz6WNkjXadg0Pa9.dkTj7WPeguLP_X04u3ne1Epb.aH3bM6nmu8XhyVi0uBNMdocGW2 Qc_Ew2E6OQacImCkp8xkF4HtOmqhEwRWoyI7IGBz6vaRQBwtH5MnK3a1u3Sl0kQFew9qCBeQQTC9 QURNKJRimayT2l55hHSo32SmQ1PKeNDunnJ2s_dGsgPM.3WGHWw8P5fTftVy4aUP61vaVjKZkxnV wOPcZwnnyaqFpUt52YMNRy_r3WCIXGXmdywPo5HqjeESQSKOrZJl4wtI8SCgTC7C31F58Si.Y4Hi KV8U06tHi8ewwIHnLchtdcpMxYLBdZ3_EcO5IKJYqubtNJuvwUQfLxEA2n3cQM33BgnZ_dVYCGvA MFCn73Vdfk6ZK9f5X.lo- Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Thu, 7 May 2020 07:46:37 +0000 Received: by smtp403.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 2d65ee9bbf6f83b7a0d0434cbd6c20e4; Thu, 07 May 2020 07:46:32 +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: <8AAB0462-3FA8-490C-8D8D-7C15B1C9E2DE@yahoo.com> Date: Thu, 7 May 2020 00:46:30 -0700 Cc: Brandon Bergren , Justin Hibbits Content-Transfer-Encoding: quoted-printable Message-Id: <18E62746-80DB-4195-977D-4FF32D0129EE@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> 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: 49HlsC2BT6z3FJR X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.15 / 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.72)[-0.716,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.93)[-0.929,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (4.75), 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)[32.65.137.98.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[32.65.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.30 Precedence: list List-Id: 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, 07 May 2020 07:46:40 -0000 [__je_sz_size2index_tab seems messed up in 2 of the asserting contexts: first 384 are zero in both. More before that is also messed up (all zero). I show the details later below.] On 2020-May-6, at 16:57, Mark Millard wrote: > [This explores process crashes that happen during system > shutdown, in a context not having MALLOC_PRODUCTION=3D . > So assert failures are reported as the stopping points.] >=20 > It looks like shutdown -p now, shutdown -r now, and the > like can lead some processes to assert during their exit > attempt, including a sshd failure (that I've not seen > before), rpcbind, and nfsd. I show information about the > observed asserts for those below. >=20 >=20 > sshd hit an assert, failing slab =3D=3D extent_slab_get(extent) : >=20 > (gdb) bt=20 > #0 thr_kill () at thr_kill.S:4 > #1 0x50927170 in __raise (s=3D6) at /usr/src/lib/libc/gen/raise.c:52 > #2 0x50886cc0 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 > #3 0x508834b0 in arena_dalloc (tsdn=3D, ptr=3D, tcache=3D, alloc_ctx=3D, = slow_path=3D) > at = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:315 > #4 idalloctm (tsdn=3D0x500dd040, ptr=3D0x5008a180, tcache=3D0x500dd160,= alloc_ctx=3D, is_internal=3D, = slow_path=3D) > at = /usr/src/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inli= nes_c.h:118 > #5 0x5087b0a4 in ifree (tsd=3D0x500dd040, ptr=3D0x5008a180, = tcache=3D0x500dd160, slow_path=3D) at = jemalloc_jemalloc.c:2590 > #6 0x5087acac in __je_free_default (ptr=3D0x5008a180) at = jemalloc_jemalloc.c:2784 > #7 0x5087b294 in __free (ptr=3D0x5008a180) at = jemalloc_jemalloc.c:2852 > #8 0x10029464 in server_accept_loop (config_s=3D, = sock_in=3D, sock_out=3D, = newsock=3D) at /usr/src/crypto/openssh/sshd.c:1185 > #9 main (ac=3D, av=3D0xffffde3c) at = /usr/src/crypto/openssh/sshd.c:2009 >=20 > . . . > (gdb) up > #2 0x50886cc0 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 > 67 (void)raise(SIGABRT); > (gdb) up > #3 0x508834b0 in arena_dalloc (tsdn=3D, ptr=3D, tcache=3D, alloc_ctx=3D, = slow_path=3D) > at = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:315 > 315 assert(slab =3D=3D extent_slab_get(extent)); >=20 > (gdb) list > 310 rtree_ctx =3D tsd_rtree_ctx(tsdn_tsd(tsdn)); > 311 extent_t *extent =3D rtree_extent_read(tsdn, = &extents_rtree, > 312 rtree_ctx, (uintptr_t)ptr, true); > 313 assert(szind =3D=3D extent_szind_get(extent)); > 314 assert(szind < SC_NSIZES); > 315 assert(slab =3D=3D extent_slab_get(extent)); > 316 } > 317=09 > 318 if (likely(slab)) { > 319 /* Small allocation. */ >=20 > More fully: >=20 > 285 JEMALLOC_ALWAYS_INLINE void > 286 arena_dalloc(tsdn_t *tsdn, void *ptr, tcache_t *tcache, > 287 alloc_ctx_t *alloc_ctx, bool slow_path) { > 288 assert(!tsdn_null(tsdn) || tcache =3D=3D NULL); > 289 assert(ptr !=3D NULL); > 290=09 > 291 if (unlikely(tcache =3D=3D NULL)) { > 292 arena_dalloc_no_tcache(tsdn, ptr); > 293 return; > 294 } > 295=09 > 296 szind_t szind; > 297 bool slab; > 298 rtree_ctx_t *rtree_ctx; > 299 if (alloc_ctx !=3D NULL) { > 300 szind =3D alloc_ctx->szind; > 301 slab =3D alloc_ctx->slab; > 302 assert(szind !=3D SC_NSIZES); > 303 } else { > 304 rtree_ctx =3D tsd_rtree_ctx(tsdn_tsd(tsdn)); > 305 rtree_szind_slab_read(tsdn, &extents_rtree, = rtree_ctx, > 306 (uintptr_t)ptr, true, &szind, &slab); > 307 } > 308=09 > 309 if (config_debug) { > 310 rtree_ctx =3D tsd_rtree_ctx(tsdn_tsd(tsdn)); > 311 extent_t *extent =3D rtree_extent_read(tsdn, = &extents_rtree, > 312 rtree_ctx, (uintptr_t)ptr, true); > 313 assert(szind =3D=3D extent_szind_get(extent)); > 314 assert(szind < SC_NSIZES); > 315 assert(slab =3D=3D extent_slab_get(extent)); > 316 } > 317=09 > 318 if (likely(slab)) { > 319 /* Small allocation. */ > 320 tcache_dalloc_small(tsdn_tsd(tsdn), tcache, ptr, = szind, > 321 slow_path); > 322 } else { > 323 arena_dalloc_large(tsdn, ptr, tcache, szind, = slow_path); > 324 } > 325 } The following are only shown for contrast with the later cases of lots of zeros showing up where below shows non-zero values (taken from sshd.core, which failed differently): (gdb) x/4x __je_arenas+16368/4 0x50981ab0 <__je_arenas+16368>: 0x00000000 0x00000000 = 0x00000000 0x00000009 (gdb) print/x __je_arenas_lock=20 $1 =3D {{{prof_data =3D {tot_wait_time =3D {ns =3D 0x0}, max_wait_time =3D= {ns =3D 0x0}, n_wait_times =3D 0x0, n_spin_acquired =3D 0x0, max_n_thds = =3D 0x0, n_waiting_thds =3D {repr =3D 0x0}, n_owner_switches =3D 0x0,=20 prev_owner =3D 0x0, n_lock_ops =3D 0x0}, lock =3D 0x5008bf00, = postponed_next =3D 0x50974070, locked =3D {repr =3D 0x0}}}, witness =3D = {name =3D 0x50760b04, rank =3D 0x3, comp =3D 0x0, opaque =3D 0x0, link =3D= { qre_next =3D 0x50981b10, qre_prev =3D 0x50981b10}}, lock_order =3D = 0x0} (gdb) print/x __je_narenas_auto $2 =3D 0x8 (gdb) print/x malloc_conf $3 =3D 0x0 (gdb) print/x __je_ncpus $4 =3D 0x2 (gdb) print/x __je_manual_arena_base $5 =3D 0x9 (gdb) print/x __je_sz_pind2sz_tab=20 $6 =3D {0x1000, 0x2000, 0x3000, 0x4000, 0x5000, 0x6000, 0x7000, 0x8000, = 0xa000, 0xc000, 0xe000, 0x10000, 0x14000, 0x18000, 0x1c000, 0x20000, = 0x28000, 0x30000, 0x38000, 0x40000, 0x50000, 0x60000,=20 0x70000, 0x80000, 0xa0000, 0xc0000, 0xe0000, 0x100000, 0x140000, = 0x180000, 0x1c0000, 0x200000, 0x280000, 0x300000, 0x380000, 0x400000, = 0x500000, 0x600000, 0x700000, 0x800000, 0xa00000, 0xc00000,=20 0xe00000, 0x1000000, 0x1400000, 0x1800000, 0x1c00000, 0x2000000, = 0x2800000, 0x3000000, 0x3800000, 0x4000000, 0x5000000, 0x6000000, = 0x7000000, 0x8000000, 0xa000000, 0xc000000, 0xe000000,=20 0x10000000, 0x14000000, 0x18000000, 0x1c000000, 0x20000000, = 0x28000000, 0x30000000, 0x38000000, 0x40000000, 0x50000000, 0x60000000, = 0x70000000, 0x70001000} (gdb) print/x __je_sz_index2size_tab $7 =3D {0x8, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, 0xa0, 0xc0, = 0xe0, 0x100, 0x140, 0x180, 0x1c0, 0x200, 0x280, 0x300, 0x380, 0x400, = 0x500, 0x600, 0x700, 0x800, 0xa00, 0xc00, 0xe00, 0x1000,=20 0x1400, 0x1800, 0x1c00, 0x2000, 0x2800, 0x3000, 0x3800, 0x4000, = 0x5000, 0x6000, 0x7000, 0x8000, 0xa000, 0xc000, 0xe000, 0x10000, = 0x14000, 0x18000, 0x1c000, 0x20000, 0x28000, 0x30000, 0x38000,=20 0x40000, 0x50000, 0x60000, 0x70000, 0x80000, 0xa0000, 0xc0000, = 0xe0000, 0x100000, 0x140000, 0x180000, 0x1c0000, 0x200000, 0x280000, = 0x300000, 0x380000, 0x400000, 0x500000, 0x600000, 0x700000,=20 0x800000, 0xa00000, 0xc00000, 0xe00000, 0x1000000, 0x1400000, = 0x1800000, 0x1c00000, 0x2000000, 0x2800000, 0x3000000, 0x3800000, = 0x4000000, 0x5000000, 0x6000000, 0x7000000, 0x8000000, 0xa000000,=20 0xc000000, 0xe000000, 0x10000000, 0x14000000, 0x18000000, 0x1c000000, = 0x20000000, 0x28000000, 0x30000000, 0x38000000, 0x40000000, 0x50000000, = 0x60000000, 0x70000000} (gdb) print/x __je_sz_size2index_tab $2 =3D {0x0, 0x0, 0x1, 0x2, 0x2, 0x3, 0x3, 0x4, 0x4, 0x5, 0x5, 0x6, 0x6, = 0x7, 0x7, 0x8, 0x8, 0x9, 0x9, 0x9, 0x9, 0xa, 0xa, 0xa, 0xa, 0xb, 0xb, = 0xb, 0xb, 0xc, 0xc, 0xc, 0xc, 0xd, 0xd, 0xd, 0xd, 0xd,=20 0xd, 0xd, 0xd, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xf, 0xf, 0xf, = 0xf, 0xf, 0xf, 0xf, 0xf, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, = 0x11 , 0x12 ,=20 0x13 , 0x14 , 0x15 , 0x16 , 0x17 , 0x18 , 0x19 ,=20 0x1a , 0x1b , 0x1c } > rpcbind hit an assert, failing ret =3D=3D sz_size2index_compute(size) = : >=20 > (gdb) bt > #0 thr_kill () at thr_kill.S:4 > #1 0x502f2170 in __raise (s=3D6) at /usr/src/lib/libc/gen/raise.c:52 > #2 0x50251d04 in abort () at /usr/src/lib/libc/stdlib/abort.c:79 > #3 0x5024f260 in sz_size2index_lookup (size=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:159 > #4 sz_size2index (size=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:166 > #5 imalloc_body (sopts=3D0xffffb360, dopts=3D0xffffb340, = tsd=3D0x5009a018) at jemalloc_jemalloc.c:2066 > #6 0x50244874 in imalloc (sopts=3D0xffffb360, dopts=3D0xffffb340) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:331 > #7 0x50244fe8 in __calloc (num=3D1, size=3D96) at = jemalloc_jemalloc.c:2498 > #8 0x50265690 in svc_xprt_alloc () at /usr/src/lib/libc/rpc/svc.c:541 > #9 0x502635f4 in makefd_xprt (fd=3D14, sendsize=3D9000, = recvsize=3D9000) at /usr/src/lib/libc/rpc/svc_vc.c:250 > #10 0x502644b4 in rendezvous_request (xprt=3D0x5004c000, = msg=3D) at /usr/src/lib/libc/rpc/svc_vc.c:315 > #11 0x50265a98 in svc_getreq_common (fd=3D) at = /usr/src/lib/libc/rpc/svc.c:640 > #12 0x50265d1c in svc_getreq_poll (pfdp=3D, = pollretval=3D1) at /usr/src/lib/libc/rpc/svc.c:739 > #13 0x10018568 in my_svc_run () at = /usr/src/usr.sbin/rpcbind/rpcb_svc_com.c:1167 > #14 0x10014ad8 in main (argc=3D, argv=3D) at /usr/src/usr.sbin/rpcbind/rpcbind.c:250 > (gdb) up 3 > #3 0x5024f260 in sz_size2index_lookup (size=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:159 > 159 assert(ret =3D=3D sz_size2index_compute(size)); > (gdb) print ret > $1 =3D 0 >=20 > 154 JEMALLOC_ALWAYS_INLINE szind_t > 155 sz_size2index_lookup(size_t size) { > 156 assert(size <=3D SC_LOOKUP_MAXCLASS); > 157 szind_t ret =3D (sz_size2index_tab[(size + (ZU(1) << = SC_LG_TINY_MIN) - 1) > 158 >> SC_LG_TINY_MIN]); > 159 assert(ret =3D=3D sz_size2index_compute(size)); > 160 return ret; > 161 } gdb reports for sz_size2index_tab (really JEMALLOC_N(sz_size2index_tab), i.e., __je_sz_size2index_tab): (gdb) print/x __je_sz_size2index_tab $1 =3D {0x0 , 0x1a, 0x1b , 0x1c = } Also: (gdb) x/4x __je_arenas+16368/4 0x5034cab0 <__je_arenas+16368>: 0x00000000 0x00000000 = 0x00000000 0x00000000 (gdb) print/x __je_arenas_lock = =20 $8 =3D {{{prof_data =3D {tot_wait_time =3D {ns =3D 0x0}, max_wait_time =3D= {ns =3D 0x0}, n_wait_times =3D 0x0, n_spin_acquired =3D 0x0, max_n_thds = =3D 0x0, n_waiting_thds =3D {repr =3D 0x0}, n_owner_switches =3D 0x0,=20 prev_owner =3D 0x0, n_lock_ops =3D 0x0}, lock =3D 0x0, = postponed_next =3D 0x0, locked =3D {repr =3D 0x0}}}, witness =3D {name =3D= 0x0, rank =3D 0x0, comp =3D 0x0, opaque =3D 0x0, link =3D {qre_next =3D = 0x0,=20 qre_prev =3D 0x0}}, lock_order =3D 0x0} (gdb) print/x __je_narenas_auto $9 =3D 0x0 (gdb) print/x malloc_conf =20 $10 =3D 0x0 (gdb) print/x __je_ncpus=20 $11 =3D 0x0 (gdb) print/x __je_manual_arena_base $12 =3D 0x0 (gdb) print/x __je_sz_pind2sz_tab =20 $13 =3D {0x0 } (gdb) print/x __je_sz_index2size_tab $14 =3D {0x0 } > nfsd hit an assert, failing ret =3D=3D sz_size2index_compute(size) [Correction: That should have referenced sz_index2size_lookup(index).] > (also, but a different caller of sz_size2index): [Correction: The "also" comment should be ignored: sz_index2size_lookup(index) is referenced below.] >=20 > (gdb) bt > #0 thr_kill () at thr_kill.S:4 > #1 0x502b2170 in __raise (s=3D6) at /usr/src/lib/libc/gen/raise.c:52 > #2 0x50211cc0 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 > #3 0x50206104 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=3D0x50094018, ptr=3D0x50041028, tcache=3D0x50094138, = slow_path=3D) at jemalloc_jemalloc.c:2583 > #6 0x50205cac in __je_free_default (ptr=3D0x50041028) at = jemalloc_jemalloc.c:2784 > #7 0x50206294 in __free (ptr=3D0x50041028) at = jemalloc_jemalloc.c:2852 > #8 0x50287ec8 in ns_src_free (src=3D0x50329004, = srclistsize=3D) at /usr/src/lib/libc/net/nsdispatch.c:452 > #9 ns_dbt_free (dbt=3D0x50329000) at = /usr/src/lib/libc/net/nsdispatch.c:436 > #10 vector_free (vec=3D0x50329000, count=3D, esize=3D12, = free_elem=3D) at /usr/src/lib/libc/net/nsdispatch.c:253 > #11 nss_atexit () at /usr/src/lib/libc/net/nsdispatch.c:578 > #12 0x5028d958 in __cxa_finalize (dso=3D0x0) at = /usr/src/lib/libc/stdlib/atexit.c:240 > #13 0x502117f8 in exit (status=3D0) at = /usr/src/lib/libc/stdlib/exit.c:74 > #14 0x10013f9c in child_cleanup (signo=3D) at = /usr/src/usr.sbin/nfsd/nfsd.c:969 > #15 > #16 0x00000000 in ?? () >=20 > (gdb) up 3 > #3 0x50206104 in sz_index2size_lookup (index=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:200 > 200 assert(ret =3D=3D sz_index2size_compute(index)); >=20 > (ret is optimized out.) >=20 > 197 JEMALLOC_ALWAYS_INLINE size_t > 198 sz_index2size_lookup(szind_t index) { > 199 size_t ret =3D (size_t)sz_index2size_tab[index]; > 200 assert(ret =3D=3D sz_index2size_compute(index)); > 201 return ret; > 202 } (gdb) print/x __je_sz_index2size_tab $3 =3D {0x0 } Also: (gdb) x/4x __je_arenas+16368/4 0x5030cab0 <__je_arenas+16368>: 0x00000000 0x00000000 = 0x00000000 0x00000000 (gdb) print/x __je_arenas_lock = =20 $8 =3D {{{prof_data =3D {tot_wait_time =3D {ns =3D 0x0}, max_wait_time =3D= {ns =3D 0x0}, n_wait_times =3D 0x0, n_spin_acquired =3D 0x0, max_n_thds = =3D 0x0, n_waiting_thds =3D {repr =3D 0x0}, n_owner_switches =3D 0x0,=20 prev_owner =3D 0x0, n_lock_ops =3D 0x0}, lock =3D 0x0, = postponed_next =3D 0x0, locked =3D {repr =3D 0x0}}}, witness =3D {name =3D= 0x0, rank =3D 0x0, comp =3D 0x0, opaque =3D 0x0, link =3D {qre_next =3D = 0x0,=20 qre_prev =3D 0x0}}, lock_order =3D 0x0} (gdb) print/x __je_narenas_auto $9 =3D 0x0 (gdb) print/x malloc_conf =20 $10 =3D 0x0 (gdb) print/x __je_ncpus=20 $11 =3D 0x0 (gdb) print/x __je_manual_arena_base $12 =3D 0x0 (gdb) print/x __je_sz_pind2sz_tab =20 $13 =3D {0x0 } (gdb) print/x __je_sz_size2index_tab $1 =3D {0x0 , 0x1a, 0x1b , 0x1c = } > Booting and immediately trying something like: >=20 > service nfsd stop >=20 > did not lead to a failure. But may be after > a while it would and be less drastic than a > reboot or power down. More detail: So, for rpcbind and nfds at some point a large part of __je_sz_size2index_tab is being stomped on, as is all of __je_sz_index2size_tab and more. For rpcbind, the following area is zero but in a live process is not all-zero (I show the partially non-zero live-process context instead of the all-zero .core file content): 0x5034cab0 <__je_arenas+16368>: 0x00000000 0x00000000 = 0x00000000 0x00000009 0x5034cac0 <__je_arenas_lock>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5034cad0 <__je_arenas_lock+16>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5034cae0 <__je_arenas_lock+32>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5034caf0 <__je_arenas_lock+48>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5034cb00 <__je_arenas_lock+64>: 0x00000000 0x5033f070 = 0x00000000 0x00000000 0x5034cb10 <__je_arenas_lock+80>: 0x5012bb04 0x00000003 = 0x00000000 0x00000000 0x5034cb20 <__je_arenas_lock+96>: 0x5034cb10 0x5034cb10 = 0x00000000 0x00000000 Then the memory in the crash continues to be zero until: 0x5034d000 <__je_sz_size2index_tab+384>: 0x1a1b1b1b = 0x1b1b1b1b 0x1b1b1b1b 0x1b1b1b1b Notice the interesting page boundary for where non-zero is first available again! Between __je_arenas_lock and __je_sz_size2index_tab are: 0x5034cb30 __je_narenas_auto 0x5034cb38 malloc_conf 0x5034cb3c __je_ncpus 0x5034cb40 __je_manual_arena_base 0x5034cb80 __je_sz_pind2sz_tab 0x5034ccc0 __je_sz_index2size_tab 0x5034ce80 __je_sz_size2index_tab For nfsd, it is similar (again showing the partially non-zero live process context instead of the all-zeros from the .core file): 0x5030cab0 <__je_arenas+16368>: 0x00000000 0x00000000 = 0x00000000 0x00000009 0x5030cac0 <__je_arenas_lock>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5030cad0 <__je_arenas_lock+16>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5030cae0 <__je_arenas_lock+32>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5030caf0 <__je_arenas_lock+48>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5030cb00 <__je_arenas_lock+64>: 0x00000000 0x502ff070 = 0x00000000 0x00000000 0x5030cb10 <__je_arenas_lock+80>: 0x500ebb04 0x00000003 = 0x00000000 0x00000000 0x5030cb20 <__je_arenas_lock+96>: 0x5030cb10 0x5030cb10 = 0x00000000 0x00000000 Then the memory in the crash continues to be zero until: 0x5030d000 <__je_sz_size2index_tab+384>: 0x1a1b1b1b = 0x1b1b1b1b 0x1b1b1b1b 0x1b1b1b1b Notice the interesting page boundary for where non-zero is first available again! Between __je_arenas_lock and __je_sz_size2index_tab are: 0x5030cb30 __je_narenas_auto 0x5030cb38 malloc_conf 0x5030cb3c __je_ncpus 0x5030cb40 __je_manual_arena_base 0x5030cb80 __je_sz_pind2sz_tab 0x5030ccc0 __je_sz_index2size_tab 0x5030ce80 __je_sz_size2index_tab Note: because __je_arenas is normally mostly zero for these contexts, I can not tell where the memory trashing started, only where it replaced non-zero values with zeros. =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 Thu May 7 08:11: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 8088B13CC0E; Thu, 7 May 2020 08:11:37 +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 49HmQ12vW2z3Ht5; Thu, 7 May 2020 08:11:37 +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 5ED20DDED; Thu, 7 May 2020 08:11:37 +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 0478Bb2B008820; Thu, 7 May 2020 08:11:37 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0478BavJ008126; Thu, 7 May 2020 08:11:36 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005070811.0478BavJ008126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 7 May 2020 08:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360773 - 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: 360773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 08:11:37 -0000 Author: melifaro Date: Thu May 7 08:11:36 2020 New Revision: 360773 URL: https://svnweb.freebsd.org/changeset/base/360773 Log: Add rib_lookup() sockaddr lookup wrapper and make ifa_ifwithroute use it. Create rib_lookup() wrapper around per-af dataplane lookup functions. This will help in the cases of having control plane af-agnostic code. Switch ifa_ifwithroute() to use this function instead of rtalloc1(). Reviewed by: ae Differential Revision: https://reviews.freebsd.org/D24731 Modified: head/sys/net/route.c head/sys/net/route.h head/sys/net/route/route_helpers.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu May 7 03:50:34 2020 (r360772) +++ head/sys/net/route.c Thu May 7 08:11:36 2020 (r360773) @@ -683,7 +683,6 @@ ifa_ifwithroute(int flags, const struct sockaddr *dst, u_int fibnum) { struct ifaddr *ifa; - int not_found = 0; NET_EPOCH_ASSERT(); if ((flags & RTF_GATEWAY) == 0) { @@ -710,34 +709,17 @@ ifa_ifwithroute(int flags, const struct sockaddr *dst, if (ifa == NULL) ifa = ifa_ifwithnet(gateway, 0, fibnum); if (ifa == NULL) { - struct rtentry *rt; + struct nhop_object *nh; - rt = rtalloc1_fib(gateway, 0, flags, fibnum); - if (rt == NULL) - goto out; + nh = rib_lookup(fibnum, gateway, NHR_NONE, 0); + /* * dismiss a gateway that is reachable only * through the default router */ - switch (gateway->sa_family) { - case AF_INET: - if (satosin(rt_key(rt))->sin_addr.s_addr == INADDR_ANY) - not_found = 1; - break; - case AF_INET6: - if (IN6_IS_ADDR_UNSPECIFIED(&satosin6(rt_key(rt))->sin6_addr)) - not_found = 1; - break; - default: - break; - } - if (!not_found && rt->rt_nhop->nh_ifa != NULL) { - ifa = rt->rt_nhop->nh_ifa; - } - RT_REMREF(rt); - RT_UNLOCK(rt); - if (not_found || ifa == NULL) - goto out; + if ((nh == NULL) || (nh->nh_flags & NHF_DEFAULT)) + return (NULL); + ifa = nh->nh_ifa; } if (ifa->ifa_addr->sa_family != dst->sa_family) { struct ifaddr *oifa = ifa; @@ -745,7 +727,7 @@ ifa_ifwithroute(int flags, const struct sockaddr *dst, if (ifa == NULL) ifa = oifa; } - out: + return (ifa); } Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Thu May 7 03:50:34 2020 (r360772) +++ head/sys/net/route.h Thu May 7 08:11:36 2020 (r360773) @@ -436,6 +436,8 @@ int rib_add_redirect(u_int fibnum, struct sockaddr *ds /* New API */ void rib_walk(int af, u_int fibnum, rt_walktree_f_t *wa_f, void *arg); +struct nhop_object *rib_lookup(uint32_t fibnum, const struct sockaddr *dst, + uint32_t flags, uint32_t flowid); #endif #endif Modified: head/sys/net/route/route_helpers.c ============================================================================== --- head/sys/net/route/route_helpers.c Thu May 7 03:50:34 2020 (r360772) +++ head/sys/net/route/route_helpers.c Thu May 7 08:11:36 2020 (r360773) @@ -55,6 +55,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef INET +#include +#endif +#ifdef INET6 +#include +#endif #include /* @@ -79,5 +85,50 @@ rib_walk(int af, u_int fibnum, rt_walktree_f_t *wa_f, RIB_RLOCK(rnh); rnh->rnh_walktree(&rnh->head, (walktree_f_t *)wa_f, arg); RIB_RUNLOCK(rnh); +} + +/* + * Wrapper for the control plane functions for performing af-agnostic + * lookups. + * @fibnum: fib to perform the lookup. + * @dst: sockaddr with family and addr filled in. IPv6 addresses needs to be in + * deembedded from. + * @flags: fib(9) flags. + * @flowid: flow id for path selection in multipath use case. + * + * Returns nhop_object or NULL. + * + * Requires NET_EPOCH. + * + */ +struct nhop_object * +rib_lookup(uint32_t fibnum, const struct sockaddr *dst, uint32_t flags, + uint32_t flowid) +{ + struct nhop_object *nh; + + nh = NULL; + + switch (dst->sa_family) { +#ifdef INET + case AF_INET: + { + const struct sockaddr_in *a = (const struct sockaddr_in *)dst; + nh = fib4_lookup(fibnum, a->sin_addr, 0, flags, flowid); + break; + } +#endif +#ifdef INET6 + case AF_INET6: + { + const struct sockaddr_in6 *a = (const struct sockaddr_in6*)dst; + nh = fib6_lookup(fibnum, &a->sin6_addr, a->sin6_scope_id, + flags, flowid); + break; + } +#endif + } + + return (nh); } From owner-svn-src-head@freebsd.org Thu May 7 08:58: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 BCFF213EF76; Thu, 7 May 2020 08:58:08 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49HnRh4dvZz3LsV; Thu, 7 May 2020 08:58:08 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A937E60C; Thu, 7 May 2020 08:58:08 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0478w8fx036576; Thu, 7 May 2020 08:58:08 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0478w84k036575; Thu, 7 May 2020 08:58:08 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202005070858.0478w84k036575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 7 May 2020 08:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360775 - head/share/termcap X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/termcap X-SVN-Commit-Revision: 360775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 08:58:08 -0000 Author: bapt Date: Thu May 7 08:58:08 2020 New Revision: 360775 URL: https://svnweb.freebsd.org/changeset/base/360775 Log: Fix indentation of the Kitty entry MFC after: 2 days Modified: head/share/termcap/termcap Modified: head/share/termcap/termcap ============================================================================== --- head/share/termcap/termcap Thu May 7 08:22:47 2020 (r360774) +++ head/share/termcap/termcap Thu May 7 08:58:08 2020 (r360775) @@ -4752,22 +4752,22 @@ xterm-kitty|KovId's TTY:\ :tc=xterm-256color:tc=kitty+common: kitty+common|KovId's TTY common properties:\ - :am:hs:km:mi:ms:xn:\ - :co#80:it#8:li#24:\ - :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:K1=:K3=:\ - :K4=:K5=:LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:\ - :ae=\E(B:al=\E[L:as=\E(0:bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:\ - :cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:\ - :ct=\E[3g:dc=\E[P:dl=\E[M:do=\n:ds=\E]2;\007:ec=\E[%dX:\ - :ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:k1=\EOP:k2=\EOQ:k3=\EOR:\ - :k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\ - :k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:\ - :kd=\EOB:ke=\E[?1l:kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:\ - :ku=\EOA:le=^H:md=\E[1m:me=\E[0m:mh=\E[2m:mr=\E[7m:nd=\E[C:\ - :rc=\E8:sc=\E7:se=\E[27m:sf=\n:so=\E[7m:sr=\EM:st=\EH:ta=^I:\ - :te=\E[?1049l:ti=\E[?1049h:ts=\E]2;:ue=\E[24m:up=\E[A:\ - :us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?12l\E[?25h:vi=\E[?25l:\ - :vs=\E[?12;25h: + :am:hs:km:mi:ms:xn:\ + :co#80:it#8:li#24:\ + :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:K1=:K3=:\ + :K4=:K5=:LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:\ + :ae=\E(B:al=\E[L:as=\E(0:bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:\ + :cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:\ + :ct=\E[3g:dc=\E[P:dl=\E[M:do=\n:ds=\E]2;\007:ec=\E[%dX:\ + :ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:k1=\EOP:k2=\EOQ:k3=\EOR:\ + :k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\ + :k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:\ + :kd=\EOB:ke=\E[?1l:kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:\ + :ku=\EOA:le=^H:md=\E[1m:me=\E[0m:mh=\E[2m:mr=\E[7m:nd=\E[C:\ + :rc=\E8:sc=\E7:se=\E[27m:sf=\n:so=\E[7m:sr=\EM:st=\EH:ta=^I:\ + :te=\E[?1049l:ti=\E[?1049h:ts=\E]2;:ue=\E[24m:up=\E[A:\ + :us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?12l\E[?25h:vi=\E[?25l:\ + :vs=\E[?12;25h: # # END OF TERMCAP From owner-svn-src-head@freebsd.org Thu May 7 10:46: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 5B8242C2C64; Thu, 7 May 2020 10:46:03 +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 49HqrC1gGDz3yMh; Thu, 7 May 2020 10:46:03 +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 34415FB7E; Thu, 7 May 2020 10:46:03 +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 047Ak3hB003553; Thu, 7 May 2020 10:46:03 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 047Ak2XO003551; Thu, 7 May 2020 10:46:02 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <202005071046.047Ak2XO003551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 7 May 2020 10:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360776 - 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: 360776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 10:46:03 -0000 Author: rrs Date: Thu May 7 10:46:02 2020 New Revision: 360776 URL: https://svnweb.freebsd.org/changeset/base/360776 Log: NF has an internal option that changes the tcp_mcopy_m routine slightly (has a few extra arguments). Recently that changed to only have one arg extra so that two ifdefs around the call are no longer needed. Lets take out the extra ifdef and arg. Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D24736 Modified: head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Thu May 7 08:58:08 2020 (r360775) +++ head/sys/netinet/tcp_stacks/bbr.c Thu May 7 10:46:02 2020 (r360776) @@ -13420,9 +13420,6 @@ send: #endif orig_len = len; m->m_next = tcp_m_copym( -#ifdef NETFLIX_COPY_ARGS - tp, -#endif mb, moff, &len, if_hw_tsomaxsegcount, if_hw_tsomaxsegsize, msb, Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu May 7 08:58:08 2020 (r360775) +++ head/sys/netinet/tcp_stacks/rack.c Thu May 7 10:46:02 2020 (r360776) @@ -13353,9 +13353,6 @@ send: else msb = sb; m->m_next = tcp_m_copym( -#ifdef NETFLIX_COPY_ARGS - tp, -#endif mb, moff, &len, if_hw_tsomaxsegcount, if_hw_tsomaxsegsize, msb, ((rsm == NULL) ? hw_tls : 0) From owner-svn-src-head@freebsd.org Thu May 7 11:28: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 138282C46D2; Thu, 7 May 2020 11:28:41 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49HrnN6qmBz425C; Thu, 7 May 2020 11:28:40 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3115183BD; Thu, 7 May 2020 11:28:40 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 047BSeFQ028257; Thu, 7 May 2020 11:28:40 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 047BSepF028253; Thu, 7 May 2020 11:28:40 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202005071128.047BSepF028253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 7 May 2020 11:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360777 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 360777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 11:28:41 -0000 Author: mw Date: Thu May 7 11:28:39 2020 New Revision: 360777 URL: https://svnweb.freebsd.org/changeset/base/360777 Log: Optimize ENA Rx refill for low memory conditions Sometimes, especially when there is not much memory in the system left, allocating mbuf jumbo clusters (like 9KB or 16KB) can take a lot of time and it is not guaranteed that it'll succeed. In that situation, the fallback will work, but if the refill needs to take a place for a lot of descriptors at once, the time spent in m_getjcl looking for memory can cause system unresponsiveness due to high priority of the Rx task. This can also lead to driver reset, because Tx cleanup routine is being blocked and timer service could detect that Tx packets aren't cleaned up. The reset routine can further create another unresponsiveness - Rx rings are being refilled there, so m_getjcl will again burn the CPU. This was causing NVMe driver timeouts and resets, because network driver is having higher priority. Instead of 16KB jumbo clusters for the Rx buffers, 9KB clusters are enough - ENA MTU is being set to 9K anyway, so it's very unlikely that more space than 9KB will be needed. However, 9KB jumbo clusters can still cause issues, so by default the page size mbuf cluster will be used for the Rx descriptors. This can have a small (~2%) impact on the throughput of the device, so to restore original behavior, one must change sysctl "hw.ena.enable_9k_mbufs" to "1" in "/boot/loader.conf" file. As a part of this patch (important fix), the version of the driver was updated to v2.1.2. Submitted by: cperciva Reviewed by: Michal Krawczyk Reviewed by: Ido Segev Reviewed by: Guy Tzalik MFC after: 3 days PR: 225791, 234838, 235856, 236989, 243531 Differential Revision: https://reviews.freebsd.org/D24546 Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h head/sys/dev/ena/ena_sysctl.c head/sys/dev/ena/ena_sysctl.h Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 7 10:46:02 2020 (r360776) +++ head/sys/dev/ena/ena.c Thu May 7 11:28:39 2020 (r360777) @@ -368,6 +368,7 @@ ena_init_io_rings_common(struct ena_adapter *adapter, ring->ena_dev = adapter->ena_dev; ring->first_interrupt = false; ring->no_interrupt_event_cnt = 0; + ring->rx_mbuf_sz = ena_mbuf_sz; } static void @@ -508,9 +509,9 @@ ena_setup_rx_dma_tag(struct ena_adapter *adapter) ENA_DMA_BIT_MASK(adapter->dma_width), /* lowaddr of excl window */ BUS_SPACE_MAXADDR, /* highaddr of excl window */ NULL, NULL, /* filter, filterarg */ - MJUM16BYTES, /* maxsize */ + ena_mbuf_sz, /* maxsize */ adapter->max_rx_sgl_size, /* nsegments */ - MJUM16BYTES, /* maxsegsize */ + ena_mbuf_sz, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockarg */ @@ -963,7 +964,8 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, return (0); /* Get mbuf using UMA allocator */ - rx_info->mbuf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM16BYTES); + rx_info->mbuf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, + rx_ring->rx_mbuf_sz); if (unlikely(rx_info->mbuf == NULL)) { counter_u64_add(rx_ring->rx_stats.mjum_alloc_fail, 1); @@ -974,7 +976,7 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, } mlen = MCLBYTES; } else { - mlen = MJUM16BYTES; + mlen = rx_ring->rx_mbuf_sz; } /* Set mbuf length*/ rx_info->mbuf->m_pkthdr.len = rx_info->mbuf->m_len = mlen; Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu May 7 10:46:02 2020 (r360776) +++ head/sys/dev/ena/ena.h Thu May 7 11:28:39 2020 (r360777) @@ -41,7 +41,7 @@ #define DRV_MODULE_VER_MAJOR 2 #define DRV_MODULE_VER_MINOR 1 -#define DRV_MODULE_VER_SUBMINOR 1 +#define DRV_MODULE_VER_SUBMINOR 2 #define DRV_MODULE_NAME "ena" @@ -307,8 +307,13 @@ struct ena_ring { /* Determines if device will use LLQ or normal mode for TX */ enum ena_admin_placement_policy_type tx_mem_queue_type; - /* The maximum length the driver can push to the device (For LLQ) */ - uint8_t tx_max_header_size; + union { + /* The maximum length the driver can push to the device (For LLQ) */ + uint8_t tx_max_header_size; + /* The maximum (and default) mbuf size for the Rx descriptor. */ + uint16_t rx_mbuf_sz; + + }; bool first_interrupt; uint16_t no_interrupt_event_cnt; Modified: head/sys/dev/ena/ena_sysctl.c ============================================================================== --- head/sys/dev/ena/ena_sysctl.c Thu May 7 10:46:02 2020 (r360776) +++ head/sys/dev/ena/ena_sysctl.c Thu May 7 11:28:39 2020 (r360777) @@ -48,6 +48,17 @@ int ena_log_level = ENA_ALERT | ENA_WARNING; SYSCTL_INT(_hw_ena, OID_AUTO, log_level, CTLFLAG_RWTUN, &ena_log_level, 0, "Logging level indicating verbosity of the logs"); +/* + * Use 9k mbufs for the Rx buffers. Default to 0 (use page size mbufs instead). + * Using 9k mbufs in low memory conditions might cause allocation to take a lot + * of time and lead to the OS instability as it needs to look for the contiguous + * pages. + * However, page size mbufs has a bit smaller throughput than 9k mbufs, so if + * the network performance is the priority, the 9k mbufs can be used. + */ +int ena_enable_9k_mbufs = 0; +SYSCTL_INT(_hw_ena, OID_AUTO, enable_9k_mbufs, CTLFLAG_RDTUN, + &ena_enable_9k_mbufs, 0, "Use 9 kB mbufs for Rx descriptors"); void ena_sysctl_add_nodes(struct ena_adapter *adapter) Modified: head/sys/dev/ena/ena_sysctl.h ============================================================================== --- head/sys/dev/ena/ena_sysctl.h Thu May 7 10:46:02 2020 (r360776) +++ head/sys/dev/ena/ena_sysctl.h Thu May 7 11:28:39 2020 (r360777) @@ -41,4 +41,7 @@ void ena_sysctl_add_nodes(struct ena_adapter *); +extern int ena_enable_9k_mbufs; +#define ena_mbuf_sz (ena_enable_9k_mbufs ? MJUM9BYTES : MJUMPAGESIZE) + #endif /* !(ENA_SYSCTL_H) */ From owner-svn-src-head@freebsd.org Thu May 7 12: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 849B92D8167; Thu, 7 May 2020 12:43:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49HtRj2xxjz47pd; Thu, 7 May 2020 12:43:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6010D19391; Thu, 7 May 2020 12:43:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 047ChTTh078289; Thu, 7 May 2020 12:43:29 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 047ChThs078288; Thu, 7 May 2020 12:43:29 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202005071243.047ChThs078288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 7 May 2020 12:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360778 - head/share/termcap X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/termcap X-SVN-Commit-Revision: 360778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 12:43:29 -0000 Author: bapt Date: Thu May 7 12:43:28 2020 New Revision: 360778 URL: https://svnweb.freebsd.org/changeset/base/360778 Log: Update the screen termcap entries Those updates have been obtained form converting the terminfo information provided by the screen sources to termcap. MFC after: 3 days Modified: head/share/termcap/termcap Modified: head/share/termcap/termcap ============================================================================== --- head/share/termcap/termcap Thu May 7 11:28:39 2020 (r360777) +++ head/share/termcap/termcap Thu May 7 12:43:28 2020 (r360778) @@ -2758,35 +2758,35 @@ vt340-color|vt340 co:\ # SC,SB,SH,SW names needed for screen(1) # SC|screen|VT 100/ANSI X3.64 virtual terminal:\ - :am:xn:ms:mi:G0:km:\ - :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:bs:bt=\E[Z:\ - :cb=\E[1K:cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:ct=\E[3g:\ - :do=^J:nd=\E[C:pt:rc=\E8:rs=\Ec:sc=\E7:st=\EH:up=\EM:\ - :le=^H:bl=^G:cr=^M:it#8:ho=\E[H:nw=\EE:ta=^I:is=\E)0:\ - :li#24:co#80:us=\E[4m:ue=\E[24m:so=\E[3m:se=\E[23m:\ - :mb=\E[5m:md=\E[1m:mr=\E[7m:me=\E[m:sr=\EM:al=\E[L:\ - :AL=\E[%dL:dl=\E[M:DL=\E[%dM:cs=\E[%i%d;%dr:dc=\E[P:\ - :DC=\E[%dP:im=\E[4h:ei=\E[4l:IC=\E[%d@:\ - :ks=\E[?1h\E=:ke=\E[?1l\E>:vb=\Eg:\ - :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\ - :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ - :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:\ - :F3=\E[25~:F4=\E[26~:F5=\E[28~:F6=\E[29~:\ - :F7=\E[31~:F8=\E[32~:F9=\E[33~:FA=\E[34~:\ - :kh=\E[1~:kI=\E[2~:kD=\E[3~:@7=\E[4~:kP=\E[5~:\ - :kN=\E[6~:eA=\E(B\E)0:as=^N:ae=^O:ti=\E[?1049h:te=\E[?1049l:\ - :vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\ - :Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:\ - :ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00: + :am:km:mi:ms:xn:\ + :Co#8:co#80:it#8:li#24:pa#64:\ + :@7=\E[4~:AB=\E[4%dm:AF=\E[3%dm:AL=\E[%dL:DC=\E[%dP:\ + :DL=\E[%dM:DO=\E[%dB:F1=\E[23~:F2=\E[24~:IC=\E[%d@:\ + :LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:\ + :ac=++,,--..00II``aaffgghhjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:\ + :ae=^O:al=\E[L:as=^N:bl=^G:bt=\E[Z:cb=\E[1K:cd=\E[J:ce=\E[K:\ + :cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:\ + :ct=\E[3g:dc=\E[P:dl=\E[M:do=\n:eA=\E(B\E)0:ei=\E[4l:\ + :ho=\E[H:im=\E[4h:is=\E)0:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\ + :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:\ + :k;=\E[21~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kd=\EOB:\ + :ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\ + :ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:\ + :nw=\EE:op=\E[39;49m:rc=\E8:rs=\Ec:sc=\E7:se=\E[23m:sf=\n:\ + :so=\E[3m:sr=\EM:st=\EH:ta=^I:te=\E[?1049l:ti=\E[?1049h:\ + :ue=\E[24m:up=\EM:us=\E[4m:vb=\Eg:ve=\E[34h\E[?25h:\ + :vi=\E[?25l:vs=\E[34l: SB|screen-bce|VT 100/ANSI X3.64 virtual terminal with bce:\ :ut:tc=screen: SH|screen-s|VT 100/ANSI X3.64 virtual terminal with hardstatus line:\ - :ts=\E_:fs=\E\\:ds=\E_\E\\:tc=screen: + :ut:hs:ts=\E_:fs=\E\\:ds=\E_\E\\:tc=screen: SW|screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols:\ :co#132:tc=screen: screen-256color|VT 100/ANSI X3.64 terminal with 256 colors:\ + :cc:\ :Co#256:pa#32767:\ - :AB=\E[48;5;%dm:AF=\E[38;5;%dm:tc=screen: + :AB=\E[48;5;%dm:AF=\E[38;5;%dm:\ + :Sb=\E[48;5;%dm:Sf=\E[38;5;%dm:tc=screen: ecma+italics|ECMA-48 italics:\ :ZH=\E[3m:ZR=\E[23m: From owner-svn-src-head@freebsd.org Thu May 7 13:11: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 3BAFD2D8B9C; Thu, 7 May 2020 13:11:33 +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 49Hv450rtqz49DV; Thu, 7 May 2020 13:11:33 +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 18993197BC; Thu, 7 May 2020 13:11:33 +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 047DBWPX094462; Thu, 7 May 2020 13:11:32 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 047DBWqO094461; Thu, 7 May 2020 13:11:32 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005071311.047DBWqO094461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 7 May 2020 13:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360779 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 360779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 13:11:33 -0000 Author: avg Date: Thu May 7 13:11:32 2020 New Revision: 360779 URL: https://svnweb.freebsd.org/changeset/base/360779 Log: gpioiic_attach: fix a NULL pointer crash on hints-based systems The attach method uses GPIO_GET_BUS() to get a "newbus" device that provides a pin. But on hints-based systems a GPIO controller driver might not be fully initialized yet and it does not know gpiobus hanging off it. Thus, GPIO_GET_BUS() cannot be called yet. The reason is that controller drivers typically create a child gpiobus using gpiobus_attach_bus() and that leads to the following call chain: gpiobus_attach_bus() -> gpiobus_attach() -> bus_generic_attach(gpiobus) -> gpioiic_attach(). So, gpioiic_attach() is called before gpiobus_attach_bus() returns. I observed this bug with nctgpio driver on amd64. I think that the problem was introduced in r355276. The fix is to avoid calling GPIO_GET_BUS() from the attach method. Instead, we know that on hints-based systems only the parent gpiobus can provide the pins. Nothing is changed for FDT-based systems. MFC after: 1 week Modified: head/sys/dev/gpio/gpioiic.c Modified: head/sys/dev/gpio/gpioiic.c ============================================================================== --- head/sys/dev/gpio/gpioiic.c Thu May 7 12:43:28 2020 (r360778) +++ head/sys/dev/gpio/gpioiic.c Thu May 7 13:11:32 2020 (r360779) @@ -303,10 +303,20 @@ gpioiic_attach(device_t dev) return (ENXIO); } - /* Say what we came up with for pin config. */ + /* + * Say what we came up with for pin config. + * NB: in the !FDT case the controller driver might not be set up enough + * for GPIO_GET_BUS() to work. Also, our parent is the only gpiobus + * that can provide our pins. + */ device_printf(dev, "SCL pin: %s:%d, SDA pin: %s:%d\n", +#ifdef FDT device_get_nameunit(GPIO_GET_BUS(sc->sclpin->dev)), sc->sclpin->pin, device_get_nameunit(GPIO_GET_BUS(sc->sdapin->dev)), sc->sdapin->pin); +#else + device_get_nameunit(device_get_parent(dev)), sc->sclpin->pin, + device_get_nameunit(device_get_parent(dev)), sc->sdapin->pin); +#endif /* Add the bitbang driver as our only child; it will add iicbus. */ device_add_child(sc->dev, "iicbb", -1); From owner-svn-src-head@freebsd.org Thu May 7 16:56: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 602182DE281; Thu, 7 May 2020 16:56:19 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49J03R1yT2z4Psb; Thu, 7 May 2020 16:56:19 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A2901C429; Thu, 7 May 2020 16:56:19 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 047GuJYt033140; Thu, 7 May 2020 16:56:19 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 047GuJl0033139; Thu, 7 May 2020 16:56:19 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <202005071656.047GuJl0033139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Thu, 7 May 2020 16:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360786 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 360786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 16:56:19 -0000 Author: pstef Date: Thu May 7 16:56:18 2020 New Revision: 360786 URL: https://svnweb.freebsd.org/changeset/base/360786 Log: ps: extend the non-standard option -d (tree view) to work with -p Initially it seemed that there were multiple possible ways to do it. Processing option -p could conditionally add selected processes and their descendants to the list for further work, but it is not guaranteed to know whether the -d option has been used or not, and it also doesn't have access to the process list just yet. There is also descendant_sort() which has access to all possibly needed information, but serves the purely post-processing purpose of sorting output. Then there is the loop that uses invocation information and full process list to create a list of processes for final display. It seems the most natural place to implement this, but indeterminate state of the process list and volatility of the final list that is being created obstruct adding an elegant search for all elements of process descendancy trees. So I opted for adding another loop, just before the one I mentioned above. For all selected processes it conditionally adds direct descendants to the end of this list of selected processes. Possible usage: * ps -auxd -p $$ * ps -auxd -p 1 * while x=$(pgrep svnlite); do clear; ps auxd -p $x; sleep 2; done * ps -auxd -p `pgrep make` Reviewed by: kevans, kaktus (earlier version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24380 Modified: head/bin/ps/ps.c Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Thu May 7 16:40:33 2020 (r360785) +++ head/bin/ps/ps.c Thu May 7 16:56:18 2020 (r360786) @@ -506,7 +506,7 @@ main(int argc, char *argv[]) what = KERN_PROC_PGRP | showthreads; flag = *pgrplist.l.pids; nselectors = 0; - } else if (pidlist.count == 1) { + } else if (pidlist.count == 1 && !descendancy) { what = KERN_PROC_PID | showthreads; flag = *pidlist.l.pids; nselectors = 0; @@ -544,6 +544,14 @@ main(int argc, char *argv[]) if ((kp == NULL && errno != ESRCH) || (kp != NULL && nentries < 0)) xo_errx(1, "%s", kvm_geterr(kd)); nkept = 0; + if (descendancy) + for (elem = 0; elem < pidlist.count; elem++) + for (i = 0; i < nentries; i++) + if (kp[i].ki_ppid == pidlist.l.pids[elem]) { + if (pidlist.count >= pidlist.maxcount) + expand_list(&pidlist); + pidlist.l.pids[pidlist.count++] = kp[i].ki_pid; + } if (nentries > 0) { if ((kinfo = malloc(nentries * sizeof(*kinfo))) == NULL) xo_errx(1, "malloc failed"); From owner-svn-src-head@freebsd.org Thu May 7 17:00: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 30FBC2DE388; Thu, 7 May 2020 17:00:52 +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 49J08h0c3zz4Q4F; Thu, 7 May 2020 17:00:52 +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 0EA171C455; Thu, 7 May 2020 17:00:52 +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 047H0pab034344; Thu, 7 May 2020 17:00:51 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 047H0pEl034066; Thu, 7 May 2020 17:00:51 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005071700.047H0pEl034066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 7 May 2020 17:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360787 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 360787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 17:00:52 -0000 Author: manu Date: Thu May 7 17:00:51 2020 New Revision: 360787 URL: https://svnweb.freebsd.org/changeset/base/360787 Log: linuxkpi: Add pci_iomap and pci_iounmap Those function are use to map/unmap io region of a pci device. Different resource can be mapped depending on the bar so use a tailq to store them all. Sponsored-by: The FreeBSD Foundation Reviewed by: emaste, hselasky Differential Revision: https://reviews.freebsd.org/D24696 Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Thu May 7 16:56:18 2020 (r360786) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Thu May 7 17:00:51 2020 (r360787) @@ -222,6 +222,13 @@ extern spinlock_t pci_lock; #define __devexit_p(x) x +struct pci_mmio_region { + TAILQ_ENTRY(pci_mmio_region) next; + struct resource *res; + int rid; + int type; +}; + struct pci_dev { struct device dev; struct list_head links; @@ -236,6 +243,8 @@ struct pci_dev { uint32_t class; uint8_t revision; bool msi_enabled; + + TAILQ_HEAD(, pci_mmio_region) mmio; }; static inline struct resource_list_entry * @@ -657,6 +666,41 @@ static inline int pci_enable_sriov(struct pci_dev *dev } static inline void pci_disable_sriov(struct pci_dev *dev) { +} + +static inline void * +pci_iomap(struct pci_dev *dev, int mmio_bar, int mmio_size __unused) +{ + struct pci_mmio_region *mmio; + + mmio = malloc(sizeof(*mmio), M_DEVBUF, M_WAITOK | M_ZERO); + mmio->rid = PCIR_BAR(mmio_bar); + mmio->type = pci_resource_type(dev, mmio_bar); + mmio->res = bus_alloc_resource_any(dev->dev.bsddev, mmio->type, + &mmio->rid, RF_ACTIVE); + if (mmio->res == NULL) { + free(mmio, M_DEVBUF); + return (NULL); + } + TAILQ_INSERT_TAIL(&dev->mmio, mmio, next); + + return ((void *)rman_get_bushandle(mmio->res)); +} + +static inline void +pci_iounmap(struct pci_dev *dev, void *res) +{ + struct pci_mmio_region *mmio, *p; + + TAILQ_FOREACH_SAFE(mmio, &dev->mmio, next, p) { + if (res != (void *)rman_get_bushandle(mmio->res)) + continue; + bus_release_resource(dev->dev.bsddev, + mmio->type, mmio->rid, mmio->res); + TAILQ_REMOVE(&dev->mmio, mmio, next); + free(mmio, M_DEVBUF); + return; + } } #define DEFINE_PCI_DEVICE_TABLE(_table) \ Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Thu May 7 16:56:18 2020 (r360786) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Thu May 7 17:00:51 2020 (r360787) @@ -271,6 +271,7 @@ linux_pci_attach_device(device_t dev, struct pci_drive if (error) goto out_dma_init; + TAILQ_INIT(&pdev->mmio); pbus = malloc(sizeof(*pbus), M_DEVBUF, M_WAITOK | M_ZERO); pbus->self = pdev; pbus->number = pci_get_bus(dev); From owner-svn-src-head@freebsd.org Thu May 7 17:25: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 6841B2DF234; Thu, 7 May 2020 17:25:30 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49J0j628N9z4S7q; Thu, 7 May 2020 17:25:30 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1129) id 3B24315F81; Thu, 7 May 2020 17:25:30 +0000 (UTC) Date: Thu, 7 May 2020 17:25:30 +0000 From: Li-Wen Hsu To: Jessica Clarke Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360722 - head/sys/dev/virtio/mmio Message-ID: <20200507172530.GA61260@freefall.freebsd.org> References: <202005062328.046NSp8x079151@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005062328.046NSp8x079151@repo.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 17:25:30 -0000 On Wed, May 06, 2020 at 23:28:51 +0000, Jessica Clarke wrote: > Author: jrtc27 > Date: Wed May 6 23:28:51 2020 > New Revision: 360722 > URL: https://svnweb.freebsd.org/changeset/base/360722 > > Log: > virtio_mmio: Support non-transitional version 2 devices > > The non-legacy virtio MMIO specification drops the use of PFNs and > replaces them with physical addresses. Whilst many implementations are > so-called transitional devices, also implementing the legacy > specification, TinyEMU[1] does not. Device-specific configuration > registers have also changed to being little-endian, and must be accessed > using a single aligned access for registers up to 32 bits, and two > 32-bit aligned accesses for 64-bit registers. > > [1] https://bellard.org/tinyemu/ > > Reviewed by: br, brooks (mentor) > Approved by: br, brooks (mentor) > Differential Revision: https://reviews.freebsd.org/D24681 > > Modified: > head/sys/dev/virtio/mmio/virtio_mmio.c > head/sys/dev/virtio/mmio/virtio_mmio.h Hi Jessica, It looks this commit breaks armv6 and armv7 builds: --- virtio_mmio.o --- /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:442:13: error: shift count >= width of type [-Werror,-Wshift-count-overflow] paddr >> 32); ^ ~~ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:127:44: note: expanded from macro 'vtmmio_write_config_4' VIRTIO_MMIO_PREWRITE(sc->platform, (o), (v)); \ ^ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:442:13: error: shift count >= width of type [-Werror,-Wshift-count-overflow] paddr >> 32); ^ ~~ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:128:34: note: expanded from macro 'vtmmio_write_config_4' bus_write_4((sc)->res[0], (o), (v)); \ ^ /usr/src/sys/sys/bus.h:919:59: note: expanded from macro 'bus_write_4' bus_space_write_4((r)->r_bustag, (r)->r_bushandle, (o), (v)) ^ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:442:13: error: shift count >= width of type [-Werror,-Wshift-count-overflow] paddr >> 32); ^ ~~ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:130:40: note: expanded from macro 'vtmmio_write_config_4' VIRTIO_MMIO_NOTE(sc->platform, (o), (v)); \ ^ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:448:13: error: shift count >= width of type [-Werror,-Wshift-count-overflow] paddr >> 32); ^ ~~ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:127:44: note: expanded from macro 'vtmmio_write_config_4' VIRTIO_MMIO_PREWRITE(sc->platform, (o), (v)); \ ^ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:448:13: error: shift count >= width of type [-Werror,-Wshift-count-overflow] paddr >> 32); ^ ~~ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:128:34: note: expanded from macro 'vtmmio_write_config_4' bus_write_4((sc)->res[0], (o), (v)); \ ^ /usr/src/sys/sys/bus.h:919:59: note: expanded from macro 'bus_write_4' bus_space_write_4((r)->r_bustag, (r)->r_bushandle, (o), (v)) ^ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:448:13: error: shift count >= width of type [-Werror,-Wshift-count-overflow] paddr >> 32); ^ ~~ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:130:40: note: expanded from macro 'vtmmio_write_config_4' VIRTIO_MMIO_NOTE(sc->platform, (o), (v)); \ ^ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:454:13: error: shift count >= width of type [-Werror,-Wshift-count-overflow] paddr >> 32); ^ ~~ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:127:44: note: expanded from macro 'vtmmio_write_config_4' VIRTIO_MMIO_PREWRITE(sc->platform, (o), (v)); \ ^ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:454:13: error: shift count >= width of type [-Werror,-Wshift-count-overflow] paddr >> 32); ^ ~~ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:128:34: note: expanded from macro 'vtmmio_write_config_4' bus_write_4((sc)->res[0], (o), (v)); \ ^ /usr/src/sys/sys/bus.h:919:59: note: expanded from macro 'bus_write_4' bus_space_write_4((r)->r_bustag, (r)->r_bushandle, (o), (v)) ^ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:454:13: error: shift count >= width of type [-Werror,-Wshift-count-overflow] paddr >> 32); ^ ~~ /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:130:40: note: expanded from macro 'vtmmio_write_config_4' VIRTIO_MMIO_NOTE(sc->platform, (o), (v)); \ ^ https://ci.freebsd.org/job/FreeBSD-head-armv6-build/9109/console https://ci.freebsd.org/job/FreeBSD-head-armv7-build/9035/console Thanks, Li-Wen From owner-svn-src-head@freebsd.org Thu May 7 17:58: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 5FDBB2DFD30; Thu, 7 May 2020 17:58:08 +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 49J1Qm1sq8z4V3p; Thu, 7 May 2020 17:58:08 +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 3B7321CF8E; Thu, 7 May 2020 17:58:08 +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 047Hw8PR071153; Thu, 7 May 2020 17:58:08 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 047Hw8aj071152; Thu, 7 May 2020 17:58:08 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202005071758.047Hw8aj071152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Thu, 7 May 2020 17:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360788 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 360788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 17:58:08 -0000 Author: bdragon Date: Thu May 7 17:58:07 2020 New Revision: 360788 URL: https://svnweb.freebsd.org/changeset/base/360788 Log: [PowerPC] Fix powerpcspe build failure after r360569 On powerpcspe, vm_paddr_t is 64 bit despite it being a 32 bit platform. Adjust compile time assertion to compensate. Modified: head/sys/kern/uipc_mbuf.c Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Thu May 7 17:00:51 2020 (r360787) +++ head/sys/kern/uipc_mbuf.c Thu May 7 17:58:07 2020 (r360788) @@ -167,7 +167,12 @@ CTASSERT(sizeof(struct m_ext) == 160); #else CTASSERT(offsetof(struct mbuf, m_dat) == 24); CTASSERT(sizeof(struct pkthdr) == 48); +#if defined(__powerpc__) && defined(BOOKE) +/* PowerPC booke has 64-bit physical pointers. */ +CTASSERT(sizeof(struct m_ext) == 184); +#else CTASSERT(sizeof(struct m_ext) == 180); +#endif #endif /* From owner-svn-src-head@freebsd.org Thu May 7 17:59:18 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 7C44B2DFDB7; Thu, 7 May 2020 17:59:18 +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 49J1S62jgdz4VBY; Thu, 7 May 2020 17:59:18 +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 583041CF90; Thu, 7 May 2020 17:59:18 +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 047HxIb3071248; Thu, 7 May 2020 17:59:18 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 047HxIKB071247; Thu, 7 May 2020 17:59:18 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202005071759.047HxIKB071247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Thu, 7 May 2020 17:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360789 - head/sys/dev/virtio/mmio X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: head/sys/dev/virtio/mmio X-SVN-Commit-Revision: 360789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 17:59:18 -0000 Author: jrtc27 Date: Thu May 7 17:59:17 2020 New Revision: 360789 URL: https://svnweb.freebsd.org/changeset/base/360789 Log: virtio_mmio: Add casts missing from r360722 This fixes -Wshift-count-overflow warnings/errors on architectures using 32-bit physical addresses. Reported by: lwhsu Modified: head/sys/dev/virtio/mmio/virtio_mmio.c Modified: head/sys/dev/virtio/mmio/virtio_mmio.c ============================================================================== --- head/sys/dev/virtio/mmio/virtio_mmio.c Thu May 7 17:58:07 2020 (r360788) +++ head/sys/dev/virtio/mmio/virtio_mmio.c Thu May 7 17:59:17 2020 (r360789) @@ -439,19 +439,19 @@ vtmmio_set_virtqueue(struct vtmmio_softc *sc, struct v vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_DESC_LOW, paddr); vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_DESC_HIGH, - paddr >> 32); + ((uint64_t)paddr) >> 32); paddr = virtqueue_avail_paddr(vq); vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_AVAIL_LOW, paddr); vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_AVAIL_HIGH, - paddr >> 32); + ((uint64_t)paddr) >> 32); paddr = virtqueue_used_paddr(vq); vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_USED_LOW, paddr); vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_USED_HIGH, - paddr >> 32); + ((uint64_t)paddr) >> 32); vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_READY, 1); } From owner-svn-src-head@freebsd.org Thu May 7 18:04: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 CCAF12E01E6 for ; Thu, 7 May 2020 18:04:07 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.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 49J1Yg092xz4Vmq for ; Thu, 7 May 2020 18:04:06 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f66.google.com with SMTP id s8so7498888wrt.9 for ; Thu, 07 May 2020 11:04:06 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=9tyi3HTeM/onj+xSEcf7hulRwWWiv0NM+JqKBiFVSxY=; b=NBzWRjDjdYSPp8ff2hD0P4BPgZYUcFYxvXBAt7lSIpn4uOxOOk8V06Fg4jjlLsa0I8 ykQBR2U7YplsKX9BUXH6rVrguu941ixh4vElJxfR4PYTI1qUGWBF6SfcGmA4OSwzCIVH d2GX8rI+dOHBEeS7pl7kVRKVkuafModWFxHzRwLXBx5RCWOPn0CoDgnnRfkxtTkeaT+c RDxfGQ4o+5LpzWHHgg/4arNhIAgazteX3S2eyzWO14rC44FgsJ1tCxlB458MPWtQLQ0v VkaCnsUDjrVvZe3IomV/rnaTIEFI+PVQ4thQg+zOMVCmdgE6lxPR2C6CumHakHc26dUE gy3A== X-Gm-Message-State: AGi0PuZqo+U8x/d+rRQNgKgP4UYZ8/PRXpiAS4ufzjVvxPkTK00nQJcM L1wRbrlPoakHWKx6eefRu21awg== X-Google-Smtp-Source: APiQypLYyF8KKN/T7E4nZaausnEXtNCSfPpWnEnVxwR7OC9Y5NkJiqFuxc6SEYDUNQLKM4eguunJIQ== X-Received: by 2002:a05:6000:1048:: with SMTP id c8mr16112759wrx.1.1588874645299; Thu, 07 May 2020 11:04:05 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id l5sm1882550wrr.72.2020.05.07.11.04.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2020 11:04:04 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: svn commit: r360722 - head/sys/dev/virtio/mmio From: Jessica Clarke In-Reply-To: <20200507172530.GA61260@freefall.freebsd.org> Date: Thu, 7 May 2020 19:04:03 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <68E0E25D-759A-4D4C-895B-0AB98A3493C9@freebsd.org> References: <202005062328.046NSp8x079151@repo.freebsd.org> <20200507172530.GA61260@freefall.freebsd.org> To: Li-Wen Hsu X-Mailer: Apple Mail (2.3608.60.0.2.5) X-Rspamd-Queue-Id: 49J1Yg092xz4Vmq X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.66 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.92 / 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]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; 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]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.221.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; IP_SCORE(-1.42)[ip: (-6.21), ipnet: 209.85.128.0/17(-0.39), asn: 15169(-0.43), country: US(-0.05)]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[66.221.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 18:04:07 -0000 On 7 May 2020, at 18:25, Li-Wen Hsu wrote: > On Wed, May 06, 2020 at 23:28:51 +0000, Jessica Clarke wrote: >> Author: jrtc27 >> Date: Wed May 6 23:28:51 2020 >> New Revision: 360722 >> URL: https://svnweb.freebsd.org/changeset/base/360722 >>=20 >> Log: >> virtio_mmio: Support non-transitional version 2 devices >>=20 >> The non-legacy virtio MMIO specification drops the use of PFNs and >> replaces them with physical addresses. Whilst many implementations = are >> so-called transitional devices, also implementing the legacy >> specification, TinyEMU[1] does not. Device-specific configuration >> registers have also changed to being little-endian, and must be = accessed >> using a single aligned access for registers up to 32 bits, and two >> 32-bit aligned accesses for 64-bit registers. >>=20 >> [1] https://bellard.org/tinyemu/ >>=20 >> Reviewed by: br, brooks (mentor) >> Approved by: br, brooks (mentor) >> Differential Revision: https://reviews.freebsd.org/D24681 >>=20 >> Modified: >> head/sys/dev/virtio/mmio/virtio_mmio.c >> head/sys/dev/virtio/mmio/virtio_mmio.h >=20 > Hi Jessica, >=20 > It looks this commit breaks armv6 and armv7 builds: >=20 >=20 > --- virtio_mmio.o --- > /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:442:13: error: shift count = >=3D width of type [-Werror,-Wshift-count-overflow] > paddr >> 32); > ^ ~~ > /usr/src/sys/dev/virtio/mmio/virtio_mmio.c:127:44: note: expanded from = macro 'vtmmio_write_config_4' > VIRTIO_MMIO_PREWRITE(sc->platform, (o), (v)); \ > ^ > ... >=20 > https://ci.freebsd.org/job/FreeBSD-head-armv6-build/9109/console > https://ci.freebsd.org/job/FreeBSD-head-armv7-build/9035/console Thanks, yes, of course. This should be fixed as of r360789. Jess From owner-svn-src-head@freebsd.org Thu May 7 18:15: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 9FDCE2E09E9; Thu, 7 May 2020 18:15:36 +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 49J1pw1tC9z4Wsg; Thu, 7 May 2020 18:15:36 +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 3745C1D367; Thu, 7 May 2020 18:15:36 +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 047IFa0C082954; Thu, 7 May 2020 18:15:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 047IFaN2082953; Thu, 7 May 2020 18:15:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005071815.047IFaN2082953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 May 2020 18:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360790 - head/sys/dev/sound/pcm X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/sound/pcm X-SVN-Commit-Revision: 360790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 18:15:36 -0000 Author: hselasky Date: Thu May 7 18:15:35 2020 New Revision: 360790 URL: https://svnweb.freebsd.org/changeset/base/360790 Log: Set PCM_CAP_VIRTUAL for virtual DSP devices. Submitted by: Kevin Zheng PR: 246206 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/sound/pcm/dsp.c Modified: head/sys/dev/sound/pcm/dsp.c ============================================================================== --- head/sys/dev/sound/pcm/dsp.c Thu May 7 17:59:17 2020 (r360789) +++ head/sys/dev/sound/pcm/dsp.c Thu May 7 18:15:35 2020 (r360790) @@ -1703,6 +1703,10 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, *arg_i = PCM_CAP_REALTIME | PCM_CAP_MMAP | PCM_CAP_TRIGGER; if (rdch && wrch && !(dsp_get_flags(i_dev) & SD_F_SIMPLEX)) *arg_i |= PCM_CAP_DUPLEX; + if (rdch && (rdch->flags & CHN_F_VIRTUAL) != 0) + *arg_i |= PCM_CAP_VIRTUAL; + if (wrch && (wrch->flags & CHN_F_VIRTUAL) != 0) + *arg_i |= PCM_CAP_VIRTUAL; PCM_UNLOCK(d); break; @@ -2653,6 +2657,7 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *a * these in pcmchan::caps? */ ai->caps = PCM_CAP_REALTIME | PCM_CAP_MMAP | PCM_CAP_TRIGGER | + ((ch->flags & CHN_F_VIRTUAL) ? PCM_CAP_VIRTUAL : 0) | ((ch->direction == PCMDIR_PLAY) ? PCM_CAP_OUTPUT : PCM_CAP_INPUT); /* From owner-svn-src-head@freebsd.org Thu May 7 18:24: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 878242E0F57; Thu, 7 May 2020 18:24:33 +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 49J21F361Rz4XdM; Thu, 7 May 2020 18:24:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65CE81D549; Thu, 7 May 2020 18:24:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 047IOXfZ089305; Thu, 7 May 2020 18:24:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 047IOXRL089304; Thu, 7 May 2020 18:24:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005071824.047IOXRL089304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 May 2020 18:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360791 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 360791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 18:24:33 -0000 Author: emaste Date: Thu May 7 18:24:32 2020 New Revision: 360791 URL: https://svnweb.freebsd.org/changeset/base/360791 Log: OptionalObsoleteFiles.inc: remove objdump objdump is removed unconditionally in ObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu May 7 18:15:35 2020 (r360790) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu May 7 18:24:32 2020 (r360791) @@ -207,7 +207,6 @@ OLD_FILES+=usr/bin/as OLD_FILES+=usr/bin/ld OLD_FILES+=usr/share/man/man1/ld.1.gz .endif -OLD_FILES+=usr/bin/objdump .endif OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.x OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xbn @@ -406,7 +405,6 @@ OLD_FILES+=usr/libdata/ldscripts/elf_x86_64_fbsd.xu OLD_FILES+=usr/libdata/ldscripts/elf_x86_64_fbsd.xw .if !defined(WITH_PORT_BASE_BINUTILS) OLD_FILES+=usr/share/man/man1/as.1.gz -OLD_FILES+=usr/share/man/man1/objdump.1.gz OLD_FILES+=usr/share/man/man7/as.7.gz OLD_FILES+=usr/share/man/man7/ld.7.gz OLD_FILES+=usr/share/man/man7/ldint.7.gz From owner-svn-src-head@freebsd.org Thu May 7 19: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 C193A2E1E9E for ; Thu, 7 May 2020 19:06:38 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic304-25.consmr.mail.gq1.yahoo.com (sonic304-25.consmr.mail.gq1.yahoo.com [98.137.68.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 49J2xn1tXrz4Zqd for ; Thu, 7 May 2020 19:06:37 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: ymUHbHAVM1nxMvrnBetflgticeA9_e1fEHsRRHVMHn0m2qCUC.tTFaDDeMuvFXO JMGVC3bkuHxMQ3Gh2xCgvxW4jAGW6JsVsVXrx8HToAGqGgMVCwx1cYVzQ9BNdiu1NFjhrJMUFNX3 KOPexm9XqKb_62elZnxldMtv6kG67pexLkfYuhEK9GdrVmZoPQPmNmfeTxtTlAdcoHeStPre1w2O Ce0doYJbKpkR39sSZm7clKruyOcUtyvXTNQKFn7L63qLYm.IDcrwekGcccVJct0Ihcw2hnVctlXD VSEssj9Dyqr2B8XK9PhIyZSiXkN.kIiXSKma5esYqfAREwas0lVoLKmkQ1LJLvMFnI2a630GjD9L bUJeisuATRy2OHPRzFKAlAyymPTwMzg23QeWoBQKvLBwzp_JsDmBQOzRWZOdGWkXkJAQAJghNNjL aWdUNOc5seAEdCA7qBs7Em9miC5WHxmYlNanPibU9x0x2Y5Ih_9c1MdOB8edHM3MfA0BmDcw2e3A A4.xhSVnMHvFB2kl9IwAlP1jFpNEoDUbsMwYPJaoSvuzv2BSwPcGvGqHkX870PPgfrDj32d7O7hn ul_vXE4u42qUxd.KMVyI27S7uGVNDXmzyuT2d6ZGROYtvob__cL6xBmNhT7C_81b5aCwSyJOUbTs cx9f__cSs8bOGlC6sbtxRs8VqrLaxHyJKvoZvsbIfFkLs0M9ANzOXEzG5fllGBnUNFCI6bIS9WCx ZcllYQuVYqpLDvuhS3h00YppZc4LDLZN40bnsZj8VOafpMtgoC1fWEllCewltGw11jV.Had9Mfud f5LxYdj3CXef8em.11Zv.Pdt6qDYCD0har50cPmDgT13cSYL.O9GsbK5DeSxdNqciTJuv5LdcKob xgHlWPjb8dxR1fHYXgieiHprpzMBHpz_kL_K_kLqp0i6xs9QiMQ17mZ5mo5pVrRbyXro1TUn2Bvc pF2WP6I6vjM6G55BVesaEl.VAgS3mxTJVMps52zZfq2mw0BStsODtQZ3SAQKf7KEZlXoNx91xXLz WTkybn.q9c5UzDLu_pX1aJDr1fGQPp9asliXeImYT1l4DsySQU8fuGnx.k5RleIMVwH7cRVr1BOj .cPbQvbcsNyHLvizcNWwqzHzYpopO3_gkwVXcRYlerQgiUztzU.1zWxpYOa7HQXowhAs5bFoHsbl 7fMk0lceaJTOCuM1_z3Ab_FRuiMuIV6cheVf_Ai.QzEGOw3.XCr7gyDL1t61cLC8LPareeeH_x9E zl1CVhlvBMkpWhiJiXIpICBhd1uWUqLpd8oakTxub26b3x4Zzgk0gT5OlK6YeMs_vL58OepvSMNH nf9yMHViwKnvByXTPJAQsxNKB8TrDLI7Z5PwSOpjXusG59yUk6.nEwKCAlr3DT5uOpYO1ufMP5XF PZSUUB1BRwmXrx2to51w4MVcqCV.DLSwqh7fFh9IaiCi8sY5qZObGhxPpPGX_.w-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Thu, 7 May 2020 19:06:35 +0000 Received: by smtp434.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID f7716cd2133ed3096a69b5432fcac9e7; Thu, 07 May 2020 19:06:34 +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: <18E62746-80DB-4195-977D-4FF32D0129EE@yahoo.com> Date: Thu, 7 May 2020 12:06:15 -0700 Cc: Brandon Bergren , Justin Hibbits Content-Transfer-Encoding: quoted-printable 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: 49J2xn1tXrz4Zqd X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.49 / 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.99)[-0.993,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (-0.08), 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.68.137.98.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[206.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.30 Precedence: list List-Id: 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, 07 May 2020 19:06:38 -0000 [mountd failure example: also at sz_size2index_lookup assert for the same zero'd memory problem.] > On 2020-May-7, at 00:46, Mark Millard wrote: >=20 > [__je_sz_size2index_tab seems messed up in 2 of the > asserting contexts: first 384 are zero in both. More > before that is also messed up (all zero). I show the > details later below.] >=20 > On 2020-May-6, at 16:57, Mark Millard wrote: >=20 >> [This explores process crashes that happen during system >> shutdown, in a context not having MALLOC_PRODUCTION=3D . >> So assert failures are reported as the stopping points.] >>=20 >> It looks like shutdown -p now, shutdown -r now, and the >> like can lead some processes to assert during their exit >> attempt, including a sshd failure (that I've not seen >> before), rpcbind, and nfsd. I show information about the >> observed asserts for those below. >>=20 >>=20 >> sshd hit an assert, failing slab =3D=3D extent_slab_get(extent) : >>=20 >> (gdb) bt=20 >> #0 thr_kill () at thr_kill.S:4 >> #1 0x50927170 in __raise (s=3D6) at /usr/src/lib/libc/gen/raise.c:52 >> #2 0x50886cc0 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 >> #3 0x508834b0 in arena_dalloc (tsdn=3D, = ptr=3D, tcache=3D, alloc_ctx=3D, slow_path=3D) >> at = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:315 >> #4 idalloctm (tsdn=3D0x500dd040, ptr=3D0x5008a180, = tcache=3D0x500dd160, alloc_ctx=3D, is_internal=3D, slow_path=3D) >> at = /usr/src/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inli= nes_c.h:118 >> #5 0x5087b0a4 in ifree (tsd=3D0x500dd040, ptr=3D0x5008a180, = tcache=3D0x500dd160, slow_path=3D) at = jemalloc_jemalloc.c:2590 >> #6 0x5087acac in __je_free_default (ptr=3D0x5008a180) at = jemalloc_jemalloc.c:2784 >> #7 0x5087b294 in __free (ptr=3D0x5008a180) at = jemalloc_jemalloc.c:2852 >> #8 0x10029464 in server_accept_loop (config_s=3D, = sock_in=3D, sock_out=3D, = newsock=3D) at /usr/src/crypto/openssh/sshd.c:1185 >> #9 main (ac=3D, av=3D0xffffde3c) at = /usr/src/crypto/openssh/sshd.c:2009 >>=20 >> . . . >> (gdb) up >> #2 0x50886cc0 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 >> 67 (void)raise(SIGABRT); >> (gdb) up >> #3 0x508834b0 in arena_dalloc (tsdn=3D, = ptr=3D, tcache=3D, alloc_ctx=3D, slow_path=3D) >> at = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:315 >> 315 assert(slab =3D=3D extent_slab_get(extent)); >>=20 >> (gdb) list >> 310 rtree_ctx =3D tsd_rtree_ctx(tsdn_tsd(tsdn)); >> 311 extent_t *extent =3D rtree_extent_read(tsdn, = &extents_rtree, >> 312 rtree_ctx, (uintptr_t)ptr, true); >> 313 assert(szind =3D=3D extent_szind_get(extent)); >> 314 assert(szind < SC_NSIZES); >> 315 assert(slab =3D=3D extent_slab_get(extent)); >> 316 } >> 317=09 >> 318 if (likely(slab)) { >> 319 /* Small allocation. */ >>=20 >> More fully: >>=20 >> 285 JEMALLOC_ALWAYS_INLINE void >> 286 arena_dalloc(tsdn_t *tsdn, void *ptr, tcache_t *tcache, >> 287 alloc_ctx_t *alloc_ctx, bool slow_path) { >> 288 assert(!tsdn_null(tsdn) || tcache =3D=3D NULL); >> 289 assert(ptr !=3D NULL); >> 290=09 >> 291 if (unlikely(tcache =3D=3D NULL)) { >> 292 arena_dalloc_no_tcache(tsdn, ptr); >> 293 return; >> 294 } >> 295=09 >> 296 szind_t szind; >> 297 bool slab; >> 298 rtree_ctx_t *rtree_ctx; >> 299 if (alloc_ctx !=3D NULL) { >> 300 szind =3D alloc_ctx->szind; >> 301 slab =3D alloc_ctx->slab; >> 302 assert(szind !=3D SC_NSIZES); >> 303 } else { >> 304 rtree_ctx =3D tsd_rtree_ctx(tsdn_tsd(tsdn)); >> 305 rtree_szind_slab_read(tsdn, &extents_rtree, = rtree_ctx, >> 306 (uintptr_t)ptr, true, &szind, &slab); >> 307 } >> 308=09 >> 309 if (config_debug) { >> 310 rtree_ctx =3D tsd_rtree_ctx(tsdn_tsd(tsdn)); >> 311 extent_t *extent =3D rtree_extent_read(tsdn, = &extents_rtree, >> 312 rtree_ctx, (uintptr_t)ptr, true); >> 313 assert(szind =3D=3D extent_szind_get(extent)); >> 314 assert(szind < SC_NSIZES); >> 315 assert(slab =3D=3D extent_slab_get(extent)); >> 316 } >> 317=09 >> 318 if (likely(slab)) { >> 319 /* Small allocation. */ >> 320 tcache_dalloc_small(tsdn_tsd(tsdn), tcache, ptr, = szind, >> 321 slow_path); >> 322 } else { >> 323 arena_dalloc_large(tsdn, ptr, tcache, szind, = slow_path); >> 324 } >> 325 } >=20 > The following are only shown for contrast with the later > cases of lots of zeros showing up where below shows > non-zero values (taken from sshd.core, which failed > differently): >=20 > (gdb) x/4x __je_arenas+16368/4 > 0x50981ab0 <__je_arenas+16368>: 0x00000000 0x00000000 = 0x00000000 0x00000009 > (gdb) print/x __je_arenas_lock=20 > $1 =3D {{{prof_data =3D {tot_wait_time =3D {ns =3D 0x0}, max_wait_time = =3D {ns =3D 0x0}, n_wait_times =3D 0x0, n_spin_acquired =3D 0x0, = max_n_thds =3D 0x0, n_waiting_thds =3D {repr =3D 0x0}, n_owner_switches = =3D 0x0,=20 > prev_owner =3D 0x0, n_lock_ops =3D 0x0}, lock =3D 0x5008bf00, = postponed_next =3D 0x50974070, locked =3D {repr =3D 0x0}}}, witness =3D = {name =3D 0x50760b04, rank =3D 0x3, comp =3D 0x0, opaque =3D 0x0, link =3D= { > qre_next =3D 0x50981b10, qre_prev =3D 0x50981b10}}, lock_order =3D = 0x0} > (gdb) print/x __je_narenas_auto > $2 =3D 0x8 > (gdb) print/x malloc_conf > $3 =3D 0x0 > (gdb) print/x __je_ncpus > $4 =3D 0x2 > (gdb) print/x __je_manual_arena_base > $5 =3D 0x9 > (gdb) print/x __je_sz_pind2sz_tab=20 > $6 =3D {0x1000, 0x2000, 0x3000, 0x4000, 0x5000, 0x6000, 0x7000, = 0x8000, 0xa000, 0xc000, 0xe000, 0x10000, 0x14000, 0x18000, 0x1c000, = 0x20000, 0x28000, 0x30000, 0x38000, 0x40000, 0x50000, 0x60000,=20 > 0x70000, 0x80000, 0xa0000, 0xc0000, 0xe0000, 0x100000, 0x140000, = 0x180000, 0x1c0000, 0x200000, 0x280000, 0x300000, 0x380000, 0x400000, = 0x500000, 0x600000, 0x700000, 0x800000, 0xa00000, 0xc00000,=20 > 0xe00000, 0x1000000, 0x1400000, 0x1800000, 0x1c00000, 0x2000000, = 0x2800000, 0x3000000, 0x3800000, 0x4000000, 0x5000000, 0x6000000, = 0x7000000, 0x8000000, 0xa000000, 0xc000000, 0xe000000,=20 > 0x10000000, 0x14000000, 0x18000000, 0x1c000000, 0x20000000, = 0x28000000, 0x30000000, 0x38000000, 0x40000000, 0x50000000, 0x60000000, = 0x70000000, 0x70001000} > (gdb) print/x __je_sz_index2size_tab > $7 =3D {0x8, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, 0xa0, = 0xc0, 0xe0, 0x100, 0x140, 0x180, 0x1c0, 0x200, 0x280, 0x300, 0x380, = 0x400, 0x500, 0x600, 0x700, 0x800, 0xa00, 0xc00, 0xe00, 0x1000,=20 > 0x1400, 0x1800, 0x1c00, 0x2000, 0x2800, 0x3000, 0x3800, 0x4000, = 0x5000, 0x6000, 0x7000, 0x8000, 0xa000, 0xc000, 0xe000, 0x10000, = 0x14000, 0x18000, 0x1c000, 0x20000, 0x28000, 0x30000, 0x38000,=20 > 0x40000, 0x50000, 0x60000, 0x70000, 0x80000, 0xa0000, 0xc0000, = 0xe0000, 0x100000, 0x140000, 0x180000, 0x1c0000, 0x200000, 0x280000, = 0x300000, 0x380000, 0x400000, 0x500000, 0x600000, 0x700000,=20 > 0x800000, 0xa00000, 0xc00000, 0xe00000, 0x1000000, 0x1400000, = 0x1800000, 0x1c00000, 0x2000000, 0x2800000, 0x3000000, 0x3800000, = 0x4000000, 0x5000000, 0x6000000, 0x7000000, 0x8000000, 0xa000000,=20 > 0xc000000, 0xe000000, 0x10000000, 0x14000000, 0x18000000, 0x1c000000, = 0x20000000, 0x28000000, 0x30000000, 0x38000000, 0x40000000, 0x50000000, = 0x60000000, 0x70000000} > (gdb) print/x __je_sz_size2index_tab > $2 =3D {0x0, 0x0, 0x1, 0x2, 0x2, 0x3, 0x3, 0x4, 0x4, 0x5, 0x5, 0x6, = 0x6, 0x7, 0x7, 0x8, 0x8, 0x9, 0x9, 0x9, 0x9, 0xa, 0xa, 0xa, 0xa, 0xb, = 0xb, 0xb, 0xb, 0xc, 0xc, 0xc, 0xc, 0xd, 0xd, 0xd, 0xd, 0xd,=20 > 0xd, 0xd, 0xd, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xf, 0xf, 0xf, = 0xf, 0xf, 0xf, 0xf, 0xf, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, = 0x11 , 0x12 ,=20 > 0x13 , 0x14 , 0x15 , 0x16 , 0x17 , 0x18 , 0x19 ,=20 > 0x1a , 0x1b , 0x1c } >=20 >=20 >> rpcbind hit an assert, failing ret =3D=3D sz_size2index_compute(size) = : >>=20 >> (gdb) bt >> #0 thr_kill () at thr_kill.S:4 >> #1 0x502f2170 in __raise (s=3D6) at /usr/src/lib/libc/gen/raise.c:52 >> #2 0x50251d04 in abort () at /usr/src/lib/libc/stdlib/abort.c:79 >> #3 0x5024f260 in sz_size2index_lookup (size=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:159 >> #4 sz_size2index (size=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:166 >> #5 imalloc_body (sopts=3D0xffffb360, dopts=3D0xffffb340, = tsd=3D0x5009a018) at jemalloc_jemalloc.c:2066 >> #6 0x50244874 in imalloc (sopts=3D0xffffb360, dopts=3D0xffffb340) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:331 >> #7 0x50244fe8 in __calloc (num=3D1, size=3D96) at = jemalloc_jemalloc.c:2498 >> #8 0x50265690 in svc_xprt_alloc () at = /usr/src/lib/libc/rpc/svc.c:541 >> #9 0x502635f4 in makefd_xprt (fd=3D14, sendsize=3D9000, = recvsize=3D9000) at /usr/src/lib/libc/rpc/svc_vc.c:250 >> #10 0x502644b4 in rendezvous_request (xprt=3D0x5004c000, = msg=3D) at /usr/src/lib/libc/rpc/svc_vc.c:315 >> #11 0x50265a98 in svc_getreq_common (fd=3D) at = /usr/src/lib/libc/rpc/svc.c:640 >> #12 0x50265d1c in svc_getreq_poll (pfdp=3D, = pollretval=3D1) at /usr/src/lib/libc/rpc/svc.c:739 >> #13 0x10018568 in my_svc_run () at = /usr/src/usr.sbin/rpcbind/rpcb_svc_com.c:1167 >> #14 0x10014ad8 in main (argc=3D, argv=3D) at /usr/src/usr.sbin/rpcbind/rpcbind.c:250 >> (gdb) up 3 >> #3 0x5024f260 in sz_size2index_lookup (size=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:159 >> 159 assert(ret =3D=3D sz_size2index_compute(size)); >> (gdb) print ret >> $1 =3D 0 >>=20 >> 154 JEMALLOC_ALWAYS_INLINE szind_t >> 155 sz_size2index_lookup(size_t size) { >> 156 assert(size <=3D SC_LOOKUP_MAXCLASS); >> 157 szind_t ret =3D (sz_size2index_tab[(size + (ZU(1) << = SC_LG_TINY_MIN) - 1) >> 158 >> SC_LG_TINY_MIN]); >> 159 assert(ret =3D=3D sz_size2index_compute(size)); >> 160 return ret; >> 161 } >=20 > gdb reports for sz_size2index_tab (really = JEMALLOC_N(sz_size2index_tab), > i.e., __je_sz_size2index_tab): >=20 > (gdb) print/x __je_sz_size2index_tab > $1 =3D {0x0 , 0x1a, 0x1b , 0x1c = } >=20 > Also: >=20 > (gdb) x/4x __je_arenas+16368/4 > 0x5034cab0 <__je_arenas+16368>: 0x00000000 0x00000000 = 0x00000000 0x00000000 > (gdb) print/x __je_arenas_lock = =20= > $8 =3D {{{prof_data =3D {tot_wait_time =3D {ns =3D 0x0}, max_wait_time = =3D {ns =3D 0x0}, n_wait_times =3D 0x0, n_spin_acquired =3D 0x0, = max_n_thds =3D 0x0, n_waiting_thds =3D {repr =3D 0x0}, n_owner_switches = =3D 0x0,=20 > prev_owner =3D 0x0, n_lock_ops =3D 0x0}, lock =3D 0x0, = postponed_next =3D 0x0, locked =3D {repr =3D 0x0}}}, witness =3D {name =3D= 0x0, rank =3D 0x0, comp =3D 0x0, opaque =3D 0x0, link =3D {qre_next =3D = 0x0,=20 > qre_prev =3D 0x0}}, lock_order =3D 0x0} > (gdb) print/x __je_narenas_auto > $9 =3D 0x0 > (gdb) print/x malloc_conf =20 > $10 =3D 0x0 > (gdb) print/x __je_ncpus=20 > $11 =3D 0x0 > (gdb) print/x __je_manual_arena_base > $12 =3D 0x0 > (gdb) print/x __je_sz_pind2sz_tab =20 > $13 =3D {0x0 } > (gdb) print/x __je_sz_index2size_tab > $14 =3D {0x0 } >=20 >=20 >> nfsd hit an assert, failing ret =3D=3D sz_size2index_compute(size) >=20 > [Correction: That should have referenced sz_index2size_lookup(index).] >=20 >> (also, but a different caller of sz_size2index): >=20 > [Correction: The "also" comment should be ignored: > sz_index2size_lookup(index) is referenced below.] >=20 >>=20 >> (gdb) bt >> #0 thr_kill () at thr_kill.S:4 >> #1 0x502b2170 in __raise (s=3D6) at /usr/src/lib/libc/gen/raise.c:52 >> #2 0x50211cc0 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 >> #3 0x50206104 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=3D0x50094018, ptr=3D0x50041028, tcache=3D0x50094138, = slow_path=3D) at jemalloc_jemalloc.c:2583 >> #6 0x50205cac in __je_free_default (ptr=3D0x50041028) at = jemalloc_jemalloc.c:2784 >> #7 0x50206294 in __free (ptr=3D0x50041028) at = jemalloc_jemalloc.c:2852 >> #8 0x50287ec8 in ns_src_free (src=3D0x50329004, = srclistsize=3D) at /usr/src/lib/libc/net/nsdispatch.c:452 >> #9 ns_dbt_free (dbt=3D0x50329000) at = /usr/src/lib/libc/net/nsdispatch.c:436 >> #10 vector_free (vec=3D0x50329000, count=3D, esize=3D12,= free_elem=3D) at /usr/src/lib/libc/net/nsdispatch.c:253 >> #11 nss_atexit () at /usr/src/lib/libc/net/nsdispatch.c:578 >> #12 0x5028d958 in __cxa_finalize (dso=3D0x0) at = /usr/src/lib/libc/stdlib/atexit.c:240 >> #13 0x502117f8 in exit (status=3D0) at = /usr/src/lib/libc/stdlib/exit.c:74 >> #14 0x10013f9c in child_cleanup (signo=3D) at = /usr/src/usr.sbin/nfsd/nfsd.c:969 >> #15 >> #16 0x00000000 in ?? () >>=20 >> (gdb) up 3 >> #3 0x50206104 in sz_index2size_lookup (index=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:200 >> 200 assert(ret =3D=3D sz_index2size_compute(index)); >>=20 >> (ret is optimized out.) >>=20 >> 197 JEMALLOC_ALWAYS_INLINE size_t >> 198 sz_index2size_lookup(szind_t index) { >> 199 size_t ret =3D (size_t)sz_index2size_tab[index]; >> 200 assert(ret =3D=3D sz_index2size_compute(index)); >> 201 return ret; >> 202 } >=20 > (gdb) print/x __je_sz_index2size_tab > $3 =3D {0x0 } >=20 > Also: >=20 > (gdb) x/4x __je_arenas+16368/4 > 0x5030cab0 <__je_arenas+16368>: 0x00000000 0x00000000 = 0x00000000 0x00000000 > (gdb) print/x __je_arenas_lock = =20= > $8 =3D {{{prof_data =3D {tot_wait_time =3D {ns =3D 0x0}, max_wait_time = =3D {ns =3D 0x0}, n_wait_times =3D 0x0, n_spin_acquired =3D 0x0, = max_n_thds =3D 0x0, n_waiting_thds =3D {repr =3D 0x0}, n_owner_switches = =3D 0x0,=20 > prev_owner =3D 0x0, n_lock_ops =3D 0x0}, lock =3D 0x0, = postponed_next =3D 0x0, locked =3D {repr =3D 0x0}}}, witness =3D {name =3D= 0x0, rank =3D 0x0, comp =3D 0x0, opaque =3D 0x0, link =3D {qre_next =3D = 0x0,=20 > qre_prev =3D 0x0}}, lock_order =3D 0x0} > (gdb) print/x __je_narenas_auto > $9 =3D 0x0 > (gdb) print/x malloc_conf =20 > $10 =3D 0x0 > (gdb) print/x __je_ncpus=20 > $11 =3D 0x0 > (gdb) print/x __je_manual_arena_base > $12 =3D 0x0 > (gdb) print/x __je_sz_pind2sz_tab =20 > $13 =3D {0x0 } > (gdb) print/x __je_sz_size2index_tab > $1 =3D {0x0 , 0x1a, 0x1b , 0x1c = } >=20 >> Booting and immediately trying something like: >>=20 >> service nfsd stop >>=20 >> did not lead to a failure. But may be after >> a while it would and be less drastic than a >> reboot or power down. >=20 > More detail: >=20 > So, for rpcbind and nfds at some point a large part of > __je_sz_size2index_tab is being stomped on, as is all of > __je_sz_index2size_tab and more. >=20 > For rpcbind, the following area is zero but in a > live process is not all-zero (I show the partially > non-zero live-process context instead of the all-zero > .core file content): >=20 > 0x5034cab0 <__je_arenas+16368>: 0x00000000 0x00000000 = 0x00000000 0x00000009 > 0x5034cac0 <__je_arenas_lock>: 0x00000000 0x00000000 = 0x00000000 0x00000000 > 0x5034cad0 <__je_arenas_lock+16>: 0x00000000 0x00000000 = 0x00000000 0x00000000 > 0x5034cae0 <__je_arenas_lock+32>: 0x00000000 0x00000000 = 0x00000000 0x00000000 > 0x5034caf0 <__je_arenas_lock+48>: 0x00000000 0x00000000 = 0x00000000 0x00000000 > 0x5034cb00 <__je_arenas_lock+64>: 0x00000000 0x5033f070 = 0x00000000 0x00000000 > 0x5034cb10 <__je_arenas_lock+80>: 0x5012bb04 0x00000003 = 0x00000000 0x00000000 > 0x5034cb20 <__je_arenas_lock+96>: 0x5034cb10 0x5034cb10 = 0x00000000 0x00000000 >=20 > Then the memory in the crash continues to be zero until: >=20 > 0x5034d000 <__je_sz_size2index_tab+384>: 0x1a1b1b1b = 0x1b1b1b1b 0x1b1b1b1b 0x1b1b1b1b >=20 > Notice the interesting page boundary for where non-zero > is first available again! >=20 > Between __je_arenas_lock and __je_sz_size2index_tab are: >=20 > 0x5034cb30 __je_narenas_auto > 0x5034cb38 malloc_conf > 0x5034cb3c __je_ncpus > 0x5034cb40 __je_manual_arena_base > 0x5034cb80 __je_sz_pind2sz_tab > 0x5034ccc0 __je_sz_index2size_tab > 0x5034ce80 __je_sz_size2index_tab >=20 > For nfsd, it is similar (again showing the partially > non-zero live process context instead of the all-zeros > from the .core file): >=20 > 0x5030cab0 <__je_arenas+16368>: 0x00000000 0x00000000 = 0x00000000 0x00000009 > 0x5030cac0 <__je_arenas_lock>: 0x00000000 0x00000000 = 0x00000000 0x00000000 > 0x5030cad0 <__je_arenas_lock+16>: 0x00000000 0x00000000 = 0x00000000 0x00000000 > 0x5030cae0 <__je_arenas_lock+32>: 0x00000000 0x00000000 = 0x00000000 0x00000000 > 0x5030caf0 <__je_arenas_lock+48>: 0x00000000 0x00000000 = 0x00000000 0x00000000 > 0x5030cb00 <__je_arenas_lock+64>: 0x00000000 0x502ff070 = 0x00000000 0x00000000 > 0x5030cb10 <__je_arenas_lock+80>: 0x500ebb04 0x00000003 = 0x00000000 0x00000000 > 0x5030cb20 <__je_arenas_lock+96>: 0x5030cb10 0x5030cb10 = 0x00000000 0x00000000 >=20 > Then the memory in the crash continues to be zero until: >=20 > 0x5030d000 <__je_sz_size2index_tab+384>: 0x1a1b1b1b = 0x1b1b1b1b 0x1b1b1b1b 0x1b1b1b1b >=20 > Notice the interesting page boundary for where non-zero > is first available again! >=20 > Between __je_arenas_lock and __je_sz_size2index_tab are: >=20 > 0x5030cb30 __je_narenas_auto > 0x5030cb38 malloc_conf > 0x5030cb3c __je_ncpus > 0x5030cb40 __je_manual_arena_base > 0x5030cb80 __je_sz_pind2sz_tab > 0x5030ccc0 __je_sz_index2size_tab > 0x5030ce80 __je_sz_size2index_tab >=20 >=20 > Note: because __je_arenas is normally > mostly zero for these contexts, I can > not tell where the memory trashing > started, only where it replaced non-zero > values with zeros. >=20 I got a mountd assert failure in sz_size2index_lookup while attempting __calloc during makefd_xprt. (gdb) bt #0 thr_kill () at thr_kill.S:4 #1 0x50301170 in __raise (s=3D6) at /usr/src/lib/libc/gen/raise.c:52 #2 0x50260cc0 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 #3 0x5025e260 in sz_size2index_lookup (size=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:159 #4 sz_size2index (size=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:166 #5 imalloc_body (sopts=3D0xffffd000, dopts=3D0xffffcfe0, = tsd=3D0x50094018) at jemalloc_jemalloc.c:2066 #6 0x50253874 in imalloc (sopts=3D0xffffd000, dopts=3D0xffffcfe0) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:331 #7 0x50253fe8 in __calloc (num=3D1, size=3D96) at = jemalloc_jemalloc.c:2498 #8 0x50274690 in svc_xprt_alloc () at /usr/src/lib/libc/rpc/svc.c:541 #9 0x502725f4 in makefd_xprt (fd=3D10, sendsize=3D9000, recvsize=3D9000) = at /usr/src/lib/libc/rpc/svc_vc.c:250 #10 0x502734b4 in rendezvous_request (xprt=3D0x5007b120, msg=3D) at /usr/src/lib/libc/rpc/svc_vc.c:315 #11 0x50274a98 in svc_getreq_common (fd=3D) at = /usr/src/lib/libc/rpc/svc.c:640 #12 0x502748e0 in svc_getreqset (readfds=3D) at = /usr/src/lib/libc/rpc/svc.c:611 #13 0x1001434c in main (argc=3D, argv=3D0xffffde3c) at = /usr/src/usr.sbin/mountd/mountd.c:683 (gdb) up 3 #3 0x5025e260 in sz_size2index_lookup (size=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:159 159 assert(ret =3D=3D sz_size2index_compute(size)); Again there is that area of memory that has been zeroed, with the same stopping point in __je_sz_size2index_tab: (gdb) print/x __je_narenas_auto $2 =3D 0x0 (gdb) print/x malloc_conf=20 $3 =3D 0x0 (gdb) print/x __je_ncpus $4 =3D 0x0 (gdb) print/x __je_manual_arena_base $5 =3D 0x0 (gdb) print/x __je_sz_pind2sz_tab $6 =3D {0x0 } (gdb) print/x __je_sz_size2index_tab $7 =3D {0x0 , 0x1a, 0x1b , 0x1c = } Showing where the zeroing stopped: . . . (gdb) x/156x __je_sz_size2index_tab 0x5035be80 <__je_sz_size2index_tab>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5035be90 <__je_sz_size2index_tab+16>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5035bea0 <__je_sz_size2index_tab+32>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5035beb0 <__je_sz_size2index_tab+48>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5035bec0 <__je_sz_size2index_tab+64>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5035bed0 <__je_sz_size2index_tab+80>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5035bee0 <__je_sz_size2index_tab+96>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5035bef0 <__je_sz_size2index_tab+112>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bf00 <__je_sz_size2index_tab+128>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bf10 <__je_sz_size2index_tab+144>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bf20 <__je_sz_size2index_tab+160>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bf30 <__je_sz_size2index_tab+176>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bf40 <__je_sz_size2index_tab+192>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bf50 <__je_sz_size2index_tab+208>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bf60 <__je_sz_size2index_tab+224>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bf70 <__je_sz_size2index_tab+240>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bf80 <__je_sz_size2index_tab+256>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bf90 <__je_sz_size2index_tab+272>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bfa0 <__je_sz_size2index_tab+288>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bfb0 <__je_sz_size2index_tab+304>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bfc0 <__je_sz_size2index_tab+320>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bfd0 <__je_sz_size2index_tab+336>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bfe0 <__je_sz_size2index_tab+352>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035bff0 <__je_sz_size2index_tab+368>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5035c000 <__je_sz_size2index_tab+384>: 0x1a1b1b1b = 0x1b1b1b1b 0x1b1b1b1b 0x1b1b1b1b 0x5035c010 <__je_sz_size2index_tab+400>: 0x1b1b1b1b = 0x1b1b1b1b 0x1b1b1b1b 0x1b1b1b1b 0x5035c020 <__je_sz_size2index_tab+416>: 0x1b1b1b1b = 0x1b1b1b1b 0x1b1b1b1b 0x1b1b1b1b 0x5035c030 <__je_sz_size2index_tab+432>: 0x1b1b1b1b = 0x1b1b1b1b 0x1b1b1b1b 0x1b1b1b1b 0x5035c040 <__je_sz_size2index_tab+448>: 0x1b1c1c1c = 0x1c1c1c1c 0x1c1c1c1c 0x1c1c1c1c 0x5035c050 <__je_sz_size2index_tab+464>: 0x1c1c1c1c = 0x1c1c1c1c 0x1c1c1c1c 0x1c1c1c1c 0x5035c060 <__je_sz_size2index_tab+480>: 0x1c1c1c1c = 0x1c1c1c1c 0x1c1c1c1c 0x1c1c1c1c 0x5035c070 <__je_sz_size2index_tab+496>: 0x1c1c1c1c = 0x1c1c1c1c 0x1c1c1c1c 0x1c1c1c1c 0x5035c080 <__je_sz_size2index_tab+512>: 0x1c000000 = 0x00000000 0x50303474 0x00000000 0x5035c090: 0x00000000 0x00000000 0x00000000 = 0x00000000 0x5035c0a0: 0x00000000 0x00000000 0x00000000 = 0x00000000 0x5035c0b0: 0x00000000 0x00000000 0x00000000 = 0x00000000 0x5035c0c0: 0x00000000 0x00000000 0x00000000 = 0x00000000 0x5035c0d0: 0x00000000 0x00000000 0x00000000 = 0x00000000 0x5035c0e0: 0x00000000 0x00000000 0x00000000 = 0x00000000 Again: a nice page boundary: 0x5035c000 for where the zeros stop. Note that, despite the address ranges shifting around between programs, the same global variables are being stomped on, stopping at the same index into __je_sz_size2index_tab in each of the 3 programs. It always is page aligned there in my context. (The sshd example is different. I've yet to explore it much.) =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 Thu May 7 19:32: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 CB8C82E318A; Thu, 7 May 2020 19:32:52 +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 49J3X45Npgz4d1V; Thu, 7 May 2020 19:32:52 +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 B336F1E2D4; Thu, 7 May 2020 19:32:52 +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 047JWqjT031921; Thu, 7 May 2020 19:32:52 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 047JWoH3031909; Thu, 7 May 2020 19:32:50 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202005071932.047JWoH3031909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Thu, 7 May 2020 19:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360794 - in head/sys: conf kern powerpc/aim powerpc/include powerpc/ofw powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head/sys: conf kern powerpc/aim powerpc/include powerpc/ofw powerpc/powerpc X-SVN-Commit-Revision: 360794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 19:32:52 -0000 Author: bdragon Date: Thu May 7 19:32:49 2020 New Revision: 360794 URL: https://svnweb.freebsd.org/changeset/base/360794 Log: [PowerPC] kernel ifunc support for powerpc*, fix ppc64 relocation oddities. This is a general cleanup of the relocatable kernel support on powerpc, needed to enable kernel ifuncs. * Fix some relocatable issues in the kernel linker, and change to using a RELOCATABLE_KERNEL #define instead of #ifdef __powerpc__ for parts that other platforms can use in the future if they wish to have ET_DYN kernels. * Get rid of the DB_STOFFS hack now that the kernel is relocated to the DMAP properly across the board on powerpc64. * Add powerpc64 and powerpc32 ifunc functionality. * Allow AIM64 virtual mode OF kernels to run from the DMAP like other AIM64 by implementing a virtual mode restart. This fixes the runtime address on PowerMac G5. * Fix symbol relocation problems on post-relocation kernels by relocating the symbol table. * Add an undocumented method for supplying kernel symbols on powernv and other powerpc machines using linux-style kernel/initrd loading -- If you pass the kernel in as the initrd as well, the copy resident in initrd will be used as a source for symbols when initializing the debugger. This method is subject to removal once we have a better way of doing this. Approved by: jhibbits Relnotes: yes Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D23156 Modified: head/sys/conf/kern.pre.mk head/sys/conf/ldscript.powerpc head/sys/conf/ldscript.powerpc64 head/sys/conf/ldscript.powerpcspe head/sys/kern/link_elf.c head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/locore64.S head/sys/powerpc/include/db_machdep.h head/sys/powerpc/include/param.h head/sys/powerpc/ofw/ofw_initrd.c head/sys/powerpc/powerpc/elf32_machdep.c head/sys/powerpc/powerpc/elf64_machdep.c head/sys/powerpc/powerpc/machdep.c Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu May 7 19:19:39 2020 (r360793) +++ head/sys/conf/kern.pre.mk Thu May 7 19:32:49 2020 (r360794) @@ -161,9 +161,9 @@ LDFLAGS+= --build-id=sha1 .endif .if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "i386") && \ + ${MACHINE_CPUARCH} == "i386" || ${MACHINE} == "powerpc") && \ defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == "" -.error amd64/arm64/i386 kernel requires linker ifunc support +.error amd64/arm64/i386/ppc* kernel requires linker ifunc support .endif .if ${MACHINE_CPUARCH} == "amd64" LDFLAGS+= -z max-page-size=2097152 Modified: head/sys/conf/ldscript.powerpc ============================================================================== --- head/sys/conf/ldscript.powerpc Thu May 7 19:19:39 2020 (r360793) +++ head/sys/conf/ldscript.powerpc Thu May 7 19:32:49 2020 (r360794) @@ -6,6 +6,11 @@ OUTPUT_ARCH(powerpc) ENTRY(__start) SEARCH_DIR(/usr/lib); PROVIDE (__stack = 0); +PHDRS +{ + kernel PT_LOAD; + dynamic PT_DYNAMIC; +} SECTIONS { /* Read-only sections, merged into text segment: */ @@ -21,7 +26,7 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.gnu.linkonce.t*) - } =0 + } :kernel =0 _etext = .; PROVIDE (etext = .); @@ -77,7 +82,7 @@ SECTIONS .got.plt : { *(.got.plt) } - .dynamic : { *(.dynamic) } + .dynamic : { *(.dynamic) } :kernel :dynamic /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. The current compiler no longer needs this, but keep it around for 2.7.2 */ @@ -96,7 +101,7 @@ SECTIONS /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ - .sdata : { *(.sdata) } + .sdata : { *(.sdata) } :kernel _edata = .; PROVIDE (edata = .); .sbss : Modified: head/sys/conf/ldscript.powerpc64 ============================================================================== --- head/sys/conf/ldscript.powerpc64 Thu May 7 19:19:39 2020 (r360793) +++ head/sys/conf/ldscript.powerpc64 Thu May 7 19:32:49 2020 (r360794) @@ -8,15 +8,15 @@ SEARCH_DIR(/usr/lib); PROVIDE (__stack = 0); PHDRS { - text PT_LOAD ; - dynamic PT_DYNAMIC ; + kernel PT_LOAD; + dynamic PT_DYNAMIC; } SECTIONS { /* Low-address wrapper for bootloaders (kexec/kboot) that can't parse ELF */ . = kernbase - 0x100; - .kboot : { *(.text.kboot) } :text + .kboot : { *(.text.kboot) } :kernel /* Read-only sections, merged into text segment: */ . = kernbase; @@ -106,7 +106,7 @@ SECTIONS .got : ALIGN(8) { __tocbase = .; *(.got) } .toc : ALIGN(8) { *(.toc) } - .dynamic : { *(.dynamic) } :text :dynamic + .dynamic : { *(.dynamic) } :kernel :dynamic /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. The current compiler no longer needs this, but keep it around for 2.7.2 */ @@ -125,7 +125,7 @@ SECTIONS /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ - .sdata : { *(.sdata) } + .sdata : { *(.sdata) } :kernel _edata = .; PROVIDE (edata = .); .sbss : Modified: head/sys/conf/ldscript.powerpcspe ============================================================================== --- head/sys/conf/ldscript.powerpcspe Thu May 7 19:19:39 2020 (r360793) +++ head/sys/conf/ldscript.powerpcspe Thu May 7 19:32:49 2020 (r360794) @@ -6,6 +6,11 @@ OUTPUT_ARCH(powerpc) ENTRY(__start) SEARCH_DIR(/usr/lib); PROVIDE (__stack = 0); +PHDRS +{ + kernel PT_LOAD; + dynamic PT_DYNAMIC; +} SECTIONS { /* Read-only sections, merged into text segment: */ @@ -21,7 +26,7 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.gnu.linkonce.t*) - } =0 + } :kernel =0 _etext = .; PROVIDE (etext = .); @@ -78,7 +83,7 @@ SECTIONS .got.plt : { *(.got.plt) } - .dynamic : { *(.dynamic) } + .dynamic : { *(.dynamic) } :kernel :dynamic /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. The current compiler no longer needs this, but keep it around for 2.7.2 */ @@ -97,7 +102,7 @@ SECTIONS /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ - .sdata : { *(.sdata) } + .sdata : { *(.sdata) } :kernel _edata = .; PROVIDE (edata = .); .sbss : Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Thu May 7 19:19:39 2020 (r360793) +++ head/sys/kern/link_elf.c Thu May 7 19:32:49 2020 (r360794) @@ -388,7 +388,9 @@ link_elf_link_common_finish(linker_file_t lf) return (0); } +#ifdef RELOCATABLE_KERNEL extern vm_offset_t __startkernel, __endkernel; +#endif static unsigned long kern_relbase = KERNBASE; @@ -424,7 +426,7 @@ link_elf_init(void* arg) ef = (elf_file_t) linker_kernel_file; ef->preloaded = 1; -#ifdef __powerpc__ +#ifdef RELOCATABLE_KERNEL ef->address = (caddr_t) (__startkernel - KERNBASE); #else ef->address = 0; @@ -436,7 +438,7 @@ link_elf_init(void* arg) if (dp != NULL) parse_dynamic(ef); -#ifdef __powerpc__ +#ifdef RELOCATABLE_KERNEL linker_kernel_file->address = (caddr_t)__startkernel; linker_kernel_file->size = (intptr_t)(__endkernel - __startkernel); kern_relbase = (unsigned long)__startkernel; @@ -1860,7 +1862,7 @@ link_elf_strtab_get(linker_file_t lf, caddr_t *strtab) return (ef->ddbstrcnt); } -#if defined(__i386__) || defined(__amd64__) || defined(__aarch64__) +#if defined(__i386__) || defined(__amd64__) || defined(__aarch64__) || defined(__powerpc__) /* * Use this lookup routine when performing relocations early during boot. * The generic lookup routine depends on kobj, which is not initialized @@ -1896,8 +1898,14 @@ link_elf_ireloc(caddr_t kmdp) ef->modptr = kmdp; ef->dynamic = (Elf_Dyn *)&_DYNAMIC; - parse_dynamic(ef); + +#ifdef RELOCATABLE_KERNEL + ef->address = (caddr_t) (__startkernel - KERNBASE); +#else ef->address = 0; +#endif + parse_dynamic(ef); + link_elf_preload_parse_symbols(ef); relocate_file1(ef, elf_lookup_ifunc, elf_reloc, true); } Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Thu May 7 19:19:39 2020 (r360793) +++ head/sys/powerpc/aim/aim_machdep.c Thu May 7 19:32:49 2020 (r360794) @@ -161,6 +161,7 @@ extern void *dsmisstrap, *dsmisssize; extern void *ap_pcpu; extern void __restartkernel(vm_offset_t, vm_offset_t, vm_offset_t, void *, uint32_t, register_t offset, register_t msr); +extern void __restartkernel_virtual(vm_offset_t, vm_offset_t, vm_offset_t, void *, uint32_t, register_t offset, register_t msr); void aim_early_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp, uint32_t mdp_cookie); @@ -184,13 +185,22 @@ aim_early_init(vm_offset_t fdt, vm_offset_t toc, vm_of #ifdef __powerpc64__ /* - * If in real mode, relocate to high memory so that the kernel + * Relocate to high memory so that the kernel * can execute from the direct map. + * + * If we are in virtual mode already, use a special entry point + * that sets up a temporary DMAP to execute from until we can + * properly set up the MMU. */ - if (!(mfmsr() & PSL_DR) && - (vm_offset_t)&aim_early_init < DMAP_BASE_ADDRESS) - __restartkernel(fdt, 0, ofentry, mdp, mdp_cookie, - DMAP_BASE_ADDRESS, mfmsr()); + if ((vm_offset_t)&aim_early_init < DMAP_BASE_ADDRESS) { + if (mfmsr() & PSL_DR) { + __restartkernel_virtual(fdt, 0, ofentry, mdp, + mdp_cookie, DMAP_BASE_ADDRESS, mfmsr()); + } else { + __restartkernel(fdt, 0, ofentry, mdp, mdp_cookie, + DMAP_BASE_ADDRESS, mfmsr()); + } + } #endif /* Various very early CPU fix ups */ Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Thu May 7 19:19:39 2020 (r360793) +++ head/sys/powerpc/aim/locore64.S Thu May 7 19:32:49 2020 (r360794) @@ -200,6 +200,57 @@ ASENTRY_NOPROF(__start) /* Unreachable */ b . +ASENTRY_NOPROF(__restartkernel_virtual) + /* + * When coming in via this entry point, we need to alter the SLB to + * shadow the segment register emulation entries in DMAP space. + * We need to do this dance because we are running with virtual-mode + * OpenFirmware and have not yet taken over the MMU. + * + * Assumptions: + * 1) The kernel is currently identity-mapped. + * 2) We are currently executing at an address compatible with + * real mode. + * 3) The first 16 SLB entries are emulating SRs. + * 4) The rest of the SLB is not in use. + * 5) OpenFirmware is not manipulating the SLB at runtime. + * 6) We are running on 64-bit AIM. + * + * Tested on a G5. + */ + mfmsr %r14 + /* Switch to real mode because we are about to mess with the SLB. */ + andi. %r14, %r14, ~(PSL_DR|PSL_IR|PSL_ME|PSL_RI)@l + mtmsr %r14 + isync + /* Prepare variables for later use. */ + li %r14, 0 + li %r18, 0 + oris %r18, %r18, 0xc000 + sldi %r18, %r18, 32 /* r18: 0xc000000000000000 */ +1: + /* + * Loop over the first 16 SLB entries. + * Offset the SLBE into the DMAP, add 16 to the index, and write + * it back to the SLB. + */ + /* XXX add more safety checks */ + slbmfev %r15, %r14 + slbmfee %r16, %r14 + or %r16, %r16, %r14 /* index is 0-15 */ + ori %r16, %r16, 0x10 /* add 16 to index. */ + or %r16, %r16, %r18 /* SLBE DMAP offset */ + rldicr %r17, %r16, 0, 37 /* Invalidation SLBE */ + + isync + slbie %r17 + /* isync */ + slbmte %r15, %r16 + isync + addi %r14, %r14, 1 + cmpdi %r14, 16 + blt 1b + ASENTRY_NOPROF(__restartkernel) /* * r3-r7: arguments to go to __start Modified: head/sys/powerpc/include/db_machdep.h ============================================================================== --- head/sys/powerpc/include/db_machdep.h Thu May 7 19:19:39 2020 (r360793) +++ head/sys/powerpc/include/db_machdep.h Thu May 7 19:32:49 2020 (r360794) @@ -85,8 +85,4 @@ typedef intptr_t db_expr_t; /* expression - signed */ #define inst_load(ins) 0 #define inst_store(ins) 0 -#ifdef __powerpc64__ -#define DB_STOFFS(offs) ((offs) & ~DMAP_BASE_ADDRESS) -#endif - #endif /* _POWERPC_DB_MACHDEP_H_ */ Modified: head/sys/powerpc/include/param.h ============================================================================== --- head/sys/powerpc/include/param.h Thu May 7 19:19:39 2020 (r360793) +++ head/sys/powerpc/include/param.h Thu May 7 19:32:49 2020 (r360794) @@ -109,6 +109,8 @@ #define MAXPAGESIZES 1 /* maximum number of supported page sizes */ +#define RELOCATABLE_KERNEL 1 /* kernel may relocate during startup */ + #ifndef KSTACK_PAGES #ifdef __powerpc64__ #define KSTACK_PAGES 8 /* includes pcb */ Modified: head/sys/powerpc/ofw/ofw_initrd.c ============================================================================== --- head/sys/powerpc/ofw/ofw_initrd.c Thu May 7 19:19:39 2020 (r360793) +++ head/sys/powerpc/ofw/ofw_initrd.c Thu May 7 19:32:49 2020 (r360794) @@ -36,6 +36,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include @@ -58,6 +60,8 @@ ofw_initrd_probe_and_attach(void *junk) vm_paddr_t start, end; pcell_t cell[2]; ssize_t size; + u_char *taste; + Elf_Ehdr ehdr; if (!hw_direct_map) return; @@ -91,7 +95,15 @@ ofw_initrd_probe_and_attach(void *junk) } if (end - start > 0) { - mfs_root = (u_char *) PHYS_TO_DMAP(start); + taste = (u_char*) PHYS_TO_DMAP(start); + memcpy(&ehdr, taste, sizeof(ehdr)); + + if (IS_ELF(ehdr)) { + printf("ofw_initrd: initrd is kernel image!\n"); + return; + } + + mfs_root = taste; mfs_root_size = end - start; printf("ofw_initrd: initrd loaded at 0x%08lx-0x%08lx\n", start, end); Modified: head/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf32_machdep.c Thu May 7 19:19:39 2020 (r360793) +++ head/sys/powerpc/powerpc/elf32_machdep.c Thu May 7 19:32:49 2020 (r360794) @@ -221,10 +221,10 @@ elf32_dump_thread(struct thread *td, void *dst, size_t #ifndef __powerpc64__ bool -elf_is_ifunc_reloc(Elf_Size r_info __unused) +elf_is_ifunc_reloc(Elf_Size r_info) { - return (false); + return (ELF_R_TYPE(r_info) == R_PPC_IRELATIVE); } /* Process one elf relocation with addend. */ @@ -235,7 +235,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas Elf_Addr *where; Elf_Half *hwhere; Elf_Addr addr; - Elf_Addr addend; + Elf_Addr addend, val; Elf_Word rtype, symidx; const Elf_Rela *rela; int error; @@ -315,6 +315,13 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas if (error != 0) return -1; *where = elf_relocaddr(lf, addr + addend); + break; + + case R_PPC_IRELATIVE: + addr = relocbase + addend; + val = ((Elf32_Addr (*)(void))addr)(); + if (*where != val) + *where = val; break; default: Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Thu May 7 19:19:39 2020 (r360793) +++ head/sys/powerpc/powerpc/elf64_machdep.c Thu May 7 19:32:49 2020 (r360794) @@ -282,10 +282,10 @@ elf64_dump_thread(struct thread *td, void *dst, size_t } bool -elf_is_ifunc_reloc(Elf_Size r_info __unused) +elf_is_ifunc_reloc(Elf_Size r_info) { - return (false); + return (ELF_R_TYPE(r_info) == R_PPC_IRELATIVE); } /* Process one elf relocation with addend. */ @@ -295,7 +295,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas { Elf_Addr *where; Elf_Addr addr; - Elf_Addr addend; + Elf_Addr addend, val; Elf_Word rtype, symidx; const Elf_Rela *rela; int error; @@ -340,6 +340,13 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas *where = addr; #endif __asm __volatile("dcbst 0,%0; sync" :: "r"(where) : "memory"); + break; + + case R_PPC_IRELATIVE: + addr = relocbase + addend; + val = ((Elf64_Addr (*)(void))addr)(); + if (*where != val) + *where = val; break; default: Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Thu May 7 19:19:39 2020 (r360793) +++ head/sys/powerpc/powerpc/machdep.c Thu May 7 19:32:49 2020 (r360794) @@ -113,6 +113,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -161,6 +162,8 @@ SYSCTL_INT(_machdep, CPU_CACHELINE, cacheline_size, uintptr_t powerpc_init(vm_offset_t, vm_offset_t, vm_offset_t, void *, uint32_t); +static void fake_preload_metadata(void); + long Maxmem = 0; long realmem = 0; @@ -246,6 +249,11 @@ void aim_early_init(vm_offset_t fdt, vm_offset_t toc, void aim_cpu_init(vm_offset_t toc); void booke_cpu_init(void); +#ifdef DDB +static void load_external_symtab(void); +static void displace_symbol_table(vm_offset_t, vm_offset_t, vm_offset_t); +#endif + uintptr_t powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp, uint32_t mdp_cookie) @@ -254,10 +262,13 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs struct cpuref bsp; vm_offset_t startkernel, endkernel; char *env; + void *kmdp = NULL; bool ofw_bootargs = false; + bool symbols_provided = false; #ifdef DDB vm_offset_t ksym_start; vm_offset_t ksym_end; + vm_offset_t ksym_sz; #endif /* First guess at start/end kernel positions */ @@ -287,15 +298,29 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs #endif /* + * At this point, we are executing in our correct memory space. + * Book-E started there, and AIM has done an rfi and restarted + * execution from _start. + * + * We may still be in real mode, however. If we are running out of + * the direct map on 64 bit, this is possible to do. + */ + + /* * Parse metadata if present and fetch parameters. Must be done * before console is inited so cninit gets the right value of * boothowto. */ if (mdp != NULL) { - void *kmdp = NULL; + /* + * Starting up from loader. + * + * Full metadata has been provided, but we need to figure + * out the correct address to relocate it to. + */ char *envp = NULL; uintptr_t md_offset = 0; - vm_paddr_t kernelendphys; + vm_paddr_t kernelstartphys, kernelendphys; #ifdef AIM if ((uintptr_t)&powerpc_init > DMAP_BASE_ADDRESS) @@ -306,6 +331,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs preload_metadata = mdp; if (md_offset > 0) { + /* Translate phys offset into DMAP offset. */ preload_metadata += md_offset; preload_bootstrap_relocate(md_offset); } @@ -321,6 +347,9 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs if (fdt != 0) fdt += md_offset; } + kernelstartphys = MD_FETCH(kmdp, MODINFO_ADDR, + vm_offset_t); + /* kernelstartphys is already relocated. */ kernelendphys = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t); if (kernelendphys != 0) @@ -329,13 +358,35 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); + ksym_sz = *(Elf_Size*)ksym_start; + + /* + * Loader already handled displacing to the load + * address, but we still need to displace it to the + * DMAP. + */ + displace_symbol_table( + (vm_offset_t)(ksym_start + sizeof(Elf_Size)), + ksym_sz, md_offset); + db_fetch_ksymtab(ksym_start, ksym_end); + symbols_provided = true; #endif } } else { + /* + * Self-loading kernel, we have to fake up metadata. + * + * Since we are creating the metadata from the final + * memory space, we don't need to call + * preload_boostrap_relocate(). + */ + fake_preload_metadata(); + kmdp = preload_search_by_type("elf kernel"); init_static_kenv(init_kenv, sizeof(init_kenv)); ofw_bootargs = true; } + /* Store boot environment state */ OF_initial_setup((void *)fdt, NULL, (int (*)(void *))ofentry); @@ -365,6 +416,11 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs */ OF_bootstrap(); +#ifdef DDB + if (!symbols_provided && hw_direct_map) + load_external_symtab(); +#endif + if (ofw_bootargs) ofw_parse_bootargs(); @@ -412,6 +468,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs */ pmap_bootstrap(startkernel, endkernel); mtmsr(psl_kernset & ~PSL_EE); + link_elf_ireloc(kmdp); /* * Initialize params/tunables that are derived from memsize @@ -447,6 +504,178 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs return (((uintptr_t)thread0.td_pcb - (sizeof(struct callframe) - 3*sizeof(register_t))) & ~15UL); +} + +#ifdef DDB +/* + * XXX Figure out where to move this. + */ +static void +displace_symbol_table(vm_offset_t ksym_start, + vm_offset_t ksym_sz, vm_offset_t displacement) { + Elf_Sym *sym; + + /* + * Relocate the symbol table to our final load address. + */ + for (sym = (Elf_Sym *)ksym_start; + (vm_paddr_t)sym < (ksym_start + ksym_sz); + sym++) { + if (sym->st_name == 0 || + sym->st_shndx == SHN_UNDEF || + sym->st_value == 0) + continue; + if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT && + ELF_ST_TYPE(sym->st_info) != STT_FUNC && + ELF_ST_TYPE(sym->st_info) != STT_NOTYPE) + continue; + /* Skip relocating any implausible symbols */ + if (sym->st_value > KERNBASE) + sym->st_value += displacement; + } +} + +/* + * On powernv, we might not have symbols loaded via loader. However, if the + * user passed the kernel in as the initrd as well, we can manually load it + * via reinterpreting the initrd copy of the kernel. + */ +static void +load_external_symtab(void) { + phandle_t chosen; + vm_paddr_t start, end; + pcell_t cell[2]; + ssize_t size; + u_char *kernelimg; + + int i; + + Elf_Ehdr *ehdr; + Elf_Phdr *phdr; + Elf_Shdr *shdr; + + vm_offset_t ksym_start, ksym_sz, kstr_start, kstr_sz; + + if (!hw_direct_map) + return; + + chosen = OF_finddevice("/chosen"); + if (chosen <= 0) + return; + + if (!OF_hasprop(chosen, "linux,initrd-start") || + !OF_hasprop(chosen, "linux,initrd-end")) + return; + + size = OF_getencprop(chosen, "linux,initrd-start", cell, sizeof(cell)); + if (size == 4) + start = cell[0]; + else if (size == 8) + start = (uint64_t)cell[0] << 32 | cell[1]; + else + return; + + size = OF_getencprop(chosen, "linux,initrd-end", cell, sizeof(cell)); + if (size == 4) + end = cell[0]; + else if (size == 8) + end = (uint64_t)cell[0] << 32 | cell[1]; + else + return; + + if (!(end - start > 0)) + return; + + kernelimg = (u_char *) PHYS_TO_DMAP(start); + + ehdr = (Elf_Ehdr *)kernelimg; + + if (!IS_ELF(*ehdr)) + return; + + phdr = (Elf_Phdr *)(kernelimg + ehdr->e_phoff); + shdr = (Elf_Shdr *)(kernelimg + ehdr->e_shoff); + + ksym_start = 0; + ksym_sz = 0; + kstr_start = 0; + kstr_sz = 0; + for (i = 0; i < ehdr->e_shnum; i++) { + if (shdr[i].sh_type == SHT_SYMTAB) { + ksym_start = (vm_offset_t)(kernelimg + + shdr[i].sh_offset); + ksym_sz = (vm_offset_t)(shdr[i].sh_size); + kstr_start = (vm_offset_t)(kernelimg + + shdr[shdr[i].sh_link].sh_offset); + kstr_sz = (vm_offset_t) + (shdr[shdr[i].sh_link].sh_size); + } + } + + if (ksym_start != 0 && kstr_start != 0 && ksym_sz != 0 && + kstr_sz != 0 && ksym_start < kstr_start) { + + displace_symbol_table(ksym_start, ksym_sz, + (__startkernel - KERNBASE)); + ksymtab = ksym_start; + ksymtab_size = ksym_sz; + kstrtab = kstr_start; + } + +}; +#endif + +/* + * When not being loaded from loader, we need to create our own metadata + * so we can interact with the kernel linker. + */ +static void +fake_preload_metadata(void) { + /* We depend on dword alignment here. */ + static uint32_t fake_preload[36] __aligned(8); + int i = 0; + + fake_preload[i++] = MODINFO_NAME; + fake_preload[i++] = strlen("kernel") + 1; + strcpy((char*)&fake_preload[i], "kernel"); + /* ['k' 'e' 'r' 'n'] ['e' 'l' '\0' ..] */ + i += 2; + + fake_preload[i++] = MODINFO_TYPE; + fake_preload[i++] = strlen("elf kernel") + 1; + strcpy((char*)&fake_preload[i], "elf kernel"); + /* ['e' 'l' 'f' ' '] ['k' 'e' 'r' 'n'] ['e' 'l' '\0' ..] */ + i += 3; + +#ifdef __powerpc64__ + /* Padding -- Fields start on u_long boundaries */ + fake_preload[i++] = 0; +#endif + + fake_preload[i++] = MODINFO_ADDR; + fake_preload[i++] = sizeof(vm_offset_t); + *(vm_offset_t *)&fake_preload[i] = + (vm_offset_t)(__startkernel); + i += (sizeof(vm_offset_t) / 4); + + fake_preload[i++] = MODINFO_SIZE; + fake_preload[i++] = sizeof(vm_offset_t); + *(vm_offset_t *)&fake_preload[i] = + (vm_offset_t)(__endkernel) - (vm_offset_t)(__startkernel); + i += (sizeof(vm_offset_t) / 4); + + /* + * MODINFOMD_SSYM and MODINFOMD_ESYM cannot be provided here, + * as the memory comes from outside the loaded ELF sections. + * + * If the symbols are being provided by other means (MFS), the + * tables will be loaded into the debugger directly. + */ + + /* Null field at end to mark end of data. */ + fake_preload[i++] = 0; + fake_preload[i] = 0; + preload_metadata = (void*)fake_preload; } /* From owner-svn-src-head@freebsd.org Thu May 7 19:51: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 036622E39BC; Thu, 7 May 2020 19:51:54 +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 49J3y15zwyz4f1y; Thu, 7 May 2020 19:51:53 +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 C8CE61E67E; Thu, 7 May 2020 19:51:53 +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 047JprVb041538; Thu, 7 May 2020 19:51:53 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 047Jpr6Z041537; Thu, 7 May 2020 19:51:53 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005071951.047Jpr6Z041537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 7 May 2020 19:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360796 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 360796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 19:51:54 -0000 Author: manu Date: Thu May 7 19:51:53 2020 New Revision: 360796 URL: https://svnweb.freebsd.org/changeset/base/360796 Log: Bump __FreeBSD_version after linuxkpi changes Requested by: zeising Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu May 7 19:38:39 2020 (r360795) +++ head/sys/sys/param.h Thu May 7 19:51:53 2020 (r360796) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300093 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300094 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Thu May 7 20:29: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 176432E4804; Thu, 7 May 2020 20:29:39 +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 49J4nZ6wpKz3D1y; Thu, 7 May 2020 20:29:38 +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 E92A51ECC9; Thu, 7 May 2020 20:29:38 +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 047KTcfA063306; Thu, 7 May 2020 20:29:38 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 047KTcft063304; Thu, 7 May 2020 20:29:38 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <202005072029.047KTcft063304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 7 May 2020 20:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360798 - 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: 360798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 20:29:39 -0000 Author: rrs Date: Thu May 7 20:29:38 2020 New Revision: 360798 URL: https://svnweb.freebsd.org/changeset/base/360798 Log: When in the SYN-SENT state bbr and rack will not properly send an ACK but instead start the D-ACK timer. This causes so_reuseport_lb_test to fail since it slows down how quickly the program runs until the timeout occurs and fails the test Sponsored by: Netflix inc. Differential Revision: https://reviews.freebsd.org/D24747 Modified: head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Thu May 7 20:27:32 2020 (r360797) +++ head/sys/netinet/tcp_stacks/bbr.c Thu May 7 20:29:38 2020 (r360798) @@ -4078,6 +4078,7 @@ bbr_cong_signal(struct tcpcb *tp, struct tcphdr *th, u */ #define DELAY_ACK(tp, bbr, nsegs) \ (((tp->t_flags & TF_RXWIN0SENT) == 0) && \ + ((tp->t_flags & TF_DELACK) == 0) && \ ((bbr->bbr_segs_rcvd + nsegs) < tp->t_delayed_ack) && \ (tp->t_delayed_ack || (tp->t_flags & TF_NEEDSYN))) @@ -8992,7 +8993,7 @@ bbr_do_syn_sent(struct mbuf *m, struct tcphdr *th, str * If there's data, delay ACK; if there's also a FIN ACKNOW * will be turned on later. */ - if (DELAY_ACK(tp, bbr, 1) && tlen != 0 && (tfo_partial == 0)) { + if (DELAY_ACK(tp, bbr, 1) && tlen != 0 && !tfo_partial) { bbr->bbr_segs_rcvd += 1; tp->t_flags |= TF_DELACK; bbr_timer_cancel(bbr, __LINE__, bbr->r_ctl.rc_rcvtime); Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu May 7 20:27:32 2020 (r360797) +++ head/sys/netinet/tcp_stacks/rack.c Thu May 7 20:29:38 2020 (r360798) @@ -9320,7 +9320,15 @@ rack_do_syn_sent(struct mbuf *m, struct tcphdr *th, st * If there's data, delay ACK; if there's also a FIN ACKNOW * will be turned on later. */ - rack_handle_delayed_ack(tp, rack, tlen, tfo_partial); + if (DELAY_ACK(tp, tlen) && tlen != 0 && !tfo_partial) { + rack_timer_cancel(tp, rack, + rack->r_ctl.rc_rcvtime, __LINE__); + tp->t_flags |= TF_DELACK; + } else { + rack->r_wanted_output = 1; + tp->t_flags |= TF_ACKNOW; + rack->rc_dack_toggle = 0; + } if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && (V_tcp_do_ecn == 1)) { tp->t_flags2 |= TF2_ECN_PERMIT; From owner-svn-src-head@freebsd.org Thu May 7 21:18: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 542592E5F42; Thu, 7 May 2020 21:18:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49J5t61YMJz3HXx; Thu, 7 May 2020 21:18:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3063C1F657; Thu, 7 May 2020 21:18:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 047LIcAL095129; Thu, 7 May 2020 21:18:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 047LIcZ7095128; Thu, 7 May 2020 21:18:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005072118.047LIcZ7095128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 May 2020 21:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360801 - head/contrib/llvm-project/llvm/lib/Support/Unix X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/llvm-project/llvm/lib/Support/Unix X-SVN-Commit-Revision: 360801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 07 May 2020 21:18:38 -0000 Author: emaste Date: Thu May 7 21:18:37 2020 New Revision: 360801 URL: https://svnweb.freebsd.org/changeset/base/360801 Log: Merge commit 21e5e1724b75 from llvm git: getMainExecutable: Fix hand-rolled AT_EXECPATH for older FreeBSD Once we hit AT_NULL, we need to bail out of the loop; not just the enclosing switch. This fixes basic usage (e.g. `cc --version`) when AT_EXECPATH isn't present on older branches (e.g. under emu-user-static, at the moment), where we would previously run off the end of ::environ. Patch By: kevans Reviewed By: arichardson Differential Revision: https://reviews.llvm.org/D79239 MFC after: 3 days Modified: head/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc Modified: head/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc ============================================================================== --- head/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc Thu May 7 21:14:12 2020 (r360800) +++ head/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc Thu May 7 21:18:37 2020 (r360801) @@ -208,14 +208,9 @@ std::string getMainExecutable(const char *argv0, void while (*p++ != 0) ; // Iterate through auxiliary vectors for AT_EXECPATH. - for (;;) { - switch (*(uintptr_t *)p++) { - case AT_EXECPATH: + for (; *(uintptr_t *)p != AT_NULL; p++) { + if (*(uintptr_t *)p++ == AT_EXECPATH) return *p; - case AT_NULL: - break; - } - p++; } #endif // Fall back to argv[0] if auxiliary vectors are not available. From owner-svn-src-head@freebsd.org Fri May 8 01:19: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 43DB12EB5D2; Fri, 8 May 2020 01:19:30 +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 49JCD212qLz42NJ; Fri, 8 May 2020 01:19:30 +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 1F1FD223F6; Fri, 8 May 2020 01:19:30 +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 0481JUS0053336; Fri, 8 May 2020 01:19:30 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0481JUVa053335; Fri, 8 May 2020 01:19:30 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <202005080119.0481JUVa053335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Fri, 8 May 2020 01:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360806 - 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: 360806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 08 May 2020 01:19:30 -0000 Author: takawata Date: Fri May 8 01:19:29 2020 New Revision: 360806 URL: https://svnweb.freebsd.org/changeset/base/360806 Log: Document le_enable subcommand Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.8 Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.8 ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/hccontrol.8 Fri May 8 00:04:25 2020 (r360805) +++ head/usr.sbin/bluetooth/hccontrol/hccontrol.8 Fri May 8 01:19:29 2020 (r360806) @@ -145,6 +145,7 @@ are: .It Cm Reset_Failed_Contact_Counter .It Cm Get_Link_Quality .It Cm Read_RSSI +.It Cm LE_Enable .It Cm LE_Read_Local_Supported_Features .It Cm LE_Set_Advertising_Parameters .It Cm LE_Read_Advertising_Physical_Channel_Tx_Power From owner-svn-src-head@freebsd.org Fri May 8 02:42: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 877042ECC95; Fri, 8 May 2020 02:42:16 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49JF3X2wBgz45jJ; Fri, 8 May 2020 02:42:16 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F5022346E; Fri, 8 May 2020 02:42:16 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0482gGSm008457; Fri, 8 May 2020 02:42:16 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0482gG2e008456; Fri, 8 May 2020 02:42:16 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005080242.0482gG2e008456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 8 May 2020 02:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360807 - head/tests/sys/geom/class/multipath X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/geom/class/multipath X-SVN-Commit-Revision: 360807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: 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, 08 May 2020 02:42:16 -0000 Author: asomers Date: Fri May 8 02:42:15 2020 New Revision: 360807 URL: https://svnweb.freebsd.org/changeset/base/360807 Log: Fix the sys.geom.class.multipath.misc.fail_on_error test on stable/12 This test uses a gnop feature (delay probability) that isn't available on stable/12. But it's unnecessary; the test works fine without it. Removing it simplifies the test and, once MFCed, will allow it to pass on stable/12. PR: 244158 Reported by: lwhsu MFC after: 2 weeks Modified: head/tests/sys/geom/class/multipath/misc.sh Modified: head/tests/sys/geom/class/multipath/misc.sh ============================================================================== --- head/tests/sys/geom/class/multipath/misc.sh Fri May 8 01:19:29 2020 (r360806) +++ head/tests/sys/geom/class/multipath/misc.sh Fri May 8 02:42:15 2020 (r360807) @@ -186,7 +186,7 @@ fail_on_error_body() atf_check -s exit:0 gmultipath create "$name" ${md0}.nop ${md1}.nop # The first I/O to the first path should fail, causing gmultipath to # fail over to the second path. - atf_check gnop configure -q 100 -r 100 -w 100 -x 100 ${md0}.nop + atf_check gnop configure -r 100 -w 100 ${md0}.nop atf_check -s exit:0 -o ignore -e ignore dd if=/dev/zero of=/dev/multipath/"$name" bs=4096 count=1 check_multipath_state ${md1}.nop "DEGRADED" "FAIL" "ACTIVE" } From owner-svn-src-head@freebsd.org Fri May 8 14:38: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 79F662D8E18; Fri, 8 May 2020 14:38:49 +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 49JXyK2XPCz3NBh; Fri, 8 May 2020 14:38:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 525563E1B; Fri, 8 May 2020 14:38:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 048Ecndo056213; Fri, 8 May 2020 14:38:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 048Ecn3U056212; Fri, 8 May 2020 14:38:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005081438.048Ecn3U056212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 8 May 2020 14:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360812 - 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: 360812 X-SVN-Commit-Repository: base MIME-Version: 1.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: Fri, 08 May 2020 14:38:49 -0000 Author: markj Date: Fri May 8 14:38:48 2020 New Revision: 360812 URL: https://svnweb.freebsd.org/changeset/base/360812 Log: Reinitialize thread0's stack base after enabling XSAVE. Otherwise the initial call to set_top_of_stack(), which occurs before fpuinit() sets the correct value for cpu_max_ext_state_size, leaves the stack base at an incorrect location. Then, when the full area is zeroed, we end up erroneously zeroing part of the following page. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24754 Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Fri May 8 14:13:30 2020 (r360811) +++ head/sys/amd64/amd64/machdep.c Fri May 8 14:38:48 2020 (r360812) @@ -1857,7 +1857,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) setidt(IDT_IO_INTS + 15, IDTVEC(spuriousint), SDT_SYSIGT, SEL_KPL, 0); #endif #else -#error "have you forgotten the isa device?"; +#error "have you forgotten the isa device?" #endif if (late_console) @@ -1867,12 +1867,13 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) fpuinit(); /* - * Set up thread0 pcb save area after fpuinit calculated fpu save - * area size. Zero out the extended state header in fpu save - * area. + * Reinitialize thread0's stack base now that the xsave area size is + * known. Set up thread0's pcb save area after fpuinit calculated fpu + * save area size. Zero out the extended state header in fpu save area. */ + set_top_of_stack_td(&thread0); thread0.td_pcb->pcb_save = get_pcb_user_save_td(&thread0); - bzero(get_pcb_user_save_td(&thread0), cpu_max_ext_state_size); + bzero(thread0.td_pcb->pcb_save, cpu_max_ext_state_size); if (use_xsave) { xhdr = (struct xstate_hdr *)(get_pcb_user_save_td(&thread0) + 1); @@ -1882,7 +1883,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) rsp0 = thread0.td_md.md_stack_base; /* Ensure the stack is aligned to 16 bytes */ rsp0 &= ~0xFul; - __pcpu[0].pc_common_tss.tss_rsp0 = rsp0; + PCPU_PTR(common_tss)->tss_rsp0 = rsp0; amd64_bsp_pcpu_init2(rsp0); /* transfer to user mode */ From owner-svn-src-head@freebsd.org Fri May 8 14:39: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 66A542D8E88; Fri, 8 May 2020 14:39:41 +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 49JXzK23J3z3NKK; Fri, 8 May 2020 14:39:41 +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 41B153E20; Fri, 8 May 2020 14:39:41 +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 048EdfQS056318; Fri, 8 May 2020 14:39:41 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 048EddvX056308; Fri, 8 May 2020 14:39:39 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005081439.048EddvX056308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Fri, 8 May 2020 14:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360813 - 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: 360813 X-SVN-Commit-Repository: base MIME-Version: 1.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: Fri, 08 May 2020 14:39:41 -0000 Author: freqlabs Date: Fri May 8 14:39:38 2020 New Revision: 360813 URL: https://svnweb.freebsd.org/changeset/base/360813 Log: Remove APPLEKEXT ifndefs They are no longer useful. Reviewed by: rmacklem Approved by: mav (mentor) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24752 Modified: head/sys/fs/nfs/nfs_commonacl.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfsclient/nfs_clcomsubs.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 Fri May 8 14:38:48 2020 (r360812) +++ head/sys/fs/nfs/nfs_commonacl.c Fri May 8 14:39:38 2020 (r360813) @@ -30,11 +30,9 @@ #include __FBSDID("$FreeBSD$"); -#ifndef APPLEKEXT #include extern int nfsrv_useacl; -#endif static int nfsrv_acemasktoperm(u_int32_t acetype, u_int32_t mask, int owner, enum vtype type, acl_perm_t *permp); Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Fri May 8 14:38:48 2020 (r360812) +++ head/sys/fs/nfs/nfs_commonsubs.c Fri May 8 14:39:38 2020 (r360813) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); * the nfs op functions. They do things like create the rpc header and * copy data between mbuf chains and uio lists. */ -#ifndef APPLEKEXT #include "opt_inet.h" #include "opt_inet6.h" @@ -192,7 +191,6 @@ struct nfsv4_opflag nfsv4_opflag[NFSV42_NOPS] = { { 0, 1, 0, 0, LK_SHARED, 1, 1 }, /* Listxattrs */ { 0, 1, 1, 1, LK_EXCLUSIVE, 1, 1 }, /* Removexattr */ }; -#endif /* !APPLEKEXT */ static int ncl_mbuf_mhlen = MHLEN; static int nfsrv_usercnt = 0; Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Fri May 8 14:38:48 2020 (r360812) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Fri May 8 14:39:38 2020 (r360813) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); * the nfs op functions. They do things like create the rpc header and * copy data between mbuf chains and uio lists. */ -#ifndef APPLEKEXT #include extern struct nfsstatsv1 nfsstatsv1; @@ -49,7 +48,6 @@ extern int ncl_mbuf_mlen; extern enum vtype newnv2tov_type[8]; extern enum vtype nv34tov_type[8]; NFSCLSTATEMUTEX; -#endif /* !APPLEKEXT */ static nfsuint64 nfs_nullcookie = {{ 0, 0 }}; Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Fri May 8 14:38:48 2020 (r360812) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Fri May 8 14:39:38 2020 (r360813) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); * arguments are all at the end, after the NFSPROC_T *p one. */ -#ifndef APPLEKEXT #include "opt_inet6.h" #include @@ -82,7 +81,6 @@ int nfscl_assumeposixlocks = 1; int nfscl_enablecallb = 0; short nfsv4_cbport = NFSV4_CBPORT; int nfstest_openallsetattr = 0; -#endif /* !APPLEKEXT */ #define DIRHDSIZ offsetof(struct dirent, d_name) Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Fri May 8 14:38:48 2020 (r360812) +++ head/sys/fs/nfsclient/nfs_clstate.c Fri May 8 14:39:38 2020 (r360813) @@ -80,7 +80,6 @@ __FBSDID("$FreeBSD$"); * (Since we are done with them, they do not need to be recovered.) */ -#ifndef APPLEKEXT #include /* @@ -98,7 +97,6 @@ int nfscl_inited = 0; struct nfsclhead nfsclhead; /* Head of clientid list */ int nfscl_deleghighwater = NFSCLDELEGHIGHWATER; int nfscl_layouthighwater = NFSCLLAYOUTHIGHWATER; -#endif /* !APPLEKEXT */ static int nfscl_delegcnt = 0; static int nfscl_layoutcnt = 0; Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdcache.c Fri May 8 14:38:48 2020 (r360812) +++ head/sys/fs/nfsserver/nfs_nfsdcache.c Fri May 8 14:39:38 2020 (r360813) @@ -158,7 +158,6 @@ __FBSDID("$FreeBSD$"); * that case. This level should be set high enough that this almost * never happens. */ -#ifndef APPLEKEXT #include extern struct nfsstatsv1 nfsstatsv1; @@ -166,7 +165,6 @@ extern struct mtx nfsrc_udpmtx; extern struct nfsrchash_bucket nfsrchash_table[NFSRVCACHE_HASHSIZE]; extern struct nfsrchash_bucket nfsrcahash_table[NFSRVCACHE_HASHSIZE]; int nfsrc_floodlevel = NFSRVCACHE_FLOODLEVEL, nfsrc_tcpsavedreplies = 0; -#endif /* !APPLEKEXT */ SYSCTL_DECL(_vfs_nfsd); Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 8 14:38:48 2020 (r360812) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 8 14:39:38 2020 (r360813) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); * For nfsv4, these functions are called for each Op within the Compound RPC. */ -#ifndef APPLEKEXT #include #include #include @@ -68,7 +67,6 @@ extern u_long sb_max_adj; extern int nfsrv_pnfsatime; extern int nfsrv_maxpnfsmirror; extern int nfs_maxcopyrange; -#endif /* !APPLEKEXT */ static int nfs_async = 0; SYSCTL_DECL(_vfs_nfsd); Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsocket.c Fri May 8 14:38:48 2020 (r360812) +++ head/sys/fs/nfsserver/nfs_nfsdsocket.c Fri May 8 14:39:38 2020 (r360813) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); * Socket operations for use by the nfs server. */ -#ifndef APPLEKEXT #include extern struct nfsstatsv1 nfsstatsv1; @@ -374,7 +373,6 @@ int (*nfsrv4_ops2[NFSV42_NOPS])(struct nfsrv_descript (int (*)(struct nfsrv_descript *, int, vnode_t , vnode_t , struct nfsexstuff *, struct nfsexstuff *))0, (int (*)(struct nfsrv_descript *, int, vnode_t , vnode_t , struct nfsexstuff *, struct nfsexstuff *))0, }; -#endif /* !APPLEKEXT */ /* * Static array that defines which nfs rpc's are nonidempotent Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Fri May 8 14:38:48 2020 (r360812) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Fri May 8 14:39:38 2020 (r360813) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#ifndef APPLEKEXT #include #include @@ -123,7 +122,6 @@ struct nfslockhashhead *nfslockhash; struct nfssessionhash *nfssessionhash; struct nfslayouthash *nfslayouthash; volatile int nfsrv_dontlistlen = 0; -#endif /* !APPLEKEXT */ static u_int32_t nfsrv_openpluslock = 0, nfsrv_delegatecnt = 0; static time_t nfsrvboottime; Modified: head/sys/fs/nfsserver/nfs_nfsdsubs.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsubs.c Fri May 8 14:38:48 2020 (r360812) +++ head/sys/fs/nfsserver/nfs_nfsdsubs.c Fri May 8 14:39:38 2020 (r360813) @@ -36,7 +36,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef APPLEKEXT /* * These functions support the macros and help fiddle mbuf chains for * the nfs op functions. They do things like create the rpc header and @@ -62,7 +61,6 @@ struct nfslayouthead nfsrv_recalllisthead; static nfstype newnfsv2_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFNON, NFCHR, NFNON }; extern nfstype nfsv34_type[9]; -#endif /* !APPLEKEXT */ static u_int32_t nfsrv_isannfserr(u_int32_t); From owner-svn-src-head@freebsd.org Fri May 8 14:54: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 41D912D953A; Fri, 8 May 2020 14:54:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49JYJd10dlz3PKQ; Fri, 8 May 2020 14:54:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D7C3424E; Fri, 8 May 2020 14:54:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 048Eseqp068503; Fri, 8 May 2020 14:54:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 048EseLx068502; Fri, 8 May 2020 14:54:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005081454.048EseLx068502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 8 May 2020 14:54:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360815 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 360815 X-SVN-Commit-Repository: base MIME-Version: 1.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: Fri, 08 May 2020 14:54:41 -0000 Author: emaste Date: Fri May 8 14:54:40 2020 New Revision: 360815 URL: https://svnweb.freebsd.org/changeset/base/360815 Log: src.opts.mk: update BINUTILS options and add comments BINUTILS is needed only for ports, and will be disabled once the failing ports are addressed (likely by growing a binutils dependency). BINUTILS_BOOTSTRAP is needed only on amd64, for skein_block_asm.s. There is no need to enable it on i386. This will all be removed before FreeBSD 13.0. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri May 8 14:48:45 2020 (r360814) +++ head/share/mk/src.opts.mk Fri May 8 14:54:40 2020 (r360815) @@ -290,8 +290,13 @@ __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF .if ${__T} == "aarch64" || ${__T:Mriscv*} != "" BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GDB .endif -.if ${__T} == "amd64" || ${__T} == "i386" +# BINUTILS is enabled on x86 to provide as for ports - PR 205250 +# BINUTILS_BOOTSTRAP is needed on amd64 only, for skein_block_asm.s +.if ${__T} == "amd64" __DEFAULT_YES_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP +.elif ${__T} == "i386" +__DEFAULT_YES_OPTIONS+=BINUTILS +__DEFAULT_NO_OPTIONS+=BINUTILS_BOOTSTRAP .else __DEFAULT_NO_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP .endif From owner-svn-src-head@freebsd.org Fri May 8 15:03: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 7EB982D97FB; Fri, 8 May 2020 15:03: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 49JYVn2qgTz3Pp9; Fri, 8 May 2020 15:03: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 5C61A4421; Fri, 8 May 2020 15:03: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 048F3TsN074961; Fri, 8 May 2020 15:03:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 048F3T43074960; Fri, 8 May 2020 15:03:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005081503.048F3T43074960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 8 May 2020 15:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360816 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 360816 X-SVN-Commit-Repository: base MIME-Version: 1.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: Fri, 08 May 2020 15:03:29 -0000 Author: emaste Date: Fri May 8 15:03:28 2020 New Revision: 360816 URL: https://svnweb.freebsd.org/changeset/base/360816 Log: src.conf.5: regen after BINUTILS changes Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri May 8 14:54:40 2020 (r360815) +++ head/share/man/man5/src.conf.5 Fri May 8 15:03:28 2020 (r360816) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd May 6, 2020 +.Dd May 8, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -202,13 +202,13 @@ Do not build GNU binutils as part of the bootstrap process. .Pp This is a default setting on -arm/armv6, arm/armv7, arm64/aarch64, mips/mips, mips/mips64, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. +arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mips, mips/mips64, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_BINUTILS_BOOTSTRAP Build GNU binutils as part of the bootstrap process. .Pp This is a default setting on -amd64/amd64 and i386/i386. +amd64/amd64. .It Va WITHOUT_BLACKLIST Set this if you do not want to build .Xr blacklistd 8 From owner-svn-src-head@freebsd.org Fri May 8 16:14: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 643862DB63F for ; Fri, 8 May 2020 16:14:34 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic306-20.consmr.mail.gq1.yahoo.com (sonic306-20.consmr.mail.gq1.yahoo.com [98.137.68.83]) (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 49Jb4m2d2mz40mS for ; Fri, 8 May 2020 16:14:32 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: TVENuvoVM1n_zA_0fs6Z719DKccdLvBZKI4IF2arNLX_N4maUdk63_v7VCedtYw kKmDxIpX7OF5E6wicfhOXIHMkD7lDSBRJFGS_kqn447wUaref25ZfPYh4YEESAzPpA2rIsETZB3z FYvkZLf5Po8MZyT3KX6Cain4buVLJUUhDIkLbXksSeWUo51VxQJMV3C6fCuJu6nWndqmA4Qh1mTt XMLaHVA8E9GNT_PfDLNvZKcnGbANy5qhCfkmZ4LOEF_GyAwAuZ1aHHwY4GOgyyoND1NHNxa04rat NulF6Fool9duKR9UmGva60q4Gl0HmRxyNNKQN253LMyOVhNlZ0B1iRkkEqig4JqhdM_aHxu0iktm AnoAodoa.Ws3BKJogkqMMnXCv91vkDRVyuxh7FDK3uf1SqN_2x9C_UpWLfrkwAET.ydd4aJEVT0N Jbz1FrB9uo8yq5KeD_uNskh1N2rHXtc30BDQOzrqsRDKcyZvcK3XcLvW6NMtMlM0UF5gHMNAA5uH 23SQcUX_sHjsarQTcf8.orhY4Xane0WX0kMO_QrZTnT00PQrlrGn0.GdH6_o8zwEAG.xcsFSLgTT _.yybkiZ.p3hwwxvTQEJWfzdQQDpj0FQcRE9gtcU8ONPqCXCZM14u73ArBF1F7dFJ8lEEru25dR5 0vErXFnRDQs.kxzebK4TWqJe24GHRSXhvLpALkZgqUp.BNqakGjSg97Y3OvQPdmLQAoPG_1S.Cje Hk9FfmYnXohSWqwBtfBgRzhd13NCi_uztl8yy2zdHs9e19MEuf8AvhwIX2AgBgSnRgde45zygkYH y.gPaQ8GewxsVdScud1nCUICCM1ACyu1IxRqZvu3QDrsoqhx5C3mTnYcvxZbAoC5QEoJ.1i3aIWy 4ooOqAK0xXFAp1VVpr3zp99dzwDc0PdtY3l6ar7sMa_uBpDCLaBry2ZCzQQmErOYj5_jeg0HH_sK 5mVHAUngzgcF_GJv29m7NC3viQH16l.e0mLx70pJv4goQuGhC_JoT9re8DZq3o9sbJIYTiTve8G9 xAqAgkZJUXQoPqkQD9bcr3cgUNMH3XCF55R0wJoH7TFpx5vYUZ3Qu4.DatFyku_ISXHer15cnlXN ThYqGhAVjHZ_cPf1N7EjWDuJxl6vtPrxbLgNPYG5eVrBVb0Y8meyYv9e9nPlCEYkPWDdGcVd8gvB Z77cDzOsF3Q8d0OJsBRBPyLjgMydpRbaffFyT0fAD22FU8rjdidlFmPmf9orIe6fRLZK4RKZh.gr rMRj5aMwaDpfT4G4KLlY9X.vCUNZ4eZasZkWtUnhoaq0ReXMJXFtCiWwEr3q_b9coYIqliudGjWR 7aUsa6GVnP53AU6aTKEurLaKhBF8tyndHLlpg8KVBobgq3YhFzOOsLv.rikJwACuuuc0eZlQh5rN TrcgPmggrtVjMJg_b2OXVrlBnJDEfhbGt0Tm_3IEz6t3qTdCQCG7XB7_ObBwezDw- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.gq1.yahoo.com with HTTP; Fri, 8 May 2020 16:14:30 +0000 Received: by smtp421.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID f4875cfc9e4acaebf3d65b4cfeaaba16; Fri, 08 May 2020 16:14:26 +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: Fri, 8 May 2020 09:14:24 -0700 Cc: Brandon Bergren , Justin Hibbits Content-Transfer-Encoding: quoted-printable Message-Id: <624CE71B-2C50-4E77-85A2-42D9FA140AD0@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: 49Jb4m2d2mz40mS X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.40 / 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.93)[-0.926,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.97)[-0.970,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (2.91), 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)[83.68.137.98.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[83.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.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: Fri, 08 May 2020 16:14:34 -0000 [More details for a sshd failure. The other examples are omitted. The sshd failure also shows a all-zeros-up-to-a-page-boundary issue, just for a different address range.] On 2020-May-7, at 12:06, Mark Millard wrote: >=20 > [mountd failure example: also at sz_size2index_lookup assert > for the same zero'd memory problem.] >=20 >> On 2020-May-7, at 00:46, Mark Millard wrote: >>=20 >> [__je_sz_size2index_tab seems messed up in 2 of the >> asserting contexts: first 384 are zero in both. More >> before that is also messed up (all zero). I show the >> details later below.] >>=20 >> On 2020-May-6, at 16:57, Mark Millard wrote: >>=20 >>> [This explores process crashes that happen during system >>> shutdown, in a context not having MALLOC_PRODUCTION=3D . >>> So assert failures are reported as the stopping points.] >>>=20 >>> It looks like shutdown -p now, shutdown -r now, and the >>> like can lead some processes to assert during their exit >>> attempt, including a sshd failure (that I've not seen >>> before), rpcbind, and nfsd. I show information about the >>> observed asserts for those below. >>>=20 >>>=20 >>> sshd hit an assert, failing slab =3D=3D extent_slab_get(extent) : >>>=20 >>> (gdb) bt=20 >>> #0 thr_kill () at thr_kill.S:4 >>> #1 0x50927170 in __raise (s=3D6) at = /usr/src/lib/libc/gen/raise.c:52 >>> #2 0x50886cc0 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 >>> #3 0x508834b0 in arena_dalloc (tsdn=3D, = ptr=3D, tcache=3D, alloc_ctx=3D, slow_path=3D) >>> at = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:315 >>> #4 idalloctm (tsdn=3D0x500dd040, ptr=3D0x5008a180, = tcache=3D0x500dd160, alloc_ctx=3D, is_internal=3D, slow_path=3D) >>> at = /usr/src/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inli= nes_c.h:118 >>> #5 0x5087b0a4 in ifree (tsd=3D0x500dd040, ptr=3D0x5008a180, = tcache=3D0x500dd160, slow_path=3D) at = jemalloc_jemalloc.c:2590 >>> #6 0x5087acac in __je_free_default (ptr=3D0x5008a180) at = jemalloc_jemalloc.c:2784 >>> #7 0x5087b294 in __free (ptr=3D0x5008a180) at = jemalloc_jemalloc.c:2852 >>> #8 0x10029464 in server_accept_loop (config_s=3D, = sock_in=3D, sock_out=3D, = newsock=3D) at /usr/src/crypto/openssh/sshd.c:1185 >>> #9 main (ac=3D, av=3D0xffffde3c) at = /usr/src/crypto/openssh/sshd.c:2009 >>>=20 >>> . . . >>> (gdb) up >>> #2 0x50886cc0 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 >>> 67 (void)raise(SIGABRT); >>> (gdb) up >>> #3 0x508834b0 in arena_dalloc (tsdn=3D, = ptr=3D, tcache=3D, alloc_ctx=3D, slow_path=3D) >>> at = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:315 >>> 315 assert(slab =3D=3D extent_slab_get(extent)); >>>=20 >>> (gdb) list >>> 310 rtree_ctx =3D tsd_rtree_ctx(tsdn_tsd(tsdn)); >>> 311 extent_t *extent =3D rtree_extent_read(tsdn, = &extents_rtree, >>> 312 rtree_ctx, (uintptr_t)ptr, true); >>> 313 assert(szind =3D=3D extent_szind_get(extent)); >>> 314 assert(szind < SC_NSIZES); >>> 315 assert(slab =3D=3D extent_slab_get(extent)); >>> 316 } >>> 317=09 >>> 318 if (likely(slab)) { >>> 319 /* Small allocation. */ >>>=20 >>> More fully: >>>=20 >>> 285 JEMALLOC_ALWAYS_INLINE void >>> 286 arena_dalloc(tsdn_t *tsdn, void *ptr, tcache_t *tcache, >>> 287 alloc_ctx_t *alloc_ctx, bool slow_path) { >>> 288 assert(!tsdn_null(tsdn) || tcache =3D=3D NULL); >>> 289 assert(ptr !=3D NULL); >>> 290=09 >>> 291 if (unlikely(tcache =3D=3D NULL)) { >>> 292 arena_dalloc_no_tcache(tsdn, ptr); >>> 293 return; >>> 294 } >>> 295=09 >>> 296 szind_t szind; >>> 297 bool slab; >>> 298 rtree_ctx_t *rtree_ctx; >>> 299 if (alloc_ctx !=3D NULL) { >>> 300 szind =3D alloc_ctx->szind; >>> 301 slab =3D alloc_ctx->slab; >>> 302 assert(szind !=3D SC_NSIZES); >>> 303 } else { >>> 304 rtree_ctx =3D tsd_rtree_ctx(tsdn_tsd(tsdn)); >>> 305 rtree_szind_slab_read(tsdn, &extents_rtree, = rtree_ctx, >>> 306 (uintptr_t)ptr, true, &szind, &slab); >>> 307 } >>> 308=09 >>> 309 if (config_debug) { >>> 310 rtree_ctx =3D tsd_rtree_ctx(tsdn_tsd(tsdn)); >>> 311 extent_t *extent =3D rtree_extent_read(tsdn, = &extents_rtree, >>> 312 rtree_ctx, (uintptr_t)ptr, true); >>> 313 assert(szind =3D=3D extent_szind_get(extent)); >>> 314 assert(szind < SC_NSIZES); >>> 315 assert(slab =3D=3D extent_slab_get(extent)); >>> 316 } >>> 317=09 >>> 318 if (likely(slab)) { >>> 319 /* Small allocation. */ >>> 320 tcache_dalloc_small(tsdn_tsd(tsdn), tcache, ptr, = szind, >>> 321 slow_path); >>> 322 } else { >>> 323 arena_dalloc_large(tsdn, ptr, tcache, szind, = slow_path); >>> 324 } >>> 325 } >>=20 >> . . . The machine code for: 309 if (config_debug) { 310 rtree_ctx =3D tsd_rtree_ctx(tsdn_tsd(tsdn)); 311 extent_t *extent =3D rtree_extent_read(tsdn, = &extents_rtree, 312 rtree_ctx, (uintptr_t)ptr, true); 313 assert(szind =3D=3D extent_szind_get(extent)); 314 assert(szind < SC_NSIZES); 315 assert(slab =3D=3D extent_slab_get(extent)); 316 } was dropping the address in "extent" the next instruction after finding it: replacing with with a field's value. So by the time the status of the assert could be known, examining extent was a difficulty. So I touched the source code to force the address to be kept and to give a place to breakpoint on failure before calling another routine: # svnlite diff = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h Index: = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h = (revision 360322) +++ = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h = (working copy) @@ -308,11 +308,11 @@ =20 if (config_debug) { rtree_ctx =3D tsd_rtree_ctx(tsdn_tsd(tsdn)); - extent_t *extent =3D rtree_extent_read(tsdn, = &extents_rtree, + extent_t * volatile extent =3D rtree_extent_read(tsdn, = &extents_rtree, rtree_ctx, (uintptr_t)ptr, true); assert(szind =3D=3D extent_szind_get(extent)); assert(szind < SC_NSIZES); - assert(slab =3D=3D extent_slab_get(extent)); + assert((slab =3D=3D extent_slab_get(extent)) ?true = :extent=3D=3DNULL); } =20 if (likely(slab)) { The ":extent=3D=3DNULL" should be guaranteed to produce :false as a = result but with more code involved to get there. It gave me a place to = breakpoint on failure. (gdb) bt -full #0 0x50883258 in arena_dalloc (tsdn=3D, ptr=3D, tcache=3D, alloc_ctx=3D, = slow_path=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:315 extent =3D 0x51007fc0 slab =3D szind =3D rtree_ctx =3D 0x500dd06c extent =3D #1 idalloctm (tsdn=3D0x500dd040, ptr=3D0x5008a180, tcache=3D0x500dd160, = alloc_ctx=3D, is_internal=3D, = slow_path=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inli= nes_c.h:118 No locals. #2 0x5087b0e4 in ifree (tsd=3D0x500dd040, ptr=3D0x5008a180, = tcache=3D0x500dd160, slow_path=3D) at = jemalloc_jemalloc.c:2590 alloc_ctx =3D {szind =3D 0, slab =3D true} rtree_ctx =3D usize =3D #3 0x5087acec in __je_free_default (ptr=3D0x5008a180) at = jemalloc_jemalloc.c:2784 tcache =3D 0x500dd160 tsd =3D #4 0x5087b2d4 in __free (ptr=3D0x5008a180) at jemalloc_jemalloc.c:2852 log_var =3D log_var =3D #5 0x10029464 in server_accept_loop (config_s=3D, = sock_in=3D, sock_out=3D, = newsock=3D) at /usr/src/crypto/openssh/sshd.c:1185 from =3D {ss_len =3D 16 '\020', ss_family =3D 2 '\002', = __ss_pad1 =3D "\317\200\300\250\001\031", __ss_align =3D 0,=20 __ss_pad2 =3D "\000\000\000\000\000\000\000\002Am", '\000' = , "\065\341I\000\000\000\000^\264\234\331", '\000' = , = "^\262\027\034-a\241H\000\000\000\000\000\000\000\000^\264\235Y,\024\247\0= 30\000\000\000\000\000\000\000\000V\312\331f6-N\370\000\000\000\000\000\00= 0\000\000\000\000\002\000\000\000\000\000\000\000\000\b"} rnd =3D '\000' startup_p =3D {6, 7} startups =3D 1 i =3D maxfd =3D 6 fdset =3D fromlen =3D ret =3D j =3D pid =3D laddr =3D raddr =3D #6 main (ac=3D, av=3D0xffffde3c) at = /usr/src/crypto/openssh/sshd.c:2009 config_s =3D {8, 9} on =3D 1 ssh =3D 0x0 logfile =3D newsock =3D -1 sock_out =3D -1 sock_in =3D -1 connection_info =3D i =3D opt =3D line =3D r =3D key =3D pubkey =3D keytype =3D fp =3D j =3D new_umask =3D already_daemon =3D remote_port =3D remote_ip =3D rdomain =3D --Type for more, q to quit, c to continue without paging-- laddr =3D authctxt =3D obytes =3D ibytes =3D (gdb) list 310 rtree_ctx =3D tsd_rtree_ctx(tsdn_tsd(tsdn)); 311 extent_t * volatile extent =3D = rtree_extent_read(tsdn, &extents_rtree, 312 rtree_ctx, (uintptr_t)ptr, true); 313 assert(szind =3D=3D extent_szind_get(extent)); 314 assert(szind < SC_NSIZES); 315 assert((slab =3D=3D extent_slab_get(extent)) = ?true :extent=3D=3DNULL); 316 } 317=09 318 if (likely(slab)) { 319 /* Small allocation. */ (gdb) print/x extent $6 =3D 0x51007fc0 (gdb) print/x *extent $2 =3D {e_bits =3D 0x0, e_addr =3D 0x0, {e_size_esn =3D 0x0, e_bsize =3D = 0x0}, ql_link =3D {qre_next =3D 0x0, qre_prev =3D 0x0}, ph_link =3D = {phn_prev =3D 0x0, phn_next =3D 0x0, phn_lchild =3D 0x0}, {e_slab_data =3D= { bitmap =3D {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xffffffff, 0xffffffff, = 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, = 0xffffffff, 0xffffffff, 0xfff8}}, {e_alloc_time =3D { ns =3D 0x0}, e_prof_tctx =3D {repr =3D 0x0}}}} It looks like the prefix of the above has been stomped on to be zeros. Checking addresses as well: (gdb) x/64x extent 0x51007fc0: 0x00000000 0x00000000 0x00000000 = 0x00000000 0x51007fd0: 0x00000000 0x00000000 0x00000000 = 0x00000000 0x51007fe0: 0x00000000 0x00000000 0x00000000 = 0x00000000 0x51007ff0: 0x00000000 0x00000000 0x00000000 = 0x00000000 0x51008000: 0xffffffff 0xffffffff 0xffffffff = 0xffffffff 0x51008010: 0xffffffff 0xffffffff 0xffffffff = 0xffffffff 0x51008020: 0xffffffff 0xffffffff 0x0000fff8 = 0x00000000 0x51008030: 0x00000000 0x00000000 0x00000000 = 0x00000000 0x51008040: 0x00000800 0x0014f000 0x5008b000 = 0x00005000 0x51008050: 0x51008040 0x51008040 0x00000000 = 0x00000000 0x51008060: 0x00000000 0x00000000 0x00000000 = 0x00000000 0x51008070: 0x00000000 0x00000000 0x00000000 = 0x00000000 0x51008080: 0x00000000 0x00000000 0x00000000 = 0x00000000 0x51008090: 0x00000000 0x00000000 0x00000000 = 0x00000000 0x510080a0: 0x00000000 0x00000000 0x00000000 = 0x00000000 0x510080b0: 0x00000000 0x00000000 0x00000000 = 0x00000000 Note that the non-zero values start at: 0x51008000, again a page boundary, like the other examples in prior notes for other cases. This appears to be another example of memory having been stomped on/replaced that likely previously had the intended values. The first prior non-zero values are at: 0x51005a30: 0x00000000 0x51008740 0x0000000f = 0x01000000 0x51005a40: 0x51008740 0x0000000f 0x01000000 = 0x51008740 0x51005a50: 0x0000000f 0x01000000 0x51008740 = 0x0000000f 0x51005a60: 0x01000000 0x51008740 0x0000000f = 0x01000000 0x51005a70: 0x51008740 0x0000000f 0x01000000 = 0x51008740 0x51005a80: 0x0000000f 0x01000000 0x51008940 = 0x00000014 0x51005a90: 0x01000000 0x510089c0 0x00000014 = 0x01000000 0x51005aa0: 0x51008a40 0x00000018 0x01000000 = 0x51008ac0 0x51005ab0: 0x00000018 0x01000000 0x51008b40 = 0x00000018 0x51005ac0: 0x01000000 0x51008bc0 0x00000018 = 0x01000000 0x51005ad0: 0x51008c40 0x00000018 0x01000000 = 0x51008cc0 0x51005ae0: 0x00000001 0x01000000 0x00000000 = 0x00000000 So the pages for address ranges 0x51006yyy and 0x51007yyy seem to be all-zero, along with the tail of the page for the range 0x51005yyy. #2 (ifree) in the backtrace shows the alloc_ctx content: alloc_ctx =3D {szind =3D 0, slab =3D true} So slab=3D=3Dtrue but the bit in extent->e_bits=3D=3Dfalse, leading to the failed assert. Before going to sleep for the night, I could ssh into the old PowerMac without this detection. After getting up, trying the same got the failure detection. I did not have the machine doing anything else special between. The other examples in the other programs are similar: just waiting long enough with normal background processing going on eventually leads to the context for the next explicit use (or exit) to detect the problem. I'm still no where near identifying when the stomped-on memory range is trashed with zeros in code terms in any example program. But sshd, dhclient, rpcbind, nfsd, and sendmail all seem to have some common subject area(s) involved in their implementation. So I suspect something common across those is essentially involved. For reference: In #0: (gdb) print/x rtree_ctx $5 =3D 0x500dd06c (gdb) print/x *rtree_ctx $4 =3D {cache =3D {{leafkey =3D 0x50000000, leaf =3D 0x51004fc0}, = {leafkey =3D 0x1, leaf =3D 0x0}, {leafkey =3D 0x1, leaf =3D 0x0}, = {leafkey =3D 0x50c00000, leaf =3D 0x51008dc0}, {leafkey =3D 0x1,=20 leaf =3D 0x0} }, l2_cache =3D {{leafkey =3D 0x1, = leaf =3D 0x0}, {leafkey =3D 0x1, leaf =3D 0x0}, {leafkey =3D 0x1, leaf =3D= 0x0}, {leafkey =3D 0x1, leaf =3D 0x0}, {leafkey =3D 0x1, leaf =3D 0x0}, = { leafkey =3D 0x1, leaf =3D 0x0}, {leafkey =3D 0x1, leaf =3D 0x0}, = {leafkey =3D 0x1, leaf =3D 0x0}}} =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 Fri May 8 16:41: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 1F6F62DC20E; Fri, 8 May 2020 16:41:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Jbgl6DZkz42f2; Fri, 8 May 2020 16:41:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D137356AA; Fri, 8 May 2020 16:41:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 048GfNi5034083; Fri, 8 May 2020 16:41:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 048GfNou034082; Fri, 8 May 2020 16:41:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005081641.048GfNou034082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 8 May 2020 16:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360818 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 360818 X-SVN-Commit-Repository: base MIME-Version: 1.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: Fri, 08 May 2020 16:41:24 -0000 Author: jhb Date: Fri May 8 16:41:23 2020 New Revision: 360818 URL: https://svnweb.freebsd.org/changeset/base/360818 Log: Fix a memory leak for ENCIOC_GETSTRING I introduced in r360171. MFC after: 1 week Sponsored by: DARPA Modified: head/sys/cam/scsi/scsi_enc_ses.c Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Fri May 8 15:05:05 2020 (r360817) +++ head/sys/cam/scsi/scsi_enc_ses.c Fri May 8 16:41:23 2020 (r360818) @@ -2958,7 +2958,7 @@ ses_handle_string(enc_softc_t *enc, encioc_string_t *s ret = enc_runcmd(enc, cdb, 6, buf, &amt); if (ret == 0 && ioc == ENCIOC_GETSTRING) ret = copyout(buf, sstr->buf, sstr->bufsiz); - if (ioc == ENCIOC_SETSTRING) + if (ioc == ENCIOC_SETSTRING || ioc == ENCIOC_GETSTRING) ENC_FREE(buf); return (ret); } From owner-svn-src-head@freebsd.org Fri May 8 17:01: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 30B752DC6B8; Fri, 8 May 2020 17:01:34 +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 49Jc720V9dz43dX; Fri, 8 May 2020 17:01:34 +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 0C0225A85; Fri, 8 May 2020 17:01:34 +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 048H1Xnp047209; Fri, 8 May 2020 17:01:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 048H1XiS047208; Fri, 8 May 2020 17:01:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005081701.048H1XiS047208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 8 May 2020 17:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360819 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 360819 X-SVN-Commit-Repository: base MIME-Version: 1.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: Fri, 08 May 2020 17:01:34 -0000 Author: adrian Date: Fri May 8 17:01:33 2020 New Revision: 360819 URL: https://svnweb.freebsd.org/changeset/base/360819 Log: [net80211] Use the unicast key when transmitting DWDS AP multicast frames. I'm still not sure whether this is the full solution, but here goes. I have a two node DWDS setup - a main AP with the ethernet bridge uplink and a satellite AP in the back of the house. They're both AR9344+AR9580 dual band 11n APs. The problem was that multicast frames was not going from the DWDS AP to the DWDS STA. Unicast frames are fine, and multicast frames from the DWDS STA to AP are fine. Now, multicast and unicast frames from the STA -> AP are just transmitted using the unicast key. That's fine. However, the AP -> STA multicast frames by default are transmitted using the current default / multicast key, the shared one between all STAs in a BSS. Now, the DWDS implementation ignores non WDS frames - it only allows about 4 address frames outside of management / EAPOL frames! - so the STA side ignores the normal multicast frames. Instead, the AP side uses ieee80211_dwds_mcast() to send multicast frames to each WDS VAP that was created as part of the "dynamic" part of DWDS. This should be queuing them individually to each node instead of using the normal multicast send path; and this is how they should get turned into 4-addr WDS frames. HOWEVER, ieee80211_encap() was trying to use the default TX key to queue them rather than the unicast key that's already setup. Since this synthetic node doesn't have the default TX key setup, transmission fails. Things would be fine in WEP and in open mode because in both cases you would have static keys (or no keys) setup. It just fails in WPA mode. This resolves the issue. AP DWDS multicast is now sent using the unicast key just like in STA mode and I'm pretty sure the STA mode side will stil work fine (as it's a STA VAP with a DWDS flag..) Tested: * TL-WDR3600/4300 APs Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri May 8 16:41:23 2020 (r360818) +++ head/sys/net80211/ieee80211_output.c Fri May 8 17:01:33 2020 (r360819) @@ -1471,10 +1471,27 @@ ieee80211_encap(struct ieee80211vap *vap, struct ieee8 if (vap->iv_opmode == IEEE80211_M_STA || !IEEE80211_IS_MULTICAST(eh.ether_dhost) || (vap->iv_opmode == IEEE80211_M_WDS && - (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY))) + (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY))) { key = ieee80211_crypto_getucastkey(vap, ni); - else + } else if ((vap->iv_opmode == IEEE80211_M_WDS) && + (! (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY))) { + /* + * Use ucastkey for DWDS transmit nodes, multicast + * or otherwise. + * + * This is required to ensure that multicast frames + * from a DWDS AP to a DWDS STA is encrypted with + * a key that can actually work. + * + * There's no default key for multicast traffic + * on a DWDS WDS VAP node (note NOT the DWDS enabled + * AP VAP, the dynamically created per-STA WDS node) + * so encap fails and transmit fails. + */ + key = ieee80211_crypto_getucastkey(vap, ni); + } else { key = ieee80211_crypto_getmcastkey(vap, ni); + } if (key == NULL && (m->m_flags & M_EAPOL) == 0) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, eh.ether_dhost, From owner-svn-src-head@freebsd.org Fri May 8 17:15:55 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 8977C2DCDB4; Fri, 8 May 2020 17:15:55 +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 49JcRb37Hyz44TL; Fri, 8 May 2020 17:15:55 +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 668085CD5; Fri, 8 May 2020 17:15:55 +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 048HFthL056717; Fri, 8 May 2020 17:15:55 GMT (envelope-from afedorov@FreeBSD.org) Received: (from afedorov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 048HFsCu056713; Fri, 8 May 2020 17:15:54 GMT (envelope-from afedorov@FreeBSD.org) Message-Id: <202005081715.048HFsCu056713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: afedorov set sender to afedorov@FreeBSD.org using -f From: Aleksandr Fedorov Date: Fri, 8 May 2020 17:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360820 - 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: 360820 X-SVN-Commit-Repository: base MIME-Version: 1.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: Fri, 08 May 2020 17:15:55 -0000 Author: afedorov Date: Fri May 8 17:15:54 2020 New Revision: 360820 URL: https://svnweb.freebsd.org/changeset/base/360820 Log: bhyve: Pass the full string of options to the network backends. Reviewed by: vmaffione Approved by: vmaffione (mentor) Sponsored by: vstack.com Differential Revision: https://reviews.freebsd.org/D24735 Modified: head/usr.sbin/bhyve/net_backends.c head/usr.sbin/bhyve/net_backends.h head/usr.sbin/bhyve/pci_e82545.c head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/net_backends.c ============================================================================== --- head/usr.sbin/bhyve/net_backends.c Fri May 8 17:01:33 2020 (r360819) +++ head/usr.sbin/bhyve/net_backends.c Fri May 8 17:15:54 2020 (r360820) @@ -91,7 +91,7 @@ struct net_backend { * and should not be called by the frontend. */ int (*init)(struct net_backend *be, const char *devname, - net_be_rxeof_t cb, void *param); + const char *opts, net_be_rxeof_t cb, void *param); void (*cleanup)(struct net_backend *be); /* @@ -199,7 +199,7 @@ tap_cleanup(struct net_backend *be) static int tap_init(struct net_backend *be, const char *devname, - net_be_rxeof_t cb, void *param) + const char *opts, net_be_rxeof_t cb, void *param) { struct tap_priv *priv = (struct tap_priv *)be->opaque; char tbuf[80]; @@ -473,7 +473,7 @@ netmap_set_cap(struct net_backend *be, uint64_t featur static int netmap_init(struct net_backend *be, const char *devname, - net_be_rxeof_t cb, void *param) + const char *opts, net_be_rxeof_t cb, void *param) { struct netmap_priv *priv = (struct netmap_priv *)be->opaque; @@ -746,12 +746,22 @@ DATA_SET(net_backend_set, vale_backend); * the argument for the callback. */ int -netbe_init(struct net_backend **ret, const char *devname, net_be_rxeof_t cb, +netbe_init(struct net_backend **ret, const char *opts, net_be_rxeof_t cb, void *param) { struct net_backend **pbe, *nbe, *tbe = NULL; + char *devname; + char *options; int err; + devname = options = strdup(opts); + + if (devname == NULL) { + return (-1); + } + + devname = strsep(&options, ","); + /* * Find the network backend that matches the user-provided * device name. net_backend_set is built using a linker set. @@ -771,8 +781,11 @@ netbe_init(struct net_backend **ret, const char *devna } *ret = NULL; - if (tbe == NULL) + if (tbe == NULL) { + free(devname); return (EINVAL); + } + nbe = calloc(1, sizeof(*nbe) + tbe->priv_size); *nbe = *tbe; /* copy the template */ nbe->fd = -1; @@ -781,13 +794,15 @@ netbe_init(struct net_backend **ret, const char *devna nbe->fe_vnet_hdr_len = 0; /* Initialize the backend. */ - err = nbe->init(nbe, devname, cb, param); + err = nbe->init(nbe, devname, options, cb, param); if (err) { + free(devname); free(nbe); return (err); } *ret = nbe; + free(devname); return (0); } Modified: head/usr.sbin/bhyve/net_backends.h ============================================================================== --- head/usr.sbin/bhyve/net_backends.h Fri May 8 17:01:33 2020 (r360819) +++ head/usr.sbin/bhyve/net_backends.h Fri May 8 17:15:54 2020 (r360820) @@ -37,7 +37,7 @@ typedef struct net_backend net_backend_t; /* Interface between network frontends and the network backends. */ typedef void (*net_be_rxeof_t)(int, enum ev_type, void *param); -int netbe_init(net_backend_t **be, const char *devname, net_be_rxeof_t cb, +int netbe_init(net_backend_t **be, const char *opts, net_be_rxeof_t cb, void *param); void netbe_cleanup(net_backend_t *be); uint64_t netbe_get_cap(net_backend_t *be); Modified: head/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- head/usr.sbin/bhyve/pci_e82545.c Fri May 8 17:01:33 2020 (r360819) +++ head/usr.sbin/bhyve/pci_e82545.c Fri May 8 17:15:54 2020 (r360820) @@ -2281,7 +2281,7 @@ e82545_init(struct vmctx *ctx, struct pci_devinst *pi, { char nstr[80]; struct e82545_softc *sc; - char *devname; + char *optscopy; char *vtopts; int mac_provided; @@ -2332,7 +2332,7 @@ e82545_init(struct vmctx *ctx, struct pci_devinst *pi, if (opts != NULL) { int err = 0; - devname = vtopts = strdup(opts); + optscopy = vtopts = strdup(opts); (void) strsep(&vtopts, ","); /* @@ -2357,15 +2357,18 @@ e82545_init(struct vmctx *ctx, struct pci_devinst *pi, } } + free(optscopy); + if (err) { - free(devname); + free(sc); return (err); } - err = netbe_init(&sc->esc_be, devname, e82545_rx_callback, sc); - free(devname); - if (err) + err = netbe_init(&sc->esc_be, opts, e82545_rx_callback, sc); + if (err) { + free(sc); return (err); + } } if (!mac_provided) { Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Fri May 8 17:01:33 2020 (r360819) +++ head/usr.sbin/bhyve/pci_virtio_net.c Fri May 8 17:15:54 2020 (r360820) @@ -577,12 +577,12 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * mac_provided = 0; mtu_provided = 0; if (opts != NULL) { - char *devname; + char *optscopy; char *vtopts; int err = 0; /* Get the device name. */ - devname = vtopts = strdup(opts); + optscopy = vtopts = strdup(opts); (void) strsep(&vtopts, ","); /* @@ -618,15 +618,16 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * } } + free(optscopy); + if (err) { - free(devname); free(sc); return (err); } - err = netbe_init(&sc->vsc_be, devname, pci_vtnet_rx_callback, + err = netbe_init(&sc->vsc_be, opts, pci_vtnet_rx_callback, sc); - free(devname); + if (err) { free(sc); return (err); From owner-svn-src-head@freebsd.org Fri May 8 20:15: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 3C00E2E0A4C; Fri, 8 May 2020 20:15:19 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49JhQb0vNLz4GXC; Fri, 8 May 2020 20:15:19 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A2417F0A; Fri, 8 May 2020 20:15:19 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 048KFIJm075306; Fri, 8 May 2020 20:15:18 GMT (envelope-from antoine@FreeBSD.org) Received: (from antoine@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 048KFIjm075305; Fri, 8 May 2020 20:15:18 GMT (envelope-from antoine@FreeBSD.org) Message-Id: <202005082015.048KFIjm075305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: antoine set sender to antoine@FreeBSD.org using -f From: Antoine Brodin Date: Fri, 8 May 2020 20:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360823 - head X-SVN-Group: head X-SVN-Commit-Author: antoine X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 360823 X-SVN-Commit-Repository: base MIME-Version: 1.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: Fri, 08 May 2020 20:15:19 -0000 Author: antoine Date: Fri May 8 20:15:18 2020 New Revision: 360823 URL: https://svnweb.freebsd.org/changeset/base/360823 Log: Add more obsolete files Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 8 18:53:06 2020 (r360822) +++ head/ObsoleteFiles.inc Fri May 8 20:15:18 2020 (r360823) @@ -40,6 +40,9 @@ OLD_FILES+=usr/bin/objdump OLD_FILES+=usr/share/man/man1/objdump.1.gz +# 20200428: route_var.h moved to net/route +OLD_FILES+=usr/include/net/route_var.h + # 20200418: Make libauditd private OLD_FILES+=usr/lib/libauditd.a OLD_FILES+=usr/lib/libauditd.so @@ -49,6 +52,9 @@ OLD_FILES+=usr/lib/libauditd_p.a # 20200418: Remove bogus man links OLD_FILES+=usr/share/man/man3/getauusernam_R.3.gz OLD_FILES+=usr/share/man/man3/getauclassnam_3.3.gz + +# 20200414: NFS file handle affinity code for the NFS server re-organized +OLD_FILES+=usr/include/nfs/nfs_fha.h # 20200401: Remove procfs-based process debugging OLD_FILES+=usr/include/sys/pioctl.h From owner-svn-src-head@freebsd.org Fri May 8 21:06: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 1244C2E2F6A; Fri, 8 May 2020 21:06:15 +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 49JjYK3Hxwz4WpK; Fri, 8 May 2020 21:06:12 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3B7A88D7; Fri, 8 May 2020 21:06:11 +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 048L6B83030030; Fri, 8 May 2020 21:06:11 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 048L6AfG030005; Fri, 8 May 2020 21:06:10 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005082106.048L6AfG030005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Fri, 8 May 2020 21:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360824 - 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: 360824 X-SVN-Commit-Repository: base MIME-Version: 1.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: Fri, 08 May 2020 21:06:15 -0000 Author: melifaro Date: Fri May 8 21:06:10 2020 New Revision: 360824 URL: https://svnweb.freebsd.org/changeset/base/360824 Log: Embed dst sockaddr into rtentry and remove rte packet counter Currently each rtentry has dst&gateway allocated separately from another zone, bloating cache accesses. Current 'struct rtentry' has 12 "mandatory" radix pointers in the beginning, leaving 4 usable pointers/32 bytes in the first 2 cache lines (amd64). Fields needed for the datapath are destination sockaddr and rt_nhop. So far it doesn't look like there is other routable addressing protocol other than IPv4/IPv6/MPLS, which uses keys longer than 20 bytes. With that in mind, embed dst into struct rtentry, making the first 24 bytes of rtentry within 128 bytes. That is enough to make IPv6 address within first 128 bytes. It is still pretty easy to add code for supporting separately-allocated dst, however it doesn't make a lot of sense in having such code without a use case. As rS359823 moved the gateway to the nexthop structure, the dst embedding change removes the need for any additional allocations done by rt_setgate(). Lastly, as a part of cleanup, remove counter(9) allocation code, as this field is not used in packet processing anymore. Reviewed by: ae Differential Revision: https://reviews.freebsd.org/D24669 Modified: head/sys/net/route.c head/sys/net/route.h head/sys/net/route/route_ddb.c head/sys/net/route/route_var.h head/sys/net/rtsock.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Fri May 8 20:15:18 2020 (r360823) +++ head/sys/net/route.c Fri May 8 21:06:10 2020 (r360824) @@ -241,10 +241,6 @@ rtentry_zinit(void *mem, int size, int how) { struct rtentry *rt = mem; - rt->rt_pksent = counter_u64_alloc(how); - if (rt->rt_pksent == NULL) - return (ENOMEM); - RT_LOCK_INIT(rt); return (0); @@ -256,7 +252,6 @@ rtentry_zfini(void *mem, int size) struct rtentry *rt = mem; RT_LOCK_DESTROY(rt); - counter_u64_free(rt->rt_pksent); } static int @@ -265,7 +260,6 @@ rtentry_ctor(void *mem, int size, void *arg, int how) struct rtentry *rt = mem; bzero(rt, offsetof(struct rtentry, rt_endzero)); - counter_u64_zero(rt->rt_pksent); rt->rt_chain = NULL; return (0); @@ -551,12 +545,6 @@ rtfree(struct rtentry *rt) goto done; } #endif - /* - * The key is separatly alloc'd so free it (see rt_setgate()). - * This also frees the gateway, as they are always malloc'd - * together. - */ - R_Free(rt_key(rt)); /* Unreference nexthop */ nhop_free(rt->rt_nhop); @@ -1557,6 +1545,9 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in (gateway->sa_family != AF_UNSPEC) && (gateway->sa_family != AF_LINK)) return (EINVAL); + if (dst->sa_len > sizeof(((struct rtentry *)NULL)->rt_dstb)) + return (EINVAL); + if (info->rti_ifa == NULL) { error = rt_getifa_fib(info, rnh->rib_fibnum); if (error) @@ -1582,16 +1573,11 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in rt->rt_flags = RTF_UP | flags; rt->rt_fibnum = rnh->rib_fibnum; rt->rt_nhop = nh; - /* - * Add the gateway. Possibly re-malloc-ing the storage for it. - */ - if ((error = rt_setgate(rt, dst, gateway)) != 0) { - ifa_free(info->rti_ifa); - nhop_free(nh); - uma_zfree(V_rtzone, rt); - return (error); - } + /* Fill in dst */ + memcpy(&rt->rt_dst, dst, dst->sa_len); + rt_key(rt) = &rt->rt_dst; + /* * point to the (possibly newly malloc'd) dest address. */ @@ -1623,7 +1609,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in rt_mpath_conflict(rnh, rt, netmask)) { RIB_WUNLOCK(rnh); - R_Free(rt_key(rt)); nhop_free(nh); uma_zfree(V_rtzone, rt); return (EEXIST); @@ -1663,7 +1648,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in * then un-make it (this should be a function) */ if (rn == NULL) { - R_Free(rt_key(rt)); nhop_free(nh); uma_zfree(V_rtzone, rt); return (EEXIST); @@ -1897,40 +1881,6 @@ rt_setmetrics(const struct rt_addrinfo *info, struct r if (info->rti_mflags & RTV_EXPIRE) rt->rt_expire = info->rti_rmx->rmx_expire ? info->rti_rmx->rmx_expire - time_second + time_uptime : 0; -} - -int -rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate) -{ - /* XXX dst may be overwritten, can we move this to below */ - int dlen = SA_SIZE(dst), glen = SA_SIZE(gate); - - /* - * Prepare to store the gateway in rt->rt_gateway. - * Both dst and gateway are stored one after the other in the same - * malloc'd chunk. If we have room, we can reuse the old buffer, - * rt_gateway already points to the right place. - * Otherwise, malloc a new block and update the 'dst' address. - */ - if (rt_key(rt) == NULL) { - caddr_t new; - - R_Malloc(new, caddr_t, dlen + glen); - if (new == NULL) - return ENOBUFS; - /* - * XXX note, we copy from *dst and not *rt_key(rt) because - * rt_setgate() can be called to initialize a newly - * allocated route entry, in which case rt_key(rt) == NULL - * (and also rt->rt_gateway == NULL). - * Free()/free() handle a NULL argument just fine. - */ - bcopy(dst, new, dlen); - R_Free(rt_key(rt)); /* free old block, if any */ - rt_key(rt) = (struct sockaddr *)new; - } - - return (0); } void Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Fri May 8 20:15:18 2020 (r360823) +++ head/sys/net/route.h Fri May 8 21:06:10 2020 (r360824) @@ -378,7 +378,6 @@ int rt_addrmsg(int, struct ifaddr *, int); int rt_routemsg(int, struct rtentry *, struct ifnet *ifp, int, int); int rt_routemsg_info(int, struct rt_addrinfo *, int); void rt_newmaddrmsg(int, struct ifmultiaddr *); -int rt_setgate(struct rtentry *, struct sockaddr *, struct sockaddr *); void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); struct rib_head *rt_table_init(int, int, u_int); void rt_table_destroy(struct rib_head *); Modified: head/sys/net/route/route_ddb.c ============================================================================== --- head/sys/net/route/route_ddb.c Fri May 8 20:15:18 2020 (r360823) +++ head/sys/net/route/route_ddb.c Fri May 8 21:06:10 2020 (r360824) @@ -48,11 +48,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include -#include +#include /* * Unfortunately, RTF_ values are expressed as raw masks rather than powers of Modified: head/sys/net/route/route_var.h ============================================================================== --- head/sys/net/route/route_var.h Fri May 8 20:15:18 2020 (r360823) +++ head/sys/net/route/route_var.h Fri May 8 21:06:10 2020 (r360824) @@ -35,6 +35,7 @@ #ifndef RNF_NORMAL #include #endif +#include /* struct sockaddr_in */ #include struct nh_control; @@ -120,14 +121,33 @@ struct rtentry { #define rt_mask(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_mask))) #define rt_key_const(r) (*((const struct sockaddr * const *)(&(r)->rt_nodes->rn_key))) #define rt_mask_const(r) (*((const struct sockaddr * const *)(&(r)->rt_nodes->rn_mask))) + + /* + * 2 radix_node structurs above consists of 2x6 pointers, leaving + * 4 pointers (32 bytes) of the second cache line on amd64. + * + */ struct nhop_object *rt_nhop; /* nexthop data */ + union { + /* + * Destination address storage. + * sizeof(struct sockaddr_in6) == 28, however + * the dataplane-relevant part (e.g. address) lies + * at offset 8..24, making the address not crossing + * cacheline boundary. + */ + struct sockaddr_in rt_dst4; + struct sockaddr_in6 rt_dst6; + struct sockaddr rt_dst; + char rt_dstb[28]; + }; + 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_pksent - counter_u64_t rt_pksent; /* packets sent using this route */ +#define rt_endzero rt_mtx struct mtx rt_mtx; /* mutex for routing entry */ struct rtentry *rt_chain; /* pointer to next rtentry to delete */ }; Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Fri May 8 20:15:18 2020 (r360823) +++ head/sys/net/rtsock.c Fri May 8 21:06:10 2020 (r360824) @@ -1078,7 +1078,6 @@ rt_getmetrics(const struct rtentry *rt, struct rt_metr bzero(out, sizeof(*out)); out->rmx_mtu = rt->rt_nhop->nh_mtu; out->rmx_weight = rt->rt_weight; - out->rmx_pksent = counter_u64_fetch(rt->rt_pksent); out->rmx_nhidx = nhop_get_idx(rt->rt_nhop); /* Kernel -> userland timebase conversion. */ out->rmx_expire = rt->rt_expire ? From owner-svn-src-head@freebsd.org Fri May 8 22:21: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 ADE272E6357; Fri, 8 May 2020 22:21:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49JlDh4B70z3M4L; Fri, 8 May 2020 22:21:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AB899870; Fri, 8 May 2020 22:21:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 048MLuuq093844; Fri, 8 May 2020 22:21:56 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 048MLu4f093843; Fri, 8 May 2020 22:21:56 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202005082221.048MLu4f093843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 8 May 2020 22:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360826 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 360826 X-SVN-Commit-Repository: base MIME-Version: 1.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: Fri, 08 May 2020 22:21:56 -0000 Author: mhorne Date: Fri May 8 22:21:56 2020 New Revision: 360826 URL: https://svnweb.freebsd.org/changeset/base/360826 Log: Sync relocation definitions Add the most recent relocation types from the RISC-V ELF psABI spec. MFC after: 3 days Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Fri May 8 22:14:39 2020 (r360825) +++ head/sys/sys/elf_common.h Fri May 8 22:21:56 2020 (r360826) @@ -1342,6 +1342,8 @@ typedef struct { #define R_RISCV_SET8 54 #define R_RISCV_SET16 55 #define R_RISCV_SET32 56 +#define R_RISCV_32_PCREL 57 +#define R_RISCV_IRELATIVE 58 #define R_SPARC_NONE 0 #define R_SPARC_8 1 From owner-svn-src-head@freebsd.org Fri May 8 22:22: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 857D62E63AC; Fri, 8 May 2020 22:22: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 49JlF132ZHz3MBy; Fri, 8 May 2020 22:22: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 636F99884; Fri, 8 May 2020 22:22: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 048MMDsJ093928; Fri, 8 May 2020 22:22:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 048MMDgq093927; Fri, 8 May 2020 22:22:13 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005082222.048MMDgq093927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 8 May 2020 22:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360827 - head/sys/dev/etherswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch X-SVN-Commit-Revision: 360827 X-SVN-Commit-Repository: base MIME-Version: 1.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: Fri, 08 May 2020 22:22:13 -0000 Author: adrian Date: Fri May 8 22:22:12 2020 New Revision: 360827 URL: https://svnweb.freebsd.org/changeset/base/360827 Log: [etherswitch] bump register width to 32 bits. Some ethernet switches have very large register windows; for example the AR8316 switch MIB starts at 0x20000. Submitted by: Mori Hiroki Modified: head/sys/dev/etherswitch/etherswitch.h Modified: head/sys/dev/etherswitch/etherswitch.h ============================================================================== --- head/sys/dev/etherswitch/etherswitch.h Fri May 8 22:21:56 2020 (r360826) +++ head/sys/dev/etherswitch/etherswitch.h Fri May 8 22:22:12 2020 (r360827) @@ -14,7 +14,7 @@ extern driver_t etherswitch_driver; #endif /* _KERNEL */ struct etherswitch_reg { - uint16_t reg; + uint32_t reg; uint32_t val; }; typedef struct etherswitch_reg etherswitch_reg_t; From owner-svn-src-head@freebsd.org Fri May 8 22:26: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 121972E648C; Fri, 8 May 2020 22:26:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49JlLN6cL1z3MNR; Fri, 8 May 2020 22:26:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE2F798AC; Fri, 8 May 2020 22:26:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 048MQq9D095773; Fri, 8 May 2020 22:26:52 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 048MQqkB095772; Fri, 8 May 2020 22:26:52 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005082226.048MQqkB095772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 8 May 2020 22:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360828 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 360828 X-SVN-Commit-Repository: base MIME-Version: 1.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: Fri, 08 May 2020 22:26:53 -0000 Author: asomers Date: Fri May 8 22:26:52 2020 New Revision: 360828 URL: https://svnweb.freebsd.org/changeset/base/360828 Log: fusefs: better dtrace probes for asynchronous invalidation operations MFC after: 2 weeks Modified: head/sys/fs/fuse/fuse_internal.c Modified: head/sys/fs/fuse/fuse_internal.c ============================================================================== --- head/sys/fs/fuse/fuse_internal.c Fri May 8 22:22:12 2020 (r360827) +++ head/sys/fs/fuse/fuse_internal.c Fri May 8 22:26:52 2020 (r360828) @@ -377,8 +377,8 @@ fuse_internal_fsync(struct vnode *vp, } /* Asynchronous invalidation */ -SDT_PROBE_DEFINE2(fusefs, , internal, invalidate_cache_hit, - "struct vnode*", "struct vnode*"); +SDT_PROBE_DEFINE3(fusefs, , internal, invalidate_entry, + "struct vnode*", "struct fuse_notify_inval_entry_out*", "char*"); int fuse_internal_invalidate_entry(struct mount *mp, struct uio *uio) { @@ -407,6 +407,7 @@ fuse_internal_invalidate_entry(struct mount *mp, struc else err = fuse_internal_get_cached_vnode( mp, fnieo.parent, LK_SHARED, &dvp); + SDT_PROBE3(fusefs, , internal, invalidate_entry, dvp, &fnieo, name); /* * If dvp is not in the cache, then it must've been reclaimed. And * since fuse_vnop_reclaim does a cache_purge, name's entry must've @@ -435,6 +436,8 @@ fuse_internal_invalidate_entry(struct mount *mp, struc return (0); } +SDT_PROBE_DEFINE2(fusefs, , internal, invalidate_inode, + "struct vnode*", "struct fuse_notify_inval_inode_out *"); int fuse_internal_invalidate_inode(struct mount *mp, struct uio *uio) { @@ -450,6 +453,7 @@ fuse_internal_invalidate_inode(struct mount *mp, struc else err = fuse_internal_get_cached_vnode(mp, fniio.ino, LK_SHARED, &vp); + SDT_PROBE2(fusefs, , internal, invalidate_inode, vp, &fniio); if (err != 0 || vp == NULL) return (err); /* From owner-svn-src-head@freebsd.org Fri May 8 23:00: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 20E6E2E6EE9; Fri, 8 May 2020 23:00:03 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Jm4f6svGz3Nl9; Fri, 8 May 2020 23:00:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E71669E60; Fri, 8 May 2020 23:00:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 048N02Ar014432; Fri, 8 May 2020 23:00:02 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 048N02r4014431; Fri, 8 May 2020 23:00:02 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005082300.048N02r4014431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 8 May 2020 23:00:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360829 - head/tests/sys/fs/fusefs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/fs/fusefs X-SVN-Commit-Revision: 360829 X-SVN-Commit-Repository: base MIME-Version: 1.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: Fri, 08 May 2020 23:00:03 -0000 Author: asomers Date: Fri May 8 23:00:02 2020 New Revision: 360829 URL: https://svnweb.freebsd.org/changeset/base/360829 Log: fusefs: fix two small bugs in the tests' expectations These two errors have been present since the tests' introduction. Coincidentally every test (I think there's only one) that cares about that field also works when the field's value is 0. MFC after: 2 weeks Modified: head/tests/sys/fs/fusefs/default_permissions.cc head/tests/sys/fs/fusefs/default_permissions_privileged.cc Modified: head/tests/sys/fs/fusefs/default_permissions.cc ============================================================================== --- head/tests/sys/fs/fusefs/default_permissions.cc Fri May 8 22:26:52 2020 (r360828) +++ head/tests/sys/fs/fusefs/default_permissions.cc Fri May 8 23:00:02 2020 (r360829) @@ -125,7 +125,7 @@ void expect_getattr(uint64_t ino, mode_t mode, uint64_ out.body.attr.attr.mode = mode; out.body.attr.attr.size = 0; out.body.attr.attr.uid = uid; - out.body.attr.attr.uid = gid; + out.body.attr.attr.gid = gid; out.body.attr.attr_valid = attr_valid; }))); } Modified: head/tests/sys/fs/fusefs/default_permissions_privileged.cc ============================================================================== --- head/tests/sys/fs/fusefs/default_permissions_privileged.cc Fri May 8 22:26:52 2020 (r360828) +++ head/tests/sys/fs/fusefs/default_permissions_privileged.cc Fri May 8 23:00:02 2020 (r360829) @@ -85,7 +85,7 @@ void expect_getattr(uint64_t ino, mode_t mode, uint64_ out.body.attr.attr.mode = mode; out.body.attr.attr.size = 0; out.body.attr.attr.uid = uid; - out.body.attr.attr.uid = gid; + out.body.attr.attr.gid = gid; out.body.attr.attr_valid = attr_valid; }))); } From owner-svn-src-head@freebsd.org Sat May 9 02:01: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 D38D02D4A18; Sat, 9 May 2020 02:01:29 +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 49Jr61522Gz42Xn; Sat, 9 May 2020 02:01:29 +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 A7D99C470; Sat, 9 May 2020 02:01:29 +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 04921TAG028389; Sat, 9 May 2020 02:01:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04921Tpf028388; Sat, 9 May 2020 02:01:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005090201.04921Tpf028388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 9 May 2020 02:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360833 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 360833 X-SVN-Commit-Repository: base MIME-Version: 1.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: Sat, 09 May 2020 02:01:29 -0000 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 \ + else \ + echo "No certctl on the host, not rehashing target -- /etc/ssl may not be populated."; \ + fi .endif packageworld: .PHONY From owner-svn-src-head@freebsd.org Sat May 9 03:58: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 141A32DB535 for ; Sat, 9 May 2020 03:58:10 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic304-23.consmr.mail.gq1.yahoo.com (sonic304-23.consmr.mail.gq1.yahoo.com [98.137.68.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 49Jthb6Scfz4Bwh for ; Sat, 9 May 2020 03:58:07 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: s0_eZEgVM1kntVEPp5zUb2Pq16aoJ1O8ool0YjqYxqXmvYgL8PHMFtmIwpbNfpG pxKFMBhV3sd28Fx3ufO1P5mYcQLHKDE1m5CZzhFzyJBBMzzHtBfxBLVnqAWkMyyAuZmqZ2ScnjMj cxVGWsQGfYur.9Ku7XZW._hrh8RLnFRQCF01D.moEPnPC0WTgKFm_GXn7SYkq6.Pg6C90yZDMjqw Vtib5SySCCLgrjLLrOua8o8Uh7FLsJFZygoKZytO0hCCStPuAaW._U0kSIRb92mwxPouIJHkvBr_ nhGADpZV5WmJ0Leor8z1Ku2dfqMpuFWQDd4zljLTUQpkYSKM7TBGNXLF8WE7Q8k41QyVZecMRvN9 Ufxzs78oOVrOELk6f0Ia71uSXshU6WRWmq2jMlAZhNeZVQpGnOHOPPqL9W1ZHhiUc27yY.lE1etw QWnCahLz9ApGIXMgeyzuhnosN517oR728w6YmL2gckxVaz4XSt.gfnz0ZqwBCWsazBp.7IfcI0bR b6FzhWhZCJiveX4tnkrTfGRyKRLiyT4k.S1uNWeI8.NQpRaCsA.NYPNTYqMt_Kht2TllSaWodXbH qSCyfW3o3azjKBGB5UkknnupwGfAWQLuy.qIqu56S7sLr27rX7truy_X1uvGowvx5ZXNZaNePqxT I1ZJG29M_Z80wl6BTuJL6jXByXHuAnPe1mT_XOxkvu7ZQdUJ6AbMiiuvfTglinoJhdDYfsxB5pVP HBviAwEBQXU0H6xcu02h2hkHWis.ktNJHlSRuAuTCr85WiDzqTyfsA1iRg611eV6.GKIexXNiUG7 whjFVar0Me_25vxiy3AgllxABzMXSTA5.FTuvVrzstGE0.eicLA318w7ty2jhII4lQTQpLP1abby .dKS7I4hgQosHxEicdvmZaLdTU3cbZ4eWLh7l9VzphGNSxT15mPVyqAiz78Igiak.HBJFoqmxuMD 09jARYa2OwCSVXPG8QAa72U47SlhwJVlyhfLUnA0cNuLcM_4Lw.g3eL5SNWKlTVMGuCGBvl4JKB3 LBNhojpv9exZQmEqy7QnNOGZfMOV76T1VdOARbW5WuCvDR2RsbnqxIHeGwDvIF4m7YTIV90XhbVK qderv9zcQCJZQTJYHj7WHEiCVg2dmFQ4Fv4K6nCNAMrkzufYII4jHJo7CjwccD1TrUJDp0doHSZt 82JCGkLWphzUXwMFeYfgRQLRt3AkU5mM_4YltVflTxRDVhDGyqsUaVnN98V101ghOlN0DcOSI6Ht CKIeM6UphwsEE2HG1HovfZMnv9RN1EhaA2ia.NNY_kAxOrRS232wMCuyYz3kZ7nQ86DDl6f8SR0R 1ZA.iRPhbPWJR0rozq7W0hb3l1Vm1QHhvgUd2cYhL2cWgYnndUzL2RwfkmGjlvMIFm5AaPKoCADw sVVUYgN0GqHUK64o2bSpDQa_OWbQXF08- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Sat, 9 May 2020 03:58:04 +0000 Received: by smtp415.mail.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 143842a2404404a60b46c84d00c5d4fd; Sat, 09 May 2020 03:58:02 +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: Fri, 8 May 2020 20:58:02 -0700 Cc: Brandon Bergren , Justin Hibbits Content-Transfer-Encoding: quoted-printable 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: 49Jthb6Scfz4Bwh X-Spamd-Bar: - X-Spamd-Result: default: False [-1.89 / 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.62)[-0.617,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.77)[-0.771,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (7.01), 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.68.137.98.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[204.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.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: Sat, 09 May 2020 03:58:10 -0000 [I caused nfsd to having things shifted in mmeory some to see it it tracked content vs. page boundary for where the zeros stop. Non-nfsd examples omitted.] > . . . >> nfsd hit an assert, failing ret =3D=3D sz_size2index_compute(size) >=20 > [Correction: That should have referenced sz_index2size_lookup(index).] >=20 >> (also, but a different caller of sz_size2index): >=20 > [Correction: The "also" comment should be ignored: > sz_index2size_lookup(index) is referenced below.] >=20 >>=20 >> (gdb) bt >> #0 thr_kill () at thr_kill.S:4 >> #1 0x502b2170 in __raise (s=3D6) at /usr/src/lib/libc/gen/raise.c:52 >> #2 0x50211cc0 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 >> #3 0x50206104 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=3D0x50094018, ptr=3D0x50041028, tcache=3D0x50094138, = slow_path=3D) at jemalloc_jemalloc.c:2583 >> #6 0x50205cac in __je_free_default (ptr=3D0x50041028) at = jemalloc_jemalloc.c:2784 >> #7 0x50206294 in __free (ptr=3D0x50041028) at = jemalloc_jemalloc.c:2852 >> #8 0x50287ec8 in ns_src_free (src=3D0x50329004, = srclistsize=3D) at /usr/src/lib/libc/net/nsdispatch.c:452 >> #9 ns_dbt_free (dbt=3D0x50329000) at = /usr/src/lib/libc/net/nsdispatch.c:436 >> #10 vector_free (vec=3D0x50329000, count=3D, esize=3D12,= free_elem=3D) at /usr/src/lib/libc/net/nsdispatch.c:253 >> #11 nss_atexit () at /usr/src/lib/libc/net/nsdispatch.c:578 >> #12 0x5028d958 in __cxa_finalize (dso=3D0x0) at = /usr/src/lib/libc/stdlib/atexit.c:240 >> #13 0x502117f8 in exit (status=3D0) at = /usr/src/lib/libc/stdlib/exit.c:74 >> #14 0x10013f9c in child_cleanup (signo=3D) at = /usr/src/usr.sbin/nfsd/nfsd.c:969 >> #15 >> #16 0x00000000 in ?? () >>=20 >> (gdb) up 3 >> #3 0x50206104 in sz_index2size_lookup (index=3D) at = /usr/src/contrib/jemalloc/include/jemalloc/internal/sz.h:200 >> 200 assert(ret =3D=3D sz_index2size_compute(index)); >>=20 >> (ret is optimized out.) >>=20 >> 197 JEMALLOC_ALWAYS_INLINE size_t >> 198 sz_index2size_lookup(szind_t index) { >> 199 size_t ret =3D (size_t)sz_index2size_tab[index]; >> 200 assert(ret =3D=3D sz_index2size_compute(index)); >> 201 return ret; >> 202 } >=20 > (gdb) print/x __je_sz_index2size_tab > $3 =3D {0x0 } >=20 > Also: >=20 > (gdb) x/4x __je_arenas+16368/4 > 0x5030cab0 <__je_arenas+16368>: 0x00000000 0x00000000 = 0x00000000 0x00000000 > (gdb) print/x __je_arenas_lock = =20= > $8 =3D {{{prof_data =3D {tot_wait_time =3D {ns =3D 0x0}, max_wait_time = =3D {ns =3D 0x0}, n_wait_times =3D 0x0, n_spin_acquired =3D 0x0, = max_n_thds =3D 0x0, n_waiting_thds =3D {repr =3D 0x0}, n_owner_switches = =3D 0x0,=20 > prev_owner =3D 0x0, n_lock_ops =3D 0x0}, lock =3D 0x0, = postponed_next =3D 0x0, locked =3D {repr =3D 0x0}}}, witness =3D {name =3D= 0x0, rank =3D 0x0, comp =3D 0x0, opaque =3D 0x0, link =3D {qre_next =3D = 0x0,=20 > qre_prev =3D 0x0}}, lock_order =3D 0x0} > (gdb) print/x __je_narenas_auto > $9 =3D 0x0 > (gdb) print/x malloc_conf =20 > $10 =3D 0x0 > (gdb) print/x __je_ncpus=20 > $11 =3D 0x0 > (gdb) print/x __je_manual_arena_base > $12 =3D 0x0 > (gdb) print/x __je_sz_pind2sz_tab =20 > $13 =3D {0x0 } > (gdb) print/x __je_sz_size2index_tab > $1 =3D {0x0 , 0x1a, 0x1b , 0x1c = } >=20 >> Booting and immediately trying something like: >>=20 >> service nfsd stop >>=20 >> did not lead to a failure. But may be after >> a while it would and be less drastic than a >> reboot or power down. >=20 > More detail: >=20 > So, for rpcbind and nfds at some point a large part of > __je_sz_size2index_tab is being stomped on, as is all of > __je_sz_index2size_tab and more. >=20 > . . . >=20 > For nfsd, it is similar (again showing the partially > non-zero live process context instead of the all-zeros > from the .core file): >=20 > 0x5030cab0 <__je_arenas+16368>: 0x00000000 0x00000000 = 0x00000000 0x00000009 > 0x5030cac0 <__je_arenas_lock>: 0x00000000 0x00000000 = 0x00000000 0x00000000 > 0x5030cad0 <__je_arenas_lock+16>: 0x00000000 0x00000000 = 0x00000000 0x00000000 > 0x5030cae0 <__je_arenas_lock+32>: 0x00000000 0x00000000 = 0x00000000 0x00000000 > 0x5030caf0 <__je_arenas_lock+48>: 0x00000000 0x00000000 = 0x00000000 0x00000000 > 0x5030cb00 <__je_arenas_lock+64>: 0x00000000 0x502ff070 = 0x00000000 0x00000000 > 0x5030cb10 <__je_arenas_lock+80>: 0x500ebb04 0x00000003 = 0x00000000 0x00000000 > 0x5030cb20 <__je_arenas_lock+96>: 0x5030cb10 0x5030cb10 = 0x00000000 0x00000000 >=20 > Then the memory in the crash continues to be zero until: >=20 > 0x5030d000 <__je_sz_size2index_tab+384>: 0x1a1b1b1b = 0x1b1b1b1b 0x1b1b1b1b 0x1b1b1b1b >=20 > Notice the interesting page boundary for where non-zero > is first available again! >=20 > Between __je_arenas_lock and __je_sz_size2index_tab are: >=20 > 0x5030cb30 __je_narenas_auto > 0x5030cb38 malloc_conf > 0x5030cb3c __je_ncpus > 0x5030cb40 __je_manual_arena_base > 0x5030cb80 __je_sz_pind2sz_tab > 0x5030ccc0 __je_sz_index2size_tab > 0x5030ce80 __je_sz_size2index_tab >=20 >=20 > Note: because __je_arenas is normally > mostly zero for these contexts, I can > not tell where the memory trashing > started, only where it replaced non-zero > values with zeros. > . . . I caused the memory content to have shifted some in nfsd. The resultant zeros-stop-at from the failure look like: (gdb) x/128x __je_sz_size2index_tab 0x5030cf00 <__je_sz_size2index_tab>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5030cf10 <__je_sz_size2index_tab+16>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5030cf20 <__je_sz_size2index_tab+32>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5030cf30 <__je_sz_size2index_tab+48>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5030cf40 <__je_sz_size2index_tab+64>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5030cf50 <__je_sz_size2index_tab+80>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5030cf60 <__je_sz_size2index_tab+96>: 0x00000000 0x00000000 = 0x00000000 0x00000000 0x5030cf70 <__je_sz_size2index_tab+112>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5030cf80 <__je_sz_size2index_tab+128>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5030cf90 <__je_sz_size2index_tab+144>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5030cfa0 <__je_sz_size2index_tab+160>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5030cfb0 <__je_sz_size2index_tab+176>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5030cfc0 <__je_sz_size2index_tab+192>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5030cfd0 <__je_sz_size2index_tab+208>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5030cfe0 <__je_sz_size2index_tab+224>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5030cff0 <__je_sz_size2index_tab+240>: 0x00000000 = 0x00000000 0x00000000 0x00000000 0x5030d000 <__je_sz_size2index_tab+256>: 0x18191919 = 0x19191919 0x19191919 0x19191919 0x5030d010 <__je_sz_size2index_tab+272>: 0x19191919 = 0x19191919 0x19191919 0x19191919 0x5030d020 <__je_sz_size2index_tab+288>: 0x19191919 = 0x19191919 0x19191919 0x19191919 0x5030d030 <__je_sz_size2index_tab+304>: 0x19191919 = 0x19191919 0x19191919 0x19191919 0x5030d040 <__je_sz_size2index_tab+320>: 0x191a1a1a = 0x1a1a1a1a 0x1a1a1a1a 0x1a1a1a1a 0x5030d050 <__je_sz_size2index_tab+336>: 0x1a1a1a1a = 0x1a1a1a1a 0x1a1a1a1a 0x1a1a1a1a 0x5030d060 <__je_sz_size2index_tab+352>: 0x1a1a1a1a = 0x1a1a1a1a 0x1a1a1a1a 0x1a1a1a1a 0x5030d070 <__je_sz_size2index_tab+368>: 0x1a1a1a1a = 0x1a1a1a1a 0x1a1a1a1a 0x1a1a1a1a 0x5030d080 <__je_sz_size2index_tab+384>: 0x1a1b1b1b = 0x1b1b1b1b 0x1b1b1b1b 0x1b1b1b1b 0x5030d090 <__je_sz_size2index_tab+400>: 0x1b1b1b1b = 0x1b1b1b1b 0x1b1b1b1b 0x1b1b1b1b 0x5030d0a0 <__je_sz_size2index_tab+416>: 0x1b1b1b1b = 0x1b1b1b1b 0x1b1b1b1b 0x1b1b1b1b 0x5030d0b0 <__je_sz_size2index_tab+432>: 0x1b1b1b1b = 0x1b1b1b1b 0x1b1b1b1b 0x1b1b1b1b 0x5030d0c0 <__je_sz_size2index_tab+448>: 0x1b1c1c1c = 0x1c1c1c1c 0x1c1c1c1c 0x1c1c1c1c 0x5030d0d0 <__je_sz_size2index_tab+464>: 0x1c1c1c1c = 0x1c1c1c1c 0x1c1c1c1c 0x1c1c1c1c 0x5030d0e0 <__je_sz_size2index_tab+480>: 0x1c1c1c1c = 0x1c1c1c1c 0x1c1c1c1c 0x1c1c1c1c 0x5030d0f0 <__je_sz_size2index_tab+496>: 0x1c1c1c1c = 0x1c1c1c1c 0x1c1c1c1c 0x1c1c1c1c So, it is the page boundary that it tracks, not the detailed placement of the memory contents. =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 Sat May 9 06:25: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 59ED12DDEB4; Sat, 9 May 2020 06:25:21 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49JxyT1Wxlz4KcZ; Sat, 9 May 2020 06:25:21 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A909F979; Sat, 9 May 2020 06:25:21 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0496PLWf091233; Sat, 9 May 2020 06:25:21 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0496PLvc091232; Sat, 9 May 2020 06:25:21 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202005090625.0496PLvc091232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 9 May 2020 06:25:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360836 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 360836 X-SVN-Commit-Repository: base MIME-Version: 1.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: Sat, 09 May 2020 06:25:21 -0000 Author: tsoome Date: Sat May 9 06:25:20 2020 New Revision: 360836 URL: https://svnweb.freebsd.org/changeset/base/360836 Log: loader: vdev_read() can corrupt memory When reading less than sector size but from sector boundary, the vdev_read() will read full sector into the provided buffer and therefore corrupting memory past buffer end. MFC after: 2 days Modified: head/stand/libsa/zfs/zfs.c Modified: head/stand/libsa/zfs/zfs.c ============================================================================== --- head/stand/libsa/zfs/zfs.c Sat May 9 05:04:02 2020 (r360835) +++ head/stand/libsa/zfs/zfs.c Sat May 9 06:25:20 2020 (r360836) @@ -418,7 +418,7 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void full_sec_size -= secsz; /* Return of partial sector data requires a bounce buffer. */ - if ((head > 0) || do_tail_read) { + if ((head > 0) || do_tail_read || bytes < secsz) { bouncebuf = malloc(secsz); if (bouncebuf == NULL) { printf("vdev_read: out of memory\n"); @@ -442,14 +442,28 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void outbuf += min(secsz - head, bytes); } - /* Full data return from read sectors */ + /* + * Full data return from read sectors. + * Note, there is still corner case where we read + * from sector boundary, but less than sector size, e.g. reading 512B + * from 4k sector. + */ if (full_sec_size > 0) { - res = read(fd, outbuf, full_sec_size); - if (res != full_sec_size) { - ret = EIO; - goto error; + if (bytes < full_sec_size) { + res = read(fd, bouncebuf, secsz); + if (res != secsz) { + ret = EIO; + goto error; + } + memcpy(outbuf, bouncebuf, bytes); + } else { + res = read(fd, outbuf, full_sec_size); + if (res != full_sec_size) { + ret = EIO; + goto error; + } + outbuf += full_sec_size; } - outbuf += full_sec_size; } /* Partial data return from last sector */ From owner-svn-src-head@freebsd.org Sat May 9 06:57: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 3CCD92DE73A; Sat, 9 May 2020 06:57:48 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.88]) (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 49Jygt6wFfz4M24; Sat, 9 May 2020 06:57:46 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.110.112]) by smarthost1.greenhost.nl with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jXJQe-00051U-IH; Sat, 09 May 2020 08:57:45 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Toomas Soome" Subject: Re: svn commit: r360836 - head/stand/libsa/zfs References: <202005090625.0496PLvc091232@repo.freebsd.org> Date: Sat, 09 May 2020 08:57:41 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <202005090625.0496PLvc091232@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 autolearn=disabled version=3.4.2 X-Scan-Signature: bbdeaaa4d227adae8d620e69c05793d6 X-Rspamd-Queue-Id: 49Jygt6wFfz4M24 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of ronald-lists@klop.ws designates 195.190.28.88 as permitted sender) smtp.mailfrom=ronald-lists@klop.ws X-Spamd-Result: default: False [-2.51 / 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]; R_SPF_ALLOW(-0.20)[+ip4:195.190.28.64/27]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[klop.ws]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-0.71)[ip: (-0.55), ipnet: 195.190.28.0/24(-0.22), asn: 47172(-2.80), country: NL(0.03)]; RCVD_IN_DNSWL_NONE(0.00)[88.28.190.195.list.dnswl.org : 127.0.10.0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RWL_MAILSPIKE_VERYGOOD(0.00)[88.28.190.195.rep.mailspike.net : 127.0.0.19]; ASN(0.00)[asn:47172, ipnet:195.190.28.0/24, country:NL]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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: Sat, 09 May 2020 06:57:48 -0000 Hi Toomas, Could this fix this issue https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=144234 ? Regards, Ronald. On Sat, 09 May 2020 08:25:21 +0200, Toomas Soome wrote: > Author: tsoome > Date: Sat May 9 06:25:20 2020 > New Revision: 360836 > URL: https://svnweb.freebsd.org/changeset/base/360836 > > Log: > loader: vdev_read() can corrupt memory > When reading less than sector size but from sector boundary, > the vdev_read() will read full sector into the provided buffer > and therefore corrupting memory past buffer end. > MFC after: 2 days > > Modified: > head/stand/libsa/zfs/zfs.c > > Modified: head/stand/libsa/zfs/zfs.c > ============================================================================== > --- head/stand/libsa/zfs/zfs.c Sat May 9 05:04:02 2020 (r360835) > +++ head/stand/libsa/zfs/zfs.c Sat May 9 06:25:20 2020 (r360836) > @@ -418,7 +418,7 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, > void > full_sec_size -= secsz; > /* Return of partial sector data requires a bounce buffer. */ > - if ((head > 0) || do_tail_read) { > + if ((head > 0) || do_tail_read || bytes < secsz) { > bouncebuf = malloc(secsz); > if (bouncebuf == NULL) { > printf("vdev_read: out of memory\n"); > @@ -442,14 +442,28 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, > void > outbuf += min(secsz - head, bytes); > } > - /* Full data return from read sectors */ > + /* > + * Full data return from read sectors. > + * Note, there is still corner case where we read > + * from sector boundary, but less than sector size, e.g. reading 512B > + * from 4k sector. > + */ > if (full_sec_size > 0) { > - res = read(fd, outbuf, full_sec_size); > - if (res != full_sec_size) { > - ret = EIO; > - goto error; > + if (bytes < full_sec_size) { > + res = read(fd, bouncebuf, secsz); > + if (res != secsz) { > + ret = EIO; > + goto error; > + } > + memcpy(outbuf, bouncebuf, bytes); > + } else { > + res = read(fd, outbuf, full_sec_size); > + if (res != full_sec_size) { > + ret = EIO; > + goto error; > + } > + outbuf += full_sec_size; > } > - outbuf += full_sec_size; > } > /* Partial data return from last sector */ > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Sat May 9 07:25: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 DD7612DF326 for ; Sat, 9 May 2020 07:25:35 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-ztdg10022001.me.com (pv50p00im-ztdg10022001.me.com [17.58.6.58]) (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 49JzHy6ZTdz4Nbx for ; Sat, 9 May 2020 07:25:34 +0000 (UTC) (envelope-from tsoome@me.com) Received: from nazgul.lan (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-ztdg10022001.me.com (Postfix) with ESMTPSA id D3A67A0314; Sat, 9 May 2020 07:25:31 +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: r360836 - head/stand/libsa/zfs From: Toomas Soome In-Reply-To: Date: Sat, 9 May 2020 10:25:29 +0300 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Toomas Soome Content-Transfer-Encoding: quoted-printable Message-Id: <2125B6CE-D25F-4BC8-AB13-89C4D01C7150@me.com> References: <202005090625.0496PLvc091232@repo.freebsd.org> To: Ronald Klop X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-09_02:2020-05-08, 2020-05-09 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2002250000 definitions=main-2005090069 X-Rspamd-Queue-Id: 49JzHy6ZTdz4Nbx X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:17.58.0.0/16]; FREEMAIL_FROM(0.00)[me.com]; RWL_MAILSPIKE_GOOD(0.00)[58.6.58.17.rep.mailspike.net : 127.0.0.18]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; DKIM_TRACE(0.00)[me.com:+]; DMARC_POLICY_ALLOW(-0.50)[me.com,quarantine]; RECEIVED_SPAMHAUS_PBL(0.00)[148.52.235.80.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; RCVD_IN_DNSWL_LOW(-0.10)[58.6.58.17.list.dnswl.org : 127.0.5.1]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:714, ipnet:17.58.0.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[me.com]; R_DKIM_ALLOW(-0.20)[me.com:s=1a1hai]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (-4.73), ipnet: 17.58.0.0/20(-2.17), asn: 714(-2.52), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; DWL_DNSWL_LOW(-1.00)[me.com.dwl.dnswl.org : 127.0.5.1]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(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: Sat, 09 May 2020 07:25:35 -0000 > On 9. May 2020, at 09:57, Ronald Klop wrote: >=20 > Hi Toomas, >=20 > Could this fix this issue = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D144234 ? >=20 > Regards, > Ronald. I doubt a bit unless you have GELI encryption or 4kn disk (which we can = not boot with BIOS, only with UEFI). That issue was reported 2010 agains = 9.0? is it still the case? rgds, toomas >=20 >=20 > On Sat, 09 May 2020 08:25:21 +0200, Toomas Soome = wrote: >=20 >> Author: tsoome >> Date: Sat May 9 06:25:20 2020 >> New Revision: 360836 >> URL: https://svnweb.freebsd.org/changeset/base/360836 >>=20 >> Log: >> loader: vdev_read() can corrupt memory >> When reading less than sector size but from sector boundary, >> the vdev_read() will read full sector into the provided buffer >> and therefore corrupting memory past buffer end. >> MFC after: 2 days >>=20 >> Modified: >> head/stand/libsa/zfs/zfs.c >>=20 >> Modified: head/stand/libsa/zfs/zfs.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/stand/libsa/zfs/zfs.c Sat May 9 05:04:02 2020 = (r360835) >> +++ head/stand/libsa/zfs/zfs.c Sat May 9 06:25:20 2020 = (r360836) >> @@ -418,7 +418,7 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, = void >> full_sec_size -=3D secsz; >> /* Return of partial sector data requires a bounce buffer. */ >> - if ((head > 0) || do_tail_read) { >> + if ((head > 0) || do_tail_read || bytes < secsz) { >> bouncebuf =3D malloc(secsz); >> if (bouncebuf =3D=3D NULL) { >> printf("vdev_read: out of memory\n"); >> @@ -442,14 +442,28 @@ vdev_read(vdev_t *vdev, void *priv, off_t = offset, void >> outbuf +=3D min(secsz - head, bytes); >> } >> - /* Full data return from read sectors */ >> + /* >> + * Full data return from read sectors. >> + * Note, there is still corner case where we read >> + * from sector boundary, but less than sector size, e.g. reading = 512B >> + * from 4k sector. >> + */ >> if (full_sec_size > 0) { >> - res =3D read(fd, outbuf, full_sec_size); >> - if (res !=3D full_sec_size) { >> - ret =3D EIO; >> - goto error; >> + if (bytes < full_sec_size) { >> + res =3D read(fd, bouncebuf, secsz); >> + if (res !=3D secsz) { >> + ret =3D EIO; >> + goto error; >> + } >> + memcpy(outbuf, bouncebuf, bytes); >> + } else { >> + res =3D read(fd, outbuf, full_sec_size); >> + if (res !=3D full_sec_size) { >> + ret =3D EIO; >> + goto error; >> + } >> + outbuf +=3D full_sec_size; >> } >> - outbuf +=3D full_sec_size; >> } >> /* Partial data return from last sector */ >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to = "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Sat May 9 07:57: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 88D4B2DFBA6; Sat, 9 May 2020 07:57:42 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49K01232dgz4Pt0; Sat, 9 May 2020 07:57:42 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 637F518A92; Sat, 9 May 2020 07:57:42 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0497vgJH048505; Sat, 9 May 2020 07:57:42 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0497vg6r048504; Sat, 9 May 2020 07:57:42 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202005090757.0497vg6r048504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sat, 9 May 2020 07:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360837 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 360837 X-SVN-Commit-Repository: base MIME-Version: 1.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: Sat, 09 May 2020 07:57:42 -0000 Author: vmaffione Date: Sat May 9 07:57:41 2020 New Revision: 360837 URL: https://svnweb.freebsd.org/changeset/base/360837 Log: bhyve: update man page to describe the virtio-net mtu option r359704 introduced an 'mtu' option for the virtio-net device emulation. Update the man page to describe the new option. Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D24723 Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Sat May 9 06:25:20 2020 (r360836) +++ head/usr.sbin/bhyve/bhyve.8 Sat May 9 07:57:41 2020 (r360837) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 04, 2020 +.Dd May 5, 2020 .Dt BHYVE 8 .Os .Sh NAME @@ -293,8 +293,8 @@ considered unconnected. .Pp Network devices: .Bl -tag -width 10n -.It Ar tapN Ns Op , Ns Ar mac=xx:xx:xx:xx:xx:xx -.It Ar vmnetN Ns Op , Ns Ar mac=xx:xx:xx:xx:xx:xx +.It Ar tapN Ns Oo , Ns Ar mac=xx:xx:xx:xx:xx:xx Oc Ns Oo , Ns Ar mtu=N Oc +.It Ar vmnetN Ns Oo , Ns Ar mac=xx:xx:xx:xx:xx:xx Oc Ns Oo , Ns Ar mtu=N Oc .Pp If .Ar mac @@ -305,6 +305,11 @@ the device name. The MAC address is an ASCII string in .Xr ethers 5 format. +.Pp +With virtio-net devices, the +.Ar mtu +parameter can be specified to inform the guest about the largest MTU +that should be allowed, expressed in bytes. .El .Pp Block storage devices: From owner-svn-src-head@freebsd.org Sat May 9 08:23: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 DBB492E057E; Sat, 9 May 2020 08:23:34 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.88]) (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 49K0Zs0TjYz4RMJ; Sat, 9 May 2020 08:23:32 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.110.112]) by smarthost1.greenhost.nl with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jXKle-0004D7-Bi; Sat, 09 May 2020 10:23:30 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Toomas Soome" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Toomas Soome" Subject: Re: svn commit: r360836 - head/stand/libsa/zfs References: <202005090625.0496PLvc091232@repo.freebsd.org> <2125B6CE-D25F-4BC8-AB13-89C4D01C7150@me.com> Date: Sat, 09 May 2020 10:23:28 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <2125B6CE-D25F-4BC8-AB13-89C4D01C7150@me.com> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 autolearn=disabled version=3.4.2 X-Scan-Signature: 4c1f0696016754537de762f13eb96caa X-Rspamd-Queue-Id: 49K0Zs0TjYz4RMJ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of ronald-lists@klop.ws designates 195.190.28.88 as permitted sender) smtp.mailfrom=ronald-lists@klop.ws X-Spamd-Result: default: False [-2.50 / 15.00]; ARC_NA(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)[+ip4:195.190.28.64/27]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[klop.ws]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[88.28.190.195.list.dnswl.org : 127.0.10.0]; IP_SCORE(-0.70)[ip: (-0.54), ipnet: 195.190.28.0/24(-0.22), asn: 47172(-2.78), country: NL(0.03)]; FREEMAIL_TO(0.00)[me.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RWL_MAILSPIKE_VERYGOOD(0.00)[88.28.190.195.rep.mailspike.net : 127.0.0.19]; ASN(0.00)[asn:47172, ipnet:195.190.28.0/24, country:NL]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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: Sat, 09 May 2020 08:23:34 -0000 On Sat, 09 May 2020 09:25:29 +0200, Toomas Soome wrote: > > >> On 9. May 2020, at 09:57, Ronald Klop wrote: >> >> Hi Toomas, >> >> Could this fix this issue >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=144234 ? >> >> Regards, >> Ronald. > > > I doubt a bit unless you have GELI encryption or 4kn disk (which we can > not boot with BIOS, only with UEFI). That issue was reported 2010 agains > 9.0? is it still the case? > > rgds, > toomas Clear answer. I don't use the computer I had this problem with anymore. (It is in the attic somewhere,) And the problem disappeared for me in 2017 (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=144234#c33). But the issue apparently happens for other people in 12.1 still as I read in the replies to the issue. Because of the bogus LBA numbers I suspected some memory corruption. But never found further evidence for this. Regards, Ronald. >> >> >> On Sat, 09 May 2020 08:25:21 +0200, Toomas Soome >> wrote: >> >>> Author: tsoome >>> Date: Sat May 9 06:25:20 2020 >>> New Revision: 360836 >>> URL: https://svnweb.freebsd.org/changeset/base/360836 >>> >>> Log: >>> loader: vdev_read() can corrupt memory >>> When reading less than sector size but from sector boundary, >>> the vdev_read() will read full sector into the provided buffer >>> and therefore corrupting memory past buffer end. >>> MFC after: 2 days >>> >>> Modified: >>> head/stand/libsa/zfs/zfs.c >>> >>> Modified: head/stand/libsa/zfs/zfs.c >>> ============================================================================== >>> --- head/stand/libsa/zfs/zfs.c Sat May 9 05:04:02 2020 (r360835) >>> +++ head/stand/libsa/zfs/zfs.c Sat May 9 06:25:20 2020 (r360836) >>> @@ -418,7 +418,7 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, >>> void >>> full_sec_size -= secsz; >>> /* Return of partial sector data requires a bounce buffer. */ >>> - if ((head > 0) || do_tail_read) { >>> + if ((head > 0) || do_tail_read || bytes < secsz) { >>> bouncebuf = malloc(secsz); >>> if (bouncebuf == NULL) { >>> printf("vdev_read: out of memory\n"); >>> @@ -442,14 +442,28 @@ vdev_read(vdev_t *vdev, void *priv, off_t >>> offset, void >>> outbuf += min(secsz - head, bytes); >>> } >>> - /* Full data return from read sectors */ >>> + /* >>> + * Full data return from read sectors. >>> + * Note, there is still corner case where we read >>> + * from sector boundary, but less than sector size, e.g. reading 512B >>> + * from 4k sector. >>> + */ >>> if (full_sec_size > 0) { >>> - res = read(fd, outbuf, full_sec_size); >>> - if (res != full_sec_size) { >>> - ret = EIO; >>> - goto error; >>> + if (bytes < full_sec_size) { >>> + res = read(fd, bouncebuf, secsz); >>> + if (res != secsz) { >>> + ret = EIO; >>> + goto error; >>> + } >>> + memcpy(outbuf, bouncebuf, bytes); >>> + } else { >>> + res = read(fd, outbuf, full_sec_size); >>> + if (res != full_sec_size) { >>> + ret = EIO; >>> + goto error; >>> + } >>> + outbuf += full_sec_size; >>> } >>> - outbuf += full_sec_size; >>> } >>> /* Partial data return from last sector */ >>> _______________________________________________ >>> svn-src-all@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/svn-src-all >>> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Sat May 9 10:22:00 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 A75B32E33E0; Sat, 9 May 2020 10:22:00 +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 49K3CX42lTz4YMN; Sat, 9 May 2020 10:22:00 +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 8609E1A6EB; Sat, 9 May 2020 10:22:00 +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 049AM0N2039242; Sat, 9 May 2020 10:22:00 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 049AM0Mx039241; Sat, 9 May 2020 10:22:00 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005091022.049AM0Mx039241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sat, 9 May 2020 10:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360839 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 360839 X-SVN-Commit-Repository: base MIME-Version: 1.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: Sat, 09 May 2020 10:22:00 -0000 Author: bcr (doc committer) Date: Sat May 9 10:22:00 2020 New Revision: 360839 URL: https://svnweb.freebsd.org/changeset/base/360839 Log: Mention the existence of /etc/defaults/vendor.conf for custom vendor-specific changes to FreeBSD's default settings. While here, fix a typo: perfomance -> performance PR: 245404 Submitted by: Jose Luis Duran Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sat May 9 08:55:18 2020 (r360838) +++ head/share/man/man5/rc.conf.5 Sat May 9 10:22:00 2020 (r360839) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 2020 +.Dd May 9, 2020 .Dt RC.CONF 5 .Os .Sh NAME @@ -59,6 +59,11 @@ Options need only be specified in .Pa /etc/rc.conf when the system administrator wishes to override these defaults. The file +.Pa /etc/defaults/vendor.conf +allows vendors to override +.Fx +defaults. +The file .Pa /etc/rc.conf.local is used to override settings in .Pa /etc/rc.conf @@ -1187,7 +1192,7 @@ by default. This setting will be identical to .Dq Li YES , if a dynamicrouting daemon is enabled, because redirect processing may -cause perfomance issues for large routing tables. +cause performance issues for large routing tables. If no such service is enabled, this setting behaves like a .Dq Li NO . Setting to @@ -4585,6 +4590,7 @@ files. .Sh FILES .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact .It Pa /etc/defaults/rc.conf +.It Pa /etc/defaults/vendor.conf .It Pa /etc/rc.conf .It Pa /etc/rc.conf.local .El From owner-svn-src-head@freebsd.org Sat May 9 10:50: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 979BE2E494A; Sat, 9 May 2020 10:50:45 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 49K3rh5pm0z4bP1; Sat, 9 May 2020 10:50:44 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-wr1-f41.google.com with SMTP id v12so4848161wrp.12; Sat, 09 May 2020 03:50:44 -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=GMxcK8zc87zNO919+bhVKd/kZTrBs+02Xq2BsTyYLqQ=; b=t469qsJy2BbLEMcDMKsmYHoEorec1zao7GMcCNIMSft1N42eYOcIoVguY+oXSjZz/z n4Zvuun+11mYgSUc1yci9YwCz/3GiKu1vFmsuPMeAY69YvPa4ehm5nCFdprgFrhLHHxf ZNiZdf5dHQUbfrLnmO0ySrHX+Q8PSx2XUsX7T0xDyEqiXe5FEAaMG0fKSNgjCwQBq9F1 jPePgzv8kxqL3W3brDDovmjNRBgYz4ex2K/+DNVSUC3q0jnU2EEXUukOVyyL2eCvx2rv JgWJWi24ZohSB/beAA9xTFNAG6MmO4anNt0KNZtqpC4HuTSUc6ujoVsc7W/OwhANOnTK F6og== X-Gm-Message-State: AGi0PuZ88LUgZMN6NN2flHPerL7ks+RF74FtbCJk3TWkImr3fQ66bQdm 8QVyEY/fxneUXxKIFKF62UPqyEwMBkY= X-Google-Smtp-Source: APiQypJnJ9VsFCmdxq9BpF6YAjFouFR06ksQvEaqHXWGPw/P+DeeLB+hgcU0Ft/RsXzf2dTjNS5VvQ== X-Received: by 2002:adf:9422:: with SMTP id 31mr25490wrq.10.1589021443048; Sat, 09 May 2020 03:50:43 -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 m6sm7333181wrq.5.2020.05.09.03.50.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 May 2020 03:50:42 -0700 (PDT) Subject: Re: svn commit: r360833 - head To: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005090201.04921Tpf028388@repo.freebsd.org> From: Mateusz Piotrowski <0mp@FreeBSD.org> Message-ID: <6884f662-2f58-edee-420a-053d07428e7b@FreeBSD.org> Date: Sat, 9 May 2020 12:51:10 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <202005090201.04921Tpf028388@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 49K3rh5pm0z4bP1 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.41 as permitted sender) smtp.mailfrom=mpp302@gmail.com X-Spamd-Result: default: False [-2.48 / 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: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]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.48)[ip: (-1.53), ipnet: 209.85.128.0/17(-0.39), asn: 15169(-0.43), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[41.221.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FORGED_SENDER(0.30)[0mp@FreeBSD.org,mpp302@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[41.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.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: Sat, 09 May 2020 10:50:45 -0000 Hi, On 5/9/20 4:01 AM, 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 ... > 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 \ I think there is a semicolon missing here. From owner-svn-src-head@freebsd.org Sat May 9 10:55: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 E37152E4DED; Sat, 9 May 2020 10:55:34 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49K3yG5lnZz4c06; Sat, 9 May 2020 10:55:34 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C08041AD19; Sat, 9 May 2020 10:55:34 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 049AtYEI061879; Sat, 9 May 2020 10:55:34 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 049AtYSD061878; Sat, 9 May 2020 10:55:34 GMT (envelope-from phk@FreeBSD.org) Message-Id: <202005091055.049AtYSD061878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sat, 9 May 2020 10:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360841 - head/sbin/recoverdisk X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: head/sbin/recoverdisk X-SVN-Commit-Revision: 360841 X-SVN-Commit-Repository: base MIME-Version: 1.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: Sat, 09 May 2020 10:55:35 -0000 Author: phk Date: Sat May 9 10:55:34 2020 New Revision: 360841 URL: https://svnweb.freebsd.org/changeset/base/360841 Log: Don't send clear screen until we are committed to run. Modified: head/sbin/recoverdisk/recoverdisk.c Modified: head/sbin/recoverdisk/recoverdisk.c ============================================================================== --- head/sbin/recoverdisk/recoverdisk.c Sat May 9 10:30:06 2020 (r360840) +++ head/sbin/recoverdisk/recoverdisk.c Sat May 9 10:55:34 2020 (r360841) @@ -153,7 +153,6 @@ set_verbose(void) if (!isatty(STDIN_FILENO) || ioctl(STDIN_FILENO, TIOCGWINSZ, &wsz)) return; - printf("\x1b[2J"); verbose = 1; t0 = time(NULL); } @@ -538,6 +537,8 @@ main(int argc, char * const argv[]) sz = 0; if (!verbose) report_header(0); + else + printf("\x1b[2J"); n = 0; for (;;) { lp = TAILQ_FIRST(&lumps); From owner-svn-src-head@freebsd.org Sat May 9 12:39: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 77FB02E871F for ; Sat, 9 May 2020 12:39:03 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st43p00im-ztdg10061801.me.com (st43p00im-ztdg10061801.me.com [17.58.63.170]) (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 49K6Ff3hsYz3FW9 for ; Sat, 9 May 2020 12:39:02 +0000 (UTC) (envelope-from tsoome@me.com) Received: from nazgul.lan (148-52-235-80.sta.estpak.ee [80.235.52.148]) by st43p00im-ztdg10061801.me.com (Postfix) with ESMTPSA id A9E2B8C0AC6; Sat, 9 May 2020 12:38:59 +0000 (UTC) From: Toomas Soome Message-Id: Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r360836 - head/stand/libsa/zfs Date: Sat, 9 May 2020 15:38:57 +0300 In-Reply-To: Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Toomas Soome To: Ronald Klop References: <202005090625.0496PLvc091232@repo.freebsd.org> <2125B6CE-D25F-4BC8-AB13-89C4D01C7150@me.com> X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-09_03:2020-05-08, 2020-05-09 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2002250000 definitions=main-2005090111 X-Rspamd-Queue-Id: 49K6Ff3hsYz3FW9 X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:17.58.0.0/16]; FREEMAIL_FROM(0.00)[me.com]; MV_CASE(0.50)[]; URI_COUNT_ODD(1.00)[13]; RCPT_COUNT_FIVE(0.00)[5]; DKIM_TRACE(0.00)[me.com:+]; DMARC_POLICY_ALLOW(-0.50)[me.com,quarantine]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[me.com]; RCVD_IN_DNSWL_LOW(-0.10)[170.63.58.17.list.dnswl.org : 127.0.5.1]; ASN(0.00)[asn:714, ipnet:17.58.63.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[148.52.235.80.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[me.com:s=1a1hai]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE(0.00)[ip: (-5.29), ipnet: 17.58.63.0/24(-1.77), asn: 714(-2.52), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; DWL_DNSWL_LOW(-1.00)[me.com.dwl.dnswl.org : 127.0.5.1]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[170.63.58.17.rep.mailspike.net : 127.0.0.17]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.32 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: Sat, 09 May 2020 12:39:03 -0000 > On 9. May 2020, at 11:23, Ronald Klop wrote: >=20 > On Sat, 09 May 2020 09:25:29 +0200, Toomas Soome > wrote: >=20 >>=20 >>=20 >>> On 9. May 2020, at 09:57, Ronald Klop wrote: >>>=20 >>> Hi Toomas, >>>=20 >>> Could this fix this issue = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D144234 ? >>>=20 >>> Regards, >>> Ronald. >>=20 >>=20 >> I doubt a bit unless you have GELI encryption or 4kn disk (which we = can not boot with BIOS, only with UEFI). That issue was reported 2010 = agains 9.0? is it still the case? >>=20 >> rgds, >> toomas >=20 >=20 > Clear answer. I don't use the computer I had this problem with = anymore. (It is in the attic somewhere,) And the problem disappeared for = me in 2017 (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D144234#c33= ). But = the issue apparently happens for other people in 12.1 still as I read in = the replies to the issue. >=20 > Because of the bogus LBA numbers I suspected some memory corruption. = But never found further evidence for this. >=20 > Regards, > Ronald. Ok, We just need to check such errors case by case. We know pretty well = how to debug those, even if the process can be time consuming. rgds, toomas >=20 >=20 >>>=20 >>>=20 >>> On Sat, 09 May 2020 08:25:21 +0200, Toomas Soome = wrote: >>>=20 >>>> Author: tsoome >>>> Date: Sat May 9 06:25:20 2020 >>>> New Revision: 360836 >>>> URL: https://svnweb.freebsd.org/changeset/base/360836 >>>>=20 >>>> Log: >>>> loader: vdev_read() can corrupt memory >>>> When reading less than sector size but from sector boundary, >>>> the vdev_read() will read full sector into the provided buffer >>>> and therefore corrupting memory past buffer end. >>>> MFC after: 2 days >>>>=20 >>>> Modified: >>>> head/stand/libsa/zfs/zfs.c >>>>=20 >>>> Modified: head/stand/libsa/zfs/zfs.c >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/stand/libsa/zfs/zfs.c Sat May 9 05:04:02 2020 = (r360835) >>>> +++ head/stand/libsa/zfs/zfs.c Sat May 9 06:25:20 2020 = (r360836) >>>> @@ -418,7 +418,7 @@ vdev_read(vdev_t *vdev, void *priv, off_t = offset, void >>>> full_sec_size -=3D secsz; >>>> /* Return of partial sector data requires a bounce buffer. */ >>>> - if ((head > 0) || do_tail_read) { >>>> + if ((head > 0) || do_tail_read || bytes < secsz) { >>>> bouncebuf =3D malloc(secsz); >>>> if (bouncebuf =3D=3D NULL) { >>>> printf("vdev_read: out of memory\n"); >>>> @@ -442,14 +442,28 @@ vdev_read(vdev_t *vdev, void *priv, off_t = offset, void >>>> outbuf +=3D min(secsz - head, bytes); >>>> } >>>> - /* Full data return from read sectors */ >>>> + /* >>>> + * Full data return from read sectors. >>>> + * Note, there is still corner case where we read >>>> + * from sector boundary, but less than sector size, e.g. reading = 512B >>>> + * from 4k sector. >>>> + */ >>>> if (full_sec_size > 0) { >>>> - res =3D read(fd, outbuf, full_sec_size); >>>> - if (res !=3D full_sec_size) { >>>> - ret =3D EIO; >>>> - goto error; >>>> + if (bytes < full_sec_size) { >>>> + res =3D read(fd, bouncebuf, secsz); >>>> + if (res !=3D secsz) { >>>> + ret =3D EIO; >>>> + goto error; >>>> + } >>>> + memcpy(outbuf, bouncebuf, bytes); >>>> + } else { >>>> + res =3D read(fd, outbuf, full_sec_size); >>>> + if (res !=3D full_sec_size) { >>>> + ret =3D EIO; >>>> + goto error; >>>> + } >>>> + outbuf +=3D full_sec_size; >>>> } >>>> - outbuf +=3D full_sec_size; >>>> } >>>> /* Partial data return from last sector */ >>>> _______________________________________________ >>>> svn-src-all@freebsd.org mailing list >>>> https://lists.freebsd.org/mailman/listinfo/svn-src-all >>>> To unsubscribe, send any mail to = "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Sat May 9 12:58: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 98DA92E8E83; Sat, 9 May 2020 12:58:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49K6h33Zn7z3GXx; Sat, 9 May 2020 12:58:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 763201C3CF; Sat, 9 May 2020 12:58:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 049CwRbb036063; Sat, 9 May 2020 12:58:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 049CwRHU036062; Sat, 9 May 2020 12:58:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005091258.049CwRHU036062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 9 May 2020 12:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360844 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 360844 X-SVN-Commit-Repository: base MIME-Version: 1.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: Sat, 09 May 2020 12:58:27 -0000 Author: kib Date: Sat May 9 12:58:27 2020 New Revision: 360844 URL: https://svnweb.freebsd.org/changeset/base/360844 Log: Document BUS_OOMERR. Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D24761 Modified: head/share/man/man3/siginfo.3 Modified: head/share/man/man3/siginfo.3 ============================================================================== --- head/share/man/man3/siginfo.3 Sat May 9 11:18:34 2020 (r360843) +++ head/share/man/man3/siginfo.3 Sat May 9 12:58:27 2020 (r360844) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2018 +.Dd May 8, 2020 .Dt SIGINFO 3 .Os .Sh NAME @@ -150,6 +150,8 @@ invalid address alignment nonexistent physical address .It Ta Dv BUS_OBJERR Ta object-specific hardware error +.It Ta Dv BUS_OOMERR Ta +cannot alloc a page to map at fault .It Dv SIGTRAP Ta Dv TRAP_BRKPT Ta process breakpoint .It Ta Dv TRAP_TRACE Ta From owner-svn-src-head@freebsd.org Sat May 9 13:00: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 786BD2E8F2D; Sat, 9 May 2020 13:00:39 +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 49K6kb2hHHz3GhM; Sat, 9 May 2020 13:00: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 577E41C3DE; Sat, 9 May 2020 13:00: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 049D0dSa037480; Sat, 9 May 2020 13:00:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 049D0dxb037457; Sat, 9 May 2020 13:00:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005091300.049D0dxb037457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 9 May 2020 13:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360845 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 360845 X-SVN-Commit-Repository: base MIME-Version: 1.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: Sat, 09 May 2020 13:00:39 -0000 Author: kib Date: Sat May 9 13:00:38 2020 New Revision: 360845 URL: https://svnweb.freebsd.org/changeset/base/360845 Log: Avoid spurious ENOMEMs from sysctl hw.pagesizes. Reported by: Paul Floyd PR: 246215 Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24737 Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Sat May 9 12:58:27 2020 (r360844) +++ head/sys/kern/kern_mib.c Sat May 9 13:00:38 2020 (r360845) @@ -231,6 +231,7 @@ static int sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) { int error; + size_t len; #ifdef SCTL_MASK32 int i; uint32_t pagesizes32[MAXPAGESIZES]; @@ -243,10 +244,18 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) for (i = 0; i < MAXPAGESIZES; i++) pagesizes32[i] = (uint32_t)pagesizes[i]; - error = SYSCTL_OUT(req, pagesizes32, sizeof(pagesizes32)); + len = sizeof(pagesizes32); + if (len > req->oldlen) + len = req->oldlen; + error = SYSCTL_OUT(req, pagesizes32, len); } else #endif - error = SYSCTL_OUT(req, pagesizes, sizeof(pagesizes)); + { + len = sizeof(pagesizes); + if (len > req->oldlen) + len = req->oldlen; + error = SYSCTL_OUT(req, pagesizes, len); + } return (error); } SYSCTL_PROC(_hw, OID_AUTO, pagesizes, From owner-svn-src-head@freebsd.org Sat May 9 14:15: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 12DB52EB078; Sat, 9 May 2020 14:15:45 +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 49K8PD6jPgz3PGQ; Sat, 9 May 2020 14:15:44 +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 E17401D2E2; Sat, 9 May 2020 14:15:44 +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 049EFivx089536; Sat, 9 May 2020 14:15:44 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 049EFisr089535; Sat, 9 May 2020 14:15:44 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <202005091415.049EFisr089535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Sat, 9 May 2020 14:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360846 - head/sys/netgraph/bluetooth/include X-SVN-Group: head X-SVN-Commit-Author: takawata X-SVN-Commit-Paths: head/sys/netgraph/bluetooth/include X-SVN-Commit-Revision: 360846 X-SVN-Commit-Repository: base MIME-Version: 1.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: Sat, 09 May 2020 14:15:45 -0000 Author: takawata Date: Sat May 9 14:15:44 2020 New Revision: 360846 URL: https://svnweb.freebsd.org/changeset/base/360846 Log: Add space for RSSI in data member. RSSI is put just after actual data. Submitted by: Marc Veldman PR: 245920 Modified: head/sys/netgraph/bluetooth/include/ng_hci.h Modified: head/sys/netgraph/bluetooth/include/ng_hci.h ============================================================================== --- head/sys/netgraph/bluetooth/include/ng_hci.h Sat May 9 13:00:38 2020 (r360845) +++ head/sys/netgraph/bluetooth/include/ng_hci.h Sat May 9 14:15:44 2020 (r360846) @@ -1980,7 +1980,8 @@ typedef struct { u_int8_t addr_type; bdaddr_t bdaddr; u_int8_t length_data; - u_int8_t data[NG_HCI_SCAN_RESPONSE_DATA_MAX]; + /* The last octet is for RSSI */ + u_int8_t data[NG_HCI_SCAN_RESPONSE_DATA_MAX+1]; }__attribute__((packed)) ng_hci_le_advreport; #define NG_HCI_LEEV_CON_UPDATE_COMPL 0x03 From owner-svn-src-head@freebsd.org Sat May 9 14:19: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 BC6542EB128; Sat, 9 May 2020 14:19:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49K8TY4bnWz3PPf; Sat, 9 May 2020 14:19:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 993A51D2EF; Sat, 9 May 2020 14:19:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 049EJTde089769; Sat, 9 May 2020 14:19:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 049EJTYV089768; Sat, 9 May 2020 14:19:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202005091419.049EJTYV089768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 9 May 2020 14:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360847 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 360847 X-SVN-Commit-Repository: base MIME-Version: 1.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: Sat, 09 May 2020 14:19:29 -0000 Author: trasz Date: Sat May 9 14:19:29 2020 New Revision: 360847 URL: https://svnweb.freebsd.org/changeset/base/360847 Log: Add ARM loader path to uefi(8) man page. MFC after: 2 weeks Sponsored by: DARPA Modified: head/share/man/man8/uefi.8 Modified: head/share/man/man8/uefi.8 ============================================================================== --- head/share/man/man8/uefi.8 Sat May 9 14:15:44 2020 (r360846) +++ head/share/man/man8/uefi.8 Sat May 9 14:19:29 2020 (r360847) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2018 +.Dd May 9, 2020 .Dt UEFI 8 .Os .Sh NAME @@ -69,6 +69,7 @@ If not set, an architecture-specific default is used. .Bl -column -offset indent "Architecture" "Default Path" .It Sy Architecture Ta Sy Default Path .It amd64 Ta Pa /EFI/BOOT/BOOTX64.EFI +.It arm Ta Pa /EFI/BOOT/BOOTARM.EFI .It arm64 Ta Pa /EFI/BOOT/BOOTAA64.EFI .El .Pp From owner-svn-src-head@freebsd.org Sat May 9 14:49: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 8EBAA2EBA23; Sat, 9 May 2020 14:49:57 +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 49K98j3JGlz3Qv8; Sat, 9 May 2020 14:49:57 +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 6C9171D89C; Sat, 9 May 2020 14:49:57 +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 049Envbs008612; Sat, 9 May 2020 14:49:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 049EnunL008610; Sat, 9 May 2020 14:49:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005091449.049EnunL008610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 9 May 2020 14:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360848 - 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: 360848 X-SVN-Commit-Repository: base MIME-Version: 1.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: Sat, 09 May 2020 14:49:57 -0000 Author: markj Date: Sat May 9 14:49:56 2020 New Revision: 360848 URL: https://svnweb.freebsd.org/changeset/base/360848 Log: rtwn: Add a new USB ID. PR: 246315 Submitted by: Idwer Vollering 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 Sat May 9 14:19:29 2020 (r360847) +++ head/share/man/man4/rtwn_usb.4 Sat May 9 14:49:56 2020 (r360848) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd September 1, 2019 +.Dd May 9, 2020 .Dt RTWN_USB 4 .Os .Sh NAME @@ -83,6 +83,7 @@ based USB wireless network adapters, including: .It "EDUP EP-AC1620" Ta RTL8821AU Ta USB 2.0 .It "Elecom WDC-150SU2M" Ta RTL8188EU Ta USB 2.0 .It "EnGenius EUB1200AC" Ta RTL8812AU Ta USB 3.0 +.It "Foxconn WFUR6" Ta RTL8812AU Ta USB 2.0 .It "Hawking HD65U" Ta RTL8821AU Ta USB 2.0 .It "Hercules Wireless N USB Pico" Ta RTL8188CUS Ta USB 2.0 .It "I-O Data WN-AC867U" Ta RTL8812AU Ta USB 3.0 Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_attach.h Sat May 9 14:19:29 2020 (r360847) +++ head/sys/dev/rtwn/usb/rtwn_usb_attach.h Sat May 9 14:49:56 2020 (r360848) @@ -136,7 +136,8 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8812AU_DEV(MELCO, WIU3866D), RTWN_RTL8812AU_DEV(NEC, WL900U), RTWN_RTL8812AU_DEV(PLANEX2, GW900D), - RTWN_RTL8812AU_DEV(REALTEK, RTL8812AU), + RTWN_RTL8812AU_DEV(REALTEK, RTL8812AU_1), + RTWN_RTL8812AU_DEV(REALTEK, RTL8812AU_2), RTWN_RTL8812AU_DEV(SENAO, EUB1200AC), RTWN_RTL8812AU_DEV(SITECOMEU, WLA7100), RTWN_RTL8812AU_DEV(TPLINK, T4U), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sat May 9 14:19:29 2020 (r360847) +++ head/sys/dev/usb/usbdevs Sat May 9 14:49:56 2020 (r360848) @@ -3996,7 +3996,8 @@ product REALTEK RTL8188CU_COMBO 0x8754 RTL8188CU product REALTEK RTL8821AU_1 0xa811 RTL8821AU product REALTEK RTL8723BU 0xb720 RTL8723BU product REALTEK RTL8192SU 0xc512 RTL8192SU -product REALTEK RTL8812AU 0x8812 RTL8812AU Wireless Adapter +product REALTEK RTL8812AU_1 0x8812 RTL8812AU Wireless Adapter +product REALTEK RTL8812AU_2 0x881a RTL8812AU Wireless Adapter /* RedOctane products */ product REDOCTANE DUMMY 0x0000 Dummy product From owner-svn-src-head@freebsd.org Sat May 9 15:56: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 4F3842EDFEB; Sat, 9 May 2020 15:56:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KBcz1PW6z41jQ; Sat, 9 May 2020 15:56:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B2DA1E5EC; Sat, 9 May 2020 15:56:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 049Fu2YI051748; Sat, 9 May 2020 15:56:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 049Fu2Vp051746; Sat, 9 May 2020 15:56:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005091556.049Fu2Vp051746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 9 May 2020 15:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360849 - in head: share/man/man9 sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: share/man/man9 sys/kern X-SVN-Commit-Revision: 360849 X-SVN-Commit-Repository: base MIME-Version: 1.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: Sat, 09 May 2020 15:56:03 -0000 Author: emaste Date: Sat May 9 15:56:02 2020 New Revision: 360849 URL: https://svnweb.freebsd.org/changeset/base/360849 Log: remove %n support from printf(9) It can be dangerous and there is no need for it in the kernel. Inspired by Kees Cook's change in Linux, and later OpenBSD. Reviewed by: cem, gordon, philip Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24760 Modified: head/share/man/man9/printf.9 head/sys/kern/subr_prf.c Modified: head/share/man/man9/printf.9 ============================================================================== --- head/share/man/man9/printf.9 Sat May 9 14:49:56 2020 (r360848) +++ head/share/man/man9/printf.9 Sat May 9 15:56:02 2020 (r360849) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 18, 2015 +.Dd May 9, 2020 .Dt PRINTF 9 .Os .Sh NAME @@ -83,7 +83,7 @@ parameter in the same manner as .Xr printf 3 . However, .Xr printf 9 -adds two other conversion specifiers. +adds two other conversion specifiers and omits one. .Pp The .Cm \&%b @@ -119,6 +119,10 @@ a time. The string is used as a delimiter between individual bytes. If present, a width directive will specify the number of bytes to display. By default, 16 bytes of data are output. +.Pp +The +.Cm \&%n +conversion specifier is not supported. .Pp The .Fn log Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Sat May 9 14:49:56 2020 (r360848) +++ head/sys/kern/subr_prf.c Sat May 9 15:56:02 2020 (r360849) @@ -775,20 +775,24 @@ reswitch: switch (ch = (u_char)*fmt++) { lflag = 1; goto reswitch; case 'n': + /* + * We do not support %n in kernel, but consume the + * argument. + */ if (jflag) - *(va_arg(ap, intmax_t *)) = retval; + (void)va_arg(ap, intmax_t *); else if (qflag) - *(va_arg(ap, quad_t *)) = retval; + (void)va_arg(ap, quad_t *); else if (lflag) - *(va_arg(ap, long *)) = retval; + (void)va_arg(ap, long *); else if (zflag) - *(va_arg(ap, size_t *)) = retval; + (void)va_arg(ap, size_t *); else if (hflag) - *(va_arg(ap, short *)) = retval; + (void)va_arg(ap, short *); else if (cflag) - *(va_arg(ap, char *)) = retval; + (void)va_arg(ap, char *); else - *(va_arg(ap, int *)) = retval; + (void)va_arg(ap, int *); break; case 'o': base = 8; From owner-svn-src-head@freebsd.org Sat May 9 16:46: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 E32B72F0688; Sat, 9 May 2020 16:46:37 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) (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 49KClK5my6z4508; Sat, 9 May 2020 16:46:37 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-qv1-xf2e.google.com with SMTP id c4so1974372qvi.6; Sat, 09 May 2020 09:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+wrV7J+WwhoAjgbzk/AnPV0hk10QVgflsyoXQ4FN54o=; b=sPTDghO4/LxZX6z+dkEDsSintwDemezli7m4HJC44r9pmEJtYmpm1j8yNjJCxnzUxf AS7WcirUevfgXl5F2+4oJPXyk1qtzumvSlTbz0+f60TTEluEb1SuIkHmrtOW77HlpKhO y26B9Ji/upA+EA8tc5an5PtuVQBMGe444jDMf5650fskPpDQrKkHMqP08/msvA3H+VIU Gcd6iVVbAuXtMgKWr+a51YM6CLZTnoRQjy9hHdHH9UbNjD/04/c8JWThD35uvPqS0DAf Wqy3Cwc0TozGKHlHKAULFIqNiGTN7gKERHMSmrFAGWWpvBNGzmdHQDtW/n8t0o6pj+cQ JxwA== 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=+wrV7J+WwhoAjgbzk/AnPV0hk10QVgflsyoXQ4FN54o=; b=kwxNLFiZ6L9XZ284jL9qot36eh+pAzygHQOzDVPuh8cys1IAG7xcEHA9x9R92q5Shi 3f6cPAEktzf4n31ZvZwDw8akXVcIvVvn4O3+JRsElDCrFBdGyID/qpTTJPXq66Hh1H+z Zh1gnEvaHcaBFGPFYVYoFUgwWo3HKI1oARpJV87D0uFIy5UVdsbGtG0hhgrl6U0rBCBy kcdY/+OZKjD0YD7BkkC3zJskrLH47mQ5i4b87TKF4w0FUWU3+4gI8re+BdpXh3R2ASX1 5TQGXQKZxAuyZPJ3YLT3kYTvioaHz/XU3s8/qt/ec8r7fvUVC/HtMjj/VzidA8/ve60V H5Xw== X-Gm-Message-State: AGi0Pub4oHm7IiV1hyVz+YonQpV44NEoinvBgfd4Cw/80Hc4lFyHXPVf ad0bnZ+Aj4ZnQnn9nwaevkAt6eL+OD/utPPBU0T2bXJJnGc= X-Google-Smtp-Source: APiQypIz6sQ4iClmDMVGefLUzVTwhlAXUydBy6BuVZDYgSoDfWXQU+rIvSFPjIYS2WnOnDLhfapwvDIey50Haiw7OzM= X-Received: by 2002:a0c:b3dc:: with SMTP id b28mr8313486qvf.217.1589042796148; Sat, 09 May 2020 09:46:36 -0700 (PDT) MIME-Version: 1.0 References: <202005091556.049Fu2Vp051746@repo.freebsd.org> In-Reply-To: <202005091556.049Fu2Vp051746@repo.freebsd.org> From: Ryan Stone Date: Sat, 9 May 2020 12:46:25 -0400 Message-ID: Subject: Re: svn commit: r360849 - in head: share/man/man9 sys/kern To: Ed Maste Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49KClK5my6z4508 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.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: Sat, 09 May 2020 16:46:38 -0000 On Sat, May 9, 2020 at 11:56 AM Ed Maste wrote: > > Author: emaste > Date: Sat May 9 15:56:02 2020 > New Revision: 360849 > URL: https://svnweb.freebsd.org/changeset/base/360849 > > Log: > remove %n support from printf(9) Should we put a KASSERT in to catch if new code tries to use a %n flag (and to let third-parties find out that it's not supported anymore)? From owner-svn-src-head@freebsd.org Sat May 9 17:52: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 B58572F1F45; Sat, 9 May 2020 17:52:50 +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 49KFCk4HRZz48qf; Sat, 9 May 2020 17:52:50 +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 8CF931FD05; Sat, 9 May 2020 17:52:50 +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 049HqoGh025312; Sat, 9 May 2020 17:52:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 049HqoGH025311; Sat, 9 May 2020 17:52:50 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005091752.049HqoGH025311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 9 May 2020 17:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360851 - 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: 360851 X-SVN-Commit-Repository: base MIME-Version: 1.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: Sat, 09 May 2020 17:52:50 -0000 Author: manu Date: Sat May 9 17:52:50 2020 New Revision: 360851 URL: https://svnweb.freebsd.org/changeset/base/360851 Log: linuxkpi: Add bitmap_copy and bitmap_andnot bitmap_copy simply copy the bitmaps, no idea why it exists. bitmap_andnot is similar to bitmap_and but uses !src2. Sponsored-by: The FreeBSD Foundation Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D24782 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 Sat May 9 17:14:59 2020 (r360850) +++ head/sys/compat/linuxkpi/common/include/linux/bitmap.h Sat May 9 17:52:50 2020 (r360851) @@ -255,6 +255,17 @@ bitmap_complement(unsigned long *dst, const unsigned l } static inline void +bitmap_copy(unsigned long *dst, const unsigned long *src, + const unsigned int size) +{ + const unsigned int end = BITS_TO_LONGS(size); + unsigned int i; + + for (i = 0; i != end; i++) + dst[i] = src[i]; +} + +static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, const unsigned long *src2, const unsigned int size) { @@ -274,6 +285,17 @@ bitmap_and(unsigned long *dst, const unsigned long *sr for (i = 0; i != end; i++) dst[i] = src1[i] & src2[i]; +} + +static inline void +bitmap_andnot(unsigned long *dst, const unsigned long *src1, + const unsigned long *src2, const unsigned int size) +{ + const unsigned int end = BITS_TO_LONGS(size); + unsigned int i; + + for (i = 0; i != end; i++) + dst[i] = src1[i] & ~src2[i]; } static inline void From owner-svn-src-head@freebsd.org Sat May 9 18:31: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 257B82F2A44; Sat, 9 May 2020 18:31:34 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f194.google.com (mail-il1-f194.google.com [209.85.166.194]) (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 49KG4P1Rlcz4Bbm; Sat, 9 May 2020 18:31:33 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f194.google.com with SMTP id m5so4534783ilj.10; Sat, 09 May 2020 11:31:33 -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=Jid2CkJl9+eANxIKB0939DpgUa9WKZQQBufbiYJuSgI=; b=fhA7dpt8qtRekls6abOmls13OrTvqcVS1PSKsPkgiQrmGn7wR6510+9xggVjpL0pam PFPsAupSA5zzqIDcGB4c3Yr30+zDKDX743K00zbSmSQh4KcfYT2IiE8DYFPYAeNL+4Ey EAPUdTS8TOz0bebg8DZt2+SMzzTWHECeLtHbmH2wvuWwHQyVwlihV99XzTCSvJC87n0K eBjydv3+OKN0kPiGFTpu6eSzqun1hU2KCpiLpzzlSCOXG400vQQnnErsnDiZYYA7/mmN YoaOY+W92lCcrjw16KvMHUqdBYlS260o1nCrOaeekMrloCk5Y56WX6SD82KFevXatSvU LlwA== X-Gm-Message-State: AGi0Pua3xyDUrf4X5RfjjJ6wNoIkM70mRWclCAp1zwtC8kPhgAGkl8KW DB4smhEnLJVpTwoVaTOCs43b7N/ErclXQ6Niwu4= X-Google-Smtp-Source: APiQypKi8oic7HRg04Q1Z1zvnV6X9euw7wdtjDra2htbF5lJZAB3o1SnuvyniZ/DBC+T9/KfBfTmoO8WdwAg7xO3bn8= X-Received: by 2002:a05:6e02:141:: with SMTP id j1mr9370491ilr.100.1589049092190; Sat, 09 May 2020 11:31:32 -0700 (PDT) MIME-Version: 1.0 References: <202005091556.049Fu2Vp051746@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Sat, 9 May 2020 14:31:20 -0400 Message-ID: Subject: Re: svn commit: r360849 - in head: share/man/man9 sys/kern To: Ryan Stone Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49KG4P1Rlcz4Bbm X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.194 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-2.17 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[194.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.17)[ip: (-0.00), ipnet: 209.85.128.0/17(-0.39), asn: 15169(-0.43), country: US(-0.05)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[194.166.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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: Sat, 09 May 2020 18:31:34 -0000 On Sat, 9 May 2020 at 12:46, Ryan Stone wrote: > > On Sat, May 9, 2020 at 11:56 AM Ed Maste wrote: > > > > Author: emaste > > Date: Sat May 9 15:56:02 2020 > > New Revision: 360849 > > URL: https://svnweb.freebsd.org/changeset/base/360849 > > > > Log: > > remove %n support from printf(9) > > Should we put a KASSERT in to catch if new code tries to use a %n flag > (and to let third-parties find out that it's not supported anymore)? cem has a clang patch to reject it: https://reviews.freebsd.org/D24786 From owner-svn-src-head@freebsd.org Sat May 9 19:26: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 124ED2F3C55; Sat, 9 May 2020 19:26:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KHJ46lWWz4F8w; Sat, 9 May 2020 19:26:44 +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 E2E5D20DF7; Sat, 9 May 2020 19:26:44 +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 049JQipp080690; Sat, 9 May 2020 19:26:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 049JQiHZ080689; Sat, 9 May 2020 19:26:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005091926.049JQiHZ080689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 9 May 2020 19:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360852 - head/contrib/llvm-project/clang/lib/AST X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/contrib/llvm-project/clang/lib/AST X-SVN-Commit-Revision: 360852 X-SVN-Commit-Repository: base MIME-Version: 1.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: Sat, 09 May 2020 19:26:45 -0000 Author: cem Date: Sat May 9 19:26:44 2020 New Revision: 360852 URL: https://svnweb.freebsd.org/changeset/base/360852 Log: clang: Reject %n for __attribute__((format(__freebsd_kprintf__))) A follow-up to r360849. Reported by: imp Reviewed by: emaste, imp X-MFC-With: r360849 Differential Revision: https://reviews.freebsd.org/D24786 Modified: head/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp Modified: head/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp Sat May 9 17:52:50 2020 (r360851) +++ head/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp Sat May 9 19:26:44 2020 (r360852) @@ -316,8 +316,8 @@ static PrintfSpecifierResult ParsePrintfSpecifier(Form case 'g': k = ConversionSpecifier::gArg; break; case 'i': k = ConversionSpecifier::iArg; break; case 'n': - // Not handled, but reserved in OpenCL. - if (!LO.OpenCL) + // Not handled, but reserved in OpenCL and FreeBSD kernel. + if (!LO.OpenCL && !isFreeBSDKPrintf) k = ConversionSpecifier::nArg; break; case 'o': k = ConversionSpecifier::oArg; break;