From owner-svn-src-all@freebsd.org Sun Dec 8 00:02:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C12491D0E2C; Sun, 8 Dec 2019 00:02:36 +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 47VmjS4Zmcz4NHX; Sun, 8 Dec 2019 00:02:36 +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 80A7F21A55; Sun, 8 Dec 2019 00:02:36 +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 xB802aws062384; Sun, 8 Dec 2019 00:02:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB802aQ8062383; Sun, 8 Dec 2019 00:02:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912080002.xB802aQ8062383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 8 Dec 2019 00:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355508 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 00:02:36 -0000 Author: markj Date: Sun Dec 8 00:02:36 2019 New Revision: 355508 URL: https://svnweb.freebsd.org/changeset/base/355508 Log: Add casts required by the 32-bit build after r355491. Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Dec 7 23:13:51 2019 (r355507) +++ head/sys/vm/vm_map.c Sun Dec 8 00:02:36 2019 (r355508) @@ -5034,17 +5034,17 @@ _vm_map_assert_consistent(vm_map_t map, int check) cur = cur->left; KASSERT(cur != lbound, ("map %p cannot find %jx", - map, entry->start)); + map, (uintmax_t)entry->start)); } else if (cur->end <= entry->start) { lbound = cur; cur = cur->right; KASSERT(cur != ubound, ("map %p cannot find %jx", - map, entry->start)); + map, (uintmax_t)entry->start)); } else { KASSERT(cur == entry, ("map %p cannot find %jx", - map, entry->start)); + map, (uintmax_t)entry->start)); break; } } From owner-svn-src-all@freebsd.org Sun Dec 8 00:06:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16F201D0F21; Sun, 8 Dec 2019 00:06:01 +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 47VmnN6fGXz4NS7; Sun, 8 Dec 2019 00:06:00 +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 C89D821A6C; Sun, 8 Dec 2019 00:06:00 +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 xB8060Mk062576; Sun, 8 Dec 2019 00:06:00 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB8060Da062575; Sun, 8 Dec 2019 00:06:00 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912080006.xB8060Da062575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 8 Dec 2019 00:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355509 - 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: 355509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 00:06:01 -0000 Author: rmacklem Date: Sun Dec 8 00:06:00 2019 New Revision: 355509 URL: https://svnweb.freebsd.org/changeset/base/355509 Log: Fix kernel handling of a NFSERR_MINORVERSMISMATCH NFSv4 server reply. When an NFSv4 server replies NFSERR_MINORVERSMISMATCH, it does not generate a status result for the first operation in the compound. Without this patch, this will result in a bogus EBADXDR error return. Returning EBADXDR is relatively harmless, but a correct reply of NFSERR_MINORVERSMISMATCH is needed by the pNFS client to select the correct minor version to use for a File Layout DS now that there can be NFSv4.2 DS servers. mount_nfs.c still needs to be fixed for this, although how the mount fails is only useful to help sysadmins isolate why a mount fails. Found during testing of the NFSv4.2 client and server. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Sun Dec 8 00:02:36 2019 (r355508) +++ head/sys/fs/nfs/nfs_commonkrpc.c Sun Dec 8 00:06:00 2019 (r355509) @@ -918,7 +918,8 @@ tryagain: * Get rid of the tag, return count and SEQUENCE result for * NFSv4. */ - if ((nd->nd_flag & ND_NFSV4) != 0) { + if ((nd->nd_flag & ND_NFSV4) != 0 && nd->nd_repstat != + NFSERR_MINORVERMISMATCH) { NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); i = fxdr_unsigned(int, *tl); error = nfsm_advance(nd, NFSM_RNDUP(i), -1); From owner-svn-src-all@freebsd.org Sun Dec 8 01:15:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80E0E1D267B; Sun, 8 Dec 2019 01:15:07 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47VpK72tmTz4RY1; Sun, 8 Dec 2019 01:15:07 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 476E822730; Sun, 8 Dec 2019 01:15:07 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB81F7lk004417; Sun, 8 Dec 2019 01:15:07 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB81F6LT004415; Sun, 8 Dec 2019 01:15:06 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912080115.xB81F6LT004415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 8 Dec 2019 01:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355510 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 01:15:07 -0000 Author: jeff Date: Sun Dec 8 01:15:06 2019 New Revision: 355510 URL: https://svnweb.freebsd.org/changeset/base/355510 Log: Use a variant slab structure for offpage zones. This saves space in embedded slabs but also is an opportunity to tidy up code and add accessor inlines. Reviewed by: markj, rlibby Differential Revision: https://reviews.freebsd.org/D22609 Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sun Dec 8 00:06:00 2019 (r355509) +++ head/sys/vm/uma_core.c Sun Dec 8 01:15:06 2019 (r355510) @@ -664,8 +664,7 @@ hash_alloc(struct uma_hash *hash, u_int size) if (size > UMA_HASH_SIZE_INIT) { hash->uh_hashsize = size; alloc = sizeof(hash->uh_slab_hash[0]) * hash->uh_hashsize; - hash->uh_slab_hash = (struct slabhead *)malloc(alloc, - M_UMAHASH, M_NOWAIT); + hash->uh_slab_hash = malloc(alloc, M_UMAHASH, M_NOWAIT); } else { alloc = sizeof(hash->uh_slab_hash[0]) * UMA_HASH_SIZE_INIT; hash->uh_slab_hash = zone_alloc_item(hashzone, NULL, @@ -698,7 +697,7 @@ hash_alloc(struct uma_hash *hash, u_int size) static int hash_expand(struct uma_hash *oldhash, struct uma_hash *newhash) { - uma_slab_t slab; + uma_hash_slab_t slab; u_int hval; u_int idx; @@ -714,12 +713,12 @@ hash_expand(struct uma_hash *oldhash, struct uma_hash */ for (idx = 0; idx < oldhash->uh_hashsize; idx++) - while (!SLIST_EMPTY(&oldhash->uh_slab_hash[idx])) { - slab = SLIST_FIRST(&oldhash->uh_slab_hash[idx]); - SLIST_REMOVE_HEAD(&oldhash->uh_slab_hash[idx], us_hlink); - hval = UMA_HASH(newhash, slab->us_data); - SLIST_INSERT_HEAD(&newhash->uh_slab_hash[hval], - slab, us_hlink); + while (!LIST_EMPTY(&oldhash->uh_slab_hash[idx])) { + slab = LIST_FIRST(&oldhash->uh_slab_hash[idx]); + LIST_REMOVE(slab, uhs_hlink); + hval = UMA_HASH(newhash, slab->uhs_data); + LIST_INSERT_HEAD(&newhash->uh_slab_hash[hval], + slab, uhs_hlink); } return (1); @@ -992,7 +991,7 @@ keg_free_slab(uma_keg_t keg, uma_slab_t slab, int star CTR4(KTR_UMA, "keg_free_slab keg %s(%p) slab %p, returning %d bytes", keg->uk_name, keg, slab, PAGE_SIZE * keg->uk_ppera); - mem = slab->us_data; + mem = slab_data(slab, keg); flags = slab->us_flags; i = start; if (keg->uk_fini != NULL) { @@ -1006,11 +1005,10 @@ keg_free_slab(uma_keg_t keg, uma_slab_t slab, int star * albeit we don't make skip check for other init/fini * invocations. */ - if (!uma_dbg_kskip(keg, slab->us_data + (keg->uk_rsize * i)) || + if (!uma_dbg_kskip(keg, slab_item(slab, keg, i)) || keg->uk_fini != trash_fini) #endif - keg->uk_fini(slab->us_data + (keg->uk_rsize * i), - keg->uk_size); + keg->uk_fini(slab_item(slab, keg, i), keg->uk_size); } if (keg->uk_flags & UMA_ZONE_OFFPAGE) zone_free_item(keg->uk_slabzone, slab, NULL, SKIP_NONE); @@ -1057,18 +1055,17 @@ keg_drain(uma_keg_t keg) keg->uk_free -= keg->uk_ipers; if (keg->uk_flags & UMA_ZONE_HASH) - UMA_HASH_REMOVE(&keg->uk_hash, slab, - slab->us_data); + UMA_HASH_REMOVE(&keg->uk_hash, slab); - SLIST_INSERT_HEAD(&freeslabs, slab, us_hlink); + LIST_INSERT_HEAD(&freeslabs, slab, us_link); } } finished: KEG_UNLOCK(keg); - while ((slab = SLIST_FIRST(&freeslabs)) != NULL) { - SLIST_REMOVE(&freeslabs, slab, uma_slab, us_hlink); + while ((slab = LIST_FIRST(&freeslabs)) != NULL) { + LIST_REMOVE(slab, us_link); keg_free_slab(keg, slab, keg->uk_ipers); } } @@ -1190,13 +1187,14 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom /* Point the slab into the allocated memory */ if (!(keg->uk_flags & UMA_ZONE_OFFPAGE)) slab = (uma_slab_t )(mem + keg->uk_pgoff); + else + ((uma_hash_slab_t)slab)->uhs_data = mem; if (keg->uk_flags & UMA_ZONE_VTOSLAB) for (i = 0; i < keg->uk_ppera; i++) vsetzoneslab((vm_offset_t)mem + (i * PAGE_SIZE), zone, slab); - slab->us_data = mem; slab->us_freecount = keg->uk_ipers; slab->us_flags = sflags; slab->us_domain = domain; @@ -1207,7 +1205,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom if (keg->uk_init != NULL) { for (i = 0; i < keg->uk_ipers; i++) - if (keg->uk_init(slab->us_data + (keg->uk_rsize * i), + if (keg->uk_init(slab_item(slab, keg, i), keg->uk_size, flags) != 0) break; if (i != keg->uk_ipers) { @@ -2393,15 +2391,12 @@ uma_startup(void *mem, int npages) zone_ctor(zones, zsize, &args, M_WAITOK); /* Now make a zone for slab headers */ - slabzone = uma_zcreate("UMA Slabs", - slab_sizeof(SLAB_MAX_SETSIZE), - NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, UMA_ZFLAG_INTERNAL); + slabzone = uma_zcreate("UMA Slabs", sizeof(struct uma_hash_slab), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZFLAG_INTERNAL); hashzone = uma_zcreate("UMA Hash", sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT, - NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, UMA_ZFLAG_INTERNAL); + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZFLAG_INTERNAL); bucket_init(); @@ -3097,7 +3092,7 @@ slab_alloc_item(uma_keg_t keg, uma_slab_t slab) freei = BIT_FFS(keg->uk_ipers, &slab->us_free) - 1; BIT_CLR(keg->uk_ipers, freei, &slab->us_free); - item = slab->us_data + (keg->uk_rsize * freei); + item = slab_item(slab, keg, freei); slab->us_freecount--; keg->uk_free--; @@ -3609,7 +3604,7 @@ slab_free_item(uma_zone_t zone, uma_slab_t slab, void } /* Slab management. */ - freei = ((uintptr_t)item - (uintptr_t)slab->us_data) / keg->uk_rsize; + freei = slab_item_index(slab, keg, item); BIT_SET(keg->uk_ipers, freei, &slab->us_free); slab->us_freecount++; @@ -4491,7 +4486,7 @@ uma_dbg_alloc(uma_zone_t zone, uma_slab_t slab, void * item, zone->uz_name); } keg = zone->uz_keg; - freei = ((uintptr_t)item - (uintptr_t)slab->us_data) / keg->uk_rsize; + freei = slab_item_index(slab, keg, item); if (BIT_ISSET(SLAB_MAX_SETSIZE, freei, &slab->us_debugfree)) panic("Duplicate alloc of %p from zone %p(%s) slab %p(%d)\n", @@ -4519,13 +4514,13 @@ uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *i item, zone->uz_name); } keg = zone->uz_keg; - freei = ((uintptr_t)item - (uintptr_t)slab->us_data) / keg->uk_rsize; + freei = slab_item_index(slab, keg, item); if (freei >= keg->uk_ipers) panic("Invalid free of %p from zone %p(%s) slab %p(%d)\n", item, zone, zone->uz_name, slab, freei); - if (((freei * keg->uk_rsize) + slab->us_data) != item) + if (slab_item(slab, keg, freei) != item) panic("Unaligned free of %p from zone %p(%s) slab %p(%d)\n", item, zone, zone->uz_name, slab, freei); Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Sun Dec 8 00:06:00 2019 (r355509) +++ head/sys/vm/uma_int.h Sun Dec 8 01:15:06 2019 (r355510) @@ -139,33 +139,28 @@ /* Max waste percentage before going to off page slab management */ #define UMA_MAX_WASTE 10 + /* - * I doubt there will be many cases where this is exceeded. This is the initial - * size of the hash table for uma_slabs that are managed off page. This hash - * does expand by powers of two. Currently it doesn't get smaller. + * Hash table for freed address -> slab translation. + * + * Only zones with memory not touchable by the allocator use the + * hash table. Otherwise slabs are found with vtoslab(). */ #define UMA_HASH_SIZE_INIT 32 -/* - * I should investigate other hashing algorithms. This should yield a low - * number of collisions if the pages are relatively contiguous. - */ - #define UMA_HASH(h, s) ((((uintptr_t)s) >> UMA_SLAB_SHIFT) & (h)->uh_hashmask) #define UMA_HASH_INSERT(h, s, mem) \ - SLIST_INSERT_HEAD(&(h)->uh_slab_hash[UMA_HASH((h), \ - (mem))], (s), us_hlink) -#define UMA_HASH_REMOVE(h, s, mem) \ - SLIST_REMOVE(&(h)->uh_slab_hash[UMA_HASH((h), \ - (mem))], (s), uma_slab, us_hlink) + LIST_INSERT_HEAD(&(h)->uh_slab_hash[UMA_HASH((h), \ + (mem))], (uma_hash_slab_t)(s), uhs_hlink) -/* Hash table for freed address -> slab translation */ +#define UMA_HASH_REMOVE(h, s) \ + LIST_REMOVE((uma_hash_slab_t)(s), uhs_hlink) -SLIST_HEAD(slabhead, uma_slab); +LIST_HEAD(slabhashhead, uma_hash_slab); struct uma_hash { - struct slabhead *uh_slab_hash; /* Hash table for slabs */ + struct slabhashhead *uh_slab_hash; /* Hash table for slabs */ u_int uh_hashsize; /* Current size of the hash table */ u_int uh_hashmask; /* Mask used during hashing */ }; @@ -202,13 +197,15 @@ struct uma_cache { typedef struct uma_cache * uma_cache_t; +LIST_HEAD(slabhead, uma_slab); + /* * Per-domain memory list. Embedded in the kegs. */ struct uma_domain { - LIST_HEAD(,uma_slab) ud_part_slab; /* partially allocated slabs */ - LIST_HEAD(,uma_slab) ud_free_slab; /* empty slab list */ - LIST_HEAD(,uma_slab) ud_full_slab; /* full slabs */ + struct slabhead ud_part_slab; /* partially allocated slabs */ + struct slabhead ud_free_slab; /* completely unallocated slabs */ + struct slabhead ud_full_slab; /* fully allocated slabs */ }; typedef struct uma_domain * uma_domain_t; @@ -271,8 +268,6 @@ BITSET_DEFINE(noslabbits, 0); */ struct uma_slab { LIST_ENTRY(uma_slab) us_link; /* slabs in zone */ - SLIST_ENTRY(uma_slab) us_hlink; /* Link for hash table */ - uint8_t *us_data; /* First item */ uint16_t us_freecount; /* How many are free? */ uint8_t us_flags; /* Page flags see uma.h */ uint8_t us_domain; /* Backing NUMA domain. */ @@ -281,7 +276,6 @@ struct uma_slab { #endif struct noslabbits us_free; /* Free bitmask. */ }; - #if MAXMEMDOM >= 255 #error "Slab domain type insufficient" #endif @@ -293,6 +287,47 @@ size_t slab_sizeof(int nitems); size_t slab_space(int nitems); int slab_ipers(size_t size, int align); +/* + * Slab structure with a full sized bitset and hash link for both + * HASH and OFFPAGE zones. + */ +struct uma_hash_slab { + struct uma_slab uhs_slab; /* Must be first. */ + struct slabbits uhs_bits; /* Must be second. */ + LIST_ENTRY(uma_hash_slab) uhs_hlink; /* Link for hash table */ + uint8_t *uhs_data; /* First item */ +}; + +typedef struct uma_hash_slab * uma_hash_slab_t; + +static inline void * +slab_data(uma_slab_t slab, uma_keg_t keg) +{ + + if ((keg->uk_flags & UMA_ZONE_OFFPAGE) == 0) + return ((void *)((uintptr_t)slab - keg->uk_pgoff)); + else + return (((uma_hash_slab_t)slab)->uhs_data); +} + +static inline void * +slab_item(uma_slab_t slab, uma_keg_t keg, int index) +{ + uintptr_t data; + + data = (uintptr_t)slab_data(slab, keg); + return ((void *)(data + keg->uk_rsize * index)); +} + +static inline int +slab_item_index(uma_slab_t slab, uma_keg_t keg, void *item) +{ + uintptr_t data; + + data = (uintptr_t)slab_data(slab, keg); + return (((uintptr_t)item - data) / keg->uk_rsize); +} + TAILQ_HEAD(uma_bucketlist, uma_bucket); struct uma_zone_domain { @@ -444,14 +479,14 @@ static __inline uma_slab_t hash_sfind(struct uma_hash static __inline uma_slab_t hash_sfind(struct uma_hash *hash, uint8_t *data) { - uma_slab_t slab; + uma_hash_slab_t slab; u_int hval; hval = UMA_HASH(hash, data); - SLIST_FOREACH(slab, &hash->uh_slab_hash[hval], us_hlink) { - if ((uint8_t *)slab->us_data == data) - return (slab); + LIST_FOREACH(slab, &hash->uh_slab_hash[hval], uhs_hlink) { + if ((uint8_t *)slab->uhs_data == data) + return (&slab->uhs_slab); } return (NULL); } From owner-svn-src-all@freebsd.org Sun Dec 8 01:16:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5DB91D2A34; Sun, 8 Dec 2019 01:16:22 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47VpLZ5qnhz4Rpk; Sun, 8 Dec 2019 01:16:22 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABCA122756; Sun, 8 Dec 2019 01:16:22 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB81GMam004512; Sun, 8 Dec 2019 01:16:22 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB81GMp3004510; Sun, 8 Dec 2019 01:16:22 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912080116.xB81GMp3004510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 8 Dec 2019 01:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355511 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 01:16:23 -0000 Author: jeff Date: Sun Dec 8 01:16:22 2019 New Revision: 355511 URL: https://svnweb.freebsd.org/changeset/base/355511 Log: Reduce duplication in grab functions by providing allocflags based inlines. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22635 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Dec 8 01:15:06 2019 (r355510) +++ head/sys/vm/vm_page.c Sun Dec 8 01:16:22 2019 (r355511) @@ -862,13 +862,49 @@ vm_page_reference(vm_page_t m) vm_page_aflag_set(m, PGA_REFERENCED); } +static bool +vm_page_acquire_flags(vm_page_t m, int allocflags) +{ + bool locked; + + if ((allocflags & (VM_ALLOC_SBUSY | VM_ALLOC_IGN_SBUSY)) != 0) + locked = vm_page_trysbusy(m); + else + locked = vm_page_tryxbusy(m); + if (locked && (allocflags & VM_ALLOC_WIRED) != 0) + vm_page_wire(m); + return (locked); +} + +static bool +vm_page_busy_sleep_flags(vm_object_t object, vm_page_t m, const char *wchan, + int allocflags) +{ + + if ((allocflags & VM_ALLOC_NOWAIT) != 0) + return (false); + /* + * Reference the page before unlocking and + * sleeping so that the page daemon is less + * likely to reclaim it. + */ + if ((allocflags & VM_ALLOC_NOCREAT) == 0) + vm_page_aflag_set(m, PGA_REFERENCED); + vm_page_busy_sleep(m, wchan, (allocflags & + VM_ALLOC_IGN_SBUSY) != 0); + VM_OBJECT_WLOCK(object); + if ((allocflags & VM_ALLOC_WAITFAIL) != 0) + return (false); + return (true); +} + /* * vm_page_busy_acquire: * * Acquire the busy lock as described by VM_ALLOC_* flags. Will loop * and drop the object lock if necessary. */ -int +bool vm_page_busy_acquire(vm_page_t m, int allocflags) { vm_object_t obj; @@ -883,26 +919,21 @@ vm_page_busy_acquire(vm_page_t m, int allocflags) */ obj = m->object; for (;;) { - if ((allocflags & VM_ALLOC_SBUSY) == 0) { - if (vm_page_tryxbusy(m)) - return (TRUE); - } else { - if (vm_page_trysbusy(m)) - return (TRUE); - } + if (vm_page_acquire_flags(m, allocflags)) + return (true); if ((allocflags & VM_ALLOC_NOWAIT) != 0) - return (FALSE); + return (false); if (obj != NULL) locked = VM_OBJECT_WOWNED(obj); else - locked = FALSE; + locked = false; MPASS(locked || vm_page_wired(m)); _vm_page_busy_sleep(obj, m, "vmpba", (allocflags & VM_ALLOC_SBUSY) != 0, locked); if (locked) VM_OBJECT_WLOCK(obj); if ((allocflags & VM_ALLOC_WAITFAIL) != 0) - return (FALSE); + return (false); KASSERT(m->object == obj || m->object == NULL, ("vm_page_busy_acquire: page %p does not belong to %p", m, obj)); @@ -4227,6 +4258,29 @@ vm_page_advise(vm_page_t m, int advice) vm_page_launder(m); } +static inline int +vm_page_grab_pflags(int allocflags) +{ + int pflags; + + KASSERT((allocflags & VM_ALLOC_NOBUSY) == 0 || + (allocflags & VM_ALLOC_WIRED) != 0, + ("vm_page_grab_pflags: the pages must be busied or wired")); + KASSERT((allocflags & VM_ALLOC_SBUSY) == 0 || + (allocflags & VM_ALLOC_IGN_SBUSY) != 0, + ("vm_page_grab_pflags: VM_ALLOC_SBUSY/VM_ALLOC_IGN_SBUSY " + "mismatch")); + pflags = allocflags & + ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL | + VM_ALLOC_NOBUSY); + if ((allocflags & VM_ALLOC_NOWAIT) == 0) + pflags |= VM_ALLOC_WAITFAIL; + if ((allocflags & VM_ALLOC_IGN_SBUSY) != 0) + pflags |= VM_ALLOC_SBUSY; + + return (pflags); +} + /* * Grab a page, waiting until we are waken up due to the page * changing state. We keep on waiting, if the page continues @@ -4242,47 +4296,19 @@ vm_page_t vm_page_grab(vm_object_t object, vm_pindex_t pindex, int allocflags) { vm_page_t m; - int sleep; int pflags; VM_OBJECT_ASSERT_WLOCKED(object); - KASSERT((allocflags & VM_ALLOC_SBUSY) == 0 || - (allocflags & VM_ALLOC_IGN_SBUSY) != 0, - ("vm_page_grab: VM_ALLOC_SBUSY/VM_ALLOC_IGN_SBUSY mismatch")); - pflags = allocflags & - ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL | - VM_ALLOC_NOBUSY); - if ((allocflags & VM_ALLOC_NOWAIT) == 0) - pflags |= VM_ALLOC_WAITFAIL; - if ((allocflags & VM_ALLOC_IGN_SBUSY) != 0) - pflags |= VM_ALLOC_SBUSY; + pflags = vm_page_grab_pflags(allocflags); retrylookup: if ((m = vm_page_lookup(object, pindex)) != NULL) { - if ((allocflags & (VM_ALLOC_IGN_SBUSY | VM_ALLOC_SBUSY)) != 0) - sleep = !vm_page_trysbusy(m); - else - sleep = !vm_page_tryxbusy(m); - if (sleep) { - if ((allocflags & VM_ALLOC_NOWAIT) != 0) - return (NULL); - /* - * Reference the page before unlocking and - * sleeping so that the page daemon is less - * likely to reclaim it. - */ - if ((allocflags & VM_ALLOC_NOCREAT) == 0) - vm_page_aflag_set(m, PGA_REFERENCED); - vm_page_busy_sleep(m, "pgrbwt", (allocflags & - VM_ALLOC_IGN_SBUSY) != 0); - VM_OBJECT_WLOCK(object); - if ((allocflags & VM_ALLOC_WAITFAIL) != 0) - return (NULL); - goto retrylookup; - } else { - if ((allocflags & VM_ALLOC_WIRED) != 0) - vm_page_wire(m); - goto out; + if (!vm_page_acquire_flags(m, allocflags)) { + if (vm_page_busy_sleep_flags(object, m, "pgrbwt", + allocflags)) + goto retrylookup; + return (NULL); } + goto out; } if ((allocflags & VM_ALLOC_NOCREAT) != 0) return (NULL); @@ -4346,16 +4372,8 @@ retrylookup: } else sleep = !vm_page_trysbusy(m); if (sleep) { - /* - * Reference the page before unlocking and - * sleeping so that the page daemon is less - * likely to reclaim it. - */ - if ((allocflags & VM_ALLOC_NOCREAT) == 0) - vm_page_aflag_set(m, PGA_REFERENCED); - vm_page_busy_sleep(m, "pgrbwt", (allocflags & - VM_ALLOC_IGN_SBUSY) != 0); - VM_OBJECT_WLOCK(object); + (void)vm_page_busy_sleep_flags(object, m, "pgrbwt", + allocflags); goto retrylookup; } if ((allocflags & VM_ALLOC_NOCREAT) != 0 && @@ -4441,26 +4459,15 @@ vm_page_grab_pages(vm_object_t object, vm_pindex_t pin vm_page_t m, mpred; int pflags; int i; - bool sleep; VM_OBJECT_ASSERT_WLOCKED(object); KASSERT(((u_int)allocflags >> VM_ALLOC_COUNT_SHIFT) == 0, ("vm_page_grap_pages: VM_ALLOC_COUNT() is not allowed")); - KASSERT((allocflags & VM_ALLOC_NOBUSY) == 0 || - (allocflags & VM_ALLOC_WIRED) != 0, - ("vm_page_grab_pages: the pages must be busied or wired")); - KASSERT((allocflags & VM_ALLOC_SBUSY) == 0 || - (allocflags & VM_ALLOC_IGN_SBUSY) != 0, - ("vm_page_grab_pages: VM_ALLOC_SBUSY/IGN_SBUSY mismatch")); + + pflags = vm_page_grab_pflags(allocflags); if (count == 0) return (0); - pflags = allocflags & - ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL | - VM_ALLOC_NOBUSY); - if ((allocflags & VM_ALLOC_NOWAIT) == 0) - pflags |= VM_ALLOC_WAITFAIL; - if ((allocflags & VM_ALLOC_IGN_SBUSY) != 0) - pflags |= VM_ALLOC_SBUSY; + i = 0; retrylookup: m = vm_radix_lookup_le(&object->rtree, pindex + i); @@ -4471,28 +4478,12 @@ retrylookup: mpred = TAILQ_PREV(m, pglist, listq); for (; i < count; i++) { if (m != NULL) { - if ((allocflags & - (VM_ALLOC_SBUSY | VM_ALLOC_IGN_SBUSY)) != 0) - sleep = !vm_page_trysbusy(m); - else - sleep = !vm_page_tryxbusy(m); - if (sleep) { - if ((allocflags & VM_ALLOC_NOWAIT) != 0) - break; - /* - * Reference the page before unlocking and - * sleeping so that the page daemon is less - * likely to reclaim it. - */ - if ((allocflags & VM_ALLOC_NOCREAT) == 0) - vm_page_aflag_set(m, PGA_REFERENCED); - vm_page_busy_sleep(m, "grbmaw", (allocflags & - VM_ALLOC_IGN_SBUSY) != 0); - VM_OBJECT_WLOCK(object); - goto retrylookup; + if (!vm_page_acquire_flags(m, allocflags)) { + if (vm_page_busy_sleep_flags(object, m, + "grbmaw", allocflags)) + goto retrylookup; + break; } - if ((allocflags & VM_ALLOC_WIRED) != 0) - vm_page_wire(m); } else { if ((allocflags & VM_ALLOC_NOCREAT) != 0) break; Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sun Dec 8 01:15:06 2019 (r355510) +++ head/sys/vm/vm_page.h Sun Dec 8 01:16:22 2019 (r355511) @@ -573,7 +573,7 @@ malloc2vm_flags(int malloc_flags) #define PS_ALL_VALID 0x2 #define PS_NONE_BUSY 0x4 -int vm_page_busy_acquire(vm_page_t m, int allocflags); +bool vm_page_busy_acquire(vm_page_t m, int allocflags); void vm_page_busy_downgrade(vm_page_t m); int vm_page_busy_tryupgrade(vm_page_t m); void vm_page_busy_sleep(vm_page_t m, const char *msg, bool nonshared); From owner-svn-src-all@freebsd.org Sun Dec 8 01:17:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 645551D2C21; Sun, 8 Dec 2019 01:17:39 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47VpN31vc9z4S1H; Sun, 8 Dec 2019 01:17:39 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25C9B2276C; Sun, 8 Dec 2019 01:17:39 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB81Hdd0004612; Sun, 8 Dec 2019 01:17:39 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB81Hchp004609; Sun, 8 Dec 2019 01:17:38 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912080117.xB81Hchp004609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 8 Dec 2019 01:17:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355512 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 355512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 01:17:39 -0000 Author: jeff Date: Sun Dec 8 01:17:38 2019 New Revision: 355512 URL: https://svnweb.freebsd.org/changeset/base/355512 Log: Handle multiple clock interrupts simultaneously in sched_clock(). Reviewed by: kib, markj, mav Differential Revision: https://reviews.freebsd.org/D22625 Modified: head/sys/kern/kern_clock.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/sys/sched.h Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Sun Dec 8 01:16:22 2019 (r355511) +++ head/sys/kern/kern_clock.c Sun Dec 8 01:17:38 2019 (r355512) @@ -711,8 +711,7 @@ statclock(int cnt, int usermode) td->td_incruntime += runtime; PCPU_SET(switchtime, new_switchtime); - for ( ; cnt > 0; cnt--) - sched_clock(td); + sched_clock(td, cnt); thread_unlock(td); #ifdef HWPMC_HOOKS if (td->td_intr_frame != NULL) Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Sun Dec 8 01:16:22 2019 (r355511) +++ head/sys/kern/sched_4bsd.c Sun Dec 8 01:17:38 2019 (r355512) @@ -706,8 +706,8 @@ sched_rr_interval(void) * favor processes which haven't run much recently, and to round-robin * among other processes. */ -void -sched_clock(struct thread *td) +static void +sched_clock_tick(struct thread *td) { struct pcpuidlestat *stat; struct td_sched *ts; @@ -734,6 +734,14 @@ sched_clock(struct thread *td) stat = DPCPU_PTR(idlestat); stat->oldidlecalls = stat->idlecalls; stat->idlecalls = 0; +} + +void +sched_clock(struct thread *td, int cnt) +{ + + for ( ; cnt > 0; cnt--) + sched_clock_tick(td); } /* Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sun Dec 8 01:16:22 2019 (r355511) +++ head/sys/kern/sched_ule.c Sun Dec 8 01:17:38 2019 (r355512) @@ -2421,7 +2421,7 @@ sched_userret_slowpath(struct thread *td) * threads. */ void -sched_clock(struct thread *td) +sched_clock(struct thread *td, int cnt) { struct tdq *tdq; struct td_sched *ts; @@ -2432,8 +2432,10 @@ sched_clock(struct thread *td) /* * We run the long term load balancer infrequently on the first cpu. */ - if (balance_tdq == tdq && smp_started != 0 && rebalance != 0) { - if (balance_ticks && --balance_ticks == 0) + if (balance_tdq == tdq && smp_started != 0 && rebalance != 0 && + balance_ticks != 0) { + balance_ticks -= cnt; + if (balance_ticks <= 0) sched_balance(); } #endif @@ -2455,14 +2457,15 @@ sched_clock(struct thread *td) } ts = td_get_sched(td); sched_pctcpu_update(ts, 1); - if (td->td_pri_class & PRI_FIFO_BIT) + if ((td->td_pri_class & PRI_FIFO_BIT) || TD_IS_IDLETHREAD(td)) return; + if (PRI_BASE(td->td_pri_class) == PRI_TIMESHARE) { /* * We used a tick; charge it to the thread so * that we can compute our interactivity. */ - td_get_sched(td)->ts_runtime += tickincr; + td_get_sched(td)->ts_runtime += tickincr * cnt; sched_interact_update(td); sched_priority(td); } @@ -2471,7 +2474,8 @@ sched_clock(struct thread *td) * Force a context switch if the current thread has used up a full * time slice (default is 100ms). */ - if (!TD_IS_IDLETHREAD(td) && ++ts->ts_slice >= tdq_slice(tdq)) { + ts->ts_slice += cnt; + if (ts->ts_slice >= tdq_slice(tdq)) { ts->ts_slice = 0; td->td_flags |= TDF_NEEDRESCHED | TDF_SLICEEND; } Modified: head/sys/sys/sched.h ============================================================================== --- head/sys/sys/sched.h Sun Dec 8 01:16:22 2019 (r355511) +++ head/sys/sys/sched.h Sun Dec 8 01:17:38 2019 (r355512) @@ -135,7 +135,7 @@ sched_userret(struct thread *td) * Threads are moved on and off of run queues */ void sched_add(struct thread *td, int flags); -void sched_clock(struct thread *td); +void sched_clock(struct thread *td, int ticks); void sched_preempt(struct thread *td); void sched_rem(struct thread *td); void sched_relinquish(struct thread *td); From owner-svn-src-all@freebsd.org Sun Dec 8 01:20:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C12A1D300D; Sun, 8 Dec 2019 01:20:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47VpRT6g9Vz4SNd; Sun, 8 Dec 2019 01:20:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C97BD2279F; Sun, 8 Dec 2019 01:20:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB81KbEB005509; Sun, 8 Dec 2019 01:20:37 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB81Kbap005507; Sun, 8 Dec 2019 01:20:37 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201912080120.xB81Kbap005507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 8 Dec 2019 01:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355513 - head/sbin/newfs_msdos X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/newfs_msdos X-SVN-Commit-Revision: 355513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 01:20:38 -0000 Author: delphij Date: Sun Dec 8 01:20:37 2019 New Revision: 355513 URL: https://svnweb.freebsd.org/changeset/base/355513 Log: Fix a couple of minor issues with newfs_msdos: - Do not unnecessarily strdup(). - Check return value of getdiskinfo(), if it failed, bail out. Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22729 Modified: head/sbin/newfs_msdos/mkfs_msdos.c head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/mkfs_msdos.c Sun Dec 8 01:17:38 2019 (r355512) +++ head/sbin/newfs_msdos/mkfs_msdos.c Sun Dec 8 01:20:37 2019 (r355513) @@ -318,7 +318,8 @@ mkfs_msdos(const char *fname, const char *dtype, const bpb.bpbHiddenSecs = o.hidden_sectors; if (!(o.floppy || (o.drive_heads && o.sectors_per_track && o.bytes_per_sector && o.size && o.hidden_sectors_set))) { - getdiskinfo(fd, fname, dtype, o.hidden_sectors_set, &bpb); + if (getdiskinfo(fd, fname, dtype, o.hidden_sectors_set, &bpb) == -1) + goto done; bpb.bpbHugeSectors -= (o.offset / bpb.bpbBytesPerSec); if (bpb.bpbSecPerClust == 0) { /* set defaults */ if (bpb.bpbHugeSectors <= 6000) /* about 3MB -> 512 bytes */ @@ -423,10 +424,7 @@ mkfs_msdos(const char *fname, const char *dtype, const bname = o.bootstrap; if (!strchr(bname, '/')) { snprintf(buf, sizeof(buf), "/boot/%s", bname); - if (!(bname = strdup(buf))) { - warn(NULL); - goto done; - } + bname = buf; } if ((fd1 = open(bname, O_RDONLY)) == -1 || fstat(fd1, &sb)) { warn("%s", bname); Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Sun Dec 8 01:17:38 2019 (r355512) +++ head/sbin/newfs_msdos/newfs_msdos.c Sun Dec 8 01:20:37 2019 (r355513) @@ -185,8 +185,7 @@ main(int argc, char *argv[]) fname = *argv++; if (!o.create_size && !strchr(fname, '/')) { snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname); - if (!(fname = strdup(buf))) - err(1, NULL); + fname = buf; } dtype = *argv; exit(!!mkfs_msdos(fname, dtype, &o)); From owner-svn-src-all@freebsd.org Sun Dec 8 01:47:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1B6D1D463D; Sun, 8 Dec 2019 01:47:29 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47Vq2T4CNBz4Tr9; Sun, 8 Dec 2019 01:47:29 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7472922D6B; Sun, 8 Dec 2019 01:47:29 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB81lTIp022024; Sun, 8 Dec 2019 01:47:29 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB81lTHD022023; Sun, 8 Dec 2019 01:47:29 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912080147.xB81lTHD022023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 8 Dec 2019 01:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355514 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 01:47:29 -0000 Author: jeff Date: Sun Dec 8 01:47:29 2019 New Revision: 355514 URL: https://svnweb.freebsd.org/changeset/base/355514 Log: Do not assert that the object lock is held in vm_object_set_writeable_dirty. A valid reference is all that is required. If we race with a deallocation we will harmlessly misidentify the type of an already dead object. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22636 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Dec 8 01:20:37 2019 (r355513) +++ head/sys/vm/vm_object.c Sun Dec 8 01:47:29 2019 (r355514) @@ -2225,8 +2225,6 @@ void vm_object_set_writeable_dirty(vm_object_t object) { - VM_OBJECT_ASSERT_LOCKED(object); - /* Only set for vnodes & tmpfs */ if (object->type != OBJT_VNODE && (object->flags & OBJ_TMPFS_NODE) == 0) From owner-svn-src-all@freebsd.org Sun Dec 8 01:49:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C03C1D46E5; Sun, 8 Dec 2019 01:49:04 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47Vq4H6yVcz4V03; Sun, 8 Dec 2019 01:49:03 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D265722D73; Sun, 8 Dec 2019 01:49:03 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB81n3VP022133; Sun, 8 Dec 2019 01:49:03 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB81n3mI022132; Sun, 8 Dec 2019 01:49:03 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912080149.xB81n3mI022132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 8 Dec 2019 01:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355515 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 01:49:04 -0000 Author: jeff Date: Sun Dec 8 01:49:03 2019 New Revision: 355515 URL: https://svnweb.freebsd.org/changeset/base/355515 Log: It is now safe to rename a page that is still on a queue. Allowing this is necessary for a forthcoming patch. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22636 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Dec 8 01:47:29 2019 (r355514) +++ head/sys/vm/vm_page.c Sun Dec 8 01:49:03 2019 (r355515) @@ -1720,8 +1720,6 @@ vm_page_replace(vm_page_t mnew, vm_object_t object, vm mnew->pindex = pindex; atomic_set_int(&mnew->ref_count, VPRC_OBJREF); mold = vm_radix_replace(&object->rtree, mnew); - KASSERT(mold->queue == PQ_NONE, - ("vm_page_replace: old page %p is on a paging queue", mold)); /* Keep the resident page list in sorted order. */ TAILQ_INSERT_AFTER(&object->memq, mold, mnew, listq); From owner-svn-src-all@freebsd.org Sun Dec 8 01:49:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECEF61D479A; Sun, 8 Dec 2019 01:49:53 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47Vq5F624Vz4V6x; Sun, 8 Dec 2019 01:49:53 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B22FA22D77; Sun, 8 Dec 2019 01:49:53 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB81nrWT022207; Sun, 8 Dec 2019 01:49:53 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB81nrIo022206; Sun, 8 Dec 2019 01:49:53 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912080149.xB81nrIo022206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 8 Dec 2019 01:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355516 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 01:49:54 -0000 Author: jeff Date: Sun Dec 8 01:49:53 2019 New Revision: 355516 URL: https://svnweb.freebsd.org/changeset/base/355516 Log: It is safe to wire a page while the object is busy. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22636 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Dec 8 01:49:03 2019 (r355515) +++ head/sys/vm/vm_page.c Sun Dec 8 01:49:53 2019 (r355516) @@ -3803,7 +3803,7 @@ vm_page_wire(vm_page_t m) KASSERT(m->object != NULL, ("vm_page_wire: page %p does not belong to an object", m)); - if (!vm_page_busied(m)) + if (!vm_page_busied(m) && !vm_object_busied(m->object)) VM_OBJECT_ASSERT_LOCKED(m->object); KASSERT((m->flags & PG_FICTITIOUS) == 0 || VPRC_WIRE_COUNT(m->ref_count) >= 1, From owner-svn-src-all@freebsd.org Sun Dec 8 01:55:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EE381D4BDB; Sun, 8 Dec 2019 01:55:24 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47VqCc0nydz4Vg0; Sun, 8 Dec 2019 01:55:24 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3BE522F79; Sun, 8 Dec 2019 01:55:23 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB81tNHF027995; Sun, 8 Dec 2019 01:55:23 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB81tNJb027994; Sun, 8 Dec 2019 01:55:23 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912080155.xB81tNJb027994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 8 Dec 2019 01:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355517 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 01:55:24 -0000 Author: jeff Date: Sun Dec 8 01:55:23 2019 New Revision: 355517 URL: https://svnweb.freebsd.org/changeset/base/355517 Log: Fix two problems with r355149. The sysctl name collision code assumed that zones would never be freed. In the case of tmpfs this was not true. While here test for the right bit to disable the keg related sysctls for zones that don't have kegs. Reported by: pho Reviewed by: rlibby Differential Revision: https://reviews.freebsd.org/D22655 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sun Dec 8 01:49:53 2019 (r355516) +++ head/sys/vm/uma_core.c Sun Dec 8 01:55:23 2019 (r355517) @@ -1859,14 +1859,13 @@ zone_alloc_counters(uma_zone_t zone, void *unused) zone->uz_fails = counter_u64_alloc(M_WAITOK); } -#define UMA_MAX_DUP 999 static void zone_alloc_sysctl(uma_zone_t zone, void *unused) { uma_zone_domain_t zdom; uma_keg_t keg; struct sysctl_oid *oid, *domainoid; - int domains, i; + int domains, i, cnt; static const char *nokeg = "cache zone"; char *c; @@ -1876,10 +1875,11 @@ zone_alloc_sysctl(uma_zone_t zone, void *unused) * an index. */ if (zone->uz_namecnt != 0) { - if (zone->uz_namecnt > UMA_MAX_DUP) - zone->uz_namecnt = UMA_MAX_DUP; - zone->uz_ctlname = malloc(strlen(zone->uz_name) + - sizeof(__XSTRING(UMA_MAX_DUP)) + 1 , M_UMA, M_WAITOK); + /* Count the number of decimal digits and '_' separator. */ + for (i = 1, cnt = zone->uz_namecnt; cnt != 0; i++) + cnt /= 10; + zone->uz_ctlname = malloc(strlen(zone->uz_name) + i + 1, + M_UMA, M_WAITOK); sprintf(zone->uz_ctlname, "%s_%d", zone->uz_name, zone->uz_namecnt); } else @@ -1912,7 +1912,7 @@ zone_alloc_sysctl(uma_zone_t zone, void *unused) oid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(zone->uz_oid), OID_AUTO, "keg", CTLFLAG_RD, NULL, ""); keg = zone->uz_keg; - if ((zone->uz_flags & UMA_ZFLAG_CACHEONLY) == 0) { + if ((zone->uz_flags & UMA_ZFLAG_CACHE) == 0) { SYSCTL_ADD_CONST_STRING(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "name", CTLFLAG_RD, keg->uk_name, "Keg name"); SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, @@ -2018,8 +2018,14 @@ zone_count(uma_zone_t zone, void *arg) struct uma_zone_count *cnt; cnt = arg; + /* + * Some zones are rapidly created with identical names and + * destroyed out of order. This can lead to gaps in the count. + * Use one greater than the maximum observed for this name. + */ if (strcmp(zone->uz_name, cnt->name) == 0) - cnt->count++; + cnt->count = MAX(cnt->count, + zone->uz_namecnt + 1); } /* From owner-svn-src-all@freebsd.org Sun Dec 8 02:11:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C3A41D514B; Sun, 8 Dec 2019 02:11:07 +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 47VqYl0n0bz4WKp; Sun, 8 Dec 2019 02:11:07 +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 F386F232C1; Sun, 8 Dec 2019 02:11:06 +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 xB82B6qQ036925; Sun, 8 Dec 2019 02:11:06 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB82B6p0036924; Sun, 8 Dec 2019 02:11:06 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201912080211.xB82B6p0036924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 8 Dec 2019 02:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355518 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 355518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 02:11:07 -0000 Author: kp Date: Sun Dec 8 02:11:06 2019 New Revision: 355518 URL: https://svnweb.freebsd.org/changeset/base/355518 Log: pf: Remove references to 'egress' Avoid giving users the impression that FreeBSD has the automatic interface group 'egress'. Submitted by: tj AT mrsk.me Modified: head/share/man/man5/pf.conf.5 Modified: head/share/man/man5/pf.conf.5 ============================================================================== --- head/share/man/man5/pf.conf.5 Sun Dec 8 01:55:23 2019 (r355517) +++ head/share/man/man5/pf.conf.5 Sun Dec 8 02:11:06 2019 (r355518) @@ -28,7 +28,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 10, 2019 +.Dd December 7, 2019 .Dt PF.CONF 5 .Os .Sh NAME @@ -2616,7 +2616,7 @@ block. Brace delimited blocks may contain rules or other brace-delimited blocks. When anchors are loaded this way the anchor name becomes optional. .Bd -literal -offset indent -anchor "external" on egress { +anchor "external" on $ext_if { block anchor out { pass proto tcp from any to port { 25, 80, 443 } From owner-svn-src-all@freebsd.org Sun Dec 8 04:17:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62D521D75B5; Sun, 8 Dec 2019 04:17:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47VtM522jsz4bsN; Sun, 8 Dec 2019 04:17:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 263422495C; Sun, 8 Dec 2019 04:17:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB84H482011162; Sun, 8 Dec 2019 04:17:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB84H4RX011159; Sun, 8 Dec 2019 04:17:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201912080417.xB84H4RX011159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 8 Dec 2019 04:17:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355519 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 355519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 04:17:05 -0000 Author: jhibbits Date: Sun Dec 8 04:17:04 2019 New Revision: 355519 URL: https://svnweb.freebsd.org/changeset/base/355519 Log: powerpc64/pmap: micro-optimize some PVO-PTE logic Summary: moea64_pte_sync_native() and moea64_pte_unset_native() don't need the full PTE created, they only need to check that the PVO has a matching PTE to the PTE in the page table. Don't waste time creating the full PTE in this case. Reviewed by: luporl Differential Revision: https://reviews.freebsd.org/D22341 Modified: head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/mmu_oea64.h head/sys/powerpc/aim/moea64_native.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sun Dec 8 02:11:06 2019 (r355518) +++ head/sys/powerpc/aim/mmu_oea64.c Sun Dec 8 04:17:04 2019 (r355519) @@ -435,8 +435,7 @@ void moea64_pte_from_pvo(const struct pvo_entry *pvo, struct lpte *lpte) { - lpte->pte_hi = (pvo->pvo_vpn >> (ADDR_API_SHFT64 - ADDR_PIDX_SHFT)) & - LPTE_AVPN_MASK; + lpte->pte_hi = moea64_pte_vpn_from_pvo_vpn(pvo); lpte->pte_hi |= LPTE_VALID; if (pvo->pvo_vaddr & PVO_LARGE) Modified: head/sys/powerpc/aim/mmu_oea64.h ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.h Sun Dec 8 02:11:06 2019 (r355518) +++ head/sys/powerpc/aim/mmu_oea64.h Sun Dec 8 04:17:04 2019 (r355519) @@ -76,6 +76,13 @@ void moea64_mid_bootstrap(mmu_t mmup, vm_offset_t ker void moea64_late_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend); +static inline uint64_t +moea64_pte_vpn_from_pvo_vpn(const struct pvo_entry *pvo) +{ + return ((pvo->pvo_vpn >> (ADDR_API_SHFT64 - ADDR_PIDX_SHFT)) & + LPTE_AVPN_MASK); +} + /* * Statistics */ Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Sun Dec 8 02:11:06 2019 (r355518) +++ head/sys/powerpc/aim/moea64_native.c Sun Dec 8 04:17:04 2019 (r355519) @@ -257,16 +257,14 @@ static int64_t moea64_pte_synch_native(mmu_t mmu, struct pvo_entry *pvo) { volatile struct lpte *pt = moea64_pteg_table + pvo->pvo_pte.slot; - struct lpte properpt; - uint64_t ptelo; + uint64_t ptelo, pvo_ptevpn; PMAP_LOCK_ASSERT(pvo->pvo_pmap, MA_OWNED); - moea64_pte_from_pvo(pvo, &properpt); + pvo_ptevpn = moea64_pte_vpn_from_pvo_vpn(pvo); rw_rlock(&moea64_eviction_lock); - if ((be64toh(pt->pte_hi) & LPTE_AVPN_MASK) != - (properpt.pte_hi & LPTE_AVPN_MASK)) { + if ((be64toh(pt->pte_hi) & LPTE_AVPN_MASK) != pvo_ptevpn) { /* Evicted */ rw_runlock(&moea64_eviction_lock); return (-1); @@ -330,14 +328,12 @@ static int64_t moea64_pte_unset_native(mmu_t mmu, struct pvo_entry *pvo) { volatile struct lpte *pt = moea64_pteg_table + pvo->pvo_pte.slot; - struct lpte properpt; - uint64_t ptelo; + uint64_t ptelo, pvo_ptevpn; - moea64_pte_from_pvo(pvo, &properpt); + pvo_ptevpn = moea64_pte_vpn_from_pvo_vpn(pvo); rw_rlock(&moea64_eviction_lock); - if ((be64toh(pt->pte_hi & LPTE_AVPN_MASK)) != - (properpt.pte_hi & LPTE_AVPN_MASK)) { + if ((be64toh(pt->pte_hi & LPTE_AVPN_MASK)) != pvo_ptevpn) { /* Evicted */ STAT_MOEA64(moea64_pte_overflow--); rw_runlock(&moea64_eviction_lock); From owner-svn-src-all@freebsd.org Sun Dec 8 04:19:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 266E51D768F; Sun, 8 Dec 2019 04:19:07 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47VtPR0xmWz4c1X; Sun, 8 Dec 2019 04:19:07 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD9E224963; Sun, 8 Dec 2019 04:19:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB84J60V011292; Sun, 8 Dec 2019 04:19:06 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB84J6Dc011288; Sun, 8 Dec 2019 04:19:06 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201912080419.xB84J6Dc011288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 8 Dec 2019 04:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355520 - stable/12/bin/dd X-SVN-Group: stable-12 X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: stable/12/bin/dd X-SVN-Commit-Revision: 355520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 04:19:07 -0000 Author: mmacy Date: Sun Dec 8 04:19:05 2019 New Revision: 355520 URL: https://svnweb.freebsd.org/changeset/base/355520 Log: MFC r351770,r352920-r352923 MFCs to dd appear to have been haphazard so selectively MFCing individually didn't work easily. Add conv=fsync flag to dd The fsync flag performs an fsync(2) on the output file before closing it. This will be useful for the ZFS test suite. Add conv=fdatasync flag to dd The fdatasync flag performs an fdatasync(2) on the output file before closing it. This will be useful for the ZFS test suite. dd: Check result of close(2) for errors close(2) can return errors from previous operations which should not be ignored. Add oflag=fsync and oflag=sync capability to dd Sets the O_FSYNC flag on the output file. oflag=fsync and oflag=sync are synonyms just as O_FSYNC and O_SYNC are synonyms. This functionality is intended to improve portability of dd commands in the ZFS test suite. Add iflag=fullblock to dd Normally, count=n means read(2) will be called n times on the input to dd. If the read() returns short, as may happen when reading from a pipe, fewer bytes will be copied from the input. With conv=sync the buffer is padded with zeros to fill the rest of the block. iflag=fullblock causes dd to continue reading until the block is full, so that count=n means n full blocks are copied. This flag is compatible with illumos and GNU dd and is used in the ZFS test suite. Submitted by: Ryan Moeller, Thomas Hurst Reviewed by: manpages, mmacy@ Sponsored by: iXsystems, Inc. Modified: stable/12/bin/dd/args.c stable/12/bin/dd/dd.1 stable/12/bin/dd/dd.c stable/12/bin/dd/dd.h stable/12/bin/dd/extern.h Modified: stable/12/bin/dd/args.c ============================================================================== --- stable/12/bin/dd/args.c Sun Dec 8 04:17:04 2019 (r355519) +++ stable/12/bin/dd/args.c Sun Dec 8 04:19:05 2019 (r355520) @@ -41,7 +41,7 @@ static char sccsid[] = "@(#)args.c 8.3 (Berkeley) 4/2/ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); static int c_arg(const void *, const void *); static int c_conv(const void *, const void *); +static int c_iflag(const void *, const void *); +static int c_oflag(const void *, const void *); static void f_bs(char *); static void f_cbs(char *); static void f_conv(char *); @@ -65,8 +67,10 @@ static void f_files(char *); static void f_fillchar(char *); static void f_ibs(char *); static void f_if(char *); +static void f_iflag(char *); static void f_obs(char *); static void f_of(char *); +static void f_oflag(char *); static void f_seek(char *); static void f_skip(char *); static void f_speed(char *); @@ -77,7 +81,7 @@ static off_t get_off_t(const char *); static const struct arg { const char *name; void (*f)(char *); - u_int set, noset; + uint64_t set, noset; } args[] = { { "bs", f_bs, C_BS, C_BS|C_IBS|C_OBS|C_OSYNC }, { "cbs", f_cbs, C_CBS, C_CBS }, @@ -87,9 +91,11 @@ static const struct arg { { "fillchar", f_fillchar, C_FILL, C_FILL }, { "ibs", f_ibs, C_IBS, C_BS|C_IBS }, { "if", f_if, C_IF, C_IF }, + { "iflag", f_iflag, 0, 0 }, { "iseek", f_skip, C_SKIP, C_SKIP }, { "obs", f_obs, C_OBS, C_BS|C_OBS }, { "of", f_of, C_OF, C_OF }, + { "oflag", f_oflag, 0, 0 }, { "oseek", f_seek, C_SEEK, C_SEEK }, { "seek", f_seek, C_SEEK, C_SEEK }, { "skip", f_skip, C_SKIP, C_SKIP }, @@ -256,7 +262,39 @@ f_if(char *arg) in.name = arg; } +static const struct iflag { + const char *name; + uint64_t set, noset; +} ilist[] = { + { "fullblock", C_IFULLBLOCK, C_SYNC }, +}; + static void +f_iflag(char *arg) +{ + struct iflag *ip, tmp; + + while (arg != NULL) { + tmp.name = strsep(&arg, ","); + ip = bsearch(&tmp, ilist, nitems(ilist), sizeof(struct iflag), + c_iflag); + if (ip == NULL) + errx(1, "unknown iflag %s", tmp.name); + if (ddflags & ip->noset) + errx(1, "%s: illegal conversion combination", tmp.name); + ddflags |= ip->set; + } +} + +static int +c_iflag(const void *a, const void *b) +{ + + return (strcmp(((const struct iflag *)a)->name, + ((const struct iflag *)b)->name)); +} + +static void f_obs(char *arg) { uintmax_t res; @@ -314,12 +352,14 @@ f_status(char *arg) static const struct conv { const char *name; - u_int set, noset; + uint64_t set, noset; const u_char *ctab; } clist[] = { { "ascii", C_ASCII, C_EBCDIC, e2a_POSIX }, { "block", C_BLOCK, C_UNBLOCK, NULL }, { "ebcdic", C_EBCDIC, C_ASCII, a2e_POSIX }, + { "fdatasync", C_FDATASYNC, 0, NULL }, + { "fsync", C_FSYNC, 0, NULL }, { "ibm", C_EBCDIC, C_ASCII, a2ibm_POSIX }, { "lcase", C_LCASE, C_UCASE, NULL }, { "noerror", C_NOERROR, 0, NULL }, @@ -334,7 +374,7 @@ static const struct conv { { "parset", C_PARSET, C_PARODD|C_PAREVEN|C_PARNONE, NULL}, { "sparse", C_SPARSE, 0, NULL }, { "swab", C_SWAB, 0, NULL }, - { "sync", C_SYNC, 0, NULL }, + { "sync", C_SYNC, C_IFULLBLOCK, NULL }, { "ucase", C_UCASE, C_LCASE, NULL }, { "unblock", C_UNBLOCK, C_BLOCK, NULL }, }; @@ -346,8 +386,8 @@ f_conv(char *arg) while (arg != NULL) { tmp.name = strsep(&arg, ","); - cp = bsearch(&tmp, clist, sizeof(clist) / sizeof(struct conv), - sizeof(struct conv), c_conv); + cp = bsearch(&tmp, clist, nitems(clist), sizeof(struct conv), + c_conv); if (cp == NULL) errx(1, "unknown conversion %s", tmp.name); if (ddflags & cp->noset) @@ -364,6 +404,37 @@ c_conv(const void *a, const void *b) return (strcmp(((const struct conv *)a)->name, ((const struct conv *)b)->name)); +} + +static const struct oflag { + const char *name; + uint64_t set; +} olist[] = { + { "fsync", C_OFSYNC }, + { "sync", C_OFSYNC }, +}; + +static void +f_oflag(char *arg) +{ + struct oflag *op, tmp; + + while (arg != NULL) { + tmp.name = strsep(&arg, ","); + op = bsearch(&tmp, olist, nitems(olist), sizeof(struct oflag), + c_oflag); + if (op == NULL) + errx(1, "unknown open flag %s", tmp.name); + ddflags |= op->set; + } +} + +static int +c_oflag(const void *a, const void *b) +{ + + return (strcmp(((const struct oflag *)a)->name, + ((const struct oflag *)b)->name)); } static intmax_t Modified: stable/12/bin/dd/dd.1 ============================================================================== --- stable/12/bin/dd/dd.1 Sun Dec 8 04:17:04 2019 (r355519) +++ stable/12/bin/dd/dd.1 Sun Dec 8 04:19:05 2019 (r355520) @@ -32,7 +32,7 @@ .\" @(#)dd.1 8.2 (Berkeley) 1/13/94 .\" $FreeBSD$ .\" -.Dd August 8, 2018 +.Dd March 26, 2019 .Dt DD 1 .Os .Sh NAME @@ -102,6 +102,22 @@ bytes instead of the default 512. Read input from .Ar file instead of the standard input. +.It Cm iflag Ns = Ns Ar value Ns Op , Ns Ar value ... +Where +.Cm value +is one of the symbols from the following list. +.Bl -tag -width "fullblock" +.It Cm fullblock +Reading from the input file may not obtain a full block. +When a read returns short, continue reading to fill the block. +Without this flag, +.Cm count +limits the number of times +.Xr read 2 +is called on the input rather than the number of blocks copied in full. +May not be combined with +.Cm conv=sync . +.El .It Cm iseek Ns = Ns Ar n Seek on the input file .Ar n @@ -123,6 +139,19 @@ If an initial portion of the output file is seeked pas .Cm oseek operand), the output file is truncated at that point. +.It Cm oflag Ns = Ns Ar value Ns Op , Ns Ar value ... +Where +.Cm value +is one of the symbols from the following list. +.Bl -tag -width "fsync" +.It Cm fsync +Set the O_FSYNC flag on the output file to make writes synchronous. +.It Cm sync +Set the O_SYNC flag on the output file to make writes synchronous. +This is synonymous with the +.Cm fsync +value. +.El .It Cm oseek Ns = Ns Ar n Seek on the output file .Ar n @@ -252,6 +281,14 @@ are maps used in historic and .No pre- Ns Bx 4.3 reno systems. +.It Cm fdatasync +Perform an +.Xr fdatasync 2 +on the output file before closing it. +.It Cm fsync +Perform an +.Xr fsync 2 +on the output file before closing it. .It Cm lcase Transform uppercase characters into lowercase characters. .It Cm pareven , parnone , parodd , parset @@ -427,7 +464,8 @@ if necessary, to a 1MiB boundary: .Xr mt 1 , .Xr recoverdisk 1 , .Xr tr 1 , -.Xr geom 4 +.Xr geom 4 , +.Xr trim 8 .Sh STANDARDS The .Nm Modified: stable/12/bin/dd/dd.c ============================================================================== --- stable/12/bin/dd/dd.c Sun Dec 8 04:17:04 2019 (r355519) +++ stable/12/bin/dd/dd.c Sun Dec 8 04:19:05 2019 (r355520) @@ -83,7 +83,7 @@ STAT st; /* statistics */ void (*cfunc)(void); /* conversion function */ uintmax_t cpy_cnt; /* # of blocks to copy */ static off_t pending = 0; /* pending seek if sparse */ -u_int ddflags = 0; /* conversion options */ +uint64_t ddflags = 0; /* conversion options */ size_t cbsz; /* conversion block size */ uintmax_t files_cnt = 1; /* # of files to copy */ const u_char *ctab; /* conversion table */ @@ -124,7 +124,8 @@ main(int argc __unused, char *argv[]) * descriptor explicitly so that the summary handler (called * from an atexit() hook) includes this work. */ - close(out.fd); + if (close(out.fd) == -1 && errno != EINTR) + err(1, "close"); exit(0); } @@ -142,6 +143,7 @@ static void setup(void) { u_int cnt; + int oflags; cap_rights_t rights; unsigned long cmds[] = { FIODTYPE, MTIOCTOP }; @@ -164,21 +166,34 @@ setup(void) errx(1, "files is not supported for non-tape devices"); cap_rights_set(&rights, CAP_FTRUNCATE, CAP_IOCTL, CAP_WRITE); + if (ddflags & (C_FDATASYNC | C_FSYNC)) + cap_rights_set(&rights, CAP_FSYNC); if (out.name == NULL) { /* No way to check for read access here. */ out.fd = STDOUT_FILENO; out.name = "stdout"; + if (ddflags & C_OFSYNC) { + oflags = fcntl(out.fd, F_GETFL); + if (oflags == -1) + err(1, "unable to get fd flags for stdout"); + oflags |= O_FSYNC; + if (fcntl(out.fd, F_SETFL, oflags) == -1) + err(1, "unable to set fd flags for stdout"); + } } else { -#define OFLAGS \ - (O_CREAT | (ddflags & (C_SEEK | C_NOTRUNC) ? 0 : O_TRUNC)) - out.fd = open(out.name, O_RDWR | OFLAGS, DEFFILEMODE); + oflags = O_CREAT; + if (!(ddflags & (C_SEEK | C_NOTRUNC))) + oflags |= O_TRUNC; + if (ddflags & C_OFSYNC) + oflags |= O_FSYNC; + out.fd = open(out.name, O_RDWR | oflags, DEFFILEMODE); /* * May not have read access, so try again with write only. * Without read we may have a problem if output also does * not support seeks. */ if (out.fd == -1) { - out.fd = open(out.name, O_WRONLY | OFLAGS, DEFFILEMODE); + out.fd = open(out.name, O_WRONLY | oflags, DEFFILEMODE); out.flags |= NOREAD; cap_rights_clear(&rights, CAP_READ); } @@ -393,13 +408,15 @@ dd_in(void) memset(in.dbp, 0, in.dbsz); } - n = read(in.fd, in.dbp, in.dbsz); - if (n == 0) { - in.dbrcnt = 0; + in.dbrcnt = 0; +fill: + n = read(in.fd, in.dbp + in.dbrcnt, in.dbsz - in.dbrcnt); + + /* EOF */ + if (n == 0 && in.dbrcnt == 0) return; - } - /* Read error. */ + /* Read error */ if (n == -1) { /* * If noerror not specified, die. POSIX requires that @@ -423,26 +440,26 @@ dd_in(void) /* If sync not specified, omit block and continue. */ if (!(ddflags & C_SYNC)) continue; + } - /* Read errors count as full blocks. */ - in.dbcnt += in.dbrcnt = in.dbsz; - ++st.in_full; + /* If conv=sync, use the entire block. */ + if (ddflags & C_SYNC) + n = in.dbsz; - /* Handle full input blocks. */ - } else if ((size_t)n == (size_t)in.dbsz) { - in.dbcnt += in.dbrcnt = n; - ++st.in_full; + /* Count the bytes read for this block. */ + in.dbrcnt += n; - /* Handle partial input blocks. */ - } else { - /* If sync, use the entire block. */ - if (ddflags & C_SYNC) - in.dbcnt += in.dbrcnt = in.dbsz; - else - in.dbcnt += in.dbrcnt = n; + /* Count the number of full and partial blocks. */ + if (in.dbrcnt == in.dbsz) + ++st.in_full; + else if (ddflags & C_IFULLBLOCK && n != 0) + goto fill; /* these don't count */ + else ++st.in_part; - } + /* Count the total bytes read for this file. */ + in.dbcnt += in.dbrcnt; + /* * POSIX states that if bs is set and no other conversions * than noerror, notrunc or sync are specified, the block @@ -463,6 +480,7 @@ dd_in(void) swapbytes(in.dbp, (size_t)n); } + /* Advance to the next block. */ in.dbp += in.dbrcnt; (*cfunc)(); if (need_summary) @@ -504,6 +522,14 @@ dd_close(void) if (out.seek_offset > 0 && (out.flags & ISTRUNC)) { if (ftruncate(out.fd, out.seek_offset) == -1) err(1, "truncating %s", out.name); + } + + if (ddflags & C_FSYNC) { + if (fsync(out.fd) == -1) + err(1, "fsyncing %s", out.name); + } else if (ddflags & C_FDATASYNC) { + if (fdatasync(out.fd) == -1) + err(1, "fdatasyncing %s", out.name); } } Modified: stable/12/bin/dd/dd.h ============================================================================== --- stable/12/bin/dd/dd.h Sun Dec 8 04:17:04 2019 (r355519) +++ stable/12/bin/dd/dd.h Sun Dec 8 04:19:05 2019 (r355520) @@ -70,37 +70,41 @@ typedef struct { } STAT; /* Flags (in ddflags). */ -#define C_ASCII 0x00000001 -#define C_BLOCK 0x00000002 -#define C_BS 0x00000004 -#define C_CBS 0x00000008 -#define C_COUNT 0x00000010 -#define C_EBCDIC 0x00000020 -#define C_FILES 0x00000040 -#define C_IBS 0x00000080 -#define C_IF 0x00000100 -#define C_LCASE 0x00000200 -#define C_NOERROR 0x00000400 -#define C_NOTRUNC 0x00000800 -#define C_OBS 0x00001000 -#define C_OF 0x00002000 -#define C_OSYNC 0x00004000 -#define C_PAREVEN 0x00008000 -#define C_PARNONE 0x00010000 -#define C_PARODD 0x00020000 -#define C_PARSET 0x00040000 -#define C_SEEK 0x00080000 -#define C_SKIP 0x00100000 -#define C_SPARSE 0x00200000 -#define C_SWAB 0x00400000 -#define C_SYNC 0x00800000 -#define C_UCASE 0x01000000 -#define C_UNBLOCK 0x02000000 -#define C_FILL 0x04000000 -#define C_STATUS 0x08000000 -#define C_NOXFER 0x10000000 -#define C_NOINFO 0x20000000 -#define C_PROGRESS 0x40000000 +#define C_ASCII 0x0000000000000001ULL +#define C_BLOCK 0x0000000000000002ULL +#define C_BS 0x0000000000000004ULL +#define C_CBS 0x0000000000000008ULL +#define C_COUNT 0x0000000000000010ULL +#define C_EBCDIC 0x0000000000000020ULL +#define C_FILES 0x0000000000000040ULL +#define C_IBS 0x0000000000000080ULL +#define C_IF 0x0000000000000100ULL +#define C_LCASE 0x0000000000000200ULL +#define C_NOERROR 0x0000000000000400ULL +#define C_NOTRUNC 0x0000000000000800ULL +#define C_OBS 0x0000000000001000ULL +#define C_OF 0x0000000000002000ULL +#define C_OSYNC 0x0000000000004000ULL +#define C_PAREVEN 0x0000000000008000ULL +#define C_PARNONE 0x0000000000010000ULL +#define C_PARODD 0x0000000000020000ULL +#define C_PARSET 0x0000000000040000ULL +#define C_SEEK 0x0000000000080000ULL +#define C_SKIP 0x0000000000100000ULL +#define C_SPARSE 0x0000000000200000ULL +#define C_SWAB 0x0000000000400000ULL +#define C_SYNC 0x0000000000800000ULL +#define C_UCASE 0x0000000001000000ULL +#define C_UNBLOCK 0x0000000002000000ULL +#define C_FILL 0x0000000004000000ULL +#define C_STATUS 0x0000000008000000ULL +#define C_NOXFER 0x0000000010000000ULL +#define C_NOINFO 0x0000000020000000ULL +#define C_PROGRESS 0x0000000040000000ULL +#define C_FSYNC 0x0000000080000000ULL +#define C_FDATASYNC 0x0000000100000000ULL +#define C_OFSYNC 0x0000000200000000ULL +#define C_IFULLBLOCK 0x0000000400000000ULL #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) Modified: stable/12/bin/dd/extern.h ============================================================================== --- stable/12/bin/dd/extern.h Sun Dec 8 04:17:04 2019 (r355519) +++ stable/12/bin/dd/extern.h Sun Dec 8 04:19:05 2019 (r355520) @@ -58,7 +58,7 @@ extern STAT st; extern void (*cfunc)(void); extern uintmax_t cpy_cnt; extern size_t cbsz; -extern u_int ddflags; +extern uint64_t ddflags; extern size_t speed; extern uintmax_t files_cnt; extern const u_char *ctab; From owner-svn-src-all@freebsd.org Sun Dec 8 04:36:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D9A61D7C24; Sun, 8 Dec 2019 04:36:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47Vtnm0Kq0z4cgD; Sun, 8 Dec 2019 04:36:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCA1124CE1; Sun, 8 Dec 2019 04:36:43 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB84ahnu022822; Sun, 8 Dec 2019 04:36:43 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB84ahxV022820; Sun, 8 Dec 2019 04:36:43 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201912080436.xB84ahxV022820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 8 Dec 2019 04:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355521 - in head: stand/powerpc/kboot sys/conf sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head: stand/powerpc/kboot sys/conf sys/powerpc/include X-SVN-Commit-Revision: 355521 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 04:36:44 -0000 Author: jhibbits Date: Sun Dec 8 04:36:42 2019 New Revision: 355521 URL: https://svnweb.freebsd.org/changeset/base/355521 Log: powerpc: Use builtins for fls/flsl Summary: There's no need to use the fallback fls() and flsl() libkern functions when the PowerISA includes instructions that already do the bulk of the work. Take advantage of this through the GCC builtins __builtin_clz() and __builtin_clzl(). Reviewed by: luporl Differential Revision: https://reviews.freebsd.org/D22340 Modified: head/stand/powerpc/kboot/main.c head/sys/conf/files.powerpc head/sys/powerpc/include/cpufunc.h Modified: head/stand/powerpc/kboot/main.c ============================================================================== --- head/stand/powerpc/kboot/main.c Sun Dec 8 04:19:05 2019 (r355520) +++ head/stand/powerpc/kboot/main.c Sun Dec 8 04:36:42 2019 (r355521) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define _KERNEL #include #include "bootstrap.h" #include "host_syscall.h" Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Dec 8 04:19:05 2019 (r355520) +++ head/sys/conf/files.powerpc Sun Dec 8 04:36:42 2019 (r355521) @@ -88,8 +88,6 @@ libkern/divdi3.c optional powerpc | powerpcspe libkern/ffs.c standard libkern/ffsl.c standard libkern/ffsll.c standard -libkern/fls.c standard -libkern/flsl.c standard libkern/flsll.c standard libkern/lshrdi3.c optional powerpc | powerpcspe libkern/memcmp.c standard Modified: head/sys/powerpc/include/cpufunc.h ============================================================================== --- head/sys/powerpc/include/cpufunc.h Sun Dec 8 04:19:05 2019 (r355520) +++ head/sys/powerpc/include/cpufunc.h Sun Dec 8 04:36:42 2019 (r355521) @@ -212,6 +212,20 @@ get_pcpu(void) return (ret); } +#define HAVE_INLINE_FLS +static __inline __pure2 int +fls(int mask) +{ + return (mask ? 32 - __builtin_clz(mask) : 0); +} + +#define HAVE_INLINE_FLSL +static __inline __pure2 int +flsl(long mask) +{ + return (mask ? (8 * sizeof(long) - __builtin_clzl(mask)) : 0); +} + /* "NOP" operations to signify priorities to the kernel. */ static __inline void nop_prio_vlow(void) From owner-svn-src-all@freebsd.org Sun Dec 8 15:22:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B81E1E59DA; Sun, 8 Dec 2019 15:22:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47W96h72PFz480t; Sun, 8 Dec 2019 15:22:20 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC9C64392; Sun, 8 Dec 2019 15:22:20 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB8FMKAX006197; Sun, 8 Dec 2019 15:22:20 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB8FMKjg006196; Sun, 8 Dec 2019 15:22:20 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201912081522.xB8FMKjg006196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 8 Dec 2019 15:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355528 - stable/12/sys/netipsec X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netipsec X-SVN-Commit-Revision: 355528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 15:22:21 -0000 Author: ae Date: Sun Dec 8 15:22:20 2019 New Revision: 355528 URL: https://svnweb.freebsd.org/changeset/base/355528 Log: MFC r355129: Add support for dummy ESP packets with next header field equal to IPPROTO_NONE. According to RFC4303 2.6 they should be silently dropped. Submitted by: aurelien.cazuc.external_stormshield.eu Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D22557 Modified: stable/12/sys/netipsec/xform_esp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netipsec/xform_esp.c ============================================================================== --- stable/12/sys/netipsec/xform_esp.c Sun Dec 8 09:44:50 2019 (r355527) +++ stable/12/sys/netipsec/xform_esp.c Sun Dec 8 15:22:20 2019 (r355528) @@ -607,6 +607,13 @@ esp_input_cb(struct cryptop *crp) } } + /* + * RFC4303 2.6: + * Silently drop packet if next header field is IPPROTO_NONE. + */ + if (lastthree[2] == IPPROTO_NONE) + goto bad; + /* Trim the mbuf chain to remove trailing authenticator and padding */ m_adj(m, -(lastthree[1] + 2)); From owner-svn-src-all@freebsd.org Sun Dec 8 15:24:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B6B61E5AAE; Sun, 8 Dec 2019 15:24:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47W98h3Dqpz48Bf; Sun, 8 Dec 2019 15:24:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 684C543AA; Sun, 8 Dec 2019 15:24:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB8FO4bB006330; Sun, 8 Dec 2019 15:24:04 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB8FO4qA006329; Sun, 8 Dec 2019 15:24:04 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201912081524.xB8FO4qA006329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 8 Dec 2019 15:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355529 - stable/11/sys/netipsec X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netipsec X-SVN-Commit-Revision: 355529 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 15:24:04 -0000 Author: ae Date: Sun Dec 8 15:24:03 2019 New Revision: 355529 URL: https://svnweb.freebsd.org/changeset/base/355529 Log: MFC r355129: Add support for dummy ESP packets with next header field equal to IPPROTO_NONE. According to RFC4303 2.6 they should be silently dropped. Submitted by: aurelien.cazuc.external_stormshield.eu Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D22557 Modified: stable/11/sys/netipsec/xform_esp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netipsec/xform_esp.c ============================================================================== --- stable/11/sys/netipsec/xform_esp.c Sun Dec 8 15:22:20 2019 (r355528) +++ stable/11/sys/netipsec/xform_esp.c Sun Dec 8 15:24:03 2019 (r355529) @@ -607,6 +607,13 @@ esp_input_cb(struct cryptop *crp) } } + /* + * RFC4303 2.6: + * Silently drop packet if next header field is IPPROTO_NONE. + */ + if (lastthree[2] == IPPROTO_NONE) + goto bad; + /* Trim the mbuf chain to remove trailing authenticator and padding */ m_adj(m, -(lastthree[1] + 2)); From owner-svn-src-all@freebsd.org Sun Dec 8 16:59:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CDA01E8943; Sun, 8 Dec 2019 16:59:37 +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 47WCGx01m4z4KQH; Sun, 8 Dec 2019 16:59:37 +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 EFCAB540C; Sun, 8 Dec 2019 16:59:36 +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 xB8Gxa5J067829; Sun, 8 Dec 2019 16:59:36 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB8GxaG5067828; Sun, 8 Dec 2019 16:59:36 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912081659.xB8GxaG5067828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 8 Dec 2019 16:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355530 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 355530 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 16:59:37 -0000 Author: rmacklem Date: Sun Dec 8 16:59:36 2019 New Revision: 355530 URL: https://svnweb.freebsd.org/changeset/base/355530 Log: Delete an unused external declaration. Since nfsv4_opflag is no longer used in nfs_clcomsubs.c, delete the external declaration of it. Found during NFSv4.2 code merge. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Sun Dec 8 15:24:03 2019 (r355529) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Sun Dec 8 16:59:36 2019 (r355530) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include extern struct nfsstatsv1 nfsstatsv1; -extern struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS]; extern int ncl_mbuf_mlen; extern enum vtype newnv2tov_type[8]; extern enum vtype nv34tov_type[8]; From owner-svn-src-all@freebsd.org Sun Dec 8 20:13:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1451C1EFBCC; Sun, 8 Dec 2019 20:13:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47WHZt6mNdz3K1d; Sun, 8 Dec 2019 20:13:42 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E37C7790D; Sun, 8 Dec 2019 20:13:42 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB8KDgLQ007387; Sun, 8 Dec 2019 20:13:42 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB8KDgYm007386; Sun, 8 Dec 2019 20:13:42 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912082013.xB8KDgYm007386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 8 Dec 2019 20:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355531 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 355531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 20:13:43 -0000 Author: ian Date: Sun Dec 8 20:13:42 2019 New Revision: 355531 URL: https://svnweb.freebsd.org/changeset/base/355531 Log: Several small fixes for the gpioths (temp/humidity sensor) driver. At the end of a read cycle, set the gpio pin to INPUT rather than OUTPUT. The state of the single-wire "bus" when idle should be high; setting the pin to input allows the external pullup to pull the line high. Setting it to output (and leaving it driving low) was leading a good read cycle followed by one that would fail, and it just continued like that forever, effectively reading the sensor once every 10 seconds instead of 5. In the attach function, do an initial read from the device before registering the sysctls for accessing the last-read values, to prevent reading spurious values for the first 5 seconds after the driver attaches. Do a callout_drain() in the detach function to prevent crashes after unloading the module. Modified: head/sys/dev/gpio/gpioths.c Modified: head/sys/dev/gpio/gpioths.c ============================================================================== --- head/sys/dev/gpio/gpioths.c Sun Dec 8 16:59:36 2019 (r355530) +++ head/sys/dev/gpio/gpioths.c Sun Dec 8 20:13:42 2019 (r355531) @@ -198,9 +198,9 @@ gpioths_dht_readbytes(device_t bus, device_t dev) } } - err = GPIOBUS_PIN_SETFLAGS(bus, dev, 0, GPIO_PIN_OUTPUT); + err = GPIOBUS_PIN_SETFLAGS(bus, dev, 0, GPIO_PIN_INPUT); if (err != 0) { - device_printf(dev, "err(FINAL_SETFLAGS, OUT) = %d\n", err); + device_printf(dev, "err(FINAL_SETFLAGS, IN) = %d\n", err); goto error; } DELAY(1); @@ -331,8 +331,11 @@ gpioths_attach(device_t dev) sc->dev = dev; - callout_init(&sc->callout, 1); - callout_reset(&sc->callout, GPIOTHS_POLLTIME * hz, gpioths_poll, dev); + /* + * Do an initial read so we have correct values for reporting before + * registering the sysctls that can access those values. + */ + gpioths_dht_readbytes(device_get_parent(dev), dev); sc->temp_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, sc, 0, @@ -346,12 +349,20 @@ gpioths_attach(device_t dev) "fails", CTLTYPE_INT | CTLFLAG_RD, sc, 0, gpioths_fails_sysctl, "I", "fails since last successful read"); + callout_init(&sc->callout, 1); + callout_reset(&sc->callout, GPIOTHS_POLLTIME * hz, gpioths_poll, dev); + return (0); } static int gpioths_detach(device_t dev) { + struct gpioths_softc *sc; + + sc = device_get_softc(dev); + + callout_drain(&sc->callout); return (0); } From owner-svn-src-all@freebsd.org Sun Dec 8 20:36:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E15BD1B8684; Sun, 8 Dec 2019 20:36:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47WJ4s5YfVz3KtG; Sun, 8 Dec 2019 20:36:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A07717CAC; Sun, 8 Dec 2019 20:36:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB8KaDtt018962; Sun, 8 Dec 2019 20:36:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB8KaDsZ018961; Sun, 8 Dec 2019 20:36:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912082036.xB8KaDsZ018961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 8 Dec 2019 20:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355532 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 355532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 20:36:13 -0000 Author: ian Date: Sun Dec 8 20:36:13 2019 New Revision: 355532 URL: https://svnweb.freebsd.org/changeset/base/355532 Log: Simplify sysctl stuff in the gpioths driver. There is no need to use local functions to handle the sysctls, they all just access simple readonly integer variables. There's no need to track the oids of the ones we add, since the teardown is done by newbus code, not the driver itself. Also remove the DDB code, because it just provides access to the same data that the sysctls already provide. Modified: head/sys/dev/gpio/gpioths.c Modified: head/sys/dev/gpio/gpioths.c ============================================================================== --- head/sys/dev/gpio/gpioths.c Sun Dec 8 20:13:42 2019 (r355531) +++ head/sys/dev/gpio/gpioths.c Sun Dec 8 20:36:13 2019 (r355532) @@ -67,9 +67,6 @@ struct gpioths_softc { int temp; int hum; int fails; - struct sysctl_oid *temp_oid; - struct sysctl_oid *hum_oid; - struct sysctl_oid *fails_oid; struct callout callout; }; @@ -80,9 +77,6 @@ static int gpioths_probe(device_t dev); static int gpioths_attach(device_t dev); static int gpioths_detach(device_t dev); static void gpioths_poll(void *arg); -static int gpioths_temp_sysctl(SYSCTL_HANDLER_ARGS); -static int gpioths_hum_sysctl(SYSCTL_HANDLER_ARGS); -static int gpioths_fails_sysctl(SYSCTL_HANDLER_ARGS); /* DHT-specific methods */ static int gpioths_dht_initread(device_t bus, device_t dev); @@ -282,43 +276,6 @@ gpioths_poll(void *arg) } static int -gpioths_temp_sysctl(SYSCTL_HANDLER_ARGS) -{ - struct gpioths_softc *sc; - int value; - - sc = (struct gpioths_softc*)arg1; - value = sc->temp; - - return (sysctl_handle_int(oidp, &value, 0, req)); -} - -static int -gpioths_hum_sysctl(SYSCTL_HANDLER_ARGS) -{ - struct gpioths_softc *sc; - int value; - - sc = (struct gpioths_softc*)arg1; - value = sc->hum; - - return (sysctl_handle_int(oidp, &value, 0, req)); -} - - -static int -gpioths_fails_sysctl(SYSCTL_HANDLER_ARGS) -{ - struct gpioths_softc *sc; - int value; - - sc = (struct gpioths_softc*)arg1; - value = sc->fails; - - return (sysctl_handle_int(oidp, &value, 0, req)); -} - -static int gpioths_attach(device_t dev) { struct gpioths_softc *sc; @@ -337,17 +294,16 @@ gpioths_attach(device_t dev) */ gpioths_dht_readbytes(device_get_parent(dev), dev); - sc->temp_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "temperature", CTLTYPE_INT | CTLFLAG_RD, sc, 0, - gpioths_temp_sysctl, "I", "temperature(C)"); + sysctl_add_oid(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "temperature", \ + CTLFLAG_RD | CTLTYPE_INT | CTLFLAG_MPSAFE, + &sc->temp, 0, sysctl_handle_int, "I", "temperature", NULL); - sc->hum_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "humidity", CTLTYPE_INT | CTLFLAG_RD, sc, 0, - gpioths_hum_sysctl, "I", "humidity(%)"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "humidity", + CTLFLAG_RD, &sc->hum, 0, "relative humidity(%)"); - sc->fails_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "fails", CTLTYPE_INT | CTLFLAG_RD, sc, 0, - gpioths_fails_sysctl, "I", "fails since last successful read"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "fails", + CTLFLAG_RD, &sc->fails, 0, + "failures since last successful read"); callout_init(&sc->callout, 1); callout_reset(&sc->callout, GPIOTHS_POLLTIME * hz, gpioths_poll, dev); @@ -366,41 +322,6 @@ gpioths_detach(device_t dev) return (0); } - -/* DDB bits */ -#include "opt_ddb.h" -#ifdef DDB -#include -#include -#include - -static struct command_table db_gpioths_table = LIST_HEAD_INITIALIZER(db_t4_table); -_DB_SET(_show, gpioths, NULL, db_show_table, 0, &db_gpioths_table); - -DB_FUNC(read, db_show_gpiothsread, db_gpioths_table, CS_OWN, NULL) -{ - device_t dev; - int t; - int init; - - init = 0; - t = db_read_token(); - if (t == tIDENT) { - dev = device_lookup_by_name(db_tok_string); - init = 1; - } - - db_skip_to_eol(); - - if (init) - db_printf("read: 0x%x\n", - gpioths_dht_readbytes(dev, device_get_parent(dev))); - else - db_printf("usage: show gpioths read \n"); - -return; -} -#endif /* DDB */ /* Driver bits */ static device_method_t gpioths_methods[] = { From owner-svn-src-all@freebsd.org Sun Dec 8 20:42:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 761A61B8C30; Sun, 8 Dec 2019 20:42:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47WJDg2YJRz3LPr; Sun, 8 Dec 2019 20:42:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52CC37E64; Sun, 8 Dec 2019 20:42:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB8KgxtV024649; Sun, 8 Dec 2019 20:42:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB8KgxDj024648; Sun, 8 Dec 2019 20:42:59 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912082042.xB8KgxDj024648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 8 Dec 2019 20:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355533 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 355533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 20:42:59 -0000 Author: ian Date: Sun Dec 8 20:42:58 2019 New Revision: 355533 URL: https://svnweb.freebsd.org/changeset/base/355533 Log: Add support for more chips to the gpioths driver. Previously the driver supported the DHT11 sensor. Now it supports DHT11, DHT12, DHT21, DHT22, AM3201, AM3202. All these chips are similar, differing primarily in supported temperature and humidity ranges and accuracy (and, presumably, cost). There are two basic data formats reported by the various chips, and it is possible to figure out at runtime which format to use for decoding the data based on the range of values in a single byte of the humidity measurement. (which is detailed in a comment block, so I won't recapitulate it here). Modified: head/sys/dev/gpio/gpioths.c Modified: head/sys/dev/gpio/gpioths.c ============================================================================== --- head/sys/dev/gpio/gpioths.c Sun Dec 8 20:36:13 2019 (r355532) +++ head/sys/dev/gpio/gpioths.c Sun Dec 8 20:42:58 2019 (r355533) @@ -47,6 +47,14 @@ __FBSDID("$FreeBSD$"); * This is driver for Temperature & Humidity sensor which provides digital * output over single-wire protocol from embedded 8-bit microcontroller. * + * This driver supports the following chips: + * DHT11: Temp 0c to 50c +-2.0c, Humidity 20% to 90% +-5% + * DHT12: Temp -20c to 60c +-0.5c, Humidity 20% to 95% +-5% + * DHT21: Temp -40c to 80c +-0.3c, Humidity 0% to 100% +-3% + * DHT22: Temp -40c to 80c +-0.3c, Humidity 0% to 100% +-2% + * AM2301: Same as DHT21, but also supports i2c interface. + * AM2302: Same as DHT22, but also supports i2c interface. + * * Temp/Humidity sensor can't be discovered automatically, please specify hints * as part of loader or kernel configuration: * hint.gpioths.0.at="gpiobus0" @@ -59,8 +67,6 @@ __FBSDID("$FreeBSD$"); #define GPIOTHS_DHT_TIMEOUT 1000 /* 1ms = 1000us */ #define GPIOTHS_DHT_CYCLES 41 #define GPIOTHS_DHT_ONEBYTEMASK 0xFF -#define GPIOTHS_DHT_TEMP_SHIFT 8 -#define GPIOTHS_DHT_HUM_SHIFT 24 struct gpioths_softc { device_t dev; @@ -160,7 +166,7 @@ gpioths_dht_readbytes(device_t bus, device_t dev) uint32_t intervals[GPIOTHS_DHT_CYCLES]; uint32_t err, avglen, value; uint8_t crc, calc; - int i, offset, size; + int i, negmul, offset, size, tmphi, tmplo; sc = device_get_softc(dev); @@ -246,9 +252,46 @@ gpioths_dht_readbytes(device_t bus, device_t dev) goto error; } + /* + * For DHT11/12, the values are split into 8 bits of integer and 8 bits + * of fractional tenths. On DHT11 the fraction bytes are always zero. + * On DHT12 the sign bit is in the high bit of the fraction byte. + * - DHT11: 0HHHHHHH 00000000 00TTTTTT 00000000 + * - DHT12: 0HHHHHHH 0000hhhh 00TTTTTT s000tttt + * + * For DHT21/21, the values are are encoded in 16 bits each, with the + * temperature sign bit in the high bit. The values are tenths of a + * degree C and tenths of a percent RH. + * - DHT21: 000000HH HHHHHHHH s00000TT TTTTTTTT + * - DHT22: 000000HH HHHHHHHH s00000TT TTTTTTTT + * + * For all devices, some bits are always zero because of the range of + * values supported by the device. + * + * We figure out how to decode things based on the high byte of the + * humidity. A DHT21/22 cannot report a value greater than 3 in + * the upper bits of its 16-bit humidity. A DHT11/12 should not report + * a value lower than 20. To allow for the possibility that a device + * could report a value slightly out of its sensitivity range, we split + * the difference and say if the value is greater than 10 it cannot be a + * DHT22 (that would be a humidity over 256%). + */ +#define DK_OFFSET 2731 /* Offset between K and C, in decikelvins. */ + if ((value >> 24) > 10) { + /* DHT11 or DHT12 */ + tmphi = (value >> 8) & 0x3f; + tmplo = value & 0x0f; + negmul = (value & 0x80) ? -1 : 1; + sc->temp = DK_OFFSET + (negmul * (tmphi * 10 + tmplo)); + sc->hum = (value >> 24) & 0x7f; + } else { + /* DHT21 or DHT22 */ + negmul = (value & 0x8000) ? -1 : 1; + sc->temp = DK_OFFSET + (negmul * (value & 0x03ff)); + sc->hum = ((value >> 16) & 0x03ff) / 10; + } + sc->fails = 0; - sc->temp = (value >> GPIOTHS_DHT_TEMP_SHIFT) & GPIOTHS_DHT_ONEBYTEMASK; - sc->hum = (value >> GPIOTHS_DHT_HUM_SHIFT) & GPIOTHS_DHT_ONEBYTEMASK; #ifdef GPIOTHS_DEBUG /* Debug bits */ @@ -296,7 +339,7 @@ gpioths_attach(device_t dev) sysctl_add_oid(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "temperature", \ CTLFLAG_RD | CTLTYPE_INT | CTLFLAG_MPSAFE, - &sc->temp, 0, sysctl_handle_int, "I", "temperature", NULL); + &sc->temp, 0, sysctl_handle_int, "IK", "temperature", NULL); SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "humidity", CTLFLAG_RD, &sc->hum, 0, "relative humidity(%)"); From owner-svn-src-all@freebsd.org Sun Dec 8 21:08:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0812A1BA192; Sun, 8 Dec 2019 21:08:35 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.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 47WJp96h6fz3N4d; Sun, 8 Dec 2019 21:08:33 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-ed1-f66.google.com with SMTP id j17so10912620edp.3; Sun, 08 Dec 2019 13:08:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=w0tZHRfWJrEeO4CnwrnhrhnYE8mHzeQUJ3EbPT6yr5U=; b=ZEDWw8MO0UjKcyaMCS2hNFEFCTO3k3K2uUdIdO6h1sddp3mE4S8LLnB6/CWmas0pLT 0a2B15WzIOvlz5bFzZBK5v+WphaOXHNameLjUsn7T9HVwlOW8jvf/fDWH2ku2ocx/E+2 lVL3Hq8bA2PMImOTXeLLHqJCMEwnZ9GaRvQby/2/sXCEpi0EFnk5ztP/orJdjQt1hNA2 YapQktMhPAaGiTJgOlSsvqnUwj3AfLKP/Uzf5tM0B7Y8h3dbx/Wfg9KafO48nlNNC5x7 pVLJOPgIxGQgBaM/yp31RwkxUUIgWlhvYDlE81SULVxKYDddmVd8FhXUQx3AG7eHWxj2 bfwQ== X-Gm-Message-State: APjAAAVAEoeGP6zFlz5wsnLYzNgsVal94O5e2II6SMq38FcBkabjbs/3 mdgGcE8CYN15ct2cuNL4F2XuD1PFc7ii4L9/WS6wT107 X-Google-Smtp-Source: APXvYqwS5MqQJTNCNakwojZSXPJVNek023NpW9XSg+x0L7gyB/UM8lgr7hO7QcQdKxhtoyVitJBr71tsqX23pgOtAWg= X-Received: by 2002:a50:d648:: with SMTP id c8mr28848881edj.20.1575839312020; Sun, 08 Dec 2019 13:08:32 -0800 (PST) MIME-Version: 1.0 References: <201911251833.xAPIXM9h040583@repo.freebsd.org> <82757e82-e26c-f92f-66cf-a03f22cffe9b@FreeBSD.org> In-Reply-To: <82757e82-e26c-f92f-66cf-a03f22cffe9b@FreeBSD.org> From: Mariusz Zaborski Date: Sun, 8 Dec 2019 22:08:22 +0100 Message-ID: Subject: Re: svn commit: r355097 - in head: sys/kern tests/sys/kern To: John Baldwin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47WJp96h6fz3N4d X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of oshogbovx@gmail.com designates 209.85.208.66 as permitted sender) smtp.mailfrom=oshogbovx@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)[oshogbo@freebsd.org,oshogbovx@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: (-4.59), ipnet: 209.85.128.0/17(-3.14), asn: 15169(-1.92), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.208.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[oshogbo@freebsd.org,oshogbovx@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[66.208.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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 21:08:35 -0000 On Mon, 2 Dec 2019 at 18:55, John Baldwin wrote: > > On 11/25/19 10:33 AM, Mariusz Zaborski wrote: > > Author: oshogbo > > Date: Mon Nov 25 18:33:21 2019 > > New Revision: 355097 > > URL: https://svnweb.freebsd.org/changeset/base/355097 > > > > Log: > > procdesc: allow to collect status through wait(1) if process is traced > > > > The debugger like truss(1) depends on the wait(2) syscall. This syscall > > waits for ALL children. When it is waiting for ALL child's the children > > created by process descriptors are not returned. This behavior was > > introduced because we want to implement libraries which may pdfork(1). > > > > The behavior of process descriptor brakes truss(1) because it will > > not be able to collect the status of processes with process descriptors. > > > > To address this problem the status is returned to parent when the > > child is traced. While the process is traced the debugger is the new parent. > > In case the original parent and debugger are the same process it means the > > debugger explicitly used pdfork() to create the child. In that case the debugger > > should be using kqueue()/pdwait() instead of wait(). > > > > Add test case to verify that. The test case was implemented by markj@. > > Does this fix PR 201276? > > Also, what about PRs 220324 and 232679? Unfortunately, only partially. I still looking at some issues. From owner-svn-src-all@freebsd.org Sun Dec 8 21:11:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 299731BA319; Sun, 8 Dec 2019 21:11:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47WJsV0N19z3NNV; Sun, 8 Dec 2019 21:11:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E25FA8492; Sun, 8 Dec 2019 21:11:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB8LBPPh041149; Sun, 8 Dec 2019 21:11:25 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB8LBP11041148; Sun, 8 Dec 2019 21:11:25 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201912082111.xB8LBP11041148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 8 Dec 2019 21:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355534 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 21:11:26 -0000 Author: mjg Date: Sun Dec 8 21:11:25 2019 New Revision: 355534 URL: https://svnweb.freebsd.org/changeset/base/355534 Log: vfs: factor out vnode destruction out of vdrop Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Dec 8 20:42:58 2019 (r355533) +++ head/sys/kern/vfs_subr.c Sun Dec 8 21:11:25 2019 (r355534) @@ -1663,6 +1663,64 @@ alloc: return (0); } +static void +freevnode(struct vnode *vp) +{ + struct bufobj *bo; + + /* + * The vnode has been marked for destruction, so free it. + * + * The vnode will be returned to the zone where it will + * normally remain until it is needed for another vnode. We + * need to cleanup (or verify that the cleanup has already + * been done) any residual data left from its current use + * so as not to contaminate the freshly allocated vnode. + */ + CTR2(KTR_VFS, "%s: destroying the vnode %p", __func__, vp); + atomic_subtract_long(&numvnodes, 1); + bo = &vp->v_bufobj; + VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, + ("cleaned vnode still on the free list.")); + VNASSERT(vp->v_data == NULL, vp, ("cleaned vnode isn't")); + VNASSERT(vp->v_holdcnt == 0, vp, ("Non-zero hold count")); + VNASSERT(vp->v_usecount == 0, vp, ("Non-zero use count")); + VNASSERT(vp->v_writecount == 0, vp, ("Non-zero write count")); + VNASSERT(bo->bo_numoutput == 0, vp, ("Clean vnode has pending I/O's")); + VNASSERT(bo->bo_clean.bv_cnt == 0, vp, ("cleanbufcnt not 0")); + VNASSERT(pctrie_is_empty(&bo->bo_clean.bv_root), vp, + ("clean blk trie not empty")); + VNASSERT(bo->bo_dirty.bv_cnt == 0, vp, ("dirtybufcnt not 0")); + VNASSERT(pctrie_is_empty(&bo->bo_dirty.bv_root), vp, + ("dirty blk trie not empty")); + VNASSERT(TAILQ_EMPTY(&vp->v_cache_dst), vp, ("vp has namecache dst")); + VNASSERT(LIST_EMPTY(&vp->v_cache_src), vp, ("vp has namecache src")); + VNASSERT(vp->v_cache_dd == NULL, vp, ("vp has namecache for ..")); + VNASSERT(TAILQ_EMPTY(&vp->v_rl.rl_waiters), vp, + ("Dangling rangelock waiters")); + VI_UNLOCK(vp); +#ifdef MAC + mac_vnode_destroy(vp); +#endif + if (vp->v_pollinfo != NULL) { + destroy_vpollinfo(vp->v_pollinfo); + vp->v_pollinfo = NULL; + } +#ifdef INVARIANTS + /* XXX Elsewhere we detect an already freed vnode via NULL v_op. */ + vp->v_op = NULL; +#endif + vp->v_mountedhere = NULL; + vp->v_unpcb = NULL; + vp->v_rdev = NULL; + vp->v_fifoinfo = NULL; + vp->v_lasta = vp->v_clen = vp->v_cstart = vp->v_lastw = 0; + vp->v_iflag = 0; + vp->v_vflag = 0; + bo->bo_flag = 0; + uma_zfree(vnode_zone, vp); +} + /* * Delete from old mount point vnode list, if on one. */ @@ -3150,7 +3208,6 @@ vholdnz(struct vnode *vp) void _vdrop(struct vnode *vp, bool locked) { - struct bufobj *bo; struct mount *mp; if (locked) @@ -3220,57 +3277,7 @@ _vdrop(struct vnode *vp, bool locked) } return; } - /* - * The vnode has been marked for destruction, so free it. - * - * The vnode will be returned to the zone where it will - * normally remain until it is needed for another vnode. We - * need to cleanup (or verify that the cleanup has already - * been done) any residual data left from its current use - * so as not to contaminate the freshly allocated vnode. - */ - CTR2(KTR_VFS, "%s: destroying the vnode %p", __func__, vp); - atomic_subtract_long(&numvnodes, 1); - bo = &vp->v_bufobj; - VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, - ("cleaned vnode still on the free list.")); - VNASSERT(vp->v_data == NULL, vp, ("cleaned vnode isn't")); - VNASSERT(vp->v_holdcnt == 0, vp, ("Non-zero hold count")); - VNASSERT(vp->v_usecount == 0, vp, ("Non-zero use count")); - VNASSERT(vp->v_writecount == 0, vp, ("Non-zero write count")); - VNASSERT(bo->bo_numoutput == 0, vp, ("Clean vnode has pending I/O's")); - VNASSERT(bo->bo_clean.bv_cnt == 0, vp, ("cleanbufcnt not 0")); - VNASSERT(pctrie_is_empty(&bo->bo_clean.bv_root), vp, - ("clean blk trie not empty")); - VNASSERT(bo->bo_dirty.bv_cnt == 0, vp, ("dirtybufcnt not 0")); - VNASSERT(pctrie_is_empty(&bo->bo_dirty.bv_root), vp, - ("dirty blk trie not empty")); - VNASSERT(TAILQ_EMPTY(&vp->v_cache_dst), vp, ("vp has namecache dst")); - VNASSERT(LIST_EMPTY(&vp->v_cache_src), vp, ("vp has namecache src")); - VNASSERT(vp->v_cache_dd == NULL, vp, ("vp has namecache for ..")); - VNASSERT(TAILQ_EMPTY(&vp->v_rl.rl_waiters), vp, - ("Dangling rangelock waiters")); - VI_UNLOCK(vp); -#ifdef MAC - mac_vnode_destroy(vp); -#endif - if (vp->v_pollinfo != NULL) { - destroy_vpollinfo(vp->v_pollinfo); - vp->v_pollinfo = NULL; - } -#ifdef INVARIANTS - /* XXX Elsewhere we detect an already freed vnode via NULL v_op. */ - vp->v_op = NULL; -#endif - vp->v_mountedhere = NULL; - vp->v_unpcb = NULL; - vp->v_rdev = NULL; - vp->v_fifoinfo = NULL; - vp->v_lasta = vp->v_clen = vp->v_cstart = vp->v_lastw = 0; - vp->v_iflag = 0; - vp->v_vflag = 0; - bo->bo_flag = 0; - uma_zfree(vnode_zone, vp); + freevnode(vp); } /* From owner-svn-src-all@freebsd.org Sun Dec 8 21:12:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04B561BA53C; Sun, 8 Dec 2019 21:12:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47WJtn6LFrz3NZN; Sun, 8 Dec 2019 21:12:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D501084EE; Sun, 8 Dec 2019 21:12:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB8LCXbT042043; Sun, 8 Dec 2019 21:12:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB8LCXjN042042; Sun, 8 Dec 2019 21:12:33 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912082112.xB8LCXjN042042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 8 Dec 2019 21:12:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355535 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 355535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 21:12:34 -0000 Author: ian Date: Sun Dec 8 21:12:33 2019 New Revision: 355535 URL: https://svnweb.freebsd.org/changeset/base/355535 Log: Add a MODULE_DEPEND() for the gpioths driver. Also, note that the prior commit changed the sysctl format for the temperature from "I" to "IK", and correspondingly changed the units from integer degrees C to decikelvin. For access via sysctl(8) the output will be the same except that now decimal fractions will be shown when available. Modified: head/sys/dev/gpio/gpioths.c Modified: head/sys/dev/gpio/gpioths.c ============================================================================== --- head/sys/dev/gpio/gpioths.c Sun Dec 8 21:11:25 2019 (r355534) +++ head/sys/dev/gpio/gpioths.c Sun Dec 8 21:12:33 2019 (r355535) @@ -76,8 +76,6 @@ struct gpioths_softc { struct callout callout; }; -static devclass_t gpioths_devclass; - /* Prototypes */ static int gpioths_probe(device_t dev); static int gpioths_attach(device_t dev); @@ -376,5 +374,8 @@ static device_method_t gpioths_methods[] = { DEVMETHOD_END }; +static devclass_t gpioths_devclass; + DEFINE_CLASS_0(gpioths, gpioths_driver, gpioths_methods, sizeof(struct gpioths_softc)); DRIVER_MODULE(gpioths, gpiobus, gpioths_driver, gpioths_devclass, 0, 0); +MODULE_DEPEND(gpioths, gpiobus, 1, 1, 1); From owner-svn-src-all@freebsd.org Sun Dec 8 21:13:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C4DD1BA5EC; Sun, 8 Dec 2019 21:13:08 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47WJvR74VXz3Nj1; Sun, 8 Dec 2019 21:13:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE35C84F1; Sun, 8 Dec 2019 21:13:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB8LD7Jc042113; Sun, 8 Dec 2019 21:13:07 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB8LD7ql042112; Sun, 8 Dec 2019 21:13:07 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201912082113.xB8LD7ql042112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 8 Dec 2019 21:13:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355536 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 21:13:08 -0000 Author: mjg Date: Sun Dec 8 21:13:07 2019 New Revision: 355536 URL: https://svnweb.freebsd.org/changeset/base/355536 Log: vfs: clean up vputx a little 1. replace hand-rolled macros for operation type with enum 2. unlock the vnode in vput itself, there is no need to branch on it. existence of VPUTX_VPUT remains significant in that the inactive variant adds LK_NOWAIT to locking request. 3. remove the useless v_usecount assertion. few lines above the checks if v_usecount > 0 and leaves. should the value be negative, refcount would fail. 4. the CTR return vnode %p to the freelist is incorrect as vdrop may find the vnode with holdcnt > 1. if the like should exist, it should be moved there 5. no need to error = 0 for everyone Reviewed by: kib, jeff (previous version) Differential Revision: https://reviews.freebsd.org/D22718 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Dec 8 21:12:33 2019 (r355535) +++ head/sys/kern/vfs_subr.c Sun Dec 8 21:13:07 2019 (r355536) @@ -2968,9 +2968,7 @@ vrefcnt(struct vnode *vp) return (vp->v_usecount); } -#define VPUTX_VRELE 1 -#define VPUTX_VPUT 2 -#define VPUTX_VUNREF 3 +enum vputx_op { VPUTX_VRELE, VPUTX_VPUT, VPUTX_VUNREF }; /* * Decrement the use and hold counts for a vnode. @@ -2978,17 +2976,13 @@ vrefcnt(struct vnode *vp) * See an explanation near vget() as to why atomic operation is safe. */ static void -vputx(struct vnode *vp, int func) +vputx(struct vnode *vp, enum vputx_op func) { int error; KASSERT(vp != NULL, ("vputx: null vp")); if (func == VPUTX_VUNREF) ASSERT_VOP_LOCKED(vp, "vunref"); - else if (func == VPUTX_VPUT) - ASSERT_VOP_LOCKED(vp, "vput"); - else - KASSERT(func == VPUTX_VRELE, ("vputx: wrong func")); ASSERT_VI_UNLOCKED(vp, __func__); VNASSERT(vp->v_holdcnt > 0 && vp->v_usecount > 0, vp, ("%s: wrong ref counts", __func__)); @@ -2996,19 +2990,6 @@ vputx(struct vnode *vp, int func) CTR2(KTR_VFS, "%s: vp %p", __func__, vp); /* - * It is an invariant that all VOP_* calls operate on a held vnode. - * We may be only having an implicit hold stemming from our usecount, - * which we are about to release. If we unlock the vnode afterwards we - * open a time window where someone else dropped the last usecount and - * proceeded to free the vnode before our unlock finished. For this - * reason we unlock the vnode early. This is a little bit wasteful as - * it may be the vnode is exclusively locked and inactive processing is - * needed, in which case we are adding work. - */ - if (func == VPUTX_VPUT) - VOP_UNLOCK(vp, 0); - - /* * We want to hold the vnode until the inactive finishes to * prevent vgone() races. We drop the use count here and the * hold count below when we're done. @@ -3034,15 +3015,6 @@ vputx(struct vnode *vp, int func) return; } - error = 0; - - if (vp->v_usecount != 0) { - vn_printf(vp, "vputx: usecount not zero for vnode "); - panic("vputx: usecount not zero"); - } - - CTR2(KTR_VFS, "%s: return vnode %p to the freelist", __func__, vp); - /* * Check if the fs wants to perform inactive processing. Note we * may be only holding the interlock, in which case it is possible @@ -3071,6 +3043,7 @@ vputx(struct vnode *vp, int func) VI_LOCK(vp); break; case VPUTX_VUNREF: + error = 0; if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { error = VOP_LOCK(vp, LK_TRYUPGRADE | LK_INTERLOCK); VI_LOCK(vp); @@ -3103,11 +3076,21 @@ vrele(struct vnode *vp) * Release an already locked vnode. This give the same effects as * unlock+vrele(), but takes less time and avoids releasing and * re-aquiring the lock (as vrele() acquires the lock internally.) + * + * It is an invariant that all VOP_* calls operate on a held vnode. + * We may be only having an implicit hold stemming from our usecount, + * which we are about to release. If we unlock the vnode afterwards we + * open a time window where someone else dropped the last usecount and + * proceeded to free the vnode before our unlock finished. For this + * reason we unlock the vnode early. This is a little bit wasteful as + * it may be the vnode is exclusively locked and inactive processing is + * needed, in which case we are adding work. */ void vput(struct vnode *vp) { + VOP_UNLOCK(vp, 0); vputx(vp, VPUTX_VPUT); } From owner-svn-src-all@freebsd.org Sun Dec 8 21:30:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F2DD1BABAF; Sun, 8 Dec 2019 21:30:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47WKH90VFDz3PCn; Sun, 8 Dec 2019 21:30:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BDE586CD; Sun, 8 Dec 2019 21:30:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB8LUDIh048438; Sun, 8 Dec 2019 21:30:13 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB8LU5dv048397; Sun, 8 Dec 2019 21:30:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201912082130.xB8LU5dv048397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 8 Dec 2019 21:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355537 - in head: share/man/man9 sys/cam/ctl sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/beri/virtio sys/dev/md sys/dev/xen/blkback sys/fs/autofs sys/fs/cd9660 sys/fs/devfs ... X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head: share/man/man9 sys/cam/ctl sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/beri/virtio sys/dev/md sys/dev/xen/blkback sys/fs/autofs sys/fs/cd9660 sys/fs/devfs sys/fs/ext2fs sys/fs/fdes... X-SVN-Commit-Revision: 355537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 21:30:13 -0000 Author: mjg Date: Sun Dec 8 21:30:04 2019 New Revision: 355537 URL: https://svnweb.freebsd.org/changeset/base/355537 Log: vfs: introduce v_irflag and make v_type smaller The current vnode layout is not smp-friendly by having frequently read data avoidably sharing cachelines with very frequently modified fields. In particular v_iflag inspected for VI_DOOMED can be found in the same line with v_usecount. Instead make it available in the same cacheline as the v_op, v_data and v_type which all get read all the time. v_type is avoidably 4 bytes while the necessary data will easily fit in 1. Shrinking it frees up 3 bytes, 2 of which get used here to introduce a new flag field with a new value: VIRF_DOOMED. Reviewed by: kib, jeff Differential Revision: https://reviews.freebsd.org/D22715 Modified: head/share/man/man9/vgone.9 head/sys/cam/ctl/ctl_backend_block.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c head/sys/dev/beri/virtio/virtio_block.c head/sys/dev/md/md.c head/sys/dev/xen/blkback/blkback.c head/sys/fs/autofs/autofs_vnops.c head/sys/fs/cd9660/cd9660_vnops.c head/sys/fs/devfs/devfs_vnops.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/fdescfs/fdesc_vnops.c head/sys/fs/fuse/fuse_io.c head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdserv.c head/sys/fs/nfsserver/nfs_nfsdstate.c head/sys/fs/nullfs/null_subr.c head/sys/fs/nullfs/null_vfsops.c head/sys/fs/nullfs/null_vnops.c head/sys/fs/pseudofs/pseudofs_vnops.c head/sys/fs/smbfs/smbfs_io.c head/sys/fs/smbfs/smbfs_vnops.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/fs/unionfs/union_subr.c head/sys/kern/kern_lockf.c head/sys/kern/kern_shutdown.c head/sys/kern/tty.c head/sys/kern/vfs_cache.c head/sys/kern/vfs_default.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/sys/param.h head/sys/sys/vnode.h head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_rawread.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ufs/ufs_inode.c head/sys/ufs/ufs/ufs_lookup.c head/sys/vm/swap_pager.c head/sys/vm/vnode_pager.c Modified: head/share/man/man9/vgone.9 ============================================================================== --- head/share/man/man9/vgone.9 Sun Dec 8 21:13:07 2019 (r355536) +++ head/share/man/man9/vgone.9 Sun Dec 8 21:30:04 2019 (r355537) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2010 +.Dd December 8, 2019 .Dt VGONE 9 .Os .Sh NAME @@ -47,7 +47,7 @@ the removal from its mount point vnode list. If the vnode has a .Va v_usecount of zero, and its -.Dv VI_DOOMED +.Dv VIRF_DOOMED flag is not set, it is moved to the head of the free list as in most cases the vnode is about to be reused, or its file system is being unmounted. Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/cam/ctl/ctl_backend_block.c Sun Dec 8 21:30:04 2019 (r355537) @@ -843,7 +843,7 @@ ctl_be_block_getattr_file(struct ctl_be_block_lun *be_ val = vattr.va_bytes / be_lun->cbe_lun.blocksize; } if (strcmp(attrname, "blocksavail") == 0 && - (be_lun->vn->v_iflag & VI_DOOMED) == 0) { + !VN_IS_DOOMED(be_lun->vn)) { error = VFS_STATFS(be_lun->vn->v_mount, &statfs); if (error == 0) val = statfs.f_bavail * statfs.f_bsize / Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sun Dec 8 21:30:04 2019 (r355537) @@ -605,7 +605,7 @@ zfsctl_relock_dot(vnode_t *dvp, int ltype) vn_lock(dvp, LK_DOWNGRADE | LK_RETRY); /* Relock for the "." case may left us with reclaimed vnode. */ - if ((dvp->v_iflag & VI_DOOMED) != 0) { + if (VN_IS_DOOMED(dvp)) { vrele(dvp); return (SET_ERROR(ENOENT)); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Dec 8 21:30:04 2019 (r355537) @@ -1413,7 +1413,7 @@ zfs_lookup_lock(vnode_t *dvp, vnode_t *vp, const char * Relock for the "." case could leave us with * reclaimed vnode. */ - if (dvp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(dvp)) { vrele(dvp); return (SET_ERROR(ENOENT)); } @@ -5913,7 +5913,7 @@ zfs_vptocnp(struct vop_vptocnp_args *ap) vput(covered_vp); } vn_lock(vp, ltype | LK_RETRY); - if ((vp->v_iflag & VI_DOOMED) != 0) + if (VN_IS_DOOMED(vp)) error = SET_ERROR(ENOENT); return (error); } @@ -5936,7 +5936,7 @@ zfs_lock(ap) if (err == 0 && (ap->a_flags & LK_NOWAIT) == 0) { vp = ap->a_vp; zp = vp->v_data; - if (vp->v_mount != NULL && (vp->v_iflag & VI_DOOMED) == 0 && + if (vp->v_mount != NULL && !VN_IS_DOOMED(vp) && zp != NULL && (zp->z_pflags & ZFS_XATTR) == 0) VERIFY(!RRM_LOCK_HELD(&zp->z_zfsvfs->z_teardown_lock)); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Dec 8 21:30:04 2019 (r355537) @@ -1216,8 +1216,7 @@ again: locked = VOP_ISLOCKED(vp); VI_LOCK(vp); - if ((vp->v_iflag & VI_DOOMED) != 0 && - locked != LK_EXCLUSIVE) { + if (VN_IS_DOOMED(vp) && locked != LK_EXCLUSIVE) { /* * The vnode is doomed and this thread doesn't * hold the exclusive lock on it, so the vnode Modified: head/sys/dev/beri/virtio/virtio_block.c ============================================================================== --- head/sys/dev/beri/virtio/virtio_block.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/dev/beri/virtio/virtio_block.c Sun Dec 8 21:30:04 2019 (r355537) @@ -258,7 +258,7 @@ open_file(struct beri_vtblk_softc *sc, struct thread * if (VOP_ISLOCKED(nd.ni_vp) != LK_EXCLUSIVE) { vn_lock(nd.ni_vp, LK_UPGRADE | LK_RETRY); - if (nd.ni_vp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(nd.ni_vp)) { return (1); } } Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/dev/md/md.c Sun Dec 8 21:30:04 2019 (r355537) @@ -1453,7 +1453,7 @@ mdcreate_vnode(struct md_s *sc, struct md_req *mdr, st goto bad; if (VOP_ISLOCKED(nd.ni_vp) != LK_EXCLUSIVE) { vn_lock(nd.ni_vp, LK_UPGRADE | LK_RETRY); - if (nd.ni_vp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(nd.ni_vp)) { /* Forced unmount. */ error = EBADF; goto bad; Modified: head/sys/dev/xen/blkback/blkback.c ============================================================================== --- head/sys/dev/xen/blkback/blkback.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/dev/xen/blkback/blkback.c Sun Dec 8 21:30:04 2019 (r355537) @@ -2627,7 +2627,7 @@ xbb_open_file(struct xbb_softc *xbb) */ if (VOP_ISLOCKED(xbb->vn) != LK_EXCLUSIVE) { vn_lock(xbb->vn, LK_UPGRADE | LK_RETRY); - if (xbb->vn->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(xbb->vn)) { error = EBADF; xenbus_dev_fatal(xbb->dev, error, "error locking file %s", Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/autofs/autofs_vnops.c Sun Dec 8 21:30:04 2019 (r355537) @@ -169,8 +169,8 @@ mounted: sx_xunlock(&autofs_softc->sc_lock); vn_lock(vp, lock_flags | LK_RETRY); vunref(vp); - if ((vp->v_iflag & VI_DOOMED) != 0) { - AUTOFS_DEBUG("VI_DOOMED"); + if (VN_IS_DOOMED(vp)) { + AUTOFS_DEBUG("VIRF_DOOMED"); return (ENOENT); } @@ -661,7 +661,7 @@ autofs_node_vn(struct autofs_node *anp, struct mount * sx_xunlock(&anp->an_vnode_lock); return (error); } - if (vp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(vp)) { /* * We got forcibly unmounted. */ Modified: head/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vnops.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/cd9660/cd9660_vnops.c Sun Dec 8 21:30:04 2019 (r355537) @@ -260,7 +260,7 @@ cd9660_ioctl(ap) vp = ap->a_vp; vn_lock(vp, LK_SHARED | LK_RETRY); - if (vp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(vp)) { VOP_UNLOCK(vp, 0); return (EBADF); } Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/devfs/devfs_vnops.c Sun Dec 8 21:30:04 2019 (r355537) @@ -252,7 +252,7 @@ devfs_populate_vp(struct vnode *vp) devfs_unmount_final(dmp); return (ERESTART); } - if ((vp->v_iflag & VI_DOOMED) != 0) { + if (VN_IS_DOOMED(vp)) { sx_xunlock(&dmp->dm_lock); return (ERESTART); } @@ -441,7 +441,7 @@ loop: vput(vp); return (ENOENT); } - else if ((vp->v_iflag & VI_DOOMED) != 0) { + else if (VN_IS_DOOMED(vp)) { mtx_lock(&devfs_de_interlock); if (de->de_vnode == vp) { de->de_vnode = NULL; @@ -592,7 +592,7 @@ devfs_close(struct vop_close_args *ap) SESS_LOCK(p->p_session); VI_LOCK(vp); if (vp->v_usecount == 2 && vcount(vp) == 1 && - (vp->v_iflag & VI_DOOMED) == 0) { + !VN_IS_DOOMED(vp)) { p->p_session->s_ttyvp = NULL; p->p_session->s_ttydp = NULL; oldvp = vp; @@ -622,7 +622,7 @@ devfs_close(struct vop_close_args *ap) VI_LOCK(vp); if (vp->v_usecount == 1 && vcount(vp) == 1) dflags |= FLASTCLOSE; - if (vp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(vp)) { /* Forced close. */ dflags |= FREVOKE | FNONBLOCK; } else if (dsw->d_flags & D_TRACKCLOSE) { @@ -1562,7 +1562,7 @@ devfs_rioctl(struct vop_ioctl_args *ap) vp = ap->a_vp; vn_lock(vp, LK_SHARED | LK_RETRY); - if (vp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(vp)) { VOP_UNLOCK(vp, 0); return (EBADF); } Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/ext2fs/ext2_lookup.c Sun Dec 8 21:30:04 2019 (r355537) @@ -665,7 +665,7 @@ found: pdp = vdp; if (flags & ISDOTDOT) { error = vn_vget_ino(pdp, ino, cnp->cn_lkflags, &tdp); - if (pdp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(pdp)) { if (error == 0) vput(tdp); error = ENOENT; Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/fdescfs/fdesc_vnops.c Sun Dec 8 21:30:04 2019 (r355537) @@ -347,7 +347,7 @@ fdesc_lookup(struct vop_lookup_args *ap) vn_lock(dvp, LK_RETRY | LK_EXCLUSIVE); vdrop(dvp); fvp = dvp; - if ((dvp->v_iflag & VI_DOOMED) != 0) + if (VN_IS_DOOMED(dvp)) error = ENOENT; } else { /* Modified: head/sys/fs/fuse/fuse_io.c ============================================================================== --- head/sys/fs/fuse/fuse_io.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/fuse/fuse_io.c Sun Dec 8 21:30:04 2019 (r355537) @@ -1116,7 +1116,7 @@ fuse_io_invalbuf(struct vnode *vp, struct thread *td) struct fuse_vnode_data *fvdat = VTOFUD(vp); int error = 0; - if (vp->v_iflag & VI_DOOMED) + if (VN_IS_DOOMED(vp)) return 0; ASSERT_VOP_ELOCKED(vp, "fuse_io_invalbuf"); Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/nfsclient/nfs_clport.c Sun Dec 8 21:30:04 2019 (r355537) @@ -149,13 +149,13 @@ nfscl_nget(struct mount *mntp, struct vnode *dvp, stru * get called on this vnode between when NFSVOPLOCK() drops * the VI_LOCK() and vget() acquires it again, so that it * hasn't yet had v_usecount incremented. If this were to - * happen, the VI_DOOMED flag would be set, so check for + * happen, the VIRF_DOOMED flag would be set, so check for * that here. Since we now have the v_usecount incremented, - * we should be ok until we vrele() it, if the VI_DOOMED + * we should be ok until we vrele() it, if the VIRF_DOOMED * flag isn't set now. */ VI_LOCK(nvp); - if ((nvp->v_iflag & VI_DOOMED)) { + if (VN_IS_DOOMED(nvp)) { VI_UNLOCK(nvp); vrele(nvp); error = ENOENT; @@ -350,7 +350,7 @@ nfscl_ngetreopen(struct mount *mntp, u_int8_t *fhp, in vfs_hash_ref(mntp, hash, td, &nvp, newnfs_vncmpf, nfhp); if (nvp == NULL) { error = ENOENT; - } else if ((nvp->v_iflag & VI_DOOMED) != 0) { + } else if (VN_IS_DOOMED(nvp)) { error = ENOENT; vrele(nvp); } else { Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/nfsclient/nfs_clvnops.c Sun Dec 8 21:30:04 2019 (r355537) @@ -1235,7 +1235,7 @@ nfs_lookup(struct vop_lookup_args *ap) vrele(newvp); *vpp = NULLVP; } else if (error == ENOENT) { - if (dvp->v_iflag & VI_DOOMED) + if (VN_IS_DOOMED(dvp)) return (ENOENT); /* * We only accept a negative hit in the cache if the @@ -1340,7 +1340,7 @@ nfs_lookup(struct vop_lookup_args *ap) error = vfs_busy(mp, 0); NFSVOPLOCK(dvp, ltype | LK_RETRY); vfs_rel(mp); - if (error == 0 && (dvp->v_iflag & VI_DOOMED)) { + if (error == 0 && VN_IS_DOOMED(dvp)) { vfs_unbusy(mp); error = ENOENT; } @@ -1355,7 +1355,7 @@ nfs_lookup(struct vop_lookup_args *ap) vfs_unbusy(mp); if (newvp != dvp) NFSVOPLOCK(dvp, ltype | LK_RETRY); - if (dvp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(dvp)) { if (error == 0) { if (newvp == dvp) vrele(newvp); @@ -3139,7 +3139,7 @@ nfs_advlock(struct vop_advlock_args *ap) else cred = td->td_ucred; NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); - if (vp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(vp)) { error = EBADF; goto out; } @@ -3169,7 +3169,7 @@ nfs_advlock(struct vop_advlock_args *ap) if (error) return (EINTR); NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); - if (vp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(vp)) { error = EBADF; goto out; } Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sun Dec 8 21:30:04 2019 (r355537) @@ -1457,7 +1457,7 @@ nfsvno_link(struct nameidata *ndp, struct vnode *vp, s } if (!error) { NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); - if ((vp->v_iflag & VI_DOOMED) == 0) + if (!VN_IS_DOOMED(vp)) error = VOP_LINK(ndp->ni_dvp, vp, &ndp->ni_cnd); else error = EPERM; @@ -1738,7 +1738,7 @@ nfsvno_open(struct nfsrv_descript *nd, struct nameidat * Updates the file rev and sets the mtime and ctime * to the current clock time, returning the va_filerev and va_Xtime * values. - * Return ESTALE to indicate the vnode is VI_DOOMED. + * Return ESTALE to indicate the vnode is VIRF_DOOMED. */ int nfsvno_updfilerev(struct vnode *vp, struct nfsvattr *nvap, @@ -1750,7 +1750,7 @@ nfsvno_updfilerev(struct vnode *vp, struct nfsvattr *n vfs_timestamp(&va.va_mtime); if (NFSVOPISLOCKED(vp) != LK_EXCLUSIVE) { NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); - if ((vp->v_iflag & VI_DOOMED) != 0) + if (VN_IS_DOOMED(vp)) return (ESTALE); } (void) VOP_SETATTR(vp, &va, nd->nd_cred); Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Sun Dec 8 21:30:04 2019 (r355537) @@ -3024,7 +3024,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int is } vp = dp; NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); - if ((vp->v_iflag & VI_DOOMED) == 0) + if (!VN_IS_DOOMED(vp)) nd->nd_repstat = nfsrv_opencheck(clientid, &stateid, stp, vp, nd, p, nd->nd_repstat); else Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Dec 8 21:30:04 2019 (r355537) @@ -2159,7 +2159,7 @@ tryagain: NFSUNLOCKSTATE(); NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); vnode_unlocked = 0; - if ((vp->v_iflag & VI_DOOMED) != 0) + if (VN_IS_DOOMED(vp)) ret = NFSERR_SERVERFAULT; NFSLOCKSTATE(); } @@ -2257,7 +2257,7 @@ tryagain: NFSUNLOCKSTATE(); NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); vnode_unlocked = 0; - if ((vp->v_iflag & VI_DOOMED) != 0) { + if (VN_IS_DOOMED(vp)) { error = NFSERR_SERVERFAULT; goto out; } @@ -2379,7 +2379,7 @@ out: } if (vnode_unlocked != 0) { NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) + if (error == 0 && VN_IS_DOOMED(vp)) error = NFSERR_SERVERFAULT; } if (other_lop) @@ -5133,7 +5133,7 @@ nfsrv_checkstable(struct nfsclient *clp) * Return 0 to indicate the conflict can't be revoked and 1 to indicate * the revocation worked and the conflicting client is "bye, bye", so it * can be tried again. - * Return 2 to indicate that the vnode is VI_DOOMED after NFSVOPLOCK(). + * Return 2 to indicate that the vnode is VIRF_DOOMED after NFSVOPLOCK(). * Unlocks State before a non-zero value is returned. */ static int @@ -5164,7 +5164,7 @@ nfsrv_clientconflict(struct nfsclient *clp, int *haslo *haslockp = 1; if (vp != NULL) { NFSVOPLOCK(vp, lktype | LK_RETRY); - if ((vp->v_iflag & VI_DOOMED) != 0) + if (VN_IS_DOOMED(vp)) return (2); } return (1); @@ -5339,7 +5339,7 @@ nfsrv_delegconflict(struct nfsstate *stp, int *haslock *haslockp = 1; if (vp != NULL) { NFSVOPLOCK(vp, lktype | LK_RETRY); - if ((vp->v_iflag & VI_DOOMED) != 0) { + if (VN_IS_DOOMED(vp)) { *haslockp = 0; NFSLOCKV4ROOTMUTEX(); nfsv4_unlock(&nfsv4rootfs_lock, 1); @@ -8313,7 +8313,7 @@ tryagain2: * changed until the copy is complete. */ NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); - if (ret == 0 && (vp->v_iflag & VI_DOOMED) != 0) { + if (ret == 0 && VN_IS_DOOMED(vp)) { NFSD_DEBUG(4, "nfsrv_copymr: lk_exclusive doomed\n"); ret = ESTALE; } Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/nullfs/null_subr.c Sun Dec 8 21:30:04 2019 (r355537) @@ -225,7 +225,7 @@ null_nodeget(mp, lowervp, vpp) */ if (VOP_ISLOCKED(lowervp) != LK_EXCLUSIVE) { vn_lock(lowervp, LK_UPGRADE | LK_RETRY); - if ((lowervp->v_iflag & VI_DOOMED) != 0) { + if (VN_IS_DOOMED(lowervp)) { vput(lowervp); return (ENOENT); } Modified: head/sys/fs/nullfs/null_vfsops.c ============================================================================== --- head/sys/fs/nullfs/null_vfsops.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/nullfs/null_vfsops.c Sun Dec 8 21:30:04 2019 (r355537) @@ -442,7 +442,7 @@ nullfs_unlink_lowervp(struct mount *mp, struct vnode * * extra unlock before allowing the final vdrop() to * free the vnode. */ - KASSERT((vp->v_iflag & VI_DOOMED) != 0, + KASSERT(VN_IS_DOOMED(vp), ("not reclaimed nullfs vnode %p", vp)); VOP_UNLOCK(vp, 0); } else { @@ -453,7 +453,7 @@ nullfs_unlink_lowervp(struct mount *mp, struct vnode * * relevant for future reclamations. */ ASSERT_VOP_ELOCKED(vp, "unlink_lowervp"); - KASSERT((vp->v_iflag & VI_DOOMED) == 0, + KASSERT(!VN_IS_DOOMED(vp), ("reclaimed nullfs vnode %p", vp)); xp->null_flags &= ~NULLV_NOUNLOCK; } Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/nullfs/null_vnops.c Sun Dec 8 21:30:04 2019 (r355537) @@ -396,7 +396,7 @@ null_lookup(struct vop_lookup_args *ap) * doomed state and return error. */ if ((error == 0 || error == EJUSTRETURN) && - (dvp->v_iflag & VI_DOOMED) != 0) { + VN_IS_DOOMED(dvp)) { error = ENOENT; if (lvp != NULL) vput(lvp); Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Sun Dec 8 21:30:04 2019 (r355537) @@ -290,7 +290,7 @@ pfs_ioctl(struct vop_ioctl_args *va) vn = va->a_vp; vn_lock(vn, LK_SHARED | LK_RETRY); - if (vn->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(vn)) { VOP_UNLOCK(vn, 0); return (EBADF); } @@ -512,7 +512,7 @@ pfs_lookup(struct vop_cachedlookup_args *va) vfs_rel(mp); if (error != 0) PFS_RETURN(ENOENT); - if (vn->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(vn)) { vfs_unbusy(mp); PFS_RETURN(ENOENT); } @@ -581,13 +581,13 @@ pfs_lookup(struct vop_cachedlookup_args *va) if (cnp->cn_flags & ISDOTDOT) { vfs_unbusy(mp); vn_lock(vn, LK_EXCLUSIVE | LK_RETRY); - if (vn->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(vn)) { vput(*vpp); *vpp = NULL; PFS_RETURN(ENOENT); } } - if (cnp->cn_flags & MAKEENTRY && !(vn->v_iflag & VI_DOOMED)) + if (cnp->cn_flags & MAKEENTRY && !VN_IS_DOOMED(vn)) cache_enter(vn, *vpp, cnp); PFS_RETURN (0); failed: Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/smbfs/smbfs_io.c Sun Dec 8 21:30:04 2019 (r355537) @@ -637,7 +637,7 @@ smbfs_vinvalbuf(struct vnode *vp, struct thread *td) struct smbnode *np = VTOSMB(vp); int error = 0; - if (vp->v_iflag & VI_DOOMED) + if (VN_IS_DOOMED(vp)) return 0; while (np->n_flag & NFLUSHINPROG) { Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/smbfs/smbfs_vnops.c Sun Dec 8 21:30:04 2019 (r355537) @@ -1345,7 +1345,7 @@ smbfs_lookup(ap) error = ENOENT; goto out; } - if ((dvp->v_iflag & VI_DOOMED) != 0) { + if (VN_IS_DOOMED(dvp)) { vfs_unbusy(mp); error = ENOENT; goto out; @@ -1355,7 +1355,7 @@ smbfs_lookup(ap) error = smbfs_nget(mp, dvp, name, nmlen, NULL, &vp); vfs_unbusy(mp); vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); - if ((dvp->v_iflag & VI_DOOMED) != 0) { + if (VN_IS_DOOMED(dvp)) { if (error == 0) vput(vp); error = ENOENT; Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sun Dec 8 21:30:04 2019 (r355537) @@ -598,15 +598,15 @@ loop: MPASS((node->tn_vpstate & TMPFS_VNODE_DOOMED) == 0); VI_LOCK(vp); if ((node->tn_type == VDIR && node->tn_dir.tn_parent == NULL) || - ((vp->v_iflag & VI_DOOMED) != 0 && - (lkflag & LK_NOWAIT) != 0)) { + (VN_IS_DOOMED(vp) && + (lkflag & LK_NOWAIT) != 0)) { VI_UNLOCK(vp); TMPFS_NODE_UNLOCK(node); error = ENOENT; vp = NULL; goto out; } - if ((vp->v_iflag & VI_DOOMED) != 0) { + if (VN_IS_DOOMED(vp)) { VI_UNLOCK(vp); node->tn_vpstate |= TMPFS_VNODE_WRECLAIM; while ((node->tn_vpstate & TMPFS_VNODE_WRECLAIM) != 0) { Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sun Dec 8 21:30:04 2019 (r355537) @@ -1578,7 +1578,7 @@ restart: tmpfs_free_node(tm, tnp); return (0); } - if ((vp->v_iflag & VI_DOOMED) != 0) { + if (VN_IS_DOOMED(vp)) { tmpfs_free_node(tm, tnp); return (ENOENT); } Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/fs/unionfs/union_subr.c Sun Dec 8 21:30:04 2019 (r355537) @@ -127,7 +127,8 @@ unionfs_get_cached_vnode(struct vnode *uvp, struct vno VI_LOCK_FLAGS(vp, MTX_DUPOK); VI_UNLOCK(dvp); vp->v_iflag &= ~VI_OWEINACT; - if ((vp->v_iflag & (VI_DOOMED | VI_DOINGINACT)) != 0) { + if (VN_IS_DOOMED(vp) || + ((vp->v_iflag & VI_DOINGINACT) != 0)) { VI_UNLOCK(vp); vp = NULLVP; } else @@ -163,7 +164,8 @@ unionfs_ins_cached_vnode(struct unionfs_node *uncp, vp = UNIONFSTOV(unp); VI_LOCK_FLAGS(vp, MTX_DUPOK); vp->v_iflag &= ~VI_OWEINACT; - if ((vp->v_iflag & (VI_DOOMED | VI_DOINGINACT)) != 0) { + if (VN_IS_DOOMED(vp) || + ((vp->v_iflag & VI_DOINGINACT) != 0)) { LIST_INSERT_HEAD(hd, uncp, un_hash); VI_UNLOCK(vp); vp = NULLVP; Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/kern/kern_lockf.c Sun Dec 8 21:30:04 2019 (r355537) @@ -592,7 +592,7 @@ retry_setlock: * the vnode interlock. */ VI_LOCK(vp); - if (vp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(vp)) { VI_UNLOCK(vp); lf_free_lock(lock); return (ENOENT); @@ -622,7 +622,7 @@ retry_setlock: * trying to allocate memory. */ VI_LOCK(vp); - if (vp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(vp)) { VI_UNLOCK(vp); sx_xlock(&lf_lock_states_lock); LIST_REMOVE(ls, ls_link); @@ -655,10 +655,10 @@ retry_setlock: /* * Recheck the doomed vnode after state->ls_lock is * locked. lf_purgelocks() requires that no new threads add - * pending locks when vnode is marked by VI_DOOMED flag. + * pending locks when vnode is marked by VIRF_DOOMED flag. */ VI_LOCK(vp); - if (vp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(vp)) { state->ls_threads--; wakeup(state); VI_UNLOCK(vp); @@ -771,12 +771,12 @@ lf_purgelocks(struct vnode *vp, struct lockf **statep) /* * For this to work correctly, the caller must ensure that no * other threads enter the locking system for this vnode, - * e.g. by checking VI_DOOMED. We wake up any threads that are + * e.g. by checking VIRF_DOOMED. We wake up any threads that are * sleeping waiting for locks on this vnode and then free all * the remaining locks. */ VI_LOCK(vp); - KASSERT(vp->v_iflag & VI_DOOMED, + KASSERT(VN_IS_DOOMED(vp), ("lf_purgelocks: vp %p has not vgone yet", vp)); state = *statep; if (state == NULL) { Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/kern/kern_shutdown.c Sun Dec 8 21:30:04 2019 (r355537) @@ -518,7 +518,7 @@ kern_reroot(void) VOP_UNLOCK(vp, 0); return (ENOENT); } - if (vp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(vp)) { VOP_UNLOCK(vp, 0); vfs_unbusy(mp); return (ENOENT); Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/kern/tty.c Sun Dec 8 21:30:04 2019 (r355537) @@ -1250,9 +1250,9 @@ tty_drop_ctty(struct tty *tp, struct proc *p) * If we did have a vnode, release our reference. Ordinarily we manage * these at the devfs layer, but we can't necessarily know that we were * invoked on the vnode referenced in the session (i.e. the vnode we - * hold a reference to). We explicitly don't check VBAD/VI_DOOMED here + * hold a reference to). We explicitly don't check VBAD/VIRF_DOOMED here * to avoid a vnode leak -- in circumstances elsewhere where we'd hit a - * VI_DOOMED vnode, release has been deferred until the controlling TTY + * VIRF_DOOMED vnode, release has been deferred until the controlling TTY * is either changed or released. */ if (vp != NULL) Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/kern/vfs_cache.c Sun Dec 8 21:30:04 2019 (r355537) @@ -1158,7 +1158,7 @@ cache_lookup_dot(struct vnode *dvp, struct vnode **vpp if (ltype != VOP_ISLOCKED(*vpp)) { if (ltype == LK_EXCLUSIVE) { vn_lock(*vpp, LK_UPGRADE | LK_RETRY); - if ((*vpp)->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED((*vpp))) { /* forced unmount */ vrele(*vpp); *vpp = NULL; @@ -1401,7 +1401,7 @@ success: error = vget_finish(*vpp, cnp->cn_lkflags, vs); if (cnp->cn_flags & ISDOTDOT) { vn_lock(dvp, ltype | LK_RETRY); - if (dvp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(dvp)) { if (error == 0) vput(*vpp); *vpp = NULL; @@ -1706,9 +1706,9 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, u_long lnumcache; CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr); - VNASSERT(vp == NULL || (vp->v_iflag & VI_DOOMED) == 0, vp, + VNASSERT(vp == NULL || !VN_IS_DOOMED(vp), vp, ("cache_enter: Adding a doomed vnode")); - VNASSERT(dvp == NULL || (dvp->v_iflag & VI_DOOMED) == 0, dvp, + VNASSERT(dvp == NULL || !VN_IS_DOOMED(dvp), dvp, ("cache_enter: Doomed vnode used as src")); #ifdef DEBUG_CACHE @@ -2365,7 +2365,7 @@ vn_vptocnp(struct vnode **vp, struct ucred *cred, char } *vp = dvp; - if (dvp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(dvp)) { /* forced unmount */ vrele(dvp); error = ENOENT; @@ -2429,7 +2429,7 @@ vn_fullpath1(struct thread *td, struct vnode *vp, stru * mnt_vnodecovered can be NULL only for the * case of unmount. */ - if ((vp->v_iflag & VI_DOOMED) != 0 || + if (VN_IS_DOOMED(vp) || (vp1 = vp->v_mount->mnt_vnodecovered) == NULL || vp1->v_mountedhere != vp->v_mount) { vput(vp); Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/kern/vfs_default.c Sun Dec 8 21:30:04 2019 (r355537) @@ -594,7 +594,7 @@ vop_stdgetwritemount(ap) * Note that having a reference does not prevent forced unmount from * setting ->v_mount to NULL after the lock gets released. This is of * no consequence for typical consumers (most notably vn_start_write) - * since in this case the vnode is VI_DOOMED. Unmount might have + * since in this case the vnode is VIRF_DOOMED. Unmount might have * progressed far enough that its completion is only delayed by the * reference obtained here. The consumer only needs to concern itself * with releasing it. @@ -1019,7 +1019,7 @@ vop_stdadvise(struct vop_advise_args *ap) case POSIX_FADV_DONTNEED: error = 0; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - if (vp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(vp)) { VOP_UNLOCK(vp, 0); break; } Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/kern/vfs_lookup.c Sun Dec 8 21:30:04 2019 (r355537) @@ -867,7 +867,7 @@ dirloop: } if ((dp->v_vflag & VV_ROOT) == 0) break; - if (dp->v_iflag & VI_DOOMED) { /* forced unmount */ + if (VN_IS_DOOMED(dp)) { /* forced unmount */ error = ENOENT; goto bad; } @@ -911,7 +911,7 @@ unionlookup: if ((cnp->cn_flags & LOCKPARENT) && (cnp->cn_flags & ISLASTCN) && dp != vp_crossmp && VOP_ISLOCKED(dp) == LK_SHARED) vn_lock(dp, LK_UPGRADE|LK_RETRY); - if ((dp->v_iflag & VI_DOOMED) != 0) { + if (VN_IS_DOOMED(dp)) { error = ENOENT; goto bad; } @@ -1028,7 +1028,7 @@ good: ((cnp->cn_flags & FOLLOW) || (cnp->cn_flags & TRAILINGSLASH) || *ndp->ni_next == '/')) { cnp->cn_flags |= ISSYMLINK; - if (dp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(dp)) { /* * We can't know whether the directory was mounted with * NOSYMFOLLOW, so we can't follow safely. @@ -1135,7 +1135,7 @@ success: if (needs_exclusive_leaf(dp->v_mount, cnp->cn_flags) && VOP_ISLOCKED(dp) != LK_EXCLUSIVE) { vn_lock(dp, LK_UPGRADE | LK_RETRY); - if (dp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(dp)) { error = ENOENT; goto bad2; } Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/kern/vfs_subr.c Sun Dec 8 21:30:04 2019 (r355537) @@ -137,7 +137,7 @@ static int v_inval_buf_range_locked(struct vnode *vp, /* * Number of vnodes in existence. Increased whenever getnewvnode() - * allocates a new vnode, decreased in vdropl() for VI_DOOMED vnode. + * allocates a new vnode, decreased in vdropl() for VIRF_DOOMED vnode. */ static unsigned long numvnodes; @@ -367,7 +367,7 @@ sysctl_try_reclaim_vnode(SYSCTL_HANDLER_ARGS) goto out; vp = nd.ni_vp; - if ((vp->v_iflag & VI_DOOMED) != 0) { + if (VN_IS_DOOMED(vp)) { /* * This vnode is being recycled. Return != 0 to let the caller * know that the sysctl had no effect. Return EAGAIN because a @@ -1033,7 +1033,7 @@ vlrureclaim(struct mount *mp, bool reclaim_nc_src, int if (vp->v_usecount || (!reclaim_nc_src && !LIST_EMPTY(&vp->v_cache_src)) || ((vp->v_iflag & VI_FREE) != 0) || - (vp->v_iflag & VI_DOOMED) != 0 || (vp->v_object != NULL && + VN_IS_DOOMED(vp) || (vp->v_object != NULL && vp->v_object->resident_page_count > trigger)) { VI_UNLOCK(vp); goto next_iter; @@ -1049,7 +1049,7 @@ vlrureclaim(struct mount *mp, bool reclaim_nc_src, int * v_usecount may have been bumped after VOP_LOCK() dropped * the vnode interlock and before it was locked again. * - * It is not necessary to recheck VI_DOOMED because it can + * It is not necessary to recheck VIRF_DOOMED because it can * only be set by another thread that holds both the vnode * lock and vnode interlock. If another thread has the * vnode lock before we get to VOP_LOCK() and obtains the @@ -1066,8 +1066,8 @@ vlrureclaim(struct mount *mp, bool reclaim_nc_src, int vdropl(vp); goto next_iter_mntunlocked; } - KASSERT((vp->v_iflag & VI_DOOMED) == 0, - ("VI_DOOMED unexpectedly detected in vlrureclaim()")); + KASSERT(!VN_IS_DOOMED(vp), + ("VIRF_DOOMED unexpectedly detected in vlrureclaim()")); counter_u64_add(recycles_count, 1); vgonel(vp); VOP_UNLOCK(vp, 0); @@ -1436,7 +1436,7 @@ vtryrecycle(struct vnode *vp) __func__, vp); return (EBUSY); } - if ((vp->v_iflag & VI_DOOMED) == 0) { + if (!VN_IS_DOOMED(vp)) { counter_u64_add(recycles_count, 1); vgonel(vp); } @@ -1715,6 +1715,7 @@ freevnode(struct vnode *vp) vp->v_rdev = NULL; vp->v_fifoinfo = NULL; vp->v_lasta = vp->v_clen = vp->v_cstart = vp->v_lastw = 0; + vp->v_irflag = 0; vp->v_iflag = 0; vp->v_vflag = 0; bo->bo_flag = 0; @@ -2752,7 +2753,7 @@ v_decr_devcount(struct vnode *vp) /* * Grab a particular vnode from the free list, increment its - * reference count and lock it. VI_DOOMED is set if the vnode + * reference count and lock it. VIRF_DOOMED is set if the vnode * is being destroyed. Only callers who specify LK_RETRY will * see doomed vnodes. If inactive processing was delayed in * vput try to do it here. @@ -3022,7 +3023,7 @@ vputx(struct vnode *vp, enum vputx_op func) * Since vgone performs inactive on its own there is nothing to do * here but to drop our hold count. */ - if (__predict_false(vp->v_iflag & VI_DOOMED) || + if (__predict_false(VN_IS_DOOMED(vp)) || VOP_NEED_INACTIVE(vp) == 0) { vdropl(vp); return; @@ -3182,7 +3183,7 @@ vholdnz(struct vnode *vp) /* * Drop the hold count of the vnode. If this is the last reference to * the vnode we place it on the free list unless it has been vgone'd - * (marked VI_DOOMED) in which case we will free it. + * (marked VIRF_DOOMED) in which case we will free it. * * Because the vnode vm object keeps a hold reference on the vnode if * there is at least one resident non-cached page, the vnode cannot @@ -3211,7 +3212,7 @@ _vdrop(struct vnode *vp, bool locked) VI_UNLOCK(vp); return; } - if ((vp->v_iflag & VI_DOOMED) == 0) { + if (!VN_IS_DOOMED(vp)) { /* * Mark a vnode as free: remove it from its active list * and put it up for recycling on the freelist. @@ -3572,9 +3573,9 @@ vgonel(struct vnode *vp) /* * Don't vgonel if we're already doomed. */ - if (vp->v_iflag & VI_DOOMED) + if (vp->v_irflag & VIRF_DOOMED) return; - vp->v_iflag |= VI_DOOMED; + vp->v_irflag |= VIRF_DOOMED; /* * Check to see if the vnode is in use. If so, we have to call @@ -3723,6 +3724,13 @@ vn_printf(struct vnode *vp, const char *fmt, ...) } buf[0] = '\0'; buf[1] = '\0'; + if (vp->v_irflag & VIRF_DOOMED) + strlcat(buf, "|VIRF_DOOMED", sizeof(buf)); + flags = vp->v_irflag & ~(VIRF_DOOMED); + if (flags != 0) { + snprintf(buf2, sizeof(buf2), "|VIRF(0x%lx)", flags); + strlcat(buf, buf2, sizeof(buf)); + } if (vp->v_vflag & VV_ROOT) strlcat(buf, "|VV_ROOT", sizeof(buf)); if (vp->v_vflag & VV_ISTTY) @@ -3762,8 +3770,6 @@ vn_printf(struct vnode *vp, const char *fmt, ...) strlcat(buf, "|VI_TEXT_REF", sizeof(buf)); if (vp->v_iflag & VI_MOUNT) strlcat(buf, "|VI_MOUNT", sizeof(buf)); - if (vp->v_iflag & VI_DOOMED) - strlcat(buf, "|VI_DOOMED", sizeof(buf)); if (vp->v_iflag & VI_FREE) strlcat(buf, "|VI_FREE", sizeof(buf)); if (vp->v_iflag & VI_ACTIVE) @@ -3772,8 +3778,8 @@ vn_printf(struct vnode *vp, const char *fmt, ...) strlcat(buf, "|VI_DOINGINACT", sizeof(buf)); if (vp->v_iflag & VI_OWEINACT) strlcat(buf, "|VI_OWEINACT", sizeof(buf)); - flags = vp->v_iflag & ~(VI_TEXT_REF | VI_MOUNT | VI_DOOMED | VI_FREE | - VI_ACTIVE | VI_DOINGINACT | VI_OWEINACT); + flags = vp->v_iflag & ~(VI_TEXT_REF | VI_MOUNT | VI_FREE | VI_ACTIVE | + VI_DOINGINACT | VI_OWEINACT); if (flags != 0) { snprintf(buf2, sizeof(buf2), "|VI(0x%lx)", flags); strlcat(buf, buf2, sizeof(buf)); @@ -5198,7 +5204,7 @@ vop_close_post(void *ap, int rc) struct vop_close_args *a = ap; if (!rc && (a->a_cred != NOCRED || /* filter out revokes */ - (a->a_vp->v_iflag & VI_DOOMED) == 0)) { + !VN_IS_DOOMED(a->a_vp))) { VFS_KNOTE_LOCKED(a->a_vp, (a->a_fflag & FWRITE) != 0 ? NOTE_CLOSE_WRITE : NOTE_CLOSE); } @@ -5667,7 +5673,7 @@ restart: MNT_ILOCK(mp); vp = mp->mnt_rootvnode; if (vp != NULL) { - if ((vp->v_iflag & VI_DOOMED) == 0) { + if (!VN_IS_DOOMED(vp)) { vrefact(vp); MNT_IUNLOCK(mp); error = vn_lock(vp, flags); @@ -5707,7 +5713,7 @@ restart: mp->mnt_rootvnode = *vpp; } else { if (mp->mnt_rootvnode != *vpp) { - if ((mp->mnt_rootvnode->v_iflag & VI_DOOMED) == 0) { + if (!VN_IS_DOOMED(mp->mnt_rootvnode)) { panic("%s: mismatch between vnode returned " " by VFS_CACHEDROOT and the one cached " " (%p != %p)", @@ -5729,7 +5735,7 @@ vfs_cache_root(struct mount *mp, int flags, struct vno if (!vfs_op_thread_enter(mp)) return (vfs_cache_root_fallback(mp, flags, vpp)); vp = (struct vnode *)atomic_load_ptr(&mp->mnt_rootvnode); - if (vp == NULL || (vp->v_iflag & VI_DOOMED)) { + if (vp == NULL || VN_IS_DOOMED(vp)) { vfs_op_thread_exit(mp); return (vfs_cache_root_fallback(mp, flags, vpp)); } @@ -5787,11 +5793,11 @@ __mnt_vnode_next_all(struct vnode **mvp, struct mount KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); for (vp = TAILQ_NEXT(*mvp, v_nmntvnodes); vp != NULL; vp = TAILQ_NEXT(vp, v_nmntvnodes)) { - /* Allow a racy peek at VI_DOOMED to save a lock acquisition. */ - if (vp->v_type == VMARKER || (vp->v_iflag & VI_DOOMED) != 0) + /* Allow a racy peek at VIRF_DOOMED to save a lock acquisition. */ + if (vp->v_type == VMARKER || VN_IS_DOOMED(vp)) continue; VI_LOCK(vp); - if ((vp->v_iflag & VI_DOOMED) != 0) { + if (VN_IS_DOOMED(vp)) { VI_UNLOCK(vp); continue; } @@ -5821,11 +5827,11 @@ __mnt_vnode_first_all(struct vnode **mvp, struct mount (*mvp)->v_type = VMARKER; TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) { - /* Allow a racy peek at VI_DOOMED to save a lock acquisition. */ - if (vp->v_type == VMARKER || (vp->v_iflag & VI_DOOMED) != 0) + /* Allow a racy peek at VIRF_DOOMED to save a lock acquisition. */ + if (vp->v_type == VMARKER || VN_IS_DOOMED(vp)) continue; VI_LOCK(vp); - if ((vp->v_iflag & VI_DOOMED) != 0) { + if (VN_IS_DOOMED(vp)) { VI_UNLOCK(vp); continue; } @@ -5982,7 +5988,7 @@ restart: KASSERT(vp->v_type != VMARKER, ("locked marker %p", vp)); KASSERT(vp->v_mount == mp || vp->v_mount == NULL, ("alien vnode on the active list %p %p", vp, mp)); - if (vp->v_mount == mp && (vp->v_iflag & VI_DOOMED) == 0) + if (vp->v_mount == mp && !VN_IS_DOOMED(vp)) break; nvp = TAILQ_NEXT(vp, v_actfreelist); VI_UNLOCK(vp); Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/kern/vfs_syscalls.c Sun Dec 8 21:30:04 2019 (r355537) @@ -1820,7 +1820,7 @@ restart: sb.st_ino != oldinum) { error = EIDRM; /* Identifier removed */ } else if (fp != NULL && fp->f_vnode != vp) { - if ((fp->f_vnode->v_iflag & VI_DOOMED) != 0) + if (VN_IS_DOOMED(fp->f_vnode)) error = EBADF; else error = EDEADLK; @@ -3779,7 +3779,7 @@ restart: } if (fp != NULL && fp->f_vnode != vp) { - if ((fp->f_vnode->v_iflag & VI_DOOMED) != 0) + if (VN_IS_DOOMED(fp->f_vnode)) error = EBADF; else error = EDEADLK; Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sun Dec 8 21:13:07 2019 (r355536) +++ head/sys/kern/vfs_vnops.c Sun Dec 8 21:30:04 2019 (r355537) @@ -328,7 +328,7 @@ vn_open_vnode_advlock(struct vnode *vp, int fmode, str fp->f_flag |= FHASLOCK; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Dec 8 22:33:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 478261BC6CC; Sun, 8 Dec 2019 22:33:52 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47WLhc0w7Lz3x6r; Sun, 8 Dec 2019 22:33:52 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A9CA9355; Sun, 8 Dec 2019 22:33:52 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB8MXp6o089428; Sun, 8 Dec 2019 22:33:51 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB8MXppR089426; Sun, 8 Dec 2019 22:33:51 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201912082233.xB8MXppR089426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sun, 8 Dec 2019 22:33:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355538 - in head: lib/libprocstat sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: in head: lib/libprocstat sys/vm X-SVN-Commit-Revision: 355538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 22:33:52 -0000 Author: dougm Date: Sun Dec 8 22:33:51 2019 New Revision: 355538 URL: https://svnweb.freebsd.org/changeset/base/355538 Log: Define a vm_map method for user-space for advancing from a map entry to its successor in cases where examining a map entry requires a helper like kvm_read_all. Use that method, with kvm_read_all, to fix procstat_getfiles_kvm, which tries to find the successor now without using such a helper. This addresses a problem introduced by r355491. Reviewed by: markj (previous version) Discussed with: kib Differential Revision: https://reviews.freebsd.org/D22728 Modified: head/lib/libprocstat/libprocstat.c head/sys/vm/vm_map.h Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sun Dec 8 21:30:04 2019 (r355537) +++ head/lib/libprocstat/libprocstat.c Sun Dec 8 22:33:51 2019 (r355538) @@ -445,6 +445,15 @@ getctty(kvm_t *kd, struct kinfo_proc *kp) return (sess.s_ttyvp); } +static int +procstat_vm_map_reader(void *token, vm_map_entry_t addr, vm_map_entry_t dest) +{ + kvm_t *kd; + + kd = (kvm_t *)token; + return (kvm_read_all(kd, (unsigned long)addr, dest, sizeof(*dest))); +} + static struct filestat_list * procstat_getfiles_kvm(struct procstat *procstat, struct kinfo_proc *kp, int mmapped) { @@ -454,7 +463,6 @@ procstat_getfiles_kvm(struct procstat *procstat, struc struct vm_object object; struct vmspace vmspace; vm_map_entry_t entryp; - vm_map_t map; vm_object_t objp; struct vnode *vp; struct file **ofiles; @@ -615,17 +623,11 @@ do_mmapped: (void *)kp->ki_vmspace); goto exit; } - map = &vmspace.vm_map; - for (entryp = vm_map_entry_first(map); - entryp != &kp->ki_vmspace->vm_map.header; - entryp = vm_map_entry_succ(&vmentry)) { - if (!kvm_read_all(kd, (unsigned long)entryp, &vmentry, - sizeof(vmentry))) { - warnx("can't read vm_map_entry at %p", - (void *)entryp); - continue; - } + vmentry = vmspace.vm_map.header; + for (entryp = vm_map_entry_read_succ(kd, &vmentry, procstat_vm_map_reader); + entryp != NULL && entryp != &kp->ki_vmspace->vm_map.header; + entryp = vm_map_entry_read_succ(kd, &vmentry, procstat_vm_map_reader)) { if (vmentry.eflags & MAP_ENTRY_IS_SUB_MAP) continue; if ((objp = vmentry.object.vm_object) == NULL) @@ -660,6 +662,8 @@ do_mmapped: if (entry != NULL) STAILQ_INSERT_TAIL(head, entry, next); } + if (entryp == NULL) + warnx("can't read vm_map_entry"); } exit: return (head); Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Sun Dec 8 21:30:04 2019 (r355537) +++ head/sys/vm/vm_map.h Sun Dec 8 22:33:51 2019 (r355538) @@ -402,6 +402,47 @@ long vmspace_resident_count(struct vmspace *vmspace); #define VM_MAP_WIRE_WRITE 4 /* Validate writable. */ +typedef int vm_map_entry_reader(void *token, vm_map_entry_t addr, + vm_map_entry_t dest); + +#ifndef _KERNEL +/* + * Find the successor of a map_entry, using a reader to dereference pointers. + * '*clone' is a copy of a vm_map entry. 'reader' is used to copy a map entry + * at some address into '*clone'. Change *clone to a copy of the next map + * entry, and return the address of that entry, or NULL if copying has failed. + * + * This function is made available to user-space code that needs to traverse + * map entries. + */ +static inline vm_map_entry_t +vm_map_entry_read_succ(void *token, struct vm_map_entry *const clone, + vm_map_entry_reader reader) +{ + vm_map_entry_t after, backup; + vm_offset_t start; + + after = clone->right; + start = clone->start; + if (!reader(token, after, clone)) + return (NULL); + backup = clone->left; + if (!reader(token, backup, clone)) + return (NULL); + if (clone->start > start) { + do { + after = backup; + backup = clone->left; + if (!reader(token, backup, clone)) + return (NULL); + } while (clone->start != start); + } + if (!reader(token, after, clone)) + return (NULL); + return (after); +} +#endif /* ! _KERNEL */ + static inline vm_map_entry_t vm_map_entry_first(vm_map_t map) { From owner-svn-src-all@freebsd.org Mon Dec 9 00:30:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 863831BFBB0; Mon, 9 Dec 2019 00:30:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47WPGk2z8gz432t; Mon, 9 Dec 2019 00:30:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 611D9A708; Mon, 9 Dec 2019 00:30:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB90U6If055481; Mon, 9 Dec 2019 00:30:06 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB90U6oN055480; Mon, 9 Dec 2019 00:30:06 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912090030.xB90U6oN055480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Dec 2019 00:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355540 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 355540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 00:30:06 -0000 Author: ian Date: Mon Dec 9 00:30:05 2019 New Revision: 355540 URL: https://svnweb.freebsd.org/changeset/base/355540 Log: Add FDT support to the gpioths driver. It now uses the newer gpio_pin_*() API and can attach based on either hints or fdt data. Modified: head/sys/dev/gpio/gpioths.c Modified: head/sys/dev/gpio/gpioths.c ============================================================================== --- head/sys/dev/gpio/gpioths.c Sun Dec 8 22:36:37 2019 (r355539) +++ head/sys/dev/gpio/gpioths.c Mon Dec 9 00:30:05 2019 (r355540) @@ -24,28 +24,12 @@ * SUCH DAMAGE. */ -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "gpiobus_if.h" - /* - * GPIOTHS - Temp/Humidity sensor over GPIO, e.g. DHT11/DHT22 + * GPIOTHS - Temp/Humidity sensor over GPIO. + * * This is driver for Temperature & Humidity sensor which provides digital * output over single-wire protocol from embedded 8-bit microcontroller. + * Note that uses a custom single-wire protocol, it is not One-wire(tm). * * This driver supports the following chips: * DHT11: Temp 0c to 50c +-2.0c, Humidity 20% to 90% +-5% @@ -59,8 +43,38 @@ __FBSDID("$FreeBSD$"); * as part of loader or kernel configuration: * hint.gpioths.0.at="gpiobus0" * hint.gpioths.0.pins= + * + * Or configure via FDT data. */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef FDT +#include +#include + +static struct ofw_compat_data compat_data[] = { + {"dht11", true}, + {NULL, false} +}; +OFWBUS_PNP_INFO(compat_data); +SIMPLEBUS_PNP_INFO(compat_data); +#endif /* FDT */ + +#define PIN_IDX 0 /* Use the first/only configured pin. */ + #define GPIOTHS_POLLTIME 5 /* in seconds */ #define GPIOTHS_DHT_STARTCYCLE 20000 /* 20ms = 20000us */ @@ -70,40 +84,44 @@ __FBSDID("$FreeBSD$"); struct gpioths_softc { device_t dev; + gpio_pin_t pin; int temp; int hum; int fails; struct callout callout; }; -/* Prototypes */ -static int gpioths_probe(device_t dev); -static int gpioths_attach(device_t dev); -static int gpioths_detach(device_t dev); -static void gpioths_poll(void *arg); - -/* DHT-specific methods */ -static int gpioths_dht_initread(device_t bus, device_t dev); -static int gpioths_dht_readbytes(device_t bus, device_t dev); -static int gpioths_dht_timeuntil(device_t bus, device_t dev, - uint32_t lev, uint32_t *time); - -/* Implementation */ static int gpioths_probe(device_t dev) { - device_set_desc(dev, "Temperature and Humidity Sensor over GPIO"); - return (0); + int rv; + + /* + * By default we only bid to attach if specifically added by our parent + * (usually via hint.gpioths.#.at=busname). On FDT systems we bid as + * the default driver based on being configured in the FDT data. + */ + rv = BUS_PROBE_NOWILDCARD; + +#ifdef FDT + if (ofw_bus_status_okay(dev) && + ofw_bus_search_compatible(dev, compat_data)->ocd_data) + rv = BUS_PROBE_DEFAULT; +#endif + + device_set_desc(dev, "DHT11/DHT22 Temperature and Humidity Sensor"); + + return (rv); } static int -gpioths_dht_timeuntil(device_t bus, device_t dev, uint32_t lev, uint32_t *time) +gpioths_dht_timeuntil(struct gpioths_softc *sc, bool lev, uint32_t *time) { - uint32_t cur_level; + bool cur_level; int i; for (i = 0; i < GPIOTHS_DHT_TIMEOUT; i++) { - GPIOBUS_PIN_GET(bus, dev, 0, &cur_level); + gpio_pin_is_active(sc->pin, &cur_level); if (cur_level == lev) { if (time != NULL) *time = i; @@ -116,93 +134,54 @@ gpioths_dht_timeuntil(device_t bus, device_t dev, uint return (ETIMEDOUT); } -static int -gpioths_dht_initread(device_t bus, device_t dev) +static void +gpioths_dht_initread(struct gpioths_softc *sc) { - int err; - err = GPIOBUS_PIN_SETFLAGS(bus, dev, 0, GPIO_PIN_OUTPUT); - if (err != 0) { - device_printf(dev, "err(GPIOBUS_PIN_SETFLAGS, OUT) = %d\n", err); - return (err); - } - DELAY(1); - - err = GPIOBUS_PIN_SET(bus, dev, 0, GPIO_PIN_LOW); - if (err != 0) { - device_printf(dev, "err(GPIOBUS_PIN_SET, LOW) = %d\n", err); - return (err); - } - /* - * According to specifications we need to wait no more than 18ms - * to start data transfer + * According to specifications we need to drive the data line low for at + * least 20ms then drive it high, to wake up the chip and signal it to + * send a measurement. After sending this start signal, we switch the + * pin back to input so the device can begin talking to us. */ + gpio_pin_setflags(sc->pin, GPIO_PIN_OUTPUT); + gpio_pin_set_active(sc->pin, false); DELAY(GPIOTHS_DHT_STARTCYCLE); - err = GPIOBUS_PIN_SET(bus, dev, 0, GPIO_PIN_HIGH); - if (err != 0) { - device_printf(dev, "err(GPIOBUS_PIN_SET, HIGH) = %d\n", err); - return (err); - } - - DELAY(1); - err = GPIOBUS_PIN_SETFLAGS(bus, dev, 0, GPIO_PIN_INPUT) ; - if (err != 0) { - device_printf(dev, "err(GPIOBUS_PIN_SETFLAGS, IN) = %d\n", err); - return (err); - } - - DELAY(1); - return (0); + gpio_pin_set_active(sc->pin, true); + gpio_pin_setflags(sc->pin, GPIO_PIN_INPUT); } static int -gpioths_dht_readbytes(device_t bus, device_t dev) +gpioths_dht_readbytes(struct gpioths_softc *sc) { - struct gpioths_softc *sc; uint32_t calibrations[GPIOTHS_DHT_CYCLES]; uint32_t intervals[GPIOTHS_DHT_CYCLES]; uint32_t err, avglen, value; uint8_t crc, calc; int i, negmul, offset, size, tmphi, tmplo; - sc = device_get_softc(dev); - - err = gpioths_dht_initread(bus,dev); + gpioths_dht_initread(sc); + + err = gpioths_dht_timeuntil(sc, false, NULL); if (err) { - device_printf(dev, "gpioths_dht_initread error = %d\n", err); + device_printf(sc->dev, "err(START) = %d\n", err); goto error; } - err = gpioths_dht_timeuntil(bus, dev, GPIO_PIN_LOW, NULL); - if (err) { - device_printf(dev, "err(START) = %d\n", err); - goto error; - } - /* reading - 41 cycles */ for (i = 0; i < GPIOTHS_DHT_CYCLES; i++) { - err = gpioths_dht_timeuntil(bus, dev, GPIO_PIN_HIGH, - &calibrations[i]); + err = gpioths_dht_timeuntil(sc, true, &calibrations[i]); if (err) { - device_printf(dev, "err(CAL, %d) = %d\n", i, err); + device_printf(sc->dev, "err(CAL, %d) = %d\n", i, err); goto error; } - err = gpioths_dht_timeuntil(bus, dev, GPIO_PIN_LOW, - &intervals[i]); + err = gpioths_dht_timeuntil(sc, false, &intervals[i]); if (err) { - device_printf(dev, "err(INTERVAL, %d) = %d\n", i, err); + device_printf(sc->dev, "err(INTERVAL, %d) = %d\n", i, err); goto error; } } - err = GPIOBUS_PIN_SETFLAGS(bus, dev, 0, GPIO_PIN_INPUT); - if (err != 0) { - device_printf(dev, "err(FINAL_SETFLAGS, IN) = %d\n", err); - goto error; - } - DELAY(1); - /* Calculate average data calibration cycle length */ avglen = 0; for (i = 1; i < GPIOTHS_DHT_CYCLES; i++) @@ -271,8 +250,8 @@ gpioths_dht_readbytes(device_t bus, device_t dev) * the upper bits of its 16-bit humidity. A DHT11/12 should not report * a value lower than 20. To allow for the possibility that a device * could report a value slightly out of its sensitivity range, we split - * the difference and say if the value is greater than 10 it cannot be a - * DHT22 (that would be a humidity over 256%). + * the difference and say if the value is greater than 10 it must be a + * DHT11/12 (that would be a humidity over 256% on a DHT21/22). */ #define DK_OFFSET 2731 /* Offset between K and C, in decikelvins. */ if ((value >> 24) > 10) { @@ -307,12 +286,10 @@ static void gpioths_poll(void *arg) { struct gpioths_softc *sc; - device_t dev; - dev = (device_t)arg; - sc = device_get_softc(dev); + sc = (struct gpioths_softc *)arg; - gpioths_dht_readbytes(device_get_parent(dev), dev); + gpioths_dht_readbytes(sc); callout_schedule(&sc->callout, GPIOTHS_POLLTIME * hz); } @@ -322,6 +299,7 @@ gpioths_attach(device_t dev) struct gpioths_softc *sc; struct sysctl_ctx_list *ctx; struct sysctl_oid *tree; + int err; sc = device_get_softc(dev); ctx = device_get_sysctl_ctx(dev); @@ -329,11 +307,55 @@ gpioths_attach(device_t dev) sc->dev = dev; +#ifdef FDT + /* Try to configure our pin from fdt data on fdt-based systems. */ + err = gpio_pin_get_by_ofw_idx(dev, ofw_bus_get_node(dev), PIN_IDX, + &sc->pin); +#else + err = ENOENT; +#endif + /* + * If we didn't get configured by fdt data and our parent is gpiobus, + * see if we can be configured by the bus (allows hinted attachment even + * on fdt-based systems). + */ + if (err != 0 && + strcmp("gpiobus", device_get_name(device_get_parent(dev))) == 0) + err = gpio_pin_get_by_child_index(dev, PIN_IDX, &sc->pin); + + /* If we didn't get configured by either method, whine and punt. */ + if (err != 0) { + device_printf(sc->dev, + "cannot acquire gpio pin (config error)\n"); + return (err); + } + + /* + * Ensure we have control of our pin, and preset the data line to its + * idle condition (high). Leave the line in input mode, relying on the + * external pullup to keep the line high while idle. + */ + err = gpio_pin_setflags(sc->pin, GPIO_PIN_OUTPUT); + if (err != 0) { + device_printf(dev, "gpio_pin_setflags(OUT) = %d\n", err); + return (err); + } + err = gpio_pin_set_active(sc->pin, true); + if (err != 0) { + device_printf(dev, "gpio_pin_set_active(false) = %d\n", err); + return (err); + } + err = gpio_pin_setflags(sc->pin, GPIO_PIN_INPUT); + if (err != 0) { + device_printf(dev, "gpio_pin_setflags(IN) = %d\n", err); + return (err); + } + /* * Do an initial read so we have correct values for reporting before * registering the sysctls that can access those values. */ - gpioths_dht_readbytes(device_get_parent(dev), dev); + gpioths_dht_readbytes(sc); sysctl_add_oid(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "temperature", \ CTLFLAG_RD | CTLTYPE_INT | CTLFLAG_MPSAFE, @@ -347,7 +369,7 @@ gpioths_attach(device_t dev) "failures since last successful read"); callout_init(&sc->callout, 1); - callout_reset(&sc->callout, GPIOTHS_POLLTIME * hz, gpioths_poll, dev); + callout_reset(&sc->callout, GPIOTHS_POLLTIME * hz, gpioths_poll, sc); return (0); } @@ -358,7 +380,7 @@ gpioths_detach(device_t dev) struct gpioths_softc *sc; sc = device_get_softc(dev); - + gpio_pin_release(sc->pin); callout_drain(&sc->callout); return (0); @@ -377,5 +399,10 @@ static device_method_t gpioths_methods[] = { static devclass_t gpioths_devclass; DEFINE_CLASS_0(gpioths, gpioths_driver, gpioths_methods, sizeof(struct gpioths_softc)); + +#ifdef FDT +DRIVER_MODULE(gpioths, simplebus, gpioths_driver, gpioths_devclass, 0, 0); +#endif + DRIVER_MODULE(gpioths, gpiobus, gpioths_driver, gpioths_devclass, 0, 0); MODULE_DEPEND(gpioths, gpiobus, 1, 1, 1); From owner-svn-src-all@freebsd.org Mon Dec 9 00:34:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 805061BFF3E; Mon, 9 Dec 2019 00:34:35 +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 47WPMv2nL9z43QK; Mon, 9 Dec 2019 00:34:35 +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 5A1A8A8BA; Mon, 9 Dec 2019 00:34:35 +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 xB90YZUY061041; Mon, 9 Dec 2019 00:34:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB90YZ7S061040; Mon, 9 Dec 2019 00:34:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912090034.xB90YZ7S061040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 Dec 2019 00:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355541 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 355541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 00:34:35 -0000 Author: markj Date: Mon Dec 9 00:34:34 2019 New Revision: 355541 URL: https://svnweb.freebsd.org/changeset/base/355541 Log: MFC r355469: Fix fault_type handling in vm_map_lookup(). Modified: stable/12/sys/vm/vm_map.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Mon Dec 9 00:30:05 2019 (r355540) +++ stable/12/sys/vm/vm_map.c Mon Dec 9 00:34:34 2019 (r355541) @@ -4525,7 +4525,7 @@ vm_map_lookup(vm_map_t *var_map, /* IN/OUT */ vm_map_entry_t entry; vm_map_t map = *var_map; vm_prot_t prot; - vm_prot_t fault_type = fault_typea; + vm_prot_t fault_type; vm_object_t eobject; vm_size_t size; struct ucred *cred; @@ -4569,7 +4569,7 @@ RetryLookupLocked: vm_map_growstack(map, vaddr, entry) == KERN_SUCCESS) goto RetryLookupLocked; } - fault_type &= VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE; + fault_type = fault_typea & VM_PROT_ALL; if ((fault_type & prot) != fault_type || prot == VM_PROT_NONE) { vm_map_unlock_read(map); return (KERN_PROTECTION_FAILURE); From owner-svn-src-all@freebsd.org Mon Dec 9 00:42:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 266981C827B; Mon, 9 Dec 2019 00:42:13 +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 47WPXj0HcZz43nG; Mon, 9 Dec 2019 00:42:13 +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 051A9AA50; Mon, 9 Dec 2019 00:42:13 +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 xB90gCaO063815; Mon, 9 Dec 2019 00:42:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB90gCB3063814; Mon, 9 Dec 2019 00:42:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201912090042.xB90gCB3063814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Dec 2019 00:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355542 - stable/12/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 355542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 00:42:13 -0000 Author: kib Date: Mon Dec 9 00:42:12 2019 New Revision: 355542 URL: https://svnweb.freebsd.org/changeset/base/355542 Log: MFC r355287: mlx5: Downgrade assert about misbehaving hardware to error message. Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Mon Dec 9 00:34:34 2019 (r355541) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Mon Dec 9 00:42:12 2019 (r355542) @@ -137,9 +137,11 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev) mdev->dump_rege[++i].addr = next_addr; addr = next_addr; } - KASSERT(i + 1 == sz, - ("inconsistent hw crspace reads: sz %u i %u addr %#lx", - sz, i, (unsigned long)addr)); + if (i + 1 != sz) { + mlx5_core_err(mdev, + "Inconsistent hw crspace reads: sz %u i %u addr %#lx", + sz, i, (unsigned long)addr); + } mdev->dump_size = mlx5_fwdump_getsize(mdev->dump_rege); mdev->dump_data = malloc(mdev->dump_size * sizeof(uint32_t), From owner-svn-src-all@freebsd.org Mon Dec 9 00:43:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BE9D1C8301; Mon, 9 Dec 2019 00:43:12 +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 47WPYr2CFbz43wt; Mon, 9 Dec 2019 00:43:12 +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 46D90AA75; Mon, 9 Dec 2019 00:43:12 +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 xB90hCZW067095; Mon, 9 Dec 2019 00:43:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB90hC5X067094; Mon, 9 Dec 2019 00:43:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201912090043.xB90hC5X067094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Dec 2019 00:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355543 - stable/12/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 355543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 00:43:12 -0000 Author: kib Date: Mon Dec 9 00:43:11 2019 New Revision: 355543 URL: https://svnweb.freebsd.org/changeset/base/355543 Log: MFC r355288: mlx5: Do not try to enable fwdumps if scan space did not responded. Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Mon Dec 9 00:42:12 2019 (r355542) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Mon Dec 9 00:43:11 2019 (r355543) @@ -111,6 +111,10 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev) sz++; addr = next_addr; } + if (sz == 1) { + mlx5_core_warn(mdev, "no output from scan space\n"); + goto unlock_vsc; + } mdev->dump_rege = malloc(sz * sizeof(struct mlx5_crspace_regmap), M_MLX5_DUMP, M_WAITOK | M_ZERO); From owner-svn-src-all@freebsd.org Mon Dec 9 00:45:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D3E61C83BE; Mon, 9 Dec 2019 00:45:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47WPcW6f1lz444G; Mon, 9 Dec 2019 00:45:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DADCDAA76; Mon, 9 Dec 2019 00:45:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB90jVmJ067278; Mon, 9 Dec 2019 00:45:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB90jVWP067277; Mon, 9 Dec 2019 00:45:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201912090045.xB90jVWP067277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Dec 2019 00:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355544 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 355544 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 00:45:32 -0000 Author: kib Date: Mon Dec 9 00:45:31 2019 New Revision: 355544 URL: https://svnweb.freebsd.org/changeset/base/355544 Log: MFC r355287: mlx5: Downgrade assert about misbehaving hardware to error message. Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Mon Dec 9 00:43:11 2019 (r355543) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Mon Dec 9 00:45:31 2019 (r355544) @@ -137,9 +137,11 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev) mdev->dump_rege[++i].addr = next_addr; addr = next_addr; } - KASSERT(i + 1 == sz, - ("inconsistent hw crspace reads: sz %u i %u addr %#lx", - sz, i, (unsigned long)addr)); + if (i + 1 != sz) { + mlx5_core_err(mdev, + "Inconsistent hw crspace reads: sz %u i %u addr %#lx", + sz, i, (unsigned long)addr); + } mdev->dump_size = mlx5_fwdump_getsize(mdev->dump_rege); mdev->dump_data = malloc(mdev->dump_size * sizeof(uint32_t), From owner-svn-src-all@freebsd.org Mon Dec 9 00:46:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6261B1C846D; Mon, 9 Dec 2019 00:46:14 +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 47WPdL22N0z44BX; Mon, 9 Dec 2019 00:46:14 +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 411F8AA79; Mon, 9 Dec 2019 00:46:14 +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 xB90kELi067367; Mon, 9 Dec 2019 00:46:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB90kEEL067366; Mon, 9 Dec 2019 00:46:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201912090046.xB90kEEL067366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Dec 2019 00:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355545 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 355545 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 00:46:14 -0000 Author: kib Date: Mon Dec 9 00:46:13 2019 New Revision: 355545 URL: https://svnweb.freebsd.org/changeset/base/355545 Log: MFC r355288: mlx5: Do not try to enable fwdumps if scan space did not responded. Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Mon Dec 9 00:45:31 2019 (r355544) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Mon Dec 9 00:46:13 2019 (r355545) @@ -111,6 +111,10 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev) sz++; addr = next_addr; } + if (sz == 1) { + mlx5_core_warn(mdev, "no output from scan space\n"); + goto unlock_vsc; + } mdev->dump_rege = malloc(sz * sizeof(struct mlx5_crspace_regmap), M_MLX5_DUMP, M_WAITOK | M_ZERO); From owner-svn-src-all@freebsd.org Mon Dec 9 01:32:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D83A61C930D; Mon, 9 Dec 2019 01:32:18 +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 47WQfV5Fbkz45kb; Mon, 9 Dec 2019 01:32:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF8DAB22A; Mon, 9 Dec 2019 01:32:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB91WIpq093849; Mon, 9 Dec 2019 01:32:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB91WIAQ093848; Mon, 9 Dec 2019 01:32:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912090132.xB91WIAQ093848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Dec 2019 01:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355546 - head/lib/libefivar X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libefivar X-SVN-Commit-Revision: 355546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 01:32:18 -0000 Author: imp Date: Mon Dec 9 01:32:18 2019 New Revision: 355546 URL: https://svnweb.freebsd.org/changeset/base/355546 Log: Add additional sanity checks. Modified: head/lib/libefivar/efivar-dp-xlate.c Modified: head/lib/libefivar/efivar-dp-xlate.c ============================================================================== --- head/lib/libefivar/efivar-dp-xlate.c Mon Dec 9 00:46:13 2019 (r355545) +++ head/lib/libefivar/efivar-dp-xlate.c Mon Dec 9 01:32:18 2019 (r355546) @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); #define MAX_DP_SANITY 4096 /* Biggest device path in bytes */ #define MAX_DP_TEXT_LEN 4096 /* Longest string rep of dp */ +#define ValidLen(dp) (DevicePathNodeLength(dp) >= sizeof(EFI_DEVICE_PATH_PROTOCOL) && \ + DevicePathNodeLength(dp) < MAX_DP_SANITY) + #define G_PART "PART" #define G_LABEL "LABEL" #define G_DISK "DISK" @@ -142,6 +145,8 @@ efi_hd_to_unix(struct gmesh *mesh, const_efidp dp, cha * Now, we can either have a filepath node next, or the end. * Otherwise, it's an error. */ + if (!ValidLen(walker)) + return (EINVAL); walker = (const_efidp)NextDevicePathNode(walker); if ((uintptr_t)walker - (uintptr_t)dp > MAX_DP_SANITY) return (EINVAL); @@ -333,10 +338,14 @@ efivar_device_path_to_unix_path(const_efidp dp, char * * then we didn't find a media device path, so signal that error. */ walker = dp; + if (!ValidLen(walker)) + return (EINVAL); while (DevicePathType(walker) != MEDIA_DEVICE_PATH && DevicePathType(walker) != END_DEVICE_PATH_TYPE) { walker = (const_efidp)NextDevicePathNode(walker); if ((uintptr_t)walker - (uintptr_t)dp > MAX_DP_SANITY) + return (EINVAL); + if (!ValidLen(walker)) return (EINVAL); } if (DevicePathType(walker) != MEDIA_DEVICE_PATH) From owner-svn-src-all@freebsd.org Mon Dec 9 02:29:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 260CA1CA144; Mon, 9 Dec 2019 02:29:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47WRwF049gz47lv; Mon, 9 Dec 2019 02:29:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED5E7BDC2; Mon, 9 Dec 2019 02:29:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB92TG6u025660; Mon, 9 Dec 2019 02:29:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB92TGbN025659; Mon, 9 Dec 2019 02:29:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912090229.xB92TGbN025659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Dec 2019 02:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355547 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 355547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 02:29:17 -0000 Author: ian Date: Mon Dec 9 02:29:16 2019 New Revision: 355547 URL: https://svnweb.freebsd.org/changeset/base/355547 Log: Fix a typo: the sysctl command is in chapter 8 of the manual, not 4. Modified: head/share/man/man4/ads111x.4 Modified: head/share/man/man4/ads111x.4 ============================================================================== --- head/share/man/man4/ads111x.4 Mon Dec 9 01:32:18 2019 (r355546) +++ head/share/man/man4/ads111x.4 Mon Dec 9 02:29:16 2019 (r355547) @@ -232,7 +232,7 @@ for all possible channels supported by the device type only the specified channels are created. .Sh SEE ALSO .Xr fdt 4 , -.Xr sysctl 4 +.Xr sysctl 8 .Sh HISTORY The .Nm From owner-svn-src-all@freebsd.org Mon Dec 9 03:02:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E85C1CABCF; Mon, 9 Dec 2019 03:02:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47WSg31mRmz49Ck; Mon, 9 Dec 2019 03:02:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37D36C514; Mon, 9 Dec 2019 03:02:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB932tnE050167; Mon, 9 Dec 2019 03:02:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB932t8P050166; Mon, 9 Dec 2019 03:02:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912090302.xB932t8P050166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Dec 2019 03:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355548 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 355548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 03:02:55 -0000 Author: ian Date: Mon Dec 9 03:02:54 2019 New Revision: 355548 URL: https://svnweb.freebsd.org/changeset/base/355548 Log: Add a man page for the gpioths(4) driver. Added: head/share/man/man4/gpioths.4 (contents, props changed) Added: head/share/man/man4/gpioths.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/gpioths.4 Mon Dec 9 03:02:54 2019 (r355548) @@ -0,0 +1,152 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2019 Ian Lepore +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 8, 2019 +.Dt GPIOTHS 4 +.Os +.Sh NAME +.Nm gpioths +.Nd driver for DHTxx and AM320x temperature and humidity sensors +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device gpioths" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +gpioths_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver supports the DHTxx and AM320x family of +temperature and humidity sensors. +The driver automatically reads the values from the sensor +once every 5 seconds, and makes the results available via +.Xr sysctl 8 +variables. +.Sh HARDWARE +The +.Nm +driver provides support for the following devices: +.Pp +.Bl -column -compact -offset indent "XXXXXXXX" "XXXXXXXX" +.It DHT11 Ta DHT12 +.It DHT21 Ta DHT22 +.It AM3201 Ta AM3202 +.El +.Pp +The supported devices are all similar to each other, varying +primarily in accuracy and resolution. +The devices require a single wire for data communications, using a +custom protocol which is not compatible with Maxim's 1-wire(tm). +The AM320x devices also support connection to an i2c bus, +but this driver supports only the single-wire connection option. +.Sh SYSCTL VARIABLES +Sysctl variables are used to access the most recent temperature and +humidity measurements. +.Bl -tag -width indent +.It Va dev.gpioths..temp +The current temperature in integer deciKelvins. +Note that +.Xr sysctl 8 +will convert those units to display in decimal degrees Celcius. +.It Va dev.gpioths..hum +The current relative humidity, as an integer percentage. +.It Va dev.gpioths..fails +The number of failed attempts to communicate with the sensor since +the last good access. +Cleared whenever a set of measurements is successfully retrieved. +.El +.Sh FDT CONFIGURATION +On an +.Xr fdt 4 +based system, a +.Nm +device node is typically defined directly under the root node, or under +a simplebus node that represents a collection of devices on a board. +.Pp +The following properties are required in the +.Nm +device subnode: +.Bl -tag -width indent +.It Va compatible +Must be "dht11". +.It Va gpios +A reference to the gpio device and pin for data communications. +.El +.Ss Example of adding a sensor with an overlay +.Bd -unfilled -offset indent +/dts-v1/; +/plugin/; +#include + +/ { + compatible = "wand,imx6q-wandboard"; +}; + +&{/} { + dht0 { + compatible = "dht11"; + gpios = <&gpio5 15 GPIO_ACTIVE_HIGH>; + }; +}; +.Ed +.Sh HINTS CONFIGURATION +On a +.Xr device.hints 5 +based system, such as +.Li MIPS , +these values are configurable for +.Nm : +.Bl -tag -width indent +.It Va hint.gpioths..at +The +.Xr gpiobus 4 +instance the +.Nm +instance is attached to. +.It Va hint.gpioths.pins +A bitmask with a single bit set to indicate which gpio pin on the +.Xr gpiobus 4 +to use for data communications. +.El +.Sh SEE ALSO +.Xr fdt 4 , +.Xr gpiobus 4 , +.Xr sysctl 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 11.1 . From owner-svn-src-all@freebsd.org Mon Dec 9 03:07:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6389E1CADD3; Mon, 9 Dec 2019 03:07:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47WSmt24tHz49PB; Mon, 9 Dec 2019 03:07:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42C91C522; Mon, 9 Dec 2019 03:07:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB937wPa050418; Mon, 9 Dec 2019 03:07:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB937wl1050417; Mon, 9 Dec 2019 03:07:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912090307.xB937wl1050417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Dec 2019 03:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355549 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 355549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 03:07:58 -0000 Author: ian Date: Mon Dec 9 03:07:57 2019 New Revision: 355549 URL: https://svnweb.freebsd.org/changeset/base/355549 Log: Add myself to the copyright list. Also add an SPDX tag. And finally, fix a missing word and a spelling error in a comment. Modified: head/sys/dev/gpio/gpioths.c Modified: head/sys/dev/gpio/gpioths.c ============================================================================== --- head/sys/dev/gpio/gpioths.c Mon Dec 9 03:02:54 2019 (r355548) +++ head/sys/dev/gpio/gpioths.c Mon Dec 9 03:07:57 2019 (r355549) @@ -1,7 +1,9 @@ /*- - * Copyright (c) 2016 Michael Zhilin - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause * + * Copyright (c) 2019 Ian Lepore + * Copyright (c) 2016 Michael Zhilin All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -29,7 +31,7 @@ * * This is driver for Temperature & Humidity sensor which provides digital * output over single-wire protocol from embedded 8-bit microcontroller. - * Note that uses a custom single-wire protocol, it is not One-wire(tm). + * Note that it uses a custom single-wire protocol, it is not 1-wire(tm). * * This driver supports the following chips: * DHT11: Temp 0c to 50c +-2.0c, Humidity 20% to 90% +-5% From owner-svn-src-all@freebsd.org Mon Dec 9 03:09:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DEF991CAE67; Mon, 9 Dec 2019 03:09:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47WSqB5JV3z49Y3; Mon, 9 Dec 2019 03:09:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1613C524; Mon, 9 Dec 2019 03:09:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB939wFh050538; Mon, 9 Dec 2019 03:09:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB939wEe050537; Mon, 9 Dec 2019 03:09:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912090309.xB939wEe050537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Dec 2019 03:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355550 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 355550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 03:09:58 -0000 Author: ian Date: Mon Dec 9 03:09:58 2019 New Revision: 355550 URL: https://svnweb.freebsd.org/changeset/base/355550 Log: Paste things correctly so that I'm added to the *end* of the copyright list. Modified: head/sys/dev/gpio/gpioths.c Modified: head/sys/dev/gpio/gpioths.c ============================================================================== --- head/sys/dev/gpio/gpioths.c Mon Dec 9 03:07:57 2019 (r355549) +++ head/sys/dev/gpio/gpioths.c Mon Dec 9 03:09:58 2019 (r355550) @@ -1,8 +1,8 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2019 Ian Lepore * Copyright (c) 2016 Michael Zhilin All rights reserved. + * Copyright (c) 2019 Ian Lepore * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-all@freebsd.org Mon Dec 9 04:15:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C0311CBF73; Mon, 9 Dec 2019 04:15:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47WVGF3FVDz4Cwv; Mon, 9 Dec 2019 04:15:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AC00D19E; Mon, 9 Dec 2019 04:15:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB94F1mT090931; Mon, 9 Dec 2019 04:15:01 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB94F1V5090930; Mon, 9 Dec 2019 04:15:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912090415.xB94F1V5090930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Dec 2019 04:15:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355551 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 355551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 04:15:01 -0000 Author: ian Date: Mon Dec 9 04:15:01 2019 New Revision: 355551 URL: https://svnweb.freebsd.org/changeset/base/355551 Log: Connect the gpioths(4) manpage to the build. Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Dec 9 03:09:58 2019 (r355550) +++ head/share/man/man4/Makefile Mon Dec 9 04:15:01 2019 (r355551) @@ -173,6 +173,7 @@ MAN= aac.4 \ gpio.4 \ gpioiic.4 \ gpioled.4 \ + gpioths.4 \ gre.4 \ h_ertt.4 \ hifn.4 \ @@ -647,6 +648,8 @@ MLINKS+=gem.4 if_gem.4 MLINKS+=geom.4 GEOM.4 MLINKS+=gif.4 if_gif.4 MLINKS+=gpio.4 gpiobus.4 +MLINKS+=gpioths.4 dht11.4 +MLINKS+=gpioths.4 dht22.4 MLINKS+=gre.4 if_gre.4 MLINKS+=hme.4 if_hme.4 MLINKS+=hpet.4 acpi_hpet.4 From owner-svn-src-all@freebsd.org Mon Dec 9 05:09:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DBA31CCB3B; Mon, 9 Dec 2019 05:09:47 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47WWTR2jn9z4FQs; Mon, 9 Dec 2019 05:09:47 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5426FDA4A; Mon, 9 Dec 2019 05:09:47 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB959lKn020784; Mon, 9 Dec 2019 05:09:47 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB959lF3020783; Mon, 9 Dec 2019 05:09:47 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201912090509.xB959lF3020783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Mon, 9 Dec 2019 05:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355552 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 05:09:47 -0000 Author: dougm Date: Mon Dec 9 05:09:46 2019 New Revision: 355552 URL: https://svnweb.freebsd.org/changeset/base/355552 Log: Revert r355505. The code that it allowed to compile has been removed. Modified: head/sys/vm/vm_map.h Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Mon Dec 9 04:15:01 2019 (r355551) +++ head/sys/vm/vm_map.h Mon Dec 9 05:09:46 2019 (r355552) @@ -443,6 +443,27 @@ vm_map_entry_read_succ(void *token, struct vm_map_entr } #endif /* ! _KERNEL */ +#ifdef _KERNEL +boolean_t vm_map_check_protection (vm_map_t, vm_offset_t, vm_offset_t, vm_prot_t); +vm_map_t vm_map_create(pmap_t, vm_offset_t, vm_offset_t); +int vm_map_delete(vm_map_t, vm_offset_t, vm_offset_t); +int vm_map_find(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t, + vm_offset_t, int, vm_prot_t, vm_prot_t, int); +int vm_map_find_min(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, + vm_size_t, vm_offset_t, vm_offset_t, int, vm_prot_t, vm_prot_t, int); +int vm_map_fixed(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t, vm_size_t, + vm_prot_t, vm_prot_t, int); +vm_offset_t vm_map_findspace(vm_map_t, vm_offset_t, vm_size_t); +int vm_map_inherit (vm_map_t, vm_offset_t, vm_offset_t, vm_inherit_t); +void vm_map_init(vm_map_t, pmap_t, vm_offset_t, vm_offset_t); +int vm_map_insert (vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t, vm_offset_t, vm_prot_t, vm_prot_t, int); +int vm_map_lookup (vm_map_t *, vm_offset_t, vm_prot_t, vm_map_entry_t *, vm_object_t *, + vm_pindex_t *, vm_prot_t *, boolean_t *); +int vm_map_lookup_locked(vm_map_t *, vm_offset_t, vm_prot_t, vm_map_entry_t *, vm_object_t *, + vm_pindex_t *, vm_prot_t *, boolean_t *); +void vm_map_lookup_done (vm_map_t, vm_map_entry_t); +boolean_t vm_map_lookup_entry (vm_map_t, vm_offset_t, vm_map_entry_t *); + static inline vm_map_entry_t vm_map_entry_first(vm_map_t map) { @@ -468,27 +489,6 @@ vm_map_entry_succ(vm_map_entry_t entry) for ((it) = vm_map_entry_first(map); \ (it) != &(map)->header; \ (it) = vm_map_entry_succ(it)) - -#ifdef _KERNEL -boolean_t vm_map_check_protection (vm_map_t, vm_offset_t, vm_offset_t, vm_prot_t); -vm_map_t vm_map_create(pmap_t, vm_offset_t, vm_offset_t); -int vm_map_delete(vm_map_t, vm_offset_t, vm_offset_t); -int vm_map_find(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t, - vm_offset_t, int, vm_prot_t, vm_prot_t, int); -int vm_map_find_min(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, - vm_size_t, vm_offset_t, vm_offset_t, int, vm_prot_t, vm_prot_t, int); -int vm_map_fixed(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t, vm_size_t, - vm_prot_t, vm_prot_t, int); -vm_offset_t vm_map_findspace(vm_map_t, vm_offset_t, vm_size_t); -int vm_map_inherit (vm_map_t, vm_offset_t, vm_offset_t, vm_inherit_t); -void vm_map_init(vm_map_t, pmap_t, vm_offset_t, vm_offset_t); -int vm_map_insert (vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t, vm_offset_t, vm_prot_t, vm_prot_t, int); -int vm_map_lookup (vm_map_t *, vm_offset_t, vm_prot_t, vm_map_entry_t *, vm_object_t *, - vm_pindex_t *, vm_prot_t *, boolean_t *); -int vm_map_lookup_locked(vm_map_t *, vm_offset_t, vm_prot_t, vm_map_entry_t *, vm_object_t *, - vm_pindex_t *, vm_prot_t *, boolean_t *); -void vm_map_lookup_done (vm_map_t, vm_map_entry_t); -boolean_t vm_map_lookup_entry (vm_map_t, vm_offset_t, vm_map_entry_t *); int vm_map_protect (vm_map_t, vm_offset_t, vm_offset_t, vm_prot_t, boolean_t); int vm_map_remove (vm_map_t, vm_offset_t, vm_offset_t); void vm_map_try_merge_entries(vm_map_t map, vm_map_entry_t prev, From owner-svn-src-all@freebsd.org Mon Dec 9 07:18:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CC2D1CF411; Mon, 9 Dec 2019 07:18:41 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47WZL91q66z4Kw9; Mon, 9 Dec 2019 07:18:41 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3925AF180; Mon, 9 Dec 2019 07:18:41 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB97IfhT096493; Mon, 9 Dec 2019 07:18:41 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB97IfB0096492; Mon, 9 Dec 2019 07:18:41 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201912090718.xB97IfB0096492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Mon, 9 Dec 2019 07:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355553 - head/sbin/swapon X-SVN-Group: head X-SVN-Commit-Author: truckman X-SVN-Commit-Paths: head/sbin/swapon X-SVN-Commit-Revision: 355553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 07:18:41 -0000 Author: truckman Date: Mon Dec 9 07:18:40 2019 New Revision: 355553 URL: https://svnweb.freebsd.org/changeset/base/355553 Log: Fix a logic bug in error handling code. It is an error if p == NULL. The linelen tests are only meaningful when p != NULL. Reported by: Coverity Coverity CID: 1368655 MFC after: 1 month Modified: head/sbin/swapon/swapon.c Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Mon Dec 9 05:09:46 2019 (r355552) +++ head/sbin/swapon/swapon.c Mon Dec 9 07:18:40 2019 (r355553) @@ -542,7 +542,7 @@ swap_on_off_md(const char *name, char *mntops, int doi goto err; } p = fgetln(sfd, &linelen); - if (p == NULL && + if (p == NULL || (linelen < 2 || linelen > sizeof(linebuf))) { warn("mdconfig (attach) unexpected output"); ret = NULL; From owner-svn-src-all@freebsd.org Mon Dec 9 10:21:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 459FF1D2F33; Mon, 9 Dec 2019 10:21:25 +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 47WfP10x7mz4SXy; Mon, 9 Dec 2019 10:21:25 +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 1B3F619301; Mon, 9 Dec 2019 10:21:25 +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 xB9ALOus005097; Mon, 9 Dec 2019 10:21:24 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9ALOIH005096; Mon, 9 Dec 2019 10:21:24 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201912091021.xB9ALOIH005096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 Dec 2019 10:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355554 - head/usr.bin/netstat X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/netstat X-SVN-Commit-Revision: 355554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 10:21:25 -0000 Author: bapt Date: Mon Dec 9 10:21:24 2019 New Revision: 355554 URL: https://svnweb.freebsd.org/changeset/base/355554 Log: Fix: netstat -rs Routing statistics requires somes symbols that are only loaded when not running live. Load them only in that specific case PR: 242423 Submitted by: olivier MFC after: 3 days Modified: head/usr.bin/netstat/main.c Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Mon Dec 9 07:18:40 2019 (r355553) +++ head/usr.bin/netstat/main.c Mon Dec 9 10:21:24 2019 (r355554) @@ -484,6 +484,9 @@ main(int argc, char *argv[]) if (rflag) { xo_open_container("statistics"); if (sflag) { + if (live) { + kresolve_list(nl); + } rt_stats(); } else routepr(fib, af); From owner-svn-src-all@freebsd.org Mon Dec 9 10:30:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E7291D3239; Mon, 9 Dec 2019 10:30:47 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Wfbp71LLz4SyB; Mon, 9 Dec 2019 10:30:46 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 6AD418D4A142; Mon, 9 Dec 2019 10:30:39 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id E1EBBE70863; Mon, 9 Dec 2019 10:30:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id d4UjSDcjtr4Q; Mon, 9 Dec 2019 10:30:37 +0000 (UTC) Received: from [192.168.2.110] (unknown [IPv6:fde9:577b:c1a9:31:651b:2fa:ad41:9634]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id BBE0DE707C0; Mon, 9 Dec 2019 10:30:37 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Baptiste Daroussin" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355554 - head/usr.bin/netstat Date: Mon, 09 Dec 2019 10:30:36 +0000 X-Mailer: MailMate (2.0BETAr6146) Message-ID: <2DE344CA-E396-49D7-A53A-4860356FC31A@lists.zabbadoz.net> In-Reply-To: <201912091021.xB9ALOIH005096@repo.freebsd.org> References: <201912091021.xB9ALOIH005096@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 47Wfbp71LLz4SyB 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)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 10:30:47 -0000 On 9 Dec 2019, at 10:21, Baptiste Daroussin wrote: > Author: bapt > Date: Mon Dec 9 10:21:24 2019 > New Revision: 355554 > URL: https://svnweb.freebsd.org/changeset/base/355554 > > Log: > Fix: netstat -rs > > Routing statistics requires somes symbols that are only loaded when > not running > live. Load them only in that specific case We should really make sure we can get them another way and don’t need this. Of course that’s another issue ;-) /bz From owner-svn-src-all@freebsd.org Mon Dec 9 13:09:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3B4D1D6780; Mon, 9 Dec 2019 13:09:33 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47Wk714b6Kz4bRl; Mon, 9 Dec 2019 13:09:33 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A81D1AFFA; Mon, 9 Dec 2019 13:09:33 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB9D9Xnh001683; Mon, 9 Dec 2019 13:09:33 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9D9W7S001680; Mon, 9 Dec 2019 13:09:32 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201912091309.xB9D9W7S001680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 9 Dec 2019 13:09:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355555 - in head/sys: conf powerpc/powernv powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in head/sys: conf powerpc/powernv powerpc/pseries X-SVN-Commit-Revision: 355555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 13:09:33 -0000 Author: luporl Date: Mon Dec 9 13:09:32 2019 New Revision: 355555 URL: https://svnweb.freebsd.org/changeset/base/355555 Log: [PPC64] Enable opal console use as a GDB DBGPORT This change makes it possible to use OPAL console as a GDB debug port. Similar to uart and uart_phyp debug ports, it has to be enabled by setting the hw.uart.dbgport variable to the serial console node of the device tree. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D22649 Added: head/sys/powerpc/powernv/opal_dbg.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/pseries/phyp_dbg.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon Dec 9 10:21:24 2019 (r355554) +++ head/sys/conf/files.powerpc Mon Dec 9 13:09:32 2019 (r355555) @@ -185,6 +185,7 @@ powerpc/powermac/vcoregpio.c optional powermac powerpc/powernv/opal.c optional powernv powerpc/powernv/opal_async.c optional powernv powerpc/powernv/opal_console.c optional powernv +powerpc/powernv/opal_dbg.c optional powernv gdb powerpc/powernv/opal_dev.c optional powernv powerpc/powernv/opal_flash.c optional powernv opalflash powerpc/powernv/opal_hmi.c optional powernv Added: head/sys/powerpc/powernv/opal_dbg.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/opal_dbg.c Mon Dec 9 13:09:32 2019 (r355555) @@ -0,0 +1,151 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2019 Leandro Lupori + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +struct thread; + +#include +#include + +#include +#include + +#include "opal.h" + +static gdb_probe_f uart_opal_dbg_probe; +static gdb_init_f uart_opal_dbg_init; +static gdb_term_f uart_opal_dbg_term; +static gdb_getc_f uart_opal_dbg_getc; +static gdb_putc_f uart_opal_dbg_putc; + +GDB_DBGPORT(uart_opal, uart_opal_dbg_probe, + uart_opal_dbg_init, uart_opal_dbg_term, + uart_opal_dbg_getc, uart_opal_dbg_putc); + +static int64_t termnum; + +static int +uart_opal_dbg_probe(void) +{ + char buf[64]; + cell_t reg; + phandle_t dev; + + if (!getenv_string("hw.uart.dbgport", buf, sizeof(buf))) + return (-1); + if ((dev = OF_finddevice(buf)) == -1) + return (-1); + + if (OF_getprop(dev, "device_type", buf, sizeof(buf)) == -1) + return (-1); + if (strcmp(buf, "serial") != 0) + return (-1); + + if (OF_getprop(dev, "compatible", buf, sizeof(buf)) == -1) + return (-1); + if (strcmp(buf, "ibm,opal-console-raw") != 0) + return (-1); + + reg = ~0U; + OF_getencprop(dev, "reg", ®, sizeof(reg)); + if (reg == ~0U) + return (-1); + termnum = reg; + + return (0); +} + +static void +uart_opal_dbg_init(void) +{ +} + +static void +uart_opal_dbg_term(void) +{ +} + +static int +uart_opal_dbg_getc(void) +{ + char c; + int err; + int64_t len; + uint64_t lenp, bufp; + + len = 1; + if (pmap_bootstrapped) { + lenp = vtophys(&len); + bufp = vtophys(&c); + } else { + lenp = (uint64_t)&len; + bufp = (uint64_t)&c; + } + + err = opal_call(OPAL_CONSOLE_READ, termnum, lenp, bufp); + if (err != OPAL_SUCCESS || len != 1) + return (-1); + + opal_call(OPAL_POLL_EVENTS, NULL); + + return (c); +} + +static void +uart_opal_dbg_putc(int c) +{ + char ch; + int err; + int64_t len; + uint64_t lenp, bufp; + + ch = (unsigned char)c; + len = 1; + if (pmap_bootstrapped) { + lenp = vtophys(&len); + bufp = vtophys(&ch); + } else { + lenp = (uint64_t)&len; + bufp = (uint64_t)&ch; + } + + for (;;) { + err = opal_call(OPAL_CONSOLE_WRITE, termnum, lenp, bufp); + /* Clear FIFO if needed. */ + if (err == OPAL_BUSY_EVENT) + opal_call(OPAL_POLL_EVENTS, NULL); + else + /* break on success or unrecoverable errors */ + break; + } + DELAY(100); +} Modified: head/sys/powerpc/pseries/phyp_dbg.c ============================================================================== --- head/sys/powerpc/pseries/phyp_dbg.c Mon Dec 9 10:21:24 2019 (r355554) +++ head/sys/powerpc/pseries/phyp_dbg.c Mon Dec 9 13:09:32 2019 (r355555) @@ -60,7 +60,7 @@ uart_phyp_dbg_probe(void) cell_t reg; phandle_t vty; - if (!getenv_string("hw.uart_phyp.dbgport", buf, sizeof(buf))) + if (!getenv_string("hw.uart.dbgport", buf, sizeof(buf))) return (-1); if ((vty = OF_finddevice(buf)) == -1) From owner-svn-src-all@freebsd.org Mon Dec 9 13:40:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B6C21D70F1; Mon, 9 Dec 2019 13:40:24 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47Wkpc0qVLz4cjD; Mon, 9 Dec 2019 13:40:24 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 131B21B578; Mon, 9 Dec 2019 13:40:24 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB9DeNnn019083; Mon, 9 Dec 2019 13:40:23 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9DeNHS019081; Mon, 9 Dec 2019 13:40:23 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201912091340.xB9DeNHS019081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 9 Dec 2019 13:40:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355556 - in head/sys: dev/vt/hw/ofwfb powerpc/ofw powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in head/sys: dev/vt/hw/ofwfb powerpc/ofw powerpc/pseries X-SVN-Commit-Revision: 355556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 13:40:24 -0000 Author: luporl Date: Mon Dec 9 13:40:23 2019 New Revision: 355556 URL: https://svnweb.freebsd.org/changeset/base/355556 Log: Enable use of ofwcons for early debug This change enables the use of OpenFirmware Console (ofwcons), even when VGA is available, allowing early kernel messages to be seen, that is important in case of crashes before VGA console initialization. This is specially useful in virtualized environments, where the user/developer doesn't have full control of the virtualization engine (e.g. OpenStack). The old behavior is preserved by default and, in order to use ofwcons, a few tunables that have been introduced need to be set: - hw.ofwfb.disable=1 - disable OFW FrameBuffer device - machdep.ofw.mtx_spin=1 - change PPC OFW mutex to SPIN type, to match kernel console's mutex type - debug.quiesce_ofw=0 - don't call OFW quiesce, needed to keep ofwcons I/O working More details can be found at differential revision D20640. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20640 Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c head/sys/powerpc/ofw/ofw_real.c head/sys/powerpc/pseries/platform_chrp.c Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Mon Dec 9 13:09:32 2019 (r355555) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Mon Dec 9 13:40:23 2019 (r355556) @@ -90,9 +90,15 @@ VT_DRIVER_DECLARE(vt_ofwfb, vt_ofwfb_driver); static int ofwfb_probe(struct vt_device *vd) { + int disabled; phandle_t chosen, node; ihandle_t stdout; char buf[64]; + + disabled = 0; + TUNABLE_INT_FETCH("hw.ofwfb.disable", &disabled); + if (disabled) + return (CN_DEAD); chosen = OF_finddevice("/chosen"); if (chosen == -1) Modified: head/sys/powerpc/ofw/ofw_real.c ============================================================================== --- head/sys/powerpc/ofw/ofw_real.c Mon Dec 9 13:09:32 2019 (r355555) +++ head/sys/powerpc/ofw/ofw_real.c Mon Dec 9 13:40:23 2019 (r355556) @@ -168,7 +168,45 @@ static vm_offset_t of_bounce_phys; static caddr_t of_bounce_virt; static off_t of_bounce_offset; static size_t of_bounce_size; + +/* + * To be able to use OFW console on PPC, that requires real mode OFW, + * the mutex that guards the mapping/unmapping of virtual to physical + * buffers (of_real_mtx) must be of SPIN type. This is needed because + * kernel console first locks a SPIN mutex before calling OFW real. + * By default, of_real_mtx is a sleepable mutex. To make it of SPIN + * type, use the following tunnable: + * machdep.ofw.mtx_spin=1 + * + * Besides that, a few more tunables are needed to select and use the + * OFW console with real mode OFW. + * + * In order to disable the use of OFW FrameBuffer and fallback to the + * OFW console, use: + * hw.ofwfb.disable=1 + * + * To disable the use of FDT (that doesn't support OFW read/write methods) + * and use real OFW instead, unset the following loader variable: + * unset usefdt + * + * OFW is put in quiesce state in early kernel boot, which usually disables + * OFW read/write capabilities (in QEMU write continue to work, but + * read doesn't). To avoid OFW quiesce, use: + * debug.quiesce_ofw=0 + * + * Note that disabling OFW quiesce can cause conflicts between kernel and + * OFW trying to control the same hardware. Thus, it must be used with care. + * Some conflicts can be avoided by disabling kernel drivers with hints. + * For instance, to disable a xhci controller and an USB keyboard connected + * to it, that may be already being used for input by OFW, use: + * hint.xhci.0.disabled=1 + */ + static struct mtx of_bounce_mtx; +static struct mtx of_spin_mtx; +static struct mtx *of_real_mtx; +static void (*of_mtx_lock)(void); +static void (*of_mtx_unlock)(void); extern int ofw_real_mode; @@ -182,16 +220,40 @@ SYSINIT(ofw_real_bounce_alloc, SI_SUB_KMEM, SI_ORDER_A ofw_real_bounce_alloc, NULL); static void +ofw_real_mtx_lock_spin(void) +{ + mtx_lock_spin(of_real_mtx); +} + +static void +ofw_real_mtx_lock(void) +{ + mtx_lock(of_real_mtx); +} + +static void +ofw_real_mtx_unlock_spin(void) +{ + mtx_unlock_spin(of_real_mtx); +} + +static void +ofw_real_mtx_unlock(void) +{ + mtx_unlock(of_real_mtx); +} + +static void ofw_real_start(void) { - mtx_lock(&of_bounce_mtx); + (*of_mtx_lock)(); of_bounce_offset = 0; } - + static void ofw_real_stop(void) { - mtx_unlock(&of_bounce_mtx); + (*of_mtx_unlock)(); } static void @@ -228,7 +290,7 @@ ofw_real_bounce_alloc(void *junk) * we have a 32-bit virtual address to give OF. */ - if (!ofw_real_mode && (!hw_direct_map || DMAP_BASE_ADDRESS != 0)) + if (!ofw_real_mode && (!hw_direct_map || DMAP_BASE_ADDRESS != 0)) pmap_kenter(of_bounce_phys, of_bounce_phys); mtx_unlock(&of_bounce_mtx); @@ -240,7 +302,7 @@ ofw_real_map(const void *buf, size_t len) static char emergency_buffer[255]; cell_t phys; - mtx_assert(&of_bounce_mtx, MA_OWNED); + mtx_assert(of_real_mtx, MA_OWNED); if (of_bounce_virt == NULL) { /* @@ -290,7 +352,7 @@ ofw_real_map(const void *buf, size_t len) static void ofw_real_unmap(cell_t physaddr, void *buf, size_t len) { - mtx_assert(&of_bounce_mtx, MA_OWNED); + mtx_assert(of_real_mtx, MA_OWNED); if (of_bounce_virt == NULL) return; @@ -306,9 +368,24 @@ ofw_real_unmap(cell_t physaddr, void *buf, size_t len) static int ofw_real_init(ofw_t ofw, void *openfirm) { - openfirmware = (int (*)(void *))openfirm; + int mtx_spin; + openfirmware = (int (*)(void *))openfirm; mtx_init(&of_bounce_mtx, "OF Bounce Page", NULL, MTX_DEF); + + mtx_spin = 0; + TUNABLE_INT_FETCH("machdep.ofw.mtx_spin", &mtx_spin); + if (mtx_spin) { + mtx_init(&of_spin_mtx, "OF Real", NULL, MTX_SPIN); + of_real_mtx = &of_spin_mtx; + of_mtx_lock = ofw_real_mtx_lock_spin; + of_mtx_unlock = ofw_real_mtx_unlock_spin; + } else { + of_real_mtx = &of_bounce_mtx; + of_mtx_lock = ofw_real_mtx_lock; + of_mtx_unlock = ofw_real_mtx_unlock; + } + of_bounce_virt = NULL; return (0); } Modified: head/sys/powerpc/pseries/platform_chrp.c ============================================================================== --- head/sys/powerpc/pseries/platform_chrp.c Mon Dec 9 13:09:32 2019 (r355555) +++ head/sys/powerpc/pseries/platform_chrp.c Mon Dec 9 13:40:23 2019 (r355556) @@ -133,6 +133,7 @@ chrp_probe(platform_t plat) static int chrp_attach(platform_t plat) { + int quiesce; #ifdef __powerpc64__ int i; @@ -175,7 +176,10 @@ chrp_attach(platform_t plat) chrp_cpuref_init(); /* Some systems (e.g. QEMU) need Open Firmware to stand down */ - ofw_quiesce(); + quiesce = 1; + TUNABLE_INT_FETCH("debug.quiesce_ofw", &quiesce); + if (quiesce) + ofw_quiesce(); return (0); } From owner-svn-src-all@freebsd.org Mon Dec 9 13:59:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E0DD1D765B; Mon, 9 Dec 2019 13:59:38 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47WlDp18k7z4djZ; Mon, 9 Dec 2019 13:59:38 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04CB31B929; Mon, 9 Dec 2019 13:59:38 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB9DxbBM031158; Mon, 9 Dec 2019 13:59:37 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9DxbTq031154; Mon, 9 Dec 2019 13:59:37 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201912091359.xB9DxbTq031154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 9 Dec 2019 13:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355557 - head/lib/libkvm X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/lib/libkvm X-SVN-Commit-Revision: 355557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 13:59:38 -0000 Author: luporl Date: Mon Dec 9 13:59:36 2019 New Revision: 355557 URL: https://svnweb.freebsd.org/changeset/base/355557 Log: [PPC64] Initial libkvm minidump implementation This change adds PowerPC64 support for minidumps on libkvm. Address translation, page walk, and data retrieval were tested and seem to be working correctly. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D21555 Added: head/lib/libkvm/kvm_minidump_powerpc64.c (contents, props changed) head/lib/libkvm/kvm_minidump_powerpc64_hpt.c (contents, props changed) head/lib/libkvm/kvm_powerpc64.h (contents, props changed) Modified: head/lib/libkvm/Makefile Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Mon Dec 9 13:40:23 2019 (r355556) +++ head/lib/libkvm/Makefile Mon Dec 9 13:59:36 2019 (r355557) @@ -19,6 +19,7 @@ SRCS= kvm.c kvm_cptime.c kvm_getloadavg.c \ kvm_minidump_mips.c \ kvm_powerpc.c kvm_powerpc64.c \ kvm_minidump_riscv.c \ + kvm_minidump_powerpc64.c kvm_minidump_powerpc64_hpt.c \ kvm_sparc64.c INCS= kvm.h Added: head/lib/libkvm/kvm_minidump_powerpc64.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/kvm_minidump_powerpc64.c Mon Dec 9 13:59:36 2019 (r355557) @@ -0,0 +1,202 @@ +/*- + * Copyright (c) 2006 Peter Wemm + * Copyright (c) 2019 Leandro Lupori + * + * 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. + * + * From: FreeBSD: src/lib/libkvm/kvm_minidump_riscv.c + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +#include +#include +#include +#include + +#include "../../sys/powerpc/include/minidump.h" +#include "kvm_private.h" +#include "kvm_powerpc64.h" + + +static int +_powerpc64_minidump_probe(kvm_t *kd) +{ + return (_kvm_probe_elf_kernel(kd, ELFCLASS64, EM_PPC64) && + _kvm_is_minidump(kd)); +} + +static void +_powerpc64_minidump_freevtop(kvm_t *kd) +{ + struct vmstate *vm = kd->vmst; + + if (vm == NULL) + return; + if (PPC64_MMU_OPS(kd)) + PPC64_MMU_OP(kd, cleanup); + free(vm); + kd->vmst = NULL; +} + +static int +_powerpc64_minidump_initvtop(kvm_t *kd) +{ + struct vmstate *vmst; + struct minidumphdr *hdr; + off_t bitmap_off, pmap_off, sparse_off; + const char *mmu_name; + + /* Alloc VM */ + vmst = _kvm_malloc(kd, sizeof(*vmst)); + if (vmst == NULL) { + _kvm_err(kd, kd->program, "cannot allocate vm"); + return (-1); + } + hdr = &vmst->hdr; + kd->vmst = vmst; + PPC64_MMU_OPS(kd) = NULL; + /* Read minidump header */ + if (pread(kd->pmfd, hdr, sizeof(*hdr), 0) != sizeof(*hdr)) { + _kvm_err(kd, kd->program, "cannot read minidump header"); + goto failed; + } + /* Check magic */ + if (strncmp(MINIDUMP_MAGIC, hdr->magic, sizeof(hdr->magic)) != 0) { + _kvm_err(kd, kd->program, "not a minidump for this platform"); + goto failed; + } + /* Check version */ + hdr->version = be32toh(hdr->version); + if (hdr->version != MINIDUMP_VERSION) { + _kvm_err(kd, kd->program, "wrong minidump version. " + "Expected %d got %d", MINIDUMP_VERSION, hdr->version); + goto failed; + } + /* Convert header fields to host endian */ + hdr->msgbufsize = be32toh(hdr->msgbufsize); + hdr->bitmapsize = be32toh(hdr->bitmapsize); + hdr->pmapsize = be32toh(hdr->pmapsize); + hdr->kernbase = be64toh(hdr->kernbase); + hdr->kernend = be64toh(hdr->kernend); + hdr->dmapbase = be64toh(hdr->dmapbase); + hdr->dmapend = be64toh(hdr->dmapend); + hdr->hw_direct_map = be32toh(hdr->hw_direct_map); + hdr->startkernel = be64toh(hdr->startkernel); + hdr->endkernel = be64toh(hdr->endkernel); + + vmst->kimg_start = PPC64_KERNBASE; + vmst->kimg_end = PPC64_KERNBASE + hdr->endkernel - hdr->startkernel; + + /* dump header */ + dprintf("%s: mmu_name=%s,\n\t" + "msgbufsize=0x%jx, bitmapsize=0x%jx, pmapsize=0x%jx, " + "kernbase=0x%jx, kernend=0x%jx,\n\t" + "dmapbase=0x%jx, dmapend=0x%jx, hw_direct_map=%d, " + "startkernel=0x%jx, endkernel=0x%jx\n\t" + "kimg_start=0x%jx, kimg_end=0x%jx\n", + __func__, hdr->mmu_name, + (uintmax_t)hdr->msgbufsize, + (uintmax_t)hdr->bitmapsize, (uintmax_t)hdr->pmapsize, + (uintmax_t)hdr->kernbase, (uintmax_t)hdr->kernend, + (uintmax_t)hdr->dmapbase, (uintmax_t)hdr->dmapend, + hdr->hw_direct_map, hdr->startkernel, hdr->endkernel, + (uintmax_t)vmst->kimg_start, (uintmax_t)vmst->kimg_end); + + /* Detect and initialize MMU */ + mmu_name = hdr->mmu_name; + if (strcmp(mmu_name, PPC64_MMU_G5) == 0 || + strcmp(mmu_name, PPC64_MMU_PHYP) == 0) + PPC64_MMU_OPS(kd) = ppc64_mmu_ops_hpt; + else { + _kvm_err(kd, kd->program, "unsupported MMU: %s", mmu_name); + goto failed; + } + if (PPC64_MMU_OP(kd, init) == -1) + goto failed; + + /* Get dump parts' offsets */ + bitmap_off = PPC64_PAGE_SIZE + ppc64_round_page(hdr->msgbufsize); + pmap_off = bitmap_off + ppc64_round_page(hdr->bitmapsize); + sparse_off = pmap_off + ppc64_round_page(hdr->pmapsize); + + /* dump offsets */ + dprintf("%s: msgbuf_off=0x%jx, bitmap_off=0x%jx, pmap_off=0x%jx, " + "sparse_off=0x%jx\n", + __func__, (uintmax_t)PPC64_PAGE_SIZE, (uintmax_t)bitmap_off, + (uintmax_t)pmap_off, (uintmax_t)sparse_off); + + /* build physical address lookup table for sparse pages */ + if (_kvm_pt_init(kd, hdr->bitmapsize, bitmap_off, sparse_off, + PPC64_PAGE_SIZE, sizeof(uint64_t)) == -1) + goto failed; + + if (_kvm_pmap_init(kd, hdr->pmapsize, pmap_off) == -1) + goto failed; + return (0); + +failed: + _powerpc64_minidump_freevtop(kd); + return (-1); +} + +static int +_powerpc64_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa) +{ + if (ISALIVE(kd)) { + _kvm_err(kd, 0, "%s called in live kernel!", __func__); + return (0); + } + return (PPC64_MMU_OP(kd, kvatop, va, pa)); +} + +static int +_powerpc64_native(kvm_t *kd __unused) +{ +#ifdef __powerpc64__ + return (1); +#else + return (0); +#endif +} + +static int +_powerpc64_minidump_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg) +{ + return (PPC64_MMU_OP(kd, walk_pages, cb, arg)); +} + +static struct kvm_arch kvm_powerpc64_minidump = { + .ka_probe = _powerpc64_minidump_probe, + .ka_initvtop = _powerpc64_minidump_initvtop, + .ka_freevtop = _powerpc64_minidump_freevtop, + .ka_kvatop = _powerpc64_minidump_kvatop, + .ka_walk_pages = _powerpc64_minidump_walk_pages, + .ka_native = _powerpc64_native, +}; + +KVM_ARCH(kvm_powerpc64_minidump); Added: head/lib/libkvm/kvm_minidump_powerpc64_hpt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/kvm_minidump_powerpc64_hpt.c Mon Dec 9 13:59:36 2019 (r355557) @@ -0,0 +1,666 @@ +/*- + * Copyright (c) 2006 Peter Wemm + * Copyright (c) 2019 Leandro Lupori + * + * 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. + * + * From: FreeBSD: src/lib/libkvm/kvm_minidump_riscv.c + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include "../../sys/powerpc/include/minidump.h" +#include "kvm_private.h" +#include "kvm_powerpc64.h" + +/* + * PowerPC64 HPT machine dependent routines for kvm and minidumps. + * + * Address Translation parameters: + * + * b = 12 (SLB base page size: 4 KB) + * b = 24 (SLB base page size: 16 MB) + * p = 12 (page size: 4 KB) + * p = 24 (page size: 16 MB) + * s = 28 (segment size: 256 MB) + */ + +/* Large (huge) page params */ +#define LP_PAGE_SHIFT 24 +#define LP_PAGE_SIZE (1ULL << LP_PAGE_SHIFT) +#define LP_PAGE_MASK 0x00ffffffULL + +/* SLB */ + +#define SEGMENT_LENGTH 0x10000000ULL + +#define round_seg(x) roundup2((uint64_t)(x), SEGMENT_LENGTH) + +/* Virtual real-mode VSID in LPARs */ +#define VSID_VRMA 0x1ffffffULL + +#define SLBV_L 0x0000000000000100ULL /* Large page selector */ +#define SLBV_CLASS 0x0000000000000080ULL /* Class selector */ +#define SLBV_LP_MASK 0x0000000000000030ULL +#define SLBV_VSID_MASK 0x3ffffffffffff000ULL /* Virtual SegID mask */ +#define SLBV_VSID_SHIFT 12 + +#define SLBE_B_MASK 0x0000000006000000ULL +#define SLBE_B_256MB 0x0000000000000000ULL +#define SLBE_VALID 0x0000000008000000ULL /* SLB entry valid */ +#define SLBE_INDEX_MASK 0x0000000000000fffULL /* SLB index mask */ +#define SLBE_ESID_MASK 0xfffffffff0000000ULL /* Effective SegID mask */ +#define SLBE_ESID_SHIFT 28 + +/* PTE */ + +#define LPTEH_VSID_SHIFT 12 +#define LPTEH_AVPN_MASK 0xffffffffffffff80ULL +#define LPTEH_B_MASK 0xc000000000000000ULL +#define LPTEH_B_256MB 0x0000000000000000ULL +#define LPTEH_BIG 0x0000000000000004ULL /* 4KB/16MB page */ +#define LPTEH_HID 0x0000000000000002ULL +#define LPTEH_VALID 0x0000000000000001ULL + +#define LPTEL_RPGN 0xfffffffffffff000ULL +#define LPTEL_LP_MASK 0x00000000000ff000ULL +#define LPTEL_NOEXEC 0x0000000000000004ULL + +/* Supervisor (U: RW, S: RW) */ +#define LPTEL_BW 0x0000000000000002ULL + +/* Both Read Only (U: RO, S: RO) */ +#define LPTEL_BR 0x0000000000000003ULL + +#define LPTEL_RW LPTEL_BW +#define LPTEL_RO LPTEL_BR + +/* + * PTE AVA field manipulation macros. + * + * AVA[0:54] = PTEH[2:56] + * AVA[VSID] = AVA[0:49] = PTEH[2:51] + * AVA[PAGE] = AVA[50:54] = PTEH[52:56] + */ +#define PTEH_AVA_VSID_MASK 0x3ffffffffffff000UL +#define PTEH_AVA_VSID_SHIFT 12 +#define PTEH_AVA_VSID(p) \ + (((p) & PTEH_AVA_VSID_MASK) >> PTEH_AVA_VSID_SHIFT) + +#define PTEH_AVA_PAGE_MASK 0x0000000000000f80UL +#define PTEH_AVA_PAGE_SHIFT 7 +#define PTEH_AVA_PAGE(p) \ + (((p) & PTEH_AVA_PAGE_MASK) >> PTEH_AVA_PAGE_SHIFT) + +/* Masks to obtain the Physical Address from PTE low 64-bit word. */ +#define PTEL_PA_MASK 0x0ffffffffffff000UL +#define PTEL_LP_PA_MASK 0x0fffffffff000000UL + +#define PTE_HASH_MASK 0x0000007fffffffffUL + +/* + * Number of AVA/VA page bits to shift right, in order to leave only the + * ones that should be considered. + * + * q = MIN(54, 77-b) (PowerISA v2.07B, 5.7.7.3) + * n = q + 1 - 50 (VSID size in bits) + * s(ava) = 5 - n + * s(va) = (28 - b) - n + * + * q: bit number of lower limit of VA/AVA bits to compare + * n: number of AVA/VA page bits to compare + * s: shift amount + * 28 - b: VA page size in bits + */ +#define AVA_PAGE_SHIFT(b) (5 - (MIN(54, 77-(b)) + 1 - 50)) +#define VA_PAGE_SHIFT(b) (28 - (b) - (MIN(54, 77-(b)) + 1 - 50)) + +/* Kernel ESID -> VSID mapping */ +#define KERNEL_VSID_BIT 0x0000001000000000UL /* Bit set in all kernel VSIDs */ +#define KERNEL_VSID(esid) ((((((uint64_t)esid << 8) | ((uint64_t)esid >> 28)) \ + * 0x13bbUL) & (KERNEL_VSID_BIT - 1)) | \ + KERNEL_VSID_BIT) + +/* Types */ + +typedef uint64_t ppc64_physaddr_t; + +typedef struct { + uint64_t slbv; + uint64_t slbe; +} ppc64_slb_entry_t; + +typedef struct { + uint64_t pte_hi; + uint64_t pte_lo; +} ppc64_pt_entry_t; + +struct hpt_data { + ppc64_slb_entry_t *slbs; + uint32_t slbsize; +}; + + +static void +slb_fill(ppc64_slb_entry_t *slb, uint64_t ea, uint64_t i) +{ + uint64_t esid; + + esid = ea >> SLBE_ESID_SHIFT; + slb->slbv = KERNEL_VSID(esid) << SLBV_VSID_SHIFT; + slb->slbe = (esid << SLBE_ESID_SHIFT) | SLBE_VALID | i; +} + +static int +slb_init(kvm_t *kd) +{ + struct minidumphdr *hdr; + struct hpt_data *data; + ppc64_slb_entry_t *slb; + uint32_t slbsize; + uint64_t ea, i, maxmem; + + hdr = &kd->vmst->hdr; + data = PPC64_MMU_DATA(kd); + + /* Alloc SLBs */ + maxmem = hdr->bitmapsize * 8 * PPC64_PAGE_SIZE; + slbsize = round_seg(hdr->kernend + 1 - hdr->kernbase + maxmem) / + SEGMENT_LENGTH * sizeof(ppc64_slb_entry_t); + data->slbs = _kvm_malloc(kd, slbsize); + if (data->slbs == NULL) { + _kvm_err(kd, kd->program, "cannot allocate slbs"); + return (-1); + } + data->slbsize = slbsize; + + dprintf("%s: maxmem=0x%jx, segs=%jd, slbsize=0x%jx\n", + __func__, (uintmax_t)maxmem, + (uintmax_t)slbsize / sizeof(ppc64_slb_entry_t), (uintmax_t)slbsize); + + /* + * Generate needed SLB entries. + * + * When translating addresses from EA to VA to PA, the needed SLB + * entry could be generated on the fly, but this is not the case + * for the walk_pages method, that needs to search the SLB entry + * by VSID, in order to find out the EA from a PTE. + */ + + /* VM area */ + for (ea = hdr->kernbase, i = 0, slb = data->slbs; + ea < hdr->kernend; ea += SEGMENT_LENGTH, i++, slb++) + slb_fill(slb, ea, i); + + /* DMAP area */ + for (ea = hdr->dmapbase; + ea < MIN(hdr->dmapend, hdr->dmapbase + maxmem); + ea += SEGMENT_LENGTH, i++, slb++) { + slb_fill(slb, ea, i); + if (hdr->hw_direct_map) + slb->slbv |= SLBV_L; + } + + return (0); +} + +static void +ppc64mmu_hpt_cleanup(kvm_t *kd) +{ + struct hpt_data *data; + + if (kd->vmst == NULL) + return; + + data = PPC64_MMU_DATA(kd); + free(data->slbs); + free(data); + PPC64_MMU_DATA(kd) = NULL; +} + +static int +ppc64mmu_hpt_init(kvm_t *kd) +{ + struct hpt_data *data; + struct minidumphdr *hdr; + + hdr = &kd->vmst->hdr; + + /* Alloc MMU data */ + data = _kvm_malloc(kd, sizeof(*data)); + if (data == NULL) { + _kvm_err(kd, kd->program, "cannot allocate MMU data"); + return (-1); + } + data->slbs = NULL; + PPC64_MMU_DATA(kd) = data; + + if (slb_init(kd) == -1) + goto failed; + + return (0); + +failed: + ppc64mmu_hpt_cleanup(kd); + return (-1); +} + +static ppc64_slb_entry_t * +slb_search(kvm_t *kd, kvaddr_t ea) +{ + struct hpt_data *data; + ppc64_slb_entry_t *slb; + int i, n; + + data = PPC64_MMU_DATA(kd); + slb = data->slbs; + n = data->slbsize / sizeof(ppc64_slb_entry_t); + + /* SLB search */ + for (i = 0; i < n; i++, slb++) { + if ((slb->slbe & SLBE_VALID) == 0) + continue; + + /* Compare 36-bit ESID of EA with segment one (64-s) */ + if ((slb->slbe & SLBE_ESID_MASK) != (ea & SLBE_ESID_MASK)) + continue; + + /* Match found */ + dprintf("SEG#%02d: slbv=0x%016jx, slbe=0x%016jx\n", + i, (uintmax_t)slb->slbv, (uintmax_t)slb->slbe); + break; + } + + /* SLB not found */ + if (i == n) { + _kvm_err(kd, kd->program, "%s: segment not found for EA 0x%jx", + __func__, (uintmax_t)ea); + return (NULL); + } + return (slb); +} + +static ppc64_pt_entry_t +pte_get(kvm_t *kd, u_long ptex) +{ + ppc64_pt_entry_t pte, *p; + + p = _kvm_pmap_get(kd, ptex, sizeof(pte)); + pte.pte_hi = be64toh(p->pte_hi); + pte.pte_lo = be64toh(p->pte_lo); + return (pte); +} + +static int +pte_search(kvm_t *kd, ppc64_slb_entry_t *slb, uint64_t hid, kvaddr_t ea, + ppc64_pt_entry_t *p) +{ + uint64_t hash, hmask; + uint64_t pteg, ptex; + uint64_t va_vsid, va_page; + int b; + int ava_pg_shift, va_pg_shift; + ppc64_pt_entry_t pte; + + /* + * Get VA: + * + * va(78) = va_vsid(50) || va_page(s-b) || offset(b) + * + * va_vsid: 50-bit VSID (78-s) + * va_page: (s-b)-bit VA page + */ + b = slb->slbv & SLBV_L? LP_PAGE_SHIFT : PPC64_PAGE_SHIFT; + va_vsid = (slb->slbv & SLBV_VSID_MASK) >> SLBV_VSID_SHIFT; + va_page = (ea & ~SLBE_ESID_MASK) >> b; + + dprintf("%s: hid=0x%jx, ea=0x%016jx, b=%d, va_vsid=0x%010jx, " + "va_page=0x%04jx\n", + __func__, (uintmax_t)hid, (uintmax_t)ea, b, + (uintmax_t)va_vsid, (uintmax_t)va_page); + + /* + * Get hash: + * + * Primary hash: va_vsid(11:49) ^ va_page(s-b) + * Secondary hash: ~primary_hash + */ + hash = (va_vsid & PTE_HASH_MASK) ^ va_page; + if (hid) + hash = ~hash & PTE_HASH_MASK; + + /* + * Get PTEG: + * + * pteg = (hash(0:38) & hmask) << 3 + * + * hmask (hash mask): mask generated from HTABSIZE || 11*0b1 + * hmask = number_of_ptegs - 1 + */ + hmask = kd->vmst->hdr.pmapsize / (8 * sizeof(ppc64_pt_entry_t)) - 1; + pteg = (hash & hmask) << 3; + + ava_pg_shift = AVA_PAGE_SHIFT(b); + va_pg_shift = VA_PAGE_SHIFT(b); + + dprintf("%s: hash=0x%010jx, hmask=0x%010jx, (hash & hmask)=0x%010jx, " + "pteg=0x%011jx, ava_pg_shift=%d, va_pg_shift=%d\n", + __func__, (uintmax_t)hash, (uintmax_t)hmask, + (uintmax_t)(hash & hmask), (uintmax_t)pteg, + ava_pg_shift, va_pg_shift); + + /* Search PTEG */ + for (ptex = pteg; ptex < pteg + 8; ptex++) { + pte = pte_get(kd, ptex); + + /* Check H, V and B */ + if ((pte.pte_hi & LPTEH_HID) != hid || + (pte.pte_hi & LPTEH_VALID) == 0 || + (pte.pte_hi & LPTEH_B_MASK) != LPTEH_B_256MB) + continue; + + /* Compare AVA with VA */ + if (PTEH_AVA_VSID(pte.pte_hi) != va_vsid || + (PTEH_AVA_PAGE(pte.pte_hi) >> ava_pg_shift) != + (va_page >> va_pg_shift)) + continue; + + /* + * Check if PTE[L] matches SLBV[L]. + * + * Note: this check ignores PTE[LP], as does the kernel. + */ + if (b == PPC64_PAGE_SHIFT) { + if (pte.pte_hi & LPTEH_BIG) + continue; + } else if ((pte.pte_hi & LPTEH_BIG) == 0) + continue; + + /* Match found */ + dprintf("%s: PTE found: ptex=0x%jx, pteh=0x%016jx, " + "ptel=0x%016jx\n", + __func__, (uintmax_t)ptex, (uintmax_t)pte.pte_hi, + (uintmax_t)pte.pte_lo); + break; + } + + /* Not found? */ + if (ptex == pteg + 8) { + /* Try secondary hash */ + if (hid == 0) + return (pte_search(kd, slb, LPTEH_HID, ea, p)); + else { + _kvm_err(kd, kd->program, + "%s: pte not found", __func__); + return (-1); + } + } + + /* PTE found */ + *p = pte; + return (0); +} + +static int +pte_lookup(kvm_t *kd, kvaddr_t ea, ppc64_pt_entry_t *pte) +{ + ppc64_slb_entry_t *slb; + + /* First, find SLB */ + if ((slb = slb_search(kd, ea)) == NULL) + return (-1); + + /* Next, find PTE */ + return (pte_search(kd, slb, 0, ea, pte)); +} + +static int +ppc64mmu_hpt_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa) +{ + struct minidumphdr *hdr; + struct vmstate *vm; + ppc64_pt_entry_t pte; + ppc64_physaddr_t pgoff, pgpa; + off_t ptoff; + int err; + + vm = kd->vmst; + hdr = &vm->hdr; + pgoff = va & PPC64_PAGE_MASK; + + dprintf("%s: va=0x%016jx\n", __func__, (uintmax_t)va); + + /* + * A common use case of libkvm is to first find a symbol address + * from the kernel image and then use kvatop to translate it and + * to be able to fetch its corresponding data. + * + * The problem is that, in PowerPC64 case, the addresses of relocated + * data won't match those in the kernel image. This is handled here by + * adding the relocation offset to those addresses. + */ + if (va < hdr->dmapbase) + va += hdr->startkernel - PPC64_KERNBASE; + + /* Handle DMAP */ + if (va >= hdr->dmapbase && va <= hdr->dmapend) { + pgpa = (va & ~hdr->dmapbase) & ~PPC64_PAGE_MASK; + ptoff = _kvm_pt_find(kd, pgpa, PPC64_PAGE_SIZE); + if (ptoff == -1) { + _kvm_err(kd, kd->program, "%s: " + "direct map address 0x%jx not in minidump", + __func__, (uintmax_t)va); + goto invalid; + } + *pa = ptoff + pgoff; + return (PPC64_PAGE_SIZE - pgoff); + /* Translate VA to PA */ + } else if (va >= hdr->kernbase) { + if ((err = pte_lookup(kd, va, &pte)) == -1) { + _kvm_err(kd, kd->program, + "%s: pte not valid", __func__); + goto invalid; + } + + if (pte.pte_hi & LPTEH_BIG) + pgpa = (pte.pte_lo & PTEL_LP_PA_MASK) | + (va & ~PPC64_PAGE_MASK & LP_PAGE_MASK); + else + pgpa = pte.pte_lo & PTEL_PA_MASK; + dprintf("%s: pgpa=0x%016jx\n", __func__, (uintmax_t)pgpa); + + ptoff = _kvm_pt_find(kd, pgpa, PPC64_PAGE_SIZE); + if (ptoff == -1) { + _kvm_err(kd, kd->program, "%s: " + "physical address 0x%jx not in minidump", + __func__, (uintmax_t)pgpa); + goto invalid; + } + *pa = ptoff + pgoff; + return (PPC64_PAGE_SIZE - pgoff); + } else { + _kvm_err(kd, kd->program, + "%s: virtual address 0x%jx not minidumped", + __func__, (uintmax_t)va); + goto invalid; + } + +invalid: + _kvm_err(kd, 0, "invalid address (0x%jx)", (uintmax_t)va); + return (0); +} + +static vm_prot_t +entry_to_prot(ppc64_pt_entry_t *pte) +{ + vm_prot_t prot = VM_PROT_READ; + + if (pte->pte_lo & LPTEL_RW) + prot |= VM_PROT_WRITE; + if ((pte->pte_lo & LPTEL_NOEXEC) != 0) + prot |= VM_PROT_EXECUTE; + return (prot); +} + +static ppc64_slb_entry_t * +slb_vsid_search(kvm_t *kd, uint64_t vsid) +{ + struct hpt_data *data; + ppc64_slb_entry_t *slb; + int i, n; + + data = PPC64_MMU_DATA(kd); + slb = data->slbs; + n = data->slbsize / sizeof(ppc64_slb_entry_t); + vsid <<= SLBV_VSID_SHIFT; + + /* SLB search */ + for (i = 0; i < n; i++, slb++) { + /* Check if valid and compare VSID */ + if ((slb->slbe & SLBE_VALID) && + (slb->slbv & SLBV_VSID_MASK) == vsid) + break; + } + + /* SLB not found */ + if (i == n) { + _kvm_err(kd, kd->program, + "%s: segment not found for VSID 0x%jx", + __func__, (uintmax_t)vsid >> SLBV_VSID_SHIFT); + return (NULL); + } + return (slb); +} + +static u_long +get_ea(kvm_t *kd, ppc64_pt_entry_t *pte, u_long ptex) +{ + ppc64_slb_entry_t *slb; + uint64_t ea, hash, vsid; + int b, shift; + + /* Find SLB */ + vsid = PTEH_AVA_VSID(pte->pte_hi); + if ((slb = slb_vsid_search(kd, vsid)) == NULL) + return (~0UL); + + /* Get ESID part of EA */ + ea = slb->slbe & SLBE_ESID_MASK; + + b = slb->slbv & SLBV_L? LP_PAGE_SHIFT : PPC64_PAGE_SHIFT; + + /* + * If there are less than 64K PTEGs (16-bit), the upper bits of + * EA page must be obtained from PTEH's AVA. + */ + if (kd->vmst->hdr.pmapsize / (8 * sizeof(ppc64_pt_entry_t)) < + 0x10000U) { + /* + * Add 0 to 5 EA bits, right after VSID. + * b == 12: 5 bits + * b == 24: 4 bits + */ + shift = AVA_PAGE_SHIFT(b); + ea |= (PTEH_AVA_PAGE(pte->pte_hi) >> shift) << + (SLBE_ESID_SHIFT - 5 + shift); + } + + /* Get VA page from hash and add to EA. */ + hash = (ptex & ~7) >> 3; + if (pte->pte_hi & LPTEH_HID) + hash = ~hash & PTE_HASH_MASK; + ea |= ((hash ^ (vsid & PTE_HASH_MASK)) << b) & ~SLBE_ESID_MASK; + return (ea); +} + +static int +ppc64mmu_hpt_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg) +{ + struct vmstate *vm; + int ret; + unsigned int pagesz; + u_long dva, pa, va; + u_long ptex, nptes; + uint64_t vsid; + + ret = 0; + vm = kd->vmst; + nptes = vm->hdr.pmapsize / sizeof(ppc64_pt_entry_t); + + /* Walk through PTEs */ + for (ptex = 0; ptex < nptes; ptex++) { + ppc64_pt_entry_t pte = pte_get(kd, ptex); + if ((pte.pte_hi & LPTEH_VALID) == 0) + continue; + + /* Skip non-kernel related pages, as well as VRMA ones */ + vsid = PTEH_AVA_VSID(pte.pte_hi); + if ((vsid & KERNEL_VSID_BIT) == 0 || + (vsid >> PPC64_PAGE_SHIFT) == VSID_VRMA) + continue; + + /* Retrieve page's VA (EA on PPC64 terminology) */ + if ((va = get_ea(kd, &pte, ptex)) == ~0UL) + goto out; + + /* Get PA and page size */ + if (pte.pte_hi & LPTEH_BIG) { + pa = pte.pte_lo & PTEL_LP_PA_MASK; + pagesz = LP_PAGE_SIZE; + } else { + pa = pte.pte_lo & PTEL_PA_MASK; + pagesz = PPC64_PAGE_SIZE; + } + + /* Get DMAP address */ + dva = vm->hdr.dmapbase + pa; + + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + entry_to_prot(&pte), pagesz, 0)) + goto out; + } + ret = 1; + +out: + return (ret); +} + + +static struct ppc64_mmu_ops ops = { + .init = ppc64mmu_hpt_init, + .cleanup = ppc64mmu_hpt_cleanup, + .kvatop = ppc64mmu_hpt_kvatop, + .walk_pages = ppc64mmu_hpt_walk_pages, +}; +struct ppc64_mmu_ops *ppc64_mmu_ops_hpt = &ops; Added: head/lib/libkvm/kvm_powerpc64.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/kvm_powerpc64.h Mon Dec 9 13:59:36 2019 (r355557) @@ -0,0 +1,81 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Leandro Lupori + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __KVM_POWERPC64_H__ +#define __KVM_POWERPC64_H__ + +/* Debug stuff */ +#define KVM_PPC64_DBG 0 +#if KVM_PPC64_DBG +#include +#define dprintf(fmt, ...) printf(fmt, ## __VA_ARGS__) +#else +#define dprintf(fmt, ...) +#endif + + +#define PPC64_KERNBASE 0x100100ULL + +/* Page params */ +#define PPC64_PAGE_SHIFT 12 +#define PPC64_PAGE_SIZE (1ULL << PPC64_PAGE_SHIFT) +#define PPC64_PAGE_MASK (PPC64_PAGE_SIZE - 1) + +#define ppc64_round_page(x) roundup2((kvaddr_t)(x), PPC64_PAGE_SIZE) + +#define PPC64_MMU_G5 "mmu_g5" +#define PPC64_MMU_PHYP "mmu_phyp" + +/* MMU interface */ +#define PPC64_MMU_OPS(kd) (kd)->vmst->mmu.ops +#define PPC64_MMU_OP(kd, op, ...) PPC64_MMU_OPS(kd)->op((kd), ## __VA_ARGS__) +#define PPC64_MMU_DATA(kd) (kd)->vmst->mmu.data + +struct ppc64_mmu_ops { + int (*init)(kvm_t *); + void (*cleanup)(kvm_t *); + int (*kvatop)(kvm_t *, kvaddr_t, off_t *); + int (*walk_pages)(kvm_t *, kvm_walk_pages_cb_t *, void *); +}; + +struct ppc64_mmu { + struct ppc64_mmu_ops *ops; + void *data; +}; + +struct vmstate { + struct minidumphdr hdr; + uint64_t kimg_start; + uint64_t kimg_end; + struct ppc64_mmu mmu; +}; + +extern struct ppc64_mmu_ops *ppc64_mmu_ops_hpt; + +#endif /* !__KVM_POWERPC64_H__ */ From owner-svn-src-all@freebsd.org Mon Dec 9 14:38:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 805CD1D843A; Mon, 9 Dec 2019 14:38:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47Wm5K2s5Wz3CTW; Mon, 9 Dec 2019 14:38:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 509421D29B; Mon, 9 Dec 2019 14:38:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f177.google.com with SMTP id r14so5037786qke.13; Mon, 09 Dec 2019 06:38:13 -0800 (PST) X-Gm-Message-State: APjAAAUUW+i0Dra7HnwJBBHJGQXnuDLhcMLyBLoh3pJjslrYc6S2Dfhl VMqZN+iBkzY/QgDqIaeCPDixt6MbVDI7cNN20JY= X-Google-Smtp-Source: APXvYqwAhYCbsbXwXnsqbcxtkoNZts7hzYW/szXBicNuzO36lX1dwiZwd7YF30F4/lfxFF6r6twcZAVQq4BbfCK81hs= X-Received: by 2002:a37:4fd0:: with SMTP id d199mr28124113qkb.103.1575902292638; Mon, 09 Dec 2019 06:38:12 -0800 (PST) MIME-Version: 1.0 References: <201912071614.xB7GENQ3080793@repo.freebsd.org> In-Reply-To: <201912071614.xB7GENQ3080793@repo.freebsd.org> From: Kyle Evans Date: Mon, 9 Dec 2019 08:38:01 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r355487 - in head/sys: arm64/arm64 arm64/include conf To: Michal Meloun Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 14:38:13 -0000 On Sat, Dec 7, 2019 at 10:14 AM Michal Meloun wrote: > > Author: mmel > Date: Sat Dec 7 16:14:23 2019 > New Revision: 355487 > URL: https://svnweb.freebsd.org/changeset/base/355487 > > Log: > Add support for booting kernel directly from U-Boot using booti command. > > In some cases, like is locked bootstrap or device's inability to boot from > removable media, we cannot use standard boot sequence and is necessary to > boot kernel directly from U-Boot. > > Discussed with: jhibbits > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D13861 > > Added: > head/sys/arm64/arm64/machdep_boot.c (contents, props changed) > Modified: > head/sys/arm64/arm64/locore.S > head/sys/arm64/arm64/machdep.c > head/sys/arm64/include/machdep.h > head/sys/conf/Makefile.arm64 > head/sys/conf/files.arm64 > head/sys/conf/options.arm64 > > [... snip ...] > Added: head/sys/arm64/arm64/machdep_boot.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/arm64/arm64/machdep_boot.c Sat Dec 7 16:14:23 2019 (r355487) > @@ -0,0 +1,254 @@ > +/*- > + * Copyright (c) 2004 Olivier Houchard > + * Copyright (c) 1994-1998 Mark Brinicombe. > + * Copyright (c) 1994 Brini. > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include "opt_platform.h" > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#ifdef FDT > +#include > +#endif > + > +#include > +#include > +#include > +#include > + > +#ifdef FDT > +#include > +#include > +#endif > + > +extern int *end; > +static char *loader_envp; > +static char static_kenv[4096]; > + > + > +#ifdef FDT > +#define CMDLINE_GUARD "FreeBSD:" > +#define LBABI_MAX_COMMAND_LINE 512 > +static char linux_command_line[LBABI_MAX_COMMAND_LINE + 1]; > +#endif > + > +/* > + * Fake up a boot descriptor table > + */ > + #define PRELOAD_PUSH_VALUE(type, value) do { \ > + *(type *)(preload_ptr + size) = (value); \ > + size += sizeof(type); \ > +} while (0) > + > + #define PRELOAD_PUSH_STRING(str) do { \ > + uint32_t ssize; \ > + ssize = strlen(str) + 1; \ > + PRELOAD_PUSH_VALUE(uint32_t, ssize); \ > + strcpy((char*)(preload_ptr + size), str); \ > + size += ssize; \ > + size = roundup(size, sizeof(u_long)); \ > +} while (0) > + > + > +/* Build minimal set of metatda. */ > +static vm_offset_t > +fake_preload_metadata(void *dtb_ptr, size_t dtb_size) > +{ > +#ifdef DDB > + vm_offset_t zstart = 0, zend = 0; > +#endif > + vm_offset_t lastaddr; > + static char fake_preload[256]; > + caddr_t preload_ptr; > + size_t size; > + > + preload_ptr = (caddr_t)&fake_preload[0]; > + size = 0; > + > + PRELOAD_PUSH_VALUE(uint32_t, MODINFO_NAME); > + PRELOAD_PUSH_STRING("kernel"); > + > + PRELOAD_PUSH_VALUE(uint32_t, MODINFO_TYPE); > + PRELOAD_PUSH_STRING("elf kernel"); > + > + PRELOAD_PUSH_VALUE(uint32_t, MODINFO_ADDR); > + PRELOAD_PUSH_VALUE(uint32_t, sizeof(vm_offset_t)); > + PRELOAD_PUSH_VALUE(uint64_t, VM_MIN_KERNEL_ADDRESS); > + > + PRELOAD_PUSH_VALUE(uint32_t, MODINFO_SIZE); > + PRELOAD_PUSH_VALUE(uint32_t, sizeof(size_t)); > + PRELOAD_PUSH_VALUE(uint64_t, (size_t)(&end - VM_MIN_KERNEL_ADDRESS)); > +#ifdef DDB > + if (*(uint64_t *)VM_MIN_KERNEL_ADDRESS == MAGIC_TRAMP_NUMBER) { > + PRELOAD_PUSH_VALUE(uint32_t, MODINFO_METADATA|MODINFOMD_SSYM); > + PRELOAD_PUSH_VALUE(uint32_t, sizeof(vm_offset_t)); > + PRELOAD_PUSH_VALUE(uint64_t, > + *(uint64_t *)(VM_MIN_KERNEL_ADDRESS + 4)); > + > + PRELOAD_PUSH_VALUE(uint32_t, MODINFO_METADATA | MODINFOMD_ESYM); > + PRELOAD_PUSH_VALUE(uint32_t, sizeof(vm_offset_t)); > + PRELOAD_PUSH_VALUE(uint64_t, > + *(uint64_t *)(VM_MIN_KERNEL_ADDRESS + 8)); > + > + lastaddr = *(uint64_t *)(VM_MIN_KERNEL_ADDRESS + 8); > + zend = lastaddr; > + zstart = *(uint64_t *)(VM_MIN_KERNEL_ADDRESS + 4); > + db_fetch_ksymtab(zstart, zend); > + } else > +#endif > + lastaddr = (vm_offset_t)&end; > + if (dtb_ptr != NULL) { > + /* Copy DTB to KVA space and insert it into module chain. */ > + lastaddr = roundup(lastaddr, sizeof(int)); > + PRELOAD_PUSH_VALUE(uint32_t, MODINFO_METADATA | MODINFOMD_DTBP); > + PRELOAD_PUSH_VALUE(uint32_t, sizeof(uint64_t)); > + PRELOAD_PUSH_VALUE(uint64_t, (uint64_t)lastaddr); > + memmove((void *)lastaddr, dtb_ptr, dtb_size); > + lastaddr += dtb_size; > + lastaddr = roundup(lastaddr, sizeof(int)); > + } > + /* End marker */ > + PRELOAD_PUSH_VALUE(uint32_t, 0); > + PRELOAD_PUSH_VALUE(uint32_t, 0); > + > + preload_metadata = (caddr_t)(uintptr_t)fake_preload; > + > + init_static_kenv(NULL, 0); > + > + return (lastaddr); > +} > + > +#ifdef FDT > + > +/* Convert the U-Boot command line into FreeBSD kenv and boot options. */ > +static void > +cmdline_set_env(char *cmdline, const char *guard) > +{ > + size_t guard_len; > + > + /* Skip leading spaces. */ > + while (isspace(*cmdline)) > + cmdline++; > + > + /* Test and remove guard. */ > + if (guard != NULL && guard[0] != '\0') { > + guard_len = strlen(guard); > + if (strncasecmp(cmdline, guard, guard_len) != 0) > + return; > + cmdline += guard_len; > + } > + > + boothowto |= boot_parse_cmdline(cmdline); > +} > + > +void > +parse_fdt_bootargs(void) > +{ > + > + if (loader_envp == NULL && fdt_get_chosen_bootargs(linux_command_line, > + LBABI_MAX_COMMAND_LINE) == 0) { > + init_static_kenv(static_kenv, sizeof(static_kenv)); > + cmdline_set_env(linux_command_line, CMDLINE_GUARD); > + } > +} > + > +#endif > + > +#if defined(LINUX_BOOT_ABI) && defined(FDT) > +static vm_offset_t > +linux_parse_boot_param(struct arm64_bootparams *abp) > +{ > + struct fdt_header *dtb_ptr; > + size_t dtb_size; > + > + if (abp->modulep == 0) > + return (0); > + /* Test if modulep point to valid DTB. */ > + dtb_ptr = (struct fdt_header *)abp->modulep; > + if (fdt_check_header(dtb_ptr) != 0) > + return (0); > + dtb_size = fdt_totalsize(dtb_ptr); > + return (fake_preload_metadata(dtb_ptr, dtb_size)); > +} > + > +#endif > + > +static vm_offset_t > +freebsd_parse_boot_param(struct arm64_bootparams *abp) > +{ > + vm_offset_t lastaddr = 0; > + void *kmdp; > +#ifdef DDB > + vm_offset_t ksym_start; > + vm_offset_t ksym_end; > +#endif > + > + if (abp->modulep == 0) > + return (0); > + > + preload_metadata = (caddr_t)(uintptr_t)(abp->modulep); > + kmdp = preload_search_by_type("elf kernel"); > + if (kmdp == NULL) > + return (0); > + > + boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); > + loader_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); > + init_static_kenv(static_kenv, 0); This should read "loader_envp" instead of "static_kenv" -- as written, it stomps over the kenv provided by loader. > [ ... snip ...] Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Mon Dec 9 15:23:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A05E1D9085; Mon, 9 Dec 2019 15:23:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47Wn560pQ4z3FVf; Mon, 9 Dec 2019 15:23:06 +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 16C8F1C93E; Mon, 9 Dec 2019 15:23:06 +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 xB9FN5Or084037; Mon, 9 Dec 2019 15:23:05 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9FN5n9084036; Mon, 9 Dec 2019 15:23:05 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201912091523.xB9FN5n9084036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 9 Dec 2019 15:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355558 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 355558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 15:23:06 -0000 Author: manu Date: Mon Dec 9 15:23:05 2019 New Revision: 355558 URL: https://svnweb.freebsd.org/changeset/base/355558 Log: arm64: Use the kenv provided by loader Otherwise we have an empty kenv a likely cannot boot. Submitted by: kevans MFC after: 1 month X-MFC-With: 355487 Modified: head/sys/arm64/arm64/machdep_boot.c Modified: head/sys/arm64/arm64/machdep_boot.c ============================================================================== --- head/sys/arm64/arm64/machdep_boot.c Mon Dec 9 13:59:36 2019 (r355557) +++ head/sys/arm64/arm64/machdep_boot.c Mon Dec 9 15:23:05 2019 (r355558) @@ -223,7 +223,7 @@ freebsd_parse_boot_param(struct arm64_bootparams *abp) boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); loader_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); - init_static_kenv(static_kenv, 0); + init_static_kenv(loader_envp, 0); lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t); #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); From owner-svn-src-all@freebsd.org Mon Dec 9 15:30:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 045EF1D9291; Mon, 9 Dec 2019 15:30:13 +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 47WnFJ6Kj5z3FvF; Mon, 9 Dec 2019 15:30:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D457A1C96C; Mon, 9 Dec 2019 15:30:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB9FUCBB084579; Mon, 9 Dec 2019 15:30:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9FUCkm084578; Mon, 9 Dec 2019 15:30:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912091530.xB9FUCkm084578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Dec 2019 15:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355559 - in stable: 11/release/arm 12/release/arm 12/release/arm64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/release/arm 12/release/arm 12/release/arm64 X-SVN-Commit-Revision: 355559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 15:30:13 -0000 Author: kevans Date: Mon Dec 9 15:30:12 2019 New Revision: 355559 URL: https://svnweb.freebsd.org/changeset/base/355559 Log: MFC r355424: release: chase ports r519089 (rpi-firmware update) Modified: stable/11/release/arm/RPI-B.conf Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/release/arm/RPI-B.conf stable/12/release/arm64/RPI3.conf Directory Properties: stable/12/ (props changed) Modified: stable/11/release/arm/RPI-B.conf ============================================================================== --- stable/11/release/arm/RPI-B.conf Mon Dec 9 15:23:05 2019 (r355558) +++ stable/11/release/arm/RPI-B.conf Mon Dec 9 15:30:12 2019 (r355559) @@ -16,7 +16,7 @@ NODOC=1 UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi" RPI_FIRMWARE_DIR="/usr/local/share/rpi-firmware" OL_DIR="${RPI_FIRMWARE_DIR}/overlays" -OVERLAYS="mmc.dtbo pi3-disable-bt.dtbo" +OVERLAYS="mmc.dtbo disable-bt.dtbo" PART_SCHEME="MBR" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" @@ -25,8 +25,8 @@ arm_install_uboot() { RPI_FIRMWARE_FILES="bootcode.bin config.txt \ fixup.dat fixup_cd.dat fixup_db.dat fixup_x.dat \ start.elf start_cd.elf start_db.elf start_x.elf \ - bcm2708-rpi-0-w.dtb bcm2708-rpi-b-plus.dtb bcm2708-rpi-b.dtb \ - bcm2708-rpi-cm.dtb" + bcm2708-rpi-zero-w.dtb bcm2708-rpi-b-plus.dtb \ + bcm2708-rpi-b.dtb bcm2708-rpi-cm.dtb" FATMOUNT="${DESTDIR%${KERNEL}}/fat" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} From owner-svn-src-all@freebsd.org Mon Dec 9 15:30:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E6D11D9295; Mon, 9 Dec 2019 15:30:13 +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 47WnFK3F7Tz3FvG; Mon, 9 Dec 2019 15:30:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 507501C96D; Mon, 9 Dec 2019 15:30:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB9FUDEg084586; Mon, 9 Dec 2019 15:30:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9FUCqJ084584; Mon, 9 Dec 2019 15:30:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912091530.xB9FUCqJ084584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Dec 2019 15:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355559 - in stable: 11/release/arm 12/release/arm 12/release/arm64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/release/arm 12/release/arm 12/release/arm64 X-SVN-Commit-Revision: 355559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 15:30:13 -0000 Author: kevans Date: Mon Dec 9 15:30:12 2019 New Revision: 355559 URL: https://svnweb.freebsd.org/changeset/base/355559 Log: MFC r355424: release: chase ports r519089 (rpi-firmware update) Modified: stable/12/release/arm/RPI-B.conf stable/12/release/arm64/RPI3.conf Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/release/arm/RPI-B.conf Directory Properties: stable/11/ (props changed) Modified: stable/12/release/arm/RPI-B.conf ============================================================================== --- stable/12/release/arm/RPI-B.conf Mon Dec 9 15:23:05 2019 (r355558) +++ stable/12/release/arm/RPI-B.conf Mon Dec 9 15:30:12 2019 (r355559) @@ -16,7 +16,7 @@ NODOC=1 UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi" RPI_FIRMWARE_DIR="/usr/local/share/rpi-firmware" OL_DIR="${RPI_FIRMWARE_DIR}/overlays" -OVERLAYS="mmc.dtbo pi3-disable-bt.dtbo" +OVERLAYS="mmc.dtbo disable-bt.dtbo" PART_SCHEME="MBR" export BOARDNAME="RPI-B" @@ -25,8 +25,8 @@ arm_install_uboot() { RPI_FIRMWARE_FILES="bootcode.bin config.txt \ fixup.dat fixup_cd.dat fixup_db.dat fixup_x.dat \ start.elf start_cd.elf start_db.elf start_x.elf \ - bcm2708-rpi-0-w.dtb bcm2708-rpi-b-plus.dtb bcm2708-rpi-b.dtb \ - bcm2708-rpi-cm.dtb" + bcm2708-rpi-zero-w.dtb bcm2708-rpi-b-plus.dtb \ + bcm2708-rpi-b.dtb bcm2708-rpi-cm.dtb" FATMOUNT="${DESTDIR%${KERNEL}}/fat" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} Modified: stable/12/release/arm64/RPI3.conf ============================================================================== --- stable/12/release/arm64/RPI3.conf Mon Dec 9 15:23:05 2019 (r355558) +++ stable/12/release/arm64/RPI3.conf Mon Dec 9 15:30:12 2019 (r355559) @@ -4,7 +4,7 @@ # DTB_DIR="/usr/local/share/rpi-firmware" -DTB="bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb" +DTB="bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb bcm2711-rpi-4-b.dtb" EMBEDDED_TARGET_ARCH="aarch64" EMBEDDED_TARGET="arm64" EMBEDDEDBUILD=1 @@ -16,14 +16,14 @@ KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 OL_DIR="${DTB_DIR}/overlays" -OVERLAYS="mmc.dtbo pwm.dtbo pi3-disable-bt.dtbo" +OVERLAYS="mmc.dtbo pwm.dtbo disable-bt.dtbo" PART_SCHEME="MBR" export BOARDNAME="RPI3" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi3" UBOOT_FILES="README u-boot.bin" - DTB_FILES="armstub8.bin bootcode.bin fixup_cd.dat \ + DTB_FILES="armstub8.bin armstub8-gic.bin bootcode.bin fixup_cd.dat \ fixup_db.dat fixup_x.dat fixup.dat LICENCE.broadcom \ start_cd.elf start_db.elf start_x.elf start.elf ${DTB}" FATMOUNT="${DESTDIR%${KERNEL}}fat" @@ -37,6 +37,8 @@ arm_install_uboot() { chroot ${CHROOTDIR} cp -p ${DTB_DIR}/${_DF} \ ${FATMOUNT}/${_DF} done + chroot ${CHROOTDIR} cp -p ${DTB_DIR}/config_rpi4.txt \ + ${FATMOUNT} chroot ${CHROOTDIR} cp -p ${DTB_DIR}/config_rpi3.txt \ ${FATMOUNT}/config.txt chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays From owner-svn-src-all@freebsd.org Mon Dec 9 16:21:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 794EE1DA2C6; Mon, 9 Dec 2019 16:21:27 +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 47WpNR3MDWz3JxK; Mon, 9 Dec 2019 16:21:27 +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 6E4521D2E0; Mon, 9 Dec 2019 16:21:27 +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 xB9GLR4e017111; Mon, 9 Dec 2019 16:21:27 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9GLQLE017107; Mon, 9 Dec 2019 16:21:26 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201912091621.xB9GLQLE017107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 9 Dec 2019 16:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355560 - in stable/12/stand/efi: include libefi X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in stable/12/stand/efi: include libefi X-SVN-Commit-Revision: 355560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 16:21:27 -0000 Author: tsoome Date: Mon Dec 9 16:21:26 2019 New Revision: 355560 URL: https://svnweb.freebsd.org/changeset/base/355560 Log: MFC r355224, r355308, r355392: loader.efi: efipart needs better support detecting nested partitions Just as disks can have nested partitions, the same happens with cd devices, so we need to detect device paths and make sure we will not mix the handles. To address this: we fetch handle array and create linked list of block devices. we walk the list and detect parent devices and set children pd_parent. for {fd, cd, hd}, we walk device list and pick up our devices and store to corresponding list. We make sure we store parent device first. For sorting we use 3 steps: We check for floppy, we check for cd and then everything else must be hd. In general, it seems the floppy devices have no parent. CD can have both parents and children (multiple boot entries, partitions from the hybrid disk image). Tested by: cross+freebsd@distal.com on Cisco UCS systems, C200 series (C220M5, C240M4, C220M3). Also on MBP with UEFI 1.10 Modified: stable/12/stand/efi/include/efidevp.h stable/12/stand/efi/include/efilib.h stable/12/stand/efi/libefi/devpath.c stable/12/stand/efi/libefi/efipart.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/efi/include/efidevp.h ============================================================================== --- stable/12/stand/efi/include/efidevp.h Mon Dec 9 15:30:12 2019 (r355559) +++ stable/12/stand/efi/include/efidevp.h Mon Dec 9 16:21:26 2019 (r355560) @@ -288,6 +288,14 @@ typedef struct _UART_DEVICE_PATH { #define DEVICE_PATH_MESSAGING_VT_UTF8 \ { 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88} } +/* Device Logical Unit SubType. */ +#define MSG_DEVICE_LOGICAL_UNIT_DP 0x11 +typedef struct { + EFI_DEVICE_PATH Header; + /* Logical Unit Number for the interface. */ + UINT8 Lun; +} DEVICE_LOGICAL_UNIT_DEVICE_PATH; + #define MSG_SATA_DP 0x12 typedef struct _SATA_DEVICE_PATH { EFI_DEVICE_PATH Header; Modified: stable/12/stand/efi/include/efilib.h ============================================================================== --- stable/12/stand/efi/include/efilib.h Mon Dec 9 15:30:12 2019 (r355559) +++ stable/12/stand/efi/include/efilib.h Mon Dec 9 16:21:26 2019 (r355560) @@ -84,6 +84,7 @@ int efi_handle_update_dev(EFI_HANDLE, struct devsw *, EFI_DEVICE_PATH *efi_lookup_image_devpath(EFI_HANDLE); EFI_DEVICE_PATH *efi_lookup_devpath(EFI_HANDLE); +void efi_close_devpath(EFI_HANDLE); EFI_HANDLE efi_devpath_handle(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_devpath_last_node(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_devpath_trim(EFI_DEVICE_PATH *); Modified: stable/12/stand/efi/libefi/devpath.c ============================================================================== --- stable/12/stand/efi/libefi/devpath.c Mon Dec 9 15:30:12 2019 (r355559) +++ stable/12/stand/efi/libefi/devpath.c Mon Dec 9 16:21:26 2019 (r355560) @@ -68,6 +68,16 @@ efi_lookup_devpath(EFI_HANDLE handle) return (devpath); } +void +efi_close_devpath(EFI_HANDLE handle) +{ + EFI_STATUS status; + + status = BS->CloseProtocol(handle, &DevicePathGUID, IH, NULL); + if (EFI_ERROR(status)) + printf("CloseProtocol error: %lu\n", EFI_ERROR_CODE(status)); +} + static char * efi_make_tail(char *suffix) { Modified: stable/12/stand/efi/libefi/efipart.c ============================================================================== --- stable/12/stand/efi/libefi/efipart.c Mon Dec 9 15:30:12 2019 (r355559) +++ stable/12/stand/efi/libefi/efipart.c Mon Dec 9 16:21:26 2019 (r355560) @@ -44,9 +44,11 @@ __FBSDID("$FreeBSD$"); static EFI_GUID blkio_guid = BLOCK_IO_PROTOCOL; +typedef bool (*pd_test_cb_t)(pdinfo_t *, pdinfo_t *); static int efipart_initfd(void); static int efipart_initcd(void); static int efipart_inithd(void); +static void efipart_cdinfo_add(pdinfo_t *); static int efipart_strategy(void *, int, daddr_t, size_t, char *, size_t *); static int efipart_realstrategy(void *, int, daddr_t, size_t, char *, size_t *); @@ -209,6 +211,139 @@ efiblk_pdinfo_count(pdinfo_list_t *pdi) return (i); } +static pdinfo_t * +efipart_find_parent(pdinfo_list_t *pdi, EFI_DEVICE_PATH *devpath) +{ + pdinfo_t *pd; + EFI_DEVICE_PATH *parent; + + /* We want to find direct parent */ + parent = efi_devpath_trim(devpath); + /* We should not get out of memory here but be careful. */ + if (parent == NULL) + return (NULL); + + STAILQ_FOREACH(pd, pdi, pd_link) { + /* We must have exact match. */ + if (efi_devpath_match(pd->pd_devpath, parent)) + break; + } + free(parent); + return (pd); +} + +/* + * Return true when we should ignore this device. + */ +static bool +efipart_ignore_device(EFI_HANDLE h, EFI_BLOCK_IO *blkio, + EFI_DEVICE_PATH *devpath) +{ + EFI_DEVICE_PATH *node, *parent; + + /* + * We assume the block size 512 or greater power of 2. + * Also skip devices with block size > 64k (16 is max + * ashift supported by zfs). + * iPXE is known to insert stub BLOCK IO device with + * BlockSize 1. + */ + if (blkio->Media->BlockSize < 512 || + blkio->Media->BlockSize > (1 << 16) || + !powerof2(blkio->Media->BlockSize)) { + efi_close_devpath(h); + return (true); + } + + /* Allowed values are 0, 1 and power of 2. */ + if (blkio->Media->IoAlign > 1 && + !powerof2(blkio->Media->IoAlign)) { + efi_close_devpath(h); + return (true); + } + + /* + * With device tree setup: + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0) + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x1) + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x2) + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x3) + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x3)/CDROM.. + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x3)/CDROM.. + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x4) + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x5) + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x6) + * PciRoot(0x0)/Pci(0x14,0x0)/USB(0x5,0)/USB(0x2,0x0)/Unit(0x7) + * + * In above exmple only Unit(0x3) has media, all other nodes are + * missing media and should not be used. + * + * No media does not always mean there is no device, but in above + * case, we can not really assume there is any device. + * Therefore, if this node is USB, or this node is Unit (LUN) and + * direct parent is USB and we have no media, we will ignore this + * device. + * + * Variation of the same situation, but with SCSI devices: + * PciRoot(0x0)/Pci(0x1a,0x0)/USB(0x1,0)/USB(0x3,0x0)/SCSI(0x0,0x1) + * PciRoot(0x0)/Pci(0x1a,0x0)/USB(0x1,0)/USB(0x3,0x0)/SCSI(0x0,0x2) + * PciRoot(0x0)/Pci(0x1a,0x0)/USB(0x1,0)/USB(0x3,0x0)/SCSI(0x0,0x3) + * PciRoot(0x0)/Pci(0x1a,0x0)/USB(0x1,0)/USB(0x3,0x0)/SCSI(0x0,0x3)/CD.. + * PciRoot(0x0)/Pci(0x1a,0x0)/USB(0x1,0)/USB(0x3,0x0)/SCSI(0x0,0x3)/CD.. + * PciRoot(0x0)/Pci(0x1a,0x0)/USB(0x1,0)/USB(0x3,0x0)/SCSI(0x0,0x4) + * + * Here above the SCSI luns 1,2 and 4 have no media. + */ + + /* Do not ignore device with media. */ + if (blkio->Media->MediaPresent) + return (false); + + node = efi_devpath_last_node(devpath); + if (node == NULL) + return (false); + + /* USB without media present */ + if (DevicePathType(node) == MESSAGING_DEVICE_PATH && + DevicePathSubType(node) == MSG_USB_DP) { + efi_close_devpath(h); + return (true); + } + + parent = efi_devpath_trim(devpath); + if (parent != NULL) { + bool parent_is_usb = false; + + node = efi_devpath_last_node(parent); + if (node == NULL) { + free(parent); + return (false); + } + if (DevicePathType(node) == MESSAGING_DEVICE_PATH && + DevicePathSubType(node) == MSG_USB_DP) + parent_is_usb = true; + free(parent); + + node = efi_devpath_last_node(devpath); + if (node == NULL) + return (false); + if (parent_is_usb && + DevicePathType(node) == MESSAGING_DEVICE_PATH) { + /* + * no media, parent is USB and devicepath is + * LUN or SCSI. + */ + if (DevicePathSubType(node) == + MSG_DEVICE_LOGICAL_UNIT_DP || + DevicePathSubType(node) == MSG_SCSI_DP) { + efi_close_devpath(h); + return (true); + } + } + } + return (false); +} + int efipart_inithandles(void) { @@ -256,25 +391,9 @@ efipart_inithandles(void) continue; } - /* - * We assume the block size 512 or greater power of 2. - * Also skip devices with block size > 64k (16 is max - * ashift supported by zfs). - * iPXE is known to insert stub BLOCK IO device with - * BlockSize 1. - */ - if (blkio->Media->BlockSize < 512 || - blkio->Media->BlockSize > (1 << 16) || - !powerof2(blkio->Media->BlockSize)) { + if (efipart_ignore_device(hin[i], blkio, devpath)) continue; - } - /* Allowed values are 0, 1 and power of 2. */ - if (blkio->Media->IoAlign > 1 && - !powerof2(blkio->Media->IoAlign)) { - continue; - } - /* This is bad. */ if ((pd = calloc(1, sizeof(*pd))) == NULL) { printf("efipart_inithandles: Out of memory.\n"); @@ -289,10 +408,32 @@ efipart_inithandles(void) STAILQ_INSERT_TAIL(&pdinfo, pd, pd_link); } + /* + * Walk pdinfo and set parents based on device path. + */ + STAILQ_FOREACH(pd, &pdinfo, pd_link) { + pd->pd_parent = efipart_find_parent(&pdinfo, pd->pd_devpath); + } free(hin); return (0); } +/* + * Get node identified by pd_test() from plist. + */ +static pdinfo_t * +efipart_get_pd(pdinfo_list_t *plist, pd_test_cb_t pd_test, pdinfo_t *data) +{ + pdinfo_t *pd; + + STAILQ_FOREACH(pd, plist, pd_link) { + if (pd_test(pd, data)) + break; + } + + return (pd); +} + static ACPI_HID_DEVICE_PATH * efipart_floppy(EFI_DEVICE_PATH *node) { @@ -310,19 +451,19 @@ efipart_floppy(EFI_DEVICE_PATH *node) return (NULL); } -static pdinfo_t * -efipart_find_parent(pdinfo_list_t *pdi, EFI_DEVICE_PATH *devpath) +static bool +efipart_testfd(pdinfo_t *fd, pdinfo_t *data __unused) { - pdinfo_t *pd, *part; + EFI_DEVICE_PATH *node; - STAILQ_FOREACH(pd, pdi, pd_link) { - if (efi_devpath_is_prefix(pd->pd_devpath, devpath)) - return (pd); - part = efipart_find_parent(&pd->pd_part, devpath); - if (part != NULL) - return (part); - } - return (NULL); + node = efi_devpath_last_node(fd->pd_devpath); + if (node == NULL) + return (false); + + if (efipart_floppy(node) != NULL) + return (true); + + return (false); } static int @@ -332,8 +473,7 @@ efipart_initfd(void) ACPI_HID_DEVICE_PATH *acpi; pdinfo_t *parent, *fd; -restart: - STAILQ_FOREACH(fd, &pdinfo, pd_link) { + while ((fd = efipart_get_pd(&pdinfo, efipart_testfd, NULL)) != NULL) { if ((node = efi_devpath_last_node(fd->pd_devpath)) == NULL) continue; @@ -341,7 +481,7 @@ restart: continue; STAILQ_REMOVE(&pdinfo, fd, pdinfo, pd_link); - parent = efipart_find_parent(&pdinfo, fd->pd_devpath); + parent = fd->pd_parent; if (parent != NULL) { STAILQ_REMOVE(&pdinfo, parent, pdinfo, pd_link); parent->pd_alias = fd->pd_handle; @@ -353,7 +493,6 @@ restart: } fd->pd_devsw = &efipart_fddev; STAILQ_INSERT_TAIL(&fdinfo, fd, pd_link); - goto restart; } bcache_add_dev(efiblk_pdinfo_count(&fdinfo)); @@ -366,208 +505,136 @@ restart: static void efipart_cdinfo_add(pdinfo_t *cd) { - pdinfo_t *pd, *last; + pdinfo_t *parent, *pd, *last; - STAILQ_FOREACH(pd, &cdinfo, pd_link) { - if (efi_devpath_is_prefix(pd->pd_devpath, cd->pd_devpath)) { - last = STAILQ_LAST(&pd->pd_part, pdinfo, pd_link); - if (last != NULL) - cd->pd_unit = last->pd_unit + 1; - else - cd->pd_unit = 0; - cd->pd_parent = pd; - cd->pd_devsw = &efipart_cddev; - STAILQ_INSERT_TAIL(&pd->pd_part, cd, pd_link); - return; + if (cd == NULL) + return; + + parent = cd->pd_parent; + /* Make sure we have parent added */ + efipart_cdinfo_add(parent); + + STAILQ_FOREACH(pd, &pdinfo, pd_link) { + if (efi_devpath_match(pd->pd_devpath, cd->pd_devpath)) { + STAILQ_REMOVE(&pdinfo, cd, pdinfo, pd_link); + break; } } + if (pd == NULL) { + /* This device is already added. */ + return; + } + if (parent != NULL) { + last = STAILQ_LAST(&parent->pd_part, pdinfo, pd_link); + if (last != NULL) + cd->pd_unit = last->pd_unit + 1; + else + cd->pd_unit = 0; + cd->pd_devsw = &efipart_cddev; + STAILQ_INSERT_TAIL(&parent->pd_part, cd, pd_link); + return; + } + last = STAILQ_LAST(&cdinfo, pdinfo, pd_link); if (last != NULL) cd->pd_unit = last->pd_unit + 1; else cd->pd_unit = 0; - cd->pd_parent = NULL; cd->pd_devsw = &efipart_cddev; STAILQ_INSERT_TAIL(&cdinfo, cd, pd_link); } static bool -efipart_testcd(EFI_DEVICE_PATH *node, EFI_BLOCK_IO *blkio) +efipart_testcd(pdinfo_t *cd, pdinfo_t *data __unused) { + EFI_DEVICE_PATH *node; + + node = efi_devpath_last_node(cd->pd_devpath); + if (node == NULL) + return (false); + + if (efipart_floppy(node) != NULL) + return (false); + if (DevicePathType(node) == MEDIA_DEVICE_PATH && DevicePathSubType(node) == MEDIA_CDROM_DP) { return (true); } /* cd drive without the media. */ - if (blkio->Media->RemovableMedia && - !blkio->Media->MediaPresent) { + if (cd->pd_blkio->Media->RemovableMedia && + !cd->pd_blkio->Media->MediaPresent) { return (true); } return (false); } -static void -efipart_updatecd(void) +/* + * Test if pd is parent for device. + */ +static bool +efipart_testchild(pdinfo_t *dev, pdinfo_t *pd) { - EFI_DEVICE_PATH *devpath, *node; - EFI_STATUS status; - pdinfo_t *parent, *cd; + /* device with no parent. */ + if (dev->pd_parent == NULL) + return (false); -restart: - STAILQ_FOREACH(cd, &pdinfo, pd_link) { - if ((node = efi_devpath_last_node(cd->pd_devpath)) == NULL) - continue; - - if (efipart_floppy(node) != NULL) - continue; - - /* Is parent of this device already registered? */ - parent = efipart_find_parent(&cdinfo, cd->pd_devpath); - if (parent != NULL) { - STAILQ_REMOVE(&pdinfo, cd, pdinfo, pd_link); - efipart_cdinfo_add(cd); - goto restart; - } - - if (!efipart_testcd(node, cd->pd_blkio)) - continue; - - /* Find parent and unlink both parent and cd from pdinfo */ - STAILQ_REMOVE(&pdinfo, cd, pdinfo, pd_link); - parent = efipart_find_parent(&pdinfo, cd->pd_devpath); - if (parent != NULL) { - STAILQ_REMOVE(&pdinfo, parent, pdinfo, pd_link); - efipart_cdinfo_add(parent); - } - - if (parent == NULL) - parent = efipart_find_parent(&cdinfo, cd->pd_devpath); - - /* - * If we come across a logical partition of subtype CDROM - * it doesn't refer to the CD filesystem itself, but rather - * to any usable El Torito boot image on it. In this case - * we try to find the parent device and add that instead as - * that will be the CD filesystem. - */ - if (DevicePathType(node) == MEDIA_DEVICE_PATH && - DevicePathSubType(node) == MEDIA_CDROM_DP && - parent == NULL) { - parent = calloc(1, sizeof(*parent)); - if (parent == NULL) { - printf("efipart_updatecd: out of memory\n"); - /* this device is lost but try again. */ - free(cd); - goto restart; - } - - devpath = efi_devpath_trim(cd->pd_devpath); - if (devpath == NULL) { - printf("efipart_updatecd: out of memory\n"); - /* this device is lost but try again. */ - free(parent); - free(cd); - goto restart; - } - parent->pd_devpath = devpath; - status = BS->LocateDevicePath(&blkio_guid, - &parent->pd_devpath, &parent->pd_handle); - free(devpath); - if (EFI_ERROR(status)) { - printf("efipart_updatecd: error %lu\n", - EFI_ERROR_CODE(status)); - free(parent); - free(cd); - goto restart; - } - parent->pd_devpath = - efi_lookup_devpath(parent->pd_handle); - efipart_cdinfo_add(parent); - } - - efipart_cdinfo_add(cd); - goto restart; + if (efi_devpath_match(dev->pd_parent->pd_devpath, pd->pd_devpath)) { + return (true); } + return (false); } static int efipart_initcd(void) { - efipart_updatecd(); + pdinfo_t *cd; + while ((cd = efipart_get_pd(&pdinfo, efipart_testcd, NULL)) != NULL) + efipart_cdinfo_add(cd); + + /* Find all children of CD devices we did add above. */ + STAILQ_FOREACH(cd, &cdinfo, pd_link) { + pdinfo_t *child; + + for (child = efipart_get_pd(&pdinfo, efipart_testchild, cd); + child != NULL; + child = efipart_get_pd(&pdinfo, efipart_testchild, cd)) + efipart_cdinfo_add(child); + } bcache_add_dev(efiblk_pdinfo_count(&cdinfo)); return (0); } -static bool +static void efipart_hdinfo_add_node(pdinfo_t *hd, EFI_DEVICE_PATH *node) { - pdinfo_t *pd, *ptr; + pdinfo_t *parent, *ptr; if (node == NULL) - return (false); + return; - /* Find our disk device. */ - STAILQ_FOREACH(pd, &hdinfo, pd_link) { - if (efi_devpath_is_prefix(pd->pd_devpath, hd->pd_devpath)) - break; - } - if (pd == NULL) - return (false); - - /* If the node is not MEDIA_HARDDRIVE_DP, it is sub-partition. */ + parent = hd->pd_parent; + /* + * If the node is not MEDIA_HARDDRIVE_DP, it is sub-partition. + * This can happen with Vendor nodes, and since we do not know + * the more about those nodes, we just count them. + */ if (DevicePathSubType(node) != MEDIA_HARDDRIVE_DP) { - STAILQ_FOREACH(ptr, &pd->pd_part, pd_link) { - if (efi_devpath_is_prefix(ptr->pd_devpath, - hd->pd_devpath)) - break; - } - /* - * ptr == NULL means we have handles in unexpected order - * and we would need to re-order the partitions later. - */ + ptr = STAILQ_LAST(&parent->pd_part, pdinfo, pd_link); if (ptr != NULL) - pd = ptr; - } - - /* Add the partition. */ - if (DevicePathSubType(node) == MEDIA_HARDDRIVE_DP) { - hd->pd_unit = ((HARDDRIVE_DEVICE_PATH *)node)->PartitionNumber; - } else { - ptr = STAILQ_LAST(&pd->pd_part, pdinfo, pd_link); - if (ptr != NULL) hd->pd_unit = ptr->pd_unit + 1; else hd->pd_unit = 0; + } else { + hd->pd_unit = ((HARDDRIVE_DEVICE_PATH *)node)->PartitionNumber; } - hd->pd_parent = pd; - hd->pd_devsw = &efipart_hddev; - STAILQ_INSERT_TAIL(&pd->pd_part, hd, pd_link); - return (true); -} - -static void -efipart_hdinfo_add(pdinfo_t *hd, EFI_DEVICE_PATH *node) -{ - pdinfo_t *last; - - if (efipart_hdinfo_add_node(hd, node)) - return; - - last = STAILQ_LAST(&hdinfo, pdinfo, pd_link); - if (last != NULL) - hd->pd_unit = last->pd_unit + 1; - else - hd->pd_unit = 0; - - /* Add the disk. */ hd->pd_devsw = &efipart_hddev; - STAILQ_INSERT_TAIL(&hdinfo, hd, pd_link); + STAILQ_INSERT_TAIL(&parent->pd_part, hd, pd_link); } /* @@ -640,96 +707,75 @@ efipart_hdinfo_add_filepath(pdinfo_t *hd, FILEPATH_DEV } static void -efipart_updatehd(void) +efipart_hdinfo_add(pdinfo_t *hd) { - EFI_DEVICE_PATH *devpath, *node; - EFI_STATUS status; - pdinfo_t *parent, *hd; + pdinfo_t *parent, *pd, *last; + EFI_DEVICE_PATH *node; -restart: - STAILQ_FOREACH(hd, &pdinfo, pd_link) { - if ((node = efi_devpath_last_node(hd->pd_devpath)) == NULL) - continue; + if (hd == NULL) + return; - if (efipart_floppy(node) != NULL) - continue; + parent = hd->pd_parent; + /* Make sure we have parent added */ + efipart_hdinfo_add(parent); - if (efipart_testcd(node, hd->pd_blkio)) - continue; - - if (DevicePathType(node) == HARDWARE_DEVICE_PATH && - (DevicePathSubType(node) == HW_PCI_DP || - DevicePathSubType(node) == HW_VENDOR_DP)) { + STAILQ_FOREACH(pd, &pdinfo, pd_link) { + if (efi_devpath_match(pd->pd_devpath, hd->pd_devpath)) { STAILQ_REMOVE(&pdinfo, hd, pdinfo, pd_link); - efipart_hdinfo_add(hd, NULL); - goto restart; + break; } + } + if (pd == NULL) { + /* This device is already added. */ + return; + } - if (DevicePathType(node) == MEDIA_DEVICE_PATH && - DevicePathSubType(node) == MEDIA_FILEPATH_DP) { - STAILQ_REMOVE(&pdinfo, hd, pdinfo, pd_link); - efipart_hdinfo_add_filepath(hd, - (FILEPATH_DEVICE_PATH *)node); - goto restart; - } + if ((node = efi_devpath_last_node(hd->pd_devpath)) == NULL) + return; - STAILQ_REMOVE(&pdinfo, hd, pdinfo, pd_link); - parent = efipart_find_parent(&pdinfo, hd->pd_devpath); - if (parent != NULL) { - STAILQ_REMOVE(&pdinfo, parent, pdinfo, pd_link); - efipart_hdinfo_add(parent, NULL); - } else { - parent = efipart_find_parent(&hdinfo, hd->pd_devpath); - } + if (DevicePathType(node) == MEDIA_DEVICE_PATH && + DevicePathSubType(node) == MEDIA_FILEPATH_DP) { + efipart_hdinfo_add_filepath(hd, + (FILEPATH_DEVICE_PATH *)node); + return; + } - if (DevicePathType(node) == MEDIA_DEVICE_PATH && - DevicePathSubType(node) == MEDIA_HARDDRIVE_DP && - parent == NULL) { - parent = calloc(1, sizeof(*parent)); - if (parent == NULL) { - printf("efipart_updatehd: out of memory\n"); - /* this device is lost but try again. */ - free(hd); - goto restart; - } + if (parent != NULL) { + efipart_hdinfo_add_node(hd, node); + return; + } - devpath = efi_devpath_trim(hd->pd_devpath); - if (devpath == NULL) { - printf("efipart_updatehd: out of memory\n"); - /* this device is lost but try again. */ - free(parent); - free(hd); - goto restart; - } + last = STAILQ_LAST(&hdinfo, pdinfo, pd_link); + if (last != NULL) + hd->pd_unit = last->pd_unit + 1; + else + hd->pd_unit = 0; - parent->pd_devpath = devpath; - status = BS->LocateDevicePath(&blkio_guid, - &parent->pd_devpath, &parent->pd_handle); - free(devpath); - if (EFI_ERROR(status)) { - printf("efipart_updatehd: error %lu\n", - EFI_ERROR_CODE(status)); - free(parent); - free(hd); - goto restart; - } + /* Add the disk. */ + hd->pd_devsw = &efipart_hddev; + STAILQ_INSERT_TAIL(&hdinfo, hd, pd_link); +} - parent->pd_devpath = - efi_lookup_devpath(&parent->pd_handle); +static bool +efipart_testhd(pdinfo_t *hd, pdinfo_t *data __unused) +{ + if (efipart_testfd(hd, NULL)) + return (false); - efipart_hdinfo_add(parent, NULL); - } + if (efipart_testcd(hd, NULL)) + return (false); - efipart_hdinfo_add(hd, node); - goto restart; - } + /* Anything else must be HD. */ + return (true); } static int efipart_inithd(void) { + pdinfo_t *hd; - efipart_updatehd(); + while ((hd = efipart_get_pd(&pdinfo, efipart_testhd, NULL)) != NULL) + efipart_hdinfo_add(hd); bcache_add_dev(efiblk_pdinfo_count(&hdinfo)); return (0); From owner-svn-src-all@freebsd.org Mon Dec 9 17:13:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F09601DB0A9; Mon, 9 Dec 2019 17:13:17 +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 47WqXF5wx0z3M0k; Mon, 9 Dec 2019 17:13:17 +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 C6DD01DD1B; Mon, 9 Dec 2019 17:13:17 +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 xB9HDHd8049076; Mon, 9 Dec 2019 17:13:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9HDHPo049074; Mon, 9 Dec 2019 17:13:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201912091713.xB9HDHPo049074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 9 Dec 2019 17:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355561 - in stable/12/sys/dev: amdsmn amdtemp X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/dev: amdsmn amdtemp X-SVN-Commit-Revision: 355561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 17:13:18 -0000 Author: mav Date: Mon Dec 9 17:13:17 2019 New Revision: 355561 URL: https://svnweb.freebsd.org/changeset/base/355561 Log: MFC r350624 (by cem): amdtemp(4), amdsmn(4): Attach to Ryzen 3 (Zen 2) hostbridges PR: 239607 Modified: stable/12/sys/dev/amdsmn/amdsmn.c stable/12/sys/dev/amdtemp/amdtemp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/amdsmn/amdsmn.c ============================================================================== --- stable/12/sys/dev/amdsmn/amdsmn.c Mon Dec 9 16:21:26 2019 (r355560) +++ stable/12/sys/dev/amdsmn/amdsmn.c Mon Dec 9 17:13:17 2019 (r355561) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #define PCI_DEVICE_ID_AMD_15H_M60H_ROOT 0x1576 #define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450 #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 +#define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 struct pciid; struct amdsmn_softc { @@ -87,6 +88,12 @@ static const struct pciid { { .amdsmn_vendorid = CPU_VENDOR_AMD, .amdsmn_deviceid = PCI_DEVICE_ID_AMD_17H_M10H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_17H_M30H_ROOT, .amdsmn_addr_reg = F17H_SMN_ADDR_REG, .amdsmn_data_reg = F17H_SMN_DATA_REG, }, Modified: stable/12/sys/dev/amdtemp/amdtemp.c ============================================================================== --- stable/12/sys/dev/amdtemp/amdtemp.c Mon Dec 9 16:21:26 2019 (r355560) +++ stable/12/sys/dev/amdtemp/amdtemp.c Mon Dec 9 17:13:17 2019 (r355561) @@ -96,6 +96,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_MISC16_M30H 0x1583 #define DEVICEID_AMD_HOSTB17H_ROOT 0x1450 #define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0 +#define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 static const struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -118,6 +119,7 @@ static const struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_MISC16_M30H, true }, { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M10H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M30H_ROOT, false }, }; /* From owner-svn-src-all@freebsd.org Mon Dec 9 17:14:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B46E61DB1D0; Mon, 9 Dec 2019 17:14:44 +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 47WqYw4MZPz3MFZ; Mon, 9 Dec 2019 17:14:44 +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 910DB1DD27; Mon, 9 Dec 2019 17:14:44 +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 xB9HEi0Q049325; Mon, 9 Dec 2019 17:14:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9HEiMK049324; Mon, 9 Dec 2019 17:14:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201912091714.xB9HEiMK049324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 9 Dec 2019 17:14:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355562 - in stable/11/sys/dev: amdsmn amdtemp X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11/sys/dev: amdsmn amdtemp X-SVN-Commit-Revision: 355562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 17:14:44 -0000 Author: mav Date: Mon Dec 9 17:14:43 2019 New Revision: 355562 URL: https://svnweb.freebsd.org/changeset/base/355562 Log: MFC r350624 (by cem): amdtemp(4), amdsmn(4): Attach to Ryzen 3 (Zen 2) hostbridges PR: 239607 Modified: stable/11/sys/dev/amdsmn/amdsmn.c stable/11/sys/dev/amdtemp/amdtemp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/amdsmn/amdsmn.c ============================================================================== --- stable/11/sys/dev/amdsmn/amdsmn.c Mon Dec 9 17:13:17 2019 (r355561) +++ stable/11/sys/dev/amdsmn/amdsmn.c Mon Dec 9 17:14:43 2019 (r355562) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #define PCI_DEVICE_ID_AMD_15H_M60H_ROOT 0x1576 #define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450 #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 +#define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 struct pciid; struct amdsmn_softc { @@ -87,6 +88,12 @@ static const struct pciid { { .amdsmn_vendorid = CPU_VENDOR_AMD, .amdsmn_deviceid = PCI_DEVICE_ID_AMD_17H_M10H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_17H_M30H_ROOT, .amdsmn_addr_reg = F17H_SMN_ADDR_REG, .amdsmn_data_reg = F17H_SMN_DATA_REG, }, Modified: stable/11/sys/dev/amdtemp/amdtemp.c ============================================================================== --- stable/11/sys/dev/amdtemp/amdtemp.c Mon Dec 9 17:13:17 2019 (r355561) +++ stable/11/sys/dev/amdtemp/amdtemp.c Mon Dec 9 17:14:43 2019 (r355562) @@ -94,6 +94,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_MISC16_M30H 0x1583 #define DEVICEID_AMD_HOSTB17H_ROOT 0x1450 #define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0 +#define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 static const struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -116,6 +117,7 @@ static const struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_MISC16_M30H, true }, { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M10H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M30H_ROOT, false }, { 0, 0 } }; From owner-svn-src-all@freebsd.org Mon Dec 9 17:34:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ADF371DB66E; Mon, 9 Dec 2019 17:34:41 +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 47Wr0x465hz3N6G; Mon, 9 Dec 2019 17:34:41 +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 6E0901E0C6; Mon, 9 Dec 2019 17:34:41 +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 xB9HYfEL061480; Mon, 9 Dec 2019 17:34:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9HYfoa061478; Mon, 9 Dec 2019 17:34:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912091734.xB9HYfoa061478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Dec 2019 17:34:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355563 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 355563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 17:34:41 -0000 Author: kevans Date: Mon Dec 9 17:34:40 2019 New Revision: 355563 URL: https://svnweb.freebsd.org/changeset/base/355563 Log: RPI: Fix DMA/SDHCI on the BCM2836 (Raspberry Pi 2) r354875 pushed VCBUS <-> ARMC translations to runtime determination, but incorrectly mapped addresses for the BCM2836 -- SOC_BCM2835 and SOC_BCM2836 are actually mutually exclusive, so the BCM2836 config (GENERIC) would have taken the latter path in the header and used 0x3f000000 as peripheral start. Easily fixed -- split out the BCM2836 into its own memmap config and use that instead if SOC_BCM2836 is included. With this, we get back to userland again. Reported by: Marek Zarychta Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Mon Dec 9 17:14:43 2019 (r355562) +++ head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Mon Dec 9 17:34:40 2019 (r355563) @@ -67,7 +67,7 @@ struct bcm283x_memory_mapping { vm_paddr_t vcbus_start; }; -#if defined(SOC_BCM2835) || defined(SOC_BCM2836) +#ifdef SOC_BCM2835 static struct bcm283x_memory_mapping bcm2835_memmap[] = { { /* SDRAM */ @@ -85,6 +85,24 @@ static struct bcm283x_memory_mapping bcm2835_memmap[] }; #endif +#ifdef SOC_BCM2836 +static struct bcm283x_memory_mapping bcm2836_memmap[] = { + { + /* SDRAM */ + .armc_start = 0x00000000, + .armc_size = BCM2836_ARM_IO_BASE, + .vcbus_start = BCM2836_VCBUS_SDRAM_BASE, + }, + { + /* Peripherals */ + .armc_start = BCM2836_ARM_IO_BASE, + .armc_size = BCM28XX_ARM_IO_SIZE, + .vcbus_start = BCM2836_VCBUS_IO_BASE, + }, + { 0, 0, 0 }, +}; +#endif + #ifdef SOC_BRCM_BCM2837 static struct bcm283x_memory_mapping bcm2837_memmap[] = { { @@ -142,7 +160,7 @@ static struct bcm283x_memory_soc_cfg { #endif #ifdef SOC_BCM2836 { - .memmap = bcm2835_memmap, + .memmap = bcm2836_memmap, .soc_compat = "brcm,bcm2836", .busdma_lowaddr = BUS_SPACE_MAXADDR_32BIT, }, Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Mon Dec 9 17:14:43 2019 (r355562) +++ head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Mon Dec 9 17:34:40 2019 (r355563) @@ -42,7 +42,11 @@ #define BCM2835_VCBUS_IO_BASE 0x7E000000 #define BCM2835_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_CACHED -#define BCM2837_ARM_IO_BASE 0x3f000000 +#define BCM2836_ARM_IO_BASE 0x3f000000 +#define BCM2836_VCBUS_IO_BASE BCM2835_VCBUS_IO_BASE +#define BCM2836_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_UNCACHED + +#define BCM2837_ARM_IO_BASE BCM2836_ARM_IO_BASE #define BCM2837_VCBUS_IO_BASE BCM2835_VCBUS_IO_BASE #define BCM2837_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_UNCACHED From owner-svn-src-all@freebsd.org Mon Dec 9 17:58:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74EF21DBB06; Mon, 9 Dec 2019 17:58:23 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47WrXH2VMMz3Nx8; Mon, 9 Dec 2019 17:58:23 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C99C1E439; Mon, 9 Dec 2019 17:58:23 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB9HwNlt073348; Mon, 9 Dec 2019 17:58:23 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9HwNC3073347; Mon, 9 Dec 2019 17:58:23 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201912091758.xB9HwNC3073347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 9 Dec 2019 17:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355564 - head/contrib/nvi/docs/man X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/contrib/nvi/docs/man X-SVN-Commit-Revision: 355564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 17:58:23 -0000 Author: 0mp (doc,ports committer) Date: Mon Dec 9 17:58:22 2019 New Revision: 355564 URL: https://svnweb.freebsd.org/changeset/base/355564 Log: vi.1: Fix a typo Reviewed by: bcr Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D22734 Modified: head/contrib/nvi/docs/man/vi.1 Modified: head/contrib/nvi/docs/man/vi.1 ============================================================================== --- head/contrib/nvi/docs/man/vi.1 Mon Dec 9 17:34:40 2019 (r355563) +++ head/contrib/nvi/docs/man/vi.1 Mon Dec 9 17:58:22 2019 (r355564) @@ -14,7 +14,7 @@ .\" .\" $Id: vi.1,v 9.0 2013/11/02 12:11:56 zy Exp $ .\" -.Dd November 2, 2013 +.Dd December 9, 2019 .Dt VI 1 .Os .Sh NAME @@ -981,7 +981,7 @@ command. .Cm ;\& .Xc Repeat the last character find -.Pq i.e., the last .Cm F , f , T No or Cm t No command +.Pq i.e., the last Cm F , f , T No or Cm t No command .Ar count times. .Pp From owner-svn-src-all@freebsd.org Mon Dec 9 19:00:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 922981DCC73; Mon, 9 Dec 2019 19:00:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47Wsw73NmDz3wlb; Mon, 9 Dec 2019 19:00:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F95A1EEEC; Mon, 9 Dec 2019 19:00:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB9J0dIi008652; Mon, 9 Dec 2019 19:00:39 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9J0dOM008651; Mon, 9 Dec 2019 19:00:39 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912091900.xB9J0dOM008651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Dec 2019 19:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355565 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 355565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 19:00:39 -0000 Author: ian Date: Mon Dec 9 19:00:39 2019 New Revision: 355565 URL: https://svnweb.freebsd.org/changeset/base/355565 Log: Switch gpioths(4) from using a callout to a taskqueue for periodic polling of the sensor hardware. Part of the polling process involves signalling the chip then waiting 20 milliseconds. This was being done with DELAY(), which is a pretty rude thing to do in a callout. Now a taskqueue_thread task is scheduled to do the polling, and because sleeping is allowed in the task context, pause_sbt() replaces DELAY() for the 20ms wait. Modified: head/sys/dev/gpio/gpioths.c Modified: head/sys/dev/gpio/gpioths.c ============================================================================== --- head/sys/dev/gpio/gpioths.c Mon Dec 9 17:58:22 2019 (r355564) +++ head/sys/dev/gpio/gpioths.c Mon Dec 9 19:00:39 2019 (r355565) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -90,7 +91,8 @@ struct gpioths_softc { int temp; int hum; int fails; - struct callout callout; + struct timeout_task task; + bool detaching; }; static int @@ -148,7 +150,7 @@ gpioths_dht_initread(struct gpioths_softc *sc) */ gpio_pin_setflags(sc->pin, GPIO_PIN_OUTPUT); gpio_pin_set_active(sc->pin, false); - DELAY(GPIOTHS_DHT_STARTCYCLE); + pause_sbt("gpioths", ustosbt(GPIOTHS_DHT_STARTCYCLE), C_PREL(2), 0); gpio_pin_set_active(sc->pin, true); gpio_pin_setflags(sc->pin, GPIO_PIN_INPUT); } @@ -285,14 +287,16 @@ error: } static void -gpioths_poll(void *arg) +gpioths_poll(void *arg, int pending __unused) { struct gpioths_softc *sc; sc = (struct gpioths_softc *)arg; gpioths_dht_readbytes(sc); - callout_schedule(&sc->callout, GPIOTHS_POLLTIME * hz); + if (!sc->detaching) + taskqueue_enqueue_timeout_sbt(taskqueue_thread, &sc->task, + GPIOTHS_POLLTIME * SBT_1S, 0, C_PREL(3)); } static int @@ -309,6 +313,8 @@ gpioths_attach(device_t dev) sc->dev = dev; + TIMEOUT_TASK_INIT(taskqueue_thread, &sc->task, 0, gpioths_poll, sc); + #ifdef FDT /* Try to configure our pin from fdt data on fdt-based systems. */ err = gpio_pin_get_by_ofw_idx(dev, ofw_bus_get_node(dev), PIN_IDX, @@ -355,9 +361,11 @@ gpioths_attach(device_t dev) /* * Do an initial read so we have correct values for reporting before - * registering the sysctls that can access those values. + * registering the sysctls that can access those values. This also + * schedules the periodic polling the driver does every few seconds to + * update the sysctl variables. */ - gpioths_dht_readbytes(sc); + gpioths_poll(sc, 0); sysctl_add_oid(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "temperature", \ CTLFLAG_RD | CTLTYPE_INT | CTLFLAG_MPSAFE, @@ -370,9 +378,6 @@ gpioths_attach(device_t dev) CTLFLAG_RD, &sc->fails, 0, "failures since last successful read"); - callout_init(&sc->callout, 1); - callout_reset(&sc->callout, GPIOTHS_POLLTIME * hz, gpioths_poll, sc); - return (0); } @@ -383,7 +388,9 @@ gpioths_detach(device_t dev) sc = device_get_softc(dev); gpio_pin_release(sc->pin); - callout_drain(&sc->callout); + sc->detaching = true; + while (taskqueue_cancel_timeout(taskqueue_thread, &sc->task, NULL) != 0) + taskqueue_drain_timeout(taskqueue_thread, &sc->task); return (0); } From owner-svn-src-all@freebsd.org Mon Dec 9 19:10:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E85C51DD03B; Mon, 9 Dec 2019 19:10:42 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47Wt7k5vmZz3xQc; Mon, 9 Dec 2019 19:10:42 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5E811F0BE; Mon, 9 Dec 2019 19:10:42 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB9JAg72014964; Mon, 9 Dec 2019 19:10:42 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9JAg6g014963; Mon, 9 Dec 2019 19:10:42 GMT (envelope-from np@FreeBSD.org) Message-Id: <201912091910.xB9JAg6g014963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 9 Dec 2019 19:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355566 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 355566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 19:10:43 -0000 Author: np Date: Mon Dec 9 19:10:42 2019 New Revision: 355566 URL: https://svnweb.freebsd.org/changeset/base/355566 Log: cxgbe/iw_cxgbe: Support 64b length in the memory registration routines. Submitted by: bharat @ chelsio MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/qp.c Modified: head/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/qp.c Mon Dec 9 19:00:39 2019 (r355565) +++ head/sys/dev/cxgbe/iw_cxgbe/qp.c Mon Dec 9 19:10:42 2019 (r355566) @@ -689,8 +689,8 @@ static void build_tpte_memreg(struct fw_ri_fr_nsmr_tpt fr->tpte.nosnoop_pbladdr = cpu_to_be32(V_FW_RI_TPTE_PBLADDR( PBL_OFF(&mhp->rhp->rdev, mhp->attr.pbl_addr)>>3)); fr->tpte.dca_mwbcnt_pstag = cpu_to_be32(0); - fr->tpte.len_hi = cpu_to_be32(0); - fr->tpte.len_lo = cpu_to_be32(mhp->ibmr.length); + fr->tpte.len_hi = cpu_to_be32(mhp->ibmr.length >> 32); + fr->tpte.len_lo = cpu_to_be32(mhp->ibmr.length & 0xffffffff); fr->tpte.va_hi = cpu_to_be32(mhp->ibmr.iova >> 32); fr->tpte.va_lo_fbo = cpu_to_be32(mhp->ibmr.iova & 0xffffffff); @@ -717,12 +717,11 @@ static int build_memreg(struct t4_sq *sq, union t4_wr wqe->fr.pgsz_shift = ilog2(wr->mr->page_size) - 12; wqe->fr.addr_type = FW_RI_VA_BASED_TO; wqe->fr.mem_perms = c4iw_ib_to_tpt_access(wr->access); - wqe->fr.len_hi = 0; - wqe->fr.len_lo = cpu_to_be32(mhp->ibmr.length); + wqe->fr.len_hi = cpu_to_be32(mhp->ibmr.length >> 32); + wqe->fr.len_lo = cpu_to_be32(mhp->ibmr.length & 0xffffffff); wqe->fr.stag = cpu_to_be32(wr->key); wqe->fr.va_hi = cpu_to_be32(mhp->ibmr.iova >> 32); - wqe->fr.va_lo_fbo = cpu_to_be32(mhp->ibmr.iova & - 0xffffffff); + wqe->fr.va_lo_fbo = cpu_to_be32(mhp->ibmr.iova & 0xffffffff); if (dsgl_supported && use_dsgl && (pbllen > max_fr_immd)) { struct fw_ri_dsgl *sglp; From owner-svn-src-all@freebsd.org Mon Dec 9 19:17:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 007081DD26A; Mon, 9 Dec 2019 19:17:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47WtHZ6zZnz3xxM; Mon, 9 Dec 2019 19:17:30 +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 D099A1F27E; Mon, 9 Dec 2019 19:17:30 +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 xB9JHU1V020725; Mon, 9 Dec 2019 19:17:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9JHSFO020716; Mon, 9 Dec 2019 19:17:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912091917.xB9JHSFO020716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 9 Dec 2019 19:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355567 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/freebsd32 i386/linux kern sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux compat/freebsd32 i386/linux kern sys X-SVN-Commit-Revision: 355567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 19:17:31 -0000 Author: jhb Date: Mon Dec 9 19:17:28 2019 New Revision: 355567 URL: https://svnweb.freebsd.org/changeset/base/355567 Log: Copy out aux args after the argument and environment vectors. Partially revert r354741 and r354754 and go back to allocating a fixed-size chunk of stack space for the auxiliary vector. Keep sv_copyout_auxargs but change it to accept the address at the end of the environment vector as an input stack address and no longer allocate room on the stack. It is now called at the end of copyout_strings after the argv and environment vectors have been copied out. This should fix a regression in r354754 that broke the stack alignment for newer Linux amd64 binaries (and probably broke Linux arm64 as well). Reviewed by: kib Tested on: amd64 (native, linux64 (only linux-base-c7), and i386) Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D22695 Modified: head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm64/linux/linux_sysvec.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/i386/linux/linux_sysvec.c head/sys/kern/imgact_elf.c head/sys/kern/kern_exec.c head/sys/sys/imgact_elf.h head/sys/sys/sysent.h Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Mon Dec 9 19:10:42 2019 (r355566) +++ head/sys/amd64/linux/linux_sysvec.c Mon Dec 9 19:17:28 2019 (r355567) @@ -224,11 +224,10 @@ linux_set_syscall_retval(struct thread *td, int error) } static int -linux_copyout_auxargs(struct image_params *imgp, uintptr_t *base) +linux_copyout_auxargs(struct image_params *imgp, uintptr_t base) { Elf_Auxargs *args; Elf_Auxinfo *argarray, *pos; - u_long auxlen; struct proc *p; int error, issetugid; @@ -266,9 +265,8 @@ linux_copyout_auxargs(struct image_params *imgp, uintp imgp->auxargs = NULL; KASSERT(pos - argarray <= LINUX_AT_COUNT, ("Too many auxargs")); - auxlen = sizeof(*argarray) * (pos - argarray); - *base -= auxlen; - error = copyout(argarray, (void *)*base, auxlen); + error = copyout(argarray, (void *)base, + sizeof(*argarray) * LINUX_AT_COUNT); free(argarray, M_TEMP); return (error); } @@ -336,17 +334,13 @@ linux_copyout_strings(struct image_params *imgp, uintp destp = rounddown2(destp, sizeof(void *)); ustringp = destp; - /* - * Starting with 2.24, glibc depends on a 16-byte stack alignment. - * One "long argc" will be prepended later. - */ - if (destp % 16 == 0) - destp -= 8; - if (imgp->auxargs) { - error = imgp->sysent->sv_copyout_auxargs(imgp, &destp); - if (error != 0) - return (error); + /* + * Allocate room on the stack for the ELF auxargs + * array. It has LINUX_AT_COUNT entries. + */ + destp -= LINUX_AT_COUNT * sizeof(Elf64_Auxinfo); + destp = rounddown2(destp, sizeof(void *)); } vectp = (char **)destp; @@ -357,6 +351,12 @@ linux_copyout_strings(struct image_params *imgp, uintp */ vectp -= imgp->args->argc + 1 + imgp->args->envc + 1; + /* + * Starting with 2.24, glibc depends on a 16-byte stack alignment. + * One "long argc" will be prepended later. + */ + vectp = (char **)((((uintptr_t)vectp + 8) & ~0xF) - 8); + /* vectp also becomes our initial stack base. */ *stack_base = (uintptr_t)vectp; @@ -404,6 +404,14 @@ linux_copyout_strings(struct image_params *imgp, uintp /* The end of the vector table is a null pointer. */ if (suword(vectp, 0) != 0) return (EFAULT); + + if (imgp->auxargs) { + vectp++; + error = imgp->sysent->sv_copyout_auxargs(imgp, + (uintptr_t)vectp); + if (error != 0) + return (error); + } return (0); } Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Mon Dec 9 19:10:42 2019 (r355566) +++ head/sys/amd64/linux32/linux32_sysvec.c Mon Dec 9 19:17:28 2019 (r355567) @@ -187,11 +187,10 @@ linux_translate_traps(int signal, int trap_code) } static int -linux_copyout_auxargs(struct image_params *imgp, u_long *base) +linux_copyout_auxargs(struct image_params *imgp, uintptr_t base) { Elf32_Auxargs *args; Elf32_Auxinfo *argarray, *pos; - u_long auxlen; int error, issetugid; args = (Elf32_Auxargs *)imgp->auxargs; @@ -238,9 +237,8 @@ linux_copyout_auxargs(struct image_params *imgp, u_lon imgp->auxargs = NULL; KASSERT(pos - argarray <= LINUX_AT_COUNT, ("Too many auxargs")); - auxlen = sizeof(*argarray) * (pos - argarray); - *base -= auxlen; - error = copyout(argarray, (void *)*base, auxlen); + error = copyout(argarray, (void *)base, + sizeof(*argarray) * LINUX_AT_COUNT); free(argarray, M_TEMP); return (error); } @@ -764,9 +762,12 @@ linux_copyout_strings(struct image_params *imgp, uintp ustringp = destp; if (imgp->auxargs) { - error = imgp->sysent->sv_copyout_auxargs(imgp, &destp); - if (error != 0) - return (error); + /* + * Allocate room on the stack for the ELF auxargs + * array. It has LINUX_AT_COUNT entries. + */ + destp -= LINUX_AT_COUNT * sizeof(Elf32_Auxinfo); + destp = rounddown2(destp, sizeof(void *)); } vectp = (uint32_t *)destp; @@ -824,6 +825,14 @@ linux_copyout_strings(struct image_params *imgp, uintp /* The end of the vector table is a null pointer. */ if (suword32(vectp, 0) != 0) return (EFAULT); + + if (imgp->auxargs) { + vectp++; + error = imgp->sysent->sv_copyout_auxargs(imgp, + (uintptr_t)vectp); + if (error != 0) + return (error); + } return (0); } Modified: head/sys/arm64/linux/linux_sysvec.c ============================================================================== --- head/sys/arm64/linux/linux_sysvec.c Mon Dec 9 19:10:42 2019 (r355566) +++ head/sys/arm64/linux/linux_sysvec.c Mon Dec 9 19:17:28 2019 (r355567) @@ -143,11 +143,10 @@ linux_set_syscall_retval(struct thread *td, int error) } static int -linux_copyout_auxargs(struct image_params *imgp, uintptr_t *base) +linux_copyout_auxargs(struct image_params *imgp, uintptr_t base) { Elf_Auxargs *args; Elf_Auxinfo *argarray, *pos; - u_long auxlen; struct proc *p; int error, issetugid; @@ -190,9 +189,8 @@ linux_copyout_auxargs(struct image_params *imgp, uintp imgp->auxargs = NULL; KASSERT(pos - argarray <= LINUX_AT_COUNT, ("Too many auxargs")); - auxlen = sizeof(*argarray) * (pos - argarray); - *base -= auxlen; - error = copyout(argarray, (void *)*base, auxlen); + error = copyout(argarray, (void *)base, + sizeof(*argarray) * LINUX_AT_COUNT); free(argarray, M_TEMP); return (error); } @@ -257,9 +255,12 @@ linux_copyout_strings(struct image_params *imgp, uintp ustringp = destp; if (imgp->auxargs) { - error = imgp->sysent->sv_copyout_auxargs(imgp, &destp); - if (error != 0) - return (error); + /* + * Allocate room on the stack for the ELF auxargs + * array. It has up to LINUX_AT_COUNT entries. + */ + destp -= LINUX_AT_COUNT * sizeof(Elf64_Auxinfo); + destp = rounddown2(destp, sizeof(void *)); } vectp = (char **)destp; @@ -321,6 +322,14 @@ linux_copyout_strings(struct image_params *imgp, uintp /* The end of the vector table is a null pointer. */ if (suword(vectp, 0) != 0) return (EFAULT); + + if (imgp->auxargs) { + vectp++; + error = imgp->sysent->sv_copyout_auxargs(imgp, + (uintptr_t)vectp); + if (error != 0) + return (error); + } return (0); } Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Mon Dec 9 19:10:42 2019 (r355566) +++ head/sys/compat/freebsd32/freebsd32_misc.c Mon Dec 9 19:17:28 2019 (r355567) @@ -3206,9 +3206,12 @@ freebsd32_copyout_strings(struct image_params *imgp, u imgp->sysent->sv_stackgap(imgp, &destp); if (imgp->auxargs) { - error = imgp->sysent->sv_copyout_auxargs(imgp, &destp); - if (error != 0) - return (error); + /* + * Allocate room on the stack for the ELF auxargs + * array. It has up to AT_COUNT entries. + */ + destp -= AT_COUNT * sizeof(Elf32_Auxinfo); + destp = rounddown2(destp, sizeof(uint32_t)); } vectp = (uint32_t *)destp; @@ -3275,6 +3278,14 @@ freebsd32_copyout_strings(struct image_params *imgp, u /* end of vector table is a null pointer */ if (suword32(vectp, 0) != 0) return (EFAULT); + + if (imgp->auxargs) { + vectp++; + error = imgp->sysent->sv_copyout_auxargs(imgp, + (uintptr_t)vectp); + if (error != 0) + return (error); + } return (0); } Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Mon Dec 9 19:10:42 2019 (r355566) +++ head/sys/i386/linux/linux_sysvec.c Mon Dec 9 19:17:28 2019 (r355567) @@ -192,14 +192,13 @@ linux_fixup(uintptr_t *stack_base, struct image_params } static int -linux_copyout_auxargs(struct image_params *imgp, uintptr_t *base) +linux_copyout_auxargs(struct image_params *imgp, uintptr_t base) { struct proc *p; Elf32_Auxargs *args; Elf32_Auxinfo *argarray, *pos; Elf32_Addr *uplatform; struct ps_strings *arginfo; - u_long auxlen; int error, issetugid; p = imgp->proc; @@ -249,9 +248,8 @@ linux_copyout_auxargs(struct image_params *imgp, uintp imgp->auxargs = NULL; KASSERT(pos - argarray <= LINUX_AT_COUNT, ("Too many auxargs")); - auxlen = sizeof(*argarray) * (pos - argarray); - *base -= auxlen; - error = copyout(argarray, (void *)*base, auxlen); + error = copyout(argarray, (void *)base, + sizeof(*argarray) * LINUX_AT_COUNT); free(argarray, M_TEMP); return (error); } @@ -323,9 +321,12 @@ linux_copyout_strings(struct image_params *imgp, uintp ustringp = destp; if (imgp->auxargs) { - error = imgp->sysent->sv_copyout_auxargs(imgp, &destp); - if (error != 0) - return (error); + /* + * Allocate room on the stack for the ELF auxargs + * array. It has LINUX_AT_COUNT entries. + */ + destp -= LINUX_AT_COUNT * sizeof(Elf32_Auxinfo); + destp = rounddown2(destp, sizeof(void *)); } vectp = (char **)destp; @@ -383,6 +384,14 @@ linux_copyout_strings(struct image_params *imgp, uintp /* The end of the vector table is a null pointer. */ if (suword(vectp, 0) != 0) return (EFAULT); + + if (imgp->auxargs) { + vectp++; + error = imgp->sysent->sv_copyout_auxargs(imgp, + (uintptr_t)vectp); + if (error != 0) + return (error); + } return (0); } Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Mon Dec 9 19:10:42 2019 (r355566) +++ head/sys/kern/imgact_elf.c Mon Dec 9 19:17:28 2019 (r355567) @@ -1324,11 +1324,10 @@ ret: #define suword __CONCAT(suword, __ELF_WORD_SIZE) int -__elfN(freebsd_copyout_auxargs)(struct image_params *imgp, uintptr_t *base) +__elfN(freebsd_copyout_auxargs)(struct image_params *imgp, uintptr_t base) { Elf_Auxargs *args = (Elf_Auxargs *)imgp->auxargs; Elf_Auxinfo *argarray, *pos; - u_long auxlen; int error; argarray = pos = malloc(AT_COUNT * sizeof(*pos), M_TEMP, @@ -1374,9 +1373,7 @@ __elfN(freebsd_copyout_auxargs)(struct image_params *i imgp->auxargs = NULL; KASSERT(pos - argarray <= AT_COUNT, ("Too many auxargs")); - auxlen = sizeof(*argarray) * (pos - argarray); - *base -= auxlen; - error = copyout(argarray, (void *)*base, auxlen); + error = copyout(argarray, (void *)base, sizeof(*argarray) * AT_COUNT); free(argarray, M_TEMP); return (error); } Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Mon Dec 9 19:10:42 2019 (r355566) +++ head/sys/kern/kern_exec.c Mon Dec 9 19:17:28 2019 (r355567) @@ -1661,9 +1661,12 @@ exec_copyout_strings(struct image_params *imgp, uintpt imgp->sysent->sv_stackgap(imgp, &destp); if (imgp->auxargs) { - error = imgp->sysent->sv_copyout_auxargs(imgp, &destp); - if (error != 0) - return (error); + /* + * Allocate room on the stack for the ELF auxargs + * array. It has up to AT_COUNT entries. + */ + destp -= AT_COUNT * sizeof(Elf_Auxinfo); + destp = rounddown2(destp, sizeof(void *)); } vectp = (char **)destp; @@ -1731,6 +1734,14 @@ exec_copyout_strings(struct image_params *imgp, uintpt /* end of vector table is a null pointer */ if (suword(vectp, 0) != 0) return (EFAULT); + + if (imgp->auxargs) { + vectp++; + error = imgp->sysent->sv_copyout_auxargs(imgp, + (uintptr_t)vectp); + if (error != 0) + return (error); + } return (0); } Modified: head/sys/sys/imgact_elf.h ============================================================================== --- head/sys/sys/imgact_elf.h Mon Dec 9 19:10:42 2019 (r355566) +++ head/sys/sys/imgact_elf.h Mon Dec 9 19:17:28 2019 (r355567) @@ -99,7 +99,7 @@ int __elfN(freebsd_fixup)(uintptr_t *, struct image_pa int __elfN(coredump)(struct thread *, struct vnode *, off_t, int); size_t __elfN(populate_note)(int, void *, void *, size_t, void **); void __elfN(stackgap)(struct image_params *, uintptr_t *); -int __elfN(freebsd_copyout_auxargs)(struct image_params *, uintptr_t *); +int __elfN(freebsd_copyout_auxargs)(struct image_params *, uintptr_t); /* Machine specific function to dump per-thread information. */ void __elfN(dump_thread)(struct thread *, void *, size_t *); Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Mon Dec 9 19:10:42 2019 (r355566) +++ head/sys/sys/sysent.h Mon Dec 9 19:17:28 2019 (r355567) @@ -111,7 +111,7 @@ struct sysentvec { int (*sv_imgact_try)(struct image_params *); void (*sv_stackgap)(struct image_params *, uintptr_t *); int (*sv_copyout_auxargs)(struct image_params *, - uintptr_t *); + uintptr_t); int sv_minsigstksz; /* minimum signal stack size */ vm_offset_t sv_minuser; /* VM_MIN_ADDRESS */ vm_offset_t sv_maxuser; /* VM_MAXUSER_ADDRESS */ From owner-svn-src-all@freebsd.org Mon Dec 9 19:17:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A75DA1DD2CC; Mon, 9 Dec 2019 19:17:57 +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 47WtJ53zD4z3y55; Mon, 9 Dec 2019 19:17:57 +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 83A161F288; Mon, 9 Dec 2019 19:17:57 +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 xB9JHvtW020797; Mon, 9 Dec 2019 19:17:57 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9JHv0d020795; Mon, 9 Dec 2019 19:17:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201912091917.xB9JHv0d020795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Dec 2019 19:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355568 - in head: include sys/sys X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: include sys/sys X-SVN-Commit-Revision: 355568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 19:17:57 -0000 Author: dim Date: Mon Dec 9 19:17:56 2019 New Revision: 355568 URL: https://svnweb.freebsd.org/changeset/base/355568 Log: Correctly check for C++17 and higher when declaring timespec_get() Summary: In rS338751, the check to declare `timespec_get()` for C++17 and higher was incorrectly done against a `cplusplus` define, while it should have been `__cplusplus`. Fix this by using `__cplusplus`, and also bump `__FreeBSD_version` so it becomes possible to correctly check for `timespec_get()` in upstream libc++ headers. Reviewed by: brooks, emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D22735 Modified: head/include/time.h head/sys/sys/param.h Modified: head/include/time.h ============================================================================== --- head/include/time.h Mon Dec 9 19:17:28 2019 (r355567) +++ head/include/time.h Mon Dec 9 19:17:56 2019 (r355568) @@ -208,7 +208,7 @@ time_t posix2time(time_t t); #endif #if defined(__BSD_VISIBLE) || __ISO_C_VISIBLE >= 2011 || \ - (defined(cplusplus) && cplusplus >= 201703) + (defined(__cplusplus) && __cplusplus >= 201703) #include /* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */ #define TIME_UTC 1 /* time elapsed since epoch */ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Dec 9 19:17:28 2019 (r355567) +++ head/sys/sys/param.h Mon Dec 9 19:17:56 2019 (r355568) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300063 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300064 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Mon Dec 9 19:18:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 727A21DD30D; Mon, 9 Dec 2019 19:18:06 +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 47WtJG22Gcz3yC6; Mon, 9 Dec 2019 19:18:06 +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 40CDE1F289; Mon, 9 Dec 2019 19:18:06 +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 xB9JI6gb020855; Mon, 9 Dec 2019 19:18:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9JI6Uc020854; Mon, 9 Dec 2019 19:18:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912091918.xB9JI6Uc020854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 9 Dec 2019 19:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355569 - head/sys/amd64/linux32 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/amd64/linux32 X-SVN-Commit-Revision: 355569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 19:18:06 -0000 Author: jhb Date: Mon Dec 9 19:18:05 2019 New Revision: 355569 URL: https://svnweb.freebsd.org/changeset/base/355569 Log: Use 4 byte stack alignment instead of 8 byte. This was an old bug prior to r355373 and mostly harmless as it would waste at most a handful of bytes on the stack. Modified: head/sys/amd64/linux32/linux32_sysvec.c Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Mon Dec 9 19:17:56 2019 (r355568) +++ head/sys/amd64/linux32/linux32_sysvec.c Mon Dec 9 19:18:05 2019 (r355569) @@ -741,7 +741,7 @@ linux_copyout_strings(struct image_params *imgp, uintp if (execpath_len != 0) { destp -= execpath_len; - destp = rounddown2(destp, sizeof(void *)); + destp = rounddown2(destp, sizeof(uint32_t)); imgp->execpathp = destp; error = copyout(imgp->execpath, (void *)destp, execpath_len); if (error != 0) @@ -750,7 +750,7 @@ linux_copyout_strings(struct image_params *imgp, uintp /* Prepare the canary for SSP. */ arc4rand(canary, sizeof(canary), 0); - destp -= roundup(sizeof(canary), sizeof(void *)); + destp -= roundup(sizeof(canary), sizeof(uint32_t)); imgp->canary = destp; error = copyout(canary, (void *)destp, sizeof(canary)); if (error != 0) @@ -758,7 +758,7 @@ linux_copyout_strings(struct image_params *imgp, uintp /* Allocate room for the argument and environment strings. */ destp -= ARG_MAX - imgp->args->stringspace; - destp = rounddown2(destp, sizeof(void *)); + destp = rounddown2(destp, sizeof(uint32_t)); ustringp = destp; if (imgp->auxargs) { @@ -767,7 +767,7 @@ linux_copyout_strings(struct image_params *imgp, uintp * array. It has LINUX_AT_COUNT entries. */ destp -= LINUX_AT_COUNT * sizeof(Elf32_Auxinfo); - destp = rounddown2(destp, sizeof(void *)); + destp = rounddown2(destp, sizeof(uint32_t)); } vectp = (uint32_t *)destp; From owner-svn-src-all@freebsd.org Mon Dec 9 19:25:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1ADD61DD738; Mon, 9 Dec 2019 19:25:16 +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 47WtSW6LTpz3ykf; Mon, 9 Dec 2019 19:25:15 +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 BABAF1F449; Mon, 9 Dec 2019 19:25:15 +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 xB9JPFSu026617; Mon, 9 Dec 2019 19:25:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9JPFfT026616; Mon, 9 Dec 2019 19:25:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912091925.xB9JPFfT026616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 Dec 2019 19:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355570 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 355570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 19:25:16 -0000 Author: markj Date: Mon Dec 9 19:25:15 2019 New Revision: 355570 URL: https://svnweb.freebsd.org/changeset/base/355570 Log: Configure headphone redirection for the Dell L780 and X1 Carbon 7th gen. As we do for many other laptops, put the headphone jack and speakers in the same association by default so that the generic sound device automatically switches between them. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Mon Dec 9 19:18:05 2019 (r355569) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Mon Dec 9 19:25:15 2019 (r355570) @@ -390,7 +390,8 @@ hdac_pin_patch(struct hdaa_widget *w) break; } } else if (id == HDA_CODEC_ALC285 && - subid == LENOVO_X120KH_SUBVENDOR) { + (subid == LENOVO_X120KH_SUBVENDOR || + subid == LENOVO_X120QD_SUBVENDOR)) { switch (nid) { case 33: patch = "as=1 seq=15"; @@ -447,7 +448,8 @@ hdac_pin_patch(struct hdaa_widget *w) config = 0x01a1913d; break; } - } else if (id == HDA_CODEC_ALC256 && subid == DELL_I7577_SUBVENDOR) { + } else if (id == HDA_CODEC_ALC256 && (subid == DELL_I7577_SUBVENDOR || + subid == DELL_L7480_SUBVENDOR)) { switch (nid) { case 20: patch = "as=1 seq=0"; Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Mon Dec 9 19:18:05 2019 (r355569) +++ head/sys/dev/sound/pci/hda/hdac.h Mon Dec 9 19:25:15 2019 (r355570) @@ -206,6 +206,7 @@ #define DELL_V1400_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x0227) #define DELL_V1500_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x0228) #define DELL_I1300_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x01c9) +#define DELL_L7480_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x07a0) #define DELL_XPSM1210_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x01d7) #define DELL_OPLX745_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x01da) #define DELL_XPS9560_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x07be) @@ -264,6 +265,7 @@ #define LENOVO_X1CRBN_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f9) #define LENOVO_X120BS_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x2227) #define LENOVO_X120KH_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x225c) +#define LENOVO_X120QD_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x2292) #define LENOVO_X220_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21da) #define LENOVO_X300_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac) #define LENOVO_T400_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20f2) From owner-svn-src-all@freebsd.org Mon Dec 9 20:01:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4326A1DDF0A; Mon, 9 Dec 2019 20:01:42 +0000 (UTC) (envelope-from joerg@bec.de) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (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 47WvGY5bHnz417r; Mon, 9 Dec 2019 20:01:41 +0000 (UTC) (envelope-from joerg@bec.de) X-Originating-IP: 93.205.172.218 Received: from bec.de (p5DCDACDA.dip0.t-ipconnect.de [93.205.172.218]) (Authenticated sender: joerg@bec.de) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 62F0CE0003; Mon, 9 Dec 2019 20:01:38 +0000 (UTC) Date: Mon, 9 Dec 2019 21:01:36 +0100 From: Joerg Sonnenberger To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355569 - head/sys/amd64/linux32 Message-ID: <20191209200136.GA28078@bec.de> References: <201912091918.xB9JI6Uc020854@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201912091918.xB9JI6Uc020854@repo.freebsd.org> User-Agent: Mutt/1.11.3 (2019-02-01) X-Rspamd-Queue-Id: 47WvGY5bHnz417r 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)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 20:01:42 -0000 On Mon, Dec 09, 2019 at 07:18:06PM +0000, John Baldwin wrote: > Author: jhb > Date: Mon Dec 9 19:18:05 2019 > New Revision: 355569 > URL: https://svnweb.freebsd.org/changeset/base/355569 > > Log: > Use 4 byte stack alignment instead of 8 byte. > > This was an old bug prior to r355373 and mostly harmless as it would > waste at most a handful of bytes on the stack. Doesn't Linux assume 128bit alignment for i386 nowadays? Joerg From owner-svn-src-all@freebsd.org Mon Dec 9 21:10:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29B3A1DEE64; Mon, 9 Dec 2019 21:10:19 +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 47Wwnl0Hylz442s; Mon, 9 Dec 2019 21:10:19 +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 0104320673; Mon, 9 Dec 2019 21:10:18 +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 xB9LAIBH086252; Mon, 9 Dec 2019 21:10:18 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9LAILI086251; Mon, 9 Dec 2019 21:10:18 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201912092110.xB9LAILI086251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 9 Dec 2019 21:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355571 - stable/12/stand/efi/libefi X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/stand/efi/libefi X-SVN-Commit-Revision: 355571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 21:10:19 -0000 Author: tsoome Date: Mon Dec 9 21:10:18 2019 New Revision: 355571 URL: https://svnweb.freebsd.org/changeset/base/355571 Log: MFC r355347: loader: ReadKeyStrokeEx may return partial keystrokes In some systems we can receive no scancode nor unicodechar values. PR: 240760 Reported by: Ariel Millennium Thornton Modified: stable/12/stand/efi/libefi/efi_console.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/efi/libefi/efi_console.c ============================================================================== --- stable/12/stand/efi/libefi/efi_console.c Mon Dec 9 19:25:15 2019 (r355570) +++ stable/12/stand/efi/libefi/efi_console.c Mon Dec 9 21:10:18 2019 (r355571) @@ -558,10 +558,11 @@ efi_readkey_ex(void) kp->UnicodeChar++; } } + if (kp->ScanCode == 0 && kp->UnicodeChar == 0) + return (false); + keybuf_inschar(kp); + return (true); } - - keybuf_inschar(kp); - return (true); } return (false); } From owner-svn-src-all@freebsd.org Mon Dec 9 21:55:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3480A1DF8B4; Mon, 9 Dec 2019 21:55:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47Wxp90Yzrz45wn; Mon, 9 Dec 2019 21:55:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0852F20F45; Mon, 9 Dec 2019 21:55:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB9Ltioo015006; Mon, 9 Dec 2019 21:55:44 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB9LtiTn015004; Mon, 9 Dec 2019 21:55:44 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912092155.xB9LtiTn015004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Dec 2019 21:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355572 - in head: share/man/man4 sys/dev/usb/serial X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/usb/serial X-SVN-Commit-Revision: 355572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 21:55:45 -0000 Author: ian Date: Mon Dec 9 21:55:44 2019 New Revision: 355572 URL: https://svnweb.freebsd.org/changeset/base/355572 Log: Allow baud rates of 1,228,800 and 1,843,200 on CP2101/2/3 usb-serial adapters. The datasheets for these chips claim the maximum is 921,600, but testing shows these two higher rates also work (but no rates above 921,600 other than these two work; these represent dividing the base buad clock by 3 and 2 respectively). Modified: head/share/man/man4/uslcom.4 head/sys/dev/usb/serial/uslcom.c Modified: head/share/man/man4/uslcom.4 ============================================================================== --- head/share/man/man4/uslcom.4 Mon Dec 9 21:10:18 2019 (r355571) +++ head/share/man/man4/uslcom.4 Mon Dec 9 21:55:44 2019 (r355572) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2017 +.Dd December 9, 2019 .Dt USLCOM 4 .Os .Sh NAME @@ -43,6 +43,11 @@ The .Nm driver supports Silicon Laboratories CP2101/CP2102/CP2103/CP2104/CP2105 based USB serial adapters. +.Pp +The datasheets for the CP2101/CP2102/CP2103 list the maximum +supported baud rate as 921,600. +Empirical testing has shown that the rates 1,228,800 and 1,843,200 also work, +at least on some hardware, so the driver allows setting those rates. .Sh HARDWARE The following devices should work with the .Nm Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Mon Dec 9 21:10:18 2019 (r355571) +++ head/sys/dev/usb/serial/uslcom.c Mon Dec 9 21:55:44 2019 (r355572) @@ -624,7 +624,11 @@ uslcom_pre_param(struct ucom_softc *ucom, struct termi case USLCOM_PARTNUM_CP2102: case USLCOM_PARTNUM_CP2103: default: - maxspeed = 921600; + /* + * Datasheet for cp2102 says 921600 max. Testing shows that + * 1228800 and 1843200 work fine. + */ + maxspeed = 1843200; break; } if (t->c_ospeed <= 0 || t->c_ospeed > maxspeed) From owner-svn-src-all@freebsd.org Mon Dec 9 23:28:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A4C71C88D7; Mon, 9 Dec 2019 23:28:27 +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 47Wzs71wRyz49RG; Mon, 9 Dec 2019 23:28:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-6.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 2C04712E2; Mon, 9 Dec 2019 23:28:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r355569 - head/sys/amd64/linux32 To: Joerg Sonnenberger Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912091918.xB9JI6Uc020854@repo.freebsd.org> <20191209200136.GA28078@bec.de> From: John Baldwin Openpgp: preference=signencrypt 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: <57a41930-57b3-3b98-3d31-432d3c5b9083@FreeBSD.org> Date: Mon, 9 Dec 2019 15:28:18 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <20191209200136.GA28078@bec.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 23:28:27 -0000 On 12/9/19 12:01 PM, Joerg Sonnenberger wrote: > On Mon, Dec 09, 2019 at 07:18:06PM +0000, John Baldwin wrote: >> Author: jhb >> Date: Mon Dec 9 19:18:05 2019 >> New Revision: 355569 >> URL: https://svnweb.freebsd.org/changeset/base/355569 >> >> Log: >> Use 4 byte stack alignment instead of 8 byte. >> >> This was an old bug prior to r355373 and mostly harmless as it would >> waste at most a handful of bytes on the stack. > > Doesn't Linux assume 128bit alignment for i386 nowadays? If it does, that is separate. This is about individual things we copy out onto the stack such as the path to the executable name, and random bytes for AT_RANDOM, etc. being aligned on a 4 byte boundary. It used 'rounddown()' with 'sizeof(void *)' before r355373 because that was copy and pasted from sys/i386/linux/linux_sysvec.c. But void * is 8 bytes on amd64, not 4 bytes as on i386. If Linux/i386 needs 16 byte alignment for the initial stack pointer, then it needs something like the change to align vectp in sys/amd64/linux/linux_sysent.c:linux_copyout_strings both in this file and in sys/i386/linux/linux_sysent.c before writing out the argv array. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Dec 9 23:36:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2772E1C8B7B; Mon, 9 Dec 2019 23:36:15 +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 47X0270BS8z4B27; Mon, 9 Dec 2019 23:36:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-6.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 8FEFE1403; Mon, 9 Dec 2019 23:36:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r355569 - head/sys/amd64/linux32 From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912091918.xB9JI6Uc020854@repo.freebsd.org> Openpgp: preference=signencrypt 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, 9 Dec 2019 15:36:12 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <201912091918.xB9JI6Uc020854@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 23:36:15 -0000 On 12/9/19 11:18 AM, John Baldwin wrote: > Author: jhb > Date: Mon Dec 9 19:18:05 2019 > New Revision: 355569 > URL: https://svnweb.freebsd.org/changeset/base/355569 > > Log: > Use 4 byte stack alignment instead of 8 byte. > > This was an old bug prior to r355373 and mostly harmless as it would > waste at most a handful of bytes on the stack. Oops, missed: Reviewed by: kib Differential Review: https://reviews.freebsd.org/D22696 -- John Baldwin From owner-svn-src-all@freebsd.org Tue Dec 10 00:08:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5748B1C9403; Tue, 10 Dec 2019 00:08:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47X0kt1bRGz4C5Q; Tue, 10 Dec 2019 00:08:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 183FF225EE; Tue, 10 Dec 2019 00:08:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBA085fJ091236; Tue, 10 Dec 2019 00:08:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBA085lw091234; Tue, 10 Dec 2019 00:08:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201912100008.xBA085lw091234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 10 Dec 2019 00:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355573 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 355573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 00:08:06 -0000 Author: mjg Date: Tue Dec 10 00:08:05 2019 New Revision: 355573 URL: https://svnweb.freebsd.org/changeset/base/355573 Log: vfs: refactor vhold and vdrop No fuctional changes. Modified: head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Dec 9 21:55:44 2019 (r355572) +++ head/sys/kern/vfs_subr.c Tue Dec 10 00:08:05 2019 (r355573) @@ -2766,7 +2766,7 @@ v_decr_devcount(struct vnode *vp) * usecount is permitted to transition 1->0 without the interlock because * vnode is kept live by holdcnt. */ -static enum vgetstate +static enum vgetstate __always_inline _vget_prep(struct vnode *vp, bool interlock) { enum vgetstate vs; @@ -2774,7 +2774,10 @@ _vget_prep(struct vnode *vp, bool interlock) if (refcount_acquire_if_not_zero(&vp->v_usecount)) { vs = VGET_USECOUNT; } else { - _vhold(vp, interlock); + if (interlock) + vholdl(vp); + else + vhold(vp); vs = VGET_HOLDCNT; } return (vs); @@ -3108,31 +3111,12 @@ vunref(struct vnode *vp) /* * Increase the hold count and activate if this is the first reference. */ -void -_vhold(struct vnode *vp, bool locked) +static void +vhold_activate(struct vnode *vp) { struct mount *mp; - if (locked) - ASSERT_VI_LOCKED(vp, __func__); - else - ASSERT_VI_UNLOCKED(vp, __func__); - CTR2(KTR_VFS, "%s: vp %p", __func__, vp); - if (!locked) { - if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { - VNODE_REFCOUNT_FENCE_ACQ(); - VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, - ("_vhold: vnode with holdcnt is free")); - return; - } - VI_LOCK(vp); - } - if ((vp->v_iflag & VI_FREE) == 0) { - refcount_acquire(&vp->v_holdcnt); - if (!locked) - VI_UNLOCK(vp); - return; - } + ASSERT_VI_LOCKED(vp, __func__); VNASSERT(vp->v_holdcnt == 0, vp, ("%s: wrong hold count", __func__)); VNASSERT(vp->v_op != NULL, vp, @@ -3163,11 +3147,39 @@ _vhold(struct vnode *vp, bool locked) mp->mnt_activevnodelistsize++; mtx_unlock(&mp->mnt_listmtx); refcount_acquire(&vp->v_holdcnt); - if (!locked) - VI_UNLOCK(vp); } void +vhold(struct vnode *vp) +{ + + ASSERT_VI_UNLOCKED(vp, __func__); + CTR2(KTR_VFS, "%s: vp %p", __func__, vp); + if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { + VNODE_REFCOUNT_FENCE_ACQ(); + VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, + ("vhold: vnode with holdcnt is free")); + return; + } + VI_LOCK(vp); + vholdl(vp); + VI_UNLOCK(vp); +} + +void +vholdl(struct vnode *vp) +{ + + ASSERT_VI_LOCKED(vp, __func__); + CTR2(KTR_VFS, "%s: vp %p", __func__, vp); + if ((vp->v_iflag & VI_FREE) == 0) { + refcount_acquire(&vp->v_holdcnt); + return; + } + vhold_activate(vp); +} + +void vholdnz(struct vnode *vp) { @@ -3189,79 +3201,96 @@ vholdnz(struct vnode *vp) * there is at least one resident non-cached page, the vnode cannot * leave the active list without the page cleanup done. */ -void -_vdrop(struct vnode *vp, bool locked) +static void +vdrop_deactivate(struct vnode *vp) { struct mount *mp; - if (locked) - ASSERT_VI_LOCKED(vp, __func__); - else - ASSERT_VI_UNLOCKED(vp, __func__); + ASSERT_VI_LOCKED(vp, __func__); + /* + * Mark a vnode as free: remove it from its active list + * and put it up for recycling on the freelist. + */ + VNASSERT(!VN_IS_DOOMED(vp), vp, + ("vdrop: returning doomed vnode")); + VNASSERT(vp->v_op != NULL, vp, + ("vdrop: vnode already reclaimed.")); + VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, + ("vnode already free")); + VNASSERT(vp->v_holdcnt == 0, vp, + ("vdrop: freeing when we shouldn't")); + if ((vp->v_iflag & VI_OWEINACT) == 0) { + mp = vp->v_mount; + if (mp != NULL) { + mtx_lock(&mp->mnt_listmtx); + if (vp->v_iflag & VI_ACTIVE) { + vp->v_iflag &= ~VI_ACTIVE; + TAILQ_REMOVE(&mp->mnt_activevnodelist, + vp, v_actfreelist); + mp->mnt_activevnodelistsize--; + } + TAILQ_INSERT_TAIL(&mp->mnt_tmpfreevnodelist, + vp, v_actfreelist); + mp->mnt_tmpfreevnodelistsize++; + vp->v_iflag |= VI_FREE; + vp->v_mflag |= VMP_TMPMNTFREELIST; + VI_UNLOCK(vp); + if (mp->mnt_tmpfreevnodelistsize >= + mnt_free_list_batch) + vnlru_return_batch_locked(mp); + mtx_unlock(&mp->mnt_listmtx); + } else { + VNASSERT((vp->v_iflag & VI_ACTIVE) == 0, vp, + ("vdrop: active vnode not on per mount vnode list")); + mtx_lock(&vnode_free_list_mtx); + TAILQ_INSERT_TAIL(&vnode_free_list, vp, + v_actfreelist); + freevnodes++; + vp->v_iflag |= VI_FREE; + VI_UNLOCK(vp); + mtx_unlock(&vnode_free_list_mtx); + } + } else { + VI_UNLOCK(vp); + counter_u64_add(free_owe_inact, 1); + } +} + +void +vdrop(struct vnode *vp) +{ + + ASSERT_VI_UNLOCKED(vp, __func__); CTR2(KTR_VFS, "%s: vp %p", __func__, vp); if (__predict_false((int)vp->v_holdcnt <= 0)) { vn_printf(vp, "vdrop: holdcnt %d", vp->v_holdcnt); panic("vdrop: wrong holdcnt"); } - if (!locked) { - if (refcount_release_if_not_last(&vp->v_holdcnt)) - return; - VI_LOCK(vp); + if (refcount_release_if_not_last(&vp->v_holdcnt)) + return; + VI_LOCK(vp); + vdropl(vp); +} + +void +vdropl(struct vnode *vp) +{ + + ASSERT_VI_LOCKED(vp, __func__); + CTR2(KTR_VFS, "%s: vp %p", __func__, vp); + if (__predict_false((int)vp->v_holdcnt <= 0)) { + vn_printf(vp, "vdrop: holdcnt %d", vp->v_holdcnt); + panic("vdrop: wrong holdcnt"); } - if (refcount_release(&vp->v_holdcnt) == 0) { + if (!refcount_release(&vp->v_holdcnt)) { VI_UNLOCK(vp); return; } - if (!VN_IS_DOOMED(vp)) { - /* - * Mark a vnode as free: remove it from its active list - * and put it up for recycling on the freelist. - */ - VNASSERT(vp->v_op != NULL, vp, - ("vdropl: vnode already reclaimed.")); - VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, - ("vnode already free")); - VNASSERT(vp->v_holdcnt == 0, vp, - ("vdropl: freeing when we shouldn't")); - if ((vp->v_iflag & VI_OWEINACT) == 0) { - mp = vp->v_mount; - if (mp != NULL) { - mtx_lock(&mp->mnt_listmtx); - if (vp->v_iflag & VI_ACTIVE) { - vp->v_iflag &= ~VI_ACTIVE; - TAILQ_REMOVE(&mp->mnt_activevnodelist, - vp, v_actfreelist); - mp->mnt_activevnodelistsize--; - } - TAILQ_INSERT_TAIL(&mp->mnt_tmpfreevnodelist, - vp, v_actfreelist); - mp->mnt_tmpfreevnodelistsize++; - vp->v_iflag |= VI_FREE; - vp->v_mflag |= VMP_TMPMNTFREELIST; - VI_UNLOCK(vp); - if (mp->mnt_tmpfreevnodelistsize >= - mnt_free_list_batch) - vnlru_return_batch_locked(mp); - mtx_unlock(&mp->mnt_listmtx); - } else { - VNASSERT((vp->v_iflag & VI_ACTIVE) == 0, vp, - ("vdropl: active vnode not on per mount " - "vnode list")); - mtx_lock(&vnode_free_list_mtx); - TAILQ_INSERT_TAIL(&vnode_free_list, vp, - v_actfreelist); - freevnodes++; - vp->v_iflag |= VI_FREE; - VI_UNLOCK(vp); - mtx_unlock(&vnode_free_list_mtx); - } - } else { - VI_UNLOCK(vp); - counter_u64_add(free_owe_inact, 1); - } + if (VN_IS_DOOMED(vp)) { + freevnode(vp); return; } - freevnode(vp); + vdrop_deactivate(vp); } /* Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Mon Dec 9 21:55:44 2019 (r355572) +++ head/sys/sys/vnode.h Tue Dec 10 00:08:05 2019 (r355573) @@ -653,17 +653,15 @@ int vaccess_acl_posix1e(enum vtype type, uid_t file_ui struct ucred *cred, int *privused); void vattr_null(struct vattr *vap); int vcount(struct vnode *vp); -#define vdrop(vp) _vdrop((vp), 0) -#define vdropl(vp) _vdrop((vp), 1) -void _vdrop(struct vnode *, bool); +void vdrop(struct vnode *); +void vdropl(struct vnode *); int vflush(struct mount *mp, int rootrefs, int flags, struct thread *td); int vget(struct vnode *vp, int flags, struct thread *td); enum vgetstate vget_prep(struct vnode *vp); int vget_finish(struct vnode *vp, int flags, enum vgetstate vs); void vgone(struct vnode *vp); -#define vhold(vp) _vhold((vp), 0) -#define vholdl(vp) _vhold((vp), 1) -void _vhold(struct vnode *, bool); +void vhold(struct vnode *); +void vholdl(struct vnode *); void vholdnz(struct vnode *); void vinactive(struct vnode *, struct thread *); int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo); From owner-svn-src-all@freebsd.org Tue Dec 10 02:19:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31C151CB97B; Tue, 10 Dec 2019 02:19:08 +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 47X3f40WPcz4Hvj; Tue, 10 Dec 2019 02:19:08 +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 080BC23D51; Tue, 10 Dec 2019 02:19:08 +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 xBA2J7xf068029; Tue, 10 Dec 2019 02:19:07 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBA2J7rU068027; Tue, 10 Dec 2019 02:19:07 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <201912100219.xBA2J7rU068027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Tue, 10 Dec 2019 02:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355574 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: takawata X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 355574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 02:19:08 -0000 Author: takawata Date: Tue Dec 10 02:19:07 2019 New Revision: 355574 URL: https://svnweb.freebsd.org/changeset/base/355574 Log: Add ACPI battery subsystem man page. PR:242100 Differential Revision: https://reviews.freebsd.org/D22556 Added: head/share/man/man4/acpi_battery.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Dec 10 00:08:05 2019 (r355573) +++ head/share/man/man4/Makefile Tue Dec 10 02:19:07 2019 (r355574) @@ -16,6 +16,7 @@ MAN= aac.4 \ ${_acpi_rapidstart.4} \ ${_acpi_sony.4} \ acpi_thermal.4 \ + acpi_battery.4 \ ${_acpi_toshiba.4} \ acpi_video.4 \ ${_acpi_wmi.4} \ Added: head/share/man/man4/acpi_battery.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/acpi_battery.4 Tue Dec 10 02:19:07 2019 (r355574) @@ -0,0 +1,283 @@ +.\" +.\" Copyright (c) 2019 Takanori Watanabe +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 26, 2019 +.Dt ACPI_BATTERY 4 +.Os +.Sh NAME +.Nm acpi_battery +.Nd ACPI battery management subsystem +.Sh SYNOPSIS +.Cd "device acpi" +.Sh DESCRIPTION +The +.Nm +is a driver for battery management features of the ACPI module. +An ACPI-compatible battery device supports either a Control +Method Battery interface or a Smart Battery subsystem interface. +The former is accessed by the AML +.Pq ACPI Machine Language +code control methods, +and the latter is controlled directly through the ACPI EC +.Pq Embedded Controller +typically via an SMBus interface. +This driver supports the +.Xr sysctl 8 +and +.Xr ioctl 2 +interfaces as well as the +.Xr devd 8 +event notification interface. +.Sh IOCTLS +Every ioctl for the +.Nm +driver takes a single integer value for the battery unit +number as an argument, +and returns a specific structure for each request. +A special unit number +.Li ACPI_BATTERY_ALL_UNITS +specifies all of the attached units +and reports accumulated information. +.Bl -tag -width indent +.It ACPIIO_BATT_GET_UNITS Vt int +Returns the number of battery units in the system. +The unit number argument will be ignored. +.It ACPIIO_BATT_GET_BATTINFO Vt struct acpi_battinfo +Returns the following: +.Bl -tag -width indent +.It cap +Battery capacity in percent, +.It min +Remaining battery life in minutes, +.It state +Current status of the battery encoded in the following: +.Bl -tag -width indent +.It ACPI_BATT_STAT_DISCHARG Pq 0x0001 +Battery is discharging, +.It ACPI_BATT_STAT_CHARGING Pq 0x0002 +Battery is being charged, or +.It ACPI_BATT_STAT_CRITICAL Pq 0x0004 +Remaining battery life is critically low. +.El +.Pp +Note that the status bits of each battery will be +consolidated when +.Li ACPI_BATTERY_ALL_UNITS +is specified. +.It rate +Current battery discharging rate in mW. +.Li -1 +means not discharging right now. +.El +.It ACPIIO_BATT_GET_BIF Vt struct acpi_bif +Returns battery information given by the ACPI +.Li _BIF Pq Battery Information +object, +which is the static portion of the Control Method +Battery information. +In the case of a Smart Battery attached to SMBus, +this ioctl will build a +.Vt struct acpi_bif +structure based on the obtained information +and return it. +.Bl -tag -width indent +.It units +Indicates the units used by the battery to report its +capacity and charge rate encoded in the following: +.Bl -tag -width indent +.It ACPI_BIF_UNITS_MW Pq 0x00000000 +in mW +.Pq power +.It ACPI_BIF_UNITS_MA Pq 0x00000001 +in mA +.Pq current +.El +.Pp +Note that capacity is expressed in mWh or mAh, +and rate is expressed in mW or mA, +respectively. +.It dcap +The Battery's design capacity, +which is the nominal capacity of a new battery. +This is expressed as power or current depending on +the value of +.Va units . +.It lfcap +Predicted battery capacity when fully charged. +Typically this will decrease every charging cycle. +.It btech +Battery technology: +.Bl -tag -width indent +.It 0x00000000 Primary cell Pq non-rechargable +.It 0x00000001 Secondery cell Pq rechargable +.El +.It dvol +Design voltage in mV, +which is the nominal voltage of a new battery. +.It wcap +Design capacity of warning. +When a discharging battery device reaches this capacity, +notification is sent to the system. +.It lcap +Design capacity of low. +.It gra1 +Battery capacity granularity between +.Va low +and +.Va warning . +This is expressed as power or current depending on +the value of +.Va units . +.It gra2 +Battery capacity granularity between +.Va warning +and +.Va full . +This is expressed as power or current depending on +the value of +.Va units . +.It model +Model number of the battery as a string. +.It serial +Serial number of the battery as a string. +.It type +Type identifier of the battery as a string. +.It oeminfo +OEM-specific information of the battery as a string. +.El +.It ACPIIO_BATT_GET_BST Vt struct acpi_bst +Returns battery information given by the ACPI +.Li _BST Pq Battery Status +object, +which is the present battery status. +In the case of a Smart Battery attached to SMBus, +this ioctl will build a +.Vt struct acpi_bst +structure based on the obtained information +and return it. +.Bl -tag -width indent +.It state +Battery state. +The value is encoded in the same way as +.Va state +of +.Vt struct acpi_battinfo . +.It rate +Battery present rate of charging or discharging. +The unit of the value depends on +.Va unit +of +.Vt struct acpi_bif . +.It cap +Battery remaining capacity. +The unit of this value depends on +.Va unit +of +.Vt struct acpi_bif . +.It volt +Battery present voltage. +.El +.El +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variables export battery status. +Note that they are accumulated status of all of the +connected batteries: +.Bl -tag -width indent +.It Va hw.acpi.battery.info_expire +Information cache expiration time in seconds. +The battery information obtained by +.Li _BIF +object will be stored and reused for successive +read access to this MIB within the specified period. +.It Va hw.acpi.battery.units +Number of battery units in the system. +.It Va hw.acpi.battery.state +Current battery charging status. +This is same as +.Va state +of +.Vt struct acpi_battinfo . +.It Va hw.acpi.battery.rate +Current battery discharging rate in mW. +.It Va hw.acpi.battery.time +Remaining battery life in minutes. +If the battery is not discharging, +the value shows +.Li -1 . +.It Va hw.acpi.battery.life +Battery capacity in percent. +.El +.Sh EVENT NOTIFICATIONS +Battery-related event notifications are sent +to the userland via the +.Xr devd 8 +interface. +See +.Pa /etc/devd.conf +and +.Xr devd.conf 5 +for more details. +Note that notifications are supported only by +the Control Method Battery. +.Pp +The +.Nm +driver sends events with the following attributes: +.Pp +.Bl -tag -width "subsystem" -compact +.It system +.Li ACPI +.It subsystem +.Li CMBAT +.It type +The fully qualified battery object path as in the ASL. +.It notify +An integer designating the event: +.Pp +.Bl -tag -width indent -compact +.It Li 0x80 +Battery status was changed. +.It Li 0x81 +Battery information was changed. +.El +.El +.Sh SEE ALSO +.Xr acpi 4 , +.Xr acpiconf 8 +.Sh AUTHORS +.An -nosplit +.An Nate Lawson Aq Mt njl@FreeBSD.org , +.An Munehiro Matsuda , +.An Takanori Watanabe Aq Mt takawata@FreeBSD.org , +.An Mitsuru IWASAKI Aq Mt iwasaki@FreeBSD.org , +and +.An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org . +.Pp +This manual page was written by +.An Takanori Watanabe Aq Mt takawata@FreeBSD.org . From owner-svn-src-all@freebsd.org Tue Dec 10 03:42:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBF371CDB2C; Tue, 10 Dec 2019 03:42:59 +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 47X5Vq57LGz4My9; Tue, 10 Dec 2019 03:42:59 +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 AB5BF24E3B; Tue, 10 Dec 2019 03:42:59 +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 xBA3gxwC021768; Tue, 10 Dec 2019 03:42:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBA3gxO0021767; Tue, 10 Dec 2019 03:42:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912100342.xBA3gxO0021767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Dec 2019 03:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355575 - head/share/vt/keymaps X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/vt/keymaps X-SVN-Commit-Revision: 355575 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 03:42:59 -0000 Author: emaste Date: Tue Dec 10 03:42:59 2019 New Revision: 355575 URL: https://svnweb.freebsd.org/changeset/base/355575 Log: Add missing language specifier for Hebrew il.kbd description PR: 235094 (related) MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/share/vt/keymaps/INDEX.keymaps Modified: head/share/vt/keymaps/INDEX.keymaps ============================================================================== --- head/share/vt/keymaps/INDEX.keymaps Tue Dec 10 02:19:07 2019 (r355574) +++ head/share/vt/keymaps/INDEX.keymaps Tue Dec 10 03:42:59 2019 (r355575) @@ -249,7 +249,7 @@ gr.101.acc.kbd:el:Ελληνικό (101 πλήκτÏω il.kbd:en:Hebrew il.kbd:de:Hebräisch il.kbd:fr:Hébreu -il.kbd::תירבע +il.kbd:he:תירבע hr.kbd:en:Croatian hr.kbd:de:Kroatisch From owner-svn-src-all@freebsd.org Tue Dec 10 07:04:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C30771D1329; Tue, 10 Dec 2019 07:04:21 +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 47X9z94jyVz4WhK; Tue, 10 Dec 2019 07:04:21 +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 82BED2721C; Tue, 10 Dec 2019 07:04:21 +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 xBA74Lh9038781; Tue, 10 Dec 2019 07:04:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBA74LT7038779; Tue, 10 Dec 2019 07:04:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201912100704.xBA74LT7038779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Dec 2019 07:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355576 - in stable/12/sys: netinet netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys: netinet netinet6 X-SVN-Commit-Revision: 355576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 07:04:21 -0000 Author: hselasky Date: Tue Dec 10 07:04:20 2019 New Revision: 355576 URL: https://svnweb.freebsd.org/changeset/base/355576 Log: MFC r355322: Use refcount from "in_joingroup_locked()" when joining multicast groups. Do not acquire additional references. This makes the IPv4 IGMP code in line with the IPv6 MLD code. Background: The IPv4 multicast code puts an extra reference on the in_multi struct when joining groups. This becomes visible when using daemons like igmpproxy from ports, that multicast entries do not disappear from the output of ifmcstat(8) when multicast streams are disconnected. This fixes a regression issue after r349762. While at it factor the ip_mfilter_insert() and ip6_mfilter_insert() calls to avoid repeated "is_new" check. Differential Revision: https://reviews.freebsd.org/D22595 Tested by: Guido van Rooij Reviewed by: rgrimes (network) Sponsored by: Mellanox Technologies Modified: stable/12/sys/netinet/in_mcast.c stable/12/sys/netinet6/in6_mcast.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/in_mcast.c ============================================================================== --- stable/12/sys/netinet/in_mcast.c Tue Dec 10 03:42:59 2019 (r355575) +++ stable/12/sys/netinet/in_mcast.c Tue Dec 10 07:04:20 2019 (r355576) @@ -2205,7 +2205,11 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt __func__); goto out_inp_locked; } - inm_acquire(imf->imf_inm); + /* + * NOTE: Refcount from in_joingroup_locked() + * is protecting membership. + */ + ip_mfilter_insert(&imo->imo_head, imf); } else { CTR1(KTR_IGMPV3, "%s: merge inm state", __func__); IN_MULTI_LIST_LOCK(); @@ -2229,8 +2233,6 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt goto out_inp_locked; } } - if (is_new) - ip_mfilter_insert(&imo->imo_head, imf); imf_commit(imf); imf = NULL; Modified: stable/12/sys/netinet6/in6_mcast.c ============================================================================== --- stable/12/sys/netinet6/in6_mcast.c Tue Dec 10 03:42:59 2019 (r355575) +++ stable/12/sys/netinet6/in6_mcast.c Tue Dec 10 07:04:20 2019 (r355576) @@ -2109,6 +2109,7 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop * NOTE: Refcount from in6_joingroup_locked() * is protecting membership. */ + ip6_mfilter_insert(&imo->im6o_head, imf); } else { CTR1(KTR_MLD, "%s: merge inm state", __func__); IN6_MULTI_LIST_LOCK(); @@ -2133,9 +2134,6 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop goto out_in6p_locked; } } - - if (is_new) - ip6_mfilter_insert(&imo->im6o_head, imf); im6f_commit(imf); imf = NULL; From owner-svn-src-all@freebsd.org Tue Dec 10 07:06:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62E911D145B; Tue, 10 Dec 2019 07:06:33 +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 47XB1j20Mwz4WsL; Tue, 10 Dec 2019 07:06:33 +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 3FB7627241; Tue, 10 Dec 2019 07:06:33 +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 xBA76XGT038941; Tue, 10 Dec 2019 07:06:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBA76WhF038939; Tue, 10 Dec 2019 07:06:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201912100706.xBA76WhF038939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Dec 2019 07:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355577 - in stable/12/sys/dev/usb: . video X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys/dev/usb: . video X-SVN-Commit-Revision: 355577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 07:06:33 -0000 Author: hselasky Date: Tue Dec 10 07:06:32 2019 New Revision: 355577 URL: https://svnweb.freebsd.org/changeset/base/355577 Log: MFC r354969: Add USB ID for Diamond Multimedia BVU195 Display Link device. Submitted by: darius@dons.net.au PR: 242128 Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/usb/usbdevs stable/12/sys/dev/usb/video/udl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/usbdevs ============================================================================== --- stable/12/sys/dev/usb/usbdevs Tue Dec 10 07:04:20 2019 (r355576) +++ stable/12/sys/dev/usb/usbdevs Tue Dec 10 07:06:32 2019 (r355577) @@ -1784,6 +1784,7 @@ product DISPLAYLINK M01061 0x01e2 Lenovo DVI product DISPLAYLINK SWDVI 0x024c SUNWEIT DVI product DISPLAYLINK NBDOCK 0x0215 VideoHome NBdock1920 product DISPLAYLINK LUM70 0x02a9 Lilliput UM-70 +product DISPLAYLINK DVI_19 0x0360 USB to DVI-19 product DISPLAYLINK UM7X0 0x401a nanovision MiMo product DISPLAYLINK LT1421 0x03e0 Lenovo ThinkVision LT1421 product DISPLAYLINK POLARIS2 0x0117 Polaris2 USB dock Modified: stable/12/sys/dev/usb/video/udl.c ============================================================================== --- stable/12/sys/dev/usb/video/udl.c Tue Dec 10 07:04:20 2019 (r355576) +++ stable/12/sys/dev/usb/video/udl.c Tue Dec 10 07:06:32 2019 (r355577) @@ -179,6 +179,7 @@ static const STRUCT_USB_HOST_ID udl_devs[] = { {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_POLARIS2, DLUNK)}, {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LT1421, DLUNK)}, {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_ITEC, DL165)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_DVI_19, DL165)}, }; static void From owner-svn-src-all@freebsd.org Tue Dec 10 07:07:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B26481D14F8; Tue, 10 Dec 2019 07:07:18 +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 47XB2Z4HzPz4X0w; Tue, 10 Dec 2019 07:07:18 +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 8E7F327246; Tue, 10 Dec 2019 07:07:18 +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 xBA77IqS039057; Tue, 10 Dec 2019 07:07:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBA77IjP039056; Tue, 10 Dec 2019 07:07:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201912100707.xBA77IjP039056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Dec 2019 07:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355578 - in stable/11/sys/dev/usb: . video X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/usb: . video X-SVN-Commit-Revision: 355578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 07:07:18 -0000 Author: hselasky Date: Tue Dec 10 07:07:17 2019 New Revision: 355578 URL: https://svnweb.freebsd.org/changeset/base/355578 Log: MFC r354969: Add USB ID for Diamond Multimedia BVU195 Display Link device. Submitted by: darius@dons.net.au PR: 242128 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/usbdevs stable/11/sys/dev/usb/video/udl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/usbdevs ============================================================================== --- stable/11/sys/dev/usb/usbdevs Tue Dec 10 07:06:32 2019 (r355577) +++ stable/11/sys/dev/usb/usbdevs Tue Dec 10 07:07:17 2019 (r355578) @@ -1713,6 +1713,7 @@ product DISPLAYLINK M01061 0x01e2 Lenovo DVI product DISPLAYLINK SWDVI 0x024c SUNWEIT DVI product DISPLAYLINK NBDOCK 0x0215 VideoHome NBdock1920 product DISPLAYLINK LUM70 0x02a9 Lilliput UM-70 +product DISPLAYLINK DVI_19 0x0360 USB to DVI-19 product DISPLAYLINK UM7X0 0x401a nanovision MiMo product DISPLAYLINK LT1421 0x03e0 Lenovo ThinkVision LT1421 product DISPLAYLINK POLARIS2 0x0117 Polaris2 USB dock Modified: stable/11/sys/dev/usb/video/udl.c ============================================================================== --- stable/11/sys/dev/usb/video/udl.c Tue Dec 10 07:06:32 2019 (r355577) +++ stable/11/sys/dev/usb/video/udl.c Tue Dec 10 07:07:17 2019 (r355578) @@ -179,6 +179,7 @@ static const STRUCT_USB_HOST_ID udl_devs[] = { {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_POLARIS2, DLUNK)}, {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_LT1421, DLUNK)}, {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_ITEC, DL165)}, + {USB_VPI(USB_VENDOR_DISPLAYLINK, USB_PRODUCT_DISPLAYLINK_DVI_19, DL165)}, }; static void From owner-svn-src-all@freebsd.org Tue Dec 10 07:45:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECF8C1D1D39; Tue, 10 Dec 2019 07:45:11 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47XBtH5kLJz4YHK; Tue, 10 Dec 2019 07:45:11 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB58727957; Tue, 10 Dec 2019 07:45:11 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBA7jBMN062127; Tue, 10 Dec 2019 07:45:11 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBA7jAeu062121; Tue, 10 Dec 2019 07:45:10 GMT (envelope-from np@FreeBSD.org) Message-Id: <201912100745.xBA7jAeu062121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 10 Dec 2019 07:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355579 - in head/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Commit-Revision: 355579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 07:45:12 -0000 Author: np Date: Tue Dec 10 07:45:10 2019 New Revision: 355579 URL: https://svnweb.freebsd.org/changeset/base/355579 Log: cxgbe(4): Update T4/5/6 firmwares to 1.24.11.0. These were obtained from the Chelsio Unified Wire v3.12.0.1 beta release. Note that the firmwares are not uuencoded any more. MFH: 1 month Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/firmware/t4fw-1.24.11.0.bin (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw-1.24.11.0.bin (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw-1.24.11.0.bin (contents, props changed) Deleted: head/sys/dev/cxgbe/firmware/t4fw-1.23.0.0.bin.uu head/sys/dev/cxgbe/firmware/t5fw-1.23.0.0.bin.uu head/sys/dev/cxgbe/firmware/t6fw-1.23.0.0.bin.uu Modified: head/sys/conf/files head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt head/sys/modules/cxgbe/t4_firmware/Makefile head/sys/modules/cxgbe/t5_firmware/Makefile head/sys/modules/cxgbe/t6_firmware/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Dec 10 07:07:17 2019 (r355578) +++ head/sys/conf/files Tue Dec 10 07:45:10 2019 (r355579) @@ -1469,8 +1469,8 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.23.0.0.bin.uu" \ - compile-with "${NORMAL_FW}" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.24.11.0.bin" \ + compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t4fw.fw" t5fw_cfg.c optional cxgbe \ @@ -1503,8 +1503,8 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.23.0.0.bin.uu" \ - compile-with "${NORMAL_FW}" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.24.11.0.bin" \ + compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t5fw.fw" t6fw_cfg.c optional cxgbe \ @@ -1537,8 +1537,8 @@ t6fw.fwo optional cxgbe \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.23.0.0.bin.uu" \ - compile-with "${NORMAL_FW}" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.24.11.0.bin" \ + compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t6fw.fw" dev/cxgbe/crypto/t4_crypto.c optional ccr \ Added: head/sys/dev/cxgbe/firmware/t4fw-1.24.11.0.bin ============================================================================== Binary file. No diff available. Modified: head/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_interface.h Tue Dec 10 07:07:17 2019 (r355578) +++ head/sys/dev/cxgbe/firmware/t4fw_interface.h Tue Dec 10 07:45:10 2019 (r355579) @@ -9938,20 +9938,20 @@ enum fw_hdr_chip { (((x) >> S_FW_HDR_FW_VER_BUILD) & M_FW_HDR_FW_VER_BUILD) enum { - T4FW_VERSION_MAJOR = 0x01, - T4FW_VERSION_MINOR = 0x17, - T4FW_VERSION_MICRO = 0x00, - T4FW_VERSION_BUILD = 0x00, + T4FW_VERSION_MAJOR = 1, + T4FW_VERSION_MINOR = 24, + T4FW_VERSION_MICRO = 11, + T4FW_VERSION_BUILD = 0, - T5FW_VERSION_MAJOR = 0x01, - T5FW_VERSION_MINOR = 0x17, - T5FW_VERSION_MICRO = 0x00, - T5FW_VERSION_BUILD = 0x00, + T5FW_VERSION_MAJOR = 1, + T5FW_VERSION_MINOR = 24, + T5FW_VERSION_MICRO = 11, + T5FW_VERSION_BUILD = 0, - T6FW_VERSION_MAJOR = 0x01, - T6FW_VERSION_MINOR = 0x17, - T6FW_VERSION_MICRO = 0x00, - T6FW_VERSION_BUILD = 0x00, + T6FW_VERSION_MAJOR = 1, + T6FW_VERSION_MINOR = 24, + T6FW_VERSION_MICRO = 11, + T6FW_VERSION_BUILD = 0, }; enum { Added: head/sys/dev/cxgbe/firmware/t5fw-1.24.11.0.bin ============================================================================== Binary file. No diff available. Added: head/sys/dev/cxgbe/firmware/t6fw-1.24.11.0.bin ============================================================================== Binary file. No diff available. Modified: head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt Tue Dec 10 07:07:17 2019 (r355578) +++ head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt Tue Dec 10 07:45:10 2019 (r355579) @@ -95,12 +95,19 @@ sge_timer_value = 5, 10, 20, 50, 100, 200 # SGE_TIMER_VALUE* in usecs reg[0x10c4] = 0x20000000/0x20000000 # GK_CONTROL, enable 5th thread - # Set the SGE Doorbell Queue Timer "tick" to 5us and initialize + # Set the SGE Doorbell Queue Timer "tick" to 50us and initialize # the Timer Table to a default set of values (which are multiples - # of the Timer Tick). + # of the Timer Tick). Note that the set of Tick Multipliers are + # NOT sorted. The Host Drivers are expected to pick amongst them + # for (Tick * Multiplier[i]) values which most closely match the Host + # Drivers' needs. Also, most Host Drivers will be default start + # start with (Tick * Multiplier[0]), so this gives us some flexibility + # in terms of picking a Tick and a default Multiplier somewhere in + # the middle of the achievable set of (Tick * Multiplier[i]) values. + # Thus, the below select for 150us by this default. # - sge_dbq_timertick = 5 - sge_dbq_timer = 1, 2, 3, 5, 7, 9, 12, 16 + sge_dbq_timertick = 50 + sge_dbq_timer = 3, 2, 1, 5, 7, 9, 12, 16 # enable TP_OUT_CONFIG.IPIDSPLITMODE reg[0x7d04] = 0x00010000/0x00010000 @@ -423,10 +430,10 @@ tp_l2t = 3072 tp_ddp = 2 tp_ddp_iscsi = 2 - tp_tls_key = 3 + tp_tls_key = 2 tp_tls_mxrxsize = 17408 # 16384 + 1024, governs max rx data, pm max xfer len, rx coalesce sizes tp_stag = 2 - tp_pbl = 5 + tp_pbl = 7 tp_rq = 7 tp_srq = 128 @@ -471,7 +478,7 @@ nhash = 2048 tp_l2t = 4 protocol = fcoe_initiator - tp_ddp = 2 + tp_ddp = 1 fcoe_nfcf = 16 fcoe_nvnp = 32 fcoe_nssn = 1024 @@ -581,7 +588,7 @@ [fini] version = 0x1425001d - checksum = 0xdbff9437 + checksum = 0x14a022cd # Total resources used by above allocations: # Virtual Interfaces: 104 @@ -592,4 +599,4 @@ # Virtual Functions: 64 # # $FreeBSD$ -# +# \ No newline at end of file Modified: head/sys/modules/cxgbe/t4_firmware/Makefile ============================================================================== --- head/sys/modules/cxgbe/t4_firmware/Makefile Tue Dec 10 07:07:17 2019 (r355578) +++ head/sys/modules/cxgbe/t4_firmware/Makefile Tue Dec 10 07:45:10 2019 (r355579) @@ -17,11 +17,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T4FW_VER= 1.23.0.0 -FIRMWS+= t4fw.fw:t4fw:${T4FW_VER} -CLEANFILES+= t4fw.fw - -t4fw.fw: t4fw-${T4FW_VER}.bin.uu - uudecode -o ${.TARGET} ${.ALLSRC} +T4FW_VER= 1.24.11.0 +FIRMWS+= t4fw-${T4FW_VER}.bin:t4fw:${T4FW_VER} .include Modified: head/sys/modules/cxgbe/t5_firmware/Makefile ============================================================================== --- head/sys/modules/cxgbe/t5_firmware/Makefile Tue Dec 10 07:07:17 2019 (r355578) +++ head/sys/modules/cxgbe/t5_firmware/Makefile Tue Dec 10 07:45:10 2019 (r355579) @@ -17,11 +17,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T5FW_VER= 1.23.0.0 -FIRMWS+= t5fw.fw:t5fw:${T5FW_VER} -CLEANFILES+= t5fw.fw - -t5fw.fw: t5fw-${T5FW_VER}.bin.uu - uudecode -o ${.TARGET} ${.ALLSRC} +T5FW_VER= 1.24.11.0 +FIRMWS+= t5fw-${T5FW_VER}.bin:t5fw:${T5FW_VER} .include Modified: head/sys/modules/cxgbe/t6_firmware/Makefile ============================================================================== --- head/sys/modules/cxgbe/t6_firmware/Makefile Tue Dec 10 07:07:17 2019 (r355578) +++ head/sys/modules/cxgbe/t6_firmware/Makefile Tue Dec 10 07:45:10 2019 (r355579) @@ -17,11 +17,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T6FW_VER= 1.23.0.0 -FIRMWS+= t6fw.fw:t6fw:${T6FW_VER} -CLEANFILES+= t6fw.fw - -t6fw.fw: t6fw-${T6FW_VER}.bin.uu - uudecode -o ${.TARGET} ${.ALLSRC} +T6FW_VER= 1.24.11.0 +FIRMWS+= t6fw-${T6FW_VER}.bin:t6fw:${T6FW_VER} .include From owner-svn-src-all@freebsd.org Tue Dec 10 08:16:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 229651D31AE; Tue, 10 Dec 2019 08:16:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47XCZD08MZz4b0K; Tue, 10 Dec 2019 08:16:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0012727EE7; Tue, 10 Dec 2019 08:16:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBA8GJMH080014; Tue, 10 Dec 2019 08:16:19 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBA8GJ9t080011; Tue, 10 Dec 2019 08:16:19 GMT (envelope-from np@FreeBSD.org) Message-Id: <201912100816.xBA8GJ9t080011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 10 Dec 2019 08:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355580 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 355580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 08:16:20 -0000 Author: np Date: Tue Dec 10 08:16:19 2019 New Revision: 355580 URL: https://svnweb.freebsd.org/changeset/base/355580 Log: cxgbe(4): Use TX_PKTS2 work requests in netmap Tx if it's available. TX_PKTS2 is more efficient within the firmware and this improves netmap Tx by a few Mpps in some common scenarios. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_netmap.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Dec 10 07:45:10 2019 (r355579) +++ head/sys/dev/cxgbe/adapter.h Tue Dec 10 08:16:19 2019 (r355580) @@ -743,6 +743,7 @@ struct sge_nm_txq { u_int udb_qid; u_int cntxt_id; __be32 cpl_ctrl0; /* for convenience */ + __be32 op_pkd; /* ditto */ u_int nid; /* netmap ring # for this queue */ /* infrequently used items after this */ Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Tue Dec 10 07:45:10 2019 (r355579) +++ head/sys/dev/cxgbe/t4_netmap.c Tue Dec 10 08:16:19 2019 (r355580) @@ -573,7 +573,10 @@ ndesc_to_npkt(const int n) } #define MAX_NPKT_IN_TYPE1_WR (ndesc_to_npkt(SGE_MAX_WR_NDESC)) -/* Space (in descriptors) needed for a type1 WR that carries n packets */ +/* + * Space (in descriptors) needed for a type1 WR (TX_PKTS or TX_PKTS2) that + * carries n packets + */ static inline int npkt_to_ndesc(const int n) { @@ -583,7 +586,10 @@ npkt_to_ndesc(const int n) return ((n + 2) / 2); } -/* Space (in 16B units) needed for a type1 WR that carries n packets */ +/* + * Space (in 16B units) needed for a type1 WR (TX_PKTS or TX_PKTS2) that + * carries n packets + */ static inline int npkt_to_len16(const int n) { @@ -670,7 +676,7 @@ cxgbe_nm_tx(struct adapter *sc, struct sge_nm_txq *nm_ len = 0; wr = (void *)&nm_txq->desc[nm_txq->pidx]; - wr->op_pkd = htobe32(V_FW_WR_OP(FW_ETH_TX_PKTS_WR)); + wr->op_pkd = nm_txq->op_pkd; wr->equiq_to_len16 = htobe32(V_FW_WR_LEN16(npkt_to_len16(n))); wr->npkt = n; wr->r3 = 0; @@ -778,7 +784,8 @@ reclaim_nm_tx_desc(struct sge_nm_txq *nm_txq) while (nm_txq->cidx != hw_cidx) { wr = (void *)&nm_txq->desc[nm_txq->cidx]; - MPASS(wr->op_pkd == htobe32(V_FW_WR_OP(FW_ETH_TX_PKTS_WR))); + MPASS(wr->op_pkd == htobe32(V_FW_WR_OP(FW_ETH_TX_PKTS_WR)) || + wr->op_pkd == htobe32(V_FW_WR_OP(FW_ETH_TX_PKTS2_WR))); MPASS(wr->type == 1); MPASS(wr->npkt > 0 && wr->npkt <= MAX_NPKT_IN_TYPE1_WR); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Dec 10 07:45:10 2019 (r355579) +++ head/sys/dev/cxgbe/t4_sge.c Tue Dec 10 08:16:19 2019 (r355580) @@ -3754,6 +3754,10 @@ alloc_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm nm_txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) | V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(sc->pf) | V_TXPKT_VF(vi->vin) | V_TXPKT_VF_VLD(vi->vfvld)); + if (sc->params.fw_vers >= FW_VERSION32(1, 24, 11, 0)) + nm_txq->op_pkd = htobe32(V_FW_WR_OP(FW_ETH_TX_PKTS2_WR)); + else + nm_txq->op_pkd = htobe32(V_FW_WR_OP(FW_ETH_TX_PKTS_WR)); nm_txq->cntxt_id = INVALID_NM_TXQ_CNTXT_ID; snprintf(name, sizeof(name), "%d", idx); From owner-svn-src-all@freebsd.org Tue Dec 10 08:28:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C918A1D3479; Tue, 10 Dec 2019 08:28:19 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vtr.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47XCr14NMGz4bSR; Tue, 10 Dec 2019 08:28:17 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp239-208.static.internode.on.net [59.167.239.208]) by vtr.rulingia.com (8.15.2/8.15.2) with ESMTPS id xBA8S1JQ053759 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Dec 2019 19:28:07 +1100 (AEDT) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id xBA8RtQ2041652 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 10 Dec 2019 19:27:55 +1100 (AEDT) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id xBA8RtSO041651; Tue, 10 Dec 2019 19:27:55 +1100 (AEDT) (envelope-from peter) Date: Tue, 10 Dec 2019 19:27:55 +1100 From: Peter Jeremy To: Michal Meloun Cc: Kyle Evans , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r355487 - in head/sys: arm64/arm64 arm64/include conf Message-ID: <20191210082755.GA31003@server.rulingia.com> References: <201912071614.xB7GENQ3080793@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WIyZ46R2i8wDzkSu" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 47XCr14NMGz4bSR X-Spamd-Bar: ------- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of peter@rulingia.com designates 2001:19f0:5801:ebe:5400:1ff:fe53:30fd as permitted sender) smtp.mailfrom=peter@rulingia.com X-Spamd-Result: default: False [-7.72 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[rulingia.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-3.32)[ip: (-9.65), ipnet: 2001:19f0:5800::/38(-4.83), asn: 20473(-2.08), country: US(-0.05)]; TO_DN_ALL(0.00)[]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:20473, ipnet:2001:19f0:5800::/38, country:US]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 08:28:19 -0000 --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-Dec-09 08:38:01 -0600, Kyle Evans wrote: =2E.. >> +static vm_offset_t >> +freebsd_parse_boot_param(struct arm64_bootparams *abp) >> +{ >> + vm_offset_t lastaddr =3D 0; >> + void *kmdp; >> +#ifdef DDB >> + vm_offset_t ksym_start; >> + vm_offset_t ksym_end; >> +#endif >> + >> + if (abp->modulep =3D=3D 0) >> + return (0); >> + >> + preload_metadata =3D (caddr_t)(uintptr_t)(abp->modulep); >> + kmdp =3D preload_search_by_type("elf kernel"); >> + if (kmdp =3D=3D NULL) >> + return (0); >> + >> + boothowto =3D MD_FETCH(kmdp, MODINFOMD_HOWTO, int); >> + loader_envp =3D MD_FETCH(kmdp, MODINFOMD_ENVP, char *); >> + init_static_kenv(static_kenv, 0); > >This should read "loader_envp" instead of "static_kenv" -- as written, >it stomps over the kenv provided by loader. Which breaks diskless booting and NFS root. Changing static_kenv to loader_envp unbreaks the kernel. --=20 Peter Jeremy --WIyZ46R2i8wDzkSu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAl3vVvJfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzRSPA/8Czk5dO7sN067HIULDFqg5oG0zHWw+aLh2tybNu6YYWBaBNTGDlbF2+J+ u7VzTNry9HZmunHKsWG8Ui7DYP2vSdvcZTj/QGo7KO1Q8mds5J4dEOSpZbcIENAi 1jF56XHjBwpG9UKudGqtb6BcAUWI4tvwhXe3xVttwgWdF4Xj65WFWjAe4N8147er 3IIZJA4dBfcy88/qvVza100ktj8Gs89nV1AkX6UXJPu4U7PI6zZ62yXBA7ND+7nx Xolnd0d3JNsD/MKqtjbn7ogwVHnY4nahua8A8yUoqo9Nl5borKgWRIP1S9c2MTuW kCE8tchsa813+vsF4+Bb97uLd8leVA9HBvllVCG1ysLzJ0amc7R98F2EGEM1R2Lk UwPOBgCa0xge5L/SMxZJQA6PGT+hlf85Cpg7Edi9T9Jd/G5kh3QTWNt3s7aC+fXG BOvgEUwqLkZC16TZracrsOztpTgRwnH9e7SILI2uq1kCn8bbwjfKdVUmi0ROZ35B E9UorbE6U9pKteOUNkBgaeeelcWEN/SB55aS0w0oRqDEBD2kS21E/YepumPVUG0F 62KJwVewk3d3k9j6twYWEalD5vVJ1dRBmoPnswfnQLOWQ45wd0CW2tc6cbo8ycex W6LfeMeX1cT4cdM/kBHSliomX4YpBI2tggkfgaa0IOiECErUqzU= =vlyy -----END PGP SIGNATURE----- --WIyZ46R2i8wDzkSu-- From owner-svn-src-all@freebsd.org Tue Dec 10 10:35:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 212B91D5C73; Tue, 10 Dec 2019 10:35:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47XGfs01pHz4j8Y; Tue, 10 Dec 2019 10:35:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F023B2981A; Tue, 10 Dec 2019 10:35:32 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBAAZWpS063062; Tue, 10 Dec 2019 10:35:32 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAAZWen063061; Tue, 10 Dec 2019 10:35:32 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201912101035.xBAAZWen063061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 10 Dec 2019 10:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355581 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 355581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 10:35:33 -0000 Author: ae Date: Tue Dec 10 10:35:32 2019 New Revision: 355581 URL: https://svnweb.freebsd.org/changeset/base/355581 Log: Avoid access to stale ip pointer and call UPDATE_POINTERS() after PULLUP_LEN_LOCKED(). PULLUP_LEN_LOCKED() could update mbuf and thus we need to update related pointers that can be used in next opcodes. Reported by: Maxime Villard MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Tue Dec 10 08:16:19 2019 (r355580) +++ head/sys/netpfil/ipfw/ip_fw2.c Tue Dec 10 10:35:32 2019 (r355581) @@ -1465,7 +1465,8 @@ do { \ #define PULLUP_LEN(_len, p, T) _PULLUP_LOCKED(_len, p, T, ) #define PULLUP_LEN_LOCKED(_len, p, T) \ - _PULLUP_LOCKED(_len, p, T, IPFW_PF_RUNLOCK(chain)) + _PULLUP_LOCKED(_len, p, T, IPFW_PF_RUNLOCK(chain)); \ + UPDATE_POINTERS() /* * In case pointers got stale after pullups, update them. */ From owner-svn-src-all@freebsd.org Tue Dec 10 12:12:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCF021D83EB; Tue, 10 Dec 2019 12:12:48 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47XJq451PGz4npy; Tue, 10 Dec 2019 12:12:48 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A78CD2A9EC; Tue, 10 Dec 2019 12:12:48 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBACCmtR022020; Tue, 10 Dec 2019 12:12:48 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBACCm1T022019; Tue, 10 Dec 2019 12:12:48 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201912101212.xBACCm1T022019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 10 Dec 2019 12:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355582 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 355582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 12:12:48 -0000 Author: arichardson Date: Tue Dec 10 12:12:48 2019 New Revision: 355582 URL: https://svnweb.freebsd.org/changeset/base/355582 Log: Use ${.ALLSRC:Ninstalldirs-*} instead of assuming order of .ALLSRC This is a follow-up to https://reviews.freebsd.org/D22382 Suggested By: sjg Modified: head/share/mk/bsd.files.mk Modified: head/share/mk/bsd.files.mk ============================================================================== --- head/share/mk/bsd.files.mk Tue Dec 10 10:35:32 2019 (r355581) +++ head/share/mk/bsd.files.mk Tue Dec 10 12:12:48 2019 (r355582) @@ -116,7 +116,7 @@ installfiles-${group}: _${group}INS_${file} _${group}INS_${file}: ${file} installdirs-${_${group}DIR_${file}} ${INSTALL} ${${group}TAG_ARGS} -o ${${group}OWN_${file}} \ -g ${${group}GRP_${file}} -m ${${group}MODE_${file}} \ - ${.ALLSRC:[1]} ${${group}PREFIX_${file}}/${${group}NAME_${file}} + ${.ALLSRC:Ninstalldirs-*} ${${group}PREFIX_${file}}/${${group}NAME_${file}} .endfor # file in ${${group}} .endif # defined(${group}) && !empty(${group}) From owner-svn-src-all@freebsd.org Tue Dec 10 13:52:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B60B41DA1D5; Tue, 10 Dec 2019 13:52:09 +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 47XM1j4S4Kz4spr; Tue, 10 Dec 2019 13:52:09 +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 93E962BBB3; Tue, 10 Dec 2019 13:52:09 +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 xBADq9s6077719; Tue, 10 Dec 2019 13:52:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBADq9d2077717; Tue, 10 Dec 2019 13:52:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912101352.xBADq9d2077717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Dec 2019 13:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355583 - in head/share: syscons/fonts syscons/keymaps vt/keymaps X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/share: syscons/fonts syscons/keymaps vt/keymaps X-SVN-Commit-Revision: 355583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 13:52:09 -0000 Author: emaste Date: Tue Dec 10 13:52:08 2019 New Revision: 355583 URL: https://svnweb.freebsd.org/changeset/base/355583 Log: strip trailing whitespace from font and keymap INDEX files PR: 235853 Submitted by: scootergrisen gmail com MFC after: 1 week Modified: head/share/syscons/fonts/INDEX.fonts head/share/syscons/keymaps/INDEX.keymaps head/share/vt/keymaps/INDEX.keymaps Modified: head/share/syscons/fonts/INDEX.fonts ============================================================================== --- head/share/syscons/fonts/INDEX.fonts Tue Dec 10 12:12:48 2019 (r355582) +++ head/share/syscons/fonts/INDEX.fonts Tue Dec 10 13:52:08 2019 (r355583) @@ -1,7 +1,7 @@ # # $FreeBSD$ # -# database for vidfont(8) +# database for vidfont(8) # # Format :: # @@ -25,21 +25,21 @@ # ISO 8859-1 supports the following languages: # Afrikaans, Catalan, Danish, Dutch, English, Faroese, Finnish, French, # German, Galician, Irish, Icelandic, Italian, Norwegian, Portuguese, -# Spanish and Swedish. -# +# Spanish and Swedish. +# # (It has been called to my attention that Albanian can be written with # ISO 8859-1 also. However, from a standards point of view, ISO 8859-2 # is the appropriate character set for Balkan countries.) -# +# # ISO 8859-1 is just one part of the ISO-8859 standard, which specifies # several character sets, e.g.: # 8859-1 Europe, Latin America # 8859-2 Eastern Europe -# 8859-3 SE Europe/miscellaneous (Esperanto, Maltese, etc.) +# 8859-3 SE Europe/miscellaneous (Esperanto, Maltese, etc.) # 8859-4 Scandinavia/Baltic (mostly covered by 8859-1 also) # 8859-5 Cyrillic # 8859-6 Arabic -# 8859-7 Greek +# 8859-7 Greek # 8859-8 Hebrew # 8859-9 Latin5, same as 8859-1 except for Turkish instead of Icelandic # 8859-10 Latin6, for Eskimo/Scandinavian languages @@ -70,17 +70,17 @@ FONT:hy:armscii8-8x16.fnt # armscii8-8x16.fnt:hy:ARMSCII-8 Îá¹³íáñÙ³Ý ³ÕáõëÛ³Ï, 8x16 armscii8-8x16.fnt:ru:ëÏÄÉÒÏ×ËÁ ARMSCII-8, 8x16 -armscii8-8x16.fnt:en:ARMSCII-8 Character set, 8x16 -armscii8-8x16.fnt:de:ARMSCII-8 Zeichensatz, 8x16 +armscii8-8x16.fnt:en:ARMSCII-8 Character set, 8x16 +armscii8-8x16.fnt:de:ARMSCII-8 Zeichensatz, 8x16 armscii8-8x14.fnt:hy:ARMSCII-8 Îá¹³íáñÙ³Ý ³ÕáõëÛ³Ï, 8x14 armscii8-8x14.fnt:ru:ëÏÄÉÒÏ×ËÁ ARMSCII-8, 8x14 -armscii8-8x14.fnt:en:ARMSCII-8 Character set, 8x14 +armscii8-8x14.fnt:en:ARMSCII-8 Character set, 8x14 armscii8-8x14.fnt:de:ARMSCII-8 Zeichensatz, 8x14 armscii8-8x8.fnt:hy:ARMSCII-8 Îá¹³íáñÙ³Ý ³ÕáõëÛ³Ï, 8x8 armscii8-8x8.fnt:ru:ëÏÄÉÒÏ×ËÁ ARMSCII-8, 8x8 -armscii8-8x8.fnt:en:ARMSCII-8 Character set, 8x8 +armscii8-8x8.fnt:en:ARMSCII-8 Character set, 8x8 armscii8-8x8.fnt:de:ARMSCII-8 Zeichensatz, 8x8 cp437-8x14.fnt:en:Codepage 437 English, 8x14 Modified: head/share/syscons/keymaps/INDEX.keymaps ============================================================================== --- head/share/syscons/keymaps/INDEX.keymaps Tue Dec 10 12:12:48 2019 (r355582) +++ head/share/syscons/keymaps/INDEX.keymaps Tue Dec 10 13:52:08 2019 (r355583) @@ -1,6 +1,6 @@ # $FreeBSD$ # -# database for kbdmap(8) +# database for kbdmap(8) # # Format :: # @@ -9,7 +9,7 @@ # lang: lang,lang # # If lang empty use 'en' (us-english) as default. -# +# # Example: # german.iso.kbd:de:deutsch ISO-8859-1 # german.iso.kbd:en:german ISO-8859-1 @@ -40,7 +40,7 @@ FONT:he:iso08-8x16.fnt FONT:uk:koi8-u-8x16.fnt FONT:el:iso07-8x16.fnt FONT:hy:haik8-8x16.fnt -# +# be.iso.kbd:en:Belgian ISO-8859-1 be.iso.kbd:de:Belgisch ISO-8859-1 be.iso.kbd:fr:Belge ISO-8859-1 @@ -547,7 +547,7 @@ us.dvorakr.kbd:pt:Estados Unidos da América dvorakr us.dvorakr.kbd:es:Estadounidense dvorak diestro us.dvorakl.kbd:en:United States of America lefthand dvorak -us.dvorakl.kbd:de:US-amerikanisch dvorak linke Hand +us.dvorakl.kbd:de:US-amerikanisch dvorak linke Hand us.dvorakl.kbd:fr:États Unis d'Amérique dvorakl us.dvorakl.kbd:pt:Estados Unidos da América dvorakl us.dvorakl.kbd:es:Estadounidense dvorak zurdo Modified: head/share/vt/keymaps/INDEX.keymaps ============================================================================== --- head/share/vt/keymaps/INDEX.keymaps Tue Dec 10 12:12:48 2019 (r355582) +++ head/share/vt/keymaps/INDEX.keymaps Tue Dec 10 13:52:08 2019 (r355583) @@ -1,6 +1,6 @@ # $FreeBSD$ # -# database for kbdmap(8) +# database for kbdmap(8) # # Format :: # @@ -9,7 +9,7 @@ # lang: lang,lang # # If lang empty use 'en' (us-english) as default. -# +# # Example: # german.iso.kbd:de:deutsch # german.iso.kbd:en:german @@ -552,7 +552,7 @@ us.dvorakr.kbd:pt:Estados Unidos da América dvorakr us.dvorakr.kbd:es:Estadounidense dvorak diestro us.dvorakl.kbd:en:United States of America lefthand dvorak -us.dvorakl.kbd:de:US-amerikanisch dvorak linke Hand +us.dvorakl.kbd:de:US-amerikanisch dvorak linke Hand us.dvorakl.kbd:fr:États Unis d'Amérique dvorakl us.dvorakl.kbd:pt:Estados Unidos da América dvorakl us.dvorakl.kbd:es:Estadounidense dvorak zurdo From owner-svn-src-all@freebsd.org Tue Dec 10 14:07:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 510011DA661; Tue, 10 Dec 2019 14:07:06 +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 47XMLy1VQMz4tSw; Tue, 10 Dec 2019 14:07:06 +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 2EAC42BDAA; Tue, 10 Dec 2019 14:07:06 +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 xBAE76Ki086340; Tue, 10 Dec 2019 14:07:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAE75Sa086337; Tue, 10 Dec 2019 14:07:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201912101407.xBAE75Sa086337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 10 Dec 2019 14:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355584 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 355584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 14:07:06 -0000 Author: kib Date: Tue Dec 10 14:07:05 2019 New Revision: 355584 URL: https://svnweb.freebsd.org/changeset/base/355584 Log: UFS: implement VOP_INACTIVE() The checks literally repeat conditions that make ufs_inactive() to take some actions. Reviewed by: jeff Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D22616 Modified: head/sys/ufs/ufs/ufs_extern.h head/sys/ufs/ufs/ufs_inode.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_extern.h ============================================================================== --- head/sys/ufs/ufs/ufs_extern.h Tue Dec 10 13:52:08 2019 (r355583) +++ head/sys/ufs/ufs/ufs_extern.h Tue Dec 10 14:07:05 2019 (r355584) @@ -79,6 +79,7 @@ int ufs_inactive(struct vop_inactive_args *); int ufs_init(struct vfsconf *); void ufs_itimes(struct vnode *vp); int ufs_lookup(struct vop_cachedlookup_args *); +int ufs_need_inactive(struct vop_need_inactive_args *); int ufs_readdir(struct vop_readdir_args *); int ufs_reclaim(struct vop_reclaim_args *); void ffs_snapgone(struct inode *); Modified: head/sys/ufs/ufs/ufs_inode.c ============================================================================== --- head/sys/ufs/ufs/ufs_inode.c Tue Dec 10 13:52:08 2019 (r355583) +++ head/sys/ufs/ufs/ufs_inode.c Tue Dec 10 14:07:05 2019 (r355584) @@ -63,6 +63,40 @@ __FBSDID("$FreeBSD$"); #include #endif +int +ufs_need_inactive(ap) + struct vop_need_inactive_args *ap; +{ + struct vnode *vp; + struct inode *ip; +#ifdef QUOTA + int i; +#endif + + vp = ap->a_vp; + ip = VTOI(vp); + if (UFS_RDONLY(ip)) + return (0); + if (ip->i_mode == 0 || ip->i_nlink <= 0 || + (ip->i_effnlink == 0 && DOINGSOFTDEP(vp)) || + (ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | + IN_UPDATE)) != 0 || + (ip->i_effnlink <= 0 && (ip->i_size != 0 || (I_IS_UFS2(ip) && + ip->i_din2->di_extsize != 0)))) + return (1); +#ifdef QUOTA + for (i = 0; i < MAXQUOTAS; i++) { + if (ip->i_dquot[i] != NULL) + return (1); + } +#endif + /* + * No need to check ufs_gjournal_close() condition since we + * return 1 if only i_nlink <= 0. + */ + return (0); +} + /* * Last reference to an inode. If necessary, write or delete it. */ Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Tue Dec 10 13:52:08 2019 (r355583) +++ head/sys/ufs/ufs/ufs_vnops.c Tue Dec 10 14:07:05 2019 (r355584) @@ -2742,6 +2742,7 @@ struct vop_vector ufs_vnodeops = { .vop_markatime = ufs_markatime, .vop_mkdir = ufs_mkdir, .vop_mknod = ufs_mknod, + .vop_need_inactive = ufs_need_inactive, .vop_open = ufs_open, .vop_pathconf = ufs_pathconf, .vop_poll = vop_stdpoll, From owner-svn-src-all@freebsd.org Tue Dec 10 14:35:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33CFE1DB19E; Tue, 10 Dec 2019 14:35:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47XMzv0gLSz3D1m; Tue, 10 Dec 2019 14:35:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1213F2C2EC; Tue, 10 Dec 2019 14:35:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBAEZcLX005148; Tue, 10 Dec 2019 14:35:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAEZcIQ005147; Tue, 10 Dec 2019 14:35:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912101435.xBAEZcIQ005147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Dec 2019 14:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355585 - head/share/vt/keymaps X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/vt/keymaps X-SVN-Commit-Revision: 355585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 14:35:39 -0000 Author: emaste Date: Tue Dec 10 14:35:38 2019 New Revision: 355585 URL: https://svnweb.freebsd.org/changeset/base/355585 Log: remove nonexistent from-* entries from vt INDEX.keymaps A number of entries of the form "de.kbd.from-cp850" existed in vt's INDEX.keymaps, added in r270114, but these files do not exist. PR: 235564 Submitted by: scootergrisen gmail com MFC after: 1 week Modified: head/share/vt/keymaps/INDEX.keymaps Modified: head/share/vt/keymaps/INDEX.keymaps ============================================================================== --- head/share/vt/keymaps/INDEX.keymaps Tue Dec 10 14:07:05 2019 (r355584) +++ head/share/vt/keymaps/INDEX.keymaps Tue Dec 10 14:35:38 2019 (r355585) @@ -92,16 +92,6 @@ cz.kbd:de:Tschechisch (QWERTZ, mit Akzenten) cz.kbd:fr:Tchèque (QWERTZ, avec accents) cz.kbd:es:Checo (QWERTZ, con acentos) -cz.kbd.from-ce:en:Czech -cz.kbd.from-ce:de:Tschechisch -cz.kbd.from-ce:fr:Tchèque -cz.kbd.from-ce:es:Checo - -cz.qwerty.kbd.from-ce:en:Czech (QWERTY) -cz.qwerty.kbd.from-ce:de:Tschechisch (QWERTY) -cz.qwerty.kbd.from-ce:fr:Tchèquey (QWERTY) -cz.qwerty.kbd.from-ce:es:Checo (QWERTY) - dk.kbd:en:Danish dk.kbd:da:Dansk dk.kbd:de:Dänisch @@ -116,13 +106,6 @@ dk.acc.kbd:fr:Danois (avec accents) dk.acc.kbd:pt:Dinamarquês (com acentos) dk.acc.kbd:es:Danés (con acentos) -dk.kbd.from-cp865:en:Danish -dk.kbd.from-cp865:da:Dansk -dk.kbd.from-cp865:de:Dänisch -dk.kbd.from-cp865:fr:Danois -dk.kbd.from-cp865:pt:Dinamarquês -dk.kbd.from-cp865:es:Danés - dk.macbook.kbd:en:Danish (macbook) dk.macbook.kbd:da:Dansk (macbook) dk.macbook.kbd:de:Dänisch (Macbook) @@ -140,31 +123,16 @@ gr.kbd:en:Greek (104 keys) gr.kbd:fr:Grec (104 touches) gr.kbd:el:Ελληνικό (104 πλήκτÏων) -ee.kbd.from-iso1:en:Estonian -ee.kbd.from-iso1:de:Estnisch -ee.kbd.from-iso1:fr:Estonien -ee.kbd.from-iso1:es:Estonio - ee.kbd:en:Estonian ee.kbd:de:Estnisch ee.kbd:fr:Estonien ee.kbd:es:Estonio -ee.kbd.from-cp850:en:Estonian -ee.kbd.from-cp850:de:Estnisch -ee.kbd.from-cp850:fr:Estonien -ee.kbd.from-cp850:es:Estonio - fi.kbd:en:Finnish fi.kbd:de:Finnisch fi.kbd:fr:Finlandais fi.kbd:es:Finlandés -fi.kbd.from-cp850:en:Finnish -fi.kbd.from-cp850:de:Finnisch -fi.kbd.from-cp850:fr:Finlandais -fi.kbd.from-cp850:es:Finlandés - fr.kbd:en:French fr.kbd:de:Französisch fr.kbd:fr:Français @@ -229,13 +197,6 @@ de.noacc.kbd:pt:Alemão (no accent keys) de.noacc.kbd:es:Alemán (no accent keys) de.noacc.kbd:uk:Ðімецька (no accent keys) -de.kbd.from-cp850:en:German -de.kbd.from-cp850:de:Deutsch -de.kbd.from-cp850:fr:Allemand -de.kbd.from-cp850:pt:Alemão -de.kbd.from-cp850:es:Alemán -de.kbd.from-cp850:uk:Ðімецька - gr.elot.acc.kbd:en:Greek ELOT gr.elot.acc.kbd:de:Grieschisch ELOT gr.elot.acc.kbd:fr:Grec ELOT @@ -367,22 +328,6 @@ pt.acc.kbd:fr:Portugais (avec accents) pt.acc.kbd:pt:Português (com acentos) pt.acc.kbd:es:Portugués (con acentos) -ru.kbd.from-cp866:en:Russian (alternative) -ru.kbd.from-cp866:de:Russisch (alternativ) -ru.kbd.from-cp866:ru:РуÑÑкий (alternative) -ru.kbd.from-cp866:fr:Russe (alternative) -ru.kbd.from-cp866:pt:Russo (alternativo) -ru.kbd.from-cp866:es:Ruso (alternativo) -ru.kbd.from-cp866:uk:РоÑійÑька (альтернативна) - -ru.kbd.from-iso5:en:Russian -ru.kbd.from-iso5:de:Russisch -ru.kbd.from-iso5:fr:Russe -ru.kbd.from-iso5:ru:РуÑÑкий -ru.kbd.from-iso5:pt:Russo -ru.kbd.from-iso5:es:Ruso -ru.kbd.from-iso5:uk:РоÑійÑький - ru.kbd:en:Russian ru.kbd:de:Russisch ru.kbd:ru:РуÑÑкий @@ -413,12 +358,6 @@ es.dvorak.kbd:fr:Espagnol Dvorak es.dvorak.kbd:pt:Espanhol Dvorak es.dvorak.kbd:es:Español Dvorak -es.kbd.from-iso1:en:Spanish -es.kbd.from-iso1:de:Spanisch -es.kbd.from-iso1:fr:Espagnol -es.kbd.from-iso1:pt:Espanhol -es.kbd.from-iso1:es:Español - es.acc.kbd:en:Spanish (accent keys) es.acc.kbd:de:Spanisch (accent keys) es.acc.kbd:fr:Espagnol (avec accents) @@ -447,11 +386,6 @@ se.kbd:de:Schwedisch se.kbd:fr:Suédois se.kbd:pt,es:Sueco -se.kbd.from-cp850:en:Swedish -se.kbd.from-cp850:de:Schwedisch -se.kbd.from-cp850:fr:Suédois -se.kbd.from-cp850:pt,es:Sueco - ch-fr.kbd:en:Swiss-French ch-fr.kbd:de:Schweiz-Französisch ch-fr.kbd:fr:Suisse-Français @@ -462,11 +396,6 @@ ch-fr.acc.kbd:de:Schweiz-Französisch (mit Akzenten) ch-fr.acc.kbd:fr:Suisse-Français (avec accents) ch-fr.acc.kbd:es:Francosuizo (con acentos) -ch-fr.kbd.from-cp850:en:Swiss-French -ch-fr.kbd.from-cp850:de:Schweiz-Französisch -ch-fr.kbd.from-cp850:fr:Suisse-Français -ch-fr.kbd.from-cp850:es:Francosuizo - ch.kbd:en:Swiss-German ch.kbd:de:Schweiz-Deutsch ch.kbd:fr:Suisse-Allemand @@ -479,12 +408,6 @@ ch.acc.kbd:fr:Suisse-Allemand (avec accents) ch.acc.kbd:pt:Suiço-Alemão (com acentos) ch.acc.kbd:es:Germanosuizo (con acentos) -ch.kbd.from-cp850:en:Swiss-German -ch.kbd.from-cp850:de:Schweiz-Deutsch -ch.kbd.from-cp850:fr:Suisse-Allemand -ch.kbd.from-cp850:pt:Suiço-Alemão -ch.kbd.from-cp850:es:Germanosuizo - ch.macbook.acc.kbd:en:Swiss-German Macbook/Macbook Pro (accent keys) ch.macbook.acc.kbd:de:Schweiz-Deutsch Macbook/Macbook Pro (mit Akzenten) ch.macbook.acc.kbd:fr:Suisse-Allemand Macbook/Macbook Pro (avec accents) @@ -588,12 +511,6 @@ us.macbook.kbd:de:US-amerikanisch Macbook/Macbook Pro us.macbook.kbd:fr:États Unis d'Amérique Macbook / Macbook Pro ISO-8859-1 us.macbook.kbd:pt:Estados Unidos da América Macbook/Macbook Pro ISO-8859-1 us.macbook.kbd:es:Estadounidense Macbook/Macbook Pro ISO-8859-1 - -ua.kbd.from-iso5:en:Ukrainian -ua.kbd.from-iso5:de:Ukrainisch -ua.kbd.from-iso5:fr:Ukrainien -ua.kbd.from-iso5:ru:УкраинÑкий -ua.kbd.from-iso5:uk:УкраїнÑька ua.kbd:en:Ukrainian ua.kbd:de:Ukrainisch From owner-svn-src-all@freebsd.org Tue Dec 10 15:22:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D6BC1DC0A9; Tue, 10 Dec 2019 15:22:37 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47XP253cW6z3GWR; Tue, 10 Dec 2019 15:22:37 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-449.fritz.box (p200300CD5F45F700F5B282D47103AABA.dip0.t-ipconnect.de [IPv6:2003:cd:5f45:f700:f5b2:82d4:7103:aaba]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id D916182E0; Tue, 10 Dec 2019 15:22:36 +0000 (UTC) (envelope-from se@freebsd.org) Subject: Re: svn commit: r355585 - head/share/vt/keymaps To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912101435.xBAEZcIQ005147@repo.freebsd.org> From: =?UTF-8?Q?Stefan_E=c3=9fer?= Message-ID: <592493f2-556d-ec0c-aa8a-788e47c26e1d@freebsd.org> Date: Tue, 10 Dec 2019 16:22:32 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <201912101435.xBAEZcIQ005147@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 15:22:37 -0000 Am 10.12.19 um 15:35 schrieb Ed Maste: > Author: emaste > Date: Tue Dec 10 14:35:38 2019 > New Revision: 355585 > URL: https://svnweb.freebsd.org/changeset/base/355585 > > Log: > remove nonexistent from-* entries from vt INDEX.keymaps > > A number of entries of the form "de.kbd.from-cp850" existed in vt's > INDEX.keymaps, added in r270114, but these files do not exist. Sorry, these were left-overs from my conversion process from 8 bit syscons charsets to UTF-8 for vt. The names were meant to simplify QA by encoding the orginal charset name in the file name. Seems that I remembered to clean up the file names before the final commit, but forgot to edit the INDEX.keymaps that contained both the final and these intermediate names for my pre-commit tests ... Nobody seems to have noticed this problem for more than 5 years, though. Regards, STefan From owner-svn-src-all@freebsd.org Tue Dec 10 16:45:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9222B1DE309; Tue, 10 Dec 2019 16:45:45 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.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 47XQt13LCfz3Lpj; Tue, 10 Dec 2019 16:45:45 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f41.google.com with SMTP id v18so19544834iol.2; Tue, 10 Dec 2019 08:45:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=aSRkzRESwJI9EX6OV6eoFwFIYxPFixP14fegG/QWWY8=; b=YRNmY7sJPdneLYoGOKUkZNUnGRFH0f2JVHL90zQ41C8yUuWC393vrXYEcWQQ10xg0/ 3xnzI74HWgDI+YSHMAHUssLqzWSufuakgxk2ecV9Y8LQXjVw2RE0do5vnb2CaX3iw0Kn KE1dOI5pCbex/ZnfqfY9Cxp05hXAUlKaQ0UF1nIOCTcOdugaS/3zAx0GQzHlchUBu3B6 QuaTyx4cQYEZlGu9pRnnBreH/lgKZQD8Likb0TJjeW+DAynPJWLrspmTNGivp5Bg2BI+ ZqIcnyf9lYyKFMFxt2FJCUXdRRA6oxtpV2HLcK4LKFpFTfiFcy/zOuzjrMq6bttSvvo5 cuWg== X-Gm-Message-State: APjAAAUx9b/qGmzEMfLLdu8n8t8rICEzNCXNTGavzYjOPKqknr+Qph+i JOo22Usbs0oDdmyq4Piiudur61FXgNd2KaYj3wjq7RIc X-Google-Smtp-Source: APXvYqwP+FHr3pX+Ah1RFLlC3Rc7LaCRmVIZHJkmzQwzpF6gMARWMsGgGAcbyl+QxVO/i1vJIOIAXrfRhBIlVRxku8A= X-Received: by 2002:a6b:39d4:: with SMTP id g203mr285533ioa.100.1575996343486; Tue, 10 Dec 2019 08:45:43 -0800 (PST) MIME-Version: 1.0 References: <201912101435.xBAEZcIQ005147@repo.freebsd.org> <592493f2-556d-ec0c-aa8a-788e47c26e1d@freebsd.org> In-Reply-To: <592493f2-556d-ec0c-aa8a-788e47c26e1d@freebsd.org> From: Ed Maste Date: Tue, 10 Dec 2019 07:59:12 -0500 Message-ID: Subject: Re: svn commit: r355585 - head/share/vt/keymaps To: =?UTF-8?B?U3RlZmFuIEXDn2Vy?= Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 47XQt13LCfz3Lpj X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 16:45:45 -0000 On Tue, 10 Dec 2019 at 10:22, Stefan E=C3=9Fer wrote: > > Nobody seems to have noticed this problem for more than 5 years, > though. Probably because there's no user-facing impact - nonexistent keymap files are just omitted from the list. I'm glad someone eventually looked and submitted a PR :) There are a couple of other keymap/font issue PRs that I'll try to look int= o. From owner-svn-src-all@freebsd.org Tue Dec 10 18:14:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 869AD1E1141; Tue, 10 Dec 2019 18:14:55 +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 47XSrv3g03z44x3; Tue, 10 Dec 2019 18:14:55 +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 5F8E72EABD; Tue, 10 Dec 2019 18:14:55 +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 xBAIEtdE045972; Tue, 10 Dec 2019 18:14:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAIEoA7045947; Tue, 10 Dec 2019 18:14:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912101814.xBAIEoA7045947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 10 Dec 2019 18:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355586 - in head/sys: amd64/amd64 amd64/include arm/include arm64/arm64 arm64/include dev/virtio/balloon i386/i386 i386/include mips/include mips/mips powerpc/aim powerpc/include riscv... X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include arm/include arm64/arm64 arm64/include dev/virtio/balloon i386/i386 i386/include mips/include mips/mips powerpc/aim powerpc/include riscv/include riscv/riscv spar... X-SVN-Commit-Revision: 355586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 18:14:55 -0000 Author: markj Date: Tue Dec 10 18:14:50 2019 New Revision: 355586 URL: https://svnweb.freebsd.org/changeset/base/355586 Log: Introduce vm_page_astate. This is a 32-bit structure embedded in each vm_page, consisting mostly of page queue state. The use of a structure makes it easy to store a snapshot of a page's queue state in a stack variable and use cmpset loops to update that state without requiring the page lock. This change merely adds the structure and updates references to atomic state fields. No functional change intended. Reviewed by: alc, jeff, kib Sponsored by: Netflix, Intel Differential Revision: https://reviews.freebsd.org/D22650 Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h head/sys/arm/include/pmap.h head/sys/arm64/arm64/pmap.c head/sys/arm64/include/pmap.h head/sys/dev/virtio/balloon/virtio_balloon.c head/sys/i386/i386/pmap.c head/sys/i386/include/pmap.h head/sys/mips/include/pmap.h head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/include/pmap.h head/sys/riscv/include/pmap.h head/sys/riscv/riscv/pmap.c head/sys/sparc64/include/pmap.h head/sys/vm/memguard.c head/sys/vm/swap_pager.c head/sys/vm/vm_mmap.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vm_swapout.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/amd64/amd64/pmap.c Tue Dec 10 18:14:50 2019 (r355586) @@ -6104,7 +6104,7 @@ retry: ("pmap_enter: no PV entry for %#lx", va)); if ((newpte & PG_MANAGED) == 0) free_pv_entry(pmap, pv); - if ((om->aflags & PGA_WRITEABLE) != 0 && + if ((om->a.flags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list) && ((om->flags & PG_FICTITIOUS) != 0 || TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) @@ -7297,7 +7297,7 @@ pmap_remove_pages(pmap_t pmap) pvh->pv_gen++; if (TAILQ_EMPTY(&pvh->pv_list)) { for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++) - if ((mt->aflags & PGA_WRITEABLE) != 0 && + if ((mt->a.flags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&mt->md.pv_list)) vm_page_aflag_clear(mt, PGA_WRITEABLE); } @@ -7315,7 +7315,7 @@ pmap_remove_pages(pmap_t pmap) pmap_resident_count_dec(pmap, 1); TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; - if ((m->aflags & PGA_WRITEABLE) != 0 && + if ((m->a.flags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&m->md.pv_list) && (m->flags & PG_FICTITIOUS) == 0) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/amd64/include/pmap.h Tue Dec 10 18:14:50 2019 (r355586) @@ -415,8 +415,8 @@ extern int pmap_pcid_enabled; extern int invpcid_works; #define pmap_page_get_memattr(m) ((vm_memattr_t)(m)->md.pat_mode) -#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) -#define pmap_unmapbios(va, sz) pmap_unmapdev((va), (sz)) +#define pmap_page_is_write_mapped(m) (((m)->a.flags & PGA_WRITEABLE) != 0) +#define pmap_unmapbios(va, sz) pmap_unmapdev((va), (sz)) struct thread; Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/arm/include/pmap.h Tue Dec 10 18:14:50 2019 (r355586) @@ -47,7 +47,7 @@ extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; void *pmap_kenter_temporary(vm_paddr_t, int); -#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) +#define pmap_page_is_write_mapped(m) (((m)->a.flags & PGA_WRITEABLE) != 0) void pmap_page_set_memattr(vm_page_t, vm_memattr_t); void *pmap_mapdev(vm_paddr_t, vm_size_t); Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/arm64/arm64/pmap.c Tue Dec 10 18:14:50 2019 (r355586) @@ -3415,7 +3415,7 @@ havel3: pv = pmap_pvh_remove(&om->md, pmap, va); if ((m->oflags & VPO_UNMANAGED) != 0) free_pv_entry(pmap, pv); - if ((om->aflags & PGA_WRITEABLE) != 0 && + if ((om->a.flags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list) && ((om->flags & PG_FICTITIOUS) != 0 || TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) @@ -4486,7 +4486,7 @@ pmap_remove_pages(pmap_t pmap) pvh->pv_gen++; if (TAILQ_EMPTY(&pvh->pv_list)) { for (mt = m; mt < &m[L2_SIZE / PAGE_SIZE]; mt++) - if ((mt->aflags & PGA_WRITEABLE) != 0 && + if ((mt->a.flags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&mt->md.pv_list)) vm_page_aflag_clear(mt, PGA_WRITEABLE); } @@ -4508,7 +4508,7 @@ pmap_remove_pages(pmap_t pmap) TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; - if ((m->aflags & PGA_WRITEABLE) != 0 && + if ((m->a.flags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&m->md.pv_list) && (m->flags & PG_FICTITIOUS) == 0) { pvh = pa_to_pvh( Modified: head/sys/arm64/include/pmap.h ============================================================================== --- head/sys/arm64/include/pmap.h Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/arm64/include/pmap.h Tue Dec 10 18:14:50 2019 (r355586) @@ -53,7 +53,7 @@ #endif #define pmap_page_get_memattr(m) ((m)->md.pv_memattr) -#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) +#define pmap_page_is_write_mapped(m) (((m)->a.flags & PGA_WRITEABLE) != 0) void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma); /* Modified: head/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.c Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/dev/virtio/balloon/virtio_balloon.c Tue Dec 10 18:14:50 2019 (r355586) @@ -332,7 +332,7 @@ vtballoon_inflate(struct vtballoon_softc *sc, int npag sc->vtballoon_page_frames[i] = VM_PAGE_TO_PHYS(m) >> VIRTIO_BALLOON_PFN_SHIFT; - KASSERT(m->queue == PQ_NONE, + KASSERT(m->a.queue == PQ_NONE, ("%s: allocated page %p on queue", __func__, m)); TAILQ_INSERT_TAIL(&sc->vtballoon_pages, m, plinks.q); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/i386/i386/pmap.c Tue Dec 10 18:14:50 2019 (r355586) @@ -3783,7 +3783,7 @@ __CONCAT(PMTYPE, enter)(pmap_t pmap, vm_offset_t va, v ("pmap_enter: no PV entry for %#x", va)); if ((newpte & PG_MANAGED) == 0) free_pv_entry(pmap, pv); - if ((om->aflags & PGA_WRITEABLE) != 0 && + if ((om->a.flags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list) && ((om->flags & PG_FICTITIOUS) != 0 || TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/i386/include/pmap.h Tue Dec 10 18:14:50 2019 (r355586) @@ -239,7 +239,7 @@ extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; #define pmap_page_get_memattr(m) ((vm_memattr_t)(m)->md.pat_mode) -#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) +#define pmap_page_is_write_mapped(m) (((m)->a.flags & PGA_WRITEABLE) != 0) #define pmap_unmapbios(va, sz) pmap_unmapdev((va), (sz)) static inline int Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/mips/include/pmap.h Tue Dec 10 18:14:50 2019 (r355586) @@ -164,7 +164,7 @@ extern vm_offset_t virtual_end; #define pmap_page_get_memattr(m) (((m)->md.pv_flags & PV_MEMATTR_MASK) >> PV_MEMATTR_SHIFT) #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) -#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) +#define pmap_page_is_write_mapped(m) (((m)->a.flags & PGA_WRITEABLE) != 0) void pmap_bootstrap(void); void *pmap_mapdev(vm_paddr_t, vm_size_t); Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/mips/mips/pmap.c Tue Dec 10 18:14:50 2019 (r355586) @@ -2158,7 +2158,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v pv = pmap_pvh_remove(&om->md, pmap, va); if (!pte_test(&newpte, PTE_MANAGED)) free_pv_entry(pmap, pv); - if ((om->aflags & PGA_WRITEABLE) != 0 && + if ((om->a.flags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list)) vm_page_aflag_clear(om, PGA_WRITEABLE); } @@ -3223,7 +3223,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t * determine if the address is MINCORE_REFERENCED. */ m = PHYS_TO_VM_PAGE(pa); - if ((m->aflags & PGA_REFERENCED) != 0) + if ((m->a.flags & PGA_REFERENCED) != 0) val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; } if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/powerpc/aim/mmu_oea.c Tue Dec 10 18:14:50 2019 (r355586) @@ -1906,7 +1906,7 @@ moea_remove_all(mmu_t mmu, vm_page_t m) moea_pvo_remove(pvo, -1); PMAP_UNLOCK(pmap); } - if ((m->aflags & PGA_WRITEABLE) && moea_query_bit(m, PTE_CHG)) { + if ((m->a.flags & PGA_WRITEABLE) && moea_query_bit(m, PTE_CHG)) { moea_attr_clear(m, PTE_CHG); vm_page_dirty(m); } Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/powerpc/aim/mmu_oea64.c Tue Dec 10 18:14:50 2019 (r355586) @@ -1493,7 +1493,7 @@ out: * Flush the page from the instruction cache if this page is * mapped executable and cacheable. */ - if (pmap != kernel_pmap && !(m->aflags & PGA_EXECUTABLE) && + if (pmap != kernel_pmap && (m->a.flags & PGA_EXECUTABLE) == 0 && (pte_lo & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { vm_page_aflag_set(m, PGA_EXECUTABLE); moea64_syncicache(mmu, pmap, va, VM_PAGE_TO_PHYS(m), PAGE_SIZE); @@ -2254,7 +2254,8 @@ moea64_pvo_protect(mmu_t mmu, pmap_t pm, struct pvo_e if (refchg < 0) refchg = (oldprot & VM_PROT_WRITE) ? LPTE_CHG : 0; - if (pm != kernel_pmap && pg != NULL && !(pg->aflags & PGA_EXECUTABLE) && + if (pm != kernel_pmap && pg != NULL && + (pg->a.flags & PGA_EXECUTABLE) == 0 && (pvo->pvo_pte.pa & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { if ((pg->oflags & VPO_UNMANAGED) == 0) vm_page_aflag_set(pg, PGA_EXECUTABLE); @@ -2468,7 +2469,7 @@ moea64_remove_all(mmu_t mmu, vm_page_t m) } KASSERT(!pmap_page_is_mapped(m), ("Page still has mappings")); - KASSERT(!(m->aflags & PGA_WRITEABLE), ("Page still writable")); + KASSERT((m->a.flags & PGA_WRITEABLE) == 0, ("Page still writable")); PV_PAGE_UNLOCK(m); /* Clean up UMA allocations */ Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/powerpc/include/pmap.h Tue Dec 10 18:14:50 2019 (r355586) @@ -249,7 +249,7 @@ extern struct pmap kernel_pmap_store; #define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx) #define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) -#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) +#define pmap_page_is_write_mapped(m) (((m)->a.flags & PGA_WRITEABLE) != 0) void pmap_bootstrap(vm_offset_t, vm_offset_t); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); Modified: head/sys/riscv/include/pmap.h ============================================================================== --- head/sys/riscv/include/pmap.h Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/riscv/include/pmap.h Tue Dec 10 18:14:50 2019 (r355586) @@ -54,7 +54,7 @@ #endif #define pmap_page_get_memattr(m) ((m)->md.pv_memattr) -#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) +#define pmap_page_is_write_mapped(m) (((m)->a.flags & PGA_WRITEABLE) != 0) void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma); /* Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/riscv/riscv/pmap.c Tue Dec 10 18:14:50 2019 (r355586) @@ -2832,7 +2832,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v ("pmap_enter: no PV entry for %#lx", va)); if ((new_l3 & PTE_SW_MANAGED) == 0) free_pv_entry(pmap, pv); - if ((om->aflags & PGA_WRITEABLE) != 0 && + if ((om->a.flags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list) && ((om->flags & PG_FICTITIOUS) != 0 || TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) @@ -3586,7 +3586,7 @@ pmap_remove_pages_pv(pmap_t pmap, vm_page_t m, pv_entr if (TAILQ_EMPTY(&pvh->pv_list)) { for (mt = m; mt < &m[Ln_ENTRIES]; mt++) if (TAILQ_EMPTY(&mt->md.pv_list) && - (mt->aflags & PGA_WRITEABLE) != 0) + (mt->a.flags & PGA_WRITEABLE) != 0) vm_page_aflag_clear(mt, PGA_WRITEABLE); } mpte = pmap_remove_pt_page(pmap, pv->pv_va); @@ -3604,7 +3604,7 @@ pmap_remove_pages_pv(pmap_t pmap, vm_page_t m, pv_entr TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; if (TAILQ_EMPTY(&m->md.pv_list) && - (m->aflags & PGA_WRITEABLE) != 0) { + (m->a.flags & PGA_WRITEABLE) != 0) { pvh = pa_to_pvh(m->phys_addr); if (TAILQ_EMPTY(&pvh->pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); @@ -4138,7 +4138,7 @@ pmap_clear_modify(vm_page_t m) * If the object containing the page is locked and the page is not * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ - if ((m->aflags & PGA_WRITEABLE) == 0) + if ((m->a.flags & PGA_WRITEABLE) == 0) return; pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : pa_to_pvh(VM_PAGE_TO_PHYS(m)); Modified: head/sys/sparc64/include/pmap.h ============================================================================== --- head/sys/sparc64/include/pmap.h Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/sparc64/include/pmap.h Tue Dec 10 18:14:50 2019 (r355586) @@ -82,7 +82,7 @@ struct pmap { #define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) #define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT -#define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) +#define pmap_page_is_write_mapped(m) (((m)->a.flags & PGA_WRITEABLE) != 0) #define pmap_page_set_memattr(m, ma) (void)0 void pmap_bootstrap(u_int cpu_impl); Modified: head/sys/vm/memguard.c ============================================================================== --- head/sys/vm/memguard.c Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/vm/memguard.c Tue Dec 10 18:14:50 2019 (r355586) @@ -262,7 +262,7 @@ v2sizep(vm_offset_t va) if (pa == 0) panic("MemGuard detected double-free of %p", (void *)va); p = PHYS_TO_VM_PAGE(pa); - KASSERT(vm_page_wired(p) && p->queue == PQ_NONE, + KASSERT(vm_page_wired(p) && p->a.queue == PQ_NONE, ("MEMGUARD: Expected wired page %p in vtomgfifo!", p)); return (&p->plinks.memguard.p); } @@ -277,7 +277,7 @@ v2sizev(vm_offset_t va) if (pa == 0) panic("MemGuard detected double-free of %p", (void *)va); p = PHYS_TO_VM_PAGE(pa); - KASSERT(vm_page_wired(p) && p->queue == PQ_NONE, + KASSERT(vm_page_wired(p) && p->a.queue == PQ_NONE, ("MEMGUARD: Expected wired page %p in vtomgfifo!", p)); return (&p->plinks.memguard.v); } Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/vm/swap_pager.c Tue Dec 10 18:14:50 2019 (r355586) @@ -1669,7 +1669,7 @@ swp_pager_force_dirty(vm_page_t m) vm_page_dirty(m); #ifdef INVARIANTS vm_page_lock(m); - if (!vm_page_wired(m) && m->queue == PQ_NONE) + if (!vm_page_wired(m) && m->a.queue == PQ_NONE) panic("page %p is neither wired nor queued", m); vm_page_unlock(m); #endif Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/vm/vm_mmap.c Tue Dec 10 18:14:50 2019 (r355586) @@ -931,9 +931,9 @@ retry: * and set PGA_REFERENCED before the call to * pmap_is_referenced(). */ - if ((m->aflags & PGA_REFERENCED) != 0 || + if ((m->a.flags & PGA_REFERENCED) != 0 || pmap_is_referenced(m) || - (m->aflags & PGA_REFERENCED) != 0) + (m->a.flags & PGA_REFERENCED) != 0) mincoreinfo |= MINCORE_REFERENCED_OTHER; } if (object != NULL) Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/vm/vm_object.c Tue Dec 10 18:14:50 2019 (r355586) @@ -897,7 +897,7 @@ vm_object_page_remove_write(vm_page_t p, int flags, bo * nosync page, skip it. Note that the object flags were not * cleared in this case so we do not have to set them. */ - if ((flags & OBJPC_NOSYNC) != 0 && (p->aflags & PGA_NOSYNC) != 0) { + if ((flags & OBJPC_NOSYNC) != 0 && (p->a.flags & PGA_NOSYNC) != 0) { *allclean = FALSE; return (FALSE); } else { @@ -2472,9 +2472,9 @@ sysctl_vm_object_list(SYSCTL_HANDLER_ARGS) * sysctl is only meant to give an * approximation of the system anyway. */ - if (m->queue == PQ_ACTIVE) + if (m->a.queue == PQ_ACTIVE) kvo->kvo_active++; - else if (m->queue == PQ_INACTIVE) + else if (m->a.queue == PQ_INACTIVE) kvo->kvo_inactive++; } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/vm/vm_page.c Tue Dec 10 18:14:50 2019 (r355586) @@ -436,9 +436,9 @@ vm_page_init_marker(vm_page_t marker, int queue, uint1 bzero(marker, sizeof(*marker)); marker->flags = PG_MARKER; - marker->aflags = aflags; + marker->a.flags = aflags; marker->busy_lock = VPB_CURTHREAD_EXCLUSIVE; - marker->queue = queue; + marker->a.queue = queue; } static void @@ -508,9 +508,9 @@ vm_page_init_page(vm_page_t m, vm_paddr_t pa, int segi m->object = NULL; m->ref_count = 0; m->busy_lock = VPB_UNBUSIED; - m->flags = m->aflags = 0; + m->flags = m->a.flags = 0; m->phys_addr = pa; - m->queue = PQ_NONE; + m->a.queue = PQ_NONE; m->psind = 0; m->segind = segind; m->order = VM_NFREEORDER; @@ -1265,7 +1265,7 @@ vm_page_initfake(vm_page_t m, vm_paddr_t paddr, vm_mem goto memattr; } m->phys_addr = paddr; - m->queue = PQ_NONE; + m->a.queue = PQ_NONE; /* Fictitious pages don't use "segind". */ m->flags = PG_FICTITIOUS; /* Fictitious pages don't use "order" or "pool". */ @@ -2002,7 +2002,7 @@ found: if ((req & VM_ALLOC_NODUMP) != 0) flags |= PG_NODUMP; m->flags = flags; - m->aflags = 0; + m->a.flags = 0; m->oflags = object == NULL || (object->flags & OBJ_UNMANAGED) != 0 ? VPO_UNMANAGED : 0; m->busy_lock = VPB_UNBUSIED; @@ -2018,7 +2018,7 @@ found: vm_wire_add(1); m->ref_count = 1; } - m->act_count = 0; + m->a.act_count = 0; if (object != NULL) { if (vm_page_insert_after(m, object, pindex, mpred)) { @@ -2212,12 +2212,12 @@ found: memattr = object->memattr; } for (m = m_ret; m < &m_ret[npages]; m++) { - m->aflags = 0; + m->a.flags = 0; m->flags = (m->flags | PG_NODUMP) & flags; m->busy_lock = busy_lock; if ((req & VM_ALLOC_WIRED) != 0) m->ref_count = 1; - m->act_count = 0; + m->a.act_count = 0; m->oflags = oflags; if (object != NULL) { if (vm_page_insert_after(m, object, pindex, mpred)) { @@ -2260,9 +2260,10 @@ vm_page_alloc_check(vm_page_t m) { KASSERT(m->object == NULL, ("page %p has object", m)); - KASSERT(m->queue == PQ_NONE && (m->aflags & PGA_QUEUE_STATE_MASK) == 0, + KASSERT(m->a.queue == PQ_NONE && + (m->a.flags & PGA_QUEUE_STATE_MASK) == 0, ("page %p has unexpected queue %d, flags %#x", - m, m->queue, (m->aflags & PGA_QUEUE_STATE_MASK))); + m, m->a.queue, (m->a.flags & PGA_QUEUE_STATE_MASK))); KASSERT(m->ref_count == 0, ("page %p has references", m)); KASSERT(!vm_page_busied(m), ("page %p is busy", m)); KASSERT(m->dirty == 0, ("page %p is dirty", m)); @@ -2336,7 +2337,7 @@ again: /* * Initialize the page. Only the PG_ZERO flag is inherited. */ - m->aflags = 0; + m->a.flags = 0; flags = 0; if ((req & VM_ALLOC_ZERO) != 0) flags = PG_ZERO; @@ -2744,7 +2745,7 @@ retry: * and dequeued. Finally, change "m" * as if vm_page_free() was called. */ - m_new->aflags = m->aflags & + m_new->a.flags = m->a.flags & ~PGA_QUEUE_STATE_MASK; KASSERT(m_new->oflags == VPO_UNMANAGED, ("page %p is managed", m_new)); @@ -3216,7 +3217,7 @@ vm_page_pagequeue(vm_page_t m) uint8_t queue; - if ((queue = atomic_load_8(&m->queue)) == PQ_NONE) + if ((queue = atomic_load_8(&m->a.queue)) == PQ_NONE) return (NULL); return (&vm_pagequeue_domain(m)->vmd_pagequeues[queue]); } @@ -3231,11 +3232,11 @@ vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_pa vm_pagequeue_assert_locked(pq); /* - * The page daemon is allowed to set m->queue = PQ_NONE without + * The page daemon is allowed to set m->a.queue = PQ_NONE without * the page queue lock held. In this case it is about to free the page, * which must not have any queue state. */ - qflags = atomic_load_16(&m->aflags); + qflags = atomic_load_16(&m->a.flags); KASSERT(pq == vm_page_pagequeue(m) || (qflags & PGA_QUEUE_STATE_MASK) == 0, ("page %p doesn't belong to queue %p but has aflags %#x", @@ -3261,7 +3262,7 @@ vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_pa * first. */ if ((qflags & PGA_REQUEUE_HEAD) != 0) { - KASSERT(m->queue == PQ_INACTIVE, + KASSERT(m->a.queue == PQ_INACTIVE, ("head enqueue not supported for page %p", m)); vmd = vm_pagequeue_domain(m); TAILQ_INSERT_BEFORE(&vmd->vmd_inacthead, m, plinks.q); @@ -3285,7 +3286,7 @@ vm_pqbatch_process(struct vm_pagequeue *pq, struct vm_ for (i = 0; i < bq->bq_cnt; i++) { m = bq->bq_pa[i]; - if (__predict_false(m->queue != queue)) + if (__predict_false(m->a.queue != queue)) continue; vm_pqbatch_process_page(pq, m); } @@ -3297,7 +3298,7 @@ vm_pqbatch_process(struct vm_pagequeue *pq, struct vm_ * * Enqueue a page in the specified page queue's batched work queue. * The caller must have encoded the requested operation in the page - * structure's aflags field. + * structure's a.flags field. */ void vm_page_pqbatch_submit(vm_page_t m, uint8_t queue) @@ -3333,12 +3334,12 @@ vm_page_pqbatch_submit(vm_page_t m, uint8_t queue) * or the page is being freed, a different thread cannot be concurrently * enqueuing the page. */ - if (__predict_true(m->queue == queue)) + if (__predict_true(m->a.queue == queue)) vm_pqbatch_process_page(pq, m); else { - KASSERT(m->queue == PQ_NONE, + KASSERT(m->a.queue == PQ_NONE, ("invalid queue transition for page %p", m)); - KASSERT((m->aflags & PGA_ENQUEUED) == 0, + KASSERT((m->a.flags & PGA_ENQUEUED) == 0, ("page %p is enqueued with invalid queue index", m)); } vm_pagequeue_unlock(pq); @@ -3394,7 +3395,7 @@ static void vm_page_dequeue_complete(vm_page_t m) { - m->queue = PQ_NONE; + m->a.queue = PQ_NONE; atomic_thread_fence_rel(); vm_page_aflag_clear(m, PGA_QUEUE_STATE_MASK); } @@ -3446,10 +3447,10 @@ vm_page_dequeue_deferred_free(vm_page_t m) KASSERT(m->ref_count == 0, ("page %p has references", m)); for (;;) { - if ((m->aflags & PGA_DEQUEUE) != 0) + if ((m->a.flags & PGA_DEQUEUE) != 0) return; atomic_thread_fence_acq(); - if ((queue = atomic_load_8(&m->queue)) == PQ_NONE) + if ((queue = atomic_load_8(&m->a.queue)) == PQ_NONE) return; if (vm_page_pqstate_cmpset(m, queue, queue, PGA_DEQUEUE, PGA_DEQUEUE)) { @@ -3483,7 +3484,7 @@ vm_page_dequeue(vm_page_t m) * vm_page_dequeue_complete(). Ensure that all queue * state is cleared before we return. */ - aflags = atomic_load_16(&m->aflags); + aflags = atomic_load_16(&m->a.flags); if ((aflags & PGA_QUEUE_STATE_MASK) == 0) return; KASSERT((aflags & PGA_DEQUEUE) != 0, @@ -3506,11 +3507,11 @@ vm_page_dequeue(vm_page_t m) } KASSERT(pq == vm_page_pagequeue(m), ("%s: page %p migrated directly between queues", __func__, m)); - KASSERT((m->aflags & PGA_DEQUEUE) != 0 || + KASSERT((m->a.flags & PGA_DEQUEUE) != 0 || mtx_owned(vm_page_lockptr(m)), ("%s: queued unlocked page %p", __func__, m)); - if ((m->aflags & PGA_ENQUEUED) != 0) + if ((m->a.flags & PGA_ENQUEUED) != 0) vm_pagequeue_remove(pq, m); vm_page_dequeue_complete(m); vm_pagequeue_unlock(pq); @@ -3525,13 +3526,14 @@ vm_page_enqueue(vm_page_t m, uint8_t queue) { vm_page_assert_locked(m); - KASSERT(m->queue == PQ_NONE && (m->aflags & PGA_QUEUE_STATE_MASK) == 0, + KASSERT(m->a.queue == PQ_NONE && + (m->a.flags & PGA_QUEUE_STATE_MASK) == 0, ("%s: page %p is already enqueued", __func__, m)); KASSERT(m->ref_count > 0, ("%s: page %p does not carry any references", __func__, m)); - m->queue = queue; - if ((m->aflags & PGA_REQUEUE) == 0) + m->a.queue = queue; + if ((m->a.flags & PGA_REQUEUE) == 0) vm_page_aflag_set(m, PGA_REQUEUE); vm_page_pqbatch_submit(m, queue); } @@ -3553,9 +3555,9 @@ vm_page_requeue(vm_page_t m) KASSERT(m->ref_count > 0, ("%s: page %p does not carry any references", __func__, m)); - if ((m->aflags & PGA_REQUEUE) == 0) + if ((m->a.flags & PGA_REQUEUE) == 0) vm_page_aflag_set(m, PGA_REQUEUE); - vm_page_pqbatch_submit(m, atomic_load_8(&m->queue)); + vm_page_pqbatch_submit(m, atomic_load_8(&m->a.queue)); } /* @@ -3584,7 +3586,7 @@ vm_page_swapqueue(vm_page_t m, uint8_t oldq, uint8_t n * queue lock is acquired, so we must verify that we hold the correct * lock before proceeding. */ - if (__predict_false(m->queue != oldq)) { + if (__predict_false(m->a.queue != oldq)) { vm_pagequeue_unlock(pq); return; } @@ -3595,7 +3597,7 @@ vm_page_swapqueue(vm_page_t m, uint8_t oldq, uint8_t n * Therefore we must remove the page from the queue now in anticipation * of a successful commit, and be prepared to roll back. */ - if (__predict_true((m->aflags & PGA_ENQUEUED) != 0)) { + if (__predict_true((m->a.flags & PGA_ENQUEUED) != 0)) { next = TAILQ_NEXT(m, plinks.q); TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); vm_page_aflag_clear(m, PGA_ENQUEUED); @@ -3658,10 +3660,10 @@ vm_page_free_prep(vm_page_t m) if ((m->oflags & VPO_UNMANAGED) == 0) { KASSERT(!pmap_page_is_mapped(m), ("vm_page_free_prep: freeing mapped page %p", m)); - KASSERT((m->aflags & (PGA_EXECUTABLE | PGA_WRITEABLE)) == 0, + KASSERT((m->a.flags & (PGA_EXECUTABLE | PGA_WRITEABLE)) == 0, ("vm_page_free_prep: mapping flags set in page %p", m)); } else { - KASSERT(m->queue == PQ_NONE, + KASSERT(m->a.queue == PQ_NONE, ("vm_page_free_prep: unmanaged page %p is queued", m)); } VM_CNT_INC(v_tfree); @@ -3694,7 +3696,7 @@ vm_page_free_prep(vm_page_t m) if ((m->flags & PG_FICTITIOUS) != 0) { KASSERT(m->ref_count == 1, ("fictitious page %p is referenced", m)); - KASSERT(m->queue == PQ_NONE, + KASSERT(m->a.queue == PQ_NONE, ("fictitious page %p is queued", m)); return (false); } @@ -3955,8 +3957,8 @@ vm_page_mvqueue(vm_page_t m, const uint8_t nqueue) vm_page_requeue(m); } - if (nqueue == PQ_ACTIVE && m->act_count < ACT_INIT) - m->act_count = ACT_INIT; + if (nqueue == PQ_ACTIVE && m->a.act_count < ACT_INIT) + m->a.act_count = ACT_INIT; } /* @@ -3998,9 +4000,9 @@ _vm_page_deactivate_noreuse(vm_page_t m) if (!vm_page_inactive(m)) { vm_page_dequeue(m); - m->queue = PQ_INACTIVE; + m->a.queue = PQ_INACTIVE; } - if ((m->aflags & PGA_REQUEUE_HEAD) == 0) + if ((m->a.flags & PGA_REQUEUE_HEAD) == 0) vm_page_aflag_set(m, PGA_REQUEUE_HEAD); vm_page_pqbatch_submit(m, PQ_INACTIVE); } @@ -5102,7 +5104,7 @@ DB_SHOW_COMMAND(pginfo, vm_page_print_pginfo) "page %p obj %p pidx 0x%jx phys 0x%jx q %d ref %u\n" " af 0x%x of 0x%x f 0x%x act %d busy %x valid 0x%x dirty 0x%x\n", m, m->object, (uintmax_t)m->pindex, (uintmax_t)m->phys_addr, - m->queue, m->ref_count, m->aflags, m->oflags, - m->flags, m->act_count, m->busy_lock, m->valid, m->dirty); + m->a.queue, m->ref_count, m->a.flags, m->oflags, + m->flags, m->a.act_count, m->busy_lock, m->valid, m->dirty); } #endif /* DDB */ Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/vm/vm_page.h Tue Dec 10 18:14:50 2019 (r355586) @@ -215,6 +215,15 @@ typedef uint32_t vm_page_bits_t; typedef uint64_t vm_page_bits_t; #endif +typedef union vm_page_astate { + struct { + uint16_t flags; + uint8_t queue; + uint8_t act_count; + }; + uint32_t _bits; +} vm_page_astate_t; + struct vm_page { union { TAILQ_ENTRY(vm_page) q; /* page queue or free list (Q) */ @@ -237,9 +246,7 @@ struct vm_page { struct md_page md; /* machine dependent stuff */ u_int ref_count; /* page references (A) */ volatile u_int busy_lock; /* busy owners lock */ - uint16_t aflags; /* atomic flags (A) */ - uint8_t queue; /* page queue index (Q) */ - uint8_t act_count; /* page usage count (P) */ + union vm_page_astate a; /* state accessed atomically */ uint8_t order; /* index of the buddy queue (F) */ uint8_t pool; /* vm_phys freepool index (F) */ uint8_t flags; /* page PG_* flags (P) */ @@ -755,19 +762,19 @@ void vm_page_assert_pga_writeable(vm_page_t m, uint16_ * destinations. In order that we can easily use a 32-bit operation, we * require that the aflags field be 32-bit aligned. */ -_Static_assert(offsetof(struct vm_page, aflags) % sizeof(uint32_t) == 0, +_Static_assert(offsetof(struct vm_page, a.flags) % sizeof(uint32_t) == 0, "aflags field is not 32-bit aligned"); /* * We want to be able to update the aflags and queue fields atomically in * the same operation. */ -_Static_assert(offsetof(struct vm_page, aflags) / sizeof(uint32_t) == - offsetof(struct vm_page, queue) / sizeof(uint32_t), +_Static_assert(offsetof(struct vm_page, a.flags) / sizeof(uint32_t) == + offsetof(struct vm_page, a.queue) / sizeof(uint32_t), "aflags and queue fields do not belong to the same 32-bit word"); -_Static_assert(offsetof(struct vm_page, queue) % sizeof(uint32_t) == 2, +_Static_assert(offsetof(struct vm_page, a.queue) % sizeof(uint32_t) == 2, "queue field is at an unexpected offset"); -_Static_assert(sizeof(((struct vm_page *)NULL)->queue) == 1, +_Static_assert(sizeof(((struct vm_page *)NULL)->a.queue) == 1, "queue field has an unexpected size"); #if BYTE_ORDER == LITTLE_ENDIAN @@ -798,7 +805,7 @@ vm_page_aflag_clear(vm_page_t m, uint16_t bits) * atomic update. Parallel non-atomic updates to the other fields * within this word are handled properly by the atomic update. */ - addr = (void *)&m->aflags; + addr = (void *)&m->a.flags; val = bits << VM_PAGE_AFLAG_SHIFT; atomic_clear_32(addr, val); } @@ -818,7 +825,7 @@ vm_page_aflag_set(vm_page_t m, uint16_t bits) * atomic update. Parallel non-atomic updates to the other fields * within this word are handled properly by the atomic update. */ - addr = (void *)&m->aflags; + addr = (void *)&m->a.flags; val = bits << VM_PAGE_AFLAG_SHIFT; atomic_set_32(addr, val); } @@ -843,7 +850,7 @@ vm_page_pqstate_cmpset(vm_page_t m, uint32_t oldq, uin qsmask = ((PGA_DEQUEUE | PGA_REQUEUE | PGA_REQUEUE_HEAD) << VM_PAGE_AFLAG_SHIFT) | VM_PAGE_QUEUE_MASK; - addr = (void *)&m->aflags; + addr = (void *)&m->a.flags; oval = atomic_load_32(addr); do { if ((oval & fflags) != 0) @@ -918,10 +925,10 @@ vm_page_queue(vm_page_t m) vm_page_assert_locked(m); - if ((m->aflags & PGA_DEQUEUE) != 0) + if ((m->a.flags & PGA_DEQUEUE) != 0) return (PQ_NONE); atomic_thread_fence_acq(); - return (m->queue); + return (m->a.queue); } static inline bool Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/vm/vm_pageout.c Tue Dec 10 18:14:50 2019 (r355586) @@ -218,7 +218,7 @@ vm_pageout_init_scan(struct scan_state *ss, struct vm_ { vm_pagequeue_assert_locked(pq); - KASSERT((marker->aflags & PGA_ENQUEUED) == 0, + KASSERT((marker->a.flags & PGA_ENQUEUED) == 0, ("marker %p already enqueued", marker)); if (after == NULL) @@ -242,7 +242,7 @@ vm_pageout_end_scan(struct scan_state *ss) pq = ss->pq; vm_pagequeue_assert_locked(pq); - KASSERT((ss->marker->aflags & PGA_ENQUEUED) != 0, + KASSERT((ss->marker->a.flags & PGA_ENQUEUED) != 0, ("marker %p not enqueued", ss->marker)); TAILQ_REMOVE(&pq->pq_pl, ss->marker, plinks.q); @@ -271,7 +271,7 @@ vm_pageout_collect_batch(struct scan_state *ss, const marker = ss->marker; pq = ss->pq; - KASSERT((marker->aflags & PGA_ENQUEUED) != 0, + KASSERT((marker->a.flags & PGA_ENQUEUED) != 0, ("marker %p not enqueued", ss->marker)); vm_pagequeue_lock(pq); @@ -280,7 +280,7 @@ vm_pageout_collect_batch(struct scan_state *ss, const m = n, ss->scanned++) { n = TAILQ_NEXT(m, plinks.q); if ((m->flags & PG_MARKER) == 0) { - KASSERT((m->aflags & PGA_ENQUEUED) != 0, + KASSERT((m->a.flags & PGA_ENQUEUED) != 0, ("page %p not enqueued", m)); KASSERT((m->flags & PG_FICTITIOUS) == 0, ("Fictitious page %p cannot be in page queue", m)); @@ -472,7 +472,7 @@ vm_pageout_flush(vm_page_t *mc, int count, int flags, KASSERT(vm_page_all_valid(mc[i]), ("vm_pageout_flush: partially invalid page %p index %d/%d", mc[i], i, count)); - KASSERT((mc[i]->aflags & PGA_WRITEABLE) == 0, + KASSERT((mc[i]->a.flags & PGA_WRITEABLE) == 0, ("vm_pageout_flush: writeable page %p", mc[i])); vm_page_busy_downgrade(mc[i]); } @@ -766,7 +766,7 @@ recheck: * A requeue was requested, so this page gets a second * chance. */ - if ((m->aflags & PGA_REQUEUE) != 0) { + if ((m->a.flags & PGA_REQUEUE) != 0) { vm_page_pqbatch_submit(m, queue); continue; } @@ -848,7 +848,7 @@ recheck: ("page %p is mapped", m)); act_delta = 0; } - if ((m->aflags & PGA_REFERENCED) != 0) { + if ((m->a.flags & PGA_REFERENCED) != 0) { vm_page_aflag_clear(m, PGA_REFERENCED); act_delta++; } @@ -865,7 +865,7 @@ recheck: * be returned prematurely to the inactive * queue. */ - m->act_count += act_delta + ACT_ADVANCE; + m->a.act_count += act_delta + ACT_ADVANCE; /* * If this was a background laundering, count @@ -1302,7 +1302,7 @@ act_scan: act_delta = pmap_ts_referenced(m); else act_delta = 0; - if ((m->aflags & PGA_REFERENCED) != 0) { + if ((m->a.flags & PGA_REFERENCED) != 0) { vm_page_aflag_clear(m, PGA_REFERENCED); act_delta++; } @@ -1311,13 +1311,13 @@ act_scan: * Advance or decay the act_count based on recent usage. */ if (act_delta != 0) { - m->act_count += ACT_ADVANCE + act_delta; - if (m->act_count > ACT_MAX) - m->act_count = ACT_MAX; + m->a.act_count += ACT_ADVANCE + act_delta; + if (m->a.act_count > ACT_MAX) + m->a.act_count = ACT_MAX; } else - m->act_count -= min(m->act_count, ACT_DECLINE); + m->a.act_count -= min(m->a.act_count, ACT_DECLINE); - if (m->act_count == 0) { + if (m->a.act_count == 0) { /* * When not short for inactive pages, let dirty pages go * through the inactive queue before moving to the @@ -1372,14 +1372,14 @@ vm_pageout_reinsert_inactive_page(struct scan_state *s { struct vm_domain *vmd; - if (m->queue != PQ_INACTIVE || (m->aflags & PGA_ENQUEUED) != 0) + if (m->a.queue != PQ_INACTIVE || (m->a.flags & PGA_ENQUEUED) != 0) return (0); vm_page_aflag_set(m, PGA_ENQUEUED); - if ((m->aflags & PGA_REQUEUE_HEAD) != 0) { + if ((m->a.flags & PGA_REQUEUE_HEAD) != 0) { vmd = vm_pagequeue_domain(m); TAILQ_INSERT_BEFORE(&vmd->vmd_inacthead, m, plinks.q); vm_page_aflag_clear(m, PGA_REQUEUE | PGA_REQUEUE_HEAD); - } else if ((m->aflags & PGA_REQUEUE) != 0) { + } else if ((m->a.flags & PGA_REQUEUE) != 0) { TAILQ_INSERT_TAIL(&ss->pq->pq_pl, m, plinks.q); vm_page_aflag_clear(m, PGA_REQUEUE | PGA_REQUEUE_HEAD); } else @@ -1458,7 +1458,7 @@ vm_pageout_scan_inactive(struct vm_domain *vmd, int sh /* * Start scanning the inactive queue for pages that we can free. The * scan will stop when we reach the target or we have scanned the - * entire queue. (Note that m->act_count is not used to make + * entire queue. (Note that m->a.act_count is not used to make * decisions for the inactive queue, only for the active queue.) */ marker = &vmd->vmd_markers[PQ_INACTIVE]; @@ -1488,7 +1488,7 @@ recheck: * dropped, or a requeue was requested. This page gets a second * chance. */ - if ((m->aflags & (PGA_ENQUEUED | PGA_REQUEUE | + if ((m->a.flags & (PGA_ENQUEUED | PGA_REQUEUE | PGA_REQUEUE_HEAD)) != 0) goto reinsert; @@ -1579,7 +1579,7 @@ recheck: ("page %p is mapped", m)); act_delta = 0; } - if ((m->aflags & PGA_REFERENCED) != 0) { + if ((m->a.flags & PGA_REFERENCED) != 0) { vm_page_aflag_clear(m, PGA_REFERENCED); act_delta++; } @@ -1596,7 +1596,7 @@ recheck: * be returned prematurely to the inactive * queue. */ - m->act_count += act_delta + ACT_ADVANCE; + m->a.act_count += act_delta + ACT_ADVANCE; continue; } else if ((object->flags & OBJ_DEAD) == 0) { vm_page_xunbusy(m); @@ -1636,9 +1636,9 @@ free_page: * requests, we can safely disassociate the page * from the inactive queue. */ - KASSERT((m->aflags & PGA_QUEUE_STATE_MASK) == 0, + KASSERT((m->a.flags & PGA_QUEUE_STATE_MASK) == 0, ("page %p has queue state", m)); - m->queue = PQ_NONE; + m->a.queue = PQ_NONE; vm_page_free(m); page_shortage--; continue; Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Tue Dec 10 14:35:38 2019 (r355585) +++ head/sys/vm/vm_swapout.c Tue Dec 10 18:14:50 2019 (r355586) @@ -224,31 +224,31 @@ vm_swapout_object_deactivate_pages(pmap_t pmap, vm_obj } act_delta = pmap_ts_referenced(p); vm_page_lock(p); - if ((p->aflags & PGA_REFERENCED) != 0) { + if ((p->a.flags & PGA_REFERENCED) != 0) { if (act_delta == 0) act_delta = 1; vm_page_aflag_clear(p, PGA_REFERENCED); } if (!vm_page_active(p) && act_delta != 0) { vm_page_activate(p); - p->act_count += act_delta; + p->a.act_count += act_delta; } else if (vm_page_active(p)) { /* * The page daemon does not requeue pages * after modifying their activation count. */ if (act_delta == 0) { - p->act_count -= min(p->act_count, + p->a.act_count -= min(p->a.act_count, ACT_DECLINE); - if (!remove_mode && p->act_count == 0) { + if (!remove_mode && p->a.act_count == 0) { (void)vm_page_try_remove_all(p); vm_page_deactivate(p); } } else { vm_page_activate(p); - if (p->act_count < ACT_MAX - + if (p->a.act_count < ACT_MAX - ACT_ADVANCE) - p->act_count += ACT_ADVANCE; + p->a.act_count += ACT_ADVANCE; } } else if (vm_page_inactive(p)) (void)vm_page_try_remove_all(p); From owner-svn-src-all@freebsd.org Tue Dec 10 18:15:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E328E1E119A; Tue, 10 Dec 2019 18:15:20 +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 47XSsN5lmHz454n; Tue, 10 Dec 2019 18:15:20 +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 C07BD2EABE; Tue, 10 Dec 2019 18:15:20 +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 xBAIFK7a046045; Tue, 10 Dec 2019 18:15:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAIFKkW046044; Tue, 10 Dec 2019 18:15:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912101815.xBAIFKkW046044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 10 Dec 2019 18:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355587 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 18:15:21 -0000 Author: markj Date: Tue Dec 10 18:15:20 2019 New Revision: 355587 URL: https://svnweb.freebsd.org/changeset/base/355587 Log: Add a helper function to the swapout daemon's deactivation code. vm_swapout_object_deactivate_pages() is renamed to vm_swapout_object_deactivate(), and the loop body is moved into the new vm_swapout_object_deactivate_page(). This makes the code a bit easier to follow and is in preparation for some functional changes. Reviewed by: jeff, kib Sponsored by: Netflix, Intel Differential Revision: https://reviews.freebsd.org/D22651 Modified: head/sys/vm/vm_swapout.c Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Tue Dec 10 18:14:50 2019 (r355586) +++ head/sys/vm/vm_swapout.c Tue Dec 10 18:15:20 2019 (r355587) @@ -165,13 +165,64 @@ static int last_swapin; static void swapclear(struct proc *); static int swapout(struct proc *); static void vm_swapout_map_deactivate_pages(vm_map_t, long); -static void vm_swapout_object_deactivate_pages(pmap_t, vm_object_t, long); +static void vm_swapout_object_deactivate(pmap_t, vm_object_t, long); static void swapout_procs(int action); static void vm_req_vmdaemon(int req); static void vm_thread_swapout(struct thread *td); +static void +vm_swapout_object_deactivate_page(pmap_t pmap, vm_page_t m, bool unmap) +{ + int act_delta; + + if (vm_page_tryxbusy(m) == 0) + return; + VM_CNT_INC(v_pdpages); + + /* + * The page may acquire a wiring after this check. + * The page daemon handles wired pages, so there is + * no harm done if a wiring appears while we are + * attempting to deactivate the page. + */ + if (vm_page_wired(m) || !pmap_page_exists_quick(pmap, m)) { + vm_page_xunbusy(m); + return; + } + act_delta = pmap_ts_referenced(m); + vm_page_lock(m); + if ((m->a.flags & PGA_REFERENCED) != 0) { + if (act_delta == 0) + act_delta = 1; + vm_page_aflag_clear(m, PGA_REFERENCED); + } + if (!vm_page_active(m) && act_delta != 0) { + vm_page_activate(m); + m->a.act_count += act_delta; + } else if (vm_page_active(m)) { + /* + * The page daemon does not requeue pages + * after modifying their activation count. + */ + if (act_delta == 0) { + m->a.act_count -= min(m->a.act_count, ACT_DECLINE); + if (unmap && m->a.act_count == 0) { + (void)vm_page_try_remove_all(m); + vm_page_deactivate(m); + } + } else { + vm_page_activate(m); + if (m->a.act_count < ACT_MAX - ACT_ADVANCE) + m->a.act_count += ACT_ADVANCE; + } + } else if (vm_page_inactive(m)) + (void)vm_page_try_remove_all(m); + vm_page_unlock(m); + vm_page_xunbusy(m); +} + /* - * vm_swapout_object_deactivate_pages + * vm_swapout_object_deactivate * * Deactivate enough pages to satisfy the inactive target * requirements. @@ -179,12 +230,12 @@ static void vm_thread_swapout(struct thread *td); * The object and map must be locked. */ static void -vm_swapout_object_deactivate_pages(pmap_t pmap, vm_object_t first_object, +vm_swapout_object_deactivate(pmap_t pmap, vm_object_t first_object, long desired) { vm_object_t backing_object, object; - vm_page_t p; - int act_delta, remove_mode; + vm_page_t m; + bool unmap; VM_OBJECT_ASSERT_LOCKED(first_object); if ((first_object->flags & OBJ_FICTITIOUS) != 0) @@ -197,63 +248,19 @@ vm_swapout_object_deactivate_pages(pmap_t pmap, vm_obj REFCOUNT_COUNT(object->paging_in_progress) > 0) goto unlock_return; - remove_mode = 0; + unmap = true; if (object->shadow_count > 1) - remove_mode = 1; + unmap = false; + /* * Scan the object's entire memory queue. */ - TAILQ_FOREACH(p, &object->memq, listq) { + TAILQ_FOREACH(m, &object->memq, listq) { if (pmap_resident_count(pmap) <= desired) goto unlock_return; if (should_yield()) goto unlock_return; - if (vm_page_tryxbusy(p) == 0) - continue; - VM_CNT_INC(v_pdpages); - - /* - * The page may acquire a wiring after this check. - * The page daemon handles wired pages, so there is - * no harm done if a wiring appears while we are - * attempting to deactivate the page. - */ - if (vm_page_wired(p) || !pmap_page_exists_quick(pmap, p)) { - vm_page_xunbusy(p); - continue; - } - act_delta = pmap_ts_referenced(p); - vm_page_lock(p); - if ((p->a.flags & PGA_REFERENCED) != 0) { - if (act_delta == 0) - act_delta = 1; - vm_page_aflag_clear(p, PGA_REFERENCED); - } - if (!vm_page_active(p) && act_delta != 0) { - vm_page_activate(p); - p->a.act_count += act_delta; - } else if (vm_page_active(p)) { - /* - * The page daemon does not requeue pages - * after modifying their activation count. - */ - if (act_delta == 0) { - p->a.act_count -= min(p->a.act_count, - ACT_DECLINE); - if (!remove_mode && p->a.act_count == 0) { - (void)vm_page_try_remove_all(p); - vm_page_deactivate(p); - } - } else { - vm_page_activate(p); - if (p->a.act_count < ACT_MAX - - ACT_ADVANCE) - p->a.act_count += ACT_ADVANCE; - } - } else if (vm_page_inactive(p)) - (void)vm_page_try_remove_all(p); - vm_page_unlock(p); - vm_page_xunbusy(p); + vm_swapout_object_deactivate_page(pmap, m, unmap); } if ((backing_object = object->backing_object) == NULL) goto unlock_return; @@ -307,7 +314,7 @@ vm_swapout_map_deactivate_pages(vm_map_t map, long des } if (bigobj != NULL) { - vm_swapout_object_deactivate_pages(map->pmap, bigobj, desired); + vm_swapout_object_deactivate(map->pmap, bigobj, desired); VM_OBJECT_RUNLOCK(bigobj); } /* @@ -321,8 +328,8 @@ vm_swapout_map_deactivate_pages(vm_map_t map, long des obj = tmpe->object.vm_object; if (obj != NULL) { VM_OBJECT_RLOCK(obj); - vm_swapout_object_deactivate_pages(map->pmap, - obj, desired); + vm_swapout_object_deactivate(map->pmap, obj, + desired); VM_OBJECT_RUNLOCK(obj); } } From owner-svn-src-all@freebsd.org Tue Dec 10 18:50:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 594561E1CC7; Tue, 10 Dec 2019 18:50:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47XTfM1nWpz46jn; Tue, 10 Dec 2019 18:50:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38A682F06E; Tue, 10 Dec 2019 18:50:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBAIop1Q064424; Tue, 10 Dec 2019 18:50:51 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAIopcB064423; Tue, 10 Dec 2019 18:50:51 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201912101850.xBAIopcB064423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 10 Dec 2019 18:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355588 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 355588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 18:50:51 -0000 Author: bdrewery Date: Tue Dec 10 18:50:50 2019 New Revision: 355588 URL: https://svnweb.freebsd.org/changeset/base/355588 Log: Fix WITHOUT_CLANG build. This decouples MK_LLVM_TARGET_ALL from MK_CLANG. It is fine if LLVM_TARGET_* are set even if MK_CLANG is disabled. It never made sense to depend MK_LLVM_TARGET_* to MK_CLANG (which I did in r335706). PR: 240507 Reported by: kevans, swills MFC after: 2 weeks Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Dec 10 18:15:20 2019 (r355587) +++ head/share/mk/src.opts.mk Tue Dec 10 18:50:50 2019 (r355588) @@ -128,6 +128,7 @@ __DEFAULT_YES_OPTIONS = \ LIBPTHREAD \ LIBTHR \ LLVM_COV \ + LLVM_TARGET_ALL \ LOADER_GELI \ LOADER_LUA \ LOADER_OFW \ @@ -219,7 +220,6 @@ __DEFAULT_NO_OPTIONS = \ # RIGHT option is disabled. __DEFAULT_DEPENDENT_OPTIONS= \ CLANG_FULL/CLANG \ - LLVM_TARGET_ALL/CLANG \ LOADER_VERIEXEC/BEARSSL \ LOADER_EFI_SECUREBOOT/LOADER_VERIEXEC \ VERIEXEC/BEARSSL \ @@ -281,9 +281,9 @@ __LLVM_TARGETS= \ x86 __LLVM_TARGET_FILT= C/(amd64|i386)/x86/:S/sparc64/sparc/:S/arm64/aarch64/:S/powerpc64/powerpc/ .for __llt in ${__LLVM_TARGETS} -# Default the given TARGET's LLVM_TARGET support to the value of MK_CLANG. +# Default enable the given TARGET's LLVM_TARGET support .if ${__TT:${__LLVM_TARGET_FILT}} == ${__llt} -__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/CLANG +__DEFAULT_YES_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu} # Disable other targets for arm, to work around "relocation truncated # to fit" errors with BFD ld, since libllvm.a will get too large to link. .elif ${__T} == "arm" @@ -291,8 +291,7 @@ __DEFAULT_NO_OPTIONS+=LLVM_TARGET_${__llt:tu} # aarch64 needs arm for -m32 support. .elif ${__TT} == "arm64" && ${__llt} == "arm" __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_ARM/LLVM_TARGET_AARCH64 -# Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL -# which is based on MK_CLANG. +# Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL. .else __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL .endif From owner-svn-src-all@freebsd.org Tue Dec 10 18:57:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41C641E1E1D; Tue, 10 Dec 2019 18:57:40 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47XTpD0yGRz479Y; Tue, 10 Dec 2019 18:57:40 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BC372F228; Tue, 10 Dec 2019 18:57:40 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBAIvdXR069395; Tue, 10 Dec 2019 18:57:39 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAIvdxt069394; Tue, 10 Dec 2019 18:57:39 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201912101857.xBAIvdxt069394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 10 Dec 2019 18:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355589 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 355589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 18:57:40 -0000 Author: scottl Date: Tue Dec 10 18:57:39 2019 New Revision: 355589 URL: https://svnweb.freebsd.org/changeset/base/355589 Log: Fix the TAA state machine to do the right thing when the TAA migitation is available in microcode and the operator has set the sysctl to automatic mode. Reported by: Coverity CID: 1408334 MFC after: 3 days Sponsored by: Intel Modified: head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Tue Dec 10 18:50:50 2019 (r355588) +++ head/sys/x86/x86/cpu_machdep.c Tue Dec 10 18:57:39 2019 (r355589) @@ -1254,8 +1254,7 @@ x86_taa_recalculate(void) /* Check to see what mitigation options the CPU gives us */ if (cpu_ia32_arch_caps & IA32_ARCH_CAP_TAA_NO) { /* CPU is not suseptible to TAA */ - taa_need = TAA_NONE; - taa_state = TAA_TAA_UC; + taa_need = TAA_TAA_UC; } else if (cpu_ia32_arch_caps & IA32_ARCH_CAP_TSX_CTRL) { /* * CPU can turn off TSX. This is the next best option From owner-svn-src-all@freebsd.org Tue Dec 10 19:16:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5EDC01E2335; Tue, 10 Dec 2019 19:16:01 +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 47XVCP1pxRz481H; Tue, 10 Dec 2019 19:16:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 395622F5E3; Tue, 10 Dec 2019 19:16:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBAJG1Xb080841; Tue, 10 Dec 2019 19:16:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAJG0Lf080839; Tue, 10 Dec 2019 19:16:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912101916.xBAJG0Lf080839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Dec 2019 19:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355590 - in head/usr.bin/sed: . tests tests/regress.multitest.out X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/usr.bin/sed: . tests tests/regress.multitest.out X-SVN-Commit-Revision: 355590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 19:16:01 -0000 Author: kevans Date: Tue Dec 10 19:16:00 2019 New Revision: 355590 URL: https://svnweb.freebsd.org/changeset/base/355590 Log: sed: process \r, \n, and \t This is both reasonable and a common GNUism that a lot of ported software expects. Universally process \r, \n, and \t into carriage return, newline, and tab respectively. Newline still doesn't function in contexts where it can't (e.g. BRE), but we process it anyways rather than passing UB \n (escaped ordinary) through to the underlying regex engine. Adding a --posix flag to disable these was considered, but sed.1 already declares this version of sed a super-set of POSIX specification and this behavior is the most likely expected when one attempts to use one of these escape sequences in pattern space. This differs from pre-r197362 behavior in that we now honor the three arguably most common escape sequences used with sed(1) and we do so outside of character classes, too. Other escape sequences, like \s and \S, will come later when GNU extensions are added to libregex; sed will likely link against libregex by default, since the GNU extensions tend to be fairly un-intrusive. PR: 229925 Reviewed by: bapt, emaste, pfg Differential Revision: https://reviews.freebsd.org/D22750 Modified: head/usr.bin/sed/compile.c head/usr.bin/sed/tests/regress.multitest.out/8.22 head/usr.bin/sed/tests/sed2_test.sh Modified: head/usr.bin/sed/compile.c ============================================================================== --- head/usr.bin/sed/compile.c Tue Dec 10 18:57:39 2019 (r355589) +++ head/usr.bin/sed/compile.c Tue Dec 10 19:16:00 2019 (r355590) @@ -395,10 +395,21 @@ compile_delimited(char *p, char *d, int is_tr) continue; } else if (*p == '\\' && p[1] == '[') { *d++ = *p++; - } else if (*p == '\\' && p[1] == c) + } else if (*p == '\\' && p[1] == c) { p++; - else if (*p == '\\' && p[1] == 'n') { - *d++ = '\n'; + } else if (*p == '\\' && + (p[1] == 'n' || p[1] == 'r' || p[1] == 't')) { + switch (p[1]) { + case 'n': + *d++ = '\n'; + break; + case 'r': + *d++ = '\r'; + break; + case 't': + *d++ = '\t'; + break; + } p += 2; continue; } else if (*p == '\\' && p[1] == '\\') { @@ -428,13 +439,29 @@ compile_ccl(char **sp, char *t) *t++ = *s++; if (*s == ']') *t++ = *s++; - for (; *s && (*t = *s) != ']'; s++, t++) + for (; *s && (*t = *s) != ']'; s++, t++) { if (*s == '[' && ((d = *(s+1)) == '.' || d == ':' || d == '=')) { *++t = *++s, t++, s++; for (c = *s; (*t = *s) != ']' || c != d; s++, t++) if ((c = *s) == '\0') return NULL; + } else if (*s == '\\') { + switch (s[1]) { + case 'n': + *t = '\n'; + s++; + break; + case 'r': + *t = '\r'; + s++; + break; + case 't': + *t = '\t'; + s++; + break; + } } + } return (*s == ']') ? *sp = ++s, ++t : NULL; } @@ -521,8 +548,23 @@ compile_subst(char *p, struct s_subst *s) linenum, fname, *p); if (s->maxbref < ref) s->maxbref = ref; - } else if (*p == '&' || *p == '\\') - *sp++ = '\\'; + } else { + switch (*p) { + case '&': + case '\\': + *sp++ = '\\'; + break; + case 'n': + *p = '\n'; + break; + case 'r': + *p = '\r'; + break; + case 't': + *p = '\t'; + break; + } + } } else if (*p == c) { if (*++p == '\0' && more) { if (cu_fgets(lbuf, sizeof(lbuf), &more)) Modified: head/usr.bin/sed/tests/regress.multitest.out/8.22 ============================================================================== --- head/usr.bin/sed/tests/regress.multitest.out/8.22 Tue Dec 10 18:57:39 2019 (r355589) +++ head/usr.bin/sed/tests/regress.multitest.out/8.22 Tue Dec 10 19:16:00 2019 (r355590) @@ -1,2 +1 @@ -1 -2 +1X2 Modified: head/usr.bin/sed/tests/sed2_test.sh ============================================================================== --- head/usr.bin/sed/tests/sed2_test.sh Tue Dec 10 18:57:39 2019 (r355589) +++ head/usr.bin/sed/tests/sed2_test.sh Tue Dec 10 19:16:00 2019 (r355590) @@ -69,9 +69,29 @@ inplace_command_q_body() atf_check -s not-exit:0 stat -q '.!'* } +atf_test_case escape_subst +escape_subst_head() +{ + atf_set "descr" "Verify functional escaping of \\n, \\r, and \\t" +} +escape_subst_body() +{ + printf "a\nt\\\t\n\tb\n\t\tc\r\n" > a + tr -d '\r' < a > b + printf "a\tb c\rx\n" > c + + atf_check -o 'inline:a\nt\\t\n' sed '/\t/d' a + atf_check -o 'inline:a\nt\\t\n b\n c\r\n' sed 's/\t/ /g' a + atf_check -o 'inline:a\nt\\t\n\t\tb\n\t\t\t\tc\r\n' sed 's/\t/\t\t/g' a + atf_check -o 'inline:a\nt\n\tb\n\t\tc\r\n' sed 's/\\t//g' a + atf_check -o file:b sed 's/\r//' a + atf_check -o 'inline:abcx\n' sed 's/[ \r\t]//g' c +} + atf_init_test_cases() { atf_add_test_case inplace_command_q atf_add_test_case inplace_hardlink_src atf_add_test_case inplace_symlink_src + atf_add_test_case escape_subst } From owner-svn-src-all@freebsd.org Tue Dec 10 19:24:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8029B1E27C5 for ; Tue, 10 Dec 2019 19:24:11 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47XVNq2sdVz48jj for ; Tue, 10 Dec 2019 19:24:11 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4ED919E4D for ; Tue, 10 Dec 2019 19:24:11 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f169.google.com with SMTP id d71so9474029qkc.0 for ; Tue, 10 Dec 2019 11:24:11 -0800 (PST) X-Gm-Message-State: APjAAAXmjEZBUw02cJq/lgI1Blah63EgfRg5zLWm90hGiETWo32E0tBx gNvt6GEgSMII7Xc1yglv3FWo2lHAVzGDpvSTj0w= X-Received: by 2002:a37:4fd0:: with SMTP id d199mt33252983qkb.103.1576005850588; Tue, 10 Dec 2019 11:24:10 -0800 (PST) MIME-Version: 1.0 References: <201912101916.xBAJG0Lf080839@repo.freebsd.org> In-Reply-To: <201912101916.xBAJG0Lf080839@repo.freebsd.org> From: Kyle Evans Date: Tue, 10 Dec 2019 13:23:58 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r355590 - in head/usr.bin/sed: . tests tests/regress.multitest.out Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 19:24:11 -0000 On Tue, Dec 10, 2019 at 1:16 PM Kyle Evans wrote: > > Author: kevans > Date: Tue Dec 10 19:16:00 2019 > New Revision: 355590 > URL: https://svnweb.freebsd.org/changeset/base/355590 > > Log: > sed: process \r, \n, and \t > > This is both reasonable and a common GNUism that a lot of ported software > expects. > > Universally process \r, \n, and \t into carriage return, newline, and tab > respectively. Newline still doesn't function in contexts where it can't > (e.g. BRE), but we process it anyways rather than passing > UB \n (escaped ordinary) through to the underlying regex engine. > This part of the message is wrong -- it would pass just an ordinary 'n', rather than an escaped ordinary, and lead to potential false-positives if you think you're matching on an embedded newline but instead match on 'n'. Further, my reading of POSIX's statement on this leads me to believe that we have to treat it as a newline rather than embedding it as 'n' or escaped-'n' which regex(3) will certainly not interpret as a newline. > Adding a --posix flag to disable these was considered, but sed.1 already > declares this version of sed a super-set of POSIX specification and this > behavior is the most likely expected when one attempts to use one of these > escape sequences in pattern space. > > This differs from pre-r197362 behavior in that we now honor the three > arguably most common escape sequences used with sed(1) and we do so outside > of character classes, too. > > Other escape sequences, like \s and \S, will come later when GNU extensions > are added to libregex; sed will likely link against libregex by default, > since the GNU extensions tend to be fairly un-intrusive. > > PR: 229925 > Reviewed by: bapt, emaste, pfg > Differential Revision: https://reviews.freebsd.org/D22750 > From owner-svn-src-all@freebsd.org Tue Dec 10 19:52:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF6481E32E2; Tue, 10 Dec 2019 19:52:30 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47XW1V4Dkmz4BNN; Tue, 10 Dec 2019 19:52:30 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CA772FD27; Tue, 10 Dec 2019 19:52:30 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBAJqUdi004104; Tue, 10 Dec 2019 19:52:30 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAJqUEN004103; Tue, 10 Dec 2019 19:52:30 GMT (envelope-from se@FreeBSD.org) Message-Id: <201912101952.xBAJqUEN004103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Tue, 10 Dec 2019 19:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355591 - head/share/vt/keymaps X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/share/vt/keymaps X-SVN-Commit-Revision: 355591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 19:52:30 -0000 Author: se Date: Tue Dec 10 19:52:29 2019 New Revision: 355591 URL: https://svnweb.freebsd.org/changeset/base/355591 Log: Replace two remaining hex values for control codes with their names. These were the only values in the range from 0 to 0x1f that were defined as hex values, all other occurances have been converted before. MFC after: 1 week Modified: head/share/vt/keymaps/hu.102.kbd head/share/vt/keymaps/us.kbd Modified: head/share/vt/keymaps/hu.102.kbd ============================================================================== --- head/share/vt/keymaps/hu.102.kbd Tue Dec 10 19:16:00 2019 (r355590) +++ head/share/vt/keymaps/hu.102.kbd Tue Dec 10 19:52:29 2019 (r355591) @@ -48,7 +48,7 @@ 038 'l' 'L' ff ff 0x0141 nop ff ff C 039 0xe9 0xc9 nop nop '$' nop nop nop C 040 0xe1 0xc1 nop nop 0xdf nop nop nop C - 041 '0' 0x15 nop nop nop nop nop nop O + 041 '0' nak nop nop nop nop nop nop O 042 lshift lshift lshift lshift lshift lshift lshift lshift O 043 0x0171 0x0170 fs fs 0xa4 nop fs fs C 044 'y' 'Y' em em '>' '<' em em C Modified: head/share/vt/keymaps/us.kbd ============================================================================== --- head/share/vt/keymaps/us.kbd Tue Dec 10 19:16:00 2019 (r355590) +++ head/share/vt/keymaps/us.kbd Tue Dec 10 19:52:29 2019 (r355591) @@ -56,7 +56,7 @@ 050 'm' 'M' cr cr 'm' 'M' cr cr C 051 ',' '<' nop nop ',' '<' nop nop O 052 '.' '>' nop nop '.' '>' nop nop O - 053 '/' '?' 0x1f nop '/' '?' nop nop O + 053 '/' '?' us nop '/' '?' nop nop O 054 rshift rshift rshift rshift rshift rshift rshift rshift O 055 '*' '*' '*' '*' '*' '*' '*' '*' O 056 lalt lalt lalt lalt lalt lalt lalt lalt O From owner-svn-src-all@freebsd.org Tue Dec 10 20:01:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4AD421E3560; Tue, 10 Dec 2019 20:01:34 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47XWCy1H4Bz4BxC; Tue, 10 Dec 2019 20:01:34 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-449.fritz.box (p200300CD5F45F7001D414298D8BB6800.dip0.t-ipconnect.de [IPv6:2003:cd:5f45:f700:1d41:4298:d8bb:6800]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 5C098A2DF; Tue, 10 Dec 2019 20:01:33 +0000 (UTC) (envelope-from se@freebsd.org) Subject: Re: svn commit: r355585 - head/share/vt/keymaps To: Ed Maste Cc: src-committers , svn-src-all , svn-src-head References: <201912101435.xBAEZcIQ005147@repo.freebsd.org> <592493f2-556d-ec0c-aa8a-788e47c26e1d@freebsd.org> From: =?UTF-8?Q?Stefan_E=c3=9fer?= Message-ID: Date: Tue, 10 Dec 2019 21:01:32 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 20:01:34 -0000 Am 10.12.19 um 13:59 schrieb Ed Maste: > On Tue, 10 Dec 2019 at 10:22, Stefan Eßer wrote: >> >> Nobody seems to have noticed this problem for more than 5 years, >> though. > > Probably because there's no user-facing impact - nonexistent keymap > files are just omitted from the list. I'm glad someone eventually > looked and submitted a PR :) Yes, I assumed so, they had been noticed before, else ... > There are a couple of other keymap/font issue PRs that I'll try to look into. I have just committed two small fixes that had been on my system for quite long and I had forgotten about them (0x15 and 01xf used instead of "nak" and "us" as in all other files). At the time when I converted the syscons keymaps for vt, I had started to write a converter from Linux keymaps to our style. But since we had all major locales covered, I did not consider this conversion a priority, I got side-tracked and did not complete that script. I might restart that effort, if there is interest (important keymaps missing in FreeBSD, but available for Linux). Regards, STefan From owner-svn-src-all@freebsd.org Tue Dec 10 20:02:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B89091E35F5; Tue, 10 Dec 2019 20:02:57 +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 47XWFY59qCz4C8R; Tue, 10 Dec 2019 20:02:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACB242FF10; Tue, 10 Dec 2019 20:02:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBAK2v8N010361; Tue, 10 Dec 2019 20:02:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAK2vEk010359; Tue, 10 Dec 2019 20:02:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912102002.xBAK2vEk010359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Dec 2019 20:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355592 - in head/share/vt: fonts keymaps X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/share/vt: fonts keymaps X-SVN-Commit-Revision: 355592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 20:02:57 -0000 Author: emaste Date: Tue Dec 10 20:02:57 2019 New Revision: 355592 URL: https://svnweb.freebsd.org/changeset/base/355592 Log: Add Danish translation for vt font and keymap INDEX files Also sort some entries into the correct location, correct MacBook capitalization, etc. PR: 235853 MFC after: 1 week Submitted by: scootergrisen gmail com Modified: head/share/vt/fonts/INDEX.fonts head/share/vt/keymaps/INDEX.keymaps Modified: head/share/vt/fonts/INDEX.fonts ============================================================================== --- head/share/vt/fonts/INDEX.fonts Tue Dec 10 19:52:29 2019 (r355591) +++ head/share/vt/fonts/INDEX.fonts Tue Dec 10 20:02:57 2019 (r355592) @@ -22,6 +22,7 @@ # Language support: MENU, FONT # MENU:en:Choose your terminal font +MENU:da:Vælg skrifttypen til din terminal MENU:de:Wählen Sie Ihre Schrift MENU:fr:Choisissez votre fonte écran @@ -34,12 +35,15 @@ FONT:en:vgarom-8x14.fnt # gallant.fnt:en:Gallant Character set, 8x16 +gallant.fnt:da:Gallant-tegnsæt, 8x16 gallant.fnt:de:Gallant Zeichensatz, 8x16 terminus-b32.fnt:en:Terminus BSD Console, size 32 +terminus-b32.fnt:da:Terminus BSD-konsol, størrelse 32 terminus-b32.fnt:de:Terminus BSD Console, Größe 32 tom-thumb.fnt:en:tom-thumb Character set, 4x6 +tom-thumb.fnt:da:tom-thumb-tegnsæt, 4x6 tom-thumb.fnt:de:tom-thumb Zeichensatz, 4x6 vgarom-16x32.fnt:en:VGAROM, 16x32 @@ -51,10 +55,12 @@ vgarom-8x16.fnt:en:VGAROM, 8x16 vgarom-8x8.fnt:en:VGAROM, 8x8 vgarom-thin-8x16.fnt:en:VGAROM, 8x16 (thin) +vgarom-thin-8x16.fnt:da:VGAROM, 8x16 (smal) vgarom-thin-8x16.fnt:de:VGAROM, 8x16 (dünn) vgarom-thin-8x16.fnt:fr:VGAROM, 8x16 (fin) vgarom-thin-8x8.fnt:en:VGAROM, 8x8 (thin) +vgarom-thin-8x8.fnt:da:VGAROM, 8x8 (smal) vgarom-thin-8x8.fnt:de:VGAROM, 8x8 (dünn) vgarom-thin-8x8.fnt:fr:VGAROM, 8x8 (fin) Modified: head/share/vt/keymaps/INDEX.keymaps ============================================================================== --- head/share/vt/keymaps/INDEX.keymaps Tue Dec 10 19:52:29 2019 (r355591) +++ head/share/vt/keymaps/INDEX.keymaps Tue Dec 10 20:02:57 2019 (r355592) @@ -21,9 +21,10 @@ # Language support: MENU, FONT # MENU:en:Choose your keyboard layout -MENU:da,no,sv:Vælg dit keyboard layout +MENU:da:Vælg dit tastaturlayout MENU:de:Wählen Sie Ihre Tastaturbelegung MENU:fr:Choisissez la disposition de votre clavier +MENU:no,sv:Vælg dit keyboard layout MENU:pl:Wybierz ukÅ‚ad klawiatury MENU:pt:Escolha o layout do teclado MENU:es:Seleccione la disposición de su teclado @@ -41,57 +42,87 @@ MENU:tr:Klavye düzeninizi seçiniz FONT:en:vgarom-8x16.hex # +am.kbd:en:Armenian phonetic layout +am.kbd:da:Armensk fonetisk layout +am.kbd:de:Armenische phonetische Tastenbelegung +am.kbd:fr:Arménien phonétique +am.kbd:hy:Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶ Õ°Õ¶Õ¹ÕµÕ¸Ö‚Õ¶Õ¡ÕµÕ«Õ¶ (Phonetic) Õ¤Õ¡Õ½Õ¡Õ¾Õ¸Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶ +am.kbd:ru:ÐрмÑнÑÐºÐ°Ñ Ñ„Ð¾Ð½ÐµÑ‚Ð¸Ñ‡ÐµÑÐºÐ°Ñ Ñ€Ð°Ñкладка + be.kbd:en:Belgian +be.kbd:da:Belgisk be.kbd:de:Belgisch be.kbd:fr:Belge be.kbd:pt,es:Belga be.acc.kbd:en:Belgian (accent keys) +be.acc.kbd:da:Belgisk (accenttaster) be.acc.kbd:de:Belgisch (mit Akzenten) be.acc.kbd:fr:Belge (avec accents) be.acc.kbd:pt:Belga (com acentos) be.acc.kbd:es:Belga (con acentos) bg.bds.kbd:en:Bulgarian (BDS) +bg.bds.kbd:da:Bulgarsk (BDS) bg.bds.kbd:de:Bulgarisch (BDS) bg.phonetic.kbd:en:Bulgarian (Phonetic) +bg.phonetic.kbd:da:Bulgarsk (fonetisk) bg.phonetic.kbd:de:Bulgarisch (phonetisch) br.kbd:en:Brazilian (accent keys) +br.kbd:da:Brasiliansk (accenttaster) br.kbd:de:Brasilianisch (mit Akzenten) br.kbd:fr:Brésilien (avec accents) br.kbd:pt:Brasileiro (com acentos) br.kbd:es:Brasileño (con acentos) br.noacc.kbd:en:Brazilian (without accent keys) +br.noacc.kbd:da:Brasiliansk (ingen accenttaster) br.noacc.kbd:de:Brasilianisch (ohne Akzente) br.noacc.kbd:fr:Brésilien (sans accents) br.noacc.kbd:pt:Brasileiro (without accent keys) br.noacc.kbd:es:Brasileño (without accent keys) by.kbd:en:Belarusian +by.kbd:da:Hviderussisk by.kbd:de:Weißrussisch by.kbd:fr:Biélorusse centraleuropean.kbd:en:Central European +centraleuropean.kbd:da:Centraleuropæisk centraleuropean.kbd:de:Zentral Europäisch centraleuropean.kbd:fr:Centre européen centraleuropean.kbd:es:Centroeuropeo centraleuropean.qwerty.kbd:en:Central European (QWERTY) +centraleuropean.qwerty.kbd:da:Centraleuropæisk (QWERTY) centraleuropean.qwerty.kbd:de:Zentral Europäisch (QWERTY) centraleuropean.qwerty.kbd:fr:Centre européen (QWERTY) centraleuropean.qwerty.kbd:es:Centroeuropeo (QWERTY) colemak-dh.acc.kbd:en:Colemak Mod-DH ergonomic alternative colemak.acc.kbd:en:Colemak ergonomic alternative +colemak.acc.kbd:da:Colemak ergonomisk alternativ cz.kbd:en:Czech (QWERTZ, accent keys) +cz.kbd:da:Tjekkisk (QWERTZ, accenttaster) cz.kbd:de:Tschechisch (QWERTZ, mit Akzenten) cz.kbd:fr:Tchèque (QWERTZ, avec accents) cz.kbd:es:Checo (QWERTZ, con acentos) +cz.kbd.from-ce:en:Czech +cz.kbd.from-ce:da:Tjekkisk +cz.kbd.from-ce:de:Tschechisch +cz.kbd.from-ce:fr:Tchèque +cz.kbd.from-ce:es:Checo + +cz.qwerty.kbd.from-ce:en:Czech (QWERTY) +cz.qwerty.kbd.from-ce:da:Tjekkisk (QWERTY) +cz.qwerty.kbd.from-ce:de:Tschechisch (QWERTY) +cz.qwerty.kbd.from-ce:fr:Tchèquey (QWERTY) +cz.qwerty.kbd.from-ce:es:Checo (QWERTY) + dk.kbd:en:Danish dk.kbd:da:Dansk dk.kbd:de:Dänisch @@ -100,40 +131,66 @@ dk.kbd:pt:Dinamarquês dk.kbd:es:Danés dk.acc.kbd:en:Danish (accent keys) -dk.acc.kbd:da:Dansk (accent taster) +dk.acc.kbd:da:Dansk (accenttaster) dk.acc.kbd:de:Dänisch (mit Akzenten) dk.acc.kbd:fr:Danois (avec accents) dk.acc.kbd:pt:Dinamarquês (com acentos) dk.acc.kbd:es:Danés (con acentos) -dk.macbook.kbd:en:Danish (macbook) -dk.macbook.kbd:da:Dansk (macbook) -dk.macbook.kbd:de:Dänisch (Macbook) -dk.macbook.kbd:fr:Danois (macbook) -dk.macbook.kbd:pt:Dinamarquês (macbook) -dk.macbook.kbd:es:Danés (macbook) +dk.kbd.from-cp865:en:Danish +dk.kbd.from-cp865:da:Dansk +dk.kbd.from-cp865:de:Dänisch +dk.kbd.from-cp865:fr:Danois +dk.kbd.from-cp865:pt:Dinamarquês +dk.kbd.from-cp865:es:Danés +dk.macbook.kbd:en:Danish (MacBook) +dk.macbook.kbd:da:Dansk (MacBook) +dk.macbook.kbd:de:Dänisch (MacBook) +dk.macbook.kbd:fr:Danois (MacBook) +dk.macbook.kbd:pt:Dinamarquês (MacBook) +dk.macbook.kbd:es:Danés (MacBook) + nl.kbd:en:Dutch (accent keys) +nl.kbd:da:Nederlandsk (accenttaster) nl.kbd:de:Holländisch (mit Akzenten) nordic.asus-eee.kbd:en:Nordic layout on Asus eeePC +nordic.asus-eee.kbd:da:Nordisk layout pÃ¥ Asus eeePC nordic.asus-eee.kbd:fr:Norvégien phonétique sur Asus eeePC -gr.kbd:en:Greek (104 keys) -gr.kbd:fr:Grec (104 touches) -gr.kbd:el:Ελληνικό (104 πλήκτÏων) +ee.kbd.from-iso1:en:Estonian +ee.kbd.from-iso1:da:Estisk +ee.kbd.from-iso1:de:Estnisch +ee.kbd.from-iso1:fr:Estonien +ee.kbd.from-iso1:es:Estonio ee.kbd:en:Estonian +ee.kbd:da:Estisk ee.kbd:de:Estnisch ee.kbd:fr:Estonien ee.kbd:es:Estonio +ee.kbd.from-cp850:en:Estonian +ee.kbd.from-cp850:da:Estisk +ee.kbd.from-cp850:de:Estnisch +ee.kbd.from-cp850:fr:Estonien +ee.kbd.from-cp850:es:Estonio + fi.kbd:en:Finnish +fi.kbd:da:Finsk fi.kbd:de:Finnisch fi.kbd:fr:Finlandais fi.kbd:es:Finlandés +fi.kbd.from-cp850:en:Finnish +fi.kbd.from-cp850:da:Finsk +fi.kbd.from-cp850:de:Finnisch +fi.kbd.from-cp850:fr:Finlandais +fi.kbd.from-cp850:es:Finlandés + fr.kbd:en:French +fr.kbd:da:Fransk fr.kbd:de:Französisch fr.kbd:fr:Français fr.kbd:pt:Francês @@ -141,19 +198,22 @@ fr.kbd:es:Francés fr.kbd:uk:Французька fr.acc.kbd:en:French (accent keys) +fr.acc.kbd:da:Fransk (accenttaster) fr.acc.kbd:de:Französisch (mit Akzenten) fr.acc.kbd:fr:Français (avec accents) fr.acc.kbd:pt:Francês (com acentos) fr.acc.kbd:es:Francés (con acentos) fr.acc.kbd:uk:Французька (accent keys) -fr.macbook.kbd:en:French Macbook/Macbook Pro (accent keys) -fr.macbook.kbd:de:Französisch Macbook/Macbook Pro (mit Aksenten) -fr.macbook.kbd:fr:Français Macbook/Macbook Pro (accent keys) -fr.macbook.kbd:pt:Francês Macbook/Macbook Pro (com acentos) -fr.macbook.kbd:es:Francés Macbook/Macbook Pro (con acentos) +fr.macbook.kbd:en:French (MacBook/MacBook Pro) (accent keys) +fr.macbook.kbd:da:Fransk (MacBook/MacBook Pro) (accenttaster) +fr.macbook.kbd:de:Französisch (MacBook/MacBook Pro) (mit Aksenten) +fr.macbook.kbd:fr:Français (MacBook/MacBook Pro) (accent keys) +fr.macbook.kbd:pt:Francês (MacBook/MacBook Pro) (com acentos) +fr.macbook.kbd:es:Francés (MacBook/MacBook Pro) (con acentos) fr.dvorak.kbd:en:French Dvorak-like +fr.dvorak.kbd:da:Fransk Dvorak-lignende fr.dvorak.kbd:de:Französisch Dvorak fr.dvorak.kbd:fr:Français Dvorak fr.dvorak.kbd:pt:Francês Dvorak @@ -161,6 +221,7 @@ fr.dvorak.kbd:es:Francés Dvorak fr.dvorak.kbd:uk:French Dvorak-like fr.dvorak.acc.kbd:en:French Dvorak-like (accent keys) +fr.dvorak.acc.kbd:da:Fransk Dvorak-lignende (accenttaster) fr.dvorak.acc.kbd:de:Französisch Dvorak (mit Akzenten) fr.dvorak.acc.kbd:fr:Français Dvorak (accent keys) fr.dvorak.acc.kbd:pt:Francês Dvorak (com acentos) @@ -168,14 +229,17 @@ fr.dvorak.acc.kbd:es:Francés Dvorak (con acentos) fr.dvorak.acc.kbd:uk:French Dvorak-like (accent keys) ca.kbd:en:Canadian Bilingual +ca.kbd:da:Canadisk tosproget ca-fr.kbd:en:French Canadian (accent keys) +ca-fr.kbd:da:Franskcanadisk (accenttaster) ca-fr.kbd:de:Französisch Kanada (mit Akzenten) ca-fr.kbd:fr:Français Canadien (avec accents) ca-fr.kbd:es:Francocanadiense (con acentos) ca-fr.kbd:uk:Французько-канадÑька (accent keys) de.kbd:en:German +de.kbd:da:Tysk de.kbd:de:Deutsch de.kbd:fr:Allemand de.kbd:pt:Alemão @@ -184,6 +248,7 @@ de.kbd:tr:Almanca de.kbd:uk:Ðімецька de.acc.kbd:en:German (accent keys) +de.acc.kbd:da:Tysk (accenttaster) de.acc.kbd:de:Deutsch (mit Akzenten) de.acc.kbd:fr:Allemand (avec accents) de.acc.kbd:pt:Alemão (com acentos) @@ -191,67 +256,85 @@ de.acc.kbd:es:Alemán (con acentos) de.acc.kbd:uk:Ðімецька (accent keys) de.noacc.kbd:en:German (no accent keys) +de.noacc.kbd:da:Tysk (ingen accenttaster) de.noacc.kbd:de:Deutsch (ohne Akzente) de.noacc.kbd:fr:Allemand (sans accents) de.noacc.kbd:pt:Alemão (no accent keys) de.noacc.kbd:es:Alemán (no accent keys) de.noacc.kbd:uk:Ðімецька (no accent keys) +de.kbd.from-cp850:en:German +de.kbd.from-cp850:da:Tysk +de.kbd.from-cp850:de:Deutsch +de.kbd.from-cp850:fr:Allemand +de.kbd.from-cp850:pt:Alemão +de.kbd.from-cp850:es:Alemán +de.kbd.from-cp850:uk:Ðімецька + +gr.kbd:en:Greek (104 keys) +gr.kbd:da:Græsk (104 taster) +gr.kbd:fr:Grec (104 touches) +gr.kbd:el:Ελληνικό (104 πλήκτÏων) + gr.elot.acc.kbd:en:Greek ELOT +gr.elot.acc.kbd:da:Græsk ELOT gr.elot.acc.kbd:de:Grieschisch ELOT gr.elot.acc.kbd:fr:Grec ELOT gr.elot.acc.kbd:el:Ελληνικό ΕΛΟΤ gr.101.acc.kbd:en:Greek (101 keys) +gr.101.acc.kbd:da:Græsk (101 taster) gr.101.acc.kbd:de:Grieschisch (101 Tasten) gr.101.acc.kbd:fr:Grec (101 touches) gr.101.acc.kbd:el:Ελληνικό (101 πλήκτÏων) il.kbd:en:Hebrew +il.kbd:da:Hebraisk il.kbd:de:Hebräisch il.kbd:fr:Hébreu il.kbd:he:תירבע hr.kbd:en:Croatian +hr.kbd:da:Kroatisk hr.kbd:de:Kroatisch hr.kbd:fr:Croate hr.kbd:es:Croata hu.101.kbd:en:Hungarian (101 keys) +hu.101.kbd:da:Ungarsk (101 taster) hu.101.kbd:de:Ungarisch (101 Tasten) hu.101.kbd:fr:Hongrois (101 touches) hu.101.kbd:es:Húngaro (101) hu.102.kbd:en:Hungarian (102 keys) +hu.102.kbd:da:Ungarsk (102 taster) hu.102.kbd:de:Ungarisch (102 Tasten) hu.102.kbd:fr:Hongrois (102 touches) hu.102.kbd:es:Húngaro (102) -am.kbd:hy:Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶ Õ°Õ¶Õ¹ÕµÕ¸Ö‚Õ¶Õ¡ÕµÕ«Õ¶ (Phonetic) Õ¤Õ¡Õ½Õ¡Õ¾Õ¸Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶ -am.kbd:ru:ÐрмÑнÑÐºÐ°Ñ Ñ„Ð¾Ð½ÐµÑ‚Ð¸Ñ‡ÐµÑÐºÐ°Ñ Ñ€Ð°Ñкладка -am.kbd:en:Armenian phonetic layout -am.kbd:fr:Arménien phonétique -am.kbd:de:Armenische phonetische Tastenbelegung - is.kbd:en:Icelandic +is.kbd:da:Islandsk is.kbd:de:Isländisch is.kbd:fr:Islandais is.kbd:pt:Islandês is.kbd:es:Islandés is.acc.kbd:en:Icelandic (accent keys) +is.acc.kbd:da:Islandsk (accenttaster) is.acc.kbd:de:Isländisch (mit Akzenten) is.acc.kbd:fr:Islandais (avec accents) is.acc.kbd:pt:Islandês (com acentos) is.acc.kbd:es:Islandés (con acentos) it.kbd:en:Italian +it.kbd:da:Italiensk it.kbd:de:Italienisch it.kbd:fr:Italien it.kbd:pt,es:Italiano it.kbd:uk:ІталійÑька jp.kbd:en:Japanese 106 +jp.kbd:da:Japansk 106 jp.kbd:de:Japanisch 106 jp.kbd:fr:Japonais 106 jp.kbd:pt:Japonês 106 @@ -259,6 +342,7 @@ jp.kbd:es:Japonés 106 jp.kbd:uk:ЯпонÑька 106 jp.capsctrl.kbd:en:Japanese 106x +jp.capsctrl.kbd:da:Japansk 106x jp.capsctrl.kbd:de:Japanisch 106x jp.capsctrl.kbd:fr:Japonais 106x jp.capsctrl.kbd:pt:Japonês 106x @@ -266,29 +350,35 @@ jp.capsctrl.kbd:es:Japonés 106x jp.capsctrl.kbd:uk:ЯпонÑька 106x kz.kst.kbd:en:Kazakh +kz.kst.kbd:da:Kasakhisk kz.kst.kbd:de:Kasachisch kz.kst.kbd:fr:Kazakh kz.io.kbd:en:Kazakh +kz.io.kbd:da:Kasakhisk kz.io.kbd:de:Kasachisch kz.io.kbd:fr:Kazakh latinamerican.kbd:en:Latin American +latinamerican.kbd:da:Latinamerikansk latinamerican.kbd:de:Latein Amerikanisch latinamerican.kbd:fr:Amérique latine latinamerican.kbd:pt,es:América Latina latinamerican.acc.kbd:en:Latin American (accent keys) +latinamerican.acc.kbd:da:Latinamerikansk (accenttaster) latinamerican.acc.kbd:de:Latein Amerikanisch (mit Akzenten) latinamerican.acc.kbd:fr:Amérique latine (avec accents) latinamerican.acc.kbd:pt,es:América Latina (com acentos) lt.kbd:en:Lithuanian +lt.kbd:da:Litauisk lt.kbd:de:Litauisch lt.kbd:fr:Lithuanien lt.kbd:es:Lituano no.kbd:en:Norwegian +no.kbd:da:Norsk no.kbd:no:Norsk no.kbd:de:Norwegisch no.kbd:fr:Norvégien @@ -296,6 +386,7 @@ no.kbd:pt:Norueguês no.kbd:es:Noruego no.dvorak.kbd:en:Norwegian dvorak +no.dvorak.kbd:da:Norsk dvorak no.dvorak.kbd:no:Norsk dvorak no.dvorak.kbd:de:Norwegisch dvorak no.dvorak.kbd:fr:Norvégien dvorak @@ -303,6 +394,7 @@ no.dvorak.kbd:pt:Norueguês dvorak no.dvorak.kbd:es:Noruego Idvorak pl.kbd:en:Polish (programmer's) +pl.kbd:da:Polsk (programmør) pl.kbd:de:Polnisch (für Programmierer) pl.kbd:fr:Polonais (pour programmeurs) pl.kbd:pl:Polska (programisty) @@ -310,6 +402,7 @@ pl.kbd:pt:Polonês (para programadores) pl.kbd:es:Polaco (para programadores) pl.dvorak.kbd:en:Polish Dvorak +pl.dvorak.kbd:da:Polsk Dvorak pl.dvorak.kbd:de:Polnisch Dvorak pl.dvorak.kbd:fr:Polonais Dvorak pl.dvorak.kbd:pl:Polska Dvorak @@ -317,18 +410,39 @@ pl.dvorak.kbd:pt:Polonês Dvorak pl.dvorak.kbd:es:Polaco Dvorak pt.kbd:en:Portuguese +pt.kbd:da:Portugisisk pt.kbd:de:Portugisisch pt.kbd:fr:Portugais pt.kbd:pt:Português pt.kbd:es:Portugués pt.acc.kbd:en:Portuguese (accent keys) +pt.acc.kbd:da:Portugisisk (accenttaster) pt.acc.kbd:de:Portugisisch (mit Akzenten) pt.acc.kbd:fr:Portugais (avec accents) pt.acc.kbd:pt:Português (com acentos) pt.acc.kbd:es:Portugués (con acentos) +ru.kbd.from-cp866:en:Russian (alternative) +ru.kbd.from-cp866:da:Russisk (alternativ) +ru.kbd.from-cp866:de:Russisch (alternativ) +ru.kbd.from-cp866:ru:РуÑÑкий (alternative) +ru.kbd.from-cp866:fr:Russe (alternative) +ru.kbd.from-cp866:pt:Russo (alternativo) +ru.kbd.from-cp866:es:Ruso (alternativo) +ru.kbd.from-cp866:uk:РоÑійÑька (альтернативна) + +ru.kbd.from-iso5:en:Russian +ru.kbd.from-iso5:da:Russisk +ru.kbd.from-iso5:de:Russisch +ru.kbd.from-iso5:fr:Russe +ru.kbd.from-iso5:ru:РуÑÑкий +ru.kbd.from-iso5:pt:Russo +ru.kbd.from-iso5:es:Ruso +ru.kbd.from-iso5:uk:РоÑійÑький + ru.kbd:en:Russian +ru.kbd:da:Russisk ru.kbd:de:Russisch ru.kbd:ru:РуÑÑкий ru.kbd:fr:Russe @@ -337,6 +451,7 @@ ru.kbd:es:Ruso ru.kbd:uk:РоÑійÑька ru.shift.kbd:en:Russian (shift) +ru.shift.kbd:da:Russisk (shift) ru.shift.kbd:de:Russisch (shift) ru.shift.kbd:ru:РуÑÑкий (shift) ru.shift.kbd:fr:Russe (shift) @@ -345,6 +460,7 @@ ru.shift.kbd:es:Ruso (shift) ru.shift.kbd:uk:РоÑійÑька (shift) ru.win.kbd:en:Russian (winkeys) +ru.win.kbd:da:Russisk (win-taster) ru.win.kbd:de:Russisch (winkeys) ru.win.kbd:ru:РуÑÑкий (winkeys) ru.win.kbd:fr:Russe (winkeys) @@ -353,171 +469,234 @@ ru.win.kbd:es:Ruso (winkeys) ru.win.kbd:uk:РоÑійÑька (winkeys) es.dvorak.kbd:en:Spanish Dvorak +es.dvorak.kbd:da:Spansk Dvorak es.dvorak.kbd:de:Spanisch Dvorak es.dvorak.kbd:fr:Espagnol Dvorak es.dvorak.kbd:pt:Espanhol Dvorak es.dvorak.kbd:es:Español Dvorak +es.kbd.from-iso1:en:Spanish +es.kbd.from-iso1:da:Spansk +es.kbd.from-iso1:de:Spanisch +es.kbd.from-iso1:fr:Espagnol +es.kbd.from-iso1:pt:Espanhol +es.kbd.from-iso1:es:Español + es.acc.kbd:en:Spanish (accent keys) +es.acc.kbd:da:Spansk (accenttaster) es.acc.kbd:de:Spanisch (accent keys) es.acc.kbd:fr:Espagnol (avec accents) es.acc.kbd:pt:Espanhol (com acentos) es.acc.kbd:es:Español (con acentos) es.kbd:en:Spanish (accent keys) +es.kbd:da:Spansk (accenttaster) es.kbd:de:Spanisch (accent keys) es.kbd:fr:Espagnol (avec accents) es.kbd:pt:Espanhol (com acentos) es.kbd:es:Español (con acentos) si.kbd:en:Slovenian +si.kbd:da:Slovensk si.kbd:de:Slovenisch si.kbd:fr:Slovène si.kbd:pt:Eslovênio si.kbd:es:Esloveno sk.kbd:en:Slovak +sk.kbd:da:Slovakisk sk.kbd:de:Slovakisch sk.kbd:fr:Slovène sk.kbd:es:Eslovaco se.kbd:en:Swedish +se.kbd:da:Svensk se.kbd:de:Schwedisch se.kbd:fr:Suédois se.kbd:pt,es:Sueco +se.kbd.from-cp850:en:Swedish +se.kbd.from-cp850:da:Svensk +se.kbd.from-cp850:de:Schwedisch +se.kbd.from-cp850:fr:Suédois +se.kbd.from-cp850:pt,es:Sueco + ch-fr.kbd:en:Swiss-French +ch-fr.kbd:da:Schweizerfransk ch-fr.kbd:de:Schweiz-Französisch ch-fr.kbd:fr:Suisse-Français ch-fr.kbd:es:Francosuizo ch-fr.acc.kbd:en:Swiss-French (accent keys) +ch-fr.acc.kbd:da:Schweizerfransk (accenttaster) ch-fr.acc.kbd:de:Schweiz-Französisch (mit Akzenten) ch-fr.acc.kbd:fr:Suisse-Français (avec accents) ch-fr.acc.kbd:es:Francosuizo (con acentos) +ch-fr.kbd.from-cp850:en:Swiss-French +ch-fr.kbd.from-cp850:da:Schweizerfransk +ch-fr.kbd.from-cp850:de:Schweiz-Französisch +ch-fr.kbd.from-cp850:fr:Suisse-Français +ch-fr.kbd.from-cp850:es:Francosuizo + ch.kbd:en:Swiss-German +ch.kbd:da:Schweizertysk ch.kbd:de:Schweiz-Deutsch ch.kbd:fr:Suisse-Allemand ch.kbd:pt:Suiço-Alemão ch.kbd:es:Germanosuizo ch.acc.kbd:en:Swiss-German (accent keys) +ch.acc.kbd:da:Schweizertysk (accenttaster) ch.acc.kbd:de:Schweiz-Deutsch (mit Akzenten) ch.acc.kbd:fr:Suisse-Allemand (avec accents) ch.acc.kbd:pt:Suiço-Alemão (com acentos) ch.acc.kbd:es:Germanosuizo (con acentos) -ch.macbook.acc.kbd:en:Swiss-German Macbook/Macbook Pro (accent keys) -ch.macbook.acc.kbd:de:Schweiz-Deutsch Macbook/Macbook Pro (mit Akzenten) -ch.macbook.acc.kbd:fr:Suisse-Allemand Macbook/Macbook Pro (avec accents) -ch.macbook.acc.kbd:pt:Suiço-Alemão Macbook/Macbook Pro (com acentos) -ch.macbook.acc.kbd:es:Germanosuizo Macbook/Macbook Pro (con acentos) +ch.kbd.from-cp850:en:Swiss-German +ch.kbd.from-cp850:da:Schweizertysk +ch.kbd.from-cp850:de:Schweiz-Deutsch +ch.kbd.from-cp850:fr:Suisse-Allemand +ch.kbd.from-cp850:pt:Suiço-Alemão +ch.kbd.from-cp850:es:Germanosuizo +ch.macbook.acc.kbd:en:Swiss-German (MacBook/MacBook Pro) (accent keys) +ch.macbook.acc.kbd:da:Schweizertysk (MacBook/MacBook Pro) (accenttaster) +ch.macbook.acc.kbd:de:Schweiz-Deutsch (MacBook/MacBook Pro) (mit Akzenten) +ch.macbook.acc.kbd:fr:Suisse-Allemand (MacBook/MacBook Pro) (avec accents) +ch.macbook.acc.kbd:pt:Suiço-Alemão (MacBook/MacBook Pro) (com acentos) +ch.macbook.acc.kbd:es:Germanosuizo (MacBook/MacBook Pro) (con acentos) + tr.kbd:en:Turkish (Q) +tr.kbd:da:Tyrkisk (Q) tr.kbd:de:Türkisch (Q) tr.kbd:fr:Turc (Q) tr.kbd:uk:Турецька (Q) tr.kbd:tr:Türkçe (Q) tr.f.kbd:en:Turkish (F) +tr.f.kbd:da:Tyrkisk (F) tr.f.kbd:de:Türkisch (F) tr.f.kbd:fr:Turc (F) tr.f.kbd:uk:Турецька (F) tr.f.kbd:tr:Türkçe (F) uk.kbd:en:United Kingdom +uk.kbd:da:Storbritannien uk.kbd:de:Vereinigtes Königreich uk.kbd:fr:Royaume Uni uk.kbd:pt:Reino Unido uk.kbd:es:Británico uk.capsctrl.kbd:en:United Kingdom (Caps Lock acts as Left Ctrl) +uk.capsctrl.kbd:da:Storbritannien (Caps Lock fungerer som venstre Ctrl) uk.capsctrl.kbd:de:Vereinigtes Königreich (Caps Lock als linke Strg) #uk.capsctrl.kbd:fr:Royaume Uni (caps lock acts as Left Ctrl) #uk.capsctrl.kbd:pt:Reino Unido (caps lock acts as Left Ctrl) #uk.capsctrl.kbd:es:Británico (caps lock acts as Left Ctrl) uk.dvorak.kbd:en:United Kingdom Dvorak +uk.dvorak.kbd:da:Storbritannien Dvorak uk.dvorak.kbd:de:Vereinigtes Königreich Dvorak uk.dvorak.kbd:fr:Royaume Uni Dvorak uk.dvorak.kbd:pt:Reino Unido Dvorak uk.dvorak.kbd:es:Británico Dvorak -uk.macbook.kbd:en:United Kingdom Macbook -uk.macbook.kbd:de:Vereinigtes Königreich Macbook -uk.macbook.kbd:fr:Royaume Uni Macbook -uk.macbook.kbd:pt:Reino Unido Macbook -uk.macbook.kbd:es:Británico Macbook +uk.macbook.kbd:en:United Kingdom (MacBook) +uk.macbook.kbd:da:Storbritannien (MacBook) +uk.macbook.kbd:de:Vereinigtes Königreich (MacBook) +uk.macbook.kbd:fr:Royaume Uni (MacBook) +uk.macbook.kbd:pt:Reino Unido (MacBook) +uk.macbook.kbd:es:Británico (MacBook) us.kbd:en:United States of America +us.kbd:da:USA us.kbd:de:US-amerikanisch us.kbd:fr:États Unis d'Amérique us.kbd:pt:Estados Unidos da América us.kbd:es:Estadounidense us.acc.kbd:en:United States of America (accent keys) +us.acc.kbd:da:USA (accenttaster) us.acc.kbd:de:US-amerikanisch (mit Akzenten) us.acc.kbd:fr:États Unis d'Amérique (avec accents) us.acc.kbd:pt:Estados Unidos da América (com acentos) us.acc.kbd:es:Estadounidense (con acentos) us.dvorak.kbd:en:United States of America dvorak +us.dvorak.kbd:da:USA dvorak us.dvorak.kbd:de:US-amerikanisch dvorak us.dvorak.kbd:fr:États Unis d'Amérique dvorak us.dvorak.kbd:pt:Estados Unidos da América dvorak us.dvorak.kbd:es:Estadounidense dvorak us.dvorakr.kbd:en:United States of America righthand dvorak +us.dvorakr.kbd:da:USA højrehÃ¥ndet dvorak us.dvorakr.kbd:de:US-amerikanisch dvorak rechte Hand us.dvorakr.kbd:fr:États Unis d'Amérique dvorakr us.dvorakr.kbd:pt:Estados Unidos da América dvorakr us.dvorakr.kbd:es:Estadounidense dvorak diestro us.dvorakl.kbd:en:United States of America lefthand dvorak +us.dvorakl.kbd:da:USA venstrehÃ¥ndet dvorak us.dvorakl.kbd:de:US-amerikanisch dvorak linke Hand us.dvorakl.kbd:fr:États Unis d'Amérique dvorakl us.dvorakl.kbd:pt:Estados Unidos da América dvorakl us.dvorakl.kbd:es:Estadounidense dvorak zurdo us.dvorakp.kbd:en:United States of America Programmer Dvorak +us.dvorakp.kbd:da:USA programmør Dvorak us.dvorakp.kbd:de:US-amerikanisch (Dvorak für Programmierer) us.dvorakp.kbd:fr:États Unis d'Amérique dvorakp us.dvorakp.kbd:pt:Estados Unidos da América dvorakp us.dvorakp.kbd:es:Estadounidense dvorakp us.dvorakx.kbd:en:United States of America dvorakx +us.dvorakx.kbd:da:USA dvorakx us.dvorakx.kbd:de:US-amerikanisch dvorakx us.dvorakx.kbd:fr:États Unis d'Amérique dvorakx us.dvorakx.kbd:pt:Estados Unidos da América dvorakx us.dvorakx.kbd:es:Estadounidense dvorakx us.emacs.kbd:en:United States of America Emacs optimized layout +us.emacs.kbd:da:USA Emacs-optimeret layout us.emacs.kbd:de:US-amerikanisch für Emacs optimiert us.emacs.kbd:fr:États Unis d'Amérique emacs us.emacs.kbd:pt:Estados Unidos da América emacs us.emacs.kbd:es:Estadounidense optimizado para Emacs us.ctrl.kbd:en:United States of America (Caps Lock acts as Left Ctrl) +us.ctrl.kbd:da:USA (Caps Lock fungerer som venstre Ctrl) us.unix.kbd:en:United States of America Traditional Unix Workstation +us.unix.kbd:da:USA traditionel Unix-arbejdsstation us.unix.kbd:de:US-amerikanisch traditionelles Unix Layout us.unix.kbd:fr:États Unis d'Amérique unix us.unix.kbd:pt:Estados Unidos da América unix us.unix.kbd:es:Estadounidense Unix tradicional -us.macbook.kbd:en:United States of America Macbook/Macbook Pro ISO-8859-1 -us.macbook.kbd:de:US-amerikanisch Macbook/Macbook Pro ISO-8859-1 -us.macbook.kbd:fr:États Unis d'Amérique Macbook / Macbook Pro ISO-8859-1 -us.macbook.kbd:pt:Estados Unidos da América Macbook/Macbook Pro ISO-8859-1 -us.macbook.kbd:es:Estadounidense Macbook/Macbook Pro ISO-8859-1 +us.macbook.kbd:en:United States of America (MacBook/MacBook Pro) ISO-8859-1 +us.macbook.kbd:da:USA (MacBook/MacBook Pro) ISO-8859-1 +us.macbook.kbd:de:US-amerikanisch (MacBook/MacBook Pro) ISO-8859-1 +us.macbook.kbd:fr:États Unis d'Amérique (MacBook/MacBook Pro) ISO-8859-1 +us.macbook.kbd:pt:Estados Unidos da América (MacBook/MacBook Pro) ISO-8859-1 +us.macbook.kbd:es:Estadounidense (MacBook/MacBook Pro) ISO-8859-1 +ua.kbd.from-iso5:en:Ukrainian +ua.kbd.from-iso5:da:Ukrainsk +ua.kbd.from-iso5:de:Ukrainisch +ua.kbd.from-iso5:fr:Ukrainien +ua.kbd.from-iso5:ru:УкраинÑкий +ua.kbd.from-iso5:uk:УкраїнÑька + ua.kbd:en:Ukrainian +ua.kbd:da:Ukrainsk ua.kbd:de:Ukrainisch ua.kbd:fr:Ukrainien ua.kbd:uk:УкраїнÑька ua.shift.alt.kbd:en:Ukrainian (with Russian) (shift) +ua.shift.alt.kbd:da:Ukrainsk (med russisk) (shift) ua.shift.alt.kbd:de:Ukrainisch (mit Russisch) (shift) ua.shift.alt.kbd:fr:Ukrainien (koi8-u avec koi8-r) (shift) ua.shift.alt.kbd:uk:УкраїнÑька (koi8-u з) koi8-r (shift) From owner-svn-src-all@freebsd.org Tue Dec 10 20:04:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF8441E36A5; Tue, 10 Dec 2019 20:04:08 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47XWGw5Xw0z4CHr; Tue, 10 Dec 2019 20:04:08 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B94142FF15; Tue, 10 Dec 2019 20:04:08 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBAK48FT010474; Tue, 10 Dec 2019 20:04:08 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAK48tS010473; Tue, 10 Dec 2019 20:04:08 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201912102004.xBAK48tS010473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 10 Dec 2019 20:04:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355593 - head/sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sbin/fsck_ffs X-SVN-Commit-Revision: 355593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 20:04:08 -0000 Author: vangyzen Date: Tue Dec 10 20:04:08 2019 New Revision: 355593 URL: https://svnweb.freebsd.org/changeset/base/355593 Log: fsck_ffs: fix some memory leaks found by Coverity. Reported by: Coverity CID: 1380549 1380550 1380551 MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/sbin/fsck_ffs/setup.c Modified: head/sbin/fsck_ffs/setup.c ============================================================================== --- head/sbin/fsck_ffs/setup.c Tue Dec 10 20:02:57 2019 (r355592) +++ head/sbin/fsck_ffs/setup.c Tue Dec 10 20:04:08 2019 (r355593) @@ -474,11 +474,15 @@ calcsb(char *dev, int devfd, struct fs *fs) if (fsrbuf == NULL) errx(EEXIT, "calcsb: cannot allocate recovery buffer"); if (blread(devfd, fsrbuf, - (SBLOCK_UFS2 - secsize) / dev_bsize, secsize) != 0) + (SBLOCK_UFS2 - secsize) / dev_bsize, secsize) != 0) { + free(fsrbuf); return (0); + } fsr = (struct fsrecovery *)&fsrbuf[secsize - sizeof *fsr]; - if (fsr->fsr_magic != FS_UFS2_MAGIC) + if (fsr->fsr_magic != FS_UFS2_MAGIC) { + free(fsrbuf); return (0); + } memset(fs, 0, sizeof(struct fs)); fs->fs_fpg = fsr->fsr_fpg; fs->fs_fsbtodb = fsr->fsr_fsbtodb; @@ -505,11 +509,14 @@ chkrecovery(int devfd) * Could not determine if backup material exists, so do not * offer to create it. */ + fsrbuf = NULL; if (ioctl(devfd, DIOCGSECTORSIZE, &secsize) == -1 || (fsrbuf = Malloc(secsize)) == NULL || blread(devfd, fsrbuf, (SBLOCK_UFS2 - secsize) / dev_bsize, - secsize) != 0) + secsize) != 0) { + free(fsrbuf); return (1); + } /* * Recovery material has already been created, so do not * need to create it again. @@ -538,12 +545,14 @@ saverecovery(int readfd, int writefd) char *fsrbuf; u_int secsize; + fsrbuf = NULL; if (sblock.fs_magic != FS_UFS2_MAGIC || ioctl(readfd, DIOCGSECTORSIZE, &secsize) == -1 || (fsrbuf = Malloc(secsize)) == NULL || blread(readfd, fsrbuf, (SBLOCK_UFS2 - secsize) / dev_bsize, secsize) != 0) { printf("RECOVERY DATA COULD NOT BE CREATED\n"); + free(fsrbuf); return; } fsr = (struct fsrecovery *)&fsrbuf[secsize - sizeof *fsr]; From owner-svn-src-all@freebsd.org Tue Dec 10 20:11:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9CD51E37E0; Tue, 10 Dec 2019 20:11:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47XWRb4bSqz4ClS; Tue, 10 Dec 2019 20:11:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98E10C6; Tue, 10 Dec 2019 20:11:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBAKBd51013891; Tue, 10 Dec 2019 20:11:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAKBdUb013890; Tue, 10 Dec 2019 20:11:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912102011.xBAKBdUb013890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Dec 2019 20:11:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355594 - head/share/vt/keymaps X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/vt/keymaps X-SVN-Commit-Revision: 355594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 20:11:39 -0000 Author: emaste Date: Tue Dec 10 20:11:39 2019 New Revision: 355594 URL: https://svnweb.freebsd.org/changeset/base/355594 Log: remove again nonexistent from-* entries from vt INDEX.keymaps A number of entries of the form "de.kbd.from-cp850" existed in vt's INDEX.keymaps, added in r270114, but these files do not exist. I removed them in r355585 but accidentally re-added them in r355592. Remove them yet again. PR: 235564, 235853 MFC after: 1 week Modified: head/share/vt/keymaps/INDEX.keymaps Modified: head/share/vt/keymaps/INDEX.keymaps ============================================================================== --- head/share/vt/keymaps/INDEX.keymaps Tue Dec 10 20:04:08 2019 (r355593) +++ head/share/vt/keymaps/INDEX.keymaps Tue Dec 10 20:11:39 2019 (r355594) @@ -111,18 +111,6 @@ cz.kbd:de:Tschechisch (QWERTZ, mit Akzenten) cz.kbd:fr:Tchèque (QWERTZ, avec accents) cz.kbd:es:Checo (QWERTZ, con acentos) -cz.kbd.from-ce:en:Czech -cz.kbd.from-ce:da:Tjekkisk -cz.kbd.from-ce:de:Tschechisch -cz.kbd.from-ce:fr:Tchèque -cz.kbd.from-ce:es:Checo - -cz.qwerty.kbd.from-ce:en:Czech (QWERTY) -cz.qwerty.kbd.from-ce:da:Tjekkisk (QWERTY) -cz.qwerty.kbd.from-ce:de:Tschechisch (QWERTY) -cz.qwerty.kbd.from-ce:fr:Tchèquey (QWERTY) -cz.qwerty.kbd.from-ce:es:Checo (QWERTY) - dk.kbd:en:Danish dk.kbd:da:Dansk dk.kbd:de:Dänisch @@ -137,13 +125,6 @@ dk.acc.kbd:fr:Danois (avec accents) dk.acc.kbd:pt:Dinamarquês (com acentos) dk.acc.kbd:es:Danés (con acentos) -dk.kbd.from-cp865:en:Danish -dk.kbd.from-cp865:da:Dansk -dk.kbd.from-cp865:de:Dänisch -dk.kbd.from-cp865:fr:Danois -dk.kbd.from-cp865:pt:Dinamarquês -dk.kbd.from-cp865:es:Danés - dk.macbook.kbd:en:Danish (MacBook) dk.macbook.kbd:da:Dansk (MacBook) dk.macbook.kbd:de:Dänisch (MacBook) @@ -159,36 +140,18 @@ nordic.asus-eee.kbd:en:Nordic layout on Asus eeePC nordic.asus-eee.kbd:da:Nordisk layout pÃ¥ Asus eeePC nordic.asus-eee.kbd:fr:Norvégien phonétique sur Asus eeePC -ee.kbd.from-iso1:en:Estonian -ee.kbd.from-iso1:da:Estisk -ee.kbd.from-iso1:de:Estnisch -ee.kbd.from-iso1:fr:Estonien -ee.kbd.from-iso1:es:Estonio - ee.kbd:en:Estonian ee.kbd:da:Estisk ee.kbd:de:Estnisch ee.kbd:fr:Estonien ee.kbd:es:Estonio -ee.kbd.from-cp850:en:Estonian -ee.kbd.from-cp850:da:Estisk -ee.kbd.from-cp850:de:Estnisch -ee.kbd.from-cp850:fr:Estonien -ee.kbd.from-cp850:es:Estonio - fi.kbd:en:Finnish fi.kbd:da:Finsk fi.kbd:de:Finnisch fi.kbd:fr:Finlandais fi.kbd:es:Finlandés -fi.kbd.from-cp850:en:Finnish -fi.kbd.from-cp850:da:Finsk -fi.kbd.from-cp850:de:Finnisch -fi.kbd.from-cp850:fr:Finlandais -fi.kbd.from-cp850:es:Finlandés - fr.kbd:en:French fr.kbd:da:Fransk fr.kbd:de:Französisch @@ -263,14 +226,6 @@ de.noacc.kbd:pt:Alemão (no accent keys) de.noacc.kbd:es:Alemán (no accent keys) de.noacc.kbd:uk:Ðімецька (no accent keys) -de.kbd.from-cp850:en:German -de.kbd.from-cp850:da:Tysk -de.kbd.from-cp850:de:Deutsch -de.kbd.from-cp850:fr:Allemand -de.kbd.from-cp850:pt:Alemão -de.kbd.from-cp850:es:Alemán -de.kbd.from-cp850:uk:Ðімецька - gr.kbd:en:Greek (104 keys) gr.kbd:da:Græsk (104 taster) gr.kbd:fr:Grec (104 touches) @@ -423,24 +378,6 @@ pt.acc.kbd:fr:Portugais (avec accents) pt.acc.kbd:pt:Português (com acentos) pt.acc.kbd:es:Portugués (con acentos) -ru.kbd.from-cp866:en:Russian (alternative) -ru.kbd.from-cp866:da:Russisk (alternativ) -ru.kbd.from-cp866:de:Russisch (alternativ) -ru.kbd.from-cp866:ru:РуÑÑкий (alternative) -ru.kbd.from-cp866:fr:Russe (alternative) -ru.kbd.from-cp866:pt:Russo (alternativo) -ru.kbd.from-cp866:es:Ruso (alternativo) -ru.kbd.from-cp866:uk:РоÑійÑька (альтернативна) - -ru.kbd.from-iso5:en:Russian -ru.kbd.from-iso5:da:Russisk -ru.kbd.from-iso5:de:Russisch -ru.kbd.from-iso5:fr:Russe -ru.kbd.from-iso5:ru:РуÑÑкий -ru.kbd.from-iso5:pt:Russo -ru.kbd.from-iso5:es:Ruso -ru.kbd.from-iso5:uk:РоÑійÑький - ru.kbd:en:Russian ru.kbd:da:Russisk ru.kbd:de:Russisch @@ -475,13 +412,6 @@ es.dvorak.kbd:fr:Espagnol Dvorak es.dvorak.kbd:pt:Espanhol Dvorak es.dvorak.kbd:es:Español Dvorak -es.kbd.from-iso1:en:Spanish -es.kbd.from-iso1:da:Spansk -es.kbd.from-iso1:de:Spanisch -es.kbd.from-iso1:fr:Espagnol -es.kbd.from-iso1:pt:Espanhol -es.kbd.from-iso1:es:Español - es.acc.kbd:en:Spanish (accent keys) es.acc.kbd:da:Spansk (accenttaster) es.acc.kbd:de:Spanisch (accent keys) @@ -515,12 +445,6 @@ se.kbd:de:Schwedisch se.kbd:fr:Suédois se.kbd:pt,es:Sueco -se.kbd.from-cp850:en:Swedish -se.kbd.from-cp850:da:Svensk -se.kbd.from-cp850:de:Schwedisch -se.kbd.from-cp850:fr:Suédois -se.kbd.from-cp850:pt,es:Sueco - ch-fr.kbd:en:Swiss-French ch-fr.kbd:da:Schweizerfransk ch-fr.kbd:de:Schweiz-Französisch @@ -533,12 +457,6 @@ ch-fr.acc.kbd:de:Schweiz-Französisch (mit Akzenten) ch-fr.acc.kbd:fr:Suisse-Français (avec accents) ch-fr.acc.kbd:es:Francosuizo (con acentos) -ch-fr.kbd.from-cp850:en:Swiss-French -ch-fr.kbd.from-cp850:da:Schweizerfransk -ch-fr.kbd.from-cp850:de:Schweiz-Französisch -ch-fr.kbd.from-cp850:fr:Suisse-Français -ch-fr.kbd.from-cp850:es:Francosuizo - ch.kbd:en:Swiss-German ch.kbd:da:Schweizertysk ch.kbd:de:Schweiz-Deutsch @@ -553,13 +471,6 @@ ch.acc.kbd:fr:Suisse-Allemand (avec accents) ch.acc.kbd:pt:Suiço-Alemão (com acentos) ch.acc.kbd:es:Germanosuizo (con acentos) -ch.kbd.from-cp850:en:Swiss-German -ch.kbd.from-cp850:da:Schweizertysk -ch.kbd.from-cp850:de:Schweiz-Deutsch -ch.kbd.from-cp850:fr:Suisse-Allemand -ch.kbd.from-cp850:pt:Suiço-Alemão -ch.kbd.from-cp850:es:Germanosuizo - ch.macbook.acc.kbd:en:Swiss-German (MacBook/MacBook Pro) (accent keys) ch.macbook.acc.kbd:da:Schweizertysk (MacBook/MacBook Pro) (accenttaster) ch.macbook.acc.kbd:de:Schweiz-Deutsch (MacBook/MacBook Pro) (mit Akzenten) @@ -681,13 +592,6 @@ us.macbook.kbd:de:US-amerikanisch (MacBook/MacBook Pro us.macbook.kbd:fr:États Unis d'Amérique (MacBook/MacBook Pro) ISO-8859-1 us.macbook.kbd:pt:Estados Unidos da América (MacBook/MacBook Pro) ISO-8859-1 us.macbook.kbd:es:Estadounidense (MacBook/MacBook Pro) ISO-8859-1 - -ua.kbd.from-iso5:en:Ukrainian -ua.kbd.from-iso5:da:Ukrainsk -ua.kbd.from-iso5:de:Ukrainisch -ua.kbd.from-iso5:fr:Ukrainien -ua.kbd.from-iso5:ru:УкраинÑкий -ua.kbd.from-iso5:uk:УкраїнÑька ua.kbd:en:Ukrainian ua.kbd:da:Ukrainsk From owner-svn-src-all@freebsd.org Tue Dec 10 20:12:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE9551E39C2; Tue, 10 Dec 2019 20:12:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47XWSP4j8Bz4CyJ; Tue, 10 Dec 2019 20:12:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C19E114; Tue, 10 Dec 2019 20:12:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBAKCLXm016233; Tue, 10 Dec 2019 20:12:21 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAKCLmY016232; Tue, 10 Dec 2019 20:12:21 GMT (envelope-from np@FreeBSD.org) Message-Id: <201912102012.xBAKCLmY016232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 10 Dec 2019 20:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355595 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 355595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 20:12:21 -0000 Author: np Date: Tue Dec 10 20:12:21 2019 New Revision: 355595 URL: https://svnweb.freebsd.org/changeset/base/355595 Log: cxgbe(4): Simplify the firmware version checks a bit. No functional change. MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Dec 10 20:11:39 2019 (r355594) +++ head/sys/dev/cxgbe/t4_main.c Tue Dec 10 20:12:21 2019 (r355595) @@ -4251,9 +4251,8 @@ set_params__pre_init(struct adapter *sc) val = 1; rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); /* firmwares < 1.20.1.0 do not have this param. */ - if (rc == FW_EINVAL && sc->params.fw_vers < - (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | - V_FW_HDR_FW_VER_MICRO(1) | V_FW_HDR_FW_VER_BUILD(0))) { + if (rc == FW_EINVAL && + sc->params.fw_vers < FW_VERSION32(1, 20, 1, 0)) { rc = 0; } if (rc != 0) { @@ -4418,9 +4417,7 @@ get_params__post_init(struct adapter *sc) return (rc); } sc->tids.ntids = val[0]; - if (sc->params.fw_vers < - (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | - V_FW_HDR_FW_VER_MICRO(5) | V_FW_HDR_FW_VER_BUILD(0))) { + if (sc->params.fw_vers < FW_VERSION32(1, 20, 5, 0)) { MPASS(sc->tids.ntids >= sc->tids.nhpftids); sc->tids.ntids -= sc->tids.nhpftids; } @@ -4460,9 +4457,7 @@ get_params__post_init(struct adapter *sc) return (rc); } sc->tids.ntids = val[0]; - if (sc->params.fw_vers < - (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | - V_FW_HDR_FW_VER_MICRO(5) | V_FW_HDR_FW_VER_BUILD(0))) { + if (sc->params.fw_vers < FW_VERSION32(1, 20, 5, 0)) { MPASS(sc->tids.ntids >= sc->tids.nhpftids); sc->tids.ntids -= sc->tids.nhpftids; } From owner-svn-src-all@freebsd.org Tue Dec 10 20:23:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3592E1E3C28; Tue, 10 Dec 2019 20:23:06 +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 47XWhp0hB4z4DQZ; Tue, 10 Dec 2019 20:23:06 +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 12D9C315; Tue, 10 Dec 2019 20:23:06 +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 xBAKN5p4022186; Tue, 10 Dec 2019 20:23:05 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAKN5G2022185; Tue, 10 Dec 2019 20:23:05 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201912102023.xBAKN5G2022185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Tue, 10 Dec 2019 20:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355596 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 355596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 20:23:06 -0000 Author: wulf Date: Tue Dec 10 20:23:05 2019 New Revision: 355596 URL: https://svnweb.freebsd.org/changeset/base/355596 Log: [ig4] Remove unused methods from bus interface bus_get/set_resource methods are implemented in child device (iicbus). As their implementation with bus_generic_rl_get/set calls do not recurse up the tree, the versions in ig4 are never called. Suggested by: jhb Modified: head/sys/dev/ichiic/ig4_acpi.c head/sys/dev/ichiic/ig4_pci.c Modified: head/sys/dev/ichiic/ig4_acpi.c ============================================================================== --- head/sys/dev/ichiic/ig4_acpi.c Tue Dec 10 20:12:21 2019 (r355595) +++ head/sys/dev/ichiic/ig4_acpi.c Tue Dec 10 20:23:05 2019 (r355596) @@ -177,8 +177,6 @@ static device_method_t ig4iic_acpi_methods[] = { DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), - DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), - DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), /* iicbus interface */ DEVMETHOD(iicbus_transfer, ig4iic_transfer), Modified: head/sys/dev/ichiic/ig4_pci.c ============================================================================== --- head/sys/dev/ichiic/ig4_pci.c Tue Dec 10 20:12:21 2019 (r355595) +++ head/sys/dev/ichiic/ig4_pci.c Tue Dec 10 20:23:05 2019 (r355596) @@ -258,8 +258,6 @@ static device_method_t ig4iic_pci_methods[] = { DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), - DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), - DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), /* iicbus interface */ DEVMETHOD(iicbus_transfer, ig4iic_transfer), From owner-svn-src-all@freebsd.org Tue Dec 10 20:51:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B215E1E4316; Tue, 10 Dec 2019 20:51:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47XXKX4Lwqz4FX9; Tue, 10 Dec 2019 20:51:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90AD373D; Tue, 10 Dec 2019 20:51:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBAKpS2e038829; Tue, 10 Dec 2019 20:51:28 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAKpShA038828; Tue, 10 Dec 2019 20:51:28 GMT (envelope-from np@FreeBSD.org) Message-Id: <201912102051.xBAKpShA038828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 10 Dec 2019 20:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355597 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 355597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 20:51:28 -0000 Author: np Date: Tue Dec 10 20:51:28 2019 New Revision: 355597 URL: https://svnweb.freebsd.org/changeset/base/355597 Log: cxgbe(4): Man page updates to go with r355107. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/share/man/man4/cxgbe.4 Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Tue Dec 10 20:23:05 2019 (r355596) +++ head/share/man/man4/cxgbe.4 Tue Dec 10 20:51:28 2019 (r355597) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Oct 25, 2019 +.Dd Dec 10, 2019 .Dt CXGBE 4 .Os .Sh NAME @@ -291,10 +291,14 @@ This tunable establishes the default PAUSE settings fo Settings can be displayed and controlled on a per-port basis via the dev..X.pause_settings sysctl. .It Va hw.cxgbe.fec -FEC (Forward Error Correction) settings. +Forward Error Correction settings. +-1 (default) means driver should automatically pick a value. 0 disables FEC. -Bit 0 enables RS FEC, bit 1 enables BASE-R FEC (aka Firecode FEC). -The default is -1 which lets the driver pick a value. +Finer grained control can be achieved by setting individual bits. +Bit 0 enables RS FEC, bit 1 enables BASE-R FEC (aka Firecode FEC), bit +2 enables NO FEC, and bit 6 enables the FEC that is recommended by the +transceiver/cable that is plugged in. +These bits can be set together in any combination. This tunable establishes the default FEC settings for all ports. Settings can be displayed and controlled on a per-port basis via the dev..X.fec sysctl. From owner-svn-src-all@freebsd.org Tue Dec 10 21:48:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68A891E5487; Tue, 10 Dec 2019 21:48:22 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47XYbB2BgKz4K3t; Tue, 10 Dec 2019 21:48:22 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 464B711D9; Tue, 10 Dec 2019 21:48:22 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBALmM0s069688; Tue, 10 Dec 2019 21:48:22 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBALmMg6069687; Tue, 10 Dec 2019 21:48:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912102148.xBALmMg6069687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 10 Dec 2019 21:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355598 - head/sys/dev/ow X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/ow X-SVN-Commit-Revision: 355598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 21:48:22 -0000 Author: ian Date: Tue Dec 10 21:48:21 2019 New Revision: 355598 URL: https://svnweb.freebsd.org/changeset/base/355598 Log: Do not attach children of owc_gpiobus until interrupts are working. The children of the bus need to do IO on the bus to probe for hardware presence. Doing IO means timing the bus states using sbinuptime(), and that requires working timecounters, which are not initialized until after device attachment has completed. PR: 242526 Modified: head/sys/dev/ow/owc_gpiobus.c Modified: head/sys/dev/ow/owc_gpiobus.c ============================================================================== --- head/sys/dev/ow/owc_gpiobus.c Tue Dec 10 20:51:28 2019 (r355597) +++ head/sys/dev/ow/owc_gpiobus.c Tue Dec 10 21:48:21 2019 (r355598) @@ -131,7 +131,7 @@ owc_gpiobus_attach(device_t dev) free(kids, M_TEMP); if (nkid == 0) device_add_child(dev, "ow", -1); - bus_generic_attach(dev); + config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); return (0); } From owner-svn-src-all@freebsd.org Tue Dec 10 21:56:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1207F1E570B; Tue, 10 Dec 2019 21:56:45 +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 47XYmr6j87z4L06; Tue, 10 Dec 2019 21:56:44 +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 E01CD13DA; Tue, 10 Dec 2019 21:56:44 +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 xBALuiNB075241; Tue, 10 Dec 2019 21:56:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBALuitf075240; Tue, 10 Dec 2019 21:56:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912102156.xBALuitf075240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 10 Dec 2019 21:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355599 - head/libexec/rtld-elf/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/libexec/rtld-elf/riscv X-SVN-Commit-Revision: 355599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 21:56:45 -0000 Author: jhb Date: Tue Dec 10 21:56:44 2019 New Revision: 355599 URL: https://svnweb.freebsd.org/changeset/base/355599 Log: Correct the offset of static TLS variables for Initial-Exec on RISC-V. TP points to the start of the TLS block after the tcb, but Obj_Entry.tlsoffset includes the tcb, so subtract the size of the tcb to compute the offset relative to TP. This is identical to the same fixes for powerpc in r339072 and r342671. Reviewed by: James Clarke Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D22661 Modified: head/libexec/rtld-elf/riscv/reloc.c Modified: head/libexec/rtld-elf/riscv/reloc.c ============================================================================== --- head/libexec/rtld-elf/riscv/reloc.c Tue Dec 10 21:48:21 2019 (r355598) +++ head/libexec/rtld-elf/riscv/reloc.c Tue Dec 10 21:56:44 2019 (r355599) @@ -354,7 +354,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int } *where = (def->st_value + rela->r_addend + - defobj->tlsoffset - TLS_TP_OFFSET); + defobj->tlsoffset - TLS_TP_OFFSET - TLS_TCB_SIZE); break; case R_RISCV_RELATIVE: *where = (Elf_Addr)(obj->relocbase + rela->r_addend); From owner-svn-src-all@freebsd.org Tue Dec 10 21:58:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E7601E5792; Tue, 10 Dec 2019 21:58:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47XYpv2mMWz4L6q; Tue, 10 Dec 2019 21:58:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A29813DF; Tue, 10 Dec 2019 21:58:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBALwVkp075357; Tue, 10 Dec 2019 21:58:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBALwUF9075354; Tue, 10 Dec 2019 21:58:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912102158.xBALwUF9075354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 10 Dec 2019 21:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355600 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 355600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 21:58:31 -0000 Author: jhb Date: Tue Dec 10 21:58:30 2019 New Revision: 355600 URL: https://svnweb.freebsd.org/changeset/base/355600 Log: Add a callout_func_t typedef for functions used with callout_*(). This typedef is the same as timeout_t except that it is in the callout namespace and header. Use this typedef in various places of the callout implementation that were either using the raw type or timeout_t. While here, add to the manpage. Reviewed by: kib, imp MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D22751 Modified: head/share/man/man9/timeout.9 head/sys/kern/kern_timeout.c head/sys/sys/_callout.h Modified: head/share/man/man9/timeout.9 ============================================================================== --- head/share/man/man9/timeout.9 Tue Dec 10 21:56:44 2019 (r355599) +++ head/share/man/man9/timeout.9 Tue Dec 10 21:58:30 2019 (r355600) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 27, 2016 +.Dd December 10, 2019 .Dt TIMEOUT 9 .Os .Sh NAME @@ -62,8 +62,10 @@ .Nd execute a function after a specified length of time .Sh SYNOPSIS .In sys/types.h +.In sys/callout.h .In sys/systm.h .Bd -literal +typedef void callout_func_t (void *); typedef void timeout_t (void *); .Ed .Ft int @@ -71,7 +73,7 @@ typedef void timeout_t (void *); .Ft void .Fn callout_deactivate "struct callout *c" .Ft int -.Fn callout_async_drain "struct callout *c" "timeout_t *drain" +.Fn callout_async_drain "struct callout *c" "callout_func_t *drain" .Ft int .Fn callout_drain "struct callout *c" .Ft void @@ -90,19 +92,24 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALI .Ft int .Fn callout_pending "struct callout *c" .Ft int -.Fn callout_reset "struct callout *c" "int ticks" "timeout_t *func" "void *arg" +.Fo callout_reset +.Fa "struct callout *c" +.Fa "int ticks" +.Fa "callout_func_t *func" +.Fa "void *arg" +.Fc .Ft int .Fo callout_reset_curcpu .Fa "struct callout *c" .Fa "int ticks" -.Fa "timeout_t *func" +.Fa "callout_func_t *func" .Fa "void *arg" .Fc .Ft int .Fo callout_reset_on .Fa "struct callout *c" .Fa "int ticks" -.Fa "timeout_t *func" +.Fa "callout_func_t *func" .Fa "void *arg" .Fa "int cpu" .Fc @@ -111,7 +118,7 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALI .Fa "struct callout *c" .Fa "sbintime_t sbt" .Fa "sbintime_t pr" -.Fa "timeout_t *func" +.Fa "callout_func_t *func" .Fa "void *arg" .Fa "int flags" .Fc @@ -120,7 +127,7 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALI .Fa "struct callout *c" .Fa "sbintime_t sbt" .Fa "sbintime_t pr" -.Fa "timeout_t *func" +.Fa "callout_func_t *func" .Fa "void *arg" .Fa "int flags" .Fc @@ -129,7 +136,7 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALI .Fa "struct callout *c" .Fa "sbintime_t sbt" .Fa "sbintime_t pr" -.Fa "timeout_t *func" +.Fa "callout_func_t *func" .Fa "void *arg" .Fa "int cpu" .Fa "int flags" Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Tue Dec 10 21:56:44 2019 (r355599) +++ head/sys/kern/kern_timeout.c Tue Dec 10 21:58:30 2019 (r355600) @@ -145,11 +145,11 @@ static u_int __read_mostly callwheelmask; */ struct cc_exec { struct callout *cc_curr; - void (*cc_drain)(void *); + callout_func_t *cc_drain; void *cc_last_func; void *cc_last_arg; #ifdef SMP - void (*ce_migration_func)(void *); + callout_func_t *ce_migration_func; void *ce_migration_arg; sbintime_t ce_migration_time; sbintime_t ce_migration_prec; @@ -656,7 +656,7 @@ softclock_call_cc(struct callout *c, struct callout_cp int direct) { struct rm_priotracker tracker; - void (*c_func)(void *); + callout_func_t *c_func, *drain; void *c_arg; struct lock_class *class; struct lock_object *c_lock; @@ -664,7 +664,7 @@ softclock_call_cc(struct callout *c, struct callout_cp int c_iflags; #ifdef SMP struct callout_cpu *new_cc; - void (*new_func)(void *); + callout_func_t *new_func; void *new_arg; int flags, new_cpu; sbintime_t new_prec, new_time; @@ -673,7 +673,7 @@ softclock_call_cc(struct callout *c, struct callout_cp sbintime_t sbt1, sbt2; struct timespec ts2; static sbintime_t maxdt = 2 * SBT_1MS; /* 2 msec */ - static timeout_t *lastfunc; + static callout_func_t *lastfunc; #endif KASSERT((c->c_iflags & CALLOUT_PENDING) == CALLOUT_PENDING, @@ -768,8 +768,6 @@ skip: KASSERT(cc_exec_curr(cc, direct) == c, ("mishandled cc_curr")); cc_exec_curr(cc, direct) = NULL; if (cc_exec_drain(cc, direct)) { - void (*drain)(void *); - drain = cc_exec_drain(cc, direct); cc_exec_drain(cc, direct) = NULL; CC_UNLOCK(cc); @@ -1031,7 +1029,7 @@ callout_when(sbintime_t sbt, sbintime_t precision, int */ int callout_reset_sbt_on(struct callout *c, sbintime_t sbt, sbintime_t prec, - void (*ftn)(void *), void *arg, int cpu, int flags) + callout_func_t *ftn, void *arg, int cpu, int flags) { sbintime_t to_sbt, precision; struct callout_cpu *cc; @@ -1190,7 +1188,7 @@ callout_schedule(struct callout *c, int to_ticks) } int -_callout_stop_safe(struct callout *c, int flags, void (*drain)(void *)) +_callout_stop_safe(struct callout *c, int flags, callout_func_t *drain) { struct callout_cpu *cc, *old_cc; struct lock_class *class; Modified: head/sys/sys/_callout.h ============================================================================== --- head/sys/sys/_callout.h Tue Dec 10 21:56:44 2019 (r355599) +++ head/sys/sys/_callout.h Tue Dec 10 21:58:30 2019 (r355600) @@ -48,6 +48,8 @@ LIST_HEAD(callout_list, callout); SLIST_HEAD(callout_slist, callout); TAILQ_HEAD(callout_tailq, callout); +typedef void callout_func_t(void *); + struct callout { union { LIST_ENTRY(callout) le; @@ -57,7 +59,7 @@ struct callout { sbintime_t c_time; /* ticks to the event */ sbintime_t c_precision; /* delta allowed wrt opt */ void *c_arg; /* function argument */ - void (*c_func)(void *); /* function to call */ + callout_func_t *c_func; /* function to call */ struct lock_object *c_lock; /* lock to handle */ short c_flags; /* User State */ short c_iflags; /* Internal State */ From owner-svn-src-all@freebsd.org Tue Dec 10 22:06:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FED21E59A7; Tue, 10 Dec 2019 22:06:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47XZ0f101cz4M9t; Tue, 10 Dec 2019 22:06:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D0D115DC; Tue, 10 Dec 2019 22:06:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBAM6vSC081194; Tue, 10 Dec 2019 22:06:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAM6sIa081174; Tue, 10 Dec 2019 22:06:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912102206.xBAM6sIa081174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 10 Dec 2019 22:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355601 - in head/sys: cam cam/ata cam/scsi dev/aic7xxx dev/isp dev/kbdmux dev/mpt dev/ocs_fc dev/ppbus dev/sbni dev/smc dev/syscons dev/uart netgraph/netflow netinet X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: cam cam/ata cam/scsi dev/aic7xxx dev/isp dev/kbdmux dev/mpt dev/ocs_fc dev/ppbus dev/sbni dev/smc dev/syscons dev/uart netgraph/netflow netinet X-SVN-Commit-Revision: 355601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 22:06:58 -0000 Author: jhb Date: Tue Dec 10 22:06:53 2019 New Revision: 355601 URL: https://svnweb.freebsd.org/changeset/base/355601 Log: Use callout_func_t instead of the deprecated timeout_t. Reviewed by: kib, imp Differential Revision: https://reviews.freebsd.org/D22752 Modified: head/sys/cam/ata/ata_da.c head/sys/cam/cam_xpt.c head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_da.c head/sys/dev/aic7xxx/aic_osm_lib.h head/sys/dev/isp/isp_freebsd.c head/sys/dev/kbdmux/kbdmux.c head/sys/dev/mpt/mpt_cam.c head/sys/dev/mpt/mpt_raid.c head/sys/dev/ocs_fc/ocs_os.c head/sys/dev/ppbus/lpt.c head/sys/dev/sbni/if_sbni.c head/sys/dev/smc/if_smc.c head/sys/dev/syscons/syscons.c head/sys/dev/uart/uart_core.c head/sys/netgraph/netflow/ng_netflow.h head/sys/netinet/tcp_timer.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/cam/ata/ata_da.c Tue Dec 10 22:06:53 2019 (r355601) @@ -825,7 +825,7 @@ static void adadone(struct cam_periph *periph, union ccb *done_ccb); static int adaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags); -static timeout_t adasendorderedtag; +static callout_func_t adasendorderedtag; static void adashutdown(void *arg, int howto); static void adasuspend(void *arg); static void adaresume(void *arg); Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/cam/cam_xpt.c Tue Dec 10 22:06:53 2019 (r355601) @@ -247,7 +247,7 @@ static union ccb *xpt_get_ccb_nowait(struct cam_periph static void xpt_run_allocq(struct cam_periph *periph, int sleep); static void xpt_run_allocq_task(void *context, int pending); static void xpt_run_devq(struct cam_devq *devq); -static timeout_t xpt_release_devq_timeout; +static callout_func_t xpt_release_devq_timeout; static void xpt_release_simq_timeout(void *arg) __unused; static void xpt_acquire_bus(struct cam_eb *bus); static void xpt_release_bus(struct cam_eb *bus); Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/cam/scsi/scsi_cd.c Tue Dec 10 22:06:53 2019 (r355601) @@ -302,7 +302,7 @@ static int cdsendkey(struct cam_periph *periph, struct dvd_authinfo *authinfo); static int cdreaddvdstructure(struct cam_periph *periph, struct dvd_struct *dvdstruct); -static timeout_t cdmediapoll; +static callout_func_t cdmediapoll; static struct periph_driver cddriver = { Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/cam/scsi/scsi_da.c Tue Dec 10 22:06:53 2019 (r355601) @@ -1492,9 +1492,9 @@ static void dasetgeom(struct cam_periph *periph, uint uint64_t maxsector, struct scsi_read_capacity_data_long *rcaplong, size_t rcap_size); -static timeout_t dasendorderedtag; +static callout_func_t dasendorderedtag; static void dashutdown(void *arg, int howto); -static timeout_t damediapoll; +static callout_func_t damediapoll; #ifndef DA_DEFAULT_POLL_PERIOD #define DA_DEFAULT_POLL_PERIOD 3 Modified: head/sys/dev/aic7xxx/aic_osm_lib.h ============================================================================== --- head/sys/dev/aic7xxx/aic_osm_lib.h Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/dev/aic7xxx/aic_osm_lib.h Tue Dec 10 22:06:53 2019 (r355601) @@ -112,7 +112,7 @@ typedef struct callout aic_timer_t; /****************************** Error Recovery ********************************/ void aic_set_recoveryscb(struct aic_softc *aic, struct scb *scb); -timeout_t aic_platform_timeout; +callout_func_t aic_platform_timeout; int aic_spawn_recovery_thread(struct aic_softc *aic); void aic_terminate_recovery_thread(struct aic_softc *aic); Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/dev/isp/isp_freebsd.c Tue Dec 10 22:06:53 2019 (r355601) @@ -57,8 +57,8 @@ static void isp_loop_changed(ispsoftc_t *isp, int chan static d_ioctl_t ispioctl; static void isp_cam_async(void *, uint32_t, struct cam_path *, void *); static void isp_poll(struct cam_sim *); -static timeout_t isp_watchdog; -static timeout_t isp_gdt; +static callout_func_t isp_watchdog; +static callout_func_t isp_gdt; static task_fn_t isp_gdt_task; static void isp_kthread(void *); static void isp_action(struct cam_sim *, union ccb *); @@ -764,8 +764,8 @@ static cam_status create_lun_state(ispsoftc_t *, int, static void destroy_lun_state(ispsoftc_t *, int, tstate_t *); static void isp_enable_lun(ispsoftc_t *, union ccb *); static void isp_disable_lun(ispsoftc_t *, union ccb *); -static timeout_t isp_refire_putback_atio; -static timeout_t isp_refire_notify_ack; +static callout_func_t isp_refire_putback_atio; +static callout_func_t isp_refire_notify_ack; static void isp_complete_ctio(union ccb *); static void isp_target_putback_atio(union ccb *); enum Start_Ctio_How { FROM_CAM, FROM_TIMER, FROM_SRR, FROM_CTIO_DONE }; Modified: head/sys/dev/kbdmux/kbdmux.c ============================================================================== --- head/sys/dev/kbdmux/kbdmux.c Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/dev/kbdmux/kbdmux.c Tue Dec 10 22:06:53 2019 (r355601) @@ -185,7 +185,7 @@ typedef struct kbdmux_state kbdmux_state_t; *****************************************************************************/ static task_fn_t kbdmux_kbd_intr; -static timeout_t kbdmux_kbd_intr_timo; +static callout_func_t kbdmux_kbd_intr_timo; static kbd_callback_func_t kbdmux_kbd_event; static void Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/dev/mpt/mpt_cam.c Tue Dec 10 22:06:53 2019 (r355601) @@ -113,7 +113,7 @@ __FBSDID("$FreeBSD$"); #include static void mpt_poll(struct cam_sim *); -static timeout_t mpt_timeout; +static callout_func_t mpt_timeout; static void mpt_action(struct cam_sim *, union ccb *); static int mpt_get_spi_settings(struct mpt_softc *, struct ccb_trans_settings *); Modified: head/sys/dev/mpt/mpt_raid.c ============================================================================== --- head/sys/dev/mpt/mpt_raid.c Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/dev/mpt/mpt_raid.c Tue Dec 10 22:06:53 2019 (r355601) @@ -107,7 +107,7 @@ static int mpt_raid_reply_frame_handler(struct mpt_sof static int mpt_spawn_raid_thread(struct mpt_softc *mpt); static void mpt_terminate_raid_thread(struct mpt_softc *mpt); static void mpt_raid_thread(void *arg); -static timeout_t mpt_raid_timer; +static callout_func_t mpt_raid_timer; #if 0 static void mpt_enable_vol(struct mpt_softc *mpt, struct mpt_raid_volume *mpt_vol, int enable); Modified: head/sys/dev/ocs_fc/ocs_os.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_os.c Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/dev/ocs_fc/ocs_os.c Tue Dec 10 22:06:53 2019 (r355601) @@ -45,7 +45,7 @@ static MALLOC_DEFINE(M_OCS, "OCS", "OneCore Storage da #include -timeout_t __ocs_callout; +callout_func_t __ocs_callout; uint32_t ocs_config_read32(ocs_os_handle_t os, uint32_t reg) Modified: head/sys/dev/ppbus/lpt.c ============================================================================== --- head/sys/dev/ppbus/lpt.c Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/dev/ppbus/lpt.c Tue Dec 10 22:06:53 2019 (r355601) @@ -140,7 +140,7 @@ struct lpt_data { #define LPT_NAME "lpt" /* our official name */ -static timeout_t lptout; +static callout_func_t lptout; static int lpt_port_test(device_t dev, u_char data, u_char mask); static int lpt_detect(device_t dev); Modified: head/sys/dev/sbni/if_sbni.c ============================================================================== --- head/sys/dev/sbni/if_sbni.c Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/dev/sbni/if_sbni.c Tue Dec 10 22:06:53 2019 (r355601) @@ -116,7 +116,7 @@ static void send_frame_header(struct sbni_softc *, u_i static void set_initial_values(struct sbni_softc *, struct sbni_flags); static u_int32_t calc_crc32(u_int32_t, caddr_t, u_int); -static timeout_t sbni_timeout; +static callout_func_t sbni_timeout; static __inline u_char sbni_inb(struct sbni_softc *, enum sbni_reg); static __inline void sbni_outb(struct sbni_softc *, enum sbni_reg, u_char); Modified: head/sys/dev/smc/if_smc.c ============================================================================== --- head/sys/dev/smc/if_smc.c Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/dev/smc/if_smc.c Tue Dec 10 22:06:53 2019 (r355601) @@ -122,7 +122,7 @@ static void smc_task_rx(void *, int); static void smc_task_tx(void *, int); static driver_filter_t smc_intr; -static timeout_t smc_watchdog; +static callout_func_t smc_watchdog; #ifdef DEVICE_POLLING static poll_handler_t smc_poll; #endif Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/dev/syscons/syscons.c Tue Dec 10 22:06:53 2019 (r355601) @@ -199,7 +199,7 @@ static void sc_puts(scr_stat *scp, u_char *buf, int le static void sccnupdate(scr_stat *scp); static scr_stat *alloc_scp(sc_softc_t *sc, int vty); static void init_scp(sc_softc_t *sc, int vty, scr_stat *scp); -static timeout_t scrn_timer; +static callout_func_t scrn_timer; static int and_region(int *s1, int *e1, int s2, int e2); static void scrn_update(scr_stat *scp, int show_cursor); @@ -232,7 +232,7 @@ static int save_kbd_state(scr_stat *scp); static int update_kbd_state(scr_stat *scp, int state, int mask); static int update_kbd_leds(scr_stat *scp, int which); static int sc_kattr(void); -static timeout_t blink_screen; +static callout_func_t blink_screen; static struct tty *sc_alloc_tty(int, int); static cn_probe_t sc_cnprobe; Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/dev/uart/uart_core.c Tue Dec 10 22:06:53 2019 (r355601) @@ -447,7 +447,7 @@ uart_intr(void *arg) if (sc->sc_polled) { callout_reset(&sc->sc_timer, hz / uart_poll_freq, - (timeout_t *)uart_intr, sc); + (callout_func_t *)uart_intr, sc); } return ((cnt == 0) ? FILTER_STRAY : @@ -712,7 +712,7 @@ uart_bus_attach(device_t dev) sc->sc_polled = 1; callout_init(&sc->sc_timer, 1); callout_reset(&sc->sc_timer, hz / uart_poll_freq, - (timeout_t *)uart_intr, sc); + (callout_func_t *)uart_intr, sc); } if (bootverbose && (sc->sc_fastintr || sc->sc_polled)) { Modified: head/sys/netgraph/netflow/ng_netflow.h ============================================================================== --- head/sys/netgraph/netflow/ng_netflow.h Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/netgraph/netflow/ng_netflow.h Tue Dec 10 22:06:53 2019 (r355601) @@ -522,7 +522,7 @@ void ng_netflow_cache_flush(priv_p); int ng_netflow_fib_init(priv_p priv, int fib); void ng_netflow_copyinfo(priv_p, struct ng_netflow_info *); void ng_netflow_copyv9info(priv_p, struct ng_netflow_v9info *); -timeout_t ng_netflow_expire; +callout_func_t ng_netflow_expire; int ng_netflow_flow_add(priv_p, fib_export_p, struct ip *, caddr_t, uint8_t, uint8_t, unsigned int); int ng_netflow_flow6_add(priv_p, fib_export_p, struct ip6_hdr *, caddr_t, Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Tue Dec 10 21:58:30 2019 (r355600) +++ head/sys/netinet/tcp_timer.c Tue Dec 10 22:06:53 2019 (r355601) @@ -839,7 +839,7 @@ void tcp_timer_activate(struct tcpcb *tp, uint32_t timer_type, u_int delta) { struct callout *t_callout; - timeout_t *f_callout; + callout_func_t *f_callout; struct inpcb *inp = tp->t_inpcb; int cpu = inp_to_cpuid(inp); From owner-svn-src-all@freebsd.org Tue Dec 10 22:10:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DB6B1E5A6F; Tue, 10 Dec 2019 22:10:26 +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 47XZ4f1sb6z4MP8; Tue, 10 Dec 2019 22:10:26 +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 3B3D015E8; Tue, 10 Dec 2019 22:10:26 +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 xBAMAQo3081444; Tue, 10 Dec 2019 22:10:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBAMAQSk081443; Tue, 10 Dec 2019 22:10:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201912102210.xBAMAQSk081443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 10 Dec 2019 22:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355602 - head/lib/clang/libllvm X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/clang/libllvm X-SVN-Commit-Revision: 355602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 22:10:26 -0000 Author: dim Date: Tue Dec 10 22:10:25 2019 New Revision: 355602 URL: https://svnweb.freebsd.org/changeset/base/355602 Log: Add a few missed source files to libllvm, for the MK_LLVM_TARGET_BPF=yes case. Otherwise, linking of clang and other llvm based executables would complain about missing symbols. Reported by: rstone MFC after: 1 month X-MFC-With: r353358 Modified: head/lib/clang/libllvm/Makefile Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Tue Dec 10 22:06:53 2019 (r355601) +++ head/lib/clang/libllvm/Makefile Tue Dec 10 22:10:25 2019 (r355602) @@ -1046,6 +1046,7 @@ SRCS_MIN+= Target/ARM/Utils/ARMBaseInfo.cpp .endif # MK_LLVM_TARGET_ARM .if ${MK_LLVM_TARGET_BPF} != "no" SRCS_MIN+= Target/BPF/AsmParser/BPFAsmParser.cpp +SRCS_MIN+= Target/BPF/BPFAbstractMemberAccess.cpp SRCS_MIN+= Target/BPF/BPFAsmPrinter.cpp SRCS_MIN+= Target/BPF/BPFFrameLowering.cpp SRCS_MIN+= Target/BPF/BPFISelDAGToDAG.cpp @@ -1054,6 +1055,7 @@ SRCS_MIN+= Target/BPF/BPFInstrInfo.cpp SRCS_MIN+= Target/BPF/BPFMCInstLower.cpp SRCS_MIN+= Target/BPF/BPFMIChecking.cpp SRCS_MIN+= Target/BPF/BPFMIPeephole.cpp +SRCS_MIN+= Target/BPF/BPFMISimplifyPatchable.cpp SRCS_MIN+= Target/BPF/BPFRegisterInfo.cpp SRCS_MIN+= Target/BPF/BPFSelectionDAGInfo.cpp SRCS_MIN+= Target/BPF/BPFSubtarget.cpp From owner-svn-src-all@freebsd.org Tue Dec 10 22:11:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E8671E5C02; Tue, 10 Dec 2019 22:11:29 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47XZ5s3kLrz4Mbd; Tue, 10 Dec 2019 22:11:29 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 7E3602601D2; Tue, 10 Dec 2019 23:10:54 +0100 (CET) Subject: Re: svn commit: r355600 - in head: share/man/man9 sys/kern sys/sys To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912102158.xBALwUF9075354@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <3cc78418-6692-058c-eba5-1edc5286aeab@selasky.org> Date: Tue, 10 Dec 2019 23:09:41 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <201912102158.xBALwUF9075354@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47XZ5s3kLrz4Mbd X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 22:11:29 -0000 On 2019-12-10 22:58, John Baldwin wrote: > While here, add to the manpage. FYI: Linux guys eliminated the "void *c_arg" in their timer implementation by using container_of() to get callback argument. We could possibly do the same! --HPS From owner-svn-src-all@freebsd.org Tue Dec 10 22:47:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 132A21E6576; Tue, 10 Dec 2019 22:47:39 +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 47XZvZ6dsgz4PZv; Tue, 10 Dec 2019 22:47:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-6.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 7104AB51D; Tue, 10 Dec 2019 22:47:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r355600 - in head: share/man/man9 sys/kern sys/sys To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912102158.xBALwUF9075354@repo.freebsd.org> <3cc78418-6692-058c-eba5-1edc5286aeab@selasky.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Tue, 10 Dec 2019 14:47:34 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <3cc78418-6692-058c-eba5-1edc5286aeab@selasky.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 22:47:39 -0000 On 12/10/19 2:09 PM, Hans Petter Selasky wrote: > On 2019-12-10 22:58, John Baldwin wrote: >> While here, add to the manpage. > > FYI: > > Linux guys eliminated the "void *c_arg" in their timer implementation by > using container_of() to get callback argument. We could possibly do the > same! You mean passing the pointer to the callout itself and using that to get to the relevant pointer? That seems less obvious from a code readability standpoint. We also don't actually guarantee that the 'struct callout' is still alive when the function is called currently (hence the need for the local variables that store a copy of the fields). -- John Baldwin From owner-svn-src-all@freebsd.org Tue Dec 10 23:41:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B75AA1E71FE; Tue, 10 Dec 2019 23:41:04 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47Xc5D4QFJz4RYj; Tue, 10 Dec 2019 23:41:03 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (v-critter.freebsd.dk [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by phk.freebsd.dk (Postfix) with ESMTPS id 95ED81AF12F; Tue, 10 Dec 2019 23:40:55 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id xBANet0b025030 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 10 Dec 2019 23:40:55 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id xBANes1p025029; Tue, 10 Dec 2019 23:40:54 GMT (envelope-from phk) To: John Baldwin cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355600 - in head: share/man/man9 sys/kern sys/sys In-reply-to: From: "Poul-Henning Kamp" References: <201912102158.xBALwUF9075354@repo.freebsd.org> <3cc78418-6692-058c-eba5-1edc5286aeab@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25027.1576021254.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Tue, 10 Dec 2019 23:40:54 +0000 Message-ID: <25028.1576021254@critter.freebsd.dk> X-Rspamd-Queue-Id: 47Xc5D4QFJz4RYj X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 23:41:04 -0000 -------- In message , John Baldwi= n writes: >On 12/10/19 2:09 PM, Hans Petter Selasky wrote: >> On 2019-12-10 22:58, John Baldwin wrote: >>> While here, add to the manpage. >> = >> FYI: >> = >> Linux guys eliminated the "void *c_arg" in their timer implementation b= y = >> using container_of() to get callback argument. We could possibly do the= = >> same! > >You mean passing the pointer to the callout itself and using that to get = to the >relevant pointer? Before we start using macro-magic of that caliber, we should consider how/if it will impact the strength of static analysis. -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= . From owner-svn-src-all@freebsd.org Wed Dec 11 06:30:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E679A1CDF72; Wed, 11 Dec 2019 06:30:27 +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 47Xn9b5nWSz3FGj; Wed, 11 Dec 2019 06:30:27 +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 C0EDC71D9; Wed, 11 Dec 2019 06:30:27 +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 xBB6URou074349; Wed, 11 Dec 2019 06:30:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBB6UQrB074342; Wed, 11 Dec 2019 06:30:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201912110630.xBB6UQrB074342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 11 Dec 2019 06:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355603 - in stable/12: contrib/expat contrib/expat/doc contrib/expat/examples contrib/expat/lib contrib/expat/tests contrib/expat/tests/benchmark contrib/expat/xmlwf lib/libexpat X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/12: contrib/expat contrib/expat/doc contrib/expat/examples contrib/expat/lib contrib/expat/tests contrib/expat/tests/benchmark contrib/expat/xmlwf lib/libexpat X-SVN-Commit-Revision: 355603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 06:30:28 -0000 Author: delphij Date: Wed Dec 11 06:30:26 2019 New Revision: 355603 URL: https://svnweb.freebsd.org/changeset/base/355603 Log: MFC r340127,340133,355085: libbsdxml (expat) 2.2.9. Added: stable/12/contrib/expat/AUTHORS - copied unchanged from r340127, head/contrib/expat/AUTHORS stable/12/contrib/expat/Makefile.am - copied, changed from r340127, head/contrib/expat/Makefile.am stable/12/contrib/expat/README.md - copied, changed from r340127, head/contrib/expat/README.md stable/12/contrib/expat/doc/Makefile.am - copied, changed from r340127, head/contrib/expat/doc/Makefile.am stable/12/contrib/expat/doc/Makefile.in - copied, changed from r340127, head/contrib/expat/doc/Makefile.in stable/12/contrib/expat/examples/Makefile.am - copied unchanged from r340127, head/contrib/expat/examples/Makefile.am stable/12/contrib/expat/examples/Makefile.in - copied, changed from r340127, head/contrib/expat/examples/Makefile.in stable/12/contrib/expat/fix-xmltest-log.sh - copied unchanged from r355085, head/contrib/expat/fix-xmltest-log.sh stable/12/contrib/expat/lib/Makefile.am - copied, changed from r340127, head/contrib/expat/lib/Makefile.am stable/12/contrib/expat/lib/Makefile.in - copied, changed from r340127, head/contrib/expat/lib/Makefile.in stable/12/contrib/expat/lib/loadlibrary.c - copied unchanged from r340127, head/contrib/expat/lib/loadlibrary.c stable/12/contrib/expat/lib/siphash.h - copied, changed from r340127, head/contrib/expat/lib/siphash.h stable/12/contrib/expat/run.sh.in - copied unchanged from r340127, head/contrib/expat/run.sh.in stable/12/contrib/expat/test-driver-wrapper.sh - copied, changed from r340127, head/contrib/expat/test-driver-wrapper.sh stable/12/contrib/expat/tests/Makefile.am - copied unchanged from r340127, head/contrib/expat/tests/Makefile.am stable/12/contrib/expat/tests/Makefile.in - copied, changed from r340127, head/contrib/expat/tests/Makefile.in stable/12/contrib/expat/tests/benchmark/Makefile.am - copied unchanged from r340127, head/contrib/expat/tests/benchmark/Makefile.am stable/12/contrib/expat/tests/benchmark/Makefile.in - copied, changed from r340127, head/contrib/expat/tests/benchmark/Makefile.in stable/12/contrib/expat/tests/benchmark/benchmark.sln - copied unchanged from r340127, head/contrib/expat/tests/benchmark/benchmark.sln stable/12/contrib/expat/tests/memcheck.c - copied, changed from r340127, head/contrib/expat/tests/memcheck.c stable/12/contrib/expat/tests/memcheck.h - copied, changed from r340127, head/contrib/expat/tests/memcheck.h stable/12/contrib/expat/tests/runtests.sln - copied unchanged from r340127, head/contrib/expat/tests/runtests.sln stable/12/contrib/expat/tests/structdata.c - copied, changed from r340127, head/contrib/expat/tests/structdata.c stable/12/contrib/expat/tests/structdata.h - copied, changed from r340127, head/contrib/expat/tests/structdata.h stable/12/contrib/expat/tests/udiffer.py - copied unchanged from r340127, head/contrib/expat/tests/udiffer.py stable/12/contrib/expat/tests/xmltest.log.expected - copied unchanged from r340127, head/contrib/expat/tests/xmltest.log.expected stable/12/contrib/expat/xmlwf/Makefile.am - copied, changed from r340127, head/contrib/expat/xmlwf/Makefile.am stable/12/contrib/expat/xmlwf/Makefile.in - copied, changed from r340127, head/contrib/expat/xmlwf/Makefile.in stable/12/contrib/expat/xmlwf/xmlwf_helpgen.py - copied unchanged from r355085, head/contrib/expat/xmlwf/xmlwf_helpgen.py stable/12/contrib/expat/xmlwf/xmlwf_helpgen.sh - copied unchanged from r355085, head/contrib/expat/xmlwf/xmlwf_helpgen.sh Deleted: stable/12/contrib/expat/MANIFEST stable/12/contrib/expat/README Modified: stable/12/contrib/expat/COPYING (contents, props changed) stable/12/contrib/expat/Changes (contents, props changed) stable/12/contrib/expat/FREEBSD-Xlist (contents, props changed) stable/12/contrib/expat/Makefile.in (contents, props changed) stable/12/contrib/expat/configure.ac (contents, props changed) stable/12/contrib/expat/doc/reference.html (contents, props changed) stable/12/contrib/expat/doc/xmlwf.1 (contents, props changed) stable/12/contrib/expat/doc/xmlwf.xml (contents, props changed) stable/12/contrib/expat/examples/elements.c (contents, props changed) stable/12/contrib/expat/examples/outline.c (contents, props changed) stable/12/contrib/expat/expat_config.h.in (contents, props changed) stable/12/contrib/expat/lib/ascii.h (contents, props changed) stable/12/contrib/expat/lib/asciitab.h (contents, props changed) stable/12/contrib/expat/lib/expat.h (contents, props changed) stable/12/contrib/expat/lib/expat_external.h (contents, props changed) stable/12/contrib/expat/lib/iasciitab.h (contents, props changed) stable/12/contrib/expat/lib/internal.h (contents, props changed) stable/12/contrib/expat/lib/latin1tab.h (contents, props changed) stable/12/contrib/expat/lib/nametab.h (contents, props changed) stable/12/contrib/expat/lib/utf8tab.h (contents, props changed) stable/12/contrib/expat/lib/xmlparse.c (contents, props changed) stable/12/contrib/expat/lib/xmlrole.c (contents, props changed) stable/12/contrib/expat/lib/xmlrole.h (contents, props changed) stable/12/contrib/expat/lib/xmltok.c (contents, props changed) stable/12/contrib/expat/lib/xmltok.h (contents, props changed) stable/12/contrib/expat/lib/xmltok_impl.c (contents, props changed) stable/12/contrib/expat/lib/xmltok_impl.h (contents, props changed) stable/12/contrib/expat/lib/xmltok_ns.c (contents, props changed) stable/12/contrib/expat/tests/benchmark/benchmark.c (contents, props changed) stable/12/contrib/expat/tests/chardata.c (contents, props changed) stable/12/contrib/expat/tests/chardata.h (contents, props changed) stable/12/contrib/expat/tests/minicheck.c (contents, props changed) stable/12/contrib/expat/tests/minicheck.h (contents, props changed) stable/12/contrib/expat/tests/runtests.c (contents, props changed) stable/12/contrib/expat/tests/runtestspp.cpp (contents, props changed) stable/12/contrib/expat/tests/xmltest.sh (contents, props changed) stable/12/contrib/expat/xmlwf/codepage.c (contents, props changed) stable/12/contrib/expat/xmlwf/codepage.h (contents, props changed) stable/12/contrib/expat/xmlwf/ct.c (contents, props changed) stable/12/contrib/expat/xmlwf/filemap.h (contents, props changed) stable/12/contrib/expat/xmlwf/readfilemap.c (contents, props changed) stable/12/contrib/expat/xmlwf/unixfilemap.c (contents, props changed) stable/12/contrib/expat/xmlwf/win32filemap.c (contents, props changed) stable/12/contrib/expat/xmlwf/xmlfile.c (contents, props changed) stable/12/contrib/expat/xmlwf/xmlfile.h (contents, props changed) stable/12/contrib/expat/xmlwf/xmlmime.c (contents, props changed) stable/12/contrib/expat/xmlwf/xmlmime.h (contents, props changed) stable/12/contrib/expat/xmlwf/xmltchar.h (contents, props changed) stable/12/contrib/expat/xmlwf/xmlurl.h (contents, props changed) stable/12/contrib/expat/xmlwf/xmlwf.c (contents, props changed) stable/12/contrib/expat/xmlwf/xmlwin32url.cxx (contents, props changed) stable/12/lib/libexpat/expat_config.h stable/12/lib/libexpat/libbsdxml.3 Directory Properties: stable/12/ (props changed) stable/12/contrib/expat/doc/style.css (props changed) stable/12/contrib/expat/tests/README.txt (props changed) stable/12/contrib/expat/tests/benchmark/README.txt (props changed) Copied: stable/12/contrib/expat/AUTHORS (from r340127, head/contrib/expat/AUTHORS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/expat/AUTHORS Wed Dec 11 06:30:26 2019 (r355603, copy of r340127, head/contrib/expat/AUTHORS) @@ -0,0 +1,10 @@ +Expat is brought to you by: + +Clark Cooper +Fred L. Drake, Jr. +Greg Stein +James Clark +Karl Waclawek +Rhodri James +Sebastian Pipping +Steven Solie Modified: stable/12/contrib/expat/COPYING ============================================================================== --- stable/12/contrib/expat/COPYING Tue Dec 10 22:10:25 2019 (r355602) +++ stable/12/contrib/expat/COPYING Wed Dec 11 06:30:26 2019 (r355603) @@ -1,5 +1,5 @@ Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper -Copyright (c) 2001-2016 Expat maintainers +Copyright (c) 2001-2017 Expat maintainers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Modified: stable/12/contrib/expat/Changes ============================================================================== --- stable/12/contrib/expat/Changes Tue Dec 10 22:10:25 2019 (r355602) +++ stable/12/contrib/expat/Changes Wed Dec 11 06:30:26 2019 (r355603) @@ -1,3 +1,489 @@ +NOTE: We are looking for help with a few things: + https://github.com/libexpat/libexpat/labels/help%20wanted + If you can help, please get in touch. Thanks! + +Release 2.2.9 Wed Septemper 25 2019 + Other changes: + examples: Drop executable bits from elements.c + #349 Windows: Change the name of the Windows DLLs from expat*.dll + to libexpat*.dll once more (regression from 2.2.8, first + fixed in 1.95.3, issue #61 on SourceForge today, + was issue #432456 back then); needs a fix due + case-insensitive file systems on Windows and the fact that + Perl's XML::Parser::Expat compiles into Expat.dll. + #347 Windows: Only define _CRT_RAND_S if not defined + Version info bumped from 7:10:6 to 7:11:6 + + Special thanks to: + Ben Wagner + +Release 2.2.8 Fri Septemper 13 2019 + Security fixes: + #317 #318 CVE-2019-15903 -- Fix heap overflow triggered by + XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber), + and deny internal entities closing the doctype; + fixed in commit c20b758c332d9a13afbbb276d30db1d183a85d43 + + Bug fixes: + #240 Fix cases where XML_StopParser did not have any effect + when called from inside of an end element handler + #341 xmlwf: Fix exit code for operation without "-d DIRECTORY"; + previously, only "-d DIRECTORY" would give you a proper + exit code: + # xmlwf -d . <<<'' 2>/dev/null ; echo $? + 2 + # xmlwf <<<'' 2>/dev/null ; echo $? + 0 + Now both cases return exit code 2. + + Other changes: + #299 #302 Windows: Replace LoadLibrary hack to access + unofficial API function SystemFunction036 (RtlGenRandom) + by using official API function rand_s (needs WinXP+) + #325 Windows: Drop support for Visual Studio <=7.1/2003 + and document supported compilers in README.md + #286 Windows: Remove COM code from xmlwf; in case it turns + out needed later, there will be a dedicated repository + below https://github.com/libexpat/ for that code + #322 Windows: Remove explicit MSVC solution and project files. + You can generate Visual Studio solution files through + CMake, e.g.: cmake -G"Visual Studio 15 2017" . + #338 xmlwf: Make "xmlwf -h" help output more friendly + #339 examples: Improve elements.c + #244 #264 Autotools: Add argument --enable-xml-attr-info + #239 #301 Autotools: Add arguments + --with-getrandom + --without-getrandom + --with-sys-getrandom + --without-sys-getrandom + #312 #343 Autotools: Fix linking issues with "./configure LD=clang" + Autotools: Fix "make run-xmltest" for out-of-source builds + #329 #336 CMake: Pull all options from Expat <=2.2.7 into namespace + prefix EXPAT_ with the exception of DOCBOOK_TO_MAN: + - BUILD_doc -> EXPAT_BUILD_DOCS (plural) + - BUILD_examples -> EXPAT_BUILD_EXAMPLES + - BUILD_shared -> EXPAT_SHARED_LIBS + - BUILD_tests -> EXPAT_BUILD_TESTS + - BUILD_tools -> EXPAT_BUILD_TOOLS + - DOCBOOK_TO_MAN -> DOCBOOK_TO_MAN (unchanged) + - INSTALL -> EXPAT_ENABLE_INSTALL + - MSVC_USE_STATIC_CRT -> EXPAT_MSVC_STATIC_CRT + - USE_libbsd -> EXPAT_WITH_LIBBSD + - WARNINGS_AS_ERRORS -> EXPAT_WARNINGS_AS_ERRORS + - XML_CONTEXT_BYTES -> EXPAT_CONTEXT_BYTES + - XML_DEV_URANDOM -> EXPAT_DEV_URANDOM + - XML_DTD -> EXPAT_DTD + - XML_NS -> EXPAT_NS + - XML_UNICODE -> EXPAT_CHAR_TYPE=ushort (!) + - XML_UNICODE_WCHAR_T -> EXPAT_CHAR_TYPE=wchar_t (!) + #244 #264 CMake: Add argument -DEXPAT_ATTR_INFO=(ON|OFF), + default OFF + #326 CMake: Add argument -DEXPAT_LARGE_SIZE=(ON|OFF), + default OFF + #328 CMake: Add argument -DEXPAT_MIN_SIZE=(ON|OFF), + default OFF + #239 #277 CMake: Add arguments + -DEXPAT_WITH_GETRANDOM=(ON|OFF|AUTO), default AUTO + -DEXPAT_WITH_SYS_GETRANDOM=(ON|OFF|AUTO), default AUTO + #326 CMake: Install expat_config.h to include directory + #326 CMake: Generate and install configuration files for + future find_package(expat [..] CONFIG [..]) + CMake: Now produces a summary of applied configuration + CMake: Require C++ compiler only when tests are enabled + #330 CMake: Fix compilation for 16bit character types, + i.e. ex -DXML_UNICODE=ON (and ex -DXML_UNICODE_WCHAR_T=ON) + #265 CMake: Fix linking with MinGW + #330 CMake: Add full support for MinGW; to enable, use + -DCMAKE_TOOLCHAIN_FILE=[expat]/cmake/mingw-toolchain.cmake + #330 CMake: Port "make run-xmltest" from GNU Autotools to CMake + #316 CMake: Windows: Make binary postfix match MSVC + Old: expat[d].lib + New: expat[w][d][MD|MT].lib + CMake: Migrate files from Windows to Unix line endings + #308 CMake: Integrate OSS-Fuzz fuzzers, option + -DEXPAT_BUILD_FUZZERS=(ON|OFF), default OFF + #14 Drop an OpenVMS support leftover + #235 #268 .. + #270 #310 .. + #313 #331 #333 Address compiler warnings + #282 #283 .. + #284 #285 Address cppcheck warnings + #294 #295 Address Clang Static Analyzer warnings + #24 #293 Mass-apply clang-format 9 (and ensure conformance during CI) + Version info bumped from 7:9:6 to 7:10:6 + + Special thanks to: + David Loffredo + Joonun Jang + Khajapasha Mohammed + Kishore Kunche + Marco Maggi + Mitch Phillips + Rolf Ade + xantares + Zhongyuan Zhou + +Release 2.2.7 Wed June 19 2019 + Security fixes: + #186 #262 CVE-2018-20843 -- Fix extraction of namespace prefixes from + XML names; XML names with multiple colons could end up in + the wrong namespace, and take a high amount of RAM and CPU + resources while processing, opening the door to + use for denial-of-service attacks + + Other changes: + #195 #197 Autotools/CMake: Utilize -fvisibility=hidden to stop + exporting non-API symbols + #227 Autotools: Add --without-examples and --without-tests + #228 Autotools: Modernize configure.ac + #245 #246 Autotools: Fix check for -fvisibility=hidden for Clang + #247 #248 Autotools: Fix compilation for lack of docbook2x-man + #236 #258 Autotools: Produce .tar.{gz,lz,xz} release archives + #212 CMake: Make libdir of pkgconfig expat.pc support multilib + #158 #263 CMake: Build man page in PROJECT_BINARY_DIR not _SOURCE_DIR + #219 Remove fallback to bcopy, assume that memmove(3) exists + #257 Use portable "/usr/bin/env bash" shebang (e.g. for OpenBSD) + #243 Windows: Fix syntax of .def module definition files + Version info bumped from 7:8:6 to 7:9:6 + + Special thanks to: + Benjamin Peterson + Caolán McNamara + Hanno Böck + KangLin + Kishore Kunche + Marco Maggi + Rhodri James + Sebastian Dröge + userwithuid + Yury Gribov + +Release 2.2.6 Sun August 12 2018 + Bug fixes: + #170 #206 Avoid doing arithmetic with NULL pointers in XML_GetBuffer + #204 #205 Fix 2.2.5 regression with suspend-resume while parsing + a document like '' + + Other changes: + #165 #168 Autotools: Fix docbook-related configure syntax error + #166 Autotools: Avoid grep option `-q` for Solaris + #167 Autotools: Support + ./configure DOCBOOK_TO_MAN="xmlto man --skip-validation" + #159 #167 Autotools: Support DOCBOOK_TO_MAN command which produces + xmlwf.1 rather than XMLWF.1; also covers case insensitive + file systems + #181 Autotools: Drop -rpath option passed to libtool + #188 Autotools: Detect and deny SGML docbook2man as ours is XML + #188 Autotools/CMake: Support command db2x_docbook2man as well + #174 CMake: Introduce option WARNINGS_AS_ERRORS, defaults to OFF + #184 #185 CMake: Introduce option MSVC_USE_STATIC_CRT, defaults to OFF + #207 #208 CMake: Introduce option XML_UNICODE and XML_UNICODE_WCHAR_T, + both defaulting to OFF + #175 CMake: Prefer check_symbol_exists over check_function_exists + #176 CMake: Create the same pkg-config file as with GNU Autotools + #178 #179 CMake: Use GNUInstallDirs module to set proper defaults for + install directories + #208 CMake: Utilize expat_config.h.cmake for XML_DEV_URANDOM + #180 Windows: Fix compilation of test suite for Visual Studio 2008 + #131 #173 #202 Address compiler warnings + #187 #190 #200 Fix miscellaneous typos + Version info bumped from 7:7:6 to 7:8:6 + + Special thanks to: + Anton Maklakov + Benjamin Peterson + Brad King + Franek Korta + Frank Rast + Joe Orton + luzpaz + Pedro Vicente + Rainer Jung + Rhodri James + Rolf Ade + Rolf Eike Beer + Thomas Beutlich + Tomasz KÅ‚oczko + +Release 2.2.5 Tue October 31 2017 + Bug fixes: + #8 If the parser runs out of memory, make sure its internal + state reflects the memory it actually has, not the memory + it wanted to have. + #11 The default handler wasn't being called when it should for + a SYSTEM or PUBLIC doctype if an entity declaration handler + was registered. + #137 #138 Fix a case of mistakenly reported parsing success where + XML_StopParser was called from an element handler + #162 Function XML_ErrorString was returning NULL rather than + a message for code XML_ERROR_INVALID_ARGUMENT + introduced with release 2.2.1 + + Other changes: + #106 xmlwf: Add argument -N adding notation declarations + #75 #106 Test suite: Resolve expected failure cases where xmlwf + output was incomplete + #127 Windows: Fix test suite compilation + #126 #127 Windows: Fix compilation for Visual Studio 2012 + Windows: Upgrade shipped project files to Visual Studio 2017 + #33 #132 tests: Mass-fix compilation for XML_UNICODE_WCHAR_T + #129 examples: Fix compilation for XML_UNICODE_WCHAR_T + #130 benchmark: Fix compilation for XML_UNICODE_WCHAR_T + #144 xmlwf: Fix compilation for XML_UNICODE_WCHAR_T; still needs + Windows or MinGW for 2-byte wchar_t + #9 Address two Clang Static Analyzer false positives + #59 Resolve troublesome macros hiding parser struct membership + and dereferencing that pointer + #6 Resolve superfluous internal malloc/realloc switch + #153 #155 Improve docbook2x-man detection + #160 Undefine NDEBUG in the test suite (rather than rejecting it) + #161 Address compiler warnings + Version info bumped from 7:6:6 to 7:7:6 + + Special thanks to: + Benbuck Nason + Hans Wennborg + José Gutiérrez de la Concha + Pedro Monreal Gonzalez + Rhodri James + Rolf Ade + Stephen Groat + and + Core Infrastructure Initiative + +Release 2.2.4 Sat August 19 2017 + Bug fixes: + #115 Fix copying of partial characters for UTF-8 input + + Other changes: + #109 Fix "make check" for non-x86 architectures that default + to unsigned type char (-128..127 rather than 0..255) + #109 coverage.sh: Cover -funsigned-char + Autotools: Introduce --without-xmlwf argument + #65 Autotools: Replace handwritten Makefile with GNU Automake + #43 CMake: Auto-detect high quality entropy extractors, add new + option USE_libbsd=ON to use arc4random_buf of libbsd + #74 CMake: Add -fno-strict-aliasing only where supported + #114 CMake: Always honor manually set BUILD_* options + #114 CMake: Compile man page if docbook2x-man is available, only + #117 Include file tests/xmltest.log.expected in source tarball + (required for "make run-xmltest") + #117 Include (existing) Visual Studio 2013 files in source tarball + Improve test suite error output + #111 Fix some typos in documentation + Version info bumped from 7:5:6 to 7:6:6 + + Special thanks to: + Jakub Wilk + Joe Orton + Lin Tian + Rolf Eike Beer + +Release 2.2.3 Wed August 2 2017 + Security fixes: + #82 CVE-2017-11742 -- Windows: Fix DLL hijacking vulnerability + using Steve Holme's LoadLibrary wrapper for/of cURL + + Bug fixes: + #85 Fix a dangling pointer issue related to realloc + + Other changes: + Increase code coverage + #91 Linux: Allow getrandom to fail if nonblocking pool has not + yet been initialized and read /dev/urandom then, instead. + This is in line with what recent Python does. + #81 Pre-10.7/Lion macOS: Support entropy from arc4random + #86 Check that a UTF-16 encoding in an XML declaration has the + right endianness + #4 #5 #7 Recover correctly when some reallocations fail + Repair "./configure && make" for systems without any + provider of high quality entropy + and try reading /dev/urandom on those + Ensure that user-defined character encodings have converter + functions when they are needed + Fix mis-leading description of argument -c in xmlwf.1 + Rely on macro HAVE_ARC4RANDOM_BUF (rather than __CloudABI__) + for CloudABI + #100 Fix use of SIPHASH_MAIN in siphash.h + #23 Test suite: Fix memory leaks + Version info bumped from 7:4:6 to 7:5:6 + + Special thanks to: + Chanho Park + Joe Orton + Pascal Cuoq + Rhodri James + Simon McVittie + Vadim Zeitlin + Viktor Szakats + and + Core Infrastructure Initiative + +Release 2.2.2 Wed July 12 2017 + Security fixes: + #43 Protect against compilation without any source of high + quality entropy enabled, e.g. with CMake build system; + commit ff0207e6076e9828e536b8d9cd45c9c92069b895 + #60 Windows with _UNICODE: + Unintended use of LoadLibraryW with a non-wide string + resulted in failure to load advapi32.dll and degradation + in quality of used entropy when compiled with _UNICODE for + Windows; you can launch existing binaries with + EXPAT_ENTROPY_DEBUG=1 in the environment to inspect the + quality of entropy used during runtime; commits + * 95b95032f907ef1cd17ee7a9a1768010a825d61d + * 73a5a2e9c081f49f2d775cf7ced864158b68dc80 + [MOX-006] Fix non-NULL parser parameter validation in XML_Parse; + resulted in NULL dereference, previously; + commit ac256dafdffc9622ab0dc2c62fcecb0dfcfa71fe + + Bug fixes: + #69 Fix improper use of unsigned long long integer literals + + Other changes: + #73 Start requiring a C99 compiler + #49 Fix "==" Bashism in configure script + #50 Fix too eager getrandom detection for Debian GNU/kFreeBSD + #52 and macOS + #51 Address lack of stdint.h in Visual Studio 2003 to 2008 + #58 Address compile warnings + #68 Fix "./buildconf.sh && ./configure" for some versions + of Dash for /bin/sh + #72 CMake: Ease use of Expat in context of a parent project + with multiple CMakeLists.txt files + #72 CMake: Resolve mistaken executable permissions + #76 Address compile warning with -DNDEBUG (not recommended!) + #77 Address compile warning about macro redefinition + + Special thanks to: + Alexander Bluhm + Ben Boeckel + Cătălin Răceanu + Kerin Millar + László Böszörményi + S. P. Zeidler + Segev Finer + Václav Slavík + Victor Stinner + Viktor Szakats + and + Radically Open Security + +Release 2.2.1 Sat June 17 2017 + Security fixes: + CVE-2017-9233 -- External entity infinite loop DoS + Details: https://libexpat.github.io/doc/cve-2017-9233/ + Commit c4bf96bb51dd2a1b0e185374362ee136fe2c9d7f + [MOX-002] CVE-2016-9063 -- Detect integer overflow; commit + d4f735b88d9932bd5039df2335eefdd0723dbe20 + (Fixed version of existing downstream patches!) + (SF.net) #539 Fix regression from fix to CVE-2016-0718 cutting off + longer tag names; commits + * 896b6c1fd3b842f377d1b62135dccf0a579cf65d + * af507cef2c93cb8d40062a0abe43a4f4e9158fb2 + #16 * 0dbbf43fdb20f593ddf4fa1ff67288000dd4a7fd + #25 More integer overflow detection (function poolGrow); commits + * 810b74e4703dcfdd8f404e3cb177d44684775143 + * 44178553f3539ce69d34abee77a05e879a7982ac + [MOX-002] Detect overflow from len=INT_MAX call to XML_Parse; commits + * 4be2cb5afcc018d996f34bbbce6374b7befad47f + * 7e5b71b748491b6e459e5c9a1d090820f94544d8 + [MOX-005] #30 Use high quality entropy for hash initialization: + * arc4random_buf on BSD, systems with libbsd + (when configured with --with-libbsd), CloudABI + * RtlGenRandom on Windows XP / Server 2003 and later + * getrandom on Linux 3.17+ + In a way, that's still part of CVE-2016-5300. + https://github.com/libexpat/libexpat/pull/30/commits + [MOX-005] For the low quality entropy extraction fallback code, + the parser instance address can no longer leak, commit + 04ad658bd3079dd15cb60fc67087900f0ff4b083 + [MOX-003] Prevent use of uninitialised variable; commit + [MOX-004] a4dc944f37b664a3ca7199c624a98ee37babdb4b + Add missing parameter validation to public API functions + and dedicated error code XML_ERROR_INVALID_ARGUMENT: + [MOX-006] * NULL checks; commits + * d37f74b2b7149a3a95a680c4c4cd2a451a51d60a (merge/many) + * 9ed727064b675b7180c98cb3d4f75efba6966681 + * 6a747c837c50114dfa413994e07c0ba477be4534 + * Negative length (XML_Parse); commit + [MOX-002] 70db8d2538a10f4c022655d6895e4c3e78692e7f + [MOX-001] #35 Change hash algorithm to William Ahern's version of SipHash + to go further with fixing CVE-2012-0876. + https://github.com/libexpat/libexpat/pull/39/commits + + Bug fixes: + #32 Fix sharing of hash salt across parsers; + relevant where XML_ExternalEntityParserCreate is called + prior to XML_Parse, in particular (e.g. FBReader) + #28 xmlwf: Auto-disable use of memory-mapping (and parsing + as a single chunk) for files larger than ~1 GB (2^30 bytes) + rather than failing with error "out of memory" + #3 Fix double free after malloc failure in DTD code; commit + 7ae9c3d3af433cd4defe95234eae7dc8ed15637f + #17 Fix memory leak on parser error for unbound XML attribute + prefix with new namespaces defined in the same tag; + found by Google's OSS-Fuzz; commits + * 16f87daae5a16132e479e4f71862128c7a915c73 + * b47dbc9745932c160893d433220e462bd605f8cd + xmlwf on Windows: Add missing calls to CloseHandle + + New features: + #30 Introduced environment switch EXPAT_ENTROPY_DEBUG=1 + for runtime debugging of entropy extraction + + Other changes: + Increase code coverage + #33 Reject use of XML_UNICODE_WCHAR_T with sizeof(wchar_t) != 2; + XML_UNICODE_WCHAR_T was never meant to be used outside + of Windows; 4-byte wchar_t is common on Linux + (SF.net) #538 Start using -fno-strict-aliasing + (SF.net) #540 Support compilation against cloudlibc of CloudABI + Allow MinGW cross-compilation + (SF.net) #534 CMake: Introduce option "BUILD_doc" (enabled by default) + to bypass compilation of the xmlwf.1 man page + (SF.net) pr2 CMake: Introduce option "INSTALL" (enabled by default) + to bypass installation of expat files + CMake: Fix ninja support + Autotools: Add parameters --enable-xml-context [COUNT] + and --disable-xml-context; default of context of 1024 + bytes enabled unchanged + #14 Drop AmigaOS 4.x code and includes + #14 Drop ancient build systems: + * Borland C++ Builder + * OpenVMS + * Open Watcom + * Visual Studio 6.0 + * Pre-X Mac OS (MPW Makefile) + If you happen to rely on some of these, please get in + touch for joining with maintenance. + #10 Move from WIN32 to _WIN32 + #13 Fix "make run-xmltest" order instability + Address compile warnings + Bump version info from 7:2:6 to 7:3:6 + Add AUTHORS file + + Infrastructure: + #1 Migrate from SourceForge to GitHub (except downloads): + https://github.com/libexpat/ + #1 Re-create http://libexpat.org/ project website + Start utilizing Travis CI + + Special thanks to: + Andy Wang + Don Lewis + Ed Schouten + Karl Waclawek + Pascal Cuoq + Rhodri James + Sergei Nikulov + Tobias Taschner + Viktor Szakats + and + Core Infrastructure Initiative + Mozilla Foundation (MOSS Track 3: Secure Open Source) + Radically Open Security + Release 2.2.0 Tue June 21 2016 Security fixes: #537 CVE-2016-0718 -- Fix crash on malformed input @@ -63,24 +549,25 @@ Release 2.1.1 Sat March 12 2016 libtool now invoked with --verbose Release 2.1.0 Sat March 24 2012 + - Security fixes: + #2958794: CVE-2012-1148 - Memory leak in poolGrow. + #2895533: CVE-2012-1147 - Resource leak in readfilemap.c. + #3496608: CVE-2012-0876 - Hash DOS attack. + #2894085: CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8(). + #1990430: CVE-2009-3720 - Parser crash with special UTF-8 sequences. - Bug Fixes: #1742315: Harmful XML_ParserCreateNS suggestion. - #2895533: CVE-2012-1147 - Resource leak in readfilemap.c. #1785430: Expat build fails on linux-amd64 with gcc version>=4.1 -O3. #1983953, 2517952, 2517962, 2649838: Build modifications using autoreconf instead of buildconf.sh. #2815947, #2884086: OBJEXT and EXEEXT support while building. - #1990430: CVE-2009-3720 - Parser crash with special UTF-8 sequences. #2517938: xmlwf should return non-zero exit status if not well-formed. #2517946: Wrong statement about XMLDecl in xmlwf.1 and xmlwf.sgml. #2855609: Dangling positionPtr after error. - #2894085: CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8(). - #2958794: CVE-2012-1148 - Memory leak in poolGrow. #2990652: CMake support. #3010819: UNEXPECTED_STATE with a trailing "%" in entity value. - #3206497: Unitialized memory returned from XML_Parse. + #3206497: Uninitialized memory returned from XML_Parse. #3287849: make check fails on mingw-w64. - #3496608: CVE-2012-0876 - Hash DOS attack. - Patches: #1749198: pkg-config support. #3010222: Fix for bug #3010819. Modified: stable/12/contrib/expat/FREEBSD-Xlist ============================================================================== --- stable/12/contrib/expat/FREEBSD-Xlist Tue Dec 10 22:10:25 2019 (r355602) +++ stable/12/contrib/expat/FREEBSD-Xlist Wed Dec 11 06:30:26 2019 (r355603) @@ -6,7 +6,9 @@ *.dsw *.m4 *.pc.in +*.vcxproj* *config.h +cmake CMake* Configure* amiga @@ -14,6 +16,7 @@ bcb5 configure conftools doc/valid-xhtml10.png +expat.sln m4 vms win32 Copied and modified: stable/12/contrib/expat/Makefile.am (from r340127, head/contrib/expat/Makefile.am) ============================================================================== --- head/contrib/expat/Makefile.am Sun Nov 4 16:08:59 2018 (r340127, copy source) +++ stable/12/contrib/expat/Makefile.am Wed Dec 11 06:30:26 2019 (r355603) @@ -30,14 +30,21 @@ AUTOMAKE_OPTIONS = \ dist-bzip2 \ + dist-lzip \ + dist-xz \ foreign \ - no-dist-gzip \ subdir-objects ACLOCAL_AMFLAGS = -I m4 LIBTOOLFLAGS = --verbose -SUBDIRS = lib examples tests # lib goes first to build first +SUBDIRS = lib # lib goes first to build first +if WITH_EXAMPLES +SUBDIRS += examples +endif +if WITH_TESTS +SUBDIRS += tests +endif if WITH_XMLWF SUBDIRS += xmlwf doc endif @@ -47,41 +54,19 @@ pkgconfigdir = $(libdir)/pkgconfig _EXTRA_DIST_CMAKE = \ + cmake/expat-config.cmake.in \ + cmake/mingw-toolchain.cmake \ + \ CMakeLists.txt \ CMake.README \ ConfigureChecks.cmake \ expat_config.h.cmake _EXTRA_DIST_WINDOWS = \ - examples/elements.vcxproj \ - examples/elements.vcxproj.filters \ - examples/outline.vcxproj \ - examples/outline.vcxproj.filters \ - \ - lib/expat_static.vcxproj \ - lib/expat_static.vcxproj.filters \ - lib/expat.vcxproj \ - lib/expat.vcxproj.filters \ - lib/expatw_static.vcxproj \ - lib/expatw_static.vcxproj.filters \ - lib/expatw.vcxproj \ - lib/expatw.vcxproj.filters \ - \ - tests/benchmark/benchmark.sln \ - tests/benchmark/benchmark.vcxproj \ - \ - tests/runtests.sln \ - tests/runtests.vcxproj \ - tests/runtests.vcxproj.filters \ - \ + win32/build_expat_iss.bat \ win32/expat.iss \ win32/MANIFEST.txt \ - win32/README.txt \ - \ - xmlwf/xmlwf.vcxproj \ - xmlwf/xmlwf.vcxproj.filters \ - \ - expat.sln + win32/README.txt EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -91,8 +76,13 @@ EXTRA_DIST = \ conftools/get-version.sh \ conftools/PrintPath \ \ + xmlwf/xmlwf_helpgen.py \ + xmlwf/xmlwf_helpgen.sh \ + \ Changes \ README.md \ + \ + fix-xmltest-log.sh \ test-driver-wrapper.sh @@ -121,7 +111,8 @@ run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 -tests/xmlts.zip: +.PHONY: download-xmlts-zip +download-xmlts-zip: if test "$(XMLTS_ZIP)" = ""; then \ wget --output-document=tests/xmlts.zip \ https://www.w3.org/XML/Test/xmlts20080827.zip; \ @@ -129,16 +120,26 @@ tests/xmlts.zip: cp $(XMLTS_ZIP) tests/xmlts.zip; \ fi -tests/xmlconf: tests/xmlts.zip +tests/xmlts.zip: + $(MAKE) download-xmlts-zip + +.PHONY: extract-xmlts-zip +extract-xmlts-zip: tests/xmlts.zip + [ -f $(builddir)/tests/xmlts.zip ] || $(MAKE) download-xmlts-zip # vpath workaround cd tests && unzip -q xmlts.zip +tests/xmlconf: tests/xmlts.zip + $(MAKE) extract-xmlts-zip + .PHONY: run-xmltest run-xmltest: tests/xmlconf if WITH_XMLWF + [ -d $(builddir)/tests/xmlconf ] || $(MAKE) extract-xmlts-zip # vpath workaround + $(MAKE) -C lib $(MAKE) -C xmlwf - tests/xmltest.sh "$(PWD)/run.sh $(PWD)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee tests/xmltest.log - dos2unix tests/xmltest.log - diff -u tests/xmltest.log.expected tests/xmltest.log + $(srcdir)/tests/xmltest.sh "$(abs_builddir)/run.sh $(abs_builddir)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee $(builddir)/tests/xmltest.log + $(srcdir)/fix-xmltest-log.sh $(builddir)/tests/xmltest.log + diff -u $(srcdir)/tests/xmltest.log.expected $(builddir)/tests/xmltest.log else @echo 'ERROR: xmlwf is needed for "make run-xmltest".' >&2 @echo 'ERROR: Please re-configure without --without-xmlwf.' >&2 @@ -147,7 +148,7 @@ endif .PHONY: qa qa: - ./qa.sh address - ./qa.sh memory - ./qa.sh undefined - ./qa.sh coverage + QA_COMPILER=clang QA_SANITIZER=address ./qa.sh + QA_COMPILER=clang QA_SANITIZER=memory ./qa.sh + QA_COMPILER=clang QA_SANITIZER=undefined ./qa.sh + QA_COMPILER=gcc QA_PROCESSOR=gcov ./qa.sh Modified: stable/12/contrib/expat/Makefile.in ============================================================================== --- stable/12/contrib/expat/Makefile.in Tue Dec 10 22:10:25 2019 (r355602) +++ stable/12/contrib/expat/Makefile.in Wed Dec 11 06:30:26 2019 (r355603) @@ -1,212 +1,1034 @@ -################################################################ -# Process this file with top-level configure script to produce Makefile +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + # -# Copyright 2000 Clark Cooper +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser # -# This file is part of EXPAT. +# Copyright (c) 2017 Expat development team +# Licensed under the MIT license: # -# EXPAT is free software; you can redistribute it and/or modify it -# under the terms of the License (based on the MIT/X license) contained -# in the file COPYING that comes with this distribution. +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the +# following conditions: # -# EXPAT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN EXPAT. +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@WITH_EXAMPLES_TRUE@am__append_1 = examples +@WITH_TESTS_TRUE@am__append_2 = tests +@WITH_XMLWF_TRUE@am__append_3 = xmlwf doc +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/conftools/ax-require-defined.m4 \ + $(top_srcdir)/conftools/ax-check-compile-flag.m4 \ + $(top_srcdir)/conftools/ax-check-link-flag.m4 \ + $(top_srcdir)/conftools/ax-append-flag.m4 \ + $(top_srcdir)/conftools/ax-append-compile-flags.m4 \ + $(top_srcdir)/conftools/ax-append-link-flags.m4 \ + $(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = expat_config.h +CONFIG_CLEAN_FILES = expat.pc run.sh +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkgconfigdir)" +DATA = $(pkgconfig_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir distdir-am dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)expat_config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = lib examples tests xmlwf doc +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/expat.pc.in \ + $(srcdir)/expat_config.h.in $(srcdir)/run.sh.in \ + $(top_srcdir)/conftools/ar-lib $(top_srcdir)/conftools/compile \ + $(top_srcdir)/conftools/config.guess \ + $(top_srcdir)/conftools/config.sub \ + $(top_srcdir)/conftools/install-sh \ + $(top_srcdir)/conftools/ltmain.sh \ + $(top_srcdir)/conftools/missing AUTHORS COPYING \ + conftools/ar-lib conftools/compile conftools/config.guess \ + conftools/config.sub conftools/depcomp conftools/install-sh \ + conftools/ltmain.sh conftools/missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 11 06:34:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D56D1CE557; Wed, 11 Dec 2019 06:34:50 +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 47XnGf25Z4z3FsX; Wed, 11 Dec 2019 06:34:50 +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 4224673C8; Wed, 11 Dec 2019 06:34:50 +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 xBB6YoaH079937; Wed, 11 Dec 2019 06:34:50 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBB6YnYH079930; Wed, 11 Dec 2019 06:34:49 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201912110634.xBB6YnYH079930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 11 Dec 2019 06:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355604 - in stable/11: contrib/expat contrib/expat/doc contrib/expat/examples contrib/expat/lib contrib/expat/tests contrib/expat/tests/benchmark contrib/expat/xmlwf lib/libexpat X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/11: contrib/expat contrib/expat/doc contrib/expat/examples contrib/expat/lib contrib/expat/tests contrib/expat/tests/benchmark contrib/expat/xmlwf lib/libexpat X-SVN-Commit-Revision: 355604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 06:34:50 -0000 Author: delphij Date: Wed Dec 11 06:34:48 2019 New Revision: 355604 URL: https://svnweb.freebsd.org/changeset/base/355604 Log: MFC r340127,340133,355085: libbsdxml (expat) 2.2.9. Added: stable/11/contrib/expat/AUTHORS - copied unchanged from r340127, head/contrib/expat/AUTHORS stable/11/contrib/expat/Makefile.am - copied, changed from r340127, head/contrib/expat/Makefile.am stable/11/contrib/expat/README.md - copied, changed from r340127, head/contrib/expat/README.md stable/11/contrib/expat/doc/Makefile.am - copied, changed from r340127, head/contrib/expat/doc/Makefile.am stable/11/contrib/expat/doc/Makefile.in - copied, changed from r340127, head/contrib/expat/doc/Makefile.in stable/11/contrib/expat/examples/Makefile.am - copied unchanged from r340127, head/contrib/expat/examples/Makefile.am stable/11/contrib/expat/examples/Makefile.in - copied, changed from r340127, head/contrib/expat/examples/Makefile.in stable/11/contrib/expat/fix-xmltest-log.sh - copied unchanged from r355085, head/contrib/expat/fix-xmltest-log.sh stable/11/contrib/expat/lib/Makefile.am - copied, changed from r340127, head/contrib/expat/lib/Makefile.am stable/11/contrib/expat/lib/Makefile.in - copied, changed from r340127, head/contrib/expat/lib/Makefile.in stable/11/contrib/expat/lib/loadlibrary.c - copied unchanged from r340127, head/contrib/expat/lib/loadlibrary.c stable/11/contrib/expat/lib/siphash.h - copied, changed from r340127, head/contrib/expat/lib/siphash.h stable/11/contrib/expat/run.sh.in - copied unchanged from r340127, head/contrib/expat/run.sh.in stable/11/contrib/expat/test-driver-wrapper.sh - copied, changed from r340127, head/contrib/expat/test-driver-wrapper.sh stable/11/contrib/expat/tests/Makefile.am - copied unchanged from r340127, head/contrib/expat/tests/Makefile.am stable/11/contrib/expat/tests/Makefile.in - copied, changed from r340127, head/contrib/expat/tests/Makefile.in stable/11/contrib/expat/tests/benchmark/Makefile.am - copied unchanged from r340127, head/contrib/expat/tests/benchmark/Makefile.am stable/11/contrib/expat/tests/benchmark/Makefile.in - copied, changed from r340127, head/contrib/expat/tests/benchmark/Makefile.in stable/11/contrib/expat/tests/benchmark/benchmark.sln - copied unchanged from r340127, head/contrib/expat/tests/benchmark/benchmark.sln stable/11/contrib/expat/tests/memcheck.c - copied, changed from r340127, head/contrib/expat/tests/memcheck.c stable/11/contrib/expat/tests/memcheck.h - copied, changed from r340127, head/contrib/expat/tests/memcheck.h stable/11/contrib/expat/tests/runtests.sln - copied unchanged from r340127, head/contrib/expat/tests/runtests.sln stable/11/contrib/expat/tests/structdata.c - copied, changed from r340127, head/contrib/expat/tests/structdata.c stable/11/contrib/expat/tests/structdata.h - copied, changed from r340127, head/contrib/expat/tests/structdata.h stable/11/contrib/expat/tests/udiffer.py - copied unchanged from r340127, head/contrib/expat/tests/udiffer.py stable/11/contrib/expat/tests/xmltest.log.expected - copied unchanged from r340127, head/contrib/expat/tests/xmltest.log.expected stable/11/contrib/expat/xmlwf/Makefile.am - copied, changed from r340127, head/contrib/expat/xmlwf/Makefile.am stable/11/contrib/expat/xmlwf/Makefile.in - copied, changed from r340127, head/contrib/expat/xmlwf/Makefile.in stable/11/contrib/expat/xmlwf/xmlwf_helpgen.py - copied unchanged from r355085, head/contrib/expat/xmlwf/xmlwf_helpgen.py stable/11/contrib/expat/xmlwf/xmlwf_helpgen.sh - copied unchanged from r355085, head/contrib/expat/xmlwf/xmlwf_helpgen.sh Deleted: stable/11/contrib/expat/MANIFEST stable/11/contrib/expat/README Modified: stable/11/contrib/expat/COPYING (contents, props changed) stable/11/contrib/expat/Changes (contents, props changed) stable/11/contrib/expat/FREEBSD-Xlist (contents, props changed) stable/11/contrib/expat/Makefile.in (contents, props changed) stable/11/contrib/expat/configure.ac (contents, props changed) stable/11/contrib/expat/doc/reference.html (contents, props changed) stable/11/contrib/expat/doc/xmlwf.1 (contents, props changed) stable/11/contrib/expat/doc/xmlwf.xml (contents, props changed) stable/11/contrib/expat/examples/elements.c (contents, props changed) stable/11/contrib/expat/examples/outline.c (contents, props changed) stable/11/contrib/expat/expat_config.h.in (contents, props changed) stable/11/contrib/expat/lib/ascii.h (contents, props changed) stable/11/contrib/expat/lib/asciitab.h (contents, props changed) stable/11/contrib/expat/lib/expat.h (contents, props changed) stable/11/contrib/expat/lib/expat_external.h (contents, props changed) stable/11/contrib/expat/lib/iasciitab.h (contents, props changed) stable/11/contrib/expat/lib/internal.h (contents, props changed) stable/11/contrib/expat/lib/latin1tab.h (contents, props changed) stable/11/contrib/expat/lib/nametab.h (contents, props changed) stable/11/contrib/expat/lib/utf8tab.h (contents, props changed) stable/11/contrib/expat/lib/xmlparse.c (contents, props changed) stable/11/contrib/expat/lib/xmlrole.c (contents, props changed) stable/11/contrib/expat/lib/xmlrole.h (contents, props changed) stable/11/contrib/expat/lib/xmltok.c (contents, props changed) stable/11/contrib/expat/lib/xmltok.h (contents, props changed) stable/11/contrib/expat/lib/xmltok_impl.c (contents, props changed) stable/11/contrib/expat/lib/xmltok_impl.h (contents, props changed) stable/11/contrib/expat/lib/xmltok_ns.c (contents, props changed) stable/11/contrib/expat/tests/benchmark/benchmark.c (contents, props changed) stable/11/contrib/expat/tests/chardata.c (contents, props changed) stable/11/contrib/expat/tests/chardata.h (contents, props changed) stable/11/contrib/expat/tests/minicheck.c (contents, props changed) stable/11/contrib/expat/tests/minicheck.h (contents, props changed) stable/11/contrib/expat/tests/runtests.c (contents, props changed) stable/11/contrib/expat/tests/runtestspp.cpp (contents, props changed) stable/11/contrib/expat/tests/xmltest.sh (contents, props changed) stable/11/contrib/expat/xmlwf/codepage.c (contents, props changed) stable/11/contrib/expat/xmlwf/codepage.h (contents, props changed) stable/11/contrib/expat/xmlwf/ct.c (contents, props changed) stable/11/contrib/expat/xmlwf/filemap.h (contents, props changed) stable/11/contrib/expat/xmlwf/readfilemap.c (contents, props changed) stable/11/contrib/expat/xmlwf/unixfilemap.c (contents, props changed) stable/11/contrib/expat/xmlwf/win32filemap.c (contents, props changed) stable/11/contrib/expat/xmlwf/xmlfile.c (contents, props changed) stable/11/contrib/expat/xmlwf/xmlfile.h (contents, props changed) stable/11/contrib/expat/xmlwf/xmlmime.c (contents, props changed) stable/11/contrib/expat/xmlwf/xmlmime.h (contents, props changed) stable/11/contrib/expat/xmlwf/xmltchar.h (contents, props changed) stable/11/contrib/expat/xmlwf/xmlurl.h (contents, props changed) stable/11/contrib/expat/xmlwf/xmlwf.c (contents, props changed) stable/11/contrib/expat/xmlwf/xmlwin32url.cxx (contents, props changed) stable/11/lib/libexpat/expat_config.h stable/11/lib/libexpat/libbsdxml.3 Directory Properties: stable/11/ (props changed) stable/11/contrib/expat/doc/style.css (props changed) stable/11/contrib/expat/tests/README.txt (props changed) stable/11/contrib/expat/tests/benchmark/README.txt (props changed) Copied: stable/11/contrib/expat/AUTHORS (from r340127, head/contrib/expat/AUTHORS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/expat/AUTHORS Wed Dec 11 06:34:48 2019 (r355604, copy of r340127, head/contrib/expat/AUTHORS) @@ -0,0 +1,10 @@ +Expat is brought to you by: + +Clark Cooper +Fred L. Drake, Jr. +Greg Stein +James Clark +Karl Waclawek +Rhodri James +Sebastian Pipping +Steven Solie Modified: stable/11/contrib/expat/COPYING ============================================================================== --- stable/11/contrib/expat/COPYING Wed Dec 11 06:30:26 2019 (r355603) +++ stable/11/contrib/expat/COPYING Wed Dec 11 06:34:48 2019 (r355604) @@ -1,5 +1,5 @@ Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper -Copyright (c) 2001-2016 Expat maintainers +Copyright (c) 2001-2017 Expat maintainers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Modified: stable/11/contrib/expat/Changes ============================================================================== --- stable/11/contrib/expat/Changes Wed Dec 11 06:30:26 2019 (r355603) +++ stable/11/contrib/expat/Changes Wed Dec 11 06:34:48 2019 (r355604) @@ -1,3 +1,489 @@ +NOTE: We are looking for help with a few things: + https://github.com/libexpat/libexpat/labels/help%20wanted + If you can help, please get in touch. Thanks! + +Release 2.2.9 Wed Septemper 25 2019 + Other changes: + examples: Drop executable bits from elements.c + #349 Windows: Change the name of the Windows DLLs from expat*.dll + to libexpat*.dll once more (regression from 2.2.8, first + fixed in 1.95.3, issue #61 on SourceForge today, + was issue #432456 back then); needs a fix due + case-insensitive file systems on Windows and the fact that + Perl's XML::Parser::Expat compiles into Expat.dll. + #347 Windows: Only define _CRT_RAND_S if not defined + Version info bumped from 7:10:6 to 7:11:6 + + Special thanks to: + Ben Wagner + +Release 2.2.8 Fri Septemper 13 2019 + Security fixes: + #317 #318 CVE-2019-15903 -- Fix heap overflow triggered by + XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber), + and deny internal entities closing the doctype; + fixed in commit c20b758c332d9a13afbbb276d30db1d183a85d43 + + Bug fixes: + #240 Fix cases where XML_StopParser did not have any effect + when called from inside of an end element handler + #341 xmlwf: Fix exit code for operation without "-d DIRECTORY"; + previously, only "-d DIRECTORY" would give you a proper + exit code: + # xmlwf -d . <<<'' 2>/dev/null ; echo $? + 2 + # xmlwf <<<'' 2>/dev/null ; echo $? + 0 + Now both cases return exit code 2. + + Other changes: + #299 #302 Windows: Replace LoadLibrary hack to access + unofficial API function SystemFunction036 (RtlGenRandom) + by using official API function rand_s (needs WinXP+) + #325 Windows: Drop support for Visual Studio <=7.1/2003 + and document supported compilers in README.md + #286 Windows: Remove COM code from xmlwf; in case it turns + out needed later, there will be a dedicated repository + below https://github.com/libexpat/ for that code + #322 Windows: Remove explicit MSVC solution and project files. + You can generate Visual Studio solution files through + CMake, e.g.: cmake -G"Visual Studio 15 2017" . + #338 xmlwf: Make "xmlwf -h" help output more friendly + #339 examples: Improve elements.c + #244 #264 Autotools: Add argument --enable-xml-attr-info + #239 #301 Autotools: Add arguments + --with-getrandom + --without-getrandom + --with-sys-getrandom + --without-sys-getrandom + #312 #343 Autotools: Fix linking issues with "./configure LD=clang" + Autotools: Fix "make run-xmltest" for out-of-source builds + #329 #336 CMake: Pull all options from Expat <=2.2.7 into namespace + prefix EXPAT_ with the exception of DOCBOOK_TO_MAN: + - BUILD_doc -> EXPAT_BUILD_DOCS (plural) + - BUILD_examples -> EXPAT_BUILD_EXAMPLES + - BUILD_shared -> EXPAT_SHARED_LIBS + - BUILD_tests -> EXPAT_BUILD_TESTS + - BUILD_tools -> EXPAT_BUILD_TOOLS + - DOCBOOK_TO_MAN -> DOCBOOK_TO_MAN (unchanged) + - INSTALL -> EXPAT_ENABLE_INSTALL + - MSVC_USE_STATIC_CRT -> EXPAT_MSVC_STATIC_CRT + - USE_libbsd -> EXPAT_WITH_LIBBSD + - WARNINGS_AS_ERRORS -> EXPAT_WARNINGS_AS_ERRORS + - XML_CONTEXT_BYTES -> EXPAT_CONTEXT_BYTES + - XML_DEV_URANDOM -> EXPAT_DEV_URANDOM + - XML_DTD -> EXPAT_DTD + - XML_NS -> EXPAT_NS + - XML_UNICODE -> EXPAT_CHAR_TYPE=ushort (!) + - XML_UNICODE_WCHAR_T -> EXPAT_CHAR_TYPE=wchar_t (!) + #244 #264 CMake: Add argument -DEXPAT_ATTR_INFO=(ON|OFF), + default OFF + #326 CMake: Add argument -DEXPAT_LARGE_SIZE=(ON|OFF), + default OFF + #328 CMake: Add argument -DEXPAT_MIN_SIZE=(ON|OFF), + default OFF + #239 #277 CMake: Add arguments + -DEXPAT_WITH_GETRANDOM=(ON|OFF|AUTO), default AUTO + -DEXPAT_WITH_SYS_GETRANDOM=(ON|OFF|AUTO), default AUTO + #326 CMake: Install expat_config.h to include directory + #326 CMake: Generate and install configuration files for + future find_package(expat [..] CONFIG [..]) + CMake: Now produces a summary of applied configuration + CMake: Require C++ compiler only when tests are enabled + #330 CMake: Fix compilation for 16bit character types, + i.e. ex -DXML_UNICODE=ON (and ex -DXML_UNICODE_WCHAR_T=ON) + #265 CMake: Fix linking with MinGW + #330 CMake: Add full support for MinGW; to enable, use + -DCMAKE_TOOLCHAIN_FILE=[expat]/cmake/mingw-toolchain.cmake + #330 CMake: Port "make run-xmltest" from GNU Autotools to CMake + #316 CMake: Windows: Make binary postfix match MSVC + Old: expat[d].lib + New: expat[w][d][MD|MT].lib + CMake: Migrate files from Windows to Unix line endings + #308 CMake: Integrate OSS-Fuzz fuzzers, option + -DEXPAT_BUILD_FUZZERS=(ON|OFF), default OFF + #14 Drop an OpenVMS support leftover + #235 #268 .. + #270 #310 .. + #313 #331 #333 Address compiler warnings + #282 #283 .. + #284 #285 Address cppcheck warnings + #294 #295 Address Clang Static Analyzer warnings + #24 #293 Mass-apply clang-format 9 (and ensure conformance during CI) + Version info bumped from 7:9:6 to 7:10:6 + + Special thanks to: + David Loffredo + Joonun Jang + Khajapasha Mohammed + Kishore Kunche + Marco Maggi + Mitch Phillips + Rolf Ade + xantares + Zhongyuan Zhou + +Release 2.2.7 Wed June 19 2019 + Security fixes: + #186 #262 CVE-2018-20843 -- Fix extraction of namespace prefixes from + XML names; XML names with multiple colons could end up in + the wrong namespace, and take a high amount of RAM and CPU + resources while processing, opening the door to + use for denial-of-service attacks + + Other changes: + #195 #197 Autotools/CMake: Utilize -fvisibility=hidden to stop + exporting non-API symbols + #227 Autotools: Add --without-examples and --without-tests + #228 Autotools: Modernize configure.ac + #245 #246 Autotools: Fix check for -fvisibility=hidden for Clang + #247 #248 Autotools: Fix compilation for lack of docbook2x-man + #236 #258 Autotools: Produce .tar.{gz,lz,xz} release archives + #212 CMake: Make libdir of pkgconfig expat.pc support multilib + #158 #263 CMake: Build man page in PROJECT_BINARY_DIR not _SOURCE_DIR + #219 Remove fallback to bcopy, assume that memmove(3) exists + #257 Use portable "/usr/bin/env bash" shebang (e.g. for OpenBSD) + #243 Windows: Fix syntax of .def module definition files + Version info bumped from 7:8:6 to 7:9:6 + + Special thanks to: + Benjamin Peterson + Caolán McNamara + Hanno Böck + KangLin + Kishore Kunche + Marco Maggi + Rhodri James + Sebastian Dröge + userwithuid + Yury Gribov + +Release 2.2.6 Sun August 12 2018 + Bug fixes: + #170 #206 Avoid doing arithmetic with NULL pointers in XML_GetBuffer + #204 #205 Fix 2.2.5 regression with suspend-resume while parsing + a document like '' + + Other changes: + #165 #168 Autotools: Fix docbook-related configure syntax error + #166 Autotools: Avoid grep option `-q` for Solaris + #167 Autotools: Support + ./configure DOCBOOK_TO_MAN="xmlto man --skip-validation" + #159 #167 Autotools: Support DOCBOOK_TO_MAN command which produces + xmlwf.1 rather than XMLWF.1; also covers case insensitive + file systems + #181 Autotools: Drop -rpath option passed to libtool + #188 Autotools: Detect and deny SGML docbook2man as ours is XML + #188 Autotools/CMake: Support command db2x_docbook2man as well + #174 CMake: Introduce option WARNINGS_AS_ERRORS, defaults to OFF + #184 #185 CMake: Introduce option MSVC_USE_STATIC_CRT, defaults to OFF + #207 #208 CMake: Introduce option XML_UNICODE and XML_UNICODE_WCHAR_T, + both defaulting to OFF + #175 CMake: Prefer check_symbol_exists over check_function_exists + #176 CMake: Create the same pkg-config file as with GNU Autotools + #178 #179 CMake: Use GNUInstallDirs module to set proper defaults for + install directories + #208 CMake: Utilize expat_config.h.cmake for XML_DEV_URANDOM + #180 Windows: Fix compilation of test suite for Visual Studio 2008 + #131 #173 #202 Address compiler warnings + #187 #190 #200 Fix miscellaneous typos + Version info bumped from 7:7:6 to 7:8:6 + + Special thanks to: + Anton Maklakov + Benjamin Peterson + Brad King + Franek Korta + Frank Rast + Joe Orton + luzpaz + Pedro Vicente + Rainer Jung + Rhodri James + Rolf Ade + Rolf Eike Beer + Thomas Beutlich + Tomasz KÅ‚oczko + +Release 2.2.5 Tue October 31 2017 + Bug fixes: + #8 If the parser runs out of memory, make sure its internal + state reflects the memory it actually has, not the memory + it wanted to have. + #11 The default handler wasn't being called when it should for + a SYSTEM or PUBLIC doctype if an entity declaration handler + was registered. + #137 #138 Fix a case of mistakenly reported parsing success where + XML_StopParser was called from an element handler + #162 Function XML_ErrorString was returning NULL rather than + a message for code XML_ERROR_INVALID_ARGUMENT + introduced with release 2.2.1 + + Other changes: + #106 xmlwf: Add argument -N adding notation declarations + #75 #106 Test suite: Resolve expected failure cases where xmlwf + output was incomplete + #127 Windows: Fix test suite compilation + #126 #127 Windows: Fix compilation for Visual Studio 2012 + Windows: Upgrade shipped project files to Visual Studio 2017 + #33 #132 tests: Mass-fix compilation for XML_UNICODE_WCHAR_T + #129 examples: Fix compilation for XML_UNICODE_WCHAR_T + #130 benchmark: Fix compilation for XML_UNICODE_WCHAR_T + #144 xmlwf: Fix compilation for XML_UNICODE_WCHAR_T; still needs + Windows or MinGW for 2-byte wchar_t + #9 Address two Clang Static Analyzer false positives + #59 Resolve troublesome macros hiding parser struct membership + and dereferencing that pointer + #6 Resolve superfluous internal malloc/realloc switch + #153 #155 Improve docbook2x-man detection + #160 Undefine NDEBUG in the test suite (rather than rejecting it) + #161 Address compiler warnings + Version info bumped from 7:6:6 to 7:7:6 + + Special thanks to: + Benbuck Nason + Hans Wennborg + José Gutiérrez de la Concha + Pedro Monreal Gonzalez + Rhodri James + Rolf Ade + Stephen Groat + and + Core Infrastructure Initiative + +Release 2.2.4 Sat August 19 2017 + Bug fixes: + #115 Fix copying of partial characters for UTF-8 input + + Other changes: + #109 Fix "make check" for non-x86 architectures that default + to unsigned type char (-128..127 rather than 0..255) + #109 coverage.sh: Cover -funsigned-char + Autotools: Introduce --without-xmlwf argument + #65 Autotools: Replace handwritten Makefile with GNU Automake + #43 CMake: Auto-detect high quality entropy extractors, add new + option USE_libbsd=ON to use arc4random_buf of libbsd + #74 CMake: Add -fno-strict-aliasing only where supported + #114 CMake: Always honor manually set BUILD_* options + #114 CMake: Compile man page if docbook2x-man is available, only + #117 Include file tests/xmltest.log.expected in source tarball + (required for "make run-xmltest") + #117 Include (existing) Visual Studio 2013 files in source tarball + Improve test suite error output + #111 Fix some typos in documentation + Version info bumped from 7:5:6 to 7:6:6 + + Special thanks to: + Jakub Wilk + Joe Orton + Lin Tian + Rolf Eike Beer + +Release 2.2.3 Wed August 2 2017 + Security fixes: + #82 CVE-2017-11742 -- Windows: Fix DLL hijacking vulnerability + using Steve Holme's LoadLibrary wrapper for/of cURL + + Bug fixes: + #85 Fix a dangling pointer issue related to realloc + + Other changes: + Increase code coverage + #91 Linux: Allow getrandom to fail if nonblocking pool has not + yet been initialized and read /dev/urandom then, instead. + This is in line with what recent Python does. + #81 Pre-10.7/Lion macOS: Support entropy from arc4random + #86 Check that a UTF-16 encoding in an XML declaration has the + right endianness + #4 #5 #7 Recover correctly when some reallocations fail + Repair "./configure && make" for systems without any + provider of high quality entropy + and try reading /dev/urandom on those + Ensure that user-defined character encodings have converter + functions when they are needed + Fix mis-leading description of argument -c in xmlwf.1 + Rely on macro HAVE_ARC4RANDOM_BUF (rather than __CloudABI__) + for CloudABI + #100 Fix use of SIPHASH_MAIN in siphash.h + #23 Test suite: Fix memory leaks + Version info bumped from 7:4:6 to 7:5:6 + + Special thanks to: + Chanho Park + Joe Orton + Pascal Cuoq + Rhodri James + Simon McVittie + Vadim Zeitlin + Viktor Szakats + and + Core Infrastructure Initiative + +Release 2.2.2 Wed July 12 2017 + Security fixes: + #43 Protect against compilation without any source of high + quality entropy enabled, e.g. with CMake build system; + commit ff0207e6076e9828e536b8d9cd45c9c92069b895 + #60 Windows with _UNICODE: + Unintended use of LoadLibraryW with a non-wide string + resulted in failure to load advapi32.dll and degradation + in quality of used entropy when compiled with _UNICODE for + Windows; you can launch existing binaries with + EXPAT_ENTROPY_DEBUG=1 in the environment to inspect the + quality of entropy used during runtime; commits + * 95b95032f907ef1cd17ee7a9a1768010a825d61d + * 73a5a2e9c081f49f2d775cf7ced864158b68dc80 + [MOX-006] Fix non-NULL parser parameter validation in XML_Parse; + resulted in NULL dereference, previously; + commit ac256dafdffc9622ab0dc2c62fcecb0dfcfa71fe + + Bug fixes: + #69 Fix improper use of unsigned long long integer literals + + Other changes: + #73 Start requiring a C99 compiler + #49 Fix "==" Bashism in configure script + #50 Fix too eager getrandom detection for Debian GNU/kFreeBSD + #52 and macOS + #51 Address lack of stdint.h in Visual Studio 2003 to 2008 + #58 Address compile warnings + #68 Fix "./buildconf.sh && ./configure" for some versions + of Dash for /bin/sh + #72 CMake: Ease use of Expat in context of a parent project + with multiple CMakeLists.txt files + #72 CMake: Resolve mistaken executable permissions + #76 Address compile warning with -DNDEBUG (not recommended!) + #77 Address compile warning about macro redefinition + + Special thanks to: + Alexander Bluhm + Ben Boeckel + Cătălin Răceanu + Kerin Millar + László Böszörményi + S. P. Zeidler + Segev Finer + Václav Slavík + Victor Stinner + Viktor Szakats + and + Radically Open Security + +Release 2.2.1 Sat June 17 2017 + Security fixes: + CVE-2017-9233 -- External entity infinite loop DoS + Details: https://libexpat.github.io/doc/cve-2017-9233/ + Commit c4bf96bb51dd2a1b0e185374362ee136fe2c9d7f + [MOX-002] CVE-2016-9063 -- Detect integer overflow; commit + d4f735b88d9932bd5039df2335eefdd0723dbe20 + (Fixed version of existing downstream patches!) + (SF.net) #539 Fix regression from fix to CVE-2016-0718 cutting off + longer tag names; commits + * 896b6c1fd3b842f377d1b62135dccf0a579cf65d + * af507cef2c93cb8d40062a0abe43a4f4e9158fb2 + #16 * 0dbbf43fdb20f593ddf4fa1ff67288000dd4a7fd + #25 More integer overflow detection (function poolGrow); commits + * 810b74e4703dcfdd8f404e3cb177d44684775143 + * 44178553f3539ce69d34abee77a05e879a7982ac + [MOX-002] Detect overflow from len=INT_MAX call to XML_Parse; commits + * 4be2cb5afcc018d996f34bbbce6374b7befad47f + * 7e5b71b748491b6e459e5c9a1d090820f94544d8 + [MOX-005] #30 Use high quality entropy for hash initialization: + * arc4random_buf on BSD, systems with libbsd + (when configured with --with-libbsd), CloudABI + * RtlGenRandom on Windows XP / Server 2003 and later + * getrandom on Linux 3.17+ + In a way, that's still part of CVE-2016-5300. + https://github.com/libexpat/libexpat/pull/30/commits + [MOX-005] For the low quality entropy extraction fallback code, + the parser instance address can no longer leak, commit + 04ad658bd3079dd15cb60fc67087900f0ff4b083 + [MOX-003] Prevent use of uninitialised variable; commit + [MOX-004] a4dc944f37b664a3ca7199c624a98ee37babdb4b + Add missing parameter validation to public API functions + and dedicated error code XML_ERROR_INVALID_ARGUMENT: + [MOX-006] * NULL checks; commits + * d37f74b2b7149a3a95a680c4c4cd2a451a51d60a (merge/many) + * 9ed727064b675b7180c98cb3d4f75efba6966681 + * 6a747c837c50114dfa413994e07c0ba477be4534 + * Negative length (XML_Parse); commit + [MOX-002] 70db8d2538a10f4c022655d6895e4c3e78692e7f + [MOX-001] #35 Change hash algorithm to William Ahern's version of SipHash + to go further with fixing CVE-2012-0876. + https://github.com/libexpat/libexpat/pull/39/commits + + Bug fixes: + #32 Fix sharing of hash salt across parsers; + relevant where XML_ExternalEntityParserCreate is called + prior to XML_Parse, in particular (e.g. FBReader) + #28 xmlwf: Auto-disable use of memory-mapping (and parsing + as a single chunk) for files larger than ~1 GB (2^30 bytes) + rather than failing with error "out of memory" + #3 Fix double free after malloc failure in DTD code; commit + 7ae9c3d3af433cd4defe95234eae7dc8ed15637f + #17 Fix memory leak on parser error for unbound XML attribute + prefix with new namespaces defined in the same tag; + found by Google's OSS-Fuzz; commits + * 16f87daae5a16132e479e4f71862128c7a915c73 + * b47dbc9745932c160893d433220e462bd605f8cd + xmlwf on Windows: Add missing calls to CloseHandle + + New features: + #30 Introduced environment switch EXPAT_ENTROPY_DEBUG=1 + for runtime debugging of entropy extraction + + Other changes: + Increase code coverage + #33 Reject use of XML_UNICODE_WCHAR_T with sizeof(wchar_t) != 2; + XML_UNICODE_WCHAR_T was never meant to be used outside + of Windows; 4-byte wchar_t is common on Linux + (SF.net) #538 Start using -fno-strict-aliasing + (SF.net) #540 Support compilation against cloudlibc of CloudABI + Allow MinGW cross-compilation + (SF.net) #534 CMake: Introduce option "BUILD_doc" (enabled by default) + to bypass compilation of the xmlwf.1 man page + (SF.net) pr2 CMake: Introduce option "INSTALL" (enabled by default) + to bypass installation of expat files + CMake: Fix ninja support + Autotools: Add parameters --enable-xml-context [COUNT] + and --disable-xml-context; default of context of 1024 + bytes enabled unchanged + #14 Drop AmigaOS 4.x code and includes + #14 Drop ancient build systems: + * Borland C++ Builder + * OpenVMS + * Open Watcom + * Visual Studio 6.0 + * Pre-X Mac OS (MPW Makefile) + If you happen to rely on some of these, please get in + touch for joining with maintenance. + #10 Move from WIN32 to _WIN32 + #13 Fix "make run-xmltest" order instability + Address compile warnings + Bump version info from 7:2:6 to 7:3:6 + Add AUTHORS file + + Infrastructure: + #1 Migrate from SourceForge to GitHub (except downloads): + https://github.com/libexpat/ + #1 Re-create http://libexpat.org/ project website + Start utilizing Travis CI + + Special thanks to: + Andy Wang + Don Lewis + Ed Schouten + Karl Waclawek + Pascal Cuoq + Rhodri James + Sergei Nikulov + Tobias Taschner + Viktor Szakats + and + Core Infrastructure Initiative + Mozilla Foundation (MOSS Track 3: Secure Open Source) + Radically Open Security + Release 2.2.0 Tue June 21 2016 Security fixes: #537 CVE-2016-0718 -- Fix crash on malformed input @@ -63,24 +549,25 @@ Release 2.1.1 Sat March 12 2016 libtool now invoked with --verbose Release 2.1.0 Sat March 24 2012 + - Security fixes: + #2958794: CVE-2012-1148 - Memory leak in poolGrow. + #2895533: CVE-2012-1147 - Resource leak in readfilemap.c. + #3496608: CVE-2012-0876 - Hash DOS attack. + #2894085: CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8(). + #1990430: CVE-2009-3720 - Parser crash with special UTF-8 sequences. - Bug Fixes: #1742315: Harmful XML_ParserCreateNS suggestion. - #2895533: CVE-2012-1147 - Resource leak in readfilemap.c. #1785430: Expat build fails on linux-amd64 with gcc version>=4.1 -O3. #1983953, 2517952, 2517962, 2649838: Build modifications using autoreconf instead of buildconf.sh. #2815947, #2884086: OBJEXT and EXEEXT support while building. - #1990430: CVE-2009-3720 - Parser crash with special UTF-8 sequences. #2517938: xmlwf should return non-zero exit status if not well-formed. #2517946: Wrong statement about XMLDecl in xmlwf.1 and xmlwf.sgml. #2855609: Dangling positionPtr after error. - #2894085: CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8(). - #2958794: CVE-2012-1148 - Memory leak in poolGrow. #2990652: CMake support. #3010819: UNEXPECTED_STATE with a trailing "%" in entity value. - #3206497: Unitialized memory returned from XML_Parse. + #3206497: Uninitialized memory returned from XML_Parse. #3287849: make check fails on mingw-w64. - #3496608: CVE-2012-0876 - Hash DOS attack. - Patches: #1749198: pkg-config support. #3010222: Fix for bug #3010819. Modified: stable/11/contrib/expat/FREEBSD-Xlist ============================================================================== --- stable/11/contrib/expat/FREEBSD-Xlist Wed Dec 11 06:30:26 2019 (r355603) +++ stable/11/contrib/expat/FREEBSD-Xlist Wed Dec 11 06:34:48 2019 (r355604) @@ -6,7 +6,9 @@ *.dsw *.m4 *.pc.in +*.vcxproj* *config.h +cmake CMake* Configure* amiga @@ -14,6 +16,7 @@ bcb5 configure conftools doc/valid-xhtml10.png +expat.sln m4 vms win32 Copied and modified: stable/11/contrib/expat/Makefile.am (from r340127, head/contrib/expat/Makefile.am) ============================================================================== --- head/contrib/expat/Makefile.am Sun Nov 4 16:08:59 2018 (r340127, copy source) +++ stable/11/contrib/expat/Makefile.am Wed Dec 11 06:34:48 2019 (r355604) @@ -30,14 +30,21 @@ AUTOMAKE_OPTIONS = \ dist-bzip2 \ + dist-lzip \ + dist-xz \ foreign \ - no-dist-gzip \ subdir-objects ACLOCAL_AMFLAGS = -I m4 LIBTOOLFLAGS = --verbose -SUBDIRS = lib examples tests # lib goes first to build first +SUBDIRS = lib # lib goes first to build first +if WITH_EXAMPLES +SUBDIRS += examples +endif +if WITH_TESTS +SUBDIRS += tests +endif if WITH_XMLWF SUBDIRS += xmlwf doc endif @@ -47,41 +54,19 @@ pkgconfigdir = $(libdir)/pkgconfig _EXTRA_DIST_CMAKE = \ + cmake/expat-config.cmake.in \ + cmake/mingw-toolchain.cmake \ + \ CMakeLists.txt \ CMake.README \ ConfigureChecks.cmake \ expat_config.h.cmake _EXTRA_DIST_WINDOWS = \ - examples/elements.vcxproj \ - examples/elements.vcxproj.filters \ - examples/outline.vcxproj \ - examples/outline.vcxproj.filters \ - \ - lib/expat_static.vcxproj \ - lib/expat_static.vcxproj.filters \ - lib/expat.vcxproj \ - lib/expat.vcxproj.filters \ - lib/expatw_static.vcxproj \ - lib/expatw_static.vcxproj.filters \ - lib/expatw.vcxproj \ - lib/expatw.vcxproj.filters \ - \ - tests/benchmark/benchmark.sln \ - tests/benchmark/benchmark.vcxproj \ - \ - tests/runtests.sln \ - tests/runtests.vcxproj \ - tests/runtests.vcxproj.filters \ - \ + win32/build_expat_iss.bat \ win32/expat.iss \ win32/MANIFEST.txt \ - win32/README.txt \ - \ - xmlwf/xmlwf.vcxproj \ - xmlwf/xmlwf.vcxproj.filters \ - \ - expat.sln + win32/README.txt EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -91,8 +76,13 @@ EXTRA_DIST = \ conftools/get-version.sh \ conftools/PrintPath \ \ + xmlwf/xmlwf_helpgen.py \ + xmlwf/xmlwf_helpgen.sh \ + \ Changes \ README.md \ + \ + fix-xmltest-log.sh \ test-driver-wrapper.sh @@ -121,7 +111,8 @@ run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 -tests/xmlts.zip: +.PHONY: download-xmlts-zip +download-xmlts-zip: if test "$(XMLTS_ZIP)" = ""; then \ wget --output-document=tests/xmlts.zip \ https://www.w3.org/XML/Test/xmlts20080827.zip; \ @@ -129,16 +120,26 @@ tests/xmlts.zip: cp $(XMLTS_ZIP) tests/xmlts.zip; \ fi -tests/xmlconf: tests/xmlts.zip +tests/xmlts.zip: + $(MAKE) download-xmlts-zip + +.PHONY: extract-xmlts-zip +extract-xmlts-zip: tests/xmlts.zip + [ -f $(builddir)/tests/xmlts.zip ] || $(MAKE) download-xmlts-zip # vpath workaround cd tests && unzip -q xmlts.zip +tests/xmlconf: tests/xmlts.zip + $(MAKE) extract-xmlts-zip + .PHONY: run-xmltest run-xmltest: tests/xmlconf if WITH_XMLWF + [ -d $(builddir)/tests/xmlconf ] || $(MAKE) extract-xmlts-zip # vpath workaround + $(MAKE) -C lib $(MAKE) -C xmlwf - tests/xmltest.sh "$(PWD)/run.sh $(PWD)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee tests/xmltest.log - dos2unix tests/xmltest.log - diff -u tests/xmltest.log.expected tests/xmltest.log + $(srcdir)/tests/xmltest.sh "$(abs_builddir)/run.sh $(abs_builddir)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee $(builddir)/tests/xmltest.log + $(srcdir)/fix-xmltest-log.sh $(builddir)/tests/xmltest.log + diff -u $(srcdir)/tests/xmltest.log.expected $(builddir)/tests/xmltest.log else @echo 'ERROR: xmlwf is needed for "make run-xmltest".' >&2 @echo 'ERROR: Please re-configure without --without-xmlwf.' >&2 @@ -147,7 +148,7 @@ endif .PHONY: qa qa: - ./qa.sh address - ./qa.sh memory - ./qa.sh undefined - ./qa.sh coverage + QA_COMPILER=clang QA_SANITIZER=address ./qa.sh + QA_COMPILER=clang QA_SANITIZER=memory ./qa.sh + QA_COMPILER=clang QA_SANITIZER=undefined ./qa.sh + QA_COMPILER=gcc QA_PROCESSOR=gcov ./qa.sh Modified: stable/11/contrib/expat/Makefile.in ============================================================================== --- stable/11/contrib/expat/Makefile.in Wed Dec 11 06:30:26 2019 (r355603) +++ stable/11/contrib/expat/Makefile.in Wed Dec 11 06:34:48 2019 (r355604) @@ -1,212 +1,1034 @@ -################################################################ -# Process this file with top-level configure script to produce Makefile +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + # -# Copyright 2000 Clark Cooper +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser # -# This file is part of EXPAT. +# Copyright (c) 2017 Expat development team +# Licensed under the MIT license: # -# EXPAT is free software; you can redistribute it and/or modify it -# under the terms of the License (based on the MIT/X license) contained -# in the file COPYING that comes with this distribution. +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the +# following conditions: # -# EXPAT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN EXPAT. +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@WITH_EXAMPLES_TRUE@am__append_1 = examples +@WITH_TESTS_TRUE@am__append_2 = tests +@WITH_XMLWF_TRUE@am__append_3 = xmlwf doc +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/conftools/ax-require-defined.m4 \ + $(top_srcdir)/conftools/ax-check-compile-flag.m4 \ + $(top_srcdir)/conftools/ax-check-link-flag.m4 \ + $(top_srcdir)/conftools/ax-append-flag.m4 \ + $(top_srcdir)/conftools/ax-append-compile-flags.m4 \ + $(top_srcdir)/conftools/ax-append-link-flags.m4 \ + $(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = expat_config.h +CONFIG_CLEAN_FILES = expat.pc run.sh +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkgconfigdir)" +DATA = $(pkgconfig_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir distdir-am dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)expat_config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = lib examples tests xmlwf doc +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/expat.pc.in \ + $(srcdir)/expat_config.h.in $(srcdir)/run.sh.in \ + $(top_srcdir)/conftools/ar-lib $(top_srcdir)/conftools/compile \ + $(top_srcdir)/conftools/config.guess \ + $(top_srcdir)/conftools/config.sub \ + $(top_srcdir)/conftools/install-sh \ + $(top_srcdir)/conftools/ltmain.sh \ + $(top_srcdir)/conftools/missing AUTHORS COPYING \ + conftools/ar-lib conftools/compile conftools/config.guess \ + conftools/config.sub conftools/depcomp conftools/install-sh \ + conftools/ltmain.sh conftools/missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 11 06:50:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BB1B1CEA71; Wed, 11 Dec 2019 06:50:56 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47XndD0vXxz3GXf; Wed, 11 Dec 2019 06:50:56 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0153776B2; Wed, 11 Dec 2019 06:50:56 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBB6otFQ086581; Wed, 11 Dec 2019 06:50:55 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBB6otD8086579; Wed, 11 Dec 2019 06:50:55 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912110650.xBB6otD8086579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Wed, 11 Dec 2019 06:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355605 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 06:50:56 -0000 Author: rlibby Date: Wed Dec 11 06:50:55 2019 New Revision: 355605 URL: https://svnweb.freebsd.org/changeset/base/355605 Log: uma: pretty print zone flags sysctl Requested by: jeff Reviewed by: jeff, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22748 Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Dec 11 06:34:48 2019 (r355604) +++ head/sys/vm/uma_core.c Wed Dec 11 06:50:55 2019 (r355605) @@ -289,6 +289,7 @@ static int sysctl_vm_zone_count(SYSCTL_HANDLER_ARGS); static int sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS); static int sysctl_handle_uma_zone_allocs(SYSCTL_HANDLER_ARGS); static int sysctl_handle_uma_zone_frees(SYSCTL_HANDLER_ARGS); +static int sysctl_handle_uma_zone_flags(SYSCTL_HANDLER_ARGS); #ifdef INVARIANTS static bool uma_dbg_kskip(uma_keg_t keg, void *mem); @@ -1896,8 +1897,9 @@ zone_alloc_sysctl(uma_zone_t zone, void *unused) oid = zone->uz_oid; SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "size", CTLFLAG_RD, &zone->uz_size, 0, "Allocation size"); - SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, - "flags", CTLFLAG_RD, &zone->uz_flags, 0, + SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "flags", CTLFLAG_RD | CTLTYPE_STRING | CTLFLAG_MPSAFE, + zone, 0, sysctl_handle_uma_zone_flags, "A", "Allocator configuration flags"); SYSCTL_ADD_U16(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "bucket_size", CTLFLAG_RD, &zone->uz_bucket_size, 0, @@ -4406,6 +4408,24 @@ sysctl_handle_uma_zone_frees(SYSCTL_HANDLER_ARGS) cur = uma_zone_get_frees(zone); return (sysctl_handle_64(oidp, &cur, 0, req)); +} + +static int +sysctl_handle_uma_zone_flags(SYSCTL_HANDLER_ARGS) +{ + struct sbuf sbuf; + uma_zone_t zone = arg1; + int error; + + sbuf_new_for_sysctl(&sbuf, NULL, 0, req); + if (zone->uz_flags != 0) + sbuf_printf(&sbuf, "0x%b", zone->uz_flags, PRINT_UMA_ZFLAGS); + else + sbuf_printf(&sbuf, "0"); + error = sbuf_finish(&sbuf); + sbuf_delete(&sbuf); + + return (error); } #ifdef INVARIANTS Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Wed Dec 11 06:34:48 2019 (r355604) +++ head/sys/vm/uma_int.h Wed Dec 11 06:50:55 2019 (r355605) @@ -420,6 +420,32 @@ struct uma_zone { #define UMA_ZFLAG_INHERIT \ (UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY | UMA_ZFLAG_BUCKET) +#define PRINT_UMA_ZFLAGS "\20" \ + "\40CACHEONLY" \ + "\37TRASH" \ + "\36INTERNAL" \ + "\35BUCKET" \ + "\34RECLAIMING" \ + "\33CACHE" \ + "\22MINBUCKET" \ + "\21NUMA" \ + "\20PCPU" \ + "\17NODUMP" \ + "\16VTOSLAB" \ + "\15CACHESPREAD" \ + "\14MAXBUCKET" \ + "\13NOBUCKET" \ + "\12SECONDARY" \ + "\11HASH" \ + "\10VM" \ + "\7MTXCLASS" \ + "\6NOFREE" \ + "\5MALLOC" \ + "\4OFFPAGE" \ + "\3STATIC" \ + "\2ZINIT" \ + "\1PAGEABLE" + #undef UMA_ALIGN #ifdef _KERNEL From owner-svn-src-all@freebsd.org Wed Dec 11 08:32:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C22B1D1128; Wed, 11 Dec 2019 08:32:41 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47Xqtc73csz3LfR; Wed, 11 Dec 2019 08:32:40 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0FB4026017B; Wed, 11 Dec 2019 09:31:11 +0100 (CET) Subject: Re: svn commit: r355600 - in head: share/man/man9 sys/kern sys/sys To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912102158.xBALwUF9075354@repo.freebsd.org> <3cc78418-6692-058c-eba5-1edc5286aeab@selasky.org> From: Hans Petter Selasky Message-ID: <4a5733c0-768a-faa7-1a3d-6ce1ad32904b@selasky.org> Date: Wed, 11 Dec 2019 09:30:14 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47Xqtc73csz3LfR 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)[-0.999,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 08:32:41 -0000 On 2019-12-10 23:47, John Baldwin wrote: > You mean passing the pointer to the callout itself and using that to get to the > relevant pointer? Yes. --HPS From owner-svn-src-all@freebsd.org Wed Dec 11 09:26:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79DE01D1D91; Wed, 11 Dec 2019 09:26:17 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_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 47Xs4T2j6fz3NNN; Wed, 11 Dec 2019 09:26:17 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 3AAB816949; Wed, 11 Dec 2019 09:26:17 +0000 (UTC) Date: Wed, 11 Dec 2019 09:26:17 +0000 From: Alexey Dokuchaev To: Hans Petter Selasky Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355600 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20191211092617.GA10000@FreeBSD.org> References: <201912102158.xBALwUF9075354@repo.freebsd.org> <3cc78418-6692-058c-eba5-1edc5286aeab@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3cc78418-6692-058c-eba5-1edc5286aeab@selasky.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 09:26:17 -0000 On Tue, Dec 10, 2019 at 11:09:41PM +0100, Hans Petter Selasky wrote: > On 2019-12-10 22:58, John Baldwin wrote: > > While here, add to the manpage. > > FYI: > > Linux guys eliminated the "void *c_arg" in their timer implementation by > using container_of() to get callback argument. We could possibly do the > same! #define container_of(ptr, type, member) ({ \ void *__mptr = (void *)(ptr); \ BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ !__same_type(*(ptr), void), \ "pointer type mismatch in container_of()"); \ ((type *)(__mptr - offsetof(type, member))); }) That's one of those things that make Linux so unpleasant to work with. Frankly, I don't think we want that for FreeBSD. ./danfe From owner-svn-src-all@freebsd.org Wed Dec 11 09:34:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22EBC1D1F9E; Wed, 11 Dec 2019 09:34:33 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47XsG106dFz3NpY; Wed, 11 Dec 2019 09:34:32 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 4375A26003E; Wed, 11 Dec 2019 10:32:33 +0100 (CET) Subject: Re: svn commit: r355600 - in head: share/man/man9 sys/kern sys/sys To: Alexey Dokuchaev Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912102158.xBALwUF9075354@repo.freebsd.org> <3cc78418-6692-058c-eba5-1edc5286aeab@selasky.org> <20191211092617.GA10000@FreeBSD.org> From: Hans Petter Selasky Message-ID: <9587687b-aea7-d835-7386-df79dbb9f2df@selasky.org> Date: Wed, 11 Dec 2019 10:31:25 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <20191211092617.GA10000@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47XsG106dFz3NpY X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 09:34:33 -0000 On 2019-12-11 10:26, Alexey Dokuchaev wrote: > That's one of those things that make Linux so unpleasant to work with. > Frankly, I don't think we want that for FreeBSD. The argument for the current callback is still a "void *". container_of() has some type checks at least. It is not a big deal though. --HPS From owner-svn-src-all@freebsd.org Wed Dec 11 14:27:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F27901D7DD2; Wed, 11 Dec 2019 14:27:00 +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 47XzlS68vKz49Gj; Wed, 11 Dec 2019 14:27:00 +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 CE91EC997; Wed, 11 Dec 2019 14:27:00 +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 xBBER05k055947; Wed, 11 Dec 2019 14:27:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBER0Qu055946; Wed, 11 Dec 2019 14:27:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912111427.xBBER0Qu055946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Dec 2019 14:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355606 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 355606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 14:27:01 -0000 Author: markj Date: Wed Dec 11 14:27:00 2019 New Revision: 355606 URL: https://svnweb.freebsd.org/changeset/base/355606 Log: MFC r355399: Fix an off-by-one error in vm_map_pmap_enter(). Modified: stable/12/sys/vm/vm_map.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Wed Dec 11 06:50:55 2019 (r355605) +++ stable/12/sys/vm/vm_map.c Wed Dec 11 14:27:00 2019 (r355606) @@ -2385,7 +2385,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offset_t addr, vm_p psize = atop(size); if (psize + pindex > object->size) { - if (object->size < pindex) { + if (pindex >= object->size) { VM_OBJECT_RUNLOCK(object); return; } From owner-svn-src-all@freebsd.org Wed Dec 11 14:27:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08DAC1D7E3D; Wed, 11 Dec 2019 14:27:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Xzm56VTfz49PQ; Wed, 11 Dec 2019 14:27:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA6BCC99A; Wed, 11 Dec 2019 14:27:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBBERX4m056017; Wed, 11 Dec 2019 14:27:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBERXGG056016; Wed, 11 Dec 2019 14:27:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912111427.xBBERXGG056016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Dec 2019 14:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355607 - stable/12/sys/dev/iwm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/dev/iwm X-SVN-Commit-Revision: 355607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 14:27:34 -0000 Author: markj Date: Wed Dec 11 14:27:33 2019 New Revision: 355607 URL: https://svnweb.freebsd.org/changeset/base/355607 Log: MFC r355143: iwm(4): Fix version string formatting. Modified: stable/12/sys/dev/iwm/if_iwm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/12/sys/dev/iwm/if_iwm.c Wed Dec 11 14:27:00 2019 (r355606) +++ stable/12/sys/dev/iwm/if_iwm.c Wed Dec 11 14:27:33 2019 (r355607) @@ -851,7 +851,7 @@ iwm_read_firmware(struct iwm_softc *sc) goto parse_out; } snprintf(sc->sc_fwver, sizeof(sc->sc_fwver), - "%d.%d.%d", + "%u.%u.%u", le32toh(((const uint32_t *)tlv_data)[0]), le32toh(((const uint32_t *)tlv_data)[1]), le32toh(((const uint32_t *)tlv_data)[2])); From owner-svn-src-all@freebsd.org Wed Dec 11 14:28:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22D3C1D7EEF; Wed, 11 Dec 2019 14:28:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47Xzmt0tzGz49ZX; Wed, 11 Dec 2019 14:28:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19B76C99D; Wed, 11 Dec 2019 14:28:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBBESEuo056095; Wed, 11 Dec 2019 14:28:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBESEMn056093; Wed, 11 Dec 2019 14:28:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912111428.xBBESEMn056093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Dec 2019 14:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355608 - stable/12/sys/dev/iwm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/dev/iwm X-SVN-Commit-Revision: 355608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 14:28:14 -0000 Author: markj Date: Wed Dec 11 14:28:13 2019 New Revision: 355608 URL: https://svnweb.freebsd.org/changeset/base/355608 Log: MFC r355144: iwm(4): Remove _mvm from the namespace. Modified: stable/12/sys/dev/iwm/if_iwm.c stable/12/sys/dev/iwm/if_iwm_binding.c stable/12/sys/dev/iwm/if_iwm_binding.h stable/12/sys/dev/iwm/if_iwm_constants.h stable/12/sys/dev/iwm/if_iwm_fw.c stable/12/sys/dev/iwm/if_iwm_led.c stable/12/sys/dev/iwm/if_iwm_led.h stable/12/sys/dev/iwm/if_iwm_mac_ctxt.c stable/12/sys/dev/iwm/if_iwm_mac_ctxt.h stable/12/sys/dev/iwm/if_iwm_phy_ctxt.c stable/12/sys/dev/iwm/if_iwm_phy_ctxt.h stable/12/sys/dev/iwm/if_iwm_power.c stable/12/sys/dev/iwm/if_iwm_power.h stable/12/sys/dev/iwm/if_iwm_scan.c stable/12/sys/dev/iwm/if_iwm_scan.h stable/12/sys/dev/iwm/if_iwm_sf.c stable/12/sys/dev/iwm/if_iwm_sf.h stable/12/sys/dev/iwm/if_iwm_sta.c stable/12/sys/dev/iwm/if_iwm_sta.h stable/12/sys/dev/iwm/if_iwm_time_event.c stable/12/sys/dev/iwm/if_iwm_time_event.h stable/12/sys/dev/iwm/if_iwm_util.c stable/12/sys/dev/iwm/if_iwm_util.h stable/12/sys/dev/iwm/if_iwmreg.h stable/12/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/12/sys/dev/iwm/if_iwm.c Wed Dec 11 14:27:33 2019 (r355607) +++ stable/12/sys/dev/iwm/if_iwm.c Wed Dec 11 14:28:13 2019 (r355608) @@ -231,10 +231,10 @@ struct iwm_nvm_section { uint8_t *data; }; -#define IWM_MVM_UCODE_ALIVE_TIMEOUT hz -#define IWM_MVM_UCODE_CALIB_TIMEOUT (2*hz) +#define IWM_UCODE_ALIVE_TIMEOUT hz +#define IWM_UCODE_CALIB_TIMEOUT (2*hz) -struct iwm_mvm_alive_data { +struct iwm_alive_data { int valid; uint32_t scd_base_addr; }; @@ -263,7 +263,7 @@ static void iwm_disable_interrupts(struct iwm_softc *) static void iwm_ict_reset(struct iwm_softc *); static int iwm_allow_mcast(struct ieee80211vap *, struct iwm_softc *); static void iwm_stop_device(struct iwm_softc *); -static void iwm_mvm_nic_config(struct iwm_softc *); +static void iwm_nic_config(struct iwm_softc *); static int iwm_nic_rx_init(struct iwm_softc *); static int iwm_nic_tx_init(struct iwm_softc *); static int iwm_nic_init(struct iwm_softc *); @@ -317,23 +317,23 @@ static int iwm_pcie_load_given_ucode(struct iwm_softc static int iwm_start_fw(struct iwm_softc *, const struct iwm_fw_img *); static int iwm_send_tx_ant_cfg(struct iwm_softc *, uint8_t); static int iwm_send_phy_cfg_cmd(struct iwm_softc *); -static int iwm_mvm_load_ucode_wait_alive(struct iwm_softc *, +static int iwm_load_ucode_wait_alive(struct iwm_softc *, enum iwm_ucode_type); -static int iwm_run_init_mvm_ucode(struct iwm_softc *, int); -static int iwm_mvm_config_ltr(struct iwm_softc *sc); +static int iwm_run_init_ucode(struct iwm_softc *, int); +static int iwm_config_ltr(struct iwm_softc *sc); static int iwm_rx_addbuf(struct iwm_softc *, int, int); -static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *, +static void iwm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_packet *); static int iwm_get_noise(struct iwm_softc *, - const struct iwm_mvm_statistics_rx_non_phy *); -static void iwm_mvm_handle_rx_statistics(struct iwm_softc *, + const struct iwm_statistics_rx_non_phy *); +static void iwm_handle_rx_statistics(struct iwm_softc *, struct iwm_rx_packet *); -static bool iwm_mvm_rx_mpdu(struct iwm_softc *, struct mbuf *, +static bool iwm_rx_mpdu(struct iwm_softc *, struct mbuf *, uint32_t, bool); -static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, +static int iwm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *, struct iwm_node *); -static void iwm_mvm_rx_tx_cmd(struct iwm_softc *, struct iwm_rx_packet *); +static void iwm_rx_tx_cmd(struct iwm_softc *, struct iwm_rx_packet *); static void iwm_cmd_done(struct iwm_softc *, struct iwm_rx_packet *); #if 0 static void iwm_update_sched(struct iwm_softc *, int, int, uint8_t, @@ -346,7 +346,7 @@ static int iwm_tx(struct iwm_softc *, struct mbuf *, struct ieee80211_node *, int); static int iwm_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); -static int iwm_mvm_update_quotas(struct iwm_softc *, struct iwm_vap *); +static int iwm_update_quotas(struct iwm_softc *, struct iwm_vap *); static int iwm_auth(struct ieee80211vap *, struct iwm_softc *); static struct ieee80211_node * iwm_node_alloc(struct ieee80211vap *, @@ -358,10 +358,10 @@ static int iwm_media_change(struct ifnet *); static int iwm_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void iwm_endscan_cb(void *, int); static int iwm_send_bt_init_conf(struct iwm_softc *); -static boolean_t iwm_mvm_is_lar_supported(struct iwm_softc *); -static boolean_t iwm_mvm_is_wifi_mcc_supported(struct iwm_softc *); +static boolean_t iwm_is_lar_supported(struct iwm_softc *); +static boolean_t iwm_is_wifi_mcc_supported(struct iwm_softc *); static int iwm_send_update_mcc_cmd(struct iwm_softc *, const char *); -static void iwm_mvm_tt_tx_backoff(struct iwm_softc *, uint32_t); +static void iwm_tt_tx_backoff(struct iwm_softc *, uint32_t); static int iwm_init_hw(struct iwm_softc *); static void iwm_init(struct iwm_softc *); static void iwm_start(struct iwm_softc *); @@ -1093,7 +1093,7 @@ iwm_alloc_tx_ring(struct iwm_softc *sc, struct iwm_tx_ * We only use rings 0 through 9 (4 EDCA + cmd) so there is no need * to allocate commands space for other rings. */ - if (qid > IWM_MVM_CMD_QUEUE) + if (qid > IWM_CMD_QUEUE) return 0; size = IWM_TX_RING_COUNT * sizeof(struct iwm_device_cmd); @@ -1106,7 +1106,7 @@ iwm_alloc_tx_ring(struct iwm_softc *sc, struct iwm_tx_ ring->cmd = ring->cmd_dma.vaddr; /* FW commands may require more mapped space than packets. */ - if (qid == IWM_MVM_CMD_QUEUE) { + if (qid == IWM_CMD_QUEUE) { maxsize = IWM_RBUF_SIZE; nsegments = 1; } else { @@ -1170,7 +1170,7 @@ iwm_reset_tx_ring(struct iwm_softc *sc, struct iwm_tx_ ring->queued = 0; ring->cur = 0; - if (ring->qid == IWM_MVM_CMD_QUEUE && sc->cmd_hold_nic_awake) + if (ring->qid == IWM_CMD_QUEUE && sc->cmd_hold_nic_awake) iwm_pcie_clear_cmd_in_flight(sc); } @@ -1359,11 +1359,11 @@ iwm_stop_device(struct iwm_softc *sc) /* iwlwifi: mvm/ops.c */ static void -iwm_mvm_nic_config(struct iwm_softc *sc) +iwm_nic_config(struct iwm_softc *sc) { uint8_t radio_cfg_type, radio_cfg_step, radio_cfg_dash; uint32_t reg_val = 0; - uint32_t phy_config = iwm_mvm_get_phy_config(sc); + uint32_t phy_config = iwm_get_phy_config(sc); radio_cfg_type = (phy_config & IWM_FW_PHY_CFG_RADIO_TYPE) >> IWM_FW_PHY_CFG_RADIO_TYPE_POS; @@ -1572,7 +1572,7 @@ iwm_nic_init(struct iwm_softc *sc) if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) iwm_set_pwr(sc); - iwm_mvm_nic_config(sc); + iwm_nic_config(sc); if ((error = iwm_nic_rx_init(sc)) != 0) return error; @@ -1605,7 +1605,7 @@ iwm_enable_txq(struct iwm_softc *sc, int sta_id, int q IWM_WRITE(sc, IWM_HBUS_TARG_WRPTR, qid << 8 | 0); - if (qid == IWM_MVM_CMD_QUEUE) { + if (qid == IWM_CMD_QUEUE) { /* Disable the scheduler. */ iwm_write_prph(sc, IWM_SCD_EN_CTRL, 0); @@ -1665,7 +1665,7 @@ iwm_enable_txq(struct iwm_softc *sc, int sta_id, int q cmd.aggregate = 0; cmd.window = IWM_FRAME_LIMIT; - error = iwm_mvm_send_cmd_pdu(sc, IWM_SCD_QUEUE_CFG, IWM_CMD_SYNC, + error = iwm_send_cmd_pdu(sc, IWM_SCD_QUEUE_CFG, IWM_CMD_SYNC, sizeof(cmd), &cmd); if (error) { device_printf(sc->sc_dev, @@ -1726,7 +1726,7 @@ iwm_trans_pcie_fw_alive(struct iwm_softc *sc, uint32_t iwm_nic_unlock(sc); /* enable command channel */ - error = iwm_enable_txq(sc, 0 /* unused */, IWM_MVM_CMD_QUEUE, 7); + error = iwm_enable_txq(sc, 0 /* unused */, IWM_CMD_QUEUE, 7); if (error) return error; @@ -2788,7 +2788,7 @@ iwm_send_tx_ant_cfg(struct iwm_softc *sc, uint8_t vali .valid = htole32(valid_tx_ant), }; - return iwm_mvm_send_cmd_pdu(sc, IWM_TX_ANT_CONFIGURATION_CMD, + return iwm_send_cmd_pdu(sc, IWM_TX_ANT_CONFIGURATION_CMD, IWM_CMD_SYNC, sizeof(tx_ant_cmd), &tx_ant_cmd); } @@ -2800,7 +2800,7 @@ iwm_send_phy_cfg_cmd(struct iwm_softc *sc) enum iwm_ucode_type ucode_type = sc->cur_ucode; /* Set parameters */ - phy_cfg_cmd.phy_cfg = htole32(iwm_mvm_get_phy_config(sc)); + phy_cfg_cmd.phy_cfg = htole32(iwm_get_phy_config(sc)); phy_cfg_cmd.calib_control.event_trigger = sc->sc_default_calib[ucode_type].event_trigger; phy_cfg_cmd.calib_control.flow_trigger = @@ -2808,16 +2808,16 @@ iwm_send_phy_cfg_cmd(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, "Sending Phy CFG command: 0x%x\n", phy_cfg_cmd.phy_cfg); - return iwm_mvm_send_cmd_pdu(sc, IWM_PHY_CONFIGURATION_CMD, IWM_CMD_SYNC, + return iwm_send_cmd_pdu(sc, IWM_PHY_CONFIGURATION_CMD, IWM_CMD_SYNC, sizeof(phy_cfg_cmd), &phy_cfg_cmd); } static int iwm_alive_fn(struct iwm_softc *sc, struct iwm_rx_packet *pkt, void *data) { - struct iwm_mvm_alive_data *alive_data = data; - struct iwm_mvm_alive_resp_v3 *palive3; - struct iwm_mvm_alive_resp *palive; + struct iwm_alive_data *alive_data = data; + struct iwm_alive_resp_v3 *palive3; + struct iwm_alive_resp *palive; struct iwm_umac_alive *umac; struct iwm_lmac_alive *lmac1; struct iwm_lmac_alive *lmac2 = NULL; @@ -2885,15 +2885,15 @@ iwm_wait_phy_db_entry(struct iwm_softc *sc, } static int -iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, +iwm_load_ucode_wait_alive(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) { struct iwm_notification_wait alive_wait; - struct iwm_mvm_alive_data alive_data; + struct iwm_alive_data alive_data; const struct iwm_fw_img *fw; enum iwm_ucode_type old_type = sc->cur_ucode; int error; - static const uint16_t alive_cmd[] = { IWM_MVM_ALIVE }; + static const uint16_t alive_cmd[] = { IWM_ALIVE }; fw = &sc->sc_fw.img[ucode_type]; sc->cur_ucode = ucode_type; @@ -2918,7 +2918,7 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, */ IWM_UNLOCK(sc); error = iwm_wait_notification(sc->sc_notif_wait, &alive_wait, - IWM_MVM_UCODE_ALIVE_TIMEOUT); + IWM_UCODE_ALIVE_TIMEOUT); IWM_LOCK(sc); if (error) { if (sc->cfg->device_family >= IWM_DEVICE_FAMILY_8000) { @@ -2981,7 +2981,7 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, * follows iwlwifi/fw.c */ static int -iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justnvm) +iwm_run_init_ucode(struct iwm_softc *sc, int justnvm) { struct iwm_notification_wait calib_wait; static const uint16_t init_complete[] = { @@ -3005,7 +3005,7 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn sc->sc_phy_db); /* Will also start the device */ - ret = iwm_mvm_load_ucode_wait_alive(sc, IWM_UCODE_INIT); + ret = iwm_load_ucode_wait_alive(sc, IWM_UCODE_INIT); if (ret) { device_printf(sc->sc_dev, "Failed to start INIT ucode: %d\n", ret); @@ -3033,7 +3033,7 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn } /* Send TX valid antennas before triggering calibrations */ - ret = iwm_send_tx_ant_cfg(sc, iwm_mvm_get_valid_tx_ant(sc)); + ret = iwm_send_tx_ant_cfg(sc, iwm_get_valid_tx_ant(sc)); if (ret) { device_printf(sc->sc_dev, "failed to send antennas before calibration: %d\n", ret); @@ -3058,7 +3058,7 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn */ IWM_UNLOCK(sc); ret = iwm_wait_notification(sc->sc_notif_wait, &calib_wait, - IWM_MVM_UCODE_CALIB_TIMEOUT); + IWM_UCODE_CALIB_TIMEOUT); IWM_LOCK(sc); @@ -3071,7 +3071,7 @@ out: } static int -iwm_mvm_config_ltr(struct iwm_softc *sc) +iwm_config_ltr(struct iwm_softc *sc) { struct iwm_ltr_config_cmd cmd = { .flags = htole32(IWM_LTR_CFG_FLAG_FEATURE_ENABLE), @@ -3080,7 +3080,7 @@ iwm_mvm_config_ltr(struct iwm_softc *sc) if (!sc->sc_ltr_enabled) return 0; - return iwm_mvm_send_cmd_pdu(sc, IWM_LTR_CONFIG, 0, sizeof(cmd), &cmd); + return iwm_send_cmd_pdu(sc, IWM_LTR_CONFIG, 0, sizeof(cmd), &cmd); } /* @@ -3136,7 +3136,7 @@ iwm_rx_addbuf(struct iwm_softc *sc, int size, int idx) } static void -iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt) +iwm_rx_rx_phy_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt) { struct iwm_rx_phy_info *phy_info = (void *)pkt->data; @@ -3150,7 +3150,7 @@ iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *sc, struct iwm */ static int iwm_get_noise(struct iwm_softc *sc, - const struct iwm_mvm_statistics_rx_non_phy *stats) + const struct iwm_statistics_rx_non_phy *stats) { int i, total, nbant, noise; @@ -3180,7 +3180,7 @@ iwm_get_noise(struct iwm_softc *sc, } static void -iwm_mvm_handle_rx_statistics(struct iwm_softc *sc, struct iwm_rx_packet *pkt) +iwm_handle_rx_statistics(struct iwm_softc *sc, struct iwm_rx_packet *pkt) { struct iwm_notif_statistics_v10 *stats = (void *)&pkt->data; @@ -3190,13 +3190,13 @@ iwm_mvm_handle_rx_statistics(struct iwm_softc *sc, str /* iwlwifi: mvm/rx.c */ /* - * iwm_mvm_get_signal_strength - use new rx PHY INFO API + * iwm_get_signal_strength - use new rx PHY INFO API * values are reported by the fw as positive values - need to negate * to obtain their dBM. Account for missing antennas by replacing 0 * values by -256dBm: practically 0 power and a non-feasible 8 bit value. */ static int -iwm_mvm_rx_get_signal_strength(struct iwm_softc *sc, +iwm_rx_get_signal_strength(struct iwm_softc *sc, struct iwm_rx_phy_info *phy_info) { int energy_a, energy_b, energy_c, max_energy; @@ -3223,7 +3223,7 @@ iwm_mvm_rx_get_signal_strength(struct iwm_softc *sc, } static int -iwm_mvm_rxmq_get_signal_strength(struct iwm_softc *sc, +iwm_rxmq_get_signal_strength(struct iwm_softc *sc, struct iwm_rx_mpdu_desc *desc) { int energy_a, energy_b; @@ -3236,12 +3236,12 @@ iwm_mvm_rxmq_get_signal_strength(struct iwm_softc *sc, } /* - * iwm_mvm_rx_rx_mpdu - IWM_REPLY_RX_MPDU_CMD handler + * iwm_rx_rx_mpdu - IWM_REPLY_RX_MPDU_CMD handler * * Handles the actual data of the Rx packet from the fw */ static bool -iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, +iwm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, bool stolen) { struct ieee80211com *ic = &sc->sc_ic; @@ -3275,7 +3275,7 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * return false; } - rssi = iwm_mvm_rx_get_signal_strength(sc, phy_info); + rssi = iwm_rx_get_signal_strength(sc, phy_info); /* Map it to relative value */ rssi = rssi - sc->sc_noise; @@ -3354,7 +3354,7 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * } static bool -iwm_mvm_rx_mpdu_mq(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, +iwm_rx_mpdu_mq(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, bool stolen) { struct ieee80211com *ic = &sc->sc_ic; @@ -3397,7 +3397,7 @@ iwm_mvm_rx_mpdu_mq(struct iwm_softc *sc, struct mbuf * } /* Map it to relative value */ - rssi = iwm_mvm_rxmq_get_signal_strength(sc, desc); + rssi = iwm_rxmq_get_signal_strength(sc, desc); rssi = rssi - sc->sc_noise; /* replenish ring for the buffer we're going to feed to the sharks */ @@ -3462,7 +3462,7 @@ iwm_mvm_rx_mpdu_mq(struct iwm_softc *sc, struct mbuf * } static bool -iwm_mvm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, +iwm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, bool stolen) { struct ieee80211com *ic; @@ -3473,8 +3473,8 @@ iwm_mvm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, ic = &sc->sc_ic; ret = sc->cfg->mqrx_supported ? - iwm_mvm_rx_mpdu_mq(sc, m, offset, stolen) : - iwm_mvm_rx_rx_mpdu(sc, m, offset, stolen); + iwm_rx_mpdu_mq(sc, m, offset, stolen) : + iwm_rx_rx_mpdu(sc, m, offset, stolen); if (!ret) { counter_u64_add(ic->ic_ierrors, 1); return (ret); @@ -3498,10 +3498,10 @@ iwm_mvm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, } static int -iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct iwm_rx_packet *pkt, +iwm_rx_tx_cmd_single(struct iwm_softc *sc, struct iwm_rx_packet *pkt, struct iwm_node *in) { - struct iwm_mvm_tx_resp *tx_resp = (void *)pkt->data; + struct iwm_tx_resp *tx_resp = (void *)pkt->data; struct ieee80211_ratectl_tx_status *txs = &sc->sc_txs; struct ieee80211_node *ni = &in->in_ni; struct ieee80211vap *vap = ni->ni_vap; @@ -3567,7 +3567,7 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct if (new_rate != 0 && new_rate != cur_rate) { struct iwm_node *in = IWM_NODE(vap->iv_bss); iwm_setrates(sc, in, rix); - iwm_mvm_send_lq_cmd(sc, &in->in_lq, FALSE); + iwm_send_lq_cmd(sc, &in->in_lq, FALSE); } } @@ -3575,7 +3575,7 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct } static void -iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt) +iwm_rx_tx_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt) { struct iwm_cmd_header *cmd_hdr; struct iwm_tx_ring *ring; @@ -3599,7 +3599,7 @@ iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, struct iwm_rx_ sc->sc_tx_timer = 0; - status = iwm_mvm_rx_tx_cmd_single(sc, pkt, in); + status = iwm_rx_tx_cmd_single(sc, pkt, in); /* Unmap and free mbuf. */ bus_dmamap_sync(ring->data_dmat, txd->map, BUS_DMASYNC_POSTWRITE); @@ -3633,10 +3633,10 @@ iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, struct iwm_rx_ static void iwm_cmd_done(struct iwm_softc *sc, struct iwm_rx_packet *pkt) { - struct iwm_tx_ring *ring = &sc->txq[IWM_MVM_CMD_QUEUE]; + struct iwm_tx_ring *ring = &sc->txq[IWM_CMD_QUEUE]; struct iwm_tx_data *data; - if (pkt->hdr.qid != IWM_MVM_CMD_QUEUE) { + if (pkt->hdr.qid != IWM_CMD_QUEUE) { return; /* Not a command ack. */ } @@ -4047,7 +4047,7 @@ iwm_raw_xmit(struct ieee80211_node *ni, struct mbuf *m * 3) wait for the transport queues to be empty */ int -iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t tfd_msk, uint32_t flags) +iwm_flush_tx_path(struct iwm_softc *sc, uint32_t tfd_msk, uint32_t flags) { int ret; struct iwm_tx_path_flush_cmd flush_cmd = { @@ -4055,7 +4055,7 @@ iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t t .flush_ctl = htole16(IWM_DUMP_TX_FIFO_FLUSH), }; - ret = iwm_mvm_send_cmd_pdu(sc, IWM_TXPATH_FLUSH, flags, + ret = iwm_send_cmd_pdu(sc, IWM_TXPATH_FLUSH, flags, sizeof(flush_cmd), &flush_cmd); if (ret) device_printf(sc->sc_dev, @@ -4068,7 +4068,7 @@ iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t t */ static int -iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm_vap *ivp) +iwm_update_quotas(struct iwm_softc *sc, struct iwm_vap *ivp) { struct iwm_time_quota_cmd cmd; int i, idx, ret, num_active_macs, quota, quota_rem; @@ -4090,7 +4090,7 @@ iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm /* * The FW's scheduling session consists of - * IWM_MVM_MAX_QUOTA fragments. Divide these fragments + * IWM_MAX_QUOTA fragments. Divide these fragments * equally between all the bindings that require quota */ num_active_macs = 0; @@ -4102,8 +4102,8 @@ iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm quota = 0; quota_rem = 0; if (num_active_macs) { - quota = IWM_MVM_MAX_QUOTA / num_active_macs; - quota_rem = IWM_MVM_MAX_QUOTA % num_active_macs; + quota = IWM_MAX_QUOTA / num_active_macs; + quota_rem = IWM_MAX_QUOTA % num_active_macs; } for (idx = 0, i = 0; i < IWM_MAX_BINDINGS; i++) { @@ -4126,7 +4126,7 @@ iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm /* Give the remainder of the session to the first binding */ cmd.quotas[0].quota = htole32(le32toh(cmd.quotas[0].quota) + quota_rem); - ret = iwm_mvm_send_cmd_pdu(sc, IWM_TIME_QUOTA_CMD, IWM_CMD_SYNC, + ret = iwm_send_cmd_pdu(sc, IWM_TIME_QUOTA_CMD, IWM_CMD_SYNC, sizeof(cmd), &cmd); if (ret) device_printf(sc->sc_dev, @@ -4210,13 +4210,13 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s * contexts that are required), let's do a dirty hack here. */ if (iv->is_uploaded) { - if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { + if ((error = iwm_mac_ctxt_changed(sc, vap)) != 0) { device_printf(sc->sc_dev, "%s: failed to update MAC\n", __func__); goto out; } } else { - if ((error = iwm_mvm_mac_ctxt_add(sc, vap)) != 0) { + if ((error = iwm_mac_ctxt_add(sc, vap)) != 0) { device_printf(sc->sc_dev, "%s: failed to add MAC\n", __func__); goto out; @@ -4224,7 +4224,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s } sc->sc_firmware_state = 1; - if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], + if ((error = iwm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], in->in_ni.ni_chan, 1, 1)) != 0) { device_printf(sc->sc_dev, "%s: failed update phy ctxt\n", __func__); @@ -4232,7 +4232,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s } iv->phy_ctxt = &sc->sc_phyctxt[0]; - if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) { + if ((error = iwm_binding_add_vif(sc, iv)) != 0) { device_printf(sc->sc_dev, "%s: binding update cmd\n", __func__); goto out; @@ -4244,7 +4244,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s * finished or is aborted. */ iv->ps_disabled = TRUE; - error = iwm_mvm_power_update_mac(sc); + error = iwm_power_update_mac(sc); iv->ps_disabled = FALSE; if (error != 0) { device_printf(sc->sc_dev, @@ -4252,7 +4252,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s __func__); goto out; } - if ((error = iwm_mvm_add_sta(sc, in)) != 0) { + if ((error = iwm_add_sta(sc, in)) != 0) { device_printf(sc->sc_dev, "%s: failed to add sta\n", __func__); goto out; @@ -4264,8 +4264,8 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s * by "protecting" the session with a time event. */ /* XXX duration is in units of TU, not MS */ - duration = IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS; - iwm_mvm_protect_session(sc, iv, duration, 500 /* XXX magic number */, TRUE); + duration = IWM_TE_SESSION_PROTECTION_MAX_TIME_MS; + iwm_protect_session(sc, iv, duration, 500 /* XXX magic number */, TRUE); error = 0; out: @@ -4390,11 +4390,11 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in #if 0 if (txant == 0) - txant = iwm_mvm_get_valid_tx_ant(sc); + txant = iwm_get_valid_tx_ant(sc); nextant = 1<<(ffs(txant)-1); txant &= ~nextant; #else - nextant = iwm_mvm_get_valid_tx_ant(sc); + nextant = iwm_get_valid_tx_ant(sc); #endif tab = iwm_rates[ridx].plcp; tab |= nextant << IWM_RATE_MCS_ANT_POS; @@ -4445,8 +4445,8 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i ivp->iv_auth = 0; if (sc->sc_firmware_state == 3) { iwm_xmit_queue_drain(sc); -// iwm_mvm_flush_tx_path(sc, 0xf, IWM_CMD_SYNC); - error = iwm_mvm_rm_sta(sc, vap, TRUE); +// iwm_flush_tx_path(sc, 0xf, IWM_CMD_SYNC); + error = iwm_rm_sta(sc, vap, TRUE); if (error) { device_printf(sc->sc_dev, "%s: Failed to remove station: %d\n", @@ -4454,7 +4454,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i } } if (sc->sc_firmware_state == 3) { - error = iwm_mvm_mac_ctxt_changed(sc, vap); + error = iwm_mac_ctxt_changed(sc, vap); if (error) { device_printf(sc->sc_dev, "%s: Failed to change mac context: %d\n", @@ -4462,7 +4462,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i } } if (sc->sc_firmware_state == 3) { - error = iwm_mvm_sf_update(sc, vap, FALSE); + error = iwm_sf_update(sc, vap, FALSE); if (error) { device_printf(sc->sc_dev, "%s: Failed to update smart FIFO: %d\n", @@ -4470,7 +4470,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i } } if (sc->sc_firmware_state == 3) { - error = iwm_mvm_rm_sta_id(sc, vap); + error = iwm_rm_sta_id(sc, vap); if (error) { device_printf(sc->sc_dev, "%s: Failed to remove station id: %d\n", @@ -4478,7 +4478,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i } } if (sc->sc_firmware_state == 3) { - error = iwm_mvm_update_quotas(sc, NULL); + error = iwm_update_quotas(sc, NULL); if (error) { device_printf(sc->sc_dev, "%s: Failed to update PHY quota: %d\n", @@ -4487,7 +4487,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i } if (sc->sc_firmware_state == 3) { /* XXX Might need to specify bssid correctly. */ - error = iwm_mvm_mac_ctxt_changed(sc, vap); + error = iwm_mac_ctxt_changed(sc, vap); if (error) { device_printf(sc->sc_dev, "%s: Failed to change mac context: %d\n", @@ -4498,7 +4498,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i sc->sc_firmware_state = 2; } if (sc->sc_firmware_state > 1) { - error = iwm_mvm_binding_remove_vif(sc, ivp); + error = iwm_binding_remove_vif(sc, ivp); if (error) { device_printf(sc->sc_dev, "%s: Failed to remove channel ctx: %d\n", @@ -4510,7 +4510,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i } ivp->phy_ctxt = NULL; if (sc->sc_firmware_state > 0) { - error = iwm_mvm_mac_ctxt_changed(sc, vap); + error = iwm_mac_ctxt_changed(sc, vap); if (error) { device_printf(sc->sc_dev, "%s: Failed to change mac context: %d\n", @@ -4518,7 +4518,7 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i } } if (sc->sc_firmware_state > 0) { - error = iwm_mvm_power_update_mac(sc); + error = iwm_power_update_mac(sc); if (error != 0) { device_printf(sc->sc_dev, "%s: failed to update power management\n", @@ -4555,9 +4555,9 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ } if (vap->iv_state == IEEE80211_S_RUN && nstate != IEEE80211_S_RUN) { - iwm_mvm_led_disable(sc); + iwm_led_disable(sc); /* disable beacon filtering if we're hopping out of RUN */ - iwm_mvm_disable_beacon_filter(sc); + iwm_disable_beacon_filter(sc); if (((in = IWM_NODE(vap->iv_bss)) != NULL)) in->in_assoc = 0; } @@ -4568,7 +4568,7 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ (nstate == IEEE80211_S_INIT || nstate == IEEE80211_S_SCAN || nstate == IEEE80211_S_AUTH)) { - iwm_mvm_stop_session_protection(sc, ivp); + iwm_stop_session_protection(sc, ivp); } if ((vap->iv_state == IEEE80211_S_RUN || @@ -4620,7 +4620,7 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ in = IWM_NODE(vap->iv_bss); /* Update the association state, now we have it all */ /* (eg associd comes in at this point */ - error = iwm_mvm_update_sta(sc, in); + error = iwm_update_sta(sc, in); if (error != 0) { device_printf(sc->sc_dev, "%s: failed to update STA\n", __func__); @@ -4629,25 +4629,25 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ return error; } in->in_assoc = 1; - error = iwm_mvm_mac_ctxt_changed(sc, vap); + error = iwm_mac_ctxt_changed(sc, vap); if (error != 0) { device_printf(sc->sc_dev, "%s: failed to update MAC: %d\n", __func__, error); } - iwm_mvm_sf_update(sc, vap, FALSE); - iwm_mvm_enable_beacon_filter(sc, ivp); - iwm_mvm_power_update_mac(sc); - iwm_mvm_update_quotas(sc, ivp); + iwm_sf_update(sc, vap, FALSE); + iwm_enable_beacon_filter(sc, ivp); + iwm_power_update_mac(sc); + iwm_update_quotas(sc, ivp); int rix = ieee80211_ratectl_rate(&in->in_ni, NULL, 0); iwm_setrates(sc, in, rix); - if ((error = iwm_mvm_send_lq_cmd(sc, &in->in_lq, TRUE)) != 0) { + if ((error = iwm_send_lq_cmd(sc, &in->in_lq, TRUE)) != 0) { device_printf(sc->sc_dev, "%s: IWM_LQ_CMD failed: %d\n", __func__, error); } - iwm_mvm_led_enable(sc); + iwm_led_enable(sc); break; default: @@ -4680,12 +4680,12 @@ iwm_send_bt_init_conf(struct iwm_softc *sc) bt_cmd.mode = htole32(IWM_BT_COEX_WIFI); bt_cmd.enabled_modules = htole32(IWM_BT_COEX_HIGH_BAND_RET); - return iwm_mvm_send_cmd_pdu(sc, IWM_BT_CONFIG, 0, sizeof(bt_cmd), + return iwm_send_cmd_pdu(sc, IWM_BT_CONFIG, 0, sizeof(bt_cmd), &bt_cmd); } static boolean_t -iwm_mvm_is_lar_supported(struct iwm_softc *sc) +iwm_is_lar_supported(struct iwm_softc *sc) { boolean_t nvm_lar = sc->nvm_data->lar_enabled; boolean_t tlv_lar = iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_LAR_SUPPORT); @@ -4704,7 +4704,7 @@ iwm_mvm_is_lar_supported(struct iwm_softc *sc) } static boolean_t -iwm_mvm_is_wifi_mcc_supported(struct iwm_softc *sc) +iwm_is_wifi_mcc_supported(struct iwm_softc *sc) { return iwm_fw_has_api(sc, IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) || iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_LAR_MULTI_MCC); @@ -4729,7 +4729,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch #endif int resp_v2 = iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_LAR_SUPPORT_V2); - if (!iwm_mvm_is_lar_supported(sc)) { + if (!iwm_is_lar_supported(sc)) { IWM_DPRINTF(sc, IWM_DEBUG_LAR, "%s: no LAR support\n", __func__); return 0; @@ -4737,7 +4737,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch memset(&mcc_cmd, 0, sizeof(mcc_cmd)); mcc_cmd.mcc = htole16(alpha2[0] << 8 | alpha2[1]); - if (iwm_mvm_is_wifi_mcc_supported(sc)) + if (iwm_is_wifi_mcc_supported(sc)) mcc_cmd.source_id = IWM_MCC_SOURCE_GET_CURRENT; else mcc_cmd.source_id = IWM_MCC_SOURCE_OLD_FW; @@ -4783,7 +4783,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch } static void -iwm_mvm_tt_tx_backoff(struct iwm_softc *sc, uint32_t backoff) +iwm_tt_tx_backoff(struct iwm_softc *sc, uint32_t backoff) { struct iwm_host_cmd cmd = { .id = IWM_REPLY_THERMAL_MNG_BACKOFF, @@ -4810,8 +4810,8 @@ iwm_init_hw(struct iwm_softc *sc) return error; } - if ((error = iwm_run_init_mvm_ucode(sc, 0)) != 0) { - printf("iwm_run_init_mvm_ucode: failed %d\n", error); + if ((error = iwm_run_init_ucode(sc, 0)) != 0) { + printf("iwm_run_init_ucode: failed %d\n", error); return error; } @@ -4827,13 +4827,13 @@ iwm_init_hw(struct iwm_softc *sc) } /* omstart, this time with the regular firmware */ - error = iwm_mvm_load_ucode_wait_alive(sc, IWM_UCODE_REGULAR); + error = iwm_load_ucode_wait_alive(sc, IWM_UCODE_REGULAR); if (error) { device_printf(sc->sc_dev, "could not load firmware\n"); goto error; } - error = iwm_mvm_sf_update(sc, NULL, FALSE); + error = iwm_sf_update(sc, NULL, FALSE); if (error) device_printf(sc->sc_dev, "Failed to initialize Smart Fifo\n"); @@ -4842,7 +4842,7 @@ iwm_init_hw(struct iwm_softc *sc) goto error; } - error = iwm_send_tx_ant_cfg(sc, iwm_mvm_get_valid_tx_ant(sc)); + error = iwm_send_tx_ant_cfg(sc, iwm_get_valid_tx_ant(sc)); if (error != 0) { device_printf(sc->sc_dev, "antenna config failed\n"); goto error; @@ -4858,7 +4858,7 @@ iwm_init_hw(struct iwm_softc *sc) } /* Add auxiliary station for scanning */ - if ((error = iwm_mvm_add_aux_sta(sc)) != 0) { + if ((error = iwm_add_aux_sta(sc)) != 0) { device_printf(sc->sc_dev, "add_aux_sta failed\n"); goto error; } @@ -4869,19 +4869,19 @@ iwm_init_hw(struct iwm_softc *sc) * going to be overwritten in the other flows. * For now use the first channel we have. */ - if ((error = iwm_mvm_phy_ctxt_add(sc, + if ((error = iwm_phy_ctxt_add(sc, &sc->sc_phyctxt[i], &ic->ic_channels[1], 1, 1)) != 0) goto error; } /* Initialize tx backoffs to the minimum. */ if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) - iwm_mvm_tt_tx_backoff(sc, 0); + iwm_tt_tx_backoff(sc, 0); - if (iwm_mvm_config_ltr(sc) != 0) + if (iwm_config_ltr(sc) != 0) device_printf(sc->sc_dev, "PCIe LTR configuration failed\n"); - error = iwm_mvm_power_update_device(sc); + error = iwm_power_update_device(sc); if (error) goto error; @@ -4889,19 +4889,19 @@ iwm_init_hw(struct iwm_softc *sc) goto error; if (iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { - if ((error = iwm_mvm_config_umac_scan(sc)) != 0) + if ((error = iwm_config_umac_scan(sc)) != 0) goto error; } /* Enable Tx queues. */ for (ac = 0; ac < WME_NUM_AC; ac++) { error = iwm_enable_txq(sc, IWM_STATION_ID, ac, - iwm_mvm_ac_to_tx_fifo[ac]); + iwm_ac_to_tx_fifo[ac]); if (error) goto error; } - if ((error = iwm_mvm_disable_beacon_filter(sc)) != 0) { + if ((error = iwm_disable_beacon_filter(sc)) != 0) { device_printf(sc->sc_dev, "failed to disable beacon filter\n"); goto error; } @@ -4932,7 +4932,7 @@ iwm_allow_mcast(struct ieee80211vap *vap, struct iwm_s cmd->pass_all = 1; IEEE80211_ADDR_COPY(cmd->bssid, ni->ni_bssid); - error = iwm_mvm_send_cmd_pdu(sc, IWM_MCAST_FILTER_CMD, + error = iwm_send_cmd_pdu(sc, IWM_MCAST_FILTER_CMD, IWM_CMD_SYNC, size, cmd); free(cmd, M_DEVBUF); @@ -5372,7 +5372,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) switch (code) { case IWM_REPLY_RX_PHY_CMD: - iwm_mvm_rx_rx_phy_cmd(sc, pkt); + iwm_rx_rx_phy_cmd(sc, pkt); break; case IWM_REPLY_RX_MPDU_CMD: { @@ -5388,7 +5388,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) nextpkt->hdr.idx == 0) || (nextpkt->len_n_flags == htole32(IWM_FH_RSCSR_FRAME_INVALID))) { - if (iwm_mvm_rx_mpdu(sc, m, offset, stolen)) { + if (iwm_rx_mpdu(sc, m, offset, stolen)) { stolen = FALSE; /* Make sure we abort the loop */ nextoff = maxoff; @@ -5399,14 +5399,14 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) /* * Use m_copym instead of m_split, because that * makes it easier to keep a valid rx buffer in - * the ring, when iwm_mvm_rx_mpdu() fails. + * the ring, when iwm_rx_mpdu() fails. * * We need to start m_copym() at offset 0, to get the * M_PKTHDR flag preserved. */ m1 = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (m1) { - if (iwm_mvm_rx_mpdu(sc, m1, offset, stolen)) + if (iwm_rx_mpdu(sc, m1, offset, stolen)) stolen = TRUE; else m_freem(m1); @@ -5415,7 +5415,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) } case IWM_TX_CMD: - iwm_mvm_rx_tx_cmd(sc, pkt); + iwm_rx_tx_cmd(sc, pkt); break; case IWM_MISSED_BEACONS_NOTIFICATION: { @@ -5460,14 +5460,14 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) case IWM_MFUART_LOAD_NOTIFICATION: break; - case IWM_MVM_ALIVE: + case IWM_ALIVE: break; case IWM_CALIB_RES_NOTIF_PHY_DB: break; case IWM_STATISTICS_NOTIFICATION: - iwm_mvm_handle_rx_statistics(sc, pkt); + iwm_handle_rx_statistics(sc, pkt); break; case IWM_NVM_ACCESS_CMD: @@ -5548,7 +5548,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) break; case IWM_SCAN_OFFLOAD_COMPLETE: - iwm_mvm_rx_lmac_scan_complete_notif(sc, pkt); + iwm_rx_lmac_scan_complete_notif(sc, pkt); if (sc->sc_flags & IWM_FLAG_SCAN_RUNNING) { sc->sc_flags &= ~IWM_FLAG_SCAN_RUNNING; ieee80211_runtask(ic, &sc->sc_es_task); @@ -5562,7 +5562,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) } case IWM_SCAN_COMPLETE_UMAC: - iwm_mvm_rx_umac_scan_complete_notif(sc, pkt); + iwm_rx_umac_scan_complete_notif(sc, pkt); if (sc->sc_flags & IWM_FLAG_SCAN_RUNNING) { sc->sc_flags &= ~IWM_FLAG_SCAN_RUNNING; ieee80211_runtask(ic, &sc->sc_es_task); @@ -5591,7 +5591,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) } case IWM_TIME_EVENT_NOTIFICATION: - iwm_mvm_rx_time_event_notif(sc, pkt); + iwm_rx_time_event_notif(sc, pkt); break; /* @@ -5763,7 +5763,7 @@ iwm_intr(void *arg) #endif /* Dump driver status (TX and RX rings) while we're here. */ device_printf(sc->sc_dev, "driver status:\n"); - for (i = 0; i < IWM_MVM_MAX_QUEUES; i++) { + for (i = 0; i < IWM_MAX_QUEUES; i++) { struct iwm_tx_ring *ring = &sc->txq[i]; device_printf(sc->sc_dev, " tx ring %2d: qid=%-2d cur=%-3d " @@ -6266,7 +6266,7 @@ iwm_wme_update(struct ieee80211com *ic) if (ivp->is_uploaded && vap->iv_bss != NULL) { in = IWM_NODE(vap->iv_bss); if (in->in_assoc) { - if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { + if ((error = iwm_mac_ctxt_changed(sc, vap)) != 0) { device_printf(sc->sc_dev, "%s: failed to update MAC\n", __func__); } @@ -6296,7 +6296,7 @@ iwm_preinit(void *arg) goto fail; } - error = iwm_run_init_mvm_ucode(sc, 1); + error = iwm_run_init_ucode(sc, 1); iwm_stop_device(sc); if (error) { IWM_UNLOCK(sc); @@ -6439,9 +6439,9 @@ iwm_scan_start(struct ieee80211com *ic) "%s: Previous scan not completed yet\n", __func__); } if (iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) - error = iwm_mvm_umac_scan(sc); + error = iwm_umac_scan(sc); else - error = iwm_mvm_lmac_scan(sc); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 11 14:54:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE23F1D8916; Wed, 11 Dec 2019 14:54: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 47Y0M95y0Tz4C84; Wed, 11 Dec 2019 14:54: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 C2E20CF1D; Wed, 11 Dec 2019 14:54: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 xBBEsTHB073428; Wed, 11 Dec 2019 14:54:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBEsT42073427; Wed, 11 Dec 2019 14:54:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912111454.xBBEsT42073427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Dec 2019 14:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355609 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 355609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 14:54:30 -0000 Author: emaste Date: Wed Dec 11 14:54:29 2019 New Revision: 355609 URL: https://svnweb.freebsd.org/changeset/base/355609 Log: Make NOCLEAN an error instead of a warning The warning was added in r289728 (over four years ago) and at that time NO_CLEAN was already the correct spelling for over a decade. Make NOCLEAN an error as the next step to removing these backward compatibility shims. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Dec 11 14:28:13 2019 (r355608) +++ head/Makefile.inc1 Wed Dec 11 14:54:29 2019 (r355609) @@ -458,8 +458,7 @@ SUBDIR+=etc .endif # !empty(SUBDIR_OVERRIDE) .if defined(NOCLEAN) -.warning NOCLEAN option is deprecated. Use NO_CLEAN instead. -NO_CLEAN= ${NOCLEAN} +.error NOCLEAN option is deprecated. Use NO_CLEAN instead. .endif .if defined(NO_CLEANDIR) CLEANDIR= clean cleandepend From owner-svn-src-all@freebsd.org Wed Dec 11 15:15:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1E201D8D6A; Wed, 11 Dec 2019 15:15:23 +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 47Y0qH4Fssz4D7L; Wed, 11 Dec 2019 15:15:23 +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 8D322D2BB; Wed, 11 Dec 2019 15:15:23 +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 xBBFFNDr085344; Wed, 11 Dec 2019 15:15:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBFFLRl085334; Wed, 11 Dec 2019 15:15:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201912111515.xBBFFLRl085334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 Dec 2019 15:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355610 - in stable/12/sys: cam geom kern X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys: cam geom kern X-SVN-Commit-Revision: 355610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 15:15:23 -0000 Author: mav Date: Wed Dec 11 15:15:21 2019 New Revision: 355610 URL: https://svnweb.freebsd.org/changeset/base/355610 Log: MFC r355404: Mark some more hot global variables with __read_mostly. Modified: stable/12/sys/cam/cam_xpt.c stable/12/sys/geom/geom_io.c stable/12/sys/geom/geom_kern.c stable/12/sys/kern/kern_mtxpool.c stable/12/sys/kern/kern_shutdown.c stable/12/sys/kern/kern_timeout.c stable/12/sys/kern/sched_4bsd.c stable/12/sys/kern/sched_ule.c stable/12/sys/kern/vfs_bio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/cam_xpt.c ============================================================================== --- stable/12/sys/cam/cam_xpt.c Wed Dec 11 14:54:29 2019 (r355609) +++ stable/12/sys/cam/cam_xpt.c Wed Dec 11 15:15:21 2019 (r355610) @@ -214,7 +214,7 @@ static struct cdevsw xpt_cdevsw = { /* Storage for debugging datastructures */ struct cam_path *cam_dpath; -u_int32_t cam_dflags = CAM_DEBUG_FLAGS; +u_int32_t __read_mostly cam_dflags = CAM_DEBUG_FLAGS; SYSCTL_UINT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RWTUN, &cam_dflags, 0, "Enabled debug flags"); u_int32_t cam_debug_delay = CAM_DEBUG_DELAY; Modified: stable/12/sys/geom/geom_io.c ============================================================================== --- stable/12/sys/geom/geom_io.c Wed Dec 11 14:54:29 2019 (r355609) +++ stable/12/sys/geom/geom_io.c Wed Dec 11 15:15:21 2019 (r355610) @@ -81,9 +81,9 @@ static struct g_bioq g_bio_run_up; * pressures exist. See g_io_schedule_down() for more details * and limitations. */ -static volatile u_int pace; +static volatile u_int __read_mostly pace; -static uma_zone_t biozone; +static uma_zone_t __read_mostly biozone; /* * The head of the list of classifiers used in g_io_request. @@ -91,8 +91,8 @@ static uma_zone_t biozone; * to add/remove entries to the list. * Classifiers are invoked in registration order. */ -static TAILQ_HEAD(g_classifier_tailq, g_classifier_hook) - g_classifier_tailq = TAILQ_HEAD_INITIALIZER(g_classifier_tailq); +static TAILQ_HEAD(, g_classifier_hook) g_classifier_tailq __read_mostly = + TAILQ_HEAD_INITIALIZER(g_classifier_tailq); #include Modified: stable/12/sys/geom/geom_kern.c ============================================================================== --- stable/12/sys/geom/geom_kern.c Wed Dec 11 14:54:29 2019 (r355609) +++ stable/12/sys/geom/geom_kern.c Wed Dec 11 15:15:21 2019 (r355610) @@ -61,12 +61,12 @@ MALLOC_DEFINE(M_GEOM, "GEOM", "Geom data structures"); struct sx topology_lock; static struct proc *g_proc; -static struct thread *g_up_td; -static struct thread *g_down_td; -static struct thread *g_event_td; +static struct thread __read_mostly *g_up_td; +static struct thread __read_mostly *g_down_td; +static struct thread __read_mostly *g_event_td; -int g_debugflags; -int g_collectstats = 1; +int __read_mostly g_debugflags; +int __read_mostly g_collectstats = G_STATS_PROVIDERS; int g_shutdown; int g_notaste; Modified: stable/12/sys/kern/kern_mtxpool.c ============================================================================== --- stable/12/sys/kern/kern_mtxpool.c Wed Dec 11 14:54:29 2019 (r355609) +++ stable/12/sys/kern/kern_mtxpool.c Wed Dec 11 15:15:21 2019 (r355610) @@ -82,7 +82,7 @@ struct mtx_pool { #define mtx_pool_shift mtx_pool_header.mtxpool_shift #define mtx_pool_next mtx_pool_header.mtxpool_next -struct mtx_pool *mtxpool_sleep; +struct mtx_pool __read_frequently *mtxpool_sleep; #if UINTPTR_MAX == UINT64_MAX /* 64 bits */ # define POINTER_BITS 64 Modified: stable/12/sys/kern/kern_shutdown.c ============================================================================== --- stable/12/sys/kern/kern_shutdown.c Wed Dec 11 14:54:29 2019 (r355609) +++ stable/12/sys/kern/kern_shutdown.c Wed Dec 11 15:15:21 2019 (r355610) @@ -205,9 +205,9 @@ SYSCTL_INT(_kern, OID_AUTO, kerneldump_gzlevel, CTLFLA * Variable panicstr contains argument to first call to panic; used as flag * to indicate that the kernel has already called panic. */ -const char *panicstr; +const char __read_mostly *panicstr; -int dumping; /* system is dumping */ +int __read_mostly dumping; /* system is dumping */ int rebooting; /* system is rebooting */ static struct dumperinfo dumper; /* our selected dumper */ Modified: stable/12/sys/kern/kern_timeout.c ============================================================================== --- stable/12/sys/kern/kern_timeout.c Wed Dec 11 14:54:29 2019 (r355609) +++ stable/12/sys/kern/kern_timeout.c Wed Dec 11 15:15:21 2019 (r355610) @@ -129,7 +129,8 @@ SYSCTL_INT(_kern, OID_AUTO, pin_pcpu_swi, CTLFLAG_RDTU * TODO: * allocate more timeout table slots when table overflows. */ -u_int callwheelsize, callwheelmask; +static u_int __read_mostly callwheelsize; +static u_int __read_mostly callwheelmask; /* * The callout cpu exec entities represent informations necessary for @@ -202,7 +203,7 @@ struct callout_cpu cc_cpu; #define CC_UNLOCK(cc) mtx_unlock_spin(&(cc)->cc_lock) #define CC_LOCK_ASSERT(cc) mtx_assert(&(cc)->cc_lock, MA_OWNED) -static int timeout_cpu; +static int __read_mostly timeout_cpu; static void callout_cpu_init(struct callout_cpu *cc, int cpu); static void softclock_call_cc(struct callout *c, struct callout_cpu *cc, Modified: stable/12/sys/kern/sched_4bsd.c ============================================================================== --- stable/12/sys/kern/sched_4bsd.c Wed Dec 11 14:54:29 2019 (r355609) +++ stable/12/sys/kern/sched_4bsd.c Wed Dec 11 15:15:21 2019 (r355610) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #ifdef KDTRACE_HOOKS #include -int dtrace_vtime_active; +int __read_mostly dtrace_vtime_active; dtrace_vtime_switch_func_t dtrace_vtime_switch_func; #endif Modified: stable/12/sys/kern/sched_ule.c ============================================================================== --- stable/12/sys/kern/sched_ule.c Wed Dec 11 14:54:29 2019 (r355609) +++ stable/12/sys/kern/sched_ule.c Wed Dec 11 15:15:21 2019 (r355610) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #ifdef KDTRACE_HOOKS #include -int dtrace_vtime_active; +int __read_mostly dtrace_vtime_active; dtrace_vtime_switch_func_t dtrace_vtime_switch_func; #endif @@ -206,23 +206,23 @@ _Static_assert(sizeof(struct thread) + sizeof(struct t * sched_slice: Runtime of each thread before rescheduling. * preempt_thresh: Priority threshold for preemption and remote IPIs. */ -static int sched_interact = SCHED_INTERACT_THRESH; -static int tickincr = 8 << SCHED_TICK_SHIFT; -static int realstathz = 127; /* reset during boot. */ -static int sched_slice = 10; /* reset during boot. */ -static int sched_slice_min = 1; /* reset during boot. */ +static int __read_mostly sched_interact = SCHED_INTERACT_THRESH; +static int __read_mostly tickincr = 8 << SCHED_TICK_SHIFT; +static int __read_mostly realstathz = 127; /* reset during boot. */ +static int __read_mostly sched_slice = 10; /* reset during boot. */ +static int __read_mostly sched_slice_min = 1; /* reset during boot. */ #ifdef PREEMPTION #ifdef FULL_PREEMPTION -static int preempt_thresh = PRI_MAX_IDLE; +static int __read_mostly preempt_thresh = PRI_MAX_IDLE; #else -static int preempt_thresh = PRI_MIN_KERN; +static int __read_mostly preempt_thresh = PRI_MIN_KERN; #endif #else -static int preempt_thresh = 0; +static int __read_mostly preempt_thresh = 0; #endif -static int static_boost = PRI_MIN_BATCH; -static int sched_idlespins = 10000; -static int sched_idlespinthresh = -1; +static int __read_mostly static_boost = PRI_MIN_BATCH; +static int __read_mostly sched_idlespins = 10000; +static int __read_mostly sched_idlespinthresh = -1; /* * tdq - per processor runqs and statistics. All fields are protected by the @@ -262,7 +262,7 @@ struct tdq { #define TDQ_IDLE 2 #ifdef SMP -struct cpu_group *cpu_top; /* CPU topology */ +struct cpu_group __read_mostly *cpu_top; /* CPU topology */ #define SCHED_AFFINITY_DEFAULT (max(1, hz / 1000)) #define SCHED_AFFINITY(ts, t) ((ts)->ts_rltick > ticks - ((t) * affinity)) @@ -272,16 +272,16 @@ struct cpu_group *cpu_top; /* CPU topology */ */ static int rebalance = 1; static int balance_interval = 128; /* Default set in sched_initticks(). */ -static int affinity; -static int steal_idle = 1; -static int steal_thresh = 2; -static int always_steal = 0; -static int trysteal_limit = 2; +static int __read_mostly affinity; +static int __read_mostly steal_idle = 1; +static int __read_mostly steal_thresh = 2; +static int __read_mostly always_steal = 0; +static int __read_mostly trysteal_limit = 2; /* * One thread queue per processor. */ -static struct tdq *balance_tdq; +static struct tdq __read_mostly *balance_tdq; static int balance_ticks; DPCPU_DEFINE_STATIC(struct tdq, tdq); DPCPU_DEFINE_STATIC(uint32_t, randomval); Modified: stable/12/sys/kern/vfs_bio.c ============================================================================== --- stable/12/sys/kern/vfs_bio.c Wed Dec 11 14:54:29 2019 (r355609) +++ stable/12/sys/kern/vfs_bio.c Wed Dec 11 15:15:21 2019 (r355610) @@ -148,7 +148,7 @@ struct bufdomain { static struct buf *buf; /* buffer header pool */ extern struct buf *swbuf; /* Swap buffer header pool. */ -caddr_t unmapped_buf; +caddr_t __read_mostly unmapped_buf; /* Used below and for softdep flushing threads in ufs/ffs/ffs_softdep.c */ struct proc *bufdaemonproc; From owner-svn-src-all@freebsd.org Wed Dec 11 15:42:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 846871D9334; Wed, 11 Dec 2019 15:42:25 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (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 47Y1QS4C94z4Ffb; Wed, 11 Dec 2019 15:42:24 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f179.google.com with SMTP id x195so13634371oix.4; Wed, 11 Dec 2019 07:42:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rh0CPYvcRm0t7W/VYVpPksJTIht+Ik7nMcU5rasv+5g=; b=uOPtUdHTq2yYFGRGk88KRUQPhtqm0C90JUcdFwAJry1ZvLNwFx+VCgt+iNNyLGgTgW FBxpHdLynnd/TFp0Rl0TLuZLQDssFmsOCO9/L2g+lQIZV4d6BseedA3eBc4JAWn46orU PkiIvbIr5RshNAJ0YKYaYcz5oJ3swKT/hppeeUDWlzCHeMnIpif0zJctQZuYC7TehlWS jMcnyiBnQ0EwGeFhyEKhYJoltvdUceQNxWTuN+LXZpnNg5hN//8EOKXY0CS7P0H2HkQP E0ojTuyxL4H/A0osvQl3LcotYjxbw3i72MzFMHeWAo093zyixecvWQ9B23DaXjdRWFvT LNdQ== X-Gm-Message-State: APjAAAVXumeqsgrrlnfbxNWxRk75FUNu56487Wgw8ns1LCDsMKTRpxJb INpRncHjxs87JvpG65F4JWwOa8/cpt1uDJzmcMYADw== X-Google-Smtp-Source: APXvYqwB4pETbFbboYhbZxMzLTZoF1DkSe7E2X/3C782ck9a6gzUXNOf5TUz4RNxm7KOKrbpofVPJg0RycQiPedCws0= X-Received: by 2002:aca:b2c5:: with SMTP id b188mr3091784oif.55.1576078943429; Wed, 11 Dec 2019 07:42:23 -0800 (PST) MIME-Version: 1.0 References: <201912060006.xB6066qR058963@repo.freebsd.org> In-Reply-To: From: Alan Somers Date: Wed, 11 Dec 2019 08:42:11 -0700 Message-ID: Subject: Re: svn commit: r355430 - head/sys/cam/scsi To: Steven Hartland Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47Y1QS4C94z4Ffb X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.167.179 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-2.04 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.989,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]; NEURAL_HAM_LONG(-0.98)[-0.978,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; URI_COUNT_ODD(1.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[179.167.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.07)[ip: (-0.27), ipnet: 209.85.128.0/17(-3.14), asn: 15169(-1.92), country: US(-0.05)]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[179.167.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+,1:+,2:~]; 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)[asomers@freebsd.org,asomers@gmail.com]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 15:42:25 -0000 In this case the offending descriptor is solid 0xFF, so replacing individual characters wouldn't accomplish anything. I can imagine a different buggy expander that has just one or two bad characters. In that case, it would make sense to replace them. But replace them with what? The UTF replacement character 0xFFFD isn't an option, because the result is supposed to be ASCII. There's no other obvious choice, which is why I chose to replace the whole thing. -Alan On Fri, Dec 6, 2019 at 2:40 AM Steven Hartland < steven.hartland@multiplay.co.uk> wrote: > If the illegal chars where removed or replaced would the result be useful, > if so might that be a better approach? > > On Fri, 6 Dec 2019 at 00:06, Alan Somers wrote: > >> Author: asomers >> Date: Fri Dec 6 00:06:05 2019 >> New Revision: 355430 >> URL: https://svnweb.freebsd.org/changeset/base/355430 >> >> Log: >> ses: sanitize illegal strings in SES element descriptors >> >> The SES4r3 standard requires that element descriptors may only contain >> ASCII >> characters in the range 0x20 to 0x7e. Some SuperMicro expanders violate >> that rule. This patch adds a sanity check to ses(4). Descriptors in >> violation will be replaced by "". >> >> This patch fixes "sesutil --libxo xml" on such systems. Previously it >> would >> generate non-well-formed XML output. >> >> PR: 241929 >> Reviewed by: allanjude >> MFC after: 2 weeks >> Sponsored by: Axcient >> >> 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 Thu Dec 5 19:39:51 2019 >> (r355429) >> +++ head/sys/cam/scsi/scsi_enc_ses.c Fri Dec 6 00:06:05 2019 >> (r355430) >> @@ -110,7 +110,7 @@ typedef struct ses_addl_status { >> typedef struct ses_element { >> uint8_t eip; /* eip bit is set */ >> uint16_t descr_len; /* length of the descriptor */ >> - char *descr; /* descriptor for this object */ >> + const char *descr; /* descriptor for this object */ >> struct ses_addl_status addl; /* additional status info */ >> } ses_element_t; >> >> @@ -1977,6 +1977,35 @@ ses_publish_cache(enc_softc_t *enc, struct >> enc_fsm_sta >> return (0); >> } >> >> +/* >> + * \brief Sanitize an element descriptor >> + * >> + * The SES4r3 standard, sections 3.1.2 and 6.1.10, specifies that element >> + * descriptors may only contain ASCII characters in the range 0x20 to >> 0x7e. >> + * But some vendors violate that rule. Ensure that we only expose >> compliant >> + * descriptors to userland. >> + * >> + * \param desc SES element descriptor as reported by the hardware >> + * \param len Length of desc in bytes, not necessarily including >> + * trailing NUL. It will be modified if desc is >> invalid. >> + */ >> +static const char* >> +ses_sanitize_elm_desc(const char *desc, uint16_t *len) >> +{ >> + const char *invalid = ""; >> + int i; >> + >> + for (i = 0; i < *len; i++) { >> + if (desc[i] < 0x20 || desc[i] > 0x7e) { >> + *len = strlen(invalid); >> + return (invalid); >> + } else if (desc[i] == 0) { >> + break; >> + } >> + } >> + return (desc); >> +} >> + >> /** >> * \brief Parse the descriptors for each object. >> * >> @@ -2061,7 +2090,8 @@ ses_process_elm_descs(enc_softc_t *enc, struct >> enc_fsm >> if (length > 0) { >> elmpriv = element->elm_private; >> elmpriv->descr_len = length; >> - elmpriv->descr = &buf[offset]; >> + elmpriv->descr = >> ses_sanitize_elm_desc(&buf[offset], >> + &elmpriv->descr_len); >> } >> >> /* skip over the descriptor itself */ >> > From owner-svn-src-all@freebsd.org Wed Dec 11 15:52:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 555861D9781; Wed, 11 Dec 2019 15:52:30 +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 47Y1f61W0wz4GQ5; Wed, 11 Dec 2019 15:52:30 +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 2F226D9CF; Wed, 11 Dec 2019 15:52:30 +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 xBBFqUVB009117; Wed, 11 Dec 2019 15:52:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBFqUq9009116; Wed, 11 Dec 2019 15:52:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201912111552.xBBFqUq9009116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 11 Dec 2019 15:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355611 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 15:52:30 -0000 Author: avg Date: Wed Dec 11 15:52:29 2019 New Revision: 355611 URL: https://svnweb.freebsd.org/changeset/base/355611 Log: add a sanity check to the system call registration code A system call number should be at least reserved. We do not expect an attempt to register a fixed number system call when nothing at all is known about it. MFC after: 3 weeks Sponsored by: Panzura Modified: head/sys/kern/kern_syscalls.c Modified: head/sys/kern/kern_syscalls.c ============================================================================== --- head/sys/kern/kern_syscalls.c Wed Dec 11 15:15:21 2019 (r355610) +++ head/sys/kern/kern_syscalls.c Wed Dec 11 15:52:29 2019 (r355611) @@ -120,11 +120,14 @@ kern_syscall_register(struct sysent *sysents, int *off if (i == SYS_MAXSYSCALL) return (ENFILE); *offset = i; - } else if (*offset < 0 || *offset >= SYS_MAXSYSCALL) + } else if (*offset < 0 || *offset >= SYS_MAXSYSCALL) { return (EINVAL); - else if (sysents[*offset].sy_call != (sy_call_t *)lkmnosys && - sysents[*offset].sy_call != (sy_call_t *)lkmressys) + } else if (sysents[*offset].sy_call != (sy_call_t *)lkmnosys && + sysents[*offset].sy_call != (sy_call_t *)lkmressys) { + KASSERT(sysents[*offset].sy_call != NULL, + ("undefined syscall %d", *offset)); return (EEXIST); + } KASSERT(sysents[*offset].sy_thrcnt == SY_THR_ABSENT, ("dynamic syscall is not protected")); From owner-svn-src-all@freebsd.org Wed Dec 11 16:09:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 194FA1D9A80; Wed, 11 Dec 2019 16:09:58 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47Y22F6xTfz4HHj; Wed, 11 Dec 2019 16:09:57 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E961EDB99; Wed, 11 Dec 2019 16:09:57 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBBG9v0h015192; Wed, 11 Dec 2019 16:09:57 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBG9v4b015191; Wed, 11 Dec 2019 16:09:57 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201912111609.xBBG9v4b015191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Wed, 11 Dec 2019 16:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355612 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 16:09:58 -0000 Author: dougm Date: Wed Dec 11 16:09:57 2019 New Revision: 355612 URL: https://svnweb.freebsd.org/changeset/base/355612 Log: Extract code common to _vm_map_clip_start and _vm_map_clip_end into a function, vm_map_entry_clone, that can be invoked by each. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22760 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Dec 11 15:52:29 2019 (r355611) +++ head/sys/vm/vm_map.c Wed Dec 11 16:09:57 2019 (r355612) @@ -2291,6 +2291,42 @@ vm_map_entry_charge_object(vm_map_t map, vm_map_entry_ } /* + * vm_map_entry_clone + * + * Create a duplicate map entry for clipping. + */ +static vm_map_entry_t +vm_map_entry_clone(vm_map_t map, vm_map_entry_t entry) +{ + vm_map_entry_t new_entry; + + VM_MAP_ASSERT_LOCKED(map); + + /* + * Create a backing object now, if none exists, so that more individual + * objects won't be created after the map entry is split. + */ + vm_map_entry_charge_object(map, entry); + + /* Clone the entry. */ + new_entry = vm_map_entry_create(map); + *new_entry = *entry; + if (new_entry->cred != NULL) + crhold(entry->cred); + if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) { + vm_object_reference(new_entry->object.vm_object); + vm_map_entry_set_vnode_text(new_entry, true); + /* + * The object->un_pager.vnp.writemappings for the object of + * MAP_ENTRY_WRITECNT type entry shall be kept as is here. The + * virtual pages are re-distributed among the clipped entries, + * so the sum is left the same. + */ + } + return (new_entry); +} + +/* * vm_map_clip_start: [ internal use only ] * * Asserts that the given entry begins at or after @@ -2316,16 +2352,8 @@ _vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, KASSERT(entry->end > start && entry->start < start, ("_vm_map_clip_start: invalid clip of entry %p", entry)); - /* - * Create a backing object now, if none exists, so that more individual - * objects won't be created after the map entry is split. - */ - vm_map_entry_charge_object(map, entry); + new_entry = vm_map_entry_clone(map, entry); - /* Clone the entry. */ - new_entry = vm_map_entry_create(map); - *new_entry = *entry; - /* * Split off the front portion. Insert the new entry BEFORE this one, * so that this entry has the specified starting address. @@ -2333,22 +2361,7 @@ _vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, new_entry->end = start; entry->offset += (start - entry->start); entry->start = start; - if (new_entry->cred != NULL) - crhold(entry->cred); - vm_map_entry_link(map, new_entry); - - if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) { - vm_object_reference(new_entry->object.vm_object); - vm_map_entry_set_vnode_text(new_entry, true); - /* - * The object->un_pager.vnp.writemappings for the - * object of MAP_ENTRY_WRITECNT type entry shall be - * kept as is here. The virtual pages are - * re-distributed among the clipped entries, so the sum is - * left the same. - */ - } } /* @@ -2377,31 +2390,15 @@ _vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, v KASSERT(entry->start < end && entry->end > end, ("_vm_map_clip_end: invalid clip of entry %p", entry)); - /* - * Create a backing object now, if none exists, so that more individual - * objects won't be created after the map entry is split. - */ - vm_map_entry_charge_object(map, entry); + new_entry = vm_map_entry_clone(map, entry); - /* Clone the entry. */ - new_entry = vm_map_entry_create(map); - *new_entry = *entry; - /* * Split off the back portion. Insert the new entry AFTER this one, * so that this entry has the specified ending address. */ new_entry->start = entry->end = end; new_entry->offset += (end - entry->start); - if (new_entry->cred != NULL) - crhold(entry->cred); - vm_map_entry_link(map, new_entry); - - if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) { - vm_object_reference(new_entry->object.vm_object); - vm_map_entry_set_vnode_text(new_entry, true); - } } /* From owner-svn-src-all@freebsd.org Wed Dec 11 16:43:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBF891DAAA3; Wed, 11 Dec 2019 16:43:54 +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 47Y2nQ5wXYz4KXn; Wed, 11 Dec 2019 16:43:54 +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 C6937E2ED; Wed, 11 Dec 2019 16:43:54 +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 xBBGhsgT038550; Wed, 11 Dec 2019 16:43:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBGhsfv038549; Wed, 11 Dec 2019 16:43:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912111643.xBBGhsfv038549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Dec 2019 16:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355613 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 355613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 16:43:55 -0000 Author: emaste Date: Wed Dec 11 16:43:54 2019 New Revision: 355613 URL: https://svnweb.freebsd.org/changeset/base/355613 Log: security.7: add caveat about interim sysctl paths from r355436 r355436 moved mitigation sysctls to machdep.mitigations but did not rationalize the sense of the invidual knobs. Clarify that the old names remain the canonical way to set these mitigations. Backwards compatibility will be maintained for the original names (e.g. hw.ibrs_disable), but not from the interim names (e.g. machdep.mitigations.ibrs.disable). Sponsored by: The FreeBSD Foundation Modified: head/share/man/man7/security.7 Modified: head/share/man/man7/security.7 ============================================================================== --- head/share/man/man7/security.7 Wed Dec 11 16:09:57 2019 (r355612) +++ head/share/man/man7/security.7 Wed Dec 11 16:43:54 2019 (r355613) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2019 +.Dd December 11, 2019 .Dt SECURITY 7 .Os .Sh NAME @@ -944,6 +944,17 @@ information access more restricted. Some people consider this as improving system security, so the knobs are briefly listed there, together with controls which enable some mitigations of the hardware state leaks. +.Pp +Hardware mitigation sysctl knobs described below have been moved under +.Pa machdep.mitigations , +with backwards-compatibility shims to accept the existing names. +A future change will rationalize the sense of the individual sysctls +(so that enabled / true always indicates that the mitigation is active). +For that reason the previous names remain the canonical way to set the +mitigations, and are documented here. +Backwards compatibility shims for the interim sysctls under +.Pa machdep.mitigations +will not be added. .Bl -tag -width security.bsd.unprivileged_proc_debug .It Dv security.bsd.see_other_uids Controls visibility of processes owned by different uid. From owner-svn-src-all@freebsd.org Wed Dec 11 17:19:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB6A31DB8B6; Wed, 11 Dec 2019 17:19:08 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 47Y3Z45zZpz4MQx; Wed, 11 Dec 2019 17:19:08 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A4DE321FFC; Wed, 11 Dec 2019 12:19:07 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 11 Dec 2019 12:19:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm2; bh=4 JoQMowbmZwlniK/YMHFG9hsxQhTN5XQd1Hh//k9520=; b=ZX82ONZrTG2crS/wo rjPf+jB3/b0FCGAVdowP1lbLDXsaT0t49niTVb/ybAe/tb8tJI/3ow5e98LtxToD 29PUcUQwIJdG7a20sk0foaEkXgINy56AnruqO8z/cCZB4y2cCOp7ZGnu8Ukzo9fJ Fk+iEe5jvc3+62HPWZY7q9maVN8FRPQgZg5cZdGfualqMgVdX8h0XdFGflVwmfey xfGtdRlRri0FqS53er7zqtILaPVJLLQ/LeF/evMu3+d4JsHBKk7/jFuWRXJb1Z4K chRZ6FJFOdLCPGwvHck2mOLMbLS4tVqcbJ5fF5uid6KcAUrUIELWOLp4M5zsQAGt qseRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=4JoQMowbmZwlniK/YMHFG9hsxQhTN5XQd1Hh//k95 20=; b=xGmppGTNGHjUFDS/mDnGjulVB4K0RJen3obLFLdPmlUCBKz3jYVuaWEXa S5FQdnFJBPF+shz87e0EaxK2UWohMvLPoM0L06riLwukjhh1lX4B3SUloeT/5VtB /cLSYWJhi3TVn1+x2KSutpZNXJjRT8vylHJQIVYUE+rxWo7QLQ8EIY11srpy1uwK 0hoZti2nQgpeZU3FS/CeNqHt4DYqFxcT5KuHusfETyNirYJMBYHNFRXSz3jS4GLd Aolkqvnj1L6RfhpLDVM2J0Obl0xIZvuPSLPlfJtFWWnp/TRTqj7any/qnSecjpa5 jRSu2Gr/SefyQzP+MyAPSIS497Mgg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudelhedgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptggguffhjgffgffkfhfvofesthhqmhdthhdtjeenucfhrhhomhepufgtohht thcunfhonhhguceoshgtohhtthhlsehsrghmshgtohdrohhrgheqnecuffhomhgrihhnpe hfrhgvvggsshgurdhorhhgnecukfhppeekrdegiedrkeelrddvudefnecurfgrrhgrmhep mhgrihhlfhhrohhmpehstghothhtlhesshgrmhhstghordhorhhgnecuvehluhhsthgvrh fuihiivgeptd X-ME-Proxy: Received: from [192.168.0.114] (unknown [8.46.89.213]) by mail.messagingengine.com (Postfix) with ESMTPA id A92FF3060132; Wed, 11 Dec 2019 12:19:06 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\)) Subject: Re: svn commit: r355430 - head/sys/cam/scsi From: Scott Long In-Reply-To: Date: Wed, 11 Dec 2019 10:19:05 -0700 Cc: Steven Hartland , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <820BE55B-AE32-44E7-8AC7-245EF6F86F8B@samsco.org> References: <201912060006.xB6066qR058963@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3601.0.10) X-Rspamd-Queue-Id: 47Y3Z45zZpz4MQx X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.996,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 17:19:09 -0000 U+FFFD doesn=E2=80=99t make sense for an ASCII string, but 0x3F might. = Any idea what Windows shows for this device? Scott > On Dec 11, 2019, at 8:42 AM, Alan Somers wrote: >=20 > In this case the offending descriptor is solid 0xFF, so replacing = individual characters wouldn't accomplish anything. I can imagine a = different buggy expander that has just one or two bad characters. In = that case, it would make sense to replace them. But replace them with = what? The UTF replacement character 0xFFFD isn't an option, because the = result is supposed to be ASCII. There's no other obvious choice, which = is why I chose to replace the whole thing. > -Alan >=20 > On Fri, Dec 6, 2019 at 2:40 AM Steven Hartland = wrote: > If the illegal chars where removed or replaced would the result be = useful, if so might that be a better approach? >=20 > On Fri, 6 Dec 2019 at 00:06, Alan Somers wrote: > Author: asomers > Date: Fri Dec 6 00:06:05 2019 > New Revision: 355430 > URL: https://svnweb.freebsd.org/changeset/base/355430 >=20 > Log: > ses: sanitize illegal strings in SES element descriptors >=20 > The SES4r3 standard requires that element descriptors may only = contain ASCII > characters in the range 0x20 to 0x7e. Some SuperMicro expanders = violate > that rule. This patch adds a sanity check to ses(4). Descriptors = in > violation will be replaced by "". >=20 > This patch fixes "sesutil --libxo xml" on such systems. Previously = it would > generate non-well-formed XML output. >=20 > PR: 241929 > Reviewed by: allanjude > MFC after: 2 weeks > Sponsored by: Axcient >=20 > Modified: > head/sys/cam/scsi/scsi_enc_ses.c >=20 > Modified: head/sys/cam/scsi/scsi_enc_ses.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/cam/scsi/scsi_enc_ses.c Thu Dec 5 19:39:51 2019 = (r355429) > +++ head/sys/cam/scsi/scsi_enc_ses.c Fri Dec 6 00:06:05 2019 = (r355430) > @@ -110,7 +110,7 @@ typedef struct ses_addl_status { > typedef struct ses_element { > uint8_t eip; /* eip bit is set */ > uint16_t descr_len; /* length of the descriptor */ > - char *descr; /* descriptor for this object = */ > + const char *descr; /* descriptor for this object = */ > struct ses_addl_status addl; /* additional status info */ > } ses_element_t; >=20 > @@ -1977,6 +1977,35 @@ ses_publish_cache(enc_softc_t *enc, struct = enc_fsm_sta > return (0); > } >=20 > +/* > + * \brief Sanitize an element descriptor > + * > + * The SES4r3 standard, sections 3.1.2 and 6.1.10, specifies that = element > + * descriptors may only contain ASCII characters in the range 0x20 to = 0x7e. > + * But some vendors violate that rule. Ensure that we only expose = compliant > + * descriptors to userland. > + * > + * \param desc SES element descriptor as reported by the = hardware > + * \param len Length of desc in bytes, not necessarily = including > + * trailing NUL. It will be modified if desc is = invalid. > + */ > +static const char* > +ses_sanitize_elm_desc(const char *desc, uint16_t *len) > +{ > + const char *invalid =3D ""; > + int i; > + > + for (i =3D 0; i < *len; i++) { > + if (desc[i] < 0x20 || desc[i] > 0x7e) { > + *len =3D strlen(invalid); > + return (invalid); > + } else if (desc[i] =3D=3D 0) { > + break; > + } > + } > + return (desc); > +} > + > /** > * \brief Parse the descriptors for each object. > * > @@ -2061,7 +2090,8 @@ ses_process_elm_descs(enc_softc_t *enc, struct = enc_fsm > if (length > 0) { > elmpriv =3D element->elm_private; > elmpriv->descr_len =3D length; > - elmpriv->descr =3D &buf[offset]; > + elmpriv->descr =3D = ses_sanitize_elm_desc(&buf[offset], > + &elmpriv->descr_len); > } >=20 > /* skip over the descriptor itself */ From owner-svn-src-all@freebsd.org Wed Dec 11 17:19:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FFEF1DB938; Wed, 11 Dec 2019 17:19:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47Y3Zd3CNyz4MZr; Wed, 11 Dec 2019 17:19:37 +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 69610E885; Wed, 11 Dec 2019 17:19:37 +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 xBBHJbZL056684; Wed, 11 Dec 2019 17:19:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBHJb9Q056683; Wed, 11 Dec 2019 17:19:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912111719.xBBHJb9Q056683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Dec 2019 17:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355614 - head/usr.sbin/kbdmap X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/kbdmap X-SVN-Commit-Revision: 355614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 17:19:37 -0000 Author: emaste Date: Wed Dec 11 17:19:36 2019 New Revision: 355614 URL: https://svnweb.freebsd.org/changeset/base/355614 Log: kbdmap: allow INDEX.keymaps to provide the dialog title Previously kbdmap had a localized menu heading ("Choose your keyboard layout") but not the dialog title ("Keyboard Menu"). MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/kbdmap/kbdmap.c Modified: head/usr.sbin/kbdmap/kbdmap.c ============================================================================== --- head/usr.sbin/kbdmap/kbdmap.c Wed Dec 11 16:43:54 2019 (r355613) +++ head/usr.sbin/kbdmap/kbdmap.c Wed Dec 11 17:19:36 2019 (r355614) @@ -57,6 +57,7 @@ static const char *sysconfig = DEFAULT_SYSCONFIG; static const char *font_current; static const char *dir; static const char *menu = ""; +static const char *title = "Keyboard Menu"; static int x11; static int using_vt; @@ -360,8 +361,8 @@ show_dialog(struct keymap **km_sorted, int num_keymaps tmp_name); exit(1); } - asprintf(&dialog, "/usr/bin/dialog --clear --title \"Keyboard Menu\" " - "--menu \"%s\" 0 0 0", menu); + asprintf(&dialog, "/usr/bin/dialog --clear --title \"%s\" " + "--menu \"%s\" 0 0 0", title, menu); /* start right font, assume that current font is equal * to default font in /etc/rc.conf @@ -627,8 +628,9 @@ menu_read(void) matches = sscanf(p, "%64[^:]:%64[^:]:%256[^:\n]", keym, lng, desc); if (matches == 3) { - if (strcmp(keym, "FONT") - && strcmp(keym, "MENU")) { + if (strcmp(keym, "FONT") != 0 && + strcmp(keym, "MENU") != 0 && + strcmp(keym, "TITLE") != 0) { /* Check file exists & is readable */ if (check_file(keym) == -1) continue; @@ -705,6 +707,10 @@ menu_read(void) exit(0); } + km = get_keymap("TITLE"); + if (km) + /* Take note of dialog title */ + title = strdup(km->desc); km = get_keymap("MENU"); if (km) /* Take note of menu title */ @@ -715,8 +721,9 @@ menu_read(void) font = strdup(km->desc); /* Remove unwanted items from list */ - remove_keymap("MENU"); remove_keymap("FONT"); + remove_keymap("MENU"); + remove_keymap("TITLE"); /* Look for keymaps not in database */ dirp = opendir(dir); From owner-svn-src-all@freebsd.org Wed Dec 11 17:28:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94B011DBBF8; Wed, 11 Dec 2019 17:28:50 +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 47Y3nG3Ds2z4N3W; Wed, 11 Dec 2019 17:28:50 +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 6503BEA59; Wed, 11 Dec 2019 17:28:50 +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 xBBHSogk062512; Wed, 11 Dec 2019 17:28:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBHSoJd062511; Wed, 11 Dec 2019 17:28:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912111728.xBBHSoJd062511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Dec 2019 17:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355615 - head/sys/arm/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm/linux X-SVN-Commit-Revision: 355615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 17:28:50 -0000 Author: emaste Date: Wed Dec 11 17:28:49 2019 New Revision: 355615 URL: https://svnweb.freebsd.org/changeset/base/355615 Log: arm linuxulator: add syscalls.conf and Makefile for "make sysent" Differential Revision: https://reviews.freebsd.org/D7973 Added: head/sys/arm/linux/Makefile (contents, props changed) head/sys/arm/linux/syscalls.conf (contents, props changed) Added: head/sys/arm/linux/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/linux/Makefile Wed Dec 11 17:28:49 2019 (r355615) @@ -0,0 +1,25 @@ +# Makefile for syscall tables +# +# $FreeBSD$ + +# Don't use an OBJDIR +.OBJDIR: ${.CURDIR} + +.include + +MAKESYSCALLS= ../../tools/makesyscalls.lua +SRCS= syscalls.conf \ + syscalls.master +GENERATED= linux_proto.h \ + linux_syscall.h \ + linux_syscalls.c \ + linux_sysent.c \ + linux_systrace_args.c + +all: + @echo "make sysent only" + +sysent: ${GENERATED} + +${GENERATED}: ${MAKESYSCALLS} ${SRCS} + ${LUA} ${MAKESYSCALLS} syscalls.master syscalls.conf Added: head/sys/arm/linux/syscalls.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/linux/syscalls.conf Wed Dec 11 17:28:49 2019 (r355615) @@ -0,0 +1,11 @@ +# $FreeBSD$ +sysnames="linux_syscalls.c" +sysproto="linux_proto.h" +sysproto_h=_LINUX_SYSPROTO_H_ +syshdr="linux_syscall.h" +syssw="linux_sysent.c" +sysmk="/dev/null" +syscallprefix="LINUX_SYS_" +switchname="linux_sysent" +namesname="linux_syscallnames" +systrace="linux_systrace_args.c" From owner-svn-src-all@freebsd.org Wed Dec 11 17:32:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4ECE21DBE01; Wed, 11 Dec 2019 17:32:14 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (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 47Y3sB1RNgz4NTv; Wed, 11 Dec 2019 17:32:13 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-qk1-f179.google.com with SMTP id w127so8536029qkb.11; Wed, 11 Dec 2019 09:32:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uhsD2d078nUtEtoZIPYM6hSSsZjs61y526btESC/nQ0=; b=fqf205QAsnUklLAuPxPgBgYJVLOaGN2HczQFT0Wx668OWZ3zrPuqWrnU4eMzrWiQS8 689NWjFZF2etqsaYg7/t5sH30bldYpA5EpdSgqkT+kQT5C9w6AUEcXloMK9E9Bu/IPuE 2VwuShA3/oA86JNsRnO6gIw9Y7H+GqWtlrMIB57b70+QShzWPR5KLj2AALrnhHMgu31Z 31Gz+GL/KMN7fYFHy8Y68IRsvnBtozIxCzON2YPKi2tA/uu+xq7wOoMc8C79fYkAmNtF kbzRHRjBVZNzF/A/f/HUk2LVOPJcmaiHP8QEzZmRJq5zHHwfqrXSHyv/M5XOh/3KOhj2 9Irg== X-Gm-Message-State: APjAAAU2zX62b5ebcBpf12oxlP98KOll2rCHWMcZiazn818hfjmvm2WY Xa7dsGeQ5iH8E/IdnWA6yWs3zMPA X-Google-Smtp-Source: APXvYqxiYTW+pZCISaj6TQOzGGTSppZVJSE9KOTP1tu3gEZtjFbliJ7mx52BUwdT69+50G+VACzJ/g== X-Received: by 2002:a37:4dc4:: with SMTP id a187mr4113589qkb.436.1576085532742; Wed, 11 Dec 2019 09:32:12 -0800 (PST) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com. [209.85.160.171]) by smtp.gmail.com with ESMTPSA id e123sm858918qkf.80.2019.12.11.09.32.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Dec 2019 09:32:11 -0800 (PST) Received: by mail-qt1-f171.google.com with SMTP id p5so6935216qtq.12; Wed, 11 Dec 2019 09:32:11 -0800 (PST) X-Received: by 2002:ac8:f77:: with SMTP id l52mr3754591qtk.310.1576085531302; Wed, 11 Dec 2019 09:32:11 -0800 (PST) MIME-Version: 1.0 References: <201912111728.xBBHSoJd062511@repo.freebsd.org> In-Reply-To: <201912111728.xBBHSoJd062511@repo.freebsd.org> From: Kyle Evans Date: Wed, 11 Dec 2019 11:31:59 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r355615 - head/sys/arm/linux To: Ed Maste Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47Y3sB1RNgz4NTv 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)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 17:32:14 -0000 On Wed, Dec 11, 2019 at 11:28 AM Ed Maste wrote: > > Author: emaste > Date: Wed Dec 11 17:28:49 2019 > New Revision: 355615 > URL: https://svnweb.freebsd.org/changeset/base/355615 > > Log: > arm linuxulator: add syscalls.conf and Makefile for "make sysent" > > Differential Revision: https://reviews.freebsd.org/D7973 > This should also feature an addition in ^/Makefile.inc1 if that's not already on your radar. =) Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Wed Dec 11 17:35:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E601D1DBECE; Wed, 11 Dec 2019 17:35:51 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f194.google.com (mail-oi1-f194.google.com [209.85.167.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 47Y3xL62xyz4Ngm; Wed, 11 Dec 2019 17:35:50 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f194.google.com with SMTP id 6so13976377oix.7; Wed, 11 Dec 2019 09:35:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1gvdYU+4UxOcSQlkjZtzAOE5OTxpo67Lju8j82HSDhA=; b=dZOmB62pn9qGK9svDmb9N4k4zLaFfIaTiveztb2ElNf2In1TI1tOAd6MchtbnRldYH mZOFVwV9tB9I+1sKQHB+qJinD/7ybQFusDcPKSMa8gOr3gyygBR5jF8s7ie33BZQLDS8 GH0tYAqDHubSj93kJxxfgbWOlJ9ntuYGh45kMPooYMzVcsGUeiz5aWjfdaxxs/h/2Dek 9DYkEtk5w+8Ej+eytY0UYp6gX+YSZhX1PiuVYA4qg4EAMphOoHjnosGv7DC59+WOoITa Fu0p9/1+Jar7dqfBOseO5XPdoXDK49WbRNO26igprMEG0U/utE4uc1R9HlSSLEtqw9Pp bn9g== X-Gm-Message-State: APjAAAV21hecaMKvPoDmrPV6aIxmFniA1tCiY1CiS9xwaRvRSfmuqKs/ DsU5lG9qcbDzGMa0ZMSVRumwWKAkGEKikTA4wGUG9Q== X-Google-Smtp-Source: APXvYqwl/cisMYrxNFD5eO7+I7W4AKylyp7qg+wz+lMH6l4pZUWNMs6d63ZqHxIXS/VtVlpJjpxGmwC45o8B0xgkCGw= X-Received: by 2002:a05:6808:6c5:: with SMTP id m5mr3521717oih.143.1576085749488; Wed, 11 Dec 2019 09:35:49 -0800 (PST) MIME-Version: 1.0 References: <201912060006.xB6066qR058963@repo.freebsd.org> <820BE55B-AE32-44E7-8AC7-245EF6F86F8B@samsco.org> In-Reply-To: <820BE55B-AE32-44E7-8AC7-245EF6F86F8B@samsco.org> From: Alan Somers Date: Wed, 11 Dec 2019 10:35:38 -0700 Message-ID: Subject: Re: svn commit: r355430 - head/sys/cam/scsi To: Scott Long Cc: Steven Hartland , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47Y3xL62xyz4Ngm X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.167.194 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-1.98 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.988,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-0.98)[-0.975,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; URI_COUNT_ODD(1.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[194.167.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.02)[ipnet: 209.85.128.0/17(-3.13), asn: 15169(-1.92), country: US(-0.05)]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[194.167.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+,1:+,2:~]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 17:35:52 -0000 No, and there's no possibility of connecting a Windows host to this particular device. We have some Oracle Solaris servers hooked up to these expanders, but it looks like Solaris completely ignores the offending element type. -Alan On Wed, Dec 11, 2019 at 10:19 AM Scott Long wrote: > U+FFFD doesn=E2=80=99t make sense for an ASCII string, but 0x3F might. A= ny idea > what Windows shows for this device? > > Scott > > > On Dec 11, 2019, at 8:42 AM, Alan Somers wrote: > > > > In this case the offending descriptor is solid 0xFF, so replacing > individual characters wouldn't accomplish anything. I can imagine a > different buggy expander that has just one or two bad characters. In tha= t > case, it would make sense to replace them. But replace them with what? > The UTF replacement character 0xFFFD isn't an option, because the result = is > supposed to be ASCII. There's no other obvious choice, which is why I > chose to replace the whole thing. > > -Alan > > > > On Fri, Dec 6, 2019 at 2:40 AM Steven Hartland < > steven.hartland@multiplay.co.uk> wrote: > > If the illegal chars where removed or replaced would the result be > useful, if so might that be a better approach? > > > > On Fri, 6 Dec 2019 at 00:06, Alan Somers wrote: > > Author: asomers > > Date: Fri Dec 6 00:06:05 2019 > > New Revision: 355430 > > URL: https://svnweb.freebsd.org/changeset/base/355430 > > > > Log: > > ses: sanitize illegal strings in SES element descriptors > > > > The SES4r3 standard requires that element descriptors may only contai= n > ASCII > > characters in the range 0x20 to 0x7e. Some SuperMicro expanders > violate > > that rule. This patch adds a sanity check to ses(4). Descriptors in > > violation will be replaced by "". > > > > This patch fixes "sesutil --libxo xml" on such systems. Previously i= t > would > > generate non-well-formed XML output. > > > > PR: 241929 > > Reviewed by: allanjude > > MFC after: 2 weeks > > Sponsored by: Axcient > > > > Modified: > > head/sys/cam/scsi/scsi_enc_ses.c > > > > Modified: head/sys/cam/scsi/scsi_enc_ses.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/sys/cam/scsi/scsi_enc_ses.c Thu Dec 5 19:39:51 2019 > (r355429) > > +++ head/sys/cam/scsi/scsi_enc_ses.c Fri Dec 6 00:06:05 2019 > (r355430) > > @@ -110,7 +110,7 @@ typedef struct ses_addl_status { > > typedef struct ses_element { > > uint8_t eip; /* eip bit is set */ > > uint16_t descr_len; /* length of the descriptor */ > > - char *descr; /* descriptor for this object *= / > > + const char *descr; /* descriptor for this object *= / > > struct ses_addl_status addl; /* additional status info */ > > } ses_element_t; > > > > @@ -1977,6 +1977,35 @@ ses_publish_cache(enc_softc_t *enc, struct > enc_fsm_sta > > return (0); > > } > > > > +/* > > + * \brief Sanitize an element descriptor > > + * > > + * The SES4r3 standard, sections 3.1.2 and 6.1.10, specifies that > element > > + * descriptors may only contain ASCII characters in the range 0x20 to > 0x7e. > > + * But some vendors violate that rule. Ensure that we only expose > compliant > > + * descriptors to userland. > > + * > > + * \param desc SES element descriptor as reported by the > hardware > > + * \param len Length of desc in bytes, not necessarily > including > > + * trailing NUL. It will be modified if desc is > invalid. > > + */ > > +static const char* > > +ses_sanitize_elm_desc(const char *desc, uint16_t *len) > > +{ > > + const char *invalid =3D ""; > > + int i; > > + > > + for (i =3D 0; i < *len; i++) { > > + if (desc[i] < 0x20 || desc[i] > 0x7e) { > > + *len =3D strlen(invalid); > > + return (invalid); > > + } else if (desc[i] =3D=3D 0) { > > + break; > > + } > > + } > > + return (desc); > > +} > > + > > /** > > * \brief Parse the descriptors for each object. > > * > > @@ -2061,7 +2090,8 @@ ses_process_elm_descs(enc_softc_t *enc, struct > enc_fsm > > if (length > 0) { > > elmpriv =3D element->elm_private; > > elmpriv->descr_len =3D length; > > - elmpriv->descr =3D &buf[offset]; > > + elmpriv->descr =3D > ses_sanitize_elm_desc(&buf[offset], > > + &elmpriv->descr_len); > > } > > > > /* skip over the descriptor itself */ > > From owner-svn-src-all@freebsd.org Wed Dec 11 17:37:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 588A71DBFDF; Wed, 11 Dec 2019 17:37:50 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47Y3zf2QHMz4NwZ; Wed, 11 Dec 2019 17:37:50 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DC55EC40; Wed, 11 Dec 2019 17:37:50 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBBHboSa068771; Wed, 11 Dec 2019 17:37:50 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBHbbN4068707; Wed, 11 Dec 2019 17:37:37 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201912111737.xBBHbbN4068707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 11 Dec 2019 17:37:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355616 - in head: bin/ls lib/libarchive lib/libbsnmp/libbsnmp lib/libc lib/libfetch lib/libpam/modules/pam_unix lib/libpcap lib/libproc lib/libradius libexec/fingerd libexec/ftpd libex... X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: bin/ls lib/libarchive lib/libbsnmp/libbsnmp lib/libc lib/libfetch lib/libpam/modules/pam_unix lib/libpcap lib/libproc lib/libradius libexec/fingerd libexec/ftpd libexec/telnetd libexec/tftpd ... X-SVN-Commit-Revision: 355616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 17:37:50 -0000 Author: sjg Date: Wed Dec 11 17:37:37 2019 New Revision: 355616 URL: https://svnweb.freebsd.org/changeset/base/355616 Log: Add Makefile.depend.options Leaf directories that have dependencies impacted by options need a Makefile.depend.options file to avoid churn in Makefile.depend DIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etc can be set in local.dirdeps-options.mk which can add to those set in Makefile.depend.options See share/mk/dirdeps-options.mk Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22469 Added: head/bin/ls/Makefile.depend.options (contents, props changed) head/lib/libarchive/Makefile.depend.options (contents, props changed) head/lib/libbsnmp/libbsnmp/Makefile.depend.options (contents, props changed) head/lib/libc/Makefile.depend.options (contents, props changed) head/lib/libfetch/Makefile.depend.options (contents, props changed) head/lib/libpam/modules/pam_unix/Makefile.depend.options (contents, props changed) head/lib/libpcap/Makefile.depend.options (contents, props changed) head/lib/libproc/Makefile.depend.options (contents, props changed) head/lib/libradius/Makefile.depend.options (contents, props changed) head/libexec/fingerd/Makefile.depend.options (contents, props changed) head/libexec/ftpd/Makefile.depend.options (contents, props changed) head/libexec/telnetd/Makefile.depend.options (contents, props changed) head/libexec/tftpd/Makefile.depend.options (contents, props changed) head/sbin/dhclient/Makefile.depend.options (contents, props changed) head/sbin/dumpon/Makefile.depend.options (contents, props changed) head/sbin/ifconfig/Makefile.depend.options (contents, props changed) head/sbin/ping/Makefile.depend.options (contents, props changed) head/sbin/ping6/Makefile.depend.options (contents, props changed) head/sbin/rtsol/Makefile.depend.options (contents, props changed) head/sbin/savecore/Makefile.depend.options (contents, props changed) head/secure/usr.bin/ssh/Makefile.depend.options (contents, props changed) head/secure/usr.sbin/sshd/Makefile.depend.options (contents, props changed) head/usr.bin/brandelf/Makefile.depend.options (contents, props changed) head/usr.bin/chkey/Makefile.depend.options (contents, props changed) head/usr.bin/chpass/Makefile.depend.options (contents, props changed) head/usr.bin/factor/Makefile.depend.options (contents, props changed) head/usr.bin/grep/Makefile.depend.options (contents, props changed) head/usr.bin/gzip/Makefile.depend.options (contents, props changed) head/usr.bin/head/Makefile.depend.options (contents, props changed) head/usr.bin/kdump/Makefile.depend.options (contents, props changed) head/usr.bin/login/Makefile.depend.options (contents, props changed) head/usr.bin/netstat/Makefile.depend.options (contents, props changed) head/usr.bin/nm/Makefile.depend.options (contents, props changed) head/usr.bin/readelf/Makefile.depend.options (contents, props changed) head/usr.bin/size/Makefile.depend.options (contents, props changed) head/usr.bin/sort/Makefile.depend.options (contents, props changed) head/usr.bin/strings/Makefile.depend.options (contents, props changed) head/usr.bin/su/Makefile.depend.options (contents, props changed) head/usr.bin/tail/Makefile.depend.options (contents, props changed) head/usr.bin/telnet/Makefile.depend.options (contents, props changed) head/usr.bin/wc/Makefile.depend.options (contents, props changed) head/usr.sbin/amd/amd/Makefile.depend.options (contents, props changed) head/usr.sbin/bhyve/Makefile.depend.options (contents, props changed) head/usr.sbin/bsnmpd/bsnmpd/Makefile.depend.options (contents, props changed) head/usr.sbin/fstyp/Makefile.depend.options (contents, props changed) head/usr.sbin/gssd/Makefile.depend.options (contents, props changed) head/usr.sbin/inetd/Makefile.depend.options (contents, props changed) head/usr.sbin/ngctl/Makefile.depend.options (contents, props changed) head/usr.sbin/ntp/ntp-keygen/Makefile.depend.options (contents, props changed) head/usr.sbin/ntp/ntpd/Makefile.depend.options (contents, props changed) head/usr.sbin/ntp/ntpdate/Makefile.depend.options (contents, props changed) head/usr.sbin/ntp/ntpdc/Makefile.depend.options (contents, props changed) head/usr.sbin/ntp/ntpq/Makefile.depend.options (contents, props changed) head/usr.sbin/ntp/sntp/Makefile.depend.options (contents, props changed) head/usr.sbin/rpcbind/Makefile.depend.options (contents, props changed) head/usr.sbin/rtsold/Makefile.depend.options (contents, props changed) head/usr.sbin/sendmail/Makefile.depend.options (contents, props changed) head/usr.sbin/tcpdump/tcpdump/Makefile.depend.options (contents, props changed) head/usr.sbin/traceroute/Makefile.depend.options (contents, props changed) head/usr.sbin/tzsetup/Makefile.depend.options (contents, props changed) head/usr.sbin/wpa/Makefile.depend.options (contents, props changed) head/usr.sbin/ypserv/Makefile.depend.options (contents, props changed) Added: head/bin/ls/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/ls/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= LS_COLORS + +DIRDEPS.LS_COLORS.yes= lib/ncurses/ncursesw + +.include Added: head/lib/libarchive/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OPENSSL + +.include Added: head/lib/libbsnmp/libbsnmp/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libbsnmp/libbsnmp/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OPENSSL + +.include Added: head/lib/libc/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= SSP + +DIRDEPS.SSP.yes= gnu/lib/libssp/libssp_nonshared + +.include Added: head/lib/libfetch/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libfetch/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,9 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OPENSSL + +DIRDEPS.OPENSSL.yes+= secure/lib/libssl +DIRDEPS.OPENSSL.no= lib/libmd + +.include Added: head/lib/libpam/modules/pam_unix/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libpam/modules/pam_unix/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= NIS + +DIRDEPS.NIS.yes= lib/libypclnt + +.include Added: head/lib/libpcap/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libpcap/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OFED + +DIRDEPS.OFED.yes= lib/ofed/libibverbs lib/ofed/libmlx5 + +.include Added: head/lib/libproc/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libproc/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,11 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CDDL LIBCPLUSPLUS + +DIRDEPS.CDDL.yes= cddl/lib/libctf + +DIRDEPS.LIBCPLUSPLUS.yes= lib/libcxxrt +DIRDEPS.LIBCPLUSPLUS.no= gnu/lib/libsupc++ + +.include Added: head/lib/libradius/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libradius/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OPENSSL + +.include Added: head/libexec/fingerd/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/fingerd/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= BLACKLIST_SUPPORT + +.include Added: head/libexec/ftpd/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/ftpd/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= BLACKLIST_SUPPORT PAM_SUPPORT + +.include Added: head/libexec/telnetd/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/telnetd/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= KERBEROS_SUPPORT OPENSSL + +.include Added: head/libexec/tftpd/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/tftpd/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= TCP_WRAPPERS + +.include Added: head/sbin/dhclient/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/dhclient/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= lib/libcasper/services/cap_syslog + +.include Added: head/sbin/dumpon/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/dumpon/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OPENSSL + +.include Added: head/sbin/ifconfig/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/ifconfig/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= JAIL WIRELESS_SUPPORT + +DIRDEPS.WIRELESS_SUPPORT.yes= lib/lib80211 + +.include Added: head/sbin/ping/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/ping/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= lib/libcasper/services/cap_dns + +.include Added: head/sbin/ping6/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/ping6/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= lib/libcasper/services/cap_dns + +.include Added: head/sbin/rtsol/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/rtsol/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= lib/libcasper/services/cap_syslog lib/libnv + +.include Added: head/sbin/savecore/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/savecore/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,10 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= \ + lib/libcasper/services/cap_fileargs \ + lib/libcasper/services/cap_syslog + +.include Added: head/secure/usr.bin/ssh/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/usr.bin/ssh/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= GSSAPI + +.include Added: head/secure/usr.sbin/sshd/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/usr.sbin/sshd/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= AUDIT BLACKLIST_SUPPORT GSSAPI KERBEROS_SUPPORT TCP_WRAPPERS + +.include Added: head/usr.bin/brandelf/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/brandelf/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= lib/libcasper/services/cap_fileargs + +.include Added: head/usr.bin/chkey/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/chkey/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= NIS + +DIRDEPS.NIS.yes= lib/libmp + +.include Added: head/usr.bin/chpass/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/chpass/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= NIS + +DIRDEPS.NIS.yes= lib/libypclnt + +.include Added: head/usr.bin/factor/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/factor/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OPENSSL + +.include Added: head/usr.bin/grep/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/grep/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= GNU_GREP_COMPAT + +DIRDEPS.GNU_GREP_COMPAT.yes= gnu/lib/libregex + +.include Added: head/usr.bin/gzip/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/gzip/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= BZIP2_SUPPORT + +DIRDEPS.BZIP2_SUPPORT.yes= lib/libbz2 + +.include Added: head/usr.bin/head/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/head/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= lib/libcasper/services/cap_fileargs + +.include Added: head/usr.bin/kdump/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/kdump/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,10 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= \ + lib/libcasper/services/cap_grp \ + lib/libcasper/services/cap_pwd + +.include Added: head/usr.bin/login/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/login/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= AUDIT + +.include Added: head/usr.bin/netstat/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/netstat/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= NETGRAPH_SUPPORT + +DIRDEPS.NETGRAPH_SUPPORT.yes= lib/libnetgraph + +.include Added: head/usr.bin/nm/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/nm/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= lib/libcasper/services/cap_fileargs + +.include Added: head/usr.bin/readelf/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/readelf/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= lib/libcasper/services/cap_fileargs + +.include Added: head/usr.bin/size/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/size/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= lib/libcasper/services/cap_fileargs + +.include Added: head/usr.bin/sort/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sort/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= SORT_THREADS + +DIRDEPS.SORT_THREADS.yes= lib/libmd lib/libpthread + +.include Added: head/usr.bin/strings/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/strings/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= lib/libcasper/services/cap_fileargs + +.include Added: head/usr.bin/su/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/su/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= AUDIT + +.include Added: head/usr.bin/tail/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/tail/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= lib/libcasper/services/cap_fileargs + +.include Added: head/usr.bin/telnet/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/telnet/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,11 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= KERBEROS_SUPPORT OPENSSL + +DIRDEPS.OPENSSL.yes= \ + lib/libipsec \ + lib/libmp \ + lib/libpam/libpam \ + +.include Added: head/usr.bin/wc/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/wc/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= lib/libcasper/services/cap_fileargs + +.include Added: head/usr.sbin/amd/amd/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/amd/amd/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= TCP_WRAPPERS + +.include Added: head/usr.sbin/bhyve/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OPENSSL + +.include Added: head/usr.sbin/bsnmpd/bsnmpd/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/bsnmpd/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= TCP_WRAPPERS + +.include Added: head/usr.sbin/fstyp/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/fstyp/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,11 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= ZFS + +DIRDEPS.ZFS.yes= \ + cddl/lib/libnvpair \ + cddl/lib/libzfs \ + cddl/lib/libzfs_core \ + +.include Added: head/usr.sbin/gssd/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/gssd/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= KERBEROS_SUPPORT + +.include Added: head/usr.sbin/inetd/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/inetd/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= TCP_WRAPPERS + +.include Added: head/usr.sbin/ngctl/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/ngctl/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= LIBTHR + +DIRDEPS.LIBTHR.yes= lib/libedit lib/libpthread + +.include Added: head/usr.sbin/ntp/ntp-keygen/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/ntp/ntp-keygen/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OPENSSL + +.include Added: head/usr.sbin/ntp/ntpd/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/ntp/ntpd/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OPENSSL + +.include Added: head/usr.sbin/ntp/ntpdate/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/ntp/ntpdate/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OPENSSL + +.include Added: head/usr.sbin/ntp/ntpdc/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/ntp/ntpdc/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OPENSSL + +.include Added: head/usr.sbin/ntp/ntpq/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/ntp/ntpq/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OPENSSL + +.include Added: head/usr.sbin/ntp/sntp/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/ntp/sntp/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OPENSSL + +.include Added: head/usr.sbin/rpcbind/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/rpcbind/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= TCP_WRAPPERS + +.include Added: head/usr.sbin/rtsold/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/rtsold/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= lib/libcasper/services/cap_syslog lib/libnv + +.include Added: head/usr.sbin/sendmail/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/sendmail/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OPENSSL TCP_WRAPPERS + +DIRDEPS.OPENSSL.yes= secure/lib/libssl + +.include Added: head/usr.sbin/tcpdump/tcpdump/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/tcpdump/tcpdump/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER OPENSSL + +DIRDEPS.CASPER.yes= lib/libcasper/services/cap_dns + +.include Added: head/usr.sbin/traceroute/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/traceroute/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= CASPER + +DIRDEPS.CASPER.yes= lib/libcasper/services/cap_dns + +.include Added: head/usr.sbin/tzsetup/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/tzsetup/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,10 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= DIALOG + +DIRDEPS.DIALOG.yes= \ + gnu/lib/libdialog \ + lib/ncurses/ncursesw \ + +.include Added: head/usr.sbin/wpa/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/wpa/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= OPENSSL + +.include Added: head/usr.sbin/ypserv/Makefile.depend.options ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/ypserv/Makefile.depend.options Wed Dec 11 17:37:37 2019 (r355616) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +DIRDEPS_OPTIONS= TCP_WRAPPERS + +.include From owner-svn-src-all@freebsd.org Wed Dec 11 17:38:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B318D1DC056; Wed, 11 Dec 2019 17:38:13 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47Y40556Hmz4P5X; Wed, 11 Dec 2019 17:38:13 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA2D6EC5F; Wed, 11 Dec 2019 17:38:13 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBBHcDwS068949; Wed, 11 Dec 2019 17:38:13 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBHbrgw068820; Wed, 11 Dec 2019 17:37:53 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201912111737.xBBHbrgw068820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 11 Dec 2019 17:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355617 - in head: bin/ls cddl/lib/libavl cddl/lib/libctf cddl/lib/libnvpair cddl/lib/libumem cddl/lib/libuutil cddl/lib/libzfs cddl/lib/libzfs_core gnu/lib/libdialog gnu/lib/libgomp gn... X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: bin/ls cddl/lib/libavl cddl/lib/libctf cddl/lib/libnvpair cddl/lib/libumem cddl/lib/libuutil cddl/lib/libzfs cddl/lib/libzfs_core gnu/lib/libdialog gnu/lib/libgomp gnu/lib/libregex gnu/lib/li... X-SVN-Commit-Revision: 355617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 17:38:13 -0000 Author: sjg Date: Wed Dec 11 17:37:53 2019 New Revision: 355617 URL: https://svnweb.freebsd.org/changeset/base/355617 Log: Update Makefile.depend files Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Added: head/lib/libbe/Makefile.depend (contents, props changed) head/lib/libcasper/services/cap_fileargs/Makefile.depend (contents, props changed) head/lib/libcasper/services/cap_syslog/Makefile.depend (contents, props changed) head/lib/libedit/Makefile.depend (contents, props changed) head/lib/libedit/readline/Makefile.depend (contents, props changed) head/lib/libmagic/Makefile.depend.inc (contents, props changed) head/lib/libomp/Makefile.depend (contents, props changed) head/lib/libopencsd/Makefile.depend (contents, props changed) head/lib/libsecureboot/Makefile.depend.amd64 (contents, props changed) head/lib/libveriexec/Makefile.depend (contents, props changed) head/lib/ofed/complib/Makefile.depend (contents, props changed) head/lib/ofed/include/Makefile.depend (contents, props changed) head/lib/ofed/libcxgb4/Makefile.depend (contents, props changed) head/lib/ofed/libibcm/Makefile.depend (contents, props changed) head/lib/ofed/libibmad/Makefile.depend (contents, props changed) head/lib/ofed/libibnetdisc/Makefile.depend (contents, props changed) head/lib/ofed/libibverbs/Makefile.depend (contents, props changed) head/lib/ofed/libmlx4/Makefile.depend (contents, props changed) head/lib/ofed/libmlx5/Makefile.depend (contents, props changed) head/lib/ofed/libopensm/Makefile.depend (contents, props changed) head/lib/ofed/librdmacm/Makefile.depend (contents, props changed) head/lib/ofed/libvendor/Makefile.depend (contents, props changed) head/sbin/bectl/Makefile.depend (contents, props changed) head/sbin/devmatch/Makefile.depend (contents, props changed) head/sbin/geom/Makefile.depend (contents, props changed) head/stand/i386/loader_4th/Makefile.depend (contents, props changed) Modified: head/bin/ls/Makefile.depend head/cddl/lib/libavl/Makefile.depend head/cddl/lib/libctf/Makefile.depend head/cddl/lib/libnvpair/Makefile.depend head/cddl/lib/libumem/Makefile.depend head/cddl/lib/libuutil/Makefile.depend head/cddl/lib/libzfs/Makefile.depend head/cddl/lib/libzfs_core/Makefile.depend head/gnu/lib/libdialog/Makefile.depend head/gnu/lib/libgomp/Makefile.depend head/gnu/lib/libregex/Makefile.depend head/gnu/lib/libssp/Makefile.depend head/gnu/lib/libstdc++/Makefile.depend head/gnu/lib/libsupc++/Makefile.depend head/kerberos5/lib/libasn1/Makefile.depend head/kerberos5/lib/libgssapi_krb5/Makefile.depend head/kerberos5/lib/libhdb/Makefile.depend head/kerberos5/lib/libheimbase/Makefile.depend head/kerberos5/lib/libheimipcc/Makefile.depend head/kerberos5/lib/libheimntlm/Makefile.depend head/kerberos5/lib/libhx509/Makefile.depend head/kerberos5/lib/libkadm5clnt/Makefile.depend head/kerberos5/lib/libkafs5/Makefile.depend head/kerberos5/lib/libkdc/Makefile.depend head/kerberos5/lib/libkrb5/Makefile.depend head/kerberos5/lib/libroken/Makefile.depend head/kerberos5/lib/libwind/Makefile.depend head/lib/atf/libatf-c/Makefile.depend head/lib/lib80211/Makefile.depend head/lib/libalias/libalias/Makefile.depend head/lib/libarchive/Makefile.depend head/lib/libbegemot/Makefile.depend head/lib/libblacklist/Makefile.depend head/lib/libblocksruntime/Makefile.depend head/lib/libbluetooth/Makefile.depend head/lib/libbsdstat/Makefile.depend head/lib/libbsm/Makefile.depend head/lib/libbsnmp/libbsnmp/Makefile.depend head/lib/libbz2/Makefile.depend head/lib/libc++/Makefile.depend head/lib/libc/Makefile.depend head/lib/libc/tests/tls_dso/Makefile.depend head/lib/libcalendar/Makefile.depend head/lib/libcam/Makefile.depend head/lib/libcasper/libcasper/Makefile.depend head/lib/libcasper/services/cap_dns/Makefile.depend head/lib/libcasper/services/cap_grp/Makefile.depend head/lib/libcasper/services/cap_pwd/Makefile.depend head/lib/libcasper/services/cap_sysctl/Makefile.depend head/lib/libcom_err/Makefile.depend head/lib/libcrypt/Makefile.depend head/lib/libcuse/Makefile.depend head/lib/libcxxrt/Makefile.depend head/lib/libdevctl/Makefile.depend head/lib/libdevdctl/Makefile.depend head/lib/libdevinfo/Makefile.depend head/lib/libdevstat/Makefile.depend head/lib/libdpv/Makefile.depend head/lib/libdwarf/Makefile.depend head/lib/libefivar/Makefile.depend head/lib/libelf/Makefile.depend head/lib/libevent/Makefile.depend head/lib/libexecinfo/Makefile.depend head/lib/libexpat/Makefile.depend head/lib/libfetch/Makefile.depend head/lib/libfigpar/Makefile.depend head/lib/libgcc_s/Makefile.depend head/lib/libgeom/Makefile.depend head/lib/libgpio/Makefile.depend head/lib/libgssapi/Makefile.depend head/lib/libipsec/Makefile.depend head/lib/libjail/Makefile.depend head/lib/libkvm/Makefile.depend head/lib/libldns/Makefile.depend head/lib/liblzma/Makefile.depend head/lib/libmagic/Makefile.depend head/lib/libmd/Makefile.depend head/lib/libmemstat/Makefile.depend head/lib/libmilter/Makefile.depend head/lib/libmp/Makefile.depend head/lib/libmt/Makefile.depend head/lib/libnetgraph/Makefile.depend head/lib/libngatm/Makefile.depend head/lib/libnv/Makefile.depend head/lib/libopie/Makefile.depend head/lib/libpam/libpam/Makefile.depend head/lib/libpam/modules/pam_unix/Makefile.depend head/lib/libpcap/Makefile.depend head/lib/libpmc/Makefile.depend head/lib/libproc/Makefile.depend head/lib/libprocstat/Makefile.depend head/lib/libradius/Makefile.depend head/lib/librpcsvc/Makefile.depend head/lib/librss/Makefile.depend head/lib/librtld_db/Makefile.depend head/lib/libsbuf/Makefile.depend head/lib/libsdp/Makefile.depend head/lib/libsecureboot/Makefile.depend head/lib/libsqlite3/Makefile.depend head/lib/libstdthreads/Makefile.depend head/lib/libsysdecode/Makefile.depend head/lib/libtacplus/Makefile.depend head/lib/libthr/Makefile.depend head/lib/libthread_db/Makefile.depend head/lib/libucl/Makefile.depend head/lib/libufs/Makefile.depend head/lib/libugidfw/Makefile.depend head/lib/libulog/Makefile.depend head/lib/libusb/Makefile.depend head/lib/libusbhid/Makefile.depend head/lib/libutil/Makefile.depend head/lib/libvgl/Makefile.depend head/lib/libvmmapi/Makefile.depend head/lib/libwrap/Makefile.depend head/lib/libxo/Makefile.depend head/lib/libypclnt/Makefile.depend head/lib/libz/Makefile.depend head/lib/libzstd/Makefile.depend head/lib/msun/Makefile.depend head/lib/ncurses/formw/Makefile.depend head/lib/ncurses/menuw/Makefile.depend head/lib/ncurses/ncursesw/Makefile.depend head/lib/ncurses/panelw/Makefile.depend head/libexec/fingerd/Makefile.depend head/libexec/ftpd/Makefile.depend head/libexec/telnetd/Makefile.depend head/libexec/tftpd/Makefile.depend head/sbin/dhclient/Makefile.depend head/sbin/dumpon/Makefile.depend head/sbin/ifconfig/Makefile.depend head/sbin/ping/Makefile.depend head/sbin/ping6/Makefile.depend head/sbin/rtsol/Makefile.depend head/sbin/savecore/Makefile.depend head/secure/lib/libcrypto/Makefile.depend head/secure/lib/libssh/Makefile.depend head/secure/lib/libssl/Makefile.depend head/secure/usr.bin/ssh/Makefile.depend head/secure/usr.sbin/sshd/Makefile.depend head/stand/efi/libefi/Makefile.depend head/stand/efi/loader/Makefile.depend head/usr.bin/brandelf/Makefile.depend head/usr.bin/chkey/Makefile.depend head/usr.bin/chpass/Makefile.depend head/usr.bin/factor/Makefile.depend head/usr.bin/grep/Makefile.depend head/usr.bin/gzip/Makefile.depend head/usr.bin/head/Makefile.depend head/usr.bin/kdump/Makefile.depend head/usr.bin/lex/Makefile.depend head/usr.bin/login/Makefile.depend head/usr.bin/netstat/Makefile.depend head/usr.bin/nm/Makefile.depend head/usr.bin/readelf/Makefile.depend head/usr.bin/size/Makefile.depend head/usr.bin/sort/Makefile.depend head/usr.bin/strings/Makefile.depend head/usr.bin/su/Makefile.depend head/usr.bin/tail/Makefile.depend head/usr.bin/telnet/Makefile.depend head/usr.bin/wc/Makefile.depend head/usr.sbin/amd/amd/Makefile.depend head/usr.sbin/bhyve/Makefile.depend head/usr.sbin/bsnmpd/bsnmpd/Makefile.depend head/usr.sbin/bsnmpd/modules/snmp_bridge/Makefile.depend head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile.depend head/usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile.depend head/usr.sbin/fstyp/Makefile.depend head/usr.sbin/gssd/Makefile.depend head/usr.sbin/inetd/Makefile.depend head/usr.sbin/makefs/Makefile.depend head/usr.sbin/ngctl/Makefile.depend head/usr.sbin/ntp/libntp/Makefile.depend head/usr.sbin/ntp/libntpevent/Makefile.depend head/usr.sbin/ntp/ntp-keygen/Makefile.depend head/usr.sbin/ntp/ntpd/Makefile.depend head/usr.sbin/ntp/ntpdate/Makefile.depend head/usr.sbin/ntp/ntpdc/Makefile.depend head/usr.sbin/ntp/ntpq/Makefile.depend head/usr.sbin/ntp/sntp/Makefile.depend head/usr.sbin/rpcbind/Makefile.depend head/usr.sbin/rtsold/Makefile.depend head/usr.sbin/sendmail/Makefile.depend head/usr.sbin/tcpdump/tcpdump/Makefile.depend head/usr.sbin/traceroute/Makefile.depend head/usr.sbin/tzsetup/Makefile.depend head/usr.sbin/ypserv/Makefile.depend Modified: head/bin/ls/Makefile.depend ============================================================================== --- head/bin/ls/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/bin/ls/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,14 +2,12 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ lib/libutil \ - lib/ncurses/ncursesw \ .include Modified: head/cddl/lib/libavl/Makefile.depend ============================================================================== --- head/cddl/lib/libavl/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/cddl/lib/libavl/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ lib/${CSU_DIR} \ lib/libc \ Modified: head/cddl/lib/libctf/Makefile.depend ============================================================================== --- head/cddl/lib/libctf/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/cddl/lib/libctf/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/cddl/lib/libnvpair/Makefile.depend ============================================================================== --- head/cddl/lib/libnvpair/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/cddl/lib/libnvpair/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/cddl/lib/libumem/Makefile.depend ============================================================================== --- head/cddl/lib/libumem/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/cddl/lib/libumem/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ lib/${CSU_DIR} \ lib/libc \ Modified: head/cddl/lib/libuutil/Makefile.depend ============================================================================== --- head/cddl/lib/libuutil/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/cddl/lib/libuutil/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/cddl/lib/libzfs/Makefile.depend ============================================================================== --- head/cddl/lib/libzfs/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/cddl/lib/libzfs/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -7,7 +7,6 @@ DIRDEPS = \ cddl/lib/libumem \ cddl/lib/libuutil \ cddl/lib/libzfs_core \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/cddl/lib/libzfs_core/Makefile.depend ============================================================================== --- head/cddl/lib/libzfs_core/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/cddl/lib/libzfs_core/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -3,7 +3,6 @@ DIRDEPS = \ cddl/lib/libnvpair \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/gnu/lib/libdialog/Makefile.depend ============================================================================== --- head/gnu/lib/libdialog/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/gnu/lib/libdialog/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/gnu/lib/libgomp/Makefile.depend ============================================================================== --- head/gnu/lib/libgomp/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/gnu/lib/libgomp/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/gnu/lib/libregex/Makefile.depend ============================================================================== --- head/gnu/lib/libregex/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/gnu/lib/libregex/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/gnu/lib/libssp/Makefile.depend ============================================================================== --- head/gnu/lib/libssp/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/gnu/lib/libssp/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/gnu/lib/libstdc++/Makefile.depend ============================================================================== --- head/gnu/lib/libstdc++/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/gnu/lib/libstdc++/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/gnu/lib/libsupc++/Makefile.depend ============================================================================== --- head/gnu/lib/libsupc++/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/gnu/lib/libsupc++/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ gnu/lib/libstdc++ \ include \ include/xlocale \ Modified: head/kerberos5/lib/libasn1/Makefile.depend ============================================================================== --- head/kerberos5/lib/libasn1/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/kerberos5/lib/libasn1/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/kerberos5/lib/libgssapi_krb5/Makefile.depend ============================================================================== --- head/kerberos5/lib/libgssapi_krb5/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/kerberos5/lib/libgssapi_krb5/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/kerberos5/lib/libhdb/Makefile.depend ============================================================================== --- head/kerberos5/lib/libhdb/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/kerberos5/lib/libhdb/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/kerberos5/lib/libheimbase/Makefile.depend ============================================================================== --- head/kerberos5/lib/libheimbase/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/kerberos5/lib/libheimbase/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/kerberos5/lib/libheimipcc/Makefile.depend ============================================================================== --- head/kerberos5/lib/libheimipcc/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/kerberos5/lib/libheimipcc/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/kerberos5/lib/libheimntlm/Makefile.depend ============================================================================== --- head/kerberos5/lib/libheimntlm/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/kerberos5/lib/libheimntlm/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/kerberos5/lib/libhx509/Makefile.depend ============================================================================== --- head/kerberos5/lib/libhx509/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/kerberos5/lib/libhx509/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/kerberos5/lib/libkadm5clnt/Makefile.depend ============================================================================== --- head/kerberos5/lib/libkadm5clnt/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/kerberos5/lib/libkadm5clnt/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/kerberos5/lib/libkafs5/Makefile.depend ============================================================================== --- head/kerberos5/lib/libkafs5/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/kerberos5/lib/libkafs5/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/kerberos5/lib/libkdc/Makefile.depend ============================================================================== --- head/kerberos5/lib/libkdc/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/kerberos5/lib/libkdc/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ @@ -16,7 +15,6 @@ DIRDEPS = \ kerberos5/lib/libwind \ lib/${CSU_DIR} \ lib/libc \ - lib/libcom_err \ lib/libcompiler_rt \ lib/libutil \ secure/lib/libcrypto \ Modified: head/kerberos5/lib/libkrb5/Makefile.depend ============================================================================== --- head/kerberos5/lib/libkrb5/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/kerberos5/lib/libkrb5/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/kerberos5/lib/libroken/Makefile.depend ============================================================================== --- head/kerberos5/lib/libroken/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/kerberos5/lib/libroken/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/kerberos5/lib/libwind/Makefile.depend ============================================================================== --- head/kerberos5/lib/libwind/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/kerberos5/lib/libwind/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/lib/atf/libatf-c/Makefile.depend ============================================================================== --- head/lib/atf/libatf-c/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/atf/libatf-c/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/lib80211/Makefile.depend ============================================================================== --- head/lib/lib80211/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/lib80211/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libalias/libalias/Makefile.depend ============================================================================== --- head/lib/libalias/libalias/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libalias/libalias/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/lib/libarchive/Makefile.depend ============================================================================== --- head/lib/libarchive/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libarchive/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ @@ -12,7 +11,7 @@ DIRDEPS = \ lib/libexpat \ lib/liblzma \ lib/libz \ - secure/lib/libcrypto \ + lib/libzstd \ .include Added: head/lib/libbe/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libbe/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -0,0 +1,20 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + cddl/lib/libnvpair \ + cddl/lib/libzfs \ + cddl/lib/libzfs_core \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + lib/msun \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Modified: head/lib/libbegemot/Makefile.depend ============================================================================== --- head/lib/libbegemot/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libbegemot/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libblacklist/Makefile.depend ============================================================================== --- head/lib/libblacklist/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libblacklist/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libblocksruntime/Makefile.depend ============================================================================== --- head/lib/libblocksruntime/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libblocksruntime/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libbluetooth/Makefile.depend ============================================================================== --- head/lib/libbluetooth/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libbluetooth/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libbsdstat/Makefile.depend ============================================================================== --- head/lib/libbsdstat/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libbsdstat/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libbsm/Makefile.depend ============================================================================== --- head/lib/libbsm/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libbsm/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/lib/libbsnmp/libbsnmp/Makefile.depend ============================================================================== --- head/lib/libbsnmp/libbsnmp/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libbsnmp/libbsnmp/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,14 +2,13 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - secure/lib/libcrypto \ + usr.sbin/bsnmpd/gensnmptree.host \ .include Modified: head/lib/libbz2/Makefile.depend ============================================================================== --- head/lib/libbz2/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libbz2/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libc++/Makefile.depend ============================================================================== --- head/lib/libc++/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libc++/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libc/Makefile.depend ============================================================================== --- head/lib/libc/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libc/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/rpc \ include/rpcsvc \ Modified: head/lib/libc/tests/tls_dso/Makefile.depend ============================================================================== --- head/lib/libc/tests/tls_dso/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libc/tests/tls_dso/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ lib/${CSU_DIR} \ lib/libc \ Modified: head/lib/libcalendar/Makefile.depend ============================================================================== --- head/lib/libcalendar/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libcalendar/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ lib/${CSU_DIR} \ lib/libc \ Modified: head/lib/libcam/Makefile.depend ============================================================================== --- head/lib/libcam/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libcam/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libcasper/libcasper/Makefile.depend ============================================================================== --- head/lib/libcasper/libcasper/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libcasper/libcasper/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libcasper/services/cap_dns/Makefile.depend ============================================================================== --- head/lib/libcasper/services/cap_dns/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libcasper/services/cap_dns/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Added: head/lib/libcasper/services/cap_fileargs/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcasper/services/cap_fileargs/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcasper/libcasper \ + lib/libcompiler_rt \ + lib/libnv \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Modified: head/lib/libcasper/services/cap_grp/Makefile.depend ============================================================================== --- head/lib/libcasper/services/cap_grp/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libcasper/services/cap_grp/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libcasper/services/cap_pwd/Makefile.depend ============================================================================== --- head/lib/libcasper/services/cap_pwd/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libcasper/services/cap_pwd/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libcasper/services/cap_sysctl/Makefile.depend ============================================================================== --- head/lib/libcasper/services/cap_sysctl/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libcasper/services/cap_sysctl/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Added: head/lib/libcasper/services/cap_syslog/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcasper/services/cap_syslog/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcasper/libcasper \ + lib/libcompiler_rt \ + lib/libnv \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Modified: head/lib/libcom_err/Makefile.depend ============================================================================== --- head/lib/libcom_err/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libcom_err/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libcrypt/Makefile.depend ============================================================================== --- head/lib/libcrypt/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libcrypt/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/lib/libcuse/Makefile.depend ============================================================================== --- head/lib/libcuse/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libcuse/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libcxxrt/Makefile.depend ============================================================================== --- head/lib/libcxxrt/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libcxxrt/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libdevctl/Makefile.depend ============================================================================== --- head/lib/libdevctl/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libdevctl/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libdevdctl/Makefile.depend ============================================================================== --- head/lib/libdevdctl/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libdevdctl/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libdevinfo/Makefile.depend ============================================================================== --- head/lib/libdevinfo/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libdevinfo/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libdevstat/Makefile.depend ============================================================================== --- head/lib/libdevstat/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libdevstat/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libdpv/Makefile.depend ============================================================================== --- head/lib/libdpv/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libdpv/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ gnu/lib/libdialog \ include \ include/xlocale \ Modified: head/lib/libdwarf/Makefile.depend ============================================================================== --- head/lib/libdwarf/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libdwarf/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Added: head/lib/libedit/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libedit/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -0,0 +1,17 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + lib/ncurses/ncursesw \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/lib/libedit/readline/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libedit/readline/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -0,0 +1,11 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Modified: head/lib/libefivar/Makefile.depend ============================================================================== --- head/lib/libefivar/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libefivar/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,12 +2,12 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ + lib/libgeom \ .include Modified: head/lib/libelf/Makefile.depend ============================================================================== --- head/lib/libelf/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libelf/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libevent/Makefile.depend ============================================================================== --- head/lib/libevent/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libevent/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libexecinfo/Makefile.depend ============================================================================== --- head/lib/libexecinfo/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libexecinfo/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libexpat/Makefile.depend ============================================================================== --- head/lib/libexpat/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libexpat/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libfetch/Makefile.depend ============================================================================== --- head/lib/libfetch/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libfetch/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,14 +2,11 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - secure/lib/libcrypto \ - secure/lib/libssl \ .include Modified: head/lib/libfigpar/Makefile.depend ============================================================================== --- head/lib/libfigpar/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libfigpar/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libgcc_s/Makefile.depend ============================================================================== --- head/lib/libgcc_s/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libgcc_s/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libgeom/Makefile.depend ============================================================================== --- head/lib/libgeom/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libgeom/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libgpio/Makefile.depend ============================================================================== --- head/lib/libgpio/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libgpio/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libgssapi/Makefile.depend ============================================================================== --- head/lib/libgssapi/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libgssapi/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/gssapi \ include/xlocale \ Modified: head/lib/libipsec/Makefile.depend ============================================================================== --- head/lib/libipsec/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libipsec/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/lib/libjail/Makefile.depend ============================================================================== --- head/lib/libjail/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libjail/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/lib/libkvm/Makefile.depend ============================================================================== --- head/lib/libkvm/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libkvm/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libldns/Makefile.depend ============================================================================== --- head/lib/libldns/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libldns/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/lib/liblzma/Makefile.depend ============================================================================== --- head/lib/liblzma/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/liblzma/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libmagic/Makefile.depend ============================================================================== --- head/lib/libmagic/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libmagic/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,12 +2,12 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ + lib/libmagic.host \ lib/libz \ Added: head/lib/libmagic/Makefile.depend.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libmagic/Makefile.depend.inc Wed Dec 11 17:37:53 2019 (r355617) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# This file is not autogenerated - take care! + +.if ${DEP_MACHINE:U${MACHINE}} != "host" +DIRDEPS+= ${DEP_RELDIR:U${RELDIR}}.host +.endif Modified: head/lib/libmd/Makefile.depend ============================================================================== --- head/lib/libmd/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libmd/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libmemstat/Makefile.depend ============================================================================== --- head/lib/libmemstat/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libmemstat/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libmilter/Makefile.depend ============================================================================== --- head/lib/libmilter/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libmilter/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/lib/libmp/Makefile.depend ============================================================================== --- head/lib/libmp/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libmp/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libmt/Makefile.depend ============================================================================== --- head/lib/libmt/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libmt/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libnetgraph/Makefile.depend ============================================================================== --- head/lib/libnetgraph/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libnetgraph/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Modified: head/lib/libngatm/Makefile.depend ============================================================================== --- head/lib/libngatm/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libngatm/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/arpa \ include/xlocale \ Modified: head/lib/libnv/Makefile.depend ============================================================================== --- head/lib/libnv/Makefile.depend Wed Dec 11 17:37:37 2019 (r355616) +++ head/lib/libnv/Makefile.depend Wed Dec 11 17:37:53 2019 (r355617) @@ -2,7 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ Added: head/lib/libomp/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 11 17:38:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 141481DC082; Wed, 11 Dec 2019 17:38:19 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47Y40C0DpJz4PCK; Wed, 11 Dec 2019 17:38:19 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF2A0EC60; Wed, 11 Dec 2019 17:38:18 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBBHcIs7069022; Wed, 11 Dec 2019 17:38:18 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBHcF9X069000; Wed, 11 Dec 2019 17:38:15 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201912111738.xBBHcF9X069000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 11 Dec 2019 17:38:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355618 - in head: lib/libbsnmp/libbsnmp lib/libgcc_eh lib/libmagic lib/libpmc share/mk targets X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: lib/libbsnmp/libbsnmp lib/libgcc_eh lib/libmagic lib/libpmc share/mk targets X-SVN-Commit-Revision: 355618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 17:38:19 -0000 Author: sjg Date: Wed Dec 11 17:38:15 2019 New Revision: 355618 URL: https://svnweb.freebsd.org/changeset/base/355618 Log: Update dirdeps.mk and gendirdeps.mk The env space consumed by exporting all libc's .meta files left little room for command line, so unexport when done. Update dirdeps.mk to latest and add dirdeps-targets.mk to simplify/update targets/Makefile Makefile changes to go with Makefile.depend changes in D22494 Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22495 Added: head/share/mk/dirdeps-targets.mk (contents, props changed) head/share/mk/local.dirdeps-options.mk (contents, props changed) Modified: head/lib/libbsnmp/libbsnmp/Makefile head/lib/libgcc_eh/Makefile head/lib/libmagic/Makefile head/lib/libpmc/Makefile head/share/mk/dirdeps.mk head/share/mk/gendirdeps.mk head/share/mk/local.dirdeps.mk head/share/mk/local.gendirdeps.mk head/share/mk/local.meta.sys.mk head/share/mk/meta.sys.mk head/targets/Makefile head/targets/Makefile.inc Modified: head/lib/libbsnmp/libbsnmp/Makefile ============================================================================== --- head/lib/libbsnmp/libbsnmp/Makefile Wed Dec 11 17:37:53 2019 (r355617) +++ head/lib/libbsnmp/libbsnmp/Makefile Wed Dec 11 17:38:15 2019 (r355618) @@ -24,12 +24,17 @@ SRCS+= snmptc.h INCS= asn1.h snmp.h snmpagent.h snmpclient.h MAN= asn1.3 bsnmpagent.3 bsnmpclient.3 bsnmplib.3 +.if ${MK_DIRDEPS_BUILD} == "yes" +GENSNMPTREE?= ${HOST_OBJTOP}/usr.sbin/bsnmpd/gensnmptree/gensnmptree +.endif +GENSNMPTREE?= gensnmptree + snmptc.h : tc.def (\ echo "/* autogenerated from tc.def */";\ echo "#ifndef snmptc_h_1529923773";\ echo "#define snmptc_h_1529923773";\ - gensnmptree -E -f <${.ALLSRC};\ + ${GENSNMPTREE} -E -f <${.ALLSRC};\ echo "#endif" ; \ ) >${.TARGET} Modified: head/lib/libgcc_eh/Makefile ============================================================================== --- head/lib/libgcc_eh/Makefile Wed Dec 11 17:37:53 2019 (r355617) +++ head/lib/libgcc_eh/Makefile Wed Dec 11 17:38:15 2019 (r355618) @@ -10,4 +10,10 @@ WARNS?= 2 .include "Makefile.inc" +.if ${.MAKE.LEVEL} > 0 +# avoid circular dependencies +GENDIRDEPS_FILTER+= Nlib/msun +CFLAGS+= -I${SRCTOP}/lib/msun/src +.endif + .include Modified: head/lib/libmagic/Makefile ============================================================================== --- head/lib/libmagic/Makefile Wed Dec 11 17:37:53 2019 (r355617) +++ head/lib/libmagic/Makefile Wed Dec 11 17:38:15 2019 (r355618) @@ -40,12 +40,18 @@ magic: ${MAGFILES} magic.mgc: mkmagic magic ${BTOOLSPATH:U.}/mkmagic magic +.if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no" CLEANFILES+= mkmagic DEPENDOBJS+= mkmagic build-tools: mkmagic mkmagic: apprentice.c cdf_time.c encoding.c funcs.c magic.c print.c ${INCS} ${BUILD_TOOLS_META} ${CC:N${CCACHE_BIN}} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} \ ${.ALLSRC:N*.h:O:u} ${LDADD} + +.endif +.if ${MK_DIRDEPS_BUILD} == "yes" +BTOOLSPATH= ${HOST_OBJTOP}/${RELDIR} +.endif FILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \ ${.CURDIR}/config.h Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Wed Dec 11 17:37:53 2019 (r355617) +++ head/lib/libpmc/Makefile Wed Dec 11 17:38:15 2019 (r355618) @@ -17,11 +17,19 @@ EVENT_ARCH="x86" EVENT_ARCH="powerpc" .endif +.if ${MK_DIRDEPS_BUILD} == "yes" +# avoid circular dependency +CFLAGS+= -I${RELDIR:H}/libpmcstat +GENDIRDEPS_FILTER+= N${RELDIR:H}/libpmcstat +JEVENTS?= ${HOST_OBJTOP}/${RELDIR}/pmu-events/jevents +.else JEVENTS= ${BTOOLSPATH:U.}/pmu-events/jevents + # This file is built in a subdirectory so never try to rebuild it here. ${JEVENTS}: .PHONY .if make(*clean*) SUBDIR+= pmu-events +.endif .endif libpmc_events.c: ${JEVENTS} Added: head/share/mk/dirdeps-targets.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/dirdeps-targets.mk Wed Dec 11 17:38:15 2019 (r355618) @@ -0,0 +1,134 @@ +# $FreeBSD$ +# RCSid: +# $Id: dirdeps-targets.mk,v 1.9 2019/10/06 20:07:50 sjg Exp $ +# +# @(#) Copyright (c) 2019 Simon J. Gerraty +# +# This file is provided in the hope that it will +# be of use. There is absolutely NO WARRANTY. +# Permission to copy, redistribute or otherwise +# use this file is hereby granted provided that +# the above copyright notice and this notice are +# left intact. +# +# Please send copies of changes and bug-fixes to: +# sjg@crufty.net +# + +## +# This makefile is used to set initial DIRDEPS for top-level build +# targets. +# +# The basic idea is that we have a list of directories in +# DIRDEPS_TARGETS_DIRS which are relative to SRCTOP. +# When asked to make 'foo' we look for any directory named 'foo' +# under DIRDEPS_TARGETS_DIRS. +# We then search those dirs for any Makefile.depend* +# Finally we select any that match conditions like REQUESTED_MACHINE +# or TARGET_SPEC and initialize DIRDEPS accordingly. +# + +.if ${.MAKE.LEVEL} == 0 +# pickup customizations +.-include + +# for DIRDEPS_BUILD this is how we prime the pump +DIRDEPS_TARGETS_DIRS ?= targets targets/pseudo +# these prefixes can modify how we behave +# they need to be stripped when looking for target dirs +DIRDEPS_TARGETS_PREFIX_LIST ?= pkg- build- + +# matching target dirs if any +tdirs := ${.TARGETS:Nall:${DIRDEPS_TARGETS_PREFIX_LIST:@p@S,^$p,,@:ts:}:@t@${DIRDEPS_TARGETS_DIRS:@d@$d/$t@}@:@d@${exists(${SRCTOP}/$d):?$d:}@} + +.if !empty(DEBUG_DIRDEPS_TARGETS) +.info tdirs=${tdirs} +.endif + +.if !empty(tdirs) +# some things we know we want to ignore +DIRDEPS_TARGETS_SKIP_LIST += \ + *~ \ + *.bak \ + *.inc \ + *.old \ + *.options \ + *.orig \ + *.rej \ + +# the list of MACHINEs we consider +DIRDEPS_TARGETS_MACHINE_LIST += \ + ${ALL_MACHINE_LIST:U} \ + ${PSEUDO_MACHINE_LIST:Ucommon host host32} \ + ${TARGET_MACHINE_LIST} + +DIRDEPS_TARGETS_MACHINE_LIST := ${DIRDEPS_TARGETS_MACHINE_LIST:O:u} + +# raw Makefile.depend* list +tdeps != 'cd' ${SRCTOP} && 'ls' -1 ${tdirs:O:u:@d@$d/${.MAKE.DEPENDFILE_PREFIX}*@} 2> /dev/null; echo +.if ${DEBUG_DIRDEPS_TARGETS:U:Mdep*} != "" +.info tdeps=${tdeps} +.endif +# remove things we know we don't want +tdeps := ${tdeps:${DIRDEPS_TARGETS_SKIP_LIST:${M_ListToSkip}}} +.if ${DEBUG_DIRDEPS_TARGETS:U:Mdep*} != "" +.info tdeps=${tdeps} +.endif + +# plain entries (no qualifiers) these apply to any TARGET_SPEC +ptdeps := ${tdeps:M*${.MAKE.DEPENDFILE_PREFIX}:S,/${.MAKE.DEPENDFILE_PREFIX},,} + +# MACHINE qualified entries +mqtdeps := ${DIRDEPS_TARGETS_MACHINE_LIST:@m@${tdeps:M*.$m}@:S,/${.MAKE.DEPENDFILE_PREFIX},,} + +tqtdeps = +.if ${TARGET_SPEC_VARS:[#]} > 1 +# TARGET_SPEC qualified entries +.if !empty(TARGET_SPEC_LIST) +# we have a list of valid TARGET_SPECS; use it +tqtdeps := ${TARGET_SPEC_LIST:U:O:u:@t@${tdeps:M*.$t}@:S,/${.MAKE.DEPENDFILE_PREFIX},,} +.else +# do we have a list of valid tuple members for at least +# the last tupple element? if so match on that +TARGET_SPEC_LAST_LIST ?= ${${TARGET_SPEC_VARS:[-1]}_LIST} +.if !empty(TARGET_SPEC_LAST_LIST) +tqtdeps := ${TARGET_SPEC_LAST_LIST:U:O:u:@t@${tdeps:M*,$t}@:S,/${.MAKE.DEPENDFILE_PREFIX},,} +.else +# this is sub-optimal match MACHINE, +tqtdeps := ${DIRDEPS_TARGETS_MACHINE_LIST:@m@${tdeps:M*.$m,*}@:S,/${.MAKE.DEPENDFILE_PREFIX},,} +.endif +.endif +.endif + +# now work out what we want in DIRDEPS +.if empty(REQUESTED_MACHINE) +# we want them all just as found +DIRDEPS = ${ptdeps} ${mqtdeps} ${tqtdeps} +.else +# we only want those that match REQUESTED_MACHINE/REQUESTED_TARGET_SPEC +# or REQUESTED_TARGET_SPEC (TARGET_SPEC) +DIRDEPS = \ + ${ptdeps:@d@$d.${REQUESTED_TARGET_SPEC:U${TARGET_SPEC:U${REQUESTED_MACHINE}}}@} \ + ${mqtdeps:M*.${REQUESTED_MACHINE}} \ + ${tqtdeps:M*.${REQUESTED_TARGET_SPEC:U${TARGET_SPEC}}} +.endif +# clean up +DIRDEPS := ${DIRDEPS:O:u} + +.if !empty(DEBUG_DIRDEPS_TARGETS) +.for x in tdeps ptdeps mqtdeps tqtdeps DIRDEPS +.info $x=${$x} +.endfor +.endif +.endif +# if we got DIRDEPS get to work +.if !empty(DIRDEPS) +.include + +DIRDEPS_TARGETS_SKIP += all clean* destroy* + +.for t in ${.TARGETS:${DIRDEPS_TARGETS_SKIP:${M_ListToSkip}}} +$t: dirdeps +.endfor +.endif +.endif Modified: head/share/mk/dirdeps.mk ============================================================================== --- head/share/mk/dirdeps.mk Wed Dec 11 17:37:53 2019 (r355617) +++ head/share/mk/dirdeps.mk Wed Dec 11 17:38:15 2019 (r355618) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: dirdeps.mk,v 1.96 2018/06/20 22:26:39 sjg Exp $ +# $Id: dirdeps.mk,v 1.100 2019/11/12 06:47:58 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -379,7 +379,8 @@ DIRDEPS_FILTER += M${_DEP_RELDIR} .endif # this is what we run below -DIRDEP_MAKE?= ${.MAKE} +DIRDEP_MAKE ?= ${.MAKE} +DIRDEP_DIR ?= ${.TARGET:R} # we suppress SUBDIR when visiting the leaves # we assume sys.mk will set MACHINE_ARCH @@ -389,10 +390,11 @@ _DIRDEP_USE: .USE .MAKE @for m in ${.MAKE.MAKEFILE_PREFERENCE}; do \ test -s ${.TARGET:R}/$$m || continue; \ echo "${TRACER}Checking ${.TARGET:R} for ${.TARGET:E} ..."; \ + ${DIRDEP_USE_PRELUDE} \ MACHINE_ARCH= NO_SUBDIR=1 ${DIRDEP_USE_ENV} \ TARGET_SPEC=${.TARGET:E} \ MACHINE=${.TARGET:E} \ - ${DIRDEP_MAKE} -C ${.TARGET:R} || exit 1; \ + ${DIRDEP_MAKE} -C ${DIRDEP_DIR} || exit 1; \ break; \ done @@ -476,7 +478,7 @@ BUILD_DIRDEPS_TARGETS ?= ${.TARGETS} ${DIRDEPS_CACHE}: .META .NOMETA_CMP +@{ echo '# Autogenerated - do NOT edit!'; echo; \ echo 'BUILD_DIRDEPS=no'; echo; \ - echo '.include '; \ + echo '.include '; echo; \ } > ${.TARGET}.new +@MAKELEVEL=${.MAKE.LEVEL} DIRDEPS_CACHE=${DIRDEPS_CACHE} \ DIRDEPS="${DIRDEPS}" \ @@ -640,9 +642,15 @@ _build_all_dirs := ${_build_all_dirs:O:u} .if ${.MAKEFLAGS:M-V${_V_READ_DIRDEPS}} == "" .if !empty(_build_all_dirs) .if ${BUILD_DIRDEPS_CACHE} == "yes" -x!= { echo; echo '\# ${DEP_RELDIR}.${DEP_TARGET_SPEC}'; \ - echo 'dirdeps: ${_build_all_dirs:${M_oneperline}}'; echo; } >&3; echo -x!= { ${_build_all_dirs:@x@${target($x):?:echo '$x: _DIRDEP_USE';}@} echo; } >&3; echo +# guard against _build_all_dirs being too big for a single command line +# first get list of dirs that need _DIRDEP_USE +# then export that and _build_all_dirs +_new_dirdeps := ${_build_all_dirs:@x@${target($x):?:$x}@} +.export _new_dirdeps _build_all_dirs +x!= echo; { echo '\# ${DEP_RELDIR}.${DEP_TARGET_SPEC}'; \ + echo "dirdeps: \\"; \ + for x in $$_build_all_dirs; do echo " $$x \\"; done; echo; \ + for x in $$_new_dirdeps; do echo "$$x: _DIRDEP_USE"; done; echo; } >&3 .if !empty(DEP_EXPORT_VARS) # Discouraged, but there are always exceptions. # Handle it here rather than explain how. @@ -672,7 +680,10 @@ DEP_EXPORT_VARS= .info ${DEP_RELDIR}.$m: graph: ${_build_dirs:M*.$q} .endif .if ${BUILD_DIRDEPS_CACHE} == "yes" -x!= { echo; echo '${_this_dir}.$m: ${_build_dirs:M*.$q:${M_oneperline}}'; echo; } >&3; echo +_cache_deps := ${_build_dirs:M*.$q} +.export _cache_deps +x!= echo; { echo "${_this_dir}.$m: \\"; \ + for x in $$_cache_deps; do echo " $$x \\"; done; echo; } >&3 .else ${_this_dir}.$m: ${_build_dirs:M*.$q} .endif @@ -682,7 +693,10 @@ ${_this_dir}.$m: ${_build_dirs:M*.$q} .info ${DEP_RELDIR}.$m: graph: ${_build_dirs:M*.$m:N${_this_dir}.$m} .endif .if ${BUILD_DIRDEPS_CACHE} == "yes" -x!= { echo; echo '${_this_dir}.$m: ${_build_dirs:M*.$m:N${_this_dir}.$m:${M_oneperline}}'; echo; } >&3; echo +_cache_deps := ${_build_dirs:M*.$m:N${_this_dir}.$m} +.export _cache_deps +x!= echo; { echo "${_this_dir}.$m: \\"; \ + for x in $$_cache_deps; do echo " $$x \\"; done; echo; } >&3 .else ${_this_dir}.$m: ${_build_dirs:M*.$m:N${_this_dir}.$m} .endif Modified: head/share/mk/gendirdeps.mk ============================================================================== --- head/share/mk/gendirdeps.mk Wed Dec 11 17:37:53 2019 (r355617) +++ head/share/mk/gendirdeps.mk Wed Dec 11 17:38:15 2019 (r355618) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: gendirdeps.mk,v 1.39 2018/06/08 01:25:31 sjg Exp $ +# $Id: gendirdeps.mk,v 1.41 2019/11/21 23:50:40 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -80,7 +80,6 @@ _DIRDEPS := ${DIRDEPS:U:O:u} .endif META_FILES := ${META_FILES:T:O:u} -.export META_FILES # pickup customizations .-include @@ -184,6 +183,11 @@ x != cd ${_OBJDIR} && find . -name '*.meta' -print -o .elif ${_meta_files:[#]} > 500 .export _meta_files x != echo; for m in $$_meta_files; do echo $$m; done > meta.list +# _meta_files is consuming a lot of env space +# that can impact command line length, +# and we do not need it any more +.undef _meta_files +.unexport _meta_files .else _meta_files_arg:= ${_meta_files} .endif @@ -374,3 +378,6 @@ all ${_DEPENDFILE}: .endif ${_DEPENDFILE}: .PRECIOUS + +# don't waste time looking for ways to make .meta files +.SUFFIXES: Added: head/share/mk/local.dirdeps-options.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/local.dirdeps-options.mk Wed Dec 11 17:38:15 2019 (r355618) @@ -0,0 +1,29 @@ +# $FreeBSD$ + +# avoid duplication +DIRDEPS.AUDIT.yes= lib/libbsm +DIRDEPS.BLACKLIST_SUPPORT.yes+= lib/libblacklist +DIRDEPS.BSD_CRTBEGIN.no+= gnu/lib/csu +DIRDEPS.CASPER.yes+= lib/libcasper/libcasper +DIRDEPS.GSSAPI.yes+= lib/libgssapi +DIRDEPS.JAIL.yes+= lib/libjail +DIRDEPS.KERBEROS_SUPPORT.yes+= \ + kerberos5/lib/libasn1 \ + kerberos5/lib/libheimbase \ + kerberos5/lib/libheimipcc \ + kerberos5/lib/libhx509 \ + kerberos5/lib/libkrb5 \ + kerberos5/lib/libroken \ + kerberos5/lib/libwind \ + +DIRDEPS.NIS.yes+= \ + include/rpc \ + include/rpcsvc \ + lib/librpcsvc + +DIRDEPS.OPENSSL.yes+= secure/lib/libcrypto +DIRDEPS.OPENSSL.no+= lib/libmd +DIRDEPS.PAM_SUPPORT.yes+= lib/libpam/libpam +DIRDEPS.TCP_WRAPPERS.yes+= lib/libwrap + + Modified: head/share/mk/local.dirdeps.mk ============================================================================== --- head/share/mk/local.dirdeps.mk Wed Dec 11 17:37:53 2019 (r355617) +++ head/share/mk/local.dirdeps.mk Wed Dec 11 17:38:15 2019 (r355618) @@ -148,7 +148,6 @@ _SRCS= ${SRCS} ${_PROGS_SRCS} # Has C files. The C_DIRDEPS are shared with C++ files as well. C_DIRDEPS= \ - gnu/lib/csu \ include \ include/arpa \ include/protocols \ @@ -220,6 +219,11 @@ DIRDEPS+= ${_lib${_lib}reldir} .if ${DEP_RELDIR} != "targets/pseudo/stage" DIRDEPS += targets/pseudo/stage .endif +.endif + +# this one is too pervasive +.if ${MK_BSD_CRTBEGIN} == "no" && ${DEP_RELDIR} != "gnu/lib/csu" +DIRDEPS+= gnu/lib/csu .endif DEP_MACHINE_ARCH = ${MACHINE_ARCH.${DEP_MACHINE}} Modified: head/share/mk/local.gendirdeps.mk ============================================================================== --- head/share/mk/local.gendirdeps.mk Wed Dec 11 17:37:53 2019 (r355617) +++ head/share/mk/local.gendirdeps.mk Wed Dec 11 17:38:15 2019 (r355618) @@ -10,6 +10,7 @@ GENDIRDEPS_FILTER+= \ Ngnu/lib/libssp/libssp_nonshared \ Ncddl/usr.bin/ctf* \ Nlib/libc_nonshared \ + Ngnu/lib/csu \ Ngnu/lib/libgcc \ Nlib/libgcc_eh \ Nlib/libgcc_s \ Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Wed Dec 11 17:37:53 2019 (r355617) +++ head/share/mk/local.meta.sys.mk Wed Dec 11 17:38:15 2019 (r355618) @@ -96,7 +96,7 @@ TARGET_MACHINE= host OBJTOP := ${HOST_OBJTOP} .endif -.if ${.MAKE.LEVEL} == 0 +.if ${.MAKE.LEVEL} == 0 || empty(PYTHON) PYTHON ?= /usr/local/bin/python .export PYTHON # this works best if share/mk is ready for it. @@ -133,7 +133,9 @@ STAGE_TARGET_OBJTOP:= ${STAGE_ROOT}/${TARGET_OBJ_SPEC} STAGE_HOST_OBJTOP:= ${STAGE_ROOT}/${HOST_TARGET} # These are exported for hooking in out-of-tree builds. They will always # be overridden in sub-makes above when building in-tree. +.if ${.MAKE.LEVEL} > 0 .export STAGE_OBJTOP STAGE_TARGET_OBJTOP STAGE_HOST_OBJTOP +.endif # Use tools/install.sh which can avoid the need for xinstall for simple cases. INSTALL?= sh ${SRCTOP}/tools/install.sh Modified: head/share/mk/meta.sys.mk ============================================================================== --- head/share/mk/meta.sys.mk Wed Dec 11 17:37:53 2019 (r355617) +++ head/share/mk/meta.sys.mk Wed Dec 11 17:38:15 2019 (r355618) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: meta.sys.mk,v 1.32 2017/06/11 03:24:04 sjg Exp $ +# $Id: meta.sys.mk,v 1.34 2019/01/24 19:36:25 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -62,13 +62,15 @@ META_MODE += silent=yes MACHINE = host .endif -.if ${.MAKE.LEVEL} == 0 +.if !defined(MACHINE0) # it can be handy to know which MACHINE kicked off the build # for example, if using Makefild.depend for multiple machines, # allowing only MACHINE0 to update can keep things simple. MACHINE0 := ${MACHINE} .export MACHINE0 +.endif +.if !defined(META2DEPS) .if defined(PYTHON) && exists(${PYTHON}) # we prefer the python version of this - it is much faster META2DEPS ?= ${.PARSEDIR}/meta2deps.py Modified: head/targets/Makefile ============================================================================== --- head/targets/Makefile Wed Dec 11 17:37:53 2019 (r355617) +++ head/targets/Makefile Wed Dec 11 17:38:15 2019 (r355618) @@ -38,75 +38,7 @@ DIRDEPS_FILTER = Mtargets/* .endif -# in theory, this is what we want -target_dirs = targets targets/pseudo -# these tweak how we do it -target_prefix = pkg- build- -DIRDEPS := ${.TARGETS:Nall:${target_prefix:@p@S,^$p,,@:ts:}:@t@${target_dirs:@d@$d/$t@}@:@d@${exists(${SRCTOP}/$d):?$d:}@} -all_machine_list = ${ALL_MACHINE_LIST} host common - -.if ${DIRDEPS:Mtargets/pseudo/*} != "" -# all bets are off -PKG_MACHINE_LIST = ${all_machine_list} -.endif - -.if make(check-commit) -# a special case -DIRDEPS = targets/pseudo/check-commit -.if defined(ALL_MACHINES) -CHECK_MACHINE_LIST = all -.undef ALL_MACHINES -.endif -SHIPDIR = no - -.else - -.if defined(ALL_MACHINES) -DIRDEPS := ${DIRDEPS:O:u:@d@${all_machine_list:O:u:@m@${exists(${SRCTOP}/$d/${.MAKE.DEPENDFILE_PREFIX:T}.$m):?$d.$m:}@}@} -.undef ALL_MACHINES -PKG_MACHINE_LIST ?= ${DIRDEPS:E:O:u} -.elif empty(REQUESTED_MACHINE) -# the above may be insufficient. -# some packages only support one machine which may not be ${MACHINE} -# some support multiple, in which case unless ALL_MACHINES is defined -# we only want ${MACHINE} -plain := ${DIRDEPS:@d@${exists(${SRCTOP}/$d/${.MAKE.DEPENDFILE_PREFIX:T}):?$d:}@} -.if ${plain} != ${DIRDEPS} -qual := ${DIRDEPS:${plain:${M_ListToSkip}}:@d@${all_machine_list:O:u:@m@${exists(${SRCTOP}/$d/${.MAKE.DEPENDFILE_PREFIX:T}.$m):?$d.$m:}@}@} -DIRDEPS := ${plain} ${qual} -PKG_MACHINE_LIST ?= ${MACHINE} ${qual:E:O:u} -.endif -.else -# check that a .MAKE.DEPENDFILE exists -DIRDEPS := ${.MAKE.DEPENDFILE_PREFERENCE:T:@m@${DIRDEPS:@d@${exists(${SRCTOP}/$d/$m):?$d:}@}@:O:u} -.endif -.if !empty(PKG_MACHINE_LIST) -.if ${PKG_MACHINE_LIST:Mdepend} != "" -PKG_MACHINE_LIST = ${ALL_MACHINE_LIST} -.endif -PKG_MACHINE_LIST := ${PKG_MACHINE_LIST} -.endif -.endif - -# we don't use DIRDEPS_FILTER, since we only want it to -# apply to this initial list -.if !empty(REQUESTED_MACHINE) && !empty(DIRDEPS) -# this is a variant of the logic above, we want plain -# but need to filter the qualified DIRDEPS to REQUESTED_MACHINE -plain := ${DIRDEPS:@d@${exists(${SRCTOP}/$d/${.MAKE.DEPENDFILE_PREFIX:T}):?$d:}@} -.if !empty(plain) && ${plain} != ${DIRDEPS} -qual := ${DIRDEPS:${plain:${M_ListToSkip}}:M*.${REQUESTED_MACHINE}} -.if empty(qual) -qual := ${DIRDEPS:@d@${exists(${SRCTOP}/$d/${.MAKE.DEPENDFILE:T}):?$d.${.MAKE.DEPENDFILE:E}:}@} -.endif -DIRDEPS := ${plain} ${qual} -.endif -.if empty(DIRDEPS) -.error ${REQUESTED_MACHINE} is not appropriate for ${.TARGETS} -.endif -.endif - .if !empty(build_options) build_options := ${build_options:O:u} .for v in ${build_options} @@ -114,6 +46,9 @@ $v = yes .endfor .export ${build_options} .endif + +# this does the work +.include .if !empty(DIRDEPS) # This is printed as we read the makefile Modified: head/targets/Makefile.inc ============================================================================== --- head/targets/Makefile.inc Wed Dec 11 17:37:53 2019 (r355617) +++ head/targets/Makefile.inc Wed Dec 11 17:38:15 2019 (r355618) @@ -20,11 +20,12 @@ PKG_METHOD = no .endif .endif +.MAIN: all + # The makefile in subdirs should set this to something useful # the default should do nothing. PKG_METHOD ?= none - -.MAIN: all +none: .if ${build-*:${M_L_TARGETS}} != "" # just build the bits, skip packaging From owner-svn-src-all@freebsd.org Wed Dec 11 17:43:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 029E51DC4B3 for ; Wed, 11 Dec 2019 17:43:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) (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 47Y45n2nw9z4Pvn for ; Wed, 11 Dec 2019 17:43:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x835.google.com with SMTP id p5so6966550qtq.12 for ; Wed, 11 Dec 2019 09:43:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0kjCkC3Sz4nJQgKPk38/eAk2Ztxu19OyjuuGbiMBtjM=; b=sax3tPFSkn1j5vDnv1dkaHthi735kesR2nBsuDnMGm+1HXQmKuXvb53uPIkmGqyxQR ttMJl1pFJsEmXZ0t4I+bxyuUtFlkG/yipV86KMyx0lh6KDvfmACXkZyqNIccE3UCs3gI 6JFCB3yptGCl/5IOVFdQeC3jA6i1nYurGJrdo/0jcce+xmPZyeYBh7InCRiwYqxR6+da J/QHPU1SZDb8omWKRJ4ylRVJFMcib0gxwNR/1rvr1MtJmqFn3fwRp5seyDdeTG/4WHJJ UAcSzOtHlBSf0nwLV7O1H+AAduzN3OirgRakQxjyvo2yC8fNH+yB2zI4ZgFH47QORZdl PIww== 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=0kjCkC3Sz4nJQgKPk38/eAk2Ztxu19OyjuuGbiMBtjM=; b=WrcyNUn1dJntl9k+g41meCymxMRn+9OFYRy9afX5VRbwqX94fLyNkxha+uNd2KaYgO GEN2uMeh9Y/7o1jOiNPPeHzru5r9gKNwpECvTZzBvTcxWlOO5L3eyYHJXcwjcgdVy2u6 6DXCAOSvtYengktiNYJZ2DUgfBY2RFfFVgmQG15jhluOPcRj3TQud0kPTuhRy8EDqD/y f37uHgHj5x8GYO4bvEJEt5MBSCTwf2GhDb2G36yjxoSBbqg7/A+cocF2nOivd0SMeFjO IQ4cEBkF5wqSfQY28EPHct+Arb1SgegwR8rDtn7Ts4wJgvDP35Z1/8Bc+FUosP5Wqf0y kHjg== X-Gm-Message-State: APjAAAVa0c6wmJBKhRJGlLwpnooyxSAi9t1L0zrfiiyd1asS+G/qhj39 IuTDSaf59Y6mL9vVBrUGgP38iJh3HLLRUhTXBSsfBQ== X-Google-Smtp-Source: APXvYqxx2JTP3E9Hht3uE/VLuMkD6RM98s//N1b1EWlbt4C1g3W2bKMvBptqlG7PKlBRn8ksX7QXF2oFEMoRLM2Zkmk= X-Received: by 2002:ac8:2cda:: with SMTP id 26mr3798043qtx.291.1576086188148; Wed, 11 Dec 2019 09:43:08 -0800 (PST) MIME-Version: 1.0 References: <201912060006.xB6066qR058963@repo.freebsd.org> <820BE55B-AE32-44E7-8AC7-245EF6F86F8B@samsco.org> In-Reply-To: From: Warner Losh Date: Wed, 11 Dec 2019 09:42:56 -0800 Message-ID: Subject: Re: svn commit: r355430 - head/sys/cam/scsi To: Alan Somers Cc: Scott Long , Steven Hartland , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47Y45n2nw9z4Pvn X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=sax3tPFS; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::835) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.70 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[5.3.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.70)[ip: (-9.34), ipnet: 2607:f8b0::/32(-2.21), asn: 15169(-1.92), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 17:43:10 -0000 At some point, we used to replace bad chars with spaces, but that may have been two ata stacks ago.. Warner On Wed, Dec 11, 2019, 9:35 AM Alan Somers wrote: > No, and there's no possibility of connecting a Windows host to this > particular device. We have some Oracle Solaris servers hooked up to thes= e > expanders, but it looks like Solaris completely ignores the offending > element type. > -Alan > > On Wed, Dec 11, 2019 at 10:19 AM Scott Long wrote: > >> U+FFFD doesn=E2=80=99t make sense for an ASCII string, but 0x3F might. = Any idea >> what Windows shows for this device? >> >> Scott >> >> > On Dec 11, 2019, at 8:42 AM, Alan Somers wrote: >> > >> > In this case the offending descriptor is solid 0xFF, so replacing >> individual characters wouldn't accomplish anything. I can imagine a >> different buggy expander that has just one or two bad characters. In th= at >> case, it would make sense to replace them. But replace them with what? >> The UTF replacement character 0xFFFD isn't an option, because the result= is >> supposed to be ASCII. There's no other obvious choice, which is why I >> chose to replace the whole thing. >> > -Alan >> > >> > On Fri, Dec 6, 2019 at 2:40 AM Steven Hartland < >> steven.hartland@multiplay.co.uk> wrote: >> > If the illegal chars where removed or replaced would the result be >> useful, if so might that be a better approach? >> > >> > On Fri, 6 Dec 2019 at 00:06, Alan Somers wrote: >> > Author: asomers >> > Date: Fri Dec 6 00:06:05 2019 >> > New Revision: 355430 >> > URL: https://svnweb.freebsd.org/changeset/base/355430 >> > >> > Log: >> > ses: sanitize illegal strings in SES element descriptors >> > >> > The SES4r3 standard requires that element descriptors may only >> contain ASCII >> > characters in the range 0x20 to 0x7e. Some SuperMicro expanders >> violate >> > that rule. This patch adds a sanity check to ses(4). Descriptors i= n >> > violation will be replaced by "". >> > >> > This patch fixes "sesutil --libxo xml" on such systems. Previously >> it would >> > generate non-well-formed XML output. >> > >> > PR: 241929 >> > Reviewed by: allanjude >> > MFC after: 2 weeks >> > Sponsored by: Axcient >> > >> > Modified: >> > head/sys/cam/scsi/scsi_enc_ses.c >> > >> > Modified: head/sys/cam/scsi/scsi_enc_ses.c >> > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> > --- head/sys/cam/scsi/scsi_enc_ses.c Thu Dec 5 19:39:51 2019 >> (r355429) >> > +++ head/sys/cam/scsi/scsi_enc_ses.c Fri Dec 6 00:06:05 2019 >> (r355430) >> > @@ -110,7 +110,7 @@ typedef struct ses_addl_status { >> > typedef struct ses_element { >> > uint8_t eip; /* eip bit is set */ >> > uint16_t descr_len; /* length of the descriptor */ >> > - char *descr; /* descriptor for this object = */ >> > + const char *descr; /* descriptor for this object = */ >> > struct ses_addl_status addl; /* additional status info */ >> > } ses_element_t; >> > >> > @@ -1977,6 +1977,35 @@ ses_publish_cache(enc_softc_t *enc, struct >> enc_fsm_sta >> > return (0); >> > } >> > >> > +/* >> > + * \brief Sanitize an element descriptor >> > + * >> > + * The SES4r3 standard, sections 3.1.2 and 6.1.10, specifies that >> element >> > + * descriptors may only contain ASCII characters in the range 0x20 to >> 0x7e. >> > + * But some vendors violate that rule. Ensure that we only expose >> compliant >> > + * descriptors to userland. >> > + * >> > + * \param desc SES element descriptor as reported by the >> hardware >> > + * \param len Length of desc in bytes, not necessarily >> including >> > + * trailing NUL. It will be modified if desc is >> invalid. >> > + */ >> > +static const char* >> > +ses_sanitize_elm_desc(const char *desc, uint16_t *len) >> > +{ >> > + const char *invalid =3D ""; >> > + int i; >> > + >> > + for (i =3D 0; i < *len; i++) { >> > + if (desc[i] < 0x20 || desc[i] > 0x7e) { >> > + *len =3D strlen(invalid); >> > + return (invalid); >> > + } else if (desc[i] =3D=3D 0) { >> > + break; >> > + } >> > + } >> > + return (desc); >> > +} >> > + >> > /** >> > * \brief Parse the descriptors for each object. >> > * >> > @@ -2061,7 +2090,8 @@ ses_process_elm_descs(enc_softc_t *enc, struct >> enc_fsm >> > if (length > 0) { >> > elmpriv =3D element->elm_private; >> > elmpriv->descr_len =3D length; >> > - elmpriv->descr =3D &buf[offset]; >> > + elmpriv->descr =3D >> ses_sanitize_elm_desc(&buf[offset], >> > + &elmpriv->descr_len); >> > } >> > >> > /* skip over the descriptor itself */ >> >> From owner-svn-src-all@freebsd.org Wed Dec 11 17:48:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 658051DC61C; Wed, 11 Dec 2019 17:48:35 +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 47Y4D321W5z4QCm; Wed, 11 Dec 2019 17:48:35 +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 405B6EE61; Wed, 11 Dec 2019 17:48:35 +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 xBBHmZ3H075041; Wed, 11 Dec 2019 17:48:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBHmZ7S075040; Wed, 11 Dec 2019 17:48:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912111748.xBBHmZ7S075040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Dec 2019 17:48:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355619 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 355619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 17:48:35 -0000 Author: emaste Date: Wed Dec 11 17:48:34 2019 New Revision: 355619 URL: https://svnweb.freebsd.org/changeset/base/355619 Log: connect arm linuxulator to top-level make sysent Reported by: kevans Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Dec 11 17:38:15 2019 (r355618) +++ head/Makefile.inc1 Wed Dec 11 17:48:34 2019 (r355619) @@ -1509,6 +1509,7 @@ _sysent_dirs+= sys/compat/cloudabi32 \ sys/compat/cloudabi64 _sysent_dirs+= sys/amd64/linux \ sys/amd64/linux32 \ + sys/arm/linux \ sys/arm64/linux \ sys/i386/linux sysent: .PHONY From owner-svn-src-all@freebsd.org Wed Dec 11 17:52:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 972FD1DC82E; Wed, 11 Dec 2019 17:52:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47Y4J64HP8z4QYc; Wed, 11 Dec 2019 17:52:06 +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 8DDC5EEF9; Wed, 11 Dec 2019 17:52:06 +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 xBBHq6nr079868; Wed, 11 Dec 2019 17:52:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBHq6c8079863; Wed, 11 Dec 2019 17:52:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912111752.xBBHq6c8079863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Dec 2019 17:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355620 - head/sys/arm/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm/linux X-SVN-Commit-Revision: 355620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 17:52:06 -0000 Author: emaste Date: Wed Dec 11 17:52:06 2019 New Revision: 355620 URL: https://svnweb.freebsd.org/changeset/base/355620 Log: arm linuxulator: add "make sysent" generated files Sponsored by: The FreeBSD Foundation Added: head/sys/arm/linux/linux_proto.h (contents, props changed) head/sys/arm/linux/linux_syscall.h (contents, props changed) head/sys/arm/linux/linux_syscalls.c (contents, props changed) head/sys/arm/linux/linux_sysent.c (contents, props changed) head/sys/arm/linux/linux_systrace_args.c (contents, props changed) Added: head/sys/arm/linux/linux_proto.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/linux/linux_proto.h Wed Dec 11 17:52:06 2019 (r355620) @@ -0,0 +1,1826 @@ +/* + * System call prototypes. + * + * DO NOT EDIT-- this file is automatically @generated. + * $FreeBSD$ + */ + +#ifndef _LINUX_SYSPROTO_H_ +#define _LINUX_SYSPROTO_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +struct proc; + +struct thread; + +#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \ + 0 : sizeof(register_t) - sizeof(t)) + +#if BYTE_ORDER == LITTLE_ENDIAN +#define PADL_(t) 0 +#define PADR_(t) PAD_(t) +#else +#define PADL_(t) PAD_(t) +#define PADR_(t) 0 +#endif + +#define nosys linux_nosys +struct linux_exit_args { + char rval_l_[PADL_(int)]; int rval; char rval_r_[PADR_(int)]; +}; +struct linux_fork_args { + register_t dummy; +}; +struct linux_open_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; +}; +struct linux_creat_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; +}; +struct linux_link_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)]; +}; +struct linux_unlink_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; +}; +struct linux_execve_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char argp_l_[PADL_(char **)]; char ** argp; char argp_r_[PADR_(char **)]; + char envp_l_[PADL_(char **)]; char ** envp; char envp_r_[PADR_(char **)]; +}; +struct linux_chdir_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; +}; +struct linux_mknod_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; + char dev_l_[PADL_(l_dev_t)]; l_dev_t dev; char dev_r_[PADR_(l_dev_t)]; +}; +struct linux_chmod_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char mode_l_[PADL_(l_mode_t)]; l_mode_t mode; char mode_r_[PADR_(l_mode_t)]; +}; +struct linux_lchown16_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char uid_l_[PADL_(l_uid16_t)]; l_uid16_t uid; char uid_r_[PADR_(l_uid16_t)]; + char gid_l_[PADL_(l_gid16_t)]; l_gid16_t gid; char gid_r_[PADR_(l_gid16_t)]; +}; +struct linux_lseek_args { + char fdes_l_[PADL_(l_uint)]; l_uint fdes; char fdes_r_[PADR_(l_uint)]; + char off_l_[PADL_(l_off_t)]; l_off_t off; char off_r_[PADR_(l_off_t)]; + char whence_l_[PADL_(l_int)]; l_int whence; char whence_r_[PADR_(l_int)]; +}; +struct linux_getpid_args { + register_t dummy; +}; +struct linux_mount_args { + char specialfile_l_[PADL_(char *)]; char * specialfile; char specialfile_r_[PADR_(char *)]; + char dir_l_[PADL_(char *)]; char * dir; char dir_r_[PADR_(char *)]; + char filesystemtype_l_[PADL_(char *)]; char * filesystemtype; char filesystemtype_r_[PADR_(char *)]; + char rwflag_l_[PADL_(l_ulong)]; l_ulong rwflag; char rwflag_r_[PADR_(l_ulong)]; + char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)]; +}; +struct linux_setuid16_args { + char uid_l_[PADL_(l_uid16_t)]; l_uid16_t uid; char uid_r_[PADR_(l_uid16_t)]; +}; +struct linux_getuid16_args { + register_t dummy; +}; +struct linux_pause_args { + register_t dummy; +}; +struct linux_access_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)]; +}; +struct linux_nice_args { + char inc_l_[PADL_(l_int)]; l_int inc; char inc_r_[PADR_(l_int)]; +}; +struct linux_kill_args { + char pid_l_[PADL_(l_int)]; l_int pid; char pid_r_[PADR_(l_int)]; + char signum_l_[PADL_(l_int)]; l_int signum; char signum_r_[PADR_(l_int)]; +}; +struct linux_rename_args { + char from_l_[PADL_(char *)]; char * from; char from_r_[PADR_(char *)]; + char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)]; +}; +struct linux_mkdir_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; +}; +struct linux_rmdir_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; +}; +struct linux_pipe_args { + char pipefds_l_[PADL_(l_int *)]; l_int * pipefds; char pipefds_r_[PADR_(l_int *)]; +}; +struct linux_times_args { + char buf_l_[PADL_(struct l_times_argv *)]; struct l_times_argv * buf; char buf_r_[PADR_(struct l_times_argv *)]; +}; +struct linux_brk_args { + char dsend_l_[PADL_(l_ulong)]; l_ulong dsend; char dsend_r_[PADR_(l_ulong)]; +}; +struct linux_setgid16_args { + char gid_l_[PADL_(l_gid16_t)]; l_gid16_t gid; char gid_r_[PADR_(l_gid16_t)]; +}; +struct linux_getgid16_args { + register_t dummy; +}; +struct linux_geteuid16_args { + register_t dummy; +}; +struct linux_getegid16_args { + register_t dummy; +}; +struct linux_umount_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_ioctl_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)]; + char arg_l_[PADL_(l_ulong)]; l_ulong arg; char arg_r_[PADR_(l_ulong)]; +}; +struct linux_fcntl_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)]; + char arg_l_[PADL_(l_ulong)]; l_ulong arg; char arg_r_[PADR_(l_ulong)]; +}; +struct linux_ustat_args { + char dev_l_[PADL_(l_dev_t)]; l_dev_t dev; char dev_r_[PADR_(l_dev_t)]; + char ubuf_l_[PADL_(struct l_ustat *)]; struct l_ustat * ubuf; char ubuf_r_[PADR_(struct l_ustat *)]; +}; +struct linux_getppid_args { + register_t dummy; +}; +struct linux_sigaction_args { + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char nsa_l_[PADL_(l_osigaction_t *)]; l_osigaction_t * nsa; char nsa_r_[PADR_(l_osigaction_t *)]; + char osa_l_[PADL_(l_osigaction_t *)]; l_osigaction_t * osa; char osa_r_[PADR_(l_osigaction_t *)]; +}; +struct linux_setreuid16_args { + char ruid_l_[PADL_(l_uid16_t)]; l_uid16_t ruid; char ruid_r_[PADR_(l_uid16_t)]; + char euid_l_[PADL_(l_uid16_t)]; l_uid16_t euid; char euid_r_[PADR_(l_uid16_t)]; +}; +struct linux_setregid16_args { + char rgid_l_[PADL_(l_gid16_t)]; l_gid16_t rgid; char rgid_r_[PADR_(l_gid16_t)]; + char egid_l_[PADL_(l_gid16_t)]; l_gid16_t egid; char egid_r_[PADR_(l_gid16_t)]; +}; +struct linux_sigsuspend_args { + char hist0_l_[PADL_(l_int)]; l_int hist0; char hist0_r_[PADR_(l_int)]; + char hist1_l_[PADL_(l_int)]; l_int hist1; char hist1_r_[PADR_(l_int)]; + char mask_l_[PADL_(l_osigset_t)]; l_osigset_t mask; char mask_r_[PADR_(l_osigset_t)]; +}; +struct linux_sigpending_args { + char mask_l_[PADL_(l_osigset_t *)]; l_osigset_t * mask; char mask_r_[PADR_(l_osigset_t *)]; +}; +struct linux_sethostname_args { + char hostname_l_[PADL_(char *)]; char * hostname; char hostname_r_[PADR_(char *)]; + char len_l_[PADL_(u_int)]; u_int len; char len_r_[PADR_(u_int)]; +}; +struct linux_setrlimit_args { + char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)]; + char rlim_l_[PADL_(struct l_rlimit *)]; struct l_rlimit * rlim; char rlim_r_[PADR_(struct l_rlimit *)]; +}; +struct linux_gettimeofday_args { + char tp_l_[PADL_(struct timeval32 *)]; struct timeval32 * tp; char tp_r_[PADR_(struct timeval32 *)]; + char tzp_l_[PADL_(struct timezone *)]; struct timezone * tzp; char tzp_r_[PADR_(struct timezone *)]; +}; +struct linux_settimeofday_args { + char tp_l_[PADL_(struct timeval32 *)]; struct timeval32 * tp; char tp_r_[PADR_(struct timeval32 *)]; + char tzp_l_[PADL_(struct timezone *)]; struct timezone * tzp; char tzp_r_[PADR_(struct timezone *)]; +}; +struct linux_getgroups16_args { + char gidsetsize_l_[PADL_(l_uint)]; l_uint gidsetsize; char gidsetsize_r_[PADR_(l_uint)]; + char gidset_l_[PADL_(l_gid16_t *)]; l_gid16_t * gidset; char gidset_r_[PADR_(l_gid16_t *)]; +}; +struct linux_setgroups16_args { + char gidsetsize_l_[PADL_(l_uint)]; l_uint gidsetsize; char gidsetsize_r_[PADR_(l_uint)]; + char gidset_l_[PADL_(l_gid16_t *)]; l_gid16_t * gidset; char gidset_r_[PADR_(l_gid16_t *)]; +}; +struct linux_symlink_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)]; +}; +struct linux_readlink_args { + char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char count_l_[PADL_(l_int)]; l_int count; char count_r_[PADR_(l_int)]; +}; +struct linux_reboot_args { + char magic1_l_[PADL_(l_int)]; l_int magic1; char magic1_r_[PADR_(l_int)]; + char magic2_l_[PADL_(l_int)]; l_int magic2; char magic2_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)]; + char arg_l_[PADL_(void *)]; void * arg; char arg_r_[PADR_(void *)]; +}; +struct linux_truncate_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char length_l_[PADL_(l_ulong)]; l_ulong length; char length_r_[PADR_(l_ulong)]; +}; +struct linux_ftruncate_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char length_l_[PADL_(long)]; long length; char length_r_[PADR_(long)]; +}; +struct linux_getpriority_args { + char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; + char who_l_[PADL_(int)]; int who; char who_r_[PADR_(int)]; +}; +struct linux_statfs_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char buf_l_[PADL_(struct l_statfs_buf *)]; struct l_statfs_buf * buf; char buf_r_[PADR_(struct l_statfs_buf *)]; +}; +struct linux_fstatfs_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char buf_l_[PADL_(struct l_statfs_buf *)]; struct l_statfs_buf * buf; char buf_r_[PADR_(struct l_statfs_buf *)]; +}; +struct linux_syslog_args { + char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)]; +}; +struct linux_setitimer_args { + char which_l_[PADL_(l_int)]; l_int which; char which_r_[PADR_(l_int)]; + char itv_l_[PADL_(struct l_itimerval *)]; struct l_itimerval * itv; char itv_r_[PADR_(struct l_itimerval *)]; + char oitv_l_[PADL_(struct l_itimerval *)]; struct l_itimerval * oitv; char oitv_r_[PADR_(struct l_itimerval *)]; +}; +struct linux_getitimer_args { + char which_l_[PADL_(l_int)]; l_int which; char which_r_[PADR_(l_int)]; + char itv_l_[PADL_(struct l_itimerval *)]; struct l_itimerval * itv; char itv_r_[PADR_(struct l_itimerval *)]; +}; +struct linux_newstat_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char buf_l_[PADL_(struct l_newstat *)]; struct l_newstat * buf; char buf_r_[PADR_(struct l_newstat *)]; +}; +struct linux_newlstat_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char buf_l_[PADL_(struct l_newstat *)]; struct l_newstat * buf; char buf_r_[PADR_(struct l_newstat *)]; +}; +struct linux_newfstat_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char buf_l_[PADL_(struct l_newstat *)]; struct l_newstat * buf; char buf_r_[PADR_(struct l_newstat *)]; +}; +struct linux_vhangup_args { + register_t dummy; +}; +struct linux_wait4_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char status_l_[PADL_(l_int *)]; l_int * status; char status_r_[PADR_(l_int *)]; + char options_l_[PADL_(l_int)]; l_int options; char options_r_[PADR_(l_int)]; + char rusage_l_[PADL_(void *)]; void * rusage; char rusage_r_[PADR_(void *)]; +}; +struct linux_swapoff_args { + register_t dummy; +}; +struct linux_sysinfo_args { + char info_l_[PADL_(struct l_sysinfo *)]; struct l_sysinfo * info; char info_r_[PADR_(struct l_sysinfo *)]; +}; +struct linux_sigreturn_args { + char sfp_l_[PADL_(struct l_sigframe *)]; struct l_sigframe * sfp; char sfp_r_[PADR_(struct l_sigframe *)]; +}; +struct linux_clone_args { + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char stack_l_[PADL_(void *)]; void * stack; char stack_r_[PADR_(void *)]; + char parent_tidptr_l_[PADL_(void *)]; void * parent_tidptr; char parent_tidptr_r_[PADR_(void *)]; + char tls_l_[PADL_(void *)]; void * tls; char tls_r_[PADR_(void *)]; + char child_tidptr_l_[PADL_(void *)]; void * child_tidptr; char child_tidptr_r_[PADR_(void *)]; +}; +struct linux_setdomainname_args { + char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)]; + char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; +}; +struct linux_newuname_args { + char buf_l_[PADL_(struct l_new_utsname *)]; struct l_new_utsname * buf; char buf_r_[PADR_(struct l_new_utsname *)]; +}; +struct linux_adjtimex_args { + register_t dummy; +}; +struct linux_mprotect_args { + char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; + char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; + char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)]; +}; +struct linux_sigprocmask_args { + char how_l_[PADL_(l_int)]; l_int how; char how_r_[PADR_(l_int)]; + char mask_l_[PADL_(l_osigset_t *)]; l_osigset_t * mask; char mask_r_[PADR_(l_osigset_t *)]; + char omask_l_[PADL_(l_osigset_t *)]; l_osigset_t * omask; char omask_r_[PADR_(l_osigset_t *)]; +}; +struct linux_init_module_args { + register_t dummy; +}; +struct linux_delete_module_args { + register_t dummy; +}; +struct linux_quotactl_args { + register_t dummy; +}; +struct linux_bdflush_args { + register_t dummy; +}; +struct linux_sysfs_args { + char option_l_[PADL_(l_int)]; l_int option; char option_r_[PADR_(l_int)]; + char arg1_l_[PADL_(l_ulong)]; l_ulong arg1; char arg1_r_[PADR_(l_ulong)]; + char arg2_l_[PADL_(l_ulong)]; l_ulong arg2; char arg2_r_[PADR_(l_ulong)]; +}; +struct linux_personality_args { + char per_l_[PADL_(l_ulong)]; l_ulong per; char per_r_[PADR_(l_ulong)]; +}; +struct linux_setfsuid16_args { + char uid_l_[PADL_(l_uid16_t)]; l_uid16_t uid; char uid_r_[PADR_(l_uid16_t)]; +}; +struct linux_setfsgid16_args { + char gid_l_[PADL_(l_gid16_t)]; l_gid16_t gid; char gid_r_[PADR_(l_gid16_t)]; +}; +struct linux_llseek_args { + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char ohigh_l_[PADL_(l_ulong)]; l_ulong ohigh; char ohigh_r_[PADR_(l_ulong)]; + char olow_l_[PADL_(l_ulong)]; l_ulong olow; char olow_r_[PADR_(l_ulong)]; + char res_l_[PADL_(l_loff_t *)]; l_loff_t * res; char res_r_[PADR_(l_loff_t *)]; + char whence_l_[PADL_(l_uint)]; l_uint whence; char whence_r_[PADR_(l_uint)]; +}; +struct linux_getdents_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char dent_l_[PADL_(void *)]; void * dent; char dent_r_[PADR_(void *)]; + char count_l_[PADL_(l_uint)]; l_uint count; char count_r_[PADR_(l_uint)]; +}; +struct linux_select_args { + char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)]; + char readfds_l_[PADL_(l_fd_set *)]; l_fd_set * readfds; char readfds_r_[PADR_(l_fd_set *)]; + char writefds_l_[PADL_(l_fd_set *)]; l_fd_set * writefds; char writefds_r_[PADR_(l_fd_set *)]; + char exceptfds_l_[PADL_(l_fd_set *)]; l_fd_set * exceptfds; char exceptfds_r_[PADR_(l_fd_set *)]; + char timeout_l_[PADL_(struct l_timeval *)]; struct l_timeval * timeout; char timeout_r_[PADR_(struct l_timeval *)]; +}; +struct linux_msync_args { + char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char fl_l_[PADL_(l_int)]; l_int fl; char fl_r_[PADR_(l_int)]; +}; +struct linux_getsid_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; +}; +struct linux_fdatasync_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; +}; +struct linux_sysctl_args { + char args_l_[PADL_(struct l___sysctl_args *)]; struct l___sysctl_args * args; char args_r_[PADR_(struct l___sysctl_args *)]; +}; +struct linux_sched_setparam_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; +}; +struct linux_sched_getparam_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; +}; +struct linux_sched_setscheduler_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; +}; +struct linux_sched_getscheduler_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; +}; +struct linux_sched_get_priority_max_args { + char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; +}; +struct linux_sched_get_priority_min_args { + char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; +}; +struct linux_sched_rr_get_interval_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char interval_l_[PADL_(struct l_timespec *)]; struct l_timespec * interval; char interval_r_[PADR_(struct l_timespec *)]; +}; +struct linux_nanosleep_args { + char rqtp_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * rqtp; char rqtp_r_[PADR_(const struct l_timespec *)]; + char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)]; +}; +struct linux_mremap_args { + char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; + char old_len_l_[PADL_(l_ulong)]; l_ulong old_len; char old_len_r_[PADR_(l_ulong)]; + char new_len_l_[PADL_(l_ulong)]; l_ulong new_len; char new_len_r_[PADR_(l_ulong)]; + char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)]; + char new_addr_l_[PADL_(l_ulong)]; l_ulong new_addr; char new_addr_r_[PADR_(l_ulong)]; +}; +struct linux_setresuid16_args { + char ruid_l_[PADL_(l_uid16_t)]; l_uid16_t ruid; char ruid_r_[PADR_(l_uid16_t)]; + char euid_l_[PADL_(l_uid16_t)]; l_uid16_t euid; char euid_r_[PADR_(l_uid16_t)]; + char suid_l_[PADL_(l_uid16_t)]; l_uid16_t suid; char suid_r_[PADR_(l_uid16_t)]; +}; +struct linux_getresuid16_args { + char ruid_l_[PADL_(l_uid16_t *)]; l_uid16_t * ruid; char ruid_r_[PADR_(l_uid16_t *)]; + char euid_l_[PADL_(l_uid16_t *)]; l_uid16_t * euid; char euid_r_[PADR_(l_uid16_t *)]; + char suid_l_[PADL_(l_uid16_t *)]; l_uid16_t * suid; char suid_r_[PADR_(l_uid16_t *)]; +}; +struct linux_setresgid16_args { + char rgid_l_[PADL_(l_gid16_t)]; l_gid16_t rgid; char rgid_r_[PADR_(l_gid16_t)]; + char egid_l_[PADL_(l_gid16_t)]; l_gid16_t egid; char egid_r_[PADR_(l_gid16_t)]; + char sgid_l_[PADL_(l_gid16_t)]; l_gid16_t sgid; char sgid_r_[PADR_(l_gid16_t)]; +}; +struct linux_getresgid16_args { + char rgid_l_[PADL_(l_gid16_t *)]; l_gid16_t * rgid; char rgid_r_[PADR_(l_gid16_t *)]; + char egid_l_[PADL_(l_gid16_t *)]; l_gid16_t * egid; char egid_r_[PADR_(l_gid16_t *)]; + char sgid_l_[PADL_(l_gid16_t *)]; l_gid16_t * sgid; char sgid_r_[PADR_(l_gid16_t *)]; +}; +struct linux_prctl_args { + char option_l_[PADL_(l_int)]; l_int option; char option_r_[PADR_(l_int)]; + char arg2_l_[PADL_(l_int)]; l_int arg2; char arg2_r_[PADR_(l_int)]; + char arg3_l_[PADL_(l_int)]; l_int arg3; char arg3_r_[PADR_(l_int)]; + char arg4_l_[PADL_(l_int)]; l_int arg4; char arg4_r_[PADR_(l_int)]; + char arg5_l_[PADL_(l_int)]; l_int arg5; char arg5_r_[PADR_(l_int)]; +}; +struct linux_rt_sigreturn_args { + char ucp_l_[PADL_(struct l_ucontext *)]; struct l_ucontext * ucp; char ucp_r_[PADR_(struct l_ucontext *)]; +}; +struct linux_rt_sigaction_args { + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char act_l_[PADL_(l_sigaction_t *)]; l_sigaction_t * act; char act_r_[PADR_(l_sigaction_t *)]; + char oact_l_[PADL_(l_sigaction_t *)]; l_sigaction_t * oact; char oact_r_[PADR_(l_sigaction_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_rt_sigprocmask_args { + char how_l_[PADL_(l_int)]; l_int how; char how_r_[PADR_(l_int)]; + char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; + char omask_l_[PADL_(l_sigset_t *)]; l_sigset_t * omask; char omask_r_[PADR_(l_sigset_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_rt_sigpending_args { + char set_l_[PADL_(l_sigset_t *)]; l_sigset_t * set; char set_r_[PADR_(l_sigset_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_rt_sigtimedwait_args { + char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; + char ptr_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * ptr; char ptr_r_[PADR_(l_siginfo_t *)]; + char timeout_l_[PADL_(struct l_timeval *)]; struct l_timeval * timeout; char timeout_r_[PADR_(struct l_timeval *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_rt_sigqueueinfo_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; +}; +struct linux_rt_sigsuspend_args { + char newset_l_[PADL_(l_sigset_t *)]; l_sigset_t * newset; char newset_r_[PADR_(l_sigset_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_pread_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char nbyte_l_[PADL_(l_size_t)]; l_size_t nbyte; char nbyte_r_[PADR_(l_size_t)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; +}; +struct linux_pwrite_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char nbyte_l_[PADL_(l_size_t)]; l_size_t nbyte; char nbyte_r_[PADR_(l_size_t)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; +}; +struct linux_chown16_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char uid_l_[PADL_(l_uid16_t)]; l_uid16_t uid; char uid_r_[PADR_(l_uid16_t)]; + char gid_l_[PADL_(l_gid16_t)]; l_gid16_t gid; char gid_r_[PADR_(l_gid16_t)]; +}; +struct linux_getcwd_args { + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char bufsize_l_[PADL_(l_ulong)]; l_ulong bufsize; char bufsize_r_[PADR_(l_ulong)]; +}; +struct linux_capget_args { + char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)]; + char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)]; +}; +struct linux_capset_args { + char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)]; + char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)]; +}; +struct linux_sigaltstack_args { + char uss_l_[PADL_(l_stack_t *)]; l_stack_t * uss; char uss_r_[PADR_(l_stack_t *)]; + char uoss_l_[PADL_(l_stack_t *)]; l_stack_t * uoss; char uoss_r_[PADR_(l_stack_t *)]; +}; +struct linux_sendfile_args { + register_t dummy; +}; +struct linux_vfork_args { + register_t dummy; +}; +struct linux_getrlimit_args { + char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)]; + char rlim_l_[PADL_(struct l_rlimit *)]; struct l_rlimit * rlim; char rlim_r_[PADR_(struct l_rlimit *)]; +}; +struct linux_mmap2_args { + char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; + char len_l_[PADL_(l_ulong)]; l_ulong len; char len_r_[PADR_(l_ulong)]; + char prot_l_[PADL_(l_ulong)]; l_ulong prot; char prot_r_[PADR_(l_ulong)]; + char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)]; + char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)]; + char pgoff_l_[PADL_(l_ulong)]; l_ulong pgoff; char pgoff_r_[PADR_(l_ulong)]; +}; +struct linux_truncate64_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char length_l_[PADL_(l_loff_t)]; l_loff_t length; char length_r_[PADR_(l_loff_t)]; +}; +struct linux_ftruncate64_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char length_l_[PADL_(l_loff_t)]; l_loff_t length; char length_r_[PADR_(l_loff_t)]; +}; +struct linux_stat64_args { + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char statbuf_l_[PADL_(struct l_stat64 *)]; struct l_stat64 * statbuf; char statbuf_r_[PADR_(struct l_stat64 *)]; +}; +struct linux_lstat64_args { + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char statbuf_l_[PADL_(struct l_stat64 *)]; struct l_stat64 * statbuf; char statbuf_r_[PADR_(struct l_stat64 *)]; +}; +struct linux_fstat64_args { + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char statbuf_l_[PADL_(struct l_stat64 *)]; struct l_stat64 * statbuf; char statbuf_r_[PADR_(struct l_stat64 *)]; +}; +struct linux_lchown_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)]; + char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)]; +}; +struct linux_getuid_args { + register_t dummy; +}; +struct linux_getgid_args { + register_t dummy; +}; +struct linux_getgroups_args { + char gidsetsize_l_[PADL_(l_int)]; l_int gidsetsize; char gidsetsize_r_[PADR_(l_int)]; + char grouplist_l_[PADL_(l_gid_t *)]; l_gid_t * grouplist; char grouplist_r_[PADR_(l_gid_t *)]; +}; +struct linux_setgroups_args { + char gidsetsize_l_[PADL_(l_int)]; l_int gidsetsize; char gidsetsize_r_[PADR_(l_int)]; + char grouplist_l_[PADL_(l_gid_t *)]; l_gid_t * grouplist; char grouplist_r_[PADR_(l_gid_t *)]; +}; +struct linux_chown_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)]; + char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)]; +}; +struct linux_setfsuid_args { + char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)]; +}; +struct linux_setfsgid_args { + char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)]; +}; +struct linux_getdents64_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char dirent_l_[PADL_(void *)]; void * dirent; char dirent_r_[PADR_(void *)]; + char count_l_[PADL_(l_uint)]; l_uint count; char count_r_[PADR_(l_uint)]; +}; +struct linux_pivot_root_args { + char new_root_l_[PADL_(char *)]; char * new_root; char new_root_r_[PADR_(char *)]; + char put_old_l_[PADL_(char *)]; char * put_old; char put_old_r_[PADR_(char *)]; +}; +struct linux_mincore_args { + char start_l_[PADL_(l_ulong)]; l_ulong start; char start_r_[PADR_(l_ulong)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char vec_l_[PADL_(u_char *)]; u_char * vec; char vec_r_[PADR_(u_char *)]; +}; +struct linux_fcntl64_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)]; + char arg_l_[PADL_(l_ulong)]; l_ulong arg; char arg_r_[PADR_(l_ulong)]; +}; +struct linux_gettid_args { + register_t dummy; +}; +struct linux_setxattr_args { + register_t dummy; +}; +struct linux_lsetxattr_args { + register_t dummy; +}; +struct linux_fsetxattr_args { + register_t dummy; +}; +struct linux_getxattr_args { + register_t dummy; +}; +struct linux_lgetxattr_args { + register_t dummy; +}; +struct linux_fgetxattr_args { + register_t dummy; +}; +struct linux_listxattr_args { + register_t dummy; +}; +struct linux_llistxattr_args { + register_t dummy; +}; +struct linux_flistxattr_args { + register_t dummy; +}; +struct linux_removexattr_args { + register_t dummy; +}; +struct linux_lremovexattr_args { + register_t dummy; +}; +struct linux_fremovexattr_args { + register_t dummy; +}; +struct linux_tkill_args { + char tid_l_[PADL_(int)]; int tid; char tid_r_[PADR_(int)]; + char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; +}; +struct linux_sys_futex_args { + char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)]; + char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; + char val_l_[PADL_(uint32_t)]; uint32_t val; char val_r_[PADR_(uint32_t)]; + char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; + char uaddr2_l_[PADL_(uint32_t *)]; uint32_t * uaddr2; char uaddr2_r_[PADR_(uint32_t *)]; + char val3_l_[PADL_(uint32_t)]; uint32_t val3; char val3_r_[PADR_(uint32_t)]; +}; +struct linux_sched_setaffinity_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; + char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)]; +}; +struct linux_sched_getaffinity_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; + char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)]; +}; +struct linux_exit_group_args { + char error_code_l_[PADL_(int)]; int error_code; char error_code_r_[PADR_(int)]; +}; +struct linux_lookup_dcookie_args { + register_t dummy; +}; +struct linux_epoll_create_args { + char size_l_[PADL_(l_int)]; l_int size; char size_r_[PADR_(l_int)]; +}; +struct linux_epoll_ctl_args { + char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; + char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)]; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char event_l_[PADL_(struct epoll_event *)]; struct epoll_event * event; char event_r_[PADR_(struct epoll_event *)]; +}; +struct linux_epoll_wait_args { + char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; + char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)]; + char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)]; + char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)]; +}; +struct linux_remap_file_pages_args { + register_t dummy; +}; +struct linux_set_tid_address_args { + char tidptr_l_[PADL_(int *)]; int * tidptr; char tidptr_r_[PADR_(int *)]; +}; +struct linux_timer_create_args { + char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; + char evp_l_[PADL_(struct sigevent *)]; struct sigevent * evp; char evp_r_[PADR_(struct sigevent *)]; + char timerid_l_[PADL_(l_timer_t *)]; l_timer_t * timerid; char timerid_r_[PADR_(l_timer_t *)]; +}; +struct linux_timer_settime_args { + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char new_l_[PADL_(const struct itimerspec *)]; const struct itimerspec * new; char new_r_[PADR_(const struct itimerspec *)]; + char old_l_[PADL_(struct itimerspec *)]; struct itimerspec * old; char old_r_[PADR_(struct itimerspec *)]; +}; +struct linux_timer_gettime_args { + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; + char setting_l_[PADL_(struct itimerspec *)]; struct itimerspec * setting; char setting_r_[PADR_(struct itimerspec *)]; +}; +struct linux_timer_getoverrun_args { + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; +}; +struct linux_timer_delete_args { + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; +}; +struct linux_clock_settime_args { + char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; + char tp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tp; char tp_r_[PADR_(struct l_timespec *)]; +}; +struct linux_clock_gettime_args { + char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; + char tp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tp; char tp_r_[PADR_(struct l_timespec *)]; +}; +struct linux_clock_getres_args { + char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; + char tp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tp; char tp_r_[PADR_(struct l_timespec *)]; +}; +struct linux_clock_nanosleep_args { + char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char rqtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rqtp; char rqtp_r_[PADR_(struct l_timespec *)]; + char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)]; +}; +struct linux_statfs64_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)]; + char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)]; +}; +struct linux_fstatfs64_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)]; + char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)]; +}; +struct linux_tgkill_args { + char tgid_l_[PADL_(int)]; int tgid; char tgid_r_[PADR_(int)]; + char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)]; + char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; +}; +struct linux_utimes_args { + char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)]; + char tptr_l_[PADL_(struct l_timeval *)]; struct l_timeval * tptr; char tptr_r_[PADR_(struct l_timeval *)]; +}; +struct linux_fadvise64_64_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; +}; +struct linux_mq_open_args { + char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; + char oflag_l_[PADL_(int)]; int oflag; char oflag_r_[PADR_(int)]; + char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; + char attr_l_[PADL_(struct mq_attr *)]; struct mq_attr * attr; char attr_r_[PADR_(struct mq_attr *)]; +}; +struct linux_mq_unlink_args { + char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; +}; +struct linux_mq_timedsend_args { + char mqd_l_[PADL_(l_mqd_t)]; l_mqd_t mqd; char mqd_r_[PADR_(l_mqd_t)]; + char msg_ptr_l_[PADL_(const char *)]; const char * msg_ptr; char msg_ptr_r_[PADR_(const char *)]; + char msg_len_l_[PADL_(size_t)]; size_t msg_len; char msg_len_r_[PADR_(size_t)]; + char msg_prio_l_[PADL_(unsigned int)]; unsigned int msg_prio; char msg_prio_r_[PADR_(unsigned int)]; + char abs_timeout_l_[PADL_(const structl_timespec *)]; const structl_timespec * abs_timeout; char abs_timeout_r_[PADR_(const structl_timespec *)]; +}; +struct linux_mq_timedreceive_args { + char mqd_l_[PADL_(l_mqd_t)]; l_mqd_t mqd; char mqd_r_[PADR_(l_mqd_t)]; + char msg_ptr_l_[PADL_(char *)]; char * msg_ptr; char msg_ptr_r_[PADR_(char *)]; + char msg_len_l_[PADL_(size_t)]; size_t msg_len; char msg_len_r_[PADR_(size_t)]; + char msg_prio_l_[PADL_(unsigned int)]; unsigned int msg_prio; char msg_prio_r_[PADR_(unsigned int)]; + char abs_timeout_l_[PADL_(const structl_timespec *)]; const structl_timespec * abs_timeout; char abs_timeout_r_[PADR_(const structl_timespec *)]; +}; +struct linux_mq_notify_args { + char mqd_l_[PADL_(l_mqd_t)]; l_mqd_t mqd; char mqd_r_[PADR_(l_mqd_t)]; + char abs_timeout_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * abs_timeout; char abs_timeout_r_[PADR_(const struct l_timespec *)]; +}; +struct linux_mq_getsetattr_args { + char mqd_l_[PADL_(l_mqd_t)]; l_mqd_t mqd; char mqd_r_[PADR_(l_mqd_t)]; + char attr_l_[PADL_(const struct mq_attr *)]; const struct mq_attr * attr; char attr_r_[PADR_(const struct mq_attr *)]; + char oattr_l_[PADL_(struct mq_attr *)]; struct mq_attr * oattr; char oattr_r_[PADR_(struct mq_attr *)]; +}; +struct linux_waitid_args { + char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; + char id_l_[PADL_(l_pid_t)]; l_pid_t id; char id_r_[PADR_(l_pid_t)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; + char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; + char rusage_l_[PADL_(void *)]; void * rusage; char rusage_r_[PADR_(void *)]; +}; +struct linux_socket_args { + char domain_l_[PADL_(l_int)]; l_int domain; char domain_r_[PADR_(l_int)]; + char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)]; + char protocol_l_[PADL_(l_int)]; l_int protocol; char protocol_r_[PADR_(l_int)]; +}; +struct linux_bind_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char name_l_[PADL_(l_uintptr_t)]; l_uintptr_t name; char name_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_int)]; l_int namelen; char namelen_r_[PADR_(l_int)]; +}; +struct linux_connect_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char name_l_[PADL_(l_uintptr_t)]; l_uintptr_t name; char name_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_int)]; l_int namelen; char namelen_r_[PADR_(l_int)]; +}; +struct linux_listen_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char backlog_l_[PADL_(l_int)]; l_int backlog; char backlog_r_[PADR_(l_int)]; +}; +struct linux_accept_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)]; +}; +struct linux_getsockname_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)]; +}; +struct linux_getpeername_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)]; +}; +struct linux_socketpair_args { + char domain_l_[PADL_(l_int)]; l_int domain; char domain_r_[PADR_(l_int)]; + char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)]; + char protocol_l_[PADL_(l_int)]; l_int protocol; char protocol_r_[PADR_(l_int)]; + char rsv_l_[PADL_(l_uintptr_t)]; l_uintptr_t rsv; char rsv_r_[PADR_(l_uintptr_t)]; +}; +struct linux_send_args { + char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; + char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; + char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; +}; +struct linux_sendto_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; + char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char to_l_[PADL_(l_uintptr_t)]; l_uintptr_t to; char to_r_[PADR_(l_uintptr_t)]; + char tolen_l_[PADL_(l_int)]; l_int tolen; char tolen_r_[PADR_(l_int)]; +}; +struct linux_recv_args { + char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; + char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; + char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; +}; +struct linux_recvfrom_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char buf_l_[PADL_(l_uintptr_t)]; l_uintptr_t buf; char buf_r_[PADR_(l_uintptr_t)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char from_l_[PADL_(l_uintptr_t)]; l_uintptr_t from; char from_r_[PADR_(l_uintptr_t)]; + char fromlen_l_[PADL_(l_uintptr_t)]; l_uintptr_t fromlen; char fromlen_r_[PADR_(l_uintptr_t)]; +}; +struct linux_shutdown_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char how_l_[PADL_(l_int)]; l_int how; char how_r_[PADR_(l_int)]; +}; +struct linux_setsockopt_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char level_l_[PADL_(l_int)]; l_int level; char level_r_[PADR_(l_int)]; + char optname_l_[PADL_(l_int)]; l_int optname; char optname_r_[PADR_(l_int)]; + char optval_l_[PADL_(l_uintptr_t)]; l_uintptr_t optval; char optval_r_[PADR_(l_uintptr_t)]; + char optlen_l_[PADL_(l_int)]; l_int optlen; char optlen_r_[PADR_(l_int)]; +}; +struct linux_getsockopt_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char level_l_[PADL_(l_int)]; l_int level; char level_r_[PADR_(l_int)]; + char optname_l_[PADL_(l_int)]; l_int optname; char optname_r_[PADR_(l_int)]; + char optval_l_[PADL_(l_uintptr_t)]; l_uintptr_t optval; char optval_r_[PADR_(l_uintptr_t)]; + char optlen_l_[PADL_(l_uintptr_t)]; l_uintptr_t optlen; char optlen_r_[PADR_(l_uintptr_t)]; +}; +struct linux_sendmsg_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_recvmsg_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_semop_args { + char semid_l_[PADL_(l_int)]; l_int semid; char semid_r_[PADR_(l_int)]; + char tsops_l_[PADL_(struct l_sembuf *)]; struct l_sembuf * tsops; char tsops_r_[PADR_(struct l_sembuf *)]; + char nsops_l_[PADL_(l_uint)]; l_uint nsops; char nsops_r_[PADR_(l_uint)]; +}; +struct linux_semget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char nsems_l_[PADL_(l_int)]; l_int nsems; char nsems_r_[PADR_(l_int)]; + char semflg_l_[PADL_(l_int)]; l_int semflg; char semflg_r_[PADR_(l_int)]; +}; +struct linux_semctl_args { + char semid_l_[PADL_(l_int)]; l_int semid; char semid_r_[PADR_(l_int)]; + char semnum_l_[PADL_(l_int)]; l_int semnum; char semnum_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char arg_l_[PADL_(union l_semun)]; union l_semun arg; char arg_r_[PADR_(union l_semun)]; +}; +struct linux_msgsnd_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)]; + char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgrcv_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)]; + char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)]; + char msgtyp_l_[PADL_(l_long)]; l_long msgtyp; char msgtyp_r_[PADR_(l_long)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgctl_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char buf_l_[PADL_(struct l_msqid_ds *)]; struct l_msqid_ds * buf; char buf_r_[PADR_(struct l_msqid_ds *)]; +}; +struct linux_shmat_args { + char shmid_l_[PADL_(l_int)]; l_int shmid; char shmid_r_[PADR_(l_int)]; + char shmaddr_l_[PADL_(char *)]; char * shmaddr; char shmaddr_r_[PADR_(char *)]; + char shmflg_l_[PADL_(l_int)]; l_int shmflg; char shmflg_r_[PADR_(l_int)]; +}; +struct linux_shmdt_args { + char shmaddr_l_[PADL_(char *)]; char * shmaddr; char shmaddr_r_[PADR_(char *)]; +}; +struct linux_shmget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; + char shmflg_l_[PADL_(l_int)]; l_int shmflg; char shmflg_r_[PADR_(l_int)]; +}; +struct linux_shmctl_args { + char shmid_l_[PADL_(l_int)]; l_int shmid; char shmid_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char buf_l_[PADL_(struct l_shmid_ds *)]; struct l_shmid_ds * buf; char buf_r_[PADR_(struct l_shmid_ds *)]; +}; +struct linux_add_key_args { + register_t dummy; +}; +struct linux_request_key_args { + register_t dummy; +}; +struct linux_keyctl_args { + register_t dummy; +}; +struct linux_ioprio_set_args { + register_t dummy; +}; +struct linux_ioprio_get_args { + register_t dummy; +}; +struct linux_inotify_init_args { + register_t dummy; +}; +struct linux_inotify_add_watch_args { + register_t dummy; +}; +struct linux_inotify_rm_watch_args { + register_t dummy; +}; +struct linux_mbind_args { + register_t dummy; +}; +struct linux_get_mempolicy_args { + register_t dummy; +}; +struct linux_set_mempolicy_args { + register_t dummy; +}; +struct linux_openat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; +}; +struct linux_mkdirat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; +}; +struct linux_mknodat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; + char dev_l_[PADL_(l_uint)]; l_uint dev; char dev_r_[PADR_(l_uint)]; +}; +struct linux_fchownat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char uid_l_[PADL_(l_uid16_t)]; l_uid16_t uid; char uid_r_[PADR_(l_uid16_t)]; + char gid_l_[PADL_(l_gid16_t)]; l_gid16_t gid; char gid_r_[PADR_(l_gid16_t)]; + char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; +}; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 11 18:21:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A71791DD52F; Wed, 11 Dec 2019 18:21:35 +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 47Y4y742HQz4SRW; Wed, 11 Dec 2019 18:21:35 +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 85985F532; Wed, 11 Dec 2019 18:21:35 +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 xBBILZQf002755; Wed, 11 Dec 2019 18:21:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBILZj9002754; Wed, 11 Dec 2019 18:21:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912111821.xBBILZj9002754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Dec 2019 18:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355621 - head/sys/arm/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm/linux X-SVN-Commit-Revision: 355621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 18:21:35 -0000 Author: emaste Date: Wed Dec 11 18:21:35 2019 New Revision: 355621 URL: https://svnweb.freebsd.org/changeset/base/355621 Log: arm linuxulator: put syscall type and argument on one line Modified: head/sys/arm/linux/syscalls.master Modified: head/sys/arm/linux/syscalls.master ============================================================================== --- head/sys/arm/linux/syscalls.master Wed Dec 11 17:52:06 2019 (r355620) +++ head/sys/arm/linux/syscalls.master Wed Dec 11 18:21:35 2019 (r355621) @@ -1270,8 +1270,7 @@ const char *msg_ptr, size_t msg_len, unsigned int msg_prio, - const struct - l_timespec *abs_timeout + const struct l_timespec *abs_timeout ); } 277 AUE_NULL STD { @@ -1280,8 +1279,7 @@ char *msg_ptr, size_t msg_len, unsigned int msg_prio, - const struct - l_timespec *abs_timeout + const struct l_timespec *abs_timeout ); } 278 AUE_NULL STD { From owner-svn-src-all@freebsd.org Wed Dec 11 18:24:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF6401DD717; Wed, 11 Dec 2019 18:24:44 +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 47Y51m4Fxdz4SlR; Wed, 11 Dec 2019 18:24:44 +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 88E5AF58B; Wed, 11 Dec 2019 18:24:44 +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 xBBIOiEN007656; Wed, 11 Dec 2019 18:24:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBIOihD007654; Wed, 11 Dec 2019 18:24:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912111824.xBBIOihD007654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Dec 2019 18:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355622 - head/sys/arm/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm/linux X-SVN-Commit-Revision: 355622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 18:24:44 -0000 Author: emaste Date: Wed Dec 11 18:24:43 2019 New Revision: 355622 URL: https://svnweb.freebsd.org/changeset/base/355622 Log: arm linuxulator: regen sysent after r355621 Modified: head/sys/arm/linux/linux_proto.h head/sys/arm/linux/linux_systrace_args.c Modified: head/sys/arm/linux/linux_proto.h ============================================================================== --- head/sys/arm/linux/linux_proto.h Wed Dec 11 18:21:35 2019 (r355621) +++ head/sys/arm/linux/linux_proto.h Wed Dec 11 18:24:43 2019 (r355622) @@ -761,14 +761,14 @@ struct linux_mq_timedsend_args { char msg_ptr_l_[PADL_(const char *)]; const char * msg_ptr; char msg_ptr_r_[PADR_(const char *)]; char msg_len_l_[PADL_(size_t)]; size_t msg_len; char msg_len_r_[PADR_(size_t)]; char msg_prio_l_[PADL_(unsigned int)]; unsigned int msg_prio; char msg_prio_r_[PADR_(unsigned int)]; - char abs_timeout_l_[PADL_(const structl_timespec *)]; const structl_timespec * abs_timeout; char abs_timeout_r_[PADR_(const structl_timespec *)]; + char abs_timeout_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * abs_timeout; char abs_timeout_r_[PADR_(const struct l_timespec *)]; }; struct linux_mq_timedreceive_args { char mqd_l_[PADL_(l_mqd_t)]; l_mqd_t mqd; char mqd_r_[PADR_(l_mqd_t)]; char msg_ptr_l_[PADL_(char *)]; char * msg_ptr; char msg_ptr_r_[PADR_(char *)]; char msg_len_l_[PADL_(size_t)]; size_t msg_len; char msg_len_r_[PADR_(size_t)]; char msg_prio_l_[PADL_(unsigned int)]; unsigned int msg_prio; char msg_prio_r_[PADR_(unsigned int)]; - char abs_timeout_l_[PADL_(const structl_timespec *)]; const structl_timespec * abs_timeout; char abs_timeout_r_[PADR_(const structl_timespec *)]; + char abs_timeout_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * abs_timeout; char abs_timeout_r_[PADR_(const struct l_timespec *)]; }; struct linux_mq_notify_args { char mqd_l_[PADL_(l_mqd_t)]; l_mqd_t mqd; char mqd_r_[PADR_(l_mqd_t)]; Modified: head/sys/arm/linux/linux_systrace_args.c ============================================================================== --- head/sys/arm/linux/linux_systrace_args.c Wed Dec 11 18:21:35 2019 (r355621) +++ head/sys/arm/linux/linux_systrace_args.c Wed Dec 11 18:24:43 2019 (r355622) @@ -1684,7 +1684,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg uarg[1] = (intptr_t) p->msg_ptr; /* const char * */ uarg[2] = p->msg_len; /* size_t */ uarg[3] = p->msg_prio; /* unsigned int */ - uarg[4] = (intptr_t) p->abs_timeout; /* const structl_timespec * */ + uarg[4] = (intptr_t) p->abs_timeout; /* const struct l_timespec * */ *n_args = 5; break; } @@ -1695,7 +1695,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg uarg[1] = (intptr_t) p->msg_ptr; /* char * */ uarg[2] = p->msg_len; /* size_t */ uarg[3] = p->msg_prio; /* unsigned int */ - uarg[4] = (intptr_t) p->abs_timeout; /* const structl_timespec * */ + uarg[4] = (intptr_t) p->abs_timeout; /* const struct l_timespec * */ *n_args = 5; break; } @@ -5060,7 +5060,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "unsigned int"; break; case 4: - p = "userland const structl_timespec *"; + p = "userland const struct l_timespec *"; break; default: break; @@ -5082,7 +5082,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "unsigned int"; break; case 4: - p = "userland const structl_timespec *"; + p = "userland const struct l_timespec *"; break; default: break; From owner-svn-src-all@freebsd.org Wed Dec 11 18:36:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B10A1DD9C3; Wed, 11 Dec 2019 18:36:08 +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 47Y5Gw2knnz4TCr; Wed, 11 Dec 2019 18:36:08 +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 54B21F748; Wed, 11 Dec 2019 18:36:08 +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 xBBIa8m3013640; Wed, 11 Dec 2019 18:36:08 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBIa7xT013639; Wed, 11 Dec 2019 18:36:07 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201912111836.xBBIa7xT013639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 11 Dec 2019 18:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355623 - in head/sys: arm64/conf conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/conf conf X-SVN-Commit-Revision: 355623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 18:36:08 -0000 Author: manu Date: Wed Dec 11 18:36:07 2019 New Revision: 355623 URL: https://svnweb.freebsd.org/changeset/base/355623 Log: arm64: Add explicit devices for dwmmc variant We used to include the hisi version if soc_hisi_hi6220 was present, include the altera version if dwmmc_altera was present and include the rockchip version if soc_rockchip_rk3328 was present. Now every version have it's own device directive. The rockchip version isn't named dwmmc_rockchip because all other rockchip driver are named rk_XXX. MFC after: 1 month Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Dec 11 18:24:43 2019 (r355622) +++ head/sys/arm64/conf/GENERIC Wed Dec 11 18:36:07 2019 (r355623) @@ -196,6 +196,8 @@ device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards device dwmmc device dwmmc_altera +device dwmmc_hisi +device rk_dwmmc device rk_emmcphy # Serial (COM) ports Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed Dec 11 18:24:43 2019 (r355622) +++ head/sys/conf/files.arm64 Wed Dec 11 18:36:07 2019 (r355623) @@ -241,9 +241,9 @@ dev/hwpmc/hwpmc_arm64.c optional hwpmc dev/hwpmc/hwpmc_arm64_md.c optional hwpmc dev/mbox/mbox_if.m optional soc_brcm_bcm2837 dev/mmc/host/dwmmc.c optional dwmmc fdt -dev/mmc/host/dwmmc_altera.c optional dwmmc fdt dwmmc_altera -dev/mmc/host/dwmmc_hisi.c optional dwmmc fdt soc_hisi_hi6220 -dev/mmc/host/dwmmc_rockchip.c optional dwmmc fdt soc_rockchip_rk3328 +dev/mmc/host/dwmmc_altera.c optional dwmmc dwmmc_altera fdt +dev/mmc/host/dwmmc_hisi.c optional dwmmc dwmmc_hisi fdt +dev/mmc/host/dwmmc_rockchip.c optional dwmmc rk_dwmmc fdt dev/neta/if_mvneta_fdt.c optional neta fdt dev/neta/if_mvneta.c optional neta mdio mii dev/ofw/ofw_cpu.c optional fdt From owner-svn-src-all@freebsd.org Wed Dec 11 18:39:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A0671DDA7A; Wed, 11 Dec 2019 18:39:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47Y5LK65Vwz4TM4; Wed, 11 Dec 2019 18:39:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC5ABF74B; Wed, 11 Dec 2019 18:39:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBBId5HM013799; Wed, 11 Dec 2019 18:39:05 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBId5Yb013798; Wed, 11 Dec 2019 18:39:05 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201912111839.xBBId5Yb013798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 11 Dec 2019 18:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355624 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 355624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 18:39:06 -0000 Author: manu Date: Wed Dec 11 18:39:05 2019 New Revision: 355624 URL: https://svnweb.freebsd.org/changeset/base/355624 Log: arm64: rk3328: Add the *clk_peri_niu clocks Those clocks are always enable by default and are not really explained in the TRM but the reason we had them is that they have the periph clock as a parent and those parent should never be disable which can happen if we disable all the childs. The current childs are the sd/emmc/sdio clocks so the board will hang if we disable them. MFC after: 1 month Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3328_cru.c Wed Dec 11 18:36:07 2019 (r355623) +++ head/sys/arm64/rockchip/clk/rk3328_cru.c Wed Dec 11 18:39:05 2019 (r355624) @@ -102,6 +102,8 @@ static struct rk_cru_gate rk3328_gates[] = { CRU_GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_peri", 0x24C, 0) CRU_GATE(HCLK_SDIO, "hclk_sdio", "hclk_peri", 0x24C, 1) CRU_GATE(HCLK_EMMC, "hclk_emmc", "hclk_peri", 0x24C, 2) + CRU_GATE(0, "hclk_peri_niu", "hclk_peri", 0x24C, 12) + CRU_GATE(0, "pclk_peri_niu", "hclk_peri", 0x24C, 13) CRU_GATE(HCLK_SDMMC_EXT, "hclk_sdmmc_ext", "hclk_peri", 0x24C, 15) }; From owner-svn-src-all@freebsd.org Wed Dec 11 18:41:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EC241DDB51; Wed, 11 Dec 2019 18:41:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47Y5Np0SbJz4Tg2; Wed, 11 Dec 2019 18:41:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AF92F783; Wed, 11 Dec 2019 18:41:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBBIfDvi016003; Wed, 11 Dec 2019 18:41:13 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBIfDZY016000; Wed, 11 Dec 2019 18:41:13 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201912111841.xBBIfDZY016000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 11 Dec 2019 18:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355625 - head/sys/dev/mmc/host X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/mmc/host X-SVN-Commit-Revision: 355625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 18:41:14 -0000 Author: manu Date: Wed Dec 11 18:41:13 2019 New Revision: 355625 URL: https://svnweb.freebsd.org/changeset/base/355625 Log: dwmmc: Add a detach method This method will disable the regulators, clocks and assert the reset of the module. It will also detach it's children (the mmc device) and release it's resources. While here enable the regulators on attach as we need them to power up the sdcard or emmc. MFC after: 1 month Modified: head/sys/dev/mmc/host/dwmmc.c head/sys/dev/mmc/host/dwmmc_rockchip.c head/sys/dev/mmc/host/dwmmc_var.h Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Wed Dec 11 18:39:05 2019 (r355624) +++ head/sys/dev/mmc/host/dwmmc.c Wed Dec 11 18:41:13 2019 (r355625) @@ -537,6 +537,22 @@ parse_fdt(struct dwmmc_softc *sc) clk_get_freq(sc->ciu, &sc->bus_hz); } + /* Enable regulators */ + if (sc->vmmc != NULL) { + error = regulator_enable(sc->vmmc); + if (error != 0) { + device_printf(sc->dev, "Cannot enable vmmc regulator\n"); + goto fail; + } + } + if (sc->vqmmc != NULL) { + error = regulator_enable(sc->vqmmc); + if (error != 0) { + device_printf(sc->dev, "Cannot enable vqmmc regulator\n"); + goto fail; + } + } + /* Take dwmmc out of reset */ if (sc->hwreset != NULL) { error = hwreset_deassert(sc->hwreset); @@ -661,8 +677,51 @@ dwmmc_attach(device_t dev) sc->host.caps |= MMC_CAP_HSPEED; sc->host.caps |= MMC_CAP_SIGNALING_330; - device_add_child(dev, "mmc", -1); + sc->child = device_add_child(dev, "mmc", -1); return (bus_generic_attach(dev)); +} + +int +dwmmc_detach(device_t dev) +{ + struct dwmmc_softc *sc; + int ret; + + sc = device_get_softc(dev); + + ret = bus_generic_detach(dev); + if (ret != 0) + return (ret); + + DWMMC_LOCK_DESTROY(sc); + if (sc->intr_cookie != NULL) { + ret = bus_teardown_intr(dev, sc->res[1], sc->intr_cookie); + if (ret != 0) + return (ret); + } + bus_release_resources(dev, dwmmc_spec, sc->res); + + if (sc->child) { + ret = device_delete_child(dev, sc->child); + if (ret != 0) + return (ret); + } + +#ifdef EXT_RESOURCES + if (sc->hwreset != NULL && hwreset_deassert(sc->hwreset) != 0) + device_printf(sc->dev, "cannot deassert reset\n"); + if (sc->biu != NULL && clk_disable(sc->biu) != 0) + device_printf(sc->dev, "cannot disable biu clock\n"); + if (sc->ciu != NULL && clk_disable(sc->ciu) != 0) + device_printf(sc->dev, "cannot disable ciu clock\n"); + + if (sc->vmmc && regulator_disable(sc->vmmc) != 0) + device_printf(sc->dev, "Cannot disable vmmc regulator\n"); + if (sc->vqmmc && regulator_disable(sc->vqmmc) != 0) + device_printf(sc->dev, "Cannot disable vqmmc regulator\n"); +#endif + + return (0); } static int Modified: head/sys/dev/mmc/host/dwmmc_rockchip.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc_rockchip.c Wed Dec 11 18:39:05 2019 (r355624) +++ head/sys/dev/mmc/host/dwmmc_rockchip.c Wed Dec 11 18:41:13 2019 (r355625) @@ -133,6 +133,7 @@ static device_method_t rockchip_dwmmc_methods[] = { /* bus interface */ DEVMETHOD(device_probe, rockchip_dwmmc_probe), DEVMETHOD(device_attach, rockchip_dwmmc_attach), + DEVMETHOD(device_detach, dwmmc_detach), DEVMETHOD_END }; Modified: head/sys/dev/mmc/host/dwmmc_var.h ============================================================================== --- head/sys/dev/mmc/host/dwmmc_var.h Wed Dec 11 18:39:05 2019 (r355624) +++ head/sys/dev/mmc/host/dwmmc_var.h Wed Dec 11 18:41:13 2019 (r355625) @@ -61,6 +61,7 @@ struct dwmmc_softc { uint32_t use_pio; uint32_t pwren_inverted; u_int desc_count; + device_t child; int (*update_ios)(struct dwmmc_softc *sc, struct mmc_ios *ios); @@ -94,5 +95,6 @@ struct dwmmc_softc { DECLARE_CLASS(dwmmc_driver); int dwmmc_attach(device_t); +int dwmmc_detach(device_t); #endif From owner-svn-src-all@freebsd.org Wed Dec 11 18:43:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A63E21DDD40; Wed, 11 Dec 2019 18:43:40 +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 47Y5Rc3tw5z4Txx; Wed, 11 Dec 2019 18:43:40 +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 80C0EF91C; Wed, 11 Dec 2019 18:43:40 +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 xBBIheIv019647; Wed, 11 Dec 2019 18:43:40 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBIheUk019646; Wed, 11 Dec 2019 18:43:40 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201912111843.xBBIheUk019646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 11 Dec 2019 18:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355626 - in head/sys/modules/rockchip: . rk_dwmmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/modules/rockchip: . rk_dwmmc X-SVN-Commit-Revision: 355626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 18:43:40 -0000 Author: manu Date: Wed Dec 11 18:43:39 2019 New Revision: 355626 URL: https://svnweb.freebsd.org/changeset/base/355626 Log: arm64: rockchip: Add a module for rk_dwmmc This is mostly needed for dev/debug as most users will have their root on the sdcard or emmc. MFC after: 1 month Added: head/sys/modules/rockchip/rk_dwmmc/ head/sys/modules/rockchip/rk_dwmmc/Makefile (contents, props changed) Modified: head/sys/modules/rockchip/Makefile Modified: head/sys/modules/rockchip/Makefile ============================================================================== --- head/sys/modules/rockchip/Makefile Wed Dec 11 18:41:13 2019 (r355625) +++ head/sys/modules/rockchip/Makefile Wed Dec 11 18:43:39 2019 (r355626) @@ -3,6 +3,7 @@ SUBDIR = \ rk_i2c \ - rk805 + rk805 \ + rk_dwmmc .include Added: head/sys/modules/rockchip/rk_dwmmc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/rockchip/rk_dwmmc/Makefile Wed Dec 11 18:43:39 2019 (r355626) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/mmc/host/ + +KMOD= rk_dwmmc +SRCS= dwmmc.c dwmmc_rockchip.c + +SRCS+= \ + bus_if.h \ + clknode_if.h \ + device_if.h \ + ofw_bus_if.h + +.include From owner-svn-src-all@freebsd.org Wed Dec 11 18:50:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7184B1DDDF8; Wed, 11 Dec 2019 18:50:25 +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 47Y5bP28Yvz4VBD; Wed, 11 Dec 2019 18:50:25 +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 4521FF925; Wed, 11 Dec 2019 18:50:25 +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 xBBIoPFm020044; Wed, 11 Dec 2019 18:50:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBIoNDT020038; Wed, 11 Dec 2019 18:50:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201912111850.xBBIoNDT020038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 11 Dec 2019 18:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355627 - head/sys/dev/mmc/host X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/mmc/host X-SVN-Commit-Revision: 355627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 18:50:25 -0000 Author: manu Date: Wed Dec 11 18:50:23 2019 New Revision: 355627 URL: https://svnweb.freebsd.org/changeset/base/355627 Log: dwmmc: Handle the card detect interrupt The driver used to always add the mmc device as it's child even it no card was detected. Add a function that will detect if the card is present or not and that will attach/detach the mmc device. The function is either call on attach (as we won't have the interrupt fired) or from two taskqueues. The first taskqueue will directly call the function when the sdcard was present and is now removed and the other one will delay a bit the attach when we didn't had a card and now have one. This is mostly based on comments from the sdhci driver where it describe a situation when the CD pin is detected before the others pins are connected. MFC after: 1 month Modified: head/sys/dev/mmc/host/dwmmc.c head/sys/dev/mmc/host/dwmmc_altera.c head/sys/dev/mmc/host/dwmmc_hisi.c head/sys/dev/mmc/host/dwmmc_rockchip.c head/sys/dev/mmc/host/dwmmc_samsung.c head/sys/dev/mmc/host/dwmmc_var.h Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Wed Dec 11 18:43:39 2019 (r355626) +++ head/sys/dev/mmc/host/dwmmc.c Wed Dec 11 18:50:23 2019 (r355627) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -127,6 +129,7 @@ static int dma_done(struct dwmmc_softc *, struct mmc_c static int dma_stop(struct dwmmc_softc *); static void pio_read(struct dwmmc_softc *, struct mmc_command *); static void pio_write(struct dwmmc_softc *, struct mmc_command *); +static void dwmmc_handle_card_present(struct dwmmc_softc *sc, bool is_present); static struct resource_spec dwmmc_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -374,7 +377,8 @@ dwmmc_intr(void *arg) sc->dto_rcvd = 1; if (reg & SDMMC_INTMASK_CD) { - /* XXX: Handle card detect */ + dwmmc_handle_card_present(sc, + READ4(sc, SDMMC_CDETECT) == 0 ? true : false); } } @@ -407,6 +411,56 @@ dwmmc_intr(void *arg) DWMMC_UNLOCK(sc); } +static void +dwmmc_handle_card_present(struct dwmmc_softc *sc, bool is_present) +{ + bool was_present; + + was_present = sc->child != NULL; + + if (!was_present && is_present) { + taskqueue_enqueue_timeout(taskqueue_swi_giant, + &sc->card_delayed_task, -(hz / 2)); + } else if (was_present && !is_present) { + taskqueue_enqueue(taskqueue_swi_giant, &sc->card_task); + } +} + +static void +dwmmc_card_task(void *arg, int pending __unused) +{ + struct dwmmc_softc *sc = arg; + + DWMMC_LOCK(sc); + + if (READ4(sc, SDMMC_CDETECT) == 0) { + if (sc->child == NULL) { + if (bootverbose) + device_printf(sc->dev, "Card inserted\n"); + + sc->child = device_add_child(sc->dev, "mmc", -1); + DWMMC_UNLOCK(sc); + if (sc->child) { + device_set_ivars(sc->child, sc); + (void)device_probe_and_attach(sc->child); + } + } else + DWMMC_UNLOCK(sc); + + } else { + /* Card isn't present, detach if necessary */ + if (sc->child != NULL) { + if (bootverbose) + device_printf(sc->dev, "Card removed\n"); + + DWMMC_UNLOCK(sc); + device_delete_child(sc->dev, sc->child); + sc->child = NULL; + } else + DWMMC_UNLOCK(sc); + } +} + static int parse_fdt(struct dwmmc_softc *sc) { @@ -677,8 +731,17 @@ dwmmc_attach(device_t dev) sc->host.caps |= MMC_CAP_HSPEED; sc->host.caps |= MMC_CAP_SIGNALING_330; - sc->child = device_add_child(dev, "mmc", -1); - return (bus_generic_attach(dev)); + TASK_INIT(&sc->card_task, 0, dwmmc_card_task, sc); + TIMEOUT_TASK_INIT(taskqueue_swi_giant, &sc->card_delayed_task, 0, + dwmmc_card_task, sc); + + /* + * Schedule a card detection as we won't get an interrupt + * if the card is inserted when we attach + */ + dwmmc_card_task(sc, 0); + + return (0); } int @@ -693,7 +756,9 @@ dwmmc_detach(device_t dev) if (ret != 0) return (ret); - DWMMC_LOCK_DESTROY(sc); + taskqueue_drain(taskqueue_swi_giant, &sc->card_task); + taskqueue_drain_timeout(taskqueue_swi_giant, &sc->card_delayed_task); + if (sc->intr_cookie != NULL) { ret = bus_teardown_intr(dev, sc->res[1], sc->intr_cookie); if (ret != 0) @@ -706,6 +771,8 @@ dwmmc_detach(device_t dev) if (ret != 0) return (ret); } + + DWMMC_LOCK_DESTROY(sc); #ifdef EXT_RESOURCES if (sc->hwreset != NULL && hwreset_deassert(sc->hwreset) != 0) Modified: head/sys/dev/mmc/host/dwmmc_altera.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc_altera.c Wed Dec 11 18:43:39 2019 (r355626) +++ head/sys/dev/mmc/host/dwmmc_altera.c Wed Dec 11 18:50:23 2019 (r355627) @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include Modified: head/sys/dev/mmc/host/dwmmc_hisi.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc_hisi.c Wed Dec 11 18:43:39 2019 (r355626) +++ head/sys/dev/mmc/host/dwmmc_hisi.c Wed Dec 11 18:50:23 2019 (r355627) @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include Modified: head/sys/dev/mmc/host/dwmmc_rockchip.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc_rockchip.c Wed Dec 11 18:43:39 2019 (r355626) +++ head/sys/dev/mmc/host/dwmmc_rockchip.c Wed Dec 11 18:50:23 2019 (r355627) @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include Modified: head/sys/dev/mmc/host/dwmmc_samsung.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc_samsung.c Wed Dec 11 18:43:39 2019 (r355626) +++ head/sys/dev/mmc/host/dwmmc_samsung.c Wed Dec 11 18:50:23 2019 (r355627) @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include Modified: head/sys/dev/mmc/host/dwmmc_var.h ============================================================================== --- head/sys/dev/mmc/host/dwmmc_var.h Wed Dec 11 18:43:39 2019 (r355626) +++ head/sys/dev/mmc/host/dwmmc_var.h Wed Dec 11 18:50:23 2019 (r355627) @@ -62,6 +62,8 @@ struct dwmmc_softc { uint32_t pwren_inverted; u_int desc_count; device_t child; + struct task card_task; /* Card presence check task */ + struct timeout_task card_delayed_task;/* Card insert delayed task */ int (*update_ios)(struct dwmmc_softc *sc, struct mmc_ios *ios); From owner-svn-src-all@freebsd.org Wed Dec 11 19:32:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9BF51DF23A; Wed, 11 Dec 2019 19:32:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47Y6XN4yFyz4YTZ; Wed, 11 Dec 2019 19:32:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A518C18245; Wed, 11 Dec 2019 19:32:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBBJWqg3050050; Wed, 11 Dec 2019 19:32:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBJWq91050049; Wed, 11 Dec 2019 19:32:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912111932.xBBJWq91050049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 11 Dec 2019 19:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355628 - head/sys/tools X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/tools X-SVN-Commit-Revision: 355628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 19:32:52 -0000 Author: kevans Date: Wed Dec 11 19:32:52 2019 New Revision: 355628 URL: https://svnweb.freebsd.org/changeset/base/355628 Log: makesyscalls.lua: trim trailing spaces/commas from args These are insignificant as far as declarations go, and we've historically allowed it. fhlinkat in ^/sys/kern/syscalls.master, for example, currently has a trailing comma after its final argument that this version of makesyscalls is ignoring (not by conscious decision). Fix it for now by actively stripping off trailing whitespace/commas until we decide to actively prohibit it. Modified: head/sys/tools/makesyscalls.lua Modified: head/sys/tools/makesyscalls.lua ============================================================================== --- head/sys/tools/makesyscalls.lua Wed Dec 11 18:50:23 2019 (r355627) +++ head/sys/tools/makesyscalls.lua Wed Dec 11 19:32:52 2019 (r355628) @@ -1010,6 +1010,7 @@ process_syscall_def = function(line) abort(1, "Not a signature? " .. line) end args = line:match("^[^(]+%((.+)%)[^)]*$") + args = trim(args, '[,%s]') end ::skipalt:: From owner-svn-src-all@freebsd.org Wed Dec 11 19:40:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C0E41DF613; Wed, 11 Dec 2019 19:40:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Y6jC3gNXz4Z89; Wed, 11 Dec 2019 19:40:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 793BE1826F; Wed, 11 Dec 2019 19:40:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBBJeVQJ051011; Wed, 11 Dec 2019 19:40:31 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBJeVH5051010; Wed, 11 Dec 2019 19:40:31 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201912111940.xBBJeVH5051010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 11 Dec 2019 19:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355629 - head/sys/dev/mmc/host X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/mmc/host X-SVN-Commit-Revision: 355629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 19:40:31 -0000 Author: manu Date: Wed Dec 11 19:40:30 2019 New Revision: 355629 URL: https://svnweb.freebsd.org/changeset/base/355629 Log: dwmmc: Use device_delete_children Instead of first detaching the children(s) and then delete them, use the device_delete_children function that does all of that. MFC after: 1 month Suggested by: ian Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Wed Dec 11 19:32:52 2019 (r355628) +++ head/sys/dev/mmc/host/dwmmc.c Wed Dec 11 19:40:30 2019 (r355629) @@ -752,7 +752,7 @@ dwmmc_detach(device_t dev) sc = device_get_softc(dev); - ret = bus_generic_detach(dev); + ret = device_delete_children(dev); if (ret != 0) return (ret); @@ -765,12 +765,6 @@ dwmmc_detach(device_t dev) return (ret); } bus_release_resources(dev, dwmmc_spec, sc->res); - - if (sc->child) { - ret = device_delete_child(dev, sc->child); - if (ret != 0) - return (ret); - } DWMMC_LOCK_DESTROY(sc); From owner-svn-src-all@freebsd.org Wed Dec 11 22:00:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A195F1E17DA; Wed, 11 Dec 2019 22:00:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47Y9pr2wmkz3CKR; Wed, 11 Dec 2019 22:00:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id xBBM0T0f019480 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 12 Dec 2019 00:00:32 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua xBBM0T0f019480 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id xBBM0SUq019479; Thu, 12 Dec 2019 00:00:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 12 Dec 2019 00:00:28 +0200 From: Konstantin Belousov To: Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355611 - head/sys/kern Message-ID: <20191211220028.GW2744@kib.kiev.ua> References: <201912111552.xBBFqUq9009116@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201912111552.xBBFqUq9009116@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 47Y9pr2wmkz3CKR 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)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 22:00:36 -0000 On Wed, Dec 11, 2019 at 03:52:30PM +0000, Andriy Gapon wrote: > Author: avg > Date: Wed Dec 11 15:52:29 2019 > New Revision: 355611 > URL: https://svnweb.freebsd.org/changeset/base/355611 > > Log: > add a sanity check to the system call registration code > > A system call number should be at least reserved. > We do not expect an attempt to register a fixed number system call > when nothing at all is known about it. > > MFC after: 3 weeks > Sponsored by: Panzura > > Modified: > head/sys/kern/kern_syscalls.c > > Modified: head/sys/kern/kern_syscalls.c > ============================================================================== > --- head/sys/kern/kern_syscalls.c Wed Dec 11 15:15:21 2019 (r355610) > +++ head/sys/kern/kern_syscalls.c Wed Dec 11 15:52:29 2019 (r355611) > @@ -120,11 +120,14 @@ kern_syscall_register(struct sysent *sysents, int *off > if (i == SYS_MAXSYSCALL) > return (ENFILE); > *offset = i; > - } else if (*offset < 0 || *offset >= SYS_MAXSYSCALL) > + } else if (*offset < 0 || *offset >= SYS_MAXSYSCALL) { > return (EINVAL); > - else if (sysents[*offset].sy_call != (sy_call_t *)lkmnosys && > - sysents[*offset].sy_call != (sy_call_t *)lkmressys) > + } else if (sysents[*offset].sy_call != (sy_call_t *)lkmnosys && > + sysents[*offset].sy_call != (sy_call_t *)lkmressys) { > + KASSERT(sysents[*offset].sy_call != NULL, > + ("undefined syscall %d", *offset)); I do not think that the assert is very useful. On debug kernels, where the development would most likely take place, its only function is to annoy developer by requiring him to reboot the host if he did not guessed a free syscall number right. I suggest to convert this into printf, might be also under bootverbose. Also, why do you say that the syscall is undefined ? I would state that it is not reusable for dynamically loaded syscall, instead. > return (EEXIST); > + } > > KASSERT(sysents[*offset].sy_thrcnt == SY_THR_ABSENT, > ("dynamic syscall is not protected")); From owner-svn-src-all@freebsd.org Wed Dec 11 22:09:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 651741E19BA; Wed, 11 Dec 2019 22:09:24 +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 47YB102dd7z3Clw; Wed, 11 Dec 2019 22:09:24 +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 3CBEE19D49; Wed, 11 Dec 2019 22:09:24 +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 xBBM9OMU039287; Wed, 11 Dec 2019 22:09:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBM9NGK039280; Wed, 11 Dec 2019 22:09:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912112209.xBBM9NGK039280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Dec 2019 22:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355630 - in head/lib/libpmc/pmu-events/arch/arm64: . arm/cortex-a53 cavium/thunderx2 hisilicon/hip08 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/lib/libpmc/pmu-events/arch/arm64: . arm/cortex-a53 cavium/thunderx2 hisilicon/hip08 X-SVN-Commit-Revision: 355630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 22:09:24 -0000 Author: emaste Date: Wed Dec 11 22:09:22 2019 New Revision: 355630 URL: https://svnweb.freebsd.org/changeset/base/355630 Log: libpmc: convert arm64 data files to proper json jevents includes a very permissive json parser that accepts invalid json, of which there are many examples in libpmc (typically extra or missing commas). Convert the arm64 files to proper json so other tools can parse them. Sponsored by: The FreeBSD Foundation Modified: head/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a53/branch.json head/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a53/bus.json head/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a53/other.json head/lib/libpmc/pmu-events/arch/arm64/armv8-recommended.json head/lib/libpmc/pmu-events/arch/arm64/cavium/thunderx2/core-imp-def.json head/lib/libpmc/pmu-events/arch/arm64/hisilicon/hip08/core-imp-def.json Modified: head/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a53/branch.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a53/branch.json Wed Dec 11 19:40:30 2019 (r355629) +++ head/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a53/branch.json Wed Dec 11 22:09:22 2019 (r355630) @@ -1,6 +1,6 @@ [ { - "ArchStdEvent": "BR_INDIRECT_SPEC", + "ArchStdEvent": "BR_INDIRECT_SPEC" }, { "EventCode": "0xC9", Modified: head/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a53/bus.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a53/bus.json Wed Dec 11 19:40:30 2019 (r355629) +++ head/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a53/bus.json Wed Dec 11 22:09:22 2019 (r355630) @@ -1,8 +1,8 @@ [ { - "ArchStdEvent": "BUS_ACCESS_RD", + "ArchStdEvent": "BUS_ACCESS_RD" }, { - "ArchStdEvent": "BUS_ACCESS_WR", + "ArchStdEvent": "BUS_ACCESS_WR" } ] Modified: head/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a53/other.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a53/other.json Wed Dec 11 19:40:30 2019 (r355629) +++ head/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a53/other.json Wed Dec 11 22:09:22 2019 (r355630) @@ -1,9 +1,9 @@ [ { - "ArchStdEvent": "EXC_IRQ", + "ArchStdEvent": "EXC_IRQ" }, { - "ArchStdEvent": "EXC_FIQ", + "ArchStdEvent": "EXC_FIQ" }, { "EventCode": "0xC6", Modified: head/lib/libpmc/pmu-events/arch/arm64/armv8-recommended.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/arm64/armv8-recommended.json Wed Dec 11 19:40:30 2019 (r355629) +++ head/lib/libpmc/pmu-events/arch/arm64/armv8-recommended.json Wed Dec 11 22:09:22 2019 (r355630) @@ -154,297 +154,297 @@ "EventCode": "0x61", "EventName": "BUS_ACCESS_WR", "BriefDescription": "Bus access write" - } + }, { "PublicDescription": "Bus access, Normal, Cacheable, Shareable", "EventCode": "0x62", "EventName": "BUS_ACCESS_SHARED", "BriefDescription": "Bus access, Normal, Cacheable, Shareable" - } + }, { "PublicDescription": "Bus access, not Normal, Cacheable, Shareable", "EventCode": "0x63", "EventName": "BUS_ACCESS_NOT_SHARED", "BriefDescription": "Bus access, not Normal, Cacheable, Shareable" - } + }, { "PublicDescription": "Bus access, Normal", "EventCode": "0x64", "EventName": "BUS_ACCESS_NORMAL", "BriefDescription": "Bus access, Normal" - } + }, { "PublicDescription": "Bus access, peripheral", "EventCode": "0x65", "EventName": "BUS_ACCESS_PERIPH", "BriefDescription": "Bus access, peripheral" - } + }, { "PublicDescription": "Data memory access, read", "EventCode": "0x66", "EventName": "MEM_ACCESS_RD", "BriefDescription": "Data memory access, read" - } + }, { "PublicDescription": "Data memory access, write", "EventCode": "0x67", "EventName": "MEM_ACCESS_WR", "BriefDescription": "Data memory access, write" - } + }, { "PublicDescription": "Unaligned access, read", "EventCode": "0x68", "EventName": "UNALIGNED_LD_SPEC", "BriefDescription": "Unaligned access, read" - } + }, { "PublicDescription": "Unaligned access, write", "EventCode": "0x69", "EventName": "UNALIGNED_ST_SPEC", "BriefDescription": "Unaligned access, write" - } + }, { "PublicDescription": "Unaligned access", "EventCode": "0x6a", "EventName": "UNALIGNED_LDST_SPEC", "BriefDescription": "Unaligned access" - } + }, { "PublicDescription": "Exclusive operation speculatively executed, LDREX or LDX", "EventCode": "0x6c", "EventName": "LDREX_SPEC", "BriefDescription": "Exclusive operation speculatively executed, LDREX or LDX" - } + }, { "PublicDescription": "Exclusive operation speculatively executed, STREX or STX pass", "EventCode": "0x6d", "EventName": "STREX_PASS_SPEC", "BriefDescription": "Exclusive operation speculatively executed, STREX or STX pass" - } + }, { "PublicDescription": "Exclusive operation speculatively executed, STREX or STX fail", "EventCode": "0x6e", "EventName": "STREX_FAIL_SPEC", "BriefDescription": "Exclusive operation speculatively executed, STREX or STX fail" - } + }, { "PublicDescription": "Exclusive operation speculatively executed, STREX or STX", "EventCode": "0x6f", "EventName": "STREX_SPEC", "BriefDescription": "Exclusive operation speculatively executed, STREX or STX" - } + }, { "PublicDescription": "Operation speculatively executed, load", "EventCode": "0x70", "EventName": "LD_SPEC", "BriefDescription": "Operation speculatively executed, load" - } + }, { - "PublicDescription": "Operation speculatively executed, store" + "PublicDescription": "Operation speculatively executed, store", "EventCode": "0x71", "EventName": "ST_SPEC", "BriefDescription": "Operation speculatively executed, store" - } + }, { "PublicDescription": "Operation speculatively executed, load or store", "EventCode": "0x72", "EventName": "LDST_SPEC", "BriefDescription": "Operation speculatively executed, load or store" - } + }, { "PublicDescription": "Operation speculatively executed, integer data processing", "EventCode": "0x73", "EventName": "DP_SPEC", "BriefDescription": "Operation speculatively executed, integer data processing" - } + }, { "PublicDescription": "Operation speculatively executed, Advanced SIMD instruction", "EventCode": "0x74", "EventName": "ASE_SPEC", - "BriefDescription": "Operation speculatively executed, Advanced SIMD instruction", - } + "BriefDescription": "Operation speculatively executed, Advanced SIMD instruction" + }, { "PublicDescription": "Operation speculatively executed, floating-point instruction", "EventCode": "0x75", "EventName": "VFP_SPEC", "BriefDescription": "Operation speculatively executed, floating-point instruction" - } + }, { "PublicDescription": "Operation speculatively executed, software change of the PC", "EventCode": "0x76", "EventName": "PC_WRITE_SPEC", "BriefDescription": "Operation speculatively executed, software change of the PC" - } + }, { "PublicDescription": "Operation speculatively executed, Cryptographic instruction", "EventCode": "0x77", "EventName": "CRYPTO_SPEC", "BriefDescription": "Operation speculatively executed, Cryptographic instruction" - } + }, { - "PublicDescription": "Branch speculatively executed, immediate branch" + "PublicDescription": "Branch speculatively executed, immediate branch", "EventCode": "0x78", "EventName": "BR_IMMED_SPEC", "BriefDescription": "Branch speculatively executed, immediate branch" - } + }, { - "PublicDescription": "Branch speculatively executed, procedure return" + "PublicDescription": "Branch speculatively executed, procedure return", "EventCode": "0x79", "EventName": "BR_RETURN_SPEC", "BriefDescription": "Branch speculatively executed, procedure return" - } + }, { - "PublicDescription": "Branch speculatively executed, indirect branch" + "PublicDescription": "Branch speculatively executed, indirect branch", "EventCode": "0x7a", "EventName": "BR_INDIRECT_SPEC", "BriefDescription": "Branch speculatively executed, indirect branch" - } + }, { - "PublicDescription": "Barrier speculatively executed, ISB" + "PublicDescription": "Barrier speculatively executed, ISB", "EventCode": "0x7c", "EventName": "ISB_SPEC", "BriefDescription": "Barrier speculatively executed, ISB" - } + }, { - "PublicDescription": "Barrier speculatively executed, DSB" + "PublicDescription": "Barrier speculatively executed, DSB", "EventCode": "0x7d", "EventName": "DSB_SPEC", "BriefDescription": "Barrier speculatively executed, DSB" - } + }, { - "PublicDescription": "Barrier speculatively executed, DMB" + "PublicDescription": "Barrier speculatively executed, DMB", "EventCode": "0x7e", "EventName": "DMB_SPEC", "BriefDescription": "Barrier speculatively executed, DMB" - } + }, { - "PublicDescription": "Exception taken, Other synchronous" + "PublicDescription": "Exception taken, Other synchronous", "EventCode": "0x81", "EventName": "EXC_UNDEF", "BriefDescription": "Exception taken, Other synchronous" - } + }, { - "PublicDescription": "Exception taken, Supervisor Call" + "PublicDescription": "Exception taken, Supervisor Call", "EventCode": "0x82", "EventName": "EXC_SVC", "BriefDescription": "Exception taken, Supervisor Call" - } + }, { - "PublicDescription": "Exception taken, Instruction Abort" + "PublicDescription": "Exception taken, Instruction Abort", "EventCode": "0x83", "EventName": "EXC_PABORT", "BriefDescription": "Exception taken, Instruction Abort" - } + }, { - "PublicDescription": "Exception taken, Data Abort and SError" + "PublicDescription": "Exception taken, Data Abort and SError", "EventCode": "0x84", "EventName": "EXC_DABORT", "BriefDescription": "Exception taken, Data Abort and SError" - } + }, { - "PublicDescription": "Exception taken, IRQ" + "PublicDescription": "Exception taken, IRQ", "EventCode": "0x86", "EventName": "EXC_IRQ", "BriefDescription": "Exception taken, IRQ" - } + }, { - "PublicDescription": "Exception taken, FIQ" + "PublicDescription": "Exception taken, FIQ", "EventCode": "0x87", "EventName": "EXC_FIQ", "BriefDescription": "Exception taken, FIQ" - } + }, { - "PublicDescription": "Exception taken, Secure Monitor Call" + "PublicDescription": "Exception taken, Secure Monitor Call", "EventCode": "0x88", "EventName": "EXC_SMC", "BriefDescription": "Exception taken, Secure Monitor Call" - } + }, { - "PublicDescription": "Exception taken, Hypervisor Call" + "PublicDescription": "Exception taken, Hypervisor Call", "EventCode": "0x8a", "EventName": "EXC_HVC", "BriefDescription": "Exception taken, Hypervisor Call" - } + }, { - "PublicDescription": "Exception taken, Instruction Abort not taken locally" + "PublicDescription": "Exception taken, Instruction Abort not taken locally", "EventCode": "0x8b", "EventName": "EXC_TRAP_PABORT", "BriefDescription": "Exception taken, Instruction Abort not taken locally" - } + }, { - "PublicDescription": "Exception taken, Data Abort or SError not taken locally" + "PublicDescription": "Exception taken, Data Abort or SError not taken locally", "EventCode": "0x8c", "EventName": "EXC_TRAP_DABORT", "BriefDescription": "Exception taken, Data Abort or SError not taken locally" - } + }, { - "PublicDescription": "Exception taken, Other traps not taken locally" + "PublicDescription": "Exception taken, Other traps not taken locally", "EventCode": "0x8d", "EventName": "EXC_TRAP_OTHER", "BriefDescription": "Exception taken, Other traps not taken locally" - } + }, { - "PublicDescription": "Exception taken, IRQ not taken locally" + "PublicDescription": "Exception taken, IRQ not taken locally", "EventCode": "0x8e", "EventName": "EXC_TRAP_IRQ", "BriefDescription": "Exception taken, IRQ not taken locally" - } + }, { - "PublicDescription": "Exception taken, FIQ not taken locally" + "PublicDescription": "Exception taken, FIQ not taken locally", "EventCode": "0x8f", "EventName": "EXC_TRAP_FIQ", "BriefDescription": "Exception taken, FIQ not taken locally" - } + }, { - "PublicDescription": "Release consistency operation speculatively executed, Load-Acquire" + "PublicDescription": "Release consistency operation speculatively executed, Load-Acquire", "EventCode": "0x90", "EventName": "RC_LD_SPEC", "BriefDescription": "Release consistency operation speculatively executed, Load-Acquire" - } + }, { - "PublicDescription": "Release consistency operation speculatively executed, Store-Release" + "PublicDescription": "Release consistency operation speculatively executed, Store-Release", "EventCode": "0x91", "EventName": "RC_ST_SPEC", "BriefDescription": "Release consistency operation speculatively executed, Store-Release" - } + }, { - "PublicDescription": "Attributable Level 3 data or unified cache access, read" + "PublicDescription": "Attributable Level 3 data or unified cache access, read", "EventCode": "0xa0", "EventName": "L3D_CACHE_RD", "BriefDescription": "Attributable Level 3 data or unified cache access, read" - } + }, { - "PublicDescription": "Attributable Level 3 data or unified cache access, write" + "PublicDescription": "Attributable Level 3 data or unified cache access, write", "EventCode": "0xa1", "EventName": "L3D_CACHE_WR", "BriefDescription": "Attributable Level 3 data or unified cache access, write" - } + }, { - "PublicDescription": "Attributable Level 3 data or unified cache refill, read" + "PublicDescription": "Attributable Level 3 data or unified cache refill, read", "EventCode": "0xa2", "EventName": "L3D_CACHE_REFILL_RD", "BriefDescription": "Attributable Level 3 data or unified cache refill, read" - } + }, { - "PublicDescription": "Attributable Level 3 data or unified cache refill, write" + "PublicDescription": "Attributable Level 3 data or unified cache refill, write", "EventCode": "0xa3", "EventName": "L3D_CACHE_REFILL_WR", "BriefDescription": "Attributable Level 3 data or unified cache refill, write" - } + }, { - "PublicDescription": "Attributable Level 3 data or unified cache Write-Back, victim" + "PublicDescription": "Attributable Level 3 data or unified cache Write-Back, victim", "EventCode": "0xa6", "EventName": "L3D_CACHE_WB_VICTIM", "BriefDescription": "Attributable Level 3 data or unified cache Write-Back, victim" - } + }, { - "PublicDescription": "Attributable Level 3 data or unified cache Write-Back, cache clean" + "PublicDescription": "Attributable Level 3 data or unified cache Write-Back, cache clean", "EventCode": "0xa7", "EventName": "L3D_CACHE_WB_CLEAN", "BriefDescription": "Attributable Level 3 data or unified cache Write-Back, cache clean" - } + }, { - "PublicDescription": "Attributable Level 3 data or unified cache access, invalidate" + "PublicDescription": "Attributable Level 3 data or unified cache access, invalidate", "EventCode": "0xa8", "EventName": "L3D_CACHE_INVAL", "BriefDescription": "Attributable Level 3 data or unified cache access, invalidate" Modified: head/lib/libpmc/pmu-events/arch/arm64/cavium/thunderx2/core-imp-def.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/arm64/cavium/thunderx2/core-imp-def.json Wed Dec 11 19:40:30 2019 (r355629) +++ head/lib/libpmc/pmu-events/arch/arm64/cavium/thunderx2/core-imp-def.json Wed Dec 11 22:09:22 2019 (r355630) @@ -1,32 +1,32 @@ [ { - "ArchStdEvent": "L1D_CACHE_RD", + "ArchStdEvent": "L1D_CACHE_RD" }, { - "ArchStdEvent": "L1D_CACHE_WR", + "ArchStdEvent": "L1D_CACHE_WR" }, { - "ArchStdEvent": "L1D_CACHE_REFILL_RD", + "ArchStdEvent": "L1D_CACHE_REFILL_RD" }, { - "ArchStdEvent": "L1D_CACHE_REFILL_WR", + "ArchStdEvent": "L1D_CACHE_REFILL_WR" }, { - "ArchStdEvent": "L1D_TLB_REFILL_RD", + "ArchStdEvent": "L1D_TLB_REFILL_RD" }, { - "ArchStdEvent": "L1D_TLB_REFILL_WR", + "ArchStdEvent": "L1D_TLB_REFILL_WR" }, { - "ArchStdEvent": "L1D_TLB_RD", + "ArchStdEvent": "L1D_TLB_RD" }, { - "ArchStdEvent": "L1D_TLB_WR", + "ArchStdEvent": "L1D_TLB_WR" }, { - "ArchStdEvent": "BUS_ACCESS_RD", + "ArchStdEvent": "BUS_ACCESS_RD" }, { - "ArchStdEvent": "BUS_ACCESS_WR", + "ArchStdEvent": "BUS_ACCESS_WR" } ] Modified: head/lib/libpmc/pmu-events/arch/arm64/hisilicon/hip08/core-imp-def.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/arm64/hisilicon/hip08/core-imp-def.json Wed Dec 11 19:40:30 2019 (r355629) +++ head/lib/libpmc/pmu-events/arch/arm64/hisilicon/hip08/core-imp-def.json Wed Dec 11 22:09:22 2019 (r355630) @@ -1,122 +1,122 @@ [ { - "ArchStdEvent": "L1D_CACHE_RD", + "ArchStdEvent": "L1D_CACHE_RD" }, { - "ArchStdEvent": "L1D_CACHE_WR", + "ArchStdEvent": "L1D_CACHE_WR" }, { - "ArchStdEvent": "L1D_CACHE_REFILL_RD", + "ArchStdEvent": "L1D_CACHE_REFILL_RD" }, { - "ArchStdEvent": "L1D_CACHE_REFILL_WR", + "ArchStdEvent": "L1D_CACHE_REFILL_WR" }, { - "ArchStdEvent": "L1D_CACHE_WB_VICTIM", + "ArchStdEvent": "L1D_CACHE_WB_VICTIM" }, { - "ArchStdEvent": "L1D_CACHE_WB_CLEAN", + "ArchStdEvent": "L1D_CACHE_WB_CLEAN" }, { - "ArchStdEvent": "L1D_CACHE_INVAL", + "ArchStdEvent": "L1D_CACHE_INVAL" }, { - "ArchStdEvent": "L1D_TLB_REFILL_RD", + "ArchStdEvent": "L1D_TLB_REFILL_RD" }, { - "ArchStdEvent": "L1D_TLB_REFILL_WR", + "ArchStdEvent": "L1D_TLB_REFILL_WR" }, { - "ArchStdEvent": "L1D_TLB_RD", + "ArchStdEvent": "L1D_TLB_RD" }, { - "ArchStdEvent": "L1D_TLB_WR", + "ArchStdEvent": "L1D_TLB_WR" }, { - "ArchStdEvent": "L2D_CACHE_RD", + "ArchStdEvent": "L2D_CACHE_RD" }, { - "ArchStdEvent": "L2D_CACHE_WR", + "ArchStdEvent": "L2D_CACHE_WR" }, { - "ArchStdEvent": "L2D_CACHE_REFILL_RD", + "ArchStdEvent": "L2D_CACHE_REFILL_RD" }, { - "ArchStdEvent": "L2D_CACHE_REFILL_WR", + "ArchStdEvent": "L2D_CACHE_REFILL_WR" }, { - "ArchStdEvent": "L2D_CACHE_WB_VICTIM", + "ArchStdEvent": "L2D_CACHE_WB_VICTIM" }, { - "ArchStdEvent": "L2D_CACHE_WB_CLEAN", + "ArchStdEvent": "L2D_CACHE_WB_CLEAN" }, { - "ArchStdEvent": "L2D_CACHE_INVAL", + "ArchStdEvent": "L2D_CACHE_INVAL" }, { "PublicDescription": "Level 1 instruction cache prefetch access count", "EventCode": "0x102e", "EventName": "L1I_CACHE_PRF", - "BriefDescription": "L1I cache prefetch access count", + "BriefDescription": "L1I cache prefetch access count" }, { "PublicDescription": "Level 1 instruction cache miss due to prefetch access count", "EventCode": "0x102f", "EventName": "L1I_CACHE_PRF_REFILL", - "BriefDescription": "L1I cache miss due to prefetch access count", + "BriefDescription": "L1I cache miss due to prefetch access count" }, { "PublicDescription": "Instruction queue is empty", "EventCode": "0x1043", "EventName": "IQ_IS_EMPTY", - "BriefDescription": "Instruction queue is empty", + "BriefDescription": "Instruction queue is empty" }, { "PublicDescription": "Instruction fetch stall cycles", "EventCode": "0x1044", "EventName": "IF_IS_STALL", - "BriefDescription": "Instruction fetch stall cycles", + "BriefDescription": "Instruction fetch stall cycles" }, { "PublicDescription": "Instructions can receive, but not send", "EventCode": "0x2014", "EventName": "FETCH_BUBBLE", - "BriefDescription": "Instructions can receive, but not send", + "BriefDescription": "Instructions can receive, but not send" }, { "PublicDescription": "Prefetch request from LSU", "EventCode": "0x6013", "EventName": "PRF_REQ", - "BriefDescription": "Prefetch request from LSU", + "BriefDescription": "Prefetch request from LSU" }, { "PublicDescription": "Hit on prefetched data", "EventCode": "0x6014", "EventName": "HIT_ON_PRF", - "BriefDescription": "Hit on prefetched data", + "BriefDescription": "Hit on prefetched data" }, { "PublicDescription": "Cycles of that the number of issuing micro operations are less than 4", "EventCode": "0x7001", "EventName": "EXE_STALL_CYCLE", - "BriefDescription": "Cycles of that the number of issue ups are less than 4", + "BriefDescription": "Cycles of that the number of issue ups are less than 4" }, { "PublicDescription": "No any micro operation is issued and meanwhile any load operation is not resolved", "EventCode": "0x7004", "EventName": "MEM_STALL_ANYLOAD", - "BriefDescription": "No any micro operation is issued and meanwhile any load operation is not resolved", + "BriefDescription": "No any micro operation is issued and meanwhile any load operation is not resolved" }, { "PublicDescription": "No any micro operation is issued and meanwhile there is any load operation missing L1 cache and pending data refill", "EventCode": "0x7006", "EventName": "MEM_STALL_L1MISS", - "BriefDescription": "No any micro operation is issued and meanwhile there is any load operation missing L1 cache and pending data refill", + "BriefDescription": "No any micro operation is issued and meanwhile there is any load operation missing L1 cache and pending data refill" }, { "PublicDescription": "No any micro operation is issued and meanwhile there is any load operation missing both L1 and L2 cache and pending data refill from L3 cache", "EventCode": "0x7007", "EventName": "MEM_STALL_L2MISS", - "BriefDescription": "No any micro operation is issued and meanwhile there is any load operation missing both L1 and L2 cache and pending data refill from L3 cache", - }, + "BriefDescription": "No any micro operation is issued and meanwhile there is any load operation missing both L1 and L2 cache and pending data refill from L3 cache" + } ] From owner-svn-src-all@freebsd.org Wed Dec 11 22:51:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC11E1E27F2; Wed, 11 Dec 2019 22:51:02 +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 47YBx25Vt7z3FwC; Wed, 11 Dec 2019 22:51:02 +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 B81F11A58B; Wed, 11 Dec 2019 22:51:02 +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 xBBMp263062504; Wed, 11 Dec 2019 22:51:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBMp2TD062502; Wed, 11 Dec 2019 22:51:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912112251.xBBMp2TD062502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 11 Dec 2019 22:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355631 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 355631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 22:51:03 -0000 Author: imp Date: Wed Dec 11 22:51:02 2019 New Revision: 355631 URL: https://svnweb.freebsd.org/changeset/base/355631 Log: Move reset to the interrutp processing stage This trims the boot time a bit more for AWS and other platforms that have nvme drives. There's no reason too do this inline. This has been in my tree a while, but IIRC I talked to Jim Harris about this at one of our face to face meetings. MFC After: 2 weeks Modified: head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Wed Dec 11 22:09:22 2019 (r355630) +++ head/sys/dev/nvme/nvme.c Wed Dec 11 22:51:02 2019 (r355631) @@ -130,25 +130,6 @@ nvme_attach(device_t dev) int status; status = nvme_ctrlr_construct(ctrlr, dev); - - if (status != 0) { - nvme_ctrlr_destruct(ctrlr, dev); - return (status); - } - - /* - * Reset controller twice to ensure we do a transition from cc.en==1 to - * cc.en==0. This is because we don't really know what status the - * controller was left in when boot handed off to OS. Linux doesn't do - * this, however. If we adopt that policy, see also nvme_ctrlr_resume(). - */ - status = nvme_ctrlr_hw_reset(ctrlr); - if (status != 0) { - nvme_ctrlr_destruct(ctrlr, dev); - return (status); - } - - status = nvme_ctrlr_hw_reset(ctrlr); if (status != 0) { nvme_ctrlr_destruct(ctrlr, dev); return (status); Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Wed Dec 11 22:09:22 2019 (r355630) +++ head/sys/dev/nvme/nvme_ctrlr.c Wed Dec 11 22:51:02 2019 (r355631) @@ -909,6 +909,25 @@ void nvme_ctrlr_start_config_hook(void *arg) { struct nvme_controller *ctrlr = arg; + int status; + + /* + * Reset controller twice to ensure we do a transition from cc.en==1 to + * cc.en==0. This is because we don't really know what status the + * controller was left in when boot handed off to OS. Linux doesn't do + * this, however. If we adopt that policy, see also nvme_ctrlr_resume(). + */ + status = nvme_ctrlr_hw_reset(ctrlr); + if (status != 0) { + nvme_ctrlr_fail(ctrlr); + return; + } + + status = nvme_ctrlr_hw_reset(ctrlr); + if (status != 0) { + nvme_ctrlr_fail(ctrlr); + return; + } nvme_qpair_reset(&ctrlr->adminq); nvme_admin_qpair_enable(&ctrlr->adminq); From owner-svn-src-all@freebsd.org Wed Dec 11 23:09:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCE2B1E2C8E; Wed, 11 Dec 2019 23:09:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47YCL14sK8z3Gkj; Wed, 11 Dec 2019 23:09:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DB5F1A915; Wed, 11 Dec 2019 23:09:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBBN9DtI074293; Wed, 11 Dec 2019 23:09:13 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBN9DFY074291; Wed, 11 Dec 2019 23:09:13 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201912112309.xBBN9DFY074291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 11 Dec 2019 23:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355632 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 355632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 23:09:13 -0000 Author: mjg Date: Wed Dec 11 23:09:12 2019 New Revision: 355632 URL: https://svnweb.freebsd.org/changeset/base/355632 Log: fd: static-ize and devolatile openfiles Almost all access is using atomics. The only read is sysctl which should use a whole-int-at-a-time friendly read internally. Modified: head/sys/kern/kern_descrip.c head/sys/sys/file.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Dec 11 22:51:02 2019 (r355631) +++ head/sys/kern/kern_descrip.c Wed Dec 11 23:09:12 2019 (r355632) @@ -174,7 +174,7 @@ struct filedesc0 { /* * Descriptor management. */ -volatile int __exclusive_cache_line openfiles; /* actual number of open files */ +static int __exclusive_cache_line openfiles; /* actual number of open files */ struct mtx sigio_lock; /* mtx to protect pointers to sigio */ void __read_mostly (*mq_fdclose)(struct thread *td, int fd, struct file *fp); @@ -4048,7 +4048,7 @@ SYSCTL_INT(_kern, KERN_MAXFILES, maxfiles, CTLFLAG_RW, &maxfiles, 0, "Maximum number of files"); SYSCTL_INT(_kern, OID_AUTO, openfiles, CTLFLAG_RD, - __DEVOLATILE(int *, &openfiles), 0, "System-wide number of open files"); + &openfiles, 0, "System-wide number of open files"); /* ARGSUSED*/ static void Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Wed Dec 11 22:51:02 2019 (r355631) +++ head/sys/sys/file.h Wed Dec 11 23:09:12 2019 (r355632) @@ -241,7 +241,6 @@ extern struct fileops badfileops; extern struct fileops socketops; extern int maxfiles; /* kernel limit on number of open files */ extern int maxfilesperproc; /* per process limit on number of open files */ -extern volatile int openfiles; /* actual number of open files */ int fget(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp); int fget_mmap(struct thread *td, int fd, cap_rights_t *rightsp, From owner-svn-src-all@freebsd.org Wed Dec 11 23:11:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44A651E2D8D; Wed, 11 Dec 2019 23:11:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47YCNW15Z5z3H4Y; Wed, 11 Dec 2019 23:11:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20BFD1A966; Wed, 11 Dec 2019 23:11:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBBNBNYK075239; Wed, 11 Dec 2019 23:11:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBNBLvF075231; Wed, 11 Dec 2019 23:11:21 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201912112311.xBBNBLvF075231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 11 Dec 2019 23:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355633 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/tmpfs kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/tmpfs kern sys X-SVN-Commit-Revision: 355633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 23:11:23 -0000 Author: mjg Date: Wed Dec 11 23:11:21 2019 New Revision: 355633 URL: https://svnweb.freebsd.org/changeset/base/355633 Log: vfs: locking primitives which elide ->v_vnlock and shared locking disablement Both of these features are not needed by many consumers and result in avoidable reads which in turn puts them on profiles due to cache-line ping ponging. On top of that the current lockgmr entry point is slower than necessary single-threaded. As an attempted clean up preparing for other changes, provide new routines which don't support any of the aforementioned features. With these patches in place vop_stdlock and vop_stdunlock disappear from flamegraphs during -j 104 buildkernel. Reviewed by: jeff (previous version) Tested by: pho Differential Revision: https://reviews.freebsd.org/D22665 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/kern/kern_lock.c head/sys/kern/vfs_default.c head/sys/sys/lockmgr.h head/sys/sys/vnode.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Dec 11 23:09:12 2019 (r355632) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Dec 11 23:11:21 2019 (r355633) @@ -5932,7 +5932,7 @@ zfs_lock(ap) znode_t *zp; int err; - err = vop_stdlock(ap); + err = vop_lock(ap); if (err == 0 && (ap->a_flags & LK_NOWAIT) == 0) { vp = ap->a_vp; zp = vp->v_data; @@ -5989,7 +5989,11 @@ struct vop_vector zfs_vnodeops = { .vop_vptocnp = zfs_vptocnp, #ifdef DIAGNOSTIC .vop_lock1 = zfs_lock, +#else + .vop_lock1 = vop_lock, #endif + .vop_unlock = vop_unlock, + .vop_islocked = vop_islocked, }; struct vop_vector zfs_fifoops = { Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Wed Dec 11 23:09:12 2019 (r355632) +++ head/sys/fs/tmpfs/tmpfs_subr.c Wed Dec 11 23:11:21 2019 (r355633) @@ -671,7 +671,7 @@ loop: MPASS(vp != NULL); /* lkflag is ignored, the lock is exclusive */ - (void) vn_lock(vp, lkflag | LK_RETRY); + (void) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vp->v_data = node; vp->v_type = node->tn_type; Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Wed Dec 11 23:09:12 2019 (r355632) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Wed Dec 11 23:11:21 2019 (r355633) @@ -1632,6 +1632,9 @@ struct vop_vector tmpfs_vnodeop_entries = { .vop_whiteout = tmpfs_whiteout, .vop_bmap = VOP_EOPNOTSUPP, .vop_vptocnp = tmpfs_vptocnp, + .vop_lock1 = vop_lock, + .vop_unlock = vop_unlock, + .vop_islocked = vop_islocked, }; /* Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Wed Dec 11 23:09:12 2019 (r355632) +++ head/sys/kern/kern_lock.c Wed Dec 11 23:11:21 2019 (r355633) @@ -1156,6 +1156,88 @@ lockmgr_unlock_fast_path(struct lock *lk, u_int flags, return (0); } +/* + * Lightweight entry points for common operations. + * + * Functionality is similar to sx locks, in that none of the additional lockmgr + * features are supported. To be clear, these are NOT supported: + * 1. shared locking disablement + * 2. returning with an error after sleep + * 3. unlocking the interlock + * + * If in doubt, use lockmgr_*_fast_path. + */ +int +lockmgr_slock(struct lock *lk, u_int flags, const char *file, int line) +{ + uintptr_t x; + + MPASS((flags & LK_TYPE_MASK) == LK_SHARED); + MPASS((flags & LK_INTERLOCK) == 0); + MPASS((lk->lock_object.lo_flags & LK_NOSHARE) == 0); + + if (LK_CAN_WITNESS(flags)) + WITNESS_CHECKORDER(&lk->lock_object, LOP_NEWORDER, + file, line, NULL); + if (__predict_true(lockmgr_slock_try(lk, &x, flags, true))) { + lockmgr_note_shared_acquire(lk, 0, 0, file, line, flags); + return (0); + } + + return (lockmgr_slock_hard(lk, flags, NULL, file, line, NULL)); +} + +int +lockmgr_xlock(struct lock *lk, u_int flags, const char *file, int line) +{ + uintptr_t tid; + + MPASS((flags & LK_TYPE_MASK) == LK_EXCLUSIVE); + MPASS((flags & LK_INTERLOCK) == 0); + + if (LK_CAN_WITNESS(flags)) + WITNESS_CHECKORDER(&lk->lock_object, LOP_NEWORDER | + LOP_EXCLUSIVE, file, line, NULL); + tid = (uintptr_t)curthread; + if (atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, tid)) { + lockmgr_note_exclusive_acquire(lk, 0, 0, file, line, + flags); + return (0); + } + + return (lockmgr_xlock_hard(lk, flags, NULL, file, line, NULL)); +} + +int +lockmgr_unlock(struct lock *lk) +{ + uintptr_t x, tid; + const char *file; + int line; + + file = __FILE__; + line = __LINE__; + + _lockmgr_assert(lk, KA_LOCKED, file, line); + x = lk->lk_lock; + if (__predict_true(x & LK_SHARE) != 0) { + if (lockmgr_sunlock_try(lk, &x)) { + lockmgr_note_shared_release(lk, file, line); + } else { + return (lockmgr_sunlock_hard(lk, x, LK_RELEASE, NULL, file, line)); + } + } else { + tid = (uintptr_t)curthread; + if (!lockmgr_recursed(lk) && + atomic_cmpset_rel_ptr(&lk->lk_lock, tid, LK_UNLOCKED)) { + lockmgr_note_exclusive_release(lk, file, line); + } else { + return (lockmgr_xunlock_hard(lk, x, LK_RELEASE, NULL, file, line)); + } + } + return (0); +} + int __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, const char *wmesg, int pri, int timo, const char *file, int line) Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Wed Dec 11 23:09:12 2019 (r355632) +++ head/sys/kern/vfs_default.c Wed Dec 11 23:11:21 2019 (r355633) @@ -545,6 +545,71 @@ vop_stdislocked(ap) } /* + * Variants of the above set. + * + * Differences are: + * - shared locking disablement is not supported + * - v_vnlock pointer is not honored + */ +int +vop_lock(ap) + struct vop_lock1_args /* { + struct vnode *a_vp; + int a_flags; + char *file; + int line; + } */ *ap; +{ + struct vnode *vp = ap->a_vp; + int flags = ap->a_flags; + struct mtx *ilk; + + MPASS(vp->v_vnlock == &vp->v_lock); + + if (__predict_false((flags & ~(LK_TYPE_MASK | LK_NODDLKTREAT | LK_RETRY)) != 0)) + goto other; + + switch (flags & LK_TYPE_MASK) { + case LK_SHARED: + return (lockmgr_slock(&vp->v_lock, flags, ap->a_file, ap->a_line)); + case LK_EXCLUSIVE: + return (lockmgr_xlock(&vp->v_lock, flags, ap->a_file, ap->a_line)); + } +other: + ilk = VI_MTX(vp); + return (lockmgr_lock_fast_path(&vp->v_lock, flags, + &ilk->lock_object, ap->a_file, ap->a_line)); +} + +int +vop_unlock(ap) + struct vop_unlock_args /* { + struct vnode *a_vp; + int a_flags; + } */ *ap; +{ + struct vnode *vp = ap->a_vp; + + MPASS(vp->v_vnlock == &vp->v_lock); + MPASS(ap->a_flags == 0); + + return (lockmgr_unlock(&vp->v_lock)); +} + +int +vop_islocked(ap) + struct vop_islocked_args /* { + struct vnode *a_vp; + } */ *ap; +{ + struct vnode *vp = ap->a_vp; + + MPASS(vp->v_vnlock == &vp->v_lock); + + return (lockstatus(&vp->v_lock)); +} + +/* * Return true for select/poll. */ int Modified: head/sys/sys/lockmgr.h ============================================================================== --- head/sys/sys/lockmgr.h Wed Dec 11 23:09:12 2019 (r355632) +++ head/sys/sys/lockmgr.h Wed Dec 11 23:11:21 2019 (r355633) @@ -74,6 +74,10 @@ int lockmgr_lock_fast_path(struct lock *lk, u_int fla struct lock_object *ilk, const char *file, int line); int lockmgr_unlock_fast_path(struct lock *lk, u_int flags, struct lock_object *ilk); +int lockmgr_slock(struct lock *lk, u_int flags, const char *file, int line); +int lockmgr_xlock(struct lock *lk, u_int flags, const char *file, int line); +int lockmgr_unlock(struct lock *lk); + #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) void _lockmgr_assert(const struct lock *lk, int what, const char *file, int line); #endif Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed Dec 11 23:09:12 2019 (r355632) +++ head/sys/sys/vnode.h Wed Dec 11 23:11:21 2019 (r355633) @@ -761,11 +761,14 @@ int vop_stdgetwritemount(struct vop_getwritemount_args int vop_stdgetpages(struct vop_getpages_args *); int vop_stdinactive(struct vop_inactive_args *); int vop_stdneed_inactive(struct vop_need_inactive_args *); -int vop_stdislocked(struct vop_islocked_args *); int vop_stdkqfilter(struct vop_kqfilter_args *); int vop_stdlock(struct vop_lock1_args *); -int vop_stdputpages(struct vop_putpages_args *); int vop_stdunlock(struct vop_unlock_args *); +int vop_stdislocked(struct vop_islocked_args *); +int vop_lock(struct vop_lock1_args *); +int vop_unlock(struct vop_unlock_args *); +int vop_islocked(struct vop_islocked_args *); +int vop_stdputpages(struct vop_putpages_args *); int vop_nopoll(struct vop_poll_args *); int vop_stdaccess(struct vop_access_args *ap); int vop_stdaccessx(struct vop_accessx_args *ap); From owner-svn-src-all@freebsd.org Wed Dec 11 23:41:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B720D1E3675; Wed, 11 Dec 2019 23:41: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 47YD3R4RX8z3JFl; Wed, 11 Dec 2019 23:41: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 93BD41AFE2; Wed, 11 Dec 2019 23:41: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 xBBNfdns096678; Wed, 11 Dec 2019 23:41:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBNfdsE096677; Wed, 11 Dec 2019 23:41:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912112341.xBBNfdsE096677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 11 Dec 2019 23:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355634 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 355634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 23:41:39 -0000 Author: jhb Date: Wed Dec 11 23:41:39 2019 New Revision: 355634 URL: https://svnweb.freebsd.org/changeset/base/355634 Log: Emulate reads of the PCI command register for passthrough devices. VFs return zero for the memory enable bit even if it has been set by a prior write. After r348779 this caused the annoying behavior that a guest OS would unintentionally disable memory decoding on a future read-modify-write operation on the command register. Instead, return the shadow value of the command register for reads. This ensures that the guest will only toggle the state of the memory enable bit when it specifically intends to do so. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/usr.sbin/bhyve/pci_passthru.c Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Wed Dec 11 23:11:21 2019 (r355633) +++ head/usr.sbin/bhyve/pci_passthru.c Wed Dec 11 23:41:39 2019 (r355634) @@ -803,6 +803,19 @@ passthru_cfgread(struct vmctx *ctx, int vcpu, struct p } #endif + /* + * Emulate the command register. If a single read reads both the + * command and status registers, read the status register from the + * device's config space. + */ + if (coff == PCIR_COMMAND) { + if (bytes <= 2) + return (-1); + *rv = pci_get_cfgdata16(pi, PCIR_COMMAND) << 16 | + read_config(&sc->psc_sel, PCIR_STATUS, 2); + return (0); + } + /* Everything else just read from the device's config space */ *rv = read_config(&sc->psc_sel, coff, bytes); From owner-svn-src-all@freebsd.org Thu Dec 12 00:14:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EDB621E435E; Thu, 12 Dec 2019 00:14:01 +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 47YDmn5shYz3Kb6; Thu, 12 Dec 2019 00:14:01 +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 C4A601B594; Thu, 12 Dec 2019 00:14:01 +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 xBC0E1qc015487; Thu, 12 Dec 2019 00:14:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBC0E1Mc015485; Thu, 12 Dec 2019 00:14:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912120014.xBC0E1Mc015485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Dec 2019 00:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355635 - in head: . lib/libpmc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . lib/libpmc X-SVN-Commit-Revision: 355635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 00:14:02 -0000 Author: emaste Date: Thu Dec 12 00:14:01 2019 New Revision: 355635 URL: https://svnweb.freebsd.org/changeset/base/355635 Log: libpmc: build json event support also on arm64 Modified: head/Makefile.inc1 head/lib/libpmc/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Dec 11 23:41:39 2019 (r355634) +++ head/Makefile.inc1 Thu Dec 12 00:14:01 2019 (r355635) @@ -2446,7 +2446,8 @@ _libmagic=lib/libmagic .endif .if ${MK_PMC} != "no" && \ - (${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386") + (${TARGET_ARCH} == "aarch64" || ${TARGET_ARCH} == "amd64" || \ + ${TARGET_ARCH} == "i386") _jevents=lib/libpmc/pmu-events .endif Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Wed Dec 11 23:41:39 2019 (r355634) +++ head/lib/libpmc/Makefile Thu Dec 12 00:14:01 2019 (r355635) @@ -7,7 +7,8 @@ INCS= pmc.h pmclog.h pmcformat.h ALLOW_MIPS_SHARED_TEXTREL= -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \ + ${MACHINE_ARCH} == "i386" .if ${MACHINE_ARCH} == "aarch64" EVENT_ARCH="arm64" From owner-svn-src-all@freebsd.org Thu Dec 12 00:29:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E5AE1E45C9; Thu, 12 Dec 2019 00:29:49 +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 47YF706PSjz3L7g; Thu, 12 Dec 2019 00:29:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B91F11B778; Thu, 12 Dec 2019 00:29:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBC0TmLF021933; Thu, 12 Dec 2019 00:29:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBC0TmAJ021932; Thu, 12 Dec 2019 00:29:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201912120029.xBC0TmAJ021932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 12 Dec 2019 00:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355636 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 355636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 00:29:49 -0000 Author: mav Date: Thu Dec 12 00:29:48 2019 New Revision: 355636 URL: https://svnweb.freebsd.org/changeset/base/355636 Log: MFC r355182: Fix use-after-free in case of L2ARC prefetch failure. In case L2ARC read failed, l2arc_read_done() creates _different_ ZIO to read data from the original storage device. Unfortunately pointer to the failed ZIO remains in hdr->b_l1hdr.b_acb->acb_zio_head, and if some other read try to bump the ZIO priority, it will crash. The problem is reproducible by corrupting L2ARC content and reading some data with prefetch if l2arc_noprefetch tunable is changed to 0. With the default setting the issue is probably not reproducible now. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Dec 12 00:14:01 2019 (r355635) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Dec 12 00:29:48 2019 (r355636) @@ -7886,7 +7886,6 @@ l2arc_read_done(zio_t *zio) zio->io_private = hdr; arc_read_done(zio); } else { - mutex_exit(hash_lock); /* * Buffer didn't survive caching. Increment stats and * reissue to the original storage device. @@ -7909,11 +7908,17 @@ l2arc_read_done(zio_t *zio) ASSERT(!pio || pio->io_child_type == ZIO_CHILD_LOGICAL); - zio_nowait(zio_read(pio, zio->io_spa, zio->io_bp, + zio = zio_read(pio, zio->io_spa, zio->io_bp, hdr->b_l1hdr.b_pabd, zio->io_size, arc_read_done, hdr, zio->io_priority, cb->l2rcb_flags, - &cb->l2rcb_zb)); - } + &cb->l2rcb_zb); + for (struct arc_callback *acb = hdr->b_l1hdr.b_acb; + acb != NULL; acb = acb->acb_next) + acb->acb_zio_head = zio; + mutex_exit(hash_lock); + zio_nowait(zio); + } else + mutex_exit(hash_lock); } kmem_free(cb, sizeof (l2arc_read_callback_t)); From owner-svn-src-all@freebsd.org Thu Dec 12 00:30:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4641E1E4638; Thu, 12 Dec 2019 00:30:21 +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 47YF7d16lwz3LFd; Thu, 12 Dec 2019 00:30:21 +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 219A31B77C; Thu, 12 Dec 2019 00:30:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBC0ULcN022051; Thu, 12 Dec 2019 00:30:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBC0UKeh022050; Thu, 12 Dec 2019 00:30:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201912120030.xBC0UKeh022050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 12 Dec 2019 00:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355637 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 355637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 00:30:21 -0000 Author: mav Date: Thu Dec 12 00:30:20 2019 New Revision: 355637 URL: https://svnweb.freebsd.org/changeset/base/355637 Log: MFC r355182: Fix use-after-free in case of L2ARC prefetch failure. In case L2ARC read failed, l2arc_read_done() creates _different_ ZIO to read data from the original storage device. Unfortunately pointer to the failed ZIO remains in hdr->b_l1hdr.b_acb->acb_zio_head, and if some other read try to bump the ZIO priority, it will crash. The problem is reproducible by corrupting L2ARC content and reading some data with prefetch if l2arc_noprefetch tunable is changed to 0. With the default setting the issue is probably not reproducible now. Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Dec 12 00:29:48 2019 (r355636) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Dec 12 00:30:20 2019 (r355637) @@ -7476,7 +7476,6 @@ l2arc_read_done(zio_t *zio) zio->io_private = hdr; arc_read_done(zio); } else { - mutex_exit(hash_lock); /* * Buffer didn't survive caching. Increment stats and * reissue to the original storage device. @@ -7499,11 +7498,17 @@ l2arc_read_done(zio_t *zio) ASSERT(!pio || pio->io_child_type == ZIO_CHILD_LOGICAL); - zio_nowait(zio_read(pio, zio->io_spa, zio->io_bp, + zio = zio_read(pio, zio->io_spa, zio->io_bp, hdr->b_l1hdr.b_pabd, zio->io_size, arc_read_done, hdr, zio->io_priority, cb->l2rcb_flags, - &cb->l2rcb_zb)); - } + &cb->l2rcb_zb); + for (struct arc_callback *acb = hdr->b_l1hdr.b_acb; + acb != NULL; acb = acb->acb_next) + acb->acb_zio_head = zio; + mutex_exit(hash_lock); + zio_nowait(zio); + } else + mutex_exit(hash_lock); } kmem_free(cb, sizeof (l2arc_read_callback_t)); From owner-svn-src-all@freebsd.org Thu Dec 12 00:51:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A85F91E4B23; Thu, 12 Dec 2019 00:51:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47YFbc3rYJz3MFf; Thu, 12 Dec 2019 00:51:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F6571BB8E; Thu, 12 Dec 2019 00:51:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBC0p8dD034659; Thu, 12 Dec 2019 00:51:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBC0p8kO034658; Thu, 12 Dec 2019 00:51:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912120051.xBC0p8kO034658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Dec 2019 00:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355638 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 355638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 00:51:08 -0000 Author: emaste Date: Thu Dec 12 00:51:08 2019 New Revision: 355638 URL: https://svnweb.freebsd.org/changeset/base/355638 Log: ObsoleteFiles.inc: chase libpcap update in r334277 libpcap 1.9.0 (pre-release) update removed the export-defs.h header. PR: 242559 Submitted by: John Hein MFC after: 3 days Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Dec 12 00:30:20 2019 (r355637) +++ head/ObsoleteFiles.inc Thu Dec 12 00:51:08 2019 (r355638) @@ -1284,6 +1284,8 @@ OLD_FILES+=usr/share/nls/es_ES.ISO8859-1/grep.cat OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/grep.cat OLD_FILES+=usr/share/nls/uk_UA.UTF-8/grep.cat OLD_FILES+=usr/share/nls/ja_JP.UTF-8/grep.cat +# 20180528: libpcap update removed header file +OLD_FILES+=usr/include/pcap/export-defs.h # 20180517: retire vxge OLD_FILES+=usr/share/man/man4/if_vxge.4.gz OLD_FILES+=usr/share/man/man4/vxge.4.gz From owner-svn-src-all@freebsd.org Thu Dec 12 01:33:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56D921E6739; Thu, 12 Dec 2019 01:33:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47YGXp1LWlz3Q2j; Thu, 12 Dec 2019 01:33:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28F041C4C8; Thu, 12 Dec 2019 01:33:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBC1Xjxe062998; Thu, 12 Dec 2019 01:33:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBC1XjAf062997; Thu, 12 Dec 2019 01:33:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912120133.xBC1XjAf062997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 12 Dec 2019 01:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355639 - in head/usr.sbin/ntp: . scripts X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/usr.sbin/ntp: . scripts X-SVN-Commit-Revision: 355639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 01:33:46 -0000 Author: kevans Date: Thu Dec 12 01:33:45 2019 New Revision: 355639 URL: https://svnweb.freebsd.org/changeset/base/355639 Log: usr.sbin/ntp: don't emit versions w/ make -s defines ECHO=echo when not using make -s, and ECHO=true when using make -s. export ECHO for ntp products and use it in the mkver script to echo the version. This suppresses the output as appropriate. ECHO is given a default value to make sure things still work as expected for anyone that isn't redefining ECHO. Reviewed by: cy MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22101 Modified: head/usr.sbin/ntp/Makefile.inc head/usr.sbin/ntp/scripts/mkver Modified: head/usr.sbin/ntp/Makefile.inc ============================================================================== --- head/usr.sbin/ntp/Makefile.inc Thu Dec 12 00:51:08 2019 (r355638) +++ head/usr.sbin/ntp/Makefile.inc Thu Dec 12 01:33:45 2019 (r355639) @@ -16,4 +16,6 @@ CFLAGS+= -DOPENSSL -DUSE_OPENSSL_CRYPTO_RAND -DAUTOKEY WARNS?= 0 +.export ECHO + .include "../Makefile.inc" Modified: head/usr.sbin/ntp/scripts/mkver ============================================================================== --- head/usr.sbin/ntp/scripts/mkver Thu Dec 12 00:51:08 2019 (r355638) +++ head/usr.sbin/ntp/scripts/mkver Thu Dec 12 01:33:45 2019 (r355639) @@ -4,6 +4,8 @@ # PROG=${1-UNKNOWN} +: ${ECHO:=echo} + ConfStr="$PROG" ConfStr="$ConfStr 4.2.8p12" @@ -32,7 +34,7 @@ echo $RUN > .version ConfStr="$ConfStr (${RUN})" -echo "Version <${ConfStr}>"; +${ECHO} "Version <${ConfStr}>"; rm -f version.c cat > version.c << -EoF- From owner-svn-src-all@freebsd.org Thu Dec 12 01:35:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE9591E68A5; Thu, 12 Dec 2019 01:35:56 +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 47YGbJ665Gz3QCM; Thu, 12 Dec 2019 01:35:56 +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 CD0FE1C4D4; Thu, 12 Dec 2019 01:35:56 +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 xBC1Zut6063144; Thu, 12 Dec 2019 01:35:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBC1ZuNv063143; Thu, 12 Dec 2019 01:35:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912120135.xBC1ZuNv063143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 12 Dec 2019 01:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355640 - head/stand/liblua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/liblua X-SVN-Commit-Revision: 355640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 01:35:57 -0000 Author: kevans Date: Thu Dec 12 01:35:56 2019 New Revision: 355640 URL: https://svnweb.freebsd.org/changeset/base/355640 Log: stand: liblua: drop default buffer size to 128 Lua allocates LUAL_BUFFERSIZE buffers on the stack for various string functions (string.format, string.gsub) -- this works out to be somewhat significant and not necessary, based on how we use string operations. Dropping it risks having to allocate per call to format/gsub, but this is not the case for our usage. This simply stops allocating 8K buffers on the stack when luaL_Buffer is used. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22500 Modified: head/stand/liblua/luaconf.h Modified: head/stand/liblua/luaconf.h ============================================================================== --- head/stand/liblua/luaconf.h Thu Dec 12 01:33:45 2019 (r355639) +++ head/stand/liblua/luaconf.h Thu Dec 12 01:35:56 2019 (r355640) @@ -783,11 +783,7 @@ ** smaller buffer would force a memory allocation for each call to ** 'string.format'.) */ -#if LUA_FLOAT_TYPE == LUA_FLOAT_LONGDOUBLE -#define LUAL_BUFFERSIZE 8192 -#else -#define LUAL_BUFFERSIZE ((int)(0x80 * sizeof(void*) * sizeof(lua_Integer))) -#endif +#define LUAL_BUFFERSIZE 128 /* }================================================================== */ From owner-svn-src-all@freebsd.org Thu Dec 12 01:41:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE34D1E6CC4; Thu, 12 Dec 2019 01:41:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47YGkF4FXfz3QdR; Thu, 12 Dec 2019 01:41:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72FC31C56C; Thu, 12 Dec 2019 01:41:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBC1fvHM067815; Thu, 12 Dec 2019 01:41:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBC1ftSj067807; Thu, 12 Dec 2019 01:41:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912120141.xBC1ftSj067807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 12 Dec 2019 01:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355641 - in head: include lib/libc/gen lib/libc/tests/gen X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: include lib/libc/gen lib/libc/tests/gen X-SVN-Commit-Revision: 355641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 01:41:57 -0000 Author: kevans Date: Thu Dec 12 01:41:55 2019 New Revision: 355641 URL: https://svnweb.freebsd.org/changeset/base/355641 Log: Add sigsetop extensions commonly found in musl libc and glibc These functions (sigandset, sigisemptyset, sigorset) are commonly available in at least musl libc and glibc; sigorset, at least, has proven quite useful in qemu-bsd-user work for tracking the current process signal mask in a more self-documenting/aesthetically pleasing manner. Reviewed by: bapt, jilles, pfg MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22187 Added: head/lib/libc/tests/gen/sigsetops_test.c (contents, props changed) Modified: head/include/signal.h head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libc/gen/sigsetops.3 head/lib/libc/gen/sigsetops.c head/lib/libc/tests/gen/Makefile Modified: head/include/signal.h ============================================================================== --- head/include/signal.h Thu Dec 12 01:35:56 2019 (r355640) +++ head/include/signal.h Thu Dec 12 01:41:55 2019 (r355641) @@ -122,7 +122,10 @@ void psignal(int, const char *); #endif #if __BSD_VISIBLE +int sigandset(sigset_t *dest, const sigset_t *left, const sigset_t *right); int sigblock(int); +int sigisemptyset(const sigset_t *set); +int sigorset(sigset_t *dest, const sigset_t *left, const sigset_t *right); int sigreturn(const struct __ucontext *); int sigsetmask(int); int sigstack(const struct sigstack *, struct sigstack *); Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Thu Dec 12 01:35:56 2019 (r355640) +++ head/lib/libc/gen/Makefile.inc Thu Dec 12 01:41:55 2019 (r355641) @@ -497,10 +497,13 @@ MLINKS+=setjmp.3 _longjmp.3 \ MLINKS+=setmode.3 getmode.3 MLINKS+=setproctitle.3 setproctitle_fast.3 MLINKS+=sigsetops.3 sigaddset.3 \ + sigsetops.3 sigandset.3 \ sigsetops.3 sigdelset.3 \ sigsetops.3 sigemptyset.3 \ sigsetops.3 sigfillset.3 \ - sigsetops.3 sigismember.3 + sigsetops.3 sigisemptyset.3 \ + sigsetops.3 sigismember.3 \ + sigsetops.3 sigorset.3 MLINKS+=statvfs.3 fstatvfs.3 MLINKS+=stringlist.3 sl_add.3 \ stringlist.3 sl_find.3 \ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Thu Dec 12 01:35:56 2019 (r355640) +++ head/lib/libc/gen/Symbol.map Thu Dec 12 01:41:55 2019 (r355641) @@ -422,6 +422,12 @@ FBSD_1.5 { timespec_get; }; +FBSD_1.6 { + sigandset; + sigisemptyset; + sigorset; +}; + FBSDprivate_1.0 { /* needed by thread libraries */ __thr_jtable; Modified: head/lib/libc/gen/sigsetops.3 ============================================================================== --- head/lib/libc/gen/sigsetops.3 Thu Dec 12 01:35:56 2019 (r355640) +++ head/lib/libc/gen/sigsetops.3 Thu Dec 12 01:41:55 2019 (r355641) @@ -28,15 +28,18 @@ .\" @(#)sigsetops.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 16, 2004 +.Dd October 29, 2019 .Dt SIGSETOPS 3 .Os .Sh NAME .Nm sigemptyset , .Nm sigfillset , .Nm sigaddset , +.Nm sigandset , .Nm sigdelset , -.Nm sigismember +.Nm sigisemptyset , +.Nm sigismember , +.Nm sigorset .Nd manipulate signal sets .Sh LIBRARY .Lb libc @@ -49,9 +52,15 @@ .Ft int .Fn sigaddset "sigset_t *set" "int signo" .Ft int +.Fn sigandset "sigset_t *set" "const sigset_t *left" "const sigset_t *right" +.Ft int .Fn sigdelset "sigset_t *set" "int signo" .Ft int +.Fn sigisemptyset "const sigset_t *set" +.Ft int .Fn sigismember "const sigset_t *set" "int signo" +.Ft int +.Fn sigorset "sigset_t *set" "const sigset_t *left" "const sigset_t *right" .Sh DESCRIPTION These functions manipulate signal sets stored in a .Fa sigset_t . @@ -78,22 +87,54 @@ function adds the specified signal to the signal set. .Pp The +.Fn sigandset +function sets the specified +.Fa set +to the logical AND of all signals from the +.Fa left +and +.Fa right +signal sets. +.Pp +The .Fn sigdelset function deletes the specified signal .Fa signo from the signal set. .Pp The +.Fn sigisemptyset +function returns whether the specified +.Fa set +is empty or not. +.Pp +The .Fn sigismember function returns whether a specified signal .Fa signo is contained in the signal set. +.Pp +The +.Fn sigorset +function sets the specified +.Fa set +to the logical OR of all signals from the +.Fa left +and +.Fa right +signal sets. .Sh RETURN VALUES The +.Fn sigisemptyset +function returns 1 +if the set is empty, 0 otherwise. +.Pp +The .Fn sigismember function returns 1 if the signal is a member of the set, 0 otherwise. +.Pp The other functions return 0 upon success. A \-1 return value indicates an error occurred and the global variable @@ -113,5 +154,13 @@ has an invalid value. .Xr sigprocmask 2 , .Xr sigsuspend 2 .Sh STANDARDS -These functions are defined by +The +.Fn sigandset , +.Fn sigisemptyset , +and +.Fn sigorset +functions are FreeBSD extensions, compatible with functions of the same name +provided by both musl libc and GNU libc. +.Pp +The rest of these functions are defined by .St -p1003.1-88 . Modified: head/lib/libc/gen/sigsetops.c ============================================================================== --- head/lib/libc/gen/sigsetops.c Thu Dec 12 01:35:56 2019 (r355640) +++ head/lib/libc/gen/sigsetops.c Thu Dec 12 01:41:55 2019 (r355641) @@ -81,6 +81,37 @@ sigfillset(sigset_t *set) } int +sigorset(sigset_t *dest, const sigset_t *left, const sigset_t *right) +{ + int i; + + for (i = 0; i < _SIG_WORDS; i++) + dest->__bits[i] = left->__bits[i] | right->__bits[i]; + return (0); +} + +int +sigandset(sigset_t *dest, const sigset_t *left, const sigset_t *right) +{ + int i; + + for (i = 0; i < _SIG_WORDS; i++) + dest->__bits[i] = left->__bits[i] & right->__bits[i]; + return (0); +} + +int +sigisemptyset(const sigset_t *set) +{ + int i; + + for (i = 0; i < _SIG_WORDS; i++) + if (set->__bits[i] != 0) + return (0); + return (1); +} + +int sigismember(const sigset_t *set, int signo) { Modified: head/lib/libc/tests/gen/Makefile ============================================================================== --- head/lib/libc/tests/gen/Makefile Thu Dec 12 01:35:56 2019 (r355640) +++ head/lib/libc/tests/gen/Makefile Thu Dec 12 01:41:55 2019 (r355641) @@ -17,6 +17,7 @@ ATF_TESTS_C+= makecontext_test ATF_TESTS_C+= popen_test ATF_TESTS_C+= posix_spawn_test ATF_TESTS_C+= realpath2_test +ATF_TESTS_C+= sigsetops_test ATF_TESTS_C+= wordexp_test # TODO: t_closefrom, t_cpuset, t_fmtcheck, t_randomid, Added: head/lib/libc/tests/gen/sigsetops_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/gen/sigsetops_test.c Thu Dec 12 01:41:55 2019 (r355641) @@ -0,0 +1,191 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Kyle Evans + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +/* Return the status of the specified sig's bit. */ +static bool +sigbitstatus(const sigset_t *set, int sig) +{ + + return (set->__bits[_SIG_WORD(sig)] & _SIG_BIT(sig)) != 0; +} + +/* Verify that sig is the lone bit set in the sigset. */ +static void +siglonebit(const sigset_t *set, int sig) +{ + int i; + + for (i = 0; i < _SIG_WORDS; ++i) { + if (i != _SIG_WORD(sig)) + ATF_REQUIRE_MSG(set->__bits[i] == 0, + "word %d altered to %x", i, set->__bits[i]); + else + ATF_REQUIRE_MSG((set->__bits[i] & ~_SIG_BIT(sig)) == 0, + "word %d has other bits set: %x", i, + set->__bits[i] & ~_SIG_BIT(sig)); + } +} + +static void +sigcompare(const sigset_t *left, const sigset_t *right) +{ + int i; + + for (i = 0; i < _SIG_WORDS; ++i) { + ATF_REQUIRE_MSG(left->__bits[i] == right->__bits[i], + "sig comparison failed at %d; left=%x, right=%x", + i, left->__bits[i], right->__bits[i]); + } +} + +/* + * Test implementation details of our sigsetops... make sure the correct bits + * are getting set, for the most part, and that duplicate operations don't + * error out. + */ +ATF_TC_WITHOUT_HEAD(posix_sigsetop_test); +ATF_TC_BODY(posix_sigsetop_test, tc) +{ + sigset_t set; + int i; + + ATF_REQUIRE(sigfillset(&set) == 0); + for (i = 0; i < _SIG_WORDS; ++i) { + ATF_REQUIRE_MSG(set.__bits[i] == ~0U, "sigfillset failed @ %d", + i); + } + ATF_REQUIRE(sigemptyset(&set) == 0); + for (i = 0; i < _SIG_WORDS; ++i) { + ATF_REQUIRE_MSG(set.__bits[i] == 0, "sigemptyset failed @ %d", + i); + } + /* Ensure that sigismember reflects the empty set status. */ + for (i = 1; i < NSIG; ++i) { + ATF_REQUIRE(sigismember(&set, i) == 0); + } + + ATF_REQUIRE(sigaddset(&set, -1) == -1 && errno == EINVAL); + ATF_REQUIRE(sigaddset(&set, _SIG_MAXSIG + 1) == -1 && errno == EINVAL); + ATF_REQUIRE(sigdelset(&set, -1) == -1 && errno == EINVAL); + ATF_REQUIRE(sigdelset(&set, _SIG_MAXSIG + 1) == -1 && errno == EINVAL); + + ATF_REQUIRE(sigaddset(&set, SIGSEGV) == 0); + ATF_REQUIRE(sigismember(&set, SIGSEGV) != 0); + ATF_REQUIRE_MSG(sigbitstatus(&set, SIGSEGV), "sigaddset failure"); + siglonebit(&set, SIGSEGV); + + /* + * A second addition should succeed without altering the state. This + * should be trivially true. + */ + ATF_REQUIRE(sigaddset(&set, SIGSEGV) == 0); + ATF_REQUIRE_MSG(sigbitstatus(&set, SIGSEGV), + "sigaddset twice changed bit"); + + ATF_REQUIRE(sigdelset(&set, SIGSEGV) == 0); + ATF_REQUIRE_MSG(!sigbitstatus(&set, SIGSEGV), "sigdelset failure"); + ATF_REQUIRE(sigismember(&set, SIGSEGV) == 0); + ATF_REQUIRE(sigdelset(&set, SIGSEGV) == 0); + ATF_REQUIRE_MSG(!sigbitstatus(&set, SIGSEGV), + "sigdelset twice changed bit"); + for (i = 0; i < _SIG_WORDS; ++i) { + ATF_REQUIRE_MSG(set.__bits[i] == 0, "set not empty @ %d", + i); + } + for (i = 1; i < NSIG; ++i) { + ATF_REQUIRE(sigismember(&set, i) == 0); + } +} + +/* + * Test extended sigset ops for union/intersection and testing of empty set. + */ +ATF_TC_WITHOUT_HEAD(extended_sigsetop_test); +ATF_TC_BODY(extended_sigsetop_test, tc) +{ + sigset_t chkset, set1, set2, set3; + + sigemptyset(&chkset); + sigemptyset(&set1); + sigemptyset(&set2); + ATF_REQUIRE(sigisemptyset(&chkset) != 0); + sigaddset(&set1, SIGSEGV); + sigaddset(&set2, SIGKILL); + sigaddset(&chkset, SIGSEGV); + ATF_REQUIRE(sigisemptyset(&chkset) == 0); + sigaddset(&chkset, SIGKILL); + ATF_REQUIRE(sigorset(&set3, &set1, &set2) == 0); + ATF_REQUIRE(sigbitstatus(&set3, SIGSEGV)); + ATF_REQUIRE(sigbitstatus(&set3, SIGKILL)); + + /* + * chkset was built with our POSIX-specified set operations that we've + * already tested, so it's a good comparison. + */ + sigcompare(&chkset, &set3); + /* + * Clear chkset; make sure sigisemptyset() still looks ok. sigaddset + * and sigdelset have already been tested to make sure that they're not + * touching other bits. + */ + sigdelset(&chkset, SIGSEGV); + sigdelset(&chkset, SIGKILL); + ATF_REQUIRE(sigisemptyset(&chkset) != 0); + ATF_REQUIRE(sigandset(&set3, &set1, &set2) == 0); + /* Make sure we clobbered these. */ + ATF_REQUIRE(!sigbitstatus(&set3, SIGSEGV)); + ATF_REQUIRE(!sigbitstatus(&set3, SIGKILL)); + ATF_REQUIRE(sigisemptyset(&set3) != 0); + /* Rebuild for sigandset test */ + sigemptyset(&set1); + sigemptyset(&set2); + sigaddset(&set1, SIGSEGV); + sigaddset(&set1, SIGKILL); + sigaddset(&set2, SIGSEGV); + ATF_REQUIRE(sigandset(&set3, &set1, &set2) == 0); + ATF_REQUIRE(sigbitstatus(&set3, SIGSEGV)); + ATF_REQUIRE(!sigbitstatus(&set3, SIGKILL)); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, posix_sigsetop_test); + ATF_TP_ADD_TC(tp, extended_sigsetop_test); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Thu Dec 12 02:18:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E142F1E8221; Thu, 12 Dec 2019 02:18:18 +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 47YHXB5f7Rz3xgM; Thu, 12 Dec 2019 02:18:18 +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 BCDE61CC97; Thu, 12 Dec 2019 02:18:18 +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 xBC2IIHC086549; Thu, 12 Dec 2019 02:18:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBC2IIem086548; Thu, 12 Dec 2019 02:18:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912120218.xBC2IIem086548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Dec 2019 02:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355642 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 355642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 02:18:18 -0000 Author: emaste Date: Thu Dec 12 02:18:18 2019 New Revision: 355642 URL: https://svnweb.freebsd.org/changeset/base/355642 Log: ObsoleteFiles.inc: remove stale comment A comment at the top of the file claimed that the file was grouped into OLD_FILES, OLD_LIBS, then OLD_DIRS, but that hasn't been the case since the mid-2000s. Delete the stale comment, add a new comment for the historical split entries, and move the one more recent entry (from 2013) to group it into a single logical change. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Dec 12 01:41:55 2019 (r355641) +++ head/ObsoleteFiles.inc Thu Dec 12 02:18:18 2019 (r355642) @@ -11,8 +11,6 @@ # In case of a complete directory hierarchy the sorting is in depth first # order. # -# The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. -# # Before you commit changes to this file please check if any entries in # tools/build/mk/OptionalObsoleteFiles.inc can be removed. The following # command tells which files are listed more than once regardless of some @@ -5195,6 +5193,12 @@ OLD_FILES+=usr/share/man/man1/atf-version.1.gz OLD_FILES+=usr/share/man/man5/atf-formats.5.gz OLD_FILES+=usr/share/xml/atf/tests-results.dtd OLD_FILES+=usr/share/xsl/atf/tests-results.xsl +OLD_DIRS+=etc/atf +OLD_DIRS+=usr/share/examples/atf +OLD_DIRS+=usr/share/xml/atf +OLD_DIRS+=usr/share/xml +OLD_DIRS+=usr/share/xsl/atf +OLD_DIRS+=usr/share/xsl # 20131009: freebsd-version moved from /libexec to /bin OLD_FILES+=libexec/freebsd-version # 20131001: ar and ranlib from binutils not used @@ -11133,6 +11137,9 @@ OLD_FILES+=usr/libdata/msdosfs/koi8u2dos # - usr/share/tmac/mm/se_locale # - var/yp/Makefile +# Early entries split OLD_FILES, OLD_LIBS, and OLD_DIRS into separate sections +# in this file, but this practice was abandoned in the mid-2000s. +# # 20071120: shared library version bump OLD_LIBS+=usr/lib/libasn1.so.8 OLD_LIBS+=usr/lib/libgssapi.so.8 @@ -11413,13 +11420,6 @@ OLD_LIBS+=usr/lib/libkse.so.1 OLD_LIBS+=usr/lib/liblwres.so.3 OLD_LIBS+=usr/lib/pam_ftp.so.2 -# 20131013: Removal of the ATF tools -OLD_DIRS+=etc/atf -OLD_DIRS+=usr/share/examples/atf -OLD_DIRS+=usr/share/xml/atf -OLD_DIRS+=usr/share/xml -OLD_DIRS+=usr/share/xsl/atf -OLD_DIRS+=usr/share/xsl # 20040925: bind9 import OLD_DIRS+=usr/share/doc/bind/html OLD_DIRS+=usr/share/doc/bind/misc From owner-svn-src-all@freebsd.org Thu Dec 12 02:42:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D34C21E8E11; Thu, 12 Dec 2019 02:42:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47YJ435F4pz3yxC; Thu, 12 Dec 2019 02:42:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF1611D1EA; Thu, 12 Dec 2019 02:42:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBC2gR5X003976; Thu, 12 Dec 2019 02:42:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBC2gRlm003975; Thu, 12 Dec 2019 02:42:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912120242.xBC2gRlm003975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 12 Dec 2019 02:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355643 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 355643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 02:42:27 -0000 Author: kevans Date: Thu Dec 12 02:42:27 2019 New Revision: 355643 URL: https://svnweb.freebsd.org/changeset/base/355643 Log: Bump __FreeBSD_version for r355641, new sig set ops This will be needed to unbreak qemu-user-static. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Dec 12 02:18:18 2019 (r355642) +++ head/sys/sys/param.h Thu Dec 12 02:42:27 2019 (r355643) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300064 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300065 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Thu Dec 12 02:43:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CFB11E8E86; Thu, 12 Dec 2019 02:43:25 +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 47YJ591qTbz4054; Thu, 12 Dec 2019 02:43:25 +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 399361D1FA; Thu, 12 Dec 2019 02:43:25 +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 xBC2hPx7004057; Thu, 12 Dec 2019 02:43:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBC2hPs6004056; Thu, 12 Dec 2019 02:43:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912120243.xBC2hPs6004056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 12 Dec 2019 02:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355644 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 02:43:25 -0000 Author: markj Date: Thu Dec 12 02:43:24 2019 New Revision: 355644 URL: https://svnweb.freebsd.org/changeset/base/355644 Log: Rename tdq_ipipending and clear it in sched_switch(). This fixes a regression after r355311. Specifically, sched_preempt() may trigger a context switch by calling thread_lock(), since thread_lock() calls critical_exit() in its slow path and the interrupted thread may have already been marked for preemption. This would happen before tdq_ipipending is cleared, blocking further preemption IPIs. The CPU can be left in this state indefinitely if the interrupted thread migrates. Rename tdq_ipipending to tdq_owepreempt. Any switch satisfies a remote preemption request, so clear tdq_owepreempt in sched_switch() instead of sched_preempt() to avoid subtle problems of the sort described above. Reviewed by: jeff, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22758 Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Thu Dec 12 02:42:27 2019 (r355643) +++ head/sys/kern/sched_ule.c Thu Dec 12 02:43:24 2019 (r355644) @@ -244,7 +244,7 @@ struct tdq { volatile short tdq_switchcnt; /* Switches this tick. */ volatile short tdq_oldswitchcnt; /* Switches last tick. */ u_char tdq_lowpri; /* Lowest priority thread. */ - u_char tdq_ipipending; /* IPI pending. */ + u_char tdq_owepreempt; /* Remote preemption pending. */ u_char tdq_idx; /* Current insert index. */ u_char tdq_ridx; /* Current removal index. */ int tdq_id; /* cpuid. */ @@ -1073,7 +1073,7 @@ tdq_notify(struct tdq *tdq, struct thread *td) int pri; int cpu; - if (tdq->tdq_ipipending) + if (tdq->tdq_owepreempt) return; cpu = td_get_sched(td)->ts_cpu; pri = td->td_priority; @@ -1096,7 +1096,12 @@ tdq_notify(struct tdq *tdq, struct thread *td) if (!tdq->tdq_cpu_idle || cpu_idle_wakeup(cpu)) return; } - tdq->tdq_ipipending = 1; + + /* + * The run queues have been updated, so any switch on the remote CPU + * will satisfy the preemption request. + */ + tdq->tdq_owepreempt = 1; ipi_cpu(cpu, IPI_PREEMPT); } @@ -2079,8 +2084,10 @@ sched_switch(struct thread *td, struct thread *newtd, (flags & SW_PREEMPT) != 0; td->td_flags &= ~(TDF_NEEDRESCHED | TDF_SLICEEND); td->td_owepreempt = 0; + tdq->tdq_owepreempt = 0; if (!TD_IS_IDLETHREAD(td)) tdq->tdq_switchcnt++; + /* * The lock pointer in an idle thread should never change. Reset it * to CAN_RUN as well. @@ -2386,7 +2393,6 @@ sched_preempt(struct thread *td) thread_lock(td); tdq = TDQ_SELF(); TDQ_LOCK_ASSERT(tdq, MA_OWNED); - tdq->tdq_ipipending = 0; if (td->td_priority > tdq->tdq_lowpri) { int flags; @@ -2397,6 +2403,8 @@ sched_preempt(struct thread *td) mi_switch(flags | SWT_REMOTEWAKEIDLE, NULL); else mi_switch(flags | SWT_REMOTEPREEMPT, NULL); + } else { + tdq->tdq_owepreempt = 0; } thread_unlock(td); } From owner-svn-src-all@freebsd.org Thu Dec 12 04:44:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CA401EB933; Thu, 12 Dec 2019 04:44:09 +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 47YLmT3gT2z451m; Thu, 12 Dec 2019 04:44:09 +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 793B11E867; Thu, 12 Dec 2019 04:44:09 +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 xBC4i9hZ074617; Thu, 12 Dec 2019 04:44:09 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBC4i9QF074616; Thu, 12 Dec 2019 04:44:09 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912120444.xBC4i9QF074616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 12 Dec 2019 04:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355645 - head/contrib/libunwind/src X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/contrib/libunwind/src X-SVN-Commit-Revision: 355645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 04:44:09 -0000 Author: cem Date: Thu Dec 12 04:44:09 2019 New Revision: 355645 URL: https://svnweb.freebsd.org/changeset/base/355645 Log: arm: libgcc_s: Fix ABI breakage introduced in r354347 Provide the symbol version for llvm-libunwind's _Unwind_Backtrace that libgcc has historically provided on arm, in addition to the (default) standard version used on all other arch. Reported by: mmel Modified: head/contrib/libunwind/src/UnwindLevel1-gcc-ext.c Modified: head/contrib/libunwind/src/UnwindLevel1-gcc-ext.c ============================================================================== --- head/contrib/libunwind/src/UnwindLevel1-gcc-ext.c Thu Dec 12 02:43:24 2019 (r355644) +++ head/contrib/libunwind/src/UnwindLevel1-gcc-ext.c Thu Dec 12 04:44:09 2019 (r355645) @@ -181,6 +181,10 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref } } } +#ifdef __arm__ +/* Preserve legacy libgcc ARM ABI mistake. */ +__sym_compat(_Unwind_Backtrace, _Unwind_Backtrace, GCC_4.3.0); +#endif /// Find DWARF unwind info for an address 'pc' in some function. From owner-svn-src-all@freebsd.org Thu Dec 12 04:47:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74F591EBA05; Thu, 12 Dec 2019 04:47:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47YLqq2VnXz4597; Thu, 12 Dec 2019 04:47:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CC631E86A; Thu, 12 Dec 2019 04:47:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBC4l3LN074791; Thu, 12 Dec 2019 04:47:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBC4l3mr074790; Thu, 12 Dec 2019 04:47:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912120447.xBC4l3mr074790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 12 Dec 2019 04:47:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355646 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 355646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 04:47:03 -0000 Author: cem Date: Thu Dec 12 04:47:02 2019 New Revision: 355646 URL: https://svnweb.freebsd.org/changeset/base/355646 Log: Revert r354348 Switch ARM32 default libunwind back to old GPL2 libgcc version. Reportedly, the llvm-libunwind code is nonfunctional. Requested by: mmel Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Dec 12 04:44:09 2019 (r355645) +++ head/share/mk/src.opts.mk Thu Dec 12 04:47:02 2019 (r355646) @@ -327,9 +327,8 @@ BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BO .if ${__T:Mriscv*} != "" BROKEN_OPTIONS+=OFED .endif -.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "armv6" || \ - ${__T} == "armv7" || ${__T} == "i386" || ${__T:Mriscv*} != "" || \ - ${__TT} == "mips" +.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ + ${__T:Mriscv*} != "" || ${__TT} == "mips" __DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND .else __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND From owner-svn-src-all@freebsd.org Thu Dec 12 05:11:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B7691EC46A; Thu, 12 Dec 2019 05:11:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47YMNV1RdCz46nQ; Thu, 12 Dec 2019 05:11:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CAA01ED8E; Thu, 12 Dec 2019 05:11:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBC5BsE2088564; Thu, 12 Dec 2019 05:11:54 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBC5Br4l088563; Thu, 12 Dec 2019 05:11:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201912120511.xBC5Br4l088563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 12 Dec 2019 05:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355647 - head/usr.bin/showmount X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/showmount X-SVN-Commit-Revision: 355647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 05:11:54 -0000 Author: eadler Date: Thu Dec 12 05:11:53 2019 New Revision: 355647 URL: https://svnweb.freebsd.org/changeset/base/355647 Log: [showmount] implement long options add long options support to showmount. Where mappings exist use the GNU names for said options. Differential Revision: https://reviews.freebsd.org/D22543 Reviewed by: kevans (earlier version) Modified: head/usr.bin/showmount/showmount.8 head/usr.bin/showmount/showmount.c Modified: head/usr.bin/showmount/showmount.8 ============================================================================== --- head/usr.bin/showmount/showmount.8 Thu Dec 12 04:47:02 2019 (r355646) +++ head/usr.bin/showmount/showmount.8 Thu Dec 12 05:11:53 2019 (r355647) @@ -67,20 +67,20 @@ for a detailed description of the protocol. .Pp The following options are available: .Bl -tag -width indent -.It Fl a +.It Fl a , Fl -all List all mount points in the form: .Bd -ragged -offset indent -compact .Ar host : Ns Ar dirpath . .Ed -.It Fl d +.It Fl d , Fl -directories List directory paths of mount points instead of hosts. -.It Fl E +.It Fl E , Fl -exports-script Show the .Ar host Ns 's exports list in a script-friendly format. Client addresses and the header are not shown, and special characters are escaped. -.It Fl e +.It Fl e , Fl -exports Show the .Ar host Ns 's exports list. Modified: head/usr.bin/showmount/showmount.c ============================================================================== --- head/usr.bin/showmount/showmount.c Thu Dec 12 04:47:02 2019 (r355646) +++ head/usr.bin/showmount/showmount.c Thu Dec 12 05:11:53 2019 (r355647) @@ -53,6 +53,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -102,6 +103,14 @@ int xdr_exportslist(XDR *, struct exportslist **); int tcp_callrpc(const char *host, int prognum, int versnum, int procnum, xdrproc_t inproc, char *in, xdrproc_t outproc, char *out); +static const struct option long_opts[] = { + { "all", no_argument, NULL, 'a' }, + { "directories", no_argument, NULL, 'd' }, + { "exports-script", no_argument, NULL, 'E' }, + { "exports", no_argument, NULL, 'e' }, + { NULL, 0, NULL, 0 }, +}; + /* * This command queries the NFS mount daemon for it's mount list and/or * it's exports list and prints them out. @@ -119,7 +128,7 @@ main(int argc, char **argv) const char *host; int ch, estat, nbytes; - while ((ch = getopt(argc, argv, "adEe13")) != -1) + while ((ch = getopt_long(argc, argv, "+adEe13", long_opts, NULL)) != -1) switch (ch) { case 'a': if (type == 0) { From owner-svn-src-all@freebsd.org Thu Dec 12 13:02:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A27841D0CCA; Thu, 12 Dec 2019 13:02:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47YYqL3w3Xz4W6D; Thu, 12 Dec 2019 13:02:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8185724250; Thu, 12 Dec 2019 13:02:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBCD2MBM062286; Thu, 12 Dec 2019 13:02:22 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCD2MVA062285; Thu, 12 Dec 2019 13:02:22 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201912121302.xBCD2MVA062285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 12 Dec 2019 13:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355648 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 355648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 13:02:22 -0000 Author: manu Date: Thu Dec 12 13:02:22 2019 New Revision: 355648 URL: https://svnweb.freebsd.org/changeset/base/355648 Log: arm64: rockchip: rk_pinctrl: Add bias parsing based on the SoC type Not all rockchip have the same value for pullup/pulldown so add a function per SoC and call the right one to have the proper value. MFC after: 3 days Modified: head/sys/arm64/rockchip/rk_pinctrl.c Modified: head/sys/arm64/rockchip/rk_pinctrl.c ============================================================================== --- head/sys/arm64/rockchip/rk_pinctrl.c Thu Dec 12 05:11:53 2019 (r355647) +++ head/sys/arm64/rockchip/rk_pinctrl.c Thu Dec 12 13:02:22 2019 (r355648) @@ -100,6 +100,7 @@ struct rk_pinctrl_conf { uint32_t ngpio_bank; uint32_t (*get_pd_offset)(struct rk_pinctrl_softc *, uint32_t); struct syscon *(*get_syscon)(struct rk_pinctrl_softc *, uint32_t); + int (*parse_bias)(phandle_t node); }; struct rk_pinctrl_softc { @@ -370,6 +371,19 @@ rk3288_get_syscon(struct rk_pinctrl_softc *sc, uint32_ return (sc->grf); } +static int +rk3288_parse_bias(phandle_t node) +{ + if (OF_hasprop(node, "bias-disable")) + return (0); + if (OF_hasprop(node, "bias-pull-up")) + return (1); + if (OF_hasprop(node, "bias-pull-down")) + return (2); + + return (-1); +} + struct rk_pinctrl_conf rk3288_conf = { .iomux_conf = rk3288_iomux_bank, .iomux_nbanks = nitems(rk3288_iomux_bank), @@ -381,6 +395,7 @@ struct rk_pinctrl_conf rk3288_conf = { .ngpio_bank = nitems(rk3288_gpio_bank), .get_pd_offset = rk3288_get_pd_offset, .get_syscon = rk3288_get_syscon, + .parse_bias = rk3288_parse_bias, }; static struct rk_pinctrl_gpio rk3328_gpio_bank[] = { @@ -524,6 +539,7 @@ struct rk_pinctrl_conf rk3328_conf = { .ngpio_bank = nitems(rk3328_gpio_bank), .get_pd_offset = rk3328_get_pd_offset, .get_syscon = rk3328_get_syscon, + .parse_bias = rk3288_parse_bias, }; static struct rk_pinctrl_gpio rk3399_gpio_bank[] = { @@ -611,12 +627,28 @@ rk3399_get_pd_offset(struct rk_pinctrl_softc *sc, uint static struct syscon * rk3399_get_syscon(struct rk_pinctrl_softc *sc, uint32_t bank) { - if (bank < 2) + if (bank < 2) { + device_printf(sc->dev, "%s: Using PMU GRF\n", __func__); return (sc->pmu); + } + device_printf(sc->dev, "%s: Using GRF\n", __func__); return (sc->grf); } +static int +rk3399_parse_bias(phandle_t node) +{ + if (OF_hasprop(node, "bias-disable")) + return (0); + if (OF_hasprop(node, "bias-pull-up")) + return (3); + if (OF_hasprop(node, "bias-pull-down")) + return (1); + + return (-1); +} + struct rk_pinctrl_conf rk3399_conf = { .iomux_conf = rk3399_iomux_bank, .iomux_nbanks = nitems(rk3399_iomux_bank), @@ -628,6 +660,7 @@ struct rk_pinctrl_conf rk3399_conf = { .ngpio_bank = nitems(rk3399_gpio_bank), .get_pd_offset = rk3399_get_pd_offset, .get_syscon = rk3399_get_syscon, + .parse_bias = rk3399_parse_bias, }; static struct ofw_compat_data compat_data[] = { @@ -638,19 +671,6 @@ static struct ofw_compat_data compat_data[] = { }; static int -rk_pinctrl_parse_bias(phandle_t node) -{ - if (OF_hasprop(node, "bias-disable")) - return (0); - if (OF_hasprop(node, "bias-pull-up")) - return (1); - if (OF_hasprop(node, "bias-pull-down")) - return (2); - - return (-1); -} - -static int rk_pinctrl_parse_drive(struct rk_pinctrl_softc *sc, phandle_t node, uint32_t bank, uint32_t subbank, uint32_t *drive, uint32_t *offset) { @@ -842,7 +862,7 @@ rk_pinctrl_configure_pin(struct rk_pinctrl_softc *sc, SYSCON_MODIFY_4(syscon, reg, mask, function << bit | (mask << 16)); /* Pull-Up/Down */ - bias = rk_pinctrl_parse_bias(pin_conf); + bias = sc->conf->parse_bias(pin_conf); if (bias >= 0) { reg = sc->conf->get_pd_offset(sc, bank); From owner-svn-src-all@freebsd.org Thu Dec 12 13:21:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F9B71D138A; Thu, 12 Dec 2019 13:21:44 +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 47YZFh1wpHz4X4X; Thu, 12 Dec 2019 13:21:44 +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 23957245B4; Thu, 12 Dec 2019 13:21:44 +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 xBCDLi8x072765; Thu, 12 Dec 2019 13:21:44 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCDLiPi072764; Thu, 12 Dec 2019 13:21:44 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201912121321.xBCDLiPi072764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 12 Dec 2019 13:21:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355649 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 355649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 13:21:44 -0000 Author: manu Date: Thu Dec 12 13:21:43 2019 New Revision: 355649 URL: https://svnweb.freebsd.org/changeset/base/355649 Log: arm64: rockchip: rk_pinctrl: Fix parse_bias for RK3399 Only bank 0 and bank 2 are different than other rockchip SoC, fix this. While here remove some debug printfs that where added in r355648 MFC after: 3 days X-MFC-With: r355648 Modified: head/sys/arm64/rockchip/rk_pinctrl.c Modified: head/sys/arm64/rockchip/rk_pinctrl.c ============================================================================== --- head/sys/arm64/rockchip/rk_pinctrl.c Thu Dec 12 13:02:22 2019 (r355648) +++ head/sys/arm64/rockchip/rk_pinctrl.c Thu Dec 12 13:21:43 2019 (r355649) @@ -100,7 +100,7 @@ struct rk_pinctrl_conf { uint32_t ngpio_bank; uint32_t (*get_pd_offset)(struct rk_pinctrl_softc *, uint32_t); struct syscon *(*get_syscon)(struct rk_pinctrl_softc *, uint32_t); - int (*parse_bias)(phandle_t node); + int (*parse_bias)(phandle_t, int); }; struct rk_pinctrl_softc { @@ -372,7 +372,7 @@ rk3288_get_syscon(struct rk_pinctrl_softc *sc, uint32_ } static int -rk3288_parse_bias(phandle_t node) +rk3288_parse_bias(phandle_t node, int bank) { if (OF_hasprop(node, "bias-disable")) return (0); @@ -627,24 +627,38 @@ rk3399_get_pd_offset(struct rk_pinctrl_softc *sc, uint static struct syscon * rk3399_get_syscon(struct rk_pinctrl_softc *sc, uint32_t bank) { - if (bank < 2) { - device_printf(sc->dev, "%s: Using PMU GRF\n", __func__); + if (bank < 2) return (sc->pmu); - } - device_printf(sc->dev, "%s: Using GRF\n", __func__); return (sc->grf); } static int -rk3399_parse_bias(phandle_t node) +rk3399_parse_bias(phandle_t node, int bank) { + int pullup, pulldown; + if (OF_hasprop(node, "bias-disable")) return (0); + + switch (bank) { + case 0: + case 2: + pullup = 3; + pulldown = 1; + break; + case 1: + case 3: + case 4: + pullup = 1; + pulldown = 2; + break; + } + if (OF_hasprop(node, "bias-pull-up")) - return (3); + return (pullup); if (OF_hasprop(node, "bias-pull-down")) - return (1); + return (pulldown); return (-1); } @@ -862,7 +876,7 @@ rk_pinctrl_configure_pin(struct rk_pinctrl_softc *sc, SYSCON_MODIFY_4(syscon, reg, mask, function << bit | (mask << 16)); /* Pull-Up/Down */ - bias = sc->conf->parse_bias(pin_conf); + bias = sc->conf->parse_bias(pin_conf, bank); if (bias >= 0) { reg = sc->conf->get_pd_offset(sc, bank); From owner-svn-src-all@freebsd.org Thu Dec 12 13:28:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09F861D15B4; Thu, 12 Dec 2019 13:28:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47YZPp6XhPz4XM8; Thu, 12 Dec 2019 13:28:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6FE72460F; Thu, 12 Dec 2019 13:28:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBCDSkQN077823; Thu, 12 Dec 2019 13:28:46 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCDSkkt077821; Thu, 12 Dec 2019 13:28:46 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201912121328.xBCDSkkt077821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 12 Dec 2019 13:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355650 - in head/sys: modules/ipfw_nat64 netpfil/ipfw/nat64 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head/sys: modules/ipfw_nat64 netpfil/ipfw/nat64 X-SVN-Commit-Revision: 355650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 13:28:47 -0000 Author: ae Date: Thu Dec 12 13:28:46 2019 New Revision: 355650 URL: https://svnweb.freebsd.org/changeset/base/355650 Log: Follow RFC 4443 p2.2 and always use own addresses for reflected ICMPv6 datagrams. Previously destination address from original datagram was used. That looked confusing, especially in the traceroute6 output. Also honor IPSTEALTH kernel option and do TTL/HLIM decrementing only when stealth mode is disabled. Reported by: Marco van Tol Reviewed by: melifaro MFC after: 2 weeks Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D22631 Modified: head/sys/modules/ipfw_nat64/Makefile head/sys/netpfil/ipfw/nat64/nat64_translate.c Modified: head/sys/modules/ipfw_nat64/Makefile ============================================================================== --- head/sys/modules/ipfw_nat64/Makefile Thu Dec 12 13:21:43 2019 (r355649) +++ head/sys/modules/ipfw_nat64/Makefile Thu Dec 12 13:28:46 2019 (r355650) @@ -7,6 +7,7 @@ SRCS= ip_fw_nat64.c nat64_translate.c SRCS+= nat64clat.c nat64clat_control.c SRCS+= nat64lsn.c nat64lsn_control.c SRCS+= nat64stl.c nat64stl_control.c +SRCS+= opt_ipstealth.h CFLAGS+= -I${SRCTOP}/sys/contrib/ck/include Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64_translate.c Thu Dec 12 13:21:43 2019 (r355649) +++ head/sys/netpfil/ipfw/nat64/nat64_translate.c Thu Dec 12 13:28:46 2019 (r355650) @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ipstealth.h" + #include #include #include @@ -101,14 +103,39 @@ static const struct nat64_methods nat64_direct = { .output = nat64_direct_output, .output_one = nat64_direct_output_one }; -VNET_DEFINE_STATIC(const struct nat64_methods *, nat64out) = &nat64_netisr; -#define V_nat64out VNET(nat64out) +/* These variables should be initialized explicitly on module loading */ +VNET_DEFINE_STATIC(const struct nat64_methods *, nat64out); +VNET_DEFINE_STATIC(const int *, nat64ipstealth); +VNET_DEFINE_STATIC(const int *, nat64ip6stealth); +#define V_nat64out VNET(nat64out) +#define V_nat64ipstealth VNET(nat64ipstealth) +#define V_nat64ip6stealth VNET(nat64ip6stealth) + +static const int stealth_on = 1; +#ifndef IPSTEALTH +static const int stealth_off = 0; +#endif + void nat64_set_output_method(int direct) { - V_nat64out = direct != 0 ? &nat64_direct: &nat64_netisr; + if (direct != 0) { + V_nat64out = &nat64_direct; +#ifdef IPSTEALTH + /* Honor corresponding variables, if IPSTEALTH is defined */ + V_nat64ipstealth = &V_ipstealth; + V_nat64ip6stealth = &V_ip6stealth; +#else + /* otherwise we need to decrement HLIM/TTL for direct case */ + V_nat64ipstealth = V_nat64ip6stealth = &stealth_off; +#endif + } else { + V_nat64out = &nat64_netisr; + /* Leave TTL/HLIM decrementing to forwarding code */ + V_nat64ipstealth = V_nat64ip6stealth = &stealth_on; + } } int @@ -486,8 +513,7 @@ nat64_init_ip4hdr(const struct ip6_hdr *ip6, const str ip->ip_tos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; ip->ip_len = htons(sizeof(*ip) + plen); ip->ip_ttl = ip6->ip6_hlim; - /* Forwarding code will decrement TTL for netisr based output. */ - if (V_nat64out == &nat64_direct) + if (*V_nat64ip6stealth == 0) ip->ip_ttl -= IPV6_HLIMDEC; ip->ip_sum = 0; ip->ip_p = (proto == IPPROTO_ICMPV6) ? IPPROTO_ICMP: proto; @@ -623,18 +649,18 @@ nat64_icmp6_reflect(struct mbuf *m, uint8_t type, uint struct icmp6_hdr *icmp6; struct ip6_hdr *ip6, *oip6; struct mbuf *n; - int len, plen; + int len, plen, proto; len = 0; - plen = nat64_getlasthdr(m, &len); - if (plen < 0) { + proto = nat64_getlasthdr(m, &len); + if (proto < 0) { DPRINTF(DP_DROPS, "mbuf isn't contigious"); goto freeit; } /* * Do not send ICMPv6 in reply to ICMPv6 errors. */ - if (plen == IPPROTO_ICMPV6) { + if (proto == IPPROTO_ICMPV6) { if (m->m_len < len + sizeof(*icmp6)) { DPRINTF(DP_DROPS, "mbuf isn't contigious"); goto freeit; @@ -646,6 +672,21 @@ nat64_icmp6_reflect(struct mbuf *m, uint8_t type, uint "ICMPv6 errors"); goto freeit; } + /* + * If there are extra headers between IPv6 and ICMPv6, + * strip off them. + */ + if (len > sizeof(struct ip6_hdr)) { + /* + * NOTE: ipfw_chk already did m_pullup() and it is + * expected that data is contigious from the start + * of IPv6 header up to the end of ICMPv6 header. + */ + bcopy(mtod(m, caddr_t), + mtodo(m, len - sizeof(struct ip6_hdr)), + sizeof(struct ip6_hdr)); + m_adj(m, len - sizeof(struct ip6_hdr)); + } } /* if (icmp6_ratelimit(&ip6->ip6_src, type, code)) @@ -687,7 +728,19 @@ nat64_icmp6_reflect(struct mbuf *m, uint8_t type, uint n->m_len = n->m_pkthdr.len = sizeof(struct ip6_hdr) + plen; oip6 = mtod(n, struct ip6_hdr *); - oip6->ip6_src = ip6->ip6_dst; + /* + * Make IPv6 source address selection for reflected datagram. + * nat64_check_ip6() doesn't allow scoped addresses, therefore + * we use zero scopeid. + */ + if (in6_selectsrc_addr(M_GETFIB(n), &ip6->ip6_src, 0, + n->m_pkthdr.rcvif, &oip6->ip6_src, NULL) != 0) { + /* + * Failed to find proper source address, drop the packet. + */ + m_freem(n); + goto freeit; + } oip6->ip6_dst = ip6->ip6_src; oip6->ip6_nxt = IPPROTO_ICMPV6; oip6->ip6_flow = 0; @@ -1182,7 +1235,7 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s ip = mtod(m, struct ip*); - if (ip->ip_ttl <= IPTTLDEC) { + if (*V_nat64ipstealth == 0 && ip->ip_ttl <= IPTTLDEC) { nat64_icmp_reflect(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, 0, &cfg->stats, logdata); return (NAT64RETURN); @@ -1229,8 +1282,7 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s ip6.ip6_flow = htonl(ip->ip_tos << 20); ip6.ip6_vfc |= IPV6_VERSION; ip6.ip6_hlim = ip->ip_ttl; - /* Forwarding code will decrement TTL for netisr based output. */ - if (V_nat64out == &nat64_direct) + if (*V_nat64ipstealth == 0) ip6.ip6_hlim -= IPTTLDEC; ip6.ip6_plen = htons(plen); ip6.ip6_nxt = (proto == IPPROTO_ICMP) ? IPPROTO_ICMPV6: proto; @@ -1533,7 +1585,7 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui return (NAT64MFREE); } - if (ip6->ip6_hlim <= IPV6_HLIMDEC) { + if (*V_nat64ip6stealth == 0 && ip6->ip6_hlim <= IPV6_HLIMDEC) { nat64_icmp6_reflect(m, ICMP6_TIME_EXCEEDED, ICMP6_TIME_EXCEED_TRANSIT, 0, &cfg->stats, logdata); return (NAT64RETURN); From owner-svn-src-all@freebsd.org Thu Dec 12 13:46:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 758281D2202; Thu, 12 Dec 2019 13:46:04 +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 47YZnm1jt9z4c6b; Thu, 12 Dec 2019 13:46:04 +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 DC612249ED; Thu, 12 Dec 2019 13:46:03 +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 xBCDk3BA094001; Thu, 12 Dec 2019 13:46:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCDk3gg093960; Thu, 12 Dec 2019 13:46:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201912121346.xBCDk3gg093960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Dec 2019 13:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355651 - stable/12/sys/fs/tmpfs X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/fs/tmpfs X-SVN-Commit-Revision: 355651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 13:46:04 -0000 Author: kib Date: Thu Dec 12 13:46:02 2019 New Revision: 355651 URL: https://svnweb.freebsd.org/changeset/base/355651 Log: MFC r355407: Stop using per-mount tmpfs zones. Modified: stable/12/sys/fs/tmpfs/tmpfs.h stable/12/sys/fs/tmpfs/tmpfs_subr.c stable/12/sys/fs/tmpfs/tmpfs_vfsops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/tmpfs/tmpfs.h ============================================================================== --- stable/12/sys/fs/tmpfs/tmpfs.h Thu Dec 12 13:28:46 2019 (r355650) +++ stable/12/sys/fs/tmpfs/tmpfs.h Thu Dec 12 13:46:02 2019 (r355651) @@ -378,10 +378,6 @@ struct tmpfs_mount { /* All node lock to protect the node list and tmp_pages_used. */ struct mtx tm_allnode_lock; - /* Zones used to store file system meta data, per tmpfs mount. */ - uma_zone_t tm_dirent_pool; - uma_zone_t tm_node_pool; - /* Read-only status. */ bool tm_ronly; /* Do not use namecache. */ @@ -491,8 +487,9 @@ struct tmpfs_dirent *tmpfs_dir_next(struct tmpfs_node #define TMPFS_PAGES_MINRESERVED (4 * 1024 * 1024 / PAGE_SIZE) size_t tmpfs_mem_avail(void); - size_t tmpfs_pages_used(struct tmpfs_mount *tmp); +void tmpfs_subr_init(void); +void tmpfs_subr_uninit(void); #endif Modified: stable/12/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/12/sys/fs/tmpfs/tmpfs_subr.c Thu Dec 12 13:28:46 2019 (r355650) +++ stable/12/sys/fs/tmpfs/tmpfs_subr.c Thu Dec 12 13:46:02 2019 (r355651) @@ -72,7 +72,74 @@ SYSCTL_NODE(_vfs, OID_AUTO, tmpfs, CTLFLAG_RW, 0, "tmp static long tmpfs_pages_reserved = TMPFS_PAGES_MINRESERVED; +static uma_zone_t tmpfs_dirent_pool; +static uma_zone_t tmpfs_node_pool; + static int +tmpfs_node_ctor(void *mem, int size, void *arg, int flags) +{ + struct tmpfs_node *node; + + node = mem; + node->tn_gen++; + node->tn_size = 0; + node->tn_status = 0; + node->tn_flags = 0; + node->tn_links = 0; + node->tn_vnode = NULL; + node->tn_vpstate = 0; + return (0); +} + +static void +tmpfs_node_dtor(void *mem, int size, void *arg) +{ + struct tmpfs_node *node; + + node = mem; + node->tn_type = VNON; +} + +static int +tmpfs_node_init(void *mem, int size, int flags) +{ + struct tmpfs_node *node; + + node = mem; + node->tn_id = 0; + mtx_init(&node->tn_interlock, "tmpfsni", NULL, MTX_DEF); + node->tn_gen = arc4random(); + return (0); +} + +static void +tmpfs_node_fini(void *mem, int size) +{ + struct tmpfs_node *node; + + node = mem; + mtx_destroy(&node->tn_interlock); +} + +void +tmpfs_subr_init(void) +{ + tmpfs_dirent_pool = uma_zcreate("TMPFS dirent", + sizeof(struct tmpfs_dirent), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0); + tmpfs_node_pool = uma_zcreate("TMPFS node", + sizeof(struct tmpfs_node), tmpfs_node_ctor, tmpfs_node_dtor, + tmpfs_node_init, tmpfs_node_fini, UMA_ALIGN_PTR, 0); +} + +void +tmpfs_subr_uninit(void) +{ + uma_zdestroy(tmpfs_node_pool); + uma_zdestroy(tmpfs_dirent_pool); +} + +static int sysctl_mem_reserved(SYSCTL_HANDLER_ARGS) { int error; @@ -221,8 +288,7 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount if ((mp->mnt_kern_flag & MNT_RDONLY) != 0) return (EROFS); - nnode = (struct tmpfs_node *)uma_zalloc_arg(tmp->tm_node_pool, tmp, - M_WAITOK); + nnode = uma_zalloc_arg(tmpfs_node_pool, tmp, M_WAITOK); /* Generic initialization. */ nnode->tn_type = type; @@ -370,7 +436,7 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct panic("tmpfs_free_node: type %p %d", node, (int)node->tn_type); } - uma_zfree(tmp->tm_node_pool, node); + uma_zfree(tmpfs_node_pool, node); TMPFS_LOCK(tmp); tmpfs_free_tmp(tmp); return (true); @@ -437,7 +503,7 @@ tmpfs_alloc_dirent(struct tmpfs_mount *tmp, struct tmp { struct tmpfs_dirent *nde; - nde = uma_zalloc(tmp->tm_dirent_pool, M_WAITOK); + nde = uma_zalloc(tmpfs_dirent_pool, M_WAITOK); nde->td_node = node; if (name != NULL) { nde->ud.td_name = malloc(len, M_TMPFSNAME, M_WAITOK); @@ -473,7 +539,7 @@ tmpfs_free_dirent(struct tmpfs_mount *tmp, struct tmpf } if (!tmpfs_dirent_duphead(de) && de->ud.td_name != NULL) free(de->ud.td_name, M_TMPFSNAME); - uma_zfree(tmp->tm_dirent_pool, de); + uma_zfree(tmpfs_dirent_pool, de); } void Modified: stable/12/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- stable/12/sys/fs/tmpfs/tmpfs_vfsops.c Thu Dec 12 13:28:46 2019 (r355650) +++ stable/12/sys/fs/tmpfs/tmpfs_vfsops.c Thu Dec 12 13:46:02 2019 (r355651) @@ -96,49 +96,6 @@ static const char *tmpfs_updateopts[] = { "from", "export", "size", NULL }; -static int -tmpfs_node_ctor(void *mem, int size, void *arg, int flags) -{ - struct tmpfs_node *node = (struct tmpfs_node *)mem; - - node->tn_gen++; - node->tn_size = 0; - node->tn_status = 0; - node->tn_flags = 0; - node->tn_links = 0; - node->tn_vnode = NULL; - node->tn_vpstate = 0; - - return (0); -} - -static void -tmpfs_node_dtor(void *mem, int size, void *arg) -{ - struct tmpfs_node *node = (struct tmpfs_node *)mem; - node->tn_type = VNON; -} - -static int -tmpfs_node_init(void *mem, int size, int flags) -{ - struct tmpfs_node *node = (struct tmpfs_node *)mem; - node->tn_id = 0; - - mtx_init(&node->tn_interlock, "tmpfs node interlock", NULL, MTX_DEF); - node->tn_gen = arc4random(); - - return (0); -} - -static void -tmpfs_node_fini(void *mem, int size) -{ - struct tmpfs_node *node = (struct tmpfs_node *)mem; - - mtx_destroy(&node->tn_interlock); -} - /* * Handle updates of time from writes to mmaped regions. Use * MNT_VNODE_FOREACH_ALL instead of MNT_VNODE_FOREACH_ACTIVE, since @@ -479,12 +436,6 @@ tmpfs_mount(struct mount *mp) tmp->tm_pages_max = pages; tmp->tm_pages_used = 0; new_unrhdr64(&tmp->tm_ino_unr, 2); - tmp->tm_dirent_pool = uma_zcreate("TMPFS dirent", - sizeof(struct tmpfs_dirent), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); - tmp->tm_node_pool = uma_zcreate("TMPFS node", - sizeof(struct tmpfs_node), tmpfs_node_ctor, tmpfs_node_dtor, - tmpfs_node_init, tmpfs_node_fini, UMA_ALIGN_PTR, 0); tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; tmp->tm_nonc = nonc; @@ -493,8 +444,6 @@ tmpfs_mount(struct mount *mp) root_mode & ALLPERMS, NULL, NULL, VNOVAL, &root); if (error != 0 || root == NULL) { - uma_zdestroy(tmp->tm_node_pool); - uma_zdestroy(tmp->tm_dirent_pool); free(tmp, M_TMPFSMNT); return (error); } @@ -588,9 +537,6 @@ tmpfs_free_tmp(struct tmpfs_mount *tmp) } TMPFS_UNLOCK(tmp); - uma_zdestroy(tmp->tm_dirent_pool); - uma_zdestroy(tmp->tm_node_pool); - mtx_destroy(&tmp->tm_allnode_lock); MPASS(tmp->tm_pages_used == 0); MPASS(tmp->tm_nodes_inuse == 0); @@ -700,10 +646,23 @@ tmpfs_susp_clean(struct mount *mp __unused) { } +static int +tmpfs_init(struct vfsconf *conf) +{ + tmpfs_subr_init(); + return (0); +} + +static int +tmpfs_uninit(struct vfsconf *conf) +{ + tmpfs_subr_uninit(); + return (0); +} + /* * tmpfs vfs operations. */ - struct vfsops tmpfs_vfsops = { .vfs_mount = tmpfs_mount, .vfs_unmount = tmpfs_unmount, @@ -712,5 +671,7 @@ struct vfsops tmpfs_vfsops = { .vfs_fhtovp = tmpfs_fhtovp, .vfs_sync = tmpfs_sync, .vfs_susp_clean = tmpfs_susp_clean, + .vfs_init = tmpfs_init, + .vfs_uninit = tmpfs_uninit, }; VFS_SET(tmpfs_vfsops, tmpfs, VFCF_JAIL); From owner-svn-src-all@freebsd.org Thu Dec 12 13:47:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 655B71D2548; Thu, 12 Dec 2019 13:47:03 +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 47YZpv2713z4d92; Thu, 12 Dec 2019 13:47:03 +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 342D4249FB; Thu, 12 Dec 2019 13:47:03 +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 xBCDl3DY095342; Thu, 12 Dec 2019 13:47:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCDl2VD095339; Thu, 12 Dec 2019 13:47:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201912121347.xBCDl2VD095339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Dec 2019 13:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355652 - in stable/12/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Commit-Revision: 355652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 13:47:03 -0000 Author: kib Date: Thu Dec 12 13:47:02 2019 New Revision: 355652 URL: https://svnweb.freebsd.org/changeset/base/355652 Log: MFC r355422: mlx5: Do not poke hardware for statistic after teardown is started. Modified: stable/12/sys/dev/mlx5/driver.h stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/driver.h ============================================================================== --- stable/12/sys/dev/mlx5/driver.h Thu Dec 12 13:46:02 2019 (r355651) +++ stable/12/sys/dev/mlx5/driver.h Thu Dec 12 13:47:02 2019 (r355652) @@ -640,7 +640,8 @@ enum mlx5_device_state { }; enum mlx5_interface_state { - MLX5_INTERFACE_STATE_UP, + MLX5_INTERFACE_STATE_UP = 0x1, + MLX5_INTERFACE_STATE_TEARDOWN = 0x2, }; enum mlx5_pci_status { Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Dec 12 13:46:02 2019 (r355651) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Dec 12 13:47:02 2019 (r355652) @@ -1606,6 +1606,8 @@ static void shutdown_one(struct pci_dev *pdev) /* enter polling mode */ mlx5_cmd_use_polling(dev); + set_bit(MLX5_INTERFACE_STATE_TEARDOWN, &dev->intf_state); + /* disable all interrupts */ mlx5_disable_interrupts(dev); Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Dec 12 13:46:02 2019 (r355651) +++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Dec 12 13:47:02 2019 (r355652) @@ -1037,9 +1037,10 @@ mlx5e_update_stats_work(struct work_struct *work) { struct mlx5e_priv *priv; - priv = container_of(work, struct mlx5e_priv, update_stats_work); + priv = container_of(work, struct mlx5e_priv, update_stats_work); PRIV_LOCK(priv); - if (test_bit(MLX5E_STATE_OPENED, &priv->state) != 0) + if (test_bit(MLX5E_STATE_OPENED, &priv->state) != 0 && + !test_bit(MLX5_INTERFACE_STATE_TEARDOWN, &priv->mdev->intf_state)) mlx5e_update_stats_locked(priv); PRIV_UNLOCK(priv); } From owner-svn-src-all@freebsd.org Thu Dec 12 13:48:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 212571D28B7; Thu, 12 Dec 2019 13:48:26 +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 47YZrV02Kvz4fNV; Thu, 12 Dec 2019 13:48:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF7B724A0F; Thu, 12 Dec 2019 13:48:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBCDmOAE097170; Thu, 12 Dec 2019 13:48:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCDmOwj097165; Thu, 12 Dec 2019 13:48:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201912121348.xBCDmOwj097165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Dec 2019 13:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355653 - in stable/11/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Commit-Revision: 355653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 13:48:26 -0000 Author: kib Date: Thu Dec 12 13:48:23 2019 New Revision: 355653 URL: https://svnweb.freebsd.org/changeset/base/355653 Log: MFC r355422: mlx5: Do not poke hardware for statistic after teardown is started. Modified: stable/11/sys/dev/mlx5/driver.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Thu Dec 12 13:47:02 2019 (r355652) +++ stable/11/sys/dev/mlx5/driver.h Thu Dec 12 13:48:23 2019 (r355653) @@ -614,7 +614,8 @@ enum mlx5_device_state { }; enum mlx5_interface_state { - MLX5_INTERFACE_STATE_UP, + MLX5_INTERFACE_STATE_UP = 0x1, + MLX5_INTERFACE_STATE_TEARDOWN = 0x2, }; enum mlx5_pci_status { Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Dec 12 13:47:02 2019 (r355652) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Dec 12 13:48:23 2019 (r355653) @@ -1588,6 +1588,8 @@ static void shutdown_one(struct pci_dev *pdev) /* enter polling mode */ mlx5_cmd_use_polling(dev); + set_bit(MLX5_INTERFACE_STATE_TEARDOWN, &dev->intf_state); + /* disable all interrupts */ mlx5_disable_interrupts(dev); Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Dec 12 13:47:02 2019 (r355652) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Dec 12 13:48:23 2019 (r355653) @@ -1037,9 +1037,10 @@ mlx5e_update_stats_work(struct work_struct *work) { struct mlx5e_priv *priv; - priv = container_of(work, struct mlx5e_priv, update_stats_work); + priv = container_of(work, struct mlx5e_priv, update_stats_work); PRIV_LOCK(priv); - if (test_bit(MLX5E_STATE_OPENED, &priv->state) != 0) + if (test_bit(MLX5E_STATE_OPENED, &priv->state) != 0 && + !test_bit(MLX5_INTERFACE_STATE_TEARDOWN, &priv->mdev->intf_state)) mlx5e_update_stats_locked(priv); PRIV_UNLOCK(priv); } From owner-svn-src-all@freebsd.org Thu Dec 12 14:52:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 366791D4080; Thu, 12 Dec 2019 14:52: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 47YcGZ0fFQz3Flv; Thu, 12 Dec 2019 14:52: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 ECEE025681; Thu, 12 Dec 2019 14:52:37 +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 xBCEqbWd038750; Thu, 12 Dec 2019 14:52:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCEqbc0038748; Thu, 12 Dec 2019 14:52:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912121452.xBCEqbc0038748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Dec 2019 14:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355654 - in head/lib/libpmc/pmu-events/arch/s390: cf_z13 cf_z14 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/lib/libpmc/pmu-events/arch/s390: cf_z13 cf_z14 X-SVN-Commit-Revision: 355654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 14:52:38 -0000 Author: emaste Date: Thu Dec 12 14:52:37 2019 New Revision: 355654 URL: https://svnweb.freebsd.org/changeset/base/355654 Log: libpmc: remove undesired prefix from two s390 counters Two counters included a prefix 'Counter:###\tName:XXX' in their descriptions that appears to be a leftover from some conversion process. Remove them. Found because a json validator tripped over the tab in the description. Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z13/extended.json head/lib/libpmc/pmu-events/arch/s390/cf_z14/extended.json Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z13/extended.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_z13/extended.json Thu Dec 12 13:48:23 2019 (r355653) +++ head/lib/libpmc/pmu-events/arch/s390/cf_z13/extended.json Thu Dec 12 14:52:37 2019 (r355654) @@ -27,7 +27,7 @@ "EventCode": "132", "EventName": "DTLB1_GPAGE_WRITES", "BriefDescription": "DTLB1 Two-Gigabyte Page Writes", - "PublicDescription": "Counter:132 Name:DTLB1_GPAGE_WRITES A translation entry has been written to the Level-1 Data Translation Lookaside Buffer for a two-gigabyte page." + "PublicDescription": "A translation entry has been written to the Level-1 Data Translation Lookaside Buffer for a two-gigabyte page." }, { "EventCode": "133", Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z14/extended.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_z14/extended.json Thu Dec 12 13:48:23 2019 (r355653) +++ head/lib/libpmc/pmu-events/arch/s390/cf_z14/extended.json Thu Dec 12 14:52:37 2019 (r355654) @@ -3,7 +3,7 @@ "EventCode": "128", "EventName": "L1D_RO_EXCL_WRITES", "BriefDescription": "L1D Read-only Exclusive Writes", - "PublicDescription": "Counter:128 Name:L1D_RO_EXCL_WRITES A directory write to the Level-1 Data cache where the line was originally in a Read-Only state in the cache but has been updated to be in the Exclusive state that allows stores to the cache line" + "PublicDescription": "A directory write to the Level-1 Data cache where the line was originally in a Read-Only state in the cache but has been updated to be in the Exclusive state that allows stores to the cache line" }, { "EventCode": "129", From owner-svn-src-all@freebsd.org Thu Dec 12 16:49:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3603A1D61CD; Thu, 12 Dec 2019 16:49:56 +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 47Yfsw0lgkz3MZh; Thu, 12 Dec 2019 16:49:56 +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 10B0126A65; Thu, 12 Dec 2019 16:49:56 +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 xBCGntfH005491; Thu, 12 Dec 2019 16:49:55 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCGnta0005490; Thu, 12 Dec 2019 16:49:55 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201912121649.xBCGnta0005490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Thu, 12 Dec 2019 16:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355655 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 355655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 16:49:56 -0000 Author: bdragon Date: Thu Dec 12 16:49:55 2019 New Revision: 355655 URL: https://svnweb.freebsd.org/changeset/base/355655 Log: [PowerPC] Fix powerpc 32 bit build in mmu_oea64.c Due to ppc32 building mmu_oea64.c (for use when in bridge mode on a G5), we need to guard the new moea64_page_array_startup code behind __powerpc64__ to avoid a compile error, since vm_offset_t is not 64-bit on ppc32. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D22782 Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Dec 12 14:52:37 2019 (r355654) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Dec 12 16:49:55 2019 (r355655) @@ -309,7 +309,9 @@ static int moea64_decode_kernel_ptr(mmu_t mmu, vm_offs int *is_user, vm_offset_t *decoded_addr); static size_t moea64_scan_pmap(mmu_t mmu); static void *moea64_dump_pmap_init(mmu_t mmu, unsigned blkpgs); +#ifdef __powerpc64__ static void moea64_page_array_startup(mmu_t, long); +#endif static mmu_method_t moea64_methods[] = { @@ -349,7 +351,9 @@ static mmu_method_t moea64_methods[] = { MMUMETHOD(mmu_page_set_memattr, moea64_page_set_memattr), MMUMETHOD(mmu_quick_enter_page, moea64_quick_enter_page), MMUMETHOD(mmu_quick_remove_page, moea64_quick_remove_page), +#ifdef __powerpc64__ MMUMETHOD(mmu_page_array_startup, moea64_page_array_startup), +#endif /* Internal interfaces */ MMUMETHOD(mmu_mapdev, moea64_mapdev), @@ -3026,6 +3030,7 @@ moea64_dump_pmap_init(mmu_t mmu, unsigned blkpgs) #endif +#ifdef __powerpc64__ static void moea64_map_range(mmu_t mmu, vm_offset_t va, vm_paddr_t pa, vm_size_t npages) { @@ -3119,3 +3124,4 @@ moea64_page_array_startup(mmu_t mmu, long pages) vm_page_array = (vm_page_t)vm_page_base; vm_page_array_size = pages; } +#endif From owner-svn-src-all@freebsd.org Thu Dec 12 17:12:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73B051D6862; Thu, 12 Dec 2019 17:12:19 +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 47YgMl20b3z3Nq5; Thu, 12 Dec 2019 17:12:19 +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 4011326FB6; Thu, 12 Dec 2019 17:12:19 +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 xBCHCJhs019656; Thu, 12 Dec 2019 17:12:19 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCHCIxM019653; Thu, 12 Dec 2019 17:12:18 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201912121712.xBCHCIxM019653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Thu, 12 Dec 2019 17:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355656 - in head: lib/libc/powerpcspe/gen lib/msun/powerpc sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head: lib/libc/powerpcspe/gen lib/msun/powerpc sys/powerpc/booke X-SVN-Commit-Revision: 355656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 17:12:19 -0000 Author: bdragon Date: Thu Dec 12 17:12:18 2019 New Revision: 355656 URL: https://svnweb.freebsd.org/changeset/base/355656 Log: [PowerPC] Fix SPE floating point environment manipulation Fix multiple problems in the powerpcspe floating point code. * Endianness handling of the SPEFSCR in fenv.h was completely broken. * Ensure SPEFSCR synchronization requirements are being met. The __r.__d -> __r transformations were written by jhibbits. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D22526 Modified: head/lib/libc/powerpcspe/gen/fpsetmask.c head/lib/libc/powerpcspe/gen/fpsetround.c head/lib/msun/powerpc/fenv.h head/sys/powerpc/booke/spe.c Modified: head/lib/libc/powerpcspe/gen/fpsetmask.c ============================================================================== --- head/lib/libc/powerpcspe/gen/fpsetmask.c Thu Dec 12 16:49:55 2019 (r355655) +++ head/lib/libc/powerpcspe/gen/fpsetmask.c Thu Dec 12 17:12:18 2019 (r355656) @@ -47,7 +47,7 @@ fpsetmask(fp_except_t mask) __asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR)); old = (fp_rnd_t)((fpscr >> 2) & 0x1f); fpscr = (fpscr & 0xffffff83) | (mask << 2); - __asm__ __volatile("mtspr %1,%0" :: "r"(fpscr), "K"(SPR_SPEFSCR)); + __asm__ __volatile("mtspr %1,%0;isync" :: "r"(fpscr), "K"(SPR_SPEFSCR)); return (old); } #endif Modified: head/lib/libc/powerpcspe/gen/fpsetround.c ============================================================================== --- head/lib/libc/powerpcspe/gen/fpsetround.c Thu Dec 12 16:49:55 2019 (r355655) +++ head/lib/libc/powerpcspe/gen/fpsetround.c Thu Dec 12 17:12:18 2019 (r355656) @@ -47,7 +47,7 @@ fpsetround(fp_rnd_t rnd_dir) __asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR) ); old = (fp_rnd_t)(fpscr & 0x3); fpscr = (fpscr & 0xfffffffc) | rnd_dir; - __asm__ __volatile("mtspr %1, %0" :: "r"(fpscr), "K"(SPR_SPEFSCR)); + __asm__ __volatile("mtspr %1, %0;isync" :: "r"(fpscr), "K"(SPR_SPEFSCR)); return (old); } #endif Modified: head/lib/msun/powerpc/fenv.h ============================================================================== --- head/lib/msun/powerpc/fenv.h Thu Dec 12 16:49:55 2019 (r355655) +++ head/lib/msun/powerpc/fenv.h Thu Dec 12 17:12:18 2019 (r355656) @@ -32,6 +32,7 @@ #define _FENV_H_ #include +#include #ifndef __fenv_static #define __fenv_static static @@ -90,11 +91,15 @@ extern const fenv_t __fe_dfl_env; #ifndef _SOFT_FLOAT #ifdef __SPE__ -#define __mffs(__env) __asm __volatile("mfspr %0, 512" : "=r" (*(__env))) -#define __mtfsf(__env) __asm __volatile("mtspr 512,%0" : : "r" (__env)) +#define __mffs(__env) \ + __asm __volatile("mfspr %0, 512" : "=r" ((__env)->__bits.__reg)) +#define __mtfsf(__env) \ + __asm __volatile("mtspr 512,%0;isync" :: "r" ((__env).__bits.__reg)) #else -#define __mffs(__env) __asm __volatile("mffs %0" : "=f" (*(__env))) -#define __mtfsf(__env) __asm __volatile("mtfsf 255,%0" : : "f" (__env)) +#define __mffs(__env) \ + __asm __volatile("mffs %0" : "=f" ((__env)->__d)) +#define __mtfsf(__env) \ + __asm __volatile("mtfsf 255,%0" :: "f" ((__env).__d)) #endif #else #define __mffs(__env) @@ -121,9 +126,9 @@ feclearexcept(int __excepts) if (__excepts & FE_INVALID) __excepts |= FE_ALL_INVALID; - __mffs(&__r.__d); + __mffs(&__r); __r.__bits.__reg &= ~__excepts; - __mtfsf(__r.__d); + __mtfsf(__r); return (0); } @@ -132,7 +137,7 @@ fegetexceptflag(fexcept_t *__flagp, int __excepts) { union __fpscr __r; - __mffs(&__r.__d); + __mffs(&__r); *__flagp = __r.__bits.__reg & __excepts; return (0); } @@ -144,10 +149,10 @@ fesetexceptflag(const fexcept_t *__flagp, int __except if (__excepts & FE_INVALID) __excepts |= FE_ALL_EXCEPT; - __mffs(&__r.__d); + __mffs(&__r); __r.__bits.__reg &= ~__excepts; __r.__bits.__reg |= *__flagp & __excepts; - __mtfsf(__r.__d); + __mtfsf(__r); return (0); } @@ -158,9 +163,9 @@ feraiseexcept(int __excepts) if (__excepts & FE_INVALID) __excepts |= FE_VXSOFT; - __mffs(&__r.__d); + __mffs(&__r); __r.__bits.__reg |= __excepts; - __mtfsf(__r.__d); + __mtfsf(__r); return (0); } @@ -169,7 +174,7 @@ fetestexcept(int __excepts) { union __fpscr __r; - __mffs(&__r.__d); + __mffs(&__r); return (__r.__bits.__reg & __excepts); } @@ -178,7 +183,7 @@ fegetround(void) { union __fpscr __r; - __mffs(&__r.__d); + __mffs(&__r); return (__r.__bits.__reg & _ROUND_MASK); } @@ -189,10 +194,10 @@ fesetround(int __round) if (__round & ~_ROUND_MASK) return (-1); - __mffs(&__r.__d); + __mffs(&__r); __r.__bits.__reg &= ~_ROUND_MASK; __r.__bits.__reg |= __round; - __mtfsf(__r.__d); + __mtfsf(__r); return (0); } @@ -201,7 +206,7 @@ fegetenv(fenv_t *__envp) { union __fpscr __r; - __mffs(&__r.__d); + __mffs(&__r); *__envp = __r.__bits.__reg; return (0); } @@ -211,10 +216,10 @@ feholdexcept(fenv_t *__envp) { union __fpscr __r; - __mffs(&__r.__d); + __mffs(&__r); *__envp = __r.__d; __r.__bits.__reg &= ~(FE_ALL_EXCEPT | _ENABLE_MASK); - __mtfsf(__r.__d); + __mtfsf(__r); return (0); } @@ -224,7 +229,7 @@ fesetenv(const fenv_t *__envp) union __fpscr __r; __r.__bits.__reg = *__envp; - __mtfsf(__r.__d); + __mtfsf(__r); return (0); } @@ -233,10 +238,10 @@ feupdateenv(const fenv_t *__envp) { union __fpscr __r; - __mffs(&__r.__d); + __mffs(&__r); __r.__bits.__reg &= FE_ALL_EXCEPT; __r.__bits.__reg |= *__envp; - __mtfsf(__r.__d); + __mtfsf(__r); return (0); } @@ -250,10 +255,10 @@ feenableexcept(int __mask) union __fpscr __r; fenv_t __oldmask; - __mffs(&__r.__d); + __mffs(&__r); __oldmask = __r.__bits.__reg; __r.__bits.__reg |= (__mask & FE_ALL_EXCEPT) >> _FPUSW_SHIFT; - __mtfsf(__r.__d); + __mtfsf(__r); return ((__oldmask & _ENABLE_MASK) << _FPUSW_SHIFT); } @@ -263,10 +268,10 @@ fedisableexcept(int __mask) union __fpscr __r; fenv_t __oldmask; - __mffs(&__r.__d); + __mffs(&__r); __oldmask = __r.__bits.__reg; __r.__bits.__reg &= ~((__mask & FE_ALL_EXCEPT) >> _FPUSW_SHIFT); - __mtfsf(__r.__d); + __mtfsf(__r); return ((__oldmask & _ENABLE_MASK) << _FPUSW_SHIFT); } @@ -275,7 +280,7 @@ fegetexcept(void) { union __fpscr __r; - __mffs(&__r.__d); + __mffs(&__r); return ((__r.__bits.__reg & _ENABLE_MASK) << _FPUSW_SHIFT); } Modified: head/sys/powerpc/booke/spe.c ============================================================================== --- head/sys/powerpc/booke/spe.c Thu Dec 12 16:49:55 2019 (r355655) +++ head/sys/powerpc/booke/spe.c Thu Dec 12 17:12:18 2019 (r355656) @@ -134,7 +134,7 @@ enable_vec(struct thread *td) /* Restore SPEFSCR and ACC. Use %r0 as the scratch for ACC. */ mtspr(SPR_SPEFSCR, pcb->pcb_vec.vscr); - __asm __volatile("evldd 0, 0(%0); evmra 0,0\n" + __asm __volatile("isync;evldd 0, 0(%0); evmra 0,0\n" :: "b"(&pcb->pcb_vec.spare[0])); /* From owner-svn-src-all@freebsd.org Thu Dec 12 17:40:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 952191D71A2; Thu, 12 Dec 2019 17:40:33 +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 47Yh0K3Syjz3Q6q; Thu, 12 Dec 2019 17:40:33 +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 6DEB32736C; Thu, 12 Dec 2019 17:40:33 +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 xBCHeXfL034851; Thu, 12 Dec 2019 17:40:33 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCHeXsg034850; Thu, 12 Dec 2019 17:40:33 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201912121740.xBCHeXsg034850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Thu, 12 Dec 2019 17:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355657 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 355657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 17:40:33 -0000 Author: bdragon Date: Thu Dec 12 17:40:32 2019 New Revision: 355657 URL: https://svnweb.freebsd.org/changeset/base/355657 Log: rtld: do not try to mmap a zero-sized PT_LOAD When a PT_LOAD segment has a zero p_filesz, skip the data mmap, as mmapping zero bytes from a file is an error. A PT_LOAD with zero p_filesz is legal (but somewhat uncommon due to segment merging in modern linkers, as it is more efficient to merge .data and .bss by just extending p_memsz in the previous segment, assuming compatible page protection.) This was seen on ports/graphics/glew on a powerpc64 ELFv2 experimental build. Submitted by: Alfredo Dal'Ava Junior Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D22634 Modified: head/libexec/rtld-elf/map_object.c Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Thu Dec 12 17:12:18 2019 (r355656) +++ head/libexec/rtld-elf/map_object.c Thu Dec 12 17:40:32 2019 (r355657) @@ -228,11 +228,12 @@ map_object(int fd, const char *path, const struct stat data_addr = mapbase + (data_vaddr - base_vaddr); data_prot = convert_prot(segs[i]->p_flags); data_flags = convert_flags(segs[i]->p_flags) | MAP_FIXED; - if (mmap(data_addr, data_vlimit - data_vaddr, data_prot, - data_flags | MAP_PREFAULT_READ, fd, data_offset) == (caddr_t) -1) { - _rtld_error("%s: mmap of data failed: %s", path, - rtld_strerror(errno)); - goto error1; + if (data_vlimit != data_vaddr && + mmap(data_addr, data_vlimit - data_vaddr, data_prot, + data_flags | MAP_PREFAULT_READ, fd, data_offset) == MAP_FAILED) { + _rtld_error("%s: mmap of data failed: %s", path, + rtld_strerror(errno)); + goto error1; } /* Do BSS setup */ From owner-svn-src-all@freebsd.org Thu Dec 12 18:16:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE7A91D7D0B; Thu, 12 Dec 2019 18:16:33 +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 47Yhns5BT5z3wws; Thu, 12 Dec 2019 18:16:33 +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 A1B6A27A9E; Thu, 12 Dec 2019 18:16:33 +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 xBCIGXIw057846; Thu, 12 Dec 2019 18:16:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCIGXCq057844; Thu, 12 Dec 2019 18:16:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201912121816.xBCIGXCq057844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 12 Dec 2019 18:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355658 - in stable/12: include sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/12: include sys/sys X-SVN-Commit-Revision: 355658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 18:16:33 -0000 Author: dim Date: Thu Dec 12 18:16:32 2019 New Revision: 355658 URL: https://svnweb.freebsd.org/changeset/base/355658 Log: MFC r355568: Correctly check for C++17 and higher when declaring timespec_get() Summary: In rS338751, the check to declare `timespec_get()` for C++17 and higher was incorrectly done against a `cplusplus` define, while it should have been `__cplusplus`. Fix this by using `__cplusplus`, and also bump `__FreeBSD_version` so it becomes possible to correctly check for `timespec_get()` in upstream libc++ headers. Reviewed by: brooks, emaste Differential Revision: https://reviews.freebsd.org/D22735 Modified: stable/12/include/time.h stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/12/include/time.h ============================================================================== --- stable/12/include/time.h Thu Dec 12 17:40:32 2019 (r355657) +++ stable/12/include/time.h Thu Dec 12 18:16:32 2019 (r355658) @@ -208,7 +208,7 @@ time_t posix2time(time_t t); #endif #if defined(__BSD_VISIBLE) || __ISO_C_VISIBLE >= 2011 || \ - (defined(cplusplus) && cplusplus >= 201703) + (defined(__cplusplus) && __cplusplus >= 201703) #include /* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */ #define TIME_UTC 1 /* time elapsed since epoch */ Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Thu Dec 12 17:40:32 2019 (r355657) +++ stable/12/sys/sys/param.h Thu Dec 12 18:16:32 2019 (r355658) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1201503 /* Master, propagated to newvers */ +#define __FreeBSD_version 1201504 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Thu Dec 12 18:27:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4EBC71D8299; Thu, 12 Dec 2019 18:27:55 +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 47Yj2z1LZmz3xbK; Thu, 12 Dec 2019 18:27:55 +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 28F2727C86; Thu, 12 Dec 2019 18:27:55 +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 xBCIRs3a063751; Thu, 12 Dec 2019 18:27:54 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCIRsco063749; Thu, 12 Dec 2019 18:27:54 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201912121827.xBCIRsco063749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 12 Dec 2019 18:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355659 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 355659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 18:27:55 -0000 Author: andrew Date: Thu Dec 12 18:27:54 2019 New Revision: 355659 URL: https://svnweb.freebsd.org/changeset/base/355659 Log: Add comments and macros to the tcr_el1 setting code to help understand it. This code is non-obvious when reading for the first time. To help with understanding of it add comments explaining what it's doing. While here use macros from armreg.h rather than magic numbers. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/locore.S head/sys/arm64/include/armreg.h Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Thu Dec 12 18:16:32 2019 (r355658) +++ head/sys/arm64/arm64/locore.S Thu Dec 12 18:27:54 2019 (r355659) @@ -688,14 +688,23 @@ start_mmu: */ ldr x2, tcr mrs x3, id_aa64mmfr0_el1 - bfi x2, x3, #32, #3 - and x3, x3, #0xF0 - cmp x3, #0x20 + + /* Copy the bottom 3 bits from id_aa64mmfr0_el1 into TCR.IPS */ + bfi x2, x3, #(TCR_IPS_SHIFT), #(TCR_IPS_WIDTH) + and x3, x3, #(ID_AA64MMFR0_ASIDBits_MASK) + + /* Check if the HW supports 16 bit ASIDS */ + cmp x3, #(ID_AA64MMFR0_ASIDBits_16) + /* If so x3 == 1, else x3 == 0 */ cset x3, eq - bfi x2, x3, #36, #1 + /* Set TCR.AS with x3 */ + bfi x2, x3, #(TCR_ASID_SHIFT), #(TCR_ASID_WIDTH) + msr tcr_el1, x2 - /* Setup SCTLR */ + /* + * Setup SCTLR. + */ ldr x2, sctlr_set ldr x3, sctlr_clear mrs x1, sctlr_el1 Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Thu Dec 12 18:16:32 2019 (r355658) +++ head/sys/arm64/include/armreg.h Thu Dec 12 18:27:54 2019 (r355659) @@ -619,9 +619,12 @@ #define PSR_FLAGS 0xf0000000 /* TCR_EL1 - Translation Control Register */ -#define TCR_ASID_16 (0x1UL << 36) +#define TCR_ASID_SHIFT 36 +#define TCR_ASID_WIDTH 1 +#define TCR_ASID_16 (0x1UL << TCR_ASID_SHIFT) #define TCR_IPS_SHIFT 32 +#define TCR_IPS_WIDTH 3 #define TCR_IPS_32BIT (0 << TCR_IPS_SHIFT) #define TCR_IPS_36BIT (1 << TCR_IPS_SHIFT) #define TCR_IPS_40BIT (2 << TCR_IPS_SHIFT) From owner-svn-src-all@freebsd.org Thu Dec 12 18:45:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FF651D878E; Thu, 12 Dec 2019 18:45:32 +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 47YjRJ2Xv3z3yQP; Thu, 12 Dec 2019 18:45:32 +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 3393E45; Thu, 12 Dec 2019 18:45:32 +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 xBCIjWD7075555; Thu, 12 Dec 2019 18:45:32 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCIjVn0075552; Thu, 12 Dec 2019 18:45:31 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201912121845.xBCIjVn0075552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 12 Dec 2019 18:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355660 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 355660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 18:45:32 -0000 Author: trasz Date: Thu Dec 12 18:45:31 2019 New Revision: 355660 URL: https://svnweb.freebsd.org/changeset/base/355660 Log: Add kern_sync(9), and make kernel code call it instead of going via sys_sync(2). Minor cleanup, no functional changes. Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19366 Modified: head/sys/kern/vfs_bio.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Dec 12 18:27:54 2019 (r355659) +++ head/sys/kern/vfs_bio.c Thu Dec 12 18:45:31 2019 (r355660) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -1342,7 +1342,7 @@ bufshutdown(int show_busybufs) * Sync filesystems for shutdown */ wdog_kern_pat(WD_LASTVAL); - sys_sync(curthread, NULL); + kern_sync(curthread); /* * With soft updates, some buffers that are @@ -1369,7 +1369,7 @@ bufshutdown(int show_busybufs) pbusy = nbusy; wdog_kern_pat(WD_LASTVAL); - sys_sync(curthread, NULL); + kern_sync(curthread); #ifdef PREEMPTION /* Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Dec 12 18:27:54 2019 (r355659) +++ head/sys/kern/vfs_syscalls.c Thu Dec 12 18:45:31 2019 (r355660) @@ -114,17 +114,8 @@ static int kern_readlink_vp(struct vnode *vp, char *bu static int kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path, enum uio_seg segflag); -/* - * Sync each mounted filesystem. - */ -#ifndef _SYS_SYSPROTO_H_ -struct sync_args { - int dummy; -}; -#endif -/* ARGSUSED */ int -sys_sync(struct thread *td, struct sync_args *uap) +kern_sync(struct thread *td) { struct mount *mp, *nmp; int save; @@ -149,6 +140,22 @@ sys_sync(struct thread *td, struct sync_args *uap) } mtx_unlock(&mountlist_mtx); return (0); +} + +/* + * Sync each mounted filesystem. + */ +#ifndef _SYS_SYSPROTO_H_ +struct sync_args { + int dummy; +}; +#endif +/* ARGSUSED */ +int +sys_sync(struct thread *td, struct sync_args *uap) +{ + + return (kern_sync(td)); } /* Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Thu Dec 12 18:27:54 2019 (r355659) +++ head/sys/sys/syscallsubr.h Thu Dec 12 18:45:31 2019 (r355660) @@ -276,6 +276,7 @@ int kern_statfs(struct thread *td, const char *path, e struct statfs *buf); int kern_symlinkat(struct thread *td, const char *path1, int fd, const char *path2, enum uio_seg segflg); +int kern_sync(struct thread *td); int kern_ktimer_create(struct thread *td, clockid_t clock_id, struct sigevent *evp, int *timerid, int preset_id); int kern_ktimer_delete(struct thread *, int); From owner-svn-src-all@freebsd.org Thu Dec 12 18:51:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00EFA1D8A36; Thu, 12 Dec 2019 18:51:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47YjZD6HmXz3ytt; Thu, 12 Dec 2019 18:51:32 +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 D32141E6; Thu, 12 Dec 2019 18:51:32 +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 xBCIpW6O079635; Thu, 12 Dec 2019 18:51:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCIpWcw079634; Thu, 12 Dec 2019 18:51:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912121851.xBCIpWcw079634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 12 Dec 2019 18:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355661 - in stable: 11/stand/lua 12/stand/lua X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/stand/lua 12/stand/lua X-SVN-Commit-Revision: 355661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 18:51:33 -0000 Author: kevans Date: Thu Dec 12 18:51:32 2019 New Revision: 355661 URL: https://svnweb.freebsd.org/changeset/base/355661 Log: MFC r354247, r355349: lualoader try_include improvement r354247: lualoader: rewrite try_include using lfs + dofile Actual modules get require()'d in, rather than try_include(). All instances of try_include should be provided with proper hooks/API in the rest of loader to do the work they need to do, since we can't rely on them to exist. Convert this now to lfs + dofile since we won't really be treating them as modules. lfs is required because dofile will properly throw an error if the file doesn't exist, which is not in the spirit of 'optionally included'. Getting out of the pcall game allows us to provide a loader.exit() style call that backs out to the common bits of loader (autoboot sequence unless disabled with a loader.setenv("autoboot_delay", "NO")). The most ideal way identified so far to implement loader.exit() is to throw a special abort-style error that indicates to the caller in interp_lua that we've not actually errored out, just continue execution. Otherwise, we have to hack in logic to bubble up and return from loader.lua without continuing further, which gets kind of ugly depending on the context in which we're aborting. A compat shim is provided temporarily in case the executing loader doesn't yet have loader.lua_path, which was just added in r354246. r355349: lualoader: correct a typo from r354247 r354247 converted try_include to lfs + dofile with the loader.lua_path added just before. Fortunately, there was a hardcoded /boot/lua fallback in case loader.lua_path wasn't being set yet- I typo'd it as loader.lua_paths. Fix the typo. Modified: stable/11/stand/lua/core.lua Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/stand/lua/core.lua Directory Properties: stable/12/ (props changed) Modified: stable/11/stand/lua/core.lua ============================================================================== --- stable/11/stand/lua/core.lua Thu Dec 12 18:45:31 2019 (r355660) +++ stable/11/stand/lua/core.lua Thu Dec 12 18:51:32 2019 (r355661) @@ -69,12 +69,28 @@ end -- try_include will return the loaded module on success, or false and the error -- message on failure. function try_include(module) - local status, ret = pcall(require, module) - -- ret is the module if we succeeded. - if status then - return ret + if module:sub(1, 1) ~= "/" then + local lua_path = loader.lua_path + -- XXX Temporary compat shim; this should be removed once the + -- loader.lua_path export has sufficiently spread. + if lua_path == nil then + lua_path = "/boot/lua" + end + module = lua_path .. "/" .. module + -- We only attempt to append an extension if an absolute path + -- wasn't specified. This assumes that the caller either wants + -- to treat this like it would require() and specify just the + -- base filename, or they know what they're doing as they've + -- specified an absolute path and we shouldn't impede. + if module:match(".lua$") == nil then + module = module .. ".lua" + end end - return false, ret + if lfs.attributes(module, "mode") ~= "file" then + return + end + + return dofile(module) end -- Module exports From owner-svn-src-all@freebsd.org Thu Dec 12 18:51:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73B9B1D8A40; Thu, 12 Dec 2019 18:51:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47YjZF1Zpkz3ytv; Thu, 12 Dec 2019 18:51:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 317E01E7; Thu, 12 Dec 2019 18:51:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBCIpXdc079641; Thu, 12 Dec 2019 18:51:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCIpXsL079640; Thu, 12 Dec 2019 18:51:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912121851.xBCIpXsL079640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 12 Dec 2019 18:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355661 - in stable: 11/stand/lua 12/stand/lua X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/stand/lua 12/stand/lua X-SVN-Commit-Revision: 355661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 18:51:33 -0000 Author: kevans Date: Thu Dec 12 18:51:32 2019 New Revision: 355661 URL: https://svnweb.freebsd.org/changeset/base/355661 Log: MFC r354247, r355349: lualoader try_include improvement r354247: lualoader: rewrite try_include using lfs + dofile Actual modules get require()'d in, rather than try_include(). All instances of try_include should be provided with proper hooks/API in the rest of loader to do the work they need to do, since we can't rely on them to exist. Convert this now to lfs + dofile since we won't really be treating them as modules. lfs is required because dofile will properly throw an error if the file doesn't exist, which is not in the spirit of 'optionally included'. Getting out of the pcall game allows us to provide a loader.exit() style call that backs out to the common bits of loader (autoboot sequence unless disabled with a loader.setenv("autoboot_delay", "NO")). The most ideal way identified so far to implement loader.exit() is to throw a special abort-style error that indicates to the caller in interp_lua that we've not actually errored out, just continue execution. Otherwise, we have to hack in logic to bubble up and return from loader.lua without continuing further, which gets kind of ugly depending on the context in which we're aborting. A compat shim is provided temporarily in case the executing loader doesn't yet have loader.lua_path, which was just added in r354246. r355349: lualoader: correct a typo from r354247 r354247 converted try_include to lfs + dofile with the loader.lua_path added just before. Fortunately, there was a hardcoded /boot/lua fallback in case loader.lua_path wasn't being set yet- I typo'd it as loader.lua_paths. Fix the typo. Modified: stable/12/stand/lua/core.lua Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/stand/lua/core.lua Directory Properties: stable/11/ (props changed) Modified: stable/12/stand/lua/core.lua ============================================================================== --- stable/12/stand/lua/core.lua Thu Dec 12 18:45:31 2019 (r355660) +++ stable/12/stand/lua/core.lua Thu Dec 12 18:51:32 2019 (r355661) @@ -69,12 +69,28 @@ end -- try_include will return the loaded module on success, or false and the error -- message on failure. function try_include(module) - local status, ret = pcall(require, module) - -- ret is the module if we succeeded. - if status then - return ret + if module:sub(1, 1) ~= "/" then + local lua_path = loader.lua_path + -- XXX Temporary compat shim; this should be removed once the + -- loader.lua_path export has sufficiently spread. + if lua_path == nil then + lua_path = "/boot/lua" + end + module = lua_path .. "/" .. module + -- We only attempt to append an extension if an absolute path + -- wasn't specified. This assumes that the caller either wants + -- to treat this like it would require() and specify just the + -- base filename, or they know what they're doing as they've + -- specified an absolute path and we shouldn't impede. + if module:match(".lua$") == nil then + module = module .. ".lua" + end end - return false, ret + if lfs.attributes(module, "mode") ~= "file" then + return + end + + return dofile(module) end -- Module exports From owner-svn-src-all@freebsd.org Thu Dec 12 18:53:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 400541D8B2B; Thu, 12 Dec 2019 18:53:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47Yjcp0wx5z40HG; Thu, 12 Dec 2019 18:53:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AFE9241; Thu, 12 Dec 2019 18:53:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBCIrjqh081311; Thu, 12 Dec 2019 18:53:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCIrjTT081308; Thu, 12 Dec 2019 18:53:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912121853.xBCIrjTT081308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 12 Dec 2019 18:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355662 - in stable: 11/lib/libbe 12/lib/libbe X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libbe 12/lib/libbe X-SVN-Commit-Revision: 355662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 18:53:46 -0000 Author: kevans Date: Thu Dec 12 18:53:45 2019 New Revision: 355662 URL: https://svnweb.freebsd.org/changeset/base/355662 Log: MFC r355460: libbe: fix build against sysutils/openzfs, part 1 This is the half of the changes required that work as-is with both in-tree ZFS and the new hotness, sysutils/openzfs. Highlights are less dependency on header pollution (from somewhere) and using 'mnttab' instead of 'extmnttab'. In the in-tree ZFS, the latter is a #define for the former, but in the port extmnttab is actually a distinct struct that's a super-set of mnttab. We really want mnttab here anyways, so just use it. Modified: stable/11/lib/libbe/be.c stable/11/lib/libbe/be_access.c stable/11/lib/libbe/be_info.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libbe/be.c stable/12/lib/libbe/be_access.c stable/12/lib/libbe/be_info.c Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libbe/be.c ============================================================================== --- stable/11/lib/libbe/be.c Thu Dec 12 18:51:32 2019 (r355661) +++ stable/11/lib/libbe/be.c Thu Dec 12 18:53:45 2019 (r355662) @@ -34,6 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include #include @@ -67,7 +70,7 @@ static int be_locate_rootfs(libbe_handle_t *lbh) { struct statfs sfs; - struct extmnttab entry; + struct mnttab entry; zfs_handle_t *zfs; /* Modified: stable/11/lib/libbe/be_access.c ============================================================================== --- stable/11/lib/libbe/be_access.c Thu Dec 12 18:51:32 2019 (r355661) +++ stable/11/lib/libbe/be_access.c Thu Dec 12 18:53:45 2019 (r355662) @@ -31,6 +31,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "be.h" #include "be_impl.h" Modified: stable/11/lib/libbe/be_info.c ============================================================================== --- stable/11/lib/libbe/be_info.c Thu Dec 12 18:51:32 2019 (r355661) +++ stable/11/lib/libbe/be_info.c Thu Dec 12 18:53:45 2019 (r355662) @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "be.h" #include "be_impl.h" From owner-svn-src-all@freebsd.org Thu Dec 12 18:53:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8F2B1D8B39; Thu, 12 Dec 2019 18:53:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47Yjcp5vpGz40HH; Thu, 12 Dec 2019 18:53:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5F59242; Thu, 12 Dec 2019 18:53:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBCIrkUC081320; Thu, 12 Dec 2019 18:53:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCIrkYM081317; Thu, 12 Dec 2019 18:53:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912121853.xBCIrkYM081317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 12 Dec 2019 18:53:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355662 - in stable: 11/lib/libbe 12/lib/libbe X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libbe 12/lib/libbe X-SVN-Commit-Revision: 355662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 18:53:47 -0000 Author: kevans Date: Thu Dec 12 18:53:45 2019 New Revision: 355662 URL: https://svnweb.freebsd.org/changeset/base/355662 Log: MFC r355460: libbe: fix build against sysutils/openzfs, part 1 This is the half of the changes required that work as-is with both in-tree ZFS and the new hotness, sysutils/openzfs. Highlights are less dependency on header pollution (from somewhere) and using 'mnttab' instead of 'extmnttab'. In the in-tree ZFS, the latter is a #define for the former, but in the port extmnttab is actually a distinct struct that's a super-set of mnttab. We really want mnttab here anyways, so just use it. Modified: stable/12/lib/libbe/be.c stable/12/lib/libbe/be_access.c stable/12/lib/libbe/be_info.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libbe/be.c stable/11/lib/libbe/be_access.c stable/11/lib/libbe/be_info.c Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libbe/be.c ============================================================================== --- stable/12/lib/libbe/be.c Thu Dec 12 18:51:32 2019 (r355661) +++ stable/12/lib/libbe/be.c Thu Dec 12 18:53:45 2019 (r355662) @@ -34,6 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include #include @@ -67,7 +70,7 @@ static int be_locate_rootfs(libbe_handle_t *lbh) { struct statfs sfs; - struct extmnttab entry; + struct mnttab entry; zfs_handle_t *zfs; /* Modified: stable/12/lib/libbe/be_access.c ============================================================================== --- stable/12/lib/libbe/be_access.c Thu Dec 12 18:51:32 2019 (r355661) +++ stable/12/lib/libbe/be_access.c Thu Dec 12 18:53:45 2019 (r355662) @@ -31,6 +31,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "be.h" #include "be_impl.h" Modified: stable/12/lib/libbe/be_info.c ============================================================================== --- stable/12/lib/libbe/be_info.c Thu Dec 12 18:51:32 2019 (r355661) +++ stable/12/lib/libbe/be_info.c Thu Dec 12 18:53:45 2019 (r355662) @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "be.h" #include "be_impl.h" From owner-svn-src-all@freebsd.org Thu Dec 12 19:17:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 272221D8F70; Thu, 12 Dec 2019 19:17:27 +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 47Yk8701cnz41PJ; Thu, 12 Dec 2019 19:17:27 +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 EFFC3611; Thu, 12 Dec 2019 19:17:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBCJHQJs093553; Thu, 12 Dec 2019 19:17:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCJHQKf093552; Thu, 12 Dec 2019 19:17:26 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201912121917.xBCJHQKf093552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 12 Dec 2019 19:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355663 - stable/12/usr.bin/netstat X-SVN-Group: stable-12 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/12/usr.bin/netstat X-SVN-Commit-Revision: 355663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 19:17:27 -0000 Author: bapt Date: Thu Dec 12 19:17:26 2019 New Revision: 355663 URL: https://svnweb.freebsd.org/changeset/base/355663 Log: MFC: r355554 Fix: netstat -rs Routing statistics requires somes symbols that are only loaded when not running live. Load them only in that specific case PR: 242423 Submitted by: olivier Modified: stable/12/usr.bin/netstat/main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/netstat/main.c ============================================================================== --- stable/12/usr.bin/netstat/main.c Thu Dec 12 18:53:45 2019 (r355662) +++ stable/12/usr.bin/netstat/main.c Thu Dec 12 19:17:26 2019 (r355663) @@ -484,6 +484,9 @@ main(int argc, char *argv[]) if (rflag) { xo_open_container("statistics"); if (sflag) { + if (live) { + kresolve_list(nl); + } rt_stats(); } else routepr(fib, af); From owner-svn-src-all@freebsd.org Thu Dec 12 19:17:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BA5B1D8FA0; Thu, 12 Dec 2019 19:17:31 +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 47Yk8B6dg1z41Rd; Thu, 12 Dec 2019 19:17:30 +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 DF083613; Thu, 12 Dec 2019 19:17:30 +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 xBCJHU0X093613; Thu, 12 Dec 2019 19:17:30 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCJHUDu093612; Thu, 12 Dec 2019 19:17:30 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201912121917.xBCJHUDu093612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 12 Dec 2019 19:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355664 - stable/11/usr.bin/netstat X-SVN-Group: stable-11 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/11/usr.bin/netstat X-SVN-Commit-Revision: 355664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 19:17:31 -0000 Author: bapt Date: Thu Dec 12 19:17:30 2019 New Revision: 355664 URL: https://svnweb.freebsd.org/changeset/base/355664 Log: MFC: r355554 Fix: netstat -rs Routing statistics requires somes symbols that are only loaded when not running live. Load them only in that specific case PR: 242423 Submitted by: olivier Modified: stable/11/usr.bin/netstat/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/netstat/main.c ============================================================================== --- stable/11/usr.bin/netstat/main.c Thu Dec 12 19:17:26 2019 (r355663) +++ stable/11/usr.bin/netstat/main.c Thu Dec 12 19:17:30 2019 (r355664) @@ -478,6 +478,9 @@ main(int argc, char *argv[]) if (rflag) { xo_open_container("statistics"); if (sflag) { + if (live) { + kresolve_list(nl); + } rt_stats(); flowtable_stats(); } else From owner-svn-src-all@freebsd.org Thu Dec 12 19:21:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A4361D917E; Thu, 12 Dec 2019 19:21:19 +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 47YkDb155qz41w0; Thu, 12 Dec 2019 19:21:19 +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 07A5A673; Thu, 12 Dec 2019 19:21:19 +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 xBCJLJDX095291; Thu, 12 Dec 2019 19:21:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCJLGSQ095280; Thu, 12 Dec 2019 19:21:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912121921.xBCJLGSQ095280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 12 Dec 2019 19:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355665 - in stable/12/sys: arm/broadcom/bcm2835 arm64/conf conf X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12/sys: arm/broadcom/bcm2835 arm64/conf conf X-SVN-Commit-Revision: 355665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 19:21:19 -0000 Author: kevans Date: Thu Dec 12 19:21:16 2019 New Revision: 355665 URL: https://svnweb.freebsd.org/changeset/base/355665 Log: MFC Collection of Raspberry Pi fixes: r348803-r348804, r354488, r354524, r354560-r354561, r354563, r354577, r354579, r354823, r354825, r354844-r354846, r354868, r354875-r354876, r354930-r354933, r354956, r355016, r355025-r355026, r355031, r355563 r348803 by bz: bcm2835_sdhci.c: save block registers to avoid controller bug Extending what the initial revision, r273264, r276985, r277346 have started for the transfer mode and command registers, another pair of 16bit registers written in sequence are block size and block count, which fall together onto the same 32bit line and hence the same register(s) would be written twice in sequence for those as well. Use a similar approach to transfer mode and command and save the writes to either of the block regiters and then only execute a write once. We can do this as with transfer mode their values are meaningless until a command is issued so we can use that write to command as a trigger to also write out the block registers. Compared to transfer mode and command the value of block count can change, so we need to keep state and actually read the block registers back the first time after a write. r348804 by bz: bcm2835_sdhci.c: exit DMA if not enough data left to avoid timeout errors In the DMA case, given we disable the data interrupts, we never seem to get DATA_END. Given we are relying on DMA interrupts we are not using the SDHCI state machine and hence only call into sdhci_platform_will_handle() for the first check of data. We do not call "will handle" for any following round trips of the same transaction if block size * count > BCM_DMA_BLOCK_SIZE. Manually check "left" in the DMA interrupt handler to see if we have at least another full BCM_DMA_BLOCK_SIZE to handle. Without this change we would DMA that and then even start a DMA with left == 0 which would lead to a timeout and error. Now we re-enable data interrupts and return and let the SDHCI generic interrupt handler and state machine pick the SPACE_AVAIL up and then find that it should punt to the pio_handler for the remaining bytes or finish the data transaction. With this change block mode seems to work beyond 7 * 64byte blocks, which worked as it was below BCM_DMA_BLOCK_SIZE. r354488: bcm_lintc: don't attach if "interrupt-controller" is missing This is a standard required property for interrupt controllers, and present on the bcm_lintc nodes for currently supported RPi models. For the RPi4, we have both bcm_lintc as well as GIC-400, but only one may be active at a time. Don't probe bcm_lintc if it's missing the "interrupt-controller" property -- in RPi 4 DTS, the bcm_lintc node is actually missing this along with other required interrupt properties. Presumably, if the earlier boot stages will support switching to the legacy interrupt controller (as is suggested possible by the documentation), the DTS will need to be updated to indicate the proper interrupt-parent and hopefully also mark this node as an interrupt-controller instead. r354524: bcm2835_dma: Mark IRQs shareable On the RPi4, some of these IRQs are shared. Start moving toward a mode where we accept that shared IRQs happen and simply ignore interrupts that are seemingly for no reason. I would like to be more verbose here, but my 30-minute assessment of the current world order is that mapping a resource/rid to an actual IRQ number (as found in FDT) data is not a simple matter. Determining if more than one handler is attached to an IRQ is closer to feasible, but it's unclear which way is the cleaner path. Beyond that, we're only really using it to be slightly more verbose when something's going wrong, so for now just suppress and drop a complaint-comment. This was originally submitted (via freebsd-arm@) by Robert Crowston; the additional verbosity was dropped by kevans@. r354560: bcm2835_sdhci: add some very basic support for rpi4 DMA is currently disabled while I work out why it's broken, but this is enough for upstream U-Boot + rpi-firmware + our rpi3-psci-monitor to boot with the right config. The RPi 4 is still not in a good "supported" state, as we have no USB/PCI-E/Ethernet drivers, but if air-gapped pies only able to operate over cereal is your thing, here's your guy. r354561: bcm2835_sdhci: remove unused power_id field This was once set, but I removed it by the time I committed it because both configurations use the same POWER_ID. This can be separated back out if the situation changes. r354563: bcm2835: commit missing constant from r354560 Surgically pulling the patch from my debugging work lead to this slopiness- my apologies. r354577: arm64: add SOC_BRCM_BCM2838, build it in GENERIC BCM2838/BCM2711 is the Raspberry Pi 4, which we will soon be able to boot on once some ports bits are worked out. r354579: bcm2835_sdhci: don't panic in DMA interrupt if curcmd went away This is an exceptional case; generally found during controller errors. A panic when we attempt to acess slot->curcmd->data is less ideal than warning, and other verbiage will be emitted to indicate the exact error. r354823: bcm2835_sdhci: push DATA_END handling out of DMA interrupt path This simplifies the DMA interrupt handler quite a bit. The sdhci framework will call platform_finish_transfer() if it's received SDHCI_INT_DATA_END, so we can take care of any final cleanup there and simply not worry about the possibility of it ending in the DMA interrupt path. r354825: bcm2835_sdhci: use a macro for interrupts we handle This is just further simplification, very little functional change. In the DMA interrupt handler, we *do* now acknowledge both DATA_AVAIL | SPACE_AVAIL every time -- these operations are mutually exclusive, so while this is a functional change, it's effectively a nop. Removing the 'mask' local allows us to further simplify in a future change. r354844: bcm2835_sdhci: drop an assert in start_dma_seg Trivial change to clarify locking expectations... no functional change. r354845: bcm2835_sdhci: some style cleanup, no functional change r354846: bcm2835_sdhci: formalize DMA tag/segment scaling requirements This allows easy and care-free scaling of NUM_DMA_SEGS with proper-ish calculations to make sure we can actually handle the number of segments we'd like to handle on average so that performance comparisons can be easily made at different values if/once we can actually handle it. It also makes it helps the untrained reader understand more quickly the reasoning behind the choice of maxsize/maxsegs/maxsegsize. r354868: bcm2835_sdhci: various refactoring of DMA path This round of refactoring is mostly about streamlining the interrupt handler to make it easier to verify and reason about operations taking place while trying to bring FreeBSD up on the RPi4. r354875: bcm2835: push address mapping conversion for DMA/mailbox to runtime We could maintain the static conversions for the !AArch64 Raspberry Pis, but I'm not sure it's worth it -- we'll traverse the platform list exactly once (of which there are only two for armv7), then every conversion there-after traverses the memory map listing of which there are at-most two entries for these boards: sdram and peripheral space. Detecting this at runtime is necessary for the AArch64 SOC, though, because of the distinct IO windows being otherwise not discernible just from support compiled into the kernel. We currently select the correct window based on /compatible in the FDT. We also use a similar mechanism to describe the DMA restrictions- the RPi 4 can have up to 4GB of RAM while the DMA controller and mailbox mechanism can technically, kind of, only access the lowest 1GB. See the comment in bcm2835_vcbus.h for a fun description/clarification of this. r354876: bcm2835_vcbus: add compatibility name for ^/sys/contrib/vchiq It's unclear how this didn't get caught in my last iteration, but the fix is easy- the interface is still compatible, it was just gratuituously renamed to match my arbitrary definition of consistency... VCBUS, the BCM2835 name, represents an address on the VideoCore CPU Bus. In a similar fashion, while it is a physical address, the ARMC portion represents that these are addresses as seen by the ARM CPU. To make things even more fun, the BCM2711 peripheral documentation describes not virtual address space vs. physical address space, but instead the 32-bit address map vs. the address map in "Low Peripheral" mode. The latter of these is what the *ARMC* macros translate to/from. r354930: bcm2835_sdhci: clean up DMA segments in error handling path Later parts assume that this would've been done if interrupts are enabled, but this is the only case in which that wouldn't have been true. This commit also reorders operations such that we're done touching slot/slot->intmask before we call back into the SDHCI framework and exit. r354931: Revert r354930: wrong diff, right message. r354932: bcm2835_sdhci: roll back r354823 r354823 kicked DATA_END handling out of the DMA interrupt path "to make things easy", but this was likely a mistake -- if we know we're done after we've finished pending DMA operations, we should go ahead and acknowledge it rather than waiting for the controller to finalize it. If it's not ready, we'll simply re-enable interrupts and wait for it anyways, to be re-entered in sdhci_data_intr. r354933: bcm2835_sdhci: clean up DMA segments in error handling path Later parts assume that this would've been done if interrupts are enabled, but this is the only case in which that wouldn't have been true. This commit also reorders operations such that we're done touching slot/slot->intmask before we call back into the SDHCI framework and exit. r354956: bcm2835_sdhci: only inspect interrupts we handle We'll write the value we read back to ack pending interrupts, but we should at least make it clear to ourselves that we only want to ack pending transfer interrupts. r355016: bcm2835_vcbus: add the *other* rpi4 compat string The DTS I used initially had brcm,bcm2838; the new one uses brcm,bcm2711. Add that one as well. r355025: bcm2835_sdhci: "fix" DMA on the RPi 4 According to the documentation I have, DREQ pacing should be required here. The DREQ# hasn't changed since the BCM2835. As soon as we attempt to setup DREQ, DMA stalls and there's no clear reason why as of yet. Setting this back to NONE seems to work just as well, though it's yet to be determined if this is a sustainable model in high-throughput scenarios. r355026: bcm2835_dma: rip out the "use_dma" flag, make it non-optional Now that it works for the Raspberry Pi 4, we can discontinue our workarounds that were put in place to at least get a bootable kernel for other testing. r355031: bcm2835_sdhci: fix non-INVARIANTS build sc is now only used to make sure we're not re-entering the data handling path erroneously. r355563: RPI: Fix DMA/SDHCI on the BCM2836 (Raspberry Pi 2) r354875 pushed VCBUS <-> ARMC translations to runtime determination, but incorrectly mapped addresses for the BCM2836 -- SOC_BCM2835 and SOC_BCM2836 are actually mutually exclusive, so the BCM2836 config (GENERIC) would have taken the latter path in the header and used 0x3f000000 as peripheral start. Easily fixed -- split out the BCM2836 into its own memmap config and use that instead if SOC_BCM2836 is included. With this, we get back to userland again. Added: stable/12/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c - copied, changed from r354876, head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_dma.c stable/12/sys/arm/broadcom/bcm2835/bcm2835_dma.h stable/12/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox.c stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h stable/12/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c stable/12/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h stable/12/sys/arm/broadcom/bcm2835/bcm2836.c stable/12/sys/arm/broadcom/bcm2835/files.bcm283x stable/12/sys/arm64/conf/GENERIC stable/12/sys/conf/files.arm64 stable/12/sys/conf/options.arm64 Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_dma.c ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_dma.c Thu Dec 12 19:17:30 2019 (r355664) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_dma.c Thu Dec 12 19:21:16 2019 (r355665) @@ -169,7 +169,7 @@ bcm_dmamap_cb(void *arg, bus_dma_segment_t *segs, return; addr = (bus_addr_t*)arg; - *addr = PHYS_TO_VCBUS(segs[0].ds_addr); + *addr = ARMC_TO_VCBUS(segs[0].ds_addr); } static void @@ -247,8 +247,12 @@ bcm_dma_init(device_t dev) if ((reg & bcm_dma_channel_mask) != 0) device_printf(dev, "statuses are not cleared\n"); - /* Allocate DMA chunks control blocks */ - /* p.40 of spec - control block should be 32-bit aligned */ + /* + * Allocate DMA chunks control blocks based on p.40 of the peripheral + * spec - control block should be 32-bit aligned. The DMA controller + * has a full 32-bit register dedicated to this address, so we do not + * need to bother with the per-SoC peripheral restrictions. + */ err = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, @@ -561,14 +565,9 @@ bcm_dma_start(int ch, vm_paddr_t src, vm_paddr_t dst, return (-1); cb = sc->sc_dma_ch[ch].cb; - if (BCM2835_ARM_IS_IO(src)) - cb->src = IO_TO_VCBUS(src); - else - cb->src = PHYS_TO_VCBUS(src); - if (BCM2835_ARM_IS_IO(dst)) - cb->dst = IO_TO_VCBUS(dst); - else - cb->dst = PHYS_TO_VCBUS(dst); + cb->src = ARMC_TO_VCBUS(src); + cb->dst = ARMC_TO_VCBUS(dst); + cb->len = len; bus_dmamap_sync(sc->sc_dma_tag, @@ -619,18 +618,18 @@ bcm_dma_intr(void *arg) /* my interrupt? */ cs = bus_read_4(sc->sc_mem, BCM_DMA_CS(ch->ch)); - if (!(cs & (CS_INT | CS_ERR))) { - device_printf(sc->sc_dev, - "unexpected DMA intr CH=%d, CS=%x\n", ch->ch, cs); + /* + * Is it an active channel? Our diagnostics could be better here, but + * it's not necessarily an easy task to resolve a rid/resource to an + * actual irq number. We'd want to do this to set a flag indicating + * whether the irq is shared or not, so we know to complain. + */ + if (!(ch->flags & BCM_DMA_CH_USED)) return; - } - /* running? */ - if (!(ch->flags & BCM_DMA_CH_USED)) { - device_printf(sc->sc_dev, - "unused DMA intr CH=%d, CS=%x\n", ch->ch, cs); + /* Again, we can't complain here. The same logic applies. */ + if (!(cs & (CS_INT | CS_ERR))) return; - } if (cs & CS_ERR) { debug = bus_read_4(sc->sc_mem, BCM_DMA_DEBUG(ch->ch)); @@ -715,7 +714,7 @@ bcm_dma_attach(device_t dev) continue; sc->sc_irq[rid] = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_ACTIVE); + RF_ACTIVE | RF_SHAREABLE); if (sc->sc_irq[rid] == NULL) { device_printf(dev, "cannot allocate interrupt\n"); err = ENXIO; Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_dma.h ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_dma.h Thu Dec 12 19:17:30 2019 (r355664) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_dma.h Thu Dec 12 19:21:16 2019 (r355665) @@ -42,6 +42,10 @@ /* Peripheral DREQ Signals (4.2.1.3) */ #define BCM_DMA_DREQ_NONE 0 +/* + * XXX This doesn't seem to work for the Raspberry Pi 4, but the peripheral + * documentation still lists it at 11. + */ #define BCM_DMA_DREQ_EMMC 11 #define BCM_DMA_DREQ_SDHOST 13 Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c Thu Dec 12 19:17:30 2019 (r355664) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c Thu Dec 12 19:21:16 2019 (r355665) @@ -227,7 +227,7 @@ ft5406ts_init(void *arg) return; } - touchbuf = VCBUS_TO_PHYS(msg.body.resp.address); + touchbuf = VCBUS_TO_ARMC(msg.body.resp.address); sc->touch_buf = (uint8_t*)pmap_mapdev(touchbuf, FT5406_WINDOW_SIZE); /* 60Hz */ Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Thu Dec 12 19:17:30 2019 (r355664) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Thu Dec 12 19:21:16 2019 (r355665) @@ -303,7 +303,7 @@ bcm2835_mbox_dma_cb(void *arg, bus_dma_segment_t *segs if (err) return; addr = (bus_addr_t *)arg; - *addr = PHYS_TO_VCBUS(segs[0].ds_addr); + *addr = ARMC_TO_VCBUS(segs[0].ds_addr); } static void * @@ -314,7 +314,7 @@ bcm2835_mbox_init_dma(device_t dev, size_t len, bus_dm int err; err = bus_dma_tag_create(bus_get_dma_tag(dev), 16, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + bcm283x_dmabus_peripheral_lowaddr(), BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, NULL, NULL, tag); if (err != 0) { device_printf(dev, "can't create DMA tag\n"); @@ -534,7 +534,7 @@ bcm2835_mbox_fb_init(struct bcm2835_fb_config *fb) fb->xoffset = msg.offset.body.resp.x; fb->yoffset = msg.offset.body.resp.y; fb->pitch = msg.pitch.body.resp.pitch; - fb->base = VCBUS_TO_PHYS(msg.buffer.body.resp.fb_address); + fb->base = VCBUS_TO_ARMC(msg.buffer.body.resp.fb_address); fb->size = msg.buffer.body.resp.fb_size; } Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Thu Dec 12 19:17:30 2019 (r355664) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Thu Dec 12 19:21:16 2019 (r355665) @@ -118,6 +118,7 @@ int bcm2835_mbox_set_power_state(uint32_t, boolean_t); #define BCM2835_MBOX_CLOCK_ID_SDRAM 0x00000008 #define BCM2835_MBOX_CLOCK_ID_PIXEL 0x00000009 #define BCM2835_MBOX_CLOCK_ID_PWM 0x0000000a +#define BCM2838_MBOX_CLOCK_ID_EMMC2 0x0000000c #define BCM2835_MBOX_TAG_GET_CLOCK_RATE 0x00030002 #define BCM2835_MBOX_TAG_SET_CLOCK_RATE 0x00038002 Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Thu Dec 12 19:17:30 2019 (r355664) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Thu Dec 12 19:21:16 2019 (r355665) @@ -58,13 +58,37 @@ __FBSDID("$FreeBSD$"); #include "bcm2835_dma.h" #include -#include "bcm2835_vcbus.h" +#ifdef NOTYET +#include +#endif +#include #define BCM2835_DEFAULT_SDHCI_FREQ 50 +#define BCM2838_DEFAULT_SDHCI_FREQ 100 #define BCM_SDHCI_BUFFER_SIZE 512 -#define NUM_DMA_SEGS 2 +/* + * NUM_DMA_SEGS is the number of DMA segments we want to accommodate on average. + * We add in a number of segments based on how much we may need to spill into + * another segment due to crossing page boundaries. e.g. up to PAGE_SIZE, an + * extra page is needed as we can cross a page boundary exactly once. + */ +#define NUM_DMA_SEGS 1 +#define NUM_DMA_SPILL_SEGS \ + ((((NUM_DMA_SEGS * BCM_SDHCI_BUFFER_SIZE) - 1) / PAGE_SIZE) + 1) +#define ALLOCATED_DMA_SEGS (NUM_DMA_SEGS + NUM_DMA_SPILL_SEGS) +#define BCM_DMA_MAXSIZE (NUM_DMA_SEGS * BCM_SDHCI_BUFFER_SIZE) +#define BCM_SDHCI_SLOT_LEFT(slot) \ + ((slot)->curcmd->data->len - (slot)->offset) + +#define BCM_SDHCI_SEGSZ_LEFT(slot) \ + min(BCM_DMA_MAXSIZE, \ + rounddown(BCM_SDHCI_SLOT_LEFT(slot), BCM_SDHCI_BUFFER_SIZE)) + +#define DATA_PENDING_MASK (SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL) +#define DATA_XFER_MASK (DATA_PENDING_MASK | SDHCI_INT_DATA_END) + #ifdef DEBUG static int bcm2835_sdhci_debug = 0; @@ -84,10 +108,38 @@ SYSCTL_INT(_hw_sdhci, OID_AUTO, bcm2835_sdhci_debug, C static int bcm2835_sdhci_hs = 1; static int bcm2835_sdhci_pio_mode = 0; +struct bcm_mmc_conf { + int clock_id; + int clock_src; + int default_freq; + int quirks; + int emmc_dreq; +}; + +struct bcm_mmc_conf bcm2835_sdhci_conf = { + .clock_id = BCM2835_MBOX_CLOCK_ID_EMMC, + .clock_src = -1, + .default_freq = BCM2835_DEFAULT_SDHCI_FREQ, + .quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | + SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | SDHCI_QUIRK_DONT_SET_HISPD_BIT | + SDHCI_QUIRK_MISSING_CAPS, + .emmc_dreq = BCM_DMA_DREQ_EMMC, +}; + +struct bcm_mmc_conf bcm2838_emmc2_conf = { + .clock_id = BCM2838_MBOX_CLOCK_ID_EMMC2, + .clock_src = -1, + .default_freq = BCM2838_DEFAULT_SDHCI_FREQ, + .quirks = 0, + .emmc_dreq = BCM_DMA_DREQ_NONE, +}; + static struct ofw_compat_data compat_data[] = { - {"broadcom,bcm2835-sdhci", 1}, - {"brcm,bcm2835-sdhci", 1}, - {"brcm,bcm2835-mmc", 1}, + {"broadcom,bcm2835-sdhci", (uintptr_t)&bcm2835_sdhci_conf}, + {"brcm,bcm2835-sdhci", (uintptr_t)&bcm2835_sdhci_conf}, + {"brcm,bcm2835-mmc", (uintptr_t)&bcm2835_sdhci_conf}, + {"brcm,bcm2711-emmc2", (uintptr_t)&bcm2838_emmc2_conf}, + {"brcm,bcm2838-emmc2", (uintptr_t)&bcm2838_emmc2_conf}, {NULL, 0} }; @@ -107,12 +159,18 @@ struct bcm_sdhci_softc { bus_dma_tag_t sc_dma_tag; bus_dmamap_t sc_dma_map; vm_paddr_t sc_sdhci_buffer_phys; - uint32_t cmd_and_mode; - bus_addr_t dmamap_seg_addrs[NUM_DMA_SEGS]; - bus_size_t dmamap_seg_sizes[NUM_DMA_SEGS]; + bus_addr_t dmamap_seg_addrs[ALLOCATED_DMA_SEGS]; + bus_size_t dmamap_seg_sizes[ALLOCATED_DMA_SEGS]; int dmamap_seg_count; int dmamap_seg_index; int dmamap_status; + uint32_t blksz_and_count; + uint32_t cmd_and_mode; + bool need_update_blk; +#ifdef NOTYET + device_t clkman; +#endif + struct bcm_mmc_conf * conf; }; static int bcm_sdhci_probe(device_t); @@ -122,6 +180,7 @@ static void bcm_sdhci_intr(void *); static int bcm_sdhci_get_ro(device_t, device_t); static void bcm_sdhci_dma_intr(int ch, void *arg); +static void bcm_sdhci_start_dma(struct sdhci_slot *slot); static void bcm_sdhci_dmacb(void *arg, bus_dma_segment_t *segs, int nseg, int err) @@ -129,6 +188,8 @@ bcm_sdhci_dmacb(void *arg, bus_dma_segment_t *segs, in struct bcm_sdhci_softc *sc = arg; int i; + /* Sanity check: we can only ever have one mapping at a time. */ + KASSERT(sc->dmamap_seg_count == 0, ("leaked DMA segment")); sc->dmamap_status = err; sc->dmamap_seg_count = nseg; @@ -166,8 +227,12 @@ bcm_sdhci_attach(device_t dev) sc->sc_dev = dev; sc->sc_req = NULL; - err = bcm2835_mbox_set_power_state(BCM2835_MBOX_POWER_ID_EMMC, - TRUE); + sc->conf = (struct bcm_mmc_conf *)ofw_bus_search_compatible(dev, + compat_data)->ocd_data; + if (sc->conf == 0) + return (ENXIO); + + err = bcm2835_mbox_set_power_state(BCM2835_MBOX_POWER_ID_EMMC, TRUE); if (err != 0) { if (bootverbose) device_printf(dev, "Unable to enable the power\n"); @@ -175,8 +240,7 @@ bcm_sdhci_attach(device_t dev) } default_freq = 0; - err = bcm2835_mbox_get_clock_rate(BCM2835_MBOX_CLOCK_ID_EMMC, - &default_freq); + err = bcm2835_mbox_get_clock_rate(sc->conf->clock_id, &default_freq); if (err == 0) { /* Convert to MHz */ default_freq /= 1000000; @@ -188,11 +252,31 @@ bcm_sdhci_attach(device_t dev) default_freq = cell / 1000000; } if (default_freq == 0) - default_freq = BCM2835_DEFAULT_SDHCI_FREQ; + default_freq = sc->conf->default_freq; if (bootverbose) device_printf(dev, "SDHCI frequency: %dMHz\n", default_freq); +#ifdef NOTYET + if (sc->conf->clock_src > 0) { + uint32_t f; + sc->clkman = devclass_get_device( + devclass_find("bcm2835_clkman"), 0); + if (sc->clkman == NULL) { + device_printf(dev, "cannot find Clock Manager\n"); + return (ENXIO); + } + f = bcm2835_clkman_set_frequency(sc->clkman, + sc->conf->clock_src, default_freq); + if (f == 0) + return (EINVAL); + + if (bootverbose) + device_printf(dev, "Clock source frequency: %dMHz\n", + f); + } +#endif + rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -207,7 +291,7 @@ bcm_sdhci_attach(device_t dev) rid = 0; sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_ACTIVE); + RF_ACTIVE | RF_SHAREABLE); if (!sc->sc_irq_res) { device_printf(dev, "cannot allocate interrupt\n"); err = ENXIO; @@ -228,24 +312,27 @@ bcm_sdhci_attach(device_t dev) if (bcm2835_sdhci_hs) sc->sc_slot.caps |= SDHCI_CAN_DO_HISPD; sc->sc_slot.caps |= (default_freq << SDHCI_CLOCK_BASE_SHIFT); - sc->sc_slot.quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK - | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL - | SDHCI_QUIRK_DONT_SET_HISPD_BIT - | SDHCI_QUIRK_MISSING_CAPS; - + sc->sc_slot.quirks = sc->conf->quirks; + sdhci_init_slot(dev, &sc->sc_slot, 0); sc->sc_dma_ch = bcm_dma_allocate(BCM_DMA_CH_ANY); if (sc->sc_dma_ch == BCM_DMA_CH_INVALID) goto fail; - bcm_dma_setup_intr(sc->sc_dma_ch, bcm_sdhci_dma_intr, sc); + err = bcm_dma_setup_intr(sc->sc_dma_ch, bcm_sdhci_dma_intr, sc); + if (err != 0) { + device_printf(dev, + "cannot setup dma interrupt handler\n"); + err = ENXIO; + goto fail; + } /* Allocate bus_dma resources. */ err = bus_dma_tag_create(bus_get_dma_tag(dev), - 1, 0, BUS_SPACE_MAXADDR_32BIT, + 1, 0, bcm283x_dmabus_peripheral_lowaddr(), BUS_SPACE_MAXADDR, NULL, NULL, - BCM_SDHCI_BUFFER_SIZE, NUM_DMA_SEGS, BCM_SDHCI_BUFFER_SIZE, + BCM_DMA_MAXSIZE, ALLOCATED_DMA_SEGS, BCM_SDHCI_BUFFER_SIZE, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->sc_dma_tag); @@ -269,6 +356,10 @@ bcm_sdhci_attach(device_t dev) sdhci_start_slot(&sc->sc_slot); + /* Seed our copies. */ + sc->blksz_and_count = SDHCI_READ_4(dev, &sc->sc_slot, SDHCI_BLOCK_SIZE); + sc->cmd_and_mode = SDHCI_READ_4(dev, &sc->sc_slot, SDHCI_TRANSFER_MODE); + return (0); fail: @@ -319,7 +410,7 @@ WR4(struct bcm_sdhci_softc *sc, bus_size_t off, uint32 /* * The Arasan HC has a bug where it may lose the content of * consecutive writes to registers that are within two SD-card - * clock cycles of each other (a clock domain crossing problem). + * clock cycles of each other (a clock domain crossing problem). */ if (sc->sc_slot.clock > 0) DELAY(((2 * 1000000) / sc->sc_slot.clock) + 1); @@ -338,17 +429,21 @@ static uint16_t bcm_sdhci_read_2(device_t dev, struct sdhci_slot *slot, bus_size_t off) { struct bcm_sdhci_softc *sc = device_get_softc(dev); - uint32_t val = RD4(sc, off & ~3); + uint32_t val32; /* - * Standard 32-bit handling of command and transfer mode. + * Standard 32-bit handling of command and transfer mode, as + * well as block size and count. */ - if (off == SDHCI_TRANSFER_MODE) { - return (sc->cmd_and_mode >> 16); - } else if (off == SDHCI_COMMAND_FLAGS) { - return (sc->cmd_and_mode & 0x0000ffff); - } - return ((val >> (off & 3)*8) & 0xffff); + if ((off == SDHCI_BLOCK_SIZE || off == SDHCI_BLOCK_COUNT) && + sc->need_update_blk) + val32 = sc->blksz_and_count; + else if (off == SDHCI_TRANSFER_MODE || off == SDHCI_COMMAND_FLAGS) + val32 = sc->cmd_and_mode; + else + val32 = RD4(sc, off & ~3); + + return ((val32 >> (off & 3)*8) & 0xffff); } static uint32_t @@ -369,7 +464,8 @@ bcm_sdhci_read_multi_4(device_t dev, struct sdhci_slot } static void -bcm_sdhci_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint8_t val) +bcm_sdhci_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint8_t val) { struct bcm_sdhci_softc *sc = device_get_softc(dev); uint32_t val32 = RD4(sc, off & ~3); @@ -379,27 +475,54 @@ bcm_sdhci_write_1(device_t dev, struct sdhci_slot *slo } static void -bcm_sdhci_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint16_t val) +bcm_sdhci_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint16_t val) { struct bcm_sdhci_softc *sc = device_get_softc(dev); uint32_t val32; - if (off == SDHCI_COMMAND_FLAGS) + + /* + * If we have a queued up 16bit value for blk size or count, use and + * update the saved value rather than doing any real register access. + * If we did not touch either since the last write, then read from + * register as at least block count can change. + * Similarly, if we are about to issue a command, always use the saved + * value for transfer mode as we can never write that without issuing + * a command. + */ + if ((off == SDHCI_BLOCK_SIZE || off == SDHCI_BLOCK_COUNT) && + sc->need_update_blk) + val32 = sc->blksz_and_count; + else if (off == SDHCI_COMMAND_FLAGS) val32 = sc->cmd_and_mode; else val32 = RD4(sc, off & ~3); + val32 &= ~(0xffff << (off & 3)*8); val32 |= (val << (off & 3)*8); + if (off == SDHCI_TRANSFER_MODE) sc->cmd_and_mode = val32; - else { - WR4(sc, off & ~3, val32); - if (off == SDHCI_COMMAND_FLAGS) + else if (off == SDHCI_BLOCK_SIZE || off == SDHCI_BLOCK_COUNT) { + sc->blksz_and_count = val32; + sc->need_update_blk = true; + } else { + if (off == SDHCI_COMMAND_FLAGS) { + /* If we saved blk writes, do them now before cmd. */ + if (sc->need_update_blk) { + WR4(sc, SDHCI_BLOCK_SIZE, sc->blksz_and_count); + sc->need_update_blk = false; + } + /* Always save cmd and mode registers. */ sc->cmd_and_mode = val32; + } + WR4(sc, off & ~3, val32); } } static void -bcm_sdhci_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint32_t val) +bcm_sdhci_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint32_t val) { struct bcm_sdhci_softc *sc = device_get_softc(dev); WR4(sc, off, val); @@ -419,27 +542,35 @@ bcm_sdhci_start_dma_seg(struct bcm_sdhci_softc *sc) { struct sdhci_slot *slot; vm_paddr_t pdst, psrc; - int err, idx, len, sync_op; + int err, idx, len, sync_op, width; slot = &sc->sc_slot; + mtx_assert(&slot->mtx, MA_OWNED); idx = sc->dmamap_seg_index++; len = sc->dmamap_seg_sizes[idx]; slot->offset += len; + width = (len & 0xf ? BCM_DMA_32BIT : BCM_DMA_128BIT); if (slot->curcmd->data->flags & MMC_DATA_READ) { - bcm_dma_setup_src(sc->sc_dma_ch, BCM_DMA_DREQ_EMMC, - BCM_DMA_SAME_ADDR, BCM_DMA_32BIT); + /* + * Peripherals on the AXI bus do not need DREQ pacing for reads + * from the ARM core, so we can safely set this to NONE. + */ + bcm_dma_setup_src(sc->sc_dma_ch, BCM_DMA_DREQ_NONE, + BCM_DMA_SAME_ADDR, BCM_DMA_32BIT); bcm_dma_setup_dst(sc->sc_dma_ch, BCM_DMA_DREQ_NONE, - BCM_DMA_INC_ADDR, - (len & 0xf) ? BCM_DMA_32BIT : BCM_DMA_128BIT); + BCM_DMA_INC_ADDR, width); psrc = sc->sc_sdhci_buffer_phys; pdst = sc->dmamap_seg_addrs[idx]; sync_op = BUS_DMASYNC_PREREAD; } else { + /* + * The ordering here is important, because the last write to + * dst/src in the dma control block writes the real dreq value. + */ bcm_dma_setup_src(sc->sc_dma_ch, BCM_DMA_DREQ_NONE, - BCM_DMA_INC_ADDR, - (len & 0xf) ? BCM_DMA_32BIT : BCM_DMA_128BIT); - bcm_dma_setup_dst(sc->sc_dma_ch, BCM_DMA_DREQ_EMMC, + BCM_DMA_INC_ADDR, width); + bcm_dma_setup_dst(sc->sc_dma_ch, sc->conf->emmc_dreq, BCM_DMA_SAME_ADDR, BCM_DMA_32BIT); psrc = sc->dmamap_seg_addrs[idx]; pdst = sc->sc_sdhci_buffer_phys; @@ -453,9 +584,9 @@ bcm_sdhci_start_dma_seg(struct bcm_sdhci_softc *sc) */ if (idx == 0) { bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map, sync_op); - slot->intmask &= ~(SDHCI_INT_DATA_AVAIL | - SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DATA_END); - bcm_sdhci_write_4(sc->sc_dev, &sc->sc_slot, SDHCI_SIGNAL_ENABLE, + + slot->intmask &= ~DATA_XFER_MASK; + bcm_sdhci_write_4(sc->sc_dev, slot, SDHCI_SIGNAL_ENABLE, slot->intmask); } @@ -468,15 +599,47 @@ bcm_sdhci_start_dma_seg(struct bcm_sdhci_softc *sc) } static void +bcm_sdhci_dma_exit(struct bcm_sdhci_softc *sc) +{ + struct sdhci_slot *slot = &sc->sc_slot; + + mtx_assert(&slot->mtx, MA_OWNED); + + /* Re-enable interrupts */ + slot->intmask |= DATA_XFER_MASK; + bcm_sdhci_write_4(slot->bus, slot, SDHCI_SIGNAL_ENABLE, + slot->intmask); +} + +static void +bcm_sdhci_dma_unload(struct bcm_sdhci_softc *sc) +{ + struct sdhci_slot *slot = &sc->sc_slot; + + if (sc->dmamap_seg_count == 0) + return; + if ((slot->curcmd->data->flags & MMC_DATA_READ) != 0) + bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map, + BUS_DMASYNC_POSTREAD); + else + bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->sc_dma_tag, sc->sc_dma_map); + + sc->dmamap_seg_count = 0; + sc->dmamap_seg_index = 0; +} + +static void bcm_sdhci_dma_intr(int ch, void *arg) { struct bcm_sdhci_softc *sc = (struct bcm_sdhci_softc *)arg; struct sdhci_slot *slot = &sc->sc_slot; - uint32_t reg, mask; - int left, sync_op; + uint32_t reg; mtx_lock(&slot->mtx); - + if (slot->curcmd == NULL) + goto out; /* * If there are more segments for the current dma, start the next one. * Otherwise unload the dma map and decide what to do next based on the @@ -484,93 +647,64 @@ bcm_sdhci_dma_intr(int ch, void *arg) */ if (sc->dmamap_seg_index < sc->dmamap_seg_count) { bcm_sdhci_start_dma_seg(sc); - mtx_unlock(&slot->mtx); - return; + goto out; } - if (slot->curcmd->data->flags & MMC_DATA_READ) { - sync_op = BUS_DMASYNC_POSTREAD; - mask = SDHCI_INT_DATA_AVAIL; - } else { - sync_op = BUS_DMASYNC_POSTWRITE; - mask = SDHCI_INT_SPACE_AVAIL; - } - bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map, sync_op); - bus_dmamap_unload(sc->sc_dma_tag, sc->sc_dma_map); + bcm_sdhci_dma_unload(sc); - sc->dmamap_seg_count = 0; - sc->dmamap_seg_index = 0; + /* + * If we had no further segments pending, we need to determine how to + * proceed next. If the 'data/space pending' bit is already set and we + * can continue via DMA, do so. Otherwise, re-enable interrupts and + * return. + */ + reg = bcm_sdhci_read_4(slot->bus, slot, SDHCI_INT_STATUS) & + DATA_XFER_MASK; + if ((reg & DATA_PENDING_MASK) != 0 && + BCM_SDHCI_SEGSZ_LEFT(slot) >= BCM_SDHCI_BUFFER_SIZE) { + /* ACK any pending interrupts */ + bcm_sdhci_write_4(slot->bus, slot, SDHCI_INT_STATUS, + DATA_PENDING_MASK); - left = min(BCM_SDHCI_BUFFER_SIZE, - slot->curcmd->data->len - slot->offset); - - /* DATA END? */ - reg = bcm_sdhci_read_4(slot->bus, slot, SDHCI_INT_STATUS); - - if (reg & SDHCI_INT_DATA_END) { - /* ACK for all outstanding interrupts */ - bcm_sdhci_write_4(slot->bus, slot, SDHCI_INT_STATUS, reg); - - /* enable INT */ - slot->intmask |= SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL - | SDHCI_INT_DATA_END; - bcm_sdhci_write_4(slot->bus, slot, SDHCI_SIGNAL_ENABLE, - slot->intmask); - - /* finish this data */ - sdhci_finish_data(slot); - } - else { - /* already available? */ - if (reg & mask) { - - /* ACK for DATA_AVAIL or SPACE_AVAIL */ - bcm_sdhci_write_4(slot->bus, slot, - SDHCI_INT_STATUS, mask); - - /* continue next DMA transfer */ - if (bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map, - (uint8_t *)slot->curcmd->data->data + - slot->offset, left, bcm_sdhci_dmacb, sc, - BUS_DMA_NOWAIT) != 0 || sc->dmamap_status != 0) { - slot->curcmd->error = MMC_ERR_NO_MEMORY; - sdhci_finish_data(slot); - } else { - bcm_sdhci_start_dma_seg(sc); - } - } else { - /* wait for next data by INT */ - - /* enable INT */ - slot->intmask |= SDHCI_INT_DATA_AVAIL | - SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DATA_END; - bcm_sdhci_write_4(slot->bus, slot, SDHCI_SIGNAL_ENABLE, - slot->intmask); + bcm_sdhci_start_dma(slot); + if (slot->curcmd->error != 0) { + /* We won't recover from this error for this command. */ + bcm_sdhci_dma_unload(sc); + bcm_sdhci_dma_exit(sc); + sdhci_finish_data(slot); } + } else if ((reg & SDHCI_INT_DATA_END) != 0) { + bcm_sdhci_dma_exit(sc); + bcm_sdhci_write_4(slot->bus, slot, SDHCI_INT_STATUS, + reg); + slot->flags &= ~PLATFORM_DATA_STARTED; + sdhci_finish_data(slot); + } else { + bcm_sdhci_dma_exit(sc); } - +out: mtx_unlock(&slot->mtx); } static void -bcm_sdhci_read_dma(device_t dev, struct sdhci_slot *slot) +bcm_sdhci_start_dma(struct sdhci_slot *slot) { struct bcm_sdhci_softc *sc = device_get_softc(slot->bus); + uint8_t *buf; size_t left; - if (sc->dmamap_seg_count != 0) { - device_printf(sc->sc_dev, "DMA in use\n"); - return; - } + mtx_assert(&slot->mtx, MA_OWNED); - left = min(BCM_SDHCI_BUFFER_SIZE, - slot->curcmd->data->len - slot->offset); + left = BCM_SDHCI_SEGSZ_LEFT(slot); + buf = (uint8_t *)slot->curcmd->data->data + slot->offset; + KASSERT(left != 0, + ("%s: DMA handling incorrectly indicated", __func__)); - KASSERT((left & 3) == 0, - ("%s: len = %zu, not word-aligned", __func__, left)); - - if (bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map, - (uint8_t *)slot->curcmd->data->data + slot->offset, left, + /* + * No need to check segment count here; if we've not yet unloaded + * previous segments, we'll catch that in bcm_sdhci_dmacb. + */ + if (bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map, buf, left, bcm_sdhci_dmacb, sc, BUS_DMA_NOWAIT) != 0 || sc->dmamap_status != 0) { slot->curcmd->error = MMC_ERR_NO_MEMORY; @@ -581,50 +715,29 @@ bcm_sdhci_read_dma(device_t dev, struct sdhci_slot *sl bcm_sdhci_start_dma_seg(sc); } -static void -bcm_sdhci_write_dma(device_t dev, struct sdhci_slot *slot) -{ - struct bcm_sdhci_softc *sc = device_get_softc(slot->bus); - size_t left; - - if (sc->dmamap_seg_count != 0) { - device_printf(sc->sc_dev, "DMA in use\n"); - return; - } - - left = min(BCM_SDHCI_BUFFER_SIZE, - slot->curcmd->data->len - slot->offset); - - KASSERT((left & 3) == 0, - ("%s: len = %zu, not word-aligned", __func__, left)); - - if (bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map, - (uint8_t *)slot->curcmd->data->data + slot->offset, left, - bcm_sdhci_dmacb, sc, BUS_DMA_NOWAIT) != 0 || - sc->dmamap_status != 0) { - slot->curcmd->error = MMC_ERR_NO_MEMORY; - return; - } - - /* DMA start */ - bcm_sdhci_start_dma_seg(sc); -} - static int bcm_sdhci_will_handle_transfer(device_t dev, struct sdhci_slot *slot) { - size_t left; +#ifdef INVARIANTS + struct bcm_sdhci_softc *sc = device_get_softc(slot->bus); +#endif /* - * Do not use DMA for transfers less than block size or with a length - * that is not a multiple of four. + * This indicates that we somehow let a data interrupt slip by into the + * SDHCI framework, when it should not have. This really needs to be + * caught and fixed ASAP, as it really shouldn't happen. */ - left = min(BCM_DMA_BLOCK_SIZE, - slot->curcmd->data->len - slot->offset); - if (left < BCM_DMA_BLOCK_SIZE) + KASSERT(sc->dmamap_seg_count == 0, + ("data pending interrupt pushed through SDHCI framework")); + + /* + * Do not use DMA for transfers less than our block size. Checking + * alignment serves little benefit, as we round transfer sizes down to + * a multiple of the block size and push the transfer back to + * SDHCI-driven PIO once we're below the block size. + */ + if (BCM_SDHCI_SEGSZ_LEFT(slot) < BCM_DMA_BLOCK_SIZE) return (0); - if (left & 0x03) - return (0); return (1); } @@ -635,16 +748,30 @@ bcm_sdhci_start_transfer(device_t dev, struct sdhci_sl { /* DMA transfer FIFO 1KB */ - if (slot->curcmd->data->flags & MMC_DATA_READ) - bcm_sdhci_read_dma(dev, slot); - else - bcm_sdhci_write_dma(dev, slot); + bcm_sdhci_start_dma(slot); } static void bcm_sdhci_finish_transfer(device_t dev, struct sdhci_slot *slot) { + struct bcm_sdhci_softc *sc = device_get_softc(slot->bus); + /* + * Clean up. Interrupts are clearly enabled, because we received an + * SDHCI_INT_DATA_END to get this far -- just make sure we don't leave + * anything laying around. + */ + if (sc->dmamap_seg_count != 0) { + /* + * Our segment math should have worked out such that we would + * never finish the transfer without having used up all of the + * segments. If we haven't, that means we must have erroneously + * regressed to SDHCI-driven PIO to finish the operation and + * this is certainly caused by developer-error. + */ + bcm_sdhci_dma_unload(sc); + } + sdhci_finish_data(slot); } @@ -692,6 +819,9 @@ static driver_t bcm_sdhci_driver = { DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass, NULL, NULL); +#ifdef NOTYET +MODULE_DEPEND(sdhci_bcm, bcm2835_clkman, 1, 1, 1); +#endif SDHCI_DEPEND(sdhci_bcm); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_bcm); Copied and modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c (from r354876, head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c) ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Wed Nov 20 05:04:44 2019 (r354876, copy source) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Thu Dec 12 19:21:16 2019 (r355665) @@ -67,7 +67,7 @@ struct bcm283x_memory_mapping { vm_paddr_t vcbus_start; }; -#if defined(SOC_BCM2835) || defined(SOC_BCM2836) +#ifdef SOC_BCM2835 static struct bcm283x_memory_mapping bcm2835_memmap[] = { { /* SDRAM */ @@ -85,6 +85,24 @@ static struct bcm283x_memory_mapping bcm2835_memmap[] }; #endif +#ifdef SOC_BCM2836 +static struct bcm283x_memory_mapping bcm2836_memmap[] = { + { + /* SDRAM */ + .armc_start = 0x00000000, + .armc_size = BCM2836_ARM_IO_BASE, + .vcbus_start = BCM2836_VCBUS_SDRAM_BASE, + }, + { + /* Peripherals */ + .armc_start = BCM2836_ARM_IO_BASE, + .armc_size = BCM28XX_ARM_IO_SIZE, + .vcbus_start = BCM2836_VCBUS_IO_BASE, + }, + { 0, 0, 0 }, +}; +#endif + #ifdef SOC_BRCM_BCM2837 static struct bcm283x_memory_mapping bcm2837_memmap[] = { { @@ -142,7 +160,7 @@ static struct bcm283x_memory_soc_cfg { #endif #ifdef SOC_BCM2836 { - .memmap = bcm2835_memmap, + .memmap = bcm2836_memmap, .soc_compat = "brcm,bcm2836", .busdma_lowaddr = BUS_SPACE_MAXADDR_32BIT, }, @@ -156,6 +174,11 @@ static struct bcm283x_memory_soc_cfg { }, #endif #ifdef SOC_BRCM_BCM2838 + { + .memmap = bcm2838_memmap, + .soc_compat = "brcm,bcm2711", + .busdma_lowaddr = BCM2838_PERIPH_MAXADDR, + }, { .memmap = bcm2838_memmap, .soc_compat = "brcm,bcm2838", Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Thu Dec 12 19:17:30 2019 (r355664) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Thu Dec 12 19:21:16 2019 (r355665) @@ -35,47 +35,47 @@ #ifndef _BCM2835_VCBUS_H_ #define _BCM2835_VCBUS_H_ -/* - * ARM64 define its SOC options in opt_soc.h - */ -#if defined(__aarch64__) -#include "opt_soc.h" -#endif - #define BCM2835_VCBUS_SDRAM_CACHED 0x40000000 -#define BCM2835_VCBUS_IO_BASE 0x7E000000 #define BCM2835_VCBUS_SDRAM_UNCACHED 0xC0000000 -#if defined(SOC_BCM2835) #define BCM2835_ARM_IO_BASE 0x20000000 +#define BCM2835_VCBUS_IO_BASE 0x7E000000 #define BCM2835_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_CACHED -#else -#define BCM2835_ARM_IO_BASE 0x3f000000 -#define BCM2835_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_UNCACHED -#endif -#define BCM2835_ARM_IO_SIZE 0x01000000 -/* - * Convert physical address to VC bus address. Should be used - * when submitting address over mailbox interface - */ -#define PHYS_TO_VCBUS(pa) ((pa) + BCM2835_VCBUS_SDRAM_BASE) +#define BCM2836_ARM_IO_BASE 0x3f000000 +#define BCM2836_VCBUS_IO_BASE BCM2835_VCBUS_IO_BASE +#define BCM2836_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_UNCACHED -/* Check whether pa bellong top IO window */ -#define BCM2835_ARM_IS_IO(pa) (((pa) >= BCM2835_ARM_IO_BASE) && \ - ((pa) < BCM2835_ARM_IO_BASE + BCM2835_ARM_IO_SIZE)) +#define BCM2837_ARM_IO_BASE BCM2836_ARM_IO_BASE +#define BCM2837_VCBUS_IO_BASE BCM2835_VCBUS_IO_BASE +#define BCM2837_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_UNCACHED -/* - * Convert physical address in IO space to VC bus address. - */ -#define IO_TO_VCBUS(pa) ((pa - BCM2835_ARM_IO_BASE) + \ - BCM2835_VCBUS_IO_BASE) +#define BCM2838_ARM_IO_BASE 0xfe000000 +#define BCM2838_VCBUS_IO_BASE BCM2835_VCBUS_IO_BASE +#define BCM2838_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_UNCACHED /* - * Convert address from VC bus space to physical. Should be used - * when address is returned by VC over mailbox interface. e.g. - * framebuffer base + * Max allowed SDRAM mapping for most peripherals. The Raspberry Pi 4 has more + * than 1 GB of SDRAM, but only the lowest 1 GB is mapped into the "Legacy + * Master view" of the address space accessible by the DMA engine. Technically, + * we can slide this window around to whatever similarly sized range is + * convenient, but this is the most useful window given how busdma(9) works and + * that the window must be reconfigured for all channels in a given DMA engine. + * The DMA lite engine's window can be configured separately from the 30-bit DMA + * engine. */ -#define VCBUS_TO_PHYS(vca) ((vca) & ~(BCM2835_VCBUS_SDRAM_BASE)) +#define BCM2838_PERIPH_MAXADDR 0x3fffffff + +#define BCM28XX_ARM_IO_SIZE 0x01000000 + +vm_paddr_t bcm283x_armc_to_vcbus(vm_paddr_t pa); +vm_paddr_t bcm283x_vcbus_to_armc(vm_paddr_t vca); +bus_addr_t bcm283x_dmabus_peripheral_lowaddr(void); + +#define ARMC_TO_VCBUS(pa) bcm283x_armc_to_vcbus(pa) +#define VCBUS_TO_ARMC(vca) bcm283x_vcbus_to_armc(vca) + +/* Compatibility name for vchiq arm interface. */ +#define PHYS_TO_VCBUS ARMC_TO_VCBUS #endif /* _BCM2835_VCBUS_H_ */ Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2836.c ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2836.c Thu Dec 12 19:17:30 2019 (r355664) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2836.c Thu Dec 12 19:21:16 2019 (r355665) @@ -658,6 +658,8 @@ bcm_lintc_probe(device_t dev) if (!ofw_bus_is_compatible(dev, "brcm,bcm2836-l1-intc")) return (ENXIO); + if (!ofw_bus_has_prop(dev, "interrupt-controller")) + return (ENXIO); device_set_desc(dev, "BCM2836 Interrupt Controller"); return (BUS_PROBE_DEFAULT); } Modified: stable/12/sys/arm/broadcom/bcm2835/files.bcm283x ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/files.bcm283x Thu Dec 12 19:17:30 2019 (r355664) +++ stable/12/sys/arm/broadcom/bcm2835/files.bcm283x Thu Dec 12 19:21:16 2019 (r355665) @@ -14,6 +14,7 @@ arm/broadcom/bcm2835/bcm2835_rng.c optional random arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 12 19:23:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED4281D9363; Thu, 12 Dec 2019 19:23: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 47YkHG5wJ9z427H; Thu, 12 Dec 2019 19:23: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 C63F77DC; Thu, 12 Dec 2019 19:23: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 xBCJNcUv099253; Thu, 12 Dec 2019 19:23:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCJNcsk099251; Thu, 12 Dec 2019 19:23:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912121923.xBCJNcsk099251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Dec 2019 19:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355666 - head/lib/libpmc/pmu-events/arch/x86/amdfam17h X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libpmc/pmu-events/arch/x86/amdfam17h X-SVN-Commit-Revision: 355666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 19:23:39 -0000 Author: emaste Date: Thu Dec 12 19:23:38 2019 New Revision: 355666 URL: https://svnweb.freebsd.org/changeset/base/355666 Log: libpmc: sort some amdfam17h entries to make valid json Modified: head/lib/libpmc/pmu-events/arch/x86/amdfam17h/core.json head/lib/libpmc/pmu-events/arch/x86/amdfam17h/memory.json Modified: head/lib/libpmc/pmu-events/arch/x86/amdfam17h/core.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/x86/amdfam17h/core.json Thu Dec 12 19:21:16 2019 (r355665) +++ head/lib/libpmc/pmu-events/arch/x86/amdfam17h/core.json Thu Dec 12 19:23:38 2019 (r355666) @@ -2,20 +2,20 @@ { "EventName": "ex_ret_instr", "EventCode": "0xc0", + "SampleAfterValue": "2000003", "BriefDescription": "Retired Instructions." - "SampleAfterValue": "2000003", }, { "EventName": "ex_ret_cops", "EventCode": "0xc1", + "SampleAfterValue": "2000003", "BriefDescription": "The number of uOps retired. This includes all processor activity (instructions, exceptions, interrupts, microcode assists, etc.). The number of events logged per cycle can vary from 0 to 4." - "SampleAfterValue": "2000003", }, { "EventName": "ex_ret_brn", "EventCode": "0xc2", + "SampleAfterValue": "2000003", "BriefDescription": "The number of branch instructions retired. This includes all types of architectural control flow changes, including exceptions and interrupts." - "SampleAfterValue": "2000003", }, { "EventName": "ex_ret_brn_misp", Modified: head/lib/libpmc/pmu-events/arch/x86/amdfam17h/memory.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/x86/amdfam17h/memory.json Thu Dec 12 19:21:16 2019 (r355665) +++ head/lib/libpmc/pmu-events/arch/x86/amdfam17h/memory.json Thu Dec 12 19:23:38 2019 (r355666) @@ -220,7 +220,7 @@ { "EventName": "ls_not_halted_cyc", "EventCode": "0x76", - "BriefDescription": "Cycles not in Halt." "SampleAfterValue": "2000003", + "BriefDescription": "Cycles not in Halt." } ] From owner-svn-src-all@freebsd.org Thu Dec 12 19:33:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5F6C1D95A2; Thu, 12 Dec 2019 19:33:17 +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 47YkVP4zpsz42XM; Thu, 12 Dec 2019 19:33:17 +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 A5DF39A0; Thu, 12 Dec 2019 19:33:17 +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 xBCJXHMe004966; Thu, 12 Dec 2019 19:33:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCJXGea004961; Thu, 12 Dec 2019 19:33:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912121933.xBCJXGea004961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Dec 2019 19:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355667 - in head/lib/libpmc/pmu-events/arch/powerpc: power8 power9 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/lib/libpmc/pmu-events/arch/powerpc: power8 power9 X-SVN-Commit-Revision: 355667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 19:33:17 -0000 Author: emaste Date: Thu Dec 12 19:33:16 2019 New Revision: 355667 URL: https://svnweb.freebsd.org/changeset/base/355667 Log: libpmc: convert powerpc event files to proper json Modified: head/lib/libpmc/pmu-events/arch/powerpc/power8/cache.json head/lib/libpmc/pmu-events/arch/powerpc/power8/floating-point.json head/lib/libpmc/pmu-events/arch/powerpc/power8/frontend.json head/lib/libpmc/pmu-events/arch/powerpc/power8/marked.json head/lib/libpmc/pmu-events/arch/powerpc/power8/memory.json head/lib/libpmc/pmu-events/arch/powerpc/power8/other.json head/lib/libpmc/pmu-events/arch/powerpc/power8/pipeline.json head/lib/libpmc/pmu-events/arch/powerpc/power8/pmc.json head/lib/libpmc/pmu-events/arch/powerpc/power8/translation.json head/lib/libpmc/pmu-events/arch/powerpc/power9/cache.json head/lib/libpmc/pmu-events/arch/powerpc/power9/floating-point.json head/lib/libpmc/pmu-events/arch/powerpc/power9/frontend.json head/lib/libpmc/pmu-events/arch/powerpc/power9/marked.json head/lib/libpmc/pmu-events/arch/powerpc/power9/memory.json head/lib/libpmc/pmu-events/arch/powerpc/power9/other.json head/lib/libpmc/pmu-events/arch/powerpc/power9/pipeline.json head/lib/libpmc/pmu-events/arch/powerpc/power9/pmc.json head/lib/libpmc/pmu-events/arch/powerpc/power9/translation.json Modified: head/lib/libpmc/pmu-events/arch/powerpc/power8/cache.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/powerpc/power8/cache.json Thu Dec 12 19:23:38 2019 (r355666) +++ head/lib/libpmc/pmu-events/arch/powerpc/power8/cache.json Thu Dec 12 19:33:16 2019 (r355667) @@ -1,176 +1,176 @@ [ - {, + { "EventCode": "0x4c048", "EventName": "PM_DATA_FROM_DL2L3_MOD", "BriefDescription": "The processor's data cache was reloaded with Modified (M) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to a demand load", "PublicDescription": "The processor's data cache was reloaded with Modified (M) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x3c048", "EventName": "PM_DATA_FROM_DL2L3_SHR", "BriefDescription": "The processor's data cache was reloaded with Shared (S) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to a demand load", "PublicDescription": "The processor's data cache was reloaded with Shared (S) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x3c04c", "EventName": "PM_DATA_FROM_DL4", "BriefDescription": "The processor's data cache was reloaded from another chip's L4 on a different Node or Group (Distant) due to a demand load", "PublicDescription": "The processor's data cache was reloaded from another chip's L4 on a different Node or Group (Distant) due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x1c042", "EventName": "PM_DATA_FROM_L2", "BriefDescription": "The processor's data cache was reloaded from local core's L2 due to a demand load", "PublicDescription": "The processor's data cache was reloaded from local core's L2 due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x200fe", "EventName": "PM_DATA_FROM_L2MISS", "BriefDescription": "Demand LD - L2 Miss (not L2 hit)", "PublicDescription": "" }, - {, + { "EventCode": "0x1c04e", "EventName": "PM_DATA_FROM_L2MISS_MOD", "BriefDescription": "The processor's data cache was reloaded from a localtion other than the local core's L2 due to a demand load", "PublicDescription": "The processor's data cache was reloaded from a localtion other than the local core's L2 due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x3c040", "EventName": "PM_DATA_FROM_L2_DISP_CONFLICT_LDHITST", "BriefDescription": "The processor's data cache was reloaded from local core's L2 with load hit store conflict due to a demand load", "PublicDescription": "The processor's data cache was reloaded from local core's L2 with load hit store conflict due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x4c040", "EventName": "PM_DATA_FROM_L2_DISP_CONFLICT_OTHER", "BriefDescription": "The processor's data cache was reloaded from local core's L2 with dispatch conflict due to a demand load", "PublicDescription": "The processor's data cache was reloaded from local core's L2 with dispatch conflict due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x2c040", "EventName": "PM_DATA_FROM_L2_MEPF", "BriefDescription": "The processor's data cache was reloaded from local core's L2 hit without dispatch conflicts on Mepf state due to a demand load", "PublicDescription": "The processor's data cache was reloaded from local core's L2 hit without dispatch conflicts on Mepf state due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x1c040", "EventName": "PM_DATA_FROM_L2_NO_CONFLICT", "BriefDescription": "The processor's data cache was reloaded from local core's L2 without conflict due to a demand load", "PublicDescription": "The processor's data cache was reloaded from local core's L2 without conflict due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x4c042", "EventName": "PM_DATA_FROM_L3", "BriefDescription": "The processor's data cache was reloaded from local core's L3 due to a demand load", "PublicDescription": "The processor's data cache was reloaded from local core's L3 due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x300fe", "EventName": "PM_DATA_FROM_L3MISS", "BriefDescription": "Demand LD - L3 Miss (not L2 hit and not L3 hit)", "PublicDescription": "" }, - {, + { "EventCode": "0x4c04e", "EventName": "PM_DATA_FROM_L3MISS_MOD", "BriefDescription": "The processor's data cache was reloaded from a localtion other than the local core's L3 due to a demand load", "PublicDescription": "The processor's data cache was reloaded from a localtion other than the local core's L3 due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x3c042", "EventName": "PM_DATA_FROM_L3_DISP_CONFLICT", "BriefDescription": "The processor's data cache was reloaded from local core's L3 with dispatch conflict due to a demand load", "PublicDescription": "The processor's data cache was reloaded from local core's L3 with dispatch conflict due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x2c042", "EventName": "PM_DATA_FROM_L3_MEPF", "BriefDescription": "The processor's data cache was reloaded from local core's L3 without dispatch conflicts hit on Mepf state due to a demand load", "PublicDescription": "The processor's data cache was reloaded from local core's L3 without dispatch conflicts hit on Mepf state due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x1c044", "EventName": "PM_DATA_FROM_L3_NO_CONFLICT", "BriefDescription": "The processor's data cache was reloaded from local core's L3 without conflict due to a demand load", "PublicDescription": "The processor's data cache was reloaded from local core's L3 without conflict due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x1c04c", "EventName": "PM_DATA_FROM_LL4", "BriefDescription": "The processor's data cache was reloaded from the local chip's L4 cache due to a demand load", "PublicDescription": "The processor's data cache was reloaded from the local chip's L4 cache due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x4c04a", "EventName": "PM_DATA_FROM_OFF_CHIP_CACHE", "BriefDescription": "The processor's data cache was reloaded either shared or modified data from another core's L2/L3 on a different chip (remote or distant) due to a demand load", "PublicDescription": "The processor's data cache was reloaded either shared or modified data from another core's L2/L3 on a different chip (remote or distant) due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x1c048", "EventName": "PM_DATA_FROM_ON_CHIP_CACHE", "BriefDescription": "The processor's data cache was reloaded either shared or modified data from another core's L2/L3 on the same chip due to a demand load", "PublicDescription": "The processor's data cache was reloaded either shared or modified data from another core's L2/L3 on the same chip due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x2c046", "EventName": "PM_DATA_FROM_RL2L3_MOD", "BriefDescription": "The processor's data cache was reloaded with Modified (M) data from another chip's L2 or L3 on the same Node or Group (Remote), as this chip due to a demand load", "PublicDescription": "The processor's data cache was reloaded with Modified (M) data from another chip's L2 or L3 on the same Node or Group (Remote), as this chip due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x1c04a", "EventName": "PM_DATA_FROM_RL2L3_SHR", "BriefDescription": "The processor's data cache was reloaded with Shared (S) data from another chip's L2 or L3 on the same Node or Group (Remote), as this chip due to a demand load", "PublicDescription": "The processor's data cache was reloaded with Shared (S) data from another chip's L2 or L3 on the same Node or Group (Remote), as this chip due to either only demand loads or demand loads plus prefetches if MMCR1[16] is 1" }, - {, + { "EventCode": "0x3001a", "EventName": "PM_DATA_TABLEWALK_CYC", "BriefDescription": "Tablwalk Cycles (could be 1 or 2 active)", "PublicDescription": "Data Tablewalk Active" }, - {, + { "EventCode": "0x4e04e", "EventName": "PM_DPTEG_FROM_L3MISS", "BriefDescription": "A Page Table Entry was loaded into the TLB from a localtion other than the local core's L3 due to a data side request", "PublicDescription": "" }, - {, + { "EventCode": "0xd094", "EventName": "PM_DSLB_MISS", "BriefDescription": "Data SLB Miss - Total of all segment sizes", "PublicDescription": "Data SLB Miss - Total of all segment sizesData SLB misses" }, - {, + { "EventCode": "0x1002c", "EventName": "PM_L1_DCACHE_RELOADED_ALL", "BriefDescription": "L1 data cache reloaded for demand or prefetch", "PublicDescription": "" }, - {, + { "EventCode": "0x300f6", "EventName": "PM_L1_DCACHE_RELOAD_VALID", "BriefDescription": "DL1 reloaded due to Demand Load", "PublicDescription": "" }, - {, + { "EventCode": "0x3e054", "EventName": "PM_LD_MISS_L1", "BriefDescription": "Load Missed L1", "PublicDescription": "" }, - {, + { "EventCode": "0x100ee", "EventName": "PM_LD_REF_L1", "BriefDescription": "All L1 D cache load references counted at finish, gated by reject", "PublicDescription": "Load Ref count combined for all units" }, - {, + { "EventCode": "0x300f0", "EventName": "PM_ST_MISS_L1", "BriefDescription": "Store Missed L1", "PublicDescription": "" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/powerpc/power8/floating-point.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/powerpc/power8/floating-point.json Thu Dec 12 19:23:38 2019 (r355666) +++ head/lib/libpmc/pmu-events/arch/powerpc/power8/floating-point.json Thu Dec 12 19:33:16 2019 (r355667) @@ -1,14 +1,14 @@ [ - {, + { "EventCode": "0x2000e", "EventName": "PM_FXU_BUSY", "BriefDescription": "fxu0 busy and fxu1 busy", "PublicDescription": "" }, - {, + { "EventCode": "0x1000e", "EventName": "PM_FXU_IDLE", "BriefDescription": "fxu0 idle and fxu1 idle", "PublicDescription": "" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/powerpc/power8/frontend.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/powerpc/power8/frontend.json Thu Dec 12 19:23:38 2019 (r355666) +++ head/lib/libpmc/pmu-events/arch/powerpc/power8/frontend.json Thu Dec 12 19:33:16 2019 (r355667) @@ -1,470 +1,470 @@ [ - {, + { "EventCode": "0x2505e", "EventName": "PM_BACK_BR_CMPL", "BriefDescription": "Branch instruction completed with a target address less than current instruction address", "PublicDescription": "" }, - {, + { "EventCode": "0x10068", "EventName": "PM_BRU_FIN", "BriefDescription": "Branch Instruction Finished", "PublicDescription": "" }, - {, + { "EventCode": "0x20036", "EventName": "PM_BR_2PATH", "BriefDescription": "two path branch", "PublicDescription": "" }, - {, + { "EventCode": "0x40060", "EventName": "PM_BR_CMPL", "BriefDescription": "Branch Instruction completed", "PublicDescription": "" }, - {, + { "EventCode": "0x400f6", "EventName": "PM_BR_MPRED_CMPL", "BriefDescription": "Number of Branch Mispredicts", "PublicDescription": "" }, - {, + { "EventCode": "0x200fa", "EventName": "PM_BR_TAKEN_CMPL", "BriefDescription": "New event for Branch Taken", "PublicDescription": "" }, - {, + { "EventCode": "0x10018", "EventName": "PM_IC_DEMAND_CYC", "BriefDescription": "Cycles when a demand ifetch was pending", "PublicDescription": "Demand ifetch pending" }, - {, + { "EventCode": "0x100f6", "EventName": "PM_IERAT_RELOAD", "BriefDescription": "Number of I-ERAT reloads", "PublicDescription": "IERAT Reloaded (Miss)" }, - {, + { "EventCode": "0x4006a", "EventName": "PM_IERAT_RELOAD_16M", "BriefDescription": "IERAT Reloaded (Miss) for a 16M page", "PublicDescription": "" }, - {, + { "EventCode": "0x20064", "EventName": "PM_IERAT_RELOAD_4K", "BriefDescription": "IERAT Miss (Not implemented as DI on POWER6)", "PublicDescription": "IERAT Reloaded (Miss) for a 4k page" }, - {, + { "EventCode": "0x3006a", "EventName": "PM_IERAT_RELOAD_64K", "BriefDescription": "IERAT Reloaded (Miss) for a 64k page", "PublicDescription": "" }, - {, + { "EventCode": "0x14050", "EventName": "PM_INST_CHIP_PUMP_CPRED", "BriefDescription": "Initial and Final Pump Scope was chip pump (prediction=correct) for an instruction fetch", "PublicDescription": "Initial and Final Pump Scope and data sourced across this scope was chip pump (prediction=correct) for an instruction fetch" }, - {, + { "EventCode": "0x2", "EventName": "PM_INST_CMPL", "BriefDescription": "Number of PowerPC Instructions that completed", "PublicDescription": "PPC Instructions Finished (completed)" }, - {, + { "EventCode": "0x200f2", "EventName": "PM_INST_DISP", "BriefDescription": "PPC Dispatched", "PublicDescription": "" }, - {, + { "EventCode": "0x44048", "EventName": "PM_INST_FROM_DL2L3_MOD", "BriefDescription": "The processor's Instruction cache was reloaded with Modified (M) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded with Modified (M) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x34048", "EventName": "PM_INST_FROM_DL2L3_SHR", "BriefDescription": "The processor's Instruction cache was reloaded with Shared (S) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded with Shared (S) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x3404c", "EventName": "PM_INST_FROM_DL4", "BriefDescription": "The processor's Instruction cache was reloaded from another chip's L4 on a different Node or Group (Distant) due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from another chip's L4 on a different Node or Group (Distant) due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x4404c", "EventName": "PM_INST_FROM_DMEM", "BriefDescription": "The processor's Instruction cache was reloaded from another chip's memory on the same Node or Group (Distant) due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from another chip's memory on the same Node or Group (Distant) due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x14042", "EventName": "PM_INST_FROM_L2", "BriefDescription": "The processor's Instruction cache was reloaded from local core's L2 due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from local core's L2 due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x1404e", "EventName": "PM_INST_FROM_L2MISS", "BriefDescription": "The processor's Instruction cache was reloaded from a localtion other than the local core's L2 due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from a localtion other than the local core's L2 due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x34040", "EventName": "PM_INST_FROM_L2_DISP_CONFLICT_LDHITST", "BriefDescription": "The processor's Instruction cache was reloaded from local core's L2 with load hit store conflict due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from local core's L2 with load hit store conflict due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x44040", "EventName": "PM_INST_FROM_L2_DISP_CONFLICT_OTHER", "BriefDescription": "The processor's Instruction cache was reloaded from local core's L2 with dispatch conflict due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from local core's L2 with dispatch conflict due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x24040", "EventName": "PM_INST_FROM_L2_MEPF", "BriefDescription": "The processor's Instruction cache was reloaded from local core's L2 hit without dispatch conflicts on Mepf state. due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from local core's L2 hit without dispatch conflicts on Mepf state. due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x14040", "EventName": "PM_INST_FROM_L2_NO_CONFLICT", "BriefDescription": "The processor's Instruction cache was reloaded from local core's L2 without conflict due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from local core's L2 without conflict due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x44042", "EventName": "PM_INST_FROM_L3", "BriefDescription": "The processor's Instruction cache was reloaded from local core's L3 due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from local core's L3 due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x300fa", "EventName": "PM_INST_FROM_L3MISS", "BriefDescription": "Marked instruction was reloaded from a location beyond the local chiplet", "PublicDescription": "Inst from L3 miss" }, - {, + { "EventCode": "0x4404e", "EventName": "PM_INST_FROM_L3MISS_MOD", "BriefDescription": "The processor's Instruction cache was reloaded from a localtion other than the local core's L3 due to a instruction fetch", "PublicDescription": "The processor's Instruction cache was reloaded from a localtion other than the local core's L3 due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x34042", "EventName": "PM_INST_FROM_L3_DISP_CONFLICT", "BriefDescription": "The processor's Instruction cache was reloaded from local core's L3 with dispatch conflict due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from local core's L3 with dispatch conflict due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x24042", "EventName": "PM_INST_FROM_L3_MEPF", "BriefDescription": "The processor's Instruction cache was reloaded from local core's L3 without dispatch conflicts hit on Mepf state. due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from local core's L3 without dispatch conflicts hit on Mepf state. due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x14044", "EventName": "PM_INST_FROM_L3_NO_CONFLICT", "BriefDescription": "The processor's Instruction cache was reloaded from local core's L3 without conflict due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from local core's L3 without conflict due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x1404c", "EventName": "PM_INST_FROM_LL4", "BriefDescription": "The processor's Instruction cache was reloaded from the local chip's L4 cache due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from the local chip's L4 cache due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x24048", "EventName": "PM_INST_FROM_LMEM", "BriefDescription": "The processor's Instruction cache was reloaded from the local chip's Memory due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from the local chip's Memory due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x2404c", "EventName": "PM_INST_FROM_MEMORY", "BriefDescription": "The processor's Instruction cache was reloaded from a memory location including L4 from local remote or distant due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from a memory location including L4 from local remote or distant due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x4404a", "EventName": "PM_INST_FROM_OFF_CHIP_CACHE", "BriefDescription": "The processor's Instruction cache was reloaded either shared or modified data from another core's L2/L3 on a different chip (remote or distant) due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded either shared or modified data from another core's L2/L3 on a different chip (remote or distant) due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x14048", "EventName": "PM_INST_FROM_ON_CHIP_CACHE", "BriefDescription": "The processor's Instruction cache was reloaded either shared or modified data from another core's L2/L3 on the same chip due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded either shared or modified data from another core's L2/L3 on the same chip due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x24046", "EventName": "PM_INST_FROM_RL2L3_MOD", "BriefDescription": "The processor's Instruction cache was reloaded with Modified (M) data from another chip's L2 or L3 on the same Node or Group (Remote), as this chip due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded with Modified (M) data from another chip's L2 or L3 on the same Node or Group (Remote), as this chip due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x1404a", "EventName": "PM_INST_FROM_RL2L3_SHR", "BriefDescription": "The processor's Instruction cache was reloaded with Shared (S) data from another chip's L2 or L3 on the same Node or Group (Remote), as this chip due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded with Shared (S) data from another chip's L2 or L3 on the same Node or Group (Remote), as this chip due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x2404a", "EventName": "PM_INST_FROM_RL4", "BriefDescription": "The processor's Instruction cache was reloaded from another chip's L4 on the same Node or Group ( Remote) due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from another chip's L4 on the same Node or Group ( Remote) due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x3404a", "EventName": "PM_INST_FROM_RMEM", "BriefDescription": "The processor's Instruction cache was reloaded from another chip's memory on the same Node or Group ( Remote) due to an instruction fetch (not prefetch)", "PublicDescription": "The processor's Instruction cache was reloaded from another chip's memory on the same Node or Group ( Remote) due to either an instruction fetch or instruction fetch plus prefetch if MMCR1[17] is 1" }, - {, + { "EventCode": "0x24050", "EventName": "PM_INST_GRP_PUMP_CPRED", "BriefDescription": "Initial and Final Pump Scope was group pump (prediction=correct) for an instruction fetch", "PublicDescription": "Initial and Final Pump Scope and data sourced across this scope was group pump for an instruction fetch" }, - {, + { "EventCode": "0x24052", "EventName": "PM_INST_GRP_PUMP_MPRED", "BriefDescription": "Final Pump Scope (Group) ended up either larger or smaller than Initial Pump Scope for an instruction fetch", "PublicDescription": "Final Pump Scope(Group) to get data sourced, ended up larger than Initial Pump Scope OR Final Pump Scope(Group) got data from source that was at smaller scope(Chip) Final pump was group pump and initial pump was chip or final and initial pump was gro" }, - {, + { "EventCode": "0x14052", "EventName": "PM_INST_GRP_PUMP_MPRED_RTY", "BriefDescription": "Final Pump Scope (Group) ended up larger than Initial Pump Scope (Chip) for an instruction fetch", "PublicDescription": "Final Pump Scope(Group) to get data sourced, ended up larger than Initial Pump Scope (Chip) Final pump was group pump and initial pump was chip pumpfor an instruction fetch" }, - {, + { "EventCode": "0x1003a", "EventName": "PM_INST_IMC_MATCH_CMPL", "BriefDescription": "IMC Match Count ( Not architected in P8)", "PublicDescription": "" }, - {, + { "EventCode": "0x14054", "EventName": "PM_INST_PUMP_CPRED", "BriefDescription": "Pump prediction correct. Counts across all types of pumps for an instruction fetch", "PublicDescription": "Pump prediction correct. Counts across all types of pumpsfor an instruction fetch" }, - {, + { "EventCode": "0x44052", "EventName": "PM_INST_PUMP_MPRED", "BriefDescription": "Pump misprediction. Counts across all types of pumps for an instruction fetch", "PublicDescription": "Pump Mis prediction Counts across all types of pumpsfor an instruction fetch" }, - {, + { "EventCode": "0x34050", "EventName": "PM_INST_SYS_PUMP_CPRED", "BriefDescription": "Initial and Final Pump Scope was system pump (prediction=correct) for an instruction fetch", "PublicDescription": "Initial and Final Pump Scope and data sourced across this scope was system pump for an instruction fetch" }, - {, + { "EventCode": "0x34052", "EventName": "PM_INST_SYS_PUMP_MPRED", "BriefDescription": "Final Pump Scope (system) mispredicted. Either the original scope was too small (Chip/Group) or the original scope was System and it should have been smaller. Counts for an instruction fetch", "PublicDescription": "Final Pump Scope(system) to get data sourced, ended up larger than Initial Pump Scope(Chip/Group) OR Final Pump Scope(system) got data from source that was at smaller scope(Chip/group) Final pump was system pump and initial pump was chip or group or" }, - {, + { "EventCode": "0x44050", "EventName": "PM_INST_SYS_PUMP_MPRED_RTY", "BriefDescription": "Final Pump Scope (system) ended up larger than Initial Pump Scope (Chip/Group) for an instruction fetch", "PublicDescription": "Final Pump Scope(system) to get data sourced, ended up larger than Initial Pump Scope (Chip or Group) for an instruction fetch" }, - {, + { "EventCode": "0x45048", "EventName": "PM_IPTEG_FROM_DL2L3_MOD", "BriefDescription": "A Page Table Entry was loaded into the TLB with Modified (M) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x35048", "EventName": "PM_IPTEG_FROM_DL2L3_SHR", "BriefDescription": "A Page Table Entry was loaded into the TLB with Shared (S) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x3504c", "EventName": "PM_IPTEG_FROM_DL4", "BriefDescription": "A Page Table Entry was loaded into the TLB from another chip's L4 on a different Node or Group (Distant) due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x4504c", "EventName": "PM_IPTEG_FROM_DMEM", "BriefDescription": "A Page Table Entry was loaded into the TLB from another chip's memory on the same Node or Group (Distant) due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x15042", "EventName": "PM_IPTEG_FROM_L2", "BriefDescription": "A Page Table Entry was loaded into the TLB from local core's L2 due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x1504e", "EventName": "PM_IPTEG_FROM_L2MISS", "BriefDescription": "A Page Table Entry was loaded into the TLB from a localtion other than the local core's L2 due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x25040", "EventName": "PM_IPTEG_FROM_L2_MEPF", "BriefDescription": "A Page Table Entry was loaded into the TLB from local core's L2 hit without dispatch conflicts on Mepf state. due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x15040", "EventName": "PM_IPTEG_FROM_L2_NO_CONFLICT", "BriefDescription": "A Page Table Entry was loaded into the TLB from local core's L2 without conflict due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x45042", "EventName": "PM_IPTEG_FROM_L3", "BriefDescription": "A Page Table Entry was loaded into the TLB from local core's L3 due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x4504e", "EventName": "PM_IPTEG_FROM_L3MISS", "BriefDescription": "A Page Table Entry was loaded into the TLB from a localtion other than the local core's L3 due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x35042", "EventName": "PM_IPTEG_FROM_L3_DISP_CONFLICT", "BriefDescription": "A Page Table Entry was loaded into the TLB from local core's L3 with dispatch conflict due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x25042", "EventName": "PM_IPTEG_FROM_L3_MEPF", "BriefDescription": "A Page Table Entry was loaded into the TLB from local core's L3 without dispatch conflicts hit on Mepf state. due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x15044", "EventName": "PM_IPTEG_FROM_L3_NO_CONFLICT", "BriefDescription": "A Page Table Entry was loaded into the TLB from local core's L3 without conflict due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x1504c", "EventName": "PM_IPTEG_FROM_LL4", "BriefDescription": "A Page Table Entry was loaded into the TLB from the local chip's L4 cache due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x25048", "EventName": "PM_IPTEG_FROM_LMEM", "BriefDescription": "A Page Table Entry was loaded into the TLB from the local chip's Memory due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x2504c", "EventName": "PM_IPTEG_FROM_MEMORY", "BriefDescription": "A Page Table Entry was loaded into the TLB from a memory location including L4 from local remote or distant due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x4504a", "EventName": "PM_IPTEG_FROM_OFF_CHIP_CACHE", "BriefDescription": "A Page Table Entry was loaded into the TLB either shared or modified data from another core's L2/L3 on a different chip (remote or distant) due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x15048", "EventName": "PM_IPTEG_FROM_ON_CHIP_CACHE", "BriefDescription": "A Page Table Entry was loaded into the TLB either shared or modified data from another core's L2/L3 on the same chip due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x25046", "EventName": "PM_IPTEG_FROM_RL2L3_MOD", "BriefDescription": "A Page Table Entry was loaded into the TLB with Modified (M) data from another chip's L2 or L3 on the same Node or Group (Remote), as this chip due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x1504a", "EventName": "PM_IPTEG_FROM_RL2L3_SHR", "BriefDescription": "A Page Table Entry was loaded into the TLB with Shared (S) data from another chip's L2 or L3 on the same Node or Group (Remote), as this chip due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x2504a", "EventName": "PM_IPTEG_FROM_RL4", "BriefDescription": "A Page Table Entry was loaded into the TLB from another chip's L4 on the same Node or Group ( Remote) due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0x3504a", "EventName": "PM_IPTEG_FROM_RMEM", "BriefDescription": "A Page Table Entry was loaded into the TLB from another chip's memory on the same Node or Group ( Remote) due to a instruction side request", "PublicDescription": "" }, - {, + { "EventCode": "0xd096", "EventName": "PM_ISLB_MISS", "BriefDescription": "I SLB Miss", "PublicDescription": "" }, - {, + { "EventCode": "0x400fc", "EventName": "PM_ITLB_MISS", "BriefDescription": "ITLB Reloaded (always zero on POWER6)", "PublicDescription": "" }, - {, + { "EventCode": "0x200fd", "EventName": "PM_L1_ICACHE_MISS", "BriefDescription": "Demand iCache Miss", "PublicDescription": "" }, - {, + { "EventCode": "0x40012", "EventName": "PM_L1_ICACHE_RELOADED_ALL", "BriefDescription": "Counts all Icache reloads includes demand, prefetchm prefetch turned into demand and demand turned into prefetch", "PublicDescription": "" }, - {, + { "EventCode": "0x30068", "EventName": "PM_L1_ICACHE_RELOADED_PREF", "BriefDescription": "Counts all Icache prefetch reloads ( includes demand turned into prefetch)", "PublicDescription": "" }, - {, + { "EventCode": "0x300f4", "EventName": "PM_THRD_CONC_RUN_INST", "BriefDescription": "PPC Instructions Finished when both threads in run_cycles", "PublicDescription": "Concurrent Run Instructions" }, - {, + { "EventCode": "0x30060", "EventName": "PM_TM_TRANS_RUN_INST", "BriefDescription": "Instructions completed in transactional state", "PublicDescription": "" }, - {, + { "EventCode": "0x4e014", "EventName": "PM_TM_TX_PASS_RUN_INST", "BriefDescription": "run instructions spent in successful transactions", "PublicDescription": "" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/powerpc/power8/marked.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/powerpc/power8/marked.json Thu Dec 12 19:23:38 2019 (r355666) +++ head/lib/libpmc/pmu-events/arch/powerpc/power8/marked.json Thu Dec 12 19:33:16 2019 (r355667) @@ -1,794 +1,794 @@ [ - {, + { "EventCode": "0x3515e", "EventName": "PM_MRK_BACK_BR_CMPL", "BriefDescription": "Marked branch instruction completed with a target address less than current instruction address", "PublicDescription": "" }, - {, + { "EventCode": "0x2013a", "EventName": "PM_MRK_BRU_FIN", "BriefDescription": "bru marked instr finish", "PublicDescription": "" }, - {, + { "EventCode": "0x1016e", "EventName": "PM_MRK_BR_CMPL", "BriefDescription": "Branch Instruction completed", "PublicDescription": "" }, - {, + { "EventCode": "0x301e4", "EventName": "PM_MRK_BR_MPRED_CMPL", "BriefDescription": "Marked Branch Mispredicted", "PublicDescription": "" }, - {, + { "EventCode": "0x101e2", "EventName": "PM_MRK_BR_TAKEN_CMPL", "BriefDescription": "Marked Branch Taken completed", "PublicDescription": "" }, - {, + { "EventCode": "0x4d148", "EventName": "PM_MRK_DATA_FROM_DL2L3_MOD", "BriefDescription": "The processor's data cache was reloaded with Modified (M) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x2d128", "EventName": "PM_MRK_DATA_FROM_DL2L3_MOD_CYC", "BriefDescription": "Duration in cycles to reload with Modified (M) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x3d148", "EventName": "PM_MRK_DATA_FROM_DL2L3_SHR", "BriefDescription": "The processor's data cache was reloaded with Shared (S) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x2c128", "EventName": "PM_MRK_DATA_FROM_DL2L3_SHR_CYC", "BriefDescription": "Duration in cycles to reload with Shared (S) data from another chip's L2 or L3 on a different Node or Group (Distant), as this chip due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x3d14c", "EventName": "PM_MRK_DATA_FROM_DL4", "BriefDescription": "The processor's data cache was reloaded from another chip's L4 on a different Node or Group (Distant) due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x2c12c", "EventName": "PM_MRK_DATA_FROM_DL4_CYC", "BriefDescription": "Duration in cycles to reload from another chip's L4 on a different Node or Group (Distant) due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x4d14c", "EventName": "PM_MRK_DATA_FROM_DMEM", "BriefDescription": "The processor's data cache was reloaded from another chip's memory on the same Node or Group (Distant) due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x2d12c", "EventName": "PM_MRK_DATA_FROM_DMEM_CYC", "BriefDescription": "Duration in cycles to reload from another chip's memory on the same Node or Group (Distant) due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x1d142", "EventName": "PM_MRK_DATA_FROM_L2", "BriefDescription": "The processor's data cache was reloaded from local core's L2 due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x1d14e", "EventName": "PM_MRK_DATA_FROM_L2MISS", "BriefDescription": "Data cache reload L2 miss", "PublicDescription": "" }, - {, + { "EventCode": "0x4c12e", "EventName": "PM_MRK_DATA_FROM_L2MISS_CYC", "BriefDescription": "Duration in cycles to reload from a localtion other than the local core's L2 due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x4c122", "EventName": "PM_MRK_DATA_FROM_L2_CYC", "BriefDescription": "Duration in cycles to reload from local core's L2 due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x3d140", "EventName": "PM_MRK_DATA_FROM_L2_DISP_CONFLICT_LDHITST", "BriefDescription": "The processor's data cache was reloaded from local core's L2 with load hit store conflict due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x2c120", "EventName": "PM_MRK_DATA_FROM_L2_DISP_CONFLICT_LDHITST_CYC", "BriefDescription": "Duration in cycles to reload from local core's L2 with load hit store conflict due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x4d140", "EventName": "PM_MRK_DATA_FROM_L2_DISP_CONFLICT_OTHER", "BriefDescription": "The processor's data cache was reloaded from local core's L2 with dispatch conflict due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x2d120", "EventName": "PM_MRK_DATA_FROM_L2_DISP_CONFLICT_OTHER_CYC", "BriefDescription": "Duration in cycles to reload from local core's L2 with dispatch conflict due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x2d140", "EventName": "PM_MRK_DATA_FROM_L2_MEPF", "BriefDescription": "The processor's data cache was reloaded from local core's L2 hit without dispatch conflicts on Mepf state. due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x4d120", "EventName": "PM_MRK_DATA_FROM_L2_MEPF_CYC", "BriefDescription": "Duration in cycles to reload from local core's L2 hit without dispatch conflicts on Mepf state. due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x1d140", "EventName": "PM_MRK_DATA_FROM_L2_NO_CONFLICT", "BriefDescription": "The processor's data cache was reloaded from local core's L2 without conflict due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x4c120", "EventName": "PM_MRK_DATA_FROM_L2_NO_CONFLICT_CYC", "BriefDescription": "Duration in cycles to reload from local core's L2 without conflict due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x4d142", "EventName": "PM_MRK_DATA_FROM_L3", "BriefDescription": "The processor's data cache was reloaded from local core's L3 due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x201e4", "EventName": "PM_MRK_DATA_FROM_L3MISS", "BriefDescription": "The processor's data cache was reloaded from a localtion other than the local core's L3 due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x2d12e", "EventName": "PM_MRK_DATA_FROM_L3MISS_CYC", "BriefDescription": "Duration in cycles to reload from a localtion other than the local core's L3 due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x2d122", "EventName": "PM_MRK_DATA_FROM_L3_CYC", "BriefDescription": "Duration in cycles to reload from local core's L3 due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x3d142", "EventName": "PM_MRK_DATA_FROM_L3_DISP_CONFLICT", "BriefDescription": "The processor's data cache was reloaded from local core's L3 with dispatch conflict due to a marked load", "PublicDescription": "" }, - {, + { "EventCode": "0x2c122", "EventName": "PM_MRK_DATA_FROM_L3_DISP_CONFLICT_CYC", "BriefDescription": "Duration in cycles to reload from local core's L3 with dispatch conflict due to a marked load", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 12 19:37:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACDD91D983B; Thu, 12 Dec 2019 19:37:14 +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 47YkZy45l7z42pC; Thu, 12 Dec 2019 19:37:14 +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 82FED9A1; Thu, 12 Dec 2019 19:37:14 +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 xBCJbEgt005185; Thu, 12 Dec 2019 19:37:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCJbBXs005167; Thu, 12 Dec 2019 19:37:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912121937.xBCJbBXs005167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Dec 2019 19:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355668 - in head/lib/libpmc/pmu-events/arch/s390: cf_z10 cf_z13 cf_z14 cf_z196 cf_zec12 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/lib/libpmc/pmu-events/arch/s390: cf_z10 cf_z13 cf_z14 cf_z196 cf_zec12 X-SVN-Commit-Revision: 355668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 19:37:14 -0000 Author: emaste Date: Thu Dec 12 19:37:10 2019 New Revision: 355668 URL: https://svnweb.freebsd.org/changeset/base/355668 Log: libpmc: convert s390 events data to proper json Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z10/basic.json head/lib/libpmc/pmu-events/arch/s390/cf_z10/crypto.json head/lib/libpmc/pmu-events/arch/s390/cf_z10/extended.json head/lib/libpmc/pmu-events/arch/s390/cf_z13/basic.json head/lib/libpmc/pmu-events/arch/s390/cf_z13/crypto.json head/lib/libpmc/pmu-events/arch/s390/cf_z13/extended.json head/lib/libpmc/pmu-events/arch/s390/cf_z14/basic.json head/lib/libpmc/pmu-events/arch/s390/cf_z14/crypto.json head/lib/libpmc/pmu-events/arch/s390/cf_z14/extended.json head/lib/libpmc/pmu-events/arch/s390/cf_z196/basic.json head/lib/libpmc/pmu-events/arch/s390/cf_z196/crypto.json head/lib/libpmc/pmu-events/arch/s390/cf_z196/extended.json head/lib/libpmc/pmu-events/arch/s390/cf_zec12/basic.json head/lib/libpmc/pmu-events/arch/s390/cf_zec12/crypto.json head/lib/libpmc/pmu-events/arch/s390/cf_zec12/extended.json Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z10/basic.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_z10/basic.json Thu Dec 12 19:33:16 2019 (r355667) +++ head/lib/libpmc/pmu-events/arch/s390/cf_z10/basic.json Thu Dec 12 19:37:10 2019 (r355668) @@ -70,5 +70,5 @@ "EventName": "PROBLEM_STATE_L1D_PENALTY_CYCLES", "BriefDescription": "Problem-State L1D Penalty Cycles", "PublicDescription": "Problem-State Level-1 D-Cache Penalty Cycle Count" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z10/crypto.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_z10/crypto.json Thu Dec 12 19:33:16 2019 (r355667) +++ head/lib/libpmc/pmu-events/arch/s390/cf_z10/crypto.json Thu Dec 12 19:37:10 2019 (r355668) @@ -94,5 +94,5 @@ "EventName": "AES_BLOCKED_CYCLES", "BriefDescription": "AES Blocked Cycles", "PublicDescription": "Total number of CPU cycles blocked for the AES functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z10/extended.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_z10/extended.json Thu Dec 12 19:33:16 2019 (r355667) +++ head/lib/libpmc/pmu-events/arch/s390/cf_z10/extended.json Thu Dec 12 19:37:10 2019 (r355668) @@ -106,5 +106,5 @@ "EventName": "L2C_STORES_SENT", "BriefDescription": "L2C Stores Sent", "PublicDescription": "Incremented by one for every store sent to Level-2 (L1.5) cache" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z13/basic.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_z13/basic.json Thu Dec 12 19:33:16 2019 (r355667) +++ head/lib/libpmc/pmu-events/arch/s390/cf_z13/basic.json Thu Dec 12 19:37:10 2019 (r355668) @@ -70,5 +70,5 @@ "EventName": "PROBLEM_STATE_L1D_PENALTY_CYCLES", "BriefDescription": "Problem-State L1D Penalty Cycles", "PublicDescription": "Problem-State Level-1 D-Cache Penalty Cycle Count" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z13/crypto.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_z13/crypto.json Thu Dec 12 19:33:16 2019 (r355667) +++ head/lib/libpmc/pmu-events/arch/s390/cf_z13/crypto.json Thu Dec 12 19:37:10 2019 (r355668) @@ -94,5 +94,5 @@ "EventName": "AES_BLOCKED_CYCLES", "BriefDescription": "AES Blocked Cycles", "PublicDescription": "Total number of CPU cycles blocked for the AES functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z13/extended.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_z13/extended.json Thu Dec 12 19:33:16 2019 (r355667) +++ head/lib/libpmc/pmu-events/arch/s390/cf_z13/extended.json Thu Dec 12 19:37:10 2019 (r355668) @@ -334,5 +334,5 @@ "EventName": "MT_DIAG_CYCLES_TWO_THR_ACTIVE", "BriefDescription": "Cycle count with two threads active", "PublicDescription": "Cycle count with two threads active" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z14/basic.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_z14/basic.json Thu Dec 12 19:33:16 2019 (r355667) +++ head/lib/libpmc/pmu-events/arch/s390/cf_z14/basic.json Thu Dec 12 19:37:10 2019 (r355668) @@ -46,5 +46,5 @@ "EventName": "PROBLEM_STATE_INSTRUCTIONS", "BriefDescription": "Problem-State Instructions", "PublicDescription": "Problem-State Instruction Count" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z14/crypto.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_z14/crypto.json Thu Dec 12 19:33:16 2019 (r355667) +++ head/lib/libpmc/pmu-events/arch/s390/cf_z14/crypto.json Thu Dec 12 19:37:10 2019 (r355668) @@ -94,5 +94,5 @@ "EventName": "AES_BLOCKED_CYCLES", "BriefDescription": "AES Blocked Cycles", "PublicDescription": "Total number of CPU cycles blocked for the AES functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z14/extended.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_z14/extended.json Thu Dec 12 19:33:16 2019 (r355667) +++ head/lib/libpmc/pmu-events/arch/s390/cf_z14/extended.json Thu Dec 12 19:37:10 2019 (r355668) @@ -316,5 +316,5 @@ "EventName": "MT_DIAG_CYCLES_TWO_THR_ACTIVE", "BriefDescription": "Cycle count with two threads active", "PublicDescription": "Cycle count with two threads active" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z196/basic.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_z196/basic.json Thu Dec 12 19:33:16 2019 (r355667) +++ head/lib/libpmc/pmu-events/arch/s390/cf_z196/basic.json Thu Dec 12 19:37:10 2019 (r355668) @@ -70,5 +70,5 @@ "EventName": "PROBLEM_STATE_L1D_PENALTY_CYCLES", "BriefDescription": "Problem-State L1D Penalty Cycles", "PublicDescription": "Problem-State Level-1 D-Cache Penalty Cycle Count" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z196/crypto.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_z196/crypto.json Thu Dec 12 19:33:16 2019 (r355667) +++ head/lib/libpmc/pmu-events/arch/s390/cf_z196/crypto.json Thu Dec 12 19:37:10 2019 (r355668) @@ -94,5 +94,5 @@ "EventName": "AES_BLOCKED_CYCLES", "BriefDescription": "AES Blocked Cycles", "PublicDescription": "Total number of CPU cycles blocked for the AES functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/s390/cf_z196/extended.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_z196/extended.json Thu Dec 12 19:33:16 2019 (r355667) +++ head/lib/libpmc/pmu-events/arch/s390/cf_z196/extended.json Thu Dec 12 19:37:10 2019 (r355668) @@ -142,5 +142,5 @@ "EventName": "L1I_OFFCHIP_L3_SOURCED_WRITES", "BriefDescription": "L1I Off-Chip L3 Sourced Writes", "PublicDescription": "A directory write to the Level-1 I-Cache directory where the returned cache line was sourced from an Off Chip/On Book Level-3 cache" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/s390/cf_zec12/basic.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_zec12/basic.json Thu Dec 12 19:33:16 2019 (r355667) +++ head/lib/libpmc/pmu-events/arch/s390/cf_zec12/basic.json Thu Dec 12 19:37:10 2019 (r355668) @@ -70,5 +70,5 @@ "EventName": "PROBLEM_STATE_L1D_PENALTY_CYCLES", "BriefDescription": "Problem-State L1D Penalty Cycles", "PublicDescription": "Problem-State Level-1 D-Cache Penalty Cycle Count" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/s390/cf_zec12/crypto.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_zec12/crypto.json Thu Dec 12 19:33:16 2019 (r355667) +++ head/lib/libpmc/pmu-events/arch/s390/cf_zec12/crypto.json Thu Dec 12 19:37:10 2019 (r355668) @@ -94,5 +94,5 @@ "EventName": "AES_BLOCKED_CYCLES", "BriefDescription": "AES Blocked Cycles", "PublicDescription": "Total number of CPU cycles blocked for the AES functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU" - }, + } ] Modified: head/lib/libpmc/pmu-events/arch/s390/cf_zec12/extended.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/s390/cf_zec12/extended.json Thu Dec 12 19:33:16 2019 (r355667) +++ head/lib/libpmc/pmu-events/arch/s390/cf_zec12/extended.json Thu Dec 12 19:37:10 2019 (r355668) @@ -208,5 +208,5 @@ "EventName": "TX_C_TABORT_SPECIAL", "BriefDescription": "Aborted transactions in constrained TX mode using special completion logic", "PublicDescription": "A transaction abort has occurred in a constrained transactional-execution mode and the CPU is using special logic to allow the transaction to complete" - }, + } ] From owner-svn-src-all@freebsd.org Thu Dec 12 20:44:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF4601DAA10; Thu, 12 Dec 2019 20:44:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47Ym4t4lkSz45mB; Thu, 12 Dec 2019 20:44:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DA431640; Thu, 12 Dec 2019 20:44:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBCKikJh046793; Thu, 12 Dec 2019 20:44:46 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCKikVY046792; Thu, 12 Dec 2019 20:44:46 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201912122044.xBCKikVY046792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 12 Dec 2019 20:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355669 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 355669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 20:44:46 -0000 Author: cy Date: Thu Dec 12 20:44:46 2019 New Revision: 355669 URL: https://svnweb.freebsd.org/changeset/base/355669 Log: in6_cksum() returns zero when checksums are good. PR: 203275 Reported by: Frank Volf MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Thu Dec 12 19:37:10 2019 (r355668) +++ head/sys/contrib/ipfilter/netinet/fil.c Thu Dec 12 20:44:46 2019 (r355669) @@ -6744,7 +6744,7 @@ ipf_checkl4sum(fin) #endif DT3(l4sums, u_short, hdrsum, u_short, sum, fr_info_t *, fin); #ifdef USE_INET6 - if (hdrsum == sum || (sum == 0 && fin->fin_p == IPPROTO_ICMPV6)) { + if (hdrsum == sum || (sum == 0 && IP_V(fin->fin_ip) == 6)) { #else if (hdrsum == sum) { #endif From owner-svn-src-all@freebsd.org Thu Dec 12 20:44:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DDF21DAA38; Thu, 12 Dec 2019 20:44:50 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47Ym4y3N4Tz45pN; Thu, 12 Dec 2019 20:44:50 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C5241642; Thu, 12 Dec 2019 20:44:50 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBCKio3p046854; Thu, 12 Dec 2019 20:44:50 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCKinsf046851; Thu, 12 Dec 2019 20:44:49 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201912122044.xBCKinsf046851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 12 Dec 2019 20:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355670 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 355670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 20:44:50 -0000 Author: cy Date: Thu Dec 12 20:44:49 2019 New Revision: 355670 URL: https://svnweb.freebsd.org/changeset/base/355670 Log: Rather than pass the address of the packet information control block to ipf_pcksum6(), directly pass the adddress of the mbuf to it. This reduces one pointer dereference. ipf_pcksum6() doesn't use the packet information control block except to obtain the mbuf address. MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/fil.c head/sys/contrib/ipfilter/netinet/ip_fil.h head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Thu Dec 12 20:44:46 2019 (r355669) +++ head/sys/contrib/ipfilter/netinet/fil.c Thu Dec 12 20:44:49 2019 (r355670) @@ -3436,7 +3436,7 @@ fr_cksum(fin, ip, l4proto, l4hdr) ip6 = (ip6_t *)ip; off = ((caddr_t)ip6 - m->m_data) + sizeof(struct ip6_hdr); int len = ntohs(ip6->ip6_plen) - (off - sizeof(*ip6)); - return(ipf_pcksum6(fin, ip6, off, len)); + return(ipf_pcksum6(m, ip6, off, len)); } else { return 0xffff; } Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil.h Thu Dec 12 20:44:46 2019 (r355669) +++ head/sys/contrib/ipfilter/netinet/ip_fil.h Thu Dec 12 20:44:49 2019 (r355670) @@ -1840,7 +1840,7 @@ extern int ipf_matchicmpqueryreply __P((int, icmpinfo extern u_32_t ipf_newisn __P((fr_info_t *)); extern u_int ipf_pcksum __P((fr_info_t *, int, u_int)); #ifdef USE_INET6 -extern u_int ipf_pcksum6 __P((fr_info_t *, ip6_t *, +extern u_int ipf_pcksum6 __P((struct mbuf *, ip6_t *, u_int32_t, u_int32_t)); #endif extern void ipf_rule_expire __P((ipf_main_softc_t *)); Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Thu Dec 12 20:44:46 2019 (r355669) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Thu Dec 12 20:44:49 2019 (r355670) @@ -1456,17 +1456,15 @@ ipf_pcksum(fin, hlen, sum) #ifdef USE_INET6 u_int -ipf_pcksum6(fin, ip6, off, len) - fr_info_t *fin; +ipf_pcksum6(m, ip6, off, len) + struct mbuf *m; ip6_t *ip6; u_int32_t off; u_int32_t len; { #ifdef _KERNEL - struct mbuf *m; int sum; - m = fin->fin_m; if (m->m_len < sizeof(struct ip6_hdr)) { return 0xffff; } From owner-svn-src-all@freebsd.org Thu Dec 12 20:55:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E22B21DAF59; Thu, 12 Dec 2019 20:55:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47YmKW5RDMz4781; Thu, 12 Dec 2019 20:55:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5DFF1829; Thu, 12 Dec 2019 20:55:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBCKth00053253; Thu, 12 Dec 2019 20:55:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCKthq3053252; Thu, 12 Dec 2019 20:55:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912122055.xBCKthq3053252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Dec 2019 20:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355671 - head/lib/libpmc/pmu-events X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libpmc/pmu-events X-SVN-Commit-Revision: 355671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 20:55:43 -0000 Author: emaste Date: Thu Dec 12 20:55:43 2019 New Revision: 355671 URL: https://svnweb.freebsd.org/changeset/base/355671 Log: libpmc: add MIT SPDX tag to header file The jevents tool includes a copy of the jsmn json parser which is MIT licensed. Upstream the MIT license appears in the jsmn.c source and a standalone LICENSE file, but the latter is not included in the copy contained in libpmc and the jsmn.h header carried no license information. Add an SPDX tag to clarify the situation. Modified: head/lib/libpmc/pmu-events/jsmn.h Modified: head/lib/libpmc/pmu-events/jsmn.h ============================================================================== --- head/lib/libpmc/pmu-events/jsmn.h Thu Dec 12 20:44:49 2019 (r355670) +++ head/lib/libpmc/pmu-events/jsmn.h Thu Dec 12 20:55:43 2019 (r355671) @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: MIT */ /* $FreeBSD$ */ #ifndef __JSMN_H_ #define __JSMN_H_ From owner-svn-src-all@freebsd.org Thu Dec 12 21:13:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F8421DB32F; Thu, 12 Dec 2019 21:13:21 +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 47Ymjs032Jz47vh; Thu, 12 Dec 2019 21:13:21 +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 F0E7F1BAE; Thu, 12 Dec 2019 21:13:20 +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 xBCLDK0Y064874; Thu, 12 Dec 2019 21:13:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCLDKNd064873; Thu, 12 Dec 2019 21:13:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912122113.xBCLDKNd064873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 12 Dec 2019 21:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355672 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 21:13:21 -0000 Author: markj Date: Thu Dec 12 21:13:20 2019 New Revision: 355672 URL: https://svnweb.freebsd.org/changeset/base/355672 Log: Implement atomic state updates using the new vm_page_astate_t structure. Introduce primitives vm_page_astate_load() and vm_page_astate_fcmpset() to operate on the 32-bit per-page atomic state. Modify vm_page_pqstate_fcmpset() to use them. No functional change intended. Introduce PGA_QUEUE_OP_MASK, a subset of PGA_QUEUE_STATE_MASK that only includes queue operation flags. This will be used in subsequent patches. Reviewed by: alc, jeff, kib Sponsored by: Netflix, Intel Differential Revision: https://reviews.freebsd.org/D22753 Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Thu Dec 12 20:55:43 2019 (r355671) +++ head/sys/vm/vm_page.h Thu Dec 12 21:13:20 2019 (r355672) @@ -439,8 +439,8 @@ extern struct mtx_padalign pa_lock[]; #define PGA_REQUEUE_HEAD 0x0040 /* page requeue should bypass LRU */ #define PGA_NOSYNC 0x0080 /* do not collect for syncer */ -#define PGA_QUEUE_STATE_MASK (PGA_ENQUEUED | PGA_DEQUEUE | PGA_REQUEUE | \ - PGA_REQUEUE_HEAD) +#define PGA_QUEUE_OP_MASK (PGA_DEQUEUE | PGA_REQUEUE | PGA_REQUEUE_HEAD) +#define PGA_QUEUE_STATE_MASK (PGA_ENQUEUED | PGA_QUEUE_OP_MASK) /* * Page flags. If changed at any other time than page allocation or @@ -756,36 +756,37 @@ void vm_page_assert_pga_writeable(vm_page_t m, uint16_ #define VM_PAGE_ASSERT_PGA_WRITEABLE(m, bits) (void)0 #endif +#define VM_PAGE_AFLAG_SHIFT (__offsetof(vm_page_astate_t, flags) * NBBY) + /* - * We want to use atomic updates for the aflags field, which is 8 bits wide. - * However, not all architectures support atomic operations on 8-bit - * destinations. In order that we can easily use a 32-bit operation, we - * require that the aflags field be 32-bit aligned. + * Load a snapshot of a page's 32-bit atomic state. */ -_Static_assert(offsetof(struct vm_page, a.flags) % sizeof(uint32_t) == 0, - "aflags field is not 32-bit aligned"); +static inline vm_page_astate_t +vm_page_astate_load(vm_page_t m) +{ + vm_page_astate_t a; + a._bits = atomic_load_32(&m->a); + return (a); +} + /* - * We want to be able to update the aflags and queue fields atomically in - * the same operation. + * Atomically compare and set a page's atomic state. */ -_Static_assert(offsetof(struct vm_page, a.flags) / sizeof(uint32_t) == - offsetof(struct vm_page, a.queue) / sizeof(uint32_t), - "aflags and queue fields do not belong to the same 32-bit word"); -_Static_assert(offsetof(struct vm_page, a.queue) % sizeof(uint32_t) == 2, - "queue field is at an unexpected offset"); -_Static_assert(sizeof(((struct vm_page *)NULL)->a.queue) == 1, - "queue field has an unexpected size"); +static inline bool +vm_page_astate_fcmpset(vm_page_t m, vm_page_astate_t *old, vm_page_astate_t new) +{ -#if BYTE_ORDER == LITTLE_ENDIAN -#define VM_PAGE_AFLAG_SHIFT 0 -#define VM_PAGE_QUEUE_SHIFT 16 -#else -#define VM_PAGE_AFLAG_SHIFT 16 -#define VM_PAGE_QUEUE_SHIFT 8 -#endif -#define VM_PAGE_QUEUE_MASK (0xff << VM_PAGE_QUEUE_SHIFT) + KASSERT(new.queue == PQ_INACTIVE || (new.flags & PGA_REQUEUE_HEAD) == 0, + ("%s: invalid head requeue request for page %p", __func__, m)); + KASSERT((new.flags & PGA_ENQUEUED) == 0 || new.queue != PQ_NONE, + ("%s: setting PGA_ENQUEUED with PQ_NONE in page %p", __func__, m)); + KASSERT(new._bits != old->_bits, + ("%s: bits are unchanged", __func__)); + return (atomic_fcmpset_32(&m->a._bits, &old->_bits, new._bits) != 0); +} + /* * Clear the given bits in the specified page. */ @@ -805,7 +806,7 @@ vm_page_aflag_clear(vm_page_t m, uint16_t bits) * atomic update. Parallel non-atomic updates to the other fields * within this word are handled properly by the atomic update. */ - addr = (void *)&m->a.flags; + addr = (void *)&m->a; val = bits << VM_PAGE_AFLAG_SHIFT; atomic_clear_32(addr, val); } @@ -825,7 +826,7 @@ vm_page_aflag_set(vm_page_t m, uint16_t bits) * atomic update. Parallel non-atomic updates to the other fields * within this word are handled properly by the atomic update. */ - addr = (void *)&m->a.flags; + addr = (void *)&m->a; val = bits << VM_PAGE_AFLAG_SHIFT; atomic_set_32(addr, val); } @@ -841,24 +842,16 @@ static inline bool vm_page_pqstate_cmpset(vm_page_t m, uint32_t oldq, uint32_t newq, uint32_t fflags, uint32_t nflags) { - uint32_t *addr, nval, oval, qsmask; + vm_page_astate_t new, old; - fflags <<= VM_PAGE_AFLAG_SHIFT; - nflags <<= VM_PAGE_AFLAG_SHIFT; - newq <<= VM_PAGE_QUEUE_SHIFT; - oldq <<= VM_PAGE_QUEUE_SHIFT; - qsmask = ((PGA_DEQUEUE | PGA_REQUEUE | PGA_REQUEUE_HEAD) << - VM_PAGE_AFLAG_SHIFT) | VM_PAGE_QUEUE_MASK; - - addr = (void *)&m->a.flags; - oval = atomic_load_32(addr); + old = vm_page_astate_load(m); do { - if ((oval & fflags) != 0) + if ((old.flags & fflags) != 0 || old.queue != oldq) return (false); - if ((oval & VM_PAGE_QUEUE_MASK) != oldq) - return (false); - nval = (oval & ~qsmask) | nflags | newq; - } while (!atomic_fcmpset_32(addr, &oval, nval)); + new = old; + new.flags = (new.flags & ~PGA_QUEUE_OP_MASK) | nflags; + new.queue = newq; + } while (!vm_page_astate_fcmpset(m, &old, new)); return (true); } From owner-svn-src-all@freebsd.org Thu Dec 12 21:33:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C6B21DB678; Thu, 12 Dec 2019 21:33:01 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47Yn8X70BFz48dQ; Thu, 12 Dec 2019 21:33:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D148D1F25; Thu, 12 Dec 2019 21:33:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBCLX0tp076314; Thu, 12 Dec 2019 21:33:00 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCLX0D9076313; Thu, 12 Dec 2019 21:33:00 GMT (envelope-from np@FreeBSD.org) Message-Id: <201912122133.xBCLX0D9076313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 12 Dec 2019 21:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355673 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 355673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 21:33:01 -0000 Author: np Date: Thu Dec 12 21:33:00 2019 New Revision: 355673 URL: https://svnweb.freebsd.org/changeset/base/355673 Log: cxgbe(4): Never use hardware checksumming in netmap tx. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Thu Dec 12 21:13:20 2019 (r355672) +++ head/sys/dev/cxgbe/t4_netmap.c Thu Dec 12 21:33:00 2019 (r355673) @@ -659,7 +659,7 @@ ring_nm_txq_db(struct adapter *sc, struct sge_nm_txq * */ static void cxgbe_nm_tx(struct adapter *sc, struct sge_nm_txq *nm_txq, - struct netmap_kring *kring, int npkt, int npkt_remaining, int txcsum) + struct netmap_kring *kring, int npkt, int npkt_remaining) { struct netmap_ring *ring = kring->ring; struct netmap_slot *slot; @@ -695,13 +695,9 @@ cxgbe_nm_tx(struct adapter *sc, struct sge_nm_txq *nm_ * netmap(4) says "netmap does not use features such as * checksum offloading, TCP segmentation offloading, * encryption, VLAN encapsulation/decapsulation, etc." - * - * So the ncxl interfaces have tx hardware checksumming - * disabled by default. But you can override netmap by - * enabling IFCAP_TXCSUM on the interface manully. */ - cpl->ctrl1 = txcsum ? 0 : - htobe64(F_TXPKT_IPCSUM_DIS | F_TXPKT_L4CSUM_DIS); + cpl->ctrl1 = htobe64(F_TXPKT_IPCSUM_DIS | + F_TXPKT_L4CSUM_DIS); usgl = (void *)(cpl + 1); usgl->cmd_nsge = htobe32(V_ULPTX_CMD(ULP_TX_SC_DSGL) | @@ -815,7 +811,7 @@ cxgbe_netmap_txsync(struct netmap_kring *kring, int fl struct sge_nm_txq *nm_txq = &sc->sge.nm_txq[vi->first_nm_txq + kring->ring_id]; const u_int head = kring->rhead; u_int reclaimed = 0; - int n, d, npkt_remaining, ndesc_remaining, txcsum; + int n, d, npkt_remaining, ndesc_remaining; /* * Tx was at kring->nr_hwcur last time around and now we need to advance @@ -826,7 +822,6 @@ cxgbe_netmap_txsync(struct netmap_kring *kring, int fl npkt_remaining = head >= kring->nr_hwcur ? head - kring->nr_hwcur : kring->nkr_num_slots - kring->nr_hwcur + head; - txcsum = ifp->if_capenable & (IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6); while (npkt_remaining) { reclaimed += reclaim_nm_tx_desc(nm_txq); ndesc_remaining = contiguous_ndesc_available(nm_txq); @@ -850,7 +845,7 @@ cxgbe_netmap_txsync(struct netmap_kring *kring, int fl /* Send n packets and update nm_txq->pidx and kring->nr_hwcur */ npkt_remaining -= n; - cxgbe_nm_tx(sc, nm_txq, kring, n, npkt_remaining, txcsum); + cxgbe_nm_tx(sc, nm_txq, kring, n, npkt_remaining); } MPASS(npkt_remaining == 0); MPASS(kring->nr_hwcur == head); From owner-svn-src-all@freebsd.org Thu Dec 12 22:00:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F8D41DBC4B; Thu, 12 Dec 2019 22:00:11 +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 47Ynlv1vB2z49X7; Thu, 12 Dec 2019 22:00:11 +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 3BA1422BB; Thu, 12 Dec 2019 22:00:11 +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 xBCM0B4O088522; Thu, 12 Dec 2019 22:00:11 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCM0AhI088521; Thu, 12 Dec 2019 22:00:10 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912122200.xBCM0AhI088521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 12 Dec 2019 22:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355674 - in stable/12/sys/fs: nfs nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/12/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 355674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 22:00:11 -0000 Author: rmacklem Date: Thu Dec 12 22:00:10 2019 New Revision: 355674 URL: https://svnweb.freebsd.org/changeset/base/355674 Log: MFC: r354989 Fix the pNFS server's reporting of SpaceUsed (va_bytes). The pNFS server currently reports SpaceUsed (va_bytes) for the metadata file. This in not correct, since the metadata file is always empty and, as such, va_bytes is just the allocation for the empty file. This patch adds va_bytes to the list of attributes acquired from the DS for a file, so that it includes the allocated data size and is updated when the file is written. For files created on a pNFS server before this patch is applied, the va_bytes value is estimated by rounding va_size up to a multiple of BLKDEV_IOSIZE. Once the file is written after this patch has been applied to the metadata server, the va_bytes returned for the file will be correct. This patch only affects a pNFS metadata server. Found during testing of the NFSv4.2 pNFS server for the Allocate operation. (Not yet in head/current.) Modified: stable/12/sys/fs/nfs/nfsrvstate.h stable/12/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfs/nfsrvstate.h ============================================================================== --- stable/12/sys/fs/nfs/nfsrvstate.h Thu Dec 12 21:33:00 2019 (r355673) +++ stable/12/sys/fs/nfs/nfsrvstate.h Thu Dec 12 22:00:10 2019 (r355674) @@ -355,14 +355,24 @@ struct nfsdevice { }; /* - * This structure holds the va_size, va_filerev, va_atime and va_mtime for the - * DS file and is stored in the metadata file's extended attribute pnfsd.dsattr. + * This structure holds the va_size, va_filerev, va_atime, va_mtime and + * va_bytes for the DS file and is stored in the metadata file's extended + * attribute pnfsd.dsattr. + * opnfsdsattr was missing the va_bytes field and, as such, it was updated. */ +struct opnfsdsattr { + uint64_t dsa_filerev; + uint64_t dsa_size; + struct timespec dsa_atime; + struct timespec dsa_mtime; +}; + struct pnfsdsattr { uint64_t dsa_filerev; uint64_t dsa_size; struct timespec dsa_atime; struct timespec dsa_mtime; + uint64_t dsa_bytes; }; /* Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdport.c Thu Dec 12 21:33:00 2019 (r355673) +++ stable/12/sys/fs/nfsserver/nfs_nfsdport.c Thu Dec 12 22:00:10 2019 (r355674) @@ -277,7 +277,8 @@ nfsvno_getattr(struct vnode *vp, struct nfsvattr *nvap } /* - * Acquire the Change, Size and TimeModify attributes, as required. + * Acquire the Change, Size, TimeAccess, TimeModify and SpaceUsed + * attributes, as required. * This needs to be done for regular files if: * - non-NFSv4 RPCs or * - when attrbitp == NULL or @@ -292,7 +293,8 @@ nfsvno_getattr(struct vnode *vp, struct nfsvattr *nvap NFSISSET_ATTRBIT(attrbitp, NFSATTRBIT_CHANGE) || NFSISSET_ATTRBIT(attrbitp, NFSATTRBIT_SIZE) || NFSISSET_ATTRBIT(attrbitp, NFSATTRBIT_TIMEACCESS) || - NFSISSET_ATTRBIT(attrbitp, NFSATTRBIT_TIMEMODIFY))) { + NFSISSET_ATTRBIT(attrbitp, NFSATTRBIT_TIMEMODIFY) || + NFSISSET_ATTRBIT(attrbitp, NFSATTRBIT_SPACEUSED))) { error = nfsrv_proxyds(nd, vp, 0, 0, nd->nd_cred, p, NFSPROC_GETATTR, NULL, NULL, NULL, &na, NULL); if (error == 0) @@ -312,6 +314,7 @@ nfsvno_getattr(struct vnode *vp, struct nfsvattr *nvap nvap->na_mtime = na.na_mtime; nvap->na_filerev = na.na_filerev; nvap->na_size = na.na_size; + nvap->na_bytes = na.na_bytes; } NFSD_DEBUG(4, "nfsvno_getattr: gotattr=%d err=%d chg=%ju\n", gotattr, error, (uintmax_t)na.na_filerev); @@ -3880,6 +3883,7 @@ nfsrv_dscreate(struct vnode *dvp, struct vattr *vap, s dsa->dsa_size = va.va_size; dsa->dsa_atime = va.va_atime; dsa->dsa_mtime = va.va_mtime; + dsa->dsa_bytes = va.va_bytes; } } if (error == 0) { @@ -4404,6 +4408,7 @@ nfsrv_proxyds(struct nfsrv_descript *nd, struct vnode struct vnode *dvp[NFSDEV_MAXMIRRORS]; struct nfsdevice *ds; struct pnfsdsattr dsattr; + struct opnfsdsattr odsattr; char *buf; int buflen, error, failpos, i, mirrorcnt, origmircnt, trycnt; @@ -4428,15 +4433,31 @@ nfsrv_proxyds(struct nfsrv_descript *nd, struct vnode error = vn_extattr_get(vp, IO_NODELOCKED, EXTATTR_NAMESPACE_SYSTEM, "pnfsd.dsattr", &buflen, buf, p); - if (error == 0 && buflen != sizeof(dsattr)) - error = ENXIO; if (error == 0) { - NFSBCOPY(buf, &dsattr, buflen); - nap->na_filerev = dsattr.dsa_filerev; - nap->na_size = dsattr.dsa_size; - nap->na_atime = dsattr.dsa_atime; - nap->na_mtime = dsattr.dsa_mtime; - + if (buflen == sizeof(odsattr)) { + NFSBCOPY(buf, &odsattr, buflen); + nap->na_filerev = odsattr.dsa_filerev; + nap->na_size = odsattr.dsa_size; + nap->na_atime = odsattr.dsa_atime; + nap->na_mtime = odsattr.dsa_mtime; + /* + * Fake na_bytes by rounding up na_size. + * Since we don't know the block size, just + * use BLKDEV_IOSIZE. + */ + nap->na_bytes = (odsattr.dsa_size + + BLKDEV_IOSIZE - 1) & ~(BLKDEV_IOSIZE - 1); + } else if (buflen == sizeof(dsattr)) { + NFSBCOPY(buf, &dsattr, buflen); + nap->na_filerev = dsattr.dsa_filerev; + nap->na_size = dsattr.dsa_size; + nap->na_atime = dsattr.dsa_atime; + nap->na_mtime = dsattr.dsa_mtime; + nap->na_bytes = dsattr.dsa_bytes; + } else + error = ENXIO; + } + if (error == 0) { /* * If nfsrv_pnfsgetdsattr is 0 or nfsrv_checkdsattr() * returns 0, just return now. nfsrv_checkdsattr() @@ -4808,6 +4829,7 @@ nfsrv_setextattr(struct vnode *vp, struct nfsvattr *na dsattr.dsa_size = nap->na_size; dsattr.dsa_atime = nap->na_atime; dsattr.dsa_mtime = nap->na_mtime; + dsattr.dsa_bytes = nap->na_bytes; error = vn_extattr_set(vp, IO_NODELOCKED, EXTATTR_NAMESPACE_SYSTEM, "pnfsd.dsattr", sizeof(dsattr), (char *)&dsattr, p); if (error != 0) @@ -4983,12 +5005,13 @@ nfsrv_writedsdorpc(struct nfsmount *nmp, fhandle_t *fh nd->nd_bpos = mtod(m, char *) + m->m_len; NFSD_DEBUG(4, "nfsrv_writedsdorpc: lastmb len=%d\n", m->m_len); - /* Do a Getattr for Size, Change and Modify Time. */ + /* Do a Getattr for the attributes that change upon writing. */ NFSZERO_ATTRBIT(&attrbits); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_SIZE); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_CHANGE); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESS); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEMODIFY); + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_SPACEUSED); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); (void) nfsrv_putattrbit(nd, &attrbits); @@ -5167,12 +5190,13 @@ nfsrv_setattrdsdorpc(fhandle_t *fhp, struct ucred *cre nfsm_stateidtom(nd, &st, NFSSTATEID_PUTSTATEID); nfscl_fillsattr(nd, &nap->na_vattr, vp, NFSSATTR_FULL, 0); - /* Do a Getattr for Size, Change, Access Time and Modify Time. */ + /* Do a Getattr for the attributes that change due to writing. */ NFSZERO_ATTRBIT(&attrbits); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_SIZE); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_CHANGE); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESS); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEMODIFY); + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_SPACEUSED); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); (void) nfsrv_putattrbit(nd, &attrbits); @@ -5469,7 +5493,7 @@ nfsrv_setacldsrpc(fhandle_t *fhp, struct ucred *cred, } /* - * Getattr call to the DS for the Modify, Size and Change attributes. + * Getattr call to the DS for the attributes that change due to writing. */ static int nfsrv_getattrdsrpc(fhandle_t *fhp, struct ucred *cred, NFSPROC_T *p, @@ -5488,6 +5512,7 @@ nfsrv_getattrdsrpc(fhandle_t *fhp, struct ucred *cred, NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_CHANGE); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESS); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEMODIFY); + NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_SPACEUSED); (void) nfsrv_putattrbit(nd, &attrbits); error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); From owner-svn-src-all@freebsd.org Thu Dec 12 22:59:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9171B1DC809; Thu, 12 Dec 2019 22:59:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47Yq4C3LT9z4CwR; Thu, 12 Dec 2019 22:59:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DFF42DD6; Thu, 12 Dec 2019 22:59:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBCMxNNG023781; Thu, 12 Dec 2019 22:59:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCMxNsl023780; Thu, 12 Dec 2019 22:59:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201912122259.xBCMxNsl023780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Dec 2019 22:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355676 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 355676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 22:59:23 -0000 Author: kib Date: Thu Dec 12 22:59:22 2019 New Revision: 355676 URL: https://svnweb.freebsd.org/changeset/base/355676 Log: rtld: make checks for mmap(2) failures compliant with documentation. On error, mmap(2) returns MAP_FAILED. There is no need to use its definition or to cast. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/map_object.c Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Thu Dec 12 22:36:47 2019 (r355675) +++ head/libexec/rtld-elf/map_object.c Thu Dec 12 22:59:22 2019 (r355676) @@ -209,7 +209,7 @@ map_object(int fd, const char *path, const struct stat base_flags |= MAP_FIXED | MAP_EXCL; mapbase = mmap(base_addr, mapsize, PROT_NONE, base_flags, -1, 0); - if (mapbase == (caddr_t) -1) { + if (mapbase == MAP_FAILED) { _rtld_error("%s: mmap of entire address space failed: %s", path, rtld_strerror(errno)); goto error; @@ -266,7 +266,7 @@ map_object(int fd, const char *path, const struct stat bss_addr = mapbase + (bss_vaddr - base_vaddr); if (bss_vlimit > bss_vaddr) { /* There is something to do */ if (mmap(bss_addr, bss_vlimit - bss_vaddr, data_prot, - data_flags | MAP_ANON, -1, 0) == (caddr_t)-1) { + data_flags | MAP_ANON, -1, 0) == MAP_FAILED) { _rtld_error("%s: mmap of bss failed: %s", path, rtld_strerror(errno)); goto error1; @@ -348,7 +348,7 @@ get_elf_header(int fd, const char *path, const struct hdr = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_PRIVATE | MAP_PREFAULT_READ, fd, 0); - if (hdr == (Elf_Ehdr *)MAP_FAILED) { + if (hdr == MAP_FAILED) { _rtld_error("%s: read error: %s", path, rtld_strerror(errno)); return (NULL); } From owner-svn-src-all@freebsd.org Thu Dec 12 23:22:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53ADE1DCFF2; Thu, 12 Dec 2019 23:22:57 +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 47YqbP2Fxdz4F6B; Thu, 12 Dec 2019 23:22:57 +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 47D82332D; Thu, 12 Dec 2019 23:22:57 +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 xBCNMv1D040927; Thu, 12 Dec 2019 23:22:57 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCNMt80040917; Thu, 12 Dec 2019 23:22:55 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912122322.xBCNMt80040917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 12 Dec 2019 23:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355677 - in head/sys/fs: nfs nfsclient nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient nfsserver X-SVN-Commit-Revision: 355677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 23:22:57 -0000 Author: rmacklem Date: Thu Dec 12 23:22:55 2019 New Revision: 355677 URL: https://svnweb.freebsd.org/changeset/base/355677 Log: Add support for NFSv4.2 to the NFS client and server. This patch adds support for NFSv4.2 (RFC-7862) and Extended Attributes (RFC-8276) to the NFS client and server. NFSv4.2 is comprised of several optional features that can be supported in addition to NFSv4.1. This patch adds the following optional features: - posix_fadvise(POSIX_FADV_WILLNEED/POSIX_FADV_DONTNEED) - posix_fallocate() - intra server file range copying via the copy_file_range(2) syscall --> Avoiding data tranfer over the wire to/from the NFS client. - lseek(SEEK_DATA/SEEK_HOLE) - Extended attribute syscalls for "user" namespace attributes as defined by RFC-8276. Although this patch is fairly large, it should not affect support for the other versions of NFS. However it does add two new sysctls that allow a sysadmin to limit which minor versions of NFSv4 a server supports, allowing a sysadmin to disable NFSv4.2. Unfortunately, when the NFS stats structure was last revised, it was assumed that there would be no additional operations added beyond what was specified in RFC-7862. However RFC-8276 did add additional operations, forcing the NFS stats structure to revised again. It now has extra unused entries in all arrays, so that future extensions to NFSv4.2 can be accomodated without revising this structure again. A future commit will update nfsstat(1) to report counts for the new NFSv4.2 specific operations/procedures. This patch affects the internal interface between the nfscommon, nfscl and nfsd modules and, as such, they all must be upgraded simultaneously. I will do a version bump (although arguably not needed), due to this. This code has survived a "make universe" but has not been built with a recent GCC. If you encounter build problems, please email me. Relnotes: yes Modified: head/sys/fs/nfs/nfs.h head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfs_var.h head/sys/fs/nfs/nfsclstate.h head/sys/fs/nfs/nfsport.h head/sys/fs/nfs/nfsproto.h head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsclient/nfsmount.h head/sys/fs/nfsserver/nfs_nfsdkrpc.c head/sys/fs/nfsserver/nfs_nfsdport.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.h ============================================================================== --- head/sys/fs/nfs/nfs.h Thu Dec 12 22:59:22 2019 (r355676) +++ head/sys/fs/nfs/nfs.h Thu Dec 12 23:22:55 2019 (r355677) @@ -668,6 +668,8 @@ struct nfsrv_descript { uint32_t *nd_sequence; /* Sequence Op. ptr */ nfsv4stateid_t nd_curstateid; /* Current StateID */ nfsv4stateid_t nd_savedcurstateid; /* Saved Current StateID */ + uint32_t nd_maxreq; /* Max. request (session). */ + uint32_t nd_maxresp; /* Max. reply (session). */ }; #define nd_princlen nd_gssnamelen Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Thu Dec 12 22:59:22 2019 (r355676) +++ head/sys/fs/nfs/nfs_commonport.c Thu Dec 12 23:22:55 2019 (r355677) @@ -80,6 +80,7 @@ int nfs_pnfsio(task_fn_t *, void *); static int nfs_realign_test; static int nfs_realign_count; static struct ext_nfsstats oldnfsstats; +static struct nfsstatsov1 nfsstatsov1; SYSCTL_NODE(_vfs, OID_AUTO, nfs, CTLFLAG_RW, 0, "NFS filesystem"); SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RW, &nfs_realign_test, @@ -580,11 +581,143 @@ nfssvc_call(struct thread *p, struct nfssvc_args *uap, } else { error = copyin(uap->argp, &nfsstatver, sizeof(nfsstatver)); - if (error == 0 && nfsstatver.vers != NFSSTATS_V1) - error = EPERM; - if (error == 0) - error = copyout(&nfsstatsv1, uap->argp, - sizeof (nfsstatsv1)); + if (error == 0) { + if (nfsstatver.vers == NFSSTATS_OV1) { + /* Copy nfsstatsv1 to nfsstatsov1. */ + nfsstatsov1.attrcache_hits = + nfsstatsv1.attrcache_hits; + nfsstatsov1.attrcache_misses = + nfsstatsv1.attrcache_misses; + nfsstatsov1.lookupcache_hits = + nfsstatsv1.lookupcache_hits; + nfsstatsov1.lookupcache_misses = + nfsstatsv1.lookupcache_misses; + nfsstatsov1.direofcache_hits = + nfsstatsv1.direofcache_hits; + nfsstatsov1.direofcache_misses = + nfsstatsv1.direofcache_misses; + nfsstatsov1.accesscache_hits = + nfsstatsv1.accesscache_hits; + nfsstatsov1.accesscache_misses = + nfsstatsv1.accesscache_misses; + nfsstatsov1.biocache_reads = + nfsstatsv1.biocache_reads; + nfsstatsov1.read_bios = + nfsstatsv1.read_bios; + nfsstatsov1.read_physios = + nfsstatsv1.read_physios; + nfsstatsov1.biocache_writes = + nfsstatsv1.biocache_writes; + nfsstatsov1.write_bios = + nfsstatsv1.write_bios; + nfsstatsov1.write_physios = + nfsstatsv1.write_physios; + nfsstatsov1.biocache_readlinks = + nfsstatsv1.biocache_readlinks; + nfsstatsov1.readlink_bios = + nfsstatsv1.readlink_bios; + nfsstatsov1.biocache_readdirs = + nfsstatsv1.biocache_readdirs; + nfsstatsov1.readdir_bios = + nfsstatsv1.readdir_bios; + for (i = 0; i < NFSV42_NPROCS; i++) + nfsstatsov1.rpccnt[i] = + nfsstatsv1.rpccnt[i]; + nfsstatsov1.rpcretries = + nfsstatsv1.rpcretries; + for (i = 0; i < NFSV42_PURENOPS; i++) + nfsstatsov1.srvrpccnt[i] = + nfsstatsv1.srvrpccnt[i]; + for (i = NFSV42_NOPS, + j = NFSV42_PURENOPS; + i < NFSV42_NOPS + NFSV4OP_FAKENOPS; + i++, j++) + nfsstatsov1.srvrpccnt[j] = + nfsstatsv1.srvrpccnt[i]; + nfsstatsov1.srvrpc_errs = + nfsstatsv1.srvrpc_errs; + nfsstatsov1.srv_errs = + nfsstatsv1.srv_errs; + nfsstatsov1.rpcrequests = + nfsstatsv1.rpcrequests; + nfsstatsov1.rpctimeouts = + nfsstatsv1.rpctimeouts; + nfsstatsov1.rpcunexpected = + nfsstatsv1.rpcunexpected; + nfsstatsov1.rpcinvalid = + nfsstatsv1.rpcinvalid; + nfsstatsov1.srvcache_inproghits = + nfsstatsv1.srvcache_inproghits; + nfsstatsov1.srvcache_idemdonehits = + nfsstatsv1.srvcache_idemdonehits; + nfsstatsov1.srvcache_nonidemdonehits = + nfsstatsv1.srvcache_nonidemdonehits; + nfsstatsov1.srvcache_misses = + nfsstatsv1.srvcache_misses; + nfsstatsov1.srvcache_tcppeak = + nfsstatsv1.srvcache_tcppeak; + nfsstatsov1.srvcache_size = + nfsstatsv1.srvcache_size; + nfsstatsov1.srvclients = + nfsstatsv1.srvclients; + nfsstatsov1.srvopenowners = + nfsstatsv1.srvopenowners; + nfsstatsov1.srvopens = + nfsstatsv1.srvopens; + nfsstatsov1.srvlockowners = + nfsstatsv1.srvlockowners; + nfsstatsov1.srvlocks = + nfsstatsv1.srvlocks; + nfsstatsov1.srvdelegates = + nfsstatsv1.srvdelegates; + for (i = 0; i < NFSV42_CBNOPS; i++) + nfsstatsov1.cbrpccnt[i] = + nfsstatsv1.cbrpccnt[i]; + nfsstatsov1.clopenowners = + nfsstatsv1.clopenowners; + nfsstatsov1.clopens = + nfsstatsv1.clopens; + nfsstatsov1.cllockowners = + nfsstatsv1.cllockowners; + nfsstatsov1.cllocks = + nfsstatsv1.cllocks; + nfsstatsov1.cldelegates = + nfsstatsv1.cldelegates; + nfsstatsov1.cllocalopenowners = + nfsstatsv1.cllocalopenowners; + nfsstatsov1.cllocalopens = + nfsstatsv1.cllocalopens; + nfsstatsov1.cllocallockowners = + nfsstatsv1.cllocallockowners; + nfsstatsov1.cllocallocks = + nfsstatsv1.cllocallocks; + nfsstatsov1.srvstartcnt = + nfsstatsv1.srvstartcnt; + nfsstatsov1.srvdonecnt = + nfsstatsv1.srvdonecnt; + for (i = NFSV42_NOPS, + j = NFSV42_PURENOPS; + i < NFSV42_NOPS + NFSV4OP_FAKENOPS; + i++, j++) { + nfsstatsov1.srvbytes[j] = + nfsstatsv1.srvbytes[i]; + nfsstatsov1.srvops[j] = + nfsstatsv1.srvops[i]; + nfsstatsov1.srvduration[j] = + nfsstatsv1.srvduration[i]; + } + nfsstatsov1.busyfrom = + nfsstatsv1.busyfrom; + nfsstatsov1.busyfrom = + nfsstatsv1.busyfrom; + error = copyout(&nfsstatsov1, uap->argp, + sizeof(nfsstatsov1)); + } else if (nfsstatver.vers != NFSSTATS_V1) + error = EPERM; + else + error = copyout(&nfsstatsv1, uap->argp, + sizeof(nfsstatsv1)); + } } if (error == 0) { if ((uap->flag & NFSSVC_ZEROCLTSTATS) != 0) { Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Thu Dec 12 22:59:22 2019 (r355676) +++ head/sys/fs/nfs/nfs_commonsubs.c Thu Dec 12 23:22:55 2019 (r355677) @@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$"); #include +#include + #include /* @@ -91,6 +93,10 @@ int nfsrv_maxpnfsmirror = 1; SYSCTL_INT(_vfs_nfs, OID_AUTO, pnfsmirror, CTLFLAG_RD, &nfsrv_maxpnfsmirror, 0, "Mirror level for pNFS service"); +int nfs_maxcopyrange = 10 * 1024 * 1024; +SYSCTL_INT(_vfs_nfs, OID_AUTO, maxcopyrange, CTLFLAG_RW, + &nfs_maxcopyrange, 0, "Max size of a Copy so RPC times reasonable"); + /* * This array of structures indicates, for V4: * retfh - which of 3 types of calling args are used @@ -108,7 +114,7 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, pnfsmirror, CTLFLAG_RD, * non-idempotent Ops. * Define it here, since it is used by both the client and server. */ -struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS] = { +struct nfsv4_opflag nfsv4_opflag[NFSV42_NOPS] = { { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* undef */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* undef */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* undef */ @@ -168,6 +174,23 @@ struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS] = { { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Want Delegation */ { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Destroy ClientID */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* Reclaim Complete */ + { 0, 1, 1, 1, LK_EXCLUSIVE, 1, 0 }, /* Allocate */ + { 2, 1, 1, 0, LK_SHARED, 1, 0 }, /* Copy */ + { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Copy Notify */ + { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Deallocate */ + { 0, 1, 0, 0, LK_SHARED, 1, 0 }, /* IO Advise */ + { 0, 1, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* Layout Error */ + { 0, 1, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* Layout Stats */ + { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Offload Cancel */ + { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Offload Status */ + { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Read Plus */ + { 0, 1, 0, 0, LK_SHARED, 1, 0 }, /* Seek */ + { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Write Same */ + { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Clone */ + { 0, 1, 0, 0, LK_SHARED, 1, 1 }, /* Getxattr */ + { 0, 1, 1, 1, LK_EXCLUSIVE, 1, 1 }, /* Setxattr */ + { 0, 1, 0, 0, LK_SHARED, 1, 1 }, /* Listxattrs */ + { 0, 1, 1, 1, LK_EXCLUSIVE, 1, 1 }, /* Removexattr */ }; #endif /* !APPLEKEXT */ @@ -192,9 +215,10 @@ static struct nfsrv_lughash *nfsgroupnamehash; * marked 0 in this array, the code will still work, just not quite as * efficiently.) */ -static int nfs_bigreply[NFSV41_NPROCS] = { 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, +static int nfs_bigreply[NFSV42_NPROCS] = { 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 1 }; /* local functions */ static int nfsrv_skipace(struct nfsrv_descript *nd, int *acesizep); @@ -211,7 +235,7 @@ static struct { int opcnt; const u_char *tag; int taglen; -} nfsv4_opmap[NFSV41_NPROCS] = { +} nfsv4_opmap[NFSV42_NPROCS] = { { 0, 1, "Null", 4 }, { NFSV4OP_GETATTR, 1, "Getattr", 7, }, { NFSV4OP_SETATTR, 2, "Setattr", 7, }, @@ -268,15 +292,24 @@ static struct { { NFSV4OP_COMMIT, 1, "CommitDS", 8, }, { NFSV4OP_OPEN, 3, "OpenLayoutGet", 13, }, { NFSV4OP_OPEN, 8, "CreateLayGet", 12, }, + { NFSV4OP_IOADVISE, 1, "Advise", 6, }, + { NFSV4OP_ALLOCATE, 2, "Allocate", 8, }, + { NFSV4OP_SAVEFH, 5, "Copy", 4, }, + { NFSV4OP_SEEK, 2, "Seek", 4, }, + { NFSV4OP_SEEK, 1, "SeekDS", 6, }, + { NFSV4OP_GETXATTR, 2, "Getxattr", 8, }, + { NFSV4OP_SETXATTR, 2, "Setxattr", 8, }, + { NFSV4OP_REMOVEXATTR, 2, "Rmxattr", 7, }, + { NFSV4OP_LISTXATTRS, 2, "Listxattr", 9, }, }; /* * NFS RPCS that have large request message size. */ -static int nfs_bigrequest[NFSV41_NPROCS] = { +static int nfs_bigrequest[NFSV42_NPROCS] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }; /* @@ -301,13 +334,17 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, nd->nd_flag = ND_NFSV4 | ND_NFSCL; if (minorvers == NFSV41_MINORVERSION) nd->nd_flag |= ND_NFSV41; + else if (minorvers == NFSV42_MINORVERSION) + nd->nd_flag |= (ND_NFSV41 | ND_NFSV42); } else if (vers == NFS_VER3) nd->nd_flag = ND_NFSV3 | ND_NFSCL; else { if (NFSHASNFSV4(nmp)) { nd->nd_flag = ND_NFSV4 | ND_NFSCL; - if (NFSHASNFSV4N(nmp)) + if (nmp->nm_minorvers == 1) nd->nd_flag |= ND_NFSV41; + else if (nmp->nm_minorvers == 2) + nd->nd_flag |= (ND_NFSV41 | ND_NFSV42); } else if (NFSHASNFSV3(nmp)) nd->nd_flag = ND_NFSV3 | ND_NFSCL; else @@ -356,7 +393,9 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, (void) nfsm_strtom(nd, nfsv4_opmap[procnum].tag, nfsv4_opmap[procnum].taglen); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); - if ((nd->nd_flag & ND_NFSV41) != 0) + if ((nd->nd_flag & ND_NFSV42) != 0) + *tl++ = txdr_unsigned(NFSV42_MINORVERSION); + else if ((nd->nd_flag & ND_NFSV41) != 0) *tl++ = txdr_unsigned(NFSV41_MINORVERSION); else *tl++ = txdr_unsigned(NFSV4_MINORVERSION); @@ -409,7 +448,7 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, } else { (void) nfsm_fhtom(nd, nfhp, fhlen, 0); } - if (procnum < NFSV41_NPROCS) + if (procnum < NFSV42_NPROCS) NFSINCRGLOBAL(nfsstatsv1.rpccnt[procnum]); } @@ -2449,6 +2488,8 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount struct nfsfsinfo fsinf; struct timespec temptime; NFSACL_T *aclp, *naclp = NULL; + size_t atsiz; + bool xattrsupp; #ifdef QUOTA struct dqblk dqb; uid_t savuid; @@ -2523,6 +2564,18 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount } } + /* Check to see if Extended Attributes are supported. */ + xattrsupp = false; + if (NFSISSET_ATTRBIT(retbitp, NFSATTRBIT_XATTRSUPPORT)) { + if (NFSVOPLOCK(vp, LK_SHARED) == 0) { + error = VOP_GETEXTATTR(vp, EXTATTR_NAMESPACE_USER, + "xxx", NULL, &atsiz, cred, p); + NFSVOPUNLOCK(vp, 0); + if (error != EOPNOTSUPP) + xattrsupp = true; + } + } + /* * Put out the attribute bitmap for the ones being filled in * and get the field for the number of attributes returned. @@ -2972,6 +3025,14 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *tl = txdr_unsigned(NFS_SRVMAXIO); retnum += NFSX_UNSIGNED; break; + case NFSATTRBIT_XATTRSUPPORT: + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + if (xattrsupp) + *tl = newnfs_true; + else + *tl = newnfs_false; + retnum += NFSX_UNSIGNED; + break; default: printf("EEK! Bad V4 attribute bitpos=%d\n", bitpos); } @@ -4629,6 +4690,8 @@ nfsv4_setsequence(struct nfsmount *nmp, struct nfsrv_d error = nfsv4_sequencelookup(nmp, sep, &slotpos, &maxslot, &slotseq, sessionid); + nd->nd_maxreq = sep->nfsess_maxreq; + nd->nd_maxresp = sep->nfsess_maxresp; /* Build the Sequence arguments. */ NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 4 * NFSX_UNSIGNED); Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Thu Dec 12 22:59:22 2019 (r355676) +++ head/sys/fs/nfs/nfs_var.h Thu Dec 12 23:22:55 2019 (r355677) @@ -128,7 +128,8 @@ void nfsrv_setupstable(NFSPROC_T *); void nfsrv_updatestable(NFSPROC_T *); void nfsrv_writestable(u_char *, int, int, NFSPROC_T *); void nfsrv_throwawayopens(NFSPROC_T *); -int nfsrv_checkremove(vnode_t, int, NFSPROC_T *); +int nfsrv_checkremove(vnode_t, int, struct nfsrv_descript *, nfsquad_t, + NFSPROC_T *); void nfsd_recalldelegation(vnode_t, NFSPROC_T *); void nfsd_disabledelegation(vnode_t, NFSPROC_T *); int nfsrv_checksetattr(vnode_t, struct nfsrv_descript *, @@ -161,6 +162,7 @@ void nfsrv_freealllayoutsanddevids(void); void nfsrv_freefilelayouts(fhandle_t *); int nfsrv_deldsserver(int, char *, NFSPROC_T *); struct nfsdevice *nfsrv_deldsnmp(int, struct nfsmount *, NFSPROC_T *); +int nfsrv_delds(char *, NFSPROC_T *); int nfsrv_createdevids(struct nfsd_nfsd_args *, NFSPROC_T *); int nfsrv_checkdsattr(vnode_t, NFSPROC_T *); int nfsrv_copymr(vnode_t, vnode_t, vnode_t, struct nfsdevice *, @@ -268,8 +270,28 @@ int nfsrvd_layoutcommit(struct nfsrv_descript *, int, vnode_t, struct nfsexstuff *); int nfsrvd_layoutreturn(struct nfsrv_descript *, int, vnode_t, struct nfsexstuff *); +int nfsrvd_ioadvise(struct nfsrv_descript *, int, + vnode_t, struct nfsexstuff *); +int nfsrvd_layouterror(struct nfsrv_descript *, int, + vnode_t, struct nfsexstuff *); +int nfsrvd_layoutstats(struct nfsrv_descript *, int, + vnode_t, struct nfsexstuff *); int nfsrvd_teststateid(struct nfsrv_descript *, int, vnode_t, struct nfsexstuff *); +int nfsrvd_allocate(struct nfsrv_descript *, int, + vnode_t, struct nfsexstuff *); +int nfsrvd_copy_file_range(struct nfsrv_descript *, int, + vnode_t, vnode_t, struct nfsexstuff *, struct nfsexstuff *); +int nfsrvd_seek(struct nfsrv_descript *, int, + vnode_t, struct nfsexstuff *); +int nfsrvd_getxattr(struct nfsrv_descript *, int, + vnode_t, struct nfsexstuff *); +int nfsrvd_setxattr(struct nfsrv_descript *, int, + vnode_t, struct nfsexstuff *); +int nfsrvd_rmxattr(struct nfsrv_descript *, int, + vnode_t, struct nfsexstuff *); +int nfsrvd_listxattr(struct nfsrv_descript *, int, + vnode_t, struct nfsexstuff *); int nfsrvd_notsupp(struct nfsrv_descript *, int, vnode_t, struct nfsexstuff *); @@ -501,10 +523,11 @@ int nfsrpc_delegreturn(struct nfscldeleg *, struct ucr int nfsrpc_getacl(vnode_t, struct ucred *, NFSPROC_T *, NFSACL_T *, void *); int nfsrpc_setacl(vnode_t, struct ucred *, NFSPROC_T *, NFSACL_T *, void *); int nfsrpc_exchangeid(struct nfsmount *, struct nfsclclient *, - struct nfssockreq *, uint32_t, struct nfsclds **, struct ucred *, + struct nfssockreq *, int, uint32_t, struct nfsclds **, struct ucred *, NFSPROC_T *); int nfsrpc_createsession(struct nfsmount *, struct nfsclsession *, - struct nfssockreq *, uint32_t, int, struct ucred *, NFSPROC_T *); + struct nfssockreq *, struct nfsclds *, uint32_t, int, struct ucred *, + NFSPROC_T *); int nfsrpc_destroysession(struct nfsmount *, struct nfsclclient *, struct ucred *, NFSPROC_T *); int nfsrpc_destroyclient(struct nfsmount *, struct nfsclclient *, @@ -518,11 +541,27 @@ int nfsrpc_layoutreturn(struct nfsmount *, uint8_t *, int, uint64_t, uint64_t, nfsv4stateid_t *, struct ucred *, NFSPROC_T *, uint32_t, uint32_t, char *); int nfsrpc_reclaimcomplete(struct nfsmount *, struct ucred *, NFSPROC_T *); +int nfsrpc_advise(vnode_t, off_t, uint64_t, int, struct ucred *, NFSPROC_T *); int nfscl_doiods(vnode_t, struct uio *, int *, int *, uint32_t, int, struct ucred *, NFSPROC_T *); int nfscl_findlayoutforio(struct nfscllayout *, uint64_t, uint32_t, struct nfsclflayout **); void nfscl_freenfsclds(struct nfsclds *); +int nfsrpc_allocate(vnode_t, off_t, off_t, struct nfsvattr *, int *, + struct ucred *, NFSPROC_T *, void *); +int nfsrpc_copy_file_range(vnode_t, off_t *, vnode_t, off_t *, size_t *, + unsigned int, int *, struct nfsvattr *, int *, struct nfsvattr *, + struct ucred *, bool, bool *); +int nfsrpc_seek(vnode_t, off_t *, bool *, int, struct ucred *, + struct nfsvattr *, int *); +int nfsrpc_getextattr(vnode_t, const char *, struct uio *, ssize_t *, + struct nfsvattr *, int *, struct ucred *, NFSPROC_T *); +int nfsrpc_setextattr(vnode_t, const char *, struct uio *, struct nfsvattr *, + int *, struct ucred *, NFSPROC_T *); +int nfsrpc_listextattr(vnode_t, uint64_t *, struct uio *, size_t *, bool *, + struct nfsvattr *, int *, struct ucred *, NFSPROC_T *); +int nfsrpc_rmextattr(vnode_t, const char *, struct nfsvattr *, int *, + struct ucred *, NFSPROC_T *); /* nfs_clstate.c */ int nfscl_open(vnode_t, u_int8_t *, int, u_int32_t, int, @@ -644,8 +683,8 @@ int nfsvno_readlink(vnode_t, struct ucred *, NFSPROC_T mbuf_t *, int *); int nfsvno_read(vnode_t, off_t, int, struct ucred *, NFSPROC_T *, mbuf_t *, mbuf_t *); -int nfsvno_write(vnode_t, off_t, int, int, int *, mbuf_t, - char *, struct ucred *, NFSPROC_T *); +int nfsvno_write(vnode_t, off_t, int, int *, mbuf_t, char *, struct ucred *, + NFSPROC_T *); int nfsvno_createsub(struct nfsrv_descript *, struct nameidata *, vnode_t *, struct nfsvattr *, int *, int32_t *, NFSDEV_T, struct nfsexstuff *); @@ -704,6 +743,17 @@ int nfsrv_dscreate(struct vnode *, struct vattr *, str int nfsrv_updatemdsattr(struct vnode *, struct nfsvattr *, NFSPROC_T *); void nfsrv_killrpcs(struct nfsmount *); int nfsrv_setacl(struct vnode *, NFSACL_T *, struct ucred *, NFSPROC_T *); +int nfsvno_seek(struct nfsrv_descript *, struct vnode *, u_long, off_t *, int, + bool *, struct ucred *, NFSPROC_T *); +int nfsvno_allocate(struct vnode *, off_t, off_t, struct ucred *, NFSPROC_T *); +int nfsvno_getxattr(struct vnode *, char *, uint32_t, struct ucred *, + struct thread *, struct mbuf **, struct mbuf **, int *); +int nfsvno_setxattr(struct vnode *, char *, int, struct mbuf *, char *, + struct ucred *, struct thread *); +int nfsvno_rmxattr(struct nfsrv_descript *, struct vnode *, char *, + struct ucred *, struct thread *); +int nfsvno_listxattr(struct vnode *, uint64_t, struct ucred *, struct thread *, + u_char **, uint32_t *, bool *); /* nfs_commonkrpc.c */ int newnfs_nmcancelreqs(struct nfsmount *); Modified: head/sys/fs/nfs/nfsclstate.h ============================================================================== --- head/sys/fs/nfs/nfsclstate.h Thu Dec 12 22:59:22 2019 (r355676) +++ head/sys/fs/nfs/nfsclstate.h Thu Dec 12 23:22:55 2019 (r355677) @@ -64,6 +64,8 @@ struct nfsclsession { uint64_t nfsess_slots; uint32_t nfsess_sequenceid; uint32_t nfsess_maxcache; /* Max size for cached reply. */ + uint32_t nfsess_maxreq; /* Max request size. */ + uint32_t nfsess_maxresp; /* Max reply size. */ uint16_t nfsess_foreslots; uint16_t nfsess_backslots; uint8_t nfsess_sessionid[NFSX_V4SESSIONID]; @@ -72,7 +74,7 @@ struct nfsclsession { /* * This structure holds the session, clientid and related information - * needed for an NFSv4.1 Meta Data Server (MDS) or Data Server (DS). + * needed for an NFSv4.1 or NFSv4.2 Meta Data Server (MDS) or Data Server (DS). * It is malloc'd to the correct length. */ struct nfsclds { @@ -95,6 +97,7 @@ struct nfsclds { #define NFSCLDS_DS 0x0004 #define NFSCLDS_CLOSED 0x0008 #define NFSCLDS_SAMECONN 0x0010 +#define NFSCLDS_MINORV2 0x0020 struct nfsclclient { LIST_ENTRY(nfsclclient) nfsc_list; Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Thu Dec 12 22:59:22 2019 (r355676) +++ head/sys/fs/nfs/nfsport.h Thu Dec 12 23:22:55 2019 (r355677) @@ -289,7 +289,7 @@ /* * Must be one more than the last NFSv4.2 op#. */ -#define NFSV42_NOPS 72 +#define NFSV42_NOPS 76 /* Quirky case if the illegal op code */ #define NFSV4OP_OPILLEGAL 10044 @@ -423,10 +423,10 @@ #endif /* NFS_V3NPROCS */ /* - * New stats structure. + * Newest stats structure. * The vers field will be set to NFSSTATS_V1 by the caller. */ -#define NFSSTATS_V1 1 +#define NFSSTATS_V1 2 struct nfsstatsv1 { int vers; /* Set to version requested by caller. */ uint64_t attrcache_hits; @@ -447,9 +447,9 @@ struct nfsstatsv1 { uint64_t readlink_bios; uint64_t biocache_readdirs; uint64_t readdir_bios; - uint64_t rpccnt[NFSV41_NPROCS + 13]; + uint64_t rpccnt[NFSV42_NPROCS + 15]; uint64_t rpcretries; - uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS]; + uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; uint64_t srvrpc_errs; uint64_t srv_errs; uint64_t rpcrequests; @@ -468,6 +468,71 @@ struct nfsstatsv1 { uint64_t srvlockowners; uint64_t srvlocks; uint64_t srvdelegates; + uint64_t cbrpccnt[NFSV42_CBNOPS + 10]; + uint64_t clopenowners; + uint64_t clopens; + uint64_t cllockowners; + uint64_t cllocks; + uint64_t cldelegates; + uint64_t cllocalopenowners; + uint64_t cllocalopens; + uint64_t cllocallockowners; + uint64_t cllocallocks; + uint64_t srvstartcnt; + uint64_t srvdonecnt; + uint64_t srvbytes[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; + uint64_t srvops[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; + struct bintime srvduration[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; + struct bintime busyfrom; + struct bintime busytime; +}; + +/* + * Newer stats structure. + * The vers field will be set to NFSSTATS_OV1 by the caller. + */ +#define NFSSTATS_OV1 1 +struct nfsstatsov1 { + int vers; /* Set to version requested by caller. */ + uint64_t attrcache_hits; + uint64_t attrcache_misses; + uint64_t lookupcache_hits; + uint64_t lookupcache_misses; + uint64_t direofcache_hits; + uint64_t direofcache_misses; + uint64_t accesscache_hits; + uint64_t accesscache_misses; + uint64_t biocache_reads; + uint64_t read_bios; + uint64_t read_physios; + uint64_t biocache_writes; + uint64_t write_bios; + uint64_t write_physios; + uint64_t biocache_readlinks; + uint64_t readlink_bios; + uint64_t biocache_readdirs; + uint64_t readdir_bios; + uint64_t rpccnt[NFSV42_NPROCS + 4]; + uint64_t rpcretries; + uint64_t srvrpccnt[NFSV42_PURENOPS + NFSV4OP_FAKENOPS]; + uint64_t srvrpc_errs; + uint64_t srv_errs; + uint64_t rpcrequests; + uint64_t rpctimeouts; + uint64_t rpcunexpected; + uint64_t rpcinvalid; + uint64_t srvcache_inproghits; + uint64_t srvcache_idemdonehits; + uint64_t srvcache_nonidemdonehits; + uint64_t srvcache_misses; + uint64_t srvcache_tcppeak; + int srvcache_size; /* Updated by atomic_xx_int(). */ + uint64_t srvclients; + uint64_t srvopenowners; + uint64_t srvopens; + uint64_t srvlockowners; + uint64_t srvlocks; + uint64_t srvdelegates; uint64_t cbrpccnt[NFSV42_CBNOPS]; uint64_t clopenowners; uint64_t clopens; @@ -480,9 +545,9 @@ struct nfsstatsv1 { uint64_t cllocallocks; uint64_t srvstartcnt; uint64_t srvdonecnt; - uint64_t srvbytes[NFSV42_NOPS + NFSV4OP_FAKENOPS]; - uint64_t srvops[NFSV42_NOPS + NFSV4OP_FAKENOPS]; - struct bintime srvduration[NFSV42_NOPS + NFSV4OP_FAKENOPS]; + uint64_t srvbytes[NFSV42_PURENOPS + NFSV4OP_FAKENOPS]; + uint64_t srvops[NFSV42_PURENOPS + NFSV4OP_FAKENOPS]; + struct bintime srvduration[NFSV42_PURENOPS + NFSV4OP_FAKENOPS]; struct bintime busyfrom; struct bintime busytime; }; Modified: head/sys/fs/nfs/nfsproto.h ============================================================================== --- head/sys/fs/nfs/nfsproto.h Thu Dec 12 22:59:22 2019 (r355676) +++ head/sys/fs/nfs/nfsproto.h Thu Dec 12 23:22:55 2019 (r355677) @@ -1070,7 +1070,7 @@ struct nfsv3_sattr { /* Not sure what attribute bit#81/0x00020000 is? */ #define NFSATTRBM_XATTRSUPPORT 0x00040000 -#define NFSATTRBIT_MAX 77 +#define NFSATTRBIT_MAX 83 /* * Sets of attributes that are supported, by words in the bitmap. Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Thu Dec 12 22:59:22 2019 (r355676) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Thu Dec 12 23:22:55 2019 (r355677) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include +#include +#include #include #include @@ -72,6 +74,8 @@ extern int nfsrv_useacl; extern char nfsv4_callbackaddr[INET6_ADDRSTRLEN]; extern int nfscl_debuglevel; extern int nfs_pnfsiothreads; +extern u_long sb_max_adj; +extern int nfs_maxcopyrange; NFSCLSTATEMUTEX; int nfstest_outofseq = 0; int nfscl_assumeposixlocks = 1; @@ -110,6 +114,9 @@ struct nfsclwritedsdorpc { struct nfsclds *dsp; uint64_t off; int len; +#ifdef notyet + int advise; +#endif struct nfsfh *fhp; struct mbuf *m; int vers; @@ -142,7 +149,8 @@ static int nfsrpc_getlayout(struct nfsmount *, vnode_t uint32_t *, nfsv4stateid_t *, uint64_t, struct nfscllayout **, struct ucred *, NFSPROC_T *); static int nfsrpc_fillsa(struct nfsmount *, struct sockaddr_in *, - struct sockaddr_in6 *, sa_family_t, int, struct nfsclds **, NFSPROC_T *); + struct sockaddr_in6 *, sa_family_t, int, int, struct nfsclds **, + NFSPROC_T *); static void nfscl_initsessionslots(struct nfsclsession *); static int nfscl_doflayoutio(vnode_t, struct uio *, int *, int *, int *, nfsv4stateid_t *, int, struct nfscldevinfo *, struct nfscllayout *, @@ -172,12 +180,21 @@ static int nfsio_commitds(vnode_t, uint64_t, int, stru NFSPROC_T *); static int nfsrpc_commitds(vnode_t, uint64_t, int, struct nfsclds *, struct nfsfh *, int, int, struct ucred *, NFSPROC_T *); +#ifdef notyet +static int nfsio_adviseds(vnode_t, uint64_t, int, int, struct nfsclds *, + struct nfsfh *, int, int, struct nfsclwritedsdorpc *, struct ucred *, + NFSPROC_T *); +static int nfsrpc_adviseds(vnode_t, uint64_t, int, int, struct nfsclds *, + struct nfsfh *, int, int, struct ucred *, NFSPROC_T *); +#endif +static int nfsrpc_allocaterpc(vnode_t, off_t, off_t, nfsv4stateid_t *, + struct nfsvattr *, int *, struct ucred *, NFSPROC_T *, void *); static void nfsrv_setuplayoutget(struct nfsrv_descript *, int, uint64_t, uint64_t, uint64_t, nfsv4stateid_t *, int, int, int); static int nfsrv_parseug(struct nfsrv_descript *, int, uid_t *, gid_t *, NFSPROC_T *); -static int nfsrv_parselayoutget(struct nfsrv_descript *, nfsv4stateid_t *, - int *, struct nfsclflayouthead *); +static int nfsrv_parselayoutget(struct nfsmount *, struct nfsrv_descript *, + nfsv4stateid_t *, int *, struct nfsclflayouthead *); static int nfsrpc_getopenlayout(struct nfsmount *, vnode_t, u_int8_t *, int, uint8_t *, int, uint32_t, struct nfsclopen *, uint8_t *, int, struct nfscldeleg **, struct ucred *, NFSPROC_T *); @@ -200,6 +217,11 @@ static int nfsrpc_layoutget(struct nfsmount *, uint8_t static int nfsrpc_layoutgetres(struct nfsmount *, vnode_t, uint8_t *, int, nfsv4stateid_t *, int, uint32_t *, struct nfscllayout **, struct nfsclflayouthead *, int, int, int *, struct ucred *, NFSPROC_T *); +static int nfsrpc_copyrpc(vnode_t, off_t, vnode_t, off_t, size_t *, + nfsv4stateid_t *, nfsv4stateid_t *, struct nfsvattr *, int *, + struct nfsvattr *, int *, bool, int *, struct ucred *, NFSPROC_T *); +static int nfsrpc_seekrpc(vnode_t, off_t *, nfsv4stateid_t *, bool *, + int, struct nfsvattr *, int *, struct ucred *); int nfs_pnfsio(task_fn_t *, void *); @@ -935,12 +957,12 @@ nfsrpc_setclient(struct nfsmount *nmp, struct nfsclcli * previous session has failed, so... * do an ExchangeID followed by the CreateSession. */ - error = nfsrpc_exchangeid(nmp, clp, &nmp->nm_sockreq, + error = nfsrpc_exchangeid(nmp, clp, &nmp->nm_sockreq, 0, NFSV4EXCH_USEPNFSMDS | NFSV4EXCH_USENONPNFS, &dsp, cred, p); NFSCL_DEBUG(1, "aft exch=%d\n", error); if (error == 0) error = nfsrpc_createsession(nmp, &dsp->nfsclds_sess, - &nmp->nm_sockreq, + &nmp->nm_sockreq, NULL, dsp->nfsclds_sess.nfsess_sequenceid, 1, cred, p); if (error == 0) { NFSLOCKMNT(nmp); @@ -4647,8 +4669,8 @@ nfsrpc_setaclrpc(vnode_t vp, struct ucred *cred, NFSPR */ int nfsrpc_exchangeid(struct nfsmount *nmp, struct nfsclclient *clp, - struct nfssockreq *nrp, uint32_t exchflags, struct nfsclds **dspp, - struct ucred *cred, NFSPROC_T *p) + struct nfssockreq *nrp, int minorvers, uint32_t exchflags, + struct nfsclds **dspp, struct ucred *cred, NFSPROC_T *p) { uint32_t *tl, v41flags; struct nfsrv_descript nfsd; @@ -4658,7 +4680,10 @@ nfsrpc_exchangeid(struct nfsmount *nmp, struct nfsclcl int error, len; *dspp = NULL; - nfscl_reqstart(nd, NFSPROC_EXCHANGEID, nmp, NULL, 0, NULL, NULL, 0, 0); + if (minorvers == 0) + minorvers = nmp->nm_minorvers; + nfscl_reqstart(nd, NFSPROC_EXCHANGEID, nmp, NULL, 0, NULL, NULL, + NFS_VER4, minorvers); NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(nfsboottime.tv_sec); /* Client owner */ *tl = txdr_unsigned(clp->nfsc_rev); @@ -4709,6 +4734,8 @@ nfsrpc_exchangeid(struct nfsmount *nmp, struct nfsclcl } if ((v41flags & NFSV4EXCH_USEPNFSDS) != 0) dsp->nfsclds_flags |= NFSCLDS_DS; + if (minorvers == NFSV42_MINORVERSION) + dsp->nfsclds_flags |= NFSCLDS_MINORV2; if (len > 0) nd->nd_repstat = nfsrv_mtostr(nd, dsp->nfsclds_serverown, len); @@ -4732,21 +4759,27 @@ nfsmout: */ int nfsrpc_createsession(struct nfsmount *nmp, struct nfsclsession *sep, - struct nfssockreq *nrp, uint32_t sequenceid, int mds, struct ucred *cred, - NFSPROC_T *p) + struct nfssockreq *nrp, struct nfsclds *dsp, uint32_t sequenceid, int mds, + struct ucred *cred, NFSPROC_T *p) { uint32_t crflags, maxval, *tl; struct nfsrv_descript nfsd; struct nfsrv_descript *nd = &nfsd; - int error, irdcnt; + int error, irdcnt, minorvers; /* Make sure nm_rsize, nm_wsize is set. */ if (nmp->nm_rsize > NFS_MAXBSIZE || nmp->nm_rsize == 0) nmp->nm_rsize = NFS_MAXBSIZE; if (nmp->nm_wsize > NFS_MAXBSIZE || nmp->nm_wsize == 0) nmp->nm_wsize = NFS_MAXBSIZE; - nfscl_reqstart(nd, NFSPROC_CREATESESSION, nmp, NULL, 0, NULL, NULL, 0, - 0); + if (dsp == NULL) + minorvers = nmp->nm_minorvers; + else if ((dsp->nfsclds_flags & NFSCLDS_MINORV2) != 0) + minorvers = NFSV42_MINORVERSION; + else + minorvers = NFSV41_MINORVERSION; + nfscl_reqstart(nd, NFSPROC_CREATESESSION, nmp, NULL, 0, NULL, NULL, + NFS_VER4, minorvers); NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); *tl++ = sep->nfsess_clientid.lval[0]; *tl++ = sep->nfsess_clientid.lval[1]; @@ -4759,8 +4792,18 @@ nfsrpc_createsession(struct nfsmount *nmp, struct nfsc /* Fill in fore channel attributes. */ NFSM_BUILD(tl, uint32_t *, 7 * NFSX_UNSIGNED); *tl++ = 0; /* Header pad size */ - *tl++ = txdr_unsigned(nmp->nm_wsize + NFS_MAXXDR);/* Max request size */ - *tl++ = txdr_unsigned(nmp->nm_rsize + NFS_MAXXDR);/* Max reply size */ + if ((nd->nd_flag & ND_NFSV42) != 0 && mds != 0 && sb_max_adj >= + nmp->nm_wsize && sb_max_adj >= nmp->nm_rsize) { + /* + * NFSv4.2 Extended Attribute operations may want to do + * requests/replies that are larger than nm_rsize/nm_wsize. + */ + *tl++ = txdr_unsigned(sb_max_adj - NFS_MAXXDR); + *tl++ = txdr_unsigned(sb_max_adj - NFS_MAXXDR); + } else { + *tl++ = txdr_unsigned(nmp->nm_wsize + NFS_MAXXDR); + *tl++ = txdr_unsigned(nmp->nm_rsize + NFS_MAXXDR); + } *tl++ = txdr_unsigned(4096); /* Max response size cached */ *tl++ = txdr_unsigned(20); /* Max operations */ *tl++ = txdr_unsigned(64); /* Max slots */ @@ -4817,6 +4860,7 @@ nfsrpc_createsession(struct nfsmount *nmp, struct nfsc else break; } + sep->nfsess_maxreq = maxval; /* Make sure nm_rsize is small enough. */ maxval = fxdr_unsigned(uint32_t, *tl++); @@ -4826,6 +4870,7 @@ nfsrpc_createsession(struct nfsmount *nmp, struct nfsc else break; } + sep->nfsess_maxresp = maxval; sep->nfsess_maxcache = fxdr_unsigned(int, *tl++); tl++; @@ -4928,7 +4973,8 @@ nfsrpc_layoutget(struct nfsmount *nmp, uint8_t *fhp, i if (error != 0) return (error); if (nd->nd_repstat == 0) - error = nfsrv_parselayoutget(nd, stateidp, retonclosep, flhp); + error = nfsrv_parselayoutget(nmp, nd, stateidp, retonclosep, + flhp); if (error == 0 && nd->nd_repstat != 0) error = nd->nd_repstat; mbuf_freem(nd->nd_mrep); @@ -4950,7 +4996,8 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de struct sockaddr_in6 sin6, ssin6; struct nfsclds *dsp = NULL, **dspp, **gotdspp; struct nfscldevinfo *ndi; - int addrcnt = 0, bitcnt, error, gotvers, i, isudp, j, stripecnt; + int addrcnt = 0, bitcnt, error, gotminor, gotvers, i, isudp, j; + int stripecnt; uint8_t stripeindex; sa_family_t af, safilled; @@ -5082,7 +5129,8 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de } } - gotvers = NFS_VER4; /* Always NFSv4 for File Layout. */ + gotvers = NFS_VER4; /* Default NFSv4.1 for File Layout. */ + gotminor = NFSV41_MINORVERSION; /* For Flex File, we will take one of the versions to use. */ if (layouttype == NFSLAYOUT_FLEXFILE) { NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); @@ -5093,14 +5141,19 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de goto nfsmout; } gotvers = 0; + gotminor = 0; for (i = 0; i < j; i++) { NFSM_DISSECT(tl, uint32_t *, 5 * NFSX_UNSIGNED); vers = fxdr_unsigned(uint32_t, *tl++); minorvers = fxdr_unsigned(uint32_t, *tl++); - if ((vers == NFS_VER4 && minorvers == - NFSV41_MINORVERSION) || (vers == NFS_VER3 && - gotvers == 0)) { + if (vers == NFS_VER3) + minorvers = 0; + if ((vers == NFS_VER4 && ((minorvers == + NFSV41_MINORVERSION && gotminor == 0) || + minorvers == NFSV42_MINORVERSION)) || + (vers == NFS_VER3 && gotvers == 0)) { gotvers = vers; + gotminor = minorvers; /* We'll take this one. */ ndi->nfsdi_versindex = i; ndi->nfsdi_vers = vers; @@ -5118,7 +5171,7 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de } } if (gotvers == 0) { - printf("pNFS: no NFSv3 or NFSv4.1\n"); + printf("pNFS: no NFSv3, NFSv4.1 or NFSv4.2\n"); error = NFSERR_BADXDR; goto nfsmout; } @@ -5144,7 +5197,7 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de * NFS version and IP address. */ error = nfsrpc_fillsa(nmp, &ssin, &ssin6, safilled, - gotvers, &dsp, p); + gotvers, gotminor, &dsp, p); } if (error == 0) { KASSERT(gotdspp != NULL, ("gotdspp is NULL")); @@ -5373,15 +5426,15 @@ nfsrpc_getlayout(struct nfsmount *nmp, vnode_t vp, str */ static int nfsrpc_fillsa(struct nfsmount *nmp, struct sockaddr_in *sin, - struct sockaddr_in6 *sin6, sa_family_t af, int vers, struct nfsclds **dspp, - NFSPROC_T *p) + struct sockaddr_in6 *sin6, sa_family_t af, int vers, int minorvers, + struct nfsclds **dspp, NFSPROC_T *p) { struct sockaddr_in *msad, *sad; struct sockaddr_in6 *msad6, *sad6; struct nfsclclient *clp; struct nfssockreq *nrp; struct nfsclds *dsp, *tdsp; - int error; + int error, firsttry; enum nfsclds_state retv; uint32_t sequenceid; @@ -5492,9 +5545,16 @@ nfsrpc_fillsa(struct nfsmount *nmp, struct sockaddr_in /* Now, do the exchangeid and create session. */ if (error == 0) { if (vers == NFS_VER4) { - error = nfsrpc_exchangeid(nmp, clp, nrp, - NFSV4EXCH_USEPNFSDS, &dsp, nrp->nr_cred, p); - NFSCL_DEBUG(3, "DS exchangeid=%d\n", error); + firsttry = 0; + do { + error = nfsrpc_exchangeid(nmp, clp, nrp, + minorvers, NFSV4EXCH_USEPNFSDS, &dsp, + nrp->nr_cred, p); + NFSCL_DEBUG(3, "DS exchangeid=%d\n", error); + if (error == NFSERR_MINORVERMISMATCH) + minorvers = NFSV42_MINORVERSION; + } while (error == NFSERR_MINORVERMISMATCH && + firsttry++ == 0); if (error != 0) newnfs_disconnect(nrp); } else { @@ -5534,7 +5594,7 @@ nfsrpc_fillsa(struct nfsmount *nmp, struct sockaddr_in dsp->nfsclds_sess.nfsess_sequenceid; NFSUNLOCKMNT(nmp); error = nfsrpc_createsession(nmp, &dsp->nfsclds_sess, - nrp, sequenceid, 0, nrp->nr_cred, p); + nrp, dsp, sequenceid, 0, nrp->nr_cred, p); NFSCL_DEBUG(3, "DS createsess=%d\n", error); } } else { @@ -5896,7 +5956,7 @@ nfscl_findlayoutforio(struct nfscllayout *lyp, uint64_ } /* - * Do I/O using an NFSv4.1 file layout. + * Do I/O using an NFSv4.1 or NFSv4.2 file layout. */ static int nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, @@ -5905,7 +5965,7 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i uint64_t len, int docommit, struct ucred *cred, NFSPROC_T *p) { uint64_t io_off, rel_off, stripe_unit_size, transfer, xfer; - int commit_thru_mds, error, stripe_index, stripe_pos; + int commit_thru_mds, error, stripe_index, stripe_pos, minorvers; struct nfsnode *np; struct nfsfh *fhp; struct nfsclds **dspp; @@ -5922,6 +5982,10 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i while (len > 0 && error == 0) { stripe_index = nfsfldi_stripeindex(dp, stripe_pos); dspp = nfsfldi_addr(dp, stripe_index); + if (((*dspp)->nfsclds_flags & NFSCLDS_MINORV2) != 0) + minorvers = NFSV42_MINORVERSION; + else + minorvers = NFSV41_MINORVERSION; if (len > transfer && docommit == 0) xfer = transfer; else @@ -5959,7 +6023,7 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i if (docommit != 0) { if (error == 0) error = nfsrpc_commitds(vp, io_off, xfer, - *dspp, fhp, 0, 0, cred, p); + *dspp, fhp, NFS_VER4, minorvers, cred, p); if (error == 0) { /* * Set both eof and uio_resid = 0 to end any @@ -5974,11 +6038,11 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i } } else if (rwflag == NFSV4OPEN_ACCESSREAD) error = nfsrpc_readds(vp, uiop, stateidp, eofp, *dspp, - io_off, xfer, fhp, 0, 0, 0, cred, p); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 12 23:33:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C3C81DD499; Thu, 12 Dec 2019 23:33:33 +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 47Yqqd1HyQz4Fmp; Thu, 12 Dec 2019 23:33:33 +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 2728136AC; Thu, 12 Dec 2019 23:33:33 +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 xBCNXXcr052638; Thu, 12 Dec 2019 23:33:33 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCNXXrq052637; Thu, 12 Dec 2019 23:33:33 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912122333.xBCNXXrq052637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 12 Dec 2019 23:33:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355678 - head X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 355678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 23:33:33 -0000 Author: rmacklem Date: Thu Dec 12 23:33:32 2019 New Revision: 355678 URL: https://svnweb.freebsd.org/changeset/base/355678 Log: Add an entry to UPDATING for r355677. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Dec 12 23:22:55 2019 (r355677) +++ head/UPDATING Thu Dec 12 23:33:32 2019 (r355678) @@ -26,6 +26,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20191212: + r355677 has modified the internal interface used between the + NFS modules in the kernel. As such, they must all be upgraded + simultaneously. I will do a version bump for this. + 20191205: The root certificates of the Mozilla CA Certificate Store have been imported into the base system and can be managed with the certctl(8) From owner-svn-src-all@freebsd.org Thu Dec 12 23:37:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F91D1DD536; Thu, 12 Dec 2019 23:37:05 +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 47Yqvj1cLkz4FwJ; Thu, 12 Dec 2019 23:37:05 +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 2E3F536B5; Thu, 12 Dec 2019 23:37:05 +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 xBCNb52W052835; Thu, 12 Dec 2019 23:37:05 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCNb5LJ052834; Thu, 12 Dec 2019 23:37:05 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912122337.xBCNb5LJ052834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 12 Dec 2019 23:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355679 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 355679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 23:37:05 -0000 Author: rmacklem Date: Thu Dec 12 23:37:04 2019 New Revision: 355679 URL: https://svnweb.freebsd.org/changeset/base/355679 Log: Bump __FreeBSD_version since r355677 changes the internal interface between the NFS modules such that they all need to be upgraded to post r355677 simultaneously. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Dec 12 23:33:32 2019 (r355678) +++ head/sys/sys/param.h Thu Dec 12 23:37:04 2019 (r355679) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300065 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300066 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Thu Dec 12 23:46:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9362B1DD785; Thu, 12 Dec 2019 23:46:05 +0000 (UTC) (envelope-from bdrewery@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 47Yr653Nzdz4GPx; Thu, 12 Dec 2019 23:46:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 1DF7716959; Thu, 12 Dec 2019 23:46:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id D2C932AC98; Thu, 12 Dec 2019 23:46:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id JsVs4bjJkEOe; Thu, 12 Dec 2019 23:45:59 +0000 (UTC) Subject: Re: svn commit: r355609 - head DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 127A02AC91 To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912111454.xBBEsT42073427@repo.freebsd.org> From: Bryan Drewery Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAG0JEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBPkXPLLDqup6XIofCTXXcbtuRpfPBQJb5hLu BQkNPvODAAoJEDXXcbtuRpfP9rMH/3f7cfX5rzyEV5QNfV/wS4jFukLoPZ4+nCM/TKxH3pEX 2bLbeQbkk6La8cueQ5Lpoht5XFZ18Y5TbMittngltrlNzoDD0h9are24OkDFGim3afJU7tkj IGQa1if+re+vI5BhzYwRhj0oKXzBi39M5oePd3L1dXfx83rg2FPyZBdIejsz6fR74T3JVkbd 6k2l5/3Zk2uiNMy+eBfDRgYE1E6CP28kV0nCeGKZgSVso0kGUUHud7voKqGVpMvbd0mE4pp4 PE5YJaFPjrll9miaDAvdU8LGIq5n6+aXPLKoQ/QNl6mg6ifgI6FfKILOkTizLW8E5PBSNnCm NapQ55yjm125AQ0EUmmGawEIAKJUU9+Q19oW1RK5jTf3m56j+szIc8Y9DaLC8REUKl4UZJBK BqCl6c0cukVApOD92XoU6hJPm2rLEyp/IcYcPPNTnVu8D8h9oag2L8EiFN7+2hk0xG+lwjc8 uOIZycme7AIJsBU4AZ1v63lxm2k104hwpiatgbe71GIGl7p1MX6ousP/wGzXCOF25Dx9w02C eRe7zEMfhnFjSUhzdCC9han2+KaVB7qIqNR3b8NfbwRNlwPmHqlhXffUow9OsQjSnTK8WKNR lx7xzVccXIvWP2wECFrmqmzMmXpSrmIuiWEpFwZ9x2a0Pva8dCNRiCVTK51IlRXKjaAxiN1u IUrMm6UAEQEAAYkBPAQYAQoAJgIbDBYhBPkXPLLDqup6XIofCTXXcbtuRpfPBQJb5hL4BQkN PvONAAoJEDXXcbtuRpfPCjcH/ivBsOpdpebpgLizSNU5/X4yWN5Aixsc9VBnQhGKAKnMINJQ VMpA55sD2JSPwloXYM/B3qyPJRS/9cwIuX5LDNKKOZU3Qp+TzleynM15/xea14orWYRGRict YHBM3Cnqp7OD8K6Q1uhs0fTxyJP7PZ/G0+7Corlf1DlHhDt6C2HldRPFvAvAgl6sR9Wzgcb7 rzub2HVtbJgl6YHbgyAG7x9NpXFqzx1JLAMdpt2DIYwoi+oMdRQlBIwNuKjQjCGzuXHandd3 kGvBAsyJpQ+coEep9UzwANaV28cXrFr2R4FSOcR50rBA2Nh/vqUYfpsvBvJlwuKAoV1djVHa ihNeL5E= Organization: FreeBSD Message-ID: <121c13a3-c855-049e-9137-e893d66759b1@FreeBSD.org> Date: Thu, 12 Dec 2019 15:45:51 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <201912111454.xBBEsT42073427@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SflHKJ1Ws9mAMVrUW3WG80ese46dADtiJ" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 23:46:05 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SflHKJ1Ws9mAMVrUW3WG80ese46dADtiJ Content-Type: multipart/mixed; boundary="PxYM46VrNrNjcK1qFAtg7y4Dimf9FwlnZ"; protected-headers="v1" From: Bryan Drewery To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <121c13a3-c855-049e-9137-e893d66759b1@FreeBSD.org> Subject: Re: svn commit: r355609 - head References: <201912111454.xBBEsT42073427@repo.freebsd.org> In-Reply-To: <201912111454.xBBEsT42073427@repo.freebsd.org> --PxYM46VrNrNjcK1qFAtg7y4Dimf9FwlnZ Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 12/11/2019 6:54 AM, Ed Maste wrote: > Author: emaste > Date: Wed Dec 11 14:54:29 2019 > New Revision: 355609 > URL: https://svnweb.freebsd.org/changeset/base/355609 >=20 > Log: > Make NOCLEAN an error instead of a warning > =20 > The warning was added in r289728 (over four years ago) and at that ti= me > NO_CLEAN was already the correct spelling for over a decade. > =20 > Make NOCLEAN an error as the next step to removing these backward > compatibility shims. >=20 > Modified: > head/Makefile.inc1 >=20 > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/Makefile.inc1 Wed Dec 11 14:28:13 2019 (r355608) > +++ head/Makefile.inc1 Wed Dec 11 14:54:29 2019 (r355609) > @@ -458,8 +458,7 @@ SUBDIR+=3Detc > .endif # !empty(SUBDIR_OVERRIDE) > =20 > .if defined(NOCLEAN) > -.warning NOCLEAN option is deprecated. Use NO_CLEAN instead. > -NO_CLEAN=3D ${NOCLEAN} > +.error NOCLEAN option is deprecated. Use NO_CLEAN instead. > .endif > .if defined(NO_CLEANDIR) > CLEANDIR=3D clean cleandepend >=20 What ever happened to POLA? Name 1 good reason this should be an .error?! Or even a .warning for that matter. The argument I keep hearing is "we have to maintain these 3 lines of code", ok, well now it's just an annoyance to maintain with no benefit to the user. --=20 Regards, Bryan Drewery --PxYM46VrNrNjcK1qFAtg7y4Dimf9FwlnZ-- --SflHKJ1Ws9mAMVrUW3WG80ese46dADtiJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE+Rc8ssOq6npcih8JNddxu25Gl88FAl3y0TVfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEY5 MTczQ0IyQzNBQUVBN0E1QzhBMUYwOTM1RDc3MUJCNkU0Njk3Q0YACgkQNddxu25G l88q6Qf9HMa21ajY72nqMe2wsDIaUQlU1PoBd28LWBR8azV0au8Dohyj1iIvYZBi p2SmRoohDCAXdwgsmBhnIj9Y7HtBZo5l34VWyB/SFiFXd+9QOBMf8VinX7heb3tB QFskygRM9gb/U12pQDEKqHzFEgotxHwuBnWhQJ4HElY0+FU1LUlfI8fErK0ekz7I yZCw12R4KpmFpOX0f6oDts20gWkbHohjeGi2jlsiKrf6dsbm8WX1IIVeyA9rPtIM P5LWpb7MHPpVYHDMZo1KdVrUHVfktVhHIQTbh7Jnkb1Ob3lKnVtCk0kKo9y79RMr hdnDLjIqy4SPIwTQwZ0JiAcBHQG34Q== =CGV/ -----END PGP SIGNATURE----- --SflHKJ1Ws9mAMVrUW3WG80ese46dADtiJ-- From owner-svn-src-all@freebsd.org Thu Dec 12 23:55:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF69C1DD984; Thu, 12 Dec 2019 23:55:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47YrK25v7Gz4Gsf; Thu, 12 Dec 2019 23:55:34 +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 C59383AC8; Thu, 12 Dec 2019 23:55:34 +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 xBCNtY1Z064467; Thu, 12 Dec 2019 23:55:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCNtY1n064466; Thu, 12 Dec 2019 23:55:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912122355.xBCNtY1n064466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 12 Dec 2019 23:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355680 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 23:55:35 -0000 Author: markj Date: Thu Dec 12 23:55:34 2019 New Revision: 355680 URL: https://svnweb.freebsd.org/changeset/base/355680 Log: Avoid relying on silent type casting in the native atomic_load_32. Reported by: np Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Thu Dec 12 23:37:04 2019 (r355679) +++ head/sys/vm/vm_page.h Thu Dec 12 23:55:34 2019 (r355680) @@ -766,7 +766,7 @@ vm_page_astate_load(vm_page_t m) { vm_page_astate_t a; - a._bits = atomic_load_32(&m->a); + a._bits = atomic_load_32(&m->a._bits); return (a); } From owner-svn-src-all@freebsd.org Fri Dec 13 00:14:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA5471DDEB9; Fri, 13 Dec 2019 00:14:13 +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 47YrkY42qvz4HkP; Fri, 13 Dec 2019 00:14:13 +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 860F53E8F; Fri, 13 Dec 2019 00:14:13 +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 xBD0EDZ6076472; Fri, 13 Dec 2019 00:14:13 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD0ED09076471; Fri, 13 Dec 2019 00:14:13 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912130014.xBD0ED09076471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 13 Dec 2019 00:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355681 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 355681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 00:14:13 -0000 Author: rmacklem Date: Fri Dec 13 00:14:12 2019 New Revision: 355681 URL: https://svnweb.freebsd.org/changeset/base/355681 Log: r355677 requires that vop_stdioctl() be global so it can be called from NFS. r355677 modified the NFS client so that it does lseek(SEEK_DATA/SEEK_HOLE) for NFSv4.2, but calls vop_stdioctl() otherwise. As such, vop_stdioctl() needs to be a global function. Missed during the code merge for r355677. Modified: head/sys/kern/vfs_default.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Thu Dec 12 23:55:34 2019 (r355680) +++ head/sys/kern/vfs_default.c Fri Dec 13 00:14:12 2019 (r355681) @@ -87,7 +87,6 @@ static int vop_stdadd_writecount(struct vop_add_writec static int vop_stdcopy_file_range(struct vop_copy_file_range_args *ap); static int vop_stdfdatasync(struct vop_fdatasync_args *ap); static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); -static int vop_stdioctl(struct vop_ioctl_args *ap); /* * This vnode table stores what we want to do if the filesystem doesn't @@ -1249,7 +1248,7 @@ vop_stdneed_inactive(struct vop_need_inactive_args *ap return (1); } -static int +int vop_stdioctl(struct vop_ioctl_args *ap) { struct vnode *vp; Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Thu Dec 12 23:55:34 2019 (r355680) +++ head/sys/sys/vnode.h Fri Dec 13 00:14:12 2019 (r355681) @@ -760,6 +760,7 @@ int vop_stdfsync(struct vop_fsync_args *); int vop_stdgetwritemount(struct vop_getwritemount_args *); int vop_stdgetpages(struct vop_getpages_args *); int vop_stdinactive(struct vop_inactive_args *); +int vop_stdioctl(struct vop_ioctl_args *); int vop_stdneed_inactive(struct vop_need_inactive_args *); int vop_stdkqfilter(struct vop_kqfilter_args *); int vop_stdlock(struct vop_lock1_args *); From owner-svn-src-all@freebsd.org Fri Dec 13 00:45:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 003EF1DE5E4; Fri, 13 Dec 2019 00:45:14 +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 47YsQL6696z4Jt3; Fri, 13 Dec 2019 00:45:14 +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 C87DF4404; Fri, 13 Dec 2019 00:45:14 +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 xBD0jESC093639; Fri, 13 Dec 2019 00:45:14 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD0jEUx093638; Fri, 13 Dec 2019 00:45:14 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912130045.xBD0jEUx093638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 13 Dec 2019 00:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355682 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 355682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 00:45:15 -0000 Author: rmacklem Date: Fri Dec 13 00:45:14 2019 New Revision: 355682 URL: https://svnweb.freebsd.org/changeset/base/355682 Log: Fix the build for MAC not defined and a couple of might not be initialized. r355677 broke the build for the not MAC defined case and a couple of might not be initialized warnings were generated for riscv. Others seem to be erroneous. Hopefully there won't be too many more build errors. Pointy hat goes on me. Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Fri Dec 13 00:14:12 2019 (r355681) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Fri Dec 13 00:45:14 2019 (r355682) @@ -3980,7 +3980,7 @@ static void nfsrv_pnfscreate(struct vnode *vp, struct vattr *vap, struct ucred *cred, NFSPROC_T *p) { - struct nfsrvdscreate *dsc, *tdsc; + struct nfsrvdscreate *dsc, *tdsc = NULL; struct nfsdevice *ds, *tds, *fds; struct mount *mp; struct pnfsdsfile *pf, *tpf; @@ -5890,7 +5890,7 @@ nfsrv_pnfssetfh(struct vnode *vp, struct pnfsdsfile *p char *fnamep, struct vnode *nvp, NFSPROC_T *p) { struct nfsnode *np; - int ret; + int ret = 0; np = VTONFS(nvp); NFSBCOPY(np->n_fhp->nfh_fh, &pf->dsf_fh, NFSX_MYFH); @@ -6210,12 +6210,13 @@ nfsvno_setxattr(struct vnode *vp, char *name, int len, struct uio uio, *uiop = &uio; int cnt, error; + error = 0; #ifdef MAC error = mac_vnode_check_setextattr(cred, vp, EXTATTR_NAMESPACE_USER, name); +#endif if (error != 0) goto out; -#endif uiop->uio_rw = UIO_WRITE; uiop->uio_segflg = UIO_SYSSPACE; @@ -6263,9 +6264,7 @@ nfsvno_rmxattr(struct nfsrv_descript *nd, struct vnode if (error == EOPNOTSUPP) error = VOP_SETEXTATTR(vp, EXTATTR_NAMESPACE_USER, name, NULL, cred, p); -#ifdef MAC out: -#endif NFSEXITCODE(error); return (error); } From owner-svn-src-all@freebsd.org Fri Dec 13 01:17:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 930F81DEB95; Fri, 13 Dec 2019 01:17:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Yt7N3FTrz4L3Y; Fri, 13 Dec 2019 01:17:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AA2F4960; Fri, 13 Dec 2019 01:17:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBD1HKVJ011411; Fri, 13 Dec 2019 01:17:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD1HKnP011410; Fri, 13 Dec 2019 01:17:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912130117.xBD1HKnP011410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Dec 2019 01:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355683 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 355683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 01:17:20 -0000 Author: jhb Date: Fri Dec 13 01:17:20 2019 New Revision: 355683 URL: https://svnweb.freebsd.org/changeset/base/355683 Log: Don't call into the debug server if it isn't configured. Reviewed by: markj (as part of a larger diff) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D20309 Modified: head/usr.sbin/bhyve/bhyverun.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Fri Dec 13 00:45:14 2019 (r355682) +++ head/usr.sbin/bhyve/bhyverun.c Fri Dec 13 01:17:20 2019 (r355683) @@ -167,6 +167,7 @@ uint16_t cores, maxcpus, sockets, threads; char *guest_uuid_str; +static int gdb_port = 0; static int guest_vmexit_on_hlt, guest_vmexit_on_pause; static int virtio_msix = 1; static int x2apic_mode = 0; /* default is xAPIC */ @@ -416,7 +417,8 @@ fbsdrun_start_thread(void *param) snprintf(tname, sizeof(tname), "vcpu %d", vcpu); pthread_set_name_np(mtp->mt_thr, tname); - gdb_cpu_add(vcpu); + if (gdb_port != 0) + gdb_cpu_add(vcpu); vm_loop(mtp->mt_ctx, vcpu, vmexit[vcpu].rip); @@ -690,8 +692,11 @@ vmexit_mtrap(struct vmctx *ctx, struct vm_exit *vmexit stats.vmexit_mtrap++; + if (gdb_port == 0) { + fprintf(stderr, "vm_loop: unexpected VMEXIT_MTRAP\n"); + exit(4); + } gdb_cpu_mtrap(*pvcpu); - return (VMEXIT_CONTINUE); } @@ -770,6 +775,10 @@ static int vmexit_debug(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) { + if (gdb_port == 0) { + fprintf(stderr, "vm_loop: unexpected VMEXIT_DEBUG\n"); + exit(4); + } gdb_cpu_suspend(*pvcpu); return (VMEXIT_CONTINUE); } From owner-svn-src-all@freebsd.org Fri Dec 13 01:34:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C705C1DF42F; Fri, 13 Dec 2019 01:34:26 +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 47YtW64ssVz4M1Q; Fri, 13 Dec 2019 01:34:26 +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 9DF6D4D11; Fri, 13 Dec 2019 01:34:26 +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 xBD1YQsa023312; Fri, 13 Dec 2019 01:34:26 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD1YQis023310; Fri, 13 Dec 2019 01:34:26 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912130134.xBD1YQis023310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 13 Dec 2019 01:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355684 - in head/sys/fs: nfsclient nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfsclient nfsserver X-SVN-Commit-Revision: 355684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 01:34:26 -0000 Author: rmacklem Date: Fri Dec 13 01:34:25 2019 New Revision: 355684 URL: https://svnweb.freebsd.org/changeset/base/355684 Log: Add some more initializations to quiet riscv build. The one case in nfs_copy_file_range() was a legitimate case, although it would probably never occur in practice. Modified: head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Fri Dec 13 01:17:20 2019 (r355683) +++ head/sys/fs/nfsclient/nfs_clvnops.c Fri Dec 13 01:34:25 2019 (r355684) @@ -3639,6 +3639,7 @@ nfs_copy_file_range(struct vop_copy_file_range_args *a off_t inoff, outoff; bool consecutive, must_commit, tryoutcred; + ret = ret2 = 0; nmp = VFSTONFS(invp->v_mount); mtx_lock(&nmp->nm_mtx); /* NFSv4.2 Copy is not permitted for infile == outfile. */ Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Fri Dec 13 01:17:20 2019 (r355683) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Fri Dec 13 01:34:25 2019 (r355684) @@ -5155,7 +5155,7 @@ nfsrv_writedsrpc(fhandle_t *fhp, off_t off, int len, s NFSPROC_T *p, struct vnode *vp, struct nfsmount **nmpp, int mirrorcnt, struct mbuf **mpp, char *cp, int *failposp) { - struct nfsrvwritedsdorpc *drpc, *tdrpc; + struct nfsrvwritedsdorpc *drpc, *tdrpc = NULL; struct nfsvattr na; struct mbuf *m; int error, i, offs, ret, timo; @@ -5322,7 +5322,7 @@ nfsrv_allocatedsrpc(fhandle_t *fhp, off_t off, off_t l NFSPROC_T *p, struct vnode *vp, struct nfsmount **nmpp, int mirrorcnt, int *failposp) { - struct nfsrvallocatedsdorpc *drpc, *tdrpc; + struct nfsrvallocatedsdorpc *drpc, *tdrpc = NULL; struct nfsvattr na; int error, i, ret, timo; @@ -5506,7 +5506,7 @@ nfsrv_setattrdsrpc(fhandle_t *fhp, struct ucred *cred, struct vnode *vp, struct nfsmount **nmpp, int mirrorcnt, struct nfsvattr *nap, int *failposp) { - struct nfsrvsetattrdsdorpc *drpc, *tdrpc; + struct nfsrvsetattrdsdorpc *drpc, *tdrpc = NULL; struct nfsvattr na; int error, i, ret, timo; @@ -5655,7 +5655,7 @@ nfsrv_setacldsrpc(fhandle_t *fhp, struct ucred *cred, struct vnode *vp, struct nfsmount **nmpp, int mirrorcnt, struct acl *aclp, int *failposp) { - struct nfsrvsetacldsdorpc *drpc, *tdrpc; + struct nfsrvsetacldsdorpc *drpc, *tdrpc = NULL; int error, i, ret, timo; NFSD_DEBUG(4, "in nfsrv_setacldsrpc\n"); From owner-svn-src-all@freebsd.org Fri Dec 13 01:38:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 49FCE1DF4FE; Fri, 13 Dec 2019 01:38:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47YtcB1DH1z4M9Q; Fri, 13 Dec 2019 01:38:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 253964D15; Fri, 13 Dec 2019 01:38:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBD1coi3023538; Fri, 13 Dec 2019 01:38:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD1cm1w023532; Fri, 13 Dec 2019 01:38:48 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912130138.xBD1cm1w023532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 13 Dec 2019 01:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355685 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 355685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 01:38:50 -0000 Author: ian Date: Fri Dec 13 01:38:48 2019 New Revision: 355685 URL: https://svnweb.freebsd.org/changeset/base/355685 Log: Clean up some of my copyrights; add SPDX tag and remove All rights reserved. Modified: head/sys/dev/iicbus/ads111x.c head/sys/dev/iicbus/ds13rtc.c head/sys/dev/iicbus/iic_recover_bus.c head/sys/dev/iicbus/iic_recover_bus.h head/sys/dev/iicbus/isl12xx.c head/sys/dev/iicbus/nxprtc.c head/sys/dev/iicbus/rtc8583.c Modified: head/sys/dev/iicbus/ads111x.c ============================================================================== --- head/sys/dev/iicbus/ads111x.c Fri Dec 13 01:34:25 2019 (r355684) +++ head/sys/dev/iicbus/ads111x.c Fri Dec 13 01:38:48 2019 (r355685) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2019 Ian Lepore. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/iicbus/ds13rtc.c ============================================================================== --- head/sys/dev/iicbus/ds13rtc.c Fri Dec 13 01:34:25 2019 (r355684) +++ head/sys/dev/iicbus/ds13rtc.c Fri Dec 13 01:38:48 2019 (r355685) @@ -1,6 +1,7 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2017 Ian Lepore - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/sys/dev/iicbus/iic_recover_bus.c ============================================================================== --- head/sys/dev/iicbus/iic_recover_bus.c Fri Dec 13 01:34:25 2019 (r355684) +++ head/sys/dev/iicbus/iic_recover_bus.c Fri Dec 13 01:38:48 2019 (r355685) @@ -1,6 +1,7 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2017 Ian Lepore - * All rights reserved. * * Development sponsored by Microsemi, Inc. * Modified: head/sys/dev/iicbus/iic_recover_bus.h ============================================================================== --- head/sys/dev/iicbus/iic_recover_bus.h Fri Dec 13 01:34:25 2019 (r355684) +++ head/sys/dev/iicbus/iic_recover_bus.h Fri Dec 13 01:38:48 2019 (r355685) @@ -1,6 +1,7 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2017 Ian Lepore - * All rights reserved. * * Development sponsored by Microsemi, Inc. * Modified: head/sys/dev/iicbus/isl12xx.c ============================================================================== --- head/sys/dev/iicbus/isl12xx.c Fri Dec 13 01:34:25 2019 (r355684) +++ head/sys/dev/iicbus/isl12xx.c Fri Dec 13 01:38:48 2019 (r355685) @@ -1,5 +1,7 @@ /*- - * Copyright (c) 2017 Ian Lepore. All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2017 Ian Lepore. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/sys/dev/iicbus/nxprtc.c ============================================================================== --- head/sys/dev/iicbus/nxprtc.c Fri Dec 13 01:34:25 2019 (r355684) +++ head/sys/dev/iicbus/nxprtc.c Fri Dec 13 01:38:48 2019 (r355685) @@ -1,6 +1,7 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2017 Ian Lepore - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/sys/dev/iicbus/rtc8583.c ============================================================================== --- head/sys/dev/iicbus/rtc8583.c Fri Dec 13 01:34:25 2019 (r355684) +++ head/sys/dev/iicbus/rtc8583.c Fri Dec 13 01:38:48 2019 (r355685) @@ -1,6 +1,8 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2017 Hiroki Mori. All rights reserved. - * Copyright (c) 2017 Ian Lepore. All rights reserved. + * Copyright (c) 2017 Ian Lepore. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-all@freebsd.org Fri Dec 13 02:15:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77EE01DFDFC; Fri, 13 Dec 2019 02:15:35 +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 47YvQb2YPXz4NQm; Fri, 13 Dec 2019 02:15:35 +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 4E8785408; Fri, 13 Dec 2019 02:15:35 +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 xBD2FZBh046773; Fri, 13 Dec 2019 02:15:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD2FZdn046772; Fri, 13 Dec 2019 02:15:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912130215.xBD2FZdn046772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Dec 2019 02:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355686 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 355686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 02:15:35 -0000 Author: jhb Date: Fri Dec 13 02:15:34 2019 New Revision: 355686 URL: https://svnweb.freebsd.org/changeset/base/355686 Log: Fix a mismerge in r355683 and remove the local gdb_port from main. Modified: head/usr.sbin/bhyve/bhyverun.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Fri Dec 13 01:38:48 2019 (r355685) +++ head/usr.sbin/bhyve/bhyverun.c Fri Dec 13 02:15:34 2019 (r355686) @@ -984,7 +984,7 @@ do_open(const char *vmname) int main(int argc, char *argv[]) { - int c, error, dbg_port, gdb_port, err, bvmcons; + int c, error, dbg_port, err, bvmcons; int max_vcpus, mptgen, memflags; int rtc_localtime; bool gdb_stop; @@ -996,7 +996,6 @@ main(int argc, char *argv[]) bvmcons = 0; progname = basename(argv[0]); dbg_port = 0; - gdb_port = 0; gdb_stop = false; guest_ncpus = 1; sockets = cores = threads = 1; From owner-svn-src-all@freebsd.org Fri Dec 13 02:18:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE2FE1DFEF7; Fri, 13 Dec 2019 02:18:44 +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 47YvVD4kRYz4NcS; Fri, 13 Dec 2019 02:18:44 +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 9946C5409; Fri, 13 Dec 2019 02:18:44 +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 xBD2IieY046941; Fri, 13 Dec 2019 02:18:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD2IiDi046940; Fri, 13 Dec 2019 02:18:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912130218.xBD2IiDi046940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Dec 2019 02:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355687 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 355687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 02:18:44 -0000 Author: jhb Date: Fri Dec 13 02:18:44 2019 New Revision: 355687 URL: https://svnweb.freebsd.org/changeset/base/355687 Log: Document that the debug server supports writing to guest memory. This was added in r348212. Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Fri Dec 13 02:15:34 2019 (r355686) +++ head/usr.sbin/bhyve/bhyve.8 Fri Dec 13 02:18:44 2019 (r355687) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 24, 2019 +.Dd December 12, 2019 .Dt BHYVE 8 .Os .Sh NAME @@ -521,8 +521,7 @@ Each virtual CPU is exposed to the debugger as a threa General purpose registers can be queried for each virtual CPU, but other registers such as floating-point and system registers cannot be queried. .Ss Memory -Memory (including memory mapped I/O regions) can be read by the debugger, -but not written. +Memory (including memory mapped I/O regions) can be read and written by the debugger. Memory operations use virtual addresses that are resolved to physical addresses via the current virtual CPU's active address translation. .Ss Control From owner-svn-src-all@freebsd.org Fri Dec 13 02:20:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC2781E0137; Fri, 13 Dec 2019 02:20:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47YvXB62r9z4Npf; Fri, 13 Dec 2019 02:20:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6786540D; Fri, 13 Dec 2019 02:20:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBD2KQ25047087; Fri, 13 Dec 2019 02:20:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD2KQ30047086; Fri, 13 Dec 2019 02:20:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912130220.xBD2KQ30047086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 13 Dec 2019 02:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355688 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 355688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 02:20:27 -0000 Author: ian Date: Fri Dec 13 02:20:26 2019 New Revision: 355688 URL: https://svnweb.freebsd.org/changeset/base/355688 Log: If device_delete_children() returns an error, bail on the rest of the detach work and return the error. Especially don't call iicbus_reset() since the most likely cause of failing to detach children is that one of them has IO in progress. Modified: head/sys/dev/iicbus/iicbus.c Modified: head/sys/dev/iicbus/iicbus.c ============================================================================== --- head/sys/dev/iicbus/iicbus.c Fri Dec 13 02:18:44 2019 (r355687) +++ head/sys/dev/iicbus/iicbus.c Fri Dec 13 02:20:26 2019 (r355688) @@ -134,10 +134,11 @@ static int iicbus_detach(device_t dev) { struct iicbus_softc *sc = IICBUS_SOFTC(dev); + int err; + if ((err = device_delete_children(dev)) != 0) + return (err); iicbus_reset(dev, IIC_FASTEST, 0, NULL); - bus_generic_detach(dev); - device_delete_children(dev); mtx_destroy(&sc->lock); return (0); } From owner-svn-src-all@freebsd.org Fri Dec 13 03:29:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 771AF1E1192; Fri, 13 Dec 2019 03:29:55 +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 47Yx4M2J3hz4RFK; Fri, 13 Dec 2019 03:29:55 +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 4A0E760F4; Fri, 13 Dec 2019 03:29:55 +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 xBD3Ttgh088976; Fri, 13 Dec 2019 03:29:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD3TtOk088975; Fri, 13 Dec 2019 03:29:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912130329.xBD3TtOk088975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 13 Dec 2019 03:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355689 - in stable: 11/sys/kern 12/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/kern 12/sys/kern X-SVN-Commit-Revision: 355689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 03:29:55 -0000 Author: kevans Date: Fri Dec 13 03:29:54 2019 New Revision: 355689 URL: https://svnweb.freebsd.org/changeset/base/355689 Log: MFC r343777, r352244-r352245: kenv fix + assertions r343777: Fix zapping of static hints and env in init_static_kenv(). Environments are terminated by 2 NULs, but only 1 NUL was zapped. Zapping only 1 NUL just splits the first string into an empty string and a corrupted string. All other strings in static hints and env remained live early in the boot when they were supposed to be disabled. Support calling init_static_kenv() very early in the boot, so as to use the env very early in the boot. Then the pointer to the loader env may change after the first call due to enabling paging or otherwise remapping the pointer. Another call is needed to register the change. Don't use the previous pointer in this (or any) later call. r352244: kenv: assert that an empty static buffer passed in is "empty" Garbage in the passed-in buffer can cause problems if any attempts to read the kenv are inadvertently made between init_static_kenv and the first kern_setenv -- assuming there is one. This is cheap and easy, so do it. This also helps rule out some class of bugs as one tries to debug; tunables fetch from the static environment up until SI_SUB_KMEM + 1, and many of these buffers are global ~4k buffers that rely on BSS clearing while others just grab a page of free memory and use it (e.g. xen). r352245: Follow up r352244: kenv: tighten up assertions As I like to forget: static kenv var formatting is actually such that an empty environment would be double null bytes. We should make sure that a non-zero buffer has at least enough for this, though most of the current usage is with a 4k buffer. Modified: stable/11/sys/kern/kern_environment.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/kern/kern_environment.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/kern/kern_environment.c ============================================================================== --- stable/11/sys/kern/kern_environment.c Fri Dec 13 02:20:26 2019 (r355688) +++ stable/11/sys/kern/kern_environment.c Fri Dec 13 03:29:54 2019 (r355689) @@ -249,6 +249,33 @@ init_static_kenv(char *buf, size_t len) KASSERT(!dynamic_kenv, ("kenv: dynamic_kenv already initialized")); /* + * Suitably sized means it must be able to hold at least one empty + * variable, otherwise things go belly up if a kern_getenv call is + * made without a prior call to kern_setenv as we have a malformed + * environment. + */ + KASSERT(len == 0 || len >= 2, + ("kenv: static env must be initialized or suitably sized")); + KASSERT(len == 0 || (*buf == '\0' && *(buf + 1) == '\0'), + ("kenv: sized buffer must be initially empty")); + + /* + * We may be called twice, with the second call needed to relocate + * md_envp after enabling paging. md_envp is then garbage if it is + * not null and the relocation will move it. Discard it so as to + * not crash using its old value in our first call to kern_getenv(). + * + * The second call gives the same environment as the first except + * in silly configurations where the static env disables itself. + * + * Other env calls don't handle possibly-garbage pointers, so must + * not be made between enabling paging and calling here. + */ + md_envp = NULL; + md_env_len = 0; + md_env_pos = 0; + + /* * Give the static environment a chance to disable the loader(8) * environment first. This is done with loader_env.disabled=1. * @@ -284,12 +311,16 @@ init_static_kenv(char *buf, size_t len) md_env_pos = 0; eval = kern_getenv("static_env.disabled"); - if (eval != NULL && strcmp(eval, "1") == 0) - *static_env = '\0'; + if (eval != NULL && strcmp(eval, "1") == 0) { + static_env[0] = '\0'; + static_env[1] = '\0'; + } eval = kern_getenv("static_hints.disabled"); - if (eval != NULL && strcmp(eval, "1") == 0) - *static_hints = '\0'; + if (eval != NULL && strcmp(eval, "1") == 0) { + static_hints[0] = '\0'; + static_hints[1] = '\0'; + } /* * Now we see if we need to tear the loader environment back down due From owner-svn-src-all@freebsd.org Fri Dec 13 03:29:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0C5A1E1196; Fri, 13 Dec 2019 03:29:55 +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 47Yx4M4lRBz4RFL; Fri, 13 Dec 2019 03:29:55 +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 9E0D660F5; Fri, 13 Dec 2019 03:29:55 +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 xBD3Tt2J088982; Fri, 13 Dec 2019 03:29:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD3TthP088981; Fri, 13 Dec 2019 03:29:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912130329.xBD3TthP088981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 13 Dec 2019 03:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355689 - in stable: 11/sys/kern 12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/kern 12/sys/kern X-SVN-Commit-Revision: 355689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 03:29:55 -0000 Author: kevans Date: Fri Dec 13 03:29:54 2019 New Revision: 355689 URL: https://svnweb.freebsd.org/changeset/base/355689 Log: MFC r343777, r352244-r352245: kenv fix + assertions r343777: Fix zapping of static hints and env in init_static_kenv(). Environments are terminated by 2 NULs, but only 1 NUL was zapped. Zapping only 1 NUL just splits the first string into an empty string and a corrupted string. All other strings in static hints and env remained live early in the boot when they were supposed to be disabled. Support calling init_static_kenv() very early in the boot, so as to use the env very early in the boot. Then the pointer to the loader env may change after the first call due to enabling paging or otherwise remapping the pointer. Another call is needed to register the change. Don't use the previous pointer in this (or any) later call. r352244: kenv: assert that an empty static buffer passed in is "empty" Garbage in the passed-in buffer can cause problems if any attempts to read the kenv are inadvertently made between init_static_kenv and the first kern_setenv -- assuming there is one. This is cheap and easy, so do it. This also helps rule out some class of bugs as one tries to debug; tunables fetch from the static environment up until SI_SUB_KMEM + 1, and many of these buffers are global ~4k buffers that rely on BSS clearing while others just grab a page of free memory and use it (e.g. xen). r352245: Follow up r352244: kenv: tighten up assertions As I like to forget: static kenv var formatting is actually such that an empty environment would be double null bytes. We should make sure that a non-zero buffer has at least enough for this, though most of the current usage is with a 4k buffer. Modified: stable/12/sys/kern/kern_environment.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/kern/kern_environment.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/kern/kern_environment.c ============================================================================== --- stable/12/sys/kern/kern_environment.c Fri Dec 13 02:20:26 2019 (r355688) +++ stable/12/sys/kern/kern_environment.c Fri Dec 13 03:29:54 2019 (r355689) @@ -251,6 +251,33 @@ init_static_kenv(char *buf, size_t len) KASSERT(!dynamic_kenv, ("kenv: dynamic_kenv already initialized")); /* + * Suitably sized means it must be able to hold at least one empty + * variable, otherwise things go belly up if a kern_getenv call is + * made without a prior call to kern_setenv as we have a malformed + * environment. + */ + KASSERT(len == 0 || len >= 2, + ("kenv: static env must be initialized or suitably sized")); + KASSERT(len == 0 || (*buf == '\0' && *(buf + 1) == '\0'), + ("kenv: sized buffer must be initially empty")); + + /* + * We may be called twice, with the second call needed to relocate + * md_envp after enabling paging. md_envp is then garbage if it is + * not null and the relocation will move it. Discard it so as to + * not crash using its old value in our first call to kern_getenv(). + * + * The second call gives the same environment as the first except + * in silly configurations where the static env disables itself. + * + * Other env calls don't handle possibly-garbage pointers, so must + * not be made between enabling paging and calling here. + */ + md_envp = NULL; + md_env_len = 0; + md_env_pos = 0; + + /* * Give the static environment a chance to disable the loader(8) * environment first. This is done with loader_env.disabled=1. * @@ -275,12 +302,16 @@ init_static_kenv(char *buf, size_t len) md_env_pos = 0; eval = kern_getenv("static_env.disabled"); - if (eval != NULL && strcmp(eval, "1") == 0) - *kern_envp = '\0'; + if (eval != NULL && strcmp(eval, "1") == 0) { + kern_envp[0] = '\0'; + kern_envp[1] = '\0'; + } } eval = kern_getenv("static_hints.disabled"); - if (eval != NULL && strcmp(eval, "1") == 0) - *static_hints = '\0'; + if (eval != NULL && strcmp(eval, "1") == 0) { + static_hints[0] = '\0'; + static_hints[1] = '\0'; + } } static void From owner-svn-src-all@freebsd.org Fri Dec 13 04:03:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 860DA1E18D8; Fri, 13 Dec 2019 04:03:04 +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 47Yxpc32xrz4SWn; Fri, 13 Dec 2019 04:03:04 +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 61CC26813; Fri, 13 Dec 2019 04:03:04 +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 xBD434iA011984; Fri, 13 Dec 2019 04:03:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD434Qn011982; Fri, 13 Dec 2019 04:03:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912130403.xBD434Qn011982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 13 Dec 2019 04:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355690 - in stable: 11/sys/kern 11/sys/sys 12/sys/kern 12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/kern 11/sys/sys 12/sys/kern 12/sys/sys X-SVN-Commit-Revision: 355690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 04:03:04 -0000 Author: kevans Date: Fri Dec 13 04:03:03 2019 New Revision: 355690 URL: https://svnweb.freebsd.org/changeset/base/355690 Log: MFC r352350: rangelock: add rangelock_cookie_assert A future change to posixshm to add file sealing will move locking out of shm_dotruncate as kern_shm_open() will require the lock to be held across the dotruncate until the seal is actually applied. For this, the cookie is passed into shm_dotruncate_locked which asserts RCA_WLOCKED. Modified: stable/12/sys/kern/kern_rangelock.c stable/12/sys/sys/rangelock.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/kern/kern_rangelock.c stable/11/sys/sys/rangelock.h Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/kern/kern_rangelock.c ============================================================================== --- stable/12/sys/kern/kern_rangelock.c Fri Dec 13 03:29:54 2019 (r355689) +++ stable/12/sys/kern/kern_rangelock.c Fri Dec 13 04:03:03 2019 (r355690) @@ -248,3 +248,35 @@ rangelock_wlock(struct rangelock *lock, off_t start, o return (rangelock_enqueue(lock, start, end, RL_LOCK_WRITE, ilk)); } + +#ifdef INVARIANT_SUPPORT +void +_rangelock_cookie_assert(void *cookie, int what, const char *file, int line) +{ + struct rl_q_entry *entry; + int flags; + + MPASS(cookie != NULL); + entry = cookie; + flags = entry->rl_q_flags; + switch (what) { + case RCA_LOCKED: + if ((flags & RL_LOCK_GRANTED) == 0) + panic("rangelock not held @ %s:%d\n", file, line); + break; + case RCA_RLOCKED: + if ((flags & (RL_LOCK_GRANTED | RL_LOCK_READ)) != + (RL_LOCK_GRANTED | RL_LOCK_READ)) + panic("rangelock not rlocked @ %s:%d\n", file, line); + break; + case RCA_WLOCKED: + if ((flags & (RL_LOCK_GRANTED | RL_LOCK_WRITE)) != + (RL_LOCK_GRANTED | RL_LOCK_WRITE)) + panic("rangelock not wlocked @ %s:%d\n", file, line); + break; + default: + panic("Unknown rangelock assertion: %d @ %s:%d", what, file, + line); + } +} +#endif /* INVARIANT_SUPPORT */ Modified: stable/12/sys/sys/rangelock.h ============================================================================== --- stable/12/sys/sys/rangelock.h Fri Dec 13 03:29:54 2019 (r355689) +++ stable/12/sys/sys/rangelock.h Fri Dec 13 04:03:03 2019 (r355690) @@ -78,6 +78,29 @@ void *rangelock_rlock(struct rangelock *lock, off_t st void *rangelock_wlock(struct rangelock *lock, off_t start, off_t end, struct mtx *ilk); void rlqentry_free(struct rl_q_entry *rlqe); +#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) +void _rangelock_cookie_assert(void *cookie, int what, const char *file, + int line); +#endif + +#ifdef INVARIANTS +#define rangelock_cookie_assert_(cookie, what, file, line) \ + _rangelock_cookie_assert((cookie), (what), (file), (line)) +#else +#define rangelock_cookie_assert_(cookie, what, file, line) (void)0 +#endif + +#define rangelock_cookie_assert(cookie, what) \ + rangelock_cookie_assert_((cookie), (what), __FILE__, __LINE__) + +/* + * Assertion flags. + */ +#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) +#define RCA_LOCKED 0x0001 +#define RCA_RLOCKED 0x0002 +#define RCA_WLOCKED 0x0004 +#endif #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Fri Dec 13 04:03:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EEF0A1E18CD; Fri, 13 Dec 2019 04:03:03 +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 47Yxpb63t3z4SWm; Fri, 13 Dec 2019 04:03:03 +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 CB64A6812; Fri, 13 Dec 2019 04:03:03 +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 xBD433ae011977; Fri, 13 Dec 2019 04:03:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD4333s011974; Fri, 13 Dec 2019 04:03:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912130403.xBD4333s011974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 13 Dec 2019 04:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355690 - in stable: 11/sys/kern 11/sys/sys 12/sys/kern 12/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/kern 11/sys/sys 12/sys/kern 12/sys/sys X-SVN-Commit-Revision: 355690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 04:03:04 -0000 Author: kevans Date: Fri Dec 13 04:03:03 2019 New Revision: 355690 URL: https://svnweb.freebsd.org/changeset/base/355690 Log: MFC r352350: rangelock: add rangelock_cookie_assert A future change to posixshm to add file sealing will move locking out of shm_dotruncate as kern_shm_open() will require the lock to be held across the dotruncate until the seal is actually applied. For this, the cookie is passed into shm_dotruncate_locked which asserts RCA_WLOCKED. Modified: stable/11/sys/kern/kern_rangelock.c stable/11/sys/sys/rangelock.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/kern/kern_rangelock.c stable/12/sys/sys/rangelock.h Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/kern/kern_rangelock.c ============================================================================== --- stable/11/sys/kern/kern_rangelock.c Fri Dec 13 03:29:54 2019 (r355689) +++ stable/11/sys/kern/kern_rangelock.c Fri Dec 13 04:03:03 2019 (r355690) @@ -246,3 +246,35 @@ rangelock_wlock(struct rangelock *lock, off_t start, o return (rangelock_enqueue(lock, start, end, RL_LOCK_WRITE, ilk)); } + +#ifdef INVARIANT_SUPPORT +void +_rangelock_cookie_assert(void *cookie, int what, const char *file, int line) +{ + struct rl_q_entry *entry; + int flags; + + MPASS(cookie != NULL); + entry = cookie; + flags = entry->rl_q_flags; + switch (what) { + case RCA_LOCKED: + if ((flags & RL_LOCK_GRANTED) == 0) + panic("rangelock not held @ %s:%d\n", file, line); + break; + case RCA_RLOCKED: + if ((flags & (RL_LOCK_GRANTED | RL_LOCK_READ)) != + (RL_LOCK_GRANTED | RL_LOCK_READ)) + panic("rangelock not rlocked @ %s:%d\n", file, line); + break; + case RCA_WLOCKED: + if ((flags & (RL_LOCK_GRANTED | RL_LOCK_WRITE)) != + (RL_LOCK_GRANTED | RL_LOCK_WRITE)) + panic("rangelock not wlocked @ %s:%d\n", file, line); + break; + default: + panic("Unknown rangelock assertion: %d @ %s:%d", what, file, + line); + } +} +#endif /* INVARIANT_SUPPORT */ Modified: stable/11/sys/sys/rangelock.h ============================================================================== --- stable/11/sys/sys/rangelock.h Fri Dec 13 03:29:54 2019 (r355689) +++ stable/11/sys/sys/rangelock.h Fri Dec 13 04:03:03 2019 (r355690) @@ -76,6 +76,29 @@ void *rangelock_rlock(struct rangelock *lock, off_t st void *rangelock_wlock(struct rangelock *lock, off_t start, off_t end, struct mtx *ilk); void rlqentry_free(struct rl_q_entry *rlqe); +#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) +void _rangelock_cookie_assert(void *cookie, int what, const char *file, + int line); +#endif + +#ifdef INVARIANTS +#define rangelock_cookie_assert_(cookie, what, file, line) \ + _rangelock_cookie_assert((cookie), (what), (file), (line)) +#else +#define rangelock_cookie_assert_(cookie, what, file, line) (void)0 +#endif + +#define rangelock_cookie_assert(cookie, what) \ + rangelock_cookie_assert_((cookie), (what), __FILE__, __LINE__) + +/* + * Assertion flags. + */ +#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) +#define RCA_LOCKED 0x0001 +#define RCA_RLOCKED 0x0002 +#define RCA_WLOCKED 0x0004 +#endif #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Fri Dec 13 04:03:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31D3C1E1926; Fri, 13 Dec 2019 04:03:07 +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 47Yxpf2rm4z4SYS; Fri, 13 Dec 2019 04:03:06 +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 50B346814; Fri, 13 Dec 2019 04:03:06 +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 xBD436hR012031; Fri, 13 Dec 2019 04:03:06 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD4355C012029; Fri, 13 Dec 2019 04:03:05 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912130403.xBD4355C012029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 13 Dec 2019 04:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355691 - head/usr.sbin/keyserv X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/keyserv X-SVN-Commit-Revision: 355691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 04:03:07 -0000 Author: cem Date: Fri Dec 13 04:03:05 2019 New Revision: 355691 URL: https://svnweb.freebsd.org/changeset/base/355691 Log: keyserv(8): unifdef out __FreeBSD__ and KEYSERV_RANDOM This doesn't appear to have some active upstream (and it's a steaming pile of bad 90s crypto design). Rip out the completely horrible bits and leave the only mildly less horrible bits. The whole thing should probably be deleted; to the extent it purports to provide a security feature: it doesn't. Modified: head/usr.sbin/keyserv/Makefile head/usr.sbin/keyserv/keyserv.c Modified: head/usr.sbin/keyserv/Makefile ============================================================================== --- head/usr.sbin/keyserv/Makefile Fri Dec 13 04:03:03 2019 (r355690) +++ head/usr.sbin/keyserv/Makefile Fri Dec 13 04:03:05 2019 (r355691) @@ -4,7 +4,7 @@ PROG= keyserv MAN= keyserv.8 SRCS= keyserv.c setkey.c crypt_svc.c crypt_server.c crypt.h -CFLAGS+= -DKEYSERV_RANDOM -DBROKEN_DES -I. +CFLAGS+= -DBROKEN_DES -I. LIBADD= mp rpcsvc Modified: head/usr.sbin/keyserv/keyserv.c ============================================================================== --- head/usr.sbin/keyserv/keyserv.c Fri Dec 13 04:03:03 2019 (r355690) +++ head/usr.sbin/keyserv/keyserv.c Fri Dec 13 04:03:05 2019 (r355691) @@ -224,38 +224,8 @@ static void randomize(master) des_block *master; { -#ifndef __FreeBSD__ - int i; - int seed; - struct timeval tv; - int shift; - - seed = 0; - for (i = 0; i < 1024; i++) { - (void)gettimeofday(&tv, NULL); - shift = i % 8 * sizeof (int); - seed ^= (tv.tv_usec << shift) | (tv.tv_usec >> (32 - shift)); - } -#endif -#ifdef KEYSERV_RANDOM -#ifdef __FreeBSD__ master->key.low = arc4random(); master->key.high = arc4random(); -#else - srandom(seed); - master->key.low = random(); - master->key.high = random(); -#endif -#else - /* use stupid dangerous bad rand() */ -#ifdef __FreeBSD__ - sranddev(); -#else - srand(seed); -#endif - master->key.low = rand(); - master->key.high = rand(); -#endif } /* From owner-svn-src-all@freebsd.org Fri Dec 13 04:12:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF8BB1E1BE8; Fri, 13 Dec 2019 04:12:13 +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 47Yy19590nz4T8n; Fri, 13 Dec 2019 04:12:13 +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 AC89169AF; Fri, 13 Dec 2019 04:12:13 +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 xBD4CDFT017851; Fri, 13 Dec 2019 04:12:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD4CDZm017850; Fri, 13 Dec 2019 04:12:13 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912130412.xBD4CDZm017850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 13 Dec 2019 04:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355692 - head/sbin/fsirand X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sbin/fsirand X-SVN-Commit-Revision: 355692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 04:12:13 -0000 Author: cem Date: Fri Dec 13 04:12:13 2019 New Revision: 355692 URL: https://svnweb.freebsd.org/changeset/base/355692 Log: fsirand(8): Just use arc4random(3) Remove single use of dubious srandomdev(3) + random(3) and replace with arc4random(3), as is used already in this program. Follow-up question: Do we really need this program anymore? In base? Modified: head/sbin/fsirand/fsirand.c Modified: head/sbin/fsirand/fsirand.c ============================================================================== --- head/sbin/fsirand/fsirand.c Fri Dec 13 04:03:05 2019 (r355691) +++ head/sbin/fsirand/fsirand.c Fri Dec 13 04:12:13 2019 (r355692) @@ -83,8 +83,6 @@ main(int argc, char *argv[]) if (argc - optind < 1) usage(); - srandomdev(); - /* Increase our data size to the max */ if (getrlimit(RLIMIT_DATA, &rl) == 0) { rl.rlim_cur = rl.rlim_max; @@ -167,7 +165,7 @@ fsirand(char *device) if (!printonly) { /* Randomize fs_id and write out new sblock and backups */ sblock->fs_id[0] = (u_int32_t)time(NULL); - sblock->fs_id[1] = random(); + sblock->fs_id[1] = arc4random(); if (sbput(devfd, sblock, sblock->fs_ncg) != 0) { warn("could not write updated superblock"); return (1); From owner-svn-src-all@freebsd.org Fri Dec 13 04:37:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCFDC1E1FE7; Fri, 13 Dec 2019 04:37:40 +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 47YyZX51xzz4Tt2; Fri, 13 Dec 2019 04:37:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7B0C6D4E; Fri, 13 Dec 2019 04:37:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBD4bent029953; Fri, 13 Dec 2019 04:37:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD4bdYT029950; Fri, 13 Dec 2019 04:37:39 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912130437.xBD4bdYT029950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 13 Dec 2019 04:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355693 - head/usr.bin/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.bin/random X-SVN-Commit-Revision: 355693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 04:37:40 -0000 Author: cem Date: Fri Dec 13 04:37:39 2019 New Revision: 355693 URL: https://svnweb.freebsd.org/changeset/base/355693 Log: random(6): produce random results This program is trash and there's no reason to keep it in base. But as long as we're shipping a silly program named 'random', let's actually make it random. Modified: head/usr.bin/random/random.6 head/usr.bin/random/random.c head/usr.bin/random/randomize_fd.c head/usr.bin/random/randomize_fd.h Modified: head/usr.bin/random/random.6 ============================================================================== --- head/usr.bin/random/random.6 Fri Dec 13 04:12:13 2019 (r355692) +++ head/usr.bin/random/random.6 Fri Dec 13 04:37:39 2019 (r355693) @@ -28,7 +28,7 @@ .\" @(#)random.6 8.2 (Berkeley) 3/31/94 .\" $FreeBSD$ .\" -.Dd February 8, 2003 +.Dd December 12, 2019 .Dt RANDOM 6 .Os .Sh NAME @@ -62,9 +62,7 @@ space characters as determined by The default .Ar denominator for this mode of operation is 1, which gives each line a chance to be -displayed, but in a -.Xr random 3 -order. +displayed, but in a random order. .Pp The options are as follows: .Bl -tag -width Ds @@ -112,7 +110,6 @@ Randomize words separated by instead of newlines. .El .Sh SEE ALSO -.Xr random 3 , .Xr fortune 6 .Sh HISTORY The Modified: head/usr.bin/random/random.c ============================================================================== --- head/usr.bin/random/random.c Fri Dec 13 04:12:13 2019 (r355692) +++ head/usr.bin/random/random.c Fri Dec 13 04:37:39 2019 (r355693) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -135,8 +136,6 @@ main(int argc, char *argv[]) /* NOTREACHED */ } - srandomdev(); - /* * Act as a filter, randomly choosing lines of the standard input * to write to the standard output. @@ -158,7 +157,7 @@ main(int argc, char *argv[]) /* Compute a random exit status between 0 and denom - 1. */ if (random_exit) - return (int)(denom * random() / RANDOM_MAX_PLUS1); + return (arc4random_uniform(denom)); /* * Select whether to print the first line. (Prime the pump.) @@ -166,7 +165,7 @@ main(int argc, char *argv[]) * 0 (which has a 1 / denom chance of being true), we select the * line. */ - selected = (int)(denom * random() / RANDOM_MAX_PLUS1) == 0; + selected = (arc4random_uniform(denom) == 0); while ((ch = getchar()) != EOF) { if (selected) (void)putchar(ch); @@ -176,8 +175,7 @@ main(int argc, char *argv[]) err(2, "stdout"); /* Now see if the next line is to be printed. */ - selected = (int)(denom * random() / - RANDOM_MAX_PLUS1) == 0; + selected = (arc4random_uniform(denom) == 0); } } if (ferror(stdin)) Modified: head/usr.bin/random/randomize_fd.c ============================================================================== --- head/usr.bin/random/randomize_fd.c Fri Dec 13 04:12:13 2019 (r355692) +++ head/usr.bin/random/randomize_fd.c Fri Dec 13 04:37:39 2019 (r355693) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -175,7 +176,7 @@ randomize_fd(int fd, int type, int unique, double deno (type == RANDOM_TYPE_WORDS && isspace(buf[i])) || (eof && i == buflen - 1)) { make_token: - if (numnode == RANDOM_MAX_PLUS1) { + if (numnode == UINT32_MAX - 1) { errno = EFBIG; err(1, "too many delimiters"); } @@ -210,15 +211,14 @@ make_token: free(buf); for (i = numnode; i > 0; i--) { - selected = random() % numnode; + selected = arc4random_uniform(numnode + 1); for (j = 0, prev = n = rand_root; n != NULL; j++, prev = n, n = n->next) { if (j == selected) { if (n->cp == NULL) break; - if ((int)(denom * random() / - RANDOM_MAX_PLUS1) == 0) { + if (arc4random_uniform(denom) == 0) { ret = printf("%.*s", (int)n->len - 1, n->cp); if (ret < 0) Modified: head/usr.bin/random/randomize_fd.h ============================================================================== --- head/usr.bin/random/randomize_fd.h Fri Dec 13 04:12:13 2019 (r355692) +++ head/usr.bin/random/randomize_fd.h Fri Dec 13 04:37:39 2019 (r355693) @@ -29,12 +29,6 @@ #ifndef __RANDOMIZE_FD__ #define __RANDOMIZE_FD__ -/* - * The random() function is defined to return values between 0 and - * 2^31 - 1 inclusive in random(3). - */ -#define RANDOM_MAX_PLUS1 0x80000000UL - #define RANDOM_TYPE_UNSET 0 #define RANDOM_TYPE_LINES 1 #define RANDOM_TYPE_WORDS 2 From owner-svn-src-all@freebsd.org Fri Dec 13 04:48:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC1B41E222B; Fri, 13 Dec 2019 04:48:21 +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 47Yyps3TkLz4VGJ; Fri, 13 Dec 2019 04:48:21 +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 6E6546F03; Fri, 13 Dec 2019 04:48:21 +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 xBD4mLqw035813; Fri, 13 Dec 2019 04:48:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD4mLIG035812; Fri, 13 Dec 2019 04:48:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912130448.xBD4mLIG035812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 13 Dec 2019 04:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355694 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 04:48:21 -0000 Author: cem Date: Fri Dec 13 04:48:20 2019 New Revision: 355694 URL: https://svnweb.freebsd.org/changeset/base/355694 Log: kern/subr_unit: Rip srandomdev, random(3) out of dead code The simulation cannot be reproduced, so the value of using a deterministic PRNG like random(3) is dubious. The number of repitions used in the sample isn't a problem for the Chacha implementation of arc4random we have today. (Also, no one actually runs this code; it was provided as an example of the work the author did validating the implementation. It's not even test code.) Modified: head/sys/kern/subr_unit.c Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Fri Dec 13 04:37:39 2019 (r355693) +++ head/sys/kern/subr_unit.c Fri Dec 13 04:48:20 2019 (r355694) @@ -1021,7 +1021,7 @@ main(int argc, char **argv) long count = 10000; /* Number of unrs to test */ long reps = 1, m; int ch; - u_int i, j; + u_int i; verbose = false; @@ -1055,20 +1055,18 @@ main(int argc, char **argv) a = calloc(count, sizeof(char)); if (a == NULL) err(1, "calloc failed"); - srandomdev(); printf("sizeof(struct unr) %zu\n", sizeof(struct unr)); printf("sizeof(struct unrb) %zu\n", sizeof(struct unrb)); printf("sizeof(struct unrhdr) %zu\n", sizeof(struct unrhdr)); printf("NBITS %lu\n", (unsigned long)NBITS); for (m = 0; m < count * reps; m++) { - j = random(); - i = (j >> 1) % count; + i = arc4random_uniform(count); #if 0 if (a[i] && (j & 1)) continue; #endif - if ((random() & 1) != 0) + if ((arc4random() & 1) != 0) test_alloc_unr(uh, i, a); else test_alloc_unr_specific(uh, i, a); From owner-svn-src-all@freebsd.org Fri Dec 13 04:55:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BC311E2584; Fri, 13 Dec 2019 04:55:18 +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 47Yyyt0QMwz4VpH; Fri, 13 Dec 2019 04:55:18 +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 055B070BC; Fri, 13 Dec 2019 04:55:18 +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 xBD4tHqU041645; Fri, 13 Dec 2019 04:55:17 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD4tH4X041644; Fri, 13 Dec 2019 04:55:17 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912130455.xBD4tH4X041644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 13 Dec 2019 04:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355695 - head/lib/libradius X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libradius X-SVN-Commit-Revision: 355695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 04:55:18 -0000 Author: cem Date: Fri Dec 13 04:55:17 2019 New Revision: 355695 URL: https://svnweb.freebsd.org/changeset/base/355695 Log: libradius: Rip out dubious use of srandomdev(3)+random(3) These functions appear to intend to produce unpredictable results. Just use arc4random. While here, use an explicit_bzero instead of memset where the intent is clearly to zero out a secret (clear_passphrase). Modified: head/lib/libradius/radlib.c Modified: head/lib/libradius/radlib.c ============================================================================== --- head/lib/libradius/radlib.c Fri Dec 13 04:48:20 2019 (r355694) +++ head/lib/libradius/radlib.c Fri Dec 13 04:55:17 2019 (r355695) @@ -79,7 +79,7 @@ static void clear_password(struct rad_handle *h) { if (h->pass_len != 0) { - memset(h->pass, 0, h->pass_len); + explicit_bzero(h->pass, h->pass_len); h->pass_len = 0; } h->pass_pos = 0; @@ -852,8 +852,8 @@ rad_create_request(struct rad_handle *h, int code) if (code == RAD_ACCESS_REQUEST) { /* Create a random authenticator */ for (i = 0; i < LEN_AUTH; i += 2) { - long r; - r = random(); + uint32_t r; + r = arc4random(); h->out[POS_AUTH+i] = (u_char)r; h->out[POS_AUTH+i+1] = (u_char)(r >> 8); } @@ -1051,10 +1051,9 @@ rad_auth_open(void) h = (struct rad_handle *)malloc(sizeof(struct rad_handle)); if (h != NULL) { - srandomdev(); h->fd = -1; h->num_servers = 0; - h->ident = random(); + h->ident = arc4random(); h->errmsg[0] = '\0'; memset(h->pass, 0, sizeof h->pass); h->pass_len = 0; From owner-svn-src-all@freebsd.org Fri Dec 13 05:11:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50D031E2923; Fri, 13 Dec 2019 05:11:35 +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 47YzKg1VyLz4WP7; Fri, 13 Dec 2019 05:11:35 +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 2F2DA72FA; Fri, 13 Dec 2019 05:11:35 +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 xBD5BZGp049302; Fri, 13 Dec 2019 05:11:35 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD5BZPC049300; Fri, 13 Dec 2019 05:11:35 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912130511.xBD5BZPC049300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 13 Dec 2019 05:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355696 - head/lib/libtacplus X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libtacplus X-SVN-Commit-Revision: 355696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 05:11:35 -0000 Author: cem Date: Fri Dec 13 05:11:34 2019 New Revision: 355696 URL: https://svnweb.freebsd.org/changeset/base/355696 Log: libtacplus: Remove bogus srandomdev+random Replace with arc4random. TACAS+ is a 1993 Cisco extension to the 1984 TACAS. Is this something we want in base still? The directory has been substantively unmaintained since 2002, at least. Modified: head/lib/libtacplus/taclib.c Modified: head/lib/libtacplus/taclib.c ============================================================================== --- head/lib/libtacplus/taclib.c Fri Dec 13 04:55:17 2019 (r355695) +++ head/lib/libtacplus/taclib.c Fri Dec 13 05:11:34 2019 (r355696) @@ -429,10 +429,10 @@ gen_session_id(struct tac_msg *msg) { int r; - r = random(); + r = arc4random(); msg->session_id[0] = r >> 8; msg->session_id[1] = r; - r = random(); + r = arc4random(); msg->session_id[2] = r >> 8; msg->session_id[3] = r; } @@ -1051,7 +1051,6 @@ tac_open(void) } init_srvr_str(&h->srvr_msg); init_srvr_str(&h->srvr_data); - srandomdev(); } return h; } From owner-svn-src-all@freebsd.org Fri Dec 13 05:13:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2409A1E29B8; Fri, 13 Dec 2019 05:13:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47YzMp08Sbz4WZH; Fri, 13 Dec 2019 05:13:26 +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 0089D7447; Fri, 13 Dec 2019 05:13:26 +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 xBD5DP15053168; Fri, 13 Dec 2019 05:13:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD5DP5x053167; Fri, 13 Dec 2019 05:13:25 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912130513.xBD5DP5x053167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 13 Dec 2019 05:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355697 - head/contrib/bsnmp/snmpd X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/contrib/bsnmp/snmpd X-SVN-Commit-Revision: 355697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 05:13:26 -0000 Author: cem Date: Fri Dec 13 05:13:25 2019 New Revision: 355697 URL: https://svnweb.freebsd.org/changeset/base/355697 Log: bsnmpd(1): Replace dubious srandomdev+random(3) with arc4random(3) Modified: head/contrib/bsnmp/snmpd/main.c Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Fri Dec 13 05:11:34 2019 (r355696) +++ head/contrib/bsnmp/snmpd/main.c Fri Dec 13 05:13:25 2019 (r355697) @@ -1615,9 +1615,7 @@ main(int argc, char *argv[]) progargs = argv; nprogargs = argc; - srandomdev(); - - snmp_serial_no = random(); + snmp_serial_no = arc4random(); #ifdef USE_TCPWRAPPERS /* From owner-svn-src-all@freebsd.org Fri Dec 13 05:15:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6587A1E2A62; Fri, 13 Dec 2019 05:15:44 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) (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 47YzQS0PWjz4Whx; Fri, 13 Dec 2019 05:15:43 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot1-x32d.google.com with SMTP id i4so4847285otr.3; Thu, 12 Dec 2019 21:15:43 -0800 (PST) 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=qS2tAqb1tia01DBf2stgPDGLid0EkFKL2pMvkp2IZMI=; b=eN5+HEG3leNQEKtVaJZGdvaUvA4nrVBArwASRZiE1KzbGokfvXFyc8V7vUo19zXg08 gdj4Iw2jYzLy/yvp01ppWz5foLv3h6pFXPorKLTUsWGszgYhqWJiDTiHFhIDB4BeHjrR YdvzcEM6U4wzWl5N+i3xzLWmJyfbe4SZkEfr4X5ONVDPgiCCUncE0OVmsRMasK0IaAsk HDuSGsGCsZteceCj9k44x24jVb2S80PvJulF5my4ZGpFZdJNB0oBXqFr5GN/hM10k3YN izf4DXRDf5jERexJL+sNoDFm+s6ND8fi7VPnJ64AES6QYirxLqIYs84QcVTpB4BleFG5 g33A== 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=qS2tAqb1tia01DBf2stgPDGLid0EkFKL2pMvkp2IZMI=; b=lRbixPmvAN0t6dj1Qpu6QgA/SvMwSYbTlZxW8AqCCt17DUWk84F0JFsHn8SjW9YqFn NDCo6PbWM6XIDatQl89Y7ZAz0KGnKr4uL8abV+yyYhKJT/6gfcEcYNa81/wa/5kJ5EU4 8qC28f0ghmb7PqSimp2IQaC8kINLSIApuZZ7WrJVqxFZL62WpKkk95L9Bxtd3adIweTQ +l4V138qx0bUR/er8xlVy2LpNTnnvayNHgPyTDTXMjyzwubuHoT8FjHgCsrF/t6BZFYi 1bjmKQ0Zdf8NUDGgNylftnsTlF1bgXFgOAxsp2xueeczI+weR8MPoN0F6Xe0KDzVC6dw DfNw== X-Gm-Message-State: APjAAAXo16jQPd2H/Xb40zVkjkXq3jkJ9nBqgCADtMcqG4prf7UKKQUw W4sZh/0WcxKQYlCsGS7MnQlgD8gpMjqESIjqrVWWgg1k4cg= X-Google-Smtp-Source: APXvYqy0FVNsbTXKNAu4lMe7/vmAjxM7SGeB/Cix/5HT5cMWsSh6Lf84g65v/UYr2L7gsdgF6cUKi3LQDIzbVfUW8fM= X-Received: by 2002:a9d:4e97:: with SMTP id v23mr11923220otk.201.1576214141564; Thu, 12 Dec 2019 21:15:41 -0800 (PST) MIME-Version: 1.0 References: <201912130511.xBD5BZPC049300@repo.freebsd.org> In-Reply-To: <201912130511.xBD5BZPC049300@repo.freebsd.org> From: Benjamin Kaduk Date: Thu, 12 Dec 2019 21:15:30 -0800 Message-ID: Subject: Re: svn commit: r355696 - head/lib/libtacplus To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 47YzQS0PWjz4Whx 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] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 05:15:44 -0000 On Thu, Dec 12, 2019 at 9:11 PM Conrad Meyer wrote: > Author: cem > Date: Fri Dec 13 05:11:34 2019 > New Revision: 355696 > URL: https://svnweb.freebsd.org/changeset/base/355696 > > Log: > libtacplus: Remove bogus srandomdev+random > > Replace with arc4random. > > TACAS+ is a 1993 Cisco extension to the 1984 TACAS. Is this something > we want > in base still? The directory has been substantively unmaintained since > 2002, > at least. > > It's not as dead as that makes it sound -- https://datatracker.ietf.org/doc/draft-ietf-opsawg-tacacs/ is on its way to becoming an RFC. -Ben From owner-svn-src-all@freebsd.org Fri Dec 13 05:29:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C4471E2E2E; Fri, 13 Dec 2019 05:29:27 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47YzkH2Fdbz4XGb; Fri, 13 Dec 2019 05:29:27 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4870C75FE; Fri, 13 Dec 2019 05:29:27 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBD5TRAW059691; Fri, 13 Dec 2019 05:29:27 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD5TRCD059690; Fri, 13 Dec 2019 05:29:27 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201912130529.xBD5TRCD059690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 13 Dec 2019 05:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355698 - stable/12/sys/x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: stable/12/sys/x86/x86 X-SVN-Commit-Revision: 355698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 05:29:27 -0000 Author: scottl Date: Fri Dec 13 05:29:26 2019 New Revision: 355698 URL: https://svnweb.freebsd.org/changeset/base/355698 Log: Merge r355134,355375,355589 Clean up and clarify meta commentary on TAA. Add a state to denote that TSX doesn't exist on the CPU. x86: Add missed break to TAA status sysctl Fix the TAA state machine to do the right thing when the TAA migitation is available in microcode and the operator has set the sysctl to automatic mode. Sponsored by: Intel Modified: stable/12/sys/x86/x86/cpu_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/x86/cpu_machdep.c ============================================================================== --- stable/12/sys/x86/x86/cpu_machdep.c Fri Dec 13 05:13:25 2019 (r355697) +++ stable/12/sys/x86/x86/cpu_machdep.c Fri Dec 13 05:29:26 2019 (r355698) @@ -1164,11 +1164,15 @@ SYSCTL_PROC(_hw, OID_AUTO, mds_disable, CTLTYPE_INT | int x86_taa_enable; int x86_taa_state; enum { - TAA_NONE = 0, - TAA_TSX_DISABLE = 1, - TAA_VERW = 2, - TAA_AUTO = 3, - TAA_TAA_NO = 4 + TAA_NONE = 0, /* No mitigation enabled */ + TAA_TSX_DISABLE = 1, /* Disable TSX via MSR */ + TAA_VERW = 2, /* Use VERW mitigation */ + TAA_AUTO = 3, /* Automatically select the mitigation */ + + /* The states below are not selectable by the operator */ + + TAA_TAA_UC = 4, /* Mitigation present in microcode */ + TAA_NOT_PRESENT = 5 /* TSX is not present */ }; static void @@ -1192,15 +1196,14 @@ x86_taa_recalculate(void) if ((cpu_stdext_feature & CPUID_STDEXT_HLE) == 0 || (cpu_stdext_feature & CPUID_STDEXT_RTM) == 0) { /* TSX is not present */ - x86_taa_state = 0; + x86_taa_state = TAA_NOT_PRESENT; return; } /* Check to see what mitigation options the CPU gives us */ if (cpu_ia32_arch_caps & IA32_ARCH_CAP_TAA_NO) { /* CPU is not suseptible to TAA */ - taa_need = TAA_NONE; - taa_state = TAA_TAA_NO; + taa_need = TAA_TAA_UC; } else if (cpu_ia32_arch_caps & IA32_ARCH_CAP_TSX_CTRL) { /* * CPU can turn off TSX. This is the next best option @@ -1307,8 +1310,11 @@ sysctl_taa_state_handler(SYSCTL_HANDLER_ARGS) case TAA_VERW: state = "VERW"; break; - case TAA_TAA_NO: - state = "Not vulnerable"; + case TAA_TAA_UC: + state = "Mitigated in microcode"; + break; + case TAA_NOT_PRESENT: + state = "TSX not present"; break; default: state = "unknown"; From owner-svn-src-all@freebsd.org Fri Dec 13 05:42:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CCBF1E35C5; Fri, 13 Dec 2019 05:42:57 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47Z01s3Y0Lz4YG6; Fri, 13 Dec 2019 05:42:57 +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 74E6E7981; Fri, 13 Dec 2019 05:42:57 +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 xBD5gv7i071227; Fri, 13 Dec 2019 05:42:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD5gvj7071226; Fri, 13 Dec 2019 05:42:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912130542.xBD5gvj7071226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 13 Dec 2019 05:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355699 - head/contrib/telnet/libtelnet X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/contrib/telnet/libtelnet X-SVN-Commit-Revision: 355699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 05:42:57 -0000 Author: cem Date: Fri Dec 13 05:42:57 2019 New Revision: 355699 URL: https://svnweb.freebsd.org/changeset/base/355699 Log: libtelnet: Replace bogus use of srandomdev + random to generate "public key pair" I'm pretty skeptical that any crypto in telnet is worth using, but if we're ostensibly generating keys, arc4random is strictly better than the previous construct. Modified: head/contrib/telnet/libtelnet/pk.c Modified: head/contrib/telnet/libtelnet/pk.c ============================================================================== --- head/contrib/telnet/libtelnet/pk.c Fri Dec 13 05:29:26 2019 (r355698) +++ head/contrib/telnet/libtelnet/pk.c Fri Dec 13 05:42:57 2019 (r355699) @@ -142,12 +142,7 @@ common_key(char *xsecret, char *xpublic, IdeaData *ide static void getseed(char *seed, int seedsize) { - int i; - - srandomdev(); - for (i = 0; i < seedsize; i++) { - seed[i] = random() & 0xff; - } + arc4random_buf(seed, seedsize); } /* From owner-svn-src-all@freebsd.org Fri Dec 13 05:54:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B5291E3921; Fri, 13 Dec 2019 05:54:39 +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 47Z0HM3273z4Ylp; Fri, 13 Dec 2019 05:54:39 +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 5EC477B39; Fri, 13 Dec 2019 05:54:39 +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 xBD5sd5h077464; Fri, 13 Dec 2019 05:54:39 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD5sdSU077463; Fri, 13 Dec 2019 05:54:39 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912130554.xBD5sdSU077463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 13 Dec 2019 05:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355700 - head/usr.sbin/ntp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/ntp X-SVN-Commit-Revision: 355700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 05:54:39 -0000 Author: cem Date: Fri Dec 13 05:54:38 2019 New Revision: 355700 URL: https://svnweb.freebsd.org/changeset/base/355700 Log: ntpd(8): Don't use OpenSSL's RAND API The !USE_OPENSSL_CRYPTO_RAND path uses arc4random_buf() correctly. In general, we should prefer to avoid things OpenSSL does poorly when a good alternative exists in libc. Modified: head/usr.sbin/ntp/Makefile.inc Modified: head/usr.sbin/ntp/Makefile.inc ============================================================================== --- head/usr.sbin/ntp/Makefile.inc Fri Dec 13 05:42:57 2019 (r355699) +++ head/usr.sbin/ntp/Makefile.inc Fri Dec 13 05:54:38 2019 (r355700) @@ -11,7 +11,7 @@ NTPDEFS= -DSYS_FREEBSD CFLAGS+= ${NTPDEFS} ${DEFS_LOCAL} ${CLOCKDEFS} .if ${MK_OPENSSL} != "no" -CFLAGS+= -DOPENSSL -DUSE_OPENSSL_CRYPTO_RAND -DAUTOKEY +CFLAGS+= -DOPENSSL -DAUTOKEY .endif WARNS?= 0 From owner-svn-src-all@freebsd.org Fri Dec 13 06:54:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5E091E52AD; Fri, 13 Dec 2019 06:54:41 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47Z1cd4pwzz4fy2; Fri, 13 Dec 2019 06:54:41 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C39B8626; Fri, 13 Dec 2019 06:54:41 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBD6sf4A016969; Fri, 13 Dec 2019 06:54:41 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD6sfLW016968; Fri, 13 Dec 2019 06:54:41 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201912130654.xBD6sfLW016968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 13 Dec 2019 06:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355701 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: stable/11/sys/x86/x86 X-SVN-Commit-Revision: 355701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 06:54:41 -0000 Author: scottl Date: Fri Dec 13 06:54:41 2019 New Revision: 355701 URL: https://svnweb.freebsd.org/changeset/base/355701 Log: Merge r355134,355375,355589 Clean up and clarify meta commentary on TAA. Add a state to denote that TSX doesn't exist on the CPU. x86: Add missed break to TAA status sysctl Fix the TAA state machine to do the right thing when the TAA migitation is available in microcode and the operator has set the sysctl to automatic mode. Sponsored by: Intel Modified: stable/11/sys/x86/x86/cpu_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/cpu_machdep.c ============================================================================== --- stable/11/sys/x86/x86/cpu_machdep.c Fri Dec 13 05:54:38 2019 (r355700) +++ stable/11/sys/x86/x86/cpu_machdep.c Fri Dec 13 06:54:41 2019 (r355701) @@ -1192,11 +1192,15 @@ SYSCTL_PROC(_hw, OID_AUTO, mds_disable, CTLTYPE_INT | int x86_taa_enable; int x86_taa_state; enum { - TAA_NONE = 0, - TAA_TSX_DISABLE = 1, - TAA_VERW = 2, - TAA_AUTO = 3, - TAA_TAA_NO = 4 + TAA_NONE = 0, /* No mitigation enabled */ + TAA_TSX_DISABLE = 1, /* Disable TSX via MSR */ + TAA_VERW = 2, /* Use VERW mitigation */ + TAA_AUTO = 3, /* Automatically select the mitigation */ + + /* The states below are not selectable by the operator */ + + TAA_TAA_UC = 4, /* Mitigation present in microcode */ + TAA_NOT_PRESENT = 5 /* TSX is not present */ }; static void @@ -1220,15 +1224,14 @@ x86_taa_recalculate(void) if ((cpu_stdext_feature & CPUID_STDEXT_HLE) == 0 || (cpu_stdext_feature & CPUID_STDEXT_RTM) == 0) { /* TSX is not present */ - x86_taa_state = 0; + x86_taa_state = TAA_NOT_PRESENT; return; } /* Check to see what mitigation options the CPU gives us */ if (cpu_ia32_arch_caps & IA32_ARCH_CAP_TAA_NO) { /* CPU is not suseptible to TAA */ - taa_need = TAA_NONE; - taa_state = TAA_TAA_NO; + taa_need = TAA_TAA_UC; } else if (cpu_ia32_arch_caps & IA32_ARCH_CAP_TSX_CTRL) { /* * CPU can turn off TSX. This is the next best option @@ -1335,8 +1338,11 @@ sysctl_taa_state_handler(SYSCTL_HANDLER_ARGS) case TAA_VERW: state = "VERW"; break; - case TAA_TAA_NO: - state = "Not vulnerable"; + case TAA_TAA_UC: + state = "Mitigated in microcode"; + break; + case TAA_NOT_PRESENT: + state = "TSX not present"; break; default: state = "unknown"; From owner-svn-src-all@freebsd.org Fri Dec 13 08:20:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92CF91E6EF4; Fri, 13 Dec 2019 08:20: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 47Z3WT32XDz3FVX; Fri, 13 Dec 2019 08:20: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 5EF039448; Fri, 13 Dec 2019 08:20: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 xBD8KLWQ064370; Fri, 13 Dec 2019 08:20:21 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD8KLO5064368; Fri, 13 Dec 2019 08:20:21 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201912130820.xBD8KLO5064368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 13 Dec 2019 08:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355702 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 355702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 08:20:21 -0000 Author: tsoome Date: Fri Dec 13 08:20:20 2019 New Revision: 355702 URL: https://svnweb.freebsd.org/changeset/base/355702 Log: loader: vdisk dereference after free print out the information and then free the memory used. MFC after: 1 week Modified: head/stand/common/vdisk.c Modified: head/stand/common/vdisk.c ============================================================================== --- head/stand/common/vdisk.c Fri Dec 13 06:54:41 2019 (r355701) +++ head/stand/common/vdisk.c Fri Dec 13 08:20:20 2019 (r355702) @@ -229,10 +229,10 @@ command_unmapvd(int argc, char *argv[]) } STAILQ_REMOVE(&vdisk_list, vd, vdisk_info, vdisk_link); - close(vd->vdisk_fd); + (void) close(vd->vdisk_fd); + printf("%s (%s) unmapped\n", argv[1], vd->vdisk_path); free(vd->vdisk_path); free(vd); - printf("%s (%s) unmapped\n", argv[1], vd->vdisk_path); return (CMD_OK); } From owner-svn-src-all@freebsd.org Fri Dec 13 08:41:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27C3D1E7478; Fri, 13 Dec 2019 08:41:38 +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 47Z4020Kj1z3GSW; Fri, 13 Dec 2019 08:41:38 +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 06A2A9927; Fri, 13 Dec 2019 08:41:38 +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 xBD8fb4Q078144; Fri, 13 Dec 2019 08:41:37 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD8fbaf078143; Fri, 13 Dec 2019 08:41:37 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201912130841.xBD8fbaf078143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 13 Dec 2019 08:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355703 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 355703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 08:41:38 -0000 Author: tsoome Date: Fri Dec 13 08:41:37 2019 New Revision: 355703 URL: https://svnweb.freebsd.org/changeset/base/355703 Log: loader: clean up devopen and devclose a bit devopen should undo setup of f->f_dev in case of error. devclose can just call free(). MFC after: 1 week Modified: head/stand/common/devopen.c Modified: head/stand/common/devopen.c ============================================================================== --- head/stand/common/devopen.c Fri Dec 13 08:20:20 2019 (r355702) +++ head/stand/common/devopen.c Fri Dec 13 08:41:37 2019 (r355703) @@ -52,6 +52,7 @@ devopen(struct open_file *f, const char *fname, const result = dev->d_dev->dv_open(f, dev); if (result != 0) { f->f_devdata = NULL; + f->f_dev = NULL; free(dev); return (result); } @@ -74,8 +75,6 @@ int devclose(struct open_file *f) { - if (f->f_devdata != NULL) { - free(f->f_devdata); - } + free(f->f_devdata); return (0); } From owner-svn-src-all@freebsd.org Fri Dec 13 09:19:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBAD81E7EDD; Fri, 13 Dec 2019 09:19:24 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47Z4qc5mh3z3HkN; Fri, 13 Dec 2019 09:19:24 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C17CB9EBA; Fri, 13 Dec 2019 09:19:24 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBD9JODx098982; Fri, 13 Dec 2019 09:19:24 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD9JORN098981; Fri, 13 Dec 2019 09:19:24 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912130919.xBD9JORN098981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Fri, 13 Dec 2019 09:19:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355704 - stable/12/sys/mips/mips X-SVN-Group: stable-12 X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: stable/12/sys/mips/mips X-SVN-Commit-Revision: 355704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 09:19:25 -0000 Author: rlibby Date: Fri Dec 13 09:19:24 2019 New Revision: 355704 URL: https://svnweb.freebsd.org/changeset/base/355704 Log: MFC r355343: mips busdma: bzero map on alloc Modified: stable/12/sys/mips/mips/busdma_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/mips/mips/busdma_machdep.c ============================================================================== --- stable/12/sys/mips/mips/busdma_machdep.c Fri Dec 13 08:41:37 2019 (r355703) +++ stable/12/sys/mips/mips/busdma_machdep.c Fri Dec 13 09:19:24 2019 (r355704) @@ -155,8 +155,6 @@ struct bus_dmamap { bus_dma_tag_t dmat; struct memdesc mem; int flags; - void *origbuffer; - void *allocbuffer; TAILQ_ENTRY(bus_dmamap) freelist; STAILQ_ENTRY(bus_dmamap) links; bus_dmamap_callback_t *callback; @@ -204,11 +202,8 @@ dmamap_ctor(void *mem, int size, void *arg, int flags) dmat->map_count++; + bzero(map, sizeof(*map)); map->dmat = dmat; - map->flags = 0; - map->slist = NULL; - map->allocbuffer = NULL; - map->sync_count = 0; STAILQ_INIT(&map->bpages); return (0); From owner-svn-src-all@freebsd.org Fri Dec 13 09:28:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D14711C8284; Fri, 13 Dec 2019 09:28:45 +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 47Z52P52hWz3JGP; Fri, 13 Dec 2019 09:28:45 +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 A809BA0A7; Fri, 13 Dec 2019 09:28:45 +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 xBD9SjKp005187; Fri, 13 Dec 2019 09:28:45 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD9SiYX005183; Fri, 13 Dec 2019 09:28:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201912130928.xBD9SiYX005183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 13 Dec 2019 09:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355705 - in head: lib/geom/part sys/geom/part X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: lib/geom/part sys/geom/part X-SVN-Commit-Revision: 355705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 09:28:45 -0000 Author: trasz Date: Fri Dec 13 09:28:44 2019 New Revision: 355705 URL: https://svnweb.freebsd.org/changeset/base/355705 Log: Add kern.geom.part.separator tunable. This makes it possible to specify an optional separator to insert before partition name; eg if it's set to "c/", you'll get "ada0c/s1" instead of "ada0s1". (It cannot be set to just “/“, since ada0 is a device node, not a directory.) Reviewed by: imp MFC after: 2 weeks Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D22193 Modified: head/lib/geom/part/gpart.8 head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_if.m Modified: head/lib/geom/part/gpart.8 ============================================================================== --- head/lib/geom/part/gpart.8 Fri Dec 13 09:19:24 2019 (r355704) +++ head/lib/geom/part/gpart.8 Fri Dec 13 09:28:44 2019 (r355705) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 3, 2019 +.Dd December 13, 2019 .Dt GPART 8 .Os .Sh NAME @@ -1260,6 +1260,14 @@ If this variable is set to a non-zero value, the modul recalculate the user-specified offset and size for alignment with the CHS geometry. Otherwise the values will be left unchanged. +.It Va kern.geom.part.separator : No "" +Specify an optional separator that will be inserted between the GEOM name +and partition name. +This variable is a +.Xr loader 8 +tunable. +Note that setting this variable may break software which assumes a particular +naming scheme. .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Fri Dec 13 09:19:24 2019 (r355704) +++ head/sys/geom/part/g_part.c Fri Dec 13 09:28:44 2019 (r355705) @@ -147,6 +147,10 @@ static u_int allow_nesting = 0; SYSCTL_UINT(_kern_geom_part, OID_AUTO, allow_nesting, CTLFLAG_RWTUN, &allow_nesting, 0, "Allow additional levels of nesting"); +char g_part_separator[MAXPATHLEN] = ""; +SYSCTL_STRING(_kern_geom_part, OID_AUTO, separator, + CTLFLAG_RDTUN, &g_part_separator, sizeof(g_part_separator), + "Partition name separator"); /* * The GEOM partitioning class. Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Fri Dec 13 09:19:24 2019 (r355704) +++ head/sys/geom/part/g_part.h Fri Dec 13 09:28:44 2019 (r355705) @@ -228,6 +228,8 @@ void g_part_geometry_heads(off_t, u_int, off_t *, u_in int g_part_modevent(module_t, int, struct g_part_scheme *); +extern char g_part_separator[]; + #define G_PART_SCHEME_DECLARE(name) \ static int name##_modevent(module_t mod, int tp, void *d) \ { \ Modified: head/sys/geom/part/g_part_if.m ============================================================================== --- head/sys/geom/part/g_part_if.m Fri Dec 13 09:19:24 2019 (r355704) +++ head/sys/geom/part/g_part_if.m Fri Dec 13 09:28:44 2019 (r355705) @@ -48,7 +48,7 @@ CODE { { char buf[32]; - sbuf_printf(sb, "%s%s", pfx, + sbuf_printf(sb, "%s%s%s", pfx, g_part_separator, G_PART_NAME(table, entry, buf, sizeof(buf))); } From owner-svn-src-all@freebsd.org Fri Dec 13 09:32:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29CED1C853B; Fri, 13 Dec 2019 09:32:00 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47Z5680LLxz3JdZ; Fri, 13 Dec 2019 09:32:00 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06FEFA269; Fri, 13 Dec 2019 09:32:00 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBD9Vxc5008582; Fri, 13 Dec 2019 09:31:59 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD9Vxfg008580; Fri, 13 Dec 2019 09:31:59 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912130931.xBD9Vxfg008580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Fri, 13 Dec 2019 09:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355706 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 09:32:00 -0000 Author: rlibby Date: Fri Dec 13 09:31:59 2019 New Revision: 355706 URL: https://svnweb.freebsd.org/changeset/base/355706 Log: uma dbg: flexible size for slab debug bitset too Recently (r355315) the size of the struct uma_slab bitset field us_free became dynamic instead of conservative. Now, make the debug bitset size dynamic too. The debug bitset is INVARIANTS-only, so in fact we don't care too much about the space savings that results from this, but enabling minimally-sized slabs on INVARIANTS builds is still important in order to be able to test new slab layouts effectively. Reviewed by: jeff, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22759 Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Dec 13 09:28:44 2019 (r355705) +++ head/sys/vm/uma_core.c Fri Dec 13 09:31:59 2019 (r355706) @@ -292,6 +292,8 @@ static int sysctl_handle_uma_zone_frees(SYSCTL_HANDLER static int sysctl_handle_uma_zone_flags(SYSCTL_HANDLER_ARGS); #ifdef INVARIANTS +static inline struct noslabbits *slab_dbg_bits(uma_slab_t slab, uma_keg_t keg); + static bool uma_dbg_kskip(uma_keg_t keg, void *mem); static bool uma_dbg_zskip(uma_zone_t zone, void *mem); static void uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *item); @@ -1201,7 +1203,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom slab->us_domain = domain; BIT_FILL(keg->uk_ipers, &slab->us_free); #ifdef INVARIANTS - BIT_ZERO(SLAB_MAX_SETSIZE, &slab->us_debugfree); + BIT_ZERO(keg->uk_ipers, slab_dbg_bits(slab, keg)); #endif if (keg->uk_init != NULL) { @@ -1484,6 +1486,15 @@ zero_init(void *mem, int size, int flags) return (0); } +#ifdef INVARIANTS +struct noslabbits * +slab_dbg_bits(uma_slab_t slab, uma_keg_t keg) +{ + + return ((void *)((char *)&slab->us_free + BITSET_SIZE(keg->uk_ipers))); +} +#endif + /* * Actual size of embedded struct slab (!OFFPAGE). */ @@ -1492,7 +1503,7 @@ slab_sizeof(int nitems) { size_t s; - s = sizeof(struct uma_slab) + BITSET_SIZE(nitems); + s = sizeof(struct uma_slab) + BITSET_SIZE(nitems) * SLAB_BITSETS; return (roundup(s, UMA_ALIGN_PTR + 1)); } @@ -4514,12 +4525,10 @@ uma_dbg_alloc(uma_zone_t zone, uma_slab_t slab, void * keg = zone->uz_keg; freei = slab_item_index(slab, keg, item); - if (BIT_ISSET(SLAB_MAX_SETSIZE, freei, &slab->us_debugfree)) + if (BIT_ISSET(keg->uk_ipers, freei, slab_dbg_bits(slab, keg))) panic("Duplicate alloc of %p from zone %p(%s) slab %p(%d)\n", item, zone, zone->uz_name, slab, freei); - BIT_SET_ATOMIC(SLAB_MAX_SETSIZE, freei, &slab->us_debugfree); - - return; + BIT_SET_ATOMIC(keg->uk_ipers, freei, slab_dbg_bits(slab, keg)); } /* @@ -4550,11 +4559,11 @@ uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *i panic("Unaligned free of %p from zone %p(%s) slab %p(%d)\n", item, zone, zone->uz_name, slab, freei); - if (!BIT_ISSET(SLAB_MAX_SETSIZE, freei, &slab->us_debugfree)) + if (!BIT_ISSET(keg->uk_ipers, freei, slab_dbg_bits(slab, keg))) panic("Duplicate free of %p from zone %p(%s) slab %p(%d)\n", item, zone, zone->uz_name, slab, freei); - BIT_CLR_ATOMIC(SLAB_MAX_SETSIZE, freei, &slab->us_debugfree); + BIT_CLR_ATOMIC(keg->uk_ipers, freei, slab_dbg_bits(slab, keg)); } #endif /* INVARIANTS */ Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Fri Dec 13 09:28:44 2019 (r355705) +++ head/sys/vm/uma_int.h Fri Dec 13 09:31:59 2019 (r355706) @@ -271,17 +271,26 @@ struct uma_slab { uint16_t us_freecount; /* How many are free? */ uint8_t us_flags; /* Page flags see uma.h */ uint8_t us_domain; /* Backing NUMA domain. */ -#ifdef INVARIANTS - struct slabbits us_debugfree; /* Debug bitmask. */ -#endif - struct noslabbits us_free; /* Free bitmask. */ + struct noslabbits us_free; /* Free bitmask, flexible. */ }; +_Static_assert(sizeof(struct uma_slab) == offsetof(struct uma_slab, us_free), + "us_free field must be last"); #if MAXMEMDOM >= 255 #error "Slab domain type insufficient" #endif typedef struct uma_slab * uma_slab_t; +/* + * On INVARIANTS builds, the slab contains a second bitset of the same size, + * "dbg_bits", which is laid out immediately after us_free. + */ +#ifdef INVARIANTS +#define SLAB_BITSETS 2 +#else +#define SLAB_BITSETS 1 +#endif + /* These three functions are for embedded (!OFFPAGE) use only. */ size_t slab_sizeof(int nitems); size_t slab_space(int nitems); @@ -293,7 +302,10 @@ int slab_ipers(size_t size, int align); */ struct uma_hash_slab { struct uma_slab uhs_slab; /* Must be first. */ - struct slabbits uhs_bits; /* Must be second. */ + struct slabbits uhs_bits1; /* Must be second. */ +#ifdef INVARIANTS + struct slabbits uhs_bits2; /* Must be third. */ +#endif LIST_ENTRY(uma_hash_slab) uhs_hlink; /* Link for hash table */ uint8_t *uhs_data; /* First item */ }; From owner-svn-src-all@freebsd.org Fri Dec 13 09:32:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 573971C8563; Fri, 13 Dec 2019 09:32:04 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47Z56D1j75z3JgN; Fri, 13 Dec 2019 09:32:04 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3529EA270; Fri, 13 Dec 2019 09:32:04 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBD9W4bK008639; Fri, 13 Dec 2019 09:32:04 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD9W48K008637; Fri, 13 Dec 2019 09:32:04 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912130932.xBD9W48K008637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Fri, 13 Dec 2019 09:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355707 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 09:32:04 -0000 Author: rlibby Date: Fri Dec 13 09:32:03 2019 New Revision: 355707 URL: https://svnweb.freebsd.org/changeset/base/355707 Log: uma: delay bucket_init() until we might actually enable buckets This helps with a bootstrapping problem in upcoming work. We don't first enable buckets until uma_startup2(), so we can delay bucket creation until then. The other two paths to bucket_enable() are both later, one in the pageout daemon (SI_SUB_KTHREAD_PAGE vs SI_SUB_VM) and one in uma_timeout() (first activated in uma_startup3()). Note that although some bucket functions are accessible before uma_startup2() (e.g. bucket_select() in zone_ctor()), none of them inspect ubz_zone. Discussed with: jeff Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22765 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Dec 13 09:31:59 2019 (r355706) +++ head/sys/vm/uma_core.c Fri Dec 13 09:32:03 2019 (r355707) @@ -335,6 +335,8 @@ SYSCTL_INT(_vm, OID_AUTO, zone_warnings, CTLFLAG_RWTUN static void bucket_enable(void) { + + KASSERT(booted >= BOOT_BUCKETS, ("Bucket enable before init")); bucketdisable = vm_page_count_min(); } @@ -2299,10 +2301,10 @@ zone_foreach(void (*zfunc)(uma_zone_t, void *arg), voi /* * Count how many pages do we need to bootstrap. VM supplies * its need in early zones in the argument, we add up our zones, - * which consist of: UMA Slabs, UMA Hash and 9 Bucket zones. The + * which consist of the UMA Slabs and UMA Hash zones. The * zone of zones and zone of kegs are accounted separately. */ -#define UMA_BOOT_ZONES 11 +#define UMA_BOOT_ZONES 2 /* Zone of zones and zone of kegs have arbitrary alignment. */ #define UMA_BOOT_ALIGN 32 static int zsize, ksize; @@ -2417,8 +2419,6 @@ uma_startup(void *mem, int npages) sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT, NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZFLAG_INTERNAL); - bucket_init(); - booted = BOOT_STRAPPED; } @@ -2439,8 +2439,9 @@ uma_startup2(void) #ifdef DIAGNOSTIC printf("Entering %s with %d boot pages left\n", __func__, boot_pages); #endif - booted = BOOT_BUCKETS; sx_init(&uma_reclaim_lock, "umareclaim"); + bucket_init(); + booted = BOOT_BUCKETS; bucket_enable(); } From owner-svn-src-all@freebsd.org Fri Dec 13 09:32:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05A951C85AC; Fri, 13 Dec 2019 09:32:10 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47Z56K6T74z3Jsk; Fri, 13 Dec 2019 09:32:09 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7DD2A27C; Fri, 13 Dec 2019 09:32:09 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBD9W9Yx009618; Fri, 13 Dec 2019 09:32:09 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD9W9Rl009617; Fri, 13 Dec 2019 09:32:09 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912130932.xBD9W9Rl009617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Fri, 13 Dec 2019 09:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355708 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 09:32:10 -0000 Author: rlibby Date: Fri Dec 13 09:32:09 2019 New Revision: 355708 URL: https://svnweb.freebsd.org/changeset/base/355708 Log: uma: report slab efficiency Reviewed by: jeff Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22766 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Dec 13 09:32:03 2019 (r355707) +++ head/sys/vm/uma_core.c Fri Dec 13 09:32:09 2019 (r355708) @@ -290,6 +290,7 @@ static int sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS); static int sysctl_handle_uma_zone_allocs(SYSCTL_HANDLER_ARGS); static int sysctl_handle_uma_zone_frees(SYSCTL_HANDLER_ARGS); static int sysctl_handle_uma_zone_flags(SYSCTL_HANDLER_ARGS); +static int sysctl_handle_uma_slab_efficiency(SYSCTL_HANDLER_ARGS); #ifdef INVARIANTS static inline struct noslabbits *slab_dbg_bits(uma_slab_t slab, uma_keg_t keg); @@ -1948,6 +1949,10 @@ zone_alloc_sysctl(uma_zone_t zone, void *unused) SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "free", CTLFLAG_RD, &keg->uk_free, 0, "items free in the slab layer"); + SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "efficiency", CTLFLAG_RD | CTLTYPE_INT | CTLFLAG_MPSAFE, + keg, 0, sysctl_handle_uma_slab_efficiency, "I", + "Slab utilization (100 - internal fragmentation %)"); } else SYSCTL_ADD_CONST_STRING(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "name", CTLFLAG_RD, nokeg, "Keg name"); @@ -4438,6 +4443,27 @@ sysctl_handle_uma_zone_flags(SYSCTL_HANDLER_ARGS) sbuf_delete(&sbuf); return (error); +} + +static int +sysctl_handle_uma_slab_efficiency(SYSCTL_HANDLER_ARGS) +{ + uma_keg_t keg = arg1; + int avail, effpct, total; + + total = keg->uk_ppera * PAGE_SIZE; + if ((keg->uk_flags & UMA_ZONE_OFFPAGE) != 0) + total += slab_sizeof(SLAB_MAX_SETSIZE); + /* + * We consider the client's requested size and alignment here, not the + * real size determination uk_rsize, because we also adjust the real + * size for internal implementation reasons (max bitset size). + */ + avail = keg->uk_ipers * roundup2(keg->uk_size, keg->uk_align + 1); + if ((keg->uk_flags & UMA_ZONE_PCPU) != 0) + avail *= mp_maxid + 1; + effpct = 100 * avail / total; + return (sysctl_handle_int(oidp, &effpct, 0, req)); } #ifdef INVARIANTS From owner-svn-src-all@freebsd.org Fri Dec 13 09:32:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96E141C864E; Fri, 13 Dec 2019 09:32:19 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47Z56W3Yp4z3K2C; Fri, 13 Dec 2019 09:32:19 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 736C8A28E; Fri, 13 Dec 2019 09:32:19 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBD9WJXr010391; Fri, 13 Dec 2019 09:32:19 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD9WGsC010377; Fri, 13 Dec 2019 09:32:16 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912130932.xBD9WGsC010377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Fri, 13 Dec 2019 09:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355709 - in head: share/man/man9 sys/i386/i386 sys/kern sys/sparc64/sparc64 sys/sys sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: in head: share/man/man9 sys/i386/i386 sys/kern sys/sparc64/sparc64 sys/sys sys/x86/x86 X-SVN-Commit-Revision: 355709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 09:32:19 -0000 Author: rlibby Date: Fri Dec 13 09:32:16 2019 New Revision: 355709 URL: https://svnweb.freebsd.org/changeset/base/355709 Log: bitset: rename confusing macro NAND to ANDNOT s/BIT_NAND/BIT_ANDNOT/, and for CPU and DOMAINSET too. The actual implementation is "and not" (or "but not"), i.e. A but not B. Fortunately this does appear to be what all existing callers want. Don't supply a NAND (not (A and B)) operation at this time. Discussed with: jeff Reviewed by: cem Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22791 Modified: head/share/man/man9/Makefile head/share/man/man9/bitset.9 head/share/man/man9/cpuset.9 head/sys/i386/i386/vm_machdep.c head/sys/kern/kern_cpuset.c head/sys/kern/kern_rmlock.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/kern/subr_kdb.c head/sys/sparc64/sparc64/mp_machdep.c head/sys/sys/bitset.h head/sys/sys/cpuset.h head/sys/sys/domainset.h head/sys/x86/x86/cpu_machdep.c Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Dec 13 09:32:09 2019 (r355708) +++ head/share/man/man9/Makefile Fri Dec 13 09:32:16 2019 (r355709) @@ -607,7 +607,7 @@ MLINKS+=bitset.9 BITSET_DEFINE.9 \ bitset.9 BIT_CMP.9 \ bitset.9 BIT_OR.9 \ bitset.9 BIT_AND.9 \ - bitset.9 BIT_NAND.9 \ + bitset.9 BIT_ANDNOT.9 \ bitset.9 BIT_CLR_ATOMIC.9 \ bitset.9 BIT_SET_ATOMIC.9 \ bitset.9 BIT_SET_ATOMIC_ACQ.9 \ @@ -856,7 +856,7 @@ MLINKS+=cpuset.9 CPUSET_T_INITIALIZER.9 \ cpuset.9 CPU_CMP.9 \ cpuset.9 CPU_OR.9 \ cpuset.9 CPU_AND.9 \ - cpuset.9 CPU_NAND.9 \ + cpuset.9 CPU_ANDNOT.9 \ cpuset.9 CPU_CLR_ATOMIC.9 \ cpuset.9 CPU_SET_ATOMIC.9 \ cpuset.9 CPU_SET_ATOMIC_ACQ.9 \ Modified: head/share/man/man9/bitset.9 ============================================================================== --- head/share/man/man9/bitset.9 Fri Dec 13 09:32:09 2019 (r355708) +++ head/share/man/man9/bitset.9 Fri Dec 13 09:32:16 2019 (r355709) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 7, 2017 +.Dd December 12, 2019 .Dt BITSET 9 .Os .Sh NAME @@ -52,8 +52,8 @@ .Nm BIT_OR2 , .Nm BIT_AND , .Nm BIT_AND2 , -.Nm BIT_NAND , -.Nm BIT_NAND2 , +.Nm BIT_ANDNOT , +.Nm BIT_ANDNOT2 , .Nm BIT_XOR , .Nm BIT_XOR2 , .Nm BIT_CLR_ATOMIC , @@ -116,8 +116,8 @@ .Fa "struct STRUCTNAME *src1" .Fa "struct STRUCTNAME *src2" .Fc -.Fn BIT_NAND "const SETSIZE" "struct STRUCTNAME *dst" "struct STRUCTNAME *src" -.Fo BIT_NAND2 +.Fn BIT_ANDNOT "const SETSIZE" "struct STRUCTNAME *dst" "struct STRUCTNAME *src" +.Fo BIT_ANDNOT2 .Fa "const SETSIZE" .Fa "struct STRUCTNAME *dst" .Fa "struct STRUCTNAME *src1" @@ -412,7 +412,7 @@ equivalent of the scalar: .Fa src2 . ) .Pp The -.Fn BIT_NAND +.Fn BIT_ANDNOT macro clears bits set in .Fa src from @@ -425,7 +425,7 @@ equivalent of the scalar: .Fa ~ src . ) .Pp The -.Fn BIT_NAND2 +.Fn BIT_ANDNOT2 macro computes .Fa src1 bitwise and not Modified: head/share/man/man9/cpuset.9 ============================================================================== --- head/share/man/man9/cpuset.9 Fri Dec 13 09:32:09 2019 (r355708) +++ head/share/man/man9/cpuset.9 Fri Dec 13 09:32:16 2019 (r355709) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 29, 2016 +.Dd December 12, 2019 .Dt CPUSET 9 .Os .Sh NAME @@ -48,7 +48,7 @@ .Nm CPU_CMP , .Nm CPU_OR , .Nm CPU_AND , -.Nm CPU_NAND , +.Nm CPU_ANDNOT , .Nm CPU_CLR_ATOMIC , .Nm CPU_SET_ATOMIC , .Nm CPU_SET_ATOMIC_ACQ , @@ -88,7 +88,7 @@ .Fn CPU_CMP "cpuset_t *cpuset1" "cpuset_t *cpuset2" .Fn CPU_OR "cpuset_t *dst" "cpuset_t *src" .Fn CPU_AND "cpuset_t *dst" "cpuset_t *src" -.Fn CPU_NAND "cpuset_t *dst" "cpuset_t *src" +.Fn CPU_ANDNOT "cpuset_t *dst" "cpuset_t *src" .\" .Fn CPU_CLR_ATOMIC "size_t cpu_idx" "cpuset_t *cpuset" .Fn CPU_SET_ATOMIC "size_t cpu_idx" "cpuset_t *cpuset" @@ -303,7 +303,7 @@ is similar, with the same atomic semantics as .Fn CPU_OR_ATOMIC . .Pp The -.Fn CPU_NAND +.Fn CPU_ANDNOT macro removes CPUs in .Fa src from Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Fri Dec 13 09:32:09 2019 (r355708) +++ head/sys/i386/i386/vm_machdep.c Fri Dec 13 09:32:16 2019 (r355709) @@ -598,7 +598,7 @@ sf_buf_shootdown(struct sf_buf *sf, int flags) if ((flags & SFB_CPUPRIVATE) == 0) { other_cpus = all_cpus; CPU_CLR(cpuid, &other_cpus); - CPU_NAND(&other_cpus, &sf->cpumask); + CPU_ANDNOT(&other_cpus, &sf->cpumask); if (!CPU_EMPTY(&other_cpus)) { CPU_OR(&sf->cpumask, &other_cpus); smp_masked_invlpg(other_cpus, sf->kva, kernel_pmap); Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Fri Dec 13 09:32:09 2019 (r355708) +++ head/sys/kern/kern_cpuset.c Fri Dec 13 09:32:16 2019 (r355709) @@ -510,7 +510,7 @@ domainset_empty_vm(struct domainset *domain) return (true); /* Remove empty domains from the set and recompute. */ - DOMAINSET_NAND(&domain->ds_mask, &empty); + DOMAINSET_ANDNOT(&domain->ds_mask, &empty); domain->ds_cnt = DOMAINSET_COUNT(&domain->ds_mask); for (i = j = 0; i < DOMAINSET_FLS(&domain->ds_mask); i++) if (DOMAINSET_ISSET(i, &domain->ds_mask)) Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Fri Dec 13 09:32:09 2019 (r355708) +++ head/sys/kern/kern_rmlock.c Fri Dec 13 09:32:16 2019 (r355709) @@ -542,7 +542,7 @@ _rm_wlock(struct rmlock *rm) if (CPU_CMP(&rm->rm_writecpus, &all_cpus)) { /* Get all read tokens back */ readcpus = all_cpus; - CPU_NAND(&readcpus, &rm->rm_writecpus); + CPU_ANDNOT(&readcpus, &rm->rm_writecpus); rm->rm_writecpus = all_cpus; /* Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Fri Dec 13 09:32:09 2019 (r355708) +++ head/sys/kern/sched_4bsd.c Fri Dec 13 09:32:16 2019 (r355709) @@ -1181,7 +1181,7 @@ forward_wakeup(int cpunum) if (forward_wakeup_use_mask) { map = idle_cpus_mask; - CPU_NAND(&map, &dontuse); + CPU_ANDNOT(&map, &dontuse); /* If they are both on, compare and use loop if different. */ if (forward_wakeup_use_loop) { @@ -1366,7 +1366,7 @@ sched_add(struct thread *td, int flags) } else { if (!single_cpu) { tidlemsk = idle_cpus_mask; - CPU_NAND(&tidlemsk, &hlt_cpus_mask); + CPU_ANDNOT(&tidlemsk, &hlt_cpus_mask); CPU_CLR(cpuid, &tidlemsk); if (!CPU_ISSET(cpuid, &idle_cpus_mask) && Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Fri Dec 13 09:32:09 2019 (r355708) +++ head/sys/kern/sched_ule.c Fri Dec 13 09:32:16 2019 (r355709) @@ -705,7 +705,7 @@ cpu_search(const struct cpu_group *cg, struct cpu_sear if (match & CPU_SEARCH_HIGHEST) hgroup.cs_cpu = -1; if (child) { /* Handle child CPU group. */ - CPU_NAND(&cpumask, &child->cg_mask); + CPU_ANDNOT(&cpumask, &child->cg_mask); switch (match) { case CPU_SEARCH_LOWEST: load = cpu_search_lowest(child, &lgroup); Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Fri Dec 13 09:32:09 2019 (r355708) +++ head/sys/kern/subr_kdb.c Fri Dec 13 09:32:16 2019 (r355709) @@ -666,7 +666,7 @@ kdb_trap(int type, int code, struct trapframe *tf) if (!SCHEDULER_STOPPED()) { #ifdef SMP other_cpus = all_cpus; - CPU_NAND(&other_cpus, &stopped_cpus); + CPU_ANDNOT(&other_cpus, &stopped_cpus); CPU_CLR(PCPU_GET(cpuid), &other_cpus); stop_cpus_hard(other_cpus); #endif Modified: head/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/mp_machdep.c Fri Dec 13 09:32:09 2019 (r355708) +++ head/sys/sparc64/sparc64/mp_machdep.c Fri Dec 13 09:32:16 2019 (r355709) @@ -493,7 +493,7 @@ cpu_mp_shutdown(void) if (CPU_CMP(&stopped_cpus, &cpus)) { /* cpus is just a flat "on" mask without curcpu. */ - CPU_NAND(&cpus, &stopped_cpus); + CPU_ANDNOT(&cpus, &stopped_cpus); stop_cpus(cpus); } i = 0; Modified: head/sys/sys/bitset.h ============================================================================== --- head/sys/sys/bitset.h Fri Dec 13 09:32:09 2019 (r355708) +++ head/sys/sys/bitset.h Fri Dec 13 09:32:16 2019 (r355709) @@ -149,13 +149,13 @@ (d)->__bits[__i] = (s1)->__bits[__i] & (s2)->__bits[__i];\ } while (0) -#define BIT_NAND(_s, d, s) do { \ +#define BIT_ANDNOT(_s, d, s) do { \ __size_t __i; \ for (__i = 0; __i < __bitset_words((_s)); __i++) \ (d)->__bits[__i] &= ~(s)->__bits[__i]; \ } while (0) -#define BIT_NAND2(_s, d, s1, s2) do { \ +#define BIT_ANDNOT2(_s, d, s1, s2) do { \ __size_t __i; \ for (__i = 0; __i < __bitset_words((_s)); __i++) \ (d)->__bits[__i] = (s1)->__bits[__i] & ~(s2)->__bits[__i];\ Modified: head/sys/sys/cpuset.h ============================================================================== --- head/sys/sys/cpuset.h Fri Dec 13 09:32:09 2019 (r355708) +++ head/sys/sys/cpuset.h Fri Dec 13 09:32:16 2019 (r355709) @@ -57,7 +57,7 @@ #define CPU_CMP(p, c) BIT_CMP(CPU_SETSIZE, p, c) #define CPU_OR(d, s) BIT_OR(CPU_SETSIZE, d, s) #define CPU_AND(d, s) BIT_AND(CPU_SETSIZE, d, s) -#define CPU_NAND(d, s) BIT_NAND(CPU_SETSIZE, d, s) +#define CPU_ANDNOT(d, s) BIT_ANDNOT(CPU_SETSIZE, d, s) #define CPU_CLR_ATOMIC(n, p) BIT_CLR_ATOMIC(CPU_SETSIZE, n, p) #define CPU_SET_ATOMIC(n, p) BIT_SET_ATOMIC(CPU_SETSIZE, n, p) #define CPU_SET_ATOMIC_ACQ(n, p) BIT_SET_ATOMIC_ACQ(CPU_SETSIZE, n, p) Modified: head/sys/sys/domainset.h ============================================================================== --- head/sys/sys/domainset.h Fri Dec 13 09:32:09 2019 (r355708) +++ head/sys/sys/domainset.h Fri Dec 13 09:32:16 2019 (r355709) @@ -58,7 +58,7 @@ #define DOMAINSET_CMP(p, c) BIT_CMP(DOMAINSET_SETSIZE, p, c) #define DOMAINSET_OR(d, s) BIT_OR(DOMAINSET_SETSIZE, d, s) #define DOMAINSET_AND(d, s) BIT_AND(DOMAINSET_SETSIZE, d, s) -#define DOMAINSET_NAND(d, s) BIT_NAND(DOMAINSET_SETSIZE, d, s) +#define DOMAINSET_ANDNOT(d, s) BIT_ANDNOT(DOMAINSET_SETSIZE, d, s) #define DOMAINSET_CLR_ATOMIC(n, p) BIT_CLR_ATOMIC(DOMAINSET_SETSIZE, n, p) #define DOMAINSET_SET_ATOMIC(n, p) BIT_SET_ATOMIC(DOMAINSET_SETSIZE, n, p) #define DOMAINSET_SET_ATOMIC_ACQ(n, p) \ Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Fri Dec 13 09:32:09 2019 (r355708) +++ head/sys/x86/x86/cpu_machdep.c Fri Dec 13 09:32:16 2019 (r355709) @@ -447,7 +447,7 @@ cpu_reset(void) if (smp_started) { map = all_cpus; CPU_CLR(PCPU_GET(cpuid), &map); - CPU_NAND(&map, &stopped_cpus); + CPU_ANDNOT(&map, &stopped_cpus); if (!CPU_EMPTY(&map)) { printf("cpu_reset: Stopping other CPUs\n"); stop_cpus(map); From owner-svn-src-all@freebsd.org Fri Dec 13 10:34:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40B7F1C9AE3; Fri, 13 Dec 2019 10:34:20 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47Z6V412Sxz3N5h; Fri, 13 Dec 2019 10:34:20 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EE54AD59; Fri, 13 Dec 2019 10:34:20 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDAYKTo049484; Fri, 13 Dec 2019 10:34:20 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDAYJMI049483; Fri, 13 Dec 2019 10:34:19 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912131034.xBDAYJMI049483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Fri, 13 Dec 2019 10:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355710 - head/lib/libmemstat X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/lib/libmemstat X-SVN-Commit-Revision: 355710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 10:34:20 -0000 Author: rlibby Date: Fri Dec 13 10:34:19 2019 New Revision: 355710 URL: https://svnweb.freebsd.org/changeset/base/355710 Log: libmemstat: unbreak build r355706 added an instance of offsetof() to the UMA private kernel header file uma_int.h. Userspace memstat_uma.c includes that header, and chokes on offsetof() because apparently the definition in sys/types.h is ifdef _KERNEL. Now, include sys/stddef.h which has an identical definition. Pointyhat to: rlibby Sponsored by: Dell EMC Isilon Modified: head/lib/libmemstat/memstat_uma.c Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Fri Dec 13 09:32:16 2019 (r355709) +++ head/lib/libmemstat/memstat_uma.c Fri Dec 13 10:34:19 2019 (r355710) @@ -31,6 +31,7 @@ #include #include #include +#include #include #include From owner-svn-src-all@freebsd.org Fri Dec 13 11:21:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B08311CABBE; Fri, 13 Dec 2019 11:21:29 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47Z7XT4Kzvz3Q3H; Fri, 13 Dec 2019 11:21:29 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FFC1B5D4; Fri, 13 Dec 2019 11:21:29 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDBLTt4074933; Fri, 13 Dec 2019 11:21:29 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDBLTTZ074931; Fri, 13 Dec 2019 11:21:29 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912131121.xBDBLTTZ074931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Fri, 13 Dec 2019 11:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355711 - in head: lib/libmemstat sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: in head: lib/libmemstat sys/vm X-SVN-Commit-Revision: 355711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 11:21:29 -0000 Author: rlibby Date: Fri Dec 13 11:21:28 2019 New Revision: 355711 URL: https://svnweb.freebsd.org/changeset/base/355711 Log: Revert r355706 & r355710 The quick fix didn't work. I'll sort it out tomorrow. Revert r355710: "libmemstat: unbreak build" Revert r355706: "uma dbg: flexible size for slab debug bitset too" Modified: head/lib/libmemstat/memstat_uma.c head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Fri Dec 13 10:34:19 2019 (r355710) +++ head/lib/libmemstat/memstat_uma.c Fri Dec 13 11:21:28 2019 (r355711) @@ -31,7 +31,6 @@ #include #include #include -#include #include #include Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Dec 13 10:34:19 2019 (r355710) +++ head/sys/vm/uma_core.c Fri Dec 13 11:21:28 2019 (r355711) @@ -293,8 +293,6 @@ static int sysctl_handle_uma_zone_flags(SYSCTL_HANDLER static int sysctl_handle_uma_slab_efficiency(SYSCTL_HANDLER_ARGS); #ifdef INVARIANTS -static inline struct noslabbits *slab_dbg_bits(uma_slab_t slab, uma_keg_t keg); - static bool uma_dbg_kskip(uma_keg_t keg, void *mem); static bool uma_dbg_zskip(uma_zone_t zone, void *mem); static void uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *item); @@ -1206,7 +1204,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom slab->us_domain = domain; BIT_FILL(keg->uk_ipers, &slab->us_free); #ifdef INVARIANTS - BIT_ZERO(keg->uk_ipers, slab_dbg_bits(slab, keg)); + BIT_ZERO(SLAB_MAX_SETSIZE, &slab->us_debugfree); #endif if (keg->uk_init != NULL) { @@ -1489,15 +1487,6 @@ zero_init(void *mem, int size, int flags) return (0); } -#ifdef INVARIANTS -struct noslabbits * -slab_dbg_bits(uma_slab_t slab, uma_keg_t keg) -{ - - return ((void *)((char *)&slab->us_free + BITSET_SIZE(keg->uk_ipers))); -} -#endif - /* * Actual size of embedded struct slab (!OFFPAGE). */ @@ -1506,7 +1495,7 @@ slab_sizeof(int nitems) { size_t s; - s = sizeof(struct uma_slab) + BITSET_SIZE(nitems) * SLAB_BITSETS; + s = sizeof(struct uma_slab) + BITSET_SIZE(nitems); return (roundup(s, UMA_ALIGN_PTR + 1)); } @@ -4552,10 +4541,12 @@ uma_dbg_alloc(uma_zone_t zone, uma_slab_t slab, void * keg = zone->uz_keg; freei = slab_item_index(slab, keg, item); - if (BIT_ISSET(keg->uk_ipers, freei, slab_dbg_bits(slab, keg))) + if (BIT_ISSET(SLAB_MAX_SETSIZE, freei, &slab->us_debugfree)) panic("Duplicate alloc of %p from zone %p(%s) slab %p(%d)\n", item, zone, zone->uz_name, slab, freei); - BIT_SET_ATOMIC(keg->uk_ipers, freei, slab_dbg_bits(slab, keg)); + BIT_SET_ATOMIC(SLAB_MAX_SETSIZE, freei, &slab->us_debugfree); + + return; } /* @@ -4586,11 +4577,11 @@ uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *i panic("Unaligned free of %p from zone %p(%s) slab %p(%d)\n", item, zone, zone->uz_name, slab, freei); - if (!BIT_ISSET(keg->uk_ipers, freei, slab_dbg_bits(slab, keg))) + if (!BIT_ISSET(SLAB_MAX_SETSIZE, freei, &slab->us_debugfree)) panic("Duplicate free of %p from zone %p(%s) slab %p(%d)\n", item, zone, zone->uz_name, slab, freei); - BIT_CLR_ATOMIC(keg->uk_ipers, freei, slab_dbg_bits(slab, keg)); + BIT_CLR_ATOMIC(SLAB_MAX_SETSIZE, freei, &slab->us_debugfree); } #endif /* INVARIANTS */ Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Fri Dec 13 10:34:19 2019 (r355710) +++ head/sys/vm/uma_int.h Fri Dec 13 11:21:28 2019 (r355711) @@ -271,26 +271,17 @@ struct uma_slab { uint16_t us_freecount; /* How many are free? */ uint8_t us_flags; /* Page flags see uma.h */ uint8_t us_domain; /* Backing NUMA domain. */ - struct noslabbits us_free; /* Free bitmask, flexible. */ +#ifdef INVARIANTS + struct slabbits us_debugfree; /* Debug bitmask. */ +#endif + struct noslabbits us_free; /* Free bitmask. */ }; -_Static_assert(sizeof(struct uma_slab) == offsetof(struct uma_slab, us_free), - "us_free field must be last"); #if MAXMEMDOM >= 255 #error "Slab domain type insufficient" #endif typedef struct uma_slab * uma_slab_t; -/* - * On INVARIANTS builds, the slab contains a second bitset of the same size, - * "dbg_bits", which is laid out immediately after us_free. - */ -#ifdef INVARIANTS -#define SLAB_BITSETS 2 -#else -#define SLAB_BITSETS 1 -#endif - /* These three functions are for embedded (!OFFPAGE) use only. */ size_t slab_sizeof(int nitems); size_t slab_space(int nitems); @@ -302,10 +293,7 @@ int slab_ipers(size_t size, int align); */ struct uma_hash_slab { struct uma_slab uhs_slab; /* Must be first. */ - struct slabbits uhs_bits1; /* Must be second. */ -#ifdef INVARIANTS - struct slabbits uhs_bits2; /* Must be third. */ -#endif + struct slabbits uhs_bits; /* Must be second. */ LIST_ENTRY(uma_hash_slab) uhs_hlink; /* Link for hash table */ uint8_t *uhs_data; /* First item */ }; From owner-svn-src-all@freebsd.org Fri Dec 13 11:47:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 942CE1CB340; Fri, 13 Dec 2019 11:47:59 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47Z8733S4Fz3RCs; Fri, 13 Dec 2019 11:47:59 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CB60B9A9; Fri, 13 Dec 2019 11:47:59 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDBlxut090957; Fri, 13 Dec 2019 11:47:59 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDBlxef090956; Fri, 13 Dec 2019 11:47:59 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201912131147.xBDBlxef090956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 13 Dec 2019 11:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355712 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 355712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 11:47:59 -0000 Author: ae Date: Fri Dec 13 11:47:58 2019 New Revision: 355712 URL: https://svnweb.freebsd.org/changeset/base/355712 Log: Make TCP options parsing stricter. Rework tcpopts_parse() to be more strict. Use const pointer. Add length checks for specific TCP options. The main purpose of the change is avoiding of possible out of mbuf's data access. Reported by: Maxime Villard Reviewed by: melifaro, emaste MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Fri Dec 13 11:21:28 2019 (r355711) +++ head/sys/netpfil/ipfw/ip_fw2.c Fri Dec 13 11:47:58 2019 (r355712) @@ -330,22 +330,27 @@ ipopts_match(struct ip *ip, ipfw_insn *cmd) return (flags_match(cmd, bits)); } +/* + * Parse TCP options. The logic copied from tcp_dooptions(). + */ static int -tcpopts_parse(struct tcphdr *tcp, uint16_t *mss) +tcpopts_parse(const struct tcphdr *tcp, uint16_t *mss) { - u_char *cp = (u_char *)(tcp + 1); + const u_char *cp = (const u_char *)(tcp + 1); int optlen, bits = 0; - int x = (tcp->th_off << 2) - sizeof(struct tcphdr); + int cnt = (tcp->th_off << 2) - sizeof(struct tcphdr); - for (; x > 0; x -= optlen, cp += optlen) { + for (; cnt > 0; cnt -= optlen, cp += optlen) { int opt = cp[0]; if (opt == TCPOPT_EOL) break; if (opt == TCPOPT_NOP) optlen = 1; else { + if (cnt < 2) + break; optlen = cp[1]; - if (optlen <= 0) + if (optlen < 2 || optlen > cnt) break; } @@ -354,22 +359,31 @@ tcpopts_parse(struct tcphdr *tcp, uint16_t *mss) break; case TCPOPT_MAXSEG: + if (optlen != TCPOLEN_MAXSEG) + break; bits |= IP_FW_TCPOPT_MSS; if (mss != NULL) *mss = be16dec(cp + 2); break; case TCPOPT_WINDOW: - bits |= IP_FW_TCPOPT_WINDOW; + if (optlen == TCPOLEN_WINDOW) + bits |= IP_FW_TCPOPT_WINDOW; break; case TCPOPT_SACK_PERMITTED: + if (optlen == TCPOLEN_SACK_PERMITTED) + bits |= IP_FW_TCPOPT_SACK; + break; + case TCPOPT_SACK: - bits |= IP_FW_TCPOPT_SACK; + if (optlen > 2 && (optlen - 2) % TCPOLEN_SACK == 0) + bits |= IP_FW_TCPOPT_SACK; break; case TCPOPT_TIMESTAMP: - bits |= IP_FW_TCPOPT_TS; + if (optlen == TCPOLEN_TIMESTAMP) + bits |= IP_FW_TCPOPT_TS; break; } } From owner-svn-src-all@freebsd.org Fri Dec 13 12:36:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4D321CCF65; Fri, 13 Dec 2019 12:36:17 +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 47Z9Bn4GsLz40CF; Fri, 13 Dec 2019 12:36:17 +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 8D5BDC444; Fri, 13 Dec 2019 12:36:17 +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 xBDCaH7O021078; Fri, 13 Dec 2019 12:36:17 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDCaHSh021076; Fri, 13 Dec 2019 12:36:17 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201912131236.xBDCaHSh021076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 13 Dec 2019 12:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355713 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 355713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 12:36:17 -0000 Author: tsoome Date: Fri Dec 13 12:36:16 2019 New Revision: 355713 URL: https://svnweb.freebsd.org/changeset/base/355713 Log: loader: cd9660_open() warn: is 'buf' large enough for 'struct iso_primary_descriptor'? We do allocate amount of memory (void * or char *), and then assign this buffer to struct iso_primary_descriptor *vd. Make sure we do allocate enough bytes. In fact we do allocate enough, but it is good idea to make sure this really is so. MFC after: 1 week Modified: head/stand/libsa/cd9660.c head/stand/libsa/cd9660read.c Modified: head/stand/libsa/cd9660.c ============================================================================== --- head/stand/libsa/cd9660.c Fri Dec 13 11:47:58 2019 (r355712) +++ head/stand/libsa/cd9660.c Fri Dec 13 12:36:16 2019 (r355713) @@ -286,7 +286,7 @@ cd9660_open(const char *path, struct open_file *f) struct file *fp = NULL; void *buf; struct iso_primary_descriptor *vd; - size_t buf_size, read, dsize, off; + size_t read, dsize, off; daddr_t bno, boff; struct iso_directory_record rec; struct iso_directory_record *dp = NULL; @@ -294,7 +294,8 @@ cd9660_open(const char *path, struct open_file *f) bool isdir = false; /* First find the volume descriptor */ - buf = malloc(buf_size = ISO_DEFAULT_BLOCK_SIZE); + buf = malloc(MAX(ISO_DEFAULT_BLOCK_SIZE, + sizeof(struct iso_primary_descriptor))); vd = buf; for (bno = 16;; bno++) { twiddle(1); @@ -438,8 +439,7 @@ cd9660_open(const char *path, struct open_file *f) return 0; out: - if (fp) - free(fp); + free(fp); free(buf); return rc; Modified: head/stand/libsa/cd9660read.c ============================================================================== --- head/stand/libsa/cd9660read.c Fri Dec 13 11:47:58 2019 (r355712) +++ head/stand/libsa/cd9660read.c Fri Dec 13 12:36:16 2019 (r355713) @@ -35,6 +35,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include @@ -220,7 +221,8 @@ dirmatch(const char *path, struct iso_directory_record static uint64_t cd9660_lookup(const char *path) { - static char blkbuf[ISO_DEFAULT_BLOCK_SIZE]; + static char blkbuf[MAX(ISO_DEFAULT_BLOCK_SIZE, + sizeof(struct iso_primary_descriptor))]; struct iso_primary_descriptor *vd; struct iso_directory_record rec; struct iso_directory_record *dp = NULL; From owner-svn-src-all@freebsd.org Fri Dec 13 13:42:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45D6D1CE20C; Fri, 13 Dec 2019 13:42:50 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::107]) (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 47ZBgX5tcvz42pm; Fri, 13 Dec 2019 13:42:48 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward100q.mail.yandex.net (forward100q.mail.yandex.net [IPv6:2a02:6b8:c0e:4b:0:640:4012:bb97]) by forward104j.mail.yandex.net (Yandex) with ESMTP id D2D784A1C51; Fri, 13 Dec 2019 16:42:44 +0300 (MSK) Received: from mxback5q.mail.yandex.net (mxback5q.mail.yandex.net [IPv6:2a02:6b8:c0e:1ba:0:640:b716:ad89]) by forward100q.mail.yandex.net (Yandex) with ESMTP id CC3DB7080012; Fri, 13 Dec 2019 16:42:44 +0300 (MSK) Received: from vla3-3dd1bd6927b2.qloud-c.yandex.net (vla3-3dd1bd6927b2.qloud-c.yandex.net [2a02:6b8:c15:350f:0:640:3dd1:bd69]) by mxback5q.mail.yandex.net (mxback/Yandex) with ESMTP id fyJb3WJCoO-gi3Ctcb0; Fri, 13 Dec 2019 16:42:44 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1576244564; bh=CC1XO07A2GfGAvabZpVKBxkQjT6xu+sCQDfB4MrcHlk=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID; b=iW4+R0Dkpb0D7LROrAz7o+oIBifjH9SbV8lrRM2VC8TDvTfza1gKGJCmk5sH/zUkf rin8HS9IuLRUqE8D13pptir5uT3WSSCN0NYh8NnZd6D3ZDXYcmnb7hDpRkTasrEk23 tlsGDhJA1tOk0JyrF/kS9loBMzwAlNTraCFZx/s4= Received: by vla3-3dd1bd6927b2.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id vwC3U2imsv-giTCxYol; Fri, 13 Dec 2019 16:42:44 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: svn commit: r341578 - head/sys/dev/mlx5/mlx5_en To: Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051420.wB5EKwxr099242@repo.freebsd.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <8715aa7b-ceea-7cfd-1980-a260c98070d5@yandex.ru> Date: Fri, 13 Dec 2019 16:40:18 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201812051420.wB5EKwxr099242@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aPxaqOZB3SNeaTjQKF3zntGIWz5lgO4Fe" X-Rspamd-Queue-Id: 47ZBgX5tcvz42pm X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yandex.ru header.s=mail header.b=iW4+R0Dk; dmarc=pass (policy=none) header.from=yandex.ru; spf=pass (mx1.freebsd.org: domain of bu7cher@yandex.ru designates 2a02:6b8:0:801:2::107 as permitted sender) smtp.mailfrom=bu7cher@yandex.ru X-Spamd-Result: default: False [-6.20 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yandex.ru]; R_SPF_ALLOW(-0.20)[+ip6:2a02:6b8:0::/52]; HAS_ATTACHMENT(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[yandex.ru:+]; DMARC_POLICY_ALLOW(-0.50)[yandex.ru,none]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[7.0.1.0.0.0.0.0.0.0.0.0.2.0.0.0.1.0.8.0.0.0.0.0.8.b.6.0.2.0.a.2.list.dnswl.org : 127.0.5.1]; ASN(0.00)[asn:13238, ipnet:2a02:6b8::/32, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[yandex.ru:s=mail]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; IP_SCORE(0.00)[ip: (-9.54), ipnet: 2a02:6b8::/32(-4.69), asn: 13238(-3.78), country: RU(0.01)]; FREEMAIL_ENVFROM(0.00)[yandex.ru]; IP_SCORE_FREEMAIL(0.00)[]; DWL_DNSWL_LOW(-1.00)[yandex.ru.dwl.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 13:42:50 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --aPxaqOZB3SNeaTjQKF3zntGIWz5lgO4Fe Content-Type: multipart/mixed; boundary="VgKBZ0OukvbzPkbEoBthS8hljSpYqUiQ8"; protected-headers="v1" From: "Andrey V. Elsukov" To: Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <8715aa7b-ceea-7cfd-1980-a260c98070d5@yandex.ru> Subject: Re: svn commit: r341578 - head/sys/dev/mlx5/mlx5_en References: <201812051420.wB5EKwxr099242@repo.freebsd.org> In-Reply-To: <201812051420.wB5EKwxr099242@repo.freebsd.org> --VgKBZ0OukvbzPkbEoBthS8hljSpYqUiQ8 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 05.12.2018 17:20, Slava Shwartsman wrote: > Author: slavash > Date: Wed Dec 5 14:20:57 2018 > New Revision: 341578 > URL: https://svnweb.freebsd.org/changeset/base/341578 >=20 > Log: > mlx5en: Remove the DRBR and associated logic in the transmit path. > =20 > The hardware queues are deep enough currently and using the DRBR and = associated > callbacks only leads to more task switching in the TX path. The is al= so a race > setting the queue_state which can lead to hung TX rings. JFYI. We have compared the same router+firewall workloads on the host with this change and before, and I can say, that without DRBR on TX now we constantly have several percents of packets drops due to ENOBUFS error from mlx5e_xmit(). --=20 WBR, Andrey V. Elsukov --VgKBZ0OukvbzPkbEoBthS8hljSpYqUiQ8-- --aPxaqOZB3SNeaTjQKF3zntGIWz5lgO4Fe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAl3zlMIACgkQAcXqBBDI oXr/fAf/Wde64SONl2DH2DW/CqZjkLpsxePAu0qJu6hVwc8M4G0gslA6tTBT7kcN hrjN2QpPVI/TGEx/WIuCeyFUy/MQIbhZfJ2zoT23R5MtQfHbzG4YhxVbIudNwXZZ Q1UtKneupKYG9nw7AwI2oCGPfri32CwdRRy5Ak+wTJfF5bRnUt13qNOHc22e4l6p gcmPVQOj8OoQ5A81278xsKFNXoAvcFv4ZHmBwLHwUzmH99vCvANHjN7ZGYIz4WPD rAXnmhzrsolnge0+Cnu8yF8Glwm+BCXVpga75D3Ci3Lze9VOjCGJst02ye1HhSEj A9GUaqQagUrh8s3oLC7isZTdsHh0pQ== =tfFi -----END PGP SIGNATURE----- --aPxaqOZB3SNeaTjQKF3zntGIWz5lgO4Fe-- From owner-svn-src-all@freebsd.org Fri Dec 13 14:30:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8941A1CED8B; Fri, 13 Dec 2019 14:30:10 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47ZCk93TFJz44ZB; Fri, 13 Dec 2019 14:30:09 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 123822600FB; Fri, 13 Dec 2019 15:29:14 +0100 (CET) Subject: Re: svn commit: r341578 - head/sys/dev/mlx5/mlx5_en To: "Andrey V. Elsukov" , Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051420.wB5EKwxr099242@repo.freebsd.org> <8715aa7b-ceea-7cfd-1980-a260c98070d5@yandex.ru> From: Hans Petter Selasky Message-ID: <6151923d-05bb-b945-359e-d632708ba021@selasky.org> Date: Fri, 13 Dec 2019 15:27:19 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <8715aa7b-ceea-7cfd-1980-a260c98070d5@yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47ZCk93TFJz44ZB X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-4.93 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(-2.63)[ip: (-9.18), ipnet: 2a01:4f8::/29(-2.41), asn: 24940(-1.56), country: DE(-0.02)]; FREEMAIL_TO(0.00)[yandex.ru]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 14:30:10 -0000 On 2019-12-13 14:40, Andrey V. Elsukov wrote: > On 05.12.2018 17:20, Slava Shwartsman wrote: >> Author: slavash >> Date: Wed Dec 5 14:20:57 2018 >> New Revision: 341578 >> URL: https://svnweb.freebsd.org/changeset/base/341578 >> >> Log: >> mlx5en: Remove the DRBR and associated logic in the transmit path. >> >> The hardware queues are deep enough currently and using the DRBR and associated >> callbacks only leads to more task switching in the TX path. The is also a race >> setting the queue_state which can lead to hung TX rings. > > JFYI. We have compared the same router+firewall workloads on the host > with this change and before, and I can say, that without DRBR on TX now > we constantly have several percents of packets drops due to ENOBUFS > error from mlx5e_xmit(). > Have you tried to tune the TX/RX parameters? Especially the tx_queue_size . --HPS From owner-svn-src-all@freebsd.org Fri Dec 13 14:48:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12F431CF625; Fri, 13 Dec 2019 14:48:45 +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 47ZD7c6hLtz45hH; Fri, 13 Dec 2019 14:48:44 +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 DBC16DB74; Fri, 13 Dec 2019 14:48:44 +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 xBDEmi2e098503; Fri, 13 Dec 2019 14:48:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDEmiMA098502; Fri, 13 Dec 2019 14:48:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912131448.xBDEmiMA098502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Dec 2019 14:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355714 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 355714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 14:48:45 -0000 Author: emaste Date: Fri Dec 13 14:48:44 2019 New Revision: 355714 URL: https://svnweb.freebsd.org/changeset/base/355714 Log: revert r355609 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Dec 13 12:36:16 2019 (r355713) +++ head/Makefile.inc1 Fri Dec 13 14:48:44 2019 (r355714) @@ -458,7 +458,8 @@ SUBDIR+=etc .endif # !empty(SUBDIR_OVERRIDE) .if defined(NOCLEAN) -.error NOCLEAN option is deprecated. Use NO_CLEAN instead. +.warning NOCLEAN option is deprecated. Use NO_CLEAN instead. +NO_CLEAN= ${NOCLEAN} .endif .if defined(NO_CLEANDIR) CLEANDIR= clean cleandepend From owner-svn-src-all@freebsd.org Fri Dec 13 14:53:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D06CF1CFA7B; Fri, 13 Dec 2019 14:53:05 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47ZDDd5Bk7z46VB; Fri, 13 Dec 2019 14:53:05 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f180.google.com with SMTP id z90so2274878ilc.8; Fri, 13 Dec 2019 06:53:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZxKXaWve7YiUO9v9NKdhVP455K/a/tIAm1NNMnyS3Ds=; b=OYEy63XHvqcPnSB0C/STQky95hlAPUesQ/DXZ3Mu6VZvvDDyKK5+HW/bD5t00Rri4p p0baAWGHmQmqIVlYJYHANLMrJ055yEoFdEjQPNQqtGaweMmM2BRyZwziGRJeFHQ129wI kVNzzG4rN1HWL34oOEDVmRWrhvc9G5DFRx6q3jCwlf5gJ8I+Is33R40KwelX20Wjjn9k p34hmTQ2+2LHMS/yVSdX7Q52Usapnv0/G1Y7EPpQjdzNLoGRVyl0BNa6nWfkO2DJrx6Q GvWQkwO6bFnBJ1ifQ+AXvtRNjyw3UTNUh/iMNNmcvw7M8XAmVArtY7vAXjVrUzALYlmM j1nQ== X-Gm-Message-State: APjAAAVaFERaNPI0TkdfVk6rWyUqDmTbzmihCgcyWaiJx1bDOOwsHqiU /1xbeop9XseuuFF0yVxKPA5c19KHjwOv3sSVSIMd98mZQpQ= X-Google-Smtp-Source: APXvYqwwwTa7Q2hsTOs/cbFHEazGC8gLtcBc8MaknLIBV1d/15VSPfzUIqTGJ+U3hthA8k9aRd/KQP2YtKGbjRHRFqg= X-Received: by 2002:a92:db4f:: with SMTP id w15mr3712976ilq.182.1576248784112; Fri, 13 Dec 2019 06:53:04 -0800 (PST) MIME-Version: 1.0 References: <201912111454.xBBEsT42073427@repo.freebsd.org> <121c13a3-c855-049e-9137-e893d66759b1@FreeBSD.org> In-Reply-To: <121c13a3-c855-049e-9137-e893d66759b1@FreeBSD.org> From: Ed Maste Date: Fri, 13 Dec 2019 06:06:39 -0500 Message-ID: Subject: Re: svn commit: r355609 - head To: Bryan Drewery Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47ZDDd5Bk7z46VB 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]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 14:53:05 -0000 On Thu, 12 Dec 2019 at 18:46, Bryan Drewery wrote: > > What ever happened to POLA? > > Name 1 good reason this should be an .error?! Or even a .warning for > that matter. > > The argument I keep hearing is "we have to maintain these 3 lines of > code", ok, well now it's just an annoyance to maintain with no benefit > to the user. If it's an error now it can eventually be removed. I'm trying to move the clean logic to follow standard WITH_/WITHOUT_ so that we can eventually change the default. Anyway I've reverted it and will just abandon this. From owner-svn-src-all@freebsd.org Fri Dec 13 16:28:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2AD81D14A9; Fri, 13 Dec 2019 16:28:48 +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 47ZGM467dYz4CNr; Fri, 13 Dec 2019 16:28:48 +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 CD6C0ED7E; Fri, 13 Dec 2019 16:28:48 +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 xBDGSmTA058715; Fri, 13 Dec 2019 16:28:48 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDGSmWf058714; Fri, 13 Dec 2019 16:28:48 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912131628.xBDGSmWf058714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 13 Dec 2019 16:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355715 - head X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 355715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 16:28:49 -0000 Author: rmacklem Date: Fri Dec 13 16:28:48 2019 New Revision: 355715 URL: https://svnweb.freebsd.org/changeset/base/355715 Log: Add an entry to RELNOTES for r355677. Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Fri Dec 13 14:48:44 2019 (r355714) +++ head/RELNOTES Fri Dec 13 16:28:48 2019 (r355715) @@ -10,6 +10,28 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r355677: + Adds support for NFSv4.2 (RFC-7862) and Extended Attributes + (RFC-8276) to the NFS client and server. + NFSv4.2 is comprised of several optional features that can be supported + in addition to NFSv4.1. This patch adds the following optional features: + - posix_fadvise(POSIX_FADV_WILLNEED/POSIX_FADV_DONTNEED) + - posix_fallocate() + - intra server file range copying via the copy_file_range(2) syscall + --> Avoiding data tranfer over the wire to/from the NFS client. + - lseek(SEEK_DATA/SEEK_HOLE) + - Extended attribute syscalls for "user" namespace attributes as defined + by RFC-8276. + + For the client, NFSv4.2 is only used if the mount command line option + minorversion=2 is specified. + For the server, two new sysctls called vfs.nfsd.server_min_minorversion4 + and vfs.nfsd.server_max_minorversion4 have been added that allow + sysadmins to limit the minor versions of NFSv4 supported by the nfsd + server. + Setting vfs.nfsd.server_max_minorversion4 to 0 or 1 will disable NFSv4.2 + on the server. + r354517: iwm(4) now supports most Intel 9260, 9460 and 9560 Wi-Fi devices. From owner-svn-src-all@freebsd.org Fri Dec 13 16:51:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0BB01D19E6; Fri, 13 Dec 2019 16:51:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47ZGrz4W41z4DPm; Fri, 13 Dec 2019 16:51:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9569DF283; Fri, 13 Dec 2019 16:51:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDGpFmI073021; Fri, 13 Dec 2019 16:51:15 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDGp8Wg072989; Fri, 13 Dec 2019 16:51:08 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201912131651.xBDGp8Wg072989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 13 Dec 2019 16:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r355716 - in vendor-sys/acpica/dist: . source/common source/compiler source/components/debugger source/components/dispatcher source/components/executer source/components/hardware source... X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in vendor-sys/acpica/dist: . source/common source/compiler source/components/debugger source/components/dispatcher source/components/executer source/components/hardware source/components/utilities sou... X-SVN-Commit-Revision: 355716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 16:51:15 -0000 Author: jkim Date: Fri Dec 13 16:51:08 2019 New Revision: 355716 URL: https://svnweb.freebsd.org/changeset/base/355716 Log: Import ACPICA 20191213. Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/source/common/dmtables.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/aslcompiler.y vendor-sys/acpica/dist/source/compiler/asldefine.h vendor-sys/acpica/dist/source/compiler/aslerror.c vendor-sys/acpica/dist/source/compiler/aslfiles.c vendor-sys/acpica/dist/source/compiler/aslload.c vendor-sys/acpica/dist/source/compiler/aslmessages.c vendor-sys/acpica/dist/source/compiler/aslmessages.h vendor-sys/acpica/dist/source/compiler/aslmethod.c vendor-sys/acpica/dist/source/compiler/asloptions.c vendor-sys/acpica/dist/source/compiler/aslstartup.c vendor-sys/acpica/dist/source/compiler/asltransform.c vendor-sys/acpica/dist/source/compiler/aslutils.c vendor-sys/acpica/dist/source/compiler/aslxref.c vendor-sys/acpica/dist/source/compiler/dtcompile.c vendor-sys/acpica/dist/source/compiler/dtcompiler.h vendor-sys/acpica/dist/source/compiler/dttable2.c vendor-sys/acpica/dist/source/components/debugger/dbinput.c vendor-sys/acpica/dist/source/components/debugger/dbnames.c vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c vendor-sys/acpica/dist/source/components/dispatcher/dsopcode.c vendor-sys/acpica/dist/source/components/dispatcher/dswload.c vendor-sys/acpica/dist/source/components/executer/exfield.c vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c vendor-sys/acpica/dist/source/components/utilities/utids.c vendor-sys/acpica/dist/source/include/acobject.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/platform/acenv.h vendor-sys/acpica/dist/source/tools/acpinames/anstubs.c vendor-sys/acpica/dist/source/tools/acpisrc/asmain.c vendor-sys/acpica/dist/source/tools/acpisrc/astable.c vendor-sys/acpica/dist/tests/misc/badcode.asl Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/changes.txt Fri Dec 13 16:51:08 2019 (r355716) @@ -1,4 +1,25 @@ ---------------------------------------- +13 December 2019. Summary of changes for version 20191213: + + +1) ACPICA kernel-resident subsystem: + +Return a Buffer object for all fields created via the CreateField operator. Previously, an Integer would be returned if the size of the field was less than or equal to the current size of an Integer. Although this goes against the ACPI specification, it provides compatibility with other ACPI implementations. Also updated the ASLTS test suite to reflect this new behavior. + +2) iASL Compiler/Disassembler and ACPICA tools: + +iASL: Implemented detection of (and throw an error for) duplicate values for Case statements within a single Switch statement. Duplicate Integers, Strings, and Buffers are supported. + +iASL: Fix error logging issue during multiple file compilation -- Switch to the correct input file during error node creation. + +iASL: For duplicate named object creation, now emit an error instead of a warning - since this will cause a runtime error. + +AcpiSrc: Add unix line-ending support for non-Windows builds. + +iASL: Add an error condition for an attempt to create a NameString with > 255 NameSegs (the max allowable via the AML definition). + + +---------------------------------------- 18 October 2019. Summary of changes for version 20191018: Modified: vendor-sys/acpica/dist/source/common/dmtables.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtables.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/common/dmtables.c Fri Dec 13 16:51:08 2019 (r355716) @@ -508,6 +508,8 @@ AdParseTable ( AmlStart = ((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER)); ASL_CV_INIT_FILETREE(Table, AmlStart, AmlLength); + AcpiUtSetIntegerWidth (Table->Revision); + /* Create the root object */ AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp (AmlStart); @@ -543,7 +545,6 @@ AdParseTable ( } WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE; - WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE; Status = AcpiPsParseAml (WalkState); if (ACPI_FAILURE (Status)) Modified: vendor-sys/acpica/dist/source/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompile.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Fri Dec 13 16:51:08 2019 (r355716) @@ -220,6 +220,7 @@ CmDoCompile ( PrDoPreprocess (); AslGbl_CurrentLineNumber = 1; AslGbl_LogicalLineNumber = 1; + AslGbl_CurrentLineOffset = 0; if (AslGbl_PreprocessOnly) { @@ -282,25 +283,6 @@ CmDoCompile ( LsDumpParseTree (); - OpcGetIntegerWidth (AslGbl_ParseTreeRoot->Asl.Child); - UtEndEvent (Event); - - /* Pre-process parse tree for any operator transforms */ - - Event = UtBeginEvent ("Parse tree transforms"); - DbgPrint (ASL_DEBUG_OUTPUT, "\nParse tree transforms\n\n"); - TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, - TrAmlTransformWalkBegin, TrAmlTransformWalkEnd, NULL); - UtEndEvent (Event); - - /* Generate AML opcodes corresponding to the parse tokens */ - - Event = UtBeginEvent ("Generate AML opcodes"); - DbgPrint (ASL_DEBUG_OUTPUT, "Generating AML opcodes\n\n"); - TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, - OpcAmlOpcodeWalk, NULL); - UtEndEvent (Event); - UtEndEvent (FullCompile); return (AE_OK); @@ -329,6 +311,25 @@ CmDoAslMiddleAndBackEnd ( { UINT8 Event; ACPI_STATUS Status; + + + OpcGetIntegerWidth (AslGbl_ParseTreeRoot->Asl.Child); + + /* Pre-process parse tree for any operator transforms */ + + Event = UtBeginEvent ("Parse tree transforms"); + DbgPrint (ASL_DEBUG_OUTPUT, "\nParse tree transforms\n\n"); + TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, + TrAmlTransformWalkBegin, TrAmlTransformWalkEnd, NULL); + UtEndEvent (Event); + + /* Generate AML opcodes corresponding to the parse tokens */ + + Event = UtBeginEvent ("Generate AML opcodes"); + DbgPrint (ASL_DEBUG_OUTPUT, "Generating AML opcodes\n\n"); + TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, + NULL, OpcAmlOpcodeWalk, NULL); + UtEndEvent (Event); /* Interpret and generate all compile-time constants */ Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.y ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.y Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.y Fri Dec 13 16:51:08 2019 (r355716) @@ -3442,7 +3442,7 @@ AddressKeyword ; AddressSpaceKeyword - : ByteConst {$$ = UtCheckIntegerRange ($1, 0x0A, 0xFF);} + : ByteConst {$$ = UtCheckIntegerRange ($1, ACPI_NUM_PREDEFINED_REGIONS, 0xFF);} | RegionSpaceKeyword {} ; @@ -4843,7 +4843,6 @@ OptionalXferSize /* Local support functions in C */ - /****************************************************************************** * * Local support functions @@ -4918,4 +4917,3 @@ UtGetOpName ( return ("[Unknown parser generator]"); #endif } - Modified: vendor-sys/acpica/dist/source/compiler/asldefine.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asldefine.h Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/asldefine.h Fri Dec 13 16:51:08 2019 (r355716) @@ -222,11 +222,11 @@ /* Misc */ -#define ASL_EXTERNAL_METHOD 255 -#define ASL_ABORT TRUE -#define ASL_NO_ABORT FALSE -#define ASL_EOF ACPI_UINT32_MAX -#define ASL_IGNORE_LINE (ACPI_UINT32_MAX -1) +#define ASL_EXTERNAL_METHOD_UNKNOWN_PARAMS 255 +#define ASL_ABORT TRUE +#define ASL_NO_ABORT FALSE +#define ASL_EOF ACPI_UINT32_MAX +#define ASL_IGNORE_LINE (ACPI_UINT32_MAX -1) /* Listings */ Modified: vendor-sys/acpica/dist/source/compiler/aslerror.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslerror.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/aslerror.c Fri Dec 13 16:51:08 2019 (r355716) @@ -335,7 +335,7 @@ AeAddToErrorLog ( * PARAMETERS: OutputFile - Output file * Enode - Error node to print * PrematureEOF - True = PrematureEOF has been reached - * Total - Total legth of line + * Total - Total length of line * * RETURN: None * @@ -445,7 +445,7 @@ AeDecodeErrorMessageId ( * PARAMETERS: OutputFile - Output file * Enode - Error node to print * PrematureEOF - True = PrematureEOF has been reached - * Total - amount of characters printed so far + * Total - Number of characters printed so far * * * RETURN: Status @@ -527,6 +527,7 @@ AePrintErrorSourceLine ( fprintf (OutputFile, "\n"); return AE_OK; } + /* * Seek to the offset in the combined source file, * read the source line, and write it to the output. @@ -550,8 +551,9 @@ AePrintErrorSourceLine ( AslGbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); return AE_IO_ERROR; } - /* Read/write the source line, up to the maximum line length */ + /* Read/write the source line, up to the maximum line length */ + while (RActual && SourceByte && (SourceByte != '\n')) { if (*Total < 256) @@ -732,7 +734,7 @@ AePrintException ( * * RETURN: None * - * DESCRIPTION: Print the contents of an error nodes. This function is tailored + * DESCRIPTION: Print the contents of an error node. This function is tailored * to print error nodes that are SubErrors within ASL_ERROR_MSG * ******************************************************************************/ @@ -795,8 +797,8 @@ AePrintErrorLog ( * LogicalLineNumber - Cumulative line number * LogicalByteOffset - Byte offset in source file * Column - Column in current line - * Filename - source filename - * ExtraMessage - additional error message + * Filename - Source filename + * ExtraMessage - Additional error message * SourceLine - Line of error source code * SubError - SubError of this InputEnode * @@ -863,10 +865,17 @@ static void AslInitEnode ( Enode->FilenameLength = 6; } - FileNode = FlGetCurrentFileNode (); + /* + * Attempt to get the file node of the filename listed in the parse + * node. If the name doesn't exist in the global file node, it is + * because the file is included by #include or ASL include. In this + * case, get the current file node. The source output of the current + * file will contain the contents of the file listed in the parse node. + */ + FileNode = FlGetFileNode (ASL_FILE_INPUT, Filename); if (!FileNode) { - return; + FileNode = FlGetCurrentFileNode (); } Enode->SourceFilename = @@ -884,8 +893,8 @@ static void AslInitEnode ( * LineNumber - Actual file line number * Column - Column in current line * SourceLine - Actual source code line - * Filename - source filename - * ExtraMessage - additional error message + * Filename - Source filename + * ExtraMessage - Additional error message * * RETURN: None * @@ -918,8 +927,8 @@ AslCommonError2 ( * LogicalLineNumber - Cumulative line number * LogicalByteOffset - Byte offset in source file * Column - Column in current line - * Filename - source filename - * ExtraMessage - additional error message + * Filename - Source filename + * ExtraMessage - Additional error message * * RETURN: None * @@ -961,8 +970,8 @@ AslCommonError ( * LogicalLineNumber - Cumulative line number * LogicalByteOffset - Byte offset in source file * Column - Column in current line - * Filename - source filename - * Message - additional error message + * Filename - Source filename + * Message - Additional error message * SourceLine - Actual line of source code * SubError - Sub-error associated with this error * @@ -1025,7 +1034,7 @@ AslLogNewError ( * PARAMETERS: Level - Seriousness (Warning/error, etc.) * MessageId - Index into global message buffer * - * RETURN: UINT8 - modified level + * RETURN: UINT8 - Modified level * * DESCRIPTION: Get the modified level of exception codes that are reported as * errors from the -ww option. @@ -1369,7 +1378,7 @@ AslIsExceptionDisabled ( * MainMsg - Message pertaining to the MainOp * SubMsgId - Index into global message buffer * SubOp - Additional parse node for better message - * SubMsg - Message pertainint to SubOp + * SubMsg - Message pertaining to SubOp * * * RETURN: None @@ -1421,7 +1430,7 @@ AslDualParseOpError ( * PARAMETERS: Level - Seriousness (Warning/error, etc.) * MessageId - Index into global message buffer * Op - Parse node where error happened - * ExtraMessage - additional error message + * ExtraMessage - Additional error message * * RETURN: None * @@ -1459,7 +1468,7 @@ AslError ( * * PARAMETERS: Op - Parse node where error happened * Status - The ACPICA Exception - * ExtraMessage - additional error message + * ExtraMessage - Additional error message * Abort - TRUE -> Abort compilation * * RETURN: None Modified: vendor-sys/acpica/dist/source/compiler/aslfiles.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfiles.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/aslfiles.c Fri Dec 13 16:51:08 2019 (r355716) @@ -207,12 +207,6 @@ FlInitOneFile ( NewFileNode = ACPI_CAST_PTR (ASL_GLOBAL_FILE_NODE, UtLocalCacheCalloc (sizeof (ASL_GLOBAL_FILE_NODE))); - if (!NewFileNode) - { - AslError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION, NULL, NULL); - return (AE_NO_MEMORY); - } - NewFileNode->ParserErrorDetected = FALSE; NewFileNode->Next = AslGbl_FilesList; @@ -420,8 +414,22 @@ ASL_GLOBAL_FILE_NODE * FlGetCurrentFileNode ( void) { - return (FlGetFileNode ( - ASL_FILE_INPUT,AslGbl_Files[ASL_FILE_INPUT].Filename)); + ASL_GLOBAL_FILE_NODE *FileNode = + FlGetFileNode (ASL_FILE_INPUT,AslGbl_Files[ASL_FILE_INPUT].Filename); + + + if (!FileNode) + { + /* + * If the current file node does not exist after initializing the file + * node structures, something went wrong and this is an unrecoverable + * condition. + */ + FlFileError (ASL_FILE_INPUT, ASL_MSG_COMPILER_INTERNAL); + AslAbort (); + } + + return (FileNode); } Modified: vendor-sys/acpica/dist/source/compiler/aslload.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslload.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/aslload.c Fri Dec 13 16:51:08 2019 (r355716) @@ -357,7 +357,7 @@ LdLoadFieldElements ( * The name already exists in this scope * But continue processing the elements */ - AslDualParseOpError (ASL_WARNING, ASL_MSG_NAME_EXISTS, Child, + AslDualParseOpError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Child, Child->Asl.Value.String, ASL_MSG_FOUND_HERE, Node->Op, Node->Op->Asl.ExternalName); } @@ -986,12 +986,19 @@ FinishNode: Op->Asl.Node = Node; Node->Op = Op; - /* Set the actual data type if appropriate (EXTERNAL term only) */ - + /* + * Set the actual data type if appropriate (EXTERNAL term only) + * As of 11/19/2019, ASL External() does not support parameter + * counts. When an External method is loaded, the parameter count is + * unknown setting Node->Value to ASL_EXTERNAL_METHOD_UNKNOWN_PARAMS + * indicates that the parameter count for this method is unknown. + * This information is used in ASL cross reference to help determine the + * parameter count through method calls. + */ if (ActualObjectType != ACPI_TYPE_ANY) { Node->Type = (UINT8) ActualObjectType; - Node->Value = ASL_EXTERNAL_METHOD; + Node->Value = ASL_EXTERNAL_METHOD_UNKNOWN_PARAMS; } if (Op->Asl.ParseOpcode == PARSEOP_METHOD) Modified: vendor-sys/acpica/dist/source/compiler/aslmessages.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.c Fri Dec 13 16:51:08 2019 (r355716) @@ -368,7 +368,9 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_BUFFER_FIELD_OVERFLOW */ "Buffer field extends beyond end of target buffer", /* ASL_MSG_INVALID_SPECIAL_NAME */ "declaration of this named object outside root scope is illegal", /* ASL_MSG_INVALID_PROCESSOR_UID */ "_UID inside processor declaration must be an integer", -/* ASL_MSG_LEGACY_PROCESSOR_OP */ "Legacy Processor() keyword detected. Use Device() keyword instead." +/* ASL_MSG_LEGACY_PROCESSOR_OP */ "Legacy Processor() keyword detected. Use Device() keyword instead.", +/* ASL_MSG_NAMESTRING_LENGTH */ "NameString contains too many NameSegs (>255)", +/* ASL_MSG_CASE_FOUND_HERE */ "Original Case value below:" }; /* Table compiler */ Modified: vendor-sys/acpica/dist/source/compiler/aslmessages.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.h Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.h Fri Dec 13 16:51:08 2019 (r355716) @@ -371,6 +371,8 @@ typedef enum ASL_MSG_INVALID_SPECIAL_NAME, ASL_MSG_INVALID_PROCESSOR_UID, ASL_MSG_LEGACY_PROCESSOR_OP, + ASL_MSG_NAMESTRING_LENGTH, + ASL_MSG_CASE_FOUND_HERE, /* These messages are used by the Data Table compiler only */ Modified: vendor-sys/acpica/dist/source/compiler/aslmethod.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmethod.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/aslmethod.c Fri Dec 13 16:51:08 2019 (r355716) @@ -586,7 +586,7 @@ MtMethodAnalysisWalkBegin ( /* Special typechecking for _HID */ - if (!strcmp (METHOD_NAME__HID, Op->Asl.NameSeg)) + if (ACPI_COMPARE_NAMESEG (METHOD_NAME__HID, Op->Asl.NameSeg)) { Next = Op->Asl.Child->Asl.Next; AnCheckId (Next, ASL_TYPE_HID); @@ -594,7 +594,7 @@ MtMethodAnalysisWalkBegin ( /* Special typechecking for _CID */ - else if (!strcmp (METHOD_NAME__CID, Op->Asl.NameSeg)) + else if (ACPI_COMPARE_NAMESEG (METHOD_NAME__CID, Op->Asl.NameSeg)) { Next = Op->Asl.Child->Asl.Next; Modified: vendor-sys/acpica/dist/source/compiler/asloptions.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asloptions.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/asloptions.c Fri Dec 13 16:51:08 2019 (r355716) @@ -219,7 +219,7 @@ AslCommandLine ( { exit (-1); } - exit (1); + exit (0); } /* Next parameter must be the input filename */ Modified: vendor-sys/acpica/dist/source/compiler/aslstartup.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslstartup.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/aslstartup.c Fri Dec 13 16:51:08 2019 (r355716) @@ -457,10 +457,6 @@ AslDoOneFile ( } FileNode = FlGetCurrentFileNode(); - if (!FileNode) - { - return (AE_ERROR); - } FileNode->OriginalInputFileSize = FlGetFileSize (ASL_FILE_INPUT); Modified: vendor-sys/acpica/dist/source/compiler/asltransform.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asltransform.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/asltransform.c Fri Dec 13 16:51:08 2019 (r355716) @@ -151,6 +151,7 @@ #include "aslcompiler.h" #include "aslcompiler.y.h" +#include "acnamesp.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("asltransform") @@ -194,7 +195,17 @@ static void TrDoSwitch ( ACPI_PARSE_OBJECT *StartNode); +static void +TrCheckForDuplicateCase ( + ACPI_PARSE_OBJECT *CaseOp, + ACPI_PARSE_OBJECT *Predicate1); +static BOOLEAN +TrCheckForBufferMatch ( + ACPI_PARSE_OBJECT *Next1, + ACPI_PARSE_OBJECT *Next2); + + /******************************************************************************* * * FUNCTION: TrAmlGetNextTempName @@ -431,6 +442,7 @@ TrTransformSubtree ( ACPI_PARSE_OBJECT *Op) { ACPI_PARSE_OBJECT *MethodOp; + ACPI_NAMESTRING_INFO Info; if (Op->Asl.AmlOpcode == AML_RAW_DATA_BYTE) @@ -492,6 +504,22 @@ TrTransformSubtree ( Op->Asl.Value.String = "\\"; break; + case PARSEOP_NAMESTRING: + /* + * A NameString can be up to 255 (0xFF) individual NameSegs maximum + * (with 254 dot separators) - as per the ACPI specification. Note: + * Cannot check for NumSegments == 0 because things like + * Scope(\) are legal and OK. + */ + Info.ExternalName = Op->Asl.Value.String; + AcpiNsGetInternalNameLength (&Info); + + if (Info.NumSegments > 255) + { + AslError (ASL_ERROR, ASL_MSG_NAMESTRING_LENGTH, Op, NULL); + } + break; + case PARSEOP_UNLOAD: AslError (ASL_WARNING, ASL_MSG_UNLOAD, Op, NULL); @@ -510,7 +538,6 @@ TrTransformSubtree ( case PARSEOP_PROCESSOR: AslError (ASL_WARNING, ASL_MSG_LEGACY_PROCESSOR_OP, Op, Op->Asl.ExternalName); - break; default: @@ -646,6 +673,8 @@ TrDoSwitch ( if (Next->Asl.ParseOpcode == PARSEOP_CASE) { + TrCheckForDuplicateCase (Next, Next->Asl.Child); + if (CaseOp) { /* Add an ELSE to complete the previous CASE */ @@ -976,4 +1005,177 @@ TrDoSwitch ( TrAmlInitLineNumbers (BreakOp, NewOp); BreakOp->Asl.Parent = StartNode; TrAmlInsertPeer (Conditional, BreakOp); +} + + +/******************************************************************************* + * + * FUNCTION: TrCheckForDuplicateCase + * + * PARAMETERS: CaseOp - Parse node for first Case statement in list + * Predicate1 - Case value for the input CaseOp + * + * RETURN: None + * + * DESCRIPTION: Check for duplicate case values. Currently, only handles + * Integers, Strings and Buffers. No support for Package objects. + * + ******************************************************************************/ + +static void +TrCheckForDuplicateCase ( + ACPI_PARSE_OBJECT *CaseOp, + ACPI_PARSE_OBJECT *Predicate1) +{ + ACPI_PARSE_OBJECT *Next; + ACPI_PARSE_OBJECT *Predicate2; + + + /* Walk the list of CASE opcodes */ + + Next = CaseOp->Asl.Next; + while (Next) + { + if (Next->Asl.ParseOpcode == PARSEOP_CASE) + { + /* Emit error only once */ + + if (Next->Asl.CompileFlags & OP_IS_DUPLICATE) + { + goto NextCase; + } + + /* Check for a duplicate plain integer */ + + Predicate2 = Next->Asl.Child; + if ((Predicate1->Asl.ParseOpcode == PARSEOP_INTEGER) && + (Predicate2->Asl.ParseOpcode == PARSEOP_INTEGER)) + { + if (Predicate1->Asl.Value.Integer == Predicate2->Asl.Value.Integer) + { + goto FoundDuplicate; + } + } + + /* Check for pairs of the constants ZERO, ONE, ONES */ + + else if (((Predicate1->Asl.ParseOpcode == PARSEOP_ZERO) && + (Predicate2->Asl.ParseOpcode == PARSEOP_ZERO)) || + ((Predicate1->Asl.ParseOpcode == PARSEOP_ONE) && + (Predicate2->Asl.ParseOpcode == PARSEOP_ONE)) || + ((Predicate1->Asl.ParseOpcode == PARSEOP_ONES) && + (Predicate2->Asl.ParseOpcode == PARSEOP_ONES))) + { + goto FoundDuplicate; + } + + /* Check for a duplicate string constant (literal) */ + + else if ((Predicate1->Asl.ParseOpcode == PARSEOP_STRING_LITERAL) && + (Predicate2->Asl.ParseOpcode == PARSEOP_STRING_LITERAL)) + { + if (!strcmp (Predicate1->Asl.Value.String, + Predicate2->Asl.Value.String)) + { + goto FoundDuplicate; + } + } + + /* Check for a duplicate buffer constant */ + + else if ((Predicate1->Asl.ParseOpcode == PARSEOP_BUFFER) && + (Predicate2->Asl.ParseOpcode == PARSEOP_BUFFER)) + { + if (TrCheckForBufferMatch (Predicate1->Asl.Child, + Predicate2->Asl.Child)) + { + goto FoundDuplicate; + } + } + } + goto NextCase; + +FoundDuplicate: + /* Emit error message only once */ + + Next->Asl.CompileFlags |= OP_IS_DUPLICATE; + + AslDualParseOpError (ASL_ERROR, ASL_MSG_DUPLICATE_CASE, Next, + Next->Asl.Value.String, ASL_MSG_CASE_FOUND_HERE, CaseOp, + CaseOp->Asl.ExternalName); + +NextCase: + Next = Next->Asl.Next; + } +} + + +/******************************************************************************* + * + * FUNCTION: TrCheckForBufferMatch + * + * PARAMETERS: Next1 - Parse node for first opcode in first buffer list + * (The DEFAULT_ARG or INTEGER node) + * Next2 - Parse node for first opcode in second buffer list + * (The DEFAULT_ARG or INTEGER node) + * + * RETURN: TRUE if buffers match, FALSE otherwise + * + * DESCRIPTION: Check for duplicate Buffer case values. + * + ******************************************************************************/ + +static BOOLEAN +TrCheckForBufferMatch ( + ACPI_PARSE_OBJECT *NextOp1, + ACPI_PARSE_OBJECT *NextOp2) +{ + + if (NextOp1->Asl.Value.Integer != NextOp2->Asl.Value.Integer) + { + return (FALSE); + } + + /* Start at the BYTECONST initializer node list */ + + NextOp1 = NextOp1->Asl.Next; + NextOp2 = NextOp2->Asl.Next; + + /* + * Walk both lists until either a mismatch is found, or one or more + * end-of-lists are found + */ + while (NextOp1 && NextOp2) + { + if ((NextOp1->Asl.ParseOpcode == PARSEOP_STRING_LITERAL) && + (NextOp2->Asl.ParseOpcode == PARSEOP_STRING_LITERAL)) + { + if (!strcmp (NextOp1->Asl.Value.String, NextOp2->Asl.Value.String)) + { + return (TRUE); + } + else + { + return (FALSE); + } + } + if ((UINT8) NextOp1->Asl.Value.Integer != (UINT8) NextOp2->Asl.Value.Integer) + { + return (FALSE); + } + + NextOp1 = NextOp1->Asl.Next; + NextOp2 = NextOp2->Asl.Next; + } + + /* Not a match if one of the lists is not at end-of-list */ + + if (NextOp1 || NextOp2) + { + return (FALSE); + } + + /* Otherwise, the buffers match */ + + return (TRUE); } Modified: vendor-sys/acpica/dist/source/compiler/aslutils.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslutils.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/aslutils.c Fri Dec 13 16:51:08 2019 (r355716) @@ -567,11 +567,6 @@ UtDisplayOneSummary ( /* Summary of main input and output files */ FileNode = FlGetCurrentFileNode (); - if (!FileNode) - { - fprintf (stderr, "Summary could not be generated"); - return; - } if (FileNode->ParserErrorDetected) { Modified: vendor-sys/acpica/dist/source/compiler/aslxref.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslxref.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/aslxref.c Fri Dec 13 16:51:08 2019 (r355716) @@ -1055,7 +1055,7 @@ XfNamespaceLocateBegin ( NextOp = NextOp->Asl.Next; } - if (Node->Value != ASL_EXTERNAL_METHOD && + if (Node->Value != ASL_EXTERNAL_METHOD_UNKNOWN_PARAMS && Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_EXTERNAL) { /* @@ -1064,8 +1064,17 @@ XfNamespaceLocateBegin ( */ if (PassedArgs != Node->Value) { - sprintf (AslGbl_MsgBuffer, "%s requires %u", Op->Asl.ExternalName, - Node->Value); + if (Node->Flags & ANOBJ_IS_EXTERNAL) + { + sprintf (AslGbl_MsgBuffer, + "according to previous use, %s requires %u", + Op->Asl.ExternalName, Node->Value); + } + else + { + sprintf (AslGbl_MsgBuffer, "%s requires %u", Op->Asl.ExternalName, + Node->Value); + } if (PassedArgs < Node->Value) { @@ -1076,6 +1085,22 @@ XfNamespaceLocateBegin ( AslError (ASL_ERROR, ASL_MSG_ARG_COUNT_HI, Op, AslGbl_MsgBuffer); } } + } + + /* + * At this point, a method call to an external method has been + * detected. As of 11/19/2019, iASL does not support parameter counts + * for methods declared as external. Therefore, save the parameter + * count of the first method call and use this count check other + * method calls to ensure that the methods are being called with the + * same amount of parameters. + */ + else if (Node->Type == ACPI_TYPE_METHOD && + (Node->Flags & ANOBJ_IS_EXTERNAL) && + Node->Value == ASL_EXTERNAL_METHOD_UNKNOWN_PARAMS && + Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_EXTERNAL) + { + Node->Value = PassedArgs; } } Modified: vendor-sys/acpica/dist/source/compiler/dtcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dtcompile.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/dtcompile.c Fri Dec 13 16:51:08 2019 (r355716) @@ -261,25 +261,15 @@ DtDoCompile ( UtEndEvent (Event); FileNode = FlGetCurrentFileNode (); - if (!FileNode) - { - fprintf (stderr, "Summary for %s could not be generated", - AslGbl_Files[ASL_FILE_INPUT].Filename); - } - else - { - FileNode->TotalLineCount = AslGbl_CurrentLineNumber; - FileNode->OriginalInputFileSize = AslGbl_InputByteCount; - DbgPrint (ASL_PARSE_OUTPUT, "Line count: %u input file size: %u\n", - FileNode->TotalLineCount, FileNode->OriginalInputFileSize); - } + FileNode->TotalLineCount = AslGbl_CurrentLineNumber; + FileNode->OriginalInputFileSize = AslGbl_InputByteCount; + DbgPrint (ASL_PARSE_OUTPUT, "Line count: %u input file size: %u\n", + FileNode->TotalLineCount, FileNode->OriginalInputFileSize); + if (ACPI_FAILURE (Status)) { - if (FileNode) - { - FileNode->ParserErrorDetected = TRUE; - } + FileNode->ParserErrorDetected = TRUE; /* TBD: temporary error message. Msgs should come from function above */ @@ -306,11 +296,8 @@ DtDoCompile ( /* Save the compile time statistics to the current file node */ - if (FileNode) - { - FileNode->TotalFields = AslGbl_InputFieldCount; - FileNode->OutputByteLength = AslGbl_TableLength; - } + FileNode->TotalFields = AslGbl_InputFieldCount; + FileNode->OutputByteLength = AslGbl_TableLength; return (Status); } Modified: vendor-sys/acpica/dist/source/compiler/dtcompiler.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dtcompiler.h Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/dtcompiler.h Fri Dec 13 16:51:08 2019 (r355716) @@ -459,7 +459,6 @@ DtCreateTableUnit ( UINT32 Column); - /* dtparser - lex/yacc files */ UINT64 DtCompilerParserResult; /* Expression return value */ Modified: vendor-sys/acpica/dist/source/compiler/dttable2.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dttable2.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/compiler/dttable2.c Fri Dec 13 16:51:08 2019 (r355716) @@ -1662,6 +1662,7 @@ DtCompileSlit ( "Found %u entries, must match LocalityCount: %u", LocalityListLength, Localities); DtError (ASL_ERROR, ASL_MSG_ENTRY_LIST, EndOfFieldList, AslGbl_MsgBuffer); + ACPI_FREE (LocalityBuffer); return (AE_LIMIT); } Modified: vendor-sys/acpica/dist/source/components/debugger/dbinput.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbinput.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/components/debugger/dbinput.c Fri Dec 13 16:51:08 2019 (r355716) @@ -1019,7 +1019,7 @@ AcpiDbCommandDispatch ( if (ACPI_FAILURE (Status) || Temp64 >= ACPI_NUM_PREDEFINED_REGIONS) { AcpiOsPrintf ( - "Invalid adress space ID: must be between 0 and %u inclusive\n", + "Invalid address space ID: must be between 0 and %u inclusive\n", ACPI_NUM_PREDEFINED_REGIONS - 1); return (AE_OK); } Modified: vendor-sys/acpica/dist/source/components/debugger/dbnames.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbnames.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/components/debugger/dbnames.c Fri Dec 13 16:51:08 2019 (r355716) @@ -807,7 +807,6 @@ AcpiDbWalkForFields ( } - /******************************************************************************* * * FUNCTION: AcpiDbWalkForSpecificObjects Modified: vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c ============================================================================== --- vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c Fri Dec 13 16:51:08 2019 (r355716) @@ -413,7 +413,7 @@ Cleanup: * FUNCTION: AcpiDsGetFieldNames * * PARAMETERS: Info - CreateField info structure - * ` WalkState - Current method state + * WalkState - Current method state * Arg - First parser arg for the field name list * * RETURN: Status Modified: vendor-sys/acpica/dist/source/components/dispatcher/dsopcode.c ============================================================================== --- vendor-sys/acpica/dist/source/components/dispatcher/dsopcode.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/components/dispatcher/dsopcode.c Fri Dec 13 16:51:08 2019 (r355716) @@ -374,6 +374,7 @@ AcpiDsInitBufferField ( } ObjDesc->BufferField.BufferObj = BufferDesc; + ObjDesc->BufferField.IsCreateField = AmlOpcode == AML_CREATE_FIELD_OP; /* Reference count for BufferDesc inherits ObjDesc count */ Modified: vendor-sys/acpica/dist/source/components/dispatcher/dswload.c ============================================================================== --- vendor-sys/acpica/dist/source/components/dispatcher/dswload.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/components/dispatcher/dswload.c Fri Dec 13 16:51:08 2019 (r355716) @@ -567,6 +567,28 @@ AcpiDsLoad1EndOp ( Op = WalkState->Op; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState)); + /* + * Disassembler: handle create field operators here. + * + * CreateBufferField is a deferred op that is typically processed in load + * pass 2. However, disassembly of control method contents walk the parse + * tree with ACPI_PARSE_LOAD_PASS1 and AML_CREATE operators are processed + * in a later walk. This is a problem when there is a control method that + * has the same name as the AML_CREATE object. In this case, any use of the + * name segment will be detected as a method call rather than a reference + * to a buffer field. + * + * This earlier creation during disassembly solves this issue by inserting + * the named object in the ACPI namespace so that references to this name + * would be a name string rather than a method call. + */ + if ((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) && + (WalkState->OpInfo->Flags & AML_CREATE)) + { + Status = AcpiDsCreateBufferField (Op, WalkState); + return_ACPI_STATUS (Status); + } + /* We are only interested in opcodes that have an associated name */ if (!(WalkState->OpInfo->Flags & (AML_NAMED | AML_FIELD))) Modified: vendor-sys/acpica/dist/source/components/executer/exfield.c ============================================================================== --- vendor-sys/acpica/dist/source/components/executer/exfield.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/components/executer/exfield.c Fri Dec 13 16:51:08 2019 (r355716) @@ -246,7 +246,8 @@ AcpiExGetProtocolBufferLength ( * RETURN: Status * * DESCRIPTION: Read from a named field. Returns either an Integer or a - * Buffer, depending on the size of the field. + * Buffer, depending on the size of the field and whether if a + * field is created by the CreateField() operator. * ******************************************************************************/ @@ -310,12 +311,17 @@ AcpiExReadDataFromField ( * the use of arithmetic operators on the returned value if the * field size is equal or smaller than an Integer. * + * However, all buffer fields created by CreateField operator needs to + * remain as a buffer to match other AML interpreter implementations. + * * Note: Field.length is in bits. */ BufferLength = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES ( ObjDesc->Field.BitLength); - if (BufferLength > AcpiGbl_IntegerByteWidth) + if (BufferLength > AcpiGbl_IntegerByteWidth || + (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD && + ObjDesc->BufferField.IsCreateField)) { /* Field is too large for an Integer, create a Buffer instead */ Modified: vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c ============================================================================== --- vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c Fri Dec 13 16:51:08 2019 (r355716) @@ -192,7 +192,7 @@ static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[ ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep)), ACPI_STRUCT_INIT (ExtendedFunction, AcpiHwExtendedWakePrep) }, - {ACPI_STRUCT_INIT (Legacy_function, + {ACPI_STRUCT_INIT (LegacyFunction, ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake)), ACPI_STRUCT_INIT (ExtendedFunction, AcpiHwExtendedWake) } Modified: vendor-sys/acpica/dist/source/components/utilities/utids.c ============================================================================== --- vendor-sys/acpica/dist/source/components/utilities/utids.c Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/components/utilities/utids.c Fri Dec 13 16:51:08 2019 (r355716) @@ -466,8 +466,7 @@ AcpiUtExecute_CID ( { /* Copy the String CID from the returned object */ - AcpiUtSafeStrcpy (NextIdString, CidObjects[i]->String.Length + 1, - CidObjects[i]->String.Pointer); + strcpy (NextIdString, CidObjects[i]->String.Pointer); Length = CidObjects[i]->String.Length + 1; } Modified: vendor-sys/acpica/dist/source/include/acobject.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acobject.h Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/include/acobject.h Fri Dec 13 16:51:08 2019 (r355716) @@ -489,6 +489,7 @@ typedef struct acpi_object_buffer_field { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO + BOOLEAN IsCreateField; /* Special case for objects created by CreateField() */ union acpi_operand_object *BufferObj; /* Containing Buffer object */ } ACPI_OBJECT_BUFFER_FIELD; Modified: vendor-sys/acpica/dist/source/include/acpixf.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acpixf.h Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/include/acpixf.h Fri Dec 13 16:51:08 2019 (r355716) @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20191018 +#define ACPI_CA_VERSION 0x20191213 #include "acconfig.h" #include "actypes.h" Modified: vendor-sys/acpica/dist/source/include/platform/acenv.h ============================================================================== --- vendor-sys/acpica/dist/source/include/platform/acenv.h Fri Dec 13 16:28:48 2019 (r355715) +++ vendor-sys/acpica/dist/source/include/platform/acenv.h Fri Dec 13 16:51:08 2019 (r355716) @@ -270,6 +270,21 @@ #define ACPI_DISASSEMBLER 1 #endif +/* + * acpisrc CR\LF support + * Unix file line endings do not include the carriage return. + * If the acpisrc utility is being built using a microsoft compiler, it means + * that it will be running on a windows machine which means that the output is + * expected to have CR/LF newlines. If the acpisrc utility is built with + * anything else, it will likely run on a system with LF newlines. This flag + * tells the acpisrc utility that newlines will be in the LF format. + */ +#if defined(ACPI_SRC_APP) && !defined(_MSC_VER) +#define ACPI_SRC_OS_LF_ONLY 1 +#else +#define ACPI_SRC_OS_LF_ONLY 0 +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 13 16:51:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAA691D1B91; Fri, 13 Dec 2019 16:51:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47ZGsm60yPz4DY9; Fri, 13 Dec 2019 16:51:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B106BF2B4; Fri, 13 Dec 2019 16:51:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDGpuOc073090; Fri, 13 Dec 2019 16:51:56 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDGpux5073089; Fri, 13 Dec 2019 16:51:56 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201912131651.xBDGpux5073089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 13 Dec 2019 16:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r355717 - vendor-sys/acpica/20191213 X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor-sys/acpica/20191213 X-SVN-Commit-Revision: 355717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 16:51:57 -0000 Author: jkim Date: Fri Dec 13 16:51:56 2019 New Revision: 355717 URL: https://svnweb.freebsd.org/changeset/base/355717 Log: Tag ACPICA 20191213. Added: vendor-sys/acpica/20191213/ - copied from r355716, vendor-sys/acpica/dist/ From owner-svn-src-all@freebsd.org Fri Dec 13 17:52:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 451371D2C6F; Fri, 13 Dec 2019 17:52:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47ZJCG18dSz4Hlx; Fri, 13 Dec 2019 17:52:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22E2AFE0B; Fri, 13 Dec 2019 17:52:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDHqAxc008078; Fri, 13 Dec 2019 17:52:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDHqAVk008077; Fri, 13 Dec 2019 17:52:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201912131752.xBDHqAVk008077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Dec 2019 17:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355718 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 355718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 17:52:10 -0000 Author: mav Date: Fri Dec 13 17:52:09 2019 New Revision: 355718 URL: https://svnweb.freebsd.org/changeset/base/355718 Log: Fix $() handling, broken since the beginning at r108014. Due to off-by-one error in brackets counting it consumed the rest of the string, preventing later variables expansions. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Fri Dec 13 16:51:56 2019 (r355717) +++ head/sbin/devd/devd.cc Fri Dec 13 17:52:09 2019 (r355718) @@ -681,15 +681,15 @@ config::expand_one(const char *&src, string &dst, bool // This is the escape hatch for passing down shell subcommands if (*src == '(') { dst += '$'; - count = 1; + count = 0; /* If the string ends before ) is matched , return. */ - while (count > 0 && *src) { + do { if (*src == ')') count--; else if (*src == '(') count++; dst += *src++; - } + } while (count > 0 && *src); return; } From owner-svn-src-all@freebsd.org Fri Dec 13 18:18:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 206D81D3ACB; Fri, 13 Dec 2019 18:18:15 +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 47ZJnL75lVz4KKw; Fri, 13 Dec 2019 18:18:14 +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 EED66181DE; Fri, 13 Dec 2019 18:18:14 +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 xBDIIEhx023616; Fri, 13 Dec 2019 18:18:14 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDIIEcV023615; Fri, 13 Dec 2019 18:18:14 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201912131818.xBDIIEcV023615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Fri, 13 Dec 2019 18:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355719 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 355719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 18:18:15 -0000 Author: bdragon Date: Fri Dec 13 18:18:14 2019 New Revision: 355719 URL: https://svnweb.freebsd.org/changeset/base/355719 Log: [PowerPC] Enable TLS usage in system libraries on ELFv2. Currently, __NO_TLS is defined to 1 on powerpc64. TLS usage works much better on ELFv2 due to the modern tooling, so take the opportunity to reenable TLS on ELFv2. If you are using a self-built ELFv2 environment on powerpc64, you will have to run installworld twice due to RuneLocale changes. This is the only known regression, and if you are using the ELFv2 isos, you likely already have the updated libraries installed, as this change is part of the patchset that the isos integrate. (No UPDATING note about this because ELFv2 is still an unofficial build.) Reviewed by: luporl, Alfredo Dal'Ava Junior Differential Revision: https://reviews.freebsd.org/D22524 Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Fri Dec 13 17:52:09 2019 (r355718) +++ head/sys/sys/cdefs.h Fri Dec 13 18:18:14 2019 (r355719) @@ -774,7 +774,8 @@ #endif #endif /* __STDC_WANT_LIB_EXT1__ */ -#if defined(__mips) || defined(__powerpc64__) || defined(__riscv) +#if defined(__mips) || defined(__riscv) || \ + (defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)) #define __NO_TLS 1 #endif From owner-svn-src-all@freebsd.org Fri Dec 13 18:28:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76AE31D3CF5; Fri, 13 Dec 2019 18:28:02 +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 47ZK0f2FF1z4Km1; Fri, 13 Dec 2019 18:28:02 +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 43418183D1; Fri, 13 Dec 2019 18:28:02 +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 xBDIS2sT029564; Fri, 13 Dec 2019 18:28:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDIS2as029563; Fri, 13 Dec 2019 18:28:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912131828.xBDIS2as029563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Dec 2019 18:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355720 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 18:28:02 -0000 Author: markj Date: Fri Dec 13 18:28:01 2019 New Revision: 355720 URL: https://svnweb.freebsd.org/changeset/base/355720 Log: Restore the reservation of boot pages for bucket zones after r355707. uma_startup2() sets booted = BOOT_BUCKETS after calling bucket_init(), but before that assignment, startup_alloc() will use pages from the reserved pool, so the bucket zones themselves are still allocated using startup pages. Reviewed by: rlibby Reported by: Jenkins via lwhsu Differential Revision: https://reviews.freebsd.org/D22797 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Dec 13 18:18:14 2019 (r355719) +++ head/sys/vm/uma_core.c Fri Dec 13 18:28:01 2019 (r355720) @@ -2295,10 +2295,10 @@ zone_foreach(void (*zfunc)(uma_zone_t, void *arg), voi /* * Count how many pages do we need to bootstrap. VM supplies * its need in early zones in the argument, we add up our zones, - * which consist of the UMA Slabs and UMA Hash zones. The + * which consist of the UMA Slabs, UMA Hash and 9 Bucket zones. The * zone of zones and zone of kegs are accounted separately. */ -#define UMA_BOOT_ZONES 2 +#define UMA_BOOT_ZONES 11 /* Zone of zones and zone of kegs have arbitrary alignment. */ #define UMA_BOOT_ALIGN 32 static int zsize, ksize; From owner-svn-src-all@freebsd.org Fri Dec 13 18:35:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7288C1D3F02; Fri, 13 Dec 2019 18:35:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47ZK9d2JRMz4LBF; Fri, 13 Dec 2019 18:35:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45F5718595; Fri, 13 Dec 2019 18:35:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDIZnub035557; Fri, 13 Dec 2019 18:35:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDIZmx2035553; Fri, 13 Dec 2019 18:35:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912131835.xBDIZmx2035553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 13 Dec 2019 18:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355721 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 355721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 18:35:49 -0000 Author: imp Date: Fri Dec 13 18:35:48 2019 New Revision: 355721 URL: https://svnweb.freebsd.org/changeset/base/355721 Log: Move to using bool instead of boolean_t While there are subtle semantic differences between bool and boolean_t, none of them matter in these cases. Prefer true/false when dealing with bool type. Preserve a couple of TRUEs since they are passed into int args into CAM. Preserve a couple of FALSEs when used for status.done, an int. Differential Revision: https://reviews.freebsd.org/D20999 Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Fri Dec 13 18:28:01 2019 (r355720) +++ head/sys/dev/nvme/nvme_ctrlr.c Fri Dec 13 18:35:48 2019 (r355721) @@ -181,7 +181,7 @@ nvme_ctrlr_fail(struct nvme_controller *ctrlr) { int i; - ctrlr->is_failed = TRUE; + ctrlr->is_failed = true; nvme_admin_qpair_disable(&ctrlr->adminq); nvme_qpair_fail(&ctrlr->adminq); if (ctrlr->ioq != NULL) { @@ -546,7 +546,7 @@ nvme_ctrlr_construct_namespaces(struct nvme_controller return (0); } -static boolean_t +static bool is_log_page_id_valid(uint8_t page_id) { @@ -558,10 +558,10 @@ is_log_page_id_valid(uint8_t page_id) case NVME_LOG_COMMAND_EFFECT: case NVME_LOG_RES_NOTIFICATION: case NVME_LOG_SANITIZE_STATUS: - return (TRUE); + return (true); } - return (FALSE); + return (false); } static uint32_t @@ -782,7 +782,7 @@ nvme_ctrlr_construct_and_submit_aer(struct nvme_contro * Disable timeout here, since asynchronous event requests should by * nature never be timed out. */ - req->timeout = FALSE; + req->timeout = false; req->cmd.opc = NVME_OPC_ASYNC_EVENT_REQUEST; nvme_ctrlr_submit_admin_request(ctrlr, req); } @@ -1198,7 +1198,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, de TASK_INIT(&ctrlr->reset_task, 0, nvme_ctrlr_reset_task, ctrlr); TASK_INIT(&ctrlr->fail_req_task, 0, nvme_ctrlr_fail_req_task, ctrlr); STAILQ_INIT(&ctrlr->fail_req); - ctrlr->is_failed = FALSE; + ctrlr->is_failed = false; make_dev_args_init(&md_args); md_args.mda_devsw = &nvme_ctrlr_cdevsw; Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Fri Dec 13 18:28:01 2019 (r355720) +++ head/sys/dev/nvme/nvme_private.h Fri Dec 13 18:35:48 2019 (r355721) @@ -141,7 +141,7 @@ struct nvme_request { } u; uint32_t type; uint32_t payload_size; - boolean_t timeout; + bool timeout; nvme_cb_fn_t cb_fn; void *cb_arg; int32_t retries; @@ -214,7 +214,7 @@ struct nvme_qpair { struct nvme_tracker **act_tr; - boolean_t is_enabled; + bool is_enabled; struct mtx lock __aligned(CACHE_LINE_SIZE); @@ -322,7 +322,7 @@ struct nvme_controller { uint32_t is_initialized; uint32_t notification_sent; - boolean_t is_failed; + bool is_failed; STAILQ_HEAD(, nvme_request) fail_req; }; @@ -487,7 +487,7 @@ _nvme_allocate_request(nvme_cb_fn_t cb_fn, void *cb_ar if (req != NULL) { req->cb_fn = cb_fn; req->cb_arg = cb_arg; - req->timeout = TRUE; + req->timeout = true; } return (req); } Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Fri Dec 13 18:28:01 2019 (r355720) +++ head/sys/dev/nvme/nvme_qpair.c Fri Dec 13 18:35:48 2019 (r355721) @@ -357,7 +357,7 @@ nvme_qpair_print_completion(struct nvme_qpair *qpair, cpl->cdw0); } -static boolean_t +static bool nvme_completion_is_retry(const struct nvme_completion *cpl) { uint8_t sct, sc, dnr; @@ -423,7 +423,7 @@ nvme_qpair_complete_tracker(struct nvme_tracker *tr, { struct nvme_qpair * qpair = tr->qpair; struct nvme_request *req; - boolean_t retry, error, retriable; + bool retry, error, retriable; req = tr->req; error = nvme_completion_is_error(cpl); @@ -508,7 +508,7 @@ nvme_qpair_manual_complete_request(struct nvme_qpair * struct nvme_request *req, uint32_t sct, uint32_t sc) { struct nvme_completion cpl; - boolean_t error; + bool error; memset(&cpl, 0, sizeof(cpl)); cpl.sqid = qpair->id; @@ -1127,7 +1127,7 @@ static void nvme_qpair_enable(struct nvme_qpair *qpair) { - qpair->is_enabled = TRUE; + qpair->is_enabled = true; } void @@ -1215,7 +1215,7 @@ nvme_qpair_disable(struct nvme_qpair *qpair) { struct nvme_tracker *tr; - qpair->is_enabled = FALSE; + qpair->is_enabled = false; mtx_lock(&qpair->lock); TAILQ_FOREACH(tr, &qpair->outstanding_tr, tailq) callout_stop(&tr->timer); From owner-svn-src-all@freebsd.org Fri Dec 13 18:39:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5F3A1D3F8F; Fri, 13 Dec 2019 18:39:37 +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 47ZKG15kQ6z4LM0; Fri, 13 Dec 2019 18:39:37 +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 BFD34185BB; Fri, 13 Dec 2019 18:39:37 +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 xBDIdbWf035762; Fri, 13 Dec 2019 18:39:37 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDIdbDr035758; Fri, 13 Dec 2019 18:39:37 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201912131839.xBDIdbDr035758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 13 Dec 2019 18:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355722 - in head/sys: compat/linux kern sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: compat/linux kern sys X-SVN-Commit-Revision: 355722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 18:39:38 -0000 Author: trasz Date: Fri Dec 13 18:39:36 2019 New Revision: 355722 URL: https://svnweb.freebsd.org/changeset/base/355722 Log: Add kern_getsid() and use it in Linuxulator; no functional changes. Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22647 Modified: head/sys/compat/linux/linux_misc.c head/sys/kern/kern_prot.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Fri Dec 13 18:35:48 2019 (r355721) +++ head/sys/compat/linux/linux_misc.c Fri Dec 13 18:39:36 2019 (r355722) @@ -1599,14 +1599,11 @@ linux_getuid(struct thread *td, struct linux_getuid_ar return (0); } - int linux_getsid(struct thread *td, struct linux_getsid_args *args) { - struct getsid_args bsd; - bsd.pid = args->pid; - return (sys_getsid(td, &bsd)); + return (kern_getsid(td, args->pid)); } int Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Fri Dec 13 18:35:48 2019 (r355721) +++ head/sys/kern/kern_prot.c Fri Dec 13 18:39:36 2019 (r355722) @@ -190,14 +190,21 @@ struct getsid_args { int sys_getsid(struct thread *td, struct getsid_args *uap) { + + return (kern_getsid(td, uap->pid)); +} + +int +kern_getsid(struct thread *td, pid_t pid) +{ struct proc *p; int error; - if (uap->pid == 0) { + if (pid == 0) { p = td->td_proc; PROC_LOCK(p); } else { - p = pfind(uap->pid); + p = pfind(pid); if (p == NULL) return (ESRCH); error = p_cansee(td, p); Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Fri Dec 13 18:35:48 2019 (r355721) +++ head/sys/sys/syscallsubr.h Fri Dec 13 18:39:36 2019 (r355722) @@ -140,6 +140,7 @@ int kern_getppid(struct thread *); int kern_getpeername(struct thread *td, int fd, struct sockaddr **sa, socklen_t *alen); int kern_getrusage(struct thread *td, int who, struct rusage *rup); +int kern_getsid(struct thread *td, pid_t pid); int kern_getsockname(struct thread *td, int fd, struct sockaddr **sa, socklen_t *alen); int kern_getsockopt(struct thread *td, int s, int level, int name, From owner-svn-src-all@freebsd.org Fri Dec 13 18:44:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E26D81D415E; Fri, 13 Dec 2019 18:44:03 +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 47ZKM75hL8z4LkT; Fri, 13 Dec 2019 18:44:03 +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 BE79F18778; Fri, 13 Dec 2019 18:44:03 +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 xBDIi3FU041207; Fri, 13 Dec 2019 18:44:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDIi3kP041204; Fri, 13 Dec 2019 18:44:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201912131844.xBDIi3kP041204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 13 Dec 2019 18:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355723 - in head/sys: compat/linux kern sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: compat/linux kern sys X-SVN-Commit-Revision: 355723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 18:44:03 -0000 Author: trasz Date: Fri Dec 13 18:44:02 2019 New Revision: 355723 URL: https://svnweb.freebsd.org/changeset/base/355723 Log: Add kern_kill() and use it in Linuxulator. It's just a cleanup, no functional changes. Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22645 Modified: head/sys/compat/linux/linux_signal.c head/sys/kern/kern_sig.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/linux/linux_signal.c ============================================================================== --- head/sys/compat/linux/linux_signal.c Fri Dec 13 18:39:36 2019 (r355722) +++ head/sys/compat/linux/linux_signal.c Fri Dec 13 18:44:02 2019 (r355723) @@ -415,10 +415,7 @@ linux_rt_sigtimedwait(struct thread *td, int linux_kill(struct thread *td, struct linux_kill_args *args) { - struct kill_args /* { - int pid; - int signum; - } */ tmp; + int l_signum; /* * Allow signal 0 as a means to check for privileges @@ -427,12 +424,11 @@ linux_kill(struct thread *td, struct linux_kill_args * return (EINVAL); if (args->signum > 0) - tmp.signum = linux_to_bsd_signal(args->signum); + l_signum = linux_to_bsd_signal(args->signum); else - tmp.signum = 0; + l_signum = 0; - tmp.pid = args->pid; - return (sys_kill(td, &tmp)); + return (kern_kill(td, args->pid, l_signum)); } static int Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Fri Dec 13 18:39:36 2019 (r355722) +++ head/sys/kern/kern_sig.c Fri Dec 13 18:44:02 2019 (r355723) @@ -1772,6 +1772,13 @@ struct kill_args { int sys_kill(struct thread *td, struct kill_args *uap) { + + return (kern_kill(td, uap->pid, uap->signum)); +} + +int +kern_kill(struct thread *td, pid_t pid, int signum) +{ ksiginfo_t ksi; struct proc *p; int error; @@ -1781,38 +1788,38 @@ sys_kill(struct thread *td, struct kill_args *uap) * The main rationale behind this is that abort(3) is implemented as * kill(getpid(), SIGABRT). */ - if (IN_CAPABILITY_MODE(td) && uap->pid != td->td_proc->p_pid) + if (IN_CAPABILITY_MODE(td) && pid != td->td_proc->p_pid) return (ECAPMODE); - AUDIT_ARG_SIGNUM(uap->signum); - AUDIT_ARG_PID(uap->pid); - if ((u_int)uap->signum > _SIG_MAXSIG) + AUDIT_ARG_SIGNUM(signum); + AUDIT_ARG_PID(pid); + if ((u_int)signum > _SIG_MAXSIG) return (EINVAL); ksiginfo_init(&ksi); - ksi.ksi_signo = uap->signum; + ksi.ksi_signo = signum; ksi.ksi_code = SI_USER; ksi.ksi_pid = td->td_proc->p_pid; ksi.ksi_uid = td->td_ucred->cr_ruid; - if (uap->pid > 0) { + if (pid > 0) { /* kill single process */ - if ((p = pfind_any(uap->pid)) == NULL) + if ((p = pfind_any(pid)) == NULL) return (ESRCH); AUDIT_ARG_PROCESS(p); - error = p_cansignal(td, p, uap->signum); - if (error == 0 && uap->signum) - pksignal(p, uap->signum, &ksi); + error = p_cansignal(td, p, signum); + if (error == 0 && signum) + pksignal(p, signum, &ksi); PROC_UNLOCK(p); return (error); } - switch (uap->pid) { + switch (pid) { case -1: /* broadcast signal */ - return (killpg1(td, uap->signum, 0, 1, &ksi)); + return (killpg1(td, signum, 0, 1, &ksi)); case 0: /* signal own process group */ - return (killpg1(td, uap->signum, 0, 0, &ksi)); + return (killpg1(td, signum, 0, 0, &ksi)); default: /* negative explicit process group */ - return (killpg1(td, uap->signum, -uap->pid, 0, &ksi)); + return (killpg1(td, signum, -pid, 0, &ksi)); } /* NOTREACHED */ } Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Fri Dec 13 18:39:36 2019 (r355722) +++ head/sys/sys/syscallsubr.h Fri Dec 13 18:44:02 2019 (r355723) @@ -156,6 +156,7 @@ int kern_kevent_anonymous(struct thread *td, int neven int kern_kevent_fp(struct thread *td, struct file *fp, int nchanges, int nevents, struct kevent_copyops *k_ops, const struct timespec *timeout); +int kern_kill(struct thread *td, pid_t pid, int signum); int kern_kqueue(struct thread *td, int flags, struct filecaps *fcaps); int kern_kldload(struct thread *td, const char *file, int *fileid); int kern_kldstat(struct thread *td, int fileid, struct kld_file_stat *stat); From owner-svn-src-all@freebsd.org Fri Dec 13 19:22:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F21FD1D49BE; Fri, 13 Dec 2019 19:22:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47ZLBw6nv3z4N8r; Fri, 13 Dec 2019 19:22:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E436D18EE2; Fri, 13 Dec 2019 19:22:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDJM0Ca060562; Fri, 13 Dec 2019 19:22:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDJLxri060525; Fri, 13 Dec 2019 19:21:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912131921.xBDJLxri060525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Dec 2019 19:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355724 - in head: sys/amd64/include sys/amd64/vmm/amd sys/amd64/vmm/intel usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: sys/amd64/include sys/amd64/vmm/amd sys/amd64/vmm/intel usr.sbin/bhyve X-SVN-Commit-Revision: 355724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 19:22:01 -0000 Author: jhb Date: Fri Dec 13 19:21:58 2019 New Revision: 355724 URL: https://svnweb.freebsd.org/changeset/base/355724 Log: Support software breakpoints in the debug server on Intel CPUs. - Allow the userland hypervisor to intercept breakpoint exceptions (BP#) in the guest. A new capability (VM_CAP_BPT_EXIT) is used to enable this feature. These exceptions are reported to userland via a new VM_EXITCODE_BPT that includes the length of the original breakpoint instruction. If userland wishes to pass the exception through to the guest, it must be explicitly re-injected via vm_inject_exception(). - Export VMCS_ENTRY_INST_LENGTH as a VM_REG_GUEST_ENTRY_INST_LENGTH pseudo-register. Injecting a BP# on Intel requires setting this to the length of the breakpoint instruction. AMD SVM currently ignores writes to this register (but reports success) and fails to read it. - Rework the per-vCPU state tracked by the debug server. Rather than a single 'stepping_vcpu' global, add a structure for each vCPU that tracks state about that vCPU ('stepping', 'stepped', and 'hit_swbreak'). A global 'stopped_vcpu' tracks which vCPU is currently reporting an event. Event handlers for MTRAP and breakpoint exits loop until the associated event is reported to the debugger. Breakpoint events are discarded if the breakpoint is not present when a vCPU resumes in the breakpoint handler to retry submitting the breakpoint event. - Maintain a linked-list of active breakpoints in response to the GDB 'Z0' and 'z0' packets. Reviewed by: markj (earlier version) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D20309 Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/intel/vmcs.c head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/intel/vmx.h head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/gdb.c head/usr.sbin/bhyve/gdb.h Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Fri Dec 13 18:44:02 2019 (r355723) +++ head/sys/amd64/include/vmm.h Fri Dec 13 19:21:58 2019 (r355724) @@ -95,6 +95,7 @@ enum vm_reg_name { VM_REG_GUEST_DR2, VM_REG_GUEST_DR3, VM_REG_GUEST_DR6, + VM_REG_GUEST_ENTRY_INST_LENGTH, VM_REG_LAST }; @@ -455,6 +456,7 @@ enum vm_cap_type { VM_CAP_PAUSE_EXIT, VM_CAP_UNRESTRICTED_GUEST, VM_CAP_ENABLE_INVPCID, + VM_CAP_BPT_EXIT, VM_CAP_MAX }; @@ -580,6 +582,7 @@ enum vm_exitcode { VM_EXITCODE_REQIDLE, VM_EXITCODE_DEBUG, VM_EXITCODE_VMINSN, + VM_EXITCODE_BPT, VM_EXITCODE_MAX }; @@ -666,6 +669,9 @@ struct vm_exit { uint64_t exitinfo1; uint64_t exitinfo2; } svm; + struct { + int inst_length; + } bpt; struct { uint32_t code; /* ecx value */ uint64_t wval; Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Fri Dec 13 18:44:02 2019 (r355723) +++ head/sys/amd64/vmm/amd/svm.c Fri Dec 13 19:21:58 2019 (r355724) @@ -2187,6 +2187,11 @@ svm_setreg(void *arg, int vcpu, int ident, uint64_t va return (0); } + if (ident == VM_REG_GUEST_ENTRY_INST_LENGTH) { + /* Ignore. */ + return (0); + } + /* * XXX deal with CR3 and invalidate TLB entries tagged with the * vcpu's ASID. This needs to be treated differently depending on Modified: head/sys/amd64/vmm/intel/vmcs.c ============================================================================== --- head/sys/amd64/vmm/intel/vmcs.c Fri Dec 13 18:44:02 2019 (r355723) +++ head/sys/amd64/vmm/intel/vmcs.c Fri Dec 13 19:21:58 2019 (r355724) @@ -120,6 +120,8 @@ vmcs_field_encoding(int ident) return (VMCS_GUEST_PDPTE2); case VM_REG_GUEST_PDPTE3: return (VMCS_GUEST_PDPTE3); + case VM_REG_GUEST_ENTRY_INST_LENGTH: + return (VMCS_ENTRY_INST_LENGTH); default: return (-1); } Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Fri Dec 13 18:44:02 2019 (r355723) +++ head/sys/amd64/vmm/intel/vmx.c Fri Dec 13 19:21:58 2019 (r355724) @@ -1071,6 +1071,7 @@ vmx_vminit(struct vm *vm, pmap_t pmap) vmx->cap[i].set = 0; vmx->cap[i].proc_ctls = procbased_ctls; vmx->cap[i].proc_ctls2 = procbased_ctls2; + vmx->cap[i].exc_bitmap = exc_bitmap; vmx->state[i].nextrip = ~0; vmx->state[i].lastcpu = NOCPU; @@ -2547,6 +2548,18 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ return (1); } + /* + * If the hypervisor has requested user exits for + * debug exceptions, bounce them out to userland. + */ + if (intr_type == VMCS_INTR_T_SWEXCEPTION && intr_vec == IDT_BP && + (vmx->cap[vcpu].set & (1 << VM_CAP_BPT_EXIT))) { + vmexit->exitcode = VM_EXITCODE_BPT; + vmexit->u.bpt.inst_length = vmexit->inst_length; + vmexit->inst_length = 0; + break; + } + if (intr_vec == IDT_PF) { error = vmxctx_setreg(vmxctx, VM_REG_GUEST_CR2, qual); KASSERT(error == 0, ("%s: vmxctx_setreg(cr2) error %d", @@ -3296,6 +3309,9 @@ vmx_getcap(void *arg, int vcpu, int type, int *retval) if (cap_invpcid) ret = 0; break; + case VM_CAP_BPT_EXIT: + ret = 0; + break; default: break; } @@ -3367,11 +3383,25 @@ vmx_setcap(void *arg, int vcpu, int type, int val) reg = VMCS_SEC_PROC_BASED_CTLS; } break; + case VM_CAP_BPT_EXIT: + retval = 0; + + /* Don't change the bitmap if we are tracing all exceptions. */ + if (vmx->cap[vcpu].exc_bitmap != 0xffffffff) { + pptr = &vmx->cap[vcpu].exc_bitmap; + baseval = *pptr; + flag = (1 << IDT_BP); + reg = VMCS_EXCEPTION_BITMAP; + } + break; default: break; } - if (retval == 0) { + if (retval) + return (retval); + + if (pptr != NULL) { if (val) { baseval |= flag; } else { @@ -3381,26 +3411,23 @@ vmx_setcap(void *arg, int vcpu, int type, int val) error = vmwrite(reg, baseval); VMCLEAR(vmcs); - if (error) { - retval = error; - } else { - /* - * Update optional stored flags, and record - * setting - */ - if (pptr != NULL) { - *pptr = baseval; - } + if (error) + return (error); - if (val) { - vmx->cap[vcpu].set |= (1 << type); - } else { - vmx->cap[vcpu].set &= ~(1 << type); - } - } + /* + * Update optional stored flags, and record + * setting + */ + *pptr = baseval; } - return (retval); + if (val) { + vmx->cap[vcpu].set |= (1 << type); + } else { + vmx->cap[vcpu].set &= ~(1 << type); + } + + return (0); } struct vlapic_vtx { Modified: head/sys/amd64/vmm/intel/vmx.h ============================================================================== --- head/sys/amd64/vmm/intel/vmx.h Fri Dec 13 18:44:02 2019 (r355723) +++ head/sys/amd64/vmm/intel/vmx.h Fri Dec 13 19:21:58 2019 (r355724) @@ -87,6 +87,7 @@ struct vmxcap { int set; uint32_t proc_ctls; uint32_t proc_ctls2; + uint32_t exc_bitmap; }; struct vmxstate { Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Fri Dec 13 18:44:02 2019 (r355723) +++ head/usr.sbin/bhyve/bhyve.8 Fri Dec 13 19:21:58 2019 (r355724) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 12, 2019 +.Dd December 13, 2019 .Dt BHYVE 8 .Os .Sh NAME @@ -530,7 +530,10 @@ The running guest can be interrupted by the debugger a .Pp Single stepping is only supported on Intel CPUs supporting the MTRAP VM exit. .Pp -Breakpoints are not supported. +Breakpoints are supported on Intel CPUs that support single stepping. +Note that continuing from a breakpoint while interrupts are enabled in the +guest may not work as expected due to timer interrupts firing while single +stepping over the breakpoint. .Sh SIGNAL HANDLING .Nm deals with the following signals: Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Fri Dec 13 18:44:02 2019 (r355723) +++ head/usr.sbin/bhyve/bhyverun.c Fri Dec 13 19:21:58 2019 (r355724) @@ -783,6 +783,18 @@ vmexit_debug(struct vmctx *ctx, struct vm_exit *vmexit return (VMEXIT_CONTINUE); } +static int +vmexit_breakpoint(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) +{ + + if (gdb_port == 0) { + fprintf(stderr, "vm_loop: unexpected VMEXIT_DEBUG\n"); + exit(4); + } + gdb_cpu_breakpoint(*pvcpu, vmexit); + return (VMEXIT_CONTINUE); +} + static vmexit_handler_t handler[VM_EXITCODE_MAX] = { [VM_EXITCODE_INOUT] = vmexit_inout, [VM_EXITCODE_INOUT_STR] = vmexit_inout, @@ -798,6 +810,7 @@ static vmexit_handler_t handler[VM_EXITCODE_MAX] = { [VM_EXITCODE_SUSPENDED] = vmexit_suspend, [VM_EXITCODE_TASK_SWITCH] = vmexit_task_switch, [VM_EXITCODE_DEBUG] = vmexit_debug, + [VM_EXITCODE_BPT] = vmexit_breakpoint, }; static void Modified: head/usr.sbin/bhyve/gdb.c ============================================================================== --- head/usr.sbin/bhyve/gdb.c Fri Dec 13 18:44:02 2019 (r355723) +++ head/usr.sbin/bhyve/gdb.c Fri Dec 13 19:21:58 2019 (r355724) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -58,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include "bhyverun.h" +#include "gdb.h" #include "mem.h" #include "mevent.h" @@ -75,8 +77,7 @@ static struct mevent *read_event, *write_event; static cpuset_t vcpus_active, vcpus_suspended, vcpus_waiting; static pthread_mutex_t gdb_lock; static pthread_cond_t idle_vcpus; -static bool stop_pending, first_stop; -static int stepping_vcpu, stopped_vcpu; +static bool first_stop, report_next_stop, swbreak_enabled; /* * An I/O buffer contains 'capacity' bytes of room at 'data'. For a @@ -92,11 +93,44 @@ struct io_buffer { size_t len; }; +struct breakpoint { + uint64_t gpa; + uint8_t shadow_inst; + TAILQ_ENTRY(breakpoint) link; +}; + +/* + * When a vCPU stops to due to an event that should be reported to the + * debugger, information about the event is stored in this structure. + * The vCPU thread then sets 'stopped_vcpu' if it is not already set + * and stops other vCPUs so the event can be reported. The + * report_stop() function reports the event for the 'stopped_vcpu' + * vCPU. When the debugger resumes execution via continue or step, + * the event for 'stopped_vcpu' is cleared. vCPUs will loop in their + * event handlers until the associated event is reported or disabled. + * + * An idle vCPU will have all of the boolean fields set to false. + * + * When a vCPU is stepped, 'stepping' is set to true when the vCPU is + * released to execute the stepped instruction. When the vCPU reports + * the stepping trap, 'stepped' is set. + * + * When a vCPU hits a breakpoint set by the debug server, + * 'hit_swbreak' is set to true. + */ +struct vcpu_state { + bool stepping; + bool stepped; + bool hit_swbreak; +}; + static struct io_buffer cur_comm, cur_resp; static uint8_t cur_csum; -static int cur_vcpu; static struct vmctx *ctx; static int cur_fd = -1; +static TAILQ_HEAD(, breakpoint) breakpoints; +static struct vcpu_state *vcpu_state; +static int cur_vcpu, stopped_vcpu; const int gdb_regset[] = { VM_REG_GUEST_RAX, @@ -183,6 +217,8 @@ debug(const char *fmt, ...) #define debug(...) #endif +static void remove_all_sw_breakpoints(void); + static int guest_paging_info(int vcpu, struct vm_guest_paging *paging) { @@ -351,6 +387,11 @@ close_connection(void) io_buffer_reset(&cur_resp); cur_fd = -1; + remove_all_sw_breakpoints(); + + /* Clear any pending events. */ + memset(vcpu_state, 0, guest_ncpus * sizeof(*vcpu_state)); + /* Resume any stopped vCPUs. */ gdb_resume_vcpus(); pthread_mutex_unlock(&gdb_lock); @@ -556,7 +597,7 @@ append_integer(unsigned int value) if (value == 0) append_char('0'); else - append_unsigned_be(value, fls(value) + 7 / 8); + append_unsigned_be(value, (fls(value) + 7) / 8); } static void @@ -609,40 +650,81 @@ parse_threadid(const uint8_t *data, size_t len) return (parse_integer(data, len)); } +/* + * Report the current stop event to the debugger. If the stop is due + * to an event triggered on a specific vCPU such as a breakpoint or + * stepping trap, stopped_vcpu will be set to the vCPU triggering the + * stop. If 'set_cur_vcpu' is true, then cur_vcpu will be updated to + * the reporting vCPU for vCPU events. + */ static void -report_stop(void) +report_stop(bool set_cur_vcpu) { + struct vcpu_state *vs; start_packet(); - if (stopped_vcpu == -1) + if (stopped_vcpu == -1) { append_char('S'); - else + append_byte(GDB_SIGNAL_TRAP); + } else { + vs = &vcpu_state[stopped_vcpu]; + if (set_cur_vcpu) + cur_vcpu = stopped_vcpu; append_char('T'); - append_byte(GDB_SIGNAL_TRAP); - if (stopped_vcpu != -1) { + append_byte(GDB_SIGNAL_TRAP); append_string("thread:"); append_integer(stopped_vcpu + 1); append_char(';'); + if (vs->hit_swbreak) { + debug("$vCPU %d reporting swbreak\n", stopped_vcpu); + if (swbreak_enabled) + append_string("swbreak:;"); + } else if (vs->stepped) + debug("$vCPU %d reporting step\n", stopped_vcpu); + else + debug("$vCPU %d reporting ???\n", stopped_vcpu); } - stopped_vcpu = -1; finish_packet(); + report_next_stop = false; } +/* + * If this stop is due to a vCPU event, clear that event to mark it as + * acknowledged. + */ static void +discard_stop(void) +{ + struct vcpu_state *vs; + + if (stopped_vcpu != -1) { + vs = &vcpu_state[stopped_vcpu]; + vs->hit_swbreak = false; + vs->stepped = false; + stopped_vcpu = -1; + } + report_next_stop = true; +} + +static void gdb_finish_suspend_vcpus(void) { if (first_stop) { first_stop = false; stopped_vcpu = -1; - } else if (response_pending()) - stop_pending = true; - else { - report_stop(); + } else if (report_next_stop) { + assert(!response_pending()); + report_stop(true); send_pending_data(cur_fd); } } +/* + * vCPU threads invoke this function whenever the vCPU enters the + * debug server to pause or report an event. vCPU threads wait here + * as long as the debug server keeps them suspended. + */ static void _gdb_cpu_suspend(int vcpu, bool report_stop) { @@ -651,19 +733,28 @@ _gdb_cpu_suspend(int vcpu, bool report_stop) CPU_SET(vcpu, &vcpus_waiting); if (report_stop && CPU_CMP(&vcpus_waiting, &vcpus_suspended) == 0) gdb_finish_suspend_vcpus(); - while (CPU_ISSET(vcpu, &vcpus_suspended) && vcpu != stepping_vcpu) + while (CPU_ISSET(vcpu, &vcpus_suspended)) pthread_cond_wait(&idle_vcpus, &gdb_lock); CPU_CLR(vcpu, &vcpus_waiting); debug("$vCPU %d resuming\n", vcpu); } +/* + * Invoked at the start of a vCPU thread's execution to inform the + * debug server about the new thread. + */ void gdb_cpu_add(int vcpu) { debug("$vCPU %d starting\n", vcpu); pthread_mutex_lock(&gdb_lock); + assert(vcpu < guest_ncpus); CPU_SET(vcpu, &vcpus_active); + if (!TAILQ_EMPTY(&breakpoints)) { + vm_set_capability(ctx, vcpu, VM_CAP_BPT_EXIT, 1); + debug("$vCPU %d enabled breakpoint exits\n", vcpu); + } /* * If a vcpu is added while vcpus are stopped, suspend the new @@ -677,44 +768,149 @@ gdb_cpu_add(int vcpu) pthread_mutex_unlock(&gdb_lock); } +/* + * Invoked by vCPU before resuming execution. This enables stepping + * if the vCPU is marked as stepping. + */ +static void +gdb_cpu_resume(int vcpu) +{ + struct vcpu_state *vs; + int error; + + vs = &vcpu_state[vcpu]; + + /* + * Any pending event should already be reported before + * resuming. + */ + assert(vs->hit_swbreak == false); + assert(vs->stepped == false); + if (vs->stepping) { + error = vm_set_capability(ctx, vcpu, VM_CAP_MTRAP_EXIT, 1); + assert(error == 0); + } +} + +/* + * Handler for VM_EXITCODE_DEBUG used to suspend a vCPU when the guest + * has been suspended due to an event on different vCPU or in response + * to a guest-wide suspend such as Ctrl-C or the stop on attach. + */ void gdb_cpu_suspend(int vcpu) { pthread_mutex_lock(&gdb_lock); _gdb_cpu_suspend(vcpu, true); + gdb_cpu_resume(vcpu); pthread_mutex_unlock(&gdb_lock); } +static void +gdb_suspend_vcpus(void) +{ + + assert(pthread_mutex_isowned_np(&gdb_lock)); + debug("suspending all CPUs\n"); + vcpus_suspended = vcpus_active; + vm_suspend_cpu(ctx, -1); + if (CPU_CMP(&vcpus_waiting, &vcpus_suspended) == 0) + gdb_finish_suspend_vcpus(); +} + +/* + * Handler for VM_EXITCODE_MTRAP reported when a vCPU single-steps via + * the VT-x-specific MTRAP exit. + */ void gdb_cpu_mtrap(int vcpu) { + struct vcpu_state *vs; debug("$vCPU %d MTRAP\n", vcpu); pthread_mutex_lock(&gdb_lock); - if (vcpu == stepping_vcpu) { - stepping_vcpu = -1; + vs = &vcpu_state[vcpu]; + if (vs->stepping) { + vs->stepping = false; + vs->stepped = true; vm_set_capability(ctx, vcpu, VM_CAP_MTRAP_EXIT, 0); - vm_suspend_cpu(ctx, vcpu); - assert(stopped_vcpu == -1); - stopped_vcpu = vcpu; - _gdb_cpu_suspend(vcpu, true); + while (vs->stepped) { + if (stopped_vcpu == -1) { + debug("$vCPU %d reporting step\n", vcpu); + stopped_vcpu = vcpu; + gdb_suspend_vcpus(); + } + _gdb_cpu_suspend(vcpu, true); + } + gdb_cpu_resume(vcpu); } pthread_mutex_unlock(&gdb_lock); } -static void -gdb_suspend_vcpus(void) +static struct breakpoint * +find_breakpoint(uint64_t gpa) { + struct breakpoint *bp; - assert(pthread_mutex_isowned_np(&gdb_lock)); - debug("suspending all CPUs\n"); - vcpus_suspended = vcpus_active; - vm_suspend_cpu(ctx, -1); - if (CPU_CMP(&vcpus_waiting, &vcpus_suspended) == 0) - gdb_finish_suspend_vcpus(); + TAILQ_FOREACH(bp, &breakpoints, link) { + if (bp->gpa == gpa) + return (bp); + } + return (NULL); } +void +gdb_cpu_breakpoint(int vcpu, struct vm_exit *vmexit) +{ + struct breakpoint *bp; + struct vcpu_state *vs; + uint64_t gpa; + int error; + + pthread_mutex_lock(&gdb_lock); + error = guest_vaddr2paddr(vcpu, vmexit->rip, &gpa); + assert(error == 1); + bp = find_breakpoint(gpa); + if (bp != NULL) { + vs = &vcpu_state[vcpu]; + assert(vs->stepping == false); + assert(vs->stepped == false); + assert(vs->hit_swbreak == false); + vs->hit_swbreak = true; + vm_set_register(ctx, vcpu, VM_REG_GUEST_RIP, vmexit->rip); + for (;;) { + if (stopped_vcpu == -1) { + debug("$vCPU %d reporting breakpoint at rip %#lx\n", vcpu, + vmexit->rip); + stopped_vcpu = vcpu; + gdb_suspend_vcpus(); + } + _gdb_cpu_suspend(vcpu, true); + if (!vs->hit_swbreak) { + /* Breakpoint reported. */ + break; + } + bp = find_breakpoint(gpa); + if (bp == NULL) { + /* Breakpoint was removed. */ + vs->hit_swbreak = false; + break; + } + } + gdb_cpu_resume(vcpu); + } else { + debug("$vCPU %d injecting breakpoint at rip %#lx\n", vcpu, + vmexit->rip); + error = vm_set_register(ctx, vcpu, + VM_REG_GUEST_ENTRY_INST_LENGTH, vmexit->u.bpt.inst_length); + assert(error == 0); + error = vm_inject_exception(ctx, vcpu, IDT_BP, 0, 0, 0); + assert(error == 0); + } + pthread_mutex_unlock(&gdb_lock); +} + static bool gdb_step_vcpu(int vcpu) { @@ -724,9 +920,11 @@ gdb_step_vcpu(int vcpu) error = vm_get_capability(ctx, vcpu, VM_CAP_MTRAP_EXIT, &val); if (error < 0) return (false); - error = vm_set_capability(ctx, vcpu, VM_CAP_MTRAP_EXIT, 1); + + discard_stop(); + vcpu_state[vcpu].stepping = true; vm_resume_cpu(ctx, vcpu); - stepping_vcpu = vcpu; + CPU_CLR(vcpu, &vcpus_suspended); pthread_cond_broadcast(&idle_vcpus); return (true); } @@ -981,6 +1179,174 @@ gdb_write_mem(const uint8_t *data, size_t len) } static bool +set_breakpoint_caps(bool enable) +{ + cpuset_t mask; + int vcpu; + + mask = vcpus_active; + while (!CPU_EMPTY(&mask)) { + vcpu = CPU_FFS(&mask) - 1; + CPU_CLR(vcpu, &mask); + if (vm_set_capability(ctx, vcpu, VM_CAP_BPT_EXIT, + enable ? 1 : 0) < 0) + return (false); + debug("$vCPU %d %sabled breakpoint exits\n", vcpu, + enable ? "en" : "dis"); + } + return (true); +} + +static void +remove_all_sw_breakpoints(void) +{ + struct breakpoint *bp, *nbp; + uint8_t *cp; + + if (TAILQ_EMPTY(&breakpoints)) + return; + + TAILQ_FOREACH_SAFE(bp, &breakpoints, link, nbp) { + debug("remove breakpoint at %#lx\n", bp->gpa); + cp = paddr_guest2host(ctx, bp->gpa, 1); + *cp = bp->shadow_inst; + TAILQ_REMOVE(&breakpoints, bp, link); + free(bp); + } + TAILQ_INIT(&breakpoints); + set_breakpoint_caps(false); +} + +static void +update_sw_breakpoint(uint64_t gva, int kind, bool insert) +{ + struct breakpoint *bp; + uint64_t gpa; + uint8_t *cp; + int error; + + if (kind != 1) { + send_error(EINVAL); + return; + } + + error = guest_vaddr2paddr(cur_vcpu, gva, &gpa); + if (error == -1) { + send_error(errno); + return; + } + if (error == 0) { + send_error(EFAULT); + return; + } + + cp = paddr_guest2host(ctx, gpa, 1); + + /* Only permit breakpoints in guest RAM. */ + if (cp == NULL) { + send_error(EFAULT); + return; + } + + /* Find any existing breakpoint. */ + bp = find_breakpoint(gpa); + + /* + * Silently ignore duplicate commands since the protocol + * requires these packets to be idempotent. + */ + if (insert) { + if (bp == NULL) { + if (TAILQ_EMPTY(&breakpoints) && + !set_breakpoint_caps(true)) { + send_empty_response(); + return; + } + bp = malloc(sizeof(*bp)); + bp->gpa = gpa; + bp->shadow_inst = *cp; + *cp = 0xcc; /* INT 3 */ + TAILQ_INSERT_TAIL(&breakpoints, bp, link); + debug("new breakpoint at %#lx\n", gpa); + } + } else { + if (bp != NULL) { + debug("remove breakpoint at %#lx\n", gpa); + *cp = bp->shadow_inst; + TAILQ_REMOVE(&breakpoints, bp, link); + free(bp); + if (TAILQ_EMPTY(&breakpoints)) + set_breakpoint_caps(false); + } + } + send_ok(); +} + +static void +parse_breakpoint(const uint8_t *data, size_t len) +{ + uint64_t gva; + uint8_t *cp; + bool insert; + int kind, type; + + insert = data[0] == 'Z'; + + /* Skip 'Z/z' */ + data += 1; + len -= 1; + + /* Parse and consume type. */ + cp = memchr(data, ',', len); + if (cp == NULL || cp == data) { + send_error(EINVAL); + return; + } + type = parse_integer(data, cp - data); + len -= (cp - data) + 1; + data += (cp - data) + 1; + + /* Parse and consume address. */ + cp = memchr(data, ',', len); + if (cp == NULL || cp == data) { + send_error(EINVAL); + return; + } + gva = parse_integer(data, cp - data); + len -= (cp - data) + 1; + data += (cp - data) + 1; + + /* Parse and consume kind. */ + cp = memchr(data, ';', len); + if (cp == data) { + send_error(EINVAL); + return; + } + if (cp != NULL) { + /* + * We do not advertise support for either the + * ConditionalBreakpoints or BreakpointCommands + * features, so we should not be getting conditions or + * commands from the remote end. + */ + send_empty_response(); + return; + } + kind = parse_integer(data, len); + data += len; + len = 0; + + switch (type) { + case 0: + update_sw_breakpoint(gva, kind, insert); + break; + default: + send_empty_response(); + break; + } +} + +static bool command_equals(const uint8_t *data, size_t len, const char *cmd) { @@ -1038,7 +1404,8 @@ check_features(const uint8_t *data, size_t len) value = NULL; } - /* No currently supported features. */ + if (strcmp(feature, "swbreak") == 0) + swbreak_enabled = supported; } free(str); @@ -1046,6 +1413,7 @@ check_features(const uint8_t *data, size_t len) /* This is an arbitrary limit. */ append_string("PacketSize=4096"); + append_string(";swbreak+"); finish_packet(); } @@ -1139,7 +1507,7 @@ handle_command(const uint8_t *data, size_t len) break; } - /* Don't send a reply until a stop occurs. */ + discard_stop(); gdb_resume_vcpus(); break; case 'D': @@ -1211,13 +1579,12 @@ handle_command(const uint8_t *data, size_t len) break; } break; + case 'z': + case 'Z': + parse_breakpoint(data, len); + break; case '?': - /* XXX: Only if stopped? */ - /* For now, just report that we are always stopped. */ - start_packet(); - append_char('S'); - append_byte(GDB_SIGNAL_TRAP); - finish_packet(); + report_stop(false); break; case 'G': /* TODO */ case 'v': @@ -1228,8 +1595,6 @@ handle_command(const uint8_t *data, size_t len) case 'Q': /* TODO */ case 't': /* TODO */ case 'X': /* TODO */ - case 'z': /* TODO */ - case 'Z': /* TODO */ default: send_empty_response(); } @@ -1260,9 +1625,8 @@ check_command(int fd) if (response_pending()) io_buffer_reset(&cur_resp); io_buffer_consume(&cur_comm, 1); - if (stop_pending) { - stop_pending = false; - report_stop(); + if (stopped_vcpu != -1 && report_next_stop) { + report_stop(true); send_pending_data(fd); } break; @@ -1416,12 +1780,11 @@ new_connection(int fd, enum ev_type event, void *arg) cur_fd = s; cur_vcpu = 0; - stepping_vcpu = -1; stopped_vcpu = -1; - stop_pending = false; /* Break on attach. */ first_stop = true; + report_next_stop = false; gdb_suspend_vcpus(); pthread_mutex_unlock(&gdb_lock); } @@ -1473,6 +1836,9 @@ init_gdb(struct vmctx *_ctx, int sport, bool wait) if (listen(s, 1) < 0) err(1, "gdb socket listen"); + stopped_vcpu = -1; + TAILQ_INIT(&breakpoints); + vcpu_state = calloc(guest_ncpus, sizeof(*vcpu_state)); if (wait) { /* * Set vcpu 0 in vcpus_suspended. This will trigger the @@ -1480,9 +1846,8 @@ init_gdb(struct vmctx *_ctx, int sport, bool wait) * it starts execution. The vcpu will remain suspended * until a debugger connects. */ - stepping_vcpu = -1; - stopped_vcpu = -1; CPU_SET(0, &vcpus_suspended); + stopped_vcpu = 0; } flags = fcntl(s, F_GETFL); Modified: head/usr.sbin/bhyve/gdb.h ============================================================================== --- head/usr.sbin/bhyve/gdb.h Fri Dec 13 18:44:02 2019 (r355723) +++ head/usr.sbin/bhyve/gdb.h Fri Dec 13 19:21:58 2019 (r355724) @@ -31,6 +31,7 @@ #define __GDB_H__ void gdb_cpu_add(int vcpu); +void gdb_cpu_breakpoint(int vcpu, struct vm_exit *vmexit); void gdb_cpu_mtrap(int vcpu); void gdb_cpu_suspend(int vcpu); void init_gdb(struct vmctx *ctx, int sport, bool wait); From owner-svn-src-all@freebsd.org Fri Dec 13 19:26:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 065801D4A8F; Fri, 13 Dec 2019 19:26:05 +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 47ZLHc6MSwz4Np7; Fri, 13 Dec 2019 19:26:04 +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 D5A8918F3A; Fri, 13 Dec 2019 19:26:04 +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 xBDJQ4gU064649; Fri, 13 Dec 2019 19:26:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDJQ4mw064647; Fri, 13 Dec 2019 19:26:04 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912131926.xBDJQ4mw064647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Dec 2019 19:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355725 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 355725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 19:26:05 -0000 Author: jhb Date: Fri Dec 13 19:26:04 2019 New Revision: 355725 URL: https://svnweb.freebsd.org/changeset/base/355725 Log: Use callout(9) instead of deprecated timeout(9) for fail points. Allocate the callout structure on-demand from fail_point_use_timeout_path() since most fail points do not use timeouts. Reviewed by: markj (earlier version), cem Differential Revision: https://reviews.freebsd.org/D22599 Modified: head/sys/kern/kern_fail.c head/sys/sys/fail.h Modified: head/sys/kern/kern_fail.c ============================================================================== --- head/sys/kern/kern_fail.c Fri Dec 13 19:21:58 2019 (r355724) +++ head/sys/kern/kern_fail.c Fri Dec 13 19:26:04 2019 (r355725) @@ -403,6 +403,8 @@ fail_point_drain(struct fail_point *fp, int expected_r wakeup(FP_PAUSE_CHANNEL(fp)); tsleep(&fp, PWAIT, "fail_point_drain", hz / 100); } + if (fp->fp_callout) + callout_drain(fp->fp_callout); fail_point_swap_settings(fp, entries); } @@ -442,8 +444,8 @@ fail_point_sleep(struct fail_point *fp, int msecs, if (fp->fp_pre_sleep_fn) fp->fp_pre_sleep_fn(fp->fp_pre_sleep_arg); - timeout(fp->fp_post_sleep_fn, fp->fp_post_sleep_arg, - timo); + callout_reset(fp->fp_callout, timo, + fp->fp_post_sleep_fn, fp->fp_post_sleep_arg); *pret = FAIL_POINT_RC_QUEUED; } } @@ -493,6 +495,20 @@ fail_point_init(struct fail_point *fp, const char *fmt fp->fp_post_sleep_arg = NULL; } +void +fail_point_alloc_callout(struct fail_point *fp) +{ + + /** + * This assumes that calls to fail_point_use_timeout_path() + * will not race. + */ + if (fp->fp_callout != NULL) + return; + fp->fp_callout = fp_malloc(sizeof(*fp->fp_callout), M_WAITOK); + callout_init(fp->fp_callout, CALLOUT_MPSAFE); +} + /** * Free the resources held by a fail_point, and wake any paused threads. * Thou shalt not allow threads to hit this fail point after you enter this @@ -510,6 +526,10 @@ fail_point_destroy(struct fail_point *fp) fp->fp_name = NULL; } fp->fp_flags = 0; + if (fp->fp_callout) { + fp_free(fp->fp_callout); + fp->fp_callout = NULL; + } sx_xlock(&sx_fp_set); fail_point_garbage_collect(); Modified: head/sys/sys/fail.h ============================================================================== --- head/sys/sys/fail.h Fri Dec 13 19:21:58 2019 (r355724) +++ head/sys/sys/fail.h Fri Dec 13 19:26:04 2019 (r355725) @@ -84,6 +84,8 @@ struct fail_point { void (*fp_post_sleep_fn)(void *); /**< Arg for fp_post_sleep_fn */ void *fp_post_sleep_arg; + + struct callout *fp_callout; }; #define FAIL_POINT_DYNAMIC_NAME 0x01 /**< Must free name on destroy */ @@ -149,9 +151,12 @@ fail_point_sleep_set_post_arg(struct fail_point *fp, v { fp->fp_post_sleep_arg = sleep_arg; } + +void fail_point_alloc_callout(struct fail_point *); + /** * If the FAIL_POINT_USE_TIMEOUT flag is set on a failpoint, then - * FAIL_POINT_SLEEP will result in a call to timeout instead of + * FAIL_POINT_SLEEP will result in a call to callout_reset instead of * msleep. Note that if you sleep while this flag is set, you must * set fp_post_sleep_fn or an error will occur upon waking. */ @@ -163,9 +168,10 @@ fail_point_use_timeout_path(struct fail_point *fp, boo (post_sleep_fn == NULL && fp->fp_post_sleep_fn != NULL), ("Setting fp to use timeout, but not setting post_sleep_fn\n")); - if (use_timeout) + if (use_timeout) { + fail_point_alloc_callout(fp); fp->fp_flags |= FAIL_POINT_USE_TIMEOUT_PATH; - else + } else fp->fp_flags &= ~FAIL_POINT_USE_TIMEOUT_PATH; if (post_sleep_fn != NULL) From owner-svn-src-all@freebsd.org Fri Dec 13 19:27:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 911C11D4B48; Fri, 13 Dec 2019 19:27:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47ZLKh3HTkz4NxY; Fri, 13 Dec 2019 19:27:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51FAC18F41; Fri, 13 Dec 2019 19:27:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDJRqbF064763; Fri, 13 Dec 2019 19:27:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDJRpJJ064761; Fri, 13 Dec 2019 19:27:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912131927.xBDJRpJJ064761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Dec 2019 19:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355726 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 355726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 19:27:52 -0000 Author: jhb Date: Fri Dec 13 19:27:51 2019 New Revision: 355726 URL: https://svnweb.freebsd.org/changeset/base/355726 Log: Use a callout instead of timeout(9) for delayed zio's. Reviewed by: avg Differential Revision: https://reviews.freebsd.org/D22597 Modified: head/sys/cddl/compat/opensolaris/sys/systm.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/compat/opensolaris/sys/systm.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/systm.h Fri Dec 13 19:26:04 2019 (r355725) +++ head/sys/cddl/compat/opensolaris/sys/systm.h Fri Dec 13 19:27:51 2019 (r355726) @@ -42,9 +42,6 @@ #define delay(x) pause("soldelay", (x)) -#define timeout_generic(type, fn, arg, t, r, f) \ - timeout(fn, arg, t / (NANOSEC/hz) + 1) - #endif /* _KERNEL */ #endif /* _OPENSOLARIS_SYS_SYSTM_H_ */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Dec 13 19:26:04 2019 (r355725) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Dec 13 19:27:51 2019 (r355726) @@ -474,6 +474,9 @@ struct zio { #ifdef __FreeBSD__ struct bio *io_bio; +#ifdef _KERNEL + struct callout io_timer; +#endif #endif /* Internal pipeline state */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Dec 13 19:26:04 2019 (r355725) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Dec 13 19:27:51 2019 (r355726) @@ -659,6 +659,9 @@ zio_create(zio_t *pio, spa_t *spa, uint64_t txg, const mutex_init(&zio->io_lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&zio->io_cv, NULL, CV_DEFAULT, NULL); +#if defined(__FreeBSD__) && defined(_KERNEL) + callout_init(&zio->io_timer, 1); +#endif list_create(&zio->io_parent_list, sizeof (zio_link_t), offsetof(zio_link_t, zl_parent_node)); @@ -726,6 +729,10 @@ zio_create(zio_t *pio, spa_t *spa, uint64_t txg, const static void zio_destroy(zio_t *zio) { +#ifdef __FreeBSD__ + KASSERT(!(callout_active(&zio->io_timer) || + callout_pending(&zio->io_timer)), ("zio_destroy: timer active")); +#endif metaslab_trace_fini(&zio->io_alloc_list); list_destroy(&zio->io_parent_list); list_destroy(&zio->io_child_list); @@ -1710,8 +1717,13 @@ zio_delay_interrupt(zio_t *zio) DTRACE_PROBE3(zio__delay__hit, zio_t *, zio, hrtime_t, now, hrtime_t, diff); +#ifdef __FreeBSD__ + callout_reset_sbt(&zio->io_timer, nstosbt(diff), 0, + (void (*)(void *))zio_interrupt, zio, C_HARDCLOCK); +#else (void) timeout_generic(CALLOUT_NORMAL, (void (*)(void *))zio_interrupt, zio, diff, 1, 0); +#endif } return; From owner-svn-src-all@freebsd.org Fri Dec 13 19:30:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF7D81D4BF0; Fri, 13 Dec 2019 19:30:29 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47ZLNj562rz4P7x; Fri, 13 Dec 2019 19:30:29 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 2D2A42600D9; Fri, 13 Dec 2019 20:30:22 +0100 (CET) Subject: Re: svn commit: r355725 - in head/sys: kern sys To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912131926.xBDJQ4mw064647@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <9165f6b5-41b7-371e-d419-0685cdcbc3a8@selasky.org> Date: Fri, 13 Dec 2019 20:27:31 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <201912131926.xBDJQ4mw064647@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47ZLNj562rz4P7x X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 19:30:29 -0000 On 2019-12-13 20:26, John Baldwin wrote: > deprecated timeout(9) Are you planning to nuke the timeout(9) API? --HPS From owner-svn-src-all@freebsd.org Fri Dec 13 19:39:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F7281D4F29; Fri, 13 Dec 2019 19:39:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47ZLbD6jPJz4Ppl; Fri, 13 Dec 2019 19:39:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD0611913C; Fri, 13 Dec 2019 19:39:36 +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 xBDJdaSa070773; Fri, 13 Dec 2019 19:39:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDJdYaB070758; Fri, 13 Dec 2019 19:39:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912131939.xBDJdYaB070758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 13 Dec 2019 19:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355727 - in head: share/man/man9 sys/arm/broadcom/bcm2835 sys/arm/freescale/imx sys/arm/mv sys/arm/ti sys/dev/glxiic sys/dev/ichsmb sys/dev/ow sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/man/man9 sys/arm/broadcom/bcm2835 sys/arm/freescale/imx sys/arm/mv sys/arm/ti sys/dev/glxiic sys/dev/ichsmb sys/dev/ow sys/kern sys/sys X-SVN-Commit-Revision: 355727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 19:39:37 -0000 Author: imp Date: Fri Dec 13 19:39:33 2019 New Revision: 355727 URL: https://svnweb.freebsd.org/changeset/base/355727 Log: Create new wrapper function: bus_delayed_attach_children() Delay the attachment of children, when requested, until after interrutps are running. This is often needed to allow children to run transactions on i2c or spi busses. It's a common enough idiom that it will be useful to have its own wrapper. Reviewed by: ian Differential Revision: https://reviews.freebsd.org/D21465 Added: head/share/man/man9/bus_delayed_attach_children.9 (contents, props changed) Modified: head/share/man/man9/Makefile head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c head/sys/arm/freescale/imx/imx_i2c.c head/sys/arm/freescale/imx/imx_spi.c head/sys/arm/mv/a37x0_spi.c head/sys/arm/mv/mv_spi.c head/sys/arm/ti/ti_i2c.c head/sys/dev/glxiic/glxiic.c head/sys/dev/ichsmb/ichsmb.c head/sys/dev/ow/owc_gpiobus.c head/sys/kern/subr_bus.c head/sys/sys/bus.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Dec 13 19:27:51 2019 (r355726) +++ head/share/man/man9/Makefile Fri Dec 13 19:39:33 2019 (r355727) @@ -34,6 +34,7 @@ MAN= accept_filter.9 \ BUS_CHILD_DELETED.9 \ BUS_CHILD_DETACHED.9 \ BUS_CONFIG_INTR.9 \ + bus_delayed_attach_children.9 \ BUS_DESCRIBE_INTR.9 \ bus_dma.9 \ bus_generic_attach.9 \ Added: head/share/man/man9/bus_delayed_attach_children.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/bus_delayed_attach_children.9 Fri Dec 13 19:39:33 2019 (r355727) @@ -0,0 +1,55 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2019 M. Warner Losh +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 29, 2019 +.Dt BUS_DELAYED_ATTACH_CHILDREN 9 +.Os +.Sh NAME +.Nm bus_delayed_attach_children +.Nd "request that the children be attached when interrupts are enabled" +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.Pp +.Ft int +.Fn bus_delayed_attach_children "device_t dev" +.Sh DESCRIPTION +The +.Fn bus_delayed_attach_children +function requests that the children of this device +be attached when interrupts are running. +If interrupts are currently running, this happens immediately. +If interrupts aren't yet running, this happens after interrupts are enabled, but +before the system mounts root. +.Sh RETURN VALUES +A zero return value indicates success. +.Sh SEE ALSO +.Xr bus 9 , +.Xr device 9 , +.Xr driver 9 +.Sh AUTHORS +This manual page was written by +.An Warner Losh Aq Mt imp@FreeBSD.org . Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Fri Dec 13 19:39:33 2019 (r355727) @@ -347,7 +347,7 @@ bcm_bsc_attach(device_t dev) } /* Probe and attach the iicbus when interrupts are available. */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + bus_delayed_attach_children(dev); return (0); } Modified: head/sys/arm/freescale/imx/imx_i2c.c ============================================================================== --- head/sys/arm/freescale/imx/imx_i2c.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/arm/freescale/imx/imx_i2c.c Fri Dec 13 19:39:33 2019 (r355727) @@ -449,8 +449,7 @@ no_recovery: /* We don't do a hardware reset here because iicbus_attach() does it. */ /* Probe and attach the iicbus when interrupts are available. */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); - return (0); + return (bus_delayed_attach_children(dev)); } static int Modified: head/sys/arm/freescale/imx/imx_spi.c ============================================================================== --- head/sys/arm/freescale/imx/imx_spi.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/arm/freescale/imx/imx_spi.c Fri Dec 13 19:39:33 2019 (r355727) @@ -566,9 +566,7 @@ spi_attach(device_t dev) * their attach. We can't do IO until timers and interrupts are working. */ sc->spibus = device_add_child(dev, "spibus", -1); - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); - - return (0); + return (bus_delayed_attach_children(dev)); } static int Modified: head/sys/arm/mv/a37x0_spi.c ============================================================================== --- head/sys/arm/mv/a37x0_spi.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/arm/mv/a37x0_spi.c Fri Dec 13 19:39:33 2019 (r355727) @@ -220,7 +220,7 @@ a37x0_spi_attach(device_t dev) device_add_child(dev, "spibus", -1); /* Probe and attach the spibus when interrupts are available. */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + bus_delayed_attach_children(dev); return (0); } Modified: head/sys/arm/mv/mv_spi.c ============================================================================== --- head/sys/arm/mv/mv_spi.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/arm/mv/mv_spi.c Fri Dec 13 19:39:33 2019 (r355727) @@ -174,9 +174,7 @@ mv_spi_attach(device_t dev) device_add_child(dev, "spibus", -1); /* Probe and attach the spibus when interrupts are available. */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); - - return (0); + return (bus_delayed_attach_children(dev)); } static int Modified: head/sys/arm/ti/ti_i2c.c ============================================================================== --- head/sys/arm/ti/ti_i2c.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/arm/ti/ti_i2c.c Fri Dec 13 19:39:33 2019 (r355727) @@ -905,7 +905,7 @@ ti_i2c_attach(device_t dev) } /* Probe and attach the iicbus when interrupts are available. */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + err = bus_delayed_attach_children(dev); out: if (err) { Modified: head/sys/dev/glxiic/glxiic.c ============================================================================== --- head/sys/dev/glxiic/glxiic.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/dev/glxiic/glxiic.c Fri Dec 13 19:39:33 2019 (r355727) @@ -411,8 +411,7 @@ glxiic_attach(device_t dev) glxiic_smb_enable(sc, IIC_FASTEST, 0); /* Probe and attach the iicbus when interrupts are available. */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); - error = 0; + error = bus_delayed_attach_children(dev); out: if (error != 0) { Modified: head/sys/dev/ichsmb/ichsmb.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/dev/ichsmb/ichsmb.c Fri Dec 13 19:39:33 2019 (r355727) @@ -131,11 +131,8 @@ ichsmb_attach(device_t dev) goto fail; } - /* Probe and attach the smbus when interrupts are available */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); - - return (0); - + /* Attach children when interrupts are available */ + return (bus_delayed_attach_children(dev)); fail: mtx_destroy(&sc->mutex); return (error); Modified: head/sys/dev/ow/owc_gpiobus.c ============================================================================== --- head/sys/dev/ow/owc_gpiobus.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/dev/ow/owc_gpiobus.c Fri Dec 13 19:39:33 2019 (r355727) @@ -131,7 +131,7 @@ owc_gpiobus_attach(device_t dev) free(kids, M_TEMP); if (nkid == 0) device_add_child(dev, "ow", -1); - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + bus_delayed_attach_children(dev); return (0); } Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/kern/subr_bus.c Fri Dec 13 19:39:33 2019 (r355727) @@ -3753,6 +3753,22 @@ bus_generic_attach(device_t dev) } /** + * @brief Helper function for delaying attaching children + * + * Many buses can't run transactions on the bus which children need to probe and + * attach until after interrupts and/or timers are running. This function + * delays their attach until interrupts and timers are enabled. + */ +int +bus_delayed_attach_children(device_t dev) +{ + /* Probe and attach the bus children when interrupts are available */ + config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + + return (0); +} + +/** * @brief Helper function for implementing DEVICE_DETACH() * * This function can be used to help implement the DEVICE_DETACH() for Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/sys/bus.h Fri Dec 13 19:39:33 2019 (r355727) @@ -567,6 +567,7 @@ int bus_child_present(device_t child); int bus_child_pnpinfo_str(device_t child, char *buf, size_t buflen); int bus_child_location_str(device_t child, char *buf, size_t buflen); void bus_enumerate_hinted_children(device_t bus); +int bus_delayed_attach_children(device_t bus); static __inline struct resource * bus_alloc_resource_any(device_t dev, int type, int *rid, u_int flags) From owner-svn-src-all@freebsd.org Fri Dec 13 19:48:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 885E01D529D; Fri, 13 Dec 2019 19:48:34 +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 47ZLnZ37vkz4QP9; Fri, 13 Dec 2019 19:48:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-6.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id E58CD16CC; Fri, 13 Dec 2019 19:48:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r355724 - in head: sys/amd64/include sys/amd64/vmm/amd sys/amd64/vmm/intel usr.sbin/bhyve From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912131921.xBDJLxri060525@repo.freebsd.org> Openpgp: preference=signencrypt 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: <60685fc4-470e-5de3-dda1-4e5689fff8a6@FreeBSD.org> Date: Fri, 13 Dec 2019 11:48:29 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <201912131921.xBDJLxri060525@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 19:48:34 -0000 On 12/13/19 11:21 AM, John Baldwin wrote: > Author: jhb > Date: Fri Dec 13 19:21:58 2019 > New Revision: 355724 > URL: https://svnweb.freebsd.org/changeset/base/355724 > > Log: > Support software breakpoints in the debug server on Intel CPUs. > > - Allow the userland hypervisor to intercept breakpoint exceptions > (BP#) in the guest. A new capability (VM_CAP_BPT_EXIT) is used to > enable this feature. These exceptions are reported to userland via > a new VM_EXITCODE_BPT that includes the length of the original > breakpoint instruction. If userland wishes to pass the exception > through to the guest, it must be explicitly re-injected via > vm_inject_exception(). > > - Export VMCS_ENTRY_INST_LENGTH as a VM_REG_GUEST_ENTRY_INST_LENGTH > pseudo-register. Injecting a BP# on Intel requires setting this to > the length of the breakpoint instruction. AMD SVM currently ignores > writes to this register (but reports success) and fails to read it. > > - Rework the per-vCPU state tracked by the debug server. Rather than > a single 'stepping_vcpu' global, add a structure for each vCPU that > tracks state about that vCPU ('stepping', 'stepped', and > 'hit_swbreak'). A global 'stopped_vcpu' tracks which vCPU is > currently reporting an event. Event handlers for MTRAP and > breakpoint exits loop until the associated event is reported to the > debugger. > > Breakpoint events are discarded if the breakpoint is not present > when a vCPU resumes in the breakpoint handler to retry submitting > the breakpoint event. > > - Maintain a linked-list of active breakpoints in response to the GDB > 'Z0' and 'z0' packets. > > Reviewed by: markj (earlier version) > MFC after: 2 months > Differential Revision: https://reviews.freebsd.org/D20309 As the manpage notes, there is a pretty large caveat with using breakpoints. The debugger wants to single-step over a breakpoint after replacing the original instruction before resuming. However, the latency between a breakpoint firing and the user responding in the debugger is such that a timer interrupt has triggered by the time the vCPU resumes. Thus, the single step stops in the first instruction of the interrupt handler. The debugger then does the user's requested continue which finishes the interrupt handler and trips the breakpoint again at the original location when the interrupt handler returns. The effect is that doing a continue after a breakpoint never makes forward progress. One workaround is to disable the current breakpoint and use 'until' to set a temporary breakpoint at the next line in the source. You can then re-enable the original breakpoint and continue. I've thought about various ways to fix this, but they all have downsides. One way is to clear IF in %eflags while stepping, but then you have to emulate pushf and possibly popf. Another option might be to add new commands to pause and unpause timer devices and pause timers when the vCPUs all exit and re-enable when either doing a continue or for the duration of a step. The latter approach feels a bit more of what you want, but it has other potential downsides, like time jumps in the guest, etc. -- John Baldwin From owner-svn-src-all@freebsd.org Fri Dec 13 19:53:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7CE9F1D5490; Fri, 13 Dec 2019 19:53:28 +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 47ZLvD2mPrz4QmN; Fri, 13 Dec 2019 19:53:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-6.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id E2A9917EA; Fri, 13 Dec 2019 19:53:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r355725 - in head/sys: kern sys To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912131926.xBDJQ4mw064647@repo.freebsd.org> <9165f6b5-41b7-371e-d419-0685cdcbc3a8@selasky.org> From: John Baldwin Openpgp: preference=signencrypt 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: <2479ee57-ec11-c179-cbb1-b203dc6e8e86@FreeBSD.org> Date: Fri, 13 Dec 2019 11:53:25 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <9165f6b5-41b7-371e-d419-0685cdcbc3a8@selasky.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 19:53:28 -0000 On 12/13/19 11:27 AM, Hans Petter Selasky wrote: > On 2019-12-13 20:26, John Baldwin wrote: >> deprecated timeout(9) > > Are you planning to nuke the timeout(9) API? Yes, only one consumer left and that is in review. D22602 is the removal. It always runs under Giant, is unreliable since timeout() can silently fail to schedule, and has been marked deprecated for years in the manpage. -- John Baldwin From owner-svn-src-all@freebsd.org Fri Dec 13 19:56:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BB7A1D5539; Fri, 13 Dec 2019 19:56:49 +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 47ZLz52Cp0z4Qvj; Fri, 13 Dec 2019 19:56:49 +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 422C4194D1; Fri, 13 Dec 2019 19:56:49 +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 xBDJun76082374; Fri, 13 Dec 2019 19:56:49 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDJumqY082372; Fri, 13 Dec 2019 19:56:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912131956.xBDJumqY082372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Dec 2019 19:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355728 - head/sys/dev/smartpqi X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/smartpqi X-SVN-Commit-Revision: 355728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 19:56:49 -0000 Author: jhb Date: Fri Dec 13 19:56:48 2019 New Revision: 355728 URL: https://svnweb.freebsd.org/changeset/base/355728 Log: Use callout(9) instead of deprecated timeout(9). Reviewed by: imp Tested by: Scott Benesh Differential Revision: https://reviews.freebsd.org/D22598 Modified: head/sys/dev/smartpqi/smartpqi_defines.h head/sys/dev/smartpqi/smartpqi_main.c head/sys/dev/smartpqi/smartpqi_misc.c Modified: head/sys/dev/smartpqi/smartpqi_defines.h ============================================================================== --- head/sys/dev/smartpqi/smartpqi_defines.h Fri Dec 13 19:39:33 2019 (r355727) +++ head/sys/dev/smartpqi/smartpqi_defines.h Fri Dec 13 19:56:48 2019 (r355728) @@ -856,8 +856,8 @@ typedef struct OS_SPECIFIC { struct cam_path *path; struct task event_task; struct cdev *cdev; - struct callout_handle wellness_periodic; /* periodic event handling */ - struct callout_handle heartbeat_timeout_id; /* heart beat event handling */ + struct callout wellness_periodic; /* periodic event handling */ + struct callout heartbeat_timeout_id; /* heart beat event handling */ eventhandler_tag eh; } OS_SPECIFIC_T; Modified: head/sys/dev/smartpqi/smartpqi_main.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_main.c Fri Dec 13 19:39:33 2019 (r355727) +++ head/sys/dev/smartpqi/smartpqi_main.c Fri Dec 13 19:56:48 2019 (r355728) @@ -324,6 +324,8 @@ smartpqi_attach(device_t dev) mtx_init(&softs->os_specific.cam_lock, "cam_lock", NULL, MTX_DEF); softs->os_specific.mtx_init = TRUE; mtx_init(&softs->os_specific.map_lock, "map_lock", NULL, MTX_DEF); + callout_init(&softs->os_specific.wellness_periodic, 1); + callout_init(&softs->os_specific.heartbeat_timeout_id, 1); /* * Create DMA tag for mapping buffers into controller-addressable space. @@ -355,8 +357,8 @@ smartpqi_attach(device_t dev) } os_start_heartbeat_timer((void *)softs); /* Start the heart-beat timer */ - softs->os_specific.wellness_periodic = timeout( os_wellness_periodic, - softs, 120*hz); + callout_reset(&softs->os_specific.wellness_periodic, 120*hz, + os_wellness_periodic, softs); /* Register our shutdown handler. */ softs->os_specific.eh = EVENTHANDLER_REGISTER(shutdown_final, smartpqi_shutdown, softs, SHUTDOWN_PRI_DEFAULT); @@ -410,11 +412,9 @@ smartpqi_detach(device_t dev) EVENTHANDLER_DEREGISTER(shutdown_final, softs->os_specific.eh); /* kill the periodic event */ - untimeout(os_wellness_periodic, softs, - softs->os_specific.wellness_periodic); + callout_drain(&softs->os_specific.wellness_periodic); /* Kill the heart beat event */ - untimeout(os_start_heartbeat_timer, softs, - softs->os_specific.heartbeat_timeout_id); + callout_drain(&softs->os_specific.heartbeat_timeout_id); smartpqi_shutdown(softs); destroy_char_dev(softs); Modified: head/sys/dev/smartpqi/smartpqi_misc.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_misc.c Fri Dec 13 19:39:33 2019 (r355727) +++ head/sys/dev/smartpqi/smartpqi_misc.c Fri Dec 13 19:56:48 2019 (r355728) @@ -69,8 +69,8 @@ void os_wellness_periodic(void *data) } /* reschedule ourselves */ - softs->os_specific.wellness_periodic = timeout(os_wellness_periodic, - softs, OS_HOST_WELLNESS_TIMEOUT * hz); + callout_schedule(&softs->os_specific.wellness_periodic, + OS_HOST_WELLNESS_TIMEOUT * hz); } /* @@ -81,8 +81,7 @@ void os_stop_heartbeat_timer(pqisrc_softstate_t *softs DBG_FUNC("IN\n"); /* Kill the heart beat event */ - untimeout(os_start_heartbeat_timer, softs, - softs->os_specific.heartbeat_timeout_id); + callout_stop(&softs->os_specific.heartbeat_timeout_id); DBG_FUNC("OUT\n"); } @@ -97,9 +96,9 @@ void os_start_heartbeat_timer(void *data) pqisrc_heartbeat_timer_handler(softs); if (!pqisrc_ctrl_offline(softs)) { - softs->os_specific.heartbeat_timeout_id = - timeout(os_start_heartbeat_timer, softs, - OS_FW_HEARTBEAT_TIMER_INTERVAL * hz); + callout_reset(&softs->os_specific.heartbeat_timeout_id, + OS_FW_HEARTBEAT_TIMER_INTERVAL * hz, + os_start_heartbeat_timer, softs); } DBG_FUNC("OUT\n"); From owner-svn-src-all@freebsd.org Fri Dec 13 20:01:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 781991D5601; Fri, 13 Dec 2019 20:01:22 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47ZM4L3Mxlz4RC4; Fri, 13 Dec 2019 20:01:22 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [172.17.133.228] (unknown [12.202.168.51]) (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 B655017EC; Fri, 13 Dec 2019 20:01:21 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.20.0.191208 Date: Fri, 13 Dec 2019 12:01:18 -0800 Subject: Re: svn commit: r355727 - in head: share/man/man9 sys/arm/broadcom/bcm2835 sys/arm/freescale/imx sys/arm/mv sys/arm/ti sys/dev/glxiic sys/dev/ichsmb sys/dev/ow sys/kern sys/sys From: Ravi Pokala To: Warner Losh , , , Message-ID: Thread-Topic: svn commit: r355727 - in head: share/man/man9 sys/arm/broadcom/bcm2835 sys/arm/freescale/imx sys/arm/mv sys/arm/ti sys/dev/glxiic sys/dev/ichsmb sys/dev/ow sys/kern sys/sys References: <201912131939.xBDJdYaB070758@repo.freebsd.org> In-Reply-To: <201912131939.xBDJdYaB070758@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 20:01:22 -0000 Hi Warner, This change takes a bunch of cases of > config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); > return (0) And replaces them with a *mix* of: > return (bus_delayed_attach_children(dev)); and > bus_delayed_attach_children(dev); > return (0) Why the two different idioms? Thanks, Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Warner Losh Date: 2019-12-13, Friday at 11:39 To: , , Subject: svn commit: r355727 - in head: share/man/man9 sys/arm/broadcom/bcm= 2835 sys/arm/freescale/imx sys/arm/mv sys/arm/ti sys/dev/glxiic sys/dev/ichs= mb sys/dev/ow sys/kern sys/sys Author: imp Date: Fri Dec 13 19:39:33 2019 New Revision: 355727 URL: https://svnweb.freebsd.org/changeset/base/355727 =20 Log: Create new wrapper function: bus_delayed_attach_children() =20 Delay the attachment of children, when requested, until after interru= tps are running. This is often needed to allow children to run transactions o= n i2c or spi busses. It's a common enough idiom that it will be useful to have= its own wrapper. =20 Reviewed by: ian Differential Revision: https://reviews.freebsd.org/D21465 =20 Added: head/share/man/man9/bus_delayed_attach_children.9 (contents, props = changed) Modified: head/share/man/man9/Makefile head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c head/sys/arm/freescale/imx/imx_i2c.c head/sys/arm/freescale/imx/imx_spi.c head/sys/arm/mv/a37x0_spi.c head/sys/arm/mv/mv_spi.c head/sys/arm/ti/ti_i2c.c head/sys/dev/glxiic/glxiic.c head/sys/dev/ichsmb/ichsmb.c head/sys/dev/ow/owc_gpiobus.c head/sys/kern/subr_bus.c head/sys/sys/bus.h =20 Modified: head/share/man/man9/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/share/man/man9/Makefile Fri Dec 13 19:27:51 2019 (r355726) +++ head/share/man/man9/Makefile Fri Dec 13 19:39:33 2019 (r355727) @@ -34,6 +34,7 @@ MAN=3D accept_filter.9 \ BUS_CHILD_DELETED.9 \ BUS_CHILD_DETACHED.9 \ BUS_CONFIG_INTR.9 \ + bus_delayed_attach_children.9 \ BUS_DESCRIBE_INTR.9 \ bus_dma.9 \ bus_generic_attach.9 \ =20 Added: head/share/man/man9/bus_delayed_attach_children.9 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/bus_delayed_attach_children.9 Fri Dec 13 19:39:= 33 2019 (r355727) @@ -0,0 +1,55 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2019 M. Warner Losh +.\" +.\" 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 copyrig= ht +.\" notice, this list of conditions and the following disclaimer in= the +.\" documentation and/or other materials provided with the distribu= tion. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPR= ESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WAR= RANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLA= IMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIREC= T, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDIN= G, 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 TOR= T +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE = USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 29, 2019 +.Dt BUS_DELAYED_ATTACH_CHILDREN 9 +.Os +.Sh NAME +.Nm bus_delayed_attach_children +.Nd "request that the children be attached when interrupts are enabled= " +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.Pp +.Ft int +.Fn bus_delayed_attach_children "device_t dev" +.Sh DESCRIPTION +The +.Fn bus_delayed_attach_children +function requests that the children of this device +be attached when interrupts are running. +If interrupts are currently running, this happens immediately. +If interrupts aren't yet running, this happens after interrupts are en= abled, but +before the system mounts root. +.Sh RETURN VALUES +A zero return value indicates success. +.Sh SEE ALSO +.Xr bus 9 , +.Xr device 9 , +.Xr driver 9 +.Sh AUTHORS +This manual page was written by +.An Warner Losh Aq Mt imp@FreeBSD.org . =20 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Fri Dec 13 19:27:51 201= 9 (r355726) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Fri Dec 13 19:39:33 201= 9 (r355727) @@ -347,7 +347,7 @@ bcm_bsc_attach(device_t dev) } =20 /* Probe and attach the iicbus when interrupts are available. */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + bus_delayed_attach_children(dev); =20 return (0); } =20 Modified: head/sys/arm/freescale/imx/imx_i2c.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/arm/freescale/imx/imx_i2c.c Fri Dec 13 19:27:51 2019 (r355= 726) +++ head/sys/arm/freescale/imx/imx_i2c.c Fri Dec 13 19:39:33 2019 (r355= 727) @@ -449,8 +449,7 @@ no_recovery: /* We don't do a hardware reset here because iicbus_attach() does it.= */ =20 /* Probe and attach the iicbus when interrupts are available. */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); - return (0); + return (bus_delayed_attach_children(dev)); } =20 static int =20 Modified: head/sys/arm/freescale/imx/imx_spi.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/arm/freescale/imx/imx_spi.c Fri Dec 13 19:27:51 2019 (r355= 726) +++ head/sys/arm/freescale/imx/imx_spi.c Fri Dec 13 19:39:33 2019 (r355= 727) @@ -566,9 +566,7 @@ spi_attach(device_t dev) * their attach. We can't do IO until timers and interrupts are worki= ng. */ sc->spibus =3D device_add_child(dev, "spibus", -1); - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); - - return (0); + return (bus_delayed_attach_children(dev)); } =20 static int =20 Modified: head/sys/arm/mv/a37x0_spi.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/arm/mv/a37x0_spi.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/arm/mv/a37x0_spi.c Fri Dec 13 19:39:33 2019 (r355727) @@ -220,7 +220,7 @@ a37x0_spi_attach(device_t dev) device_add_child(dev, "spibus", -1); =20 /* Probe and attach the spibus when interrupts are available. */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + bus_delayed_attach_children(dev); =20 return (0); } =20 Modified: head/sys/arm/mv/mv_spi.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/arm/mv/mv_spi.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/arm/mv/mv_spi.c Fri Dec 13 19:39:33 2019 (r355727) @@ -174,9 +174,7 @@ mv_spi_attach(device_t dev) device_add_child(dev, "spibus", -1); =20 /* Probe and attach the spibus when interrupts are available. */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); - - return (0); + return (bus_delayed_attach_children(dev)); } =20 static int =20 Modified: head/sys/arm/ti/ti_i2c.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/arm/ti/ti_i2c.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/arm/ti/ti_i2c.c Fri Dec 13 19:39:33 2019 (r355727) @@ -905,7 +905,7 @@ ti_i2c_attach(device_t dev) } =20 /* Probe and attach the iicbus when interrupts are available. */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + err =3D bus_delayed_attach_children(dev); =20 out: if (err) { =20 Modified: head/sys/dev/glxiic/glxiic.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/dev/glxiic/glxiic.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/dev/glxiic/glxiic.c Fri Dec 13 19:39:33 2019 (r355727) @@ -411,8 +411,7 @@ glxiic_attach(device_t dev) glxiic_smb_enable(sc, IIC_FASTEST, 0); =20 /* Probe and attach the iicbus when interrupts are available. */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); - error =3D 0; + error =3D bus_delayed_attach_children(dev); =20 out: if (error !=3D 0) { =20 Modified: head/sys/dev/ichsmb/ichsmb.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/dev/ichsmb/ichsmb.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/dev/ichsmb/ichsmb.c Fri Dec 13 19:39:33 2019 (r355727) @@ -131,11 +131,8 @@ ichsmb_attach(device_t dev) goto fail; } =20 - /* Probe and attach the smbus when interrupts are available */ - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); - - return (0); - + /* Attach children when interrupts are available */ + return (bus_delayed_attach_children(dev)); fail: mtx_destroy(&sc->mutex); return (error); =20 Modified: head/sys/dev/ow/owc_gpiobus.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/dev/ow/owc_gpiobus.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/dev/ow/owc_gpiobus.c Fri Dec 13 19:39:33 2019 (r355727) @@ -131,7 +131,7 @@ owc_gpiobus_attach(device_t dev) free(kids, M_TEMP); if (nkid =3D=3D 0) device_add_child(dev, "ow", -1); - config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + bus_delayed_attach_children(dev); =20 return (0); } =20 Modified: head/sys/kern/subr_bus.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/kern/subr_bus.c Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/kern/subr_bus.c Fri Dec 13 19:39:33 2019 (r355727) @@ -3753,6 +3753,22 @@ bus_generic_attach(device_t dev) } =20 /** + * @brief Helper function for delaying attaching children + * + * Many buses can't run transactions on the bus which children need to= probe and + * attach until after interrupts and/or timers are running. This func= tion + * delays their attach until interrupts and timers are enabled. + */ +int +bus_delayed_attach_children(device_t dev) +{ + /* Probe and attach the bus children when interrupts are available */ + config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + + return (0); +} + +/** * @brief Helper function for implementing DEVICE_DETACH() * * This function can be used to help implement the DEVICE_DETACH() for =20 Modified: head/sys/sys/bus.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/sys/bus.h Fri Dec 13 19:27:51 2019 (r355726) +++ head/sys/sys/bus.h Fri Dec 13 19:39:33 2019 (r355727) @@ -567,6 +567,7 @@ int bus_child_present(device_t child); int bus_child_pnpinfo_str(device_t child, char *buf, size_t buflen); int bus_child_location_str(device_t child, char *buf, size_t buflen); void bus_enumerate_hinted_children(device_t bus); +int bus_delayed_attach_children(device_t bus); =20 static __inline struct resource * bus_alloc_resource_any(device_t dev, int type, int *rid, u_int flags) =20 From owner-svn-src-all@freebsd.org Fri Dec 13 20:30:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4BFB01D6095; Fri, 13 Dec 2019 20:30:27 +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 47ZMjv1HWRz4Sx4; Fri, 13 Dec 2019 20:30:27 +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 2640019A68; Fri, 13 Dec 2019 20:30:27 +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 xBDKURIq001139; Fri, 13 Dec 2019 20:30:27 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDKURLq001138; Fri, 13 Dec 2019 20:30:27 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201912132030.xBDKURLq001138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Fri, 13 Dec 2019 20:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355729 - head/lib/libc/powerpc64 X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/lib/libc/powerpc64 X-SVN-Commit-Revision: 355729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 20:30:27 -0000 Author: bdragon Date: Fri Dec 13 20:30:26 2019 New Revision: 355729 URL: https://svnweb.freebsd.org/changeset/base/355729 Log: [PowerPC] Fully define gdtoa settings on powerpc64. The settings in arith.h were not fully defined on powerpc64 after the gdtoa switchover. Generate them using arithchk.c, similar to what AMD64 did for r114814. Technically, none of this is necessary in FreeBSD gdtoa, but since the other platforms have full definitions, we might as well have full definitions too. Approved by: jhibbits (in irc) Differential Revision: https://reviews.freebsd.org/D22775 Modified: head/lib/libc/powerpc64/arith.h Modified: head/lib/libc/powerpc64/arith.h ============================================================================== --- head/lib/libc/powerpc64/arith.h Fri Dec 13 19:56:48 2019 (r355728) +++ head/lib/libc/powerpc64/arith.h Fri Dec 13 20:30:26 2019 (r355729) @@ -13,4 +13,7 @@ #define IEEE_MC68k #define Arith_Kind_ASL 2 +#define Long int +#define Intcast (int)(long) #define Double_Align +#define X64_bit_pointers From owner-svn-src-all@freebsd.org Fri Dec 13 20:38:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFB931D6448; Fri, 13 Dec 2019 20:38:58 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47ZMvk5tMLz4TWW; Fri, 13 Dec 2019 20:38:58 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4FA119C37; Fri, 13 Dec 2019 20:38:58 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDKcwpx007406; Fri, 13 Dec 2019 20:38:58 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDKcwXX007404; Fri, 13 Dec 2019 20:38:58 GMT (envelope-from np@FreeBSD.org) Message-Id: <201912132038.xBDKcwXX007404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 13 Dec 2019 20:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355730 - in head/sys/dev/cxgbe: . crypto X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . crypto X-SVN-Commit-Revision: 355730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 20:38:58 -0000 Author: np Date: Fri Dec 13 20:38:58 2019 New Revision: 355730 URL: https://svnweb.freebsd.org/changeset/base/355730 Log: cxgbe(4): Use the _XT variant of the CPL used to transmit NIC traffic. CPL_TX_PKT_XT disables the internal parser on the chip and instead relies on the driver to provide the exact length of the L2 and L3 headers. This allows hw checksumming and TSO to be used with L2 and L3 encapsulations that the chip doesn't understand directly. Note that netmap tx still uses the old CPL as it never uses the hw to generate the checksum on tx. Reviewed by: jhb@ MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D22788 Modified: head/sys/dev/cxgbe/crypto/t4_kern_tls.c head/sys/dev/cxgbe/t4_sched.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/crypto/t4_kern_tls.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_kern_tls.c Fri Dec 13 20:30:26 2019 (r355729) +++ head/sys/dev/cxgbe/crypto/t4_kern_tls.c Fri Dec 13 20:38:58 2019 (r355730) @@ -1394,15 +1394,10 @@ ktls_write_tcp_options(struct sge_txq *txq, void *dst, cpl = (void *)(wr + 1); - /* Checksum offload */ - ctrl1 = 0; - txq->txcsum++; - /* CPL header */ cpl->ctrl0 = txq->cpl_ctrl0; cpl->pack = 0; cpl->len = htobe16(pktlen); - cpl->ctrl1 = htobe64(ctrl1); out = (void *)(cpl + 1); @@ -1419,13 +1414,21 @@ ktls_write_tcp_options(struct sge_txq *txq, void *dst, if (m->m_pkthdr.l3hlen > sizeof(*ip)) copy_to_txd(&txq->eq, (caddr_t)(ip + 1), &out, m->m_pkthdr.l3hlen - sizeof(*ip)); + ctrl1 = V_TXPKT_CSUM_TYPE(TX_CSUM_TCPIP) | + V_T6_TXPKT_ETHHDR_LEN(m->m_pkthdr.l2hlen - ETHER_HDR_LEN) | + V_TXPKT_IPHDR_LEN(m->m_pkthdr.l3hlen); } else { ip6 = (void *)((char *)eh + m->m_pkthdr.l2hlen); newip6 = *ip6; newip6.ip6_plen = htons(pktlen - m->m_pkthdr.l2hlen); copy_to_txd(&txq->eq, (caddr_t)&newip6, &out, sizeof(newip6)); MPASS(m->m_pkthdr.l3hlen == sizeof(*ip6)); + ctrl1 = V_TXPKT_CSUM_TYPE(TX_CSUM_TCPIP6) | + V_T6_TXPKT_ETHHDR_LEN(m->m_pkthdr.l2hlen - ETHER_HDR_LEN) | + V_TXPKT_IPHDR_LEN(m->m_pkthdr.l3hlen); } + cpl->ctrl1 = htobe64(ctrl1); + txq->txcsum++; /* Clear PUSH and FIN in the TCP header if present. */ tcp = (void *)((char *)eh + m->m_pkthdr.l2hlen + m->m_pkthdr.l3hlen); @@ -1493,15 +1496,10 @@ ktls_write_tunnel_packet(struct sge_txq *txq, void *ds cpl = (void *)(wr + 1); - /* Checksum offload */ - ctrl1 = 0; - txq->txcsum++; - /* CPL header */ cpl->ctrl0 = txq->cpl_ctrl0; cpl->pack = 0; cpl->len = htobe16(pktlen); - cpl->ctrl1 = htobe64(ctrl1); out = (void *)(cpl + 1); @@ -1518,13 +1516,21 @@ ktls_write_tunnel_packet(struct sge_txq *txq, void *ds if (m->m_pkthdr.l3hlen > sizeof(*ip)) copy_to_txd(&txq->eq, (caddr_t)(ip + 1), &out, m->m_pkthdr.l3hlen - sizeof(*ip)); + ctrl1 = V_TXPKT_CSUM_TYPE(TX_CSUM_TCPIP) | + V_T6_TXPKT_ETHHDR_LEN(m->m_pkthdr.l2hlen - ETHER_HDR_LEN) | + V_TXPKT_IPHDR_LEN(m->m_pkthdr.l3hlen); } else { ip6 = (void *)((char *)eh + m->m_pkthdr.l2hlen); newip6 = *ip6; newip6.ip6_plen = htons(pktlen - m->m_pkthdr.l2hlen); copy_to_txd(&txq->eq, (caddr_t)&newip6, &out, sizeof(newip6)); MPASS(m->m_pkthdr.l3hlen == sizeof(*ip6)); + ctrl1 = V_TXPKT_CSUM_TYPE(TX_CSUM_TCPIP6) | + V_T6_TXPKT_ETHHDR_LEN(m->m_pkthdr.l2hlen - ETHER_HDR_LEN) | + V_TXPKT_IPHDR_LEN(m->m_pkthdr.l3hlen); } + cpl->ctrl1 = htobe64(ctrl1); + txq->txcsum++; /* Set sequence number in TCP header. */ tcp = (void *)((char *)eh + m->m_pkthdr.l2hlen + m->m_pkthdr.l3hlen); @@ -2134,15 +2140,10 @@ ktls_write_tcp_fin(struct sge_txq *txq, void *dst, str cpl = (void *)(wr + 1); - /* Checksum offload */ - ctrl1 = 0; - txq->txcsum++; - /* CPL header */ cpl->ctrl0 = txq->cpl_ctrl0; cpl->pack = 0; cpl->len = htobe16(pktlen); - cpl->ctrl1 = htobe64(ctrl1); out = (void *)(cpl + 1); @@ -2159,13 +2160,21 @@ ktls_write_tcp_fin(struct sge_txq *txq, void *dst, str if (m->m_pkthdr.l3hlen > sizeof(*ip)) copy_to_txd(&txq->eq, (caddr_t)(ip + 1), &out, m->m_pkthdr.l3hlen - sizeof(*ip)); + ctrl1 = V_TXPKT_CSUM_TYPE(TX_CSUM_TCPIP) | + V_T6_TXPKT_ETHHDR_LEN(m->m_pkthdr.l2hlen - ETHER_HDR_LEN) | + V_TXPKT_IPHDR_LEN(m->m_pkthdr.l3hlen); } else { ip6 = (void *)((char *)eh + m->m_pkthdr.l2hlen); newip6 = *ip6; newip6.ip6_plen = htons(pktlen - m->m_pkthdr.l2hlen); copy_to_txd(&txq->eq, (caddr_t)&newip6, &out, sizeof(newip6)); MPASS(m->m_pkthdr.l3hlen == sizeof(*ip6)); + ctrl1 = V_TXPKT_CSUM_TYPE(TX_CSUM_TCPIP6) | + V_T6_TXPKT_ETHHDR_LEN(m->m_pkthdr.l2hlen - ETHER_HDR_LEN) | + V_TXPKT_IPHDR_LEN(m->m_pkthdr.l3hlen); } + cpl->ctrl1 = htobe64(ctrl1); + txq->txcsum++; /* Set sequence number in TCP header. */ tcp = (void *)((char *)eh + m->m_pkthdr.l2hlen + m->m_pkthdr.l3hlen); Modified: head/sys/dev/cxgbe/t4_sched.c ============================================================================== --- head/sys/dev/cxgbe/t4_sched.c Fri Dec 13 20:30:26 2019 (r355729) +++ head/sys/dev/cxgbe/t4_sched.c Fri Dec 13 20:38:58 2019 (r355730) @@ -797,7 +797,7 @@ failed: cst->tx_credits = sc->params.eo_wr_cred; cst->tx_total = cst->tx_credits; cst->plen = 0; - cst->ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) | + cst->ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT_XT) | V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(sc->pf) | V_TXPKT_VF(vi->vin) | V_TXPKT_VF_VLD(vi->vfvld)); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Dec 13 20:30:26 2019 (r355729) +++ head/sys/dev/cxgbe/t4_sge.c Fri Dec 13 20:38:58 2019 (r355730) @@ -294,14 +294,14 @@ static inline u_int txpkt_vm_len16(u_int, u_int); static inline u_int txpkts0_len16(u_int); static inline u_int txpkts1_len16(void); static u_int write_raw_wr(struct sge_txq *, void *, struct mbuf *, u_int); -static u_int write_txpkt_wr(struct sge_txq *, struct fw_eth_tx_pkt_wr *, - struct mbuf *, u_int); +static u_int write_txpkt_wr(struct adapter *, struct sge_txq *, + struct fw_eth_tx_pkt_wr *, struct mbuf *, u_int); static u_int write_txpkt_vm_wr(struct adapter *, struct sge_txq *, struct fw_eth_tx_pkt_vm_wr *, struct mbuf *, u_int); static int try_txpkts(struct mbuf *, struct mbuf *, struct txpkts *, u_int); static int add_to_txpkts(struct mbuf *, struct txpkts *, u_int); -static u_int write_txpkts_wr(struct sge_txq *, struct fw_eth_tx_pkts_wr *, - struct mbuf *, const struct txpkts *, u_int); +static u_int write_txpkts_wr(struct adapter *, struct sge_txq *, + struct fw_eth_tx_pkts_wr *, struct mbuf *, const struct txpkts *, u_int); static void write_gl_to_txd(struct sge_txq *, struct mbuf *, caddr_t *, int); static inline void copy_to_txd(struct sge_eq *, caddr_t, caddr_t *, int); static inline void ring_eq_db(struct adapter *, struct sge_eq *, u_int); @@ -2345,31 +2345,31 @@ alloc_wr_mbuf(int len, int how) } static inline int -needs_tso(struct mbuf *m) +needs_hwcsum(struct mbuf *m) { M_ASSERTPKTHDR(m); - return (m->m_pkthdr.csum_flags & CSUM_TSO); + return (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_IP | + CSUM_TSO | CSUM_UDP_IPV6 | CSUM_TCP_IPV6)); } static inline int -needs_l3_csum(struct mbuf *m) +needs_tso(struct mbuf *m) { M_ASSERTPKTHDR(m); - return (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO)); + return (m->m_pkthdr.csum_flags & CSUM_TSO); } static inline int -needs_l4_csum(struct mbuf *m) +needs_l3_csum(struct mbuf *m) { M_ASSERTPKTHDR(m); - return (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_UDP_IPV6 | - CSUM_TCP_IPV6 | CSUM_TSO)); + return (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO)); } static inline int @@ -2382,6 +2382,16 @@ needs_tcp_csum(struct mbuf *m) #ifdef RATELIMIT static inline int +needs_l4_csum(struct mbuf *m) +{ + + M_ASSERTPKTHDR(m); + + return (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_UDP_IPV6 | + CSUM_TCP_IPV6 | CSUM_TSO)); +} + +static inline int needs_udp_csum(struct mbuf *m) { @@ -2631,11 +2641,11 @@ restart: } #endif - if (!needs_tso(m0) && + if (!needs_hwcsum(m0) #ifdef RATELIMIT - !needs_eo(cst) && + && !needs_eo(cst) #endif - !(sc->flags & IS_VF && (needs_l3_csum(m0) || needs_l4_csum(m0)))) + ) return (0); m = m0; @@ -2991,14 +3001,14 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx) next_cidx = 0; } - n = write_txpkts_wr(txq, wr, m0, &txp, available); + n = write_txpkts_wr(sc, txq, wr, m0, &txp, available); total += txp.npkt; remaining -= txp.npkt; } else { total++; remaining--; ETHER_BPF_MTAP(ifp, m0); - n = write_txpkt_wr(txq, (void *)wr, m0, available); + n = write_txpkt_wr(sc, txq, (void *)wr, m0, available); } MPASS(n >= 1 && n <= available); if (!(mbuf_cflags(m0) & MC_TLS)) @@ -4161,7 +4171,7 @@ alloc_txq(struct vi_info *vi, struct sge_txq *txq, int txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT_XT) | V_TXPKT_INTF(pi->tx_chan)); else - txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) | + txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT_XT) | V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(sc->pf) | V_TXPKT_VF(vi->vin) | V_TXPKT_VF_VLD(vi->vfvld)); txq->tc_idx = -1; @@ -4632,6 +4642,55 @@ imm_payload(u_int ndesc) return (n); } +static inline uint64_t +csum_to_ctrl(struct adapter *sc, struct mbuf *m) +{ + uint64_t ctrl; + int csum_type; + + M_ASSERTPKTHDR(m); + + if (needs_hwcsum(m) == 0) + return (F_TXPKT_IPCSUM_DIS | F_TXPKT_L4CSUM_DIS); + + ctrl = 0; + if (needs_l3_csum(m) == 0) + ctrl |= F_TXPKT_IPCSUM_DIS; + switch (m->m_pkthdr.csum_flags & + (CSUM_IP_TCP | CSUM_IP_UDP | CSUM_IP6_TCP | CSUM_IP6_UDP)) { + case CSUM_IP_TCP: + csum_type = TX_CSUM_TCPIP; + break; + case CSUM_IP_UDP: + csum_type = TX_CSUM_UDPIP; + break; + case CSUM_IP6_TCP: + csum_type = TX_CSUM_TCPIP6; + break; + case CSUM_IP6_UDP: + csum_type = TX_CSUM_UDPIP6; + break; + default: + /* needs_hwcsum told us that at least some hwcsum is needed. */ + MPASS(ctrl == 0); + MPASS(m->m_pkthdr.csum_flags & CSUM_IP); + ctrl |= F_TXPKT_L4CSUM_DIS; + csum_type = TX_CSUM_IP; + break; + } + + MPASS(m->m_pkthdr.l2hlen > 0); + MPASS(m->m_pkthdr.l3hlen > 0); + ctrl |= V_TXPKT_CSUM_TYPE(csum_type) | + V_TXPKT_IPHDR_LEN(m->m_pkthdr.l3hlen); + if (chip_id(sc) <= CHELSIO_T5) + ctrl |= V_TXPKT_ETHHDR_LEN(m->m_pkthdr.l2hlen - ETHER_HDR_LEN); + else + ctrl |= V_T6_TXPKT_ETHHDR_LEN(m->m_pkthdr.l2hlen - ETHER_HDR_LEN); + + return (ctrl); +} + /* * Write a VM txpkt WR for this packet to the hardware descriptors, update the * software descriptor, and advance the pidx. It is guaranteed that enough @@ -4648,7 +4707,7 @@ write_txpkt_vm_wr(struct adapter *sc, struct sge_txq * struct cpl_tx_pkt_core *cpl; uint32_t ctrl; /* used in many unrelated places */ uint64_t ctrl1; - int csum_type, len16, ndesc, pktlen, nsegs; + int len16, ndesc, pktlen, nsegs; caddr_t dst; TXQ_LOCK_ASSERT_OWNED(txq); @@ -4673,7 +4732,7 @@ write_txpkt_vm_wr(struct adapter *sc, struct sge_txq * wr->equiq_to_len16 = htobe32(ctrl); wr->r3[0] = 0; wr->r3[1] = 0; - + /* * Copy over ethmacdst, ethmacsrc, ethtype, and vlantci. * vlantci is ignored unless the ethtype is 0x8100, so it's @@ -4683,7 +4742,6 @@ write_txpkt_vm_wr(struct adapter *sc, struct sge_txq * */ m_copydata(m0, 0, sizeof(struct ether_header) + 2, wr->ethmacdst); - csum_type = -1; if (needs_tso(m0)) { struct cpl_tx_pkt_lso_core *lso = (void *)(wr + 1); @@ -4693,10 +4751,10 @@ write_txpkt_vm_wr(struct adapter *sc, struct sge_txq * __func__, m0)); ctrl = V_LSO_OPCODE(CPL_TX_PKT_LSO) | F_LSO_FIRST_SLICE | - F_LSO_LAST_SLICE | V_LSO_IPHDR_LEN(m0->m_pkthdr.l3hlen >> 2) - | V_LSO_TCPHDR_LEN(m0->m_pkthdr.l4hlen >> 2); - if (m0->m_pkthdr.l2hlen == sizeof(struct ether_vlan_header)) - ctrl |= V_LSO_ETHHDR_LEN(1); + F_LSO_LAST_SLICE | V_LSO_ETHHDR_LEN((m0->m_pkthdr.l2hlen - + ETHER_HDR_LEN) >> 2) | + V_LSO_IPHDR_LEN(m0->m_pkthdr.l3hlen >> 2) | + V_LSO_TCPHDR_LEN(m0->m_pkthdr.l4hlen >> 2); if (m0->m_pkthdr.l3hlen == sizeof(struct ip6_hdr)) ctrl |= F_LSO_IPV6; @@ -4706,70 +4764,15 @@ write_txpkt_vm_wr(struct adapter *sc, struct sge_txq * lso->seqno_offset = htobe32(0); lso->len = htobe32(pktlen); - if (m0->m_pkthdr.l3hlen == sizeof(struct ip6_hdr)) - csum_type = TX_CSUM_TCPIP6; - else - csum_type = TX_CSUM_TCPIP; - cpl = (void *)(lso + 1); txq->tso_wrs++; - } else { - if (m0->m_pkthdr.csum_flags & CSUM_IP_TCP) - csum_type = TX_CSUM_TCPIP; - else if (m0->m_pkthdr.csum_flags & CSUM_IP_UDP) - csum_type = TX_CSUM_UDPIP; - else if (m0->m_pkthdr.csum_flags & CSUM_IP6_TCP) - csum_type = TX_CSUM_TCPIP6; - else if (m0->m_pkthdr.csum_flags & CSUM_IP6_UDP) - csum_type = TX_CSUM_UDPIP6; -#if defined(INET) - else if (m0->m_pkthdr.csum_flags & CSUM_IP) { - /* - * XXX: The firmware appears to stomp on the - * fragment/flags field of the IP header when - * using TX_CSUM_IP. Fall back to doing - * software checksums. - */ - u_short *sump; - struct mbuf *m; - int offset; - - m = m0; - offset = 0; - sump = m_advance(&m, &offset, m0->m_pkthdr.l2hlen + - offsetof(struct ip, ip_sum)); - *sump = in_cksum_skip(m0, m0->m_pkthdr.l2hlen + - m0->m_pkthdr.l3hlen, m0->m_pkthdr.l2hlen); - m0->m_pkthdr.csum_flags &= ~CSUM_IP; - } -#endif - + } else cpl = (void *)(wr + 1); - } /* Checksum offload */ - ctrl1 = 0; - if (needs_l3_csum(m0) == 0) - ctrl1 |= F_TXPKT_IPCSUM_DIS; - if (csum_type >= 0) { - KASSERT(m0->m_pkthdr.l2hlen > 0 && m0->m_pkthdr.l3hlen > 0, - ("%s: mbuf %p needs checksum offload but missing header lengths", - __func__, m0)); - - if (chip_id(sc) <= CHELSIO_T5) { - ctrl1 |= V_TXPKT_ETHHDR_LEN(m0->m_pkthdr.l2hlen - - ETHER_HDR_LEN); - } else { - ctrl1 |= V_T6_TXPKT_ETHHDR_LEN(m0->m_pkthdr.l2hlen - - ETHER_HDR_LEN); - } - ctrl1 |= V_TXPKT_IPHDR_LEN(m0->m_pkthdr.l3hlen); - ctrl1 |= V_TXPKT_CSUM_TYPE(csum_type); - } else - ctrl1 |= F_TXPKT_L4CSUM_DIS; - if (m0->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP | - CSUM_UDP_IPV6 | CSUM_TCP_IPV6 | CSUM_TSO)) + ctrl1 = csum_to_ctrl(sc, m0); + if (ctrl1 != (F_TXPKT_IPCSUM_DIS | F_TXPKT_L4CSUM_DIS)) txq->txcsum++; /* some hardware assistance provided */ /* VLAN tag insertion */ @@ -4852,8 +4855,8 @@ write_raw_wr(struct sge_txq *txq, void *wr, struct mbu * The return value is the # of hardware descriptors used. */ static u_int -write_txpkt_wr(struct sge_txq *txq, struct fw_eth_tx_pkt_wr *wr, - struct mbuf *m0, u_int available) +write_txpkt_wr(struct adapter *sc, struct sge_txq *txq, + struct fw_eth_tx_pkt_wr *wr, struct mbuf *m0, u_int available) { struct sge_eq *eq = &txq->eq; struct tx_sdesc *txsd; @@ -4902,10 +4905,10 @@ write_txpkt_wr(struct sge_txq *txq, struct fw_eth_tx_p __func__, m0)); ctrl = V_LSO_OPCODE(CPL_TX_PKT_LSO) | F_LSO_FIRST_SLICE | - F_LSO_LAST_SLICE | V_LSO_IPHDR_LEN(m0->m_pkthdr.l3hlen >> 2) - | V_LSO_TCPHDR_LEN(m0->m_pkthdr.l4hlen >> 2); - if (m0->m_pkthdr.l2hlen == sizeof(struct ether_vlan_header)) - ctrl |= V_LSO_ETHHDR_LEN(1); + F_LSO_LAST_SLICE | V_LSO_ETHHDR_LEN((m0->m_pkthdr.l2hlen - + ETHER_HDR_LEN) >> 2) | + V_LSO_IPHDR_LEN(m0->m_pkthdr.l3hlen >> 2) | + V_LSO_TCPHDR_LEN(m0->m_pkthdr.l4hlen >> 2); if (m0->m_pkthdr.l3hlen == sizeof(struct ip6_hdr)) ctrl |= F_LSO_IPV6; @@ -4922,13 +4925,8 @@ write_txpkt_wr(struct sge_txq *txq, struct fw_eth_tx_p cpl = (void *)(wr + 1); /* Checksum offload */ - ctrl1 = 0; - if (needs_l3_csum(m0) == 0) - ctrl1 |= F_TXPKT_IPCSUM_DIS; - if (needs_l4_csum(m0) == 0) - ctrl1 |= F_TXPKT_L4CSUM_DIS; - if (m0->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP | - CSUM_UDP_IPV6 | CSUM_TCP_IPV6 | CSUM_TSO)) + ctrl1 = csum_to_ctrl(sc, m0); + if (ctrl1 != (F_TXPKT_IPCSUM_DIS | F_TXPKT_L4CSUM_DIS)) txq->txcsum++; /* some hardware assistance provided */ /* VLAN tag insertion */ @@ -5049,8 +5047,9 @@ add_to_txpkts(struct mbuf *m, struct txpkts *txp, u_in * The return value is the # of hardware descriptors used. */ static u_int -write_txpkts_wr(struct sge_txq *txq, struct fw_eth_tx_pkts_wr *wr, - struct mbuf *m0, const struct txpkts *txp, u_int available) +write_txpkts_wr(struct adapter *sc, struct sge_txq *txq, + struct fw_eth_tx_pkts_wr *wr, struct mbuf *m0, const struct txpkts *txp, + u_int available) { struct sge_eq *eq = &txq->eq; struct tx_sdesc *txsd; @@ -5114,13 +5113,8 @@ write_txpkts_wr(struct sge_txq *txq, struct fw_eth_tx_ } /* Checksum offload */ - ctrl1 = 0; - if (needs_l3_csum(m) == 0) - ctrl1 |= F_TXPKT_IPCSUM_DIS; - if (needs_l4_csum(m) == 0) - ctrl1 |= F_TXPKT_L4CSUM_DIS; - if (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP | - CSUM_UDP_IPV6 | CSUM_TCP_IPV6 | CSUM_TSO)) + ctrl1 = csum_to_ctrl(sc, m); + if (ctrl1 != (F_TXPKT_IPCSUM_DIS | F_TXPKT_L4CSUM_DIS)) txq->txcsum++; /* some hardware assistance provided */ /* VLAN tag insertion */ @@ -5948,10 +5942,10 @@ write_ethofld_wr(struct cxgbe_rate_tag *cst, struct fw ctrl = V_LSO_OPCODE(CPL_TX_PKT_LSO) | F_LSO_FIRST_SLICE | F_LSO_LAST_SLICE | + V_LSO_ETHHDR_LEN((m0->m_pkthdr.l2hlen - + ETHER_HDR_LEN) >> 2) | V_LSO_IPHDR_LEN(m0->m_pkthdr.l3hlen >> 2) | V_LSO_TCPHDR_LEN(m0->m_pkthdr.l4hlen >> 2); - if (m0->m_pkthdr.l2hlen == sizeof(struct ether_vlan_header)) - ctrl |= V_LSO_ETHHDR_LEN(1); if (m0->m_pkthdr.l3hlen == sizeof(struct ip6_hdr)) ctrl |= F_LSO_IPV6; lso->lso_ctrl = htobe32(ctrl); @@ -5968,8 +5962,8 @@ write_ethofld_wr(struct cxgbe_rate_tag *cst, struct fw } /* Checksum offload must be requested for ethofld. */ - ctrl1 = 0; MPASS(needs_l4_csum(m0)); + ctrl1 = csum_to_ctrl(cst->adapter, m0); /* VLAN tag insertion */ if (needs_vlan_insertion(m0)) { From owner-svn-src-all@freebsd.org Fri Dec 13 20:45:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5278D1D670C; Fri, 13 Dec 2019 20:45:46 +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 47ZN3Z1SlSz4Txs; Fri, 13 Dec 2019 20:45:46 +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 2D6A419E0E; Fri, 13 Dec 2019 20:45:46 +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 xBDKjkKH012942; Fri, 13 Dec 2019 20:45:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDKjked012941; Fri, 13 Dec 2019 20:45:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912132045.xBDKjked012941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Dec 2019 20:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355731 - stable/11/crypto/openssh X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/crypto/openssh X-SVN-Commit-Revision: 355731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 20:45:46 -0000 Author: emaste Date: Fri Dec 13 20:45:45 2019 New Revision: 355731 URL: https://svnweb.freebsd.org/changeset/base/355731 Log: sftp: disallow creation (of empty files) in read-only mode Direct commit to stable/11; already fixed in newer OpenSSH in 12 and later. PR: 233801 Reported by: Dani Obtained from: OpenBSD 1.111 Security: CVE-2017-15906 Modified: stable/11/crypto/openssh/sftp-server.c Modified: stable/11/crypto/openssh/sftp-server.c ============================================================================== --- stable/11/crypto/openssh/sftp-server.c Fri Dec 13 20:38:58 2019 (r355730) +++ stable/11/crypto/openssh/sftp-server.c Fri Dec 13 20:45:45 2019 (r355731) @@ -691,8 +691,8 @@ process_open(u_int32_t id) logit("open \"%s\" flags %s mode 0%o", name, string_from_portable(pflags), mode); if (readonly && - ((flags & O_ACCMODE) == O_WRONLY || - (flags & O_ACCMODE) == O_RDWR)) { + ((flags & O_ACCMODE) != O_RDONLY || + (flags & (O_CREAT|O_TRUNC)) != 0)) { verbose("Refusing open request in read-only mode"); status = SSH2_FX_PERMISSION_DENIED; } else { From owner-svn-src-all@freebsd.org Fri Dec 13 21:03:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20E761D6FAF; Fri, 13 Dec 2019 21:03:15 +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 47ZNRl0nPyz4W83; Fri, 13 Dec 2019 21:03:15 +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 1601A1A1E0; Fri, 13 Dec 2019 21:03:15 +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 xBDL3F94024556; Fri, 13 Dec 2019 21:03:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDL3DX9024547; Fri, 13 Dec 2019 21:03:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912132103.xBDL3DX9024547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Dec 2019 21:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355732 - in head: . share/man/man9 sys/kern sys/netgraph sys/sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: . share/man/man9 sys/kern sys/netgraph sys/sys X-SVN-Commit-Revision: 355732 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 21:03:15 -0000 Author: jhb Date: Fri Dec 13 21:03:12 2019 New Revision: 355732 URL: https://svnweb.freebsd.org/changeset/base/355732 Log: Remove the deprecated timeout(9) interface. All in-tree consumers have been converted to callout(9). Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22602 Added: head/share/man/man9/callout.9 (contents, props changed) - copied, changed from r355731, head/share/man/man9/timeout.9 Deleted: head/share/man/man9/timeout.9 Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/sys/kern/kern_intr.c head/sys/kern/kern_timeout.c head/sys/netgraph/ng_base.c head/sys/sys/interrupt.h head/sys/sys/param.h head/sys/sys/systm.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Dec 13 20:45:45 2019 (r355731) +++ head/ObsoleteFiles.inc Fri Dec 13 21:03:12 2019 (r355732) @@ -36,6 +36,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20191213: remove timeout(9) +OLD_FILES+=usr/share/man/man9/timeout.9.gz +OLD_FILES+=usr/share/man/man9/untimeout.9.gz # 20191128: Removal of trm(4) OLD_FILES+=usr/share/man/man4/trm.4.gz # 20191121: Removal of sio(4) Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Dec 13 20:45:45 2019 (r355731) +++ head/share/man/man9/Makefile Fri Dec 13 21:03:12 2019 (r355732) @@ -56,6 +56,7 @@ MAN= accept_filter.9 \ BUS_SETUP_INTR.9 \ bus_space.9 \ byteorder.9 \ + callout.9 \ casuword.9 \ cd.9 \ cnv.9 \ @@ -315,7 +316,6 @@ MAN= accept_filter.9 \ tcp_functions.9 \ thread_exit.9 \ time.9 \ - timeout.9 \ tvtohz.9 \ ucred.9 \ uidinfo.9 \ @@ -766,6 +766,30 @@ MLINKS+=byteorder.9 be16dec.9 \ byteorder.9 le64dec.9 \ byteorder.9 le64enc.9 \ byteorder.9 le64toh.9 +MLINKS+=callout.9 callout_active.9 \ + callout.9 callout_async_drain.9 \ + callout.9 callout_deactivate.9 \ + callout.9 callout_drain.9 \ + callout.9 callout_handle_init.9 \ + callout.9 callout_init.9 \ + callout.9 callout_init_mtx.9 \ + callout.9 callout_init_rm.9 \ + callout.9 callout_init_rw.9 \ + callout.9 callout_pending.9 \ + callout.9 callout_reset.9 \ + callout.9 callout_reset_curcpu.9 \ + callout.9 callout_reset_on.9 \ + callout.9 callout_reset_sbt.9 \ + callout.9 callout_reset_sbt_curcpu.9 \ + callout.9 callout_reset_sbt_on.9 \ + callout.9 callout_schedule.9 \ + callout.9 callout_schedule_curcpu.9 \ + callout.9 callout_schedule_on.9 \ + callout.9 callout_schedule_sbt.9 \ + callout.9 callout_schedule_sbt_curcpu.9 \ + callout.9 callout_schedule_sbt_on.9 \ + callout.9 callout_stop.9 \ + callout.9 callout_when.9 MLINKS+=cnv.9 cnvlist.9 \ cnv.9 cnvlist_free_binary.9 \ cnv.9 cnvlist_free_bool.9 \ @@ -2097,32 +2121,6 @@ MLINKS+=tcp_functions.9 register_tcp_functions.9 \ MLINKS+=time.9 boottime.9 \ time.9 time_second.9 \ time.9 time_uptime.9 -MLINKS+=timeout.9 callout.9 \ - timeout.9 callout_active.9 \ - timeout.9 callout_async_drain.9 \ - timeout.9 callout_deactivate.9 \ - timeout.9 callout_drain.9 \ - timeout.9 callout_handle_init.9 \ - timeout.9 callout_init.9 \ - timeout.9 callout_init_mtx.9 \ - timeout.9 callout_init_rm.9 \ - timeout.9 callout_init_rw.9 \ - timeout.9 callout_pending.9 \ - timeout.9 callout_reset.9 \ - timeout.9 callout_reset_curcpu.9 \ - timeout.9 callout_reset_on.9 \ - timeout.9 callout_reset_sbt.9 \ - timeout.9 callout_reset_sbt_curcpu.9 \ - timeout.9 callout_reset_sbt_on.9 \ - timeout.9 callout_schedule.9 \ - timeout.9 callout_schedule_curcpu.9 \ - timeout.9 callout_schedule_on.9 \ - timeout.9 callout_schedule_sbt.9 \ - timeout.9 callout_schedule_sbt_curcpu.9 \ - timeout.9 callout_schedule_sbt_on.9 \ - timeout.9 callout_stop.9 \ - timeout.9 callout_when.9 \ - timeout.9 untimeout.9 MLINKS+=ucred.9 crcopy.9 \ ucred.9 crcopysafe.9 \ ucred.9 crdup.9 \ Copied and modified: head/share/man/man9/callout.9 (from r355731, head/share/man/man9/timeout.9) ============================================================================== --- head/share/man/man9/timeout.9 Fri Dec 13 20:45:45 2019 (r355731, copy source) +++ head/share/man/man9/callout.9 Fri Dec 13 21:03:12 2019 (r355732) @@ -29,8 +29,8 @@ .\" .\" $FreeBSD$ .\" -.Dd December 10, 2019 -.Dt TIMEOUT 9 +.Dd December 13, 2019 +.Dt CALLOUT 9 .Os .Sh NAME .Nm callout_active , @@ -56,17 +56,13 @@ .Nm callout_schedule_sbt_curcpu , .Nm callout_schedule_sbt_on , .Nm callout_stop , -.Nm callout_when , -.Nm timeout , -.Nm untimeout +.Nm callout_when .Nd execute a function after a specified length of time .Sh SYNOPSIS .In sys/types.h .In sys/callout.h -.In sys/systm.h .Bd -literal typedef void callout_func_t (void *); -typedef void timeout_t (void *); .Ed .Ft int .Fn callout_active "struct callout *c" @@ -179,10 +175,6 @@ struct callout_handle handle = CALLOUT_HANDLE_INITIALI .Fa "sbintime_t *sbt_res" .Fa "sbintime_t *precision_res" .Fc -.Ft struct callout_handle -.Fn timeout "timeout_t *func" "void *arg" "int ticks" -.Ft void -.Fn untimeout "timeout_t *func" "void *arg" "struct callout_handle handle" .Sh DESCRIPTION The .Nm callout @@ -808,99 +800,6 @@ should be used. In particular, a callout should always be drained prior to destroying its associated lock or releasing the storage for the callout structure. -.Sh LEGACY API -.Bf Sy -The functions below are a legacy API that will be removed in a future release. -New code should not use these routines. -.Ef -.Pp -The function -.Fn timeout -schedules a call to the function given by the argument -.Fa func -to take place after -.Fa ticks Ns No /hz -seconds. -Non-positive values of -.Fa ticks -are silently converted to the value -.Sq 1 . -.Fa func -should be a pointer to a function that takes a -.Fa void * -argument. -Upon invocation, -.Fa func -will receive -.Fa arg -as its only argument. -The return value from -.Fn timeout -is a -.Ft struct callout_handle -which can be used in conjunction with the -.Fn untimeout -function to request that a scheduled timeout be canceled. -.Pp -The function -.Fn callout_handle_init -can be used to initialize a handle to a state which will cause -any calls to -.Fn untimeout -with that handle to return with no side -effects. -.Pp -Assigning a callout handle the value of -.Fn CALLOUT_HANDLE_INITIALIZER -performs the same function as -.Fn callout_handle_init -and is provided for use on statically declared or global callout handles. -.Pp -The function -.Fn untimeout -cancels the timeout associated with -.Fa handle -using the -.Fa func -and -.Fa arg -arguments to validate the handle. -If the handle does not correspond to a timeout with -the function -.Fa func -taking the argument -.Fa arg -no action is taken. -.Fa handle -must be initialized by a previous call to -.Fn timeout , -.Fn callout_handle_init , -or assigned the value of -.Fn CALLOUT_HANDLE_INITIALIZER "&handle" -before being passed to -.Fn untimeout . -The behavior of calling -.Fn untimeout -with an uninitialized handle -is undefined. -.Pp -As handles are recycled by the system, it is possible (although unlikely) -that a handle from one invocation of -.Fn timeout -may match the handle of another invocation of -.Fn timeout -if both calls used the same function pointer and argument, and the first -timeout is expired or canceled before the second call. -The timeout facility offers O(1) running time for -.Fn timeout -and -.Fn untimeout . -Timeouts are executed from -.Fn softclock -with the -.Va Giant -lock held. -Thus they are protected from re-entrancy. .Sh RETURN VALUES The .Fn callout_active @@ -928,24 +827,28 @@ and functions return a value of one if the callout was still pending when it was called, a zero if the callout could not be stopped and a negative one is it was either not running or has already completed. -The -.Fn timeout -function returns a -.Ft struct callout_handle -that can be passed to -.Fn untimeout . .Sh HISTORY -The current timeout and untimeout routines are based on the work of +.Fx +initially used the long standing +.Bx +linked list +callout mechanism which offered O(n) insertion and removal running time +but did not generate or require handles for untimeout operations. +.Pp +.Fx 3.0 +introduced a new set of timeout and untimeout routines from +.Nx +based on the work of .An Adam M. Costello and .An George Varghese , published in a technical report entitled .%T "Redesigning the BSD Callout and Timer Facilities" -and modified slightly for inclusion in +and modified for inclusion in .Fx by .An Justin T. Gibbs . -The original work on the data structures used in this implementation +The original work on the data structures used in that implementation was published by .An G. Varghese and @@ -954,8 +857,66 @@ in the paper .%T "Hashed and Hierarchical Timing Wheels: Data Structures for the Efficient Implementation of a Timer Facility" in the .%B "Proceedings of the 11th ACM Annual Symposium on Operating Systems Principles" . -The current implementation replaces the long standing -.Bx -linked list -callout mechanism which offered O(n) insertion and removal running time -but did not generate or require handles for untimeout operations. +.Pp +.Fx 3.3 +introduced the first implementations of +.Fn callout_init , +.Fn callout_reset , +and +.Fn callout_stop +which permitted callers to allocate dedicated storage for callouts. +This ensured that a callout would always fire unlike +.Fn timeout +which would silently fail if it was unable to allocate a callout. +.Pp +.Fx 5.0 +permitted callout handlers to be tagged as MPSAFE via +.Fn callout_init . +.Pp +.Fx 5.3 +introduced +.Fn callout_drain . +.Pp +.Fx 6.0 +introduced +.Fn callout_init_mtx . +.Pp +.Fx 8.0 +introduced per-CPU callout wheels, +.Fn callout_init_rw , +and +.Fn callout_schedule . +.Pp +.Fx 9.0 +changed the underlying timer interrupts used to drive callouts to prefer +one-shot event timers instead of a periodic timer interrupt. +.Pp +.Fx 10.0 +switched the callout wheel to support tickless operation. +These changes introduced +.Vt sbintime_t +and the +.Fn callout_reset_sbt* +family of functions. +.Fx 10.0 also added +.Dv C_DIRECT_EXEC +and +.Fn callout_init_rm . +.Pp +.Fx 10.2 +introduced the +.Fn callout_schedule_sbt* +family of functions. +.Pp +.Fx 11.0 +introduced +.Fn callout_async_drain . +.Fx 11.1 +introduced +.Fn callout_when . +.Fx 13.0 +removed +.Vt timeout_t , +.Fn timeout , +and +.Fn untimeout . Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Fri Dec 13 20:45:45 2019 (r355731) +++ head/sys/kern/kern_intr.c Fri Dec 13 21:03:12 2019 (r355732) @@ -84,7 +84,6 @@ struct intr_entropy { uintptr_t event; }; -struct intr_event *clk_intr_event; struct intr_event *tty_intr_event; void *vm_ih; struct proc *intrproc; Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Fri Dec 13 20:45:45 2019 (r355731) +++ head/sys/kern/kern_timeout.c Fri Dec 13 21:03:12 2019 (r355732) @@ -167,10 +167,8 @@ struct callout_cpu { struct mtx_padalign cc_lock; struct cc_exec cc_exec_entity[2]; struct callout *cc_next; - struct callout *cc_callout; struct callout_list *cc_callwheel; struct callout_tailq cc_expireq; - struct callout_slist cc_callfree; sbintime_t cc_firstevent; sbintime_t cc_lastscan; void *cc_cookie; @@ -210,7 +208,7 @@ struct callout_cpu cc_cpu; #define CC_UNLOCK(cc) mtx_unlock_spin(&(cc)->cc_lock) #define CC_LOCK_ASSERT(cc) mtx_assert(&(cc)->cc_lock, MA_OWNED) -static int __read_mostly timeout_cpu; +static int __read_mostly cc_default_cpu; static void callout_cpu_init(struct callout_cpu *cc, int cpu); static void softclock_call_cc(struct callout *c, struct callout_cpu *cc, @@ -279,6 +277,7 @@ static void callout_callwheel_init(void *dummy) { struct callout_cpu *cc; + int cpu; /* * Calculate the size of the callout wheel and the preallocated @@ -304,16 +303,14 @@ callout_callwheel_init(void *dummy) TUNABLE_INT_FETCH("kern.pin_pcpu_swi", &pin_pcpu_swi); /* - * Only BSP handles timeout(9) and receives a preallocation. - * - * XXX: Once all timeout(9) consumers are converted this can - * be removed. + * Initialize callout wheels. The software interrupt threads + * are created later. */ - timeout_cpu = PCPU_GET(cpuid); - cc = CC_CPU(timeout_cpu); - cc->cc_callout = malloc(ncallout * sizeof(struct callout), - M_CALLOUT, M_WAITOK); - callout_cpu_init(cc, timeout_cpu); + cc_default_cpu = PCPU_GET(cpuid); + CPU_FOREACH(cpu) { + cc = CC_CPU(cpu); + callout_cpu_init(cc, cpu); + } } SYSINIT(callwheel_init, SI_SUB_CPU, SI_ORDER_ANY, callout_callwheel_init, NULL); @@ -323,11 +320,9 @@ SYSINIT(callwheel_init, SI_SUB_CPU, SI_ORDER_ANY, call static void callout_cpu_init(struct callout_cpu *cc, int cpu) { - struct callout *c; int i; mtx_init(&cc->cc_lock, "callout", NULL, MTX_SPIN | MTX_RECURSE); - SLIST_INIT(&cc->cc_callfree); cc->cc_inited = 1; cc->cc_callwheel = malloc_domainset(sizeof(struct callout_list) * callwheelsize, M_CALLOUT, @@ -342,14 +337,6 @@ callout_cpu_init(struct callout_cpu *cc, int cpu) snprintf(cc->cc_ktr_event_name, sizeof(cc->cc_ktr_event_name), "callwheel cpu %d", cpu); #endif - if (cc->cc_callout == NULL) /* Only BSP handles timeout(9) */ - return; - for (i = 0; i < ncallout; i++) { - c = &cc->cc_callout[i]; - callout_init(c, 0); - c->c_iflags = CALLOUT_LOCAL_ALLOC; - SLIST_INSERT_HEAD(&cc->cc_callfree, c, c_links.sle); - } } #ifdef SMP @@ -383,50 +370,35 @@ callout_cpu_switch(struct callout *c, struct callout_c #endif /* - * Start standard softclock thread. + * Start softclock threads. */ static void start_softclock(void *dummy) { struct callout_cpu *cc; char name[MAXCOMLEN]; -#ifdef SMP int cpu; + bool pin_swi; struct intr_event *ie; -#endif - cc = CC_CPU(timeout_cpu); - snprintf(name, sizeof(name), "clock (%d)", timeout_cpu); - if (swi_add(&clk_intr_event, name, softclock, cc, SWI_CLOCK, - INTR_MPSAFE, &cc->cc_cookie)) - panic("died while creating standard software ithreads"); - if (pin_default_swi && - (intr_event_bind(clk_intr_event, timeout_cpu) != 0)) { - printf("%s: timeout clock couldn't be pinned to cpu %d\n", - __func__, - timeout_cpu); - } - -#ifdef SMP CPU_FOREACH(cpu) { - if (cpu == timeout_cpu) - continue; cc = CC_CPU(cpu); - cc->cc_callout = NULL; /* Only BSP handles timeout(9). */ - callout_cpu_init(cc, cpu); snprintf(name, sizeof(name), "clock (%d)", cpu); ie = NULL; if (swi_add(&ie, name, softclock, cc, SWI_CLOCK, INTR_MPSAFE, &cc->cc_cookie)) panic("died while creating standard software ithreads"); - if (pin_pcpu_swi && (intr_event_bind(ie, cpu) != 0)) { - printf("%s: per-cpu clock couldn't be pinned to " - "cpu %d\n", + if (cpu == cc_default_cpu) + pin_swi = pin_default_swi; + else + pin_swi = pin_pcpu_swi; + if (pin_swi && (intr_event_bind(ie, cpu) != 0)) { + printf("%s: %s clock couldn't be pinned to cpu %d\n", __func__, + cpu == cc_default_cpu ? "default" : "per-cpu", cpu); } } -#endif } SYSINIT(start_softclock, SI_SUB_SOFTINTR, SI_ORDER_FIRST, start_softclock, NULL); @@ -639,16 +611,6 @@ callout_cc_add(struct callout *c, struct callout_cpu * } static void -callout_cc_del(struct callout *c, struct callout_cpu *cc) -{ - - if ((c->c_iflags & CALLOUT_LOCAL_ALLOC) == 0) - return; - c->c_func = NULL; - SLIST_INSERT_HEAD(&cc->cc_callfree, c, c_links.sle); -} - -static void softclock_call_cc(struct callout *c, struct callout_cpu *cc, #ifdef CALLOUT_PROFILING int *mpcalls, int *lockcalls, int *gcalls, @@ -692,10 +654,7 @@ softclock_call_cc(struct callout *c, struct callout_cp c_func = c->c_func; c_arg = c->c_arg; c_iflags = c->c_iflags; - if (c->c_iflags & CALLOUT_LOCAL_ALLOC) - c->c_iflags = CALLOUT_LOCAL_ALLOC; - else - c->c_iflags &= ~CALLOUT_PENDING; + c->c_iflags &= ~CALLOUT_PENDING; cc_exec_curr(cc, direct) = c; cc_exec_last_func(cc, direct) = c_func; @@ -795,8 +754,6 @@ skip: wakeup(&cc_exec_waiting(cc, direct)); CC_LOCK(cc); } else if (cc_cce_migrating(cc, direct)) { - KASSERT((c_iflags & CALLOUT_LOCAL_ALLOC) == 0, - ("Migrating legacy callout %p", c)); #ifdef SMP /* * If the callout was scheduled for @@ -819,7 +776,6 @@ skip: CTR3(KTR_CALLOUT, "deferred cancelled %p func %p arg %p", c, new_func, new_arg); - callout_cc_del(c, cc); return; } c->c_iflags &= ~CALLOUT_DFRMIGRATION; @@ -834,19 +790,6 @@ skip: panic("migration should not happen"); #endif } - /* - * If the current callout is locally allocated (from - * timeout(9)) then put it on the freelist. - * - * Note: we need to check the cached copy of c_iflags because - * if it was not local, then it's not safe to deref the - * callout pointer. - */ - KASSERT((c_iflags & CALLOUT_LOCAL_ALLOC) == 0 || - c->c_iflags == CALLOUT_LOCAL_ALLOC, - ("corrupted callout")); - if (c_iflags & CALLOUT_LOCAL_ALLOC) - callout_cc_del(c, cc); } /* @@ -896,70 +839,7 @@ softclock(void *arg) CC_UNLOCK(cc); } -/* - * timeout -- - * Execute a function after a specified length of time. - * - * untimeout -- - * Cancel previous timeout function call. - * - * callout_handle_init -- - * Initialize a handle so that using it with untimeout is benign. - * - * See AT&T BCI Driver Reference Manual for specification. This - * implementation differs from that one in that although an - * identification value is returned from timeout, the original - * arguments to timeout as well as the identifier are used to - * identify entries for untimeout. - */ -struct callout_handle -timeout(timeout_t *ftn, void *arg, int to_ticks) -{ - struct callout_cpu *cc; - struct callout *new; - struct callout_handle handle; - - cc = CC_CPU(timeout_cpu); - CC_LOCK(cc); - /* Fill in the next free callout structure. */ - new = SLIST_FIRST(&cc->cc_callfree); - if (new == NULL) - /* XXX Attempt to malloc first */ - panic("timeout table full"); - SLIST_REMOVE_HEAD(&cc->cc_callfree, c_links.sle); - callout_reset(new, to_ticks, ftn, arg); - handle.callout = new; - CC_UNLOCK(cc); - - return (handle); -} - void -untimeout(timeout_t *ftn, void *arg, struct callout_handle handle) -{ - struct callout_cpu *cc; - - /* - * Check for a handle that was initialized - * by callout_handle_init, but never used - * for a real timeout. - */ - if (handle.callout == NULL) - return; - - cc = callout_lock(handle.callout); - if (handle.callout->c_func == ftn && handle.callout->c_arg == arg) - callout_stop(handle.callout); - CC_UNLOCK(cc); -} - -void -callout_handle_init(struct callout_handle *handle) -{ - handle->callout = NULL; -} - -void callout_when(sbintime_t sbt, sbintime_t precision, int flags, sbintime_t *res, sbintime_t *prec_res) { @@ -1060,12 +940,9 @@ callout_reset_sbt_on(struct callout *c, sbintime_t sbt ("%s: direct callout %p has lock", __func__, c)); cc = callout_lock(c); /* - * Don't allow migration of pre-allocated callouts lest they - * become unbalanced or handle the case where the user does - * not care. + * Don't allow migration if the user does not care. */ - if ((c->c_iflags & CALLOUT_LOCAL_ALLOC) || - ignore_cpu) { + if (ignore_cpu) { cpu = c->c_cpu; } @@ -1435,7 +1312,6 @@ again: TAILQ_REMOVE(&cc->cc_expireq, c, c_links.tqe); } } - callout_cc_del(c, cc); CC_UNLOCK(cc); return (cancelled); } @@ -1451,7 +1327,7 @@ callout_init(struct callout *c, int mpsafe) c->c_lock = &Giant.lock_object; c->c_iflags = 0; } - c->c_cpu = timeout_cpu; + c->c_cpu = cc_default_cpu; } void @@ -1467,7 +1343,7 @@ _callout_init_lock(struct callout *c, struct lock_obje (LC_SPINLOCK | LC_SLEEPABLE)), ("%s: invalid lock class", __func__)); c->c_iflags = flags & (CALLOUT_RETURNUNLOCKED | CALLOUT_SHAREDLOCK); - c->c_cpu = timeout_cpu; + c->c_cpu = cc_default_cpu; } #ifdef APM_FIXUP_CALLTODO @@ -1559,9 +1435,7 @@ sysctl_kern_callout_stat(SYSCTL_HANDLER_ARGS) sbintime_t maxpr, maxt, medpr, medt, now, spr, st, t; int ct[64], cpr[64], ccpbk[32]; int error, val, i, count, tcum, pcum, maxc, c, medc; -#ifdef SMP int cpu; -#endif val = 0; error = sysctl_handle_int(oidp, &val, 0, req); @@ -1573,12 +1447,8 @@ sysctl_kern_callout_stat(SYSCTL_HANDLER_ARGS) bzero(ct, sizeof(ct)); bzero(cpr, sizeof(cpr)); now = sbinuptime(); -#ifdef SMP CPU_FOREACH(cpu) { cc = CC_CPU(cpu); -#else - cc = CC_CPU(timeout_cpu); -#endif CC_LOCK(cc); for (i = 0; i < callwheelsize; i++) { sc = &cc->cc_callwheel[i]; @@ -1603,9 +1473,7 @@ sysctl_kern_callout_stat(SYSCTL_HANDLER_ARGS) count += c; } CC_UNLOCK(cc); -#ifdef SMP } -#endif for (i = 0, tcum = 0; i < 64 && tcum < count / 2; i++) tcum += ct[i]; Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Fri Dec 13 20:45:45 2019 (r355731) +++ head/sys/netgraph/ng_base.c Fri Dec 13 21:03:12 2019 (r355732) @@ -3801,7 +3801,7 @@ ng_callout(struct callout *c, node_p node, hook_p hook return (0); } -/* A special modified version of untimeout() */ +/* A special modified version of callout_stop() */ int ng_uncallout(struct callout *c, node_p node) { Modified: head/sys/sys/interrupt.h ============================================================================== --- head/sys/sys/interrupt.h Fri Dec 13 20:45:45 2019 (r355731) +++ head/sys/sys/interrupt.h Fri Dec 13 21:03:12 2019 (r355732) @@ -151,7 +151,6 @@ struct intr_event { struct proc; extern struct intr_event *tty_intr_event; -extern struct intr_event *clk_intr_event; extern void *vm_ih; /* Counts and names for statistics (defined in MD code). */ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Dec 13 20:45:45 2019 (r355731) +++ head/sys/sys/param.h Fri Dec 13 21:03:12 2019 (r355732) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300066 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300067 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Dec 13 20:45:45 2019 (r355731) +++ head/sys/sys/systm.h Fri Dec 13 21:03:12 2019 (r355732) @@ -466,15 +466,6 @@ void usrinfoinit(void); void kern_reboot(int) __dead2; void shutdown_nice(int); -/* Timeouts */ -typedef void timeout_t(void *); /* timeout function type */ -#define CALLOUT_HANDLE_INITIALIZER(handle) \ - { NULL } - -void callout_handle_init(struct callout_handle *); -struct callout_handle timeout(timeout_t *, void *, int); -void untimeout(timeout_t *, void *, struct callout_handle); - /* Stubs for obsolete functions that used to be for interrupt management */ static __inline intrmask_t splbio(void) { return 0; } static __inline intrmask_t splcam(void) { return 0; } From owner-svn-src-all@freebsd.org Fri Dec 13 21:38:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 034C91D78BD; Fri, 13 Dec 2019 21:38:10 +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 47ZPD16L71z4Xj9; Fri, 13 Dec 2019 21:38:09 +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 CFCE31A75C; Fri, 13 Dec 2019 21:38:09 +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 xBDLc9HZ042280; Fri, 13 Dec 2019 21:38:09 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDLc8fU042276; Fri, 13 Dec 2019 21:38:08 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912132138.xBDLc8fU042276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 13 Dec 2019 21:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355733 - in head/sys/fs: nfsclient nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfsclient nfsserver X-SVN-Commit-Revision: 355733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 21:38:10 -0000 Author: rmacklem Date: Fri Dec 13 21:38:08 2019 New Revision: 355733 URL: https://svnweb.freebsd.org/changeset/base/355733 Log: Silence some "might not be initialized" warnings for riscv64. None of these case were actually using the variable(s) uninitialized, but I figured that silencing the warnings via initializing them made sense. Some of these predated r355677. Modified: head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdserv.c head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Fri Dec 13 21:03:12 2019 (r355732) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Fri Dec 13 21:38:08 2019 (r355733) @@ -5001,6 +5001,8 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de uint8_t stripeindex; sa_family_t af, safilled; + ssin.sin_port = 0; /* To shut up compiler. */ + ssin.sin_addr.s_addr = 0; /* ditto */ *ndip = NULL; ndi = NULL; gotdspp = NULL; @@ -5436,7 +5438,7 @@ nfsrpc_fillsa(struct nfsmount *nmp, struct sockaddr_in struct nfsclds *dsp, *tdsp; int error, firsttry; enum nfsclds_state retv; - uint32_t sequenceid; + uint32_t sequenceid = 0; KASSERT(nmp->nm_sockreq.nr_cred != NULL, ("nfsrpc_fillsa: NULL nr_cred")); Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Fri Dec 13 21:03:12 2019 (r355732) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Fri Dec 13 21:38:08 2019 (r355733) @@ -4670,7 +4670,7 @@ nfsrv_dsgetsockmnt(struct vnode *vp, int lktype, char char *devid, char *fnamep, struct vnode **nvpp, struct nfsmount **newnmpp, struct nfsmount *curnmp, int *ippos, int *dsdirp) { - struct vnode *dvp, *nvp, **tdvpp; + struct vnode *dvp, *nvp = NULL, **tdvpp; struct mount *mp; struct nfsmount *nmp, *newnmp; struct sockaddr *sad; Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Fri Dec 13 21:03:12 2019 (r355732) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Fri Dec 13 21:38:08 2019 (r355733) @@ -4594,7 +4594,7 @@ nfsrvd_layoutcommit(struct nfsrv_descript *nd, __unuse nfsv4stateid_t stateid; int error = 0, hasnewoff, hasnewmtime, layouttype, maxcnt, reclaim; int hasnewsize; - uint64_t offset, len, newoff, newsize; + uint64_t offset, len, newoff = 0, newsize; struct timespec newmtime; char *layp; struct thread *p = curthread; Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Fri Dec 13 21:03:12 2019 (r355732) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Fri Dec 13 21:38:08 2019 (r355733) @@ -4056,10 +4056,10 @@ nfsrv_getclientipaddr(struct nfsrv_descript *nd, struc int i, j, maxalen = 0, minalen = 0; sa_family_t af; #ifdef INET - struct sockaddr_in *rin, *sin; + struct sockaddr_in *rin = NULL, *sin; #endif #ifdef INET6 - struct sockaddr_in6 *rin6, *sin6; + struct sockaddr_in6 *rin6 = NULL, *sin6; #endif u_char *addr; int error = 0, cantparse = 0; @@ -7075,7 +7075,7 @@ nfsrv_recalloldlayout(NFSPROC_T *p) nfsquad_t clientid; nfsv4stateid_t stateid; fhandle_t fh; - int error, laytype, ret; + int error, laytype = 0, ret; lhyp = &nfslayouthash[arc4random() % nfsrv_layouthashsize]; NFSLOCKLAYOUT(lhyp); From owner-svn-src-all@freebsd.org Fri Dec 13 21:39:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D35021D7A0A; Fri, 13 Dec 2019 21:39:10 +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 47ZPFB5M1sz4XyD; Fri, 13 Dec 2019 21:39:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B24181A767; Fri, 13 Dec 2019 21:39:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDLdAgI042364; Fri, 13 Dec 2019 21:39:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDLdA5L042363; Fri, 13 Dec 2019 21:39:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912132139.xBDLdA5L042363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 13 Dec 2019 21:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355734 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 355734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 21:39:10 -0000 Author: imp Date: Fri Dec 13 21:39:10 2019 New Revision: 355734 URL: https://svnweb.freebsd.org/changeset/base/355734 Log: Don't use contractions. Fix the date. Contractions cause problems for translators, so s/aren't/are not/ in the one place this slipped through. While here, noticed I commited with the date I did the work, not today's date. Fix that too. Noticed by: bjk@ Modified: head/share/man/man9/bus_delayed_attach_children.9 Modified: head/share/man/man9/bus_delayed_attach_children.9 ============================================================================== --- head/share/man/man9/bus_delayed_attach_children.9 Fri Dec 13 21:38:08 2019 (r355733) +++ head/share/man/man9/bus_delayed_attach_children.9 Fri Dec 13 21:39:10 2019 (r355734) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 29, 2019 +.Dd December 13, 2019 .Dt BUS_DELAYED_ATTACH_CHILDREN 9 .Os .Sh NAME @@ -42,7 +42,7 @@ The function requests that the children of this device be attached when interrupts are running. If interrupts are currently running, this happens immediately. -If interrupts aren't yet running, this happens after interrupts are enabled, but +If interrupts are not yet running, this happens after interrupts are enabled, but before the system mounts root. .Sh RETURN VALUES A zero return value indicates success. From owner-svn-src-all@freebsd.org Fri Dec 13 21:39:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 527B41D7AAC; Fri, 13 Dec 2019 21:39:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47ZPFP0SZzz4Y6C; Fri, 13 Dec 2019 21:39:21 +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 068DB1A768; Fri, 13 Dec 2019 21:39:21 +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 xBDLdKIf042425; Fri, 13 Dec 2019 21:39:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDLdK99042422; Fri, 13 Dec 2019 21:39:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912132139.xBDLdK99042422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 13 Dec 2019 21:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355735 - in head/sys: arm/broadcom/bcm2835 arm/mv dev/ow X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 arm/mv dev/ow X-SVN-Commit-Revision: 355735 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 21:39:21 -0000 Author: imp Date: Fri Dec 13 21:39:20 2019 New Revision: 355735 URL: https://svnweb.freebsd.org/changeset/base/355735 Log: Be consistent about checking return value from bus_delayed_attach_children. Most places checked, but a couple last minute changes didn't. Make them all use the return value. Noticed by: rpokala@ Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c head/sys/arm/mv/a37x0_spi.c head/sys/dev/ow/owc_gpiobus.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Fri Dec 13 21:39:10 2019 (r355734) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Fri Dec 13 21:39:20 2019 (r355735) @@ -347,9 +347,7 @@ bcm_bsc_attach(device_t dev) } /* Probe and attach the iicbus when interrupts are available. */ - bus_delayed_attach_children(dev); - - return (0); + return (bus_delayed_attach_children(dev)); } static int Modified: head/sys/arm/mv/a37x0_spi.c ============================================================================== --- head/sys/arm/mv/a37x0_spi.c Fri Dec 13 21:39:10 2019 (r355734) +++ head/sys/arm/mv/a37x0_spi.c Fri Dec 13 21:39:20 2019 (r355735) @@ -220,9 +220,7 @@ a37x0_spi_attach(device_t dev) device_add_child(dev, "spibus", -1); /* Probe and attach the spibus when interrupts are available. */ - bus_delayed_attach_children(dev); - - return (0); + return (bus_delayed_attach_children(dev)); } static int Modified: head/sys/dev/ow/owc_gpiobus.c ============================================================================== --- head/sys/dev/ow/owc_gpiobus.c Fri Dec 13 21:39:10 2019 (r355734) +++ head/sys/dev/ow/owc_gpiobus.c Fri Dec 13 21:39:20 2019 (r355735) @@ -131,9 +131,7 @@ owc_gpiobus_attach(device_t dev) free(kids, M_TEMP); if (nkid == 0) device_add_child(dev, "ow", -1); - bus_delayed_attach_children(dev); - - return (0); + return (bus_delayed_attach_children(dev)); } static int From owner-svn-src-all@freebsd.org Fri Dec 13 21:41:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 595D31D801E; Fri, 13 Dec 2019 21:41:27 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47ZPHq1TBsz4YbT; Fri, 13 Dec 2019 21:41:27 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [172.17.133.228] (unknown [12.202.168.51]) (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 822E22475; Fri, 13 Dec 2019 21:41:26 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.20.0.191208 Date: Fri, 13 Dec 2019 13:41:21 -0800 Subject: Re: svn commit: r355735 - in head/sys: arm/broadcom/bcm2835 arm/mv dev/ow From: Ravi Pokala To: Warner Losh , , , Message-ID: Thread-Topic: svn commit: r355735 - in head/sys: arm/broadcom/bcm2835 arm/mv dev/ow References: <201912132139.xBDLdK99042422@repo.freebsd.org> In-Reply-To: <201912132139.xBDLdK99042422@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 21:41:27 -0000 Thanks! -Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Warner Losh Date: 2019-12-13, Friday at 13:39 To: , , Subject: svn commit: r355735 - in head/sys: arm/broadcom/bcm2835 arm/mv dev= /ow Author: imp Date: Fri Dec 13 21:39:20 2019 New Revision: 355735 URL: https://svnweb.freebsd.org/changeset/base/355735 =20 Log: Be consistent about checking return value from bus_delayed_attach_chi= ldren. =20 Most places checked, but a couple last minute changes didn't. Make th= em all use the return value. =20 Noticed by: rpokala@ =20 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c head/sys/arm/mv/a37x0_spi.c head/sys/dev/ow/owc_gpiobus.c =20 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Fri Dec 13 21:39:10 201= 9 (r355734) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Fri Dec 13 21:39:20 201= 9 (r355735) @@ -347,9 +347,7 @@ bcm_bsc_attach(device_t dev) } =20 /* Probe and attach the iicbus when interrupts are available. */ - bus_delayed_attach_children(dev); - - return (0); + return (bus_delayed_attach_children(dev)); } =20 static int =20 Modified: head/sys/arm/mv/a37x0_spi.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/arm/mv/a37x0_spi.c Fri Dec 13 21:39:10 2019 (r355734) +++ head/sys/arm/mv/a37x0_spi.c Fri Dec 13 21:39:20 2019 (r355735) @@ -220,9 +220,7 @@ a37x0_spi_attach(device_t dev) device_add_child(dev, "spibus", -1); =20 /* Probe and attach the spibus when interrupts are available. */ - bus_delayed_attach_children(dev); - - return (0); + return (bus_delayed_attach_children(dev)); } =20 static int =20 Modified: head/sys/dev/ow/owc_gpiobus.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/dev/ow/owc_gpiobus.c Fri Dec 13 21:39:10 2019 (r355734) +++ head/sys/dev/ow/owc_gpiobus.c Fri Dec 13 21:39:20 2019 (r355735) @@ -131,9 +131,7 @@ owc_gpiobus_attach(device_t dev) free(kids, M_TEMP); if (nkid =3D=3D 0) device_add_child(dev, "ow", -1); - bus_delayed_attach_children(dev); - - return (0); + return (bus_delayed_attach_children(dev)); } =20 static int =20 From owner-svn-src-all@freebsd.org Fri Dec 13 22:04:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47F231D8852; Fri, 13 Dec 2019 22:04:14 +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 47ZPp60fRsz4Zdf; Fri, 13 Dec 2019 22:04:14 +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 11A6A1ACD9; Fri, 13 Dec 2019 22:04:14 +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 xBDM4DIC059813; Fri, 13 Dec 2019 22:04:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDM4DJj059812; Fri, 13 Dec 2019 22:04:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201912132204.xBDM4DJj059812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 13 Dec 2019 22:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355736 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 355736 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 22:04:14 -0000 Author: avg Date: Fri Dec 13 22:04:13 2019 New Revision: 355736 URL: https://svnweb.freebsd.org/changeset/base/355736 Log: zfs boot: fix a crash in a rarely taken path in fzap_lookup Instead of passing NULL to fzap_name_equal and crashing, just return ENOENT. This happened when higher bits of a hash of the searched key (its hash prefix) matched a hash prefix of some key in the ZAP, but the full hash value of the searched key did not match any key in the ZAP. I observerved this problem when loader tried to look up "features_for_read" in a particular old pool that predates pool features. MFC after: 2 weeks Sponsored by: Panzura Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Fri Dec 13 21:39:20 2019 (r355735) +++ head/stand/libsa/zfs/zfsimpl.c Fri Dec 13 22:04:13 2019 (r355736) @@ -2282,10 +2282,8 @@ fzap_lookup(const spa_t *spa, const dnode_phys_t *dnod return (ENOENT); zc = &ZAP_LEAF_CHUNK(&zl, h); while (zc->l_entry.le_hash != hash) { - if (zc->l_entry.le_next == 0xffff) { - zc = NULL; - break; - } + if (zc->l_entry.le_next == 0xffff) + return (ENOENT); zc = &ZAP_LEAF_CHUNK(&zl, zc->l_entry.le_next); } if (fzap_name_equal(&zl, zc, name)) { From owner-svn-src-all@freebsd.org Fri Dec 13 22:32:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2042A1D8DC4; Fri, 13 Dec 2019 22:32:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47ZQQG05PQz4bhw; Fri, 13 Dec 2019 22:32:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F29911B1F5; Fri, 13 Dec 2019 22:32:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDMW5ZY074331; Fri, 13 Dec 2019 22:32:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDMW5LL074330; Fri, 13 Dec 2019 22:32:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912132232.xBDMW5LL074330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 13 Dec 2019 22:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355737 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 355737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 22:32:06 -0000 Author: imp Date: Fri Dec 13 22:32:05 2019 New Revision: 355737 URL: https://svnweb.freebsd.org/changeset/base/355737 Log: Better copyright advice Document the common practices around copyrights with "all rights reserved" in them as new copyright notices get added. It's an open question qhether to point people at the fact that since the Berne convention was ratified, All rights reserved is largely obsolete. https://en.wikipedia.org/wiki/All_rights_reserved#Obsolescence has the details. The committer's guide will be revised shortly, and it's likely that's a better place for this discussion. If not, I'll add a blurb here. Reviewed by: jhb@, brooks@ Differential Review: https://reviews.freebsd.org/D22800 Modified: head/share/man/man9/style.9 Modified: head/share/man/man9/style.9 ============================================================================== --- head/share/man/man9/style.9 Fri Dec 13 22:04:13 2019 (r355736) +++ head/share/man/man9/style.9 Fri Dec 13 22:32:05 2019 (r355737) @@ -1,6 +1,5 @@ .\"- -.\" Copyright (c) 1995-2005 The FreeBSD Project -.\" All rights reserved. +.\" Copyright (c) 1995-2019 The FreeBSD Project .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -26,7 +25,7 @@ .\" From: @(#)style 1.14 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd June 3, 2019 +.Dd December 13, 2019 .Dt STYLE 9 .Os .Sh NAME @@ -84,8 +83,32 @@ comments. Comments starting in columns other than the first are never considered license statements. Use the appropriate SPDX-License-Identifier line before the copyright. +If the copyright assertion contains the phrase +.Dq Li "All Rights Reserved" +that should be on the same line as the word +.Dq Li "Copyright" . +You should not insert a new copyright line between an old +copyright line and this phrase. +Instead, you should insert a new copyright phrase after +a pre-existing +.Dq Li "All Rights Reserved" +line. +When making changes, it is acceptable to fold an +.Dq Li "All Rights Reserved" +line with each of the +.Dq Li "Copyright" +lines. +For files that have the +.Dq Li "All Rights Reserved" +line on the same line(s) as the word +.Dq Li "Copyright" , +new copyright assertions should be added last. +New +.Dq Li "Copyright" +lines should only be added when making substantial changes to the file, +not for trivial changes. .Pp -After any copyright header, there is a blank line, and the +After any copyright and license comment, there is a blank line, and the .Li $\&FreeBSD$ for non C/C++ language source files. Version control system ID tags should only exist once in a file From owner-svn-src-all@freebsd.org Fri Dec 13 23:22:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EEA811D9C44; Fri, 13 Dec 2019 23:22:49 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47ZRXn5xg6z4dvj; Fri, 13 Dec 2019 23:22:49 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C740C1BB6E; Fri, 13 Dec 2019 23:22:49 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDNMnAp006997; Fri, 13 Dec 2019 23:22:49 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDNMnO2006996; Fri, 13 Dec 2019 23:22:49 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912132322.xBDNMnO2006996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 13 Dec 2019 23:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355738 - head/sys/modules/i2c/ads111x X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/modules/i2c/ads111x X-SVN-Commit-Revision: 355738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 23:22:50 -0000 Author: ian Date: Fri Dec 13 23:22:49 2019 New Revision: 355738 URL: https://svnweb.freebsd.org/changeset/base/355738 Log: Include ofw_bus_if.h in SRCS only on systems configured with the FDT option. Modified: head/sys/modules/i2c/ads111x/Makefile Modified: head/sys/modules/i2c/ads111x/Makefile ============================================================================== --- head/sys/modules/i2c/ads111x/Makefile Fri Dec 13 22:32:05 2019 (r355737) +++ head/sys/modules/i2c/ads111x/Makefile Fri Dec 13 23:22:49 2019 (r355738) @@ -9,7 +9,10 @@ SRCS+= \ bus_if.h \ device_if.h \ iicbus_if.h \ - ofw_bus_if.h \ opt_platform.h \ + +.if !empty(OPT_FDT) +SRCS+= ofw_bus_if.h +.endif .include From owner-svn-src-all@freebsd.org Fri Dec 13 23:28:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57B3C1D9E4E; Fri, 13 Dec 2019 23:28:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47ZRgv2Lz2z4fCk; Fri, 13 Dec 2019 23:28:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E1421BB7E; Fri, 13 Dec 2019 23:28:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDNSxQi007334; Fri, 13 Dec 2019 23:28:59 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDNSruB007305; Fri, 13 Dec 2019 23:28:53 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201912132328.xBDNSruB007305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 13 Dec 2019 23:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355739 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/dispatcher components/executer components/hardware include include/platform X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/sys/contrib/dev/acpica: . common compiler components/debugger components/dispatcher components/executer components/hardware include include/platform X-SVN-Commit-Revision: 355739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 23:28:59 -0000 Author: jkim Date: Fri Dec 13 23:28:52 2019 New Revision: 355739 URL: https://svnweb.freebsd.org/changeset/base/355739 Log: MFV: r355716 Merge ACPICA 20191213. Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/dmtables.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslmethod.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/asltransform.c head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dttable2.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dswload.c head/sys/contrib/dev/acpica/components/executer/exfield.c head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/platform/acenv.h Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/changes.txt Fri Dec 13 23:28:52 2019 (r355739) @@ -1,4 +1,25 @@ ---------------------------------------- +13 December 2019. Summary of changes for version 20191213: + + +1) ACPICA kernel-resident subsystem: + +Return a Buffer object for all fields created via the CreateField operator. Previously, an Integer would be returned if the size of the field was less than or equal to the current size of an Integer. Although this goes against the ACPI specification, it provides compatibility with other ACPI implementations. Also updated the ASLTS test suite to reflect this new behavior. + +2) iASL Compiler/Disassembler and ACPICA tools: + +iASL: Implemented detection of (and throw an error for) duplicate values for Case statements within a single Switch statement. Duplicate Integers, Strings, and Buffers are supported. + +iASL: Fix error logging issue during multiple file compilation -- Switch to the correct input file during error node creation. + +iASL: For duplicate named object creation, now emit an error instead of a warning - since this will cause a runtime error. + +AcpiSrc: Add unix line-ending support for non-Windows builds. + +iASL: Add an error condition for an attempt to create a NameString with > 255 NameSegs (the max allowable via the AML definition). + + +---------------------------------------- 18 October 2019. Summary of changes for version 20191018: Modified: head/sys/contrib/dev/acpica/common/dmtables.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtables.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/common/dmtables.c Fri Dec 13 23:28:52 2019 (r355739) @@ -508,6 +508,8 @@ AdParseTable ( AmlStart = ((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER)); ASL_CV_INIT_FILETREE(Table, AmlStart, AmlLength); + AcpiUtSetIntegerWidth (Table->Revision); + /* Create the root object */ AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp (AmlStart); @@ -543,7 +545,6 @@ AdParseTable ( } WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE; - WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE; Status = AcpiPsParseAml (WalkState); if (ACPI_FAILURE (Status)) Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Fri Dec 13 23:28:52 2019 (r355739) @@ -220,6 +220,7 @@ CmDoCompile ( PrDoPreprocess (); AslGbl_CurrentLineNumber = 1; AslGbl_LogicalLineNumber = 1; + AslGbl_CurrentLineOffset = 0; if (AslGbl_PreprocessOnly) { @@ -282,25 +283,6 @@ CmDoCompile ( LsDumpParseTree (); - OpcGetIntegerWidth (AslGbl_ParseTreeRoot->Asl.Child); - UtEndEvent (Event); - - /* Pre-process parse tree for any operator transforms */ - - Event = UtBeginEvent ("Parse tree transforms"); - DbgPrint (ASL_DEBUG_OUTPUT, "\nParse tree transforms\n\n"); - TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, - TrAmlTransformWalkBegin, TrAmlTransformWalkEnd, NULL); - UtEndEvent (Event); - - /* Generate AML opcodes corresponding to the parse tokens */ - - Event = UtBeginEvent ("Generate AML opcodes"); - DbgPrint (ASL_DEBUG_OUTPUT, "Generating AML opcodes\n\n"); - TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL, - OpcAmlOpcodeWalk, NULL); - UtEndEvent (Event); - UtEndEvent (FullCompile); return (AE_OK); @@ -329,6 +311,25 @@ CmDoAslMiddleAndBackEnd ( { UINT8 Event; ACPI_STATUS Status; + + + OpcGetIntegerWidth (AslGbl_ParseTreeRoot->Asl.Child); + + /* Pre-process parse tree for any operator transforms */ + + Event = UtBeginEvent ("Parse tree transforms"); + DbgPrint (ASL_DEBUG_OUTPUT, "\nParse tree transforms\n\n"); + TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, + TrAmlTransformWalkBegin, TrAmlTransformWalkEnd, NULL); + UtEndEvent (Event); + + /* Generate AML opcodes corresponding to the parse tokens */ + + Event = UtBeginEvent ("Generate AML opcodes"); + DbgPrint (ASL_DEBUG_OUTPUT, "Generating AML opcodes\n\n"); + TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, + NULL, OpcAmlOpcodeWalk, NULL); + UtEndEvent (Event); /* Interpret and generate all compile-time constants */ Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asldefine.h Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/asldefine.h Fri Dec 13 23:28:52 2019 (r355739) @@ -222,11 +222,11 @@ /* Misc */ -#define ASL_EXTERNAL_METHOD 255 -#define ASL_ABORT TRUE -#define ASL_NO_ABORT FALSE -#define ASL_EOF ACPI_UINT32_MAX -#define ASL_IGNORE_LINE (ACPI_UINT32_MAX -1) +#define ASL_EXTERNAL_METHOD_UNKNOWN_PARAMS 255 +#define ASL_ABORT TRUE +#define ASL_NO_ABORT FALSE +#define ASL_EOF ACPI_UINT32_MAX +#define ASL_IGNORE_LINE (ACPI_UINT32_MAX -1) /* Listings */ Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Fri Dec 13 23:28:52 2019 (r355739) @@ -335,7 +335,7 @@ AeAddToErrorLog ( * PARAMETERS: OutputFile - Output file * Enode - Error node to print * PrematureEOF - True = PrematureEOF has been reached - * Total - Total legth of line + * Total - Total length of line * * RETURN: None * @@ -445,7 +445,7 @@ AeDecodeErrorMessageId ( * PARAMETERS: OutputFile - Output file * Enode - Error node to print * PrematureEOF - True = PrematureEOF has been reached - * Total - amount of characters printed so far + * Total - Number of characters printed so far * * * RETURN: Status @@ -527,6 +527,7 @@ AePrintErrorSourceLine ( fprintf (OutputFile, "\n"); return AE_OK; } + /* * Seek to the offset in the combined source file, * read the source line, and write it to the output. @@ -550,8 +551,9 @@ AePrintErrorSourceLine ( AslGbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); return AE_IO_ERROR; } - /* Read/write the source line, up to the maximum line length */ + /* Read/write the source line, up to the maximum line length */ + while (RActual && SourceByte && (SourceByte != '\n')) { if (*Total < 256) @@ -732,7 +734,7 @@ AePrintException ( * * RETURN: None * - * DESCRIPTION: Print the contents of an error nodes. This function is tailored + * DESCRIPTION: Print the contents of an error node. This function is tailored * to print error nodes that are SubErrors within ASL_ERROR_MSG * ******************************************************************************/ @@ -795,8 +797,8 @@ AePrintErrorLog ( * LogicalLineNumber - Cumulative line number * LogicalByteOffset - Byte offset in source file * Column - Column in current line - * Filename - source filename - * ExtraMessage - additional error message + * Filename - Source filename + * ExtraMessage - Additional error message * SourceLine - Line of error source code * SubError - SubError of this InputEnode * @@ -863,10 +865,17 @@ static void AslInitEnode ( Enode->FilenameLength = 6; } - FileNode = FlGetCurrentFileNode (); + /* + * Attempt to get the file node of the filename listed in the parse + * node. If the name doesn't exist in the global file node, it is + * because the file is included by #include or ASL include. In this + * case, get the current file node. The source output of the current + * file will contain the contents of the file listed in the parse node. + */ + FileNode = FlGetFileNode (ASL_FILE_INPUT, Filename); if (!FileNode) { - return; + FileNode = FlGetCurrentFileNode (); } Enode->SourceFilename = @@ -884,8 +893,8 @@ static void AslInitEnode ( * LineNumber - Actual file line number * Column - Column in current line * SourceLine - Actual source code line - * Filename - source filename - * ExtraMessage - additional error message + * Filename - Source filename + * ExtraMessage - Additional error message * * RETURN: None * @@ -918,8 +927,8 @@ AslCommonError2 ( * LogicalLineNumber - Cumulative line number * LogicalByteOffset - Byte offset in source file * Column - Column in current line - * Filename - source filename - * ExtraMessage - additional error message + * Filename - Source filename + * ExtraMessage - Additional error message * * RETURN: None * @@ -961,8 +970,8 @@ AslCommonError ( * LogicalLineNumber - Cumulative line number * LogicalByteOffset - Byte offset in source file * Column - Column in current line - * Filename - source filename - * Message - additional error message + * Filename - Source filename + * Message - Additional error message * SourceLine - Actual line of source code * SubError - Sub-error associated with this error * @@ -1025,7 +1034,7 @@ AslLogNewError ( * PARAMETERS: Level - Seriousness (Warning/error, etc.) * MessageId - Index into global message buffer * - * RETURN: UINT8 - modified level + * RETURN: UINT8 - Modified level * * DESCRIPTION: Get the modified level of exception codes that are reported as * errors from the -ww option. @@ -1369,7 +1378,7 @@ AslIsExceptionDisabled ( * MainMsg - Message pertaining to the MainOp * SubMsgId - Index into global message buffer * SubOp - Additional parse node for better message - * SubMsg - Message pertainint to SubOp + * SubMsg - Message pertaining to SubOp * * * RETURN: None @@ -1421,7 +1430,7 @@ AslDualParseOpError ( * PARAMETERS: Level - Seriousness (Warning/error, etc.) * MessageId - Index into global message buffer * Op - Parse node where error happened - * ExtraMessage - additional error message + * ExtraMessage - Additional error message * * RETURN: None * @@ -1459,7 +1468,7 @@ AslError ( * * PARAMETERS: Op - Parse node where error happened * Status - The ACPICA Exception - * ExtraMessage - additional error message + * ExtraMessage - Additional error message * Abort - TRUE -> Abort compilation * * RETURN: None Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Fri Dec 13 23:28:52 2019 (r355739) @@ -207,12 +207,6 @@ FlInitOneFile ( NewFileNode = ACPI_CAST_PTR (ASL_GLOBAL_FILE_NODE, UtLocalCacheCalloc (sizeof (ASL_GLOBAL_FILE_NODE))); - if (!NewFileNode) - { - AslError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION, NULL, NULL); - return (AE_NO_MEMORY); - } - NewFileNode->ParserErrorDetected = FALSE; NewFileNode->Next = AslGbl_FilesList; @@ -420,8 +414,22 @@ ASL_GLOBAL_FILE_NODE * FlGetCurrentFileNode ( void) { - return (FlGetFileNode ( - ASL_FILE_INPUT,AslGbl_Files[ASL_FILE_INPUT].Filename)); + ASL_GLOBAL_FILE_NODE *FileNode = + FlGetFileNode (ASL_FILE_INPUT,AslGbl_Files[ASL_FILE_INPUT].Filename); + + + if (!FileNode) + { + /* + * If the current file node does not exist after initializing the file + * node structures, something went wrong and this is an unrecoverable + * condition. + */ + FlFileError (ASL_FILE_INPUT, ASL_MSG_COMPILER_INTERNAL); + AslAbort (); + } + + return (FileNode); } Modified: head/sys/contrib/dev/acpica/compiler/aslload.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslload.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/aslload.c Fri Dec 13 23:28:52 2019 (r355739) @@ -357,7 +357,7 @@ LdLoadFieldElements ( * The name already exists in this scope * But continue processing the elements */ - AslDualParseOpError (ASL_WARNING, ASL_MSG_NAME_EXISTS, Child, + AslDualParseOpError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Child, Child->Asl.Value.String, ASL_MSG_FOUND_HERE, Node->Op, Node->Op->Asl.ExternalName); } @@ -986,12 +986,19 @@ FinishNode: Op->Asl.Node = Node; Node->Op = Op; - /* Set the actual data type if appropriate (EXTERNAL term only) */ - + /* + * Set the actual data type if appropriate (EXTERNAL term only) + * As of 11/19/2019, ASL External() does not support parameter + * counts. When an External method is loaded, the parameter count is + * unknown setting Node->Value to ASL_EXTERNAL_METHOD_UNKNOWN_PARAMS + * indicates that the parameter count for this method is unknown. + * This information is used in ASL cross reference to help determine the + * parameter count through method calls. + */ if (ActualObjectType != ACPI_TYPE_ANY) { Node->Type = (UINT8) ActualObjectType; - Node->Value = ASL_EXTERNAL_METHOD; + Node->Value = ASL_EXTERNAL_METHOD_UNKNOWN_PARAMS; } if (Op->Asl.ParseOpcode == PARSEOP_METHOD) Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.c Fri Dec 13 23:28:52 2019 (r355739) @@ -368,7 +368,9 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_BUFFER_FIELD_OVERFLOW */ "Buffer field extends beyond end of target buffer", /* ASL_MSG_INVALID_SPECIAL_NAME */ "declaration of this named object outside root scope is illegal", /* ASL_MSG_INVALID_PROCESSOR_UID */ "_UID inside processor declaration must be an integer", -/* ASL_MSG_LEGACY_PROCESSOR_OP */ "Legacy Processor() keyword detected. Use Device() keyword instead." +/* ASL_MSG_LEGACY_PROCESSOR_OP */ "Legacy Processor() keyword detected. Use Device() keyword instead.", +/* ASL_MSG_NAMESTRING_LENGTH */ "NameString contains too many NameSegs (>255)", +/* ASL_MSG_CASE_FOUND_HERE */ "Original Case value below:" }; /* Table compiler */ Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Fri Dec 13 23:28:52 2019 (r355739) @@ -371,6 +371,8 @@ typedef enum ASL_MSG_INVALID_SPECIAL_NAME, ASL_MSG_INVALID_PROCESSOR_UID, ASL_MSG_LEGACY_PROCESSOR_OP, + ASL_MSG_NAMESTRING_LENGTH, + ASL_MSG_CASE_FOUND_HERE, /* These messages are used by the Data Table compiler only */ Modified: head/sys/contrib/dev/acpica/compiler/aslmethod.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmethod.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/aslmethod.c Fri Dec 13 23:28:52 2019 (r355739) @@ -586,7 +586,7 @@ MtMethodAnalysisWalkBegin ( /* Special typechecking for _HID */ - if (!strcmp (METHOD_NAME__HID, Op->Asl.NameSeg)) + if (ACPI_COMPARE_NAMESEG (METHOD_NAME__HID, Op->Asl.NameSeg)) { Next = Op->Asl.Child->Asl.Next; AnCheckId (Next, ASL_TYPE_HID); @@ -594,7 +594,7 @@ MtMethodAnalysisWalkBegin ( /* Special typechecking for _CID */ - else if (!strcmp (METHOD_NAME__CID, Op->Asl.NameSeg)) + else if (ACPI_COMPARE_NAMESEG (METHOD_NAME__CID, Op->Asl.NameSeg)) { Next = Op->Asl.Child->Asl.Next; Modified: head/sys/contrib/dev/acpica/compiler/asloptions.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloptions.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/asloptions.c Fri Dec 13 23:28:52 2019 (r355739) @@ -219,7 +219,7 @@ AslCommandLine ( { exit (-1); } - exit (1); + exit (0); } /* Next parameter must be the input filename */ Modified: head/sys/contrib/dev/acpica/compiler/aslstartup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslstartup.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/aslstartup.c Fri Dec 13 23:28:52 2019 (r355739) @@ -457,10 +457,6 @@ AslDoOneFile ( } FileNode = FlGetCurrentFileNode(); - if (!FileNode) - { - return (AE_ERROR); - } FileNode->OriginalInputFileSize = FlGetFileSize (ASL_FILE_INPUT); Modified: head/sys/contrib/dev/acpica/compiler/asltransform.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asltransform.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/asltransform.c Fri Dec 13 23:28:52 2019 (r355739) @@ -151,6 +151,7 @@ #include #include "aslcompiler.y.h" +#include #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("asltransform") @@ -194,7 +195,17 @@ static void TrDoSwitch ( ACPI_PARSE_OBJECT *StartNode); +static void +TrCheckForDuplicateCase ( + ACPI_PARSE_OBJECT *CaseOp, + ACPI_PARSE_OBJECT *Predicate1); +static BOOLEAN +TrCheckForBufferMatch ( + ACPI_PARSE_OBJECT *Next1, + ACPI_PARSE_OBJECT *Next2); + + /******************************************************************************* * * FUNCTION: TrAmlGetNextTempName @@ -431,6 +442,7 @@ TrTransformSubtree ( ACPI_PARSE_OBJECT *Op) { ACPI_PARSE_OBJECT *MethodOp; + ACPI_NAMESTRING_INFO Info; if (Op->Asl.AmlOpcode == AML_RAW_DATA_BYTE) @@ -492,6 +504,22 @@ TrTransformSubtree ( Op->Asl.Value.String = "\\"; break; + case PARSEOP_NAMESTRING: + /* + * A NameString can be up to 255 (0xFF) individual NameSegs maximum + * (with 254 dot separators) - as per the ACPI specification. Note: + * Cannot check for NumSegments == 0 because things like + * Scope(\) are legal and OK. + */ + Info.ExternalName = Op->Asl.Value.String; + AcpiNsGetInternalNameLength (&Info); + + if (Info.NumSegments > 255) + { + AslError (ASL_ERROR, ASL_MSG_NAMESTRING_LENGTH, Op, NULL); + } + break; + case PARSEOP_UNLOAD: AslError (ASL_WARNING, ASL_MSG_UNLOAD, Op, NULL); @@ -510,7 +538,6 @@ TrTransformSubtree ( case PARSEOP_PROCESSOR: AslError (ASL_WARNING, ASL_MSG_LEGACY_PROCESSOR_OP, Op, Op->Asl.ExternalName); - break; default: @@ -646,6 +673,8 @@ TrDoSwitch ( if (Next->Asl.ParseOpcode == PARSEOP_CASE) { + TrCheckForDuplicateCase (Next, Next->Asl.Child); + if (CaseOp) { /* Add an ELSE to complete the previous CASE */ @@ -976,4 +1005,177 @@ TrDoSwitch ( TrAmlInitLineNumbers (BreakOp, NewOp); BreakOp->Asl.Parent = StartNode; TrAmlInsertPeer (Conditional, BreakOp); +} + + +/******************************************************************************* + * + * FUNCTION: TrCheckForDuplicateCase + * + * PARAMETERS: CaseOp - Parse node for first Case statement in list + * Predicate1 - Case value for the input CaseOp + * + * RETURN: None + * + * DESCRIPTION: Check for duplicate case values. Currently, only handles + * Integers, Strings and Buffers. No support for Package objects. + * + ******************************************************************************/ + +static void +TrCheckForDuplicateCase ( + ACPI_PARSE_OBJECT *CaseOp, + ACPI_PARSE_OBJECT *Predicate1) +{ + ACPI_PARSE_OBJECT *Next; + ACPI_PARSE_OBJECT *Predicate2; + + + /* Walk the list of CASE opcodes */ + + Next = CaseOp->Asl.Next; + while (Next) + { + if (Next->Asl.ParseOpcode == PARSEOP_CASE) + { + /* Emit error only once */ + + if (Next->Asl.CompileFlags & OP_IS_DUPLICATE) + { + goto NextCase; + } + + /* Check for a duplicate plain integer */ + + Predicate2 = Next->Asl.Child; + if ((Predicate1->Asl.ParseOpcode == PARSEOP_INTEGER) && + (Predicate2->Asl.ParseOpcode == PARSEOP_INTEGER)) + { + if (Predicate1->Asl.Value.Integer == Predicate2->Asl.Value.Integer) + { + goto FoundDuplicate; + } + } + + /* Check for pairs of the constants ZERO, ONE, ONES */ + + else if (((Predicate1->Asl.ParseOpcode == PARSEOP_ZERO) && + (Predicate2->Asl.ParseOpcode == PARSEOP_ZERO)) || + ((Predicate1->Asl.ParseOpcode == PARSEOP_ONE) && + (Predicate2->Asl.ParseOpcode == PARSEOP_ONE)) || + ((Predicate1->Asl.ParseOpcode == PARSEOP_ONES) && + (Predicate2->Asl.ParseOpcode == PARSEOP_ONES))) + { + goto FoundDuplicate; + } + + /* Check for a duplicate string constant (literal) */ + + else if ((Predicate1->Asl.ParseOpcode == PARSEOP_STRING_LITERAL) && + (Predicate2->Asl.ParseOpcode == PARSEOP_STRING_LITERAL)) + { + if (!strcmp (Predicate1->Asl.Value.String, + Predicate2->Asl.Value.String)) + { + goto FoundDuplicate; + } + } + + /* Check for a duplicate buffer constant */ + + else if ((Predicate1->Asl.ParseOpcode == PARSEOP_BUFFER) && + (Predicate2->Asl.ParseOpcode == PARSEOP_BUFFER)) + { + if (TrCheckForBufferMatch (Predicate1->Asl.Child, + Predicate2->Asl.Child)) + { + goto FoundDuplicate; + } + } + } + goto NextCase; + +FoundDuplicate: + /* Emit error message only once */ + + Next->Asl.CompileFlags |= OP_IS_DUPLICATE; + + AslDualParseOpError (ASL_ERROR, ASL_MSG_DUPLICATE_CASE, Next, + Next->Asl.Value.String, ASL_MSG_CASE_FOUND_HERE, CaseOp, + CaseOp->Asl.ExternalName); + +NextCase: + Next = Next->Asl.Next; + } +} + + +/******************************************************************************* + * + * FUNCTION: TrCheckForBufferMatch + * + * PARAMETERS: Next1 - Parse node for first opcode in first buffer list + * (The DEFAULT_ARG or INTEGER node) + * Next2 - Parse node for first opcode in second buffer list + * (The DEFAULT_ARG or INTEGER node) + * + * RETURN: TRUE if buffers match, FALSE otherwise + * + * DESCRIPTION: Check for duplicate Buffer case values. + * + ******************************************************************************/ + +static BOOLEAN +TrCheckForBufferMatch ( + ACPI_PARSE_OBJECT *NextOp1, + ACPI_PARSE_OBJECT *NextOp2) +{ + + if (NextOp1->Asl.Value.Integer != NextOp2->Asl.Value.Integer) + { + return (FALSE); + } + + /* Start at the BYTECONST initializer node list */ + + NextOp1 = NextOp1->Asl.Next; + NextOp2 = NextOp2->Asl.Next; + + /* + * Walk both lists until either a mismatch is found, or one or more + * end-of-lists are found + */ + while (NextOp1 && NextOp2) + { + if ((NextOp1->Asl.ParseOpcode == PARSEOP_STRING_LITERAL) && + (NextOp2->Asl.ParseOpcode == PARSEOP_STRING_LITERAL)) + { + if (!strcmp (NextOp1->Asl.Value.String, NextOp2->Asl.Value.String)) + { + return (TRUE); + } + else + { + return (FALSE); + } + } + if ((UINT8) NextOp1->Asl.Value.Integer != (UINT8) NextOp2->Asl.Value.Integer) + { + return (FALSE); + } + + NextOp1 = NextOp1->Asl.Next; + NextOp2 = NextOp2->Asl.Next; + } + + /* Not a match if one of the lists is not at end-of-list */ + + if (NextOp1 || NextOp2) + { + return (FALSE); + } + + /* Otherwise, the buffers match */ + + return (TRUE); } Modified: head/sys/contrib/dev/acpica/compiler/aslutils.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslutils.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/aslutils.c Fri Dec 13 23:28:52 2019 (r355739) @@ -567,11 +567,6 @@ UtDisplayOneSummary ( /* Summary of main input and output files */ FileNode = FlGetCurrentFileNode (); - if (!FileNode) - { - fprintf (stderr, "Summary could not be generated"); - return; - } if (FileNode->ParserErrorDetected) { Modified: head/sys/contrib/dev/acpica/compiler/aslxref.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslxref.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/aslxref.c Fri Dec 13 23:28:52 2019 (r355739) @@ -1055,7 +1055,7 @@ XfNamespaceLocateBegin ( NextOp = NextOp->Asl.Next; } - if (Node->Value != ASL_EXTERNAL_METHOD && + if (Node->Value != ASL_EXTERNAL_METHOD_UNKNOWN_PARAMS && Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_EXTERNAL) { /* @@ -1064,8 +1064,17 @@ XfNamespaceLocateBegin ( */ if (PassedArgs != Node->Value) { - sprintf (AslGbl_MsgBuffer, "%s requires %u", Op->Asl.ExternalName, - Node->Value); + if (Node->Flags & ANOBJ_IS_EXTERNAL) + { + sprintf (AslGbl_MsgBuffer, + "according to previous use, %s requires %u", + Op->Asl.ExternalName, Node->Value); + } + else + { + sprintf (AslGbl_MsgBuffer, "%s requires %u", Op->Asl.ExternalName, + Node->Value); + } if (PassedArgs < Node->Value) { @@ -1076,6 +1085,22 @@ XfNamespaceLocateBegin ( AslError (ASL_ERROR, ASL_MSG_ARG_COUNT_HI, Op, AslGbl_MsgBuffer); } } + } + + /* + * At this point, a method call to an external method has been + * detected. As of 11/19/2019, iASL does not support parameter counts + * for methods declared as external. Therefore, save the parameter + * count of the first method call and use this count check other + * method calls to ensure that the methods are being called with the + * same amount of parameters. + */ + else if (Node->Type == ACPI_TYPE_METHOD && + (Node->Flags & ANOBJ_IS_EXTERNAL) && + Node->Value == ASL_EXTERNAL_METHOD_UNKNOWN_PARAMS && + Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_EXTERNAL) + { + Node->Value = PassedArgs; } } Modified: head/sys/contrib/dev/acpica/compiler/dtcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtcompile.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/dtcompile.c Fri Dec 13 23:28:52 2019 (r355739) @@ -261,25 +261,15 @@ DtDoCompile ( UtEndEvent (Event); FileNode = FlGetCurrentFileNode (); - if (!FileNode) - { - fprintf (stderr, "Summary for %s could not be generated", - AslGbl_Files[ASL_FILE_INPUT].Filename); - } - else - { - FileNode->TotalLineCount = AslGbl_CurrentLineNumber; - FileNode->OriginalInputFileSize = AslGbl_InputByteCount; - DbgPrint (ASL_PARSE_OUTPUT, "Line count: %u input file size: %u\n", - FileNode->TotalLineCount, FileNode->OriginalInputFileSize); - } + FileNode->TotalLineCount = AslGbl_CurrentLineNumber; + FileNode->OriginalInputFileSize = AslGbl_InputByteCount; + DbgPrint (ASL_PARSE_OUTPUT, "Line count: %u input file size: %u\n", + FileNode->TotalLineCount, FileNode->OriginalInputFileSize); + if (ACPI_FAILURE (Status)) { - if (FileNode) - { - FileNode->ParserErrorDetected = TRUE; - } + FileNode->ParserErrorDetected = TRUE; /* TBD: temporary error message. Msgs should come from function above */ @@ -306,11 +296,8 @@ DtDoCompile ( /* Save the compile time statistics to the current file node */ - if (FileNode) - { - FileNode->TotalFields = AslGbl_InputFieldCount; - FileNode->OutputByteLength = AslGbl_TableLength; - } + FileNode->TotalFields = AslGbl_InputFieldCount; + FileNode->OutputByteLength = AslGbl_TableLength; return (Status); } Modified: head/sys/contrib/dev/acpica/compiler/dtcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtcompiler.h Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/dtcompiler.h Fri Dec 13 23:28:52 2019 (r355739) @@ -459,7 +459,6 @@ DtCreateTableUnit ( UINT32 Column); - /* dtparser - lex/yacc files */ UINT64 DtCompilerParserResult; /* Expression return value */ Modified: head/sys/contrib/dev/acpica/compiler/dttable2.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dttable2.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/compiler/dttable2.c Fri Dec 13 23:28:52 2019 (r355739) @@ -1662,6 +1662,7 @@ DtCompileSlit ( "Found %u entries, must match LocalityCount: %u", LocalityListLength, Localities); DtError (ASL_ERROR, ASL_MSG_ENTRY_LIST, EndOfFieldList, AslGbl_MsgBuffer); + ACPI_FREE (LocalityBuffer); return (AE_LIMIT); } Modified: head/sys/contrib/dev/acpica/components/debugger/dbinput.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbinput.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/components/debugger/dbinput.c Fri Dec 13 23:28:52 2019 (r355739) @@ -1019,7 +1019,7 @@ AcpiDbCommandDispatch ( if (ACPI_FAILURE (Status) || Temp64 >= ACPI_NUM_PREDEFINED_REGIONS) { AcpiOsPrintf ( - "Invalid adress space ID: must be between 0 and %u inclusive\n", + "Invalid address space ID: must be between 0 and %u inclusive\n", ACPI_NUM_PREDEFINED_REGIONS - 1); return (AE_OK); } Modified: head/sys/contrib/dev/acpica/components/debugger/dbnames.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbnames.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/components/debugger/dbnames.c Fri Dec 13 23:28:52 2019 (r355739) @@ -807,7 +807,6 @@ AcpiDbWalkForFields ( } - /******************************************************************************* * * FUNCTION: AcpiDbWalkForSpecificObjects Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c Fri Dec 13 23:28:52 2019 (r355739) @@ -413,7 +413,7 @@ Cleanup: * FUNCTION: AcpiDsGetFieldNames * * PARAMETERS: Info - CreateField info structure - * ` WalkState - Current method state + * WalkState - Current method state * Arg - First parser arg for the field name list * * RETURN: Status Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c Fri Dec 13 23:28:52 2019 (r355739) @@ -374,6 +374,7 @@ AcpiDsInitBufferField ( } ObjDesc->BufferField.BufferObj = BufferDesc; + ObjDesc->BufferField.IsCreateField = AmlOpcode == AML_CREATE_FIELD_OP; /* Reference count for BufferDesc inherits ObjDesc count */ Modified: head/sys/contrib/dev/acpica/components/dispatcher/dswload.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dswload.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/components/dispatcher/dswload.c Fri Dec 13 23:28:52 2019 (r355739) @@ -567,6 +567,28 @@ AcpiDsLoad1EndOp ( Op = WalkState->Op; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState)); + /* + * Disassembler: handle create field operators here. + * + * CreateBufferField is a deferred op that is typically processed in load + * pass 2. However, disassembly of control method contents walk the parse + * tree with ACPI_PARSE_LOAD_PASS1 and AML_CREATE operators are processed + * in a later walk. This is a problem when there is a control method that + * has the same name as the AML_CREATE object. In this case, any use of the + * name segment will be detected as a method call rather than a reference + * to a buffer field. + * + * This earlier creation during disassembly solves this issue by inserting + * the named object in the ACPI namespace so that references to this name + * would be a name string rather than a method call. + */ + if ((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) && + (WalkState->OpInfo->Flags & AML_CREATE)) + { + Status = AcpiDsCreateBufferField (Op, WalkState); + return_ACPI_STATUS (Status); + } + /* We are only interested in opcodes that have an associated name */ if (!(WalkState->OpInfo->Flags & (AML_NAMED | AML_FIELD))) Modified: head/sys/contrib/dev/acpica/components/executer/exfield.c ============================================================================== --- head/sys/contrib/dev/acpica/components/executer/exfield.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/components/executer/exfield.c Fri Dec 13 23:28:52 2019 (r355739) @@ -246,7 +246,8 @@ AcpiExGetProtocolBufferLength ( * RETURN: Status * * DESCRIPTION: Read from a named field. Returns either an Integer or a - * Buffer, depending on the size of the field. + * Buffer, depending on the size of the field and whether if a + * field is created by the CreateField() operator. * ******************************************************************************/ @@ -310,12 +311,17 @@ AcpiExReadDataFromField ( * the use of arithmetic operators on the returned value if the * field size is equal or smaller than an Integer. * + * However, all buffer fields created by CreateField operator needs to + * remain as a buffer to match other AML interpreter implementations. + * * Note: Field.length is in bits. */ BufferLength = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES ( ObjDesc->Field.BitLength); - if (BufferLength > AcpiGbl_IntegerByteWidth) + if (BufferLength > AcpiGbl_IntegerByteWidth || + (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD && + ObjDesc->BufferField.IsCreateField)) { /* Field is too large for an Integer, create a Buffer instead */ Modified: head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c ============================================================================== --- head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c Fri Dec 13 23:28:52 2019 (r355739) @@ -192,7 +192,7 @@ static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[ ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep)), ACPI_STRUCT_INIT (ExtendedFunction, AcpiHwExtendedWakePrep) }, - {ACPI_STRUCT_INIT (Legacy_function, + {ACPI_STRUCT_INIT (LegacyFunction, ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake)), ACPI_STRUCT_INIT (ExtendedFunction, AcpiHwExtendedWake) } Modified: head/sys/contrib/dev/acpica/include/acobject.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acobject.h Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/include/acobject.h Fri Dec 13 23:28:52 2019 (r355739) @@ -489,6 +489,7 @@ typedef struct acpi_object_buffer_field { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO + BOOLEAN IsCreateField; /* Special case for objects created by CreateField() */ union acpi_operand_object *BufferObj; /* Containing Buffer object */ } ACPI_OBJECT_BUFFER_FIELD; Modified: head/sys/contrib/dev/acpica/include/acpixf.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acpixf.h Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/include/acpixf.h Fri Dec 13 23:28:52 2019 (r355739) @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20191018 +#define ACPI_CA_VERSION 0x20191213 #include #include Modified: head/sys/contrib/dev/acpica/include/platform/acenv.h ============================================================================== --- head/sys/contrib/dev/acpica/include/platform/acenv.h Fri Dec 13 23:22:49 2019 (r355738) +++ head/sys/contrib/dev/acpica/include/platform/acenv.h Fri Dec 13 23:28:52 2019 (r355739) @@ -270,6 +270,21 @@ #define ACPI_DISASSEMBLER 1 #endif +/* + * acpisrc CR\LF support + * Unix file line endings do not include the carriage return. + * If the acpisrc utility is being built using a microsoft compiler, it means + * that it will be running on a windows machine which means that the output is + * expected to have CR/LF newlines. If the acpisrc utility is built with + * anything else, it will likely run on a system with LF newlines. This flag + * tells the acpisrc utility that newlines will be in the LF format. + */ +#if defined(ACPI_SRC_APP) && !defined(_MSC_VER) +#define ACPI_SRC_OS_LF_ONLY 1 +#else +#define ACPI_SRC_OS_LF_ONLY 0 +#endif + /*! [Begin] no source code translation */ /****************************************************************************** From owner-svn-src-all@freebsd.org Fri Dec 13 23:33:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6AD71DA03A; Fri, 13 Dec 2019 23:33:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47ZRnZ5HM3z4fZm; Fri, 13 Dec 2019 23:33:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B09771BD48; Fri, 13 Dec 2019 23:33:54 +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 xBDNXsTb012848; Fri, 13 Dec 2019 23:33:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDNXsmS012846; Fri, 13 Dec 2019 23:33:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912132333.xBDNXsmS012846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Dec 2019 23:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355740 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 355740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 23:33:54 -0000 Author: jhb Date: Fri Dec 13 23:33:54 2019 New Revision: 355740 URL: https://svnweb.freebsd.org/changeset/base/355740 Log: Expand net epoch in the cxgbe TOE driver to satisfy assertions. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D22483 Modified: head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Fri Dec 13 23:28:52 2019 (r355739) +++ head/sys/dev/cxgbe/tom/t4_connect.c Fri Dec 13 23:33:54 2019 (r355740) @@ -237,6 +237,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru struct tcpcb *tp = intotcpcb(inp); int reason; struct offload_settings settings; + struct epoch_tracker et; uint16_t vid = 0xfff, pcp = 0; INP_WLOCK_ASSERT(inp); @@ -371,7 +372,9 @@ t4_connect(struct toedev *tod, struct socket *so, stru } offload_socket(so, toep); + NET_EPOCH_ENTER(et); rc = t4_l2t_send(sc, wr, toep->l2te); + NET_EPOCH_EXIT(et); if (rc == 0) { toep->flags |= TPF_CPL_PENDING; return (0); Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Fri Dec 13 23:28:52 2019 (r355739) +++ head/sys/dev/cxgbe/tom/t4_listen.c Fri Dec 13 23:33:54 2019 (r355740) @@ -1235,8 +1235,11 @@ found: * SYN must be directed to an IP6 address on this ifnet. This * is more restrictive than in6_localip. */ - if (!in6_ifhasaddr(ifp, &inc.inc6_laddr)) + NET_EPOCH_ENTER(et); + if (!in6_ifhasaddr(ifp, &inc.inc6_laddr)) { + NET_EPOCH_EXIT(et); REJECT_PASS_ACCEPT_REQ(true); + } ntids = 2; } else { @@ -1249,23 +1252,26 @@ found: * SYN must be directed to an IP address on this ifnet. This * is more restrictive than in_localip. */ - if (!in_ifhasaddr(ifp, inc.inc_laddr)) + NET_EPOCH_ENTER(et); + if (!in_ifhasaddr(ifp, inc.inc_laddr)) { + NET_EPOCH_EXIT(et); REJECT_PASS_ACCEPT_REQ(true); + } ntids = 1; } e = get_l2te_for_nexthop(pi, ifp, &inc); - if (e == NULL) + if (e == NULL) { + NET_EPOCH_EXIT(et); REJECT_PASS_ACCEPT_REQ(true); + } /* Don't offload if the 4-tuple is already in use */ - NET_EPOCH_ENTER(et); /* for 4-tuple check */ if (toe_4tuple_check(&inc, &th, ifp) != 0) { NET_EPOCH_EXIT(et); REJECT_PASS_ACCEPT_REQ(false); } - NET_EPOCH_EXIT(et); inp = lctx->inp; /* listening socket, not owned by TOE */ INP_WLOCK(inp); @@ -1273,6 +1279,7 @@ found: /* Don't offload if the listening socket has closed */ if (__predict_false(inp->inp_flags & INP_DROPPED)) { INP_WUNLOCK(inp); + NET_EPOCH_EXIT(et); REJECT_PASS_ACCEPT_REQ(false); } so = inp->inp_socket; @@ -1282,12 +1289,14 @@ found: rw_runlock(&sc->policy_lock); if (!settings.offload) { INP_WUNLOCK(inp); + NET_EPOCH_EXIT(et); REJECT_PASS_ACCEPT_REQ(true); /* Rejected by COP. */ } synqe = alloc_synqe(sc, lctx, M_NOWAIT); if (synqe == NULL) { INP_WUNLOCK(inp); + NET_EPOCH_EXIT(et); REJECT_PASS_ACCEPT_REQ(true); } atomic_store_int(&synqe->ok_to_respond, 0); @@ -1318,15 +1327,19 @@ found: remove_tid(sc, tid, ntids); m = synqe->syn; synqe->syn = NULL; + NET_EPOCH_EXIT(et); REJECT_PASS_ACCEPT_REQ(true); } CTR6(KTR_CXGBE, "%s: stid %u, tid %u, synqe %p, opt0 %#016lx, opt2 %#08x", __func__, stid, tid, synqe, be64toh(opt0), be32toh(opt2)); - } else + } else { + NET_EPOCH_EXIT(et); REJECT_PASS_ACCEPT_REQ(false); + } + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); return (0); reject: From owner-svn-src-all@freebsd.org Fri Dec 13 23:47:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07CFE1DA752; Fri, 13 Dec 2019 23:47:01 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47ZS4h6XKpz3C0L; Fri, 13 Dec 2019 23:47:00 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB7CA1BFA1; Fri, 13 Dec 2019 23:47:00 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDNl0Pc019273; Fri, 13 Dec 2019 23:47:00 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDNl0Cb019267; Fri, 13 Dec 2019 23:47:00 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201912132347.xBDNl0Cb019267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 13 Dec 2019 23:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355741 - in head: sys/dev/pci usr.sbin/pciconf X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head: sys/dev/pci usr.sbin/pciconf X-SVN-Commit-Revision: 355741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 23:47:01 -0000 Author: scottl Date: Fri Dec 13 23:46:59 2019 New Revision: 355741 URL: https://svnweb.freebsd.org/changeset/base/355741 Log: Add accessors for the Vendor Specific Extended Capability (VSEC) Parse out the VSEC. If the user invokes a second -c command line option, do a hex dump of the vendor data. Reviewed by: imp MFC after: 3 days Sponsored by: Intel Differential Revision: http://reviews.freebsd.org/D22808 Modified: head/sys/dev/pci/pcireg.h head/usr.sbin/pciconf/cap.c head/usr.sbin/pciconf/pciconf.8 head/usr.sbin/pciconf/pciconf.c head/usr.sbin/pciconf/pciconf.h Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Fri Dec 13 23:33:54 2019 (r355740) +++ head/sys/dev/pci/pcireg.h Fri Dec 13 23:46:59 2019 (r355741) @@ -1049,6 +1049,13 @@ #define PCIR_SRIOV_BARS 0x24 #define PCIR_SRIOV_BAR(x) (PCIR_SRIOV_BARS + (x) * 4) +/* Extended Capability Vendor-Specific definitions */ +#define PCIR_VSEC_HEADER 0x04 +#define PCIR_VSEC_ID(hdr) ((hdr) & 0xffff) +#define PCIR_VSEC_REV(hdr) (((hdr) & 0xf0000) >> 16) +#define PCIR_VSEC_LENGTH(hdr) (((hdr) & 0xfff00000) >> 20) +#define PCIR_VSEC_DATA 0x08 + /* * PCI Express Firmware Interface definitions */ Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Fri Dec 13 23:33:54 2019 (r355740) +++ head/usr.sbin/pciconf/cap.c Fri Dec 13 23:46:59 2019 (r355741) @@ -50,6 +50,8 @@ static const char rcsid[] = static void list_ecaps(int fd, struct pci_conf *p); +static int cap_level; + static void cap_power(int fd, struct pci_conf *p, uint8_t ptr) { @@ -729,7 +731,7 @@ cap_ea(int fd, struct pci_conf *p, uint8_t ptr) } void -list_caps(int fd, struct pci_conf *p) +list_caps(int fd, struct pci_conf *p, int level) { int express; uint16_t sta; @@ -740,6 +742,8 @@ list_caps(int fd, struct pci_conf *p) if (!(sta & PCIM_STATUS_CAPPRESENT)) return; + cap_level = level; + switch (p->pc_hdr & PCIM_HDRTYPE) { case PCIM_HDRTYPE_NORMAL: case PCIM_HDRTYPE_BRIDGE: @@ -875,13 +879,33 @@ ecap_sernum(int fd, struct pci_conf *p, uint16_t ptr, static void ecap_vendor(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) { - uint32_t val; + uint32_t val, hdr; + uint16_t nextptr, len; + int i; - printf("Vendor %d", ver); - if (ver < 1) + val = read_config(fd, &p->pc_sel, ptr, 4); + nextptr = PCI_EXTCAP_NEXTPTR(val); + hdr = read_config(fd, &p->pc_sel, ptr + PCIR_VSEC_HEADER, 4); + len = PCIR_VSEC_LENGTH(hdr); + if (len == 0) { + if (nextptr == 0) + nextptr = 0x1000; + len = nextptr - ptr; + } + + printf("Vendor [%d] ID %04x Rev %d Length %d\n", ver, + PCIR_VSEC_ID(hdr), PCIR_VSEC_REV(hdr), len); + if ((ver < 1) || (cap_level <= 1)) return; - val = read_config(fd, &p->pc_sel, ptr + 4, 4); - printf(" ID %d\n", val & 0xffff); + for (i = 0; i < len; i += 4) { + val = read_config(fd, &p->pc_sel, ptr + PCIR_VSEC_DATA + i, 4); + if ((i % 16) == 0) + printf(" "); + printf("%02x %02x %02x %02x ", val & 0xff, (val >> 8) & 0xff, + (val >> 16) & 0xff, (val >> 24) & 0xff); + if ((((i + 4) % 16) == 0 ) || ((i + 4) >= len)) + printf("\n"); + } } static void Modified: head/usr.sbin/pciconf/pciconf.8 ============================================================================== --- head/usr.sbin/pciconf/pciconf.8 Fri Dec 13 23:33:54 2019 (r355740) +++ head/usr.sbin/pciconf/pciconf.8 Fri Dec 13 23:46:59 2019 (r355741) @@ -177,6 +177,9 @@ If the option is supplied, .Nm will list any capabilities supported by each device. +A second invocation of +.Fl c +will print additional data for certain capabilities. Each capability is enumerated via a line in the following format: .Bd -literal cap 10[40] = PCI-Express 1 root port Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Fri Dec 13 23:33:54 2019 (r355740) +++ head/usr.sbin/pciconf/pciconf.c Fri Dec 13 23:46:59 2019 (r355741) @@ -131,7 +131,7 @@ main(int argc, char **argv) break; case 'c': - caps = 1; + caps++; break; case 'D': @@ -282,7 +282,7 @@ list_devs(const char *name, int verbose, int bars, int if (bridge) list_bridge(fd, p); if (caps) - list_caps(fd, p); + list_caps(fd, p, caps); if (errors) list_errors(fd, p); if (vpd) Modified: head/usr.sbin/pciconf/pciconf.h ============================================================================== --- head/usr.sbin/pciconf/pciconf.h Fri Dec 13 23:33:54 2019 (r355740) +++ head/usr.sbin/pciconf/pciconf.h Fri Dec 13 23:46:59 2019 (r355741) @@ -35,7 +35,7 @@ #ifndef __PCICONF_H__ #define __PCICONF_H__ -void list_caps(int fd, struct pci_conf *p); +void list_caps(int fd, struct pci_conf *p, int level); void list_errors(int fd, struct pci_conf *p); uint8_t pci_find_cap(int fd, struct pci_conf *p, uint8_t id); uint16_t pcie_find_cap(int fd, struct pci_conf *p, uint16_t id); From owner-svn-src-all@freebsd.org Sat Dec 14 00:43:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9077E1DB83B; Sat, 14 Dec 2019 00:43:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47ZTKf3JQwz3Fj6; Sat, 14 Dec 2019 00:43:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C1841CA56; Sat, 14 Dec 2019 00:43:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBE0hI3P054786; Sat, 14 Dec 2019 00:43:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBE0hIXa054784; Sat, 14 Dec 2019 00:43:18 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201912140043.xBE0hIXa054784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 14 Dec 2019 00:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355742 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 355742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 00:43:18 -0000 Author: mjg Date: Sat Dec 14 00:43:17 2019 New Revision: 355742 URL: https://svnweb.freebsd.org/changeset/base/355742 Log: Remove the useless return value from proc_set_cred Modified: head/sys/kern/kern_prot.c head/sys/sys/ucred.h Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Fri Dec 13 23:46:59 2019 (r355741) +++ head/sys/kern/kern_prot.c Sat Dec 14 00:43:17 2019 (r355742) @@ -1995,10 +1995,9 @@ proc_set_cred_init(struct proc *p, struct ucred *newcr * only used when the process is about to be freed, at which point it should * not be visible anymore). */ -struct ucred * +void proc_set_cred(struct proc *p, struct ucred *newcred) { - struct ucred *oldcred; MPASS(p->p_ucred != NULL); if (newcred == NULL) @@ -2006,11 +2005,9 @@ proc_set_cred(struct proc *p, struct ucred *newcred) else PROC_LOCK_ASSERT(p, MA_OWNED); - oldcred = p->p_ucred; p->p_ucred = newcred; if (newcred != NULL) PROC_UPDATE_COW(p); - return (oldcred); } struct ucred * Modified: head/sys/sys/ucred.h ============================================================================== --- head/sys/sys/ucred.h Fri Dec 13 23:46:59 2019 (r355741) +++ head/sys/sys/ucred.h Sat Dec 14 00:43:17 2019 (r355742) @@ -112,7 +112,7 @@ struct ucred *crcopysafe(struct proc *p, struct ucred struct ucred *crdup(struct ucred *cr); void crextend(struct ucred *cr, int n); void proc_set_cred_init(struct proc *p, struct ucred *cr); -struct ucred *proc_set_cred(struct proc *p, struct ucred *cr); +void proc_set_cred(struct proc *p, struct ucred *cr); void crfree(struct ucred *cr); struct ucred *crget(void); struct ucred *crhold(struct ucred *cr); From owner-svn-src-all@freebsd.org Sat Dec 14 02:03:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C742D1DE8A9; Sat, 14 Dec 2019 02:03:47 +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 47ZW6W4wkCz3L4M; Sat, 14 Dec 2019 02:03:47 +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 A44F51D975; Sat, 14 Dec 2019 02:03:47 +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 xBE23lpc002094; Sat, 14 Dec 2019 02:03:47 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBE23lkn002093; Sat, 14 Dec 2019 02:03:47 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201912140203.xBE23lkn002093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 14 Dec 2019 02:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355743 - head/sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sbin/pfctl X-SVN-Commit-Revision: 355743 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 02:03:47 -0000 Author: kp Date: Sat Dec 14 02:03:47 2019 New Revision: 355743 URL: https://svnweb.freebsd.org/changeset/base/355743 Log: pfctl: Warn users when they run into kernel limits Warn users when they try to add/delete/modify more items than the kernel will allow. Reviewed by: allanjude (previous version), Lutz Donnerhacke Differential Revision: https://reviews.freebsd.org/D22733 Modified: head/sbin/pfctl/pfctl_radix.c Modified: head/sbin/pfctl/pfctl_radix.c ============================================================================== --- head/sbin/pfctl/pfctl_radix.c Sat Dec 14 00:43:17 2019 (r355742) +++ head/sbin/pfctl/pfctl_radix.c Sat Dec 14 02:03:47 2019 (r355743) @@ -58,7 +58,24 @@ extern int dev; static int pfr_next_token(char buf[], FILE *); +static void +pfr_report_error(struct pfr_table *tbl, struct pfioc_table *io, + const char *err) +{ + unsigned long maxcount; + size_t s; + s = sizeof(maxcount); + if (sysctlbyname("net.pf.request_maxcount", &maxcount, &s, NULL, + 0) == -1) + return; + + if (io->pfrio_size > maxcount || io->pfrio_size2 > maxcount) + fprintf(stderr, "cannot %s %s: too many elements.\n" + "Consider increasing net.pf.request_maxcount.", + err, tbl->pfrt_name); +} + int pfr_clr_tables(struct pfr_table *filter, int *ndel, int flags) { @@ -89,8 +106,10 @@ pfr_add_tables(struct pfr_table *tbl, int size, int *n io.pfrio_buffer = tbl; io.pfrio_esize = sizeof(*tbl); io.pfrio_size = size; - if (ioctl(dev, DIOCRADDTABLES, &io)) + if (ioctl(dev, DIOCRADDTABLES, &io)) { + pfr_report_error(tbl, &io, "add table"); return (-1); + } if (nadd != NULL) *nadd = io.pfrio_nadd; return (0); @@ -110,8 +129,10 @@ pfr_del_tables(struct pfr_table *tbl, int size, int *n io.pfrio_buffer = tbl; io.pfrio_esize = sizeof(*tbl); io.pfrio_size = size; - if (ioctl(dev, DIOCRDELTABLES, &io)) + if (ioctl(dev, DIOCRDELTABLES, &io)) { + pfr_report_error(tbl, &io, "delete table"); return (-1); + } if (ndel != NULL) *ndel = io.pfrio_ndel; return (0); @@ -134,8 +155,10 @@ pfr_get_tables(struct pfr_table *filter, struct pfr_ta io.pfrio_buffer = tbl; io.pfrio_esize = sizeof(*tbl); io.pfrio_size = *size; - if (ioctl(dev, DIOCRGETTABLES, &io)) + if (ioctl(dev, DIOCRGETTABLES, &io)) { + pfr_report_error(tbl, &io, "get table"); return (-1); + } *size = io.pfrio_size; return (0); } @@ -157,8 +180,10 @@ pfr_get_tstats(struct pfr_table *filter, struct pfr_ts io.pfrio_buffer = tbl; io.pfrio_esize = sizeof(*tbl); io.pfrio_size = *size; - if (ioctl(dev, DIOCRGETTSTATS, &io)) + if (ioctl(dev, DIOCRGETTSTATS, &io)) { + pfr_report_error(filter, &io, "get tstats for"); return (-1); + } *size = io.pfrio_size; return (0); } @@ -198,8 +223,10 @@ pfr_add_addrs(struct pfr_table *tbl, struct pfr_addr * io.pfrio_buffer = addr; io.pfrio_esize = sizeof(*addr); io.pfrio_size = size; - if (ioctl(dev, DIOCRADDADDRS, &io)) + if (ioctl(dev, DIOCRADDADDRS, &io)) { + pfr_report_error(tbl, &io, "add addresses in"); return (-1); + } if (nadd != NULL) *nadd = io.pfrio_nadd; return (0); @@ -221,8 +248,10 @@ pfr_del_addrs(struct pfr_table *tbl, struct pfr_addr * io.pfrio_buffer = addr; io.pfrio_esize = sizeof(*addr); io.pfrio_size = size; - if (ioctl(dev, DIOCRDELADDRS, &io)) + if (ioctl(dev, DIOCRDELADDRS, &io)) { + pfr_report_error(tbl, &io, "delete addresses in"); return (-1); + } if (ndel != NULL) *ndel = io.pfrio_ndel; return (0); @@ -245,8 +274,10 @@ pfr_set_addrs(struct pfr_table *tbl, struct pfr_addr * io.pfrio_esize = sizeof(*addr); io.pfrio_size = size; io.pfrio_size2 = (size2 != NULL) ? *size2 : 0; - if (ioctl(dev, DIOCRSETADDRS, &io)) + if (ioctl(dev, DIOCRSETADDRS, &io)) { + pfr_report_error(tbl, &io, "set addresses in"); return (-1); + } if (nadd != NULL) *nadd = io.pfrio_nadd; if (ndel != NULL) @@ -275,8 +306,10 @@ pfr_get_addrs(struct pfr_table *tbl, struct pfr_addr * io.pfrio_buffer = addr; io.pfrio_esize = sizeof(*addr); io.pfrio_size = *size; - if (ioctl(dev, DIOCRGETADDRS, &io)) + if (ioctl(dev, DIOCRGETADDRS, &io)) { + pfr_report_error(tbl, &io, "get addresses from"); return (-1); + } *size = io.pfrio_size; return (0); } @@ -298,8 +331,10 @@ pfr_get_astats(struct pfr_table *tbl, struct pfr_astat io.pfrio_buffer = addr; io.pfrio_esize = sizeof(*addr); io.pfrio_size = *size; - if (ioctl(dev, DIOCRGETASTATS, &io)) + if (ioctl(dev, DIOCRGETASTATS, &io)) { + pfr_report_error(tbl, &io, "get astats from"); return (-1); + } *size = io.pfrio_size; return (0); } @@ -318,8 +353,10 @@ pfr_clr_tstats(struct pfr_table *tbl, int size, int *n io.pfrio_buffer = tbl; io.pfrio_esize = sizeof(*tbl); io.pfrio_size = size; - if (ioctl(dev, DIOCRCLRTSTATS, &io)) + if (ioctl(dev, DIOCRCLRTSTATS, &io)) { + pfr_report_error(tbl, &io, "clear tstats from"); return (-1); + } if (nzero) *nzero = io.pfrio_nzero; return (0); @@ -341,8 +378,10 @@ pfr_tst_addrs(struct pfr_table *tbl, struct pfr_addr * io.pfrio_buffer = addr; io.pfrio_esize = sizeof(*addr); io.pfrio_size = size; - if (ioctl(dev, DIOCRTSTADDRS, &io)) + if (ioctl(dev, DIOCRTSTADDRS, &io)) { + pfr_report_error(tbl, &io, "test addresses in"); return (-1); + } if (nmatch) *nmatch = io.pfrio_nmatch; return (0); @@ -365,8 +404,10 @@ pfr_ina_define(struct pfr_table *tbl, struct pfr_addr io.pfrio_esize = sizeof(*addr); io.pfrio_size = size; io.pfrio_ticket = ticket; - if (ioctl(dev, DIOCRINADEFINE, &io)) + if (ioctl(dev, DIOCRINADEFINE, &io)) { + pfr_report_error(tbl, &io, "define inactive set table"); return (-1); + } if (nadd != NULL) *nadd = io.pfrio_nadd; if (naddr != NULL) From owner-svn-src-all@freebsd.org Sat Dec 14 02:06:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DA361DEA21; Sat, 14 Dec 2019 02:06:08 +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 47ZW9D0xLyz3LFL; Sat, 14 Dec 2019 02:06:08 +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 1B88D1D99C; Sat, 14 Dec 2019 02:06:08 +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 xBE267Rk002251; Sat, 14 Dec 2019 02:06:07 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBE2672g002250; Sat, 14 Dec 2019 02:06:07 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201912140206.xBE2672g002250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 14 Dec 2019 02:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355744 - 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: 355744 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 02:06:08 -0000 Author: kp Date: Sat Dec 14 02:06:07 2019 New Revision: 355744 URL: https://svnweb.freebsd.org/changeset/base/355744 Log: pf: Make request_maxcount runtime adjustable There's no reason for this to be a tunable. It's perfectly safe to change this at runtime. Reviewed by: Lutz Donnerhacke Differential Revision: https://reviews.freebsd.org/D22737 Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sat Dec 14 02:03:47 2019 (r355743) +++ head/sys/netpfil/pf/pf.c Sat Dec 14 02:06:07 2019 (r355744) @@ -381,7 +381,7 @@ SYSCTL_ULONG(_net_pf, OID_AUTO, states_hashsize, CTLFL &pf_hashsize, 0, "Size of pf(4) states hashtable"); SYSCTL_ULONG(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_RDTUN, &pf_srchashsize, 0, "Size of pf(4) source nodes hashtable"); -SYSCTL_ULONG(_net_pf, OID_AUTO, request_maxcount, CTLFLAG_RDTUN, +SYSCTL_ULONG(_net_pf, OID_AUTO, request_maxcount, CTLFLAG_RW, &pf_ioctl_maxcount, 0, "Maximum number of tables, addresses, ... in a single ioctl() call"); VNET_DEFINE(void *, pf_swi_cookie); From owner-svn-src-all@freebsd.org Sat Dec 14 03:14:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01D071E01D0; Sat, 14 Dec 2019 03:14:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47ZXhS6zJdz3P7r; Sat, 14 Dec 2019 03:14:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA5151E6DC; Sat, 14 Dec 2019 03:14:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBE3EmD0044530; Sat, 14 Dec 2019 03:14:48 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBE3Ekm3044517; Sat, 14 Dec 2019 03:14:46 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201912140314.xBE3Ekm3044517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 14 Dec 2019 03:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355745 - stable/12/contrib/openresolv X-SVN-Group: stable-12 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/12/contrib/openresolv X-SVN-Commit-Revision: 355745 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 03:14:49 -0000 Author: pfg Date: Sat Dec 14 03:14:46 2019 New Revision: 355745 URL: https://svnweb.freebsd.org/changeset/base/355745 Log: MFC 354924: MFV 354917, 354918, 354919 openresolv: update to version 3.9.2 Added: stable/12/contrib/openresolv/LICENSE - copied unchanged from r354924, head/contrib/openresolv/LICENSE stable/12/contrib/openresolv/README.md - copied unchanged from r354924, head/contrib/openresolv/README.md Deleted: stable/12/contrib/openresolv/README Modified: stable/12/contrib/openresolv/Makefile stable/12/contrib/openresolv/configure stable/12/contrib/openresolv/dnsmasq.in stable/12/contrib/openresolv/libc.in stable/12/contrib/openresolv/named.in stable/12/contrib/openresolv/pdns_recursor.in stable/12/contrib/openresolv/pdnsd.in stable/12/contrib/openresolv/resolvconf.conf stable/12/contrib/openresolv/resolvconf.conf.5.in stable/12/contrib/openresolv/resolvconf.in stable/12/contrib/openresolv/unbound.in Copied: stable/12/contrib/openresolv/LICENSE (from r354924, head/contrib/openresolv/LICENSE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/openresolv/LICENSE Sat Dec 14 03:14:46 2019 (r355745, copy of r354924, head/contrib/openresolv/LICENSE) @@ -0,0 +1,23 @@ +Copyright (c) 2007-2019 Roy Marples +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. Modified: stable/12/contrib/openresolv/Makefile ============================================================================== --- stable/12/contrib/openresolv/Makefile Sat Dec 14 02:06:07 2019 (r355744) +++ stable/12/contrib/openresolv/Makefile Sat Dec 14 03:14:46 2019 (r355745) @@ -10,6 +10,7 @@ SYSCONFDIR?= /etc LIBEXECDIR?= /libexec/resolvconf VARDIR?= /var/run/resolvconf +ECHO?= echo INSTALL?= install SED?= sed @@ -20,7 +21,7 @@ DOCMODE?= 0644 MANMODE?= 0444 RESOLVCONF= resolvconf resolvconf.8 resolvconf.conf.5 -SUBSCRIBERS= libc dnsmasq named pdnsd unbound +SUBSCRIBERS= libc dnsmasq named pdnsd pdns_recursor unbound TARGET= ${RESOLVCONF} ${SUBSCRIBERS} SRCS= ${TARGET:C,$,.in,} # pmake SRCS:= ${TARGET:=.in} # gmake @@ -42,7 +43,7 @@ DISTINFOSIGN= ${DISTINFO}.asc CKSUM?= cksum -a SHA256 PGP?= netpgp -FOSSILID?= current +GITREF?= HEAD .SUFFIXES: .in @@ -79,15 +80,17 @@ maninstall: install: proginstall maninstall -import: +dist-git: + git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE} + +dist-inst: + mkdir /tmp/${DISTPREFIX} + cp -RPp * /tmp/${DISTPREFIX} + (cd /tmp/${DISTPREFIX}; make clean) + tar -cvjpf ${DISTFILE} -C /tmp ${DISTPREFIX} rm -rf /tmp/${DISTPREFIX} - ${INSTALL} -d /tmp/${DISTPREFIX} - cp README ${SRCS} /tmp/${DISTPREFIX} -dist: - fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ} - gunzip -c ${DISTFILEGZ} | xz >${DISTFILE} - rm ${DISTFILEGZ} +dist: dist-git distinfo: dist rm -f ${DISTINFO} ${DISTINFOSIGN} @@ -96,3 +99,20 @@ distinfo: dist ${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO} chmod 644 ${DISTINFOSIGN} ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN} + +import: dist + rm -rf /tmp/${DISTPREFIX} + ${INSTALL} -d /tmp/${DISTPREFIX} + tar xvJpf ${DISTFILE} -C /tmp + +_import-src: + rm -rf ${DESTDIR}/* + ${INSTALL} -d ${DESTDIR} + cp LICENSE README.md ${SRCS} resolvconf.conf ${DESTDIR}; + cp resolvconf.8.in resolvconf.conf.5.in ${DESTDIR}; + @${ECHO} + @${ECHO} "=============================================================" + @${ECHO} "openresolv-${VERSION} imported to ${DESTDIR}" + +import-src: + ${MAKE} _import-src DESTDIR=`if [ -n "${DESTDIR}" ]; then echo "${DESTDIR}"; else echo /tmp/${DISTPREFIX}; fi` Copied: stable/12/contrib/openresolv/README.md (from r354924, head/contrib/openresolv/README.md) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/openresolv/README.md Sat Dec 14 03:14:46 2019 (r355745, copy of r354924, head/contrib/openresolv/README.md) @@ -0,0 +1,64 @@ +# openresolv + +openresolv is a [resolvconf](https://en.wikipedia.org/wiki/Resolvconf) +implementation which manages `/etc/resolv.conf`. + +`/etc/resolv.conf` is a file that holds the configuration for the local +resolution of domain names. +Normally this file is either static or maintained by a local daemon, +normally a DHCP daemon. But what happens if more than one thing wants to +control the file? +Say you have wired and wireless interfaces to different subnets and run a VPN +or two on top of that, how do you say which one controls the file? +It's also not as easy as just adding and removing the nameservers each client +knows about as different clients could add the same nameservers. + +Enter resolvconf, the middleman between the network configuration services and +`/etc/resolv.conf`. +resolvconf itself is just a script that stores, removes and lists a full +`resolv.conf` generated for the interface. It then calls all the helper scripts +it knows about so it can configure the real `/etc/resolv.conf` and optionally +any local nameservers other than libc. + +## Reasons for using openresolv + +Why openresolv over the +[Debian implementation](http://qref.sourceforge.net/Debian/reference/ch-gateway.en.html#s-dns-resolvconf)? +Here's some reasons: + * Works with + [POSIX shell and userland](http://www.opengroup.org/onlinepubs/009695399) + * Does not need awk, grep or sed which means we can work without `/usr` + mounted + * Works with other init systems than Debians' out of the box + * Available as a 2 clause + [BSD license](http://www.freebsd.org/copyright/freebsd-license.html) + * Prefer configs via IF_METRIC for dynamic ordering + * Configures zones for local resolvers other than libc + +The last point is quite important, especially when running VPN systems. +Take the following resolv.conf files which have been generated by a +[DHCP client](../dhcpcd) and sent to resolvconf: + +``` +# resolv.conf from bge0 +search foo.com +nameserver 1.2.3.4 + +# resolv.conf from tap0 +domain bar.org +nameserver 5.6.7.8 +``` + +In this instance, queries for foo.com will go to 1.2.3.4 and queries for +bar.org will go to 5.6.7.8. +This does require the resolvers to be configured to pickup the resolvconf +generated configuration for them though. +openresolv ships with helpers for: + * [unbound](http://www.unbound.net/) + * [dnsmasq](http://www.thekelleys.org.uk/dnsmasq/doc.html) + * [ISC BIND](http://www.isc.org/software/bind) + * [PowerDNS Recursor](http://wiki.powerdns.com/trac) + +See the +[configuration section](https://roy.marples.name/projects/openresolv/config) +for more details. Modified: stable/12/contrib/openresolv/configure ============================================================================== --- stable/12/contrib/openresolv/configure Sat Dec 14 02:06:07 2019 (r355744) +++ stable/12/contrib/openresolv/configure Sat Dec 14 03:14:46 2019 (r355745) @@ -44,42 +44,8 @@ for x do esac done -if [ -z "$LIBEXECDIR" ]; then - printf "Checking for directory /libexec ... " - if [ -d /libexec ]; then - echo "yes" - LIBEXECDIR=$PREFIX/libexec/resolvconf - else - echo "no" - LIBEXECDIR=$PREFIX/lib/resolvconf - fi -fi -if [ -z "$RUNDIR" ]; then - printf "Checking for directory /run ... " - if [ -d /run ]; then - echo "yes" - RUNDIR=/run - else - echo "no" - RUNDIR=/var/run - fi -fi - : ${SED:=sed} -: ${SYSCONFDIR:=$PREFIX/etc} -: ${SBINDIR:=$PREFIX/sbin} -: ${LIBEXECDIR:=$PREFIX/libexec/resolvconf} -: ${STATEDIR:=/var} -: ${RUNDIR:=$STATEDIR/run} -: ${MANDIR:=${PREFIX:-/usr}/share/man} - -eval SYSCONFDIR="$SYSCONFDIR" -eval SBINDIR="$SBINDIR" -eval LIBEXECDIR="$LIBEXECDIR" -eval VARDIR="$RUNDIR/resolvconf" -eval MANDIR="$MANDIR" - CONFIG_MK=config.mk if [ -z "$BUILD" ]; then @@ -121,7 +87,19 @@ rm -rf $CONFIG_MK echo "# $OS" >$CONFIG_MK case "$OS" in -freebsd*) +dragonfly*) + # This means /usr HAS to be mounted not via dhcpcd + : ${LIBEXECDIR:=${PREFIX:-/usr}/libexec/resolvconf} + ;; +linux*) + # cksum does't support -a and netpgp is rare + echo "CKSUM= sha256sum --tag" >>$CONFIG_MK + echo "PGP= gpg2" >>$CONFIG_MK + ;; +esac + +case "$OS" in +dragonfly*|freebsd*) # On FreeBSD, /etc/init.d/foo status returns 0 if foo is not enabled # regardless of if it's not running. # So we force onestatus to work around this silly bug. @@ -129,12 +107,42 @@ freebsd*) STATUSARG="onestatus" fi ;; -linux*) - # cksum does't support -a and netpgp is rare - echo "CKSUM= sha256sum --tag" >>$CONFIG_MK - echo "PGP= gpg2" >>$CONFIG_MK - ;; esac + + +if [ -z "$LIBEXECDIR" ]; then + printf "Checking for directory /libexec ... " + if [ -d /libexec ]; then + echo "yes" + LIBEXECDIR=$PREFIX/libexec/resolvconf + else + echo "no" + LIBEXECDIR=$PREFIX/lib/resolvconf + fi +fi +if [ -z "$RUNDIR" ]; then + printf "Checking for directory /run ... " + if [ -d /run ]; then + echo "yes" + RUNDIR=/run + else + echo "no" + RUNDIR=/var/run + fi +fi + +: ${SYSCONFDIR:=$PREFIX/etc} +: ${SBINDIR:=$PREFIX/sbin} +: ${LIBEXECDIR:=$PREFIX/libexec/resolvconf} +: ${STATEDIR:=/var} +: ${RUNDIR:=$STATEDIR/run} +: ${MANDIR:=${PREFIX:-/usr}/share/man} + +eval SYSCONFDIR="$SYSCONFDIR" +eval SBINDIR="$SBINDIR" +eval LIBEXECDIR="$LIBEXECDIR" +eval VARDIR="$RUNDIR/resolvconf" +eval MANDIR="$MANDIR" for x in SYSCONFDIR SBINDIR LIBEXECDIR VARDIR MANDIR RESTARTCMD RCDIR STATUSARG do Modified: stable/12/contrib/openresolv/dnsmasq.in ============================================================================== --- stable/12/contrib/openresolv/dnsmasq.in Sat Dec 14 02:06:07 2019 (r355744) +++ stable/12/contrib/openresolv/dnsmasq.in Sat Dec 14 03:14:46 2019 (r355745) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2016 Roy Marples +# Copyright (c) 2007-2019 Roy Marples # All rights reserved # dnsmasq subscriber for resolvconf @@ -28,7 +28,7 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 -[ -z "$dnsmasq_conf" -a -z "$dnsmasq_resolv" ] && exit 0 +[ -z "${dnsmasq_conf}${dnsmasq_resolv}" ] && exit 0 [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " @@ -98,7 +98,7 @@ for d in $DOMAINS; do empty=false i=0 IFS=: set -- $n - while [ -n "$1" -o -n "$2" ]; do + while [ -n "$1" ] || [ -n "$2" ]; do addr="$1" shift if [ -z "$addr" ]; then @@ -184,7 +184,7 @@ if $changed; then eval $dnsmasq_restart elif [ -n "$RESTARTCMD" ]; then set -- ${dnsmasq_service} - eval $RESTARTCMD + eval "$RESTARTCMD" else @SBINDIR@/resolvconf -r ${dnsmasq_service} fi @@ -206,4 +206,6 @@ if $dbus; then dbus-send --system --dest=uk.org.thekelleys.dnsmasq \ /uk/org/thekelleys/dnsmasq uk.org.thekelleys.$method \ $dbusdest + dbus-send --system --dest=uk.org.thekelleys.dnsmasq \ + /uk/org/thekelleys/dnsmasq uk.org.thekelleys.ClearCache fi Modified: stable/12/contrib/openresolv/libc.in ============================================================================== --- stable/12/contrib/openresolv/libc.in Sat Dec 14 02:06:07 2019 (r355744) +++ stable/12/contrib/openresolv/libc.in Sat Dec 14 03:14:46 2019 (r355745) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2016 Roy Marples +# Copyright (c) 2007-2019 Roy Marples # All rights reserved # libc subscriber for resolvconf @@ -36,9 +36,9 @@ NL=" # sed may not be available, and this is faster on small files key_get_value() { - local key="$1" x= line= - + key="$1" shift + if [ $# -eq 0 ]; then while read -r line; do case "$line" in @@ -58,8 +58,6 @@ key_get_value() keys_remove() { - local key x line found - while read -r line; do found=false for key do @@ -79,7 +77,7 @@ local_nameservers="127.* 0.0.0.0 255.255.255.255 ::1" if [ -f "$SYSCONFDIR"/resolvconf.conf ]; then . "$SYSCONFDIR"/resolvconf.conf elif [ -d "$SYSCONFDIR"/resolvconf ]; then - SYSCONFDIR="$SYSCONFDIR/resolvconf/resolv.conf.d" + SYSCONFDIR="$SYSCONFDIR/resolvconf" base="$SYSCONFDIR/resolv.conf.d/base" if [ -f "$base" ]; then prepend_nameservers="$(key_get_value "nameserver " "$base")" @@ -98,10 +96,12 @@ fi : ${resolv_conf:=/etc/resolv.conf} : ${libc_service:=nscd} : ${list_resolv:=@SBINDIR@/resolvconf -l} -if [ "${resolv_conf_head-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.head ]; then +if [ "${resolv_conf_head-x}" = x ] && [ -f "$SYSCONFDIR"/resolv.conf.head ] +then resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.head)" fi -if [ "${resolv_conf_tail-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.tail ]; then +if [ "${resolv_conf_tail-x}" = x ] && [ -f "$SYSCONFDIR"/resolv.conf.tail ] +then resolv_conf_tail="$(cat "$SYSCONFDIR"/resolv.conf.tail)" fi @@ -110,7 +110,7 @@ signature="# Generated by resolvconf" uniqify() { - local result= + result= while [ -n "$1" ]; do case " $result " in *" $1 "*);; @@ -126,7 +126,7 @@ case "${resolv_conf_passthrough:-NO}" in backup=false newest= for conf in "$IFACEDIR"/*; do - if [ -z "$newest" -o "$conf" -nt "$newest" ]; then + if [ -z "$newest" ] || [ "$conf" -nt "$newest" ]; then newest="$conf" fi done @@ -178,7 +178,7 @@ case "${resolv_conf_passthrough:-NO}" in fi [ -n "$domain" ] && newconf="${newconf}domain $domain$NL" - if [ -n "$newsearch" -a "$newsearch" != "$domain" ]; then + if [ -n "$newsearch" ] && [ "$newsearch" != "$domain" ]; then newconf="${newconf}search $newsearch$NL" fi for n in $newns; do @@ -232,7 +232,7 @@ if [ -n "$libc_restart" ]; then eval $libc_restart elif [ -n "$RESTARTCMD" ]; then set -- ${libc_service} - eval $RESTARTCMD + eval "$RESTARTCMD" else @SBINDIR@/resolvconf -r ${libc_service} fi Modified: stable/12/contrib/openresolv/named.in ============================================================================== --- stable/12/contrib/openresolv/named.in Sat Dec 14 02:06:07 2019 (r355744) +++ stable/12/contrib/openresolv/named.in Sat Dec 14 03:14:46 2019 (r355745) @@ -28,14 +28,14 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 -[ -z "$named_zones" -a -z "$named_options" ] && exit 0 +[ -z "${named_zones}${named_options}" ] && exit 0 [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " # Platform specific kludges -if [ -z "$named_service" -a -z "$named_restart" -a \ - -d "$RCDIR" -a ! -x "$RCDIR"/named ] +if [ -z "${named_service}${named_restart}" ] && + [ -d "$RCDIR" ] && ! [ -x "$RCDIR"/named ] then if [ -x "$RCDIR"/bind9 ]; then # Debian and derivatives @@ -111,7 +111,7 @@ if $changed; then eval $named_restart elif [ -n "$RESTARTCMD" ]; then set -- ${named_service} - eval $RESTARTCMD + eval "$RESTARTCMD" else @SBINDIR@/resolvconf -r ${named_service} fi Modified: stable/12/contrib/openresolv/pdns_recursor.in ============================================================================== --- stable/12/contrib/openresolv/pdns_recursor.in Sat Dec 14 02:06:07 2019 (r355744) +++ stable/12/contrib/openresolv/pdns_recursor.in Sat Dec 14 03:14:46 2019 (r355745) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2009-2011 Roy Marples +# Copyright (c) 2009-2019 Roy Marples # All rights reserved # PowerDNS Recursor subscriber for resolvconf @@ -33,17 +33,14 @@ NL=" " -: ${pdns_service:=pdns_recursor} +: ${pdns_service:=pdns-recursor} newzones= -# pds_recursor does not present support global forward servers, which -# does limit it's usefulness somewhat. -# If it did, the below code can be enabled, or something like it. -#for n in $NAMESERVERS; do -# newzones="$newzones${newzones:+,}$n" -#done -#[ -n "$newzones" ] && newzones=".=$newzones$NL" +for n in $NAMESERVERS; do + newzones="$newzones${newzones:+,}$n" +done +[ -n "$newzones" ] && newzones="+.=$newzones$NL" for d in $DOMAINS; do newns= @@ -71,7 +68,7 @@ then eval $pdns_restart elif [ -n "$RESTARTCMD" ]; then set -- ${pdns_service} - eval $RESTARTCMD + eval "$RESTARTCMD" else @SBINDIR@/resolvconf -r ${pdns_service} fi Modified: stable/12/contrib/openresolv/pdnsd.in ============================================================================== --- stable/12/contrib/openresolv/pdnsd.in Sat Dec 14 02:06:07 2019 (r355744) +++ stable/12/contrib/openresolv/pdnsd.in Sat Dec 14 03:14:46 2019 (r355745) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2010-2013 Roy Marples +# Copyright (c) 2010-2018 Roy Marples # All rights reserved # pdnsd subscriber for resolvconf @@ -28,7 +28,7 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 -[ -z "$pdnsd_conf" -a -z "$pdnsd_resolv" ] && exit 0 +[ -z "${pdnsd_conf}${pdnsd_resolv}" ] && exit 0 [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " @@ -41,14 +41,16 @@ signature_end="# End of resolvconf" # but sed may not always be available at the time. remove_markers() { - local m1="$1" m2="$2" x= line= in_marker=0 + m1="$1" + m2="$2" + in_marker=0 shift; shift if type sed >/dev/null 2>&1; then sed "/^$m1/,/^$m2/d" $@ else - for x; do - while read -r line; do + for x do + while read line; do case "$line" in "$m1"*) in_marker=1;; "$m2"*) in_marker=0;; Modified: stable/12/contrib/openresolv/resolvconf.conf ============================================================================== --- stable/12/contrib/openresolv/resolvconf.conf Sat Dec 14 02:06:07 2019 (r355744) +++ stable/12/contrib/openresolv/resolvconf.conf Sat Dec 14 03:14:46 2019 (r355745) @@ -4,4 +4,4 @@ resolv_conf=/etc/resolv.conf # If you run a local name server, you should uncomment the below line and # configure your subscribers configuration files below. -#name_servers=127.0.0.1 \ No newline at end of file +#name_servers=127.0.0.1 Modified: stable/12/contrib/openresolv/resolvconf.conf.5.in ============================================================================== --- stable/12/contrib/openresolv/resolvconf.conf.5.in Sat Dec 14 02:06:07 2019 (r355744) +++ stable/12/contrib/openresolv/resolvconf.conf.5.in Sat Dec 14 03:14:46 2019 (r355745) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 29, 2016 +.Dd September 8, 2019 .Dt RESOLVCONF.CONF 5 .Os .Sh NAME @@ -64,19 +64,25 @@ Defaults to YES. .It Sy interface_order These interfaces will always be processed first. If unset, defaults to the following:- -.D1 lo lo[0-9]* +.Bd -compact -literal -offset indent +lo lo[0-9]* +.Ed .It Sy dynamic_order These interfaces will be processed next, unless they have a metric. If unset, defaults to the following:- -.D1 tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]* +.Bd -compact -literal -offset indent +tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]* +.Ed .It Sy inclusive_interfaces -Ignore any exlcusive marking for these interfaces. +Ignore any exclusive marking for these interfaces. This is handy when 3rd party integrations force the .Nm resolvconf -x option and you want to disable it easily. .It Sy local_nameservers If unset, defaults to the following:- -.D1 127.* 0.0.0.0 255.255.255.255 ::1 +.Bd -compact -literal -offset indent +127.* 0.0.0.0 255.255.255.255 ::1 +.Ed .It Sy search_domains Prepend search domains to the dynamically generated list. .It Sy search_domains_append @@ -118,16 +124,24 @@ The syntax is this: .Va $keyword Ns / Ns Va $match Ns / Ns Va $replacement .Pp Example, given this resolv.conf: -.D1 domain foo.org -.D1 search foo.org dead.beef -.D1 nameserver 1.2.3.4 -.D1 nameserver 2.3.4.5 +.Bd -compact -literal -offset indent +domain foo.org +search foo.org dead.beef +nameserver 1.2.3.4 +nameserver 2.3.4.5 +.Ed and this configuaration: -.D1 replace="search/foo*/bar.com nameserver/1.2.3.4/5.6.7.8 nameserver/2.3.4.5/" +.Bd -compact -literal -offset indent +replace="search/foo*/bar.com" +replace="$replace nameserver/1.2.3.4/5.6.7.8" +replace="$replace nameserver/2.3.4.5/" +.Ed you would get this resolv.conf instead: -.D1 domain foo.org -.D1 search bar.com -.D1 nameserver 5.6.7.8 +.Bd -compact -literal -offset indent +domain foo.org +search bar.com +nameserver 5.6.7.8 +.Ed .It Sy replace_sub Works the same way as .Sy replace @@ -138,9 +152,11 @@ Using the same example resolv.conf and changing to .Sy replace_sub , you would get this resolv.conf instead: -.D1 domain foo.org -.D1 search bar.com dead.beef -.D1 nameserver 5.6.7.8 +.Bd -compact -literal -offset indent +domain foo.org +search bar.com dead.beef +nameserver 5.6.7.8 +.Ed .It Sy state_dir Override the default state directory of .Pa @VARDIR@ . @@ -195,7 +211,8 @@ Prepend search domains to the dynamically generated li openresolv ships with subscribers for the name servers .Xr dnsmasq 8 , .Xr named 8 , -.Xr pdnsd 8 +.Xr pdnsd 8 , +.Xr pdns_recursor 8 , and .Xr unbound 8 . Each subscriber can create configuration files which should be included in @@ -203,7 +220,9 @@ in the subscribers main configuration file. .Pp To disable a subscriber, simply set it's name to NO. For example, to disable the libc subscriber you would set: -.D1 libc=NO +.Bd -compact -literal -offset indent +libc=NO +.Ed .Bl -tag -width indent .It Sy dnsmasq_conf This file tells dnsmasq which name servers to use for specific domains. @@ -211,17 +230,21 @@ This file tells dnsmasq which name servers to use for This file tells dnsmasq which name servers to use for global lookups. .Pp Example resolvconf.conf for dnsmasq: -.D1 name_servers=127.0.0.1 -.D1 dnsmasq_conf=/etc/dnsmasq-conf.conf -.D1 dnsmasq_resolv=/etc/dnsmasq-resolv.conf +.Bd -compact -literal -offset indent +name_servers=127.0.0.1 +dnsmasq_conf=/etc/dnsmasq-conf.conf +dnsmasq_resolv=/etc/dnsmasq-resolv.conf +.Ed .Pp Example dnsmasq.conf: -.D1 listen-address=127.0.0.1 -.D1 # If dnsmasq is compiled for DBus then we can take -.D1 # advantage of not having to restart dnsmasq. -.D1 enable-dbus -.D1 conf-file=/etc/dnsmasq-conf.conf -.D1 resolv-file=/etc/dnsmasq-resolv.conf +.Bd -compact -literal -offset indent +listen-address=127.0.0.1 +# If dnsmasq is compiled for DBus then we can take +# advantage of not having to restart dnsmasq. +enable-dbus +conf-file=/etc/dnsmasq-conf.conf +resolv-file=/etc/dnsmasq-resolv.conf +.Ed .It Sy named_options Include this file in the named options block. This file tells named which name servers to use for global lookups. @@ -230,16 +253,21 @@ Include this file in the named global scope, after the This file tells named which name servers to use for specific domains. .Pp Example resolvconf.conf for named: -.D1 name_servers=127.0.0.1 -.D1 named_options=/etc/named-options.conf -.D1 named_zones=/etc/named-zones.conf +.Bd -compact -literal -offset indent +name_servers=127.0.0.1 +named_options=/etc/named-options.conf +named_zones=/etc/named-zones.conf +.Ed .Pp Example named.conf: -.D1 options { -.D1 listen-on { 127.0.0.1; }; -.D1 include "/etc/named-options.conf"; -.D1 }; -.D1 include "/etc/named-zones.conf"; +.Bd -compact -literal -offset indent +options { + listen-on { 127.0.0.1; }; + include "/etc/named-options.conf"; +}; + +include "/etc/named-zones.conf"; +.Ed .It Sy pdnsd_conf This is the main pdnsd configuration file which we modify to add our forward domains to. @@ -253,32 +281,54 @@ If this variable is not set then it's written to .Pa pdnsd_conf . .Pp Example resolvconf.conf for pdnsd: -.D1 name_servers=127.0.0.1 -.D1 pdnsd_conf=/etc/pdnsd.conf -.D1 # pdnsd_resolv=/etc/pdnsd-resolv.conf +.Bd -compact -literal -offset indent +name_servers=127.0.0.1 +pdnsd_conf=/etc/pdnsd.conf +# pdnsd_resolv=/etc/pdnsd-resolv.conf +.Ed .Pp Example pdnsd.conf: -.D1 global { -.D1 server_ip = 127.0.0.1; -.D1 status_ctl = on; -.D1 } -.D1 server { -.D1 # A server definition is required, even if emtpy. -.D1 label="empty"; -.D1 proxy_only=on; -.D1 # file="/etc/pdnsd-resolv.conf"; -.D1 } +.Bd -compact -literal -offset indent +global { + server_ip = 127.0.0.1; + status_ctl = on; +} +server { + # A server definition is required, even if empty. + label="empty"; + proxy_only=on; + # file="/etc/pdnsd-resolv.conf"; +} +.Ed +.It Sy pdns_zones +This file tells pdns_recursor about specific and global name servers. +.Pp +Example resolvconf.conf for pdns_recursor: +.Bd -compact -literal -offset indent +name_servers=127.0.0.1 +pdns_zones=/etc/pdns/recursor-zones.conf +.Ed +.Pp +Example recursor.conf: +.Bd -compact -literal -offset indent +allow-from=127.0.0.0/8, ::1/128 +forward-zones-file=/etc/pdns/recursor-zones.conf +.Ed .It Sy unbound_conf This file tells unbound about specific and global name servers. .It Sy unbound_insecure When set to YES, unbound marks the domains as insecure, thus ignoring DNSSEC. .Pp Example resolvconf.conf for unbound: -.D1 name_servers=127.0.0.1 -.D1 unbound_conf=/etc/unbound-resolvconf.conf +.Bd -compact -literal -offset indent +name_servers=127.0.0.1 +unbound_conf=/etc/unbound-resolvconf.conf +.Ed .Pp Example unbound.conf: -.D1 include: /etc/unbound-resolvconf.conf +.Bd -compact -literal -offset indent +include: /etc/unbound-resolvconf.conf +.Ed .El .Sh SUBSCRIBER INTEGRATION Not all distributions store the files the subscribers need in the same @@ -292,7 +342,6 @@ Also, users could equally want to use a different vers installed by default, such as bind8 and bind9. To accommodate this, the subscribers have these files in configurable variables, documented below. -.Pp .Bl -tag -width indent .It Sy dnsmasq_service Name of the dnsmasq service. @@ -310,6 +359,10 @@ Name of the named service. Command to restart the named service. .It Sy pdnsd_restart Command to restart the pdnsd service. +.It Sy pdns_service +Command to restart the pdns_recursor service. +.It Sy pdns_restart +Command to restart the pdns_recursor service. .It Sy unbound_service Name of the unbound service. .It Sy unbound_restart Modified: stable/12/contrib/openresolv/resolvconf.in ============================================================================== --- stable/12/contrib/openresolv/resolvconf.in Sat Dec 14 02:06:07 2019 (r355744) +++ stable/12/contrib/openresolv/resolvconf.in Sat Dec 14 03:14:46 2019 (r355745) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2016 Roy Marples +# Copyright (c) 2007-2019 Roy Marples # All rights reserved # Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. RESOLVCONF="$0" -OPENRESOLV_VERSION="3.9.0" +OPENRESOLV_VERSION="3.9.2" SYSCONFDIR=@SYSCONFDIR@ LIBEXECDIR=@LIBEXECDIR@ VARDIR=@VARDIR@ @@ -125,21 +125,22 @@ usage() # If you think otherwise, capture a DNS trace and you'll see libc # will strip it regardless. # This also solves setting up duplicate zones in our subscribers. -strip_trailing_dots() +# Also strip any comments denoted by #. +resolv_strip() { - local n= d= - - for n; do - printf "$d%s" "${n%.}" - d=" " + space= + for word; do + case "$word" in + \#*) break;; + esac + printf "%s%s" "$space${word%.}" + space=" " done printf "\n" } private_iface() { - local p - # Allow expansion cd "$IFACEDIR" @@ -168,12 +169,15 @@ private_iface() # for domain name servers, search name servers and global nameservers parse_resolv() { - local line= ns= ds= search= d= n= newns= - local new=true iface= private=false p= domain= l= islocal= - + domain= + new=true newns= + ns= + private=false + search= while read -r line; do + stripped_line="$(resolv_strip ${line#* })" case "$line" in "# resolv.conf from "*) if ${new}; then @@ -189,29 +193,32 @@ parse_resolv() "nameserver "*) islocal=false for l in $local_nameservers; do - case "${line#* }" in + case "$stripped_line" in $l) islocal=true - echo "LOCALNAMESERVERS=\"\$LOCALNAMESERVERS ${line#* }\"" break ;; esac done - $islocal || ns="$ns${line#* } " + if $islocal; then + echo "LOCALNAMESERVERS=\"\$LOCALNAMESERVERS $stripped_line\"" + else + ns="$ns$stripped_line " + fi ;; "domain "*) - search="$(strip_trailing_dots ${line#* })" + search="$stripped_line" if [ -z "$domain" ]; then domain="$search" echo "DOMAIN=\"$domain\"" fi ;; "search "*) - search="$(strip_trailing_dots ${line#* })" + search="$stripped_line" ;; *) [ -n "$line" ] && continue - if [ -n "$ns" -a -n "$search" ]; then + if [ -n "$ns" ] && [ -n "$search" ]; then newns= for n in $ns; do newns="$newns${newns:+,}$n" @@ -236,7 +243,7 @@ parse_resolv() uniqify() { - local result= + result= while [ -n "$1" ]; do case " $result " in *" $1 "*);; @@ -249,8 +256,8 @@ uniqify() dirname() { - local dir= OIFS="$IFS" - local IFS=/ + OIFS="$IFS" + IFS=/ set -- $@ IFS="$OIFS" if [ -n "$1" ]; then @@ -267,7 +274,7 @@ dirname() config_mkdirs() { - local e=0 f d + e=0 for f; do [ -n "$f" ] || continue d="$(dirname "$f")" @@ -295,66 +302,86 @@ detect_init() # Detect the running init system. # As systemd and OpenRC can be installed on top of legacy init # systems we try to detect them first. - local status="@STATUSARG@" + status="@STATUSARG@" : ${status:=status} - if [ -x /bin/systemctl -a -S /run/systemd/private ]; then - RESTARTCMD="if /bin/systemctl --quiet is-active \$1.service; then - /bin/systemctl restart \$1.service; -fi" - elif [ -x /usr/bin/systemctl -a -S /run/systemd/private ]; then - RESTARTCMD="if /usr/bin/systemctl --quiet is-active \$1.service; then - /usr/bin/systemctl restart \$1.service; -fi" - elif [ -x /sbin/rc-service -a \ - -s /libexec/rc/init.d/softlevel -o -s /run/openrc/softlevel ] + if [ -x /bin/systemctl ] && [ -S /run/systemd/private ]; then + RESTARTCMD=' + if /bin/systemctl --quiet is-active $1.service + then + /bin/systemctl restart $1.service + fi' + elif [ -x /usr/bin/systemctl ] && [ -S /run/systemd/private ]; then + RESTARTCMD=' + if /usr/bin/systemctl --quiet is-active $1.service + then + /usr/bin/systemctl restart $1.service + fi' + elif [ -x /sbin/rc-service ] && + { [ -s /libexec/rc/init.d/softlevel ] || + [ -s /run/openrc/softlevel ]; } then - RESTARTCMD="/sbin/rc-service -i \$1 -- -Ds restart" + RESTARTCMD='/sbin/rc-service -i $1 -- -Ds restart' elif [ -x /usr/sbin/invoke-rc.d ]; then RCDIR=/etc/init.d - RESTARTCMD="if /usr/sbin/invoke-rc.d --quiet \$1 status 1>/dev/null 2>&1; then - /usr/sbin/invoke-rc.d \$1 restart; -fi" + RESTARTCMD=' + if /usr/sbin/invoke-rc.d --quiet $1 status >/dev/null 2>&1 + then + /usr/sbin/invoke-rc.d $1 restart + fi' elif [ -x /sbin/service ]; then # Old RedHat RCDIR=/etc/init.d - RESTARTCMD="if /sbin/service \$1; then - /sbin/service \$1 restart; -fi" + RESTARTCMD=' + if /sbin/service $1; then + /sbin/service $1 restart + fi' elif [ -x /usr/sbin/service ]; then # Could be FreeBSD - RESTARTCMD="if /usr/sbin/service \$1 $status 1>/dev/null 2>&1; then - /usr/sbin/service \$1 restart; -fi" + RESTARTCMD=" + if /usr/sbin/service \$1 $status >/dev/null 2>&1 + then + /usr/sbin/service \$1 restart + fi" elif [ -x /bin/sv ]; then - RESTARTCMD="/bin/sv status \$1 >/dev/null 2>&1 && /bin/sv try-restart \$1" + RESTARTCMD='/bin/sv status $1 >/dev/null 2>&1 && + /bin/sv try-restart $1' elif [ -x /usr/bin/sv ]; then - RESTARTCMD="/usr/bin/sv status \$1 >/dev/null 2>&1 && /usr/bin/sv try-restart \$1" - elif [ -e /etc/arch-release -a -d /etc/rc.d ]; then *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Dec 14 05:21:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF84C1E20E0; Sat, 14 Dec 2019 05:21:57 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47ZbW941zwz3yY3; Sat, 14 Dec 2019 05:21:57 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 858981FE4C; Sat, 14 Dec 2019 05:21:57 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBE5Lv6K016859; Sat, 14 Dec 2019 05:21:57 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBE5LvQm016857; Sat, 14 Dec 2019 05:21:57 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912140521.xBE5LvQm016857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Sat, 14 Dec 2019 05:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355746 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355746 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 05:21:57 -0000 Author: rlibby Date: Sat Dec 14 05:21:56 2019 New Revision: 355746 URL: https://svnweb.freebsd.org/changeset/base/355746 Log: uma dbg: flexible size for slab debug bitset too Recently (r355315) the size of the struct uma_slab bitset field us_free became dynamic instead of conservative. Now, make the debug bitset size dynamic too. The debug bitset is INVARIANTS-only, so in fact we don't care too much about the space savings that results from this, but enabling minimally-sized slabs on INVARIANTS builds is still important in order to be able to test new slab layouts effectively. Reviewed by: jeff (previous version), markj (previous version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22759 Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sat Dec 14 03:14:46 2019 (r355745) +++ head/sys/vm/uma_core.c Sat Dec 14 05:21:56 2019 (r355746) @@ -293,6 +293,8 @@ static int sysctl_handle_uma_zone_flags(SYSCTL_HANDLER static int sysctl_handle_uma_slab_efficiency(SYSCTL_HANDLER_ARGS); #ifdef INVARIANTS +static inline struct noslabbits *slab_dbg_bits(uma_slab_t slab, uma_keg_t keg); + static bool uma_dbg_kskip(uma_keg_t keg, void *mem); static bool uma_dbg_zskip(uma_zone_t zone, void *mem); static void uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *item); @@ -1204,7 +1206,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom slab->us_domain = domain; BIT_FILL(keg->uk_ipers, &slab->us_free); #ifdef INVARIANTS - BIT_ZERO(SLAB_MAX_SETSIZE, &slab->us_debugfree); + BIT_ZERO(keg->uk_ipers, slab_dbg_bits(slab, keg)); #endif if (keg->uk_init != NULL) { @@ -1487,6 +1489,15 @@ zero_init(void *mem, int size, int flags) return (0); } +#ifdef INVARIANTS +struct noslabbits * +slab_dbg_bits(uma_slab_t slab, uma_keg_t keg) +{ + + return ((void *)((char *)&slab->us_free + BITSET_SIZE(keg->uk_ipers))); +} +#endif + /* * Actual size of embedded struct slab (!OFFPAGE). */ @@ -1495,7 +1506,7 @@ slab_sizeof(int nitems) { size_t s; - s = sizeof(struct uma_slab) + BITSET_SIZE(nitems); + s = sizeof(struct uma_slab) + BITSET_SIZE(nitems) * SLAB_BITSETS; return (roundup(s, UMA_ALIGN_PTR + 1)); } @@ -4541,12 +4552,10 @@ uma_dbg_alloc(uma_zone_t zone, uma_slab_t slab, void * keg = zone->uz_keg; freei = slab_item_index(slab, keg, item); - if (BIT_ISSET(SLAB_MAX_SETSIZE, freei, &slab->us_debugfree)) + if (BIT_ISSET(keg->uk_ipers, freei, slab_dbg_bits(slab, keg))) panic("Duplicate alloc of %p from zone %p(%s) slab %p(%d)\n", item, zone, zone->uz_name, slab, freei); - BIT_SET_ATOMIC(SLAB_MAX_SETSIZE, freei, &slab->us_debugfree); - - return; + BIT_SET_ATOMIC(keg->uk_ipers, freei, slab_dbg_bits(slab, keg)); } /* @@ -4577,11 +4586,11 @@ uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *i panic("Unaligned free of %p from zone %p(%s) slab %p(%d)\n", item, zone, zone->uz_name, slab, freei); - if (!BIT_ISSET(SLAB_MAX_SETSIZE, freei, &slab->us_debugfree)) + if (!BIT_ISSET(keg->uk_ipers, freei, slab_dbg_bits(slab, keg))) panic("Duplicate free of %p from zone %p(%s) slab %p(%d)\n", item, zone, zone->uz_name, slab, freei); - BIT_CLR_ATOMIC(SLAB_MAX_SETSIZE, freei, &slab->us_debugfree); + BIT_CLR_ATOMIC(keg->uk_ipers, freei, slab_dbg_bits(slab, keg)); } #endif /* INVARIANTS */ Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Sat Dec 14 03:14:46 2019 (r355745) +++ head/sys/vm/uma_int.h Sat Dec 14 05:21:56 2019 (r355746) @@ -254,6 +254,7 @@ struct uma_keg { }; typedef struct uma_keg * uma_keg_t; +#ifdef _KERNEL /* * Free bits per-slab. */ @@ -271,17 +272,26 @@ struct uma_slab { uint16_t us_freecount; /* How many are free? */ uint8_t us_flags; /* Page flags see uma.h */ uint8_t us_domain; /* Backing NUMA domain. */ -#ifdef INVARIANTS - struct slabbits us_debugfree; /* Debug bitmask. */ -#endif - struct noslabbits us_free; /* Free bitmask. */ + struct noslabbits us_free; /* Free bitmask, flexible. */ }; +_Static_assert(sizeof(struct uma_slab) == offsetof(struct uma_slab, us_free), + "us_free field must be last"); #if MAXMEMDOM >= 255 #error "Slab domain type insufficient" #endif typedef struct uma_slab * uma_slab_t; +/* + * On INVARIANTS builds, the slab contains a second bitset of the same size, + * "dbg_bits", which is laid out immediately after us_free. + */ +#ifdef INVARIANTS +#define SLAB_BITSETS 2 +#else +#define SLAB_BITSETS 1 +#endif + /* These three functions are for embedded (!OFFPAGE) use only. */ size_t slab_sizeof(int nitems); size_t slab_space(int nitems); @@ -293,7 +303,10 @@ int slab_ipers(size_t size, int align); */ struct uma_hash_slab { struct uma_slab uhs_slab; /* Must be first. */ - struct slabbits uhs_bits; /* Must be second. */ + struct slabbits uhs_bits1; /* Must be second. */ +#ifdef INVARIANTS + struct slabbits uhs_bits2; /* Must be third. */ +#endif LIST_ENTRY(uma_hash_slab) uhs_hlink; /* Link for hash table */ uint8_t *uhs_data; /* First item */ }; @@ -327,6 +340,7 @@ slab_item_index(uma_slab_t slab, uma_keg_t keg, void * data = (uintptr_t)slab_data(slab, keg); return (((uintptr_t)item - data) / keg->uk_rsize); } +#endif /* _KERNEL */ TAILQ_HEAD(uma_bucketlist, uma_bucket); From owner-svn-src-all@freebsd.org Sat Dec 14 08:28:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E66F31E602A; Sat, 14 Dec 2019 08:28:12 +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 47Zgf43CVBz476Z; Sat, 14 Dec 2019 08:28:12 +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 6478F21E84; Sat, 14 Dec 2019 08:28:12 +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 xBE8SCX2027664; Sat, 14 Dec 2019 08:28:12 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBE8SAXq027656; Sat, 14 Dec 2019 08:28:10 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912140828.xBE8SAXq027656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 14 Dec 2019 08:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355747 - in head: . include lib/libc/stdlib lib/libxo X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: . include lib/libc/stdlib lib/libxo X-SVN-Commit-Revision: 355747 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 08:28:13 -0000 Author: cem Date: Sat Dec 14 08:28:10 2019 New Revision: 355747 URL: https://svnweb.freebsd.org/changeset/base/355747 Log: Deprecate sranddev(3) API It serves no useful purpose and wasn't as popular as its equally meritless cousin, srandomdev(3). Setting aside the problems with rand(3) in general, the problem with this interface is that the seed isn't shared with the caller (other than by attacking the output of the generator, which is trivial, but not a hallmark of pleasant API design). The (arguable) utility of rand(3) or random(3) is as a semi-fast simulation generator which produces consistent results from a given seed. These are mutually at odd. Furthermore, sometimes people got the mistaken impression that a high quality random seed meant a weak generator like rand(3) or random(3) could be used for things like cryptographic key generation. This is absolutely not so. The API was never part of a standard and was not widely used in tree. Existing in-tree uses have all been removed. Possible replacement in out of tree codebases: char buf[3]; time_t t; time(t); strftime(buf, sizeof(buf), "%S", gmtime(&t)); srand(atoi(buf)); Relnotes: yes Modified: head/ObsoleteFiles.inc head/include/stdlib.h head/lib/libc/stdlib/Makefile.inc head/lib/libc/stdlib/Symbol.map head/lib/libc/stdlib/rand.3 head/lib/libc/stdlib/rand.c head/lib/libxo/xo_config.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Dec 14 05:21:56 2019 (r355746) +++ head/ObsoleteFiles.inc Sat Dec 14 08:28:10 2019 (r355747) @@ -36,6 +36,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20191214: Removal of sranddev(3) +OLD_FILES+=usr/share/man/man3/sranddev.3.gz # 20191213: remove timeout(9) OLD_FILES+=usr/share/man/man9/timeout.9.gz OLD_FILES+=usr/share/man/man9/untimeout.9.gz Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Sat Dec 14 05:21:56 2019 (r355746) +++ head/include/stdlib.h Sat Dec 14 08:28:10 2019 (r355747) @@ -309,12 +309,17 @@ int rpmatch(const char *); void setprogname(const char *); int sradixsort(const unsigned char **, int, const unsigned char *, unsigned); -void sranddev(void); void srandomdev(void); long long strtonum(const char *, long long, long long, const char **); /* Deprecated interfaces, to be removed. */ +static inline void +__attribute__((__deprecated__("sranddev to be removed in FreeBSD 13"))) +sranddev(void) +{ +} + __int64_t strtoq(const char *, char **, int); __uint64_t Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Sat Dec 14 05:21:56 2019 (r355746) +++ head/lib/libc/stdlib/Makefile.inc Sat Dec 14 08:28:10 2019 (r355747) @@ -52,7 +52,7 @@ MLINKS+=insque.3 remque.3 MLINKS+=lsearch.3 lfind.3 MLINKS+=ptsname.3 grantpt.3 ptsname.3 unlockpt.3 MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3 -MLINKS+=rand.3 rand_r.3 rand.3 srand.3 rand.3 sranddev.3 +MLINKS+=rand.3 rand_r.3 rand.3 srand.3 MLINKS+=random.3 initstate.3 random.3 setstate.3 random.3 srandom.3 \ random.3 srandomdev.3 MLINKS+=radixsort.3 sradixsort.3 Modified: head/lib/libc/stdlib/Symbol.map ============================================================================== --- head/lib/libc/stdlib/Symbol.map Sat Dec 14 05:21:56 2019 (r355746) +++ head/lib/libc/stdlib/Symbol.map Sat Dec 14 08:28:10 2019 (r355747) @@ -56,7 +56,6 @@ FBSD_1.0 { rand_r; rand; srand; - sranddev; srandom; srandomdev; initstate; Modified: head/lib/libc/stdlib/rand.3 ============================================================================== --- head/lib/libc/stdlib/rand.3 Sat Dec 14 05:21:56 2019 (r355746) +++ head/lib/libc/stdlib/rand.3 Sat Dec 14 08:28:10 2019 (r355747) @@ -32,13 +32,12 @@ .\" @(#)rand.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 22, 2019 +.Dd December 14, 2019 .Dt RAND 3 .Os .Sh NAME .Nm rand , .Nm srand , -.Nm sranddev , .Nm rand_r .Nd bad random number generator .Sh LIBRARY @@ -47,8 +46,6 @@ .In stdlib.h .Ft void .Fn srand "unsigned seed" -.Ft void -.Fn sranddev void .Ft int .Fn rand void .Ft int @@ -90,10 +87,6 @@ value is provided, the functions are automatically seeded with a value of 1. .Pp The -.Fn sranddev -function initializes a seed using pseudo-random numbers obtained from the kernel. -.Pp -The .Fn rand_r function provides the same functionality as @@ -122,4 +115,5 @@ conform to .Pp The .Fn rand_r -function is as proposed in the POSIX.4a Draft #6 document. +function is marked as obsolescent in POSIX and may be removed in a future +revision of the standard. Modified: head/lib/libc/stdlib/rand.c ============================================================================== --- head/lib/libc/stdlib/rand.c Sat Dec 14 05:21:56 2019 (r355746) +++ head/lib/libc/stdlib/rand.c Sat Dec 14 08:28:10 2019 (r355747) @@ -40,7 +40,9 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #include +#include #include "un-namespace.h" #ifdef TEST @@ -102,25 +104,18 @@ srand(unsigned seed) } -/* - * sranddev: - * - * Many programs choose the seed value in a totally predictable manner. - * This often causes problems. We seed the generator using pseudo-random - * data from the kernel. - */ +void __sranddev_fbsd12(void); void -sranddev(void) +__sranddev_fbsd12(void) { - int mib[2]; - size_t len; + static bool warned = false; - len = sizeof(next); - - mib[0] = CTL_KERN; - mib[1] = KERN_ARND; - sysctl(mib, 2, (void *)&next, &len, NULL, 0); + if (!warned) { + syslog(LOG_DEBUG, "Deprecated function sranddev() called"); + warned = true; + } } +__sym_compat(sranddev, __sranddev_fbsd12, FBSD_1.0); #ifdef TEST Modified: head/lib/libxo/xo_config.h ============================================================================== --- head/lib/libxo/xo_config.h Sat Dec 14 05:21:56 2019 (r355746) +++ head/lib/libxo/xo_config.h Sat Dec 14 08:28:10 2019 (r355747) @@ -102,7 +102,7 @@ #define HAVE_SRAND 1 /* Define to 1 if you have the `sranddev' function. */ -#define HAVE_SRANDDEV 1 +/* #undef HAVE_SRANDDEV */ /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 From owner-svn-src-all@freebsd.org Sat Dec 14 09:26:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98E591E736D for ; Sat, 14 Dec 2019 09:26:53 +0000 (UTC) (envelope-from mrvmurray@icloud.com) Received: from mr85p00im-ztdg06021701.me.com (mr85p00im-ztdg06021701.me.com [17.58.23.196]) (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 47Zhxm2LVrz49fw for ; Sat, 14 Dec 2019 09:26:51 +0000 (UTC) (envelope-from mrvmurray@icloud.com) Received: from gronkulator.grondar.org (grouter.grondar.org [88.96.155.38]) by mr85p00im-ztdg06021701.me.com (Postfix) with ESMTPSA id 916D7A00E13; Sat, 14 Dec 2019 09:26:49 +0000 (UTC) Content-Type: multipart/signed; boundary="Apple-Mail=_3DD21231-53B4-4827-8899-B046AC2C9F66"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: Re: svn commit: r355747 - in head: . include lib/libc/stdlib lib/libxo From: Mark Murray In-Reply-To: <201912140828.xBE8SAXq027656@repo.freebsd.org> Date: Sat, 14 Dec 2019 09:26:46 +0000 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <8313AF73-9ACA-4C25-93A0-49AC8F696B03@icloud.com> References: <201912140828.xBE8SAXq027656@repo.freebsd.org> To: Conrad Meyer X-Mailer: Apple Mail (2.3608.40.2.2.4) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-12-14_01:, , 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=866 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1912140071 X-Rspamd-Queue-Id: 47Zhxm2LVrz49fw X-Spamd-Bar: -------- X-Spamd-Result: default: False [-8.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[icloud.com]; R_SPF_ALLOW(-0.20)[+ip4:17.58.0.0/16]; HAS_ATTACHMENT(0.00)[]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[icloud.com:+]; DMARC_POLICY_ALLOW(-0.50)[icloud.com,quarantine]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[icloud.com]; RCVD_IN_DNSWL_LOW(-0.10)[196.23.58.17.list.dnswl.org : 127.0.5.1]; ASN(0.00)[asn:714, ipnet:17.58.16.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[icloud.com:s=1a1hai]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; IP_SCORE(0.00)[ip: (-2.50), ipnet: 17.58.16.0/20(-1.45), asn: 714(-2.22), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; DWL_DNSWL_LOW(-1.00)[icloud.com.dwl.dnswl.org : 127.0.5.1]; TO_MATCH_ENVRCPT_SOME(0.00)[]; WHITELIST_SPF_DKIM(-3.00)[icloud.com:d:+,icloud.com:s:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 09:26:53 -0000 --Apple-Mail=_3DD21231-53B4-4827-8899-B046AC2C9F66 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On 14 Dec 2019, at 08:28, Conrad Meyer wrote: > > Author: cem > Date: Sat Dec 14 08:28:10 2019 > New Revision: 355747 > URL: https://svnweb.freebsd.org/changeset/base/355747 > > Log: > Deprecate sranddev(3) API > > It serves no useful purpose and wasn't as popular as its equally meritless > cousin, srandomdev(3). Good! This is many years overdue. M -- --Apple-Mail=_3DD21231-53B4-4827-8899-B046AC2C9F66 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 Comment: GPGTools - http://gpgtools.org iQEzBAEBCgAdFiEEyzPHvybPbOpU9MCxQlsJDh9CUqAFAl30qtYACgkQQlsJDh9C UqA8Pgf9H8hOIpMVXtlUWqKGtu6Tf7sHf06TW1scoPq3QH9qw/9FVo3U4minFWvl sgzVBSaiecp0Rz6ntY2i1bSVvbShbVeymEGg+aVFKVBRed2AGni2ykJ+2a7p2SPU ZDeeX3/VFhZC3BR6Du7p/ihDh9Q6CMaT5rM5IfssG0i7V6tw5BsB00Anp/5ufdlB NpeVmdaJNMIkPu/w5O2i2tYKoIgMI383DxNbE8VDPTUojXdCZ5Bjs5djZw4sB25I 1YlPKtRDI7gii2cThzepUq/1DLMEBaNEDh/xK9Q3ymNTl6fw+Zb3vXsq/3ILPGUS GX/cMno6KSSPJfNWi2irNNPPr931Yg== =2Q54 -----END PGP SIGNATURE----- --Apple-Mail=_3DD21231-53B4-4827-8899-B046AC2C9F66-- From owner-svn-src-all@freebsd.org Sat Dec 14 09:49:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A8581E7E0E; Sat, 14 Dec 2019 09:49:37 +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 47ZjS11g04z4Btb; Sat, 14 Dec 2019 09:49:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3450722CD5; Sat, 14 Dec 2019 09:49:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBE9nbM8075074; Sat, 14 Dec 2019 09:49:37 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBE9naWI075072; Sat, 14 Dec 2019 09:49:36 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201912140949.xBE9naWI075072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 14 Dec 2019 09:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355748 - in stable/12/libexec: rc/rc.d save-entropy X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/12/libexec: rc/rc.d save-entropy X-SVN-Commit-Revision: 355748 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 09:49:37 -0000 Author: delphij Date: Sat Dec 14 09:49:36 2019 New Revision: 355748 URL: https://svnweb.freebsd.org/changeset/base/355748 Log: MFC r345744, r348122, r355247 r345744: random(4): Attempt to persist entropy promptly r348122: save-entropy(8), rc.d/random: Set nodump flag r355247: Reduce disk write load in /usr/libexec/save-entropy. Modified: stable/12/libexec/rc/rc.d/random stable/12/libexec/save-entropy/save-entropy.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.d/random ============================================================================== --- stable/12/libexec/rc/rc.d/random Sat Dec 14 08:28:10 2019 (r355747) +++ stable/12/libexec/rc/rc.d/random Sat Dec 14 09:49:36 2019 (r355748) @@ -25,7 +25,9 @@ save_dev_random() for f ; do debug "saving entropy to $f" dd if=/dev/random of="$f" bs=4096 count=1 status=none && - chmod 600 "$f" + ( chflags nodump "$f" 2>/dev/null || : ) && + chmod 600 "$f" && + fsync "$f" "$(dirname "$f")" done umask ${oumask} } @@ -98,7 +100,7 @@ random_stop() [Nn][Oo]) ;; *) - echo -n 'Writing entropy file:' + echo -n 'Writing entropy file: ' rm -f ${entropy_file} 2> /dev/null oumask=`umask` umask 077 @@ -117,9 +119,7 @@ random_stop() warn 'write failed (read-only fs?)' ;; *) - dd if=/dev/random of=${entropy_file_confirmed} \ - bs=4096 count=1 2> /dev/null || - warn 'write failed (unwriteable file or full fs?)' + save_dev_random "${entropy_file_confirmed}" echo '.' ;; esac @@ -130,7 +130,7 @@ random_stop() [Nn][Oo]) ;; *) - echo -n 'Writing early boot entropy file:' + echo -n 'Writing early boot entropy file: ' rm -f ${entropy_boot_file} 2> /dev/null oumask=`umask` umask 077 @@ -142,9 +142,7 @@ random_stop() warn 'write failed (read-only fs?)' ;; *) - dd if=/dev/random of=${entropy_boot_file_confirmed} \ - bs=4096 count=1 2> /dev/null || - warn 'write failed (unwriteable file or full fs?)' + save_dev_random "${entropy_boot_file_confirmed}" echo '.' ;; esac Modified: stable/12/libexec/save-entropy/save-entropy.sh ============================================================================== --- stable/12/libexec/save-entropy/save-entropy.sh Sat Dec 14 08:28:10 2019 (r355747) +++ stable/12/libexec/save-entropy/save-entropy.sh Sat Dec 14 09:49:36 2019 (r355748) @@ -71,24 +71,63 @@ cd "${entropy_dir}" || { for f in saved-entropy.*; do case "${f}" in saved-entropy.\*) continue ;; esac # No files match - [ ${f#saved-entropy\.} -ge ${entropy_save_num} ] && unlink ${f} + [ ${f#saved-entropy\.} -gt ${entropy_save_num} ] && unlink ${f} done -umask 377 +umask 177 -n=$(( ${entropy_save_num} - 1 )) -while [ ${n} -ge 1 ]; do - if [ -f "saved-entropy.${n}" ]; then - mv "saved-entropy.${n}" "saved-entropy.$(( ${n} + 1 ))" - elif [ -e "saved-entropy.${n}" -o -L "saved-entropy.${n}" ]; then +# Scan slots [1..$entropy_save_num), picking an empty slot or the oldest +# existing file if no empty slot was available. +# +# 1. Find out the first regular file or empty slot (and its serial number) +# +n=1 +while [ ${n} -le ${entropy_save_num} ]; do + save_file="saved-entropy.${n}" + if [ ! -e "${save_file}" -o -f "${save_file}" ]; then + break + else logger -is -t "$0" \ - "${entropy_dir}/saved-entropy.${n}" is not a regular file, and so \ - it will not be rotated. Entropy file rotation is aborted. - exit 1 + "${save_file}" is not a regular file, skipped. fi - n=$(( ${n} - 1 )) + n=$(( ${n} + 1 )) done +# +# 2. Start from (serial number + 1), and check if the slot is empty +# or is an older regular file, update save_file pointer in either +# case, and break early if we found an empty slot. +# +if [ -f ${save_file} ]; then + n=$(( ${n} + 1 )) + while [ ${n} -le ${entropy_save_num} ]; do + next_file=saved-entropy.${n} + if [ -f "${next_file}" ]; then + [ "${next_file}" -ot "${save_file}" ] && \ + save_file="${next_file}" + elif [ ! -e "${next_file}" ]; then + save_file="${next_file}" + break + else + logger -is -t "$0" \ + "${next_file}" is not a regular file, skipped. + fi + n=$(( ${n} + 1 )) + done +fi +# +# 3. Check if the pointer we have in hand is really a regular file or +# an empty slot, and bail out as that means there is no available slot. +# +if [ -e "${save_file}" -a ! -f "${save_file}" ]; then + logger -is -t "$0" \ + No available slot in "${entropy_dir}", save entropy is aborted. + exit 1 +fi -dd if=/dev/random of=saved-entropy.1 bs=${entropy_save_sz} count=1 2>/dev/null +# Save entropy to the selected slot. +chmod 600 "${save_file}" 2>/dev/null || : +dd if=/dev/random of="${save_file}" bs=${entropy_save_sz} count=1 2>/dev/null +chflags nodump "${save_file}" 2>/dev/null || : +fsync "${save_file}" "." exit 0 From owner-svn-src-all@freebsd.org Sat Dec 14 09:54:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A3261C80ED; Sat, 14 Dec 2019 09:54:31 +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 47ZjYg315Qz4CHT; Sat, 14 Dec 2019 09:54:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E47022E90; Sat, 14 Dec 2019 09:54:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBE9sVCx081040; Sat, 14 Dec 2019 09:54:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBE9sVZh081039; Sat, 14 Dec 2019 09:54:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201912140954.xBE9sVZh081039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 14 Dec 2019 09:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r355749 - stable/11/libexec/save-entropy X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/libexec/save-entropy X-SVN-Commit-Revision: 355749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 09:54:31 -0000 Author: delphij Date: Sat Dec 14 09:54:30 2019 New Revision: 355749 URL: https://svnweb.freebsd.org/changeset/base/355749 Log: MFC r355247: Reduce disk write load in /usr/libexec/save-entropy. Modified: stable/11/libexec/save-entropy/save-entropy.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/save-entropy/save-entropy.sh ============================================================================== --- stable/11/libexec/save-entropy/save-entropy.sh Sat Dec 14 09:49:36 2019 (r355748) +++ stable/11/libexec/save-entropy/save-entropy.sh Sat Dec 14 09:54:30 2019 (r355749) @@ -69,24 +69,61 @@ cd "${entropy_dir}" || { for f in saved-entropy.*; do case "${f}" in saved-entropy.\*) continue ;; esac # No files match - [ ${f#saved-entropy\.} -ge ${entropy_save_num} ] && unlink ${f} + [ ${f#saved-entropy\.} -gt ${entropy_save_num} ] && unlink ${f} done -umask 377 +umask 177 -n=$(( ${entropy_save_num} - 1 )) -while [ ${n} -ge 1 ]; do - if [ -f "saved-entropy.${n}" ]; then - mv "saved-entropy.${n}" "saved-entropy.$(( ${n} + 1 ))" - elif [ -e "saved-entropy.${n}" -o -L "saved-entropy.${n}" ]; then +# Scan slots [1..$entropy_save_num), picking an empty slot or the oldest +# existing file if no empty slot was available. +# +# 1. Find out the first regular file or empty slot (and its serial number) +# +n=1 +while [ ${n} -le ${entropy_save_num} ]; do + save_file="saved-entropy.${n}" + if [ ! -e "${save_file}" -o -f "${save_file}" ]; then + break + else logger -is -t "$0" \ - "${entropy_dir}/saved-entropy.${n}" is not a regular file, and so \ - it will not be rotated. Entropy file rotation is aborted. - exit 1 + "${save_file}" is not a regular file, skipped. fi - n=$(( ${n} - 1 )) + n=$(( ${n} + 1 )) done +# +# 2. Start from (serial number + 1), and check if the slot is empty +# or is an older regular file, update save_file pointer in either +# case, and break early if we found an empty slot. +# +if [ -f ${save_file} ]; then + n=$(( ${n} + 1 )) + while [ ${n} -le ${entropy_save_num} ]; do + next_file=saved-entropy.${n} + if [ -f "${next_file}" ]; then + [ "${next_file}" -ot "${save_file}" ] && \ + save_file="${next_file}" + elif [ ! -e "${next_file}" ]; then + save_file="${next_file}" + break + else + logger -is -t "$0" \ + "${next_file}" is not a regular file, skipped. + fi + n=$(( ${n} + 1 )) + done +fi +# +# 3. Check if the pointer we have in hand is really a regular file or +# an empty slot, and bail out as that means there is no available slot. +# +if [ -e "${save_file}" -a ! -f "${save_file}" ]; then + logger -is -t "$0" \ + No available slot in "${entropy_dir}", save entropy is aborted. + exit 1 +fi -dd if=/dev/random of=saved-entropy.1 bs=${entropy_save_sz} count=1 2>/dev/null +# Save entropy to the selected slot. +chmod 600 "${save_file}" 2>/dev/null || : +dd if=/dev/random of="${save_file}" bs=${entropy_save_sz} count=1 2>/dev/null exit 0 From owner-svn-src-all@freebsd.org Sat Dec 14 10:53:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D32AC1C95F7; Sat, 14 Dec 2019 10:53:53 +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 47Zkt95GWzz4FTZ; Sat, 14 Dec 2019 10:53:53 +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 B00122396C; Sat, 14 Dec 2019 10:53:53 +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 xBEArrsr015755; Sat, 14 Dec 2019 10:53:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBEArrUq015753; Sat, 14 Dec 2019 10:53:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201912141053.xBEArrUq015753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 14 Dec 2019 10:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355750 - in head: contrib/netcat usr.bin/nc X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: contrib/netcat usr.bin/nc X-SVN-Commit-Revision: 355750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 10:53:53 -0000 Author: trasz Date: Sat Dec 14 10:53:52 2019 New Revision: 355750 URL: https://svnweb.freebsd.org/changeset/base/355750 Log: Add -M option to nc(1), which makes it print the TCP connection statistics obtained with stats(3) in JSON format to standard error. Reviewed by: allanjude, thj, cem (earlier version) Tested by: thj MFC after: 2 weeks Relnotes: yes Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D21324 Modified: head/contrib/netcat/nc.1 head/contrib/netcat/netcat.c head/usr.bin/nc/Makefile Modified: head/contrib/netcat/nc.1 ============================================================================== --- head/contrib/netcat/nc.1 Sat Dec 14 09:54:30 2019 (r355749) +++ head/contrib/netcat/nc.1 Sat Dec 14 10:53:52 2019 (r355750) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 26, 2015 +.Dd August 20, 2019 .Dt NC 1 .Os .Sh NAME @@ -36,7 +36,7 @@ .Sh SYNOPSIS .Nm nc .Bk -words -.Op Fl 46DdEFhklNnrStUuvz +.Op Fl 46DdEFhklMNnrStUuvz .Op Fl e Ar IPsec_policy .Op Fl I Ar length .Op Fl i Ar interval @@ -170,6 +170,12 @@ options. Additionally, any timeouts specified with the .Fl w option are ignored. +.It Fl M +Collect per-connection TCP statistics using the +.Xr stats 3 +framework and print them in JSON format to +.Xr stderr 4 +after the connection is closed. .It Fl N .Xr shutdown 2 the network socket after EOF on the input. Modified: head/contrib/netcat/netcat.c ============================================================================== --- head/contrib/netcat/netcat.c Sat Dec 14 09:54:30 2019 (r355749) +++ head/contrib/netcat/netcat.c Sat Dec 14 10:53:52 2019 (r355750) @@ -33,10 +33,16 @@ * *Hobbit* . */ +#include +#include +#include #include #include +#include #include #include +#include +#include #include #include #include @@ -50,7 +56,6 @@ #include #include -#include #include #include #include @@ -58,7 +63,6 @@ #include #include #include -#include #include #include #include @@ -85,6 +89,7 @@ int Fflag; /* fdpass sock to stdout */ unsigned int iflag; /* Interval Flag */ int kflag; /* More than one connect */ int lflag; /* Bind to local port */ +int FreeBSD_Mflag; /* Measure using stats(3) */ int Nflag; /* shutdown() network socket */ int nflag; /* Don't do name look up */ int FreeBSD_Oflag; /* Do not use TCP options */ @@ -123,6 +128,8 @@ int udptest(int); int unix_bind(char *); int unix_connect(char *); int unix_listen(char *); +void FreeBSD_stats_setup(int); +void FreeBSD_stats_print(int); void set_common_sockopts(int, int); int map_tos(char *, int *); void report_connect(const struct sockaddr *, socklen_t); @@ -167,7 +174,7 @@ main(int argc, char *argv[]) signal(SIGPIPE, SIG_IGN); while ((ch = getopt_long(argc, argv, - "46DdEe:FhI:i:klNnoO:P:p:rSs:tT:UuV:vw:X:x:z", + "46DdEe:FhI:i:klMNnoO:P:p:rSs:tT:UuV:vw:X:x:z", longopts, NULL)) != -1) { switch (ch) { case '4': @@ -224,6 +231,13 @@ main(int argc, char *argv[]) case 'l': lflag = 1; break; + case 'M': +#ifndef WITH_STATS + errx(1, "-M requires stats(3) support"); +#else + FreeBSD_Mflag = 1; +#endif + break; case 'N': Nflag = 1; break; @@ -451,6 +465,8 @@ main(int argc, char *argv[]) if (vflag) report_connect((struct sockaddr *)&cliaddr, len); + if (FreeBSD_Mflag) + FreeBSD_stats_setup(connfd); readwrite(connfd); close(connfd); } @@ -801,6 +817,7 @@ readwrite(int net_fd) unsigned char stdinbuf[BUFSIZE]; size_t stdinbufpos = 0; int n, num_fds; + int stats_printed = 0; ssize_t ret; /* don't read from stdin if requested */ @@ -827,17 +844,23 @@ readwrite(int net_fd) /* both inputs are gone, buffers are empty, we are done */ if (pfd[POLL_STDIN].fd == -1 && pfd[POLL_NETIN].fd == -1 && stdinbufpos == 0 && netinbufpos == 0) { + if (FreeBSD_Mflag && !stats_printed) + FreeBSD_stats_print(net_fd); close(net_fd); return; } /* both outputs are gone, we can't continue */ if (pfd[POLL_NETOUT].fd == -1 && pfd[POLL_STDOUT].fd == -1) { + if (FreeBSD_Mflag && !stats_printed) + FreeBSD_stats_print(net_fd); close(net_fd); return; } /* listen and net in gone, queues empty, done */ if (lflag && pfd[POLL_NETIN].fd == -1 && stdinbufpos == 0 && netinbufpos == 0) { + if (FreeBSD_Mflag && !stats_printed) + FreeBSD_stats_print(net_fd); close(net_fd); return; } @@ -858,8 +881,11 @@ readwrite(int net_fd) } /* timeout happened */ - if (num_fds == 0) + if (num_fds == 0) { + if (FreeBSD_Mflag) + FreeBSD_stats_print(net_fd); return; + } /* treat socket error conditions */ for (n = 0; n < 4; n++) { @@ -961,8 +987,13 @@ readwrite(int net_fd) /* stdin gone and queue empty? */ if (pfd[POLL_STDIN].fd == -1 && stdinbufpos == 0) { - if (pfd[POLL_NETOUT].fd != -1 && Nflag) + if (pfd[POLL_NETOUT].fd != -1 && Nflag) { + if (FreeBSD_Mflag) { + FreeBSD_stats_print(net_fd); + stats_printed = 1; + } shutdown(pfd[POLL_NETOUT].fd, SHUT_WR); + } pfd[POLL_NETOUT].fd = -1; } /* net in gone and queue empty? */ @@ -1181,6 +1212,67 @@ udptest(int s) } void +FreeBSD_stats_setup(int s) +{ + + if (setsockopt(s, IPPROTO_TCP, TCP_STATS, + &FreeBSD_Mflag, sizeof(FreeBSD_Mflag)) == -1) { + if (errno == EOPNOTSUPP) { + warnx("getsockopt(TCP_STATS) failed; " + "kernel built without \"options STATS\"?"); + } + err(1, "enable TCP_STATS gathering"); + } +} + +void +FreeBSD_stats_print(int s) +{ +#ifdef WITH_STATS + struct statsblob *statsb; + struct sbuf *sb; + socklen_t sockoptlen; + int error; + + /* + * This usleep is a workaround for TCP_STATS reporting + * incorrect values for TXPB. + */ + usleep(100000); + + sockoptlen = 2048; + statsb = malloc(sockoptlen); + if (statsb == NULL) + err(1, "malloc"); + error = getsockopt(s, IPPROTO_TCP, TCP_STATS, statsb, &sockoptlen); + if (error != 0) { + if (errno == EOVERFLOW && statsb->cursz > sockoptlen) { + /* Retry with a larger size. */ + sockoptlen = statsb->cursz; + statsb = realloc(statsb, sockoptlen); + if (statsb == NULL) + err(1, "realloc"); + error = getsockopt(s, IPPROTO_TCP, TCP_STATS, + statsb, &sockoptlen); + } + if (error != 0) + err(1, "getsockopt"); + } + + sb = sbuf_new_auto(); + error = stats_blob_tostr(statsb, sb, SB_STRFMT_JSON, SB_TOSTR_META); + if (error != 0) + errc(1, error, "stats_blob_tostr"); + + error = sbuf_finish(sb); + if (error != 0) + err(1, "sbuf_finish"); + + fprintf(stderr, "%s\n", sbuf_data(sb)); +#endif +} + +void set_common_sockopts(int s, int af) { int x = 1; @@ -1224,6 +1316,8 @@ set_common_sockopts(int s, int af) &FreeBSD_Oflag, sizeof(FreeBSD_Oflag)) == -1) err(1, "disable TCP options"); } + if (FreeBSD_Mflag) + FreeBSD_stats_setup(s); #ifdef IPSEC if (ipsec_policy[0] != NULL) add_ipsec_policy(s, af, ipsec_policy[0]); Modified: head/usr.bin/nc/Makefile ============================================================================== --- head/usr.bin/nc/Makefile Sat Dec 14 09:54:30 2019 (r355749) +++ head/usr.bin/nc/Makefile Sat Dec 14 10:53:52 2019 (r355750) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .PATH: ${SRCTOP}/contrib/netcat PROG= nc @@ -7,6 +9,11 @@ SRCS= netcat.c atomicio.c socks.c CFLAGS+=-DIPSEC LIBADD= ipsec + +.if ${MK_STATS} != "no" && !defined(RESCUE) +LIBADD+= sbuf stats +CFLAGS+= -DWITH_STATS +.endif WARNS?= 2 From owner-svn-src-all@freebsd.org Sat Dec 14 10:58:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B9EC1C973E; Sat, 14 Dec 2019 10:58:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47Zkz31m8Yz4FkD; Sat, 14 Dec 2019 10:58:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3725723987; Sat, 14 Dec 2019 10:58:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBEAw7h4016159; Sat, 14 Dec 2019 10:58:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBEAw6j0016157; Sat, 14 Dec 2019 10:58:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201912141058.xBEAw6j0016157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 14 Dec 2019 10:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355751 - head/usr.sbin/sesutil X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/sesutil X-SVN-Commit-Revision: 355751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 10:58:07 -0000 Author: trasz Date: Sat Dec 14 10:58:06 2019 New Revision: 355751 URL: https://svnweb.freebsd.org/changeset/base/355751 Log: Add 'sesutil show' subcommand to show enclosure and its contents in a user-friendly way. Reviewed by: allanjude, bcr (manpages) MFC after: 2 weeks Relnotes: yes Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D22567 Modified: head/usr.sbin/sesutil/sesutil.8 head/usr.sbin/sesutil/sesutil.c Modified: head/usr.sbin/sesutil/sesutil.8 ============================================================================== --- head/usr.sbin/sesutil/sesutil.8 Sat Dec 14 10:53:52 2019 (r355750) +++ head/usr.sbin/sesutil/sesutil.8 Sat Dec 14 10:58:06 2019 (r355751) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 29, 2017 +.Dd December 12, 2019 .Dt SESUTIL 8 .Os .Sh NAME @@ -46,6 +46,10 @@ .Op Fl -libxo Ar options .Op Fl u Ar /dev/sesN .Nm +.Cm show +.Op Fl -libxo Ar options +.Op Fl u Ar /dev/sesN +.Nm .Cm status .Op Fl -libxo Ar options .Op Fl u Ar /dev/sesN @@ -97,6 +101,11 @@ must be the element ID of a valid item attached to the Use the .Cm map command to list the elements attached to a controller. +.It Cm show Op Fl u Ar /dev/sesN +Display user-friendly summary of specified +.Xr ses 4 +controller. +If no controller is specified, all controllers are mapped. .It Cm map Op Fl u Ar /dev/sesN Display a map of all elements connected to the specified .Xr ses 4 Modified: head/usr.sbin/sesutil/sesutil.c ============================================================================== --- head/usr.sbin/sesutil/sesutil.c Sat Dec 14 10:53:52 2019 (r355750) +++ head/usr.sbin/sesutil/sesutil.c Sat Dec 14 10:58:06 2019 (r355751) @@ -1,9 +1,13 @@ /*- + * Copyright (c) 2019 Klara Inc. * Copyright (c) 2015 Baptiste Daroussin * Copyright (c) 2015 Allan Jude * Copyright (c) 2000 by Matthew Jacob * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * under sponsorship from Klara Inc. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -31,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -54,12 +59,20 @@ __FBSDID("$FreeBSD$"); #define SESUTIL_XO_VERSION "1" +#define TEMPERATURE_OFFSET 20 + +#define PRINT_STYLE_DASHED 0 +#define PRINT_STYLE_DASHED_2 1 +#define PRINT_STYLE_CSV 2 +#define PRINT_STYLE_CSV_2 3 + static int encstatus(int argc, char **argv); static int fault(int argc, char **argv); static int locate(int argc, char **argv); static int objmap(int argc, char **argv); static int sesled(int argc, char **argv, bool fault); -static void sesutil_print(bool *title, const char *fmt, ...) __printflike(2,3); +static int show(int argc, char **argv); +static void sesutil_print(int *style, const char *fmt, ...) __printflike(2,3); static struct command { const char *name; @@ -77,6 +90,8 @@ static struct command { locate }, { "map", "", "Print a map of the devices managed by the enclosure", objmap } , + { "show", "", + "Print a human-friendly summary of the enclosure", show } , { "status", "", "Print the status of the enclosure", encstatus }, }; @@ -313,64 +328,72 @@ fault(int argc, char **argv) return (sesled(argc, argv, true)); } -#define TEMPERATURE_OFFSET 20 static void -sesutil_print(bool *title, const char *fmt, ...) +sesutil_print(int *style, const char *fmt, ...) { va_list args; - if (!*title) { + if (*style == PRINT_STYLE_DASHED) { xo_open_container("extra_status"); xo_emit("\t\tExtra status:\n"); - *title = true; + *style = PRINT_STYLE_DASHED_2; + } else if (*style == PRINT_STYLE_CSV) { + xo_open_container("extra_status"); + *style = PRINT_STYLE_CSV_2; } + + if (*style == PRINT_STYLE_DASHED_2) + xo_emit("\t\t- "); + else if (*style == PRINT_STYLE_CSV_2) + xo_emit(", "); va_start(args, fmt); xo_emit_hv(NULL, fmt, args); va_end(args); + if (*style == PRINT_STYLE_DASHED_2) + xo_emit("\n"); } static void -print_extra_status(int eletype, u_char *cstat) +print_extra_status(int eletype, u_char *cstat, int style) { - bool title = false; if (cstat[0] & 0x40) { - sesutil_print(&title, "\t\t-{e:predicted_failure/true} Predicted Failure\n"); + sesutil_print(&style, "{e:predicted_failure/true} Predicted Failure"); } if (cstat[0] & 0x20) { - sesutil_print(&title, "\t\t-{e:disabled/true} Disabled\n"); + sesutil_print(&style, "{e:disabled/true} Disabled"); } if (cstat[0] & 0x10) { - sesutil_print(&title, "\t\t-{e:swapped/true} Swapped\n"); + sesutil_print(&style, "{e:swapped/true} Swapped"); } switch (eletype) { case ELMTYP_DEVICE: case ELMTYP_ARRAY_DEV: if (cstat[2] & 0x02) { - sesutil_print(&title, "\t\t- LED={q:led/locate}\n"); + sesutil_print(&style, "LED={q:led/locate}"); } if (cstat[2] & 0x20) { - sesutil_print(&title, "\t\t- LED={q:led/fault}\n"); + sesutil_print(&style, "LED={q:led/fault}"); } break; case ELMTYP_FAN: - sesutil_print(&title, "\t\t- Speed: {:speed/%d}{Uw:rpm}\n", + sesutil_print(&style, "Speed: {:speed/%d}{Uw:rpm}", (((0x7 & cstat[1]) << 8) + cstat[2]) * 10); break; case ELMTYP_THERM: if (cstat[2]) { - sesutil_print(&title, "\t\t- Temperature: {:temperature/%d}{Uw:C}\n", + sesutil_print(&style, "Temperature: {:temperature/%d}{Uw:C}", cstat[2] - TEMPERATURE_OFFSET); } else { - sesutil_print(&title, "\t\t- Temperature: -{q:temperature/reserved}-\n"); + sesutil_print(&style, "Temperature: -{q:temperature/reserved}"); } break; case ELMTYP_VOM: - sesutil_print(&title, "\t\t- Voltage: {:voltage/%.2f}{Uw:V}\n", + sesutil_print(&style, "Voltage: {:voltage/%.2f}{Uw:V}", be16dec(cstat + 2) / 100.0); break; } - if (title) { + if (style) { xo_close_container("extra_status"); } } @@ -499,10 +522,337 @@ objmap(int argc, char **argv __unused) xo_emit("\t\tDevice Names: {:device_names/%s}\n", e_devname.elm_devnames); } - print_extra_status(e_ptr[j].elm_type, e_status.cstat); + print_extra_status(e_ptr[j].elm_type, e_status.cstat, PRINT_STYLE_DASHED); xo_close_instance("elements"); free(e_devname.elm_devnames); } + xo_close_list("elements"); + free(e_ptr); + close(fd); + } + globfree(&g); + xo_close_list("enclosures"); + xo_close_container("sesutil"); + xo_finish(); + + return (EXIT_SUCCESS); +} + +/* + * Get rid of the 'passN' devices, unless there's nothing else to show. + */ +static void +skip_pass_devices(char *devnames, size_t devnameslen) +{ + char *dev, devs[128], passes[128], *tmp; + + devs[0] = passes[0] = '\0'; + tmp = devnames; + + while ((dev = strsep(&tmp, ",")) != NULL) { + if (strncmp(dev, "pass", 4) == 0) { + if (passes[0] != '\0') + strlcat(passes, ",", sizeof(passes)); + strlcat(passes, dev, sizeof(passes)); + } else { + if (devs[0] != '\0') + strlcat(devs, ",", sizeof(devs)); + strlcat(devs, dev, sizeof(devs)); + } + } + strlcpy(devnames, devs, devnameslen); + if (devnames[0] == '\0') + strlcpy(devnames, passes, devnameslen); +} + +static void +fetch_device_details(char *devnames, char **model, char **serial, off_t *size) +{ + char ident[DISK_IDENT_SIZE]; + struct diocgattr_arg arg; + char *device, *tmp; + off_t mediasize; + int fd; + + tmp = strdup(devnames); + if (tmp == NULL) + err(1, "strdup"); + + device = strsep(&tmp, ","); + asprintf(&tmp, "/dev/%s", device); + fd = open(tmp, O_RDONLY); + if (fd < 0) { + /* + * This can happen with a disk so broken it cannot + * be probed by GEOM. + */ + *model = strdup("?"); + *serial = strdup("?"); + *size = -1; + return; + } + + strlcpy(arg.name, "GEOM::descr", sizeof(arg.name)); + arg.len = sizeof(arg.value.str); + if (ioctl(fd, DIOCGATTR, &arg) == 0) + *model = strdup(arg.value.str); + else + *model = NULL; + + if (ioctl(fd, DIOCGIDENT, ident) == 0) + *serial = strdup(ident); + else + *serial = NULL; + + if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) == 0) + *size = mediasize; + else + *size = -1; +} + +static void +show_device(int fd, int elm_idx, encioc_elm_status_t e_status, encioc_elm_desc_t e_desc) +{ + encioc_elm_devnames_t e_devname; + char *model, *serial; + off_t size; + + /* Get the device name(s) of the element */ + memset(&e_devname, 0, sizeof(e_devname)); + e_devname.elm_idx = elm_idx; + e_devname.elm_names_size = 128; + e_devname.elm_devnames = calloc(128, sizeof(char)); + if (e_devname.elm_devnames == NULL) { + close(fd); + xo_err(EXIT_FAILURE, "calloc()"); + } + + if (ioctl(fd, ENCIOC_GETELMDEVNAMES, + (caddr_t) &e_devname) < 0) { + /* We don't care if this fails */ + e_devname.elm_devnames[0] = '\0'; + model = NULL; + serial = NULL; + size = -1; + } else { + skip_pass_devices(e_devname.elm_devnames, 128); + fetch_device_details(e_devname.elm_devnames, &model, &serial, &size); + } + xo_open_instance("elements"); + xo_emit("{e:type/device_slot}"); + xo_emit("{d:description/%-8s} ", e_desc.elm_desc_len > 0 ? e_desc.elm_desc_str : "-"); + xo_emit("{e:description/%-8s}", e_desc.elm_desc_len > 0 ? e_desc.elm_desc_str : ""); + xo_emit("{d:device_names/%-7s} ", e_devname.elm_names_len > 0 ? e_devname.elm_devnames : "-"); + xo_emit("{e:device_names/%s}", e_devname.elm_names_len > 0 ? e_devname.elm_devnames : ""); + xo_emit("{d:model/%-25s} ", model ? model : "-"); + xo_emit("{e:model/%s}", model ? model : ""); + xo_emit("{d:serial/%-20s} ", serial != NULL ? serial : "-"); + xo_emit("{e:serial/%s}", serial != NULL ? serial : ""); + if (e_status.cstat[0] == SES_OBJSTAT_OK && size >= 0) { + xo_emit("{h,hn-1000:size/%ld}{e:status/%s}", + size, scode2ascii(e_status.cstat[0])); + } else { + xo_emit("{:status/%s}", scode2ascii(e_status.cstat[0])); + } + print_extra_status(ELMTYP_ARRAY_DEV, e_status.cstat, PRINT_STYLE_CSV); + xo_emit("\n"); + xo_close_instance("elements"); + free(e_devname.elm_devnames); +} + +static void +show_therm(encioc_elm_status_t e_status, encioc_elm_desc_t e_desc) +{ + + if (e_desc.elm_desc_len <= 0) { + /* We don't have a label to display; might as well skip it. */ + return; + } + + if (e_status.cstat[2] == 0) { + /* No temperature to show. */ + return; + } + + xo_open_instance("elements"); + xo_emit("{e:type/temperature_sensor}"); + xo_emit("{:description/%s}: {:temperature/%d}{Uw:C}", + e_desc.elm_desc_str, e_status.cstat[2] - TEMPERATURE_OFFSET); + xo_close_instance("elements"); +} + +static void +show_vom(encioc_elm_status_t e_status, encioc_elm_desc_t e_desc) +{ + + if (e_desc.elm_desc_len <= 0) { + /* We don't have a label to display; might as well skip it. */ + return; + } + + if (e_status.cstat[2] == 0) { + /* No voltage to show. */ + return; + } + + xo_open_instance("elements"); + xo_emit("{e:type/voltage_sensor}"); + xo_emit("{:description/%s}: {:voltage/%.2f}{Uw:V}", + e_desc.elm_desc_str, be16dec(e_status.cstat + 2) / 100.0); + xo_close_instance("elements"); +} + +static int +show(int argc, char **argv __unused) +{ + encioc_string_t stri; + encioc_elm_status_t e_status; + encioc_elm_desc_t e_desc; + encioc_element_t *e_ptr; + glob_t g; + elm_type_t prev_type; + int fd; + unsigned int j, nobj; + size_t i; + bool first_ses; + char str[32]; + + if (argc != 1) { + usage(stderr, "map"); + } + + first_ses = true; + + /* Get the list of ses devices */ + if (glob(uflag, 0, NULL, &g) == GLOB_NOMATCH) { + globfree(&g); + xo_errx(EXIT_FAILURE, "No SES devices found"); + } + xo_set_version(SESUTIL_XO_VERSION); + xo_open_container("sesutil"); + xo_open_list("enclosures"); + for (i = 0; i < g.gl_pathc; i++) { + /* ensure we only got numbers after ses */ + if (strspn(g.gl_pathv[i] + 8, "0123456789") != + strlen(g.gl_pathv[i] + 8)) { + continue; + } + if ((fd = open(g.gl_pathv[i], O_RDWR)) < 0) { + /* + * Don't treat non-access errors as critical if we are + * accessing all devices + */ + if (errno == EACCES && g.gl_pathc > 1) { + xo_err(EXIT_FAILURE, "unable to access SES device"); + } + xo_warn("unable to access SES device: %s", g.gl_pathv[i]); + continue; + } + + if (ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj) < 0) { + close(fd); + xo_err(EXIT_FAILURE, "ENCIOC_GETNELM"); + } + + e_ptr = calloc(nobj, sizeof(encioc_element_t)); + if (e_ptr == NULL) { + close(fd); + xo_err(EXIT_FAILURE, "calloc()"); + } + + if (ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) e_ptr) < 0) { + close(fd); + xo_err(EXIT_FAILURE, "ENCIOC_GETELMMAP"); + } + + xo_open_instance("enclosures"); + + if (first_ses) + first_ses = false; + else + xo_emit("\n"); + + xo_emit("{t:enc/%s}: ", g.gl_pathv[i] + 5); + stri.bufsiz = sizeof(str); + stri.buf = &str[0]; + if (ioctl(fd, ENCIOC_GETENCNAME, (caddr_t) &stri) == 0) + xo_emit("<{t:name/%s}>; ", stri.buf); + stri.bufsiz = sizeof(str); + stri.buf = &str[0]; + if (ioctl(fd, ENCIOC_GETENCID, (caddr_t) &stri) == 0) + xo_emit("ID: {t:id/%s}", stri.buf); + xo_emit("\n"); + + xo_open_list("elements"); + prev_type = -1; + for (j = 0; j < nobj; j++) { + /* Get the status of the element */ + memset(&e_status, 0, sizeof(e_status)); + e_status.elm_idx = e_ptr[j].elm_idx; + if (ioctl(fd, ENCIOC_GETELMSTAT, + (caddr_t) &e_status) < 0) { + close(fd); + xo_err(EXIT_FAILURE, "ENCIOC_GETELMSTAT"); + } + + /* + * Skip "Unsupported" elements; those usually precede + * the actual device entries and are not particularly + * interesting. + */ + if (e_status.cstat[0] == SES_OBJSTAT_UNSUPPORTED) + continue; + + /* Get the description of the element */ + memset(&e_desc, 0, sizeof(e_desc)); + e_desc.elm_idx = e_ptr[j].elm_idx; + e_desc.elm_desc_len = UINT16_MAX; + e_desc.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); + if (e_desc.elm_desc_str == NULL) { + close(fd); + xo_err(EXIT_FAILURE, "calloc()"); + } + if (ioctl(fd, ENCIOC_GETELMDESC, + (caddr_t) &e_desc) < 0) { + close(fd); + xo_err(EXIT_FAILURE, "ENCIOC_GETELMDESC"); + } + + switch (e_ptr[j].elm_type) { + case ELMTYP_DEVICE: + case ELMTYP_ARRAY_DEV: + if (e_ptr[j].elm_type != prev_type) + xo_emit("Desc Dev Model Ident Size/Status\n"); + + show_device(fd, e_ptr[j].elm_idx, e_status, e_desc); + prev_type = e_ptr[j].elm_type; + break; + case ELMTYP_THERM: + if (e_ptr[j].elm_type != prev_type) + xo_emit("\nVoltages: "); + else + xo_emit(", "); + prev_type = e_ptr[j].elm_type; + show_therm(e_status, e_desc); + break; + case ELMTYP_VOM: + if (e_ptr[j].elm_type != prev_type) + xo_emit("\nTemperatures: "); + else + xo_emit(", "); + prev_type = e_ptr[j].elm_type; + show_vom(e_status, e_desc); + break; + default: + /* + * Ignore stuff not interesting to the user. + */ + break; + } + } + if (prev_type != (elm_type_t)-1 && + prev_type != ELMTYP_DEVICE && prev_type != ELMTYP_ARRAY_DEV) + xo_emit("\n"); xo_close_list("elements"); free(e_ptr); close(fd); From owner-svn-src-all@freebsd.org Sat Dec 14 13:30:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 508951CDFEE; Sat, 14 Dec 2019 13:30:45 +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 47ZpM90Pr9z4NWH; Sat, 14 Dec 2019 13:30:45 +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 09680254EE; Sat, 14 Dec 2019 13:30:45 +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 xBEDUiot006473; Sat, 14 Dec 2019 13:30:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBEDUhu7006467; Sat, 14 Dec 2019 13:30:43 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201912141330.xBEDUhu7006467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 14 Dec 2019 13:30:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355752 - in head/sys: amd64/linux amd64/linux32 arm/linux arm64/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm/linux arm64/linux i386/linux X-SVN-Commit-Revision: 355752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 13:30:45 -0000 Author: trasz Date: Sat Dec 14 13:30:43 2019 New Revision: 355752 URL: https://svnweb.freebsd.org/changeset/base/355752 Log: Fix definitions for linuxulator's sync_file_range(2). Reviewed by: brooks, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22371 Modified: head/sys/amd64/linux/syscalls.master head/sys/amd64/linux32/syscalls.master head/sys/arm/linux/syscalls.master head/sys/arm64/linux/syscalls.master head/sys/i386/linux/syscalls.master Modified: head/sys/amd64/linux/syscalls.master ============================================================================== --- head/sys/amd64/linux/syscalls.master Sat Dec 14 10:58:06 2019 (r355751) +++ head/sys/amd64/linux/syscalls.master Sat Dec 14 13:30:43 2019 (r355752) @@ -467,7 +467,8 @@ struct linux_robust_list_head **head, l_size_t *len); } 275 AUE_NULL STD { int linux_splice(void); } 276 AUE_NULL STD { int linux_tee(void); } -277 AUE_NULL STD { int linux_sync_file_range(void); } +277 AUE_NULL STD { int linux_sync_file_range(l_int fd, l_loff_t offset, + l_loff_t nbytes, unsigned int flags); } 278 AUE_NULL STD { int linux_vmsplice(void); } 279 AUE_NULL STD { int linux_move_pages(void); } 280 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Sat Dec 14 10:58:06 2019 (r355751) +++ head/sys/amd64/linux32/syscalls.master Sat Dec 14 13:30:43 2019 (r355752) @@ -524,7 +524,8 @@ 312 AUE_NULL STD { int linux_get_robust_list(l_int pid, \ struct linux_robust_list_head **head, l_size_t *len); } 313 AUE_NULL STD { int linux_splice(void); } -314 AUE_NULL STD { int linux_sync_file_range(void); } +314 AUE_NULL STD { int linux_sync_file_range(l_int fd, l_loff_t offset, + l_loff_t nbytes, unsigned int flags); } 315 AUE_NULL STD { int linux_tee(void); } 316 AUE_NULL STD { int linux_vmsplice(void); } ; Linux 2.6.18: Modified: head/sys/arm/linux/syscalls.master ============================================================================== --- head/sys/arm/linux/syscalls.master Sat Dec 14 10:58:06 2019 (r355751) +++ head/sys/arm/linux/syscalls.master Sat Dec 14 13:30:43 2019 (r355752) @@ -1692,7 +1692,12 @@ int linux_splice(void); } 341 AUE_NULL STD { - int linux_sync_file_range(void); + int linux_sync_file_range( + l_int fd, + l_loff_t offset, + l_loff_t nbytes, + unsigned int flags + ); } 342 AUE_NULL STD { int linux_tee(void); Modified: head/sys/arm64/linux/syscalls.master ============================================================================== --- head/sys/arm64/linux/syscalls.master Sat Dec 14 10:58:06 2019 (r355751) +++ head/sys/arm64/linux/syscalls.master Sat Dec 14 13:30:43 2019 (r355752) @@ -450,7 +450,12 @@ l_uint fd); } 84 AUE_NULL STD { - int linux_sync_file_range(void); + int linux_sync_file_range( + l_int fd, + l_loff_t offset, + l_loff_t nbytes, + unsigned int flags + ); } 85 AUE_NULL STD { int linux_timerfd_create( Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Sat Dec 14 10:58:06 2019 (r355751) +++ head/sys/i386/linux/syscalls.master Sat Dec 14 13:30:43 2019 (r355752) @@ -533,7 +533,8 @@ 312 AUE_NULL STD { int linux_get_robust_list(l_int pid, \ struct linux_robust_list_head **head, l_size_t *len); } 313 AUE_NULL STD { int linux_splice(void); } -314 AUE_NULL STD { int linux_sync_file_range(void); } +314 AUE_NULL STD { int linux_sync_file_range(l_int fd, l_loff_t offset, + l_loff_t nbytes, unsigned int flags); } 315 AUE_NULL STD { int linux_tee(void); } 316 AUE_NULL STD { int linux_vmsplice(void); } ; Linux 2.6.18: From owner-svn-src-all@freebsd.org Sat Dec 14 13:32:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7AC71CE2EE; Sat, 14 Dec 2019 13:32:40 +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 47ZpPN66pxz4NxN; Sat, 14 Dec 2019 13:32:40 +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 CD26C25691; Sat, 14 Dec 2019 13:32:40 +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 xBEDWemd010502; Sat, 14 Dec 2019 13:32:40 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBEDWbil010482; Sat, 14 Dec 2019 13:32:37 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201912141332.xBEDWbil010482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 14 Dec 2019 13:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355753 - in head/sys: amd64/linux amd64/linux32 arm/linux arm64/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm/linux arm64/linux i386/linux X-SVN-Commit-Revision: 355753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 13:32:40 -0000 Author: trasz Date: Sat Dec 14 13:32:37 2019 New Revision: 355753 URL: https://svnweb.freebsd.org/changeset/base/355753 Log: Regen after r355752. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22371 Modified: head/sys/amd64/linux/linux_proto.h head/sys/amd64/linux/linux_sysent.c head/sys/amd64/linux/linux_systrace_args.c head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_sysent.c head/sys/amd64/linux32/linux32_systrace_args.c head/sys/arm/linux/linux_proto.h head/sys/arm/linux/linux_sysent.c head/sys/arm/linux/linux_systrace_args.c head/sys/arm64/linux/linux_proto.h head/sys/arm64/linux/linux_sysent.c head/sys/arm64/linux/linux_systrace_args.c head/sys/i386/linux/linux_proto.h head/sys/i386/linux/linux_sysent.c head/sys/i386/linux/linux_systrace_args.c Modified: head/sys/amd64/linux/linux_proto.h ============================================================================== --- head/sys/amd64/linux/linux_proto.h Sat Dec 14 13:30:43 2019 (r355752) +++ head/sys/amd64/linux/linux_proto.h Sat Dec 14 13:32:37 2019 (r355753) @@ -940,7 +940,10 @@ struct linux_tee_args { register_t dummy; }; struct linux_sync_file_range_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char nbytes_l_[PADL_(l_loff_t)]; l_loff_t nbytes; char nbytes_r_[PADR_(l_loff_t)]; + char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)]; }; struct linux_vmsplice_args { register_t dummy; Modified: head/sys/amd64/linux/linux_sysent.c ============================================================================== --- head/sys/amd64/linux/linux_sysent.c Sat Dec 14 13:30:43 2019 (r355752) +++ head/sys/amd64/linux/linux_sysent.c Sat Dec 14 13:32:37 2019 (r355753) @@ -294,7 +294,7 @@ struct sysent linux_sysent[] = { { AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 274 = linux_get_robust_list */ { 0, (sy_call_t *)linux_splice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 275 = linux_splice */ { 0, (sy_call_t *)linux_tee, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 276 = linux_tee */ - { 0, (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 277 = linux_sync_file_range */ + { AS(linux_sync_file_range_args), (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 277 = linux_sync_file_range */ { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 278 = linux_vmsplice */ { 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 279 = linux_move_pages */ { AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 280 = linux_utimensat */ Modified: head/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- head/sys/amd64/linux/linux_systrace_args.c Sat Dec 14 13:30:43 2019 (r355752) +++ head/sys/amd64/linux/linux_systrace_args.c Sat Dec 14 13:32:37 2019 (r355753) @@ -1977,7 +1977,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg } /* linux_sync_file_range */ case 277: { - *n_args = 0; + struct linux_sync_file_range_args *p = params; + iarg[0] = p->fd; /* l_int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->nbytes; /* l_loff_t */ + uarg[3] = p->flags; /* unsigned int */ + *n_args = 4; break; } /* linux_vmsplice */ @@ -5553,6 +5558,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; /* linux_sync_file_range */ case 277: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_loff_t"; + break; + case 3: + p = "unsigned int"; + break; + default: + break; + }; break; /* linux_vmsplice */ case 278: @@ -7509,6 +7530,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char * case 276: /* linux_sync_file_range */ case 277: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_vmsplice */ case 278: /* linux_move_pages */ Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Sat Dec 14 13:30:43 2019 (r355752) +++ head/sys/amd64/linux32/linux32_proto.h Sat Dec 14 13:32:37 2019 (r355753) @@ -1020,7 +1020,10 @@ struct linux_splice_args { register_t dummy; }; struct linux_sync_file_range_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char nbytes_l_[PADL_(l_loff_t)]; l_loff_t nbytes; char nbytes_r_[PADR_(l_loff_t)]; + char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)]; }; struct linux_tee_args { register_t dummy; Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Sat Dec 14 13:30:43 2019 (r355752) +++ head/sys/amd64/linux32/linux32_sysent.c Sat Dec 14 13:32:37 2019 (r355753) @@ -331,7 +331,7 @@ struct sysent linux32_sysent[] = { { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_set_robust_list */ { AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = linux_get_robust_list */ { 0, (sy_call_t *)linux_splice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 313 = linux_splice */ - { 0, (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 314 = linux_sync_file_range */ + { AS(linux_sync_file_range_args), (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 314 = linux_sync_file_range */ { 0, (sy_call_t *)linux_tee, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 315 = linux_tee */ { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 316 = linux_vmsplice */ { 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = linux_move_pages */ Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Sat Dec 14 13:30:43 2019 (r355752) +++ head/sys/amd64/linux32/linux32_systrace_args.c Sat Dec 14 13:32:37 2019 (r355753) @@ -2118,7 +2118,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg } /* linux_sync_file_range */ case 314: { - *n_args = 0; + struct linux_sync_file_range_args *p = params; + iarg[0] = p->fd; /* l_int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->nbytes; /* l_loff_t */ + uarg[3] = p->flags; /* unsigned int */ + *n_args = 4; break; } /* linux_tee */ @@ -6164,6 +6169,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; /* linux_sync_file_range */ case 314: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_loff_t"; + break; + case 3: + p = "unsigned int"; + break; + default: + break; + }; break; /* linux_tee */ case 315: @@ -8654,6 +8675,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char * case 313: /* linux_sync_file_range */ case 314: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_tee */ case 315: /* linux_vmsplice */ Modified: head/sys/arm/linux/linux_proto.h ============================================================================== --- head/sys/arm/linux/linux_proto.h Sat Dec 14 13:30:43 2019 (r355752) +++ head/sys/arm/linux/linux_proto.h Sat Dec 14 13:32:37 2019 (r355753) @@ -1076,7 +1076,10 @@ struct linux_splice_args { register_t dummy; }; struct linux_sync_file_range_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char nbytes_l_[PADL_(l_loff_t)]; l_loff_t nbytes; char nbytes_r_[PADR_(l_loff_t)]; + char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)]; }; struct linux_tee_args { register_t dummy; Modified: head/sys/arm/linux/linux_sysent.c ============================================================================== --- head/sys/arm/linux/linux_sysent.c Sat Dec 14 13:30:43 2019 (r355752) +++ head/sys/arm/linux/linux_sysent.c Sat Dec 14 13:32:37 2019 (r355753) @@ -358,7 +358,7 @@ struct sysent linux_sysent[] = { { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = linux_set_robust_list */ { AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 339 = linux_get_robust_list */ { 0, (sy_call_t *)linux_splice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = linux_splice */ - { 0, (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 341 = linux_sync_file_range */ + { AS(linux_sync_file_range_args), (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 341 = linux_sync_file_range */ { 0, (sy_call_t *)linux_tee, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 342 = linux_tee */ { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 343 = linux_vmsplice */ { 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = linux_move_pages */ Modified: head/sys/arm/linux/linux_systrace_args.c ============================================================================== --- head/sys/arm/linux/linux_systrace_args.c Sat Dec 14 13:30:43 2019 (r355752) +++ head/sys/arm/linux/linux_systrace_args.c Sat Dec 14 13:32:37 2019 (r355753) @@ -2224,7 +2224,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg } /* linux_sync_file_range */ case 341: { - *n_args = 0; + struct linux_sync_file_range_args *p = params; + iarg[0] = p->fd; /* l_int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->nbytes; /* l_loff_t */ + uarg[3] = p->flags; /* unsigned int */ + *n_args = 4; break; } /* linux_tee */ @@ -5975,6 +5980,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; /* linux_sync_file_range */ case 341: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_loff_t"; + break; + case 3: + p = "unsigned int"; + break; + default: + break; + }; break; /* linux_tee */ case 342: @@ -7515,6 +7536,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char * case 340: /* linux_sync_file_range */ case 341: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_tee */ case 342: /* linux_vmsplice */ Modified: head/sys/arm64/linux/linux_proto.h ============================================================================== --- head/sys/arm64/linux/linux_proto.h Sat Dec 14 13:30:43 2019 (r355752) +++ head/sys/arm64/linux/linux_proto.h Sat Dec 14 13:32:37 2019 (r355753) @@ -317,7 +317,10 @@ struct linux_fdatasync_args { char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; }; struct linux_sync_file_range_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char nbytes_l_[PADL_(l_loff_t)]; l_loff_t nbytes; char nbytes_r_[PADR_(l_loff_t)]; + char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)]; }; struct linux_timerfd_create_args { char clockid_l_[PADL_(l_int)]; l_int clockid; char clockid_r_[PADR_(l_int)]; Modified: head/sys/arm64/linux/linux_sysent.c ============================================================================== --- head/sys/arm64/linux/linux_sysent.c Sat Dec 14 13:30:43 2019 (r355752) +++ head/sys/arm64/linux/linux_sysent.c Sat Dec 14 13:32:37 2019 (r355753) @@ -101,7 +101,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 81 = linux_sync */ { AS(fsync_args), (sy_call_t *)sys_fsync, AUE_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 82 = fsync */ { AS(linux_fdatasync_args), (sy_call_t *)linux_fdatasync, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 83 = linux_fdatasync */ - { 0, (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 84 = linux_sync_file_range */ + { AS(linux_sync_file_range_args), (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 84 = linux_sync_file_range */ { AS(linux_timerfd_create_args), (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 85 = linux_timerfd_create */ { AS(linux_timerfd_settime_args), (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 86 = linux_timerfd_settime */ { AS(linux_timerfd_gettime_args), (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 87 = linux_timerfd_gettime */ Modified: head/sys/arm64/linux/linux_systrace_args.c ============================================================================== --- head/sys/arm64/linux/linux_systrace_args.c Sat Dec 14 13:30:43 2019 (r355752) +++ head/sys/arm64/linux/linux_systrace_args.c Sat Dec 14 13:32:37 2019 (r355753) @@ -597,7 +597,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg } /* linux_sync_file_range */ case 84: { - *n_args = 0; + struct linux_sync_file_range_args *p = params; + iarg[0] = p->fd; /* l_int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->nbytes; /* l_loff_t */ + uarg[3] = p->flags; /* unsigned int */ + *n_args = 4; break; } /* linux_timerfd_create */ @@ -3025,6 +3030,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; /* linux_sync_file_range */ case 84: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_loff_t"; + break; + case 3: + p = "unsigned int"; + break; + default: + break; + }; break; /* linux_timerfd_create */ case 85: @@ -5773,6 +5794,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* linux_sync_file_range */ case 84: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_timerfd_create */ case 85: if (ndx == 0 || ndx == 1) Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Sat Dec 14 13:30:43 2019 (r355752) +++ head/sys/i386/linux/linux_proto.h Sat Dec 14 13:32:37 2019 (r355753) @@ -1038,7 +1038,10 @@ struct linux_splice_args { register_t dummy; }; struct linux_sync_file_range_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char nbytes_l_[PADL_(l_loff_t)]; l_loff_t nbytes; char nbytes_r_[PADR_(l_loff_t)]; + char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)]; }; struct linux_tee_args { register_t dummy; Modified: head/sys/i386/linux/linux_sysent.c ============================================================================== --- head/sys/i386/linux/linux_sysent.c Sat Dec 14 13:30:43 2019 (r355752) +++ head/sys/i386/linux/linux_sysent.c Sat Dec 14 13:32:37 2019 (r355753) @@ -331,7 +331,7 @@ struct sysent linux_sysent[] = { { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_set_robust_list */ { AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = linux_get_robust_list */ { 0, (sy_call_t *)linux_splice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 313 = linux_splice */ - { 0, (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 314 = linux_sync_file_range */ + { AS(linux_sync_file_range_args), (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 314 = linux_sync_file_range */ { 0, (sy_call_t *)linux_tee, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 315 = linux_tee */ { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 316 = linux_vmsplice */ { 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = linux_move_pages */ Modified: head/sys/i386/linux/linux_systrace_args.c ============================================================================== --- head/sys/i386/linux/linux_systrace_args.c Sat Dec 14 13:30:43 2019 (r355752) +++ head/sys/i386/linux/linux_systrace_args.c Sat Dec 14 13:32:37 2019 (r355753) @@ -2194,7 +2194,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg } /* linux_sync_file_range */ case 314: { - *n_args = 0; + struct linux_sync_file_range_args *p = params; + iarg[0] = p->fd; /* l_int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->nbytes; /* l_loff_t */ + uarg[3] = p->flags; /* unsigned int */ + *n_args = 4; break; } /* linux_tee */ @@ -6395,6 +6400,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; /* linux_sync_file_range */ case 314: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_loff_t"; + break; + case 3: + p = "unsigned int"; + break; + default: + break; + }; break; /* linux_tee */ case 315: @@ -8932,6 +8953,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char * case 313: /* linux_sync_file_range */ case 314: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_tee */ case 315: /* linux_vmsplice */ From owner-svn-src-all@freebsd.org Sat Dec 14 13:37:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3D141CE473; Sat, 14 Dec 2019 13:37:18 +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 47ZpVk6Bfvz4P7B; Sat, 14 Dec 2019 13:37:18 +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 CFC7B25699; Sat, 14 Dec 2019 13:37:18 +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 xBEDbIUh010778; Sat, 14 Dec 2019 13:37:18 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBEDbH4Z010771; Sat, 14 Dec 2019 13:37:17 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201912141337.xBEDbH4Z010771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 14 Dec 2019 13:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355754 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Commit-Revision: 355754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 13:37:19 -0000 Author: trasz Date: Sat Dec 14 13:37:17 2019 New Revision: 355754 URL: https://svnweb.freebsd.org/changeset/base/355754 Log: Add sync_file_range(2) implementation to linux(4); it's a thin wrapper over the usual fsync(2). This silences some warnings when running "apt-get upgrade". Reviewed by: brooks, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22371 Modified: head/sys/amd64/linux/linux_dummy.c head/sys/amd64/linux32/linux32_dummy.c head/sys/arm64/linux/linux_dummy.c head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_file.h head/sys/i386/linux/linux_dummy.c Modified: head/sys/amd64/linux/linux_dummy.c ============================================================================== --- head/sys/amd64/linux/linux_dummy.c Sat Dec 14 13:32:37 2019 (r355753) +++ head/sys/amd64/linux/linux_dummy.c Sat Dec 14 13:37:17 2019 (r355754) @@ -99,7 +99,6 @@ DUMMY(migrate_pages); DUMMY(unshare); /* Linux 2.6.17: */ DUMMY(splice); -DUMMY(sync_file_range); DUMMY(tee); DUMMY(vmsplice); /* Linux 2.6.18: */ Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Sat Dec 14 13:32:37 2019 (r355753) +++ head/sys/amd64/linux32/linux32_dummy.c Sat Dec 14 13:37:17 2019 (r355754) @@ -105,7 +105,6 @@ DUMMY(migrate_pages); DUMMY(unshare); /* Linux 2.6.17: */ DUMMY(splice); -DUMMY(sync_file_range); DUMMY(tee); DUMMY(vmsplice); /* Linux 2.6.18: */ Modified: head/sys/arm64/linux/linux_dummy.c ============================================================================== --- head/sys/arm64/linux/linux_dummy.c Sat Dec 14 13:32:37 2019 (r355753) +++ head/sys/arm64/linux/linux_dummy.c Sat Dec 14 13:37:17 2019 (r355754) @@ -101,7 +101,6 @@ DUMMY(migrate_pages); DUMMY(unshare); /* Linux 2.6.17: */ DUMMY(splice); -DUMMY(sync_file_range); DUMMY(tee); DUMMY(vmsplice); /* Linux 2.6.18: */ Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Sat Dec 14 13:32:37 2019 (r355753) +++ head/sys/compat/linux/linux_file.c Sat Dec 14 13:37:17 2019 (r355754) @@ -908,6 +908,22 @@ linux_fdatasync(td, uap) } int +linux_sync_file_range(td, uap) + struct thread *td; + struct linux_sync_file_range_args *uap; +{ + + if (uap->offset < 0 || uap->nbytes < 0 || + (uap->flags & ~(LINUX_SYNC_FILE_RANGE_WAIT_BEFORE | + LINUX_SYNC_FILE_RANGE_WRITE | + LINUX_SYNC_FILE_RANGE_WAIT_AFTER)) != 0) { + return (EINVAL); + } + + return (kern_fsync(td, uap->fd, false)); +} + +int linux_pread(struct thread *td, struct linux_pread_args *uap) { struct vnode *vp; Modified: head/sys/compat/linux/linux_file.h ============================================================================== --- head/sys/compat/linux/linux_file.h Sat Dec 14 13:32:37 2019 (r355753) +++ head/sys/compat/linux/linux_file.h Sat Dec 14 13:37:17 2019 (r355754) @@ -134,4 +134,11 @@ #define LINUX_RENAME_EXCHANGE 0x00000002 #define LINUX_RENAME_WHITEOUT 0x00000004 +/* + * sync_file_range flags + */ +#define LINUX_SYNC_FILE_RANGE_WAIT_BEFORE 1 +#define LINUX_SYNC_FILE_RANGE_WRITE 2 +#define LINUX_SYNC_FILE_RANGE_WAIT_AFTER 4 + #endif /* !_LINUX_FILE_H_ */ Modified: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Sat Dec 14 13:32:37 2019 (r355753) +++ head/sys/i386/linux/linux_dummy.c Sat Dec 14 13:37:17 2019 (r355754) @@ -101,7 +101,6 @@ DUMMY(migrate_pages); DUMMY(unshare); /* Linux 2.6.17: */ DUMMY(splice); -DUMMY(sync_file_range); DUMMY(tee); DUMMY(vmsplice); /* Linux 2.6.18: */ From owner-svn-src-all@freebsd.org Sat Dec 14 14:56:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 159471CFF16; Sat, 14 Dec 2019 14:56:35 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 47ZrGC0X3vz4Rxj; Sat, 14 Dec 2019 14:56:35 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D01D264D5; Sat, 14 Dec 2019 14:56:35 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBEEuZMR057831; Sat, 14 Dec 2019 14:56:35 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBEEuZDA057830; Sat, 14 Dec 2019 14:56:35 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201912141456.xBEEuZDA057830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 14 Dec 2019 14:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355755 - in head/sys: arm64/rockchip conf X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head/sys: arm64/rockchip conf X-SVN-Commit-Revision: 355755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 14:56:35 -0000 Author: mmel Date: Sat Dec 14 14:56:34 2019 New Revision: 355755 URL: https://svnweb.freebsd.org/changeset/base/355755 Log: Add driver for Rockchip PCIe root complex found in RK3399 SOC. Unfortunately, there are some limitations: - memory aperture of his controller is only 16MiB, so it is nearly unusable for graphic cards - every attempt to generate type 1 config cycle always causes trap. These config cycles are disabled now and we don't support cards with PCIe switch. - in some cases, attempt to do config cycle to (probably) not-yet ready card also causes trap. This cannot be detected at runtime, but it seems like very rare issue. MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D22724 Added: head/sys/arm64/rockchip/rk_pcie.c (contents, props changed) head/sys/arm64/rockchip/rk_pcie_phy.c (contents, props changed) Modified: head/sys/conf/files.arm64 Added: head/sys/arm64/rockchip/rk_pcie.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/rk_pcie.c Sat Dec 14 14:56:34 2019 (r355755) @@ -0,0 +1,1411 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Michal Meloun + * + * 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. + * + */ + +/* Rockchip PCIe controller driver */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "pcib_if.h" + +#define ATU_CFG_BUS(x) (((x) & 0x0ff) << 20) +#define ATU_CFG_SLOT(x) (((x) & 0x01f) << 15) +#define ATU_CFG_FUNC(x) (((x) & 0x007) << 12) +#define ATU_CFG_REG(x) (((x) & 0xfff) << 0) + +#define ATU_TYPE_MEM 0x2 +#define ATU_TYPE_IO 0x6 +#define ATU_TYPE_CFG0 0xA +#define ATU_TYPE_CFG1 0xB +#define ATY_TYPE_NOR_MSG 0xC + +#define ATU_OB_REGIONS 33 +#define ATU_OB_REGION_SHIFT 20 +#define ATU_OB_REGION_SIZE (1 << ATU_OB_REGION_SHIFT) +#define ATU_OB_REGION_0_SIZE (( ATU_OB_REGIONS - 1) * ATU_OB_REGION_SIZE) + +#define ATU_IB_REGIONS 3 + +#define PCIE_CLIENT_BASIC_STRAP_CONF 0x000000 +#define STRAP_CONF_GEN_2 (1 << 7) +#define STRAP_CONF_MODE_RC (1 << 6) +#define STRAP_CONF_LANES(n) ((((n) / 2) & 0x3) << 4) +#define STRAP_CONF_ARI_EN (1 << 3) +#define STRAP_CONF_SR_IOV_EN (1 << 2) +#define STRAP_CONF_LINK_TRAIN_EN (1 << 1) +#define STRAP_CONF_CONF_EN (1 << 0) +#define PCIE_CLIENT_HOT_RESET_CTRL 0x000018 +#define HOT_RESET_CTRL_LINK_DOWN_RESET (1 << 1) +#define HOT_RESET_CTRL_HOT_RESET_IN (1 << 0) +#define PCIE_CLIENT_BASIC_STATUS0 0x000044 +#define PCIE_CLIENT_BASIC_STATUS1 0x000048 +#define STATUS1_LINK_ST_GET(x) (((x) >> 20) & 0x3) +#define STATUS1_LINK_ST_UP 3 +#define PCIE_CLIENT_INT_MASK 0x00004C +#define PCIE_CLIENT_INT_STATUS 0x000050 +#define PCIE_CLIENT_INT_LEGACY_DONE (1 << 15) +#define PCIE_CLIENT_INT_MSG (1 << 14) +#define PCIE_CLIENT_INT_HOT_RST (1 << 13) +#define PCIE_CLIENT_INT_DPA (1 << 12) +#define PCIE_CLIENT_INT_FATAL_ERR (1 << 11) +#define PCIE_CLIENT_INT_NFATAL_ERR (1 << 10) +#define PCIE_CLIENT_INT_CORR_ERR (1 << 9) +#define PCIE_CLIENT_INT_INTD (1 << 8) +#define PCIE_CLIENT_INT_INTC (1 << 7) +#define PCIE_CLIENT_INT_INTB (1 << 6) +#define PCIE_CLIENT_INT_INTA (1 << 5) +#define PCIE_CLIENT_INT_LOCAL (1 << 4) +#define PCIE_CLIENT_INT_UDMA (1 << 3) +#define PCIE_CLIENT_INT_PHY (1 << 2) +#define PCIE_CLIENT_INT_HOT_PLUG (1 << 1) +#define PCIE_CLIENT_INT_PWR_STCG (1 << 0) +#define PCIE_CLIENT_INT_LEGACY (PCIE_CLIENT_INT_INTA | \ + PCIE_CLIENT_INT_INTB | \ + PCIE_CLIENT_INT_INTC | \ + PCIE_CLIENT_INT_INTD) + +#define PCIE_CORE_CTRL0 0x900000 +#define CORE_CTRL_LANES_GET(x) (((x) >> 20) & 0x3) +#define PCIE_CORE_CTRL1 0x900004 +#define PCIE_CORE_CONFIG_VENDOR 0x900044 +#define PCIE_CORE_INT_STATUS 0x90020c +#define PCIE_CORE_INT_PRFPE (1 << 0) +#define PCIE_CORE_INT_CRFPE (1 << 1) +#define PCIE_CORE_INT_RRPE (1 << 2) +#define PCIE_CORE_INT_PRFO (1 << 3) +#define PCIE_CORE_INT_CRFO (1 << 4) +#define PCIE_CORE_INT_RT (1 << 5) +#define PCIE_CORE_INT_RTR (1 << 6) +#define PCIE_CORE_INT_PE (1 << 7) +#define PCIE_CORE_INT_MTR (1 << 8) +#define PCIE_CORE_INT_UCR (1 << 9) +#define PCIE_CORE_INT_FCE (1 << 10) +#define PCIE_CORE_INT_CT (1 << 11) +#define PCIE_CORE_INT_UTC (1 << 18) +#define PCIE_CORE_INT_MMVC (1 << 19) +#define PCIE_CORE_INT_MASK 0x900210 +#define PCIE_CORE_PHY_FUNC_CONF 0x9002C0 +#define PCIE_CORE_RC_BAR_CONF 0x900300 + +#define PCIE_RC_CONFIG_STD_BASE 0x800000 +#define PCIE_RC_CONFIG_PRIV_BASE 0xA00000 +#define PCIE_RC_CONFIG_DCSR 0xA000C8 +#define PCIE_RC_CONFIG_DCSR_MPS_MASK (0x7 << 5) +#define PCIE_RC_CONFIG_DCSR_MPS_128 (0 << 5) +#define PCIE_RC_CONFIG_DCSR_MPS_256 (1 << 5) +#define PCIE_RC_CONFIG_LINK_CAP 0xA00CC +#define PCIE_RC_CONFIG_LINK_CAP_L0S (1 << 10) + +#define PCIE_RC_CONFIG_LCS 0xA000D0 +#define PCIE_RC_CONFIG_THP_CAP 0xA00274 +#define PCIE_RC_CONFIG_THP_CAP_NEXT_MASK 0xFFF00000 + +#define PCIE_CORE_OB_ADDR0(n) (0xC00000 + 0x20 * (n) + 0x00) +#define PCIE_CORE_OB_ADDR1(n) (0xC00000 + 0x20 * (n) + 0x04) +#define PCIE_CORE_OB_DESC0(n) (0xC00000 + 0x20 * (n) + 0x08) +#define PCIE_CORE_OB_DESC1(n) (0xC00000 + 0x20 * (n) + 0x0C) +#define PCIE_CORE_OB_DESC2(n) (0xC00000 + 0x20 * (n) + 0x10) +#define PCIE_CORE_OB_DESC3(n) (0xC00000 + 0x20 * (n) + 0x14) + +#define PCIE_CORE_IB_ADDR0(n) (0xC00800 + 0x8 * (n) + 0x00) +#define PCIE_CORE_IB_ADDR1(n) (0xC00800 + 0x8 * (n) + 0x04) + +#define PRIV_CFG_RD4(sc, reg) \ + (uint32_t)rk_pcie_local_cfg_read(sc, true, reg, 4) +#define PRIV_CFG_RD2(sc, reg) \ + (uint16_t)rk_pcie_local_cfg_read(sc, true, reg, 2) +#define PRIV_CFG_RD1(sc, reg) \ + (uint8_t)rk_pcie_local_cfg_read(sc, true, reg, 1) +#define PRIV_CFG_WR4(sc, reg, val) \ + rk_pcie_local_cfg_write(sc, true, reg, val, 4) +#define PRIV_CFG_WR2(sc, reg, val) \ + rk_pcie_local_cfg_write(sc, true, reg, val, 2) +#define PRIV_CFG_WR1(sc, reg, val) \ + rk_pcie_local_cfg_write(sc, true, reg, val, 1) + +#define APB_WR4(_sc, _r, _v) bus_write_4((_sc)->apb_mem_res, (_r), (_v)) +#define APB_RD4(_sc, _r) bus_read_4((_sc)->apb_mem_res, (_r)) + +#define MAX_LANES 4 + +#define RK_PCIE_ENABLE_MSI +#define RK_PCIE_ENABLE_MSIX + +struct rk_pcie_softc { + struct ofw_pci_softc ofw_pci; /* Must be first */ + + struct resource *axi_mem_res; + struct resource *apb_mem_res; + struct resource *client_irq_res; + struct resource *legacy_irq_res; + struct resource *sys_irq_res; + void *client_irq_cookie; + void *legacy_irq_cookie; + void *sys_irq_cookie; + + device_t dev; + phandle_t node; + struct mtx mtx; + + + struct ofw_pci_range mem_range; + struct ofw_pci_range pref_mem_range; + struct ofw_pci_range io_range; + + bool coherent; + bus_dma_tag_t dmat; + + int num_lanes; + bool link_is_gen2; + bool no_l0s; + + u_int bus_start; + u_int bus_end; + u_int root_bus; + u_int sub_bus; + + regulator_t supply_12v; + regulator_t supply_3v3; + regulator_t supply_1v8; + regulator_t supply_0v9; + hwreset_t hwreset_core; + hwreset_t hwreset_mgmt; + hwreset_t hwreset_mgmt_sticky; + hwreset_t hwreset_pipe; + hwreset_t hwreset_pm; + hwreset_t hwreset_aclk; + hwreset_t hwreset_pclk; + clk_t clk_aclk; + clk_t clk_aclk_perf; + clk_t clk_hclk; + clk_t clk_pm; + phy_t phys[MAX_LANES]; + gpio_pin_t gpio_ep; +}; + +/* Compatible devices. */ +static struct ofw_compat_data compat_data[] = { + {"rockchip,rk3399-pcie", 1}, + {NULL, 0}, +}; + + +static uint32_t +rk_pcie_local_cfg_read(struct rk_pcie_softc *sc, bool priv, u_int reg, + int bytes) +{ + uint32_t val; + bus_addr_t base; + + if (priv) + base = PCIE_RC_CONFIG_PRIV_BASE; + else + base = PCIE_RC_CONFIG_STD_BASE; + + switch (bytes) { + case 4: + val = bus_read_4(sc->apb_mem_res, base + reg); + break; + case 2: + val = bus_read_2(sc->apb_mem_res, base + reg); + break; + case 1: + val = bus_read_1(sc->apb_mem_res, base + reg); + break; + default: + val = 0xFFFFFFFF; + } + return (val); +} + +static void +rk_pcie_local_cfg_write(struct rk_pcie_softc *sc, bool priv, u_int reg, + uint32_t val, int bytes) +{ + uint32_t val2; + bus_addr_t base; + + if (priv) + base = PCIE_RC_CONFIG_PRIV_BASE; + else + base = PCIE_RC_CONFIG_STD_BASE; + + switch (bytes) { + case 4: + bus_write_4(sc->apb_mem_res, base + reg, val); + break; + case 2: + val2 = bus_read_4(sc->apb_mem_res, base + (reg & ~3)); + val2 &= ~(0xffff << ((reg & 3) << 3)); + val2 |= ((val & 0xffff) << ((reg & 3) << 3)); + bus_write_4(sc->apb_mem_res, base + (reg & ~3), val2); + break; + case 1: + val2 = bus_read_4(sc->apb_mem_res, base + (reg & ~3)); + val2 &= ~(0xff << ((reg & 3) << 3)); + val2 |= ((val & 0xff) << ((reg & 3) << 3)); + bus_write_4(sc->apb_mem_res, base + (reg & ~3), val2); + break; + } +} + + +static bool +rk_pcie_check_dev(struct rk_pcie_softc *sc, u_int bus, u_int slot, u_int func, + u_int reg) +{ + uint32_t val; + + if (bus < sc->bus_start || bus > sc->bus_end || slot > PCI_SLOTMAX || + func > PCI_FUNCMAX || reg > PCI_REGMAX) + return (false); + + if (bus == sc->root_bus) { + /* we have only 1 device with 1 function root port */ + if (slot > 0 || func > 0) + return (false); + return (true); + } + + /* link is needed for accessing non-root busses */ + val = APB_RD4(sc, PCIE_CLIENT_BASIC_STATUS1); + if (STATUS1_LINK_ST_GET(val) != STATUS1_LINK_ST_UP) + return (false); + + /* only one device is on first subordinate bus */ + if (bus == sc->sub_bus && slot) + return (false); + return (true); +} + + +static void +rk_pcie_map_out_atu(struct rk_pcie_softc *sc, int idx, int type, + int num_bits, uint64_t pa) +{ + uint32_t addr0; + uint64_t max_size; + + + /* Check HW constrains */ + max_size = idx == 0 ? ATU_OB_REGION_0_SIZE: ATU_OB_REGION_SIZE; + KASSERT(idx < ATU_OB_REGIONS, ("Invalid region index: %d\n", idx)); + KASSERT(num_bits >= 7 && num_bits <= 63, + ("Bit width of region is invalid: %d\n", num_bits)); + KASSERT(max_size <= (1ULL << (num_bits + 1)), + ("Bit width is invalid for given region[%d]: %d\n", idx, num_bits)); + + addr0 = (uint32_t)pa & 0xFFFFFF00; + addr0 |= num_bits; + APB_WR4(sc, PCIE_CORE_OB_ADDR0(idx), addr0); + APB_WR4(sc, PCIE_CORE_OB_ADDR1(idx), (uint32_t)(pa >> 32)); + APB_WR4(sc, PCIE_CORE_OB_DESC0(idx), 1 << 23 | type); + APB_WR4(sc, PCIE_CORE_OB_DESC1(idx), sc->root_bus); + + /* Readback for sync */ + APB_RD4(sc, PCIE_CORE_OB_DESC1(idx)); +} + +static void +rk_pcie_map_cfg_atu(struct rk_pcie_softc *sc, int idx, int type) +{ + + /* Check HW constrains */ + KASSERT(idx < ATU_OB_REGIONS, ("Invalid region index: %d\n", idx)); + + /* + * Config window is only 25 bits width, so we cannot encode full bus + * range into it. Remaining bits of bus number should be taken from + * DESC1 field. + */ + APB_WR4(sc, PCIE_CORE_OB_ADDR0(idx), 25 - 1); + APB_WR4(sc, PCIE_CORE_OB_ADDR1(idx), 0); + APB_WR4(sc, PCIE_CORE_OB_DESC0(idx), 1 << 23 | type); + APB_WR4(sc, PCIE_CORE_OB_DESC1(idx), sc->root_bus); + + /* Readback for sync */ + APB_RD4(sc, PCIE_CORE_OB_DESC1(idx)); + +} + +static void +rk_pcie_map_in_atu(struct rk_pcie_softc *sc, int idx, int num_bits, uint64_t pa) +{ + uint32_t addr0; + + /* Check HW constrains */ + KASSERT(idx < ATU_IB_REGIONS, ("Invalid region index: %d\n", idx)); + KASSERT(num_bits >= 7 && num_bits <= 63, + ("Bit width of region is invalid: %d\n", num_bits)); + + addr0 = (uint32_t)pa & 0xFFFFFF00; + addr0 |= num_bits; + APB_WR4(sc, PCIE_CORE_IB_ADDR0(idx), addr0); + APB_WR4(sc, PCIE_CORE_IB_ADDR1(idx), (uint32_t)(pa >> 32)); + + /* Readback for sync */ + APB_RD4(sc, PCIE_CORE_IB_ADDR1(idx)); +} + +static int +rk_pcie_decode_ranges(struct rk_pcie_softc *sc, struct ofw_pci_range *ranges, + int nranges) +{ + int i; + + for (i = 0; i < nranges; i++) { + if ((ranges[i].pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) == + OFW_PCI_PHYS_HI_SPACE_IO) { + if (sc->io_range.size != 0) { + device_printf(sc->dev, + "Duplicated IO range found in DT\n"); + return (ENXIO); + } + sc->io_range = ranges[i]; + } + if (((ranges[i].pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) == + OFW_PCI_PHYS_HI_SPACE_MEM64)) { + if (ranges[i].pci_hi & OFW_PCI_PHYS_HI_PREFETCHABLE) { + if (sc->pref_mem_range.size != 0) { + device_printf(sc->dev, + "Duplicated memory range found " + "in DT\n"); + return (ENXIO); + } + sc->pref_mem_range = ranges[i]; + } else { + if (sc->mem_range.size != 0) { + device_printf(sc->dev, + "Duplicated memory range found " + "in DT\n"); + return (ENXIO); + } + sc->mem_range = ranges[i]; + } + } + } + if (sc->mem_range.size == 0) { + device_printf(sc->dev, + " At least memory range should be defined in DT.\n"); + return (ENXIO); + } + return (0); +} + +/*----------------------------------------------------------------------------- + * + * P C I B I N T E R F A C E + */ +static uint32_t +rk_pcie_read_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, int bytes) +{ + struct rk_pcie_softc *sc; + uint32_t data; + uint64_t addr; + int type; + + sc = device_get_softc(dev); + + if (!rk_pcie_check_dev(sc, bus, slot, func, reg)) + return (0xFFFFFFFFU); + + if (bus == sc->root_bus) + return (rk_pcie_local_cfg_read(sc, false, reg, bytes)); + + addr = ATU_CFG_BUS(bus) | ATU_CFG_SLOT(slot) | ATU_CFG_FUNC(func) | + ATU_CFG_REG(reg); + if (bus == sc->sub_bus) { + type = ATU_TYPE_CFG0; + } else { + type = ATU_TYPE_CFG1; + /* + * XXX FIXME: any attempt to generate type1 configuration + * access causes external data abort + */ + return (0xFFFFFFFFU); + } + rk_pcie_map_cfg_atu(sc, 0, type); + + switch (bytes) { + case 1: + data = bus_read_1(sc->axi_mem_res, addr); + break; + case 2: + data = bus_read_2(sc->axi_mem_res, addr); + break; + case 4: + data = bus_read_4(sc->axi_mem_res, addr); + break; + default: + data = 0xFFFFFFFFU; + } + return (data); +} + +static void +rk_pcie_write_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, uint32_t val, int bytes) +{ + struct rk_pcie_softc *sc; + uint64_t addr; + int type; + + sc = device_get_softc(dev); + + if (!rk_pcie_check_dev(sc, bus, slot, func, reg)) + return; + + if (bus == sc->root_bus) + return (rk_pcie_local_cfg_write(sc, false, reg, val, bytes)); + + addr = ATU_CFG_BUS(bus) | ATU_CFG_SLOT(slot) | ATU_CFG_FUNC(func) | + ATU_CFG_REG(reg); + if (bus == sc->sub_bus){ + type = ATU_TYPE_CFG0; + } else { + type = ATU_TYPE_CFG1; + /* + * XXX FIXME: any attempt to generate type1 configuration + * access causes external data abort + */ + return; + } + rk_pcie_map_cfg_atu(sc, 0, type); + + switch (bytes) { + case 1: + bus_write_1(sc->axi_mem_res, addr, val); + break; + case 2: + bus_write_2(sc->axi_mem_res, addr, val); + break; + case 4: + bus_write_4(sc->axi_mem_res, addr, val); + break; + default: + break; + } +} + +#ifdef RK_PCIE_ENABLE_MSI +static int +rk_pcie_alloc_msi(device_t pci, device_t child, int count, + int maxcount, int *irqs) +{ + phandle_t msi_parent; + int rv; + + rv = ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), + &msi_parent, NULL); + if (rv != 0) + return (rv); + + rv = intr_alloc_msi(pci, child, msi_parent, count, maxcount,irqs); + return (rv); +} + +static int +rk_pcie_release_msi(device_t pci, device_t child, int count, int *irqs) +{ + phandle_t msi_parent; + int rv; + + rv = ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), + &msi_parent, NULL); + if (rv != 0) + return (rv); + rv = intr_release_msi(pci, child, msi_parent, count, irqs); + return (rv); +} +#endif + +static int +rk_pcie_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, + uint32_t *data) +{ + phandle_t msi_parent; + int rv; + + rv = ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), + &msi_parent, NULL); + if (rv != 0) + return (rv); + rv = intr_map_msi(pci, child, msi_parent, irq, addr, data); + return (rv); +} + +#ifdef RK_PCIE_ENABLE_MSIX +static int +rk_pcie_alloc_msix(device_t pci, device_t child, int *irq) +{ + phandle_t msi_parent; + int rv; + + rv = ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), + &msi_parent, NULL); + if (rv != 0) + return (rv); + rv = intr_alloc_msix(pci, child, msi_parent, irq); + return (rv); +} + +static int +rk_pcie_release_msix(device_t pci, device_t child, int irq) +{ + phandle_t msi_parent; + int rv; + + rv = ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), + &msi_parent, NULL); + if (rv != 0) + return (rv); + rv = intr_release_msix(pci, child, msi_parent, irq); + return (rv); +} +#endif + +static int +rk_pcie_get_id(device_t pci, device_t child, enum pci_id_type type, + uintptr_t *id) +{ + phandle_t node; + int rv; + uint32_t rid; + uint16_t pci_rid; + + if (type != PCI_ID_MSI) + return (pcib_get_id(pci, child, type, id)); + + node = ofw_bus_get_node(pci); + pci_rid = pci_get_rid(child); + + rv = ofw_bus_msimap(node, pci_rid, NULL, &rid); + if (rv != 0) + return (rv); + + *id = rid; + return (0); +} + +static int +rk_pcie_route_interrupt(device_t bus, device_t dev, int pin) +{ + struct rk_pcie_softc *sc; + u_int irq; + + sc = device_get_softc(bus); + irq = intr_map_clone_irq(rman_get_start(sc->legacy_irq_res)); + device_printf(bus, "route pin %d for device %d.%d to %u\n", + pin, pci_get_slot(dev), pci_get_function(dev), irq); + + return (irq); +} + +/*----------------------------------------------------------------------------- + * + * B U S / D E V I C E I N T E R F A C E + */ +static int +rk_pcie_parse_fdt_resources(struct rk_pcie_softc *sc) +{ + int i, rv; + char buf[16]; + + /* Regulators. All are optional. */ + rv = regulator_get_by_ofw_property(sc->dev, 0, + "vpcie12v-supply", &sc->supply_12v); + if (rv != 0 && rv != ENOENT) { + device_printf(sc->dev,"Cannot get 'vpcie12' regulator\n"); + return (ENXIO); + } + rv = regulator_get_by_ofw_property(sc->dev, 0, + "vpcie3v3-supply", &sc->supply_3v3); + if (rv != 0 && rv != ENOENT) { + device_printf(sc->dev,"Cannot get 'vpcie3v3' regulator\n"); + return (ENXIO); + } + rv = regulator_get_by_ofw_property(sc->dev, 0, + "vpcie1v8-supply", &sc->supply_1v8); + if (rv != 0 && rv != ENOENT) { + device_printf(sc->dev,"Cannot get 'vpcie1v8' regulator\n"); + return (ENXIO); + } + rv = regulator_get_by_ofw_property(sc->dev, 0, + "vpcie0v9-supply", &sc->supply_0v9); + if (rv != 0 && rv != ENOENT) { + device_printf(sc->dev,"Cannot get 'vpcie0v9' regulator\n"); + return (ENXIO); + } + + /* Resets. */ + rv = hwreset_get_by_ofw_name(sc->dev, 0, "core", &sc->hwreset_core); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'core' reset\n"); + return (ENXIO); + } + rv = hwreset_get_by_ofw_name(sc->dev, 0, "mgmt", &sc->hwreset_mgmt); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'mgmt' reset\n"); + return (ENXIO); + } + rv = hwreset_get_by_ofw_name(sc->dev, 0, "mgmt-sticky", + &sc->hwreset_mgmt_sticky); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'mgmt-sticky' reset\n"); + return (ENXIO); + } + rv = hwreset_get_by_ofw_name(sc->dev, 0, "pipe", &sc->hwreset_pipe); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'pipe' reset\n"); + return (ENXIO); + } + rv = hwreset_get_by_ofw_name(sc->dev, 0, "pm", &sc->hwreset_pm); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'pm' reset\n"); + return (ENXIO); + } + rv = hwreset_get_by_ofw_name(sc->dev, 0, "aclk", &sc->hwreset_aclk); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'aclk' reset\n"); + return (ENXIO); + } + rv = hwreset_get_by_ofw_name(sc->dev, 0, "pclk", &sc->hwreset_pclk); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'pclk' reset\n"); + return (ENXIO); + } + + /* Clocks. */ + rv = clk_get_by_ofw_name(sc->dev, 0, "aclk", &sc->clk_aclk); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'aclk' clock\n"); + return (ENXIO); + } + rv = clk_get_by_ofw_name(sc->dev, 0, "aclk-perf", &sc->clk_aclk_perf); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'aclk-perf' clock\n"); + return (ENXIO); + } + rv = clk_get_by_ofw_name(sc->dev, 0, "hclk", &sc->clk_hclk); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'hclk' clock\n"); + return (ENXIO); + } + rv = clk_get_by_ofw_name(sc->dev, 0, "pm", &sc->clk_pm); + if (rv != 0) { + device_printf(sc->dev, "Cannot get 'pm' clock\n"); + return (ENXIO); + } + + /* Phys. */ + for (i = 0; i < MAX_LANES; i++ ) { + sprintf (buf, "pcie-phy-%d", i); + rv = phy_get_by_ofw_name(sc->dev, 0, buf, sc->phys + i); + if (rv != 0) { + device_printf(sc->dev, "Cannot get '%s' phy\n", buf); + return (ENXIO); + } + } + + /* GPIO for PERST#. Optional */ + rv = gpio_pin_get_by_ofw_property(sc->dev, sc->node, "ep-gpios", + &sc->gpio_ep); + if (rv != 0 && rv != ENOENT) { + device_printf(sc->dev, "Cannot get 'ep-gpios' gpio\n"); + return (ENXIO); + } + + return (0); +} + +static int +rk_pcie_enable_resources(struct rk_pcie_softc *sc) +{ + int i, rv; + uint32_t val; + + /* Assert all resets */ + rv = hwreset_assert(sc->hwreset_pclk); + if (rv != 0) { + device_printf(sc->dev, "Cannot assert 'pclk' reset\n"); + return (rv); + } + rv = hwreset_assert(sc->hwreset_aclk); + if (rv != 0) { + device_printf(sc->dev, "Cannot assert 'aclk' reset\n"); + return (rv); + } + rv = hwreset_assert(sc->hwreset_pm); + if (rv != 0) { + device_printf(sc->dev, "Cannot assert 'pm' reset\n"); + return (rv); + } + rv = hwreset_assert(sc->hwreset_pipe); + if (rv != 0) { + device_printf(sc->dev, "Cannot assert 'pipe' reset\n"); + return (rv); + } + rv = hwreset_assert(sc->hwreset_mgmt_sticky); + if (rv != 0) { + device_printf(sc->dev, "Cannot assert 'mgmt_sticky' reset\n"); + return (rv); + } + rv = hwreset_assert(sc->hwreset_mgmt); + if (rv != 0) { + device_printf(sc->dev, "Cannot assert 'hmgmt' reset\n"); + return (rv); + } + rv = hwreset_assert(sc->hwreset_core); + if (rv != 0) { + device_printf(sc->dev, "Cannot assert 'hcore' reset\n"); + return (rv); + } + DELAY(10000); + + /* Enable clockls */ + rv = clk_enable(sc->clk_aclk); + if (rv != 0) { + device_printf(sc->dev, "Cannot enable 'aclk' clock\n"); + return (rv); + } + rv = clk_enable(sc->clk_aclk_perf); + if (rv != 0) { + device_printf(sc->dev, "Cannot enable 'aclk_perf' clock\n"); + return (rv); + } + rv = clk_enable(sc->clk_hclk); + if (rv != 0) { + device_printf(sc->dev, "Cannot enable 'hclk' clock\n"); + return (rv); + } + rv = clk_enable(sc->clk_pm); + if (rv != 0) { + device_printf(sc->dev, "Cannot enable 'pm' clock\n"); + return (rv); + } + + /* Power up regulators */ + if (sc->supply_12v != NULL) { + rv = regulator_enable(sc->supply_12v); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'vpcie12' regulator\n"); + return (rv); + } + } + if (sc->supply_3v3 != NULL) { + rv = regulator_enable(sc->supply_3v3); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'vpcie3v3' regulator\n"); + return (rv); + } + } + if (sc->supply_1v8 != NULL) { + rv = regulator_enable(sc->supply_1v8); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'vpcie1v8' regulator\n"); + return (rv); + } + } + if (sc->supply_0v9 != NULL) { + rv = regulator_enable(sc->supply_0v9); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable 'vpcie1v8' regulator\n"); + return (rv); + } + } + DELAY(1000); + + /* Deassert basic resets*/ + rv = hwreset_deassert(sc->hwreset_pm); + if (rv != 0) { + device_printf(sc->dev, "Cannot deassert 'pm' reset\n"); + return (rv); + } + rv = hwreset_deassert(sc->hwreset_aclk); + if (rv != 0) { + device_printf(sc->dev, "Cannot deassert 'aclk' reset\n"); + return (rv); + } + rv = hwreset_deassert(sc->hwreset_pclk); + if (rv != 0) { + device_printf(sc->dev, "Cannot deassert 'pclk' reset\n"); + return (rv); + } + + /* Set basic PCIe core mode (RC, lanes, gen1 or 2) */ + val = STRAP_CONF_GEN_2 << 16 | + sc->link_is_gen2 ? STRAP_CONF_GEN_2: 0; + val |= STRAP_CONF_MODE_RC << 16 | STRAP_CONF_MODE_RC; + val |= STRAP_CONF_LANES(~0) << 16 | STRAP_CONF_LANES(sc->num_lanes); + val |= STRAP_CONF_ARI_EN << 16 | STRAP_CONF_ARI_EN; + val |= STRAP_CONF_CONF_EN << 16 | STRAP_CONF_CONF_EN; + APB_WR4(sc, PCIE_CLIENT_BASIC_STRAP_CONF, val); + + for (i = 0; i < MAX_LANES; i++) { + rv = phy_enable(sc->phys[i]); + if (rv != 0) { + device_printf(sc->dev, "Cannot enable phy %d\n", i); + return (rv); + } + } + + /* Deassert rest of resets - order is important ! */ + rv = hwreset_deassert(sc->hwreset_mgmt_sticky); + if (rv != 0) { + device_printf(sc->dev, "Cannot deassert 'mgmt_sticky' reset\n"); + return (rv); + } + rv = hwreset_deassert(sc->hwreset_core); + if (rv != 0) { + device_printf(sc->dev, "Cannot deassert 'core' reset\n"); + return (rv); + } + rv = hwreset_deassert(sc->hwreset_mgmt); + if (rv != 0) { + device_printf(sc->dev, "Cannot deassert 'mgmt' reset\n"); + return (rv); + } + rv = hwreset_deassert(sc->hwreset_pipe); + if (rv != 0) { + device_printf(sc->dev, "Cannot deassert 'pipe' reset\n"); + return (rv); + } + return (0); +} + +static int +rk_pcie_setup_hw(struct rk_pcie_softc *sc) +{ + uint32_t val; + int i, rv; + + /* Assert PERST# if defined */ + if (sc->gpio_ep != NULL) { + rv = gpio_pin_set_active(sc->gpio_ep, 0); + if (rv != 0) { + device_printf(sc->dev, + "Cannot clear 'gpio-ep' gpio\n"); + return (rv); + } + } + + rv = rk_pcie_enable_resources(sc); + if (rv != 0) + return(rv); + + /* Fix wrong default value for transmited FTS for L0s exit */ + val = APB_RD4(sc, PCIE_CORE_CTRL1); + val |= 0xFFFF << 8; + APB_WR4(sc, PCIE_CORE_CTRL1, val); + + /* Setup PCIE Link Status & Control register */ + val = APB_RD4(sc, PCIE_RC_CONFIG_LCS); + val |= PCIEM_LINK_CTL_COMMON_CLOCK; + APB_WR4(sc, PCIE_RC_CONFIG_LCS, val); + val = APB_RD4(sc, PCIE_RC_CONFIG_LCS); + val |= PCIEM_LINK_CTL_RCB; + APB_WR4(sc, PCIE_RC_CONFIG_LCS, val); + + /* Enable training for GEN1 */ + APB_WR4(sc, PCIE_CLIENT_BASIC_STRAP_CONF, + STRAP_CONF_LINK_TRAIN_EN << 16 | STRAP_CONF_LINK_TRAIN_EN); + + /* Deassert PERST# if defined */ + if (sc->gpio_ep != NULL) { + rv = gpio_pin_set_active(sc->gpio_ep, 1); + if (rv != 0) { + device_printf(sc->dev, "Cannot set 'gpio-ep' gpio\n"); + return (rv); + } + } + + /* Wait for link */ + for (i = 500; i > 0; i--) { + val = APB_RD4(sc, PCIE_CLIENT_BASIC_STATUS1); + if (STATUS1_LINK_ST_GET(val) == STATUS1_LINK_ST_UP) + break; + DELAY(1000); + } + if (i <= 0) { + device_printf(sc->dev, + "Gen1 link training timeouted: 0x%08X.\n", val); + return (0); + } + + if (sc->link_is_gen2) { + val = APB_RD4(sc, PCIE_RC_CONFIG_LCS); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Dec 14 17:26:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACA121D2B09 for ; Sat, 14 Dec 2019 17:26:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47ZvbQ49PBz4Ymt for ; Sat, 14 Dec 2019 17:26:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 771DDADC2 for ; Sat, 14 Dec 2019 17:26:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f43.google.com with SMTP id o18so1045328qvf.1 for ; Sat, 14 Dec 2019 09:26:42 -0800 (PST) X-Gm-Message-State: APjAAAUKFsz+TAT+VMTIhk1mQDz/7D0VstKUic9NYVkZO8I8l/GyUwKu CcZgw7hoXiq68eFXnPia3w6aE4oJ8PmUsY8Bvjc= X-Received: by 2002:a05:6214:1645:: with SMTP id f5mt18414776qvw.129.1576344401776; Sat, 14 Dec 2019 09:26:41 -0800 (PST) MIME-Version: 1.0 References: <201805280812.w4S8CI56046943@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Sat, 14 Dec 2019 11:26:30 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334277 - in head: contrib/libpcap contrib/ofed/usr.lib/3 contrib/pf/pflogd contrib/wpa/src/l2_packet lib lib/libpcap share/mk usr.sbin/cxgbetool Cc: Hans Petter Selasky , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 17:26:42 -0000 On Mon, Nov 25, 2019 at 1:17 PM Kyle Evans wrote: > > On Mon, May 28, 2018 at 3:12 AM Hans Petter Selasky > wrote: > > > > Author: hselasky > > Date: Mon May 28 08:12:18 2018 > > New Revision: 334277 > > URL: https://svnweb.freebsd.org/changeset/base/334277 > > > > Log: > > MFV r333789: libpcap 1.9.0 (pre-release) > > > > MFC after: 1 month > > Sponsored by: Mellanox Technologies > > > > Replaced: > > head/contrib/libpcap/ > > - copied from r333789, vendor/libpcap/dist/ > > Deleted: > > head/lib/libpcap/pcap-netmap.c > > Modified: > > head/contrib/ofed/usr.lib/3/Makefile > > head/contrib/pf/pflogd/pflogd.c > > head/contrib/wpa/src/l2_packet/l2_packet_freebsd.c > > head/lib/Makefile > > head/lib/libpcap/Makefile > > head/lib/libpcap/config.h > > head/share/mk/src.libnames.mk > > head/usr.sbin/cxgbetool/cxgbetool.c > > > > [ ... snip ... ] > > Modified: head/lib/libpcap/Makefile > > ============================================================================== > > --- head/lib/libpcap/Makefile Mon May 28 06:01:02 2018 (r334276) > > +++ head/lib/libpcap/Makefile Mon May 28 08:12:18 2018 (r334277) > > @@ -7,16 +7,51 @@ SHLIBDIR?= /lib > > > > PACKAGE=lib${LIB} > > LIB= pcap > > -SRCS= grammar.y tokdefs.h pcap_version.h pcap-bpf.c \ > > - pcap-netmap.c fad-helpers.c \ > > - pcap.c pcap-common.c inet.c fad-getad.c gencode.c optimize.c nametoaddr.c \ > > - etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c \ > > - scanner.l sf-pcap.c sf-pcap-ng.c version.c > > > > +SRCS= bpf_dump.c \ > > + bpf_filter.c \ > > + bpf_image.c \ > > + etherent.c \ > > + fad-getad.c \ > > + fmtutils.c \ > > + gencode.c \ > > + grammar.y \ > > + nametoaddr.c \ > > + optimize.c \ > > + pcap-bpf.c \ > > + pcap-common.c \ > > + pcap-netmap.c \ > > + pcap-netmap.h \ > > + pcap.c \ > > + savefile.c \ > > + scanner.l \ > > + sf-pcap.c \ > > + sf-pcapng.c \ > > + tokdefs.h > > + > > # Old compatibility headers > > -INCS= pcap.h pcap-namedb.h pcap-bpf.h > > +INCS= fmtutils.h \ > > + pcap-bpf.h \ > > + pcap-namedb.h \ > > + pcap-netmap.h \ > > + pcap.h > > > > -PCAPINCS= pcap/pcap.h pcap/namedb.h pcap/bpf.h pcap/dlt.h pcap/export-defs.h > > +PCAPINCS= \ > > + pcap/bluetooth.h \ > > + pcap/bpf.h \ > > + pcap/can_socketcan.h \ > > + pcap/compiler-tests.h \ > > + pcap/dlt.h \ > > + pcap/funcattrs.h \ > > + pcap/ipnet.h \ > > + pcap/namedb.h \ > > + pcap/nflog.h \ > > + pcap/pcap-inttypes.h \ > > + pcap/pcap.h \ > > + pcap/sll.h \ > > + pcap/usb.h \ > > + pcap/vlan.h > > + > > PCAPINCSDIR= ${INCLUDEDIR}/pcap > > INCSGROUPS= INCS PCAPINCS > > > > @@ -40,6 +75,7 @@ MAN= pcap.3 \ > > pcap_fileno.3 \ > > pcap_findalldevs.3 \ > > pcap_freecode.3 \ > > + pcap_get_required_select_timeout.3 \ > > pcap_get_selectable_fd.3 \ > > pcap_get_tstamp_precision.3 \ > > pcap_geterr.3 \ > > @@ -61,6 +97,7 @@ MAN= pcap.3 \ > > pcap_set_datalink.3 \ > > pcap_set_immediate_mode.3 \ > > pcap_set_promisc.3 \ > > + pcap_set_protocol.3 \ > > pcap_set_rfmon.3 \ > > pcap_set_snaplen.3 \ > > pcap_set_timeout.3 \ > > @@ -73,12 +110,11 @@ MAN= pcap.3 \ > > pcap_stats.3 \ > > pcap_statustostr.3 \ > > pcap_strerror.3 \ > > - pcap-savefile.5 \ > > pcap_tstamp_type_name_to_val.3 \ > > - pcap_tstamp_type_val_to_name.3 \ > > - pcap-filter.7 \ > > - pcap-linktype.7 > > -MLINKS= pcap_datalink_val_to_name.3 pcap_datalink_val_to_description.3 \ > > + pcap_tstamp_type_val_to_name.3 > > + > > +MLINKS= \ > > + pcap_datalink_val_to_name.3 pcap_datalink_val_to_description.3 \ > > pcap_dump_open.3 pcap_dump_fopen.3 \ > > pcap_findalldevs.3 pcap_freealldevs.3 \ > > pcap_geterr.3 pcap_perror.3 \ > > Hi Hans, > > This stopped installing pcap-filter(7) by default, but that wasn't > mentioned in the commit message and it's xref'd in other manpages -- > any objections to reinstating it? > > Thanks, > > Kyle Evans Resend at the request of Hans; please see above. Also, open PR [0] with a patch included dating back to May. Thanks! Kyle Evans [0] http://bugs.freebsd.org/237893 From owner-svn-src-all@freebsd.org Sat Dec 14 17:26:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DE641D2B0E; Sat, 14 Dec 2019 17:26:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47ZvbR1BT4z4Ymw; Sat, 14 Dec 2019 17:26:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id xBEHQSLl099003 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 14 Dec 2019 19:26:31 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua xBEHQSLl099003 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id xBEHQS8x099002; Sat, 14 Dec 2019 19:26:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 14 Dec 2019 19:26:28 +0200 From: Konstantin Belousov To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355754 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux Message-ID: <20191214172628.GX2744@kib.kiev.ua> References: <201912141337.xBEDbH4Z010771@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201912141337.xBEDbH4Z010771@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.3 X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on tom.home X-Rspamd-Queue-Id: 47ZvbR1BT4z4Ymw 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)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 17:26:43 -0000 On Sat, Dec 14, 2019 at 01:37:17PM +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Sat Dec 14 13:37:17 2019 > New Revision: 355754 > URL: https://svnweb.freebsd.org/changeset/base/355754 > > Log: > Add sync_file_range(2) implementation to linux(4); it's a thin wrapper > over the usual fsync(2). > > This silences some warnings when running "apt-get upgrade". > > Reviewed by: brooks, emaste > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D22371 > > Modified: > head/sys/amd64/linux/linux_dummy.c > head/sys/amd64/linux32/linux32_dummy.c > head/sys/arm64/linux/linux_dummy.c > head/sys/compat/linux/linux_file.c > head/sys/compat/linux/linux_file.h > head/sys/i386/linux/linux_dummy.c > > Modified: head/sys/amd64/linux/linux_dummy.c > ============================================================================== > --- head/sys/amd64/linux/linux_dummy.c Sat Dec 14 13:32:37 2019 (r355753) > +++ head/sys/amd64/linux/linux_dummy.c Sat Dec 14 13:37:17 2019 (r355754) > @@ -99,7 +99,6 @@ DUMMY(migrate_pages); > DUMMY(unshare); > /* Linux 2.6.17: */ > DUMMY(splice); > -DUMMY(sync_file_range); > DUMMY(tee); > DUMMY(vmsplice); > /* Linux 2.6.18: */ > > Modified: head/sys/amd64/linux32/linux32_dummy.c > ============================================================================== > --- head/sys/amd64/linux32/linux32_dummy.c Sat Dec 14 13:32:37 2019 (r355753) > +++ head/sys/amd64/linux32/linux32_dummy.c Sat Dec 14 13:37:17 2019 (r355754) > @@ -105,7 +105,6 @@ DUMMY(migrate_pages); > DUMMY(unshare); > /* Linux 2.6.17: */ > DUMMY(splice); > -DUMMY(sync_file_range); > DUMMY(tee); > DUMMY(vmsplice); > /* Linux 2.6.18: */ > > Modified: head/sys/arm64/linux/linux_dummy.c > ============================================================================== > --- head/sys/arm64/linux/linux_dummy.c Sat Dec 14 13:32:37 2019 (r355753) > +++ head/sys/arm64/linux/linux_dummy.c Sat Dec 14 13:37:17 2019 (r355754) > @@ -101,7 +101,6 @@ DUMMY(migrate_pages); > DUMMY(unshare); > /* Linux 2.6.17: */ > DUMMY(splice); > -DUMMY(sync_file_range); > DUMMY(tee); > DUMMY(vmsplice); > /* Linux 2.6.18: */ > > Modified: head/sys/compat/linux/linux_file.c > ============================================================================== > --- head/sys/compat/linux/linux_file.c Sat Dec 14 13:32:37 2019 (r355753) > +++ head/sys/compat/linux/linux_file.c Sat Dec 14 13:37:17 2019 (r355754) > @@ -908,6 +908,22 @@ linux_fdatasync(td, uap) > } > > int > +linux_sync_file_range(td, uap) > + struct thread *td; > + struct linux_sync_file_range_args *uap; Why use K&R definitions in 2019 ? > +{ > + > + if (uap->offset < 0 || uap->nbytes < 0 || > + (uap->flags & ~(LINUX_SYNC_FILE_RANGE_WAIT_BEFORE | > + LINUX_SYNC_FILE_RANGE_WRITE | > + LINUX_SYNC_FILE_RANGE_WAIT_AFTER)) != 0) { > + return (EINVAL); > + } > + > + return (kern_fsync(td, uap->fd, false)); > +} > + > +int > linux_pread(struct thread *td, struct linux_pread_args *uap) This function is defined using ANSI C method. > { > struct vnode *vp; > > Modified: head/sys/compat/linux/linux_file.h > ============================================================================== > --- head/sys/compat/linux/linux_file.h Sat Dec 14 13:32:37 2019 (r355753) > +++ head/sys/compat/linux/linux_file.h Sat Dec 14 13:37:17 2019 (r355754) > @@ -134,4 +134,11 @@ > #define LINUX_RENAME_EXCHANGE 0x00000002 > #define LINUX_RENAME_WHITEOUT 0x00000004 > > +/* > + * sync_file_range flags > + */ > +#define LINUX_SYNC_FILE_RANGE_WAIT_BEFORE 1 > +#define LINUX_SYNC_FILE_RANGE_WRITE 2 > +#define LINUX_SYNC_FILE_RANGE_WAIT_AFTER 4 > + > #endif /* !_LINUX_FILE_H_ */ > > Modified: head/sys/i386/linux/linux_dummy.c > ============================================================================== > --- head/sys/i386/linux/linux_dummy.c Sat Dec 14 13:32:37 2019 (r355753) > +++ head/sys/i386/linux/linux_dummy.c Sat Dec 14 13:37:17 2019 (r355754) > @@ -101,7 +101,6 @@ DUMMY(migrate_pages); > DUMMY(unshare); > /* Linux 2.6.17: */ > DUMMY(splice); > -DUMMY(sync_file_range); > DUMMY(tee); > DUMMY(vmsplice); > /* Linux 2.6.18: */ From owner-svn-src-all@freebsd.org Sat Dec 14 18:20:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85F051D3B38; Sat, 14 Dec 2019 18:20:14 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (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 47ZwnB32L9z4bpJ; Sat, 14 Dec 2019 18:20:14 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-qt1-x830.google.com with SMTP id g17so834675qtp.11; Sat, 14 Dec 2019 10:20:14 -0800 (PST) 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=pVhUfiqXM1pdl8Z46ChT9mF7qYS+xu4mpuE5lry/u+A=; b=m6PiTlsaPKclGJhRa7puQE/VoWtfHT/z9kMl7Ws7TOs84LpARHZjHLeemlFGihE78D i8c3uThMJFdTpG2CfdSCFK5bsodD2lnK9d7Z7F1nzWZEeAYlYLgQzPTyPNHCACGydjaj 3Z5Nmat+IFAUF5d+aQFu31yyXeftJs7NrMXqPwQihj8ifzzJZec02V5GKQzdXymDh3tl nFhc74z7UqF16ScyOsIGqUgvCOctgD2osp6rBQccOmV89CZHcxZzHraF+/3C8dFEnVj7 plqyY69lRBJN6PtbGSw0AX6BtKN4HyRKvnvlRrEjHgyiM6ESF4b9uKl3w4Hbzja89Jw2 8kag== 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=pVhUfiqXM1pdl8Z46ChT9mF7qYS+xu4mpuE5lry/u+A=; b=svRq5GpdfEUJjyTsKJpbmRfROOTtvZnxlVy+zWIy4ulk9ooSNNnF0LTrlm19r/Jpef haMNPhLOTPTk0VpQ1/KwQDxJGlr85qkrgjguAPtMRlWRdxTny7Zo5Dpn1yHyEzCbc/L9 hiV62CDxCAH1PiomOeUTt9RKMJiou2ofjsXoVUlkTZObwD1NbEuHw3CbCUmtCc5eFV1k cELBoCYqCeFseDUEoypPvL1hbYbNwZyocUwhvOASfH7GlR0Wg1RhJVbnnc7sBZ/Ibs8d 4mxhi58Zu3rTpHyax70Q/JTkfIyg0WTcblu8Ysy01qwysNADMXaxRRrCB6JPzkjtdtHc HXMA== X-Gm-Message-State: APjAAAVBhXllRE98qPtoQOObciI/3eClT0lOQAm/ltzjbh79TUcFB8tp KAj51+xfNYjby9bNuVjaaaHW9cidX24s8gAT2DqejQ== X-Google-Smtp-Source: APXvYqxPjINd1Q269MhWua6v009RAo3rRbrp5Qszzv+MxhtMi4s7zlf/UsicqaxpoOjlFM+SA6Nl4nGWbgssbR0TAH8= X-Received: by 2002:aed:3641:: with SMTP id e59mr224139qtb.174.1576347611838; Sat, 14 Dec 2019 10:20:11 -0800 (PST) MIME-Version: 1.0 References: <201912140828.xBE8SAXq027656@repo.freebsd.org> In-Reply-To: <201912140828.xBE8SAXq027656@repo.freebsd.org> From: Ryan Libby Date: Sat, 14 Dec 2019 10:20:00 -0800 Message-ID: Subject: Re: svn commit: r355747 - in head: . include lib/libc/stdlib lib/libxo To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47ZwnB32L9z4bpJ 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]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 18:20:14 -0000 On Sat, Dec 14, 2019 at 12:28 AM Conrad Meyer wrote: > > Author: cem > Date: Sat Dec 14 08:28:10 2019 > New Revision: 355747 > URL: https://svnweb.freebsd.org/changeset/base/355747 > > Log: > Deprecate sranddev(3) API > > It serves no useful purpose and wasn't as popular as its equally meritless > cousin, srandomdev(3). > > Setting aside the problems with rand(3) in general, the problem with this > interface is that the seed isn't shared with the caller (other than by > attacking the output of the generator, which is trivial, but not a hallmark of > pleasant API design). The (arguable) utility of rand(3) or random(3) is as a > semi-fast simulation generator which produces consistent results from a given > seed. These are mutually at odd. Furthermore, sometimes people got the > mistaken impression that a high quality random seed meant a weak generator like > rand(3) or random(3) could be used for things like cryptographic key > generation. This is absolutely not so. > > The API was never part of a standard and was not widely used in tree. Existing > in-tree uses have all been removed. > > Possible replacement in out of tree codebases: > > char buf[3]; > time_t t; > > time(t); > strftime(buf, sizeof(buf), "%S", gmtime(&t)); > srand(atoi(buf)); > > Relnotes: yes > > Modified: > head/ObsoleteFiles.inc > head/include/stdlib.h > head/lib/libc/stdlib/Makefile.inc > head/lib/libc/stdlib/Symbol.map > head/lib/libc/stdlib/rand.3 > head/lib/libc/stdlib/rand.c > head/lib/libxo/xo_config.h > > Modified: head/ObsoleteFiles.inc > ============================================================================== > --- head/ObsoleteFiles.inc Sat Dec 14 05:21:56 2019 (r355746) > +++ head/ObsoleteFiles.inc Sat Dec 14 08:28:10 2019 (r355747) > @@ -36,6 +36,8 @@ > # xargs -n1 | sort | uniq -d; > # done > > +# 20191214: Removal of sranddev(3) > +OLD_FILES+=usr/share/man/man3/sranddev.3.gz > # 20191213: remove timeout(9) > OLD_FILES+=usr/share/man/man9/timeout.9.gz > OLD_FILES+=usr/share/man/man9/untimeout.9.gz > > Modified: head/include/stdlib.h > ============================================================================== > --- head/include/stdlib.h Sat Dec 14 05:21:56 2019 (r355746) > +++ head/include/stdlib.h Sat Dec 14 08:28:10 2019 (r355747) > @@ -309,12 +309,17 @@ int rpmatch(const char *); > void setprogname(const char *); > int sradixsort(const unsigned char **, int, const unsigned char *, > unsigned); > -void sranddev(void); > void srandomdev(void); > long long > strtonum(const char *, long long, long long, const char **); > > /* Deprecated interfaces, to be removed. */ > +static inline void > +__attribute__((__deprecated__("sranddev to be removed in FreeBSD 13"))) > +sranddev(void) > +{ > +} > + This broke some gcc builds in ci. It looks like older versions of gcc don't like having an argument to deprecated. > __int64_t > strtoq(const char *, char **, int); > __uint64_t > > Modified: head/lib/libc/stdlib/Makefile.inc > ============================================================================== > --- head/lib/libc/stdlib/Makefile.inc Sat Dec 14 05:21:56 2019 (r355746) > +++ head/lib/libc/stdlib/Makefile.inc Sat Dec 14 08:28:10 2019 (r355747) > @@ -52,7 +52,7 @@ MLINKS+=insque.3 remque.3 > MLINKS+=lsearch.3 lfind.3 > MLINKS+=ptsname.3 grantpt.3 ptsname.3 unlockpt.3 > MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3 > -MLINKS+=rand.3 rand_r.3 rand.3 srand.3 rand.3 sranddev.3 > +MLINKS+=rand.3 rand_r.3 rand.3 srand.3 > MLINKS+=random.3 initstate.3 random.3 setstate.3 random.3 srandom.3 \ > random.3 srandomdev.3 > MLINKS+=radixsort.3 sradixsort.3 > > Modified: head/lib/libc/stdlib/Symbol.map > ============================================================================== > --- head/lib/libc/stdlib/Symbol.map Sat Dec 14 05:21:56 2019 (r355746) > +++ head/lib/libc/stdlib/Symbol.map Sat Dec 14 08:28:10 2019 (r355747) > @@ -56,7 +56,6 @@ FBSD_1.0 { > rand_r; > rand; > srand; > - sranddev; > srandom; > srandomdev; > initstate; > > Modified: head/lib/libc/stdlib/rand.3 > ============================================================================== > --- head/lib/libc/stdlib/rand.3 Sat Dec 14 05:21:56 2019 (r355746) > +++ head/lib/libc/stdlib/rand.3 Sat Dec 14 08:28:10 2019 (r355747) > @@ -32,13 +32,12 @@ > .\" @(#)rand.3 8.1 (Berkeley) 6/4/93 > .\" $FreeBSD$ > .\" > -.Dd April 22, 2019 > +.Dd December 14, 2019 > .Dt RAND 3 > .Os > .Sh NAME > .Nm rand , > .Nm srand , > -.Nm sranddev , > .Nm rand_r > .Nd bad random number generator > .Sh LIBRARY > @@ -47,8 +46,6 @@ > .In stdlib.h > .Ft void > .Fn srand "unsigned seed" > -.Ft void > -.Fn sranddev void > .Ft int > .Fn rand void > .Ft int > @@ -90,10 +87,6 @@ value is provided, the functions are automatically > seeded with a value of 1. > .Pp > The > -.Fn sranddev > -function initializes a seed using pseudo-random numbers obtained from the kernel. > -.Pp > -The > .Fn rand_r > function > provides the same functionality as > @@ -122,4 +115,5 @@ conform to > .Pp > The > .Fn rand_r > -function is as proposed in the POSIX.4a Draft #6 document. > +function is marked as obsolescent in POSIX and may be removed in a future > +revision of the standard. > > Modified: head/lib/libc/stdlib/rand.c > ============================================================================== > --- head/lib/libc/stdlib/rand.c Sat Dec 14 05:21:56 2019 (r355746) > +++ head/lib/libc/stdlib/rand.c Sat Dec 14 08:28:10 2019 (r355747) > @@ -40,7 +40,9 @@ __FBSDID("$FreeBSD$"); > #include "namespace.h" > #include > #include > +#include > #include > +#include > #include "un-namespace.h" > > #ifdef TEST > @@ -102,25 +104,18 @@ srand(unsigned seed) > } > > > -/* > - * sranddev: > - * > - * Many programs choose the seed value in a totally predictable manner. > - * This often causes problems. We seed the generator using pseudo-random > - * data from the kernel. > - */ > +void __sranddev_fbsd12(void); > void > -sranddev(void) > +__sranddev_fbsd12(void) > { > - int mib[2]; > - size_t len; > + static bool warned = false; > > - len = sizeof(next); > - > - mib[0] = CTL_KERN; > - mib[1] = KERN_ARND; > - sysctl(mib, 2, (void *)&next, &len, NULL, 0); > + if (!warned) { > + syslog(LOG_DEBUG, "Deprecated function sranddev() called"); > + warned = true; > + } > } > +__sym_compat(sranddev, __sranddev_fbsd12, FBSD_1.0); > > > #ifdef TEST > > Modified: head/lib/libxo/xo_config.h > ============================================================================== > --- head/lib/libxo/xo_config.h Sat Dec 14 05:21:56 2019 (r355746) > +++ head/lib/libxo/xo_config.h Sat Dec 14 08:28:10 2019 (r355747) > @@ -102,7 +102,7 @@ > #define HAVE_SRAND 1 > > /* Define to 1 if you have the `sranddev' function. */ > -#define HAVE_SRANDDEV 1 > +/* #undef HAVE_SRANDDEV */ > > /* Define to 1 if you have the header file. */ > #define HAVE_STDINT_H 1 > _______________________________________________ > 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-all@freebsd.org Sat Dec 14 18:32:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CB5D1D3E26; Sat, 14 Dec 2019 18:32:01 +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 47Zx2n0V1cz4cJc; Sat, 14 Dec 2019 18:32:01 +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 0C093C74; Sat, 14 Dec 2019 18:32:01 +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 xBEIW0ts086919; Sat, 14 Dec 2019 18:32:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBEIW0PE086918; Sat, 14 Dec 2019 18:32:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912141832.xBEIW0PE086918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 14 Dec 2019 18:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355756 - stable/12/usr.bin/gcore X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.bin/gcore X-SVN-Commit-Revision: 355756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 18:32:01 -0000 Author: markj Date: Sat Dec 14 18:32:00 2019 New Revision: 355756 URL: https://svnweb.freebsd.org/changeset/base/355756 Log: MFC r355506: gcore: Avoid using vm_map_entry_t. Modified: stable/12/usr.bin/gcore/elfcore.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/gcore/elfcore.c ============================================================================== --- stable/12/usr.bin/gcore/elfcore.c Sat Dec 14 14:56:34 2019 (r355755) +++ stable/12/usr.bin/gcore/elfcore.c Sat Dec 14 18:32:00 2019 (r355756) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include #include @@ -64,8 +62,15 @@ __FBSDID("$FreeBSD$"); * Code for generating ELF core dumps. */ -typedef void (*segment_callback)(vm_map_entry_t, void *); +struct map_entry { + struct map_entry *next; + vm_offset_t start; + vm_offset_t end; + vm_prot_t protection; +}; +typedef void (*segment_callback)(struct map_entry *, void *); + /* Closure for cb_put_phdr(). */ struct phdr_closure { Elf_Phdr *phdr; /* Program header to fill in */ @@ -101,9 +106,9 @@ typedef struct ptrace_lwpinfo elfcore_lwpinfo_t; typedef void* (*notefunc_t)(void *, size_t *); -static void cb_put_phdr(vm_map_entry_t, void *); -static void cb_size_segment(vm_map_entry_t, void *); -static void each_dumpable_segment(vm_map_entry_t, segment_callback, +static void cb_put_phdr(struct map_entry *, void *); +static void cb_size_segment(struct map_entry *, void *); +static void each_dumpable_segment(struct map_entry *, segment_callback, void *closure); static void elf_detach(void); /* atexit() handler. */ static void *elf_note_fpregset(void *, size_t *); @@ -130,12 +135,12 @@ static void *elf_note_procstat_psstrings(void *, size_ static void *elf_note_procstat_rlimit(void *, size_t *); static void *elf_note_procstat_umask(void *, size_t *); static void *elf_note_procstat_vmmap(void *, size_t *); -static void elf_puthdr(int, pid_t, vm_map_entry_t, void *, size_t, size_t, +static void elf_puthdr(int, pid_t, struct map_entry *, void *, size_t, size_t, size_t, int); static void elf_putnote(int, notefunc_t, void *, struct sbuf *); static void elf_putnotes(pid_t, struct sbuf *, size_t *); -static void freemap(vm_map_entry_t); -static vm_map_entry_t readmap(pid_t); +static void freemap(struct map_entry *); +static struct map_entry *readmap(pid_t); static void *procstat_sysctl(void *, int, size_t, size_t *sizep); static pid_t g_pid; /* Pid being dumped, global for elf_detach */ @@ -193,7 +198,7 @@ elf_detach(void) static void elf_coredump(int efd, int fd, pid_t pid) { - vm_map_entry_t map; + struct map_entry *map; struct sseg_closure seginfo; struct sbuf *sb; void *hdr; @@ -294,7 +299,7 @@ elf_coredump(int efd, int fd, pid_t pid) * program header entry. */ static void -cb_put_phdr(vm_map_entry_t entry, void *closure) +cb_put_phdr(struct map_entry *entry, void *closure) { struct phdr_closure *phc = (struct phdr_closure *)closure; Elf_Phdr *phdr = phc->phdr; @@ -324,7 +329,7 @@ cb_put_phdr(vm_map_entry_t entry, void *closure) * the number of segments and their total size. */ static void -cb_size_segment(vm_map_entry_t entry, void *closure) +cb_size_segment(struct map_entry *entry, void *closure) { struct sseg_closure *ssc = (struct sseg_closure *)closure; @@ -338,11 +343,12 @@ cb_size_segment(vm_map_entry_t entry, void *closure) * data. */ static void -each_dumpable_segment(vm_map_entry_t map, segment_callback func, void *closure) +each_dumpable_segment(struct map_entry *map, segment_callback func, + void *closure) { - vm_map_entry_t entry; + struct map_entry *entry; - for (entry = map; entry != NULL; entry = entry->next) + for (entry = map; entry != NULL; entry = entry->next) (*func)(entry, closure); } @@ -438,7 +444,7 @@ elf_putnote(int type, notefunc_t notefunc, void *arg, * Generate the ELF coredump header. */ static void -elf_puthdr(int efd, pid_t pid, vm_map_entry_t map, void *hdr, size_t hdrsize, +elf_puthdr(int efd, pid_t pid, struct map_entry *map, void *hdr, size_t hdrsize, size_t notesz, size_t segoff, int numsegs) { Elf_Ehdr *ehdr, binhdr; @@ -529,11 +535,12 @@ elf_puthdr(int efd, pid_t pid, vm_map_entry_t map, voi * Free the memory map. */ static void -freemap(vm_map_entry_t map) +freemap(struct map_entry *map) { + struct map_entry *next; while (map != NULL) { - vm_map_entry_t next = map->next; + next = map->next; free(map); map = next; } @@ -545,10 +552,10 @@ freemap(vm_map_entry_t map) * returned. The map entries in the list aren't fully filled in; only * the items we need are present. */ -static vm_map_entry_t +static struct map_entry * readmap(pid_t pid) { - vm_map_entry_t ent, *linkp, map; + struct map_entry *ent, **linkp, *map; struct kinfo_vmentry *vmentl, *kve; int i, nitems; From owner-svn-src-all@freebsd.org Sat Dec 14 19:22:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 024931D4F82; Sat, 14 Dec 2019 19:21:59 +0000 (UTC) (envelope-from pfg@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 47Zy8R68vVz4fQS; Sat, 14 Dec 2019 19:21:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.5] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id 22155BB82; Sat, 14 Dec 2019 19:21:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r355747 - in head: . include lib/libc/stdlib lib/libxo To: Ryan Libby , Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912140828.xBE8SAXq027656@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Message-ID: <7d4c68ec-97e9-8b29-ac70-f8167f31de37@FreeBSD.org> Date: Sat, 14 Dec 2019 14:21:53 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 19:22:00 -0000 On 14/12/2019 13:20, Ryan Libby wrote: > On Sat, Dec 14, 2019 at 12:28 AM Conrad Meyer wrote: >> Author: cem >> Date: Sat Dec 14 08:28:10 2019 >> New Revision: 355747 >> URL: https://svnweb.freebsd.org/changeset/base/355747 >> >> Log: >> Deprecate sranddev(3) API >> >> It serves no useful purpose and wasn't as popular as its equally meritless >> cousin, srandomdev(3). >> >> .. (cut unrelated code) >> >> Modified: head/include/stdlib.h >> ============================================================================== >> --- head/include/stdlib.h Sat Dec 14 05:21:56 2019 (r355746) >> +++ head/include/stdlib.h Sat Dec 14 08:28:10 2019 (r355747) >> @@ -309,12 +309,17 @@ int rpmatch(const char *); >> void setprogname(const char *); >> int sradixsort(const unsigned char **, int, const unsigned char *, >> unsigned); >> -void sranddev(void); >> void srandomdev(void); >> long long >> strtonum(const char *, long long, long long, const char **); >> >> /* Deprecated interfaces, to be removed. */ >> +static inline void >> +__attribute__((__deprecated__("sranddev to be removed in FreeBSD 13"))) >> +sranddev(void) >> +{ >> +} >> + > This broke some gcc builds in ci. It looks like older versions of gcc > don't like having an argument to deprecated. FWIW, the msg argument for __deprecated__ appeared in GCC 4.5. Pedro. From owner-svn-src-all@freebsd.org Sat Dec 14 19:28:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3A311D5289 for ; Sat, 14 Dec 2019 19:28:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (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 47ZyHd0ly2z4flp for ; Sat, 14 Dec 2019 19:28:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x832.google.com with SMTP id j5so2179351qtq.9 for ; Sat, 14 Dec 2019 11:28:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CR24ckpewZdjYMNelax3MWbcJ+vLZz6wVxjwYah6JnI=; b=jBgBU0VNSpISKHPAK1FpYI9BlH8Vh/9crGj7lCA0LbYR1LnPXcTZKEx/qnFCu96ExU Mv6zCmsIQvxsaRVEhDxh2iw9yCTFIvdbP/1Uy74jtqOpzPKfbwvKtIPktEBvbYGekBlj rKDexFp1bX20Rtuz9WUnJO4JsYxaE8nMcMgiiGBFpIYowe5yTtX6qS6D/YPhRSuiDk71 brKy4QiHxXXu77m3HB7dTH1BlGpoD5FCpGDTXtmLM8ykywkh2Fg+SWY0sLIblBc3f3r2 JxA5VsS0igkS3pgmGhYG7UX008omGgia0fQZMj3/3Df6jS8PTuklB3ijLfcHiNXLN3sk 064Q== 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=CR24ckpewZdjYMNelax3MWbcJ+vLZz6wVxjwYah6JnI=; b=ohjZM4YDrnXVhsco0zQ2oNWne8WtmHi0/HnEnPOR9AMDf/U76JkZHxkGPpV16fV8nh ZJVB1Z7FO5VBawb7Ip6hWPrwM0L068Swhwtk2DNSh4VNGr6+ZCyhcM/scQ/4EJOsfjTD vP3AD7j6piLvt5dwsNyWXCFqW2SEJc5mLJnTKzbuFeGUdSnTBEIq/cSASvgtGI/502cf 145f7E978S9zum8IG/YImUgk3DVEpN0HiCLpcl+aWDsMQixWsN1FcNmEw3/VutVa+PPD 8OLus3WZ35LgeLJr9dQIlHnz9eTY5An/yAjZVYjfDT2i7GukLbPP85mGREOXMM0WRKyl tH+g== X-Gm-Message-State: APjAAAV0lsEsz5W+NFHPojDLEmxeBoH14tI3GhtqyNr325Yz+rWJx/z/ Maf+UYVAmypMoRWOpmBZpypFwcfXkvE3/WTl1mFucQ== X-Google-Smtp-Source: APXvYqzbMYjSiOje1Dpn764D5CrVbO6GMPOd8z1tNtgOFTRLxq6OMgU0lzMWMHHZtR2CgEfo58biGgKAGRwgCnC7+8k= X-Received: by 2002:ac8:68c:: with SMTP id f12mr2567110qth.187.1576351690506; Sat, 14 Dec 2019 11:28:10 -0800 (PST) MIME-Version: 1.0 References: <201912140828.xBE8SAXq027656@repo.freebsd.org> <7d4c68ec-97e9-8b29-ac70-f8167f31de37@FreeBSD.org> In-Reply-To: <7d4c68ec-97e9-8b29-ac70-f8167f31de37@FreeBSD.org> From: Warner Losh Date: Sat, 14 Dec 2019 12:27:59 -0700 Message-ID: Subject: Re: svn commit: r355747 - in head: . include lib/libc/stdlib lib/libxo To: Pedro Giffuni Cc: Ryan Libby , Conrad Meyer , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47ZyHd0ly2z4flp X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=jBgBU0VN; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::832) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.70 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2.3.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.70)[ip: (-9.36), ipnet: 2607:f8b0::/32(-2.20), asn: 15169(-1.91), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_CC(0.00)[gmail.com] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 19:28:14 -0000 On Sat, Dec 14, 2019 at 12:22 PM Pedro Giffuni wrote: > > On 14/12/2019 13:20, Ryan Libby wrote: > > On Sat, Dec 14, 2019 at 12:28 AM Conrad Meyer wrote: > >> Author: cem > >> Date: Sat Dec 14 08:28:10 2019 > >> New Revision: 355747 > >> URL: https://svnweb.freebsd.org/changeset/base/355747 > >> > >> Log: > >> Deprecate sranddev(3) API > >> > >> It serves no useful purpose and wasn't as popular as its equally > meritless > >> cousin, srandomdev(3). > >> > >> .. (cut unrelated code) > >> > >> Modified: head/include/stdlib.h > >> > ============================================================================== > >> --- head/include/stdlib.h Sat Dec 14 05:21:56 2019 > (r355746) > >> +++ head/include/stdlib.h Sat Dec 14 08:28:10 2019 > (r355747) > >> @@ -309,12 +309,17 @@ int rpmatch(const char *); > >> void setprogname(const char *); > >> int sradixsort(const unsigned char **, int, const unsigned char *, > >> unsigned); > >> -void sranddev(void); > >> void srandomdev(void); > >> long long > >> strtonum(const char *, long long, long long, const char **); > >> > >> /* Deprecated interfaces, to be removed. */ > >> +static inline void > >> +__attribute__((__deprecated__("sranddev to be removed in FreeBSD 13"))) > >> +sranddev(void) > >> +{ > >> +} > >> + > > This broke some gcc builds in ci. It looks like older versions of gcc > > don't like having an argument to deprecated. > > FWIW, the msg argument for __deprecated__ appeared in GCC 4.5. > Maybe sys/cdefs.h should define a __DEPRECATED for such differences? It's not like __attribute__ is a standard thing anyway... Warner From owner-svn-src-all@freebsd.org Sat Dec 14 19:44:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 081DC1D57FF; Sat, 14 Dec 2019 19:44:43 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 47Zyff6THDz3C8K; Sat, 14 Dec 2019 19:44:42 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9932196A; Sat, 14 Dec 2019 19:44:42 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBEJigTT029385; Sat, 14 Dec 2019 19:44:42 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBEJigPm029384; Sat, 14 Dec 2019 19:44:42 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201912141944.xBEJigPm029384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sat, 14 Dec 2019 19:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355757 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 19:44:43 -0000 Author: dougm Date: Sat Dec 14 19:44:42 2019 New Revision: 355757 URL: https://svnweb.freebsd.org/changeset/base/355757 Log: Simplify the processing a leaf mask to find big-enough ranges of set bits, by storing and modifying the complement of the original leaf mask, and by avoiding some unnecessary intermediate variables in computing the shift amounts. The logic is similar to what has recently been committed to sys/sys/bitstring.h. Compute better hint updates for the case when the cursor starts in mid-leaf, and eliminates some otherwise viable solutions. Assume the worst case, that all the eliminated offsets could have been solutions, and you can still compute a better hint than we use now. Eliminate some unnecessary conditional control flow. Approved by: alc Tested by: pho Differential Revision: https://reviews.freebsd.org/D22666 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Sat Dec 14 18:32:00 2019 (r355756) +++ head/sys/kern/subr_blist.c Sat Dec 14 19:44:42 2019 (r355757) @@ -695,19 +695,6 @@ blst_next_leaf_alloc(blmeta_t *scan, daddr_t start, in } /* - * Given a bitmask, flip all the bits from the least-significant 1-bit to the - * most significant bit. If the result is non-zero, then the least-significant - * 1-bit of the result is in the same position as the least-signification 0-bit - * in mask that is followed by a 1-bit. - */ -static inline u_daddr_t -flip_hibits(u_daddr_t mask) -{ - - return (-mask & ~mask); -} - -/* * BLST_LEAF_ALLOC() - allocate at a leaf in the radix tree (a bitmap). * * This function is the core of the allocator. Its execution time is @@ -717,84 +704,73 @@ flip_hibits(u_daddr_t mask) static daddr_t blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int *count, int maxcount) { - u_daddr_t cursor_mask, mask; - int count1, hi, lo, num_shifts, range1, range_ext; + u_daddr_t mask; + int bighint, count1, hi, lo, num_shifts; - range1 = 0; count1 = *count - 1; num_shifts = fls(count1); - mask = scan->bm_bitmap; - while (flip_hibits(mask) != 0 && num_shifts > 0) { + mask = ~scan->bm_bitmap; + while ((mask & (mask + 1)) != 0 && num_shifts > 0) { /* - * If bit i is set in mask, then bits in [i, i+range1] are set - * in scan->bm_bitmap. The value of range1 is equal to count1 - * >> num_shifts. Grow range1 and reduce num_shifts to 0, - * while preserving these invariants. The updates to mask - * leave fewer bits set, but each bit that remains set - * represents a longer string of consecutive bits set in - * scan->bm_bitmap. If more updates to mask cannot clear more - * bits, because mask is partitioned with all 0 bits preceding - * all 1 bits, the loop terminates immediately. + * If bit i is 0 in mask, then bits in [i, i + (count1 >> + * num_shifts)] are 1 in scan->bm_bitmap. Reduce num_shifts to + * 0, while preserving this invariant. The updates to mask + * leave fewer bits 0, but each bit that remains 0 represents a + * longer string of consecutive 1-bits in scan->bm_bitmap. If + * more updates to mask cannot set more bits, because mask is + * partitioned with all 1 bits following all 0 bits, the loop + * terminates immediately. */ num_shifts--; - range_ext = range1 + ((count1 >> num_shifts) & 1); - /* - * mask is a signed quantity for the shift because when it is - * shifted right, the sign bit should copied; when the last - * block of the leaf is free, pretend, for a while, that all the - * blocks that follow it are also free. - */ - mask &= (daddr_t)mask >> range_ext; - range1 += range_ext; + mask |= mask >> ((count1 >> num_shifts) + 1) / 2; } - if (mask == 0) { + bighint = count1 >> num_shifts; + if (~mask == 0) { /* - * Update bighint. There is no allocation bigger than range1 - * starting in this leaf. + * Update bighint. There is no allocation bigger than + * count1 >> num_shifts starting in this leaf. */ - scan->bm_bighint = range1; + scan->bm_bighint = bighint; return (SWAPBLK_NONE); } /* Discard any candidates that appear before blk. */ if ((blk & BLIST_BMAP_MASK) != 0) { - cursor_mask = mask & bitrange(0, blk & BLIST_BMAP_MASK); - if (cursor_mask != 0) { - mask ^= cursor_mask; - if (mask == 0) + if ((~mask & bitrange(0, blk & BLIST_BMAP_MASK)) != 0) { + /* Grow bighint in case all discarded bits are set. */ + bighint += blk & BLIST_BMAP_MASK; + mask |= bitrange(0, blk & BLIST_BMAP_MASK); + if (~mask == 0) { + scan->bm_bighint = bighint; return (SWAPBLK_NONE); - - /* - * Bighint change for last block allocation cannot - * assume that any other blocks are allocated, so the - * bighint cannot be reduced much. - */ - range1 = BLIST_MAX_ALLOC - 1; + } } - blk &= ~BLIST_BMAP_MASK; + blk -= blk & BLIST_BMAP_MASK; } /* * The least significant set bit in mask marks the start of the first * available range of sufficient size. Find its position. */ - lo = bitpos(mask); + lo = bitpos(~mask); /* * Find how much space is available starting at that position. */ - if (flip_hibits(mask) != 0) { + if ((mask & (mask + 1)) != 0) { /* Count the 1 bits starting at position lo. */ - hi = bitpos(flip_hibits(mask)) + count1; + hi = bitpos(mask & (mask + 1)) + count1; if (maxcount < hi - lo) hi = lo + maxcount; *count = hi - lo; - mask = bitrange(lo, *count); + mask = ~bitrange(lo, *count); } else if (maxcount <= BLIST_BMAP_RADIX - lo) { /* All the blocks we can use are available here. */ hi = lo + maxcount; *count = maxcount; - mask = bitrange(lo, *count); + mask = ~bitrange(lo, *count); + if (hi == BLIST_BMAP_RADIX) + scan->bm_bighint = bighint; } else { /* Check next leaf for some of the blocks we want or need. */ count1 = *count - (BLIST_BMAP_RADIX - lo); @@ -811,18 +787,11 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int *coun */ return (SWAPBLK_NONE); *count = BLIST_BMAP_RADIX - lo + hi; - hi = BLIST_BMAP_RADIX; + scan->bm_bighint = bighint; } - if (hi == BLIST_BMAP_RADIX) { - /* - * Update bighint. There is no allocation bigger than range1 - * available in this leaf after this allocation completes. - */ - scan->bm_bighint = range1; - } /* Clear the allocated bits from this leaf. */ - scan->bm_bitmap &= ~mask; + scan->bm_bitmap &= mask; return (blk + lo); } From owner-svn-src-all@freebsd.org Sat Dec 14 19:54:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE4391D5B3E; Sat, 14 Dec 2019 19:54:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (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 47ZytN6MMPz3Cd0; Sat, 14 Dec 2019 19:54:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f45.google.com with SMTP id 77so3589271oty.6; Sat, 14 Dec 2019 11:54:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=D0qrYWLZYApIePW8o7nuHNGo9VqVIjOjCixj0Ty+9AA=; b=F1HszFRq/5ml2Oee2WTWoyz/Sv8AnIHFAKP2Sn4JZD1iIfPifD5jpZUNi6/vyl5JiK rxObsdhJbligaViPza7WCZp7oTzwNJTgoNUDlfNiPuQE/MDQMfWmm6gSrV2DhE5JgUEK 1SIngwM62VhsOAjijzuUkcJk94PvKRxusykH8COFmRSqBaAfTrNd/XnCJAAM7tSnNo6E vyHBF+n8Z3FPWBVCGvsRzSR1Ub+gZ82dSBp7svUpKaMK3I4Z1h0GRvtEh60E7XRhejyW Y+aIF3/lNQMuyWxnCqcxan5Jdne7wKhqduMsYm7Uru6+d7nkyDlZ61g0CI37dWAqAnvI iBjw== X-Gm-Message-State: APjAAAVDf87y+CE0zuXbaX/nPRabBnpqKrGSmUQ0JSJwsouwwK3Y8Lso j5LnEJDz8TQO66WQU3rCKjc6k2lY X-Google-Smtp-Source: APXvYqy6nQnuOOk26udqq7HixJGtGboD2oAzUzAt9/xy6gWS0CaptRLCyRrMRr75Agz2Wxo3yYnNuA== X-Received: by 2002:a9d:70d2:: with SMTP id w18mr23547955otj.48.1576353291473; Sat, 14 Dec 2019 11:54:51 -0800 (PST) Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com. [209.85.210.42]) by smtp.gmail.com with ESMTPSA id s9sm4757977oic.15.2019.12.14.11.54.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 14 Dec 2019 11:54:51 -0800 (PST) Received: by mail-ot1-f42.google.com with SMTP id x3so3554191oto.11; Sat, 14 Dec 2019 11:54:51 -0800 (PST) X-Received: by 2002:a9d:7593:: with SMTP id s19mr21114124otk.219.1576353290946; Sat, 14 Dec 2019 11:54:50 -0800 (PST) MIME-Version: 1.0 References: <201912140828.xBE8SAXq027656@repo.freebsd.org> <7d4c68ec-97e9-8b29-ac70-f8167f31de37@FreeBSD.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sat, 14 Dec 2019 11:54:40 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r355747 - in head: . include lib/libc/stdlib lib/libxo To: Warner Losh Cc: Pedro Giffuni , Ryan Libby , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47ZytN6MMPz3Cd0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.210.45 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-2.10 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; RWL_MAILSPIKE_GOOD(0.00)[45.210.85.209.rep.mailspike.net : 127.0.0.18]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; 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)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.988,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[45.210.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.12)[ip: (-0.50), ipnet: 209.85.128.0/17(-3.13), asn: 15169(-1.91), country: US(-0.05)]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 19:54:53 -0000 I agree, a cdefs.h definition would be pleasant even if gcc4 isn=E2=80=99t = a factor (and it=E2=80=99s not in about two weeks). I=E2=80=99ll go ahead and do tha= t. On Sat, Dec 14, 2019 at 11:28 Warner Losh wrote: > > > On Sat, Dec 14, 2019 at 12:22 PM Pedro Giffuni wrote: > >> >> On 14/12/2019 13:20, Ryan Libby wrote: >> > On Sat, Dec 14, 2019 at 12:28 AM Conrad Meyer wrote: >> >> Author: cem >> >> Date: Sat Dec 14 08:28:10 2019 >> >> New Revision: 355747 >> >> URL: https://svnweb.freebsd.org/changeset/base/355747 >> >> >> >> Log: >> >> Deprecate sranddev(3) API >> >> >> >> It serves no useful purpose and wasn't as popular as its equally >> meritless >> >> cousin, srandomdev(3). >> >> >> >> .. (cut unrelated code) >> >> >> >> Modified: head/include/stdlib.h >> >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> >> --- head/include/stdlib.h Sat Dec 14 05:21:56 2019 >> (r355746) >> >> +++ head/include/stdlib.h Sat Dec 14 08:28:10 2019 >> (r355747) >> >> @@ -309,12 +309,17 @@ int rpmatch(const char *); >> >> void setprogname(const char *); >> >> int sradixsort(const unsigned char **, int, const unsigned char >> *, >> >> unsigned); >> >> -void sranddev(void); >> >> void srandomdev(void); >> >> long long >> >> strtonum(const char *, long long, long long, const char **); >> >> >> >> /* Deprecated interfaces, to be removed. */ >> >> +static inline void >> >> +__attribute__((__deprecated__("sranddev to be removed in FreeBSD >> 13"))) >> >> +sranddev(void) >> >> +{ >> >> +} >> >> + >> > This broke some gcc builds in ci. It looks like older versions of gcc >> > don't like having an argument to deprecated. >> >> FWIW, the msg argument for __deprecated__ appeared in GCC 4.5. >> > > Maybe sys/cdefs.h should define a __DEPRECATED for such differences? It's > not like __attribute__ is a standard thing anyway... > > Warner > From owner-svn-src-all@freebsd.org Sat Dec 14 20:06:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B71B91D605F for ; Sat, 14 Dec 2019 20:06:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (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 47Zz873dzhz3DFt for ; Sat, 14 Dec 2019 20:06:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x834.google.com with SMTP id k40so2055169qtk.8 for ; Sat, 14 Dec 2019 12:06:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FQ93ORcNGz2OaFUyiYHj5YS1mtix6rv/iY5IKeSb4N8=; b=xfOOkUfFwGUo5qAUImKgMX2taJ50E25ANaHTxnOPEiwDKqfHyGz7uW8IsGEwwZMrdZ koUBGrjn9oFzJGf8nZn7KxOZssoDFSJstm+UGauzMEhAce0jgcnebOS5UJ82Ltoc5Hp1 JQIWrE+4ssOIhI1ktkogWmigHh9gZuBsfA0QAgljnQIcVtP/iJjkWJCDHiGzKv2fLMqA X1cRkqPJ7JsAgWj5WaZzpv1fxVjXK0pNzxMU8ajI4/qd1XlJi7xxlLapDbdlH9+9i3mr T5lZVYHlKnnawnjK2gkEeTftrxp3qY+mUtNhJ7OABN1ZtEmkY1ABCsaTpEYqb824x/7T mW7Q== 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=FQ93ORcNGz2OaFUyiYHj5YS1mtix6rv/iY5IKeSb4N8=; b=cWbPRmvvxtad9VRwuOOW/X8O3hx9q+JsBnEmOslJB06V9BFtjfSBeyUYM0f0ot+GWR qWYk/p2Fo3JWm6qDCX19BKnog1MVSjjtdDk3FlKn4tTHAFgRorOKN/RJd/DNEm/mecuQ k53H0/vC3snT9mvPyBhpgMKBaHSd8Ojz8J6FGe1M03YIpn+oqrqNtMQTKR11qb0xZCHa E+LGpzK0LRMTSXlXq/A+X8uiH2tNl4e0pnRssuhoSfC9v+3xwEA6XFyq7pn0+elXuLYe 6/qDcFAIGwG/tV0ftsP6jXl5JUELBXEVS3jJcvO23X/2tzNEZ8uXguMKDrUE+0/dFWl3 x7Ig== X-Gm-Message-State: APjAAAWyZfn12lez9UfjB2oPkJfIKq7fEgMM4+pzqnCX9PqaT/y9JIyp stCTHCsuqnT2xnS61QSXCbyKbWTC3Wyimq9Dx7I5yA== X-Google-Smtp-Source: APXvYqznCTgBoCxwqdtUYGM/JSPYVfrBaAb/RFVAMQQf29kIkvAFo1lPA64Y+8D4Wxzm54jh+/HrA2+x703htdAxRwQ= X-Received: by 2002:ac8:23af:: with SMTP id q44mr13386142qtq.175.1576354006346; Sat, 14 Dec 2019 12:06:46 -0800 (PST) MIME-Version: 1.0 References: <201912140828.xBE8SAXq027656@repo.freebsd.org> <7d4c68ec-97e9-8b29-ac70-f8167f31de37@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Sat, 14 Dec 2019 13:06:33 -0700 Message-ID: Subject: Re: svn commit: r355747 - in head: . include lib/libc/stdlib lib/libxo To: "Conrad E. Meyer" Cc: Pedro Giffuni , Ryan Libby , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47Zz873dzhz3DFt X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=xfOOkUfF; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::834) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.70 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.3.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.71)[ip: (-9.37), ipnet: 2607:f8b0::/32(-2.20), asn: 15169(-1.91), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 20:06:48 -0000 Thanks. Put me on the review :) Warner On Sat, Dec 14, 2019, 12:54 PM Conrad Meyer wrote: > I agree, a cdefs.h definition would be pleasant even if gcc4 isn=E2=80=99= t a > factor (and it=E2=80=99s not in about two weeks). I=E2=80=99ll go ahead a= nd do that. > > On Sat, Dec 14, 2019 at 11:28 Warner Losh wrote: > >> >> >> On Sat, Dec 14, 2019 at 12:22 PM Pedro Giffuni wrote: >> >>> >>> On 14/12/2019 13:20, Ryan Libby wrote: >>> > On Sat, Dec 14, 2019 at 12:28 AM Conrad Meyer wrote= : >>> >> Author: cem >>> >> Date: Sat Dec 14 08:28:10 2019 >>> >> New Revision: 355747 >>> >> URL: https://svnweb.freebsd.org/changeset/base/355747 >>> >> >>> >> Log: >>> >> Deprecate sranddev(3) API >>> >> >>> >> It serves no useful purpose and wasn't as popular as its equally >>> meritless >>> >> cousin, srandomdev(3). >>> >> >>> >> .. (cut unrelated code) >>> >> >>> >> Modified: head/include/stdlib.h >>> >> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> >> --- head/include/stdlib.h Sat Dec 14 05:21:56 2019 >>> (r355746) >>> >> +++ head/include/stdlib.h Sat Dec 14 08:28:10 2019 >>> (r355747) >>> >> @@ -309,12 +309,17 @@ int rpmatch(const char *); >>> >> void setprogname(const char *); >>> >> int sradixsort(const unsigned char **, int, const unsigned cha= r >>> *, >>> >> unsigned); >>> >> -void sranddev(void); >>> >> void srandomdev(void); >>> >> long long >>> >> strtonum(const char *, long long, long long, const char **)= ; >>> >> >>> >> /* Deprecated interfaces, to be removed. */ >>> >> +static inline void >>> >> +__attribute__((__deprecated__("sranddev to be removed in FreeBSD >>> 13"))) >>> >> +sranddev(void) >>> >> +{ >>> >> +} >>> >> + >>> > This broke some gcc builds in ci. It looks like older versions of gc= c >>> > don't like having an argument to deprecated. >>> >>> FWIW, the msg argument for __deprecated__ appeared in GCC 4.5. >>> >> >> Maybe sys/cdefs.h should define a __DEPRECATED for such differences? It'= s >> not like __attribute__ is a standard thing anyway... >> >> Warner >> > From owner-svn-src-all@freebsd.org Sat Dec 14 21:49:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 512E21D7C2E; Sat, 14 Dec 2019 21:49:48 +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 47b1R01WdCz3J3W; Sat, 14 Dec 2019 21:49:48 +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 2F1A72EB5; Sat, 14 Dec 2019 21:49:48 +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 xBELnmdW000328; Sat, 14 Dec 2019 21:49:48 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBELnmbg000327; Sat, 14 Dec 2019 21:49:48 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912142149.xBELnmbg000327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 14 Dec 2019 21:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355758 - head/sbin/mount_nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sbin/mount_nfs X-SVN-Commit-Revision: 355758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 21:49:48 -0000 Author: rmacklem Date: Sat Dec 14 21:49:47 2019 New Revision: 355758 URL: https://svnweb.freebsd.org/changeset/base/355758 Log: Update the mount_nfs.8 man page to include NFSv4.2. r355677 added NFSv4.2 support to the NFS client. This patch updates the mount_nfs.8 man page to reflect that. It also clarifies that the "nolockd" option does not apply to NFSv4 mounts. This is a content change. Modified: head/sbin/mount_nfs/mount_nfs.8 Modified: head/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- head/sbin/mount_nfs/mount_nfs.8 Sat Dec 14 19:44:42 2019 (r355757) +++ head/sbin/mount_nfs/mount_nfs.8 Sat Dec 14 21:49:47 2019 (r355758) @@ -28,7 +28,7 @@ .\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd April 13, 2017 +.Dd December 14, 2019 .Dt MOUNT_NFS 8 .Os .Sh NAME @@ -59,9 +59,11 @@ on to the file system tree at the point .Ar node . This command is normally executed by .Xr mount 8 . -It implements the mount protocol as described in RFC 1094, Appendix A and -.%T "NFS: Network File System Version 3 Protocol Specification" , -Appendix I. +For NFSv2 and NFSv3, +it implements the mount protocol as described in RFC 1094, Appendix A and +RFC 1813, Appendix I. +For NFSv4, it uses the NFSv4 protocol as described in RFC 7530, RFC 5661 and +RFC 7862. .Pp By default, .Nm @@ -197,20 +199,20 @@ This option will force the mount to use TCP transport. .It Cm minorversion Ns = Ns Aq Ar value Override the default of 0 for the minor version of the NFS Version 4 protocol. -The only minor version currently supported is 1. +The minor versions other than 0 currently supported are 1 and 2. This option is only meaningful when used with the .Cm nfsv4 option. .It Cm oneopenown -Make a minor version 1 of the NFS Version 4 protocol mount use a single OpenOwner -for all Opens. +Make a minor version 1 or 2 of the NFS Version 4 protocol mount use a single +OpenOwner for all Opens. This may be useful for a server with a very low limit on OpenOwners, such as AmazonEFS. -It can only be used with an NFSv4.1 mount. +It ca only be used with an NFSv4.1 or NFSv4.2 mount. It may not work correctly when Delegations are being issued by a server, but note that the AmazonEFS server does not issued delegations at this time. .It Cm pnfs -Enable support for parallel NFS (pNFS) for minor version 1 of the +Enable support for parallel NFS (pNFS) for minor version 1 or 2 of the NFS Version 4 protocol. This option is only meaningful when used with the .Cm minorversion @@ -250,9 +252,9 @@ Do .Em not forward .Xr fcntl 2 -locks over the wire. +locks over the wire via the NLM protocol for NFSv3 mounts. All locks will be local and not seen by the server -and likewise not seen by other NFS clients. +and likewise not seen by other NFS clients for NFSv3 mounts. This removes the need to run the .Xr rpcbind 8 service and the @@ -263,6 +265,9 @@ servers on the client. Note that this option will only be honored when performing the initial mount, it will be silently ignored if used while updating the mount options. +Also, note that NFSv4 mounts do not use these daemons and handle locks over the +wire in the NFSv4 protocol. +As such, this option is meaningless for NFSv4 mounts. .It Cm noncontigwr This mount option allows the NFS client to combine non-contiguous byte ranges being written From owner-svn-src-all@freebsd.org Sat Dec 14 21:52:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 385C01D7E32; Sat, 14 Dec 2019 21:52:50 +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 47b1VV0W1Kz3JPs; Sat, 14 Dec 2019 21:52:50 +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 0CCA8306C; Sat, 14 Dec 2019 21:52:50 +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 xBELqnEv005847; Sat, 14 Dec 2019 21:52:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBELqnYJ005845; Sat, 14 Dec 2019 21:52:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912142152.xBELqnYJ005845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 14 Dec 2019 21:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355759 - in head: include sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: include sys/sys X-SVN-Commit-Revision: 355759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 21:52:50 -0000 Author: cem Date: Sat Dec 14 21:52:49 2019 New Revision: 355759 URL: https://svnweb.freebsd.org/changeset/base/355759 Log: cdefs: Add __deprecated(message) function attribute macro The legacy version of GCC4 currently in base does not support the parameterized form of this function attribute, as recent introduced in stdlib.h (r355747). As we have done for other function attributes with similar compatibility problems, add a version-compatibile definition in sys/cdefs.h. Note that Clang defines itself to be GCC 4, so one must check for __clang__ in addition to __GNUC__ version. On legacy GCC 4, the macro expands to just the __deprecated__ attribute; on modern GCC or Clang, the macro expands to the parameterized variant with the message. Ignoring legacy or unsupported compilers, the macro is also beneficial in that it is a bit more ergonomic than the full __attribute__((__deprecated__())) boilerplate. Reported by: CI (but not tinderbox); imp and others Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D22817 Modified: head/include/stdlib.h head/sys/sys/cdefs.h Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Sat Dec 14 21:49:47 2019 (r355758) +++ head/include/stdlib.h Sat Dec 14 21:52:49 2019 (r355759) @@ -315,7 +315,7 @@ long long /* Deprecated interfaces, to be removed. */ static inline void -__attribute__((__deprecated__("sranddev to be removed in FreeBSD 13"))) +__deprecated("sranddev to be removed in FreeBSD 13") sranddev(void) { } Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sat Dec 14 21:49:47 2019 (r355758) +++ head/sys/sys/cdefs.h Sat Dec 14 21:52:49 2019 (r355759) @@ -468,6 +468,14 @@ #define __hidden #endif +#if __GNUC__ > 4 || defined(__clang__) +#define __deprecated(m) __attribute__((__deprecated__(m))) +#elif defined(__GNUC__) +#define __deprecated(m) __attribute__((__deprecated__)) +#else +#define __deprecated(m) +#endif + /* * We define this here since , , and * require it. From owner-svn-src-all@freebsd.org Sat Dec 14 23:39:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1BDEC1D9E70; Sat, 14 Dec 2019 23:39:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_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 47b3sd004Zz3NgX; Sat, 14 Dec 2019 23:39: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 EAA1344D8; Sat, 14 Dec 2019 23:39: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 xBENdWF7064962; Sat, 14 Dec 2019 23:39:32 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBENdWwU064961; Sat, 14 Dec 2019 23:39:32 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912142339.xBENdWwU064961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 14 Dec 2019 23:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355760 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 355760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 23:39:33 -0000 Author: cem Date: Sat Dec 14 23:39:32 2019 New Revision: 355760 URL: https://svnweb.freebsd.org/changeset/base/355760 Log: linuxkpi: Drop incompatible __deprecated definition Probably all of these linuxkpi stubs should be '#ifndef' guarded, but maybe that would prevent people from noticing when they are defined. Introduced in r355759. For some reason I only ran a buildworld and not a kernel. Mea culpa. Reported by: Mark Millard X-MFC-with: r355759 Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/compiler.h Sat Dec 14 21:52:49 2019 (r355759) +++ head/sys/compat/linuxkpi/common/include/linux/compiler.h Sat Dec 14 23:39:32 2019 (r355760) @@ -50,7 +50,6 @@ #define __cond_lock(x,c) (c) #define __bitwise #define __devinitdata -#define __deprecated #define __init #define __initconst #define __devinit