From owner-svn-src-head@freebsd.org Sun Dec 8 00:02:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 00:06:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 01:15:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 01:16:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 01:17:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 01:20:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 01:47:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 01:49:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 01:49:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 01:55:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 02:11:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 04:17:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 04:36:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 16:59:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 20:13:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 20:36:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 20:42:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 21:08:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 21:11:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 21:12:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 21:13:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 21:30:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Dec 8 22:33:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Mon Dec 9 00:30:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 01:32:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 02:29:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 03:02:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 03:07:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 03:09:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 04:15:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 05:09:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 07:18:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 10:21:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 10:30:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 13:09:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 13:40:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 13:59:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 14:38:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 15:23:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 17:34:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 17:58:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 19:00:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 19:10:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 19:17:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 19:17:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 19:18:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 19:25:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 20:01:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 21:55:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 23:28:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Dec 9 23:36:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Tue Dec 10 00:08:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 02:19:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 03:42:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 07:45:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 08:16:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 08:28:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 10:35:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 12:12:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 13:52:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 14:07:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 14:35:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 15:22:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 16:45:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 18:14:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 18:15:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 18:50:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 18:57:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 19:16:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 19:24:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 802BC1E27C6 for ; Tue, 10 Dec 2019 19:24:11 +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 47XVNq2qRjz48jg 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 4A0FE9E4C 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 k6so17462076qki.5 for ; Tue, 10 Dec 2019 11:24:11 -0800 (PST) X-Gm-Message-State: APjAAAVLwUwjiTNNBAbRyWKVQU4lWh2xo1pgJ/QjaoL7wFOOGBQiAscp eU0sfi9e5wrPTiqb/IVpulpfYuS70pK1de0Fnr0= X-Received: by 2002:a37:4fd0:: with SMTP id d199mt33252985qkb.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 19:52:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 20:01:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 20:02:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 20:04:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 20:11:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 20:12:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 20:23:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 20:51:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 21:48:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 21:56:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 21:58:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 22:06:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 22:10:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 22:11:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 22:47:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Dec 10 23:41:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Wed Dec 11 06:50:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 08:32:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 09:26:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 09:34:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 14:54:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 15:42:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 15:52:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 16:09:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 16:43:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 17:19:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 17:19:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 17:28:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 17:32:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 17:35:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 17:37:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 17:38:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 17:38:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 17:43:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DD4D1DC4B5 for ; Wed, 11 Dec 2019 17:43:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (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 47Y45n2tkWz4Pvp for ; Wed, 11 Dec 2019 17:43:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82f.google.com with SMTP id v2so6983002qtv.8 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=l8GFeyyEmP8qlFp4xVKF1ivQgyAJw/lrBS8Pc9atChApJeMb29pYMufVbBRa28aRTV Nlq/lOwmrw1UMqyDAZl8cd/qH5uaojOMhAS08ALkpb482iTPtOnJdUNDOvhlT/YdtpME H3+yzg12mVQ96yCLW9/EYL3Ml2qyaV4AIF4Ugf51PDDpxGTiJhJsHTLNH8q3UhSx1L6i Bnc5jmWyHA3vNDJswz7ZrDzuHm40aTYZnj20NM26taQ6VJflTAYWUotSizClRasS2gRz Brz2S4yWHQy5qoAcA1aKTvwMcgKJOo6NVz2TkIVN+meVQxOnyWvuheiyw3ET+BA5tUyj AGdw== X-Gm-Message-State: APjAAAVxWHPEIN9RULtYsox6dLMS/JaApP2VDodJEpg6lv2xp36q5Jzo 9axfCeaAI/FNUvkZ8k7xru0j2Dgyg2Fwg2Pi/2ZAUA== 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: 47Y45n2tkWz4Pvp 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::82f) 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-head@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)[f.2.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.32), 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 17:48:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 17:52:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 18:21:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 18:24:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 18:36:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 18:39:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 18:41:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 18:43:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 18:50:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 19:32:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 19:40:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 22:00:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 22:09:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 22:51:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 23:09:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 23:11:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Wed Dec 11 23:41:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 00:14:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 00:51:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 01:33:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 01:35:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 01:41:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 02:18:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 02:42:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 02:43:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 04:44:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 04:47:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 05:11:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 13:02:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 13:21:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 13:28:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 14:52:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 16:49:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 17:12:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 17:40:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 18:27:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 18:45:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 19:23:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 19:33:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 19:37:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 20:44:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 20:44:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 20:55:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 21:13:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 21:33:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 22:59:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 23:22:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 23:33:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 23:37:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 23:46:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Thu Dec 12 23:55:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 00:14:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 00:45:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 01:17:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 01:34:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 01:38:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 02:15:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 02:18:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 02:20:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 04:03:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 04:12:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 04:37:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 04:48:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 04:55:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 05:11:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 05:13:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 05:15:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 05:42:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 05:54:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 08:20:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 08:41:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 09:28:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 09:32:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 09:32:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 09:32:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 09:32:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 10:34:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 11:21:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 11:47:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 12:36:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 13:42:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 14:30:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 14:48:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 14:53:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 16:28:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 17:52:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 18:18:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 18:28:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 18:35:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 18:39:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 18:44:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 19:22:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 19:26:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 19:27:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 19:30:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 19:39:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 19:48:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 19:53:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 19:56:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 20:01:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 20:30:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 20:38:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 21:03:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 21:38:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 21:39:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 21:39:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 21:41:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 22:04:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 22:32:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 23:22:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 23:28:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 23:33:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Fri Dec 13 23:47:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 00:43:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 02:03:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 02:06:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 05:21:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 08:28:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 09:26:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9938A1E736E 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 47Zhxm2Lb5z49fx 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: 47Zhxm2Lb5z49fx 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 10:53:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 10:58:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 13:30:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 13:32:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 13:37:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 14:56:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 17:26:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3DBA1D2B08 for ; Sat, 14 Dec 2019 17:26:42 +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 47ZvbQ3qKtz4Ymq for ; Sat, 14 Dec 2019 17:26:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (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 723F5ADBF for ; Sat, 14 Dec 2019 17:26:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f52.google.com with SMTP id t7so1040876qve.4 for ; Sat, 14 Dec 2019 09:26:42 -0800 (PST) X-Gm-Message-State: APjAAAV18MvVXAfUQibuWTFZTzpJVSrXg1J2oXE0kQH8GKiQeTzDw0ZY 6oJ29VQK/NgQKENKfyyp0DKJNw0TWvk9z3H+MEg= X-Received: by 2002:a05:6214:1645:: with SMTP id f5mt18414777qvw.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 17:26:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 18:20:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 19:22:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 19:28:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CF1F1D528A for ; Sat, 14 Dec 2019 19:28:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (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 47ZyHd0WbYz4flm for ; Sat, 14 Dec 2019 19:28:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id l12so2171929qtq.12 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=kgRnRgiqfQm4fQNG1fzRiUp3qPpnuKEDnTEyvpKXjMetNThPDo0Si+p76uLT/GNBPK UZ44AnoBIX6mz3iL+7aifViSCwS34+9y7/7M9CH/8GubjP3183BhhKDAmkqReozLOTmv 5VW9v1e6i0U8FulOKAKm6XWGGNB0/52YTFVXZ32TgLhV3ShbPX9uJiGaocdf92qTOziT rbbQV3EBt7fZbu5xsNZwVBtLU9Ko95WrKZCq/BlP4UVEziLBpj09c9rzHJb/Lbw5qEdh C+4iSX6Rc9PF+wvTH0tCy2LB/hRkzjdpvZjYZI9rYFWKpir4SCgIqrCfGNufPAGdUjhk Qe/Q== X-Gm-Message-State: APjAAAVJFsTHbq92WLjNJnF4X1bhrmOecNN5E6rVT2xdfAd3yOj6U8BT eVt+VWN4TsLw85L/9xIA/UIUDPl+AupihqtAVQIWOg== 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: 47ZyHd0WbYz4flm 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::82b) 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-head@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)[b.2.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 19:44:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 19:54:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 20:06:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DA0D1D605D for ; Sat, 14 Dec 2019 20:06:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) 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 47Zz873jHMz3DFv for ; Sat, 14 Dec 2019 20:06:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82a.google.com with SMTP id g17so983775qtp.11 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=C5u54ev3z08QZAina9TdUe8gpsU8EE9Vclg1qr6IyljemNowjLFvioHCCP3r8Zx3RF 80uU0v5EyXCQojWEF0jVhn2PPIujp31CzpcPBKI0PglWqZfzSEIzGPbNkaxyjDoZYmXZ RdjlcXVhrq2vTXrYCI7BwMMdNzgRu1/pilf0IiPeSJpFxj5VwJRhNd7e7nRN0l8BUxoY VkXTlu9+1rt8oiNQHYu4C01BKp2k6/KTW2R8Tsk3TOTH3G32MUSWsaz2IAKZRoX7lSn9 azxlggYLVccSukngpk8jKWnXHEwudRoDfBoLO/dhqqFvcbzZ2lelxeLvC0bWTPQfHu0n n7/Q== X-Gm-Message-State: APjAAAWw3u7YI131nkQLJ7281J+EQGizGQkzhHu6u4lSMti8BU9r7V2V G5BS8Lf7oMvMtb5nYYEOgDoWdKtyznBV71CEj5+ydQ== 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: 47Zz873jHMz3DFv 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::82a) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.71 / 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-head@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)[a.2.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.38), 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 21:49:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 21:52:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@freebsd.org Sat Dec 14 22:51:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 981DF1D8F49 for ; Sat, 14 Dec 2019 22:51:31 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic304-25.consmr.mail.gq1.yahoo.com (sonic304-25.consmr.mail.gq1.yahoo.com [98.137.68.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47b2p96b87z3Lyt for ; Sat, 14 Dec 2019 22:51:29 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: uSEwH3MVM1k6oQrlMOU5c25LNNVhOJZkQsYthXevv.LbV61KLSzczHTXm7fgEHJ mKadHKdIKTtYqZpeaZjAqEb1x_eSuVYqpoY89GvuZs141RYs_bTYy4DxJjeH2MILchbdSpx18JQR 9WH3xM_0OzufD481irXPotbFQ60suzR6uAN4wGm2ftX0zqzg6Uc3.PZgFnuBJki6tyU.GbPhlnJj 5I37xYnMd5L2Ulnjpfmg.6tkiwJnDKdqIwRFON1.ZlhIdg_MpRBjECfYY368KPYtzyBFil.F9HaK fYGH8f2ESYyM0WLewIVcSOP9c087YSo0NJCMHxTsK4NcuGxXQQzfWYSwheatXk9MwtcTnncNJFRt eFigfy39BPZ6Hp5GmwQNrbGrBmnBipgSHsQ62Ll4JLA3qtPh.FHSXu1eTVE0NE3pRn_6zWdG7C5_ 5vbcYUxZalf47PMAIDJB1SKEvvNudutMn9YfJDHdD6GwI4udhRaWdvAjVR3Al_T_4FulIlGu0RSz EcIrMtYOdgWr2n_hvcvwwm79_.bLu1cnJFucjnlUNdGVz_ImzPjE3bqva81HsudSqNfhLD0iFB7U Dz88CD5w0_Iey4q0salR381Q7KMLUu5GLGXKtsQ9p2UL6erzZ9oX1jyB5SOl7EsjEcQW15vATfkf gLRxtOvuBO50a33Qy4caMQpN5oSFjR9.3_wMLP0FNVhfnOwpEdZg5Q3iBSGPN9O51qCE1knaiiX. ccddtmpm8W0T1q7LpolI9VEPKIpdiPiSzYSdBp6aJcPfpmxVPSmcH3e_69tIjfsmT1z1OUzCKC3i Fp1udCkN1JjTlKi85rGKiObfO_TqLYa9s29KxsZKQ.yBAtFMXBULb83pEcnVHNkiPGwa5BdGkJn7 bh4e0EaMC9ZmqHQnJ7VoCQJNsEkZEtwGwMe7x7yRD4ood4Wy__aWWzN5x0laxq0ZQkUb3TVRD12f lkL_WN5CxPe5pNCc4wUacjMIZGg_9vitAz.x4nWnNLj3fIRhVDQ4Jb0T7QaUhkh5C921dtFaiUgF v5coMKbEyAkIFjgWoHaakyZwLluDWxbg_DRhqipIVAHxQtU0._Mo4s8KsSSVedG1Ph2wJBcACWZV DXGp39S1XH30u5n1517H2RsnK1DYMeFcYKjvz3l7MBItxGHKpj3zMwidHWkq6bbpAdwSSspAjOq. QnxlHYTStu7xcZRK5ZeMXXnrt1u7_VUZtfJ8dzzrbxaWPwbf4veq83v6S3KGos9IFQ29_Tp7Sl71 Ut_l4dtyZIuOlQj7Jsd37In84lwFlegREPo6Z.0H6AlsX0UZPYt3anIVl5sZqiDXr.ZCHyeg9A9M NLY6z4nVj26nZX4i2SgzfMSR4XAKOag9.qtQmX0G8EP0YoHcOhxkrd2rwqnXARtwnx7aNhMbjKRl SmB0uCP.xzNqNdZNb2eRNZAHlMfH2ZJc44.yc Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Sat, 14 Dec 2019 22:51:28 +0000 Received: by smtp421.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID ba27b898a179526ffb7a1d4bfc11a94a; Sat, 14 Dec 2019 22:51:23 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: Re: svn commit: r355759 - in head: include sys/sys Message-Id: Date: Sat, 14 Dec 2019 14:51:22 -0800 To: Conrad Meyer , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3608.40.2.2.4) References: X-Rspamd-Queue-Id: 47b2p96b87z3Lyt X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.15 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.79)[-0.786,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MIME_GOOD(-0.10)[text/plain]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-0.87)[-0.867,0]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[206.68.137.98.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.00)[ip: (3.71), ipnet: 98.137.64.0/21(0.89), asn: 36647(0.71), country: US(-0.05)]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 22:51:31 -0000 Now it is clang builds that are broken, at least ones that use: sys/compat/linuxkpi/common/include/linux/compiler.h An example from: https://ci.freebsd.org/job/FreeBSD-head-aarch64-build/14953/console is: 14:32:22 --- all_subdir_lindebugfs --- 14:32:22 In file included from = /usr/src/sys/compat/lindebugfs/lindebugfs.c:72: 14:32:22 In file included from = /usr/src/sys/compat/linuxkpi/common/include/linux/debugfs.h:33: 14:32:22 In file included from = /usr/src/sys/compat/linuxkpi/common/include/linux/fs.h:41: 14:32:22 In file included from = /usr/src/sys/compat/linuxkpi/common/include/linux/types.h:38: 14:32:22 = /usr/src/sys/compat/linuxkpi/common/include/linux/compiler.h:53:9: = error: '__deprecated' macro redefined [-Werror,-Wmacro-redefined] 14:32:22 #define __deprecated 14:32:22 ^ 14:32:22 /usr/src/sys/sys/cdefs.h:472:9: note: previous definition is = here 14:32:22 #define __deprecated(m) __attribute__((__deprecated__(m))) 14:32:22 ^ =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Sat Dec 14 23:39:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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